﻿MCPM.prototype.bf=function(){if(navigator.userAgent.indexOf("Firefox")!= -1){this.G=1;}else if(navigator.userAgent.indexOf("MSIE")!= -1){this.G=2;}else if(navigator.userAgent.indexOf("Safari")!= -1){this.G=3;}else if(navigator.userAgent.indexOf("Opera")!= -1){this.G=4;}return this.G;};function bb(ad,aG,ap,at,ah,aB){var aV=ad+"="+escape(aG)+((ap)?"; expires="+ap.toGMTString():"")+((at)?"; path="+at:"")+((ah)?"; domain="+ah:"")+((aB)?"; secure":"");document.cookie=aV;};function bi(ad){var L=document.cookie;var R=ad+"=";var v=L.indexOf("; "+R);if(v== -1){v=L.indexOf(R);if(v!=0){return null;}}else{v+=2;}var ae=document.cookie.indexOf(";",v);if(ae== -1){ae=L.length;}return unescape(L.substring(v+R.length,ae));};var al=new Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var aZ=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");var aU=[0,31,28,31,30,31,30,31,31,31,31,30,31];var SECONDS_CF=1000;var MINUTES_CF=60000;var HOURS_CF=3600000;var DAYS_CF=86400000;var WEEKS_CF=604800000;var FORTNIGHTS_CF=1209600000;var MONTHS_CF=2592000000;var QUARTERS_CF=7776000000;var YEARS_CF=31557600000;var DECADES_CF=315576000000;var CENTURIES_CF=3155760000000;Date.prototype.aM=function(ms){return new Date(new Date().setTime(this.getTime()+(ms)));};Date.prototype.bm=function(d){return this.aM(d*DAYS_CF);};Date.prototype.bo=function(m){var C=this.getDate();var g=this.getMonth();var o=this.getFullYear();if(m>0){g+=m;while(g>11){g-=12;o++;}}else if(m<0){g+=m;while(g<0){g+=12;o--;}}var aj=new Date();aj.setFullYear(o,g,C);return aj;};function TimeSpan(ms){this.milliseconds=Math.abs(ms);this.seconds=Math.round(this.milliseconds/SECONDS_CF);this.minutes=Math.round(this.milliseconds/MINUTES_CF);this.hours=Math.round(this.milliseconds/HOURS_CF);this.days=Math.round(this.milliseconds/DAYS_CF);this.weeks=Math.round(this.milliseconds/WEEKS_CF);this.fortnights=Math.round(this.milliseconds/FORTNIGHTS_CF);this.months=Math.round(this.milliseconds/MONTHS_CF);this.quarters=Math.round(this.milliseconds/QUARTERS_CF);this.years=Math.round(this.milliseconds/YEARS_CF);this.decades=Math.round(this.milliseconds/DECADES_CF);this.centuries=Math.round(this.milliseconds/CENTURIES_CF);};TimeSpan.prototype.toString=function(){return this.milliseconds.toString();};function aH(A,H){if((A==2)&&((H%4)==0)){return 29;}else{return aU[A];}};function bj(l,aE,A,H){var aQ=aH(A,H);l.options.length=0;for(var i=0;i<aQ;i++){var C=i+1;var r=(aE==C);var V=C.toString();var F=new Option(V,C,r,r);l.options[i]=F;}};function bk(l,A,H){var ao=new Date();var g=ao.getMonth();var o=ao.getFullYear();var aS=12;l.options.length=0;for(var i=0;i<aS;i++){var V=al[g+1]+" "+o;var r=((g+1)==A)&&(o==H);var aP=(o*100)+(g+1);var F=new Option(V,aP,r,r);l.options[i]=F;g++;if(g>11){g=0;o++;}}};function aY(l,aI){l.options.length=0;for(var i=1;i<=30;i++){var r=(i==aI);var F=new Option(i,i,r,r);l.options[i]=F;}};;MCPM.prototype.directionsFind=function(){this.mainMode=1;this.mappanNormal();this.aw();};MCPM.prototype.directionsKey=function(aD){var aK=aD.keyCode;if(aK==13){this.directionsFind();return false;}return true;};MCPM.prototype.directionsClose=function(){if(this.j){this.j.clear();this.j=null;}this.mapDefaults();};MCPM.prototype.aw=function(ba){if(this.j){this.j.clear();this.j=null;}var O=this.e("dirText").value;this.aT=O;if(O.length>0){this.e("dirTitle").innerHTML="Finding Directions ...";this.e("dirInnerDiv").innerHTML="";var aX="from: "+O+" to: "+this.name+"@"+this.mapPoint.lat()+","+this.mapPoint.lng();var aW=this.e("dirInnerDiv");this.j=new GDirections(this.map,aW);GEvent.addListener(mcpm.j,"load",PMDirectionsLoaded);GEvent.addListener(mcpm.j,"error",PMDirectionsError);var bl=this.j.load(aX);}else{alert("Please enter a start address");}};function PMDirectionsLoaded(){mcpm.e("dirTitle").innerHTML="Directions:";};function PMDirectionsError(){var k=[];k[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";k[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";k[G_GEO_UNKNOWN_ADDRESS]="No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.";k[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";k[G_GEO_SERVER_ERROR]="A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.";k[G_GEO_MISSING_QUERY]="The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.";k[G_GEO_BAD_KEY]="The given key is either invalid or does not match the domain for which it was given.";k[G_GEO_BAD_REQUEST]="A directions request could not be successfully parsed.";var T=mcpm.j.getStatus().code;if(T!=G_GEO_SUCCESS){if(k[T]){aq=k[T];}else{aq="Unable to obtain directions";}mcpm.e("dirTitle").innerHTML="Directions";mcpm.e("dirInnerDiv").innerHTML="<div style='padding-left:8px'>"+"<h2 style='color:slategray'>Find Directions Error</h2>"+"From "+mcpm.aT+"<br/><br/>"+"<div style='color:slategray'>"+aq+"</div></div>";}};;MCPM.prototype.aA=function(aF,aa){var aL=new GClientGeocoder(new GGeocodeCache());aL.getLatLng(aF,function(J){if(J){mcpm.x=J.lng();mcpm.y=J.lat();mcpm.mapPoint=J;(aa)();}else{mcpm.e("frameDiv").style.display="none";}});};;MCPM.prototype.mapHelp=function(){this.directionsClose();this.mainMode=2;this.mappanNormal();};MCPM.prototype.mapHelpClose=function(){this.mainMode=0;this.mappanNormal();};;function MCPM(){this.controlWidth=960;this.controlHeight=420;this.name="";this.address="";this.town="";this.region="";this.postcode="";this.country="";this.link="";this.initialStreetPoint;this.initialStreetHeading;this.initialStreetPitch;this.initialStreetZoom;this.initialMapPoint;this.initialMapType;this.initialMapZoom;this.mainMode=0;this.viewMode=0;this.map=null;this.mapPoint=null;this.mapTypes=[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP];this.G=0;this.panoramioLayer=null;this.wikipediaLayer=null;this.trafficLayer=null;this.panoramioLayerOn=false;this.wikipediaLayerOn=false;this.trafficLayerOn=false;this.scrollzoomOn=false;this.searchOn=false;this.streetviewOn=false;this.streetOverlay=null;this.streetviewClient=null;this.streetMarker=null;this.panorama=null;this.panInitialized=false;this.streetPoint=null;this.streetHeading=0;this.streetPitch=0;this.streetZoom=0;this.streetPanoID="";this.streetTitle="";this.streetviewUI=true;this.panoramioUI=true;this.wikipediaUI=true;this.trafficUI=true;this.scrollzoomUI=true;this.searchUI=false;this.directionsUI=true;this.permalinkUI=true;};function loadPage(){mcpm.initMap();};function unloadPage(){GUnload();};function resizePage(){mcpm.resizeFrame();};;MCPM.prototype.initMap=function(){var t=this.e("mapDiv");if(t){this.e("svBox").checked=false;this.e("wiBox").checked=false;this.e("paBox").checked=false;this.e("trBox").checked=false;this.e("szBox").checked=false;this.e("seBox").checked=false;this.e("dirText").value="";if(this.x==0&&this.y==0){var aR=this.address+" "+this.town+" "+this.region+" "+this.postcode+" "+this.country;this.aA(aR,mcpm.initMap2);}else{this.initMap2();}}};MCPM.prototype.initMap2=function(){mcpm.initStreetViewClient();mcpm.mapPoint=new GLatLng(mcpm.y,mcpm.x);if(mcpm.accuracy==0&&(mcpm.streetX==0&&mcpm.streetY==0)){mcpm.getInitialStreetPoint(mcpm.initMap3);}else{mcpm.initMap3();}};MCPM.prototype.initMap3=function(){mcpm.resizeElements();if(mcpm.streetX!=0||mcpm.streetY!=0){mcpm.streetPoint=new GLatLng(mcpm.streetY,mcpm.streetX);}mcpm.initialStreetPoint=mcpm.streetPoint;mcpm.initialStreetHeading=mcpm.streetHeading;mcpm.initialStreetPitch=mcpm.streetPitch;mcpm.initialStreetZoom=mcpm.streetZoom;var t=mcpm.e("mapDiv");var gbOptions={showOnLoad:true};var map=new GMap2(t,{googleBarOptions:gbOptions});mcpm.map=map;map.addMapType(G_PHYSICAL_MAP);map.addControl(new GMenuMapTypeControl);map.addControl(new GLargeMapControl());map.addControl(new GScaleControl());map.enableDoubleClickZoom();map.enableContinuousZoom();map.setCenter(mcpm.mapPoint,mcpm.mapZoom);map.setMapType(mcpm.mapTypes[mcpm.mapType]);var f=new GIcon();var af="http://mk.mapchannels.com/iimm2-blue.png";f.image=af;f.iconSize=new GSize(32,32);f.shadow="mk/shadow.png";f.shadowSize=new GSize(59,32);f.printImage=af;f.mozPrintImage=af;f.iconAnchor=new GPoint(16,31);f.infoWindowAnchor=new GPoint(16,0);f.infoShadowAnchor=new GPoint(0,31);var ab=new GMarker(mcpm.mapPoint,{"icon":f,"title":mcpm.name});map.addOverlay(ab);var aJ="<b>"+mcpm.name+"</b><br />"+mcpm.address+"<br />"+mcpm.town+"<br />"+mcpm.region+" "+mcpm.postcode+"<br />"+mcpm.country;GEvent.addListener(ab,"click",function(){ab.openInfoWindowHtml(aJ);});mcpm.updateGoogleMapsLink();mcpm.initStreetViewOverlay();if(mcpm.streetPoint!=null){if(mcpm.streetPoint!=null){mcpm.initPanorama(mcpm.streetPoint);}}if(mcpm.streetPoint==null){mcpm.streetviewUI=false;}if(mcpm.streetviewUI){mcpm.e("svSpan").style.display="inline";}else{mcpm.e("svHelp").style.display="none";}if(mcpm.panoramioUI){mcpm.e("paSpan").style.display="inline";}else{mcpm.e("paHelp").style.display="none";}if(mcpm.wikipediaUI){mcpm.e("wiSpan").style.display="inline";}else{mcpm.e("wiHelp").style.display="none";}if(mcpm.trafficUI){mcpm.e("trSpan").style.display="inline";}else{mcpm.e("trHelp").style.display="none";}if(mcpm.scrollzoomUI){mcpm.e("szSpan").style.display="inline";}else{mcpm.e("szHelp").style.display="none";}if(mcpm.searchUI){mcpm.e("seSpan").style.display="inline";}else{mcpm.e("seHelp").style.display="none";}if(mcpm.directionsUI){mcpm.e("directionsSpan").style.display="inline";}else{mcpm.e("dirHelp").style.display="none";}if(mcpm.permalinkUI){mcpm.e("permalinkSpan").style.display="inline";}};;MCPM.prototype.checkTraffic=function(a){if(!this.trafficLayer){this.trafficLayer=new GTrafficOverlay();}this.trafficLayerOn= !this.trafficLayerOn;if(this.trafficLayerOn){this.map.addOverlay(this.trafficLayer);}else{this.map.removeOverlay(this.trafficLayer);}};MCPM.prototype.clickTraffic=function(a){this.checkTraffic();this.e("trBox").checked=this.trafficLayerOn;};MCPM.prototype.checkPanoramio=function(a){if(!this.panoramioLayer){this.panoramioLayer=new GLayer("com.panoramio.all");}this.panoramioLayerOn= !this.panoramioLayerOn;if(this.panoramioLayerOn){this.map.addOverlay(this.panoramioLayer);}else{this.map.removeOverlay(this.panoramioLayer);}};MCPM.prototype.clickPanoramio=function(a){this.checkPanoramio();this.e("paBox").checked=this.panoramioLayerOn;};MCPM.prototype.checkWikipedia=function(a){if(!this.wikipediaLayer){this.wikipediaLayer=new GLayer("org.wikipedia.en");}this.wikipediaLayerOn= !this.wikipediaLayerOn;if(this.wikipediaLayerOn){this.map.addOverlay(this.wikipediaLayer);}else{this.map.removeOverlay(this.wikipediaLayer);}};MCPM.prototype.clickWikipedia=function(a){this.checkWikipedia();this.e("wiBox").checked=this.wikipediaLayerOn;};MCPM.prototype.checkScrollzoom=function(){this.scrollzoomOn= !this.scrollzoomOn;if(this.scrollzoomOn){this.map.enableScrollWheelZoom();}else{this.map.disableScrollWheelZoom();}};MCPM.prototype.clickScrollzoom=function(){this.checkScrollzoom();this.e("szBox").checked=this.scrollzoomOn;};MCPM.prototype.checkSearch=function(){this.searchOn= !this.searchOn;if(this.searchOn){this.map.enableGoogleBar();}else{this.map.disableGoogleBar();}};MCPM.prototype.clickSearch=function(){this.checkSearch();this.e("seBox").checked=this.searchOn;};MCPM.prototype.mapDefaults=function(){this.mainMode=0;this.e("svBox").checked=false;this.e("wiBox").checked=false;this.e("paBox").checked=false;this.e("trBox").checked=false;this.e("szBox").checked=false;this.e("seBox").checked=false;if(this.trafficLayerOn){this.trafficLayerOn=false;this.map.removeOverlay(this.trafficLayer);}if(this.panoramioLayerOn){this.panoramioLayerOn=false;this.map.removeOverlay(this.panoramioLayer);}if(this.wikipediaLayerOn){this.wikipediaLayerOn=false;this.map.removeOverlay(this.wikipediaLayer);}if(this.scrollzoomOn){this.map.disableScrollWheelZoom();this.scrollzoomOn=false;}if(this.searchOn){this.map.disableGoogleBar();this.searchOn=false;}if(this.streetviewOn){this.map.removeOverlay(this.streetOverlay);this.streetviewOn=false;}if(this.j){this.j.clear();this.j=null;}this.streetPoint=this.initialStreetPoint;this.streetHeading=this.initialStreetHeading;this.streetPitch=this.initialStreetPitch;this.streetZoom=this.initialStreetZoom;this.resizeElements();this.mappanNormal();this.map.closeInfoWindow();this.map.checkResize();if(this.panorama){this.panorama.checkResize();}this.map.setCenter(this.mapPoint,this.mapZoom);this.map.setMapType(this.mapTypes[this.mapType]);if(this.streetPoint){this.initPanorama(this.streetPoint);}};MCPM.prototype.updateGoogleMapsLink=function(){var pt=this.map.getCenter();var z=this.map.getZoom();var link=this.e("googleMapsLink");var html="http://maps.google.com/maps?"+"q="+this.formatNameForURL(this.name)+"%40"+pt.lat()+","+pt.lng();if(this.streetPoint!=null){html+="&z="+z+"&layer=c"+"&cbp=1,"+parseInt(this.streetHeading)+",,"+this.streetZoom+","+this.streetPitch+"&cbll="+this.streetPoint.lat()+","+this.streetPoint.lng()+"&panoid="+this.streetPanoID;}if(this.panoramioLayerOn&&this.wikipediaLayerOn){html+="&lci=lmc:panoramio,lmc:wikipedia_en";}else if(this.panoramioLayerOn){html+="&lci=lmc:panoramio";}else if(this.wikipediaLayerOn){html+="&lci=lmc:lmc:wikipedia_en";}link.href=html;};;MCPM.prototype.resizeFrame=function(){};MCPM.prototype.resizeElements=function(){var t=this.e("mapDiv");var B=this.e("panDiv");var ag=this.e("dirDiv");var as=this.e("dirInnerDiv");var ac=this.e("helpDiv");var ar=this.e("helpInnerDiv");var am=this.e("controlDiv");var w=parseInt((this.controlWidth-12)/2);t.style.width=w+"px";B.style.width=w+"px";ag.style.width=w+"px";as.style.width=(w-12)+"px";ac.style.width=w+"px";ar.style.width=(w-8)+"px";am.style.width=this.controlWidth+"px";t.style.height=this.controlHeight+"px";B.style.height=this.controlHeight+"px";ag.style.height=this.controlHeight+"px";as.style.height=(this.controlHeight-36)+"px";ac.style.height=this.controlHeight+"px";ar.style.height=(this.controlHeight-24)+"px";t.style.display="block";B.style.display="block";am.style.display="block";this.e("bar2aDiv").style.display="block";this.e("bar2bDiv").style.display="block";ac.style.display="none";ag.style.display="none";this.e("bar1Div").style.display="none";this.e("bar3Div").style.display="none";this.viewMode=0;this.mainMode=0;if(this.streetPoint==null){mcpm.mapFull();}};MCPM.prototype.mapFull=function(){if(this.map){var pt=this.map.getCenter();}this.e("panDiv").style.display="none";this.e("dirDiv").style.display="none";this.e("helpDiv").style.display="none";this.e("mapDiv").style.display="block";this.e("mapDiv").style.width=this.controlWidth+"px";this.e("bar1Div").style.display="none";this.e("bar2aDiv").style.display="none";this.e("bar2bDiv").style.display="none";this.e("bar3Div").style.display="none";if(this.map){this.map.checkResize();this.map.setCenter(pt);}};MCPM.prototype.mapMaximize=function(){if(this.mainMode==0&&this.streetPoint==null){mcpm.mapFull();return;}var pt=this.map.getCenter();this.e("panDiv").style.display="none";this.e("dirDiv").style.display="none";this.e("helpDiv").style.display="none";this.e("mapDiv").style.display="block";this.e("mapDiv").style.width=(this.controlWidth-12)+"px";this.e("bar2aDiv").style.display="none";this.e("bar2bDiv").style.display="none";this.e("bar3Div").style.display="block";this.map.checkResize();this.map.setCenter(pt);};MCPM.prototype.panMaximize=function(){this.e("mapDiv").style.display="none";this.e("panDiv").style.display=(this.mainMode==0)?"block":"none";this.e("dirDiv").style.display=(this.mainMode==1)?"block":"none";this.e("helpDiv").style.display=(this.mainMode==2)?"block":"none";this.e("dirDiv").style.width=(this.controlWidth-12)+"px";this.e("dirInnerDiv").style.width=(this.controlWidth-24)+"px";this.e("helpDiv").style.width=(this.controlWidth-12)+"px";this.e("helpInnerDiv").style.width=(this.controlWidth-8)+"px";this.e("panDiv").style.width=(this.controlWidth-12)+"px";this.e("bar2aDiv").style.display="none";this.e("bar2bDiv").style.display="none";this.e("bar1Div").style.display="block";this.panorama.checkResize();};MCPM.prototype.mappanNormal=function(){if(this.mainMode==0&&this.panorama==null){this.mapFull();return;}var pt=this.map.getCenter();this.e("mapDiv").style.display="block";this.e("dirDiv").style.display="none";this.e("helpDiv").style.display="none";this.e("bar1Div").style.display="none";this.e("bar3Div").style.display="none";this.e("panDiv").style.display=(this.mainMode==0)?"block":"none";this.e("dirDiv").style.display=(this.mainMode==1)?"block":"none";this.e("helpDiv").style.display=(this.mainMode==2)?"block":"none";this.e("bar2aDiv").style.display="block";this.e("bar2bDiv").style.display="block";var w=parseInt((this.controlWidth-12)/2);this.e("mapDiv").style.width=w+"px";this.e("panDiv").style.width=w+"px";this.e("dirDiv").style.width=w+"px";this.e("dirInnerDiv").style.width=(w-12)+"px";this.e("helpDiv").style.width=w+"px";this.e("helpInnerDiv").style.width=(w-8)+"px";this.map.checkResize();this.map.setCenter(pt);if(this.panorama&&(this.mainMode==0)){this.panorama.checkResize();this.initPanorama(this.streetPoint);}};;MCPM.prototype.initStreetViewClient=function(){this.streetviewClient=new GStreetviewClient();};MCPM.prototype.initStreetViewOverlay=function(){this.streetOverlay=new GStreetviewOverlay();GEvent.addListener(this.map,"click",function(overlay,point){if(mcpm.streetviewOn){mcpm.initPanorama(point);}});};MCPM.prototype.checkSvBox=function(){this.streetviewOn= !this.streetviewOn;if(this.streetviewOn){if(!this.streetviewClient){this.streetviewClient=new GStreetviewClient();this.streetOverlay=new GStreetviewOverlay();this.map.addOverlay(this.streetOverlay);GEvent.addListener(mcpm.map,"click",function(overlay,point){if(mcpm.streetviewOn){mcpm.initPanorama(point);}});}else{this.map.addOverlay(this.streetOverlay);}}else{this.map.removeOverlay(this.streetOverlay);}};MCPM.prototype.clickSvBox=function(){this.checkSvBox();this.e("svBox").checked=this.streetviewOn;};MCPM.prototype.createPanorama=function(container){if(this.panorama==null){this.panorama=new GStreetviewPanorama(container);this.panorama.setLocationAndPOV(this.streetPoint,{"yaw":this.streetHeading,"pitch":this.streetPitch,"zoom":this.streetZoom});GEvent.addListener(mcpm.panorama,"yawchanged",function(a){mcpm.streetHeading=parseFloat(a);mcpm.updateStreetMarker(false);});GEvent.addListener(mcpm.panorama,"pitchchanged",function(a){mcpm.streetPitch=parseFloat(a);});GEvent.addListener(mcpm.panorama,"zoomchanged",function(a){mcpm.streetZoom=parseInt(a);});GEvent.addListener(mcpm.panorama,"initialized",function(a){mcpm.streetPoint=a.latlng;mcpm.streetTitle=a.description;mcpm.streetPanoID=a.panoId;mcpm.updateStreetMarker(true);});var pt=mcpm.map.getCenter();mcpm.mappanNormal();mcpm.map.setCenter(pt);}};MCPM.prototype.initPanorama=function(point){if(!this.panInitialized){this.panInitialized=true;var B=this.e("panDiv");this.createPanorama(B);}this.streetviewClient.getNearestPanorama(point,mcpm.initPanorama2);};MCPM.prototype.initPanorama2=function(param){if(param){var location=param.location;if(location){mcpm.streetPoint=location.latlng;mcpm.streetTitle=location.description;mcpm.panorama.setLocationAndPOV(mcpm.streetPoint,{"yaw":mcpm.streetHeading,"pitch":mcpm.streetPitch,"zoom":mcpm.streetZoom});mcpm.updateStreetMarker(false);}}};MCPM.prototype.updateStreetMarker=function(recentre){if(!this.streetMarker){var f=new GIcon();var M=Math.round(this.streetHeading/22.5)%16;var P="http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-"+M+".png";f.image=P;f.iconSize=new GSize(49,52);f.printImage=f.image;f.mozPrintImage=f.image;f.iconAnchor=new GPoint(25,36);f.infoWindowAnchor=new GPoint(25,6);this.streetMarker=new GMarker(this.streetPoint,{"icon":f,"draggable":true});GEvent.addListener(mcpm.streetMarker,"dragend",function(){mcpm.streetPoint=mcpm.streetMarker.getPoint();mcpm.initPanorama(mcpm.streetPoint);});this.map.addOverlay(this.streetMarker);}else{var M=Math.round(this.streetHeading/22.5)%16;var P="http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-"+M+".png";this.streetMarker.setImage(P);this.streetMarker.setPoint(this.streetPoint);}if(recentre){this.map.setCenter(this.streetPoint);}this.updateGoogleMapsLink();};MCPM.prototype.getInitialStreetPoint=function(aa){this.streetviewClient.getNearestPanorama(this.mapPoint,cbInitial);function cbInitial(param){if(param){var location=param.location;if(location){mcpm.streetPoint=location.latlng;mcpm.streetX=mcpm.streetPoint.lng();mcpm.streetY=mcpm.streetPoint.lat();mcpm.streetHeading=mcpm.az(mcpm.streetPoint,mcpm.mapPoint);var distance=mcpm.streetPoint.distanceFrom(mcpm.mapPoint);distance=parseInt(distance);mcpm.e("messageDiv").innerHTML="<span style='color:gray'>The initial street view is the nearest found to the marker location (distance: "+distance+" metres)</span>";}}(aa)();}};;function MCJSON(aC){this.ax=aC;this.au='&noCacheIE='+(new Date()).getTime();this.ak=document.getElementsByTagName("head").item(0);};MCJSON.prototype.bc=function(){this.I=document.createElement("script");this.I.setAttribute("type","text/javascript");this.I.setAttribute("charset","utf-8");this.I.setAttribute("src",this.ax+this.au);};MCJSON.prototype.bp=function(){this.ak.removeChild(this.I);};MCJSON.prototype.bd=function(){this.ak.appendChild(this.I);};;MCPM.prototype.e=function(id){return document.getElementById(id);};MCPM.prototype.ay=function(pFloat,pDp){var m=Math.pow(10,pDp);return parseInt(pFloat*m,10)/m;};MCPM.prototype.bn=function(Q){var U=Math.floor(Math.random()*Q);return U;};MCPM.prototype.be=function(Q){var U=Math.random()*Q;return U;};var al=new Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");MCPM.prototype.zoomIn=function(){this.map.zoomIn();};MCPM.prototype.zoomOut=function(){this.map.zoomOut();};MCPM.prototype.bh=function(K){var an="";for(var i=0;i<K.length;i++){var c=K.substr(i,1);if(c==" "){if((i<K.length-1)&&(K.substr(i+1,1)==" ")){c=" ";i++;}else{c="&nbsp;";}}an+=c;}return an;};MCPM.prototype.bg=function(av,ret){var aN=parseFloat(av);var D=this.ay(aN,2).toString();var ai=D.indexOf(".");if(ai>0){var aO=D.length-ai;if(aO<3){D+="0";}}else{D+=".00";}return D;};MCPM.prototype.formatNameForURL=function(name){var formatted="";for(var i=0;i<name.length;i++){var c=name.substr(i,1);if(c==' '){formatted+='+';}else{formatted+=c;}}return formatted;};MCPM.prototype.az=function(p1,p2){var angle=null;if(p1!=null&&p2!=null&& !p1.equals(p2)){var y1=p1.latRadians();var x1=p1.lngRadians();var y2=p2.latRadians();var x2=p2.lngRadians();var a=Math.sin(x1-x2)*Math.cos(y2);var b=Math.cos(y1)*Math.sin(y2)-Math.sin(y1)*Math.cos(y2)*Math.cos(x1-x2);angle= -(Math.atan2(a,b));if(angle<0.0){angle+=Math.PI*2.0;}}return parseInt(angle*180.0/Math.PI);}