﻿var cI=[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP,G_PHYSICAL_MAP];var DH=[];var BB=[];var AZ=[];var qB=[];var fO=[];var qD=[];var map=null;var mc_atlas=null;var mc_assistant=null;function loadViewPage(){prepMap();map=new GMap2(e("mapDiv"));map.addControl(new GHierarchicalMapTypeControl());map.addControl(new GLargeMapControl());map.addMapType(G_PHYSICAL_MAP);map.setCenter(new GLatLng(0,0),5);var ne=new GLatLng(mapBounds[3],mapBounds[2]);var sw=new GLatLng(mapBounds[1],mapBounds[0]);var bounds=new GLatLngBounds(sw,ne);var centre=bounds.getCenter();var zoom=map.getBoundsZoomLevel(bounds);map.setCenter(centre,zoom);map.enableDoubleClickZoom();var geoxml=new GGeoXml(sourceURL);map.addOverlay(geoxml);};function loadAtlasPage(){var kG={suppressZoomToBounds:true};map=new GMap2(e("mapDiv"),{googleBarOptions:kG});map.addControl(new GHierarchicalMapTypeControl());map.addControl(new GLargeMapControl());map.addMapType(G_PHYSICAL_MAP);var centre=new GLatLng(51.507705,-0.128874);var zoom=2;map.setCenter(centre,zoom);map.enableDoubleClickZoom();map.setMapType(G_PHYSICAL_MAP);e("controlDiv").innerHTML="";mc_assistant=new MC_Assistant(map,true);mc_atlas=new MC_Atlas(map);initAtlasCountries();initAtlasClasses();initAtlasWebsites();initAtlasOptions();initAtlasGeocoder();mc_atlas.vN(true);mc_atlas.vI(true);GEvent.addListener(map,"moveend",function(){mc_atlas.updateView();mc_assistant.updateView();});mc_atlas.updateView();mc_assistant.updateView();setTimeout("infoMon();",1);};function infoMon(){var uT=e("descriptionDiv");if(uT&&uT.style.display!="none"){var gw=map.getInfoWindow();if(gw==null||gw.isHidden()){if(mc_atlas.nF==0){vW();}}}if(mc_atlas.nF>0){mc_atlas.nF--;}setTimeout("infoMon();",50);};function unloadPage(){GUnload();};function MC_Atlas(){this.gP=0;this.iH=null;this.RU=null;this.bR=null;this.kN=true;this.BS=false;this.BV=false;this.xJ=false;this.fF=null;this.fX=null;this.OH=true;if(typeof(window.innerHeight)=='number'){this.OH=false;}this.nF=0;};MC_Atlas.prototype.xM=function(eY){this.kN=eY;this.updateView();};MC_Atlas.prototype.vN=function(eY){if(eY&& !this.iH){this.iH=new GAdsManager(map,"pub-5408854154696215",{channel:"0316900114"});this.iH.enable();}else if(!eY&&this.iH){this.iH.disable();}this.BS=eY;};MC_Atlas.prototype.vI=function(eY){if(eY){map.enableGoogleBar();}else{map.disableGoogleBar();}this.BV=eY;};MC_Atlas.prototype.zM=function(eY){this.xJ=eY;if(eY&& !this.bR){this.bR=new GTrafficOverlay();map.addOverlay(this.bR);}if(eY){this.bR.show();}else if(this.bR){this.bR.hide();}};﻿;function selectCountry(a){var jL=a.value;var aV=qB[jL];var oK=aV.aI+"\r\n"+aV.BJ+" "+aV.BH+" "+aV.BG+" "+aV.BD;var iI=new GLatLng(aV.BD,aV.BG);var iD=new GLatLng(aV.BH,aV.BJ);var aG=new GLatLngBounds(iD,iI);var jP=map.getBoundsZoomLevel(aG);var lP=aG.getCenter();map.setCenter(lP,jP);};function selectClass(a){mc_atlas.gP=parseInt(a.value);mc_atlas.updateView();};function selectWebsite(a){var jL=parseInt(a.id.substr(2));var aO=fO[jL];if(a.checked){if(aO.kU==null){aO.kU=new GGeoXml(aO.LE);}map.addOverlay(aO.kU);}else{map.removeOverlay(aO.kU);aO.kU=null;}};function checkWebsiteMarkers(a){lH=a.checked?true:false;mc_atlas.xM(lH);if(!lH){map.closeInfowWindow();}};function checkGoogleAds(a){lH=a.checked?true:false;mc_atlas.vN(lH);};function checkGoogleBar(a){lH=a.checked?true:false;mc_atlas.vI(lH);};function checkTrafficLayer(a){lH=a.checked?true:false;mc_atlas.zM(lH);};﻿;var cI=[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP,G_PHYSICAL_MAP];var map=null;var rR=6;var GX=0;var sR=null;var GY=null;var GV=null;var lB=null;var nN=null;var nG=null;var pU=null;var gY=[];function xY(){var aE=new GIcon();var bX="http://mcmarkers.googlepages.com/iimm2-green.png";aE.image=bX;aE.iconSize=new GSize(32,32);aE.shadow="http://mcmarkers.googlepages.com/iimm2-shadow.png";aE.shadowSize=new GSize(59,32);aE.printImage=bX;aE.mozPrintImage=bX;aE.iconAnchor=new GPoint(16,31);aE.infoWindowAnchor=new GPoint(16,0);aE.infoShadowAnchor=new GPoint(0,31);var aL=new GMarker(sR,{draggable:true,icon:aE});map.addOverlay(aL);GEvent.addListener(aL,"dragend",function(){fK();});lB=aL;};function CW(){var aE=new GIcon();var bX="mk/corner.png";aE.image=bX;aE.iconSize=new GSize(7,7);aE.iconAnchor=new GPoint(4,4);aE.infoWindowAnchor=new GPoint(4,0);var aL=new GMarker(GV,{draggable:true,icon:aE});map.addOverlay(aL);GEvent.addListener(aL,"dragend",function(){fK();});nN=aL;};function DE(){var aE=new GIcon();var bX="mk/corner.png";aE.image=bX;aE.iconSize=new GSize(7,7);aE.iconAnchor=new GPoint(4,4);aE.infoWindowAnchor=new GPoint(4,0);var aL=new GMarker(GY,{draggable:true,icon:aE});map.addOverlay(aL);GEvent.addListener(aL,"dragend",function(){fK();});nG=aL;};function fK(){var iD=nN.getPoint();var iI=nG.getPoint();var lP=lB.getPoint();var lN=iD.lng();var mI=iD.lat();var lT=iI.lng();var nP=iI.lat();var OC=lP.lng();var NZ=lP.lat();if(lN>lT){var MC=lT;lT=lN;lN=MC;}if(mI>nP){var MC=nP;nP=mI;mI=MC;}var pJ=0.7;var sK=0.1;var hX="#FF0000";var wF="#FFFF00";var tX=[new GLatLng(mI,lN),new GLatLng(mI,lT),new GLatLng(nP,lT),new GLatLng(nP,lN),new GLatLng(mI,lN)];if(pU){map.removeOverlay(pU);}pU=new GPolygon(tX,hX,1,pJ,wF,sK);map.addOverlay(pU);e("ctl00_CH1_SWXbox").value=lN;e("ctl00_CH1_SWYbox").value=mI;e("ctl00_CH1_NEXbox").value=lT;e("ctl00_CH1_NEYbox").value=nP;e("ctl00_CH1_CXbox").value=OC;e("ctl00_CH1_CYbox").value=NZ;};function loadPage(){map=new GMap2(e("mapDiv"));map.addControl(new GHierarchicalMapTypeControl());map.addControl(new GMapTypeControl());map.addControl(new GLargeMapControl());map.addMapType(G_PHYSICAL_MAP);var lN=parseFloat(e("ctl00_CH1_SWXbox").value);var mI=parseFloat(e("ctl00_CH1_SWYbox").value);var lT=parseFloat(e("ctl00_CH1_NEXbox").value);var nP=parseFloat(e("ctl00_CH1_NEYbox").value);var SN=parseFloat(e("ctl00_CH1_CXbox").value);var SM=parseFloat(e("ctl00_CH1_CYbox").value);sR=new GLatLng(SM,SN);GY=new GLatLng(nP,lT);GV=new GLatLng(mI,lN);rR=5;GX=0;if(map){map.setCenter(sR,rR);map.enableDoubleClickZoom();xY();CW();DE();fK();map.setMapType(cI[GX]);}pY();};function sF(){this.fQ=0;this.aI=0;this.nZ=null;this.oU=null;};sF.prototype.pQ=function(a){var jL=a.getAttribute('i');if(jL){this.fQ=parseInt(jL);}var cY=a.getAttribute('n');if(cY){this.aI=cY;}var KD=parseFloat(a.getAttribute('x1'));var PJ=parseFloat(a.getAttribute('y1'));var MV=parseFloat(a.getAttribute('x2'));var PH=parseFloat(a.getAttribute('y2'));this.oU=new GLatLng(PJ,KD);this.nZ=new GLatLng(PH,MV);};function pY(){var nU=e("CountryDropDown");var fY="template/country.xml";var aJ=GXmlHttp.create();aJ.open("GET",fY,true);jV=[];gY=[];aJ.onreadystatechange=function(){if(aJ.readyState==4){var dZ=aJ.responseXML;if(dZ!=null){var mR=dZ.documentElement.getElementsByTagName('pl');for(var i=0;i<mR.length;i++){aV=new sF();aV.pQ(mR[i]);gY[aV.fQ]=aV;}}}};aJ.send(null);};function selectCountry(){var gI=e("ctl00_CH1_CountryDropDownList");var gB=parseInt(gI.value);var yS=gI[gI.selectedIndex].text;var aV=gY[gB];if(aV){var aG=new GLatLngBounds();aG.extend(aV.oU);aG.extend(aV.nZ);var dB=map.getBoundsZoomLevel(aG);var cD=aG.getCenter();nG.setPoint(aV.oU);nN.setPoint(aV.nZ);lB.setPoint(cD);fK();map.setCenter(cD,dB);}};function unloadPage(){GUnload();};var bE=[];bE[G_GEO_SUCCESS]="Success";bE[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";bE[G_GEO_UNKNOWN_ADDRESS]="Unknown Address:  No corresponding geographic location could be found for the specified address.";bE[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";bE[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";bE[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";bE[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";function findArea(){var gM=e("ctl00_CH1_AreaTextBox").value;var gI=e("ctl00_CH1_CountryDropDownList");var gB=gI.value;var yS=gI[gI.selectedIndex].text;if(gB>1){if(gM.length>0){gM+=",";}gM+=yS;}var gV=new GClientGeocoder(new GGeocodeCache());gV.getLatLng(gM,function(eR){if(eR){lB.setPoint(eR);var iI=new GLatLng(eR.lat()+1,eR.lng()+1);var iD=new GLatLng(eR.lat()-1,eR.lng()-1);nN.setPoint(iD);nG.setPoint(iI);fK();var aG=new GLatLngBounds();aG.extend(iI);aG.extend(iD);var dB=map.getBoundsZoomLevel(aG);map.setCenter(eR,dB);}else{var aR=gV.getCache().get(gM);var kO="";if(aR){var kO="<b>Error "+aR.Status.code+"</b><br />";if(bE[aR.Status.code]){kO+=" "+bE[aR.Status.code];}}}});};var nS=false;function AlasCheckUrl(){var NU=e("ctl00_CH1_WebsiteUrlTextBox").value;var MD="atlascheckurl.aspx?url="+NU;var nD=function(iZ){nS=false;var uJ=e("checkResultDiv");var hS=iZ.split("\t");if(hS.length!=4){uJ.innerHTML="<span style='color:red'>Invalid URL or no response received from the site</span>";}else{var JU=parseInt(hS[0]);var IU=parseInt(e("ctl00_CH1_Ubox").value);if(JU> -1&&IU!=JU){uJ.innerHTML="<span style='color:red'>Already added by another user</span>";}else{uJ.innerHTML="<span style='color:green'>Website URL Verified</span>";e("ctl00_CH1_NameTextBox").value=hS[1];e("ctl00_CH1_DescriptionTextBox").value=hS[2];e("ctl00_CH1_TagsTextBox").value=hS[3];e("finishDiv").style.display="inline";}}};nS=true;e("checkResultDiv").innerHTML="Checking <img src='images/progress.png' alt='' />";setTimeout("atlasProgress();",500);GDownloadUrl(MD,nD);};function atlasProgress(){if(nS){var yK=e("checkResultDiv");if(yK){yK.innerHTML+="&nbsp;<img src='images/progress.png' alt='' />";setTimeout("atlasProgress();",500);}}};function atlasAutoFit(){var aG=map.getBounds();nG.setPoint(aG.getNorthEast());nN.setPoint(aG.getSouthWest());lB.setPoint(aG.getCenter());fK();};function atlasWorldwideBounds(){var aG=map.getBounds();nN.setPoint(new GLatLng(-89,-170));nG.setPoint(new GLatLng(89,170));fK();map.setZoom(1);};function confirmAtlasEdit(){var Qx=e("ctl00_CH1_EmailTextBox").value;if(Qx.length>5){return true;}else{alert("Error: please enter a valid email address");return false;}};﻿;var bE=[];bE[G_GEO_SUCCESS]="Success";bE[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";bE[G_GEO_UNKNOWN_ADDRESS]="Unknown Address:  No corresponding geographic location could be found for the specified address.";bE[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";bE[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";bE[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";bE[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";var sJ="";function atlasGeocodeInfo(){var bV=mc_atlas.fF.getPoint();var aC="<span style='font-size:20px;font-weight:bold'>"+sJ+"</span><br /><br />"+"<b>Lat:</b> "+bV.lat()+"<br />"+"<b>Lng:</b> "+bV.lng()+"<br />";mc_atlas.fF.openInfoWindowHtml(aC);};function atlasGeocode(){sJ=e("geocodeName").value;var gV=new GClientGeocoder(new GGeocodeCache());gV.getLatLng(sJ,function(eR){if(eR){map.setCenter(eR);if(mc_atlas.fF==null){mc_atlas.fF=new GMarker(eR);map.addOverlay(mc_atlas.fF);GEvent.addListener(mc_atlas.fF,'click',function(){atlasGeocodeInfo();});}else{mc_atlas.fF.setPoint(eR);mc_atlas.fF.show();}e("geocodeResult").innerHTML="Address Found";e("geocodeResult").style.color="green";e("atlasGeocodeClearBtn").style.display="inline";atlasGeocodeInfo();}else{var aR=gV.getCache().get(gM);var kO="";if(aR){var kO="<b>Error "+aR.Status.code+"</b><br />";if(bE[aR.Status.code]){kO+=" "+bE[aR.Status.code];}}e("geocodeResult").innerHTML=kO;e("geocodeResult").style.color="red";}});};function atlasGeocodeClear(){map.closeInfoWindow();e("geocodeName").value="";e("geocodeResult").innerHTML="";e("atlasGeocodeClearBtn").style.display="none";mc_atlas.fF.hide();};﻿;function initAtlasCountries(){var aC="<b>Country</b><br /><select style='width:140px'  onchange='selectCountry(this)'>";aC+="<option value='0' >All</option>";for(var i=0;i<srcAtlasCountries.length;i++){var rP=srcAtlasCountries[i];var aV=new FQ(rP);AZ.push(aV);qB[aV.dW]=aV;aC+="<option value='"+aV.dW+"' >"+aV.aI+"</option>";}aC+="</select><div style='height:4px'></div>";e("controlDiv").innerHTML+=aC;};function initAtlasClasses(){var aC="<b>Classification</b><br /><select style='width:140px'  onchange='selectClass(this)'>";aC+="<option value='0' >All</option>";for(var i=0;i<srcAtlasClasses.length;i++){var rP=srcAtlasClasses[i];var dC=new wH(rP);DH.push(dC);BB[dC.dW]=dC;aC+="<option value='"+dC.dW+"' >"+dC.aI+"</option>";}aC+="</select><div style='height:4px'></div>";e("controlDiv").innerHTML+=aC;};function initAtlasWebsites(){for(var i=0;i<srcAtlasWebsites.length;i++){var rP=srcAtlasWebsites[i];var aO=new kX(i,rP);if(qD[aO.jC]==null){fO.push(aO);qD[aO.jC]=aO;}}};function initAtlasOptions(){var aC="<b>Options</b><br />"+"<input id='showWebsiteMarkers' type='checkbox' checked='true' onchange='checkWebsiteMarkers(this)' /> Website Markers<br />"+"<input id='showGoogleBar' type='checkbox' checked='true' onchange='checkGoogleBar(this)' /> Google Bar<br />"+"<input id='showTraficLayer' type='checkbox' onchange='checkTrafficLayer(this)' /> Traffic Layer<br /><br />";e("controlDiv").innerHTML+=aC;};function initAtlasGeocoder(){var aC="<b>Geocoder</b><br />"+"Place or Town Name<br />"+"<table cellspacing='0' cellpadding='0' style='width:100%'><tr><td>"+"<input id='geocodeName' type='text' style='width:110px;font-size:10px' />"+"</td><td style='width:40px'>"+"<input type='button' onclick='atlasGeocode()' value='Find' style='width:40px;font-size:10px' />"+"</td></tr><tr><td>"+"<span id='geocodeResult'></span>"+"</td><td>"+"<input id='atlasGeocodeClearBtn' type='button' onclick='atlasGeocodeClear()' value='Clear' style='width:40px;font-size:10px;color:green;display:none' />"+"</td></tr></table>"+"<br />";e("controlDiv").innerHTML+=aC;};﻿;function FQ(cQ){this.dW=cQ[0];this.aI=cQ[1];this.BJ=cQ[2];this.BH=cQ[3];this.BG=cQ[4];this.BD=cQ[5];};function wH(cQ){this.dW=cQ[0];this.aI=cQ[1];};function kX(iY,cQ){this.dW=iY;this.jC="htpp://"+cQ[0];this.xH="";for(var i=0;i<cQ[0].length;i++){var c=cQ[0].substr(i,1);if(c=="/"){c=".";}this.xH+=c;}this.hV=cQ[1];this.gP=cQ[2];this.fQ=cQ[3];this.SL=cQ[4];this.HE=cQ[5];this.GS=cQ[6];this.BJ=cQ[7];this.BH=cQ[8];this.BG=cQ[9];this.BD=cQ[10];this.LE=cQ[11];this.uN=new GLatLng(this.GS,this.HE);this.nZ=new GLatLng(this.BH,this.BJ);this.SJ=new GLatLng(this.BH,this.BG);this.oU=new GLatLng(this.BD,this.BG);this.SK=new GLatLng(this.BD,this.BJ);this.iQ=new GLatLngBounds(this.nZ,this.oU);this.kU=null;this.fX=null;this.fC=null;this.bN=false;};kX.prototype.zX=function(eY){var pJ=0.7;var sK=0.1;var hX="#FF0000";var wF="#FFFF00";var tX=[this.nZ,this.SK,this.oU,this.SJ,this.nZ];if(eY&& !this.fX){this.fX=new GPolygon(tX,hX,1,pJ,wF,sK);map.addOverlay(this.fX);}else if(eY&&this.fX){this.fX.show();}else if(!eY&&this.fX){this.fX.hide();}};kX.prototype.DS=function(){var aC="<span style='font-size:14px;font-weight:bold' >"+this.hV+"</span><br />";if(this.fC&& !this.fC.isHidden()){this.fC.openInfoWindowHtml(aC);}else{map.openInfoWindowHtml(this.uN,aC);}this.BM();};kX.prototype.BM=function(){mc_atlas.nF=10;var kQ="<iframe src='atlas/html/"+this.xH+".htm' style='width:160px;height:560px;padding:0px' marginwidth='0' marginheight='0' frameborder='0' scrolling='no' ></iframe>";e("descriptionDiv").innerHTML=kQ;e("descriptionDiv").style.display="block";e("outerIndexDiv").style.display="none";};function vW(){e("descriptionDiv").innerHTML="";e("descriptionDiv").style.display="none";e("outerIndexDiv").style.display="block";};kX.prototype.cB=function(){var aO=this;var aE=new GIcon();var bX="http://mcmarkers.googlepages.com/iimm2-green.png";aE.image=bX;aE.iconSize=new GSize(32,32);aE.shadow="http://mcmarkers.googlepages.com/iimm2-shadow.png";aE.shadowSize=new GSize(59,32);aE.printImage=bX;aE.mozPrintImage=bX;aE.iconAnchor=new GPoint(16,31);aE.infoWindowAnchor=new GPoint(16,0);aE.infoShadowAnchor=new GPoint(0,31);aK=new GMarker(aO.uN,{icon:aE,title:aO.hV});aO.fC=aK;map.addOverlay(aK);GEvent.addListener(aK,'click',function(){aO.DS();});GEvent.addListener(aK,"mouseover",function(){var yJ=e("wr"+aO.dW);wsHi(yJ);});GEvent.addListener(aK,"mouseout",function(){var yJ=e("wr"+aO.dW);wsLo(yJ);});};﻿;var cC=[];var gR=[];var hP=[];function BN(w1,w2){var v1=w1.OE;var v2=w2.OE;var aR=((v1<v2)? -1:((v1>v2)?1:0));return aR;};MC_Atlas.prototype.updateView=function(){var aG=map.getBounds();gR=[];hP=[];for(var i=0;i<cC.length;i++){var aO=cC[i];aO.bN=false;gR.push(aO);hP[aO.dW]=aO;}cC=[];for(var i=0;i<fO.length;i++){var aO=fO[i];var pE=false;if(aG.contains(aO.uN)){if((mc_atlas.gP==0)||(mc_atlas.gP==aO.gP)){pE=true;}}if(pE){aO.bN=true;cC.push(aO);if(hP[aO.dW]){gR.push(aO);hP[aO.dW]=aO;}}}cC.sort(BN);for(var i=0;i<gR.length;i++){var aO=gR[i];if(!this.kN|| !aO.bN){var aL=aO.fC;if(aL){aL.hide();}}}var aC="";if(cC.length==0){aC+="<span style='color:red'>No websites within view</span>";}else{var s=cC.length==1?"":"s";aC+="<div style='color:white;background-color:green;font-weight:bold;padding:2px'>"+cC.length+" website"+s+" within view</div>";}aC+="<table cellspacing='0' cellpadding='0' style='width:100%'>";for(var i=0;i<cC.length;i++){var aO=cC[i];aO.OE=100;var bU=this.kU?" checked=true":"";aC+="<tr><td id='wr"+aO.dW+"' onmouseover='wsHi(this)' onmouseout='wsLo(this)' onclick='wsClick(this)' style='border:solid 1px white;width:100%'>"+aO.hV+"</td></tr>";if(this.kN){if(aO.fC){aO.fC.show();}else{aO.cB();}this.bN=true;}}aC+="</table>";e("indexDiv").innerHTML=aC;};function wsHi(a){a.style.backgroundColor="yellow";a.style.color="darkgreen";a.style.border="solid 1px red";if(mc_atlas.OH){a.style.cursor="hand";}else{a.style.cursor="pointer";}var jL=parseInt(a.id.substr(2));var aO=fO[jL];aO.zX(true);var aK=aO.fC;if(aK){aK.setImage("http://mcmarkers.googlepages.com/iimm2-orange.png");}};function wsLo(a){a.style.backgroundColor="white";a.style.color="black";a.style.border="solid 1px white";var jL=parseInt(a.id.substr(2));var aO=fO[jL];aO.zX(false);var aK=aO.fC;if(aK){aK.setImage("http://mcmarkers.googlepages.com/iimm2-green.png");}};function wsClick(a){var jL=parseInt(a.id.substr(2));var aO=fO[jL];aO.DS();}
