﻿var m_pntContext=null;function OnRightClickHandler(point,src,overlay){m_pntContext=m_map.fromDivPixelToLatLng(point);var eMenu=ID('divContextMenu');eMenu.style.display="";eMenu.style.left=ID('divMap').offsetLeft+point.x-10+"px";eMenu.style.top=point.y-10+"px";};function CopyText(sMessage){if(!document.all){alert('Your browsers does not support clipboard access. \n'+sMessage);return;};ID('taClipboard').innerText=sMessage;var copied=ID('taClipboard').createTextRange();copied.execCommand("Copy");alert("Copied to clipboard");};function OnVirtualEarthMap(){window.location="../Map/Default.aspx"+"?Long="+m_pntContext.lng()+"&Lati="+m_pntContext.lat()+"&Zoom="+GetMapZoom();};function OnEmailPoint(){var sBody=window.location.toString().split('?')[0];sBody+="?Long="+m_pntContext.lng();sBody+="&Lati="+m_pntContext.lat();sBody+="&Zoom="+GetMapZoom();sBody+="&Style="+GetMapType();window.location="mailto:?subject=Check out this location&body="+escape(sBody);ShowDiv('divContextMenu',false);};function OnNewEvent(bEvent){window.location="../Location/EventNew.aspx"+"?MapCreate="+"T"+"&Event="+bEvent+"&Street="+escape(ID('tbSearchStreet').value)+"&City="+escape(ID('tbSearchCity').value)+"&State="+escape(ID('tbSearchState').value)+"&Country="+escape(ID('tbSearchCountry').value)+"&Longitude="+m_pntContext.lng()+"&Latitude="+m_pntContext.lat();};﻿var m_httpReqEvent=null;var m_lyrEvents=null;var m_nIDPinMouseOver=8000;function OnEventSearch(sIDDropList){var tNow=new Date();m_lyrEvents=CreateLayer(m_lyrEvents);m_httpReqEvent=SetupHttpRequest("xml",OnGotEventData);ShowDiv('m_ucBtnEventSearch',false);ID('divEventResults').innerHTML="Please wait. Loading ......";var bound=GetMapBounds();IssueRequest(m_httpReqEvent,"RequestProcess.aspx","Events="+"true"+"&Activity="+GetDropListItem(ID(sIDDropList))+"&ViewTL="+bound.getNorthEast().lat()+","+bound.getSouthWest().lng()+"&ViewBR="+bound.getSouthWest().lat()+","+bound.getNorthEast().lng()+"&Time="+tNow.getTime()+"&UtcOffset="+tNow.getTimezoneOffset());};function OnGotEventData(){if(m_httpReqEvent==null)return;if(m_httpReqEvent.readyState!=4)return;ShowDiv('m_ucBtnEventSearch',true);ID('divEventResults').innerHTML="";if(m_httpReqEvent.status!=200){alert('There was a problem reading the event data from the server. \nRequest status '+m_httpReqEvent.status);return;};var xmlDoc=m_httpReqEvent.responseXML;var xError=xmlDoc.documentElement.getElementsByTagName("Error");if(xError.length>0){alert(xError[0].firstChild.data);return;};try{var sPntList="";var aryPnts=new Array();var xEvents=xmlDoc.documentElement.getElementsByTagName("E");for(var n=0;n<xEvents.length;n++){var nID=xEvents[n].getAttribute("id");var sTitle=xEvents[n].getAttribute("t");var sWhen=xEvents[n].getAttribute("w");var dLongitude=parseFloat(xEvents[n].getAttribute("x"));var dLatitude=parseFloat(xEvents[n].getAttribute("y"));var sType=xEvents[n].getAttribute("ty");var sImg="<img src='Images/Mark_"+sType+"_S.gif' height='12px' width='12px' align='middle' /> ";var sDesc="";if(sType=="E")sDesc+=sWhen+"<br/>";sDesc+="<a class='MapPop' href='../Location/EventView.aspx?ID="+nID+"'>";if(sType=="E")sDesc+="Event";else sDesc+="Location";sDesc+=" details</a><br/>";sDesc+="<a class='MapPop' href='../Location/EventNew.aspx?CopyLocn=true&Edit=true&ID="+nID+"'>";sDesc+="Create a new event, ride or gathering at this point</a><br/>";var pnt=new GLatLng(dLatitude,dLongitude);AddPointToCluster(aryPnts,pnt,sImg+sTitle,sDesc,sType);sPntList+=MakeSidePointListEvent(sImg+sTitle,dLongitude,dLatitude);};for(var nMark=0;nMark<aryPnts.length;nMark++){var clust=aryPnts[nMark];PlacePin(0,clust.m_pnt.lat(),clust.m_pnt.lng(),clust.m_sType,clust.m_sTitle,clust.m_sDesc);};var sFullText="<br/><strong>Matches</strong><br/>";sFullText+="Hover over each match to see it highlighted on the map. Or click on it to centre and zoom on it's location.<hr/>";sFullText+=sPntList;ID("divEventResults").innerHTML=sFullText;}catch(e){alert("Problem in OnGotEventData(). Error name: "+e.name+". Error message: "+e.message);};m_httpReqEvent=null;};function GetDropListItem(eList){return eList.options[eList.selectedIndex].value;};function MakeSidePointListEvent(sTitle,dLong,dLati){var sHtml="<div class='JrSidePnt' ";sHtml+=" onmouseover='OnSidePntMouseover(this,"+dLong+","+dLati+")'";sHtml+=" onmouseout='OnSidePntMouseout(this)' ";sHtml+=" onclick='OnSidePntClick("+dLati+","+dLong+")' >";sHtml+=sTitle;sHtml+=" ";sHtml+="</div>";return sHtml;};function OnSidePntMouseover(eSender,dLong,dLati){eSender.style.backgroundColor='#8888ff';};function OnSidePntMouseout(eSender){eSender.style.backgroundColor='#000066';};function OnSidePntClick(dLati,dLong){SetCentreZoom(dLati,dLong,15);};﻿function OnGetMap(){try{if(!SetupMapAndControls())return false;LoadAddressSearchCookies();}catch(e){alert("Problem loading map.\nError name: "+e.name+". Error message: "+e.message);};window.onresize=OnDefaultWindowResize;OnDefaultWindowResize();StartupViewRestore();if(GetParam("Long")!=null){OnShowMarker("",GetParam("Long"),GetParam("Lati"));if(GetParam("Zoom")!=null)SetMapZoom(GetParam("Zoom"));if(GetParam("Style")!=null)SetMapStyle(GetParam("Style"));return true;};if(window.location.hostname=="dirtbike.domysport.com"){OnPageEvents();EventSearch();};return true;};function HideAll(){ID("divPageSearch").style.display="none";ID("divPageEvents").style.display="none";ID("divPageUsers").style.display="none";ID("divPageTools").style.display="none";ID("divContextMenu").style.display="none";};function OnGoHome(){window.location='../Default.aspx';};function OnPageSearch(){if(!RestoreSideBar())return;HideAll();ID('divPageMarker').style.marginLeft=(10+1*50)+"px";ID("divPageSearch").style.display="";OnDefaultWindowResize();};function OnPageEvents(){if(!RestoreSideBar())return;HideAll();ID('divPageMarker').style.marginLeft=(10+2*50)+"px";ID("divPageEvents").style.display="";OnDefaultWindowResize();};function OnPageUsers(){if(!RestoreSideBar())return;HideAll();ID('divPageMarker').style.marginLeft=(10+3*50)+"px";ID("divPageUsers").style.display="";OnDefaultWindowResize();OnUserSearch();};function OnPageTools(){if(!RestoreSideBar())return;HideAll();ID('divPageMarker').style.marginLeft=(10+4*50)+"px";ID("divPageTools").style.display="";OnDefaultWindowResize();};﻿var m_map=null;var m_geocoder=null;var m_nMapLeft=285;var m_nMinPageW=640;var m_nMinPageH=480;var m_markInfoCurrent=null;var m_iconAddr=null;var m_iconHover=null;var m_iconLocn=null;var m_iconEvent=null;var m_iconGroup=null;var m_iconWatch=null;function ID(sID){return document.getElementById(sID);};function OnMenuOver(sender){sender.style.backgroundColor='DarkGray';return false;};function OnMenuOut(sender){sender.style.backgroundColor='#000066';return false;};function SetupMapAndControls(){if(!GBrowserIsCompatible()){alert('Unfortunatly your web browser is not supported. You will not be able to use the mape display');return false;};m_map=new GMap2(ID("divMap"));m_map.enableScrollWheelZoom();m_map.addControl(new GLargeMapControl());m_map.addControl(new GMapTypeControl());m_map.addControl(new GScaleControl());m_map.addControl(new GOverviewMapControl());m_geocoder=new GClientGeocoder();m_map.setCenter(new GLatLng(37.4419,-122.1419),13);m_iconAddr=new GIcon(G_DEFAULT_ICON);m_iconHover=new GIcon(G_DEFAULT_ICON);m_iconLocn=new GIcon(G_DEFAULT_ICON);m_iconEvent=new GIcon(G_DEFAULT_ICON);m_iconGroup=new GIcon(G_DEFAULT_ICON);m_iconWatch=new GIcon(G_DEFAULT_ICON);m_iconAddr.image="Images/MarkSearch_L.png";m_iconHover.image="Images/MarkListSelect.gif";m_iconLocn.image="Images/Mark_L_L.png";m_iconEvent.image="Images/Mark_E_L.png";m_iconGroup.image="Images/Mark_M_L.png";m_iconWatch.image="Images/Mark_W_L.png";GEvent.addListener(m_map,"singlerightclick",OnRightClickHandler);return true;};function StartupViewRestore(){if(!OnRestoreSavedView()){var sParts=ID('divCountry').innerHTML.split(',');if(sParts.length==3){SetCentreZoom(sParts[1],sParts[0],sParts[2]);}else{OnRestoreSystemDefaultView();}}};function OnDefaultWindowResize(){var nPageW=SetMapLeft(m_nMapLeft);var nPageH=Height();if(nPageW==m_nMinPageW||nPageH==m_nMinPageH)ID("bodyMain").scroll="yes";else ID("bodyMain").scroll="no";ID("divSideBody").style.height=(nPageH-0)+"px";SetListBoxHeight("divSearchResults",nPageH);SetListBoxHeight("divEventResults",nPageH);SetListBoxHeight("divUserResults",nPageH);};function OnDisposeMap(){if(m_map!=null)m_map.Dispose();};function SetMapLeft(nLeft){m_nMapLeft=nLeft;ID("divMap").style.left=m_nMapLeft+"px";var nPageW=Width();eMap=ID('divMap');eMap.style.width=nPageW-m_nMapLeft+"px";eMap.style.height=Height()+"px";m_map.checkResize();return nPageW;};function SetupHttpRequest(type,onReadyStateChange){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/'+type);}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){alert('Cannot create XMLHTTP instance');return null;}}};http_request.onreadystatechange=onReadyStateChange;return http_request;};function IssueRequest(httpReq,url,parameters){httpReq.open('GET',url+"?"+parameters,true);httpReq.send(null);};function DeletePushPin(nPinId){try{m_map.DeletePushpin(nPinId);}catch(e){}};function PlaceAndCentreMarker(nPinID,dLati,dLong,sTitle,sDetail){DeletePushPin(nPinID);SetCentreZoom(dLati,dLong,15);PlacePin(nPinID,dLati,dLong,"A",sTitle,sDetail);};function PlacePin(nPinID,dLati,dLong,sImage,sTitle,sDetail){ClearMarkerInfo();var icon=null;switch(sImage){case "A":icon=m_iconAddr;break;case "H":icon=m_iconHover;break;case "L":icon=m_iconLocn;break;case "E":icon=m_iconEvent;break;case "M":icon=m_iconGroup;break;case "W":icon=m_iconWatch;break;default:alert("Unknow marker type "+sImage);};var pnt=new GLatLng(dLati,dLong);var marker=new GMarker(pnt,{icon:icon,clickable:true,draggable:true});GEvent.addListener(marker,'mouseover',function(){OnMarkerClick(marker,'<b>'+sTitle+'</b></br>'+sDetail);});m_map.addOverlay(marker);};function OnMarkerClick(marker,sHtml){ClearMarkerInfo(marker);marker.openInfoWindowHtml("<div style='height:150px; overflow:scroll; margin-top:0px; margin-right:0px;'>"+sHtml+"</div>",{maxWidth:100});m_markInfoCurrent=marker;};function ClearMarkerInfo(marker){if(m_markInfoCurrent!=null){if(m_markInfoCurrent!=marker){m_markInfoCurrent.closeInfoWindow();m_markInfoCurrent=null;}}};function CreateLayer(lyrOld){m_map.clearOverlays();return;if(lyrOld!=null)m_map.DeleteShapeLayer(lyrOld);var layer=new VEShapeLayer();m_map.AddShapeLayer(layer);return layer;};function trim(str){return str.replace(/^\s*|\s*$/g,"");};function GetCookie(sCookieName){var sCookieString=""+document.cookie;var nNameStart=sCookieString.indexOf(sCookieName);if(nNameStart==-1||sCookieName=="")return "";var nNameEnd=nNameStart+sCookieName.length+1;var nValueEnd=sCookieString.indexOf(';',nNameStart);if(nValueEnd==-1)nValueEnd=sCookieString.length;if(nNameEnd>=nValueEnd)return "";return unescape(sCookieString.substring(nNameEnd,nValueEnd));};function SetCookie(sName,value,nDays){var sCookieString=sName+"="+escape(value)+";EXPIRES="+GetExpiryDate(nDays);document.cookie=sCookieString;return GetCookie(name);};function GetExpiryDate(nDays){var UTCstring;Today=new Date();nomilli=Date.parse(Today);Today.setTime(nomilli+nDays*24*60*60*1000);UTCstring=Today.toUTCString();return UTCstring;};function Width(){var x;if(self.innerHeight){x=self.innerWidth;}else if(document.documentElement&&document.documentElement.clientHeight){x=document.documentElement.clientWidth;}else if(document.body){x=document.body.clientWidth;};if(x<m_nMinPageW)x=m_nMinPageW;return x;};function Height(){var y;if(self.innerHeight){y=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){y=document.documentElement.clientHeight;}else if(document.body){y=document.body.clientHeight;};if(y<m_nMinPageH)y=m_nMinPageH;return y;};function GetParam(sName){if(document.location.search=="")return null;var sParams=document.location.search.substring(1);var sFields=sParams.split('&');for(n=0;n<sFields.length;n++){var sParts=sFields[n].split('=');if(sParts[0]==sName)return sParts[1];};return null;};function OnSaveCurrentView(){SetCookie("Scale",GetMapZoom(),365);SetCookie("Type",GetMapType(),365);SetCookie("Longitude",GetCenter().lng(),365);SetCookie("Latitude",GetCenter().lat(),365);alert("Saved.");};function OnRestoreSavedView(){var sScale=GetCookie("Scale");var sLong=GetCookie("Longitude");var sLati=GetCookie("Latitude");var sType=GetCookie("Type");if(sLong!=""&&sLati!=""&&sScale!=""&&sType!=""){SetCentreZoom(sLati,sLong,sScale);SetMapType(sType);return true;};return false;};function OnShowDisplayDetails(){alert("Scale : "+GetMapZoom()+"\nLongitude : "+GetCenter().lng()+"\nLatitude : "+GetCenter().lat());};function OnRestoreSystemDefaultView(){SetMapType(G_NORMAL_MAP.getName());SetCentreZoom(-26.58,134.64,4);};function SetCentreZoom(sLati,sLong,sScale){var pnt=new GLatLng(parseFloat(sLati),parseFloat(sLong));m_map.setCenter(pnt,parseFloat(sScale));};function ShowDiv(sID,bShow){ID(sID).style.display=bShow?"":"none";};function AttachMapEvent(sName,fnName){m_map.AttachEvent(sName,fnName);};function ToLatLong(pixel){return m_map.PixelToLatLong(pixel);};function SetBounds(pntLow,pntHi){var pntCen=new GLatLng((pntLow.lat()+pntHi.lat())/2,(pntLow.lng()+pntHi.lng())/2);m_map.setCenter(pntCen,19);for(n=19;n>0;n--){SetMapZoom(n);if(GetMapBounds().containsLatLng(pntLow)&&GetMapBounds().containsLatLng(pntHi))return;}};function SetMapType(sName){var aryTypes=m_map.getMapTypes();for(n=0;n<aryTypes.length;n++){var type=aryTypes[n];if(type.getName()==sName){m_map.setMapType(type);return;}};alert("Unknown map type : "+sName);};function GetMapZoom(){return m_map.getZoom();};function GetMapType(){return m_map.getCurrentMapType().getName();};function GetMapBounds(){return m_map.getBounds();};function GetCenter(){return m_map.getCenter();};function SetMapZoom(v){m_map.setZoom(parseInt(v));};function MapAddPin(p){m_map.AddPushpin(p);};﻿var m_nGrower=-1;function RestoreSideBar(){if(m_nGrower!=-1)return false;ControlGrow(true);return true;};function OnGrow(nLimit,bExpand){var nW=ID('divSideBody').offsetWidth;var nNewW=nW;if(bExpand)nNewW+=20;else nNewW-=20;if((bExpand&&nNewW<nLimit)||(!bExpand&&nNewW>nLimit)){SetSideWidth(nNewW,false);if(nW!=ID('divSideBody').offsetWidth)return;alert(nW+' to '+ID('divSideBody').offsetWidth);return;};SetSideWidth(nLimit,true);clearInterval(m_nGrower);m_nGrower=-1;if(bExpand){ShowDiv('imgLogoFull',true);ID('divMenuBtns').style.marginLeft="0px";ID('divBtnClose').style.visibility="visible";ShowDiv('divSideInner',true);SetMapLeft(nLimit+20);}else{ID('divBtnOpen').style.visibility="visible";}};function SetSideWidth(nWidth,bShowScrollbar){ID('divSideBody').style.width=nWidth+"px";};function ControlGrow(bExpand){var nLimit=0;ID('divBtnOpen').style.visibility="hidden";ID('divBtnClose').style.visibility="hidden";if(bExpand){nLimit=265;}else{nLimit=76;ShowDiv('imgLogoFull',false);ID('divMenuBtns').style.marginLeft="10px";ShowDiv('divSideInner',false);SetMapLeft(nLimit+20);};m_nGrower=setInterval("OnGrow( "+nLimit+", "+bExpand+" )",25);};function OnCloseDiv(sDiv){ShowDiv(sDiv,false);};function SetListBoxHeight(sID,nPageH){var eList=ID(sID);eList.style.height=(nPageH-eList.offsetTop)+"px";};﻿var m_pinIDMarker=1000;var m_nIDPinMouseOver=1500;var m_pinOffender1=2000;var m_pinOffenderLast=0;var m_dSearchLong=null;var m_dSearchLati=null;function LoadAddressSearchCookies(cbPageFilter){if(GetParam("Street")!=null){ID('tbSearchStreet').value=unescape(GetParam("Street"));ID('tbSearchCity').value=unescape(GetParam("City"));ID('tbSearchState').value=unescape(GetParam("State"));ID('tbSearchCountry').value=unescape(GetParam("Country"));}else{LoadValueCookie('tbSearchStreet');LoadValueCookie('tbSearchCity');LoadValueCookie('tbSearchState');LoadValueCookie('tbSearchCountry');}};function OnAddressSearch(){DeletePushPin(m_pinIDMarker);var sAddr="";sAddr=AddStreetPart(sAddr,'tbSearchStreet');sAddr=AddStreetPart(sAddr,'tbSearchCity');sAddr=AddStreetPart(sAddr,'tbSearchState');sAddr=AddStreetPart(sAddr,'tbSearchCountry');OnFindDetail(sAddr);};function AddStreetPart(sAddr,sPartName){var sPart=ID(sPartName).value;SetCookie(sPartName,sPart,365);if(sPart=="")return sAddr;if(sAddr=="")return sPart;return sAddr+","+sPart;};function OnFindDetail(sWhere){ID('divSearchResults').innerHTML="";try{m_map.clearOverlays();m_geocoder.getLocations(sWhere,OnFindCallback);ShowDiv('m_ucBtnSearch',false);ID('divSearchResults').innerHTML="Searching. Please wait .....";}catch(e){alert(e.message);}};function OnFindCallback(response){ShowDiv('m_ucBtnSearch',true);if(response.Status.code==G_GEO_UNKNOWN_ADDRESS){ID('divSearchResults').innerHTML="No address found!";return;};if(response.Status.code==G_GEO_TOO_MANY_QUERIES){ID('divSearchResults').innerHTML="This site is uses a free service from Google and is over its searches limit for today! Please try again tomorrow.";return;};if(!response||response.Status.code!=200){alert("Sorry, we were unable to geocode that address. Code "+response.Status.code);return;};var results="";for(n=0;n<response.Placemark.length;n++){var pl=response.Placemark[n];var sName=pl.address;results+="<img src='Images/MarkSearch_S.gif' width='12px' height='15px' style='vertical-align:middle;'/> <a href='javascript:OnShowMarker(\""+sName+"\",\""+pl.Point.coordinates[0]+"\",\""+pl.Point.coordinates[1]+"\");'>"+sName+"</a><br>";if(n==0)OnShowMarker(sName,pl.Point.coordinates[0],pl.Point.coordinates[1]);};ID('divSearchResults').innerHTML=results;};function LoadValueCookie(sItemName){ID(sItemName).value=GetCookie(sItemName);};function OnShowMarker(sName,dLong,dLati){PlaceAndCentreMarker(m_pinIDMarker,dLati,dLong,"Address match",sName);};﻿var m_httpReqUser=null;var m_lyrUsers=null;function OnUserSearch(){if(m_httpReqUser!=null)return;if(ID('divUserLoggedOut')!=null)return;var tNow=new Date();m_lyrUsers=CreateLayer(m_lyrUsers);m_httpReqUser=SetupHttpRequest("xml",OnGotUserData);IssueRequest(m_httpReqUser,"RequestProcess.aspx","User="+"true"+"&Time="+tNow.getTime()+"&UtcOffset="+tNow.getTimezoneOffset());};function OnGotUserData(){if(m_httpReqUser==null)return;if(m_httpReqUser.readyState!=4)return;ID('divUserResults').innerHTML="";if(m_httpReqUser.status!=200){DisplayUserReqError('There was a problem reading user location data from the server. \nRequest status '+m_httpReqUser.status);return;};var xmlDoc=m_httpReqUser.responseXML;var xError=xmlDoc.documentElement.getElementsByTagName("Error");if(xError.length>0){DisplayUserReqError(xError[0].firstChild.data);return;};try{var xLimits=xmlDoc.documentElement.getElementsByTagName("LIMITS");SetBounds(new GLatLng(parseFloat(xLimits[0].getAttribute("LatiMin")),parseFloat(xLimits[0].getAttribute("LongMin"))),new GLatLng(parseFloat(xLimits[0].getAttribute("LatiMax")),parseFloat(xLimits[0].getAttribute("LongMax"))));var sPntList="";var aryPnts=new Array();var xUsers=xmlDoc.documentElement.getElementsByTagName("U");for(var n=0;n<xUsers.length;n++){var nID=xUsers[n].getAttribute("id");var sTitle=xUsers[n].getAttribute("n");var nRange=xUsers[n].getAttribute("r");var sType=xUsers[n].getAttribute("t");var dLongitude=parseFloat(xUsers[n].getAttribute("x"));var dLatitude=parseFloat(xUsers[n].getAttribute("y"));var sImg="<img src='Images/Mark_"+sType+"_S.gif' height='12px' width='12px' align='middle' /> ";var sDesc="";if(sType=="W"){sDesc+="<a class='MapPop' href='../User/Watch/WatchEdit.aspx?Edit=true&ID="+nID+"'>";sDesc+="Favourite watch details</a><br/>";}else{sDesc+="<a class='MapPop' href='../Location/EventView.aspx?ID="+nID+"'>";if(sType=="E")sDesc+="Event";else sDesc+="Shared location";sDesc+=" detail</a><br/>";sDesc+="<a class='MapPop' href='../Location/EventNew.aspx?CopyLocn=true&Edit=true&ID="+nID+"'>";sDesc+="Create a new event, ride or gathering at this point</a><br/>";};var pnt=new GLatLng(dLatitude,dLongitude);AddPointToCluster(aryPnts,pnt,sImg+sTitle,sDesc,sType);sPntList+=MakeSidePointListEvent(sImg+sTitle,dLongitude,dLatitude);};for(var nMark=0;nMark<aryPnts.length;nMark++){var clust=aryPnts[nMark];PlacePin(0,clust.m_pnt.lat(),clust.m_pnt.lng(),clust.m_sType,clust.m_sTitle,clust.m_sDesc);};ID("divUserResults").innerHTML=sPntList;}catch(e){DisplayUserReqError("Problem in User data read. Error name: "+e.name+". Error message: "+e.message);};m_httpReqUser=null;};function DisplayUserReqError(sMsg){alert(sMsg);ID('divUserResults').innerHTML=sMsg;};function Cluster(pnt,sTitle,sDesc,sType,nCount){this.m_pnt=pnt;this.m_sTitle=sTitle;this.m_sDesc=sDesc;this.m_sType=sType;this.m_nCount=nCount;};function AddPointToCluster(aryPnts,pnt,sTitle,sDesc,sType){for(var nChk=0;nChk<aryPnts.length;nChk++){if(aryPnts[nChk].m_pnt.toString()==pnt.toString()){var cMatch=aryPnts[nChk];if(cMatch.m_nCount==1)cMatch.m_sDesc="<br/><strong>"+cMatch.m_sTitle+"</strong><br/>"+cMatch.m_sDesc;cMatch.m_sDesc+="<hr/>";cMatch.m_sDesc+="<strong>"+sTitle+"</strong><br/>";cMatch.m_sDesc+=sDesc;if(cMatch.m_sType!=sType)cMatch.m_sType="M";cMatch.m_nCount++;cMatch.m_sTitle=cMatch.m_nCount+" matches at this location";return;}};aryPnts.push(new Cluster(pnt,sTitle,sDesc,sType,1));};


