var minSSCityTileXY=null;var maxSSCityTileXY=null;var minSSCityLatLong=null;var maxSSCityLatLong=null;function CheckSSCityLatLongBox(b,c){if(b>=minSSCityLatLong.latitude&&b<=maxSSCityLatLong.latitude&&c>=minSSCityLatLong.longitude&&c<=maxSSCityLatLong.longitude)return true;else return false;}function GetEvent(e){return e?e:window.event;}function CancelEvent(e){e.cancelBubble=true;}function IgnoreEvent(e){e=GetEvent(e);CancelEvent(e);return false;}function GetMouseX(e){var posX=0;if(e.pageX)posX=e.pageX;else{if(e.clientX){if(document.documentElement&&document.documentElement.scrollLeft)posX=e.clientX+document.documentElement.scrollLeft;else{if(document.body)posX=e.clientX+document.body.scrollLeft;}}}return posX;}function GetMouseY(e){var posY=0;if(e.pageY)posY=e.pageY;else{if(e.clientY){if(document.documentElement&&document.documentElement.scrollTop)posY=e.clientY+document.documentElement.scrollTop;else{if(document.body)posY=e.clientY+document.body.scrollTop;}}}return posY;}function GetMouseScrollDelta(e){if(e.wheelDelta)return e.wheelDelta;else{if(e.detail)return -e.detail;}return 0;}function GetTarget(e){if(!e)e=window.event;var t=null;if(e.srcElement)t=e.srcElement;else{if(e.target)t=e.target;}if(t&&t.nodeType){if(t.nodeType==3)t=targ.parentNode;}return t;}function GetLeftPosition(e){var offsetTrail=e;var offsetLeft=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;offsetTrail=offsetTrail.offsetParent;}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined")offsetLeft+=document.body.leftMargin;return offsetLeft;}function GetTopPosition(g){var offsetTrail=g;var offsetTop=0;while(offsetTrail){offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent;}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.topMargin!="undefined")offsetTop+=document.body.topMargin;return offsetTop;}function MathFloor(x){return Math.floor(x);}function MathCeil(x){return Math.ceil(x);}function MathMax(x,y){return Math.max(x,y);}function MathMin(x,y){return Math.min(x,y);}function MathAbs(x){return Math.abs(x);}function MathRound(x){return Math.round(x);}function DegToRad(d){return d*Math.PI/180;}function RadToDeg(r){return r*180/Math.PI;}function MatrixMultiply(a,b){if(!a||!b||a[0].length!=b.length)return;var height=a.length;var width=b[0].length;var result=new Array(height);var z=b.length;for(var i=0;i<height;i++){result[i]=new Array(width);for(var j=0;j<width;j++){result[i][j]=0;for(var k=0;k<z;k++){result[i][j]+=a[i][k]*b[k][j];}}}return result;}function RegisterNamespaces(){for(var i=0;i<arguments.length;i++){var astrParts=arguments[i].split(".");var root=window;for(var j=0;j<astrParts.length;j++){if(!root[astrParts[j]])root[astrParts[j]]=new Object();root=root[astrParts[j]];}}}RegisterNamespaces("Msn.VE");Msn.VE.MapControl=function(j,k){var offsetMeters=20971520;var baseMetersPerPixel=163840;var buffer=0;var animatedMovementEnabled=true;var zoomTotalSteps=6;var keyboardPanSpeed=10;var panToLatLongSpeed=15;var earthRadius=6378137;var earthCircumference=earthRadius*2*Math.PI;var projectionOffset=earthCircumference*0.5;var minZoom=1;var maxZoom=19;var emptyTile="http://virtualearth.msn.com/i/spacer.gif";var minLatitude=-85;var maxLatitude=85;var minLongitude=-180;var maxLongitude=180;var tileSize=256;var generations=new Object();var kbInputZIndex=0;var containerZIndex=0;var mapZIndex=1;var swapZIndex=1;var baseZIndex=2;var debugZIndex=3;var baseZIndex=11;var topZIndex=20;var p_this=this;var roadStyle="r";var hybridStyle="h";var aerialStyle="a";var obliqueStyle="o";var currentView=new Msn.VE.MapView();var preferredView=new Msn.VE.MapView();var previousZoomLevel=1;var previousMapStyle=null;var lastOrthoZoomLevel=15;var lastOrthoMapStyle=roadStyle;var x=0;var y=0;var width=0;var height=0;var currentTilesList=new Array();var oldTilesList=null;var originX=0;var originY=0;var offsetX=0;var offsetY=0;var tileViewportX1=0;var tileViewportY1=0;var tileViewportX2=0;var tileViewportY2=0;var tileViewportWidth=0;var tileViewportHeight=0;var dragging=false;var keyboardPan=false;var lastMouseX=0;var lastMouseY=0;var zooming=false;var zoomCounter=0;var panning=false;var panCounter=0;var panningX=0;var panningY=0;var panLatitude=null;var panLongitude=null;var pushpins=new Array();var lines=new Array();var map=document.createElement("div");var keyboard=document.createElement("input");keyboard.id="wl_ve_mapInput";var logo=null;var scaleBar=null;var copyright=null;var dashboardContainer=null;var dashboard=null;var boxTool=null;var panTool=null;var currentTool=null;var orthoMode=null;var obliqueMode=null;var currentMode=null;var currentBounds=null;var eventTable=new Array();var debug=false;this.Init=function(){generations[roadStyle]=1;generations[aerialStyle]=1;generations[hybridStyle]=1;generations[obliqueStyle]=1;orthoMode=new Zj();orthoMode.Init();if(k.obliqueEnabled&&k.obliqueUrl){obliqueMode=new ej();obliqueMode.Init(k.obliqueUrl);}m();map.className="Map";map.style.zIndex=mapZIndex;j.appendChild(map);keyboard.className="KeyboardInput";j.appendChild(keyboard);if(!k.fixedView){boxTool=new Ak();boxTool.Init();panTool=new Jk();panTool.Init();currentTool=panTool;j.attachEvent("onmousedown",le);j.attachEvent("onmouseup",ne);j.attachEvent("onmousemove",me);j.attachEvent("onmousewheel",pe);j.attachEvent("ondblclick",oe);j.attachEvent("oncontextmenu",qe);if(window.addEventListener&&navigator.product&&navigator.product=="Gecko")j.addEventListener("DOMMouseScroll",pe,false);buffer=tileSize;}if(k.buffer!=undefined&&k.buffer!=null)buffer=k.buffer;if(k.latitude&&k.longitude&&k.zoomlevel&&k.mapstyle)try{var initialView=new Msn.VE.MapView();initialView.SetMapStyle(A(k.mapstyle),k.obliqueSceneId);initialView.SetZoomLevel(eval(k.zoomlevel));initialView.SetCenterLatLong(new Msn.VE.LatLong(eval(k.latitude),eval(k.longitude)));Ah(initialView);}catch(ex){q();}else q();if(!k.disableLogo){logo=new ge(j);logo.Init();}copyright=new Fb(j);copyright.Init();if(k.showScaleBar){scaleBar=new tg(j);scaleBar.Init();Rb("onendzoom",scaleBar.Update);Rb("onendcontinuouspan",scaleBar.Update);Rb("onresize",scaleBar.Reposition);}if(k.showDashboard)o(k.dashboardX,k.dashboardY,k.dashboardSize);if(obliqueMode&&currentMode!=obliqueMode)obliqueMode.UpdateAvailability();};this.GetDashboard=function(){return dashboard;};this.Destroy=function(){if(!k.fixedView){j.detachEvent("onmousedown",le);j.detachEvent("onmouseup",ne);j.detachEvent("onmousemove",me);j.detachEvent("onmousewheel",pe);j.detachEvent("ondblclick",oe);j.detachEvent("oncontextmenu",qe);}while(currentTilesList.length>0){var tile=currentTilesList.pop();tile.RemoveFromMap();}currentTilesList=null;while(pushpins.length){pushpins.pop().Destroy();}pushpins=null;rc();if(dashboard){dashboard.Destroy();dashboard=null;}if(dashboardContainer){dashboardContainer.detachEvent("onmousedown",IgnoreEvent);dashboardContainer.detachEvent("onmouseup",IgnoreEvent);dashboardContainer.detachEvent("onmousemove",IgnoreEvent);dashboardContainer.detachEvent("oncontextmenu",IgnoreEvent);dashboardContainer.detachEvent("onkeydown",IgnoreEvent);dashboardContainer.detachEvent("onkeyup",IgnoreEvent);j.removeChild(dashboardContainer);dashboardContainer=null;}if(scaleBar){Ub("onendzoom",scaleBar.Update);Ub("onendcontinuouspan",scaleBar.Update);Ub("onresize",scaleBar.Reposition);scaleBar.Destroy();scaleBar=null;}if(logo){logo.Destroy();logo=null;}if(copyright){copyright.Destroy();copyright=null;}if(orthoMode){orthoMode.Destroy();orthoMode=null;}if(obliqueMode){obliqueMode.Destroy();obliqueMode=null;}if(boxTool){boxTool.Destroy();boxTool=null;}if(panTool){panTool.Destroy();panTool=null;}ac();j=p_this=null;};function m(){x=GetLeftPosition(j);y=GetTopPosition(j);width=j.offsetWidth;height=j.offsetHeight;}function o(x,y,p){if(!p)p=Msn.VE.DashboardSize.Normal;if(p==Msn.VE.DashboardSize.Tiny)p=Msn.VE.DashboardSize.Small;dashboardContainer=document.createElement("div");j.appendChild(dashboardContainer);dashboardContainer.id="mapnavdashboard";dashboardContainer.className="Dashboard Dashboard_"+p;dashboardContainer.style.top=y+"px";dashboardContainer.style.left=x+"px";dashboardContainer.attachEvent("onmousedown",IgnoreEvent);dashboardContainer.attachEvent("onmouseup",IgnoreEvent);dashboardContainer.attachEvent("onmousemove",IgnoreEvent);dashboardContainer.attachEvent("oncontextmenu",IgnoreEvent);dashboardContainer.attachEvent("onkeydown",IgnoreEvent);dashboardContainer.attachEvent("onkeyup",IgnoreEvent);dashboard=new Msn.VE.Dashboard(dashboardContainer,p_this,p);dashboard.Init();}function q(){var view=new Msn.VE.MapView();view.SetCenterLatLong(new Msn.VE.LatLong(0,0));view.SetZoomLevel(1);view.SetMapStyle(roadStyle);Ah(view);}function r(s,t){var view=preferredView.MakeCopy();view.SetCenterLatLong(new Msn.VE.LatLong(s,t));Ah(view);}function u(v,w,x){var view=currentView.MakeCopy();view.SetMapStyle(A(v),w,x);if(currentView.mapStyle!=v){if(v==obliqueStyle){view.SetZoomLevel(1);lastOrthoZoomLevel=currentView.zoomLevel;lastOrthoMapStyle=currentView.mapStyle;}else{if(currentView.mapStyle==obliqueStyle)view.SetZoomLevel(lastOrthoZoomLevel);}}Ah(view);}function A(B){if(B==aerialStyle||B==hybridStyle||B==obliqueStyle||B=="c")return B;else return roadStyle;}function C(){return currentView.latlong.latitude;}function D(){return currentView.latlong.longitude;}function E(F){currentView.latlong=currentMode.PixelToLatLong(currentView.center,currentView.zoomLevel);if(F)preferredView.Copy(currentView);if(obliqueMode)obliqueMode.UpdateAvailability();}function G(y){var pixel=new Msn.VE.Pixel(originX+offsetX+width/2,originY+offsetY+y);var latlong=currentMode.PixelToLatLong(pixel,currentView.zoomLevel);if(!latlong)return null;return latlong.latitude;}function H(x){var pixel=new Msn.VE.Pixel(originX+offsetX+x,originY+offsetY+height/2);var latlong=currentMode.PixelToLatLong(pixel,currentView.zoomLevel);if(!latlong)return null;return latlong.longitude;}function I(J){var latlong=new Msn.VE.LatLong(J,currentView.center.longitude);var pixel=currentMode.LatLongToPixel(latlong,currentView.zoomLevel);if(!pixel)return null;return MathRound(pixel.y-originY-offsetY);}function K(L){var latlong=new Msn.VE.LatLong(currentView.center.latitude,L);var pixel=currentMode.LatLongToPixel(latlong,currentView.zoomLevel);if(!pixel)return null;return MathRound(pixel.x-originX-offsetX);}function M(N){var pixel=currentMode.LatLongToPixel(N,currentView.zoomLevel);pixel.x-=(originX+offsetX);pixel.y-=(originY+offsetY);return pixel;}function O(P){var adjPixel=new Msn.VE.Pixel(P.x+originX+offsetX,P.y+originY+offsetY);var latlong=currentMode.PixelToLatLong(adjPixel,currentView.zoomLevel);return latlong;}function Q(){return currentView.zoomLevel;}function R(){return currentView.mapStyle;}function S(T,U){if(!T)T=currentView.latlong.latitude;if(!U)U=currentView.zoomLevel;return Math.cos(DegToRad(T))*currentMode.MetersPerPixel(U);}function V(w,h){if(!w||!h||w<=0||h<=0)return;width=w;height=h;j.style.width=width;j.style.height=height;Ee(currentView);copyright.Reposition();if(logo)logo.Reposition();Xb("onresize");}function W(){return obliqueMode?obliqueMode.IsAvailable():false;}function X(){return obliqueMode?obliqueMode.GetScene():null;}function Y(Z){animatedMovementEnabled=Z;}function ab(){return animatedMovementEnabled;}function bb(cb){if(obliqueMode)u(obliqueStyle,cb,null);}function eb(gb){if(obliqueMode)u(obliqueStyle,null,gb);}function hb(d){debug=d;for(var i=0;i<currentTilesList.length;i++){currentTilesList[i].Debug(d);}}this.GetMapSource=function(){return j;};function jb(kb,lb){var pixel=currentMode.LatLongToPixel(kb,lb);var tileX=MathFloor(pixel.x/tileSize);var tileY=MathFloor(pixel.y/tileSize);return new Msn.VE.Pixel(tileX,tileY);}function mb(nb,ob){var pixel=currentMode.LatLongToPixel(nb,ob);var tileX=MathFloor(pixel.x/tileSize);var tileY=MathFloor(pixel.y/tileSize);var quadKey="";for(var i=ob;i>0;i--){var cell=0;var mask=1<<i-1;if((tileX&mask)!=0)cell++;if((tileY&mask)!=0)cell+=2;quadKey+=cell+"";}return quadKey;}this.LatLongToQuadKey=mb;this.LatLongToTileXY=jb;function pb(qb,rb){sb(qb,rb,0,0);}function sb(tb,ub,vb,wb){vb=xb(vb,width,tb.center.x-width/2,tb.zoomLevel,ub.z1,ub.x1,ub.x2);wb=xb(wb,height,tb.center.y-height/2,tb.zoomLevel,ub.z1,ub.y1,ub.y2);tb.SetCenter(new Msn.VE.Pixel(tb.center.x+vb,tb.center.y+wb));}function xb(yb,zb,Ab,Bb,Cb,Db,Eb){var min=tileSize*Db*Math.pow(2,Bb-Cb);var max=tileSize*Eb*Math.pow(2,Bb-Cb);if(zb>max-min)return (max-min-zb)/2-Ab+min;else{if(Ab+yb<min)return min-Ab;else{if(Ab+zb+yb>max)return max-Ab-zb;}}return yb;}function Fb(Gb){var bg=document.createElement("div");var fg=document.createElement("div");var copyrightHeight=13;this.Init=function(){bg.className="Copyright CopyrightBackground";fg.className="Copyright CopyrightForeground";Hb();Gb.appendChild(bg);Gb.appendChild(fg);};this.Destroy=function(){Gb.removeChild(bg);Gb.removeChild(fg);bg=fg=null;};function Hb(){bg.style.top=height-copyrightHeight+"px";bg.style.left=width-234+"px";bg.style.display="block";fg.style.top=height-copyrightHeight-1+"px";fg.style.left=width-235+"px";fg.style.display="block";}function Ib(){var c="&copy; 2005 Microsoft Corp";copyrightHeight=13;if(currentView.zoomLevel>=5&&(currentView.mapStyle==roadStyle||currentView.mapStyle==hybridStyle))c+=" &nbsp; &copy; 2004 NAVTEQ";if(currentView.mapStyle==hybridStyle||currentView.mapStyle==aerialStyle){c+="<br>";copyrightHeight=21;if(currentView.zoomLevel<=8)c+="Image courtesy of NASA";else{if(currentView.zoomLevel<=13)c+="&copy; Harris Corp, Earthstar Geographics LLC";else c+="Image courtesy of USGS";}}else{if(currentView.mapStyle==obliqueStyle){c+="<br>&copy; 2005 Pictometry International Corp.";copyrightHeight=21;}}bg.innerHTML=c;fg.innerHTML=c;Hb();}this.Reposition=Hb;this.Update=Ib;}function Jb(Kb,Lb,Mb){this.view=Kb;this.oblique=Lb;this.error=Mb;}function Nb(Ob,Pb,Qb){var view=currentView.MakeCopy();if(Ob!=undefined)view.latlong=Ob;if(Pb!=undefined)view.zoomLevel=Pb;if(Qb==undefined)Qb="";var oblique=null;if(obliqueMode)oblique=obliqueMode.GetEventInfo();return new Jb(view,oblique,Qb);}function Rb(Sb,Tb){var eventList=eventTable[Sb];if(!eventList){eventList=new Array();eventTable[Sb]=eventList;}for(var i=0;i<eventList.length;i++){if(eventList[i]==Tb)return true;}eventList.push(Tb);}function Ub(Vb,Wb){var eventList=eventTable[Vb];if(!eventList)return;for(var i=0;i<eventList.length;i++){if(eventList[i]==Wb)eventList.splice(i,1);}}function Xb(Yb,Zb){var eventList=eventTable[Yb];if(!eventList)return;if(!Zb)Zb=Nb();for(var i=0;i<eventList.length;i++){eventList[i](Zb);}}function ac(){while(eventTable.length){var eventList=eventTable.pop();while(eventList.length){eventList.pop();}eventList=null;}eventTable=null;}function bc(e){e=GetEvent(e);var s=keyboardPanSpeed;var x=panningX;var y=panningY;switch(e.keyCode){case 9:if(panning&&keyboardPan)Ae();return true;case 37:x=-s;break;case 38:y=-s;break;case 39:x=s;break;case 40:y=s;break;case 107:case 187:case 61:case 43:x=0;y=0;Xh();break;case 109:case 189:x=0;y=0;Yh();break;case 65:x=0;y=0;u(aerialStyle);break;case 72:x=0;y=0;u(hybridStyle);break;case 82:case 86:x=0;y=0;u(roadStyle);break;case 66:case 79:x=0;y=0;u(obliqueStyle);break;default:return false;}if(x||y)ue(x,y,null,true);return false;}function cc(e){e=GetEvent(e);var x=panningX;var y=panningY;switch(e.keyCode){case 37:x=0;break;case 38:y=0;break;case 39:x=0;break;case 40:y=0;break;default:return false;}ue(x,y,null,true);return false;}var northLatitude=0;var southLatitude=0;var westLongitude=0;var eastLongitude=0;function ec(gc,hc,jc,kc,lc,mc,nc,oc){if(gc==null||hc==null||jc==null||nc==null||oc==null)return null;var regionHeap=new Array();for(var i=0;i<nc.length;i++){regionHeap.push(vc(nc[i],0,nc[i].length-1));}var line=new zc();line.Init(gc,hc,jc,kc,lc,mc,regionHeap,oc);lines.push(line);return line;}function pc(qc){for(var i=0;i<lines.length;i++){var line=lines[i];if(line.id==qc){lines.splice(i,1);line.Destroy();return;}}}function rc(){while(lines.length>0){lines.pop().Destroy();}}function sc(){for(var i=0;i<lines.length;i++){lines[i].StartLine();lines[i].Show();}}function tc(){for(var i=0;i<lines.length;i++){lines[i].Hide();}}function uc(){for(var i=0;i<lines.length;i++){lines[i].UpdateLine();}}function vc(wc,xc,yc){var numberOfRegions=yc-xc+1;if(numberOfRegions<1)return null;else{if(numberOfRegions==1)return wc[xc];}var leftRegion=null;var rightRegion=null;if(numberOfRegions==2){leftRegion=wc[xc];rightRegion=wc[yc];}else{var i=Math.round((xc+yc)/2);leftRegion=vc(wc,xc,i);rightRegion=vc(wc,i+1,yc);}if(leftRegion!=null&&rightRegion!=null){var left=leftRegion.boundingRectangle;var right=rightRegion.boundingRectangle;var northLatitude=left[0].latitude>right[0].latitude?left[0].latitude:right[0].latitude;var eastLongitude=left[0].longitude>right[0].longitude?left[0].longitude:right[0].longitude;var southLatitude=left[1].latitude<right[1].latitude?left[1].latitude:right[1].latitude;var westLongitude=left[1].longitude<right[1].longitude?left[1].longitude:right[1].longitude;var combinedBoundingRectangle=[new Msn.VE.LatLong(northLatitude,eastLongitude),new Msn.VE.LatLong(southLatitude,westLongitude)];return new Msn.VE.LineRegion(combinedBoundingRectangle,null,[leftRegion,rightRegion]);}else{if(leftRegion!=null)return leftRegion;else{if(rightRegion!=null)return rightRegion;}}return null;}function zc(){var defaultLineWeight=6;var defaultLineColor="#11DD11";var defaultLineZIndex=4;var element=null;var elementId="";var visible=true;var strokeweight="";var strokecolor="";var zIndex=0;var startLatitude=0;var startLongitude=0;var endLatitude=0;var endLongitude=0;var latitudes=null;var longitudes=null;var lineRegions=null;var zoomLevelsForGeneralizedLines=null;var startIndex=0;var endIndex=0;var lastRedrawView=null;function Ac(Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ic){if(!Ec)Ec=defaultLineWeight;if(!Fc)Fc=defaultLineColor;if(!Gc)Gc=defaultZIndex;this.id=Bc;elementId=Bc;strokeweight=Ec+"pt";strokecolor=Fc;zIndex=Gc;latitudes=Cc;longitudes=Dc;zoomLevelsForGeneralizedLines=Ic;lineRegions=Hc;startLatitude=latitudes[0];startLongitude=longitudes[0];endLatitude=latitudes[latitudes.length-1];endLongitude=longitudes[longitudes.length-1];lastRedrawView=currentView.MakeCopy();Pc();}function Jc(){Kc();latitudes=longitudes=lineRegions=element=lastRedrawView=null;}function Kc(){if(element&&element.parentNode==map)map.removeChild(element);}function Lc(){if(!visible){Mc();return;}if(element)element.style.display="block";}function Mc(){if(element)element.style.display="none";}function Nc(Oc){visible=Oc;if(!visible)Mc();}function Pc(){Rc();Sc();lastRedrawView.Copy(currentView);}function Qc(){if(currentView.zoomLevel==lastRedrawView.zoomLevel&&MathAbs((currentView.center.x-lastRedrawView.center.x)/width)<0.25&&MathAbs((currentView.center.y-lastRedrawView.center.y)/height)<0.25)return;Rc();Sc();lastRedrawView=currentView.MakeCopy();}function Rc(){var bufferHeight=height<900?900:height;var bufferWidth=width<900?900:width;northLatitude=G(-0.5*bufferHeight);southLatitude=G(1.5*bufferHeight);westLongitude=H(-0.5*bufferWidth);eastLongitude=H(1.5*bufferWidth);}function Sc(){if(currentView.mapStyle==obliqueStyle){if(element&&element.parentNode==map)map.removeChild(element);return;}var points=new Array();var generalizedLineIndex=zoomLevelsForGeneralizedLines.length-1;while(zoomLevelsForGeneralizedLines[generalizedLineIndex]<currentView.zoomLevel&&generalizedLineIndex>=0){generalizedLineIndex--;}Tc(lineRegions[generalizedLineIndex],points);Wc(points);}function Tc(Uc,Vc){if(be(Uc.boundingRectangle[0],Uc.boundingRectangle[1]))return;if(Uc.childRegions!=null)for(var i=0;i<Uc.childRegions.length;i++){Tc(Uc.childRegions[i],Vc);}else{var indices=Uc.indices;var firstPoint=new Msn.VE.LatLong(latitudes[indices[0]],longitudes[indices[0]]);var secondPoint;var inVisibleSegment=false;if(Yc(firstPoint.latitude,firstPoint.longitude)){var firstPixel=currentMode.LatLongToPixel(firstPoint,currentView.zoomLevel);Vc.push(firstPixel.x-originX);Vc.push(firstPixel.y-originY);inVisibleSegment=true;}for(var pointIndex=1;pointIndex<indices.length;pointIndex++){secondPoint=new Msn.VE.LatLong(latitudes[indices[pointIndex]],longitudes[indices[pointIndex]]);if(Yc(secondPoint.latitude,secondPoint.longitude)){if(!inVisibleSegment){var firstPixel=currentMode.LatLongToPixel(firstPoint,currentView.zoomLevel);Vc.push(firstPixel.x-originX);Vc.push(firstPixel.y-originY);}inVisibleSegment=true;var secondPixel=currentMode.LatLongToPixel(secondPoint,currentView.zoomLevel);Vc.push(secondPixel.x-originX);Vc.push(secondPixel.y-originY);}else{if(inVisibleSegment){inVisibleSegment=false;var secondPixel=currentMode.LatLongToPixel(secondPoint,currentView.zoomLevel);Vc.push(secondPixel.x-originX);Vc.push(secondPixel.y-originY);}}firstPoint=secondPoint;}}}function Wc(Xc){if(element&&element.parentNode==map)map.removeChild(element);element=document.createElement("v:polyline");element.id=elementId;element.className="Line";element.points=Xc.join(" ");element.filled="false";element.style.zIndex=zIndex;element.unselectable="on";if(visible)element.style.display="block";else element.style.display="none";var strokeElm=document.createElement("v:stroke");strokeElm.setAttribute("weight",strokeweight);strokeElm.setAttribute("joinstyle","round");strokeElm.setAttribute("color",strokecolor);strokeElm.setAttribute("endcap","round");var opacity="0.75";if(currentView.mapStyle=="r")opacity="0.5";strokeElm.setAttribute("opacity",opacity);element.appendChild(strokeElm);map.appendChild(element);}function Yc(Zc,ae){return Zc>=southLatitude&&Zc<=northLatitude&&ae>=westLongitude&&ae<=eastLongitude;}function be(ce,ee){return ce.latitude>northLatitude&&ee.latitude>northLatitude||ce.latitude<southLatitude&&ee.latitude<southLatitude||ce.longitude>eastLongitude&&ee.longitude>eastLongitude||ce.longitude<westLongitude&&ee.longitude<westLongitude;}this.Init=Ac;this.Destroy=Jc;this.RemoveFromMap=Kc;this.Show=Lc;this.Hide=Mc;this.ChangeVisibility=Nc;this.StartLine=Pc;this.UpdateLine=Qc;}function ge(he){var image=null;this.Init=function(){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){image=document.createElement("div");image.className="PoweredByLogo PoweredByLogo_ie";}else{image=document.createElement("img");image.src="http://local.live.com/i/logo_powered_by.png";image.className="PoweredByLogo";}je();he.appendChild(image);image.style.zIndex=400;image.onclick=function(){window.location="http://local.live.com";};};this.Destroy=function(){he.removeChild(image);image=null;};function je(){image.style.top=height-40+"px";image.style.left="6px";image.style.display="block";}function ke(){je();}this.Reposition=je;this.Update=ke;}function le(e){e=GetEvent(e);CancelEvent(e);if(zooming)return false;if(panning)Ae();if(obliqueMode)obliqueMode.CancelRequest();if(e.which&&e.which==2)currentTool=boxTool;else{if(!e.which&&e.button&&e.button==4)currentTool=boxTool;else{if(e.altKey)currentTool=boxTool;}}dragging=true;currentTool.OnMouseDown(e);return false;}function me(e){e=GetEvent(e);if(dragging)currentTool.OnMouseMove(e);return false;}function ne(e){e=GetEvent(e);CancelEvent(e);dragging=false;currentTool.OnMouseUp(e);currentTool=panTool;keyboard.focus();return false;}function oe(e){e=GetEvent(e);CancelEvent(e);m();if(panning||zooming)return false;var view=preferredView.MakeCopy();view.SetCenter(new Msn.VE.Pixel(originX+offsetX+GetMouseX(e)-x,originY+offsetY+GetMouseY(e)-y));if(e.altKey){view.SetZoomLevel(currentView.zoomLevel-1);VE_Analytics.Log("Home Page","Zoom Out","Mouse DblClick");}else{view.SetZoomLevel(currentView.zoomLevel+1);VE_Analytics.Log("Home Page","Zoom In","Mouse DblClick");}Ah(view);return false;}function pe(e){e=GetEvent(e);CancelEvent(e);if(panning||zooming)return false;var delta=GetMouseScrollDelta(e);if(delta>0){Xh();VE_Analytics.Log("Home Page","Zoom In","Mouse Wheel");}else{if(delta<0){Yh();VE_Analytics.Log("Home Page","Zoom Out","Mouse Wheel");}}return false;}function qe(e){e=GetEvent(e);CancelEvent(e);var clickX=originX+offsetX+GetMouseX(e)-x;var clickY=originY+offsetY+GetMouseY(e)-y;var clickEvent=Nb(currentMode.PixelToLatLong(new Msn.VE.Pixel(clickX,clickY),currentView.zoomLevel));Xb("oncontextmenu",clickEvent);return false;}function re(se,te){if(se==0&&te==0)return;sb(currentView,currentBounds,se,te);offsetX=currentView.center.x-originX-width/2;offsetY=currentView.center.y-originY-height/2;map.style.top=-offsetY+"px";map.style.left=-offsetX+"px";var pixelOffset=new Msn.VE.Pixel(se,te);Xb("onmappan",pixelOffset);copyright.Update();window.setTimeout(zh,1);window.setTimeout(uc,2);}function ue(ve,we,xe,ye){if(zooming)return;if(!xe)xe=-1;panningX=ve;panningY=we;panCounter=xe;if(!ve&&!we){Ae();return;}keyboardPan=ye;if(!panning){panning=true;ze();Xb("onstartcontinuouspan");}}function ze(){if(panning){re(panningX,panningY);if(panCounter>0)panCounter--;if(panCounter!=0)window.setTimeout(ze,1);else Ae();}}function Ae(){panningX=0;panningY=0;panning=false;keyboardPan=false;if(panLatitude!=null&&panLongitude!=null){var latlong=new Msn.VE.LatLong(panLatitude,panLongitude);var pixel=currentMode.LatLongToPixel(latlong,currentView.zoomLevel);var dx=pixel.x-(originX+offsetX+width/2);var dy=pixel.y-(originY+offsetY+height/2);re(dx,dy);currentView.latlong.latitude=panLatitude;currentView.latlong.longitude=panLongitude;preferredView.Copy(currentView);panLatitude=null;panLongitude=null;if(obliqueMode)obliqueMode.UpdateAvailability();}else E(true);Xb("onendcontinuouspan");Xb("onchangeview");}function Be(Ce,De){panLatitude=Ce;panLongitude=De;Ge(currentMode.LatLongToPixel(new Msn.VE.LatLong(Ce,De),currentView.zoomLevel));}function Ee(Fe){Ge(Fe.center);}function Ge(He){if(currentView.mapStyle==obliqueStyle){var scene=obliqueMode.GetScene();if(!scene||!scene.ContainsPixel(He,currentView.zoomLevel)){var view=preferredView.MakeCopy();view.sceneId=null;view.SetCenterLatLong(obliqueMode.PixelToLatLong(He,currentView.zoomLevel));Ah(view);return;}}var dx=He.x-(originX+offsetX+width/2);var dy=He.y-(originY+offsetY+height/2);var distance=Math.sqrt(dx*dx+dy*dy);if(!animatedMovementEnabled||MathAbs(dx)>2*width||MathAbs(dy)>2*height||distance>1.5*Math.sqrt(width*width+height*height)){var view=preferredView.MakeCopy();view.SetCenter(He);Ah(view);return;}var angle=Math.atan2(dy,dx);var count=MathCeil(distance/panToLatLongSpeed);var speed=MathRound(distance/count);dx=MathRound(Math.cos(angle)*speed);dy=MathRound(Math.sin(angle)*speed);ue(dx,dy,count);}function Ie(Je,Ke,Le,Me,Ne,Oe,Pe,Qe){var pin=new Ve();pin.Init(Je,Ke,Le,Me,Ne,Oe,Pe,Qe);pushpins.push(pin);return pin.pin;}function Re(Se){for(var i=0;i<pushpins.length;i++){var p=pushpins[i];if(p.id==Se){pushpins.splice(i,1);p.Destroy();return;}}}function Te(){while(pushpins.length>0){pushpins.pop().Destroy();}}function Ue(){for(var i=0;i<pushpins.length;i++){pushpins[i].Reposition();}}function Ve(){var pin=document.createElement("div");pin.vePushpin=this;this.pin=pin;var x1=0;var y1=0;var x2=0;var y2=0;var center=null;var w=0;var h=0;var n=zoomTotalSteps+1;var xs=new Array(n);var ys=new Array(n);this.Init=function(We,Xe,Ye,Ze,ag,bg,cg,eg){this.id=We;pin.id=We;pin.className=bg;pin.style.position="absolute";pin.style.zIndex=eg;pin.innerHTML=cg;if(!k.fixedView){pin.attachEvent("ondblclick",rg);pin.attachEvent("onmousewheel",sg);}pin.unselectable="on";center=new Msn.VE.LatLong(Xe,Ye);w=Ze;h=ag;var pixel=currentMode.LatLongToPixel(center,currentView.zoomLevel);if(pixel){x1=MathRound(pixel.x-originX);y1=MathRound(pixel.y-originY);x2=x1;y2=y1;hg();jg(0);pin.style.display="block";}else pin.style.display="none";map.appendChild(pin);};this.Destroy=function(){pin.detachEvent("ondblclick",rg);pin.detachEvent("onmousewheel",sg);qg();pin.vePushpin=null;pin=null;this.pin=null;while(xs.length>0){xs.pop();}while(ys.length>0){ys.pop();}};this.GetLatitude=function(){return center.latitude;};this.GetLongitude=function(){return center.longitude;};function gg(){var n=zoomTotalSteps;for(var i=0;i<=n;i++){xs[i]=x1-w/2;ys[i]=y1-h/2;}}function hg(){var n=zoomTotalSteps;for(var i=0;i<=n;i++){var a=i/n;var b=1-a;xs[i]=MathFloor(b*x1+a*x2-w/2)+"px";ys[i]=MathFloor(b*y1+a*y2-h/2)+"px";}}function jg(i){pin.style.left=xs[i];pin.style.top=ys[i];}function kg(){var t=0;t=x1;x1=x2;x2=t;t=y1;y1=y2;y2=t;}function lg(){var pixel=currentMode.LatLongToPixel(center,currentView.zoomLevel);if(pixel){x1=MathRound(pixel.x-originX);y1=MathRound(pixel.y-originY);gg();jg(0);pin.style.display="block";}else pin.style.display="none";}function mg(ng,og,pg){x1-=offsetX;y1-=offsetY;var pixel=currentMode.LatLongToPixel(center,pg);if(pixel){x2=MathRound(pixel.x-ng);y2=MathRound(pixel.y-og);hg();pin.style.display="block";}else pin.style.display="none";}function qg(){if(pin.parentNode==map)map.removeChild(pin);}function rg(e){e=GetEvent(e);CancelEvent(e);if(panning||zooming)return false;var view=preferredView.MakeCopy();view.SetCenterLatLong(center);if(e.altKey)view.SetZoomLevel(currentView.zoomLevel-1);else view.SetZoomLevel(currentView.zoomLevel+1);Ah(view);return false;}function sg(e){e=GetEvent(e);CancelEvent(e);if(panning||zooming)return false;var delta=GetMouseScrollDelta(e);if(delta>0)Xh();else{if(delta<0)Yh();}return false;}this.ClearSteps=gg;this.PrecomputeSteps=hg;this.SetFactor=jg;this.SwapStates=kg;this.Reposition=lg;this.PrepareForZoom=mg;this.RemoveFromMap=qg;}function tg(ug){var labelBg=document.createElement("div");var labelFg=document.createElement("div");var barBg=document.createElement("div");var barFg=document.createElement("div");var scaleBarWidth=150;this.Init=function(){labelBg.className="ScaleBarLabel ScaleBarLabelBackground";labelFg.className="ScaleBarLabel ScaleBarLabelForeground";barBg.className="ScaleBar ScaleBarBackground";barFg.className="ScaleBar ScaleBarForeground";Cg();vg();ug.appendChild(labelBg);ug.appendChild(labelFg);ug.appendChild(barBg);ug.appendChild(barFg);};this.Destroy=function(){ug.removeChild(labelBg);ug.removeChild(labelFg);ug.removeChild(barBg);ug.removeChild(barFg);labelBg=labelFg=barBg=BarFg=null;};function vg(){labelBg.style.top=height-45+"px";labelBg.style.left=width-160+"px";labelBg.style.display="block";labelFg.style.top=height-46+"px";labelFg.style.left=width-161+"px";labelFg.style.display="block";barBg.style.top=height-30+"px";barBg.style.left=width-160+"px";barBg.style.display="block";barFg.style.top=height-31+"px";barFg.style.left=width-161+"px";barFg.style.display="block";}function wg(xg){return xg*0.001;}function yg(zg){return zg*0.000621371192;}function Ag(Bg){return Bg*1.0936133;}function Cg(){try{var mpp=S();var maxMeters=mpp*scaleBarWidth;var units="mi";var dMeasure=yg(maxMeters);var niceValue=Dg(dMeasure);if(niceValue<0.5){units="yds";dMeasure=Ag(maxMeters);niceValue=Dg(dMeasure);}Fg("us",units,niceValue,Math.round(niceValue/dMeasure*scaleBarWidth));}catch(ex){}}function Dg(Eg){var dLog10=Math.log(Eg)/Math.log(10);var dExponent=Math.floor(dLog10);var dExponentValue=Math.pow(10,dExponent);var dRoot=Eg/dExponentValue;var dIntegerRoot=Math.floor(dRoot);if(dIntegerRoot>=3)return dIntegerRoot*dExponentValue;var dNiceRoot=Math.floor(dRoot*2)*0.5;return dNiceRoot*dExponentValue;}function Fg(Gg,Hg,Ig,Jg){if(Ig<1)Ig=Ig.toFixed(1);var text=Ig+" "+Hg;labelBg.innerHTML=text;labelFg.innerHTML=text;barBg.style.width=Jg;barFg.style.width=Jg;}this.Update=Cg;this.Reposition=vg;}var totalRequestTime=0;var totalRequestCount=0;var totalFailureCount=0;var responseRangeCeilings=new Array();responseRangeCeilings[roadStyle]=[325,975];responseRangeCeilings[aerialStyle]=[350,1050];responseRangeCeilings[hybridStyle]=[425,1275];responseRangeCeilings[obliqueStyle]=[450,1350];responseRangeCeilings["c"]=[450,1350];var responseRangeCounts=[0,0,0];function Kg(x,y,z,s){var t=new Qg();t.Init(x,y,z,s,x*tileSize-originX,y*tileSize-originY);return t;}function Lg(Mg){while(Mg.length>0){var tile=Mg.pop();tile.Destroy();tile=null;}}function Ng(){var total=0;for(var i=0;i<responseRangeCounts.length;i++){total+=responseRangeCounts[i];}if(total==0)return responseRangeCounts;var responseRangePercentages=new Array(responseRangeCounts.length);for(var i=0;i<responseRangeCounts.length;i++){responseRangePercentages[i]=responseRangeCounts[i]/total;}return responseRangePercentages;}function Og(){for(var i=0;i<responseRangeCounts.length;i++){responseRangeCounts[i]=0;}}function Pg(){return totalFailureCount/totalRequestCount;}function Qg(){var img=null;var request=null;var overlay=document.createElement("div");var tileX=0;var tileY=0;var tileZoom=0;var mapStyle=0;var zIndex=0;var n=zoomTotalSteps+1;var xs=new Array(n);var ys=new Array(n);var ws=new Array(n);var hs=new Array(n);var animated=false;var x1=0;var y1=0;var w1=0;var h1=0;var x2=0;var y2=0;var w2=0;var h2=0;var startTime=null;this.Init=function(Rg,Sg,Tg,Ug,x,y){tileX=Rg;tileY=Sg;tileZoom=Tg;mapStyle=Ug;overlay.style.font="7pt Verdana, sans-serif";overlay.style.color="Red";overlay.style.backgroundColor="White";if(!currentMode.IsValidTile(tileX,tileY,tileZoom))return;Vg(x,y,tileSize,tileSize);Wg(x,y,tileSize,tileSize);Yg();request=new Image();request.onload=ch;request.onerror=eh;startTime=new Date();request.src=currentMode.GetFilename(tileX,tileY,tileZoom);};this.Destroy=function(){if(img)img.onmousedown=null;bh();while(xs.length>0){xs.pop();}while(ys.length>0){ys.pop();}while(ws.length>0){ws.pop();}while(hs.length>0){hs.pop();}xs=ys=ws=hs=null;};function Vg(x,y,w,h){x1=x;y1=y;w1=w;h1=h;}this.SetCurrentState=Vg;function Wg(x,y,w,h){x2=x;y2=y;w2=w;h2=h;}this.SetNextState=Wg;function Xg(){for(var i=0;i<=zoomTotalSteps;i++){xs[i]=x1+"px";ys[i]=y1+"px";ws[i]=w1+"px";hs[i]=h1+"px";}}this.ClearSteps=Xg;function Yg(){for(var i=0;i<=zoomTotalSteps;i++){var a=i/zoomTotalSteps;var b=1-a;xs[i]=MathFloor(b*x1+a*x2)+"px";ys[i]=MathFloor(b*y1+a*y2)+"px";ws[i]=MathCeil(b*w1+a*w2)+"px";hs[i]=MathCeil(b*h1+a*h2)+"px";}}this.PrecomputeSteps=Yg;function Zg(i){if(img==null||zooming&&!animated)return;var style=img.style;style.left=xs[i];style.top=ys[i];style.width=ws[i];style.height=hs[i];var overlayStyle=overlay.style;if(debug&&i==0){style.border="1px dashed red";overlayStyle.left=xs[i];overlayStyle.top=ys[i];}if(img.parentNode!=map){style.position="absolute";style.cursor="pointer";style.zIndex=zIndex;map.appendChild(img);if(debug&&overlay.parentNode!=map){var path=img.src;overlay.innerHTML=path.substring(path.lastIndexOf("/")+1,path.lastIndexOf("."));overlayStyle.position="absolute";overlayStyle.zIndex=zIndex+1;map.appendChild(overlay);}}}this.SetFactor=Zg;function ah(){var t=0;t=x1;x1=x2;x2=t;t=y1;y1=y2;y2=t;t=w1;w1=w2;w2=t;t=h1;h1=h2;h2=t;}this.SwapStates=ah;function bh(){if(request){request.onload=null;request.onerror=null;request=null;}if(img){if(img.parentNode==map)map.removeChild(img);img=null;}if(overlay){if(overlay.parentNode==map)map.removeChild(overlay);overlay=null;}}this.RemoveFromMap=bh;function ch(){if(tileZoom!=currentView.zoomLevel||request==null)return;var endTime=new Date();var lastTime=endTime.getTime()-startTime.getTime();gh(lastTime);totalRequestTime+=lastTime;totalRequestCount++;if(debug)window.status="last="+lastTime+", average="+totalRequestTime/totalRequestCount;request.onload=null;request.onerror=null;img=request;img.onmousedown=function(e){return false;};request=null;if(!zooming)Zg(zoomCounter);}function eh(){if(tileZoom!=currentView.zoomLevel||request==null)return;var endTime=new Date();var lastTime=endTime.getTime()-startTime.getTime();gh(lastTime);totalRequestTime+=lastTime;totalRequestCount++;totalFailureCount++;request.onload=null;request.onerror=null;request=null;}function gh(hh){for(var i=0;i<responseRangeCeilings[mapStyle].length;i++){if(hh<responseRangeCeilings[mapStyle][i]){responseRangeCounts[i]++;return;}}responseRangeCounts[responseRangeCounts.length-1]++;}function jh(kh,lh,mh,nh,oh,ph){Vg(x1-offsetX,y1-offsetY,w1,h1);var deltaZoom=ph-mh;var zoomFactor=Math.pow(2,deltaZoom);x2=MathFloor((kh+x1)*zoomFactor-nh);y2=MathFloor((lh+y1)*zoomFactor-oh);w2=MathCeil((kh+x1+w1)*zoomFactor-nh)-x2;h2=MathCeil((lh+y1+h1)*zoomFactor-oh)-y2;animated=true;Yg();zIndex=baseZIndex;if(img!=null)img.style.zIndex=zIndex;}this.PrepareBaseTile=jh;function qh(rh,sh,th,uh,vh,wh){var deltaZoom=th-wh;var zoomFactor=Math.pow(2,deltaZoom);x2=MathFloor((uh+x1)*zoomFactor-rh);y2=MathFloor((vh+y1)*zoomFactor-sh);w2=MathCeil((uh+x1+w1)*zoomFactor-rh)-x2;h2=MathCeil((vh+y1+h1)*zoomFactor-sh)-y2;var quarterWidth=MathCeil(tileViewportWidth*0.25);var quarterHeight=MathCeil(tileViewportHeight*0.25);animated=wh<th&&(tileX<tileViewportX1+quarterWidth||tileX>tileViewportX2-quarterWidth||tileY<tileViewportY1+quarterHeight||tileY>tileViewportY2-quarterHeight);ah();Yg();zIndex=swapZIndex;}this.PrepareSwapTile=qh;function xh(d){if(img!=null)img.style.border=d?"1px dashed red":"0px";overlay.style.display=d?"block":"none";}this.Debug=xh;}function yh(){Lg(currentTilesList);map.style.top="0px";map.style.left="0px";originX=MathRound(currentView.center.x-width/2);originY=MathRound(currentView.center.y-height/2);offsetX=0;offsetY=0;tileViewportX1=MathFloor((originX-buffer)/tileSize);tileViewportY1=MathFloor((originY-buffer)/tileSize);tileViewportX2=MathFloor((originX+width+buffer)/tileSize);tileViewportY2=MathFloor((originY+height+buffer)/tileSize);tileViewportWidth=tileViewportX2-tileViewportX1+1;tileViewportHeight=tileViewportY2-tileViewportY1+1;for(var y=tileViewportY1;y<=tileViewportY2;y++){for(var x=tileViewportX1;x<=tileViewportX2;x++){var tile=Kg(x,y,currentView.zoomLevel,currentView.mapStyle);currentTilesList.push(tile);}}}function zh(){if(zooming)return;var ox=originX+offsetX;var oy=originY+offsetY;var x1=MathFloor((ox-buffer)/tileSize);var y1=MathFloor((oy-buffer)/tileSize);var x2=MathFloor((ox+width+buffer)/tileSize);var y2=MathFloor((oy+height+buffer)/tileSize);while(tileViewportX1<x1){for(var y=tileViewportHeight-1;y>=0;y--){var tile=currentTilesList.splice(y*tileViewportWidth,1)[0];tile.RemoveFromMap();}tileViewportX1++;tileViewportWidth--;}while(tileViewportX1>x1){tileViewportX1--;tileViewportWidth++;for(var y=0;y<tileViewportHeight;y++){var tile=Kg(tileViewportX1,tileViewportY1+y,currentView.zoomLevel,currentView.mapStyle);currentTilesList.splice(y*tileViewportWidth,0,tile);}}while(tileViewportY1<y1){for(var x=0;x<tileViewportWidth;x++){var tile=currentTilesList.shift();tile.RemoveFromMap();}tileViewportY1++;tileViewportHeight--;}while(tileViewportY1>y1){tileViewportY1--;tileViewportHeight++;for(var x=tileViewportWidth-1;x>=0;x--){var tile=Kg(tileViewportX1+x,tileViewportY1,currentView.zoomLevel,currentView.mapStyle);currentTilesList.unshift(tile);}}while(tileViewportX2>x2){for(var y=tileViewportHeight-1;y>=0;y--){var tile=currentTilesList.splice(y*tileViewportWidth+tileViewportWidth-1,1)[0];tile.RemoveFromMap();}tileViewportX2--;tileViewportWidth--;}while(tileViewportX2<x2){tileViewportX2++;tileViewportWidth++;for(var y=0;y<tileViewportHeight;y++){var tile=Kg(tileViewportX2,tileViewportY1+y,currentView.zoomLevel,currentView.mapStyle);currentTilesList.splice(y*tileViewportWidth+tileViewportWidth-1,0,tile);}}while(tileViewportY2>y2){for(var x=0;x<tileViewportWidth;x++){var tile=currentTilesList.pop();tile.RemoveFromMap();}tileViewportY2--;tileViewportHeight--;}while(tileViewportY2<y2){tileViewportY2++;tileViewportHeight++;for(var x=0;x<tileViewportWidth;x++){var tile=Kg(tileViewportX1+x,tileViewportY2,currentView.zoomLevel,currentView.mapStyle);currentTilesList.push(tile);}}}function Ah(Bh){if(zooming||panning||dragging)return;var centerLatLong=Bh.latlong;if(Bh.GetViewType()=="latlongRect")centerLatLong=Bh.latlongRect.Center();if(Bh.mapStyle==obliqueStyle){if(obliqueMode==null)return;preferredView.Copy(Bh);currentMode=obliqueMode;j.style.backgroundColor="black";Bh.Resolve(currentMode,width,height);var scene=obliqueMode.GetScene();if((!scene||scene.GetID()!=Bh.sceneId)&&Bh.sceneId!=null){obliqueMode.RequestScene(Bh.sceneId);return;}if(!scene||!scene.ContainsLatLong(centerLatLong,Bh.zoomLevel)&&scene.GetID()!=Bh.sceneId||scene.GetOrientation()!=Bh.sceneOrientation){obliqueMode.RequestSceneAtLatLong(centerLatLong,Bh.sceneOrientation,true);return;}}else{currentMode=orthoMode;if(Bh.mapStyle=="r")j.style.backgroundColor="#e9e7d4";else j.style.backgroundColor="black";Bh.Resolve(currentMode,width,height);}centerLatLong=Bh.latlong;preferredView.Copy(Bh);currentMode.ValidateZoomLevel(Bh);currentBounds=currentMode.GetBounds(Bh);pb(Bh,currentBounds);Bh.Resolve(currentMode,width,height);if(Bh.Equals(currentView))return;var deltaX=Bh.GetX(currentView.zoomLevel)-currentView.center.x;var deltaY=Bh.GetY(currentView.zoomLevel)-currentView.center.y;var distance=Math.sqrt(deltaX*deltaX+deltaY*deltaY);var animatedPan=distance<width&&distance<height&&Bh.zoomLevel==currentView.zoomLevel&&animatedMovementEnabled&&Bh.mapStyle==currentView.mapStyle&&(Bh.sceneId==null||Bh.sceneId==currentView.sceneId);if(animatedPan){Be(centerLatLong.latitude,centerLatLong.longitude);return;}previousZoomLevel=currentView.zoomLevel;if(currentView.zoomLevel!=Bh.zoomLevel){Xb("onstartzoom");zooming=true;}var animatedZoom=distance<width&&distance<height&&(Bh.zoomLevel==currentView.zoomLevel-1||Bh.zoomLevel==currentView.zoomLevel+1)&&animatedMovementEnabled&&Bh.mapStyle==currentView.mapStyle&&(Bh.sceneId==null||Bh.sceneId==currentView.sceneId);if(animatedZoom){var oldOriginX=originX+offsetX;var oldOriginY=originY+offsetY;var oldZoom=currentView.zoomLevel;var newZoom=Bh.zoomLevel;var newOriginX=MathRound(Bh.center.x-width/2);var newOriginY=MathRound(Bh.center.y-height/2);oldTilesList=currentTilesList;currentTilesList=new Array();for(var i=0;i<oldTilesList.length;i++){oldTilesList[i].PrepareBaseTile(oldOriginX,oldOriginY,oldZoom,newOriginX,newOriginY,newZoom);}for(var i=0;i<pushpins.length;i++){pushpins[i].PrepareForZoom(newOriginX,newOriginY,newZoom);}tc();currentView.Destroy();currentView=Bh;yh();for(var i=0;i<currentTilesList.length;i++){currentTilesList[i].PrepareSwapTile(oldOriginX,oldOriginY,oldZoom,newOriginX,newOriginY,newZoom);}zoomCounter=1;Ch();return;}oldTilesList=currentTilesList;currentTilesList=new Array();currentView.Destroy();currentView=Bh;tc();yh();Dh();Ue();}function Ch(){if(!zooming)return;for(var i=0;i<oldTilesList.length;i++){oldTilesList[i].SetFactor(zoomCounter);}for(var i=0;i<currentTilesList.length;i++){currentTilesList[i].SetFactor(zoomCounter);}for(var i=0;i<pushpins.length;i++){pushpins[i].SetFactor(zoomCounter);}if(zoomCounter<zoomTotalSteps){zoomCounter++;window.setTimeout(Ch,1);}else{zoomCounter=0;Dh();}}function Dh(){Lg(oldTilesList);oldTilesList=null;zooming=false;for(var i=0;i<currentTilesList.length;i++){currentTilesList[i].SwapStates();currentTilesList[i].ClearSteps();currentTilesList[i].SetFactor(0);}for(var i=0;i<pushpins.length;i++){pushpins[i].SwapStates();pushpins[i].ClearSteps();pushpins[i].SetFactor(0);}currentTilesIndexes=null;oldTilesIndexes=null;window.setTimeout(sc,250);if(copyright)copyright.Update();if(previousMapStyle!=currentView.mapStyle)Xb("onchangemapstyle");if(previousZoomLevel!=currentView.zoomLevel)Xb("onendzoom");Xb("onchangeview");if(obliqueMode)window.setTimeout(obliqueMode.UpdateAvailability,100);try{CollectGarbage();}catch(ex){}}function Eh(Fh,Gh,Hh,Ih){var view=preferredView.MakeCopy();view.sceneId=null;view.SetLatLongRectangle(new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(Fh,Gh),new Msn.VE.LatLong(Hh,Ih)));Ah(view);}function Jh(l){if(!l||l.constructor!=Array)return;var a=l[0].latitude;var b=l[0].longitude;var c=a;var d=b;for(var i=1;i<l.length;i++){a=MathMin(a,l[i].latitude);b=MathMin(b,l[i].longitude);c=MathMax(c,l[i].latitude);d=MathMax(d,l[i].longitude);}var dLat=(c-a)*0.1;var dLon=(d-b)*0.1;a-=dLat;b-=dLon;c+=dLat;d+=dLon;Eh(Nh(a),Ph(b),Nh(c),Ph(d));}function Kh(Lh,Mh){var latlong=new Msn.VE.LatLong(Lh,Mh);if(currentView.mapStyle==obliqueStyle){var scene=obliqueMode.GetScene();if(!scene||!scene.ContainsLatLong(latlong))u(lastOrthoMapStyle);}Jh(new Array(currentView.latlong,latlong));}function Nh(Oh){return Rh(Oh,minLatitude,maxLatitude);}function Ph(Qh){return Rh(Qh,minLongitude,maxLongitude);}function Rh(n,Sh,Th){if(n<Sh)return Sh;if(n>Th)return Th;return n;}function Uh(){var x=null;try{x=new ActiveXObject("Msxml2.XMLHTTP");}catch(ex){try{x=new ActiveXObject("Microsoft.XMLHTTP");}catch(ex){x=null;}}if(!x&&typeof XMLHttpRequest!="undefined")x=new XMLHttpRequest();return x;}function Vh(Wh){var view=preferredView.MakeCopy();view.SetZoomLevel(Wh);Ah(view);}function Xh(){var view=preferredView.MakeCopy();view.SetZoomLevel(currentView.zoomLevel+1);Ah(view);}function Yh(){var view=preferredView.MakeCopy();view.SetZoomLevel(currentView.zoomLevel-1);Ah(view);}function Zh(aj,bj,cj){var view=preferredView.MakeCopy();view.sceneId=null;view.SetCenterLatLong(new Msn.VE.LatLong(aj,bj));view.SetZoomLevel(cj);Ah(view);}function ej(){var scene=null;var available=false;var availableBefore=false;var xmlHttp=null;var obliqueUrl=null;var showOnLoad=false;var requestUrl=null;var timerId=-1;var bounds=["02121222233","02121222322","02121222323","02121222332","02121222333","02121223222","02121223223","02121223232","02123000101","02123000103","02123000110","02123000111","02123000112","02123000113","02123000130","02123000131","02123001000","02123001001","02123001002","02123001003","02123001010","02123001012","02123001020","02123001021","02123001030","02123002113","02123002131","02123002133","02123002311","02123002313","02123003002","02123003003","02123003012","02123003020","02123003021","02123003022","02123003023","02123003030","02123003032","02123003200","02123003201","02123003202","02123003210","02133333112","02133333121","02133333122","02133333123","02133333130","02133333131","02133333132","02133333133","02133333201","02133333203","02133333210","02133333211","02133333212","02133333213","02133333300","02133333301","02133333302","02133333303","02133333310","02301020311","02301020313","02301020331","02301020332","02301020333","02301021013","02301021021","02301021022","02301021023","02301021030","02301021031","02301021032","02301021033","02301021122","02301021200","02301021201","02301021202","02301021203","02301021210","02301021211","02301021212","02301021213","02301021222","02301021300","02301022110","02301022111","02301031102","02301031103","02301031120","02301031121","02301031131","02301031133","02301120020","02301120022","02301213211","02301213213","02301213300","02301213301","02301213302","02301213303","02301213310","02301213311","02301213312","02301213313","02301213320","02301213321","02301213322","02301213323","02301213330","02301213331","02301213332","02301213333","02301231013","02301231031","02301231100","02301231101","02301231102","02301231103","02301231110","02301231111","02301231112","02301231113","02301231120","02301231121","02301231130","02301231131","02301231132","02301231133","02301231310","02301231311","02301300230","02301300231","02301300232","02301300233","02301300302","02301300320","02301301131","02301301133","02301301332","02301301333","02301302123","02301302132","02301302133","02301302200","02301302201","02301302202","02301302203","02301302210","02301302211","02301302212","02301302213","02301302220","02301302221","02301302221","02301302222","02301302223","02301302230","02301302231","02301302232","02301302233","02301302300","02301302301","02301302302","02301302303","02301302310","02301302311","02301302312","02301302313","02301302320","02301302321","02301302322","02301302323","02301302330","02301302331","02301302332","02301302333","02301303021","02301303022","02301303110","02301303111","02301303200","02301303201","02301310020","02301310021","02301310022","02301310023","02301310200","02301310201","02301312033","02301312211","02301312300","02301312302","02301312320","02301312321","02301312332","02301320000","02301320001","02301320002","02301320003","02301320010","02301320011","02301320012","02301320013","02301320020","02301320021","02301320022","02301320023","02301320030","02301320031","02301320032","02301320033","02301320100","02301320101","02301320102","02301320103","02301320110","02301320111","02301320112","02301320113","02301320120","02301320121","02301320130","02301320200","02301320201","02301320203","02301320210","02301320211","02301320212","02301320213","02301320230","02301320231","02301320300","02301321001","02301321002","02301321003","02301321010","02301321011","02301321012","02301321013","02301321100","02301321101","02301321102","02301321103","02301330011","02301330100","02301330101","02301330102","02301330103","02301330110","02310103023","02310103030","02310103031","02310103032","02310103033","02310103120","02310103122","02310103203","02310103210","02310103211","02310103212","02310103213","02310103300","02310103302","02310210322","02310210323","02310210332","02310210333","02310211203","02310211212","02310211213","02310211221","02310211222","02310211223","02310211230","02310211231","02310211232","02310211233","02310211302","02310211303","02310211320","02310211321","02310211322","02310212011","02310212100","02310212101","02310212110","02310212111","02310212112","02310212130","02310212132","02310213000","02310213001","02310213002","02310213003","02310213010","02310213011","02310213012","02310213100","02310213112","02310213113","02310213130","02310213131","02310213132","02310213133","02310213311","02310223202","02310223203","02310223220","02310223221","02310302002","02310302003","02310302012","02310302013","02310302020","02310302021","02310302022","02310302023","02310302030","02310302031","02310302032","02310302033","02310302120","02310302121","02310302122","02310302123","02310302200","02310302201","02310302210","02310302211","02310302212","02310302213","02310302230","02310302231","02310302232","02310302233","02310302300","02310302301","02310302302","02310302320","02311102213","02311102231","02311102302","02311102303","02311102320","02311102321","02311102323","02311102332","02311102333","02311103222","02311120101","02311120103","02311120110","02311120111","02311120112","02311120113","02311120121","02311120130","02311120131","02311121000","02311121002","02311121020","02311231220","02311231221","02311231222","02311231223","02311231230","02311231231","02311231232","02311231233","02311231320","02311231322","02311232023","02311232032","02311232033","02311232122","02311232201","02311232210","02311232211","02311232212","02311232213","02311232230","02311232231","02311232300","02311232302","02311233000","02311233001","02311233002","02311233003","02311233010","02311233011","02311233012","02311233013","02311233100","02311233102","02311300131","02311300132","02311300133","02311300310","02311300311","02311300312","02311300313","02311300331","02311301020","02311301021","02311301022","02311301023","02311301200","02311301201","02311301202","02311301203","02313032013","02313032030","02313032031","02313032032","02313032033","02313032120","02313032121","02313032122","02313032123","02313032130","02313032131","02313032132","02313032133","02313032210","02313032211","02313032300","02313032301","02313032310","02313032311","02313102232","02313102233","02313102332","02313102333","02313113033","02313113122","02313113210","02313113211","02313113212","02313113213","02313113300","02313113302","02313113311","02313113313","02313120010","02313120011","02313120012","02313120013","02313120030","02313120031","02313120032","02313120100","02313120101","02313120102","02313120103","02313120110","02313120120","02313210211","02313210213","02313210231","02313210300","02313210301","02313210302","02313210303","02313210310","02313210311","02313210312","02313210313","02313210320","02313210321","02313210322","02313210323","02313210330","02313210331","02313210332","02313210333","03022220013","03022220031","03022220033","03022220102","03022220103","03022220112","03022220113","03022220120","03022220121","03022220122","03022220123","03022220130","03022220131","03022220132","03022220133","03022220211","03022220300","03022220301","03022220310","03022220311","03022313313","03022313330","03022313331","03022313332","03022313333","03022322030","03022322031","03022322032","03022322033","03022322120","03022322121","03022322122","03022322123","03022322130","03022322132","03022322210","03022322211","03022323021","03022323022","03022323023","03022323123","03022323200","03022323201","03022323202","03022323203","03022323210","03022323211","03022323212","03022323213","03022323231","03022323233","03022323300","03022323301","03022323302","03022323303","03022323312","03022323320","03022323321","03022323322","03022330332","03022330333","03022331110","03022331111","03022331113","03022331123","03022331130","03022331131","03022331132","03022331133","03022331220","03022331221","03022331222","03022331223","03022331230","03022331232","03022331301","03022331310","03022331311","03022332003","03022332012","03022332013","03022332020","03022332021","03022332022","03022332023","03022332030","03022332031","03022332032","03022332033","03022332101","03022332103","03022332110","03022332111","03022332112","03022332113","03022332200","03022332201","03022332202","03022332203","03022332210","03022332211","03022332212","03022332213","03022332231","03022332232","03022332233","03022332320","03022332321","03022332322","03022332323","03022333000","03022333001","03022333002","03022333003","03022333010","03022333011","03022333012","03022333013","03023202202","03023202203","03023202212","03023202213","03023202220","03023202221","03023202222","03023202223","03023202230","03023202231","03023202232","03023202233","03023202302","03023202303","03023202320","03023202321","03023202322","03023202323","03023202330","03023202331","03023202332","03023202333","03023203213","03023203231","03023203233","03023203302","03023203320","03023203321","03023203322","03023203323","03023203330","03023203331","03023203332","03023203333","03023212222","03023212233","03023220000","03023220001","03023220002","03023220003","03023220010","03023220011","03023220012","03023220013","03023220020","03023220021","03023220022","03023220023","03023220030","03023220031","03023220032","03023220033","03023220100","03023220101","03023220102","03023220103","03023220110","03023220111","03023220112","03023220113","03023220120","03023220122","03023220130","03023220131","03023220132","03023220133","03023220200","03023220201","03023220210","03023220211","03023220212","03023220213","03023220230","03023220231","03023220232","03023220233","03023220300","03023220301","03023220302","03023220303","03023220310","03023220311","03023220312","03023220313","03023220320","03023220321","03023220322","03023220323","03023220330","03023220331","03023220332","03023220333","03023221000","03023221001","03023221002","03023221003","03023221010","03023221011","03023221012","03023221013","03023221020","03023221021","03023221022","03023221023","03023221030","03023221031","03023221032","03023221033","03023221100","03023221101","03023221102","03023221103","03023221110","03023221111","03023221112","03023221113","03023221120","03023221121","03023221122","03023221123","03023221130","03023221131","03023221132","03023221200","03023221201","03023221202","03023221203","03023221210","03023221211","03023221220","03023221221","03023221222","03023221223","03023221230","03023221232","03023221300","03023221303","03023221312","03023221313","03023221320","03023221321","03023221322","03023221323","03023221330","03023221331","03023221332","03023221333","03023222010","03023222011","03023222100","03023222101","03023222110","03023222111","03023223000","03023223001","03023223010","03023223100","03023223101","03023223110","03023223111","03023230000","03023230002","03023230020","03023231130","03023231131","03023231132","03023231133","03023231310","03023231311","03023231312","03023231313","03023231321","03023231323","03023231330","03023231331","03023231332","03023231333","03023233101","03023233110","03023233111","03023233212","03023233213","03023233221","03023233223","03023233230","03023233231","03023233232","03023233233","03023320020","03023320021","03023320022","03023320023","03023320030","03023320031","03023320032","03023320033","03023320120","03023320121","03023320122","03023320123","03023320130","03023320131","03023320132","03023320133","03023320200","03023320201","03023320202","03023320203","03023320210","03023320211","03023320212","03023320213","03023320220","03023320221","03023320222","03023320223","03023320230","03023320231","03023320232","03023320233","03023320300","03023320301","03023320302","03023320303","03023320310","03023320311","03023320312","03023320313","03023320320","03023320321","03023320322","03023320323","03023320330","03023320331","03023320332","03023320333","03023321003","03023321013","03023321020","03023321021","03023321022","03023321023","03023321030","03023321031","03023321032","03023321033","03023321102","03023321103","03023321120","03023321121","03023321122","03023321123","03023321130","03023321132","03023321200","03023321201","03023321202","03023321203","03023321210","03023321211","03023321212","03023321213","03023321220","03023321221","03023321222","03023321223","03023321230","03023321231","03023321232","03023321233","03023321300","03023321301","03023321302","03023321320","03023321321","03023321322","03023321323","03023321332","03023322000","03023322001","03023322010","03023322011","03023322100","03023322101","03023322110","03023322111","03023323000","03023323001","03023323002","03023323003","03023323010","03023323011","03023323012","03023323013","03023323020","03023323021","03023323023","03023323030","03023323031","03023323032","03023323033","03023323100","03023323101","03023323102","03023323103","03023323110","03023323112","03023323113","03023323120","03023323121","03023323122","03023323123","03023323130","03023323131","03023323132","03023323133","03023323201","03023323210","03023323211","03023323300","03023323301","03023323302","03023323303","03023323310","03023323311","03023323312","03023323313","03023330222","03023330223","03023332000","03023332001","03023332002","03023332003","03023332010","03023332012","03023332020","03023332021","03023332022","03023332023","03023332030","03023332032","03023332201","03023332202","03023332203","03023332212","03023332220","03023332221","03200000320","03200000321","03200000322","03200000323","03200000330","03200000331","03200000332","03200000333","03200002100","03200002101","03200002102","03200002103","03200002110","03200002111","03200002112","03200002113","03200002120","03200002121","03200002130","03200010303","03200010312","03200010313","03200010321","03200010322","03200010323","03200010330","03200010331","03200010332","03200010333","03200011233","03200011322","03200011323","03200012100","03200012101","03200012102","03200012103","03200012110","03200012111","03200012112","03200012113","03200012120","03200012121","03200012130","03200012131","03200013011","03200013013","03200013100","03200013101","03200013102","03200013103","03200013131","03200013301","03200013303","03200013310","03200013311","03200013312","03200013313","03200013330","03200013331","03200023130","03200023131","03200023132","03200023133","03200023311","03200031310","03200031311","03200031312","03200031313","03200031330","03200031331","03200031333","03200032020","03200032021","03200032022","03200032023","03200032200","03200032201","03200100311","03200100312","03200100313","03200100322","03200100323","03200100330","03200100331","03200100332","03200101202","03200101220","03200102020","03200102021","03200102022","03200102023","03200102030","03200102032","03200102100","03200102101","03200102102","03200102103","03200102110","03200102112","03200102200","03200102201","03200102202","03200102210","03200102220","03200110010","03200110011","03200110100","03200110101","03200120122","03200120123","03200120132","03200120200","03200120202","03200120220","03200120222","03200120300","03200120301","03200120302","03200120303","03200120310","03200120312","03200203001","03200203003","03200203010","03200203011","03200203012","03200203013","03200203021","03200203023","03200203030","03200203031","03200203032","03200203033","03200213103","03200213112","03200213113","03200213121","03200213123","03200213130","03200213131","03200213132","03200213133","03200230101","03200230102","03200230103","03200230110","03200230111","03200230112","03200230113","03200230120","03200230121","03200230130","03200230131","03200230132","03200231002","03200231020","03200231103","03200231112","03200231113","03200231121","03200231123","03200231130","03200231131","03200231132","03200231133","03200231301","03200231303","03200231310","03200231311","03200231312","03200231313","03200232120","03200232121","03200232122","03200232123","03200232130","03200232131","03200232132","03200232133","03200232300","03200232301","03200232310","03200232311","03200232312","03200302002","03200302020","03200302022","03200302222","03200302223","03200302232","03200320000","03200320001","03200320002","03200320003","03200320010","03200320012","03200320013","03200320020","03200320021","03200320022","03200320023","03200320030","03200320031","03200320032","03200320200","03200320201","03200320210","03200332203","03200332212","03200332220","03200332221","03200332222","03200332223","03200332230","03200332231","03200332232","03200332233","03200332322","03201000333","03201001212","03201001213","03201001220","03201001221","03201001222","03201001223","03201001230","03201001231","03201001232","03201001233","03201001320","03201001322","03201001323","03201002111","03201002113","03201002311","03201002312","03201002313","03201002331","03201002332","03201002333","03201003000","03201003001","03201003002","03201003003","03201003010","03201003011","03201003012","03201003013","03201003033","03201003100","03201003101","03201003102","03201003103","03201003110","03201003112","03201003122","03201003200","03201003201","03201003202","03201003203","03201003211","03201003212","03201003220","03201003221","03201003222","03201003223","03201003230","03201003231","03201003232","03201003233","03201003300","03201003302","03201010231","03201010233","03201010320","03201010321","03201010322","03201010323","03201011001","03201011002","03201011003","03201011010","03201011011","03201011012","03201011013","03201011020","03201011021","03201011023","03201011030","03201011031","03201011032","03201011033","03201011100","03201011101","03201011102","03201011103","03201011110","03201011112","03201011120","03201011121","03201011122","03201011123","03201011130","03201012011","03201012100","03201012101","03201012112","03201012113","03201012121","03201012123","03201012130","03201012131","03201012132","03201012133","03201012301","03201012303","03201012310","03201012311","03201012312","03201012313","03201012321","03201012323","03201012330","03201012332","03201013020","03201013022","03201013023","03201013200","03201020111","03201020132","03201020133","03201021000","03201021001","03201021002","03201021003","03201021010","03201021011","03201021012","03201021013","03201021031","03201022110","03201022111","03201022112","03201022113","03201022130","03201022131","03201023303","03201023312","03201023313","03201023320","03201023321","03201023322","03201023323","03201023330","03201023331","03201023332","03201023333","03201032220","03201032222","03201201100","03201201101","03201201110","03201201111","03201210000","03202002022","03202002023","03202002032","03202002200","03202002201","03202002202","03202002210","03202010333","03202011222","03202011223","03202011232","03202012111","03202012113","03202012130","03202012131","03202013000","03202013001","03202013002","03202013003","03202013010","03202013012","03202013020","03202013021","03202101311","03202101313","03202101323","03202101332","03202101333","03202102331","03202102333","03202103101","03202103103","03202103110","03202103111","03202103112","03202103113","03202103121","03202103123","03202103130","03202103131","03202103132","03202103133","03202103202","03202103203","03202103220","03202103221","03202103222","03202103223","03202103311","03202110001","03202110003","03202110010","03202110011","03202110012","03202110013","03202110100","03202110200","03202110201","03202110202","03202110203","03202110220","03202112000","03202112002","03202112020","03202112021","03202112022","03202112023","03202112200","03202121023","03202121032","03202121033","03202121201","03202121203","03202121210","03202121211","03202121212","03202121213","03202121300","03202121302","03202121323","03202121332","03202121333","03202123100","03202123101","03202123103","03202123110","03202123111","03202123112","03202123113","03202123121","03202123123","03202123130","03202123131","03202123132","03202123133","03202123301","03202123310","03202123311","03202130200","03202130201","03202130202","03202130203","03202130210","03202130212","03202130221","03202130230","03202132000","03202132002","03202132003","03202132020","03202132021","03202132022","03202132023","03202132032","03202132200","03202132201","03202132210","03202301011","03202301013","03202301031","03202301100","03202301102","03202301103","03202301112","03202301113","03202301120","03202301121","03202301122","03202301123","03202301130","03202301131","03202301132","03202301133","03202301300","03202301301","03202301310","03202301311","03202310020","03202310022","03202310200"];this.Init=function(gj){obliqueUrl=gj;};this.Destroy=function(){};function hj(jj,kj,lj){return scene.IsValidTile(jj,kj,lj);}function mj(nj,oj,pj){return scene.GetTileFilename(nj,oj,pj);}function qj(rj){if(!scene)return 0;var pixel=new Msn.VE.Pixel(MathRound(originX+offsetX+width/2),MathRound(originY+offsetY+height/2));var latlong1=scene.PixelToLatLong(pixel,rj);pixel.x++;var latlong2=scene.PixelToLatLong(pixel,rj);var sinLat1=Math.sin(DegToRad(latlong1.latitude));var sinLat2=Math.sin(DegToRad(latlong2.latitude));var metersHeight=earthRadius/2*MathAbs(Math.log((1+sinLat1)/(1-sinLat1))-Math.log((1+sinLat2)/(1-sinLat2)));var metersWidth=earthRadius*MathAbs(DegToRad(latlong1.longitude)-DegToRad(latlong2.longitude));return Math.sqrt(metersWidth*metersWidth+metersHeight*metersHeight);}function sj(tj,uj){return scene?scene.PixelToLatLong(tj,uj):null;}function vj(wj,xj){return scene?scene.LatLongToPixel(wj,xj):null;}function yj(zj){if(zj.zoomLevel<1)zj.SetZoomLevel(1);else{if(zj.zoomLevel>2)zj.SetZoomLevel(2);}}function Aj(){return scene;}function Bj(){return scene.GetBounds();}function Cj(){return available;}function Dj(){if(!available)return null;var info=new Object();return info;}function Ej(){if(currentView.mapStyle==obliqueStyle)return;if(currentView.zoomLevel<12){scene=null;availableBefore=available;available=false;Pj();return;}Fj(currentView.latlong,"North",false,500);}function Fj(Gj,Hj,Ij,Jj){Mj();showOnLoad=Ij;if(!Qj(Gj)){scene=null;availableBefore=available;available=false;Pj();return;}requestUrl=obliqueUrl+"?lat="+Gj.latitude+"&lon="+Gj.longitude;if(Hj)requestUrl+="&o="+Hj;if(Jj)timerId=window.setTimeout(Nj,Jj);else{Nj();timerId=-1;}}function Kj(Lj){if(scene&&scene.GetID()==Lj)return;Mj();showOnLoad=true;requestUrl=obliqueUrl+"?id="+Lj;Nj();}function Mj(){try{if(timerId!=-1)window.clearTimeout(timerId);}catch(ex){}timerId=-1;try{if(xmlHttp){xmlHttp.onreadystatechange=null;xmlHttp.abort();}}catch(ex){}}function Nj(){Mj();if(!requestUrl)return;if(!xmlHttp)xmlHttp=Uh();if(xmlHttp){xmlHttp.open("POST",requestUrl,true);xmlHttp.onreadystatechange=Oj;xmlHttp.send("");}}function Oj(){if(!xmlHttp||xmlHttp.readyState!=4)return;timerId=-1;availableBefore=available;var code=xmlHttp.responseText;if(code)try{scene=eval(code);available=true;}catch(ex){scene=null;available=false;}else{scene=null;available=false;}Pj();}function Pj(){if(showOnLoad){showOnLoad=false;if(available){var view=preferredView.MakeCopy();view.SetMapStyle(obliqueStyle,scene.GetID(),scene.GetOrientation());Ah(view);Xb("onobliquechange");}else{var view=preferredView.MakeCopy();view.SetMapStyle(lastOrthoMapStyle);if(view.GetViewType()!="latlongRect")view.SetZoomLevel(lastOrthoZoomLevel);Ah(view);Xb("onerror",Nb(currentView.latlong,currentView.zoomLevel,"Bird's Eye images are not available for this area."));}}if(availableBefore!=available){if(available)Xb("onobliqueenter");else Xb("onobliqueleave");}}function Qj(Rj){if(!Rj||!bounds||bounds.length==0)return false;var quadKey=Sj(Rj,bounds[0].length);return Vj(quadKey,0,bounds.length-1);}function Sj(Tj,Uj){var pixel=orthoMode.LatLongToPixel(Tj,Uj);var tileX=MathFloor(pixel.x/tileSize);var tileY=MathFloor(pixel.y/tileSize);var quadKey="";for(var i=Uj;i>0;i--){var cell=0;var mask=1<<i-1;if((tileX&mask)!=0)cell++;if((tileY&mask)!=0)cell+=2;quadKey+=cell+"";}return quadKey;}function Vj(Wj,Xj,Yj){if(Yj<Xj)return false;var middle=MathFloor((Xj+Yj)/2);if(bounds[middle]==Wj)return true;if(Wj<bounds[middle])return Vj(Wj,Xj,middle-1);return Vj(Wj,middle+1,Yj);}this.IsValidTile=hj;this.GetFilename=mj;this.MetersPerPixel=qj;this.PixelToLatLong=sj;this.LatLongToPixel=vj;this.GetBounds=Bj;this.ValidateZoomLevel=yj;this.IsAvailable=Cj;this.UpdateAvailability=Ej;this.CancelRequest=Mj;this.GetEventInfo=Dj;this.GetScene=Aj;this.RequestSceneAtLatLong=Fj;this.RequestScene=Kj;}function Zj(){var bounds=[new Msn.VE.Bounds(1,9,0,0,2,2),new Msn.VE.Bounds(10,19,156,348,321,441),new Msn.VE.Bounds(10,17,28,216,141,333),new Msn.VE.Bounds(10,17,108,216,361,381),new Msn.VE.Bounds(10,17,56,444,72,460),new Msn.VE.Bounds(10,17,480,292,520,352)];this.Init=function(){};this.Destroy=function(){};function ak(bk,ck,ek){var max=1<<ek;return bk>=0&&ck>=0&&bk<max&&ck<max;}function gk(hk,jk){if(hk>=minSSCityTileXY.x&&hk<=maxSSCityTileXY.x&&jk>=minSSCityTileXY.y&&jk<=maxSSCityTileXY.y)return true;else return false;}function kk(lk,mk,nk){var key="";var cell=0;for(var i=nk;i>0;i--){cell=0;var mask=1<<i-1;if((lk&mask)!=0)cell++;if((mk&mask)!=0)cell+=2;key+=cell+"";}if(currentView.mapStyle=="c"){if(currentView.zoomLevel==19&&gk(lk,mk))return "http://tiles"+cell+"."+basehost+"/streettiles/c"+key+".jpg";else return "http://r"+cell+".ortho.tiles.virtualearth.net/tiles/"+"r"+key+".png"+"?g="+generations["r"];}else return "http://"+currentView.mapStyle+cell+".ortho.tiles.virtualearth.net/tiles/"+currentView.mapStyle+key+(currentView.mapStyle==roadStyle?".png":".jpeg")+"?g="+generations[currentView.mapStyle];}function ok(pk){return earthCircumference/((1<<pk)*tileSize);}function qk(rk,sk){var metersPerPixel=ok(sk);var metersX=rk.x*metersPerPixel-projectionOffset;var metersY=projectionOffset-rk.y*metersPerPixel;var latlong=new Msn.VE.LatLong();latlong.latitude=RadToDeg(Math.PI/2-2*Math.atan(Math.exp(-metersY/earthRadius)));latlong.longitude=RadToDeg(metersX/earthRadius);return latlong;}function tk(uk,vk){var sinLat=Math.sin(DegToRad(uk.latitude));var metersX=earthRadius*DegToRad(uk.longitude);var metersY=earthRadius/2*Math.log((1+sinLat)/(1-sinLat));var metersPerPixel=ok(vk);var pixel=new Msn.VE.Pixel();pixel.x=(projectionOffset+metersX)/metersPerPixel;pixel.y=(projectionOffset-metersY)/metersPerPixel;return pixel;}function wk(xk){if(xk==undefined)xk=currentView;var zoomLevel=xk.zoomLevel;var x=xk.center.x;var y=xk.center.y;for(var i=0;i<bounds.length;i++){var deltaZ=zoomLevel-bounds[i].z1;var factor=tileSize*Math.pow(2,deltaZ);var minX=bounds[i].x1*factor;var maxX=bounds[i].x2*factor;var minY=bounds[i].y1*factor;var maxY=bounds[i].y2*factor;if(x>=minX&&x<=maxX&&y>=minY&&y<=maxY){if(zoomLevel>=bounds[i].z1&&zoomLevel<=bounds[i].z2)return bounds[i];}}}function yk(zk){var x=zk.center.x;var y=zk.center.y;var maxZoom=0;for(var i=0;i<bounds.length;i++){var factor=tileSize*Math.pow(2,zk.zoomLevel-bounds[i].z1);var minX=bounds[i].x1*factor;var maxX=bounds[i].x2*factor;var minY=bounds[i].y1*factor;var maxY=bounds[i].y2*factor;if(x>=minX&&x<=maxX&&y>=minY&&y<=maxY){if(bounds[i].z2>=zk.zoomLevel)return;else{if(bounds[i].z2>maxZoom)maxZoom=bounds[i].z2;}}}zk.SetZoomLevel(maxZoom);}this.IsValidTile=ak;this.GetFilename=kk;this.MetersPerPixel=ok;this.PixelToLatLong=qk;this.LatLongToPixel=tk;this.GetBounds=wk;this.ValidateZoomLevel=yk;}function Ak(){var bg=document.createElement("div");var fg=document.createElement("div");var x1=0;var y1=0;var x2=0;var y2=0;this.Init=function(){bg.className="ZoomBox_bg";fg.className="ZoomBox_fg";bg.attachEvent("onmouseup",ne);fg.attachEvent("onmouseup",ne);map.appendChild(bg);map.appendChild(fg);};this.Destroy=function(){bg.detachEvent("onmouseup",ne);fg.detachEvent("onmouseup",ne);map.removeChild(bg);map.removeChild(fg);};function Bk(e){x1=x2=GetMouseX(e)-x+offsetX;y1=y2=GetMouseY(e)-y+offsetY;Ek(x1,y1,1,1);Hk();if(fg.setCapture)fg.setCapture();}function Ck(e){x2=GetMouseX(e)-x+offsetX;y2=GetMouseY(e)-y+offsetY;Ek(MathMin(x1,x2),MathMin(y1,y2),MathMax(1,MathAbs(x2-x1)),MathMax(1,MathAbs(y2-y1)));}function Dk(e){if(MathAbs(x1-x2)>1&&MathAbs(y1-y2)>1){var view=preferredView.MakeCopy();view.SetZoomLevel(currentView.zoomLevel);view.SetPixelRectangle(new Msn.VE.PixelRectangle(new Msn.VE.Pixel(originX+x1,originY+y1),new Msn.VE.Pixel(originX+x2,originY+y2)));Ah(view);}Ik();if(fg.releaseCapture)fg.releaseCapture();}function Ek(x,y,w,h){Fk(bg,x+1,y+1,w,h);Fk(fg,x,y,w,h);}function Fk(Gk,x,y,w,h){Gk.style.left=x+"px";Gk.style.top=y+"px";Gk.style.width=w+"px";Gk.style.height=h+"px";}function Hk(){bg.style.display="block";fg.style.display="block";}function Ik(){bg.style.display="none";fg.style.display="none";}this.OnMouseDown=Bk;this.OnMouseMove=Ck;this.OnMouseUp=Dk;}function Jk(){var moved=false;this.Init=function(){};this.Destroy=function(){};function Kk(e){moved=false;lastMouseX=GetMouseX(e);lastMouseY=GetMouseY(e);if(j.setCapture)j.setCapture();var clickX=originX+offsetX+GetMouseX(e)-x;var clickY=originY+offsetY+GetMouseY(e)-y;Xb("onstartcontinuouspan",Nb(currentMode.PixelToLatLong(new Msn.VE.Pixel(clickX,clickY),currentView.zoomLevel)));}function Lk(e){var mouseX=GetMouseX(e);var mouseY=GetMouseY(e);re(lastMouseX-mouseX,lastMouseY-mouseY);lastMouseX=mouseX;lastMouseY=mouseY;moved=true;}function Mk(e){E(true);if(j.releaseCapture)j.releaseCapture();if(moved){Xb("onendcontinuouspan");Xb("onchangeview");moved=false;VE_Analytics.Log("Home Page","Pan","Mouse");}var clickX=originX+offsetX+GetMouseX(e)-x;var clickY=originY+offsetY+GetMouseY(e)-y;var clickEvent=Nb(currentMode.PixelToLatLong(new Msn.VE.Pixel(clickX,clickY),currentView.zoomLevel));Xb("onmouseup",clickEvent);Xb("onclick",clickEvent);}this.OnMouseDown=Kk;this.OnMouseMove=Lk;this.OnMouseUp=Mk;}this.SetCenter=r;this.SetMapStyle=u;this.GetCenterLatitude=C;this.GetCenterLongitude=D;this.GetLatitude=G;this.GetLongitude=H;this.GetY=I;this.GetX=K;this.LatLongToPixel=M;this.PixelToLatLong=O;this.GetZoomLevel=Q;this.GetMapStyle=R;this.GetMetersPerPixel=S;this.Resize=V;this.PanMap=re;this.ContinuousPan=ue;this.StopContinuousPan=Ae;this.PanToLatLong=Be;this.AddPushpin=Ie;this.RemovePushpin=Re;this.ClearPushpins=Te;this.SetViewport=Eh;this.SetBestMapView=Jh;this.IncludePointInViewport=Kh;this.SetZoom=Vh;this.ZoomIn=Xh;this.ZoomOut=Yh;this.SetCenterAndZoom=Zh;this.AddLine=ec;this.RemoveLine=pc;this.ClearLines=rc;this.AttachEvent=Rb;this.DetachEvent=Ub;this.IsObliqueAvailable=W;this.GetObliqueScene=X;this.SetAnimationEnabled=Y;this.IsAnimationEnabled=ab;this.SetObliqueScene=bb;this.SetObliqueOrientation=eb;this.SetView=Ah;this.Debug=hb;this.GetResponseRangeCounts=Ng;this.ResetResponseRangeCounts=Og;this.GetFailureRate=Pg;};Msn.VE.Bounds=function(Nk,Ok,Pk,Qk,Rk,Sk){this.z1=Nk;this.z2=Ok;this.x1=Pk;this.y1=Qk;this.x2=Rk;this.y2=Sk;};Msn.VE.Dashboard=function(Tk,Uk,Vk){var roadTab=document.createElement("div");var aerialTab=document.createElement("div");var obliqueTab=document.createElement("div");var selectedTab=null;var separator=document.createElement("hr");var labelsContainer=document.createElement("div");var labelsCheckbox=document.createElement("input");var firstAerial=true;var compass=null;var obliqueCompass=null;var orthoZoom=null;var obliqueZoom=null;var obliqueNotification=null;var obliqueSelector=null;var containerTable=document.createElement("table");containerTable.className="dashboardContainerTable";var containerTBody=document.createElement("tbody");var compassZoomRow=document.createElement("tr");containerTable.appendChild(containerTBody);containerTBody.appendChild(compassZoomRow);var compassCell=document.createElement("td");var zoomCell=document.createElement("td");zoomCell.vAlign="top";var notificationCell=document.createElement("td");notificationCell.colSpan=2;notificationCell.setAttribute("colspan",2);notificationCell.className="obliqueSelectorTable";compassZoomRow.appendChild(compassCell);compassZoomRow.appendChild(zoomCell);var notificationRow=document.createElement("tr");notificationRow.appendChild(notificationCell);containerTBody.appendChild(notificationRow);this.Init=function(){var mapStyle=Uk.GetMapStyle();Wk(roadTab,"road",ql);Wk(aerialTab,"aerial",rl);Wk(obliqueTab,"bird's eye",sl);separator.className="Dashboard_separator";Tk.appendChild(separator);Tk.appendChild(containerTable);if(!Vk||Vk==Msn.VE.DashboardSize.Normal){compass=new zl(compassCell,5,30);compass.Init();compass.Show();}obliqueCompass=new cn(compassCell);obliqueCompass.Hide();orthoZoom=new Rl(zoomCell,100,30);orthoZoom.Init();obliqueZoom=new km(zoomCell);jl();kl();obliqueSelector=new Gl(notificationCell);obliqueSelector.Init();Uk.AttachEvent("onendzoom",ul);Uk.AttachEvent("onobliqueenter",vl);Uk.AttachEvent("onobliqueleave",wl);Uk.AttachEvent("onchangemapstyle",xl);Uk.AttachEvent("onobliquechange",yl);if(Uk.IsObliqueAvailable())ol();else pl();switch(mapStyle){case "r":ll();break;case "a":case "h":ml();break;case "o":nl();break;}};this.Destroy=function(){bl(roadTab,ql);bl(aerialTab,rl);bl(obliqueTab,sl);selectedTab=roadTab=aerialTab=obliqueTab=null;labelsContainer.removeChild(labelsCheckbox);zoomCell.removeChild(labelsContainer);labelsContainer.detachEvent("onclick",tl);labelsContainer=labelsCheckbox=null;if(compass){compass.Destroy();compass=null;}if(obliqueZoom){obliqueZoom.Destroy();obliqueZoom=null;}if(obliqueSelector){obliqueSelector.Destroy();obliqueSelector=null;}if(Uk){Uk.DetachEvent("onendzoom",ul);Uk.DetachEvent("onobliqueenter",vl);Uk.DetachEvent("onobliqueleave",wl);Uk.DetachEvent("onchangemapstyle",xl);Uk=null;}};this.GetY=function(){return GetTopPosition(Tk);};this.GetHeight=function(){return Tk.offsetHeight;};function Wk(Xk,Yk,Zk,al){Xk.className="Dashboard_tab Dashboard_unselected";Xk.href="javascript:void(0)";Xk.innerText=Yk;Xk.attachEvent("onclick",Zk);Tk.appendChild(Xk);}function bl(cl,el){cl.detachEvent("onclick",el);Tk.removeChild(cl);}function gl(hl){if(selectedTab)selectedTab.className="Dashboard_tab Dashboard_unselected";hl.className="Dashboard_tab Dashboard_selected";selectedTab=hl;}function jl(){labelsCheckbox.type="checkbox";labelsContainer.className="Dashboard_toggler";labelsContainer.style.display="none";labelsContainer.attachEvent("onclick",tl);labelsContainer.appendChild(labelsCheckbox);labelsContainer.appendChild(document.createTextNode("Show labels"));zoomCell.appendChild(labelsContainer);}function kl(){obliqueNotification=document.createElement("div");obliqueNotification.className="Dashboard_notification";obliqueNotification.innerHTML="<div id=\"obliqueNotifyIcon\">&nbsp;</div> There is Bird's Eye imagery available for this location.";obliqueNotification.style.display="none";obliqueNotification.onclick=sl;notificationCell.appendChild(obliqueNotification);}function ll(){gl(roadTab);labelsContainer.style.display="none";obliqueSelector.Hide();obliqueZoom.Hide();orthoZoom.Show();if(Uk.IsObliqueAvailable())obliqueNotification.style.display="block";if(compass)compass.Show();obliqueCompass.Hide();}function ml(){gl(aerialTab);labelsContainer.style.display="block";obliqueSelector.Hide();obliqueZoom.Hide();orthoZoom.Show();if(Uk.GetMapStyle()=="h")labelsCheckbox.checked=true;else labelsCheckbox.checked=false;if(Uk.IsObliqueAvailable())obliqueNotification.style.display="block";if(compass)compass.Show();obliqueCompass.Hide();}function nl(){gl(obliqueTab);labelsContainer.style.display="none";obliqueNotification.style.display="none";obliqueSelector.Show();orthoZoom.Hide();obliqueZoom.Show();if(compass)compass.Hide();obliqueCompass.Show();}function ol(){obliqueTab.className="Dashboard_tab Dashboard_unselected";obliqueNotification.style.display="block";}function pl(){obliqueTab.className="Dashboard_tab Dashboard_disabled";obliqueNotification.style.display="none";}function ql(){Uk.SetMapStyle("r");}function rl(){if(firstAerial||labelsCheckbox.checked)Uk.SetMapStyle("h");else Uk.SetMapStyle("a");firstAerial=false;}function sl(){Uk.SetMapStyle("o");}function tl(e){var mapStyle=Uk.GetMapStyle();if(mapStyle=="a"){Uk.SetMapStyle("h");labelsCheckbox.checked=true;}else{if(mapStyle=="h"){Uk.SetMapStyle("a");labelsCheckbox.checked=false;}}}function ul(e){orthoZoom.UpdateFromMap();obliqueZoom.UpdateFromMap();}function vl(e){if(Uk.GetMapStyle()=="o")return;ol();obliqueCompass.UpdateFromMap();}function wl(e){pl();}function xl(e){switch(e.view.mapStyle){case "r":ll();break;case "a":case "h":ml();break;case "o":nl();break;}}function yl(e){obliqueSelector.Update();obliqueCompass.UpdateFromMap();}function zl(Al){var Tk=document.createElement("div");var x=0;var y=0;var panning=false;var maxScrollSpeed=15;this.Init=function(){Tk.className="Compass";Tk.attachEvent("onmousedown",Bl);Tk.attachEvent("onmouseup",Dl);Tk.attachEvent("onmousemove",Cl);Tk.attachEvent("ondblclick",IgnoreEvent);Al.appendChild(Tk);};this.Destroy=function(){Tk.detachEvent("onmousedown",Bl);Tk.detachEvent("onmouseup",Dl);Tk.detachEvent("onmousemove",Cl);Tk.detachEvent("ondblclick",IgnoreEvent);Tk=null;};function Bl(e){e=GetEvent(e);CancelEvent(e);x=GetLeftPosition(Tk);y=GetTopPosition(Tk);if(Tk.setCapture)Tk.setCapture();var dx=GetMouseX(e)-x-Tk.offsetWidth/2;var dy=GetMouseY(e)-y-Tk.offsetHeight/2;dx=Math.min(Math.max(dx,-maxScrollSpeed),maxScrollSpeed);dy=Math.min(Math.max(dy,-maxScrollSpeed),maxScrollSpeed);Uk.ContinuousPan(dx,dy);panning=true;return false;}function Cl(e){e=GetEvent(e);CancelEvent(e);if(panning){var dx=GetMouseX(e)-x-Tk.offsetWidth/2;var dy=GetMouseY(e)-y-Tk.offsetHeight/2;dx=Math.min(Math.max(dx,-maxScrollSpeed),maxScrollSpeed);dy=Math.min(Math.max(dy,-maxScrollSpeed),maxScrollSpeed);Uk.ContinuousPan(dx,dy);}return false;}function Dl(e){e=GetEvent(e);CancelEvent(e);if(Tk.releaseCapture)Tk.releaseCapture();Uk.StopContinuousPan();panning=false;return false;}function El(){Tk.style.display="none";}function Fl(){Tk.style.display="block";}this.Hide=El;this.Show=Fl;}function Gl(Hl){var Tk=document.createElement("table");var cells=new Array(3);this.Init=function(){Tk.className="obliqueSelectorTable";Jl();Hl.appendChild(Tk);var tbody=document.createElement("tbody");tbody.className="obliqueSelectorTable";Tk.appendChild(tbody);for(var i=0;i<3;i++){var row=document.createElement("tr");tbody.appendChild(row);cells[i]=new Array(3);for(var j=0;j<3;j++){var link=document.createElement("div");var cell=document.createElement("td");row.appendChild(cell);cell.appendChild(link);link.className="Dashboard_thumbnail";if(i==1&&j==1){cells[i][j]=new Ll(link,false);cell.className="obliqueSelectorCellCenter";}else{cells[i][j]=new Ll(link,true);cell.className="obliqueSelectorCellOff";}cells[i][j].Init();}}};this.Destroy=function(){Hl.removeChild(Tk);Tk=null;for(var i=0;i<cells.length;i++){for(var j=0;j<cells[i].length;j++){cells[i][j].Destroy();cells[i][j]=null;}}cells=null;};function Il(){Kl();Tk.style.display="block";}function Jl(){Tk.style.display="none";}function Kl(){var scene=Uk.GetObliqueScene();if(!scene)return;cells[1][1].SetScene(scene);switch(scene.GetOrientation()){case "North":cells[0][0].SetScene(scene.GetNeighbor("Northwest"));cells[0][1].SetScene(scene.GetNeighbor("North"));cells[0][2].SetScene(scene.GetNeighbor("Northeast"));cells[1][0].SetScene(scene.GetNeighbor("West"));cells[1][2].SetScene(scene.GetNeighbor("East"));cells[2][0].SetScene(scene.GetNeighbor("Southwest"));cells[2][1].SetScene(scene.GetNeighbor("South"));cells[2][2].SetScene(scene.GetNeighbor("Southeast"));break;case "East":cells[0][0].SetScene(scene.GetNeighbor("Northeast"));cells[0][1].SetScene(scene.GetNeighbor("East"));cells[0][2].SetScene(scene.GetNeighbor("Southeast"));cells[1][0].SetScene(scene.GetNeighbor("North"));cells[1][2].SetScene(scene.GetNeighbor("South"));cells[2][0].SetScene(scene.GetNeighbor("Northwest"));cells[2][1].SetScene(scene.GetNeighbor("West"));cells[2][2].SetScene(scene.GetNeighbor("Southwest"));break;case "West":cells[0][0].SetScene(scene.GetNeighbor("Southwest"));cells[0][1].SetScene(scene.GetNeighbor("West"));cells[0][2].SetScene(scene.GetNeighbor("Northwest"));cells[1][0].SetScene(scene.GetNeighbor("South"));cells[1][2].SetScene(scene.GetNeighbor("North"));cells[2][0].SetScene(scene.GetNeighbor("Southeast"));cells[2][1].SetScene(scene.GetNeighbor("East"));cells[2][2].SetScene(scene.GetNeighbor("Northeast"));break;case "South":cells[0][0].SetScene(scene.GetNeighbor("Southeast"));cells[0][1].SetScene(scene.GetNeighbor("South"));cells[0][2].SetScene(scene.GetNeighbor("Southwest"));cells[1][0].SetScene(scene.GetNeighbor("East"));cells[1][2].SetScene(scene.GetNeighbor("West"));cells[2][0].SetScene(scene.GetNeighbor("Northeast"));cells[2][1].SetScene(scene.GetNeighbor("North"));cells[2][2].SetScene(scene.GetNeighbor("Northwest"));break;}}function Ll(Ml,Nl){var scene=null;this.Init=function(){Ml.title="Select a thumbnail to display an image from the surrounding area.";if(Nl){Ml.attachEvent("onclick",Ol);Ml.attachEvent("onmouseover",Pl);Ml.attachEvent("onmouseout",Ql);}};this.Destroy=function(){if(Nl){Ml.detachEvent("onclick",Ol);Ml.detachEvent("onmouseover",Pl);Ml.detachEvent("onmouseout",Ql);}};this.SetScene=function(s){scene=s;if(scene){Ml.innerHTML="<img src=\""+scene.GetThumbnailFilename()+"\" width=48 height=48 border=0>";if(Nl)Ml.style.cursor="pointer";}else{Ml.innerHTML="";Ml.style.cursor="default";}if(Nl)Ml.parentNode.className="obliqueSelectorCellOff";};function Ol(){if(!scene)return;Uk.SetObliqueScene(scene.GetID());}function Pl(e){Ml.parentNode.className="obliqueSelectorCellOn";}function Ql(e){Ml.parentNode.className="obliqueSelectorCellOff";}}this.Update=Kl;this.Show=Il;this.Hide=Jl;}function Rl(Sl){var container=document.createElement("div");var plus=document.createElement("div");var bar=document.createElement("div");var slider=document.createElement("div");var minus=document.createElement("div");var x=0;var y=0;var dragging=false;this.Init=function(){minus.className="ZoomBar_minus";minus.unselectable="on";minus.attachEvent("onclick",am);slider.className="ZoomBar_slider";slider.unselectable="on";slider.attachEvent("onmousedown",Wl);slider.attachEvent("onmousemove",Xl);slider.attachEvent("onmouseup",Yl);slider.attachEvent("onclick",IgnoreEvent);bar.className="ZoomBar_bar";bar.unselectable="on";bar.appendChild(slider);bar.attachEvent("onclick",bm);plus.className="ZoomBar_plus";plus.unselectable="on";plus.attachEvent("onclick",Zl);container.className="ZoomBar";container.appendChild(minus);container.appendChild(bar);container.appendChild(plus);container.attachEvent("onmousedown",IgnoreEvent);container.attachEvent("onmouseup",IgnoreEvent);container.attachEvent("onclick",IgnoreEvent);container.attachEvent("ondblclick",IgnoreEvent);Sl.appendChild(container);jm();};this.Destroy=function(){minus.detachEvent("onclick",am);slider.detachEvent("onmousedown",Wl);slider.detachEvent("onmousemove",Xl);slider.detachEvent("onmouseup",Yl);slider.detachEvent("onclick",IgnoreEvent);bar.removeChild(slider);bar.detachEvent("onclick",bm);plus.detachEvent("onclick",Zl);container.removeChild(plus);container.removeChild(bar);container.removeChild(minus);container.detachEvent("onmousedown",IgnoreEvent);container.detachEvent("onmousedown",IgnoreEvent);container.detachEvent("onclick",IgnoreEvent);container.detachEvent("ondblclick",IgnoreEvent);Sl.removeChild(container);Uk.DetachEvent("onendzoom",jm);minus=slider=bar=plus=container=Sl=Uk=null;};function Tl(){container.style.display="block";}function Ul(){container.style.display="none";}function Vl(){x=GetLeftPosition(container);y=GetTopPosition(container);}function Wl(e){e=GetEvent(e);CancelEvent(e);Vl();if(slider.setCapture)slider.setCapture();dragging=true;return false;}function Xl(e){e=GetEvent(e);CancelEvent(e);if(dragging)slider.style.left=cm(GetMouseX(e))+"px";return false;}function Yl(e){e=GetEvent(e);CancelEvent(e);if(slider.releaseCapture)slider.releaseCapture();dragging=false;gm(cm(GetMouseX(e)));return false;}function Zl(e){Uk.ZoomIn();}function am(e){Uk.ZoomOut();}function bm(e){e=GetEvent(e);CancelEvent(e);Vl();gm(cm(GetMouseX(e)));return false;}function cm(em){em-=(x+minus.offsetWidth+slider.offsetWidth);var max=bar.offsetWidth-slider.offsetWidth;if(em<0)em=0;else{if(em>max)em=max;}return em;}function gm(hm){var max=bar.offsetWidth-slider.offsetWidth;var zoom=1+MathRound(hm/max*18);Uk.SetZoom(zoom);}function jm(){var max=bar.offsetWidth-slider.offsetWidth;var pos=(Uk.GetZoomLevel()-1)/18*max;slider.style.left=pos+"px";}this.UpdateFromMap=jm;this.Show=Tl;this.Hide=Ul;}function km(lm){var container=document.createElement("div");var smallViewButton=document.createElement("div");var largeViewButton=document.createElement("div");container.title="Select the desired zoom level for the image.";container.setAttribute("id","obliqueZoomContainer");smallViewButton.setAttribute("id","obliqueZoomSmall");smallViewButton.className="obliqueZoomSmallOn";largeViewButton.setAttribute("id","obliqueZoomLarge");largeViewButton.className="obliqueZoomLargeOff";smallViewButton.attachEvent("onclick",om);largeViewButton.attachEvent("onclick",pm);container.appendChild(smallViewButton);container.appendChild(largeViewButton);lm.appendChild(container);function mm(){container.style.display="block";}function nm(){container.style.display="none";}function om(e){Uk.ZoomOut();smallViewButton.className="obliqueZoomSmallOn";largeViewButton.className="obliqueZoomLargeOff";}function pm(e){Uk.ZoomIn();smallViewButton.className="obliqueZoomSmallOff";largeViewButton.className="obliqueZoomLargeOn";}function qm(){smallViewButton.detachEvent("onclick",om);largeViewButton.detachEvent("onclick",pm);container.removeChild(smallViewButton);container.removeChild(largeViewButton);smallViewButton=null;largeViewButton=null;container.parentNode.removeChild(container);container=null;}function rm(){if(Uk.GetZoomLevel()==1){smallViewButton.className="obliqueZoomSmallOn";largeViewButton.className="obliqueZoomLargeOff";}else{smallViewButton.className="obliqueZoomSmallOff";largeViewButton.className="obliqueZoomLargeOn";}}this.Destroy=qm;this.Show=mm;this.Hide=nm;this.UpdateFromMap=rm;}function sm(tm,um,vm){var Tk=document.createElement("div");Tk.setAttribute("id",tm);Tk.innerHTML=um;var previousClass="obliqueCompassPointOff";var currentPositionIndex=vm;Tk.onmouseover=wm;Tk.onmouseout=ym;Tk.onclick=xm;this.onclick=null;this.onmouseover=null;this.onmouseout=null;var me=this;var disabled=false;var rotator=new Km(Tk,17,17);function wm(e){if(disabled)return;previousClass=Tk.className;Tk.className="obliqueCompassPointHover";if(me.onmouseover)me.onmouseover(e);}function xm(e){if(disabled)return;wm(e);previousClass="obliqueCompassPointOn";if(me.onclick)me.onclick(e);}function ym(e){if(disabled)return;Tk.className=previousClass;if(me.onmouseout)me.onmouseout(e);}function zm(){previousClass="obliqueCompassPointOn";Tk.className="obliqueCompassPointOn";}function Am(){previousClass="obliqueCompassPointOff";Tk.className="obliqueCompassPointOff";}function Bm(){disabled=true;Am();}function Cm(){disabled=false;zm();}function Dm(){return Tk;}function Em(){return currentPositionIndex;}function Fm(Gm){currentPositionIndex=Gm;}function Hm(){rotator.Reset();Cm();}function Im(Jm){Tk.style.left=Jm.left;Tk.style.top=Jm.top;}function Km(Lm,Mm,Nm){var Tk=Lm;var currentAngle=0;var deltaAngle=0.3;var targetAngle=0;var deltaTime=40;var radius=25;var animating=false;var quartCircle=Math.PI/2;var isCCW=true;var limit=deltaAngle+0.1;function Om(Pm,Qm,Rm){if(Qm>=Rm-Pm&&Qm<=Rm+Pm)return true;return false;}function Sm(){currentAngle+=deltaAngle;if(currentAngle>Math.PI*2)currentAngle-=Math.PI*2;else{if(currentAngle<0)currentAngle+=Math.PI*2;}if(Om(limit,currentAngle,targetAngle)){deltaAngle=0.3;currentAngle=targetAngle;Tm(currentAngle);animating=false;return;}Tm(currentAngle);window.setTimeout(Sm,deltaTime);}function Tm(Um){var x=Mm+radius*Math.sin(Um);var y=Nm+radius*Math.cos(Um);Tk.style.left=x+"px";Tk.style.top=y+"px";}function Vm(Wm){if(animating)return;animating=true;targetAngle=Wm;Sm();}function Xm(Ym,Zm){isCCW=Zm;if(!isCCW)deltaAngle*=-1;Vm(quartCircle*Ym);}function an(){animating=false;currentAngle=0;}this.RotateTo=Vm;this.RotateToIndex=Xm;this.Reset=an;}function bn(){Tk.parentNode.removeChild(Tk);Tk.onmouseover=null;Tk.onmouseout=null;Tk.onclick=null;Tk=null;}this.GetElement=Dm;this.GetCurrentPositionIndex=Em;this.SetCurrentPositionIndex=Fm;this.SetCurrentPosition=Im;this.On=zm;this.Off=Am;this.RotateToIndex=rotator.RotateToIndex;this.Reset=Hm;this.Disable=Bm;this.Enable=Cm;this.Destroy=bn;}function cn(en){var pointPositions=new Array();pointPositions.push({"top":"-8px","left":"17px"});pointPositions.push({"top":"17px","left":"42px"});pointPositions.push({"top":"42px","left":"17px"});pointPositions.push({"top":"17px","left":"-8px"});var compassContainer=document.createElement("div");compassContainer.setAttribute("id","obliqueCompassContainer");compassContainer.title="Select the direction you want to look toward.";var northElm=new sm("obliqueCompassPointN","N",0);northElm.onclick=sn;northElm.onmouseover=yn;northElm.onmouseout=nn;var eastElm=new sm("obliqueCompassPointE","E",1);eastElm.onclick=tn;eastElm.onmouseover=wn;eastElm.onmouseout=nn;var southElm=new sm("obliqueCompassPointS","S",2);southElm.onclick=rn;southElm.onmouseover=vn;southElm.onmouseout=nn;var westElm=new sm("obliqueCompassPointW","W",3);westElm.onclick=un;westElm.onmouseover=xn;westElm.onmouseout=nn;var arrowElm=document.createElement("div");compassContainer.appendChild(northElm.GetElement());compassContainer.appendChild(eastElm.GetElement());compassContainer.appendChild(southElm.GetElement());compassContainer.appendChild(westElm.GetElement());compassContainer.appendChild(arrowElm);en.appendChild(compassContainer);Bn();function gn(hn){if(hn<0)hn=4-Math.abs(hn);return hn;}function jn(kn){var pos=kn.GetCurrentPositionIndex();eastElm.SetCurrentPositionIndex(gn(eastElm.GetCurrentPositionIndex()-pos));westElm.SetCurrentPositionIndex(gn(westElm.GetCurrentPositionIndex()-pos));northElm.SetCurrentPositionIndex(gn(northElm.GetCurrentPositionIndex()-pos));southElm.SetCurrentPositionIndex(gn(southElm.GetCurrentPositionIndex()-pos));var ccw=true;if(pos==3)ccw=false;northElm.RotateToIndex(2-northElm.GetCurrentPositionIndex()<0?northElm.GetCurrentPositionIndex():2-northElm.GetCurrentPositionIndex(),ccw);eastElm.RotateToIndex(2-eastElm.GetCurrentPositionIndex()<0?eastElm.GetCurrentPositionIndex():2-eastElm.GetCurrentPositionIndex(),ccw);southElm.RotateToIndex(2-southElm.GetCurrentPositionIndex()<0?southElm.GetCurrentPositionIndex():2-southElm.GetCurrentPositionIndex(),ccw);westElm.RotateToIndex(2-westElm.GetCurrentPositionIndex()<0?westElm.GetCurrentPositionIndex():2-westElm.GetCurrentPositionIndex(),ccw);}function ln(mn){switch(mn){case 0:nn();break;case 1:pn();break;case 2:on();break;case 3:qn();break;}}function nn(){arrowElm.className="obliqueCompassArrowU";}function on(){arrowElm.className="obliqueCompassArrowD";}function pn(){arrowElm.className="obliqueCompassArrowR";}function qn(){arrowElm.className="obliqueCompassArrowL";}function rn(e){jn(southElm);ln(0);var scene=Uk.GetObliqueScene();if(scene){var aScene=scene.GetRotation("South");if(aScene)Uk.SetObliqueOrientation("South");}}function sn(e){jn(northElm);ln(0);var scene=Uk.GetObliqueScene();if(scene){var aScene=scene.GetRotation("North");if(aScene)Uk.SetObliqueOrientation("North");}}function tn(e){jn(eastElm);ln(0);var scene=Uk.GetObliqueScene();if(scene){var aScene=scene.GetRotation("East");if(aScene)Uk.SetObliqueOrientation("East");}}function un(e){jn(westElm);ln(0);var scene=Uk.GetObliqueScene();if(scene){var aScene=scene.GetRotation("West");if(aScene)Uk.SetObliqueOrientation("West");}}function vn(e){ln(southElm.GetCurrentPositionIndex());}function wn(e){ln(eastElm.GetCurrentPositionIndex());}function xn(e){ln(westElm.GetCurrentPositionIndex());}function yn(e){ln(northElm.GetCurrentPositionIndex());}function zn(){compassContainer.style.display="none";}function An(){compassContainer.style.display="block";}function Bn(){var scene=Uk.GetObliqueScene();if(!scene)return;switch(scene.GetOrientation()){case "North":jn(northElm);break;case "South":jn(southElm);break;case "East":jn(eastElm);break;case "West":jn(westElm);break;}ln(0);if(scene.GetRotation("North"))northElm.Enable();else northElm.Disable();if(scene.GetRotation("South"))southElm.Enable();else southElm.Disable();if(scene.GetRotation("East"))eastElm.Enable();else eastElm.Disable();if(scene.GetRotation("West"))westElm.Enable();else westElm.Disable();}function Cn(){northElm.Destroy();eastElm.Destroy();southElm.Destroy();westElm.Destroy();compassContainer.parentNode.removeChild(compassContainer);compassContainer=null;}this.Hide=zn;this.Show=An;this.UpdateFromMap=Bn;}};Msn.VE.DashboardSize=new function(){this.Normal="normal";this.Small="small";this.Tiny="tiny";}();Msn.VE.LatLong=function(Dn,En){this.latitude=Dn;this.longitude=En;this.ToString=function(){return "("+this.latitude+", "+this.longitude+")";};this.Copy=function(Fn){if(!Fn)return;this.latitude=Fn.latitude;this.longitude=Fn.longitude;};};Msn.VE.LatLongRectangle=function(Gn,Hn){this.northwest=Gn;this.southeast=Hn;this.ToString=function(){return "("+(this.northwest?this.northwest.ToString():"null")+", "+(this.southeast?this.southeast.ToString():"null")+")";};this.Copy=function(In){if(!In)return;if(!this.northwest)this.northwest=new Msn.VE.LatLong();if(!this.southeast)this.southeast=new Msn.VE.LatLong();this.northwest.Copy(In.northwest);this.southeast.Copy(In.southeast);};this.Center=function(){var sinLat1=Math.sin(this.northwest.latitude*Math.PI/180);var sinLat2=Math.sin(this.southeast.latitude*Math.PI/180);var average=0.25*(Math.log((1+sinLat1)/(1-sinLat1))+Math.log((1+sinLat2)/(1-sinLat2)));var center=new Msn.VE.LatLong();center.latitude=Math.atan(Math.exp(average))*360/Math.PI-90;center.longitude=0.5*(this.northwest.longitude+this.southeast.longitude);return center;};this.Contains=function(Jn){return Jn.latitude<=Gn.latitude&&Jn.longitude>=Gn.longitude&&Jn.latitude>=Hn.latitude&&Jn.longitude<=Hn.longitude;};};Msn.VE.MapStyle=new function(){this.Road="r";this.Aerial="a";this.Hybrid="h";this.Oblique="o";}();Msn.VE.MapView=function(){this.zoomLevel=0;this.mapStyle=null;this.center=new Msn.VE.Pixel();this.latlong=new Msn.VE.LatLong();this.pixelRect=new Msn.VE.PixelRectangle();this.latlongRect=new Msn.VE.LatLongRectangle();this.sceneId=null;this.sceneOrientation=null;var p_this=this;var viewType="pixel";this.Destroy=function(){this.center=this.latlong=p_this=null;};this.GetViewType=function(){return viewType;};function Kn(){var copy=new Msn.VE.MapView();copy.Copy(p_this);return copy;}function Ln(Mn){p_this.zoomLevel=Mn.zoomLevel;p_this.mapStyle=Mn.mapStyle;p_this.center.Copy(Mn.center);p_this.latlong.Copy(Mn.latlong);p_this.pixelRect.Copy(Mn.pixelRect);p_this.latlongRect.Copy(Mn.latlongRect);p_this.sceneId=Mn.sceneId;p_this.sceneOrientation=Mn.sceneOrientation;viewType=Mn.GetViewType();}function Nn(On){return On!=null&&p_this.zoomLevel==On.zoomLevel&&p_this.mapStyle==On.mapStyle&&MathAbs(p_this.center.x-On.center.x)<1E-06&&MathAbs(p_this.center.y-On.center.y)<1E-06&&p_this.sceneId==On.sceneId&&p_this.sceneOrientation==On.sceneOrientation;}function Pn(){return "("+p_this.latlong.ToString()+", "+p_this.zoomLevel+", "+p_this.mapStyle+")";}function Qn(Rn){if(!Rn)return;p_this.center=Rn;viewType="pixel";}function Sn(Tn){if(!Tn)return;p_this.latlong=Tn;viewType="latlong";}function Un(Vn){p_this.pixelRect=Vn;viewType="pixelRect";}function Wn(Xn){p_this.latlongRect=Xn;viewType="latlongRect";}function Yn(Zn){if(Zn<=0)return;switch(viewType){case "pixel":var factor=Math.pow(2,Zn-p_this.zoomLevel);p_this.center.x*=factor;p_this.center.y*=factor;break;case "pixelRect":var factor=Math.pow(2,Zn-p_this.zoomLevel);p_this.pixelRect.topLeft.x*=factor;p_this.pixelRect.topLeft.y*=factor;p_this.pixelRect.bottomRight.x*=factor;p_this.pixelRect.bottomRight.y*=factor;break;}p_this.zoomLevel=Zn;}function ao(bo,co,eo){p_this.mapStyle=bo;if(viewType=="pixel")viewType="latlong";if(bo!="o"){p_this.sceneId=null;p_this.sceneOrientation=null;}else{p_this.sceneId=co;p_this.sceneOrientation=eo;}}function go(ho){if(ho)return p_this.center.x*Math.pow(2,ho-p_this.zoomLevel);return p_this.center.x;}function jo(ko){if(ko)return p_this.center.y*Math.pow(2,ko-p_this.zoomLevel);return p_this.center.y;}function lo(mo){if(mo==undefined)return p_this.center;return new Msn.VE.Pixel(p_this.GetX(mo),p_this.GetY(mo));}function no(oo,po,qo){switch(viewType){case "pixel":p_this.latlong=oo.PixelToLatLong(p_this.center,p_this.zoomLevel);break;case "latlong":p_this.center=oo.LatLongToPixel(p_this.latlong,p_this.zoomLevel);break;case "pixelRect":ro(oo,po,qo);break;case "latlongRect":if(p_this.mapStyle=="o"){p_this.zoomLevel=1;var scene=oo.GetScene();if(!scene.ContainsLatLong(p_this.latlongRect.northwest)||!scene.ContainsLatLong(p_this.latlongRect.southeast)){p_this.latlong=p_this.latlongRect.Center();p_this.center=oo.LatLongToPixel(p_this.latlong,p_this.zoomLevel);}else{p_this.pixelRect.topLeft=oo.LatLongToPixel(p_this.latlongRect.northwest,p_this.zoomLevel);p_this.pixelRect.bottomRight=oo.LatLongToPixel(p_this.latlongRect.southeast,p_this.zoomLevel);ro(oo,po,qo);}}else{p_this.zoomLevel=12;p_this.pixelRect.topLeft=oo.LatLongToPixel(p_this.latlongRect.northwest,p_this.zoomLevel);p_this.pixelRect.bottomRight=oo.LatLongToPixel(p_this.latlongRect.southeast,p_this.zoomLevel);ro(oo,po,qo);}break;}viewType="pixel";}function ro(so,to,uo){var zoomPivot=19;var zoomFactor=Math.pow(2,zoomPivot-p_this.zoomLevel);var viewportWidth=MathMax(1,MathAbs(p_this.pixelRect.topLeft.x-p_this.pixelRect.bottomRight.x)*zoomFactor);var viewportHeight=MathMax(1,MathAbs(p_this.pixelRect.topLeft.y-p_this.pixelRect.bottomRight.y)*zoomFactor);var log2=Math.log(2);var horizontalZoom=zoomPivot-Math.ceil(Math.log(viewportWidth/to)/log2);var verticalZoom=zoomPivot-Math.ceil(Math.log(viewportHeight/uo)/log2);var newZoom=MathMin(horizontalZoom,verticalZoom);zoomFactor=Math.pow(2,newZoom-p_this.zoomLevel);p_this.center.x=0.5*(p_this.pixelRect.topLeft.x+p_this.pixelRect.bottomRight.x)*zoomFactor;p_this.center.y=0.5*(p_this.pixelRect.topLeft.y+p_this.pixelRect.bottomRight.y)*zoomFactor;p_this.zoomLevel=newZoom;p_this.latlong=so.PixelToLatLong(p_this.center,p_this.zoomLevel);}this.MakeCopy=Kn;this.Copy=Ln;this.Equals=Nn;this.ToString=Pn;this.SetCenter=Qn;this.SetCenterLatLong=Sn;this.SetPixelRectangle=Un;this.SetLatLongRectangle=Wn;this.SetZoomLevel=Yn;this.SetMapStyle=ao;this.GetX=go;this.GetY=jo;this.GetCenter=lo;this.Resolve=no;this.SetZoomLevel=Yn;};Msn.VE.ObliqueScene=function(vo,wo,xo,yo,zo,Ao,Bo,Co,Do,Eo,Fo,Go){var tileSize=256;var bounds=new Msn.VE.Bounds(1,2,0,0,Bo/2,Co/2);function Ho(Io,Jo){var zoomFactor=Math.pow(2,Jo-2);var vector=[[Io.x/zoomFactor],[Io.y/zoomFactor],[1]];var result=MatrixMultiply(Do,vector);var latlong=new Msn.VE.LatLong();latlong.longitude=result[0][0]/result[2][0];latlong.latitude=result[1][0]/result[2][0];return latlong;}function Ko(Lo,Mo){var zoomFactor=Math.pow(2,Mo-2);var vector=[[Lo.longitude],[Lo.latitude],[1]];var result=MatrixMultiply(Eo,vector);var pixel=new Msn.VE.Pixel();pixel.x=result[0][0]/result[2][0]*zoomFactor;pixel.y=result[1][0]/result[2][0]*zoomFactor;return pixel;}function No(Oo,Po,Qo){if(Oo<0||Po<0)return false;if(Qo==1)return Oo<Bo/2&&Po<Co/2;return Oo<Bo&&Po<Co;}function Ro(){return vo;}function So(To,Uo,Vo){var tileId=Uo*(Vo==1?Bo/2:Bo)+To;return "http://c"+To%2+".p"+Ao+".oblique.tiles.dns.corp.microsoft.com/tiles/o"+wo+"-"+xo+"-"+(zo+Vo-2)+"-"+tileId+".jpeg?g=1";}function Wo(){return "http://thumbs.oblique.tiles.dns.corp.microsoft.com/tiles/ot"+vo+".jpeg?g=1";}function Xo(i){var sceneId=Fo[i];if(sceneId==null||sceneId==-1)return null;return new Msn.VE.ObliqueScene(sceneId);}function Yo(i){var sceneId=Go[i];if(sceneId==null||sceneId==-1)return null;return new Msn.VE.ObliqueScene(sceneId);}function Zo(){return yo;}function ap(){return bounds;}function bp(){return Bo*tileSize;}function cp(){return Co*tileSize;}function ep(gp){if(!gp)return false;var pixel=Ko(gp,2);return hp(pixel,2);}function hp(jp,kp){var zoomFactor=Math.pow(2,2-kp);var x=jp.x*zoomFactor;var y=jp.y*zoomFactor;return x>=0&&y>=0&&x<bp()&&y<cp();}this.PixelToLatLong=Ho;this.LatLongToPixel=Ko;this.IsValidTile=No;this.GetID=Ro;this.GetTileFilename=So;this.GetThumbnailFilename=Wo;this.GetNeighbor=Xo;this.GetRotation=Yo;this.GetOrientation=Zo;this.GetBounds=ap;this.GetWidth=bp;this.GetHeight=cp;this.ContainsLatLong=ep;this.ContainsPixel=hp;};Msn.VE.Orientation=new function(){this.North="North";this.East="East";this.West="West";this.South="South";}();Msn.VE.Pixel=function(x,y){this.x=x;this.y=y;this.ToString=function(){return "("+this.x+", "+this.y+")";};this.Copy=function(lp){if(!lp)return;this.x=lp.x;this.y=lp.y;};};Msn.VE.PixelRectangle=function(mp,np){this.topLeft=mp;this.bottomRight=np;this.ToString=function(){return "("+(this.topLeft?this.topLeft.ToString():"null")+", "+(this.bottomRight?this.bottomRight.ToString():"null")+")";};this.Copy=function(op){if(!op)return;if(!this.topLeft)this.topLeft=new Msn.VE.Pixel();if(!this.bottomRight)this.bottomRight=new Msn.VE.Pixel();this.topLeft.Copy(op.topLeft);this.bottomRight.Copy(op.bottomRight);};};Msn.VE.LineRegion=function(pp,qp,rp){this.boundingRectangle=pp;this.indices=qp;this.childRegions=rp;function sp(){return "Bounding Rectangle: "+this.boundingRectangle[0].ToString()+" to "+this.boundingRectangle[1].ToString()+" | Indices: ["+qp+"]";}this.ToString=sp;};function VEParameter(tp,up){this.Name=tp;this.Value=up;}VEParameter.prototype.Name=this.name;VEParameter.prototype.Value=this.value;function VENetwork(vp,wp,xp){if(vp!=null&&vp!="undefined")this.ServiceUrl=vp;if(wp!=null&&wp!="undefined")Msn.VE.API.Globals.veonbegininvokeevent=wp;if(xp!=null&&xp!="undefined")Msn.VE.API.Globals.veonendinvokeevent=xp;}function BeginInvoke(yp,zp,Ap){if(this.ServiceUrl==null||this.ServiceUrl=="undefined"||this.ServiceUrl.length==0)throw new VEException("VENetwork:BeginInvoke","err_noserviceurl",L_noserviceurl_text);if(Msn.VE.API.Globals.veonbegininvokeevent)Msn.VE.API.Globals.veonbegininvokeevent();var executionid=VENetwork.GetExecutionID();if(zp){var methodurl=this.ServiceUrl+"?";for(var i=0;i<zp.length;i++){methodurl=methodurl+zp[i].Name;methodurl=methodurl+"=";methodurl=methodurl+zp[i].Value;methodurl=methodurl+"&";}}else var methodurl=this.ServiceUrl;if(Msn.VE.API.Globals.vedebug)alert(methodurl);var elScript=document.createElement("script");elScript.type="text/javascript";elScript.language="javascript";elScript.id=executionid;elScript.src=methodurl;if(navigator.userAgent.indexOf("IE")>=0)elScript.onreadystatechange=function(){if(elScript&&("loaded"==elScript.readyState||"complete"==elScript.readyState)){elScript.onreadystatechange=null;EndInvoke(Ap,yp,elScript,executionid);}};else elScript.onload=function(){elScript.onload=null;EndInvoke(Ap,yp,elScript,executionid);};VENetwork.GetAttachTarget().appendChild(elScript);}function EndInvoke(Bp,Cp,Dp,Ep){var objects=null;if(Cp)eval("objects = "+Cp+"();");document.getElementsByTagName("head")[0].removeChild(Dp);Dp=null;if(Bp!=null&&Bp!="undefined")Bp(objects);if(Msn.VE.API.Globals.veonendinvokeevent)Msn.VE.API.Globals.veonendinvokeevent();}VENetwork.GetExecutionID=function(){var date=new Date();var id=Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds());id+=Math.round(Math.random()*1000000);return id;};function GetXmlHttp(){var xmlhttp=null;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(ex){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(ex){xmlhttp=null;}}if(!xmlhttp&&typeof XMLHttpRequest!="undefined")xmlhttp=new XMLHttpRequest();return xmlhttp;}VENetwork.AttachStyleSheetCallback=function(Fp){if(Fp)Fp();};VENetwork.AttachStyleSheet=function(Gp,Hp){if(Gp==null||Gp=="undefined"||Gp.length==0)throw new VEException("VENetwork:AttachStylesheet","err_nostylesurl",L_nostylesurl_text);elStyle=document.createElement("link");elStyle.rel="stylesheet";elStyle.type="text/css";elStyle.rev="stylesheet";elStyle.id=VENetwork.GetExecutionID();elStyle.href=Gp;VENetwork.GetAttachTarget().appendChild(elStyle);if(navigator.userAgent.indexOf("IE")>=0)elStyle.onreadystatechange=function(){if(elStyle&&("loaded"==elStyle.readyState||"complete"==elStyle.readyState)){elStyle.onreadystatechange=null;VENetwork.AttachStyleSheetCallback(Hp);}};else VENetwork.AttachStyleSheetCallback(Hp);return;};VENetwork.DownloadScriptCallback=function(Ip,Jp){if(Ip)Ip(Jp);};VENetwork.DownloadScript=function(Kp,Lp,Mp,Np){if(Kp==null||Kp=="undefined"||Kp.length==0)throw new VEException("VENetwork:DownloadScript","err_noscripturl",L_noscripturl_text);elScript=document.createElement("script");elScript.type="text/javascript";elScript.language="javascript";elScript.id=Lp;elScript.src=Kp;if(navigator.userAgent.indexOf("IE")>=0)elScript.onreadystatechange=function(){if(elScript&&("loaded"==elScript.readyState||"complete"==elScript.readyState)){elScript.onreadystatechange=null;VENetwork.DownloadScriptCallback(Mp,Np);}};else elScript.onload=function(){elScript.onload=null;VENetwork.DownloadScriptCallback(Mp,Np);};VENetwork.GetAttachTarget().appendChild(elScript);return;};VENetwork.DownloadXml=function(Op,Pp,Qp){var xmlhttp=GetXmlHttp();xmlhttp.open(Pp,Op,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(Qp)Qp(xmlhttp.responseXML);xmlhttp=null;}};xmlhttp.send(null);};VENetwork.GetAttachTarget=function(){if(document.getElementsByTagName("head")[0]!=null)return document.getElementsByTagName("head")[0];else throw new VEException("VENetwork:cstr","err_noheadelement",L_noheadelement_text);};VENetwork.prototype.BeginInvoke=BeginInvoke;VENetwork.prototype.EndInvoke=EndInvoke;function detectIE(){var version=0;if(navigator.appVersion.indexOf("MSIE")!=-1){temp=navigator.appVersion.split("MSIE");version=parseFloat(temp[1]);}if(version>=5.5)return true;else return false;}var Microsoft_Web_UI_Geometry={"point":function(x,y){var self=this;var geo=Microsoft_Web_UI_Geometry;this.x=x;this.y=y;this.add=function(Rp,Sp){var newX=self.x;var newY=self.y;if(Rp)newX+=Rp;if(Sp)newY+=Sp;return new geo.point(newX,newY);};},"rect":function(Tp,Up){this.p1=Tp;this.p2=Up;this.isInArea=function(p){return p.x>Tp.x&&p.x<Up.x&&p.y>Tp.y&&p.y<Up.y;};},"getElementPosition":function(Vp){var geo=Microsoft_Web_UI_Geometry;if(Vp.parentElement)return new geo.point(Vp.offsetLeft,Vp.offsetTop).add(Vp.parentElement.offsetLeft,Vp.parentElement.offsetTop);else return new geo.point(Vp.offsetLeft,Vp.offsetTop);},"getElementRect":function(Wp){var p1=getElementPosition(Wp);var p2=p1.add(Wp.offsetWidth,Wp.offsetHeight);return new rect(p1,p2);}};var Microsoft_Web_UI_DragLib={"DraggableObjectsFactory":function(){var m_drobCollection=new Array();var m_componentBeingDragged=null;document.attachEvent("onmousemove",jq);document.attachEvent("onmouseup",hq);function Xp(Yp,Zp){Yp.isDrob=true;Zp=Zp||Yp;Zp.attachEvent("onmouseover",aq);Zp.attachEvent("onmouseout",bq);Zp.attachEvent("onmousedown",eq);this.destroy=function(){Yp.isDrob=null;Zp.detachEvent("onmouseover",aq);Zp.detachEvent("onmouseout",bq);Zp.detachEvent("onmousedown",eq);};this.getDragArea=function(){return Zp;};}function aq(){document.body.style.cursor="move";}function bq(){document.body.style.cursor="default";}function cq(){return false;}function eq(e){document.body.attachEvent("onselectstart",cq);m_bIsDraggingSomething=true;var target=e.srcElement||e.target;var parent=target.parentNode;while(true){if(!parent||!parent.isDrob)break;else{target=parent;break;}}m_componentBeingDragged=target;var p=Microsoft_Web_UI_Geometry.getElementPosition(target);m_componentBeingDragged.xOffset=e.clientX-p.x;m_componentBeingDragged.yOffset=e.clientY-p.y;}function gq(e){if(e&&e.stopPropagation)e.stopPropagation();else window.event.cancelBubble=true;}function hq(){document.body.detachEvent("onselectstart",cq);if(m_componentBeingDragged)m_componentBeingDragged.xOffset=m_componentBeingDragged.yOffset=m_componentBeingDragged=null;}function jq(e){if(m_componentBeingDragged){var cbd=m_componentBeingDragged;cbd.style.left=e.clientX-cbd.xOffset+"px";cbd.style.top=e.clientY-cbd.yOffset+"px";}}this.makeDraggableObject=function(kq,lq){var drob=new Xp(kq,lq);m_drobCollection.push(drob);return drob;};this.isDraggingSomething=function(){return !(m_componentBeingDragged==null);};this.goOutOfBusiness=function(){document.detachEvent("onmousemove",jq);document.detachEvent("onmouseup",hq);if(m_componentBeingDragged)m_componentBeingDragged.xOffset=m_componentBeingDragged.yOffset=m_componentBeingDragged=null;var drobs=m_drobCollection;for(var i=0;i<drobs.length;i++){drobs[i].destroy();}};}};