var lista=new Array();var ListOfLon=new Array();var ListOfLat=new Array();var ListOfPlaces=new Array();var ListOfPlacesCode=new Array();var ListOfCountriesCode=new Array();var ListOfLocationCity=new Array();var ListOfPopulations=new Array();var ListOfZoom=new Array();var ListOfDetails=new Array();var ListOfCountriesName=new Array();var RouteList=new Array();var RouteSearchAddress=new Array();var MapLinkPath=new Array(3);MapLinkPath[0]="world";var MapLinkGlobalLat=new Array(3);var MapLinkGlobalLon=new Array(3);var MapLinkGlobalZoom=new Array(3);var MapLinkPathWhich=0;var RouteListCount=0;var RouteKey=0;var strRouteName="";var TotalDistance=0;var Quantity=0;var DetailPosition=0;var ChoosingList="";var MapVisibility=false;var ContinentMap="";var TypeMap="";var strOpacity="";MapLinkGlobalLat[0]=20.63;MapLinkGlobalLon[0]=4.92;MapLinkGlobalZoom[0]=2;var GlobalLat=20.63,GlobalLon=4.92,GlobalZoom=2;var goSelect1=null;var map=null;var popuplat;var popuplon;var startpt=null;var endpt=null;var InfoBoxOverValue=0;var TimerInfoBox;var TimerRouteDirections;var TimerLocation;var tick=0;var InfoBoxMaxHeight=90;var InfoBoxWidth=300;var RouteActivePage=1;var RouteDirectionsArray=new Array();var AllPointsCount;var GlobalSteps;var MaxGlobalWaitCycles=300;var GlobalWaitCycles;if(ie5==true){strOpacity="filter: alpha(opacity=60);"}if(ns6==true){strOpacity="opacity=.60;"}var screenW;var screenH;var Cookie_mapHistoryBackMembers="mapHistoryBackMembers";var appproxypath="";var SliderZoomValue=1;var shim;var shimInfoBox;var timerError;var WhichPage=0;var protocol_Map="";var requestedhost_Map="";function LoadMap(){var d=ReadCookie(Cookie_mapHistoryBackMembers);if((d!==null)&&(d.length>0)){try{EraseCookie(Cookie_mapHistoryBackMembers);var b=d.substr(0,d.indexOf("$"));var a=d.substr(d.indexOf("$")+1,d.length-d.indexOf("$"));TypeMap=a;ContinentMap=b;document.location="/waynmaps.html?wci=map&m="+ContinentMap+"&t="+TypeMap;return}catch(g){}}document.getElementById("myMap").innerHTML="Loading map, Please wait...";var c=document.getElementsByTagName("head")[0];var f=document.createElement("script");f.id="VEScript";f.type="text/javascript";f.src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6";try{c.appendChild(f)}catch(g){alert("The service is temporarily unavailable. Try again later.");return}DelayLoadMap()}function DelayLoadMap(){window.clearTimeout(timerError);try{var f=0;var d="Firefox/";var b=navigator.userAgent.indexOf(d);if(b!=-1){f=parseFloat(navigator.userAgent.substring(b+d.length))}if((f>=1.5)||(typeof(window.innerWidth)=="number")){try{Msn.Drawing.Graphic.CreateGraphic=function(h,e){return new Msn.Drawing.SVGGraphic(h,e)}}catch(g){timerError=setTimeout("DelayLoadMap()",1500);return}}document.getElementById("myMap").innerHTML="Loading map, Please wait...";try{map=new VEMap("myMap")}catch(g){document.getElementById("myMap").innerHTML="Loading map, Please wait...";timerError=setTimeout("DelayLoadMap()",1500);return}}catch(g){document.getElementById("myMap").innerHTML="Loading map, Please wait...";timerError=setTimeout("DelayLoadMap()",1500);return}var c=ReadCookie("MapLinkGlobalLat1");if((c!==null)&&(c.length>0)){MapLinkGlobalLat[1]=ReadCookie("MapLinkGlobalLat1");MapLinkGlobalLat[2]=ReadCookie("MapLinkGlobalLat2");MapLinkGlobalLat[3]=ReadCookie("MapLinkGlobalLat3");MapLinkGlobalLon[1]=ReadCookie("MapLinkGlobalLon1");MapLinkGlobalLon[2]=ReadCookie("MapLinkGlobalLon2");MapLinkGlobalLon[3]=ReadCookie("MapLinkGlobalLon3");MapLinkGlobalZoom[1]=ReadCookie("MapLinkGlobalZoom1");MapLinkGlobalZoom[2]=ReadCookie("MapLinkGlobalZoom2");MapLinkGlobalZoom[3]=ReadCookie("MapLinkGlobalZoom3");MapLinkPathWhich=ReadCookie("MapLinkPathWhich");MapLinkPath[1]=ReadCookie("MapLinkPath1");MapLinkPath[2]=ReadCookie("MapLinkPath2");MapLinkPath[3]=ReadCookie("MapLinkPath3");EraseCookie("MapLinkGlobalLat1");EraseCookie("MapLinkGlobalLat2");EraseCookie("MapLinkGlobalLat3");EraseCookie("MapLinkGlobalLon1");EraseCookie("MapLinkGlobalLon2");EraseCookie("MapLinkGlobalLon3");EraseCookie("MapLinkGlobalZoom1");EraseCookie("MapLinkGlobalZoom2");EraseCookie("MapLinkGlobalZoom3");EraseCookie("MapLinkPathWhich");EraseCookie("MapLinkPath1");EraseCookie("MapLinkPath2");EraseCookie("MapLinkPath3");GlobalLat=MapLinkGlobalLat[MapLinkPathWhich];GlobalLon=MapLinkGlobalLon[MapLinkPathWhich];GlobalZoom=MapLinkGlobalZoom[MapLinkPathWhich]}WhichPage=1;addShim();addShimInfoBox();try{map.LoadMap(new VELatLong(GlobalLat,GlobalLon),GlobalZoom,"r",false)}catch(g){}map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);var a=document.getElementById("myMapNavigMenu");map.AddControl(a);var a=document.getElementById("myMapNavigMenuPanel");map.AddControl(a);var a=document.getElementById("InfoBox");map.AddControl(a);var a=document.getElementById("InfoBoxClose");map.AddControl(a);ChangeZoomView();PutDetailsOnMap(TypeMap,ContinentMap);AttachNavigMenu();HideNavigMenu()}function Search(){InfoBoxOver(0);map.Find(null,document.getElementById("FullAddress").value,1,onFindResults)}function ShowLocation(b,c){var a=new VELatLong(b,c);map.PanToLatLong(a)}function updateSelect(a,b){goSelect1=b;getServerData(a)}function getServerData(b){goSelect1.disabled=true;document.body.style.cursor="wait";goSelect1.options[0]=new Option("Loading...","0");try{try{xmlhttp=new XMLHttpRequest()}catch(d){var a=new Array("MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");var f=false;for(var c=0;c<a.length&&!f;c++){try{xmlhttp=new ActiveXObject(a[c]);f=true}catch(d){}}if(!f){try{xmlhttp=new HTML_AJAX_IframeXHR()}catch(d){alert("Sorry. We are unable to load xml file. Please try again later.")}}}xmlhttp.open("GET","/waynfx.html?wci=cityget&type=xml&country="+b,"true");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var j=xmlhttp.responseXML.getElementsByTagName("state");if(j.length>0){goSelect1.options.length=0;goSelect1.options[0]=new Option("Select State/County","");for(var h=0;j[h];h++){var g=j[h].getAttribute("text");var e=j[h].getAttribute("value");goSelect1.options.length++;goSelect1.options[goSelect1.options.length-1]=new Option(g,e)}}else{goSelect1.options.length=0;goSelect1.options[0]=new Option("State/County Not Found",0)}document.body.style.cursor="auto";goSelect1.disabled=false;xmlhttp=null}else{goSelect1.options.length=0;goSelect1.options[0]=new Option("Loading in progress...","0")}};xmlhttp.send("")}catch(d){alert("Server is not available at this time to process your request.")}}function updateSelect2(){FillAdress()}function UpdateCoordination(h,b,c){try{var f=map.GetZoomLevel();var k=document.getElementById("country").value;var a=document.getElementById("state").value;try{xmlhttp=new XMLHttpRequest()}catch(g){var j=new Array("MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");var l=false;for(var d=0;d<j.length&&!l;d++){try{xmlhttp=new ActiveXObject(j[d]);l=true}catch(g){}}if(!l){try{xmlhttp=new HTML_AJAX_IframeXHR()}catch(g){alert("Sorry. We are unable to load xml file. Please try again later.")}}}xmlhttp.open("POST","/waynmaps.html?wci=updatecoord","true");xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var i=xmlhttp.responseXML.getElementsByTagName("operationstatus");var e=i[0].getAttribute("value");alert(e);xmlhttp=null}};xmlhttp.send("type=xml&country="+k+"&state="+a+"&lon="+b+"&lat="+h+"&town="+escape(c)+"&zoom="+f)}catch(g){alert("Server is not available at this time to process your request.")}}function PutDetailsOnMap(c,b){try{if(requestedhost_Map==""){if(requestedhost!=""){requestedhost_Map=requestedhost;protocol_Map=protocol}}}catch(d){}c=c.toLowerCase();b=b.toLowerCase();map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();CloseInfoBoxOver();ClosenoFriendsAlert();if(c.length>0){document.getElementById("btnquery").value=c}if((document.getElementById("btn-world"))!==null){document.getElementById("btn-reg").src=appproxypath+"maps/images/icoSmlNav01_off.gif";document.getElementById("btn-unreg").src=appproxypath+"maps/images/icoSmlNav02_off.gif";document.getElementById("btn-members").src=appproxypath+"maps/images/icoSmlNav03_off.gif";document.getElementById("btn-loc").src=appproxypath+"maps/images/icoSmlNav04_off.gif";document.getElementById("btn-world").src=appproxypath+"maps/images/icoSmlMap01_off.gif";document.getElementById("btn-eu").src=appproxypath+"maps/images/icoSmlMap02_off.gif";document.getElementById("btn-af").src=appproxypath+"maps/images/icoSmlMap03_off.gif";document.getElementById("btn-as").src=appproxypath+"maps/images/icoSmlMap04_off.gif";document.getElementById("btn-au").src=appproxypath+"maps/images/icoSmlMap05_off.gif";document.getElementById("btn-na").src=appproxypath+"maps/images/icoSmlMap06_off.gif";document.getElementById("btn-sa").src=appproxypath+"maps/images/icoSmlMap07_off.gif";if(c=="btn-reg"){document.getElementById(c).src=appproxypath+"maps/images/icoSmlNav01_on.gif"}if(c=="btn-unreg"){document.getElementById(c).src=appproxypath+"maps/images/icoSmlNav02_on.gif"}if(c=="btn-members"){document.getElementById(c).src=appproxypath+"maps/images/icoSmlNav03_on.gif"}if(c=="btn-loc"){document.getElementById(c).src=appproxypath+"maps/images/icoSmlNav04_on.gif"}if(b=="world"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap01_on.gif";document.getElementById("continent").value="World"}if(b=="eu"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap02_on.gif";document.getElementById("continent").value="Europe"}if(b=="af"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap03_on.gif";document.getElementById("continent").value="Africa"}if(b=="as"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap04_on.gif";document.getElementById("continent").value="Asia"}if(b=="au"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap05_on.gif";document.getElementById("continent").value="Australia"}if(b=="na"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap06_on.gif";document.getElementById("continent").value="North America"}if(b=="sa"){document.getElementById("btn-"+b).src=appproxypath+"maps/images/icoSmlMap07_on.gif";document.getElementById("continent").value="South America"}if(c.length>0){document.getElementById("btnquery").value=c;var a="";switch(c){case"btn-reg":document.getElementById("query").value="My friends on WAYN";break;case"btn-unreg":document.getElementById("query").value="Friends who haven't joined yet";break;case"btn-members":document.getElementById("query").value="All Members";break;case"btn-loc":document.getElementById("query").value="My Trips";break;default:document.getElementById("query").value=""}if(b.length>0){document.getElementById("btncontinent").value="btn-"+b}}document.getElementById("con1").href="javascript:ShowLocalizationContinents('world','"+c+"')";document.getElementById("con2").href="javascript:ShowLocalizationContinents('eu','"+c+"')";document.getElementById("con3").href="javascript:ShowLocalizationContinents('af','"+c+"')";document.getElementById("con4").href="javascript:ShowLocalizationContinents('as','"+c+"')";document.getElementById("con5").href="javascript:ShowLocalizationContinents('au','"+c+"')";document.getElementById("con6").href="javascript:ShowLocalizationContinents('na','"+c+"')";document.getElementById("con7").href="javascript:ShowLocalizationContinents('sa','"+c+"')"}getServerDataForMapPoints(c,b)}function getServerDataForMapPoints(k,d){try{var m="0";var a="";var c="";var b="";try{xmlhttp=new XMLHttpRequest()}catch(g){var j=new Array("MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");var l=false;for(var f=0;f<j.length&&!l;f++){try{xmlhttp=new ActiveXObject(j[f]);l=true}catch(g){}}if(!l){try{xmlhttp=new HTML_AJAX_IframeXHR()}catch(g){alert("Sorry. We are unable to load xml file. Please try again later.")}}}try{if(requestedhost_Map==""){if(requestedhost!=""){requestedhost_Map=requestedhost;protocol_Map=protocol}}}catch(g){}var h=protocol_Map+requestedhost_Map+"/waynmaps.html?wci=mapdetails&type=xml&mapcode="+d+"&maptype="+k;if(document.getElementById("MemberKey")!==null){h+="&MemberKey="+document.getElementById("MemberKey").value}xmlhttp.open("GET",h,"true");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var x=xmlhttp.responseXML.getElementsByTagName("mappoint");Quantity=0;if(x.length>0){for(var w=0;x[w];w++){var u=x[w].getAttribute("geo_lon");var A=x[w].getAttribute("geo_lat");var z=x[w].getAttribute("geo_zoom");var s=x[w].getAttribute("place");var q=x[w].getAttribute("PlaceCode");var p=x[w].getAttribute("countrycode");var o=x[w].getAttribute("countryname");var t=x[w].getAttribute("inCountry");var n=x[w].getAttribute("locationcity");var e=x[w].getAttribute("forename")+" "+x[w].getAttribute("surname");if(k=="btn-reg"){var v=e;e=AHrefOnDiv("/waynprofile.html?member_key="+x[w].getAttribute("contact_member_key")+"&ref_id=Y",v,"View user profile");e+="&nbsp;&nbsp;&nbsp;&nbsp;";e+=AHrefOnDiv(unescape("/waynmessages.html?wci=newmessage&member_key="+x[w].getAttribute("contact_member_key")+"&ref_id=Y"),"<img align='absmiddle' border='0' src='"+appproxypath+"maps/images/icodivemail.gif'>","title='Send Message'");e+="&nbsp;";e+=AHrefOnDiv(unescape("/waynprofile.html?member_key="+x[w].getAttribute("contact_member_key")+"&ref_id=Y"),"<img border='0' align='absmiddle' src='"+appproxypath+"maps/images/icodivprofile.gif'>","title='View user profile'");var y=x[w].getAttribute("member_telnum");if(y!==null){if(y.length>0){e+="&nbsp;";e+=AHrefOnDiv(unescape("/waynmessages.html?wci=newsms&contact_key="+x[w].getAttribute("contact_key")),"<img border='0' align='absmiddle' src='"+appproxypath+"maps/images/icodivsms.gif'>","title='Send SMS'")}}}if(k=="btn-unreg"){e+="&nbsp;&nbsp;&nbsp;&nbsp;";e+=AHrefOnDiv(unescape("/waynmessages.html?wci=newmessage&contact_key="+x[w].getAttribute("contact_member_key")+"&ref_id=Y"),"<img border='0' align='absmiddle' src='"+appproxypath+"maps/images/icodivemail.gif'>","title='Send Message'")}Quantity++;ListOfLon[Quantity]=u;ListOfLat[Quantity]=A;if(z>0){ListOfZoom[Quantity]=z}else{ListOfZoom[Quantity]=5}ListOfPlaces[Quantity]=s;ListOfPlacesCode[Quantity]=q;ListOfLocationCity[Quantity]=n;ListOfCountriesCode[Quantity]=p;ListOfCountriesName[Quantity]=o;ListOfPopulations[Quantity]=t;ListOfDetails[Quantity]=e}}else{getAlternativeServerDataForMapPoints(k,d);if(d!=="world"){return}}AddLocalizationsOnMap(k,d)}else{}};xmlhttp.send("")}catch(g){alert("Server is not available at this time to process your request.")}}function getAlternativeServerDataForMapPoints(c,a){if(MapLinkPathWhich>0){MapLinkPathWhich--;var b=MapLinkPath[MapLinkPathWhich];GlobalLat=MapLinkGlobalLat[MapLinkPathWhich];GlobalLon=MapLinkGlobalLon[MapLinkPathWhich];GlobalZoom=MapLinkGlobalZoom[MapLinkPathWhich];if(document.getElementById("btn1")!==null){document.getElementById("btn1").href="javascript:PutDetailsOnMap('btn-reg','"+b+"');"}if(document.getElementById("btn2")!==null){document.getElementById("btn2").href="javascript:PutDetailsOnMap('btn-unreg','"+b+"');"}if(document.getElementById("btn3")!==null){document.getElementById("btn3").href="javascript:PutDetailsOnMap('btn-members','"+b+"');"}if(document.getElementById("btn4")!==null){document.getElementById("btn4").href="javascript:PutDetailsOnMap('btn-loc','"+b+"');"}PutDetailsOnMap(c,b)}}function AddLocalizationsOnMap(x,q){x=x.toLowerCase();q=q.toLowerCase();var m=0;var h="";var u="";var p=0;strMapCode=q.substr(0,8);var C=new Array;for(var B=1;B<=Quantity;B++){var w="0";var j=ListOfLon[B];var n=ListOfLat[B];if((j.length<1)||(n.length<1)){j=GlobalLon;n=GlobalLat}var a=ListOfZoom[B];var z=ListOfPlaces[B];var v=NumberDelimiter(ListOfPopulations[B]);var G=ListOfPlacesCode[B];var d=ListOfCountriesCode[B];var s=ListOfLocationCity[B];var b=ListOfCountriesName[B];var D=ListOfDetails[B];if(q=="world"){w="1";u=AHrefOnDiv("javascript:ShowLocalizationContinents('"+B+"','"+x+"')",z,"");if(x=="btn-reg"||x=="btn-unreg"){h=""+v+" friends in "+z}else{if(x!=="btn-loc"){h="There are "+v+" member(s) in "+z}else{h=""+v+" trip(s) in "+z}}}else{if((q=="eu")||(q=="af")||(q=="na")||(q=="sa")||(q=="au")||(q=="ca")||(q=="as")){if(x=="btn-loc"){w="0";p++;var l=MakeTownBold(z);h+="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='top'><font style='color:#ffffff;'><b>"+p+"</b></font></td><td style='padding-left:5px;'>"+AHrefOnDiv("/wayntrips.html?wci=view&amp;location_key="+G+"",l,'title="'+z+'" target="_self" ')+"</td></tr></table>";if((B==Quantity)||(ListOfCountriesCode[B+1]!==d)){u="<img border='0' src=\""+appproxypath+"maps/flags/"+d+'.gif" border="0" >&nbsp;&nbsp;'+AHrefOnDiv("javascript:ShowLocalizationCountry("+B+")",b,"");w="1"}}else{if((x=="btn-reg")||(x=="btn-unreg")){w="0";p++;h+=p+"&nbsp;&nbsp;"+D+"<br>";if((B==Quantity)||(ListOfCountriesCode[B+1]!==d)){u="<img border='0' src=\""+appproxypath+"maps/flags/"+G+'.gif" border="0" >&nbsp;&nbsp;'+AHrefOnDiv("javascript:ShowLocalizationCountry("+B+")",z,"");w="1"}}else{w="1";u="<img border='0' src=\""+appproxypath+"maps/flags/"+d+'.gif" border="0" >&nbsp;&nbsp;'+AHrefOnDiv("javascript:ShowLocalizationCountry("+B+")",z,"");h="Population: "+v}}}else{if(strMapCode=="country:"){if(x=="btn-loc"){w="0";p++;var l=z;var F="/wayntrips.html?wci=view&amp;location_key="+G;var g=q+"$"+x;h+="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='top'><font style='color:#ffffff;'><b>"+p+"</b></font></td><td style='padding-left:5px;'>"+AHrefOnDiv("javascript:GoToLinkWithBack('"+F+"','"+g+"')",l,'title="'+z+'" target="_self" ')+"</td></tr></table>";if((B==Quantity)||(ListOfLocationCity[B+1]!==s)){u="<img border='0' src=\""+appproxypath+"maps/flags/"+d+'.gif" border="0" >&nbsp;&nbsp;'+b;w="1"}}else{if((x=="btn-reg")||(x=="btn-unreg")){w="0";p++;h+=p+"&nbsp;&nbsp;"+D;if((B==Quantity)||(ListOfPlacesCode[B+1]!==G)){u="<img border='0' src=\""+appproxypath+"maps/flags/"+d+'.gif" border="0" >&nbsp;&nbsp;';if((ListOfLat[B].length>0)&&(ListOfLon[B].length>0)){u+=b+", "+z}else{h+=" ("+z+")";u+=b}w="1"}h+="<br>"}else{w="1";var F="/wayn.html?wci=sitesearch&wce=create&type=full&search_gender=Any&submittype=full_search&search_nationality=0&search_age=0&search_homelocation="+d+"&search_homecity="+G;var g=q+"$"+x;u="<img border='0' src=\""+appproxypath+"maps/flags/"+d+'.gif" border="0" >&nbsp;&nbsp;'+AHrefOnDiv("javascript:GoToLinkWithBack('"+F+"','"+g+"')",b+", "+z,"");h="Population: "+v}}}else{}}}if(w=="1"){m++;var k=new VELatLong(n,j);var o=new VEPushpin(m,k,"/maps/images/icoMapFlagGreen.gif",u,h);C.push(k);map.AddPushpin(o);var c=document.getElementById(m);c.onclick=MapEventHandlerOnClick;h="";u="";p=0}}if(Quantity>0){if(q=="world"){GlobalLat=20.63,GlobalLon=4.92,GlobalZoom=2}var f=new VELatLong(GlobalLat,GlobalLon);if(parseInt(document.getElementById("myMap").style.width)<500){map.SetCenterAndZoom(f,GlobalZoom-1)}else{map.SetCenterAndZoom(f,GlobalZoom)}if(GlobalZoom<0){GlobalZoom=0;map.SetCenterAndZoom(f,GlobalZoom)}ChangeZoomView();VEPushpin.ShowDetailOnMouseOver=false;VEPushpin.OnMouseOverCallback=function(J,M,L,K){window.parent.document.getElementById("InfoBox").display="none";tick=80;document.getElementById("myobject").innerHTML=L;var i=unescape(L);if(i.length>0){i="<strong>"+i+"</strong><br>"}if((q=="world")||((q!=="world")&&(x=="btn-members"))){window.parent.document.getElementById("InfoBox").style.height=25;window.parent.document.getElementById("InfoBox").style.width=250;window.parent.document.getElementById("InfoBox").style.overflow="visible"}else{window.parent.document.getElementById("InfoBox").style.height=InfoBoxMaxHeight;window.parent.document.getElementById("InfoBox").style.width=InfoBoxWidth;window.parent.document.getElementById("InfoBox").style.overflow="auto"}window.parent.document.getElementById("InfoBox").innerHTML=i+K;var e=parseFloat(window.parent.document.getElementById("InfoBox").style.height);if(e>InfoBoxMaxHeight){e=InfoBoxMaxHeight}window.parent.document.getElementById("InfoBox").style.top=M-(e/2)-10;window.parent.document.getElementById("InfoBox").style.left=J+15;InfoBoxOver(1)}}else{if(WhichPage==3){return}var I="";if(q.indexOf("country")<0){switch(q){case"au":I="Australia";break;case"as":I="Asia";break;case"af":I="Africa";break;case"eu":I="Europe";break;case"sa":I="South America";break;case"na":I="North America";break;case"world":I="World";break}if(q=="world"){if(x=="btn-loc"){I="You don't have any trips"}else{if(x=="btn-members"){I="There are currently no members"}else{if(x=="btn-reg"){I="You currently don't have any friends"}else{if(x=="btn-unreg"){I="No location information is available"}}}}}else{if(x=="btn-loc"){I="You don't have any trips in "+I}else{if(x=="btn-members"){I="There are currently no members in "+I}else{if(x=="btn-reg"){I="You currently don't have any friends in "+I}else{if(x=="btn-unreg"){I="No location information is available"}}}}}var t=map.GetLeft();var y=map.GetTop();var A=0;var H=0;try{A=parseInt(document.getElementById("myMap").style.width);A=A-parseInt(document.getElementById("noFriendsAlert").style.width);A=Math.floor(A/2)}catch(E){}try{H=parseInt(document.getElementById("myMap").style.height);H=H-parseInt(document.getElementById("noFriendsAlert").style.height);H=Math.floor(H/2)}catch(E){}document.getElementById("noFriendsAlert").style.left=t+A;document.getElementById("noFriendsAlert").style.top=y+H;document.getElementById("noFriendsAlertTitle").innerHTML=I;document.getElementById("noFriendsAlert").style.display=""}}}function ClosenoFriendsAlert(){if(document.getElementById("noFriendsAlert")!==null){document.getElementById("noFriendsAlert").style.display="none"}}function MapEventHandlerOnClick(e){var strLocation=unescape(document.getElementById("myobject").innerHTML);var strTemp=strLocation.substr(strLocation.indexOf('href="')+6,strLocation.length);strLocation=strTemp;strTemp=strLocation.substr(0,strLocation.indexOf('"'));if(strTemp.indexOf("waynmaps.htm")==0){document.location=strTemp}else{if(strTemp.indexOf("javascript:")==0){strLocation=strTemp;strTemp=strLocation.substr(11,strLocation.length);eval(strTemp)}}}function GoToLinkWithBack(h,b){var g=new Date();var c=g.getTime()+20*(60*1000);var a=new Date();a.setTime(c);try{CreateCookie(Cookie_mapHistoryBackMembers,b,a.toGMTString());CreateCookie("MapLinkGlobalLat1",MapLinkGlobalLat[1],a.toGMTString());CreateCookie("MapLinkGlobalLat2",MapLinkGlobalLat[2],a.toGMTString());CreateCookie("MapLinkGlobalLat3",MapLinkGlobalLat[3],a.toGMTString());CreateCookie("MapLinkGlobalLon1",MapLinkGlobalLon[1],a.toGMTString());CreateCookie("MapLinkGlobalLon2",MapLinkGlobalLon[2],a.toGMTString());CreateCookie("MapLinkGlobalLon3",MapLinkGlobalLon[3],a.toGMTString());CreateCookie("MapLinkGlobalZoom1",MapLinkGlobalZoom[1],a.toGMTString());CreateCookie("MapLinkGlobalZoom2",MapLinkGlobalZoom[2],a.toGMTString());CreateCookie("MapLinkGlobalZoom3",MapLinkGlobalZoom[3],a.toGMTString());CreateCookie("MapLinkPathWhich",MapLinkPathWhich,a.toGMTString());CreateCookie("MapLinkPath1",MapLinkPath[1],a.toGMTString());CreateCookie("MapLinkPath2",MapLinkPath[2],a.toGMTString());CreateCookie("MapLinkPath3",MapLinkPath[3],a.toGMTString())}catch(f){}document.location=h}function isNumeric(b){var a=/^[0-9]+$/;if(b.match(a)){return true}else{return false}}function ShowLocalizationContinents(c,d){if(c>0){if(ListOfLat[c].length>0){var b=ListOfZoom[c];GlobalLat=ListOfLat[c];GlobalLon=ListOfLon[c];GlobalZoom=ListOfZoom[c]}MapLinkPathWhich=1}else{c=c.toLowerCase();switch(c){case"world":GlobalLat=20.63;GlobalLon=4.92;GlobalZoom=2;break;case"af":GlobalLat=-0.44;GlobalLon=14.16;GlobalZoom=3;break;case"as":GlobalLat=37.83;GlobalLon=94.31;GlobalZoom=3;break;case"au":GlobalLat=-25.58;GlobalLon=134.5;GlobalZoom=4;break;case"eu":GlobalLat=53.97;GlobalLon=22.39;GlobalZoom=4;break;case"na":GlobalLat=46.97;GlobalLon=-119.03;GlobalZoom=2;break;case"sa":GlobalLat=-22.87;GlobalLon=-57.097;GlobalZoom=3;break;default:GlobalLat=20.63;GlobalLon=4.92;GlobalZoom=2}if(c!=="world"){MapLinkPathWhich=1}else{MapLinkPathWhich=0}}var a=new VELatLong(GlobalLat,GlobalLon);var b=GlobalZoom;if(b>8){b=8}if(parseInt(document.getElementById("myMap").style.width)<500){map.SetCenterAndZoom(a,b-1)}else{map.SetCenterAndZoom(a,GlobalZoom)}if(c>0){MapLinkPath[MapLinkPathWhich]=ListOfPlacesCode[c].toLowerCase()}else{MapLinkPath[MapLinkPathWhich]=c}MapLinkGlobalLat[MapLinkPathWhich]=GlobalLat;MapLinkGlobalLon[MapLinkPathWhich]=GlobalLon;MapLinkGlobalZoom[MapLinkPathWhich]=GlobalZoom;document.getElementById("btnquery").value=d;if(document.getElementById("btncontinent")!==null){document.getElementById("btncontinent").value="btn-"+MapLinkPath[MapLinkPathWhich]}if(c>0){PutDetailsOnMap(d,ListOfPlacesCode[c]);if(document.getElementById("btn1")!==null){document.getElementById("btn1").href="javascript:PutDetailsOnMap('btn-reg','"+ListOfPlacesCode[c]+"');"}if(document.getElementById("btn2")!==null){document.getElementById("btn2").href="javascript:PutDetailsOnMap('btn-unreg','"+ListOfPlacesCode[c]+"');"}if(document.getElementById("btn3")!==null){document.getElementById("btn3").href="javascript:PutDetailsOnMap('btn-members','"+ListOfPlacesCode[c]+"');"}if(document.getElementById("btn4")!==null){document.getElementById("btn4").href="javascript:PutDetailsOnMap('btn-loc','"+ListOfPlacesCode[c]+"');"}}else{PutDetailsOnMap(d,c);if(document.getElementById("btn1")!==null){document.getElementById("btn1").href="javascript:PutDetailsOnMap('btn-reg','"+c+"');"}if(document.getElementById("btn2")!==null){document.getElementById("btn2").href="javascript:PutDetailsOnMap('btn-unreg','"+c+"');"}if(document.getElementById("btn3")!==null){document.getElementById("btn3").href="javascript:PutDetailsOnMap('btn-members','"+c+"');"}if(document.getElementById("btn4")!==null){document.getElementById("btn4").href="javascript:PutDetailsOnMap('btn-loc','"+c+"');"}}}function ShowLocalizationCountry(c){if(ListOfLat[c].length>0){var a=new VELatLong(ListOfLat[c],ListOfLon[c]);var b=ListOfZoom[c];GlobalLat=ListOfLat[c];GlobalLon=ListOfLon[c];GlobalZoom=ListOfZoom[c]}else{var a=new VELatLong(GlobalLat,GlobalLon);var b=GlobalZoom}if(b>8){b=8}if(parseInt(document.getElementById("myMap").style.width)<500){map.SetCenterAndZoom(a,b-1)}else{map.SetCenterAndZoom(a,GlobalZoom)}MapLinkPathWhich++;MapLinkPath[MapLinkPathWhich]=ListOfCountriesCode[c];MapLinkGlobalLat[MapLinkPathWhich]=GlobalLat;MapLinkGlobalLon[MapLinkPathWhich]=GlobalLon;MapLinkGlobalZoom[MapLinkPathWhich]=GlobalZoom;PutDetailsOnMap(document.getElementById("btnquery").value,"country:"+ListOfCountriesCode[c]);if(document.getElementById("btn1")!==null){document.getElementById("btn1").href="javascript:PutDetailsOnMap('btn-reg','country:"+ListOfCountriesCode[c]+"');"}if(document.getElementById("btn2")!==null){document.getElementById("btn2").href="javascript:PutDetailsOnMap('btn-unreg','country:"+ListOfCountriesCode[c]+"');"}if(document.getElementById("btn3")!==null){document.getElementById("btn3").href="javascript:PutDetailsOnMap('btn-members','country:"+ListOfCountriesCode[c]+"');"}if(document.getElementById("btn4")!==null){document.getElementById("btn4").href="javascript:PutDetailsOnMap('btn-loc','country:"+ListOfCountriesCode[c]+"');"}}function ShowLocalizationCounty(c){map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();CloseInfoBoxOver();var a=new VELatLong(ListOfLat[c],ListOfLon[c]);var b=ListOfZoom[c];if(b>8){b=8}map.SetCenterAndZoom(a,b);GlobalLat=ListOfLat[c];GlobalLon=ListOfLon[c];GlobalZoom=ListOfZoom[c];getServerDataForMapPoints(document.getElementById("btnquery").value,"county:"+ListOfPlacesCode[c]);document.getElementById("btn1").href="javascript:PutDetailsOnMap('btn-reg','county_:"+ListOfPlacesCode[c]+"');";document.getElementById("btn2").href="javascript:PutDetailsOnMap('btn-unreg','county_:"+ListOfPlacesCode[c]+"');";document.getElementById("btn3").href="javascript:PutDetailsOnMap('btn-members','county_:"+ListOfPlacesCode[c]+"');";document.getElementById("btn4").href="javascript:PutDetailsOnMap('btn-loc','county_:"+ListOfPlacesCode[c]+"');"}function FillAddress(b,c,a){var d="";if(b!=="Select country"){if((c=="State/County Not Found")||(c=="Select State/County")){if(a.length>0){d=a+" "+b}else{d=b}}else{if(a.length>0){d=a+" "+c+" "+b}else{d=c+" "+b}}document.getElementById("FullAddress").value=d}else{}}function calculateDistance(d,i,c,g){d=(d*2*Math.PI)/360;i=(i*2*Math.PI)/360;c=(c*2*Math.PI)/360;g=(g*2*Math.PI)/360;var o=6378137;var m=6356752.3142;var h=(o-m)/o;var j=2*h-h*h;var p=(o/Math.sqrt(1-j*Math.sin(d)*Math.sin(d)));var q=Math.cos(d);var n=p*q*Math.cos(i);var l=p*q*Math.sin(i);var k=p*(1-j)*Math.sin(d);p=(o/Math.sqrt(1-j*Math.sin(c)*Math.sin(c)));q=Math.cos(c);n-=(p*q*Math.cos(g));l-=(p*q*Math.sin(g));k-=(p*(1-j)*Math.sin(c));return Math.sqrt((n*n)+(l*l)+(k*k))}function RouteLengthName(b){try{try{if(b.indexOf(",")>=0){b=b.replace(",",".")}}catch(c){}var a=b-Math.floor(b);a=Math.floor(a*100);return Math.floor(b)+"."+a}catch(c){}}function myEventHandler(a){return(window.event)?window.event.srcElement:a.target}function AHrefOnDiv(c,a,b){return'<a href="'+unescape(c)+'" '+b+' onmouseover="javascript:InfoBoxOver(1);return false;" onmouseout="javascript:InfoBoxOver(0);return false;" >'+a+"</a>"}function CheckButtons(a){if(a==1){DissaperInfoBoxOver(0)}}function InfoBoxOver(a){if(a==1){InfoBoxOverValue=1;window.clearTimeout(TimerInfoBox);TimerInfoBox=window.setTimeout("OpenInfoBoxOver()",1)}else{InfoBoxOverValue=0;window.clearTimeout(TimerInfoBox);TimerInfoBox=window.setTimeout("CloseInfoBoxOver()",1)}}function OpenInfoBoxOver(){window.clearTimeout(TimerInfoBox);if(InfoBoxOverValue==0){TimerInfoBox=window.setTimeout("AppearInfoBoxOver(0)",1)}else{TimerInfoBox=window.setTimeout("AppearInfoBoxOver("+tick+")",1)}}function CloseInfoBoxOver(){if(ie5){try{shimInfoBox.style.display="none"}catch(a){}}window.clearTimeout(TimerInfoBox);if(InfoBoxOverValue==0){TimerInfoBox=window.setTimeout("DissaperInfoBoxOver(88)",1)}else{TimerInfoBox=window.setTimeout("DissaperInfoBoxOver("+tick+")",1)}}function AppearInfoBoxOver(f){window.clearTimeout(TimerInfoBox);tick=f;var b=parseFloat(window.parent.document.getElementById("InfoBox").style.left)+parseFloat(window.parent.document.getElementById("InfoBox").style.width);var h=parseFloat(window.parent.document.getElementById("InfoBox").style.top);window.parent.document.getElementById("InfoBoxClose").innerHTML="x";window.parent.document.getElementById("InfoBoxClose").style.top=h-4;if(ie5!==true){window.parent.document.getElementById("InfoBoxClose").style.left=b}else{window.parent.document.getElementById("InfoBoxClose").style.left=b-16}var d=window.parent.document.getElementById("InfoBox").offsetHeight;var c=parseFloat(window.parent.document.getElementById("InfoBox").style.height);if(ie5){try{var a=map.GetMapMode();if(a==VEMapMode.Mode3D){shimInfoBox.style.display="";shimInfoBox.style.top=window.parent.document.getElementById("InfoBox").style.top;shimInfoBox.style.left=window.parent.document.getElementById("InfoBox").style.left;shimInfoBox.style.width=window.parent.document.getElementById("InfoBox").style.width;shimInfoBox.style.height=window.parent.document.getElementById("InfoBox").style.height}}catch(g){}}if(ns6==true){if(WhichPage==2){window.parent.document.getElementById("InfoBox").style.overflow="auto";window.parent.document.getElementById("InfoBox").style.height=InfoBoxMaxHeight}}else{if(d>InfoBoxMaxHeight){window.parent.document.getElementById("InfoBox").style.overflow="auto";window.parent.document.getElementById("InfoBox").style.height=InfoBoxMaxHeight}else{if(d>c){window.parent.document.getElementById("InfoBox").style.overflow="visible";window.parent.document.getElementById("InfoBox").style.height=d}}}window.parent.document.getElementById("InfoBox").style.display="inline";window.parent.document.getElementById("InfoBoxClose").style.display="inline";b=parseFloat(window.parent.document.getElementById("InfoBoxClose").style.left);window.parent.document.getElementById("InfoBoxClose").style.left=b-14;tick=tick+6;if(tick>88){tick=88}if(ie5){window.parent.document.getElementById("InfoBox").filters.alpha.opacity=tick}else{if(ns6){window.parent.document.getElementById("InfoBox").style.opacity=tick/100}}if(tick<88){TimerInfoBox=window.setTimeout("AppearInfoBoxOver("+tick+")",20)}else{TimerInfoBox=window.setTimeout("CloseInfoBoxOver()",8000)}}function DissaperInfoBoxOver(a){tick=a;tick=tick-3;if(tick<0){tick=0}window.clearTimeout(TimerInfoBox);if(tick>0){if(ie5){document.getElementById("InfoBox").filters.alpha.opacity=tick}else{if(ns6){document.getElementById("InfoBox").style.opacity=tick/100}}TimerInfoBox=window.setTimeout("DissaperInfoBoxOver("+tick+")",20)}else{document.getElementById("InfoBox").style.display="none";document.getElementById("InfoBoxClose").style.display="none"}}function SplitLine(a,e,d){var b=Math.floor(a.length/e)+1;var h="";var f=a;var g="";for(var c=1;c<=d;c++){g+="&nbsp;"}for(var c=1;c<=b;c++){if(c>1){h+="<br>\n"+g}h+=f.substr((c-1)*e,e)}return h}function ShowBoxInProgress(a){if(a==1){document.getElementById("BoxInProgress").style.display="";document.getElementById("BoxInProgressText").innerHTML="<img border='0' src='"+appproxypath+"friends/images/import/loader_02.gif'><br><a href=\"javascript:StopWaiting();\" title='Click here to cancel'>STOP</a>";MoveBoxInProgress()}else{document.getElementById("BoxInProgress").style.display="none"}}function StopWaiting(){ShowBoxInProgress(0);window.clearTimeout(TimerRouteDirections);document.getElementById("BoxListToChoose").style.display="none";document.getElementById("SearchStepsMiddlePoint").style.display="none"}function ReplaceEntityToChar(b){try{var d=b;var a="";var g=0;while(d.indexOf("&#")>0){g++;a+=d.substr(0,d.indexOf("&#"));d=d.substr(d.indexOf("&#")+2);var c=d.substr(0,d.indexOf(";"));c=String.fromCharCode(c);a+=c;d=d.substr(d.indexOf(";")+1);if(g>1000){break}}if(g>1000){return b}else{a+=d;return a}}catch(f){return b}}function CreateCookie(c,d,b){var a="";if(b.length>0){a="; expires="+b}document.cookie=c+"="+d+""+a+"; path=/"}function ReadCookie(d){var e=d+"=";var a=document.cookie.split(";");for(var b=0;b<a.length;b++){var f=a[b];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function EraseCookie(a){CreateCookie(a,"","")}function beginDrag(elementToDrag,event,BoundFromX,BoundToX,BoundFromY,BoundToY,WhichVar,FromValue,ToValue){if(elementToDrag.style.left==""){elementToDrag.style.left=-4}if(elementToDrag.style.top==""){elementToDrag.style.top=0}var deltaX=event.clientX-parseInt(elementToDrag.style.left);var deltaY=event.clientY-parseInt(elementToDrag.style.top);if(document.addEventListener){document.addEventListener("mousemove",moveHandler,true);document.addEventListener("mouseup",upHandler,true)}else{if(document.attachEvent){elementToDrag.attachEvent("onmousemove",moveHandler);elementToDrag.attachEvent("onmouseup",upHandler);elementToDrag.setCapture()}else{var oldmovehandler=document.onmousemove;var olduphandler=document.onmouseup;document.onmousemove=moveHandler;document.onmouseup=upHandler}}if(event.stopPropagation){event.stopPropagation()}else{event.cancelBubble=true}if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}function moveHandler(e){if(!e){e=window.event}var posX=e.clientX-deltaX;var posY=e.clientY-deltaY;var SliderValue=0;if(BoundFromX!==BoundToX){if(posX<BoundFromX){posX=BoundFromX}if(posX>BoundToX+BoundFromX){posX=BoundToX+BoundFromX}elementToDrag.style.left=posX+"px";SliderValue=posX-BoundFromX;SliderValue=Math.floor((SliderValue/BoundToX)*(ToValue-FromValue))+FromValue}if(BoundFromY!==BoundToY){if(posY<BoundFromY){posY=BoundFromY}if(posY>BoundToY+BoundFromY){posY=BoundToY+BoundFromY}elementToDrag.style.top=posY+"px";SliderValue=posY-BoundFromY;SliderValue=Math.floor((SliderValue/BoundToY)*(ToValue-FromValue))+FromValue}try{eval(WhichVar+"="+SliderValue)}catch(e){}if(document.getElementById(elementToDrag.id+"Content")!==null){document.getElementById(elementToDrag.id+"Content").style.top=elementToDrag.style.top;document.getElementById(elementToDrag.id+"Content").style.left=parseInt(elementToDrag.style.left)+4+"px";document.getElementById(elementToDrag.id+"Content").innerHTML=SliderValue}if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}}function upHandler(e){if(!e){e=window.event}if(document.removeEventListener){document.removeEventListener("mouseup",upHandler,true);document.removeEventListener("mousemove",moveHandler,true)}else{if(document.detachEvent){elementToDrag.detachEvent("onmouseup",upHandler);elementToDrag.detachEvent("onmousemove",moveHandler);elementToDrag.releaseCapture()}else{document.onmouseup=olduphandler;document.onmousemove=oldmovehandler}}if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}if(elementToDrag.id=="SliderZoom"){map.SetZoomLevel(SliderZoomValue)}}}function AttachNavigMenu(){var b=0;try{b=parseInt(document.getElementById("myMap").style.width)}catch(c){}try{b=b-parseInt(document.getElementById("myMapNavigMenuPanel").style.width)}catch(c){}var a=0;var d=0;try{a=document.getElementById("myMap").offsetLeft+b-2}catch(c){}try{d=document.getElementById("myMap").offsetTop}catch(c){}document.getElementById("myMapNavigMenuPanel").style.top=d-2;document.getElementById("myMapNavigMenuPanel").style.left=a;document.getElementById("myMapNavigMenuPanel").style.display="inline";a=a-parseInt(document.getElementById("myMapNavigMenu").style.width)-6;document.getElementById("myMapNavigMenu").style.top=d;document.getElementById("myMapNavigMenu").style.left=a;try{shim.style.left=a;shim.style.top=d}catch(c){}}function addShim(){var a=document.getElementById("myMapNavigMenu");shim=document.createElement("iframe");shim.id="myShim";shim.frameBorder="0";shim.style.position="absolute";shim.style.zIndex="1";shim.style.top=a.style.top;shim.style.left=a.style.left;shim.width=193;shim.height=90;shim.style.display="none";a.shimElement=shim;a.parentNode.insertBefore(shim,a);var a=document.getElementById("myMapNavigMenuPanel");a.shimElement=shim;a.parentNode.insertBefore(shim,a)}function addShimInfoBox(){var a=document.getElementById("InfoBox");shimInfoBox=document.createElement("iframe");shimInfoBox.id="myShimInfoBox";shimInfoBox.frameBorder="0";shimInfoBox.style.position="absolute";shimInfoBox.style.zIndex="1";shimInfoBox.style.top=300;shimInfoBox.style.left=400;shimInfoBox.style.width=100;shimInfoBox.style.height=90;shimInfoBox.style.display="none";a.shimElement=shimInfoBox;a.parentNode.insertBefore(shimInfoBox,a);var a=document.getElementById("InfoBoxClose");a.shimElement=shimInfoBox;a.parentNode.insertBefore(shimInfoBox,a)}function HideNavigMenu(){var a=document.getElementById("myMapNavigMenu").style.display;if(a=="none"){document.getElementById("myMapNavigMenu").style.display="inline"}else{document.getElementById("myMapNavigMenu").style.display="none"}AttachNavigMenu()}function MapZoomIn(){var a=map.GetZoomLevel();if(a<17){map.SetZoomLevel(a+1)}}function MapZoomOut(){var a=map.GetZoomLevel();if(a>1){map.SetZoomLevel(a-1)}}function ChangeZoomView(){var e=document.getElementById("SliderZoom");if(e==null){return}var c=-4;var f=123;var i=1;var d=17;var a=map.GetZoomLevel();var b=parseInt(e.style.left);var h=Math.floor(((a-1)/d)*(f+c));var g=Math.floor((a/d)*(f+c));if((b>=h)&&(b<g)){}else{e.style.left=h+"px"}SliderValue=a;if(document.getElementById(e.id+"Content")!==null){document.getElementById(e.id+"Content").style.top=e.style.top;document.getElementById(e.id+"Content").style.left=parseInt(e.style.left)+4+"px";document.getElementById(e.id+"Content").innerHTML=SliderValue}}function ChangeViewMap(a){shim.style.display="none";shimInfoBox.style.display="none";switch(a){case 1:map.SetMapMode(VEMapMode.Mode2D);map.SetMapStyle(VEMapStyle.Road);map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);if(document.getElementById("mapview2D")!==null){document.getElementById("mapview2D").style.display="none"}if(document.getElementById("mapview3D")!==null){document.getElementById("mapview3D").style.display=""}AttachNavigMenu();ChangeZoomView();break;case 2:map.SetMapMode(VEMapMode.Mode2D);map.SetMapStyle(VEMapStyle.Aerial);map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);if(document.getElementById("mapview2D")!==null){document.getElementById("mapview2D").style.display="none"}if(document.getElementById("mapview3D")!==null){document.getElementById("mapview3D").style.display=""}AttachNavigMenu();ChangeZoomView();break;case 3:map.SetMapMode(VEMapMode.Mode2D);map.SetMapStyle(VEMapStyle.Hybrid);map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);if(document.getElementById("mapview2D")!==null){document.getElementById("mapview2D").style.display="none"}if(document.getElementById("mapview3D")!==null){document.getElementById("mapview3D").style.display=""}AttachNavigMenu();ChangeZoomView();break;case 4:map.SetMapMode(VEMapMode.Mode2D);map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);if(document.getElementById("mapview2D")!==null){document.getElementById("mapview2D").style.display="none"}if(document.getElementById("mapview3D")!==null){document.getElementById("mapview3D").style.display=""}AttachNavigMenu();ChangeZoomView();break;case 5:if(ie5){map.SetMapMode(VEMapMode.Mode3D);map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);shim.style.display="inline";if(document.getElementById("mapview3D")!==null){document.getElementById("mapview3D").style.display="none"}if(document.getElementById("mapview2D")!==null){document.getElementById("mapview2D").style.display=""}AttachNavigMenu();ChangeZoomView()}else{alert("Sorry, Your browser doesn't support this feature")}break;default:map.SetMapMode(VEMapMode.Mode2D);map.SetMapStyle(VEMapStyle.Road);map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);AttachNavigMenu();ChangeZoomView()}}function NumberDelimiter(a){if(a==null){a=""}var d=",";var g=3;var c=Math.floor((a.length-1)/g);var b=a.length%g;if(b>0){b=g-b}for(var f=1;f<=b;f++){a=" "+a}var e="";for(var f=1;f<=c;f++){e+=a.substr((f-1)*g,g)+d}e+=a.substr(c*g,g);e=e.substr(b,e.length);return e}function LoadMapRoute(){document.getElementById("myMap").innerHTML="Loading map, Please wait...";var a=document.getElementsByTagName("head")[0];var b=document.createElement("script");b.id="VEScript";b.type="text/javascript";b.src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6";try{a.appendChild(b)}catch(c){alert("The service is temporarily unavailable. Try again later.");return}DelayGetMapRoute()}function DelayGetMapRoute(){window.clearTimeout(timerError);try{var d=0;var c="Firefox/";var b=navigator.userAgent.indexOf(c);if(b!=-1){d=parseFloat(navigator.userAgent.substring(b+c.length))}if((d>=1.5)||(typeof(window.innerWidth)=="number")){try{Msn.Drawing.Graphic.CreateGraphic=function(g,e){return new Msn.Drawing.SVGGraphic(g,e)}}catch(f){timerError=setTimeout("DelayGetMapRoute()",1500);return}}document.getElementById("myMap").innerHTML="Loading map, Please wait...";try{map=new VEMap("myMap")}catch(f){document.getElementById("myMap").innerHTML="Loading map, Please wait...";timerError=setTimeout("DelayGetMapRoute()",1500);return}}catch(f){document.getElementById("myMap").innerHTML="Loading map, Please wait...";timerError=setTimeout("DelayGetMapRoute()",1500);return}WhichPage=2;addShim();addShimInfoBox();try{map.LoadMap()}catch(f){}map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);map.AttachEvent("onendzoom",ChangeZoomView);var a=document.getElementById("myMapNavigMenu");map.AddControl(a);var a=document.getElementById("myMapNavigMenuPanel");map.AddControl(a);VEPushpin.ShowDetailOnMouseOver=false;VEPushpin.OnMouseOverCallback=function(h,k,j,i){var g=unescape(j);if(g.length>0){g="<strong>"+g+"</strong><br>"}window.parent.document.getElementById("InfoBox").style.height=25;window.parent.document.getElementById("InfoBox").style.width=InfoBoxWidth;window.parent.document.getElementById("InfoBox").style.overflow="visible";window.parent.document.getElementById("InfoBox").innerHTML=g+i;var e=parseFloat(window.parent.document.getElementById("InfoBox").style.height);window.parent.document.getElementById("InfoBox").style.top=k-e;window.parent.document.getElementById("InfoBox").style.left=h+5;InfoBoxOver(1)};if(RouteListCount>1){document.getElementById("RouteName").value=strRouteName;GetRouteDirections()}else{GoToSearchStepFirst()}ChangeZoomView();AttachNavigMenu();HideNavigMenu()}function MoveBoxInProgress(){try{if(document.getElementById("BoxInProgress").style.display==""){var b=document.body.scrollTop;var d=document.body.scrollLeft;var a=parseInt(document.getElementById("BoxInProgress").style.top);screenW=window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;screenH=window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;document.getElementById("BoxInProgress").style.width=screenW;document.getElementById("BoxInProgress").style.height=parseInt(screenH)+20+"px";if(b<0){b=0}if(b!==a){document.getElementById("BoxInProgress").style.top=b}}else{document.getElementById("BoxInProgress").style.width=10;document.getElementById("BoxInProgress").style.height=10}}catch(c){}try{AttachNavigMenu()}catch(c){}}function SearchNow(){RouteSearchAddress.length=0;var f="";var b="";b=document.getElementById("country1").options[document.getElementById("country1").selectedIndex].text;if(b=="Select country"){b="";f=""}else{f=document.getElementById("state1").options[document.getElementById("state1").selectedIndex].text;if((f=="State/County Not Found")||(f=="Select State/County")){var f=""}else{f+=","}}var a=document.getElementById("city1").value;var c=document.getElementById("address1").value;if(c.length>0){c+=","}if(a.length>0){a+=","}SearchAddress=c+" "+a+" "+f+" "+b;if(SearchAddress.length<=6){alert("Please choose your departure");return}RouteSearchAddress.push(SearchAddress);b=document.getElementById("country2").options[document.getElementById("country2").selectedIndex].text;if(b=="Select country"){b="";f=""}else{f=document.getElementById("state2").options[document.getElementById("state2").selectedIndex].text;if((f=="State/County Not Found")||(f=="Select State/County")){var f=""}else{f+=","}}var a=document.getElementById("city2").value;var c=document.getElementById("address2").value;if(c.length>0){c+=","}if(a.length>0){a+=","}SearchAddress=c+" "+a+" "+f+" "+b;if(SearchAddress.length<=6){alert("Please choose your destination");return}document.getElementById("SearchSteps").style.display="none";map.Resize(800,400);document.getElementById("myMap").style.width="785px";AttachNavigMenu();RouteSearchAddress.push(SearchAddress);try{map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons()}catch(d){}RouteList.length=0;RouteListCount=0;ShowBoxInProgress(1);map.Find(null,RouteSearchAddress[0],null,null,null,null,null,null,false,null,onFindResultsRoute)}function onFindResultsRoute(a,b,findResults,d,e){if(document.getElementById("BoxInProgress").style.display=="none"){return}document.getElementById("ListToChoose").innerHTML="";document.getElementById("RouteList").style.display="inline";var results="";var lat=0;var lon=0;var strTown;var pins=new Array;if(findResults.length==1){lat=findResults[0].LatLong.Latitude;lon=findResults[0].LatLong.Longitude;RouteListAddPoint(lat,lon,findResults[0].Name)}else{results="<table>";for(r=0;r<findResults.length;r++){lat=findResults[r].LatLong.Latitude;lon=findResults[r].LatLong.Longitude;strTown=findResults[r].Name;strTown=strTown.substr(0,strTown.indexOf(","));if(strTown.indexOf("(")>0){strTown=strTown.substr(0,strTown.indexOf("(")-1)}if(strTown.indexOf("[")>0){strTown=strTown.substr(0,strTown.indexOf("[")-1)}results+="<tr>";results+="<td valign='top'>";results+="<img border='0' src='"+appproxypath+"maps/images/icoFlagRouteNavy.gif'>";results+="</td>\n";results+="<td class='textBlueDefault' valign='top'>\n";results+=findResults[r].Name+": <br>";results+="<a class='link' href=\"javascript:RouteListAddPoint("+eval(lat)+","+eval(lon)+",'"+findResults[r].Name+'\')" title="Click here to add this point to your route">Add this location to your route plan</a>';results+="</td>\n";results+="</tr>"}results+="</table>";var results2;if(findResults.length>1){results2="We have found<b>"+findResults.length+" location(s)</b> that matches your query, please choose one from below or from the map<br>"}else{if(findResults.length==0){results2="Sorry we couldn't find the location you specified, please refine your search criteria<br>"}}if(RouteListCount>=2){results2+="<a class='link' href=\"javascript:CancelSearchNowAnotherPoint();\">Go back</a><hr style='border: 1px solid #c9dbee;height:1px;'>"}else{results2+="<a class='link' href=\"javascript:StartNewRouteSearch();\">Go back to choose another location</a><hr style='border: 1px solid #c9dbee;height:1px;'>"}document.getElementById("ListToChooseContent").innerHTML=results2;document.getElementById("ListToChoose").innerHTML=results;var xPos=map.GetLeft();var yPos=map.GetTop();var xAdd=0;var yAdd=0;try{xAdd=parseInt(document.getElementById("myMap").style.width);xAdd=xAdd-parseInt(document.getElementById("BoxListToChoose").style.width);xAdd=Math.floor(xAdd/2)}catch(e){}try{yAdd=parseInt(document.getElementById("myMap").style.height);yAdd=yAdd-parseInt(document.getElementById("BoxListToChoose").style.height);yAdd=Math.floor(yAdd/2)}catch(e){}document.getElementById("BoxListToChoose").style.left=xPos+xAdd;document.getElementById("BoxListToChoose").style.top=yPos+yAdd;document.getElementById("BoxListToChoose").style.display="inline"}}function StartNewRouteSearch(){RouteList.length=0;RouteListCount=0;RouteSearchAddress.length=0;GoToSearchStepFirst()}function SearchNowAnotherPoint(){document.getElementById("YourRoutePlan").style.display="none";try{map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons()}catch(d){}var f="";var b="";b=document.getElementById("country3").options[document.getElementById("country3").selectedIndex].text;if(b=="Select country"){b="";f=""}else{f=document.getElementById("state3").options[document.getElementById("state3").selectedIndex].text;if((f=="State/County Not Found")||(f=="Select State/County")){var f=""}else{f+=","}}var a=document.getElementById("city3").value;var c=document.getElementById("address3").value;if(c.length>0){c+=","}if(a.length>0){a+=","}SearchAddress=c+" "+a+" "+f+" "+b;if(SearchAddress.length<=6){alert("Please choose your additional point");return}document.getElementById("SearchStepsMiddlePoint").style.display="none";ShowBoxInProgress(1);map.Find(null,SearchAddress,null,null,null,null,null,null,false,null,onFindResultsRoute)}function CancelSearchNowAnotherPoint(){ShowBoxInProgress(0);ShowRouteList()}function ShowRouteList(){document.getElementById("SearchStepsMiddlePoint").style.display="none";document.getElementById("BoxListToChoose").style.display="none";var k="";if(RouteListCount>0){document.getElementById("myMap").style.width="785px";AttachNavigMenu();var l;l="<table width='100%' border='0'><tr><td class='headingBlackMiddle' valign='center' align='center' width='80'>";l+="Step 2";l+="</td><td valign='center' align='left'>";l+="<font class='headingBlueMiddle'>Setting additional points</font>";l+="</td><td align='right' valign='center' class='textBlueMiddle'>";l+="Back to Step 1";l+="</td></tr></table>";document.getElementById("SearchStepsTitle").innerHTML=l;document.getElementById("SearchSteps").style.display="none";var c=0;if(RouteListCount>1){for(var d=1;d<RouteListCount;d++){c+=calculateDistance(RouteList[d-1][0],RouteList[d-1][1],RouteList[d][0],RouteList[d][1])}}k+="<table width='100%' border='0' cellpading='2' cellspacing='10'><tr><td align='right' class='headingGreyMiddle'>Route from</td>\n";k+="<td style='border-right: 2px solid #42a314;'><img border='0' src='"+appproxypath+"maps/images/icoFlagRouteGreen.gif'></td>\n";k+="<td class='routePointGreen'>1&nbsp;&nbsp;"+MakeTownBold(RouteList[0][2])+"<br>\n";k+="<a class='link' href=\"javascript:RouteListPointMoveUp("+0+")\"title=\"Move the point up\"><img border='0' src='"+appproxypath+"maps/images/icoListMoveUp.gif'></a>";k+="&nbsp;&nbsp;&nbsp;";k+="<a class='link' href=\"javascript:RouteListPointMoveDown("+0+")\"title=\"Move the point down\"><img border='0' src='"+appproxypath+"maps/images/icoListMoveDown.gif'></a>";k+="&nbsp;&nbsp;&nbsp;";k+="<a class='link' href=\"javascript:RouteListPointRemove("+0+")\" title=\"Remove the point from your route list\"><img border='0' src='"+appproxypath+"maps/images/icoListRemove.gif'></a>";k+="</td>\n";k+="<td align='center' valign='top' rowspan='"+(RouteListCount+1)+"'>";k+="<a class='link' href=\"javascript:GetRouteDirections()\" title=\"Click here to finish and get route directions\"><img border='0' src='"+appproxypath+"maps/images/btnDrawRoutePath.gif'></a><br><br><br>";k+="<a class='link' href=\"javascript:AddAnotherPoint()\" title=\"Click here to add another point\"><img border='0' src='"+appproxypath+"maps/images/btnChooseMorePoints.gif'></a><br>";k+="</td>\n"}else{k="No route definied"}var a=3;var g=Math.floor((RouteListCount-2)/a);if(g*a<RouteListCount-2){g++}if(RouteActivePage<1){RouteActivePage=1}if(RouteActivePage>g){RouteActivePage=g}for(var d=1;d<RouteListCount-1;d++){if((d>=(RouteActivePage-1)*a+1)&&(d<RouteActivePage*a+1)){k+="<tr><td>&nbsp;</td><td style='border-right: 2px solid #c9dbee;'><img border='0' src='"+appproxypath+"maps/images/icoFlagRouteNavy.gif'></td>\n";k+="<td class='routePointNavy'>"+(d+1)+"&nbsp;&nbsp;"+MakeTownBold(RouteList[d][2])+"<br>";k+="<a class='link' href=\"javascript:RouteListPointMoveUp("+d+")\"title=\"Move the point up\"><img border='0' src='"+appproxypath+"maps/images/icoListMoveUp.gif'></a>";k+="&nbsp;&nbsp;&nbsp;";k+="<a class='link' href=\"javascript:RouteListPointMoveDown("+d+")\"title=\"Move the point down\"><img border='0' src='"+appproxypath+"maps/images/icoListMoveDown.gif'></a>";k+="&nbsp;&nbsp;&nbsp;";k+="<a class='link' href=\"javascript:RouteListPointRemove("+d+")\" title=\"Remove the point from your route list\"><img border='0' src='"+appproxypath+"maps/images/icoListRemove.gif'></a>";k+="</td>\n";k+="</tr>\n"}}if(RouteListCount>0){k+="<tr><td align='right' class='headingGreyMiddle'>to</td>\n";k+="<td style='border-right: 2px solid #ff2226;'><img border='0' src='"+appproxypath+"maps/images/icoFlagRouteRed.gif'></td>\n";k+="<td class='routePointRed'>";if(RouteListCount>1){k+=RouteListCount+"&nbsp;&nbsp;"+MakeTownBold(RouteList[RouteListCount-1][2])+"<br>";k+="<a class='link' href=\"javascript:RouteListPointMoveUp("+(RouteListCount-1)+")\"title=\"Move the point up\"><img border='0' src='"+appproxypath+"maps/images/icoListMoveUp.gif'></a>";k+="&nbsp;&nbsp;&nbsp;";k+="<a class='link' href=\"javascript:RouteListPointMoveDown("+(RouteListCount-1)+")\"title=\"Move the point down\"><img border='0' src='"+appproxypath+"maps/images/icoListMoveDown.gif'></a>";k+="&nbsp;&nbsp;&nbsp;";k+="<a class='link' href=\"javascript:RouteListPointRemove("+(RouteListCount-1)+")\" title=\"Remove the point from your route list\"><img border='0' src='"+appproxypath+"maps/images/icoListRemove.gif'></a>"}k+="</td>\n";k+="</tr>\n";k+="<tr><td colspan='3'>&nbsp;</td></tr>\n";k+="</table>\n"}if(g>1){k+="<hr>\n";k+='<a href="javascript:RouteChangePage(1)">First</a>&nbsp;&nbsp;&nbsp;';k+='<a href="javascript:RouteChangePage('+(RouteActivePage-1)+')"><<</a>&nbsp;&nbsp;&nbsp;';var b=3;var h=RouteActivePage;var j=h+b-1;if(h>1){h--;j--}if(j>g){j=g;h--}if(h<1){h=1}for(var d=h;d<=j;d++){if(d==RouteActivePage){k+="<strong>"+d+"</strong>&nbsp;"}else{k+='<a href="javascript:RouteChangePage('+d+')">'+d+"</a>&nbsp;"}}k+='<a href="javascript:RouteChangePage('+(RouteActivePage+1)+')">>></a>&nbsp;&nbsp;&nbsp;';k+='<a href="javascript:RouteChangePage('+g+')">Last ('+g+")</a>"}document.getElementById("RouteList").innerHTML=k;if(RouteListCount>=1){document.getElementById("YourRoutePoints").style.display="";document.getElementById("YourRouteName").style.display=""}else{document.getElementById("YourRoutePoints").style.display="none";document.getElementById("YourRouteName").style.display="none"}if(RouteListCount>1){try{document.getElementById("RouteName").value=strRouteName}catch(f){}}}function MakeTownBold(a){if(a.indexOf(",")>0){var b="<b>"+a.substr(0,a.indexOf(","))+"</b>";b+=a.substr(a.indexOf(","),a.length);return b}else{return a}}function GoToSearchStepFirst(){window.clearTimeout(TimerRouteDirections);ShowBoxInProgress(0);try{map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons()}catch(b){}var a="";a="<table><tr><td width='80' valign='center' align='center' class='headingBlackMiddle'>";a+="Step 1";a+="</td><td valign='center' align='left'>";a+="<font class='headingBlueMiddle'>Choose your departure and destination points</font>";a+="</td></tr></table>";document.getElementById("SearchStepsTitle").innerHTML=a;document.getElementById("BoxListToChoose").style.display="none";document.getElementById("SearchStepsMiddlePoint").style.display="none";document.getElementById("YourRoutePoints").style.display="none";document.getElementById("YourRouteName").style.display="none";document.getElementById("YourRoutePlan").style.display="none";document.getElementById("myMap").style.width="553px";document.getElementById("SearchSteps").style.display="";ShowRouteList();AttachNavigMenu()}function RouteListAddPoint(b,c,a){a=ReplaceEntityToChar(a);document.getElementById("BoxListToChoose").style.display="none";RouteListCount++;RouteList.push(new Array(b,c,a));if(RouteList.length==2){document.getElementById("BoxListToChoose").style.display="none";ShowRouteList();GetRouteDirections()}else{if(RouteList.length>2){document.getElementById("BoxListToChoose").style.display="none";ShowRouteList();ShowBoxInProgress(0)}else{document.getElementById("BoxListToChoose").style.display="none";ShowRouteList();map.Find(null,RouteSearchAddress[RouteList.length],null,null,null,null,null,null,0,null,onFindResultsRoute);return}}}function ReverseRouteListOnMap(){RouteList.reverse();ShowRouteList()}function GetRouteDirections(){if(RouteListCount>=2){ShowBoxInProgress(1);document.getElementById("RoutePlan").innerHTML="";RouteDirectionsArray.length=0;AllPointsCount=0;GlobalSteps=0;GlobalWaitCycles=0;var b=new VELatLong(RouteList[0][0],RouteList[0][1]);var a=new VELatLong(RouteList[1][0],RouteList[1][1]);map.GetRoute(b,a,VEDistanceUnit.Kilometers,1,OnGotRouteDirections);if(document.getElementById("BoxInProgress").style.display=="none"){return}WaitForDirections()}}function OnGotRouteDirections(b){if(document.getElementById("BoxInProgress").style.display=="none"){return}map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();var a=b.Itinerary.Segments.length;var c=0;if((AllPointsCount>0)&&(GlobalSteps>0)){c=1}if(GlobalSteps<RouteListCount-2){a--}for(var e=c;e<a;e++){AllPointsCount++;var h="";if((e==0)&&(GlobalSteps==0)){h=b.Itinerary.Segments[e].Instruction;h+=RouteList[0][2]}else{if((e==a-1)&&(GlobalSteps==RouteListCount-2)){h=b.Itinerary.Segments[e].Instruction;h+=RouteList[RouteListCount-1][2]}else{h=b.Itinerary.Segments[e].Instruction}}RouteDirectionsArray.push(new Array(b.Itinerary.Segments[e].LatLong.Latitude,b.Itinerary.Segments[e].LatLong.Longitude,h,b.Itinerary.Segments[e].Distance))}if(a==0){var d="<b>Sorry we couldn't find the driving directions you specified, please refine your search criteria</b><br>";document.getElementById("ListToChoose").innerHTML=d;document.getElementById("BoxListToChoose").style.display="inline";return}GlobalSteps++;if((GlobalSteps<RouteListCount-1)&&(document.getElementById("BoxInProgress").style.display=="")){var g=new VELatLong(RouteList[GlobalSteps][0],RouteList[GlobalSteps][1]);var f=new VELatLong(RouteList[GlobalSteps+1][0],RouteList[GlobalSteps+1][1]);map.GetRoute(g,f,VEDistanceUnit.Kilometers,VERouteType.Quickest,OnGotRouteDirections)}}function ShowRouteListOnMap(){map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();var e=new Array();for(var b=0;b<RouteListCount;b++){var d=new VELatLong(RouteList[b][0],RouteList[b][1]);var a=new VEPushpin(b,d,"/maps/images/icoMapFlagGreen.gif",SplitLine(RouteList[b][2],30,4),"Point: "+(b+1)+'<br><a href="javascript:RouteListPointRemove('+b+')" title="Remove the point from the route list">remove</a>');e.push(d);map.AddPushpin(a);VEPushpin.ShowDetailOnMouseOver=false;VEPushpin.OnMouseOverCallback=function(h,k,j,i){var g=unescape(j);if(g.length>0){g="<strong>"+g+"</strong><br>"}window.parent.document.getElementById("InfoBox").style.height=25;window.parent.document.getElementById("InfoBox").style.width=InfoBoxWidth;window.parent.document.getElementById("InfoBox").style.overflow="visible";window.parent.document.getElementById("InfoBox").innerHTML=g+i;var f=parseFloat(window.parent.document.getElementById("InfoBox").style.height);window.parent.document.getElementById("InfoBox").style.top=k-f;window.parent.document.getElementById("InfoBox").style.left=h+5;InfoBoxOver(1)}}map.SetMapView(e);var c=map.GetZoomLevel();if(c>8){map.SetZoomLevel(8)}}function ClearRouteListOnMap(){map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();RouteList.length=0;RouteListCount=0;GoToSearchStepFirst()}function AddAnotherPoint(){document.getElementById("SearchSteps").style.display="none";var f=map.GetLeft();var b=map.GetTop();var c=0;var a=0;try{c=parseInt(document.getElementById("myMap").style.width);c=c-parseInt(document.getElementById("SearchStepsMiddlePoint").style.width);c=Math.floor(c/2)}catch(d){}try{a=parseInt(document.getElementById("myMap").style.height);a=a-parseInt(document.getElementById("SearchStepsMiddlePoint").style.height);a=Math.floor(a/2)}catch(d){}document.getElementById("SearchStepsMiddlePoint").style.left=f+c;document.getElementById("SearchStepsMiddlePoint").style.top=b+a;document.getElementById("SearchStepsMiddlePoint").style.display="inline"}function SaveRouteList(){if((document.getElementById("RouteName").value).length<5){alert("The name of route is too short, please put at least 5 characters");return}try{try{xmlhttp=new XMLHttpRequest()}catch(g){var b=new Array("MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");var h=false;for(var d=0;d<b.length&&!h;d++){try{xmlhttp=new ActiveXObject(b[d]);h=true}catch(g){}}if(!h){try{xmlhttp=new HTML_AJAX_IframeXHR()}catch(g){alert("Sorry. We are unable to load xml file. Please try again later.")}}}xmlhttp.open("POST","/waynmaps.html?wci=saveroute","true");xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var i=xmlhttp.responseXML.getElementsByTagName("operationstatus");var e=i[0].getAttribute("value");var j=i[0].getAttribute("text");alert(j);xmlhttp=null;if((e=="OK")&&(RouteKey>0)){window.location.href="/waynmaps.html?wci=maproutelist"}}};var f="";f+="type=xml";f+="&route_key="+RouteKey;f+="&route_name="+unicodeEscape(document.getElementById("RouteName").value);f+="&route_length="+(Math.floor(TotalDistance*100))/100;f+="&route_time="+escape("12 h");f+="&details_count="+RouteListCount;var a=new Array();for(var d=1;d<=RouteListCount;d++){for(var c=1;c<=3;c++){if(d>1){a[c-1]+="$$"}else{a.push("")}a[c-1]+=RouteList[d-1][c-1]}}for(var d=1;d<=3;d++){f+="&details"+d+"="+(a[d-1])}xmlhttp.send(f)}catch(g){alert("Server is not available at this time to process your request.")}}function WaitForDirections(){window.clearTimeout(TimerRouteDirections);if(document.getElementById("BoxInProgress").style.display=="none"){return}GlobalWaitCycles++;if(GlobalWaitCycles>MaxGlobalWaitCycles){document.getElementById("BoxInProgressText").innerHTML="Error: Time Out";alert("Sorry but it took too long so the operation was aborted");ShowBoxInProgress(0);return}if((GlobalSteps<RouteListCount-1)&&(RouteListCount>1)){document.getElementById("RoutePlan").innerHTML="Please wait while calculating the route directions...<br>";document.getElementById("RoutePlan").innerHTML+=AllPointsCount+" / Steps:"+GlobalSteps;TimerRouteDirections=window.setTimeout("WaitForDirections()",100);return}else{if(GlobalSteps==RouteListCount-1){var k="";TotalDistance=0;map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();var g=new Array();var e="";var c="";var j="";var f="";for(var h=1;h<=AllPointsCount;h++){if(h%2==1){k+="<tr id='rawBlue'>"}else{k+="<tr>"}k+="<td align='right' width='30px' valign='top'><font class='textBlackDefault'>"+h+".</font></td>\n";k+="<td width='660px' class='textBlackDefault' style='border-right: 1px solid #c9dbee;padding-left:16px;' valign='top';>"+RouteDirectionsArray[h-1][2]+"</td>\n";if(RouteDirectionsArray[h-1][3]!=null){k+="<td width='160px' align='right' class='textBlackDefault' valign='top'>"+RouteDirectionsArray[h-1][3]+"&nbsp;km&nbsp;</td>\n"}else{k+="<td width='160px' align='right' class='textBlackDefault' valign='top'>&nbsp;</td>\n"}k+="</tr>\n";if(h>1){TotalDistance+=RouteDirectionsArray[h-2][3]}e="Step "+h;HtmlBody=RouteDirectionsArray[h-1][2]+"<br>";HtmlBody+="Distance to the next point:&nbsp;";if(h<AllPointsCount){HtmlBody+=RouteLengthName(RouteDirectionsArray[h-1][3])+" km<br>"}else{HtmlBody+=RouteLengthName(0)+" km<br>"}HtmlBody+="Total Distance:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";HtmlBody+=RouteLengthName(TotalDistance)+" km<br>";var d=new VELatLong(RouteDirectionsArray[h-1][0],RouteDirectionsArray[h-1][1]);if(h==1){j=e;HtmlBody1=HtmlBody;var a=new VEPushpin(h,d,"/maps/images/icoMapFlagGreen.gif",e,HtmlBody)}else{if(h==AllPointsCount){var a=new VEPushpin(h,d,"/maps/images/icoMapFlagRed.gif",e,HtmlBody)}else{var a=new VEPushpin(h,d,"/maps/images/icoMapFlagNavy.gif",e,HtmlBody)}}g.push(d);if(h>1){map.AddPushpin(a)}}var d=new VELatLong(RouteDirectionsArray[0][0],RouteDirectionsArray[0][1]);var a=new VEPushpin(1,d,"/maps/images/icoMapFlagGreen.gif",j,HtmlBody1);map.AddPushpin(a);var b=new VEPolyline("1",g);b.SetWidth(4);b.SetColor(new VEColor(66,163,20,0.66));map.AddPolyline(b);map.SetMapView(g);k="<table border='0' cellspacing='0' cellpadding='2' class='routePlanTable' style='border-top: 1px solid #c9dbee;'>"+k+"</table>";k="<table border='0' cellspacing='0' cellpadding='5'><tr><td class='textBlackDefault' width='690px'><b>Total route directions:</b> <font class='headingGreenDefault'>"+AllPointsCount+"</font></td><td class='textBlackDefault' width='160px' align='right'><b>Total distance:</b> <font class='headingGreenDefault'>"+RouteLengthName(TotalDistance)+" km</font></td></tr></table>"+k+"<table border='0' cellspacing='0' cellpadding='5'><tr><td class='textBlackDefault' width='690px'><b>Total route directions:</b> <font class='headingGreenDefault'>"+AllPointsCount+"</font></td><td class='textBlackDefault' width='160px' align='right'><b>Total distance:</b> <font class='headingGreenDefault'>"+RouteLengthName(TotalDistance)+" km</font></td></tr></table>";document.getElementById("RoutePlan").innerHTML=k;document.getElementById("YourRoutePlan").style.display="";ShowBoxInProgress(0)}}}function RouteChangePage(a){RouteActivePage=a;ShowRouteList()}function RouteListPointMoveUp(a){if((a>0)&&(a<=RouteListCount)){var b=new Array();b.push(new Array(RouteList[a-1][0],RouteList[a-1][1],RouteList[a-1][2]));RouteList[a-1][0]=RouteList[a][0];RouteList[a-1][1]=RouteList[a][1];RouteList[a-1][2]=RouteList[a][2];RouteList[a][0]=b[0][0];RouteList[a][1]=b[0][1];RouteList[a][2]=b[0][2]}ShowRouteList()}function RouteListPointMoveDown(a){if((a>=0)&&(a<RouteListCount-1)){var b=new Array();b.push(new Array(RouteList[a+1][0],RouteList[a+1][1],RouteList[a+1][2]));RouteList[a+1][0]=RouteList[a][0];RouteList[a+1][1]=RouteList[a][1];RouteList[a+1][2]=RouteList[a][2];RouteList[a][0]=b[0][0];RouteList[a][1]=b[0][1];RouteList[a][2]=b[0][2]}ShowRouteList()}function RouteListPointRemove(a){if((a>=0)&&(a<RouteListCount)&&(RouteListCount>0)){RouteList.splice(a,1);try{map.DeletePushpin(a)}catch(b){}RouteListCount--}DissaperInfoBoxOver(0);ShowRouteList()}function LoadMapAdmin(){document.getElementById("myMap").innerHTML="Loading map, Please wait...";var a=document.getElementsByTagName("head")[0];var b=document.createElement("script");b.id="VEScript";b.type="text/javascript";b.src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6";try{a.appendChild(b)}catch(c){alert("The service is temporarily unavailable. Try again later.");return}DelayLoadMapAdmin()}function DelayLoadMapAdmin(){window.clearTimeout(timerError);try{var c=0;var b="Firefox/";var a=navigator.userAgent.indexOf(b);if(a!=-1){c=parseFloat(navigator.userAgent.substring(a+b.length))}if((c>=1.5)||(typeof(window.innerWidth)=="number")){try{Msn.Drawing.Graphic.CreateGraphic=function(g,e){return new Msn.Drawing.SVGGraphic(g,e)}}catch(d){timerError=setTimeout("DelayLoadMapAdmin()",1500);return}}document.getElementById("myMap").innerHTML="Loading map, Please wait...";try{map=new VEMap("myMap")}catch(d){document.getElementById("myMap").innerHTML="Loading map, Please wait...";timerError=setTimeout("DelayLoadMapAdmin",1500);return}}catch(d){document.getElementById("myMap").innerHTML="Loading map, Please wait...";timerError=setTimeout("DelayLoadMapAdmin()",1500);return}try{map.LoadMap(new VELatLong(GlobalLat,GlobalLon),GlobalZoom,"r",false)}catch(d){}map.vemapcontrol.EnableGeoCommunity(false);map.HideDashboard();map.ShowDisambiguationDialog(false);map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers)}function Search2(){InfoBoxOver(0);map.Find(null,document.getElementById("FullAddress").value,null,null,null,null,null,null,1,null,onFindResults2)}function onFindResults2(a,b,findResults,d,e){map.DeleteRoute();map.DeleteAllPushpins();map.DeleteAllPolylines();map.DeleteAllPolygons();document.getElementById("ListToChoose").innerHTML="";var results="";var lat=0;var lon=0;var strTown;var pins=new Array;for(r=0;r<findResults.length;r++){lat=findResults[r].LatLong.Latitude;lon=findResults[r].LatLong.Longitude;strTown=findResults[r].Name;strTown=strTown.substr(0,strTown.indexOf(","));if(strTown.indexOf("(")>0){strTown=strTown.substr(0,strTown.indexOf("(")-1)}if(strTown.indexOf("[")>0){strTown=strTown.substr(0,strTown.indexOf("[")-1)}results+=findResults[r].Name+": "+lat+", "+lon+"<br>\n";results+='<a href="javascript:ShowLocation('+eval(lat)+","+eval(lon)+')">Show</a><br>\n';results+='<a href="javascript:UpdateCoordination('+eval(lat)+","+eval(lon)+",'"+strTown+"')\">Update coordination</a><br>\n";results+="----------------------------<br>\n";var pinLatLong=new VELatLong(lat,lon);var pin=new VEPushpin(r,pinLatLong,"maps/flag.gif",findResults[r].Name,"Latitude: "+lat+",<br>Longitude: "+lon+"<br>"+AHrefOnDiv("javascript:UpdateCoordination("+eval(lat)+","+eval(lon)+",'"+strTown+"')","Update coordination",""));pins.push(pinLatLong);map.AddPushpin(pin)}if(findResults.length>1){map.SetMapView(pins)}VEPushpin.ShowDetailOnMouseOver=false;VEPushpin.OnMouseOverCallback=function(x,y,title,details){var strTitle=unescape(title);if(strTitle.length>0){strTitle="<strong>"+strTitle+"</strong><br>"}document.getElementById("InfoBox").style.width=InfoBoxWidth;document.getElementById("InfoBox").style.height=InfoBoxMaxHeight;document.getElementById("InfoBox").style.overflow="visible";document.getElementById("InfoBox").innerHTML=strTitle+details;var valHeight=parseFloat(document.getElementById("InfoBox").style.height);document.getElementById("InfoBox").style.top=y-valHeight;document.getElementById("InfoBox").style.left=x+5;InfoBoxOver(1)};document.getElementById("ListToChoose").innerHTML=results}function navLabel(b,a){try{document.getElementById(b).value=a}catch(c){}}function navLabelReturn(a,b){try{document.getElementById(a).value=document.getElementById(b).value}catch(c){}}function navMouseover(a){if(document.getElementById(a)!==null){if(a=="btn-reg"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav01_on.gif"}if(a=="btn-unreg"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav02_on.gif"}if(a=="btn-members"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav03_on.gif"}if(a=="btn-loc"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav04_on.gif"}if(a=="btn-world"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap01_on.gif"}if(a=="btn-eu"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap02_on.gif"}if(a=="btn-af"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap03_on.gif"}if(a=="btn-as"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap04_on.gif"}if(a=="btn-au"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap05_on.gif"}if(a=="btn-na"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap06_on.gif"}if(a=="btn-sa"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap07_on.gif"}if(a=="btn-ca"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap08_on.gif"}}}function navMouseout(a){if(document.getElementById(a)!==null){if(a=="btn-reg"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav01_off.gif"}if(a=="btn-unreg"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav02_off.gif"}if(a=="btn-members"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav03_off.gif"}if(a=="btn-loc"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav04_off.gif"}if(a=="btn-world"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap01_off.gif"}if(a=="btn-eu"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap02_off.gif"}if(a=="btn-af"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap03_off.gif"}if(a=="btn-as"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap04_off.gif"}if(a=="btn-au"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap05_off.gif"}if(a=="btn-na"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap06_off.gif"}if(a=="btn-sa"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap07_off.gif"}if(a=="btn-ca"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlMap08_off.gif"}}}function navAtvBtn(){var a=document.getElementById("btnquery").value;var b=document.getElementById("btncontinent").value;if(a=="btn-reg"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav01_on.gif"}if(a=="btn-unreg"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav02_on.gif"}if(a=="btn-members"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav03_on.gif"}if(a=="btn-loc"){document.getElementById(a).src=appproxypath+"maps/images/icoSmlNav04_on.gif"}if(b=="btn-world"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap01_on.gif"}if(b=="btn-eu"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap02_on.gif"}if(b=="btn-af"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap03_on.gif"}if(b=="btn-as"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap04_on.gif"}if(b=="btn-au"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap05_on.gif"}if(b=="btn-na"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap06_on.gif"}if(b=="btn-sa"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap07_on.gif"}if(b=="btn-ca"){document.getElementById(b).src=appproxypath+"maps/images/icoSmlMap08_on.gif"}};
