__l.ViewMode=new function(){this.Street=0;
this.Aerial_Labels=1;
this.Aerial=2;
this.Physical=3;
this.Physical_Labels=4;
};
__l.CursorMode=new function(){this.Pan=0;
this.Select=1;
this.Marker=2;
this.Text=3;
this.Draw=4;
};
__l.TileType=new function(){this.Street="map";
this.Satellite="sat";
this.StreetTransparent="mapt";
this.Physical="phy";
};
__l.ZoomLevel=new function(){this.Min=19;
this.Address=16;
this.Street=15;
this.Town=14;
this.City=13;
this.Region=10;
this.Min_Physical=9;
this.State=7;
this.Country=4;
this.Continent=3;
this.Globe=2;
this.Max=1;
};
__l.OverlayType=new function(){this.Default=0;
this.Marker=1;
this.Text=2;
this.Route=3;
this.Shape=5;
};
__l.Defaults={AMX_HOST:"http://api.syndication.ask.com",CurrentHost:window.location.protocol+"//"+window.location.host+window.location.pathname.substr(0,window.location.pathname.lastIndexOf("/")),MapsPath:"/maps",MapsHostPath:this.AMX_HOST+this.MapsPath,StaticTileHost:"http://mapssyn%n.ask.com",CacheTileHost:"http://mapcsyn%n.ask.com",SP:"http://sp.ask.com/sh/i/maps2/",LocalSP:"http://sp.ask.com/sh/i/local/",StaticPrintRoot:"",partnerId:"",qsrc:121};
__l.Defaults.getStaticTileHost=function(){var A=Math.round((Math.random()*3))+1;
return __l.Defaults.StaticTileHost.replace("%n",A);
};
__l.Bounds=function(D,A,C,B){this.minLat=D;
this.minLong=A;
this.maxLat=C;
this.maxLong=B;
this.minX=null;
this.minY=null;
this.maxX=null;
this.maxY=null;
};
__l.Bounds.prototype={getPixelBounds:function(A){if(this.minLong&&this.maxLong&&this.minLat&&this.maxLat){this.minX=__u.GeoMath.long2pix(this.minLong,A);
this.maxX=__u.GeoMath.long2pix(this.maxLong,A);
this.minY=__u.GeoMath.lat2pix(this.minLat,A);
this.maxY=__u.GeoMath.lat2pix(this.maxLat,A);
}return this;
},containsPoint:function(A){if(!A){return false;
}var C=A.lat>=this.minLat&&A.lat<=this.maxLat;
var B=A.lng>=this.minLong&&A.lng<=this.maxLong;
return C&&B;
},contains:function(A){return(A.minLong>=this.minLong&&A.maxLong<=this.maxLong&&A.maxLat<=this.maxLat&&A.minLat>=this.minLat);
},intersects:function(C){var D=Math.min(this.maxLat,C.maxLat);
var B=Math.min(this.maxLong,C.maxLong);
var E=Math.max(this.minLat,C.minLat);
var A=Math.max(this.minLong,C.minLong);
if(D>=E&&B>=A){return new __l.Bounds(E,A,D,B);
}else{return null;
}}};
__l.Point=function(E,B,A,F,D,C){this.fullLat=parseFloat(E);
this.fullLong=parseFloat(B);
this.lat=__u.Math.Round(this.fullLat,5);
this.lng=__u.Math.Round(this.fullLong,5);
this.address=A;
this.title=F;
this.description=D;
this.link=C;
};
__l.Point.prototype={isValid:function(){return this.lat&&this.lng;
}};
__l.Icon=function(A,B,D){this.image=__d.ce("img");
this.image.ondragstart=__u.Events.returnFalse;
this.imageUrl=A?A:__l.Defaults.LocalSP+"blue_m_dot.png";
__u.Image.SetPng(this.image,this.imageUrl);
var C=__d.ce("img");
C.src=this.imageUrl;
this.realImg=__u.Browser.isIE6?C:this.image;
this.offsetTop=B?B:null;
this.offsetLeft=D?D:null;
if(this.offsetLeft==null&&this.offsetTop==null){if(this.realImg.height>0&&this.realImg.width>0){this.offsetLeft=this.realImg.width/2;
this.offsetTop=this.realImg.height;
}else{var E=this;
this.realImg.onload=function(){if(E.realImg){E.offsetLeft=E.realImg.width/2;
E.offsetTop=E.realImg.height;
}};
}}};
__l.Icon.prototype={setImage:function(B){this.imageUrl=B;
var A=this;
setTimeout(function(){__u.Image.SetPng(A.image,A.imageUrl);
},20);
this.realImg.src=this.imageUrl;
}};
__l.DOMOverlay=function(A,D){this.parentMap=null;
this.point=A;
this.overlayType=__l.OverlayType.Default;
this.visible=true;
this.minDisplayZoom=__l.ZoomLevel.Min;
this.maxDisplayZoom=__l.ZoomLevel.Max;
var C=this;
this.div=__d.ce("div");
this.div.style.zIndex=200;
this.div.style.position="absolute";
this.div.style.cursor=__u.Browser.handCursor;
__u.Events.addListener(this.div,"click",function(E){__u.Events.stopPropagation(E);
C.click.fire(__u.Events.getEvent(E));
});
__u.Events.addListener(this.div,"mousedown",function(H){H=__u.Events.getEvent(H);
__u.Events.stopPropagation(H);
if(H.button==2){var E=C.parentMap.getMousePos(H);
var I=C.parentMap.centerX+E.x-C.parentMap.halfViewWidth;
var G=C.parentMap.centerY+E.y-C.parentMap.halfViewHeight;
var F=new __l.Point(__u.GeoMath.pix2lat(G,C.parentMap.zoom),__u.GeoMath.pix2long(I,C.parentMap.zoom));
C.rightClick.fire(H,F,I,G);
}});
this.div.ondblclick=__u.Events.stopPropagation;
if(D&&typeof (D)=="object"){try{this.div.appendChild(D);
}catch(B){}}this.click=new __u.AbstractEvent("click",this);
this.rightClick=new __u.AbstractEvent("rightClick",this);
this.dragStart=new __u.AbstractEvent("dragStart",this);
this.dragEnd=new __u.AbstractEvent("dragEnd",this);
this.mouseOver=new __u.AbstractEvent("mouseOver",this);
this.mouseOut=new __u.AbstractEvent("mouseOut",this);
};
__l.DOMOverlay.prototype={position:function(){try{var E=(__u.GeoMath.lat2pix(this.point.lat,this.parentMap.zoom));
var D=(__u.GeoMath.long2pix(this.point.lng,this.parentMap.zoom));
var B=D>=0?this.parentMap.leftShift:-(this.parentMap.leftShift);
var A=E>=0?this.parentMap.topShift:-(this.parentMap.topShift);
D=D-B;
E=E-A;
this.div.style.top=E+"px";
this.div.style.left=D+"px";
}catch(C){}},appendTo:function(A){if(A){A.appendChild(this.div);
}}};
__l.Marker=function(A,B){this.uid=__u.Math.getUniqueId();
this.lkey="overlay";
this.parentMap=null;
this.point=A;
this.overlayType=__l.OverlayType.Marker;
this.visible=true;
this.saved=false;
this.minDisplayZoom=__l.ZoomLevel.Min;
this.maxDisplayZoom=__l.ZoomLevel.Max;
this.icon=B?B:new __l.Icon();
this.icon.image.id="mi_"+this.uid;
this.click=new __u.AbstractEvent("click",this);
this.rightClick=new __u.AbstractEvent("rightClick",this);
this.dragStart=new __u.AbstractEvent("dragStart",this);
this.dragEnd=new __u.AbstractEvent("dragEnd",this);
this.mouseOver=new __u.AbstractEvent("mouseOver",this);
this.mouseOut=new __u.AbstractEvent("mouseOut",this);
this.removed=new __u.AbstractEvent("removed",this);
var D=this;
this.icon.image.onmouseover=function(E){D.mouseOver.fire(__u.Events.getEvent(E));
};
this.icon.image.onmouseout=function(E){D.mouseOut.fire(__u.Events.getEvent(E));
};
this.icon.image.oncontextmenu=__u.Events.cancel;
if(this.icon.offsetLeft==null&&this.icon.offsetTop==null){__u.Events.addListener(this.icon.realImg,"load",this.position,this,true,this.lkey);
}this.div=__d.ce("div");
this.div.id="m_"+this.uid;
var C=__d.ce("span");
if(!a10.browser.isIE6()){C.className="pinspan";
}this.icon.image.className="pinimg";
C.appendChild(this.icon.image);
this.div.appendChild(C);
if(this.div.firstChild.runtimeStyle){this.div.firstChild.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src='"+this.icon.image.src+"', sizingMethod='image');";
}this.div.style.zIndex=200;
this.div.style.position="absolute";
this.div.style.cursor=__u.Browser.handCursor;
this.div.onclick=function(H){__u.Events.stopPropagation(H);
H=__u.Events.getEvent(H);
var E=D.parentMap.getMousePos(H);
var I=D.parentMap.centerX+E.x-D.parentMap.halfViewWidth;
var G=D.parentMap.centerY+E.y-D.parentMap.halfViewHeight;
var F=new __l.Point(__u.GeoMath.pix2lat(G,D.parentMap.zoom),__u.GeoMath.pix2long(I,D.parentMap.zoom));
D.click.fire(H,F,I,G);
};
this.div.onmousedown=function(E){D.startDrag(__u.Events.getEvent(E));
};
this.div.ondblclick=__u.Events.stopPropagation;
this.dragMoved=false;
this.enableDragging=false;
__l.Marker.fadeAll.subscribe(function(F,E,G){if(!G.div){return ;
}if(E.length&&E[0]){if(E[0].id==G.div.id){G.div.className="";
}else{G.div.className="pintranspdiv";
}}else{G.div.className="";
}},this);
};
__l.Marker.fadeAll=new __u.AbstractEvent("fadeAll",this);
__l.Marker.prototype={position:function(){},appendTo:function(A){if(A){A.appendChild(this.div);
}},openInfoWindow:function(A,B){if(this.poi){this.poi.Select(true);
}},closeInfoWindow:function(A){if(this.poi){this.poi.Select(false);
}},startDrag:function(D){D=__u.Events.getEvent(D);
__u.Events.stopPropagation(D);
var B=this.parentMap.getMousePos(D);
var F=this.parentMap.centerX+B.x-this.parentMap.halfViewWidth;
var C=this.parentMap.centerY+B.y-this.parentMap.halfViewHeight;
var A=new __l.Point(__u.GeoMath.pix2lat(C,this.parentMap.zoom),__u.GeoMath.pix2long(F,this.parentMap.zoom));
if(D.button==2){this.rightClick.fire(D,A,F,C);
}else{if(this.enableDragging){var E=this;
this.dragStart.fire(__u.Events.getEvent(D));
this.dragStartX=this.x();
this.dragStartY=this.y();
this.dragOffsetX=this.dragStartX-F;
this.dragOffsetY=this.dragStartY-C;
__d.documentElement.onmousemove=function(G){return E.drag(G);
};
__d.documentElement.onmouseup=function(G){return E.endDrag(G);
};
return false;
}}},drag:function(C){__d.body.style.cursor="move";
C=__u.Events.getEvent(C);
var A=this.parentMap.getMousePos(C);
var D=this.parentMap.centerX+A.x-this.parentMap.halfViewWidth+this.dragOffsetX;
var B=this.parentMap.centerY+A.y-this.parentMap.halfViewHeight+this.dragOffsetY;
if((this.dragStartX==this.x()||this.dragStartY==this.y())){if(Math.abs(this.dragStartX-D)>10||Math.abs(this.dragStartY-B)>10){this.moveTo(D,B);
this.dragMoved=true;
}else{this.dragMoved=false;
}}else{this.moveTo(D,B);
this.dragMoved=true;
}return false;
},moveTo:function(A,B){if(this.poi){}return false;
},endDrag:function(A){__d.body.style.cursor=__u.Browser.DefaultCursor;
__d.documentElement.onmousemove=null;
__d.documentElement.onmouseup=null;
if(this.dragMoved){this.dragEnd.fire(__u.Events.getEvent(A));
}this.dragMoved=false;
return false;
},setIcon:function(A){if(this.icon&&A&&this.icon==A){return ;
}var B=this;
this.icon=A?A:new __l.Icon();
this.icon.image.onmouseover=function(C){B.mouseOver.fire(__u.Events.getEvent(C));
};
this.icon.image.onmouseout=function(C){B.mouseOut.fire(__u.Events.getEvent(C));
};
this.div.replaceChild(this.icon.image,this.div.firstChild);
},getIconBounds:function(){var C=new __l.Bounds();
if(this.icon){var A=__u.GeoMath.long2pix(this.point.lng,this.parentMap.zoom);
var I=__u.GeoMath.lat2pix(this.point.lat,this.parentMap.zoom);
var D=A+this.icon.offsetLeft;
var H=A-this.icon.offsetLeft;
var B=I-this.icon.offsetTop;
var F=__u.GeoMath.pix2long(H,this.parentMap.zoom);
var E=__u.GeoMath.pix2long(D,this.parentMap.zoom);
var G=__u.GeoMath.pix2lat(B,this.parentMap.zoom);
C.minLong=Math.min(F,E);
C.maxLong=Math.max(F,E);
C.minLat=Math.min(this.point.lat,G);
C.maxLat=Math.max(this.point.lat,G);
C.getPixelBounds(this.parentMap.zoom);
}return C;
},x:function(){return __u.GeoMath.long2pix(this.point.lng,this.parentMap.zoom);
},y:function(){return __u.GeoMath.lat2pix(this.point.lat,this.parentMap.zoom);
}};
__l.Marker3D=function(A,C,D){var B=new __l.Marker(A,C);
B.saved=true;
B.maxDisplayZoom=__l.ZoomLevel.Street;
B.parentMap=D;
B.parentMap.addOverlay(B);
return B;
};
__l.Text=function(A,F){this.parentMap=null;
this.point=A;
this.text=F?F:"Type here";
this.overlayType=__l.OverlayType.Text;
this.visible=true;
this.minDisplayZoom=__l.ZoomLevel.Min;
this.maxDisplayZoom=__l.ZoomLevel.Max;
var E=this;
this.div=__d.ce("div");
this.div.style.zIndex=200;
this.div.style.position="absolute";
this.div.style.cursor="text";
this.timeoutID=-1;
this.fontSize=14;
__u.Events.addListener(this.div,"click",function(G){__u.Events.stopPropagation(G);
E.click.fire(__u.Events.getEvent(G));
});
__u.Events.addListener(this.div,"mousedown",function(J){J=__u.Events.getEvent(J);
__u.Events.stopPropagation(J);
if(J.button==2){var G=E.parentMap.getMousePos(J);
var K=E.parentMap.centerX+G.x-E.parentMap.halfViewWidth;
var I=E.parentMap.centerY+G.y-E.parentMap.halfViewHeight;
var H=new __l.Point(__u.GeoMath.pix2lat(I,E.parentMap.zoom),__u.GeoMath.pix2long(K,E.parentMap.zoom));
E.rightClick.fire(J,H,K,I);
}});
this.div.ondblclick=__u.Events.stopPropagation;
var D=__d.ce("span");
D.style.left=-10000+"px";
D.style.top=-10000+"px";
D.style.zIndex=-10000;
D.style.font=this.fontSize+"px monospace";
D.innerHTML="x";
__d.body.appendChild(D);
this.charWidth=D.offsetWidth;
this.charHeight=D.offsetHeight;
__d.body.removeChild(D);
this.minCols=12;
this.maxCols=24;
this.minRows=1;
this.maxRows=12;
this.minWidth=this.minCols*this.charWidth;
this.maxWidth=this.maxCols*this.charWidth;
this.minHeight=this.minRows*this.charHeight;
this.maxHeight=this.maxRows*this.charHeight;
this.cornerWidth=10;
this.cornerHeight=10;
this.handleWidth=9;
this.handleHeight=18;
this.textarea=__d.ce("textarea");
this.textarea.style.font=this.fontSize+"px monospace";
this.textarea.style.overflow="hidden";
this.textarea.style.position="absolute";
this.textarea.style.left=(this.handleWidth+this.cornerWidth)+"px";
this.textarea.style.top=this.cornerHeight+"px";
this.textarea.style.zIndex=500;
this.textarea.style.width=this.minWidth+"px";
this.textarea.style.height=this.minHeight+"px";
__d.body.appendChild(this.textarea);
this.hFudge=0;
this.vFudge=0;
while(this.textarea.offsetWidth<this.minWidth+4||this.textarea.offsetHeight<this.minHeight+4){if(this.textarea.offsetWidth<this.minWidth+4){this.hFudge+=2;
this.textarea.style.width=(this.minWidth+this.hFudge)+"px";
}if(this.textarea.offsetHeight<this.minHeight+4){this.vFudge+=2;
this.textarea.style.height=(this.minHeight+this.vFudge)+"px";
}}if(__u.Browser.isOpera){this.hFudge+=2;
this.vFudge+=2;
this.textarea.style.width=(this.minWidth+this.hFudge)+"px";
this.textarea.style.height=(this.minHeight+this.vFudge)+"px";
}else{if(__u.Browser.isSafari){this.hFudge+=8;
this.vFudge+=2;
this.textarea.style.width=(this.minWidth+this.hFudge)+"px";
this.textarea.style.height=(this.minHeight+this.vFudge)+"px";
}}var B=this.textarea.offsetWidth;
var C=this.textarea.offsetHeight;
this.textarea.value=this.text;
this.div.appendChild(this.textarea);
this.handleImg=__d.ce("img");
__u.Image.SetPng(this.handleImg,__l.UI.Defaults.SP+"texth.png");
this.handleImg.style.position="absolute";
this.handleImg.style.left="0px";
this.handleImg.style.top=this.cornerHeight+"px";
this.handleImg.style.cursor=__u.Browser.handCursor;
this.div.appendChild(this.handleImg);
this.btl=__d.ce("img");
__u.Image.SetPng(this.btl,__l.UI.Defaults.SP+"texttl.png");
this.btl.style.position="absolute";
this.btl.style.left=this.handleWidth+"px";
this.btl.style.top="0px";
this.btl.style.width=this.cornerWidth+"px";
this.btl.style.height=this.cornerHeight+"px";
this.div.appendChild(this.btl);
this.bt=__d.ce("img");
__u.Image.SetPng(this.bt,__l.UI.Defaults.SP+"textt.png");
this.bt.style.position="absolute";
this.bt.style.left=(this.handleWidth+this.cornerWidth)+"px";
this.bt.style.top="0px";
this.bt.style.width=B+"px";
this.bt.style.height=this.cornerHeight+"px";
this.div.appendChild(this.bt);
this.btr=__d.ce("img");
__u.Image.SetPng(this.btr,__l.UI.Defaults.SP+"texttrx.png");
this.btr.style.position="absolute";
this.btr.style.left=(this.handleWidth+this.cornerWidth+B)+"px";
this.btr.style.top="0px";
this.btr.style.width=this.cornerWidth+"px";
this.btr.style.height=this.cornerHeight+"px";
this.btr.style.cursor=__u.Browser.handCursor;
this.btr.title="Close";
this.div.appendChild(this.btr);
this.bl=__d.ce("img");
__u.Image.SetPng(this.bl,__l.UI.Defaults.SP+"textl.png");
this.bl.style.position="absolute";
this.bl.style.left=this.handleWidth+"px";
this.bl.style.top=this.cornerHeight+"px";
this.bl.style.width=this.cornerWidth+"px";
this.bl.style.height=C+"px";
this.div.appendChild(this.bl);
this.bc=__d.ce("img");
__u.Image.SetPng(this.bc,__l.UI.Defaults.SP+"textc.png");
this.bc.style.position="absolute";
this.bc.style.left=(this.handleWidth+this.cornerWidth)+"px";
this.bc.style.top=this.cornerHeight+"px";
this.bc.style.width=B+"px";
this.bc.style.height=C+"px";
this.div.appendChild(this.bc);
this.br=__d.ce("img");
__u.Image.SetPng(this.br,__l.UI.Defaults.SP+"textr.png");
this.br.style.position="absolute";
this.br.style.left=(this.handleWidth+this.cornerWidth+B)+"px";
this.br.style.top=this.cornerHeight+"px";
this.br.style.width=this.cornerWidth+"px";
this.br.style.height=C+"px";
this.div.appendChild(this.br);
this.bbl=__d.ce("img");
__u.Image.SetPng(this.bbl,__l.UI.Defaults.SP+"textbl.png");
this.bbl.style.position="absolute";
this.bbl.style.left=this.handleWidth+"px";
this.bbl.style.top=(this.cornerHeight+C)+"px";
this.bbl.style.width=this.cornerWidth+"px";
this.bbl.style.height=this.cornerHeight+"px";
this.div.appendChild(this.bbl);
this.bb=__d.ce("img");
__u.Image.SetPng(this.bb,__l.UI.Defaults.SP+"textb.png");
this.bb.style.position="absolute";
this.bb.style.left=(this.handleWidth+this.cornerWidth)+"px";
this.bb.style.top=(this.cornerHeight+C)+"px";
this.bb.style.width=B+"px";
this.bb.style.height=this.cornerHeight+"px";
this.div.appendChild(this.bb);
this.bbr=__d.ce("img");
__u.Image.SetPng(this.bbr,__l.UI.Defaults.SP+"textbr.png");
this.bbr.style.position="absolute";
this.bbr.style.left=(this.handleWidth+this.cornerWidth+B)+"px";
this.bbr.style.top=(this.cornerHeight+C)+"px";
this.bbr.style.width=this.cornerWidth+"px";
this.bbr.style.height=this.cornerHeight+"px";
this.div.appendChild(this.bbr);
this.handleDiv=__d.ce("div");
this.handleDiv.style.position="absolute";
this.handleDiv.style.left="0px";
this.handleDiv.style.top=this.cornerHeight+"px";
this.handleDiv.style.width=this.handleWidth+"px";
this.handleDiv.style.height=this.handleHeight+"px";
this.handleDiv.style.cursor=__u.Browser.handCursor;
this.div.appendChild(this.handleDiv);
__u.Events.addListener(this.handleDiv,"mousedown",this.startDrag,this,true);
__u.Events.addListener(this.handleImg,"mousedown",this.startDrag,this,true);
this.addTextEvents();
this.click=new __u.AbstractEvent("click",this);
this.rightClick=new __u.AbstractEvent("rightClick",this);
if(__l.UI){__l.UI.hookupMarkerEvents(this);
}__l.Canvas.drawings.push(this);
};
__l.Text.prototype={position:function(){try{var E=(__u.GeoMath.lat2pix(this.point.lat,this.parentMap.zoom));
var D=(__u.GeoMath.long2pix(this.point.lng,this.parentMap.zoom));
var B=D>=0?this.parentMap.leftShift:-(this.parentMap.leftShift);
var A=E>=0?this.parentMap.topShift:-(this.parentMap.topShift);
D=D-B;
E=E-A;
this.div.style.top=E-parseFloat(this.handleDiv.style.top)-parseFloat(this.handleDiv.style.height)/2+"px";
this.div.style.left=D+"px";
}catch(C){}},appendTo:function(A){if(A){A.appendChild(this.div);
}},addTextEvents:function(){var A=this;
this.textarea.onkeyup=function(){A.update();
};
this.textarea.onmousedown=function(B){B=__u.Events.getEvent(B);
if(B.button!=2){__u.Events.stopPropagation(B);
}};
this.textarea.onselectstart=function(B){__u.Events.stopPropagation(B);
};
this.textarea.ondblclick=function(B){__u.Events.stopPropagation(B);
};
this.textarea.onmousemove=function(B){__u.Events.stopPropagation(B);
};
this.textarea.onfocus=function(){A.activate();
};
this.textarea.onblur=function(){A.deactivate();
};
this.btr.onclick=function(){A.parentMap.removeOverlay(A);
};
},removeTextEvents:function(){this.textarea.onkeyup=null;
this.textarea.onfocus=null;
this.textarea.onblur=null;
this.textarea.onmousedown=null;
this.textarea.onselectstart=null;
this.textarea.ondblclick=null;
this.textarea.onmousemove=null;
this.textarea.onfocus=null;
this.textarea.onblur=null;
this.btr.onclick=null;
},startDrag:function(E){this.blur();
__l.Keys.typing=false;
E=__u.Events.getEvent(E);
if(E.button==2){return false;
}this.dragStartX=E.clientX+__d.body.scrollLeft-this.parentMap.viewDiv.offsetLeft;
this.dragStartY=E.clientY+__d.body.scrollTop-this.parentMap.viewDiv.offsetTop;
var D=(__u.GeoMath.lat2pix(this.point.lat,this.parentMap.zoom));
var C=(__u.GeoMath.long2pix(this.point.lng,this.parentMap.zoom));
var B=C>=0?this.parentMap.leftShift:-(this.parentMap.leftShift);
var A=D>=0?this.parentMap.topShift:-(this.parentMap.topShift);
C-=B;
D-=A;
this.dragStartTop=D;
this.dragStartLeft=C;
this.dragging=true;
var F=this;
__d.documentElement.onmousemove=function(G){return F.drag(G);
};
__d.documentElement.onmouseup=function(G){return F.endDrag(G);
};
this.removeTextEvents();
this.div.style.zIndex=201;
__u.Events.stopPropagation(E);
return false;
},drag:function(E){E=__u.Events.getEvent(E);
if(!this.dragging){return false;
}var B=E.clientX+__d.body.scrollLeft-this.parentMap.viewDiv.offsetLeft;
var A=E.clientY+__d.body.scrollTop-this.parentMap.viewDiv.offsetTop;
var D=A-this.dragStartY+this.dragStartTop;
var C=B-this.dragStartX+this.dragStartLeft;
this.div.style.top=D-parseFloat(this.handleDiv.style.top)-parseFloat(this.handleDiv.style.height)/2+"px";
this.div.style.left=C+"px";
__u.Events.stopPropagation(E);
return false;
},endDrag:function(G){__d.documentElement.onmousemove=null;
__d.documentElement.onmouseup=null;
this.addTextEvents();
this.div.style.zIndex=200;
this.dragging=false;
G=__u.Events.getEvent(G);
var D=G.clientX+__d.body.scrollLeft-this.parentMap.viewDiv.offsetLeft;
var C=G.clientY+__d.body.scrollTop-this.parentMap.viewDiv.offsetTop;
if(this.dragStartX==D&&this.dragStartY==C){return false;
}var F=C-this.dragStartY+this.dragStartTop;
var E=D-this.dragStartX+this.dragStartLeft;
var B=E>=0?this.parentMap.leftShift:-(this.parentMap.leftShift);
var A=F>=0?this.parentMap.topShift:-(this.parentMap.topShift);
E+=B;
F+=A;
this.point=new __l.Point(__u.GeoMath.pix2lat(F,this.parentMap.zoom),__u.GeoMath.pix2long(E,this.parentMap.zoom));
this.position();
return false;
},select:function(){this.textarea.select();
},focus:function(){this.textarea.focus();
this.activate();
},blur:function(){this.textarea.blur();
this.deactivate();
},activate:function(){__l.Keys.typing=true;
if(this.timeoutID==-1){var A=this;
this.timeoutID=window.setTimeout(function(){A.timeout();
},1000);
}},deactivate:function(){__l.Keys.typing=false;
if(this.timeoutID!=-1){window.clearTimeout(this.timeoutID);
this.timeoutID=-1;
}},timeout:function(){this.update();
var A=this;
this.timeoutID=window.setTimeout(function(){A.timeout();
},1000);
},update:function(){var G=this;
var B=F(this.textarea.value);
var H=B>1?this.maxWidth:Math.max(Math.min(this.textarea.value.length*this.charWidth,this.maxWidth),this.minWidth);
var E=Math.max(Math.min(B*this.charHeight,this.maxHeight),this.minHeight);
this.textarea.style.width=H+this.hFudge+"px";
this.textarea.style.height=E+this.vFudge+"px";
var C=this.textarea.offsetWidth;
var I=this.textarea.offsetHeight;
this.bt.style.width=C+"px";
this.btr.style.left=(this.handleWidth+this.cornerWidth+C)+"px";
this.bl.style.height=I+"px";
this.bc.style.width=C+"px";
this.bc.style.height=I+"px";
this.br.style.left=(this.handleWidth+this.cornerWidth+C)+"px";
this.br.style.height=I+"px";
this.bbl.style.top=(this.cornerHeight+I)+"px";
this.bb.style.top=(this.cornerHeight+I)+"px";
this.bb.style.width=C+"px";
this.bbr.style.left=(this.handleWidth+this.cornerWidth+C)+"px";
this.bbr.style.top=(this.cornerHeight+I)+"px";
this.text=this.textarea.value;
function F(N){var L=0;
var M=0;
while(M<N.length){L++;
numChars=0;
while(M<N.length){if(N.charAt(M)=="\n"){L++;
numChars=0;
M++;
}var K=D(N,M);
if(numChars+K>G.maxCols){if(!numChars){M+=K;
}break;
}numChars+=K;
M+=K;
var J=A(N,M);
if(numChars+J>G.maxCols){if(__u.Browser.isIE||__u.Browser.isOpera){L++;
numChars=K+J;
M+=J;
}}numChars+=J;
M+=J;
}}return L;
}function A(K,J){var M=0;
var L;
while(J<K.length&&(L=K.charAt(J++))==" "&&L!="\n"){M++;
}return M;
}function D(K,J){var M=0;
var L;
while(J<K.length&&(L=K.charAt(J++))!=" "&&L!="\n"){M++;
}return M;
}}};
__l.Shape=function(B,C,A,D){this.parentMap=null;
this.points=B;
this.overlayType=__l.OverlayType.Shape;
this.visible=true;
this.minDisplayZoom=__l.ZoomLevel.Min;
this.maxDisplayZoom=__l.ZoomLevel.Max;
this.lineColor=C;
this.lineWidth=A;
this.fillColor=D;
this.bounds=new __l.Bounds();
this.div=__d.ce("img");
this.div.style.zIndex=300;
this.div.style.position="absolute";
this.div.src=__l.Defaults.SP+"transparent.gif";
this.click=new __u.AbstractEvent("click",this);
this.removed=new __u.AbstractEvent("removed",this);
};
__l.Shape.prototype={position:function(){},appendTo:function(B){if(B){B.appendChild(this.div);
}var A=this.parentMap.canvas.context;
if(A){this.lineColor=this.lineColor?this.lineColor:A.strokeStyle.replace(/rgb\(/,"rgba(");
this.lineWidth=this.lineWidth?this.lineWidth:A.lineWidth;
this.fillColor=this.fillColor?this.fillColor:A.fillStyle.replace(/rgb\(/,"rgba(");
}if(!this.shapeId){this.shapeId=this.parentMap.getShapeId();
}},getBounds:function(){return this.bounds;
},setStyle:function(){if(this.parentMap){this.lineColor=this.lineColor?this.lineColor:this.parentMap.canvas.context.strokeStyle.replace(/rgb\(/,"rgba(");
this.lineWidth=this.lineWidth?this.lineWidth:this.parentMap.canvas.context.lineWidth;
}},createHandle:function(){this.div.src=__l.Defaults.LocalSP+"magglass.gif";
this.div.width=13;
this.div.height=13;
this.div.style.cursor=__u.Browser.handCursor;
var A=this;
this.div.onclick=function(B){B=__u.Events.getEvent(B);
__u.Events.stopPropagation(B);
A.click.fire(B);
};
this.div.onmouseover=function(B){A.highlight();
};
this.div.onmouseout=function(B){if(__l.UI&&__l.UI.map.pulldownMenu.owner!=A){A.unhighlight();
}};
this.div.onmousedown=__u.Events.stopPropagation;
this.div.onmouseup=__u.Events.stopPropagation;
},openPulldownMenu:function(B){if(__l.UI){var D=__l.UI.map.pulldownMenu;
D.open(this.getHandlePoint(),B);
D.setOwner(this);
var C=D.div.getElementsByTagName("input");
for(var A=0;
A<C.length;
A++){if(C[A].type=="text"){C[A].focus();
break;
}}if(__l.UI.canvasControl){__l.UI.canvasControl.setTool(__l.UI.canvasControl.mapTool);
}__l.Keys.typing=true;
}},closePulldownMenu:function(A){if(__l.UI){var B=__l.UI.map.pulldownMenu;
B.close();
B.setOwner(null);
if(!A){this.unhighlight();
}__l.Keys.typing=false;
}},handlePulldownMenu:function(A){if(__l.UI){var B=__l.UI.map.pulldownMenu;
if(B.owner!=this){if(B.owner){B.owner.closePulldownMenu(false);
}this.openPulldownMenu(A);
}else{this.closePulldownMenu(true);
}}},highlight:function(){this.highlighted=true;
this.parentMap.drawOverlays();
},unhighlight:function(){this.highlighted=false;
this.parentMap.drawOverlays();
},getHighlightColor:function(A){var C=A.slice(5,-1).split(",");
if(C[0]==0&&C[1]==0&&C[2]==0){C[0]=C[1]=C[2]=128;
}else{for(var B=0;
B<3;
B++){C[B]=Math.round(parseInt(C[B])*0.5);
}}A="rgba("+C.join(",")+")";
return A;
},getLinearMeasureDisplayString:function(B){var A=B*0.621371192;
return A<1?this.approximateMeasure(A*5280)+" feet":this.approximateMeasure(A)+" miles";
},getSquareMeasureDisplayString:function(A){var B=A*0.386102159;
return(B<1?B*640<1?this.approximateMeasure(B*27878400)+" square feet":this.approximateMeasure(B*640)+" acres":this.approximateMeasure(B)+" square miles");
},approximateMeasure:function(B){var A;
if(B<10){A=__u.Math.Round(B,1);
}else{if(B<100){A=Math.round(B);
}else{if(B<1000){A=(Math.round(B/10)*10);
}else{A=(Math.round(B/100)*100);
}}}return A;
}};
__l.Rectangle=function(D,F,A,G,E){var B=[];
if(D){if(D.minLat&&D.maxLat&&D.minLong&&D.maxLong){B.push(new __l.Point(D.maxLat,D.minLong));
B.push(new __l.Point(D.maxLat,D.maxLong));
B.push(new __l.Point(D.minLat,D.maxLong));
B.push(new __l.Point(D.minLat,D.minLong));
B.push(new __l.Point(D.maxLat,D.minLong));
}}var C=new __l.Shape(B,F,A,G);
C.shape=__l.Shapes.Rectangle;
C.bounds=D;
if(E){C.createHandle();
}C.position=function(){if(this.parentMap.canvas){this.setStyle();
var R=this.parentMap.getBounds();
var P=this.parentMap.zoom;
var N=new Object();
var L=__u.GeoMath.long2pix(this.bounds.minLong,P);
var Q=__u.GeoMath.lat2pix(this.bounds.maxLat,P);
N.x=L-R.minX;
N.y=Q-R.minY;
var S=new Object();
S.x=__u.GeoMath.long2pix(this.bounds.maxLong,P)-R.minX;
S.y=__u.GeoMath.lat2pix(this.bounds.minLat,P)-R.minY;
var J=this.parentMap.canvas.context;
var O=J.lineWidth;
var M=J.strokeStyle.replace(/rgb\(/,"rgba(");
var K=J.fillStyle.replace(/rgb\(/,"rgba(");
J.lineWidth=this.lineWidth;
J.strokeStyle=this.highlighted?this.getHighlightColor(this.lineColor):this.lineColor;
J.beginPath();
J.strokeRect(N.x,N.y,S.x-N.x,S.y-N.y);
if(this.fillColor){J.fillStyle=this.fillColor;
J.fillRect(N.x+this.lineWidth/2,N.y+this.lineWidth/2,S.x-N.x-this.lineWidth,S.y-N.y-this.lineWidth);
}J.closePath();
J.lineWidth=O;
J.strokeStyle=M;
J.fillStyle=K;
if(this.div&&this.div.src){var I=this.getHandlePoint();
var H=this.lineWidth?this.lineWidth:0;
this.div.style.left=__u.GeoMath.long2pix(I.lng,P)-H+"px";
this.div.style.top=__u.GeoMath.lat2pix(I.lat,P)-H+"px";
}}else{printfire("The addCanvas(canvasDOMElement) method must be called before drawing this shape.",__u.MsgType.Exception);
}};
C.getHandlePoint=function(){return new __l.Point(this.bounds.maxLat,this.bounds.minLong);
};
C.getPerimeter=function(){var I=__u.GeoMath.calculateDistance(this.bounds.minLat,this.bounds.minLong,this.bounds.maxLat,this.bounds.minLong);
var H=__u.GeoMath.calculateDistance(this.bounds.minLat,this.bounds.minLong,this.bounds.minLat,this.bounds.maxLong);
return this.getLinearMeasureDisplayString((I+H)*2);
};
C.getArea=function(){var I=__u.GeoMath.calculateDistance(this.bounds.minLat,this.bounds.minLong,this.bounds.maxLat,this.bounds.minLong);
var H=__u.GeoMath.calculateDistance(this.bounds.minLat,this.bounds.minLong,this.bounds.minLat,this.bounds.maxLong);
return this.getSquareMeasureDisplayString(I*H);
};
return C;
};
__l.Circle=function(E,I,F,D,G){var B;
var J=[];
var C=new __l.Shape(J,I,F,D);
C.shape=__l.Shapes.Circle;
if(E){if(E.center&&E.radius){var H=E.center;
var A=E.radius;
B=new __l.Bounds(H.lat-A,H.lng-A,H.lat+A,H.lng+A);
C.center=H;
C.radius=A;
J.push(H);
}else{B=E;
if(B.minLat&&B.maxLat&&B.minLong&&B.maxLong){J.push(new __l.Point(B.maxLat,B.minLong));
J.push(new __l.Point(B.maxLat,B.maxLong));
J.push(new __l.Point(B.minLat,B.maxLong));
J.push(new __l.Point(B.minLat,B.minLong));
J.push(new __l.Point(B.maxLat,B.minLong));
}}}C.points=J;
C.bounds=B;
if(G){C.createHandle();
}C.position=function(){if(this.parentMap.canvas){this.setStyle();
var X=this.parentMap.getBounds();
var V=this.parentMap.zoom;
var T=new Object();
var P=__u.GeoMath.long2pix(this.bounds.minLong,V);
var W=__u.GeoMath.lat2pix(this.bounds.maxLat,V);
T.x=P-X.minX;
T.y=W-X.minY;
var Y=new Object();
var Z=__u.GeoMath.long2pix(this.bounds.maxLong,V);
var K=__u.GeoMath.lat2pix(this.bounds.minLat,V);
Y.x=Z-X.minX;
Y.y=K-X.minY;
var N=this.parentMap.canvas.context;
var U=N.lineWidth;
var S=N.strokeStyle.replace(/rgb\(/,"rgba(");
var O=N.fillStyle.replace(/rgb\(/,"rgba(");
N.lineWidth=this.lineWidth;
N.strokeStyle=this.highlighted?this.getHighlightColor(this.lineColor):this.lineColor;
N.beginPath();
var R=Math.max(T.x,Y.x)-Math.abs(T.x-Y.x)/2;
var Q=Math.max(T.y,Y.y)-Math.abs(T.y-Y.y)/2;
T.y=Y.y=Q;
if(__u.Browser.isOpera){N.moveTo(T.x,T.y);
}N.arc(R,Q,__u.GeoMath.getPxDistance(T,Y)/2,0,Math.PI*2,true);
N.stroke();
N.closePath();
if(this.fillColor){N.beginPath();
if(__u.Browser.isOpera){N.moveTo(T.x,T.y);
}N.arc(R,Q,__u.GeoMath.getPxDistance(T,Y)/2-this.lineWidth/2,0,Math.PI*2,true);
N.fillStyle=this.fillColor;
N.fill();
N.closePath();
}N.lineWidth=U;
N.strokeStyle=S;
N.fillStyle=O;
if(this.div&&this.div.src){var M=this.getHandlePoint();
var L=this.lineWidth?this.lineWidth:0;
this.div.style.left=__u.GeoMath.long2pix(M.lng,V)-L+"px";
this.div.style.top=__u.GeoMath.lat2pix(M.lat,V)-L+"px";
}}else{printfire("The addCanvas(canvasDOMElement) method must be called before drawing this shape.",__u.MsgType.Exception);
}};
C.getHandlePoint=function(){return new __l.Point(this.bounds.maxLat,(this.bounds.minLong+this.bounds.maxLong)/2);
};
C.getPerimeter=function(){var K=__u.GeoMath.calculateDistance(this.bounds.minLat,this.bounds.minLong,this.bounds.minLat,this.bounds.maxLong)/2;
return this.getLinearMeasureDisplayString(2*Math.PI*K);
};
C.getArea=function(){var K=__u.GeoMath.calculateDistance(this.bounds.minLat,this.bounds.minLong,this.bounds.minLat,this.bounds.maxLong)/2;
return this.getSquareMeasureDisplayString(Math.PI*K*K);
};
return C;
};
__l.Polyline=function(C,E,A,F,D){var B=new __l.Shape(C,E,A,F);
B.shape=__l.Shapes.Polyline;
if(D){B.createHandle();
}B.position=function(){if(this.parentMap.canvas){this.setStyle();
var N=this.parentMap.getBounds();
var I,Y,c,O;
var d=[];
var G=[];
var P=this.parentMap.zoom;
this.drawPoints=[];
var J=this.parentMap.canvas.context;
if(this.points&&this.points.length>0&&J){I=Y=this.points[0].lat;
c=O=this.points[0].lng;
var T=0;
var S=0;
var W,V;
for(var a=0;
a<this.points.length;
a++){var Z=this.points[a];
if(typeof (Z)=="object"&&Z.lat==undefined){if(Z.length&&Z.length==2){var L=Z[0];
var f=Z[1];
Z=new __l.Point(L,f);
this.points[a]=Z;
}}var R=parseFloat(__u.GeoMath.long2pix(Z.lng,P)-N.minX);
var Q=parseFloat(__u.GeoMath.lat2pix(Z.lat,P)-N.minY);
if(this.points.length>10&&a>0&&a<this.points.length-1){T+=Math.abs(R-W);
S+=Math.abs(Q-V);
if(T>3||S>3){d.push(R);
G.push(Q);
T=0;
S=0;
this.drawPoints.push(Z);
}}else{d.push(R);
G.push(Q);
this.drawPoints.push(Z);
}W=R;
V=Q;
I=I<Z.lat?I:Z.lat;
c=c<Z.lng?c:Z.lng;
Y=Y>Z.lat?Y:Z.lat;
O=O>Z.lng?O:Z.lng;
}this.bounds=new __l.Bounds(I,c,Y,O);
var P=this.parentMap.zoom;
this.bounds.minY=__u.GeoMath.lat2pix(I,P);
this.bounds.minX=__u.GeoMath.long2pix(c,P);
this.bounds.maxY=__u.GeoMath.lat2pix(Y,P);
this.bounds.maxX=__u.GeoMath.long2pix(O,P);
}var K=d[0];
var H=G[0];
var b=J.lineWidth;
var X=J.strokeStyle.replace(/rgb\(/,"rgba(");
var M=J.fillStyle.replace(/rgb\(/,"rgba(");
J.lineWidth=this.lineWidth;
J.strokeStyle=this.highlighted?this.getHighlightColor(this.lineColor):this.lineColor;
J.beginPath();
J.moveTo(K,H);
if(this.shape!=__l.Shapes.Polyline&&this.fillColor){J.fillStyle=this.fillColor;
if(this.fillColor){for(a=1;
a<d.length;
a++){J.lineTo(d[a],G[a]);
}J.fill();
}}J.moveTo(K,H);
for(a=1;
a<d.length;
a++){J.lineTo(d[a],G[a]);
}J.stroke();
J.lineWidth=b;
J.strokeStyle=X;
J.fillStyle=M;
if(this.div&&this.div.src){var U=this.getHandlePoint();
var e=this.lineWidth?this.lineWidth:0;
this.div.style.left=(__u.GeoMath.long2pix(U.lng,P)-e)+"px";
this.div.style.top=(__u.GeoMath.lat2pix(U.lat,P)-e)+"px";
}}else{printfire("The addCanvas() method must be called before drawing this shape.",__u.MsgType.Exception);
}};
B.getHandlePoint=function(){return this.points&&this.points.length?this.points[0]:new __l.Point(0,0);
};
B.getLength=function(){var H=0;
for(var G=1;
G<this.points.length;
G++){if(!__u.General.equal(this.points[G],this.points[G-1])){H+=__u.GeoMath.calculateDistance(this.points[G].lat,this.points[G].lng,this.points[G-1].lat,this.points[G-1].lng);
}}return this.getLinearMeasureDisplayString(H);
};
return B;
};
__l.Polygon=function(C,F,A,G,E){if(C){var D=C[0];
if(C.length>1){C.push(D);
}}var B=new __l.Polyline(C,F,A,G,E);
B.shape=__l.Shapes.Polygon;
B.isSimple=function(){var H=[];
var J=null;
for(var I=0;
I<this.points.length-1;
I++){var K={x:this.points[I].lat,y:this.points[I].lng};
if(!J||!__u.General.equal(K,J)){H.push(K);
}J=K;
}return __u.Geometry.isSimplePoly(H);
};
B.getPerimeter=function(){var H=0;
for(var I=1;
I<this.points.length;
I++){if(!__u.General.equal(this.points[I],this.points[I-1])){H+=__u.GeoMath.calculateDistance(this.points[I].lat,this.points[I].lng,this.points[I-1].lat,this.points[I-1].lng);
}}return this.getLinearMeasureDisplayString(H);
};
B.getArea=function(){var I=[{x:0,y:0}];
for(var J=1;
J<this.points.length-1;
J++){if(!__u.General.equal(this.points[J],this.points[J-1])){var H=this.points[0].lng!=this.points[J].lng?__u.GeoMath.calculateDistance(this.points[0].lat,this.points[0].lng,this.points[0].lat,this.points[J].lng)*__u.Geometry.sgn(this.points[J].lng-this.points[0].lng):0;
var K=this.points[0].lat!=this.points[J].lat?__u.GeoMath.calculateDistance(this.points[0].lat,this.points[0].lng,this.points[J].lat,this.points[0].lng)*__u.Geometry.sgn(this.points[J].lat-this.points[0].lat):0;
I.push({x:H,y:K});
}}return this.getSquareMeasureDisplayString(__u.Geometry.polyArea(I));
};
return B;
};
__l.Shapes=new function(){this.Line=0;
this.Polyline=1;
this.Polygon=2;
this.Rectangle=3;
this.Circle=4;
};
__l.InfoWindow=function(){this.parentMap=null;
this.owner=null;
var A=this;
this.enableAutoFit=true;
this.point=new __l.Point(0,0);
this.visible=false;
this.div=__d.ce("div");
this.div.style.display="none";
this.markerOffsetTop=0;
this.reason=null;
this.closeButton=__u.Image.MakePng(__l.Defaults.LocalSP+"close.gif",203,7,301);
__u.Events.addListener(this.closeButton,"mousedown",function(B){A.setVisible(false);
__u.Events.cancel(B);
});
this.closeButton.title="Close";
this.closeButton.style.cursor=__u.Browser.handCursor;
this.div.appendChild(this.closeButton);
__u.Events.addListener(this.div,"click",this.onClick,this);
__u.Events.addListener(this.div,"contextmenu",__u.Events.cancel);
this.textdiv=__d.ce("div");
this.textdiv.style.position="absolute";
this.textdiv.className="infoWin";
this.textdiv.style.cursor="text";
this.textdiv.style.zIndex=200;
this.textdiv.onmousedown=__u.Events.stopPropagation;
this.textdiv.onclick=__u.Events.stopPropagation;
this.textdiv.ondblclick=__u.Events.stopPropagation;
this.textdiv.onkeyup=__u.Events.stopPropagation;
this.div.style.position="absolute";
this.div.style.left="100px";
this.div.style.top="100px";
this.div.style.zIndex=301;
this.div.appendChild(this.textdiv);
this.imgDiv=__d.ce("div");
this.div.appendChild(this.imgDiv);
this.closed=new __u.AbstractEvent("click",this);
this.ownerChange=new __u.AbstractEvent("click",this);
this.repositioned=new __u.AbstractEvent("click",this);
};
__l.InfoWindow.prototype={x:function(){return __u.GeoMath.long2pix(this.point.lng,this.parentMap.zoom);
},y:function(){return __u.GeoMath.lat2pix(this.point.lat,this.parentMap.zoom);
},open:function(A,B,C,D,E){this.point=A;
if(B){this.setHtml(B);
}this.setPosition(this.point,C,D);
this.reason=E;
this.setVisible(true);
},close:function(A){if(!A||this.reason==A){this.setVisible(false);
}},position:function(){if(this.parentMap){if(this.div.style.display!="none"){this.repositioned.fire();
}var B=this.realImg&&this.realImg.height?this.realImg.height:this.hints&&this.hints.imgHeight?this.hints.imgHeight:0;
var H=this.hints&&this.hints.vSlices?this.hints.vSlices:[Math.round(B/3),Math.round(B*2/3)];
var E=H[0]+B-H[1];
var A=Math.max(this.height||B,E);
var G=this.x()+this.balloonImgOffsetLeft;
var F=this.y()-(A+this.markerOffsetTop)+this.balloonImgOffsetTop;
var D=G>=0?this.parentMap.leftShift:-(this.parentMap.leftShift);
var C=F>=0?this.parentMap.topShift:-(this.parentMap.topShift);
G=G-D;
F=F-C;
if(!(isNaN(G)||isNaN(F))){this.div.style.left=G+"px";
this.div.style.top=F+"px";
}}},appendTo:function(A){if(A){A.appendChild(this.div);
}},appendToMap:function(A){if(A){A.mapDiv.appendChild(this.div);
this.parentMap=A;
}},setHtml:function(A){__u.Dom.removeAllChildNodes(this.textdiv);
if(typeof (A)=="object"){this.textdiv.appendChild(A);
}else{if(typeof (A)=="string"){this.textdiv.innerHTML=A;
}}},setImage:function(){var K,H,D,I,G,C,E,B,J,A;
if(typeof arguments[0]=="object"){K=arguments[0].imgUrl;
H=arguments[0].txtTop;
D=arguments[0].txtLeft;
I=arguments[0].txtWidth;
G=arguments[0].txtHeight;
C=arguments[0].offsetTop;
E=arguments[0].offsetLeft;
B=arguments[0].width;
J=arguments[0].height;
A=arguments[0].hints;
}else{K=arguments[0];
H=arguments[1];
D=arguments[2];
I=arguments[3];
G=arguments[4];
C=arguments[5];
E=arguments[6];
}if(__u.General.equal([K,H,D,I,G,C,E,B,J,A],[this.imgUrl,this.txtTop,this.txtLeft,this.txtWidth,this.txtHeight,this.offsetTop,this.offsetLeft,this.width,this.height,this.hints])){return ;
}this.imgUrl=K;
this.txtTop=H;
this.txtLeft=D;
this.txtWidth=I;
this.txtHeight=G;
this.offsetTop=C;
this.offsetLeft=E;
this.width=B;
this.height=J;
this.hints=A;
this.realImg=__d.ce("img");
var F=this;
this.realImg.onload=function(){var L=F.div.style.display!="none";
if(L){F.div.style.display="none";
}F.configure();
if(L){F.position();
F.setVisible(true);
}};
this.realImg.src=this.imgUrl;
this.balloonImgOffsetLeft=this.offsetLeft||0;
this.balloonImgOffsetTop=this.offsetTop||0;
this.textdiv.style.left=this.txtLeft+"px";
this.textdiv.style.top=this.txtTop+"px";
this.textdiv.style.width=this.txtWidth+"px";
this.textdiv.style.height=this.txtHeight+"px";
this.closeButton.style.left=(this.txtLeft+this.txtWidth)+"px";
this.closeButton.style.top=this.txtTop+"px";
},makeRectangular:function(D,C,B,A){this.balloonImgOffsetLeft=0;
this.balloonImgOffsetTop=0;
this.textdiv.style.left=D+"px";
this.textdiv.style.top=C+"px";
this.textdiv.style.width=B+"px";
this.textdiv.style.height=A+"px";
this.textdiv.style.backgroundColor="white";
this.textdiv.style.border="1px solid black";
__u.Dom.removeAllChildNodes(this.imgDiv);
},configure:function(){var K=this.realImg.width?this.realImg.width:this.hints&&this.hints.imgWidth?this.hints.imgWidth:0;
var L=this.realImg.height?this.realImg.height:this.hints&&this.hints.imgHeight?this.hints.imgHeight:0;
var B=this.width?this.width:K;
var O=this.height?this.height:L;
__u.Dom.removeAllChildNodes(this.imgDiv);
if(!K||!L||!B||!O||B==K&&O==L){var G=__d.ce("img");
G=__u.Image.SetPng(G,this.realImg.src);
this.imgDiv.appendChild(G);
}else{var H=this.hints&&this.hints.hSlices?this.hints.hSlices:[Math.round(K/3),Math.round(K*2/3)];
var P=this.hints&&this.hints.vSlices?this.hints.vSlices:[Math.round(L/3),Math.round(L*2/3)];
var I=[H[0]];
var E=H[0];
while(E<B-(K-H[1])){var N=Math.min(H[1]-H[0],B-(K-H[1])-E);
I.push(N);
E+=N;
}I.push(H[1]-H[0]);
var M=[P[0]];
var E=P[0];
while(E<O-(L-P[1])){var N=Math.min(P[1]-P[0],O-(L-P[1])-E);
M.push(N);
E+=N;
}M.push(P[1]-P[0]);
var J=0;
for(var F=0;
F<M.length;
F++){var C=0;
for(var D=0;
D<I.length;
D++){var A=document.createElement("div");
A.style.position="absolute";
A.style.left=C+"px";
A.style.top=J+"px";
A.style.width=I[D]+"px";
A.style.height=M[F]+"px";
A.style.overflow="hidden";
var G=document.createElement("img");
G=__u.Image.SetPng(G,this.realImg.src);
G.style.position="absolute";
G.style.left=-(D==0?0:D==I.length-1?H[1]:H[0])+"px";
G.style.top=-(F==0?0:F==M.length-1?P[1]:P[0])+"px";
A.appendChild(G);
this.imgDiv.appendChild(A);
C+=I[D];
}J+=M[F];
}}},setCloseImage:function(A){this.closeButton=__u.Image.SetPng(this.closeButton,A);
},setVisible:function(H){var A=this.parentMap.centerX;
var M=this.parentMap.centerY;
if(H){if(this.enableAutoFit&&!((__u.Browser.isOpera)&&(this.parentMap.leftShift>0||this.parentMap.rightShift>0))){var I=parseFloat(this.div.style.left);
var G=parseFloat(this.div.style.top);
var B,J,E,C;
if(this.width&&this.height){B=this.width;
J=this.height;
E=0;
C=10;
}else{if(this.realImg){B=this.realImg.width;
J=this.realImg.height;
E=0;
C=10;
}else{B=parseFloat(this.textdiv.style.width);
J=parseFloat(this.textdiv.style.height);
E=10;
C=20;
}}var D=__u.Geometry.squeeze({left:0,top:0,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},this.parentMap.controlBoundingBoxes);
var F=this.parentMap.getBounds();
var L=(I+B)-(F.minX+D.right);
if(L>0){A+=L;
}var K=(G-E)-(F.minY+D.top);
if(K<0){M+=K;
}else{K=G+J+C-F.maxY;
if(K>0){M+=K;
}}if(A!=this.parentMap.centerX||M!=this.parentMap.centerY){this.parentMap.stopScrolling();
this.parentMap.moveViewTo(A,M);
}else{if(__u.Browser.isIE6&&this.parentMap.zoom<=__l.ZoomLevel.Address){this.parentMap.moveViewTo(A+1,M+1);
}}}this.div.style.display="";
}else{this.closed.fire();
this.owner=null;
this.div.style.display="none";
if(__u.Browser.isIE6&&this.parentMap.zoom<=__l.ZoomLevel.Address){this.parentMap.moveViewTo(A+1,M+1);
}}this.visible=H;
},setPosition:function(A,B,C){this.point=A;
this.markerOffsetTop=B?parseInt(B):0;
this.markerOffsetLeft=C?parseInt(C):0;
this.position();
},setOwner:function(A){if(this.owner!=A){this.ownerChange.fire();
}var B=this;
this.owner=A;
if(A){A.removed.subscribe(function(D,C,E){if(B.owner==E){B.close();
}},A);
}},onClick:function(F,C){F=__u.Events.getEvent(F);
var H=C.parentMap.getMousePos(F);
var B=C.parentMap.dragStartCenterX+H.x-C.parentMap.halfViewWidth;
var I=C.parentMap.dragStartCenterY+H.y-C.parentMap.halfViewHeight;
var G=new __l.Point(__u.GeoMath.pix2lat(I,C.parentMap.zoom),__u.GeoMath.pix2long(B,C.parentMap.zoom));
for(var E=0;
E<C.parentMap.overlays.length;
E++){var D=C.parentMap.overlays[E];
if(D&&D.overlayType==__l.OverlayType.Marker&&D.div.style.display!="none"){var A=D.getIconBounds();
if(A&&A.containsPoint(G)){__u.Events.stopPropagation(F);
D.click.fire(F);
break;
}}}}};
__l.Keys=new function(){this.KE_SP_BAR=32;
this.KE_RT_UP=33;
this.KE_RT_DN=34;
this.KE_LF_DN=35;
this.KE_LF_UP=36;
this.KE_LF=37;
this.KE_UP=38;
this.KE_RT=39;
this.KE_DN=40;
this.KE_MINUS=189;
this.KE_PLUS=187;
this.KE_MINUS2=109;
this.KE_PLUS2=107;
this.KE_PLUS2ff=61;
this.KE_ZERO=48;
this.KE_ONE=49;
this.KE_NINE=57;
this.KE_ONE_PAD=97;
this.KE_NINE_PAD=105;
this.KE_C=67;
this.KE_P=80;
this.KE_DF_DELTA=15;
this.KE_DF_INTVL=20;
this.KE_CLR=0;
this.ke_bks=new Array();
this.ke_bks[this.KE_LF]=1;
this.ke_bks[this.KE_UP]=1<<1;
this.ke_bks[this.KE_RT]=1<<2;
this.ke_bks[this.KE_DN]=1<<3;
this.ke_bks[this.KE_LF_UP]=this.ke_bks[this.KE_LF]|this.ke_bks[this.KE_UP];
this.ke_bks[this.KE_LF_DN]=this.ke_bks[this.KE_LF]|this.ke_bks[this.KE_DN];
this.ke_bks[this.KE_RT_UP]=this.ke_bks[this.KE_RT]|this.ke_bks[this.KE_UP];
this.ke_bks[this.KE_RT_DN]=this.ke_bks[this.KE_RT]|this.ke_bks[this.KE_DN];
this.ke_sc_tmr=null;
this.ke_mask=this.KE_CLR;
this.ke_hits=0;
this.parentMap=null;
this.isOverMap=true;
this.typing=false;
this.keyPress=new __u.AbstractEvent("keyPress",this);
this.enable=function(){__u.Events.addListener(__d.documentElement,"keydown",function(A){return __l.Keys.keyDown(A);
});
__u.Events.addListener(__d.documentElement,"keyup",function(A){return __l.Keys.keyUp(A);
});
};
this.keyDown=function(D){if(this.isOverMap&&!this.typing){D=__u.Events.getEvent(D);
var C=D.keyCode;
var E=D["ctrlKey"];
var B=D["shiftKey"];
this.keyPress.fire(D,C,E,B);
if(C>=this.KE_RT_UP&&C<=this.KE_DN&&!E){__u.Events.cancel(D);
this.ke_hits++;
var A=(this.ke_hits%5==0)&&((this.ke_hits/5)<5);
if((this.ke_mask&this.ke_bks[C])==0||A){this.ke_mask=this.ke_mask|this.ke_bks[C];
this.updateMap();
}return false;
}else{if(this.ke_mask==this.KE_CLR){if(C==this.KE_PLUS||C==this.KE_PLUS2||C==this.KE_PLUS2ff||C==this.KE_UP&&E){this.parentMap.zoomIn();
__u.Events.cancel(D);
return false;
}else{if(C==this.KE_MINUS||C==this.KE_MINUS2||C==this.KE_DN&&E){this.parentMap.zoomOut();
__u.Events.cancel(D);
return false;
}else{if(!__u.Browser.isIE&&E&&C==this.KE_P){if(this.parentMap.enableTruePrint){this.parentMap.setPrintImage();
}}}}}}}else{return true;
}};
this.keyUp=function(B){if(!B){B=window.event;
}var A=B.keyCode;
if(A<this.KE_RT_UP||A>this.KE_DN){return false;
}clearInterval(this.ke_sc_tmr);
this.ke_mask=this.ke_mask&~(this.ke_bks[B.keyCode]);
this.ke_hits=0;
this.updateMap();
return false;
};
this.updateMap=function(){if(this.ke_mask!=this.KE_CLR){var B=0;
var A=0;
var D=this.ke_hits%5==0?this.KE_DF_DELTA+2.5*(this.ke_hits/5):this.KE_DF_DELTA;
if((this.ke_mask&this.ke_bks[this.KE_LF])>0){B-=D;
}if((this.ke_mask&this.ke_bks[this.KE_UP])>0){A-=D;
}if((this.ke_mask&this.ke_bks[this.KE_RT])>0){B+=D;
}if((this.ke_mask&this.ke_bks[this.KE_DN])>0){A+=D;
}clearInterval(this.ke_sc_tmr);
var C=this;
if(C.parentMap){this.parentMap.scrolling=true;
this.ke_sc_tmr=setInterval(function(){C.parentMap.move(C.parentMap.centerX+B,C.parentMap.centerY+A);
},C.KE_DF_INTVL);
}}else{if(this.isOverMap){if(this.parentMap){this.parentMap.scrolling=false;
this.parentMap.moveView();
this.parentMap.drawOverlays();
}}}};
};
if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){if(!window.CanvasRenderingContext2D){(function(){var H={init:function(O){var P=O||document;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){var N=this;
__u.Events.addListener(P,"readystatechange",function(Q){N.init_(P);
});
}},init_:function(R,Q){if(R.readyState=="complete"){if(!R.namespaces["g_vml_"]){R.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml");
}var P=R.createStyleSheet();
P.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;}canvas *{behavior:url(#default#VML)}";
var O=R.getElementsByTagName("canvas");
for(var N=0;
N<O.length;
N++){if(!O[N].getContext){this.initElement(O[N]);
}}}},fixElement_:function(P){var R=P.outerHTML;
var Q=document.createElement(R);
if(R.slice(-2)!="/>"){var N="/"+P.tagName;
var O;
while((O=P.nextSibling)&&O.tagName!=N){O.removeNode();
}if(O){O.removeNode();
}}P.parentNode.replaceChild(Q,P);
return Q;
},getContext_:function(){if(this.context_){return this.context_;
}return this.context_=new J(this);
},initElement:function(O){O=this.fixElement_(O);
O.getContext=this.getContext_;
var N=O.attributes;
if(N.width&&N.width.specified){O.style.width=N.width.nodeValue+"px";
}if(N.height&&N.height.specified){O.style.height=N.height.nodeValue+"px";
}return O;
}};
H.init();
var M=[];
for(var F=0;
F<16;
F++){for(var E=0;
E<16;
E++){M[F*16+E]=F.toString(16)+E.toString(16);
}}function G(){return[[1,0,0],[0,1,0],[0,0,1]];
}function D(Q,P){var O=G();
for(var N=0;
N<3;
N++){for(var T=0;
T<3;
T++){var R=0;
for(var S=0;
S<3;
S++){R+=Q[N][S]*P[S][T];
}O[N][T]=R;
}}return O;
}function I(O,N){N.fillStyle=O.fillStyle;
N.lineCap=O.lineCap;
N.lineJoin=O.lineJoin;
N.lineWidth=O.lineWidth;
N.miterLimit=O.miterLimit;
N.shadowBlur=O.shadowBlur;
N.shadowColor=O.shadowColor;
N.shadowOffsetX=O.shadowOffsetX;
N.shadowOffsetY=O.shadowOffsetY;
N.strokeStyle=O.strokeStyle;
}function A(O){var R,Q=1;
O=String(O);
if(O.substring(0,3)=="rgb"){var T=O.indexOf("(",3);
var N=O.indexOf(")",T+1);
var S=O.substring(T+1,N).split(",");
R="#";
for(var P=0;
P<3;
P++){R+=M[parseInt(S[P])];
}if((S.length==4)&&(O.substr(3,1)=="a")){Q=S[3];
}}else{R=O;
}return[R,Q];
}function L(N){switch(N){case"butt":return"flat";
case"round":return"round";
case"square":default:return"square";
}}function J(N){this.m_=G();
this.element_=N;
this.mStack_=[];
this.aStack_=[];
this.currentPath_=[];
this.strokeStyle="#000";
this.fillStyle="#ccc";
this.lineWidth=1;
this.lineJoin="miter";
this.lineCap="butt";
this.miterLimit=10;
this.globalAlpha=1;
}var K=J.prototype;
K.clearRect=function(){this.element_.innerHTML="";
this.currentPath_=[];
};
K.beginPath=function(){this.currentPath_=[];
};
K.moveTo=function(O,N){this.currentPath_.push({type:"moveTo",x:O,y:N});
};
K.lineTo=function(O,N){this.currentPath_.push({type:"lineTo",x:O,y:N});
};
K.bezierCurveTo=function(P,N,S,R,Q,O){this.currentPath_.push({type:"bezierCurveTo",cp1x:P,cp1y:N,cp2x:S,cp2y:R,x:Q,y:O});
};
K.quadraticCurveTo=function(Q,P,O,N){this.bezierCurveTo(Q,P,Q,P,O,N);
};
K.arc=function(T,R,S,Q,O,P){if(!P){var W=Q;
Q=O;
O=W;
}var U=T+(Math.cos(Q)*S);
var X=R+Math.round(Math.sin(Q)*S);
var N=T+(Math.cos(O)*S);
var V=R+Math.round(Math.sin(O)*S);
this.currentPath_.push({type:"arc",x:T,y:R,radius:S,xStart:U,yStart:X,xEnd:N,yEnd:V});
};
K.rect=function(P,O,N,Q){this.moveTo(P,O);
this.lineTo(P+N,O);
this.lineTo(P+N,O+Q);
this.lineTo(P,O+Q);
this.closePath();
};
K.strokeRect=function(P,O,N,Q){this.beginPath();
this.moveTo(P,O);
this.lineTo(P+N,O);
this.lineTo(P+N,O+Q);
this.lineTo(P,O+Q);
this.closePath();
this.stroke();
};
K.fillRect=function(P,O,N,Q){this.beginPath();
this.moveTo(P,O);
this.lineTo(P+N,O);
this.lineTo(P+N,O+Q);
this.lineTo(P,O+Q);
this.closePath();
this.fill();
};
K.createLinearGradient=function(O,Q,N,P){var R=new C("gradient");
return R;
};
K.createRadialGradient=function(Q,S,P,O,R,N){var T=new C("gradientradial");
T.radius1_=P;
T.radius2_=N;
T.focus_.x=Q;
T.focus_.y=S;
return T;
};
K.drawImage=function(Y,O){var T,Q,U,f,X,V,a,j;
var R=Y.width;
var e=Y.height;
if(arguments.length==3){T=arguments[1];
Q=arguments[2];
X=V=0;
a=U=R;
j=f=e;
}else{if(arguments.length==5){T=arguments[1];
Q=arguments[2];
U=arguments[3];
f=arguments[4];
X=V=0;
a=R;
j=e;
}else{if(arguments.length==9){X=arguments[1];
V=arguments[2];
a=arguments[3];
j=arguments[4];
T=arguments[5];
Q=arguments[6];
U=arguments[7];
f=arguments[8];
}else{throw"Invalid number of arguments";
}}}var i=this.getCoords_(T,Q);
var P=(a/2);
var N=(j/2);
var g=[];
g.push(" <g_vml_:group",' coordsize="100,100"',' coordorigin="0, 0"',' style="width:100px;height:100px;position:absolute;');
if(this.m_[0][0]!=1||this.m_[0][1]){var S=[];
S.push("M11='",this.m_[0][0],"',","M12='",this.m_[1][0],"',","M21='",this.m_[0][1],"',","M22='",this.m_[1][1],"',","Dx='",i.x,"',","Dy='",i.y,"'");
var c=i;
var b=this.getCoords_(T+U,Q);
var Z=this.getCoords_(T,Q+f);
var W=this.getCoords_(T+U,Q+f);
c.x=Math.max(c.x,b.x,Z.x,W.x);
c.y=Math.max(c.y,b.y,Z.y,W.y);
g.push(" padding:0 ",Math.floor(c.x),"px ",Math.floor(c.y),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",S.join(""),", sizingmethod='clip');");
}else{g.push(" top:",i.y,"px;left:",i.x,"px;");
}g.push(' ">','<g_vml_:image src="',Y.src,'"',' style="width:',U,";"," height:",f,';"',' cropleft="',X/R,'"',' croptop="',V/e,'"',' cropright="',(R-X-a)/R,'"',' cropbottom="',(e-V-j)/e,'"'," />","</g_vml_:group>");
this.element_.insertAdjacentHTML("BeforeEnd",g.join(""));
};
K.stroke=function(o){var U=[];
var T=false;
var s=A(o?this.fillStyle:this.strokeStyle);
var k=s[0];
var P=s[1]*this.globalAlpha;
U.push("<g_vml_:shape",' fillcolor="',k,'"',' filled="',Boolean(o),'"',' style="position:absolute;width:10;height:10;"',' coordorigin="0 0" coordsize="10 10"',' stroked="',!o,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',k,'"',' path="');
var X=false;
var j={x:null,y:null};
var l={x:null,y:null};
for(var m=0;
m<this.currentPath_.length;
m++){var e=this.currentPath_[m];
if(e.type=="moveTo"){U.push(" m ");
var r=this.getCoords_(e.x,e.y);
U.push(Math.floor(r.x),",",Math.floor(r.y));
}else{if(e.type=="lineTo"){U.push(" l ");
var r=this.getCoords_(e.x,e.y);
U.push(Math.floor(r.x),",",Math.floor(r.y));
}else{if(e.type=="close"){U.push(" x ");
}else{if(e.type=="bezierCurveTo"){U.push(" c ");
var r=this.getCoords_(e.x,e.y);
var h=this.getCoords_(e.cp1x,e.cp1y);
var f=this.getCoords_(e.cp2x,e.cp2y);
U.push(Math.floor(h.x),",",Math.floor(h.y),",",Math.floor(f.x),",",Math.floor(f.y),",",Math.floor(r.x),",",Math.floor(r.y));
}else{if(e.type=="arc"){U.push(" ar ");
var r=this.getCoords_(e.x,e.y);
var Y=this.getCoords_(e.xStart,e.yStart);
var S=this.getCoords_(e.xEnd,e.yEnd);
var O=this.m_[0][0];
var R=this.m_[1][1];
U.push(Math.floor(r.x-O*e.radius),",",Math.floor(r.y-R*e.radius)," ",Math.floor(r.x+O*e.radius),",",Math.floor(r.y+R*e.radius)," ",Math.floor(Y.x),",",Math.floor(Y.y)," ",Math.floor(S.x),",",Math.floor(S.y));
}}}}}if(r){if(j.x==null||r.x<j.x){j.x=r.x;
}if(l.x==null||r.x>l.x){l.x=r.x;
}if(j.y==null||r.y<j.y){j.y=r.y;
}if(l.y==null||r.y>l.y){l.y=r.y;
}}}U.push(' ">');
if(typeof this.fillStyle=="object"){var d={x:"50%",y:"50%"};
var g=(l.x-j.x);
var Z=(l.y-j.y);
var q=(g>Z)?g:Z;
d.x=Math.floor((this.fillStyle.focus_.x/g)*100+50)+"%";
d.y=Math.floor((this.fillStyle.focus_.y/Z)*100+50)+"%";
var W=[];
if(this.fillStyle.type_=="gradientradial"){var n=(this.fillStyle.radius1_/q*100);
var b=(this.fillStyle.radius2_/q*100)-n;
}else{var n=0;
var b=100;
}var N={offset:null,color:null};
var Q={offset:null,color:null};
this.fillStyle.colors_.sort(function(c,a){return c.offset-a.offset;
});
for(var m=0;
m<this.fillStyle.colors_.length;
m++){var V=this.fillStyle.colors_[m];
W.push((V.offset*b)+n,"% ",V.color,",");
if(V.offset>N.offset||N.offset==null){N.offset=V.offset;
N.color=V.color;
}if(V.offset<Q.offset||Q.offset==null){Q.offset=V.offset;
Q.color=V.color;
}}W.pop();
U.push("<g_vml_:fill",' color="',Q.color,'"',' color2="',N.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',d.x,", ",d.y,'"',' colors="',W.join(""),'"',' opacity="',P,'" />');
}else{if(o){U.push('<g_vml_:fill color="',k,'" opacity="',P,'" />');
}else{U.push("<g_vml_:stroke",' opacity="',P,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',L(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',k,'" />');
}}U.push("</g_vml_:shape>");
this.element_.insertAdjacentHTML("beforeEnd",U.join(""));
this.currentPath_=[];
};
K.fill=function(){this.stroke(true);
};
K.closePath=function(){this.currentPath_.push({type:"close"});
};
K.getCoords_=function(O,N){return{x:(O*this.m_[0][0]+N*this.m_[1][0]+this.m_[2][0]),y:(O*this.m_[0][1]+N*this.m_[1][1]+this.m_[2][1])};
};
K.save=function(){var N={};
I(this,N);
this.aStack_.push(N);
this.mStack_.push(this.m_);
this.m_=D(G(),this.m_);
};
K.restore=function(){I(this.aStack_.pop(),this);
this.m_=this.mStack_.pop();
};
K.translate=function(P,O){var N=[[1,0,0],[0,1,0],[P,O,1]];
this.m_=D(N,this.m_);
};
K.rotate=function(O){var Q=Math.cos(O);
var P=Math.sin(O);
var N=[[Q,P,0],[-P,Q,0],[0,0,1]];
this.m_=D(N,this.m_);
};
K.scale=function(P,O){var N=[[P,0,0],[0,O,0],[0,0,1]];
this.m_=D(N,this.m_);
};
K.clip=function(){};
K.arcTo=function(){};
K.createPattern=function(){return new B;
};
function C(N){this.type_=N;
this.radius1_=0;
this.radius2_=0;
this.colors_=[];
this.focus_={x:0,y:0};
}C.prototype.addColorStop=function(O,N){N=A(N);
this.colors_.push({offset:1-O,color:N});
};
function B(){}G_vmlCanvasManager=H;
CanvasRenderingContext2D=J;
CanvasGradient=C;
CanvasPattern=B;
})();
}}
__l.Control=function(){this.controlDiv=null;
this.positionable=true;
};
__l.Control.prototype={appendTo:function(A){if(A){A.appendChild(this.controlDiv);
}},getImportance:function(){return 1;
},isPositionable:function(){return this.positionable;
},setPositionable:function(A){this.positionable=A;
},position:function(A){}};
__l.ViewModeControl=function(N){this.parentMap=null;
var C=this;
this.controlDiv=__d.ce("div");
this.controlDiv.id="viewCtrl";
this.controlDiv.className="viewModeControl";
this.controlDiv.style.zIndex=400;
this.controlDiv.style.position="relative";
var P=__d.ce("span");
P.className="viewModeLink";
P.innerHTML="&nbsp;&nbsp;|&nbsp;";
var L=__d.ce("span");
L.className="viewModeLink";
L.innerHTML="&nbsp;&nbsp;|&nbsp;";
var B=__d.ce("a");
B.id="mode0";
B.title="Street";
B.href="javascript:void(0);";
__u.Events.addListener(B,"click",function(){C.setViewMode(0);
sct(44055);
});
B.className="viewModeLinkActive";
B.innerHTML="Street";
this.streetMode=B;
var A=__d.ce("a");
A.id="mode2";
A.title="Aerial";
A.href="javascript:void(0);";
__u.Events.addListener(A,"click",function(){C.setViewMode(2);
sct(44050);
});
A.className="viewModeLink";
A.innerHTML="Aerial";
this.aerialMode=A;
var E=__d.ce("span");
var O=__d.ce("a");
O.id="mode3";
O.title="Physical";
O.href="javascript:void(0);";
__u.Events.addListener(E,"click",function(){if(C.parentMap.zoom>=__l.ZoomLevel.Min_Physical){C.setViewMode(3);
}sct(44054);
});
O.className="viewModeLink";
O.innerHTML="Physical";
E.appendChild(O);
this.physicalMode=E;
var M=__d.ce("input");
M.type="checkbox";
M.style.cursor="pointer";
M.style.marginRight="3";
M.style.position="relative";
M.style.bottom="1";
M.style.width="12px";
M.style.height="12px";
M.style.verticalAlign="middle";
M.name="chkLabels";
M.id="chkLabels";
M.checked=true;
__u.Events.addListener(M,"click",function(R,Q){Q.addLabels(this);
sct(44052);
},this);
this.labelsCheck=M;
var G=__d.ce("label");
G.id="lblLabel";
G.innerHTML="Labels";
G.style.fontWeight="bold";
G.style.cursor="pointer";
G.htmlFor="chkLabels";
var H=__d.ce("span");
H.id="dvLabels";
H.style.display="none";
H.innerHTML="&nbsp;&nbsp;";
H.appendChild(this.labelsCheck);
H.appendChild(G);
this.labels=H;
var D=false;
var K=false;
var J=false;
var I=false;
if(N){for(var F=0;
F<N.length;
F++){switch(N[F]){case __l.ViewMode.Street:D=true;
break;
case __l.ViewMode.Aerial_Labels:I=true;
break;
case __l.ViewMode.Aerial:I=true;
break;
case __l.ViewMode.Physical:J=true;
I=true;
break;
case __l.ViewMode.Physical_Labels:J=true;
I=true;
break;
}}}else{D=true;
J=true;
I=true;
}this.table=__d.ce("table");
this.table.style.width="97%";
this.table.cellPadding=0;
this.table.cellSpacing=0;
this.tbody=__d.ce("tbody");
this.table.appendChild(this.tbody);
this.tr=__d.ce("tr");
this.tbody.appendChild(this.tr);
this.tdLeft=__d.ce("td");
this.tr.appendChild(this.tdLeft);
this.tdRight=__d.ce("td");
this.tdRight.style.textAlign="right";
this.tdRight.style.whiteSpace="nowrap";
this.tr.appendChild(this.tdRight);
this.controlDiv.appendChild(this.table);
};
__l.ViewModeControl.prototype=new __l.Control();
__l.ViewModeControl.prototype.subscribeToEvents=function(){this.parentMap.disablePhysicalView.subscribe(this.onDisablePhysicalView,this);
this.parentMap.viewModeChange.subscribe(this.onViewModeChange,this);
};
__l.ViewModeControl.prototype.onViewModeChange=function(B,A,C){C.setControlStatus(A[0]);
};
__l.ViewModeControl.prototype.onDisablePhysicalView=function(B,A,C){if(this.viewMode!=3&&this.viewMode!=4){C.physicalMode.childNodes[0].className=C.parentMap.zoom<__l.ZoomLevel.Min_Physical?"viewModeLinkDis":"viewModeLink";
}};
__l.ViewModeControl.prototype.setControlStatus=function(A){if(this.parentMap){if(A==0){this.labels.style.display="none";
this.streetMode.className="viewModeLinkActive";
this.aerialMode.className="viewModeLink";
this.physicalMode.childNodes[0].className="viewModeLink";
}else{this.labels.style.display="inline";
if(A==1||A==2){this.streetMode.className="viewModeLink";
this.aerialMode.className="viewModeLinkActive";
this.physicalMode.childNodes[0].className="viewModeLink";
}else{if(A==3||A==4){this.streetMode.className="viewModeLink";
this.aerialMode.className="viewModeLink";
this.physicalMode.childNodes[0].className="viewModeLinkActive";
}}}this.parentMap.setZoomBackground();
this.parentMap.disablePhysicalView.fire();
}};
__l.ViewModeControl.prototype.setViewMode=function(A){if(this.parentMap){if((A==2)&&(this.labelsCheck.checked)){A=1;
}else{if((A==3)&&(this.labelsCheck.checked)){A=4;
}}this.parentMap.setViewMode(A);
}};
__l.ViewModeControl.prototype.addLabels=function(B){var A;
if(this.parentMap){if((this.parentMap.viewMode==2)||(this.parentMap.viewMode==1)){if(B.checked){A=1;
}else{A=2;
}}else{if((this.parentMap.viewMode==3)||(this.parentMap.viewMode==4)){if(B.checked){A=4;
}else{A=3;
}}}this.parentMap.setViewMode(A);
}};
__l.ViewModeControl.prototype.appendTo=function(A){if(A){A.appendChild(this.controlDiv);
var B=this.labels;
if(B){if(this.parentMap.viewMode==0){B.style.display="none";
}else{B.style.display="inline";
}}this.labelsCheck.checked=true;
}};
__l.ViewModeControl.prototype.getImportance=function(){return 8;
};
__l.ViewModeControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}var C=__u.Geometry.squeeze({left:0,top:0,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.left,top:C.top,right:C.right,bottom:C.top+16};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
B.push(A);
};
__l.ScrollArrowsControl=function(){this.parentMap=null;
var C=this;
this.moveTimer=null;
var B=150;
var A=__u.Image.MakePng(__l.Defaults.SP+"north.png",100,22,101);
A.id="img_N";
A.title="Move North";
__u.Events.addListener(A,"mousedown",function(){C.movePercent("N");
C.moveTimer=setInterval(function(){C.movePercent("N");
},B);
sct(44039);
});
__u.Events.addListener(A,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(A,"mouseout",this.stopMovePercent,this,true);
A.style.cursor=__u.Browser.handCursor;
var G=__u.Image.MakePng(__l.Defaults.SP+"northeast.png",100,22,101);
G.id="img_NE";
G.title="Move North-East";
__u.Events.addListener(G,"mousedown",function(){C.movePercent("NE");
C.moveTimer=setInterval(function(){C.movePercent("NE");
},B);
sct(44040);
});
__u.Events.addListener(G,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(G,"mouseout",this.stopMovePercent,this,true);
G.style.cursor=__u.Browser.handCursor;
var J=__u.Image.MakePng(__l.Defaults.SP+"northwest.png",1,22,101);
J.id="img_NW";
J.title="Move North-West";
__u.Events.addListener(J,"mousedown",function(){C.movePercent("NW");
C.moveTimer=setInterval(function(){C.movePercent("NW");
},B);
sct(44041);
});
__u.Events.addListener(J,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(J,"mouseout",this.stopMovePercent,this,true);
J.style.cursor=__u.Browser.handCursor;
var H=__u.Image.MakePng(__l.Defaults.SP+"west.png",2,22,101);
H.id="img_W";
H.title="Move West";
__u.Events.addListener(H,"mousedown",function(){C.movePercent("W");
C.moveTimer=setInterval(function(){C.movePercent("W");
},B);
sct(44038);
});
__u.Events.addListener(H,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(H,"mouseout",this.stopMovePercent,this,true);
H.style.cursor=__u.Browser.handCursor;
var E=__u.Image.MakePng(__l.Defaults.SP+"east.png",3,22,101);
E.id="img_E";
E.title="Move East";
__u.Events.addListener(E,"mousedown",function(){C.movePercent("E");
C.moveTimer=setInterval(function(){C.movePercent("E");
},B);
sct(44038);
});
__u.Events.addListener(E,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(E,"mouseout",this.stopMovePercent,this,true);
E.style.cursor=__u.Browser.handCursor;
var I=__u.Image.MakePng(__l.Defaults.SP+"south.png",3,22,101);
I.id="img_S";
I.title="Move South";
__u.Events.addListener(I,"mousedown",function(){C.movePercent("S");
C.moveTimer=setInterval(function(){C.movePercent("S");
},B);
sct(44039);
});
__u.Events.addListener(I,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(I,"mouseout",this.stopMovePercent,this,true);
I.style.cursor=__u.Browser.handCursor;
var D=__u.Image.MakePng(__l.Defaults.SP+"southeast.png",3,22,101);
D.id="img_SE";
D.title="Move South-East";
__u.Events.addListener(D,"mousedown",function(){C.movePercent("SE");
C.moveTimer=setInterval(function(){C.movePercent("SE");
},B);
sct(44042);
});
__u.Events.addListener(D,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(D,"mouseout",this.stopMovePercent,this,true);
D.style.cursor=__u.Browser.handCursor;
var F=__u.Image.MakePng(__l.Defaults.SP+"southwest.png",1,22,101);
F.id="img_SW";
F.title="Move South-West";
__u.Events.addListener(F,"mousedown",function(){C.movePercent("SW");
C.moveTimer=setInterval(function(){C.movePercent("SW");
},B);
sct(44043);
});
__u.Events.addListener(F,"mouseup",this.stopMovePercent,this,true);
__u.Events.addListener(F,"mouseout",this.stopMovePercent,this,true);
F.style.cursor=__u.Browser.handCursor;
this.controlDiv=__d.ce("div");
this.controlDiv.id="scrollArrowsCntrl";
this.controlDiv.onselectstart=__u.Events.returnFalse;
this.controlDiv.appendChild(A);
this.controlDiv.appendChild(G);
this.controlDiv.appendChild(J);
this.controlDiv.appendChild(H);
this.controlDiv.appendChild(E);
this.controlDiv.appendChild(I);
this.controlDiv.appendChild(D);
this.controlDiv.appendChild(F);
};
__l.ScrollArrowsControl.prototype=new __l.Control();
__l.ScrollArrowsControl.prototype.appendTo=function(A){if(A){A.appendChild(this.controlDiv);
}};
__l.ScrollArrowsControl.prototype.subscribeToEvents=function(){};
__l.ScrollArrowsControl.prototype.movePercent=function(D){var C,G;
var B=this.parentMap.centerX;
var F=this.parentMap.centerY;
var E=parseInt(this.parentMap.viewHeight/5);
var A=parseInt(this.parentMap.viewWidth/5);
if(D=="N"){C=B;
G=F-E;
}else{if(D=="S"){C=B;
G=F+E;
}else{if(D=="W"){C=B-A;
G=F;
}else{if(D=="E"){C=B+A;
G=F;
}else{if(D=="NW"){C=B-A;
G=F-E;
}else{if(D=="NE"){C=B+A;
G=F-E;
}else{if(D=="SW"){C=B-A;
G=F+E;
}else{if(D=="SE"){C=B+A;
G=F+E;
}}}}}}}}if(C&&G){this.parentMap.moveViewTo(C,G);
}};
__l.ScrollArrowsControl.prototype.stopMovePercent=function(A){clearInterval(this.moveTimer);
};
__l.ScrollArrowsControl.prototype.moveArrows=function(){this.controlDiv.childNodes[0].style.left=this.parentMap.halfViewWidth-15+"px";
this.controlDiv.childNodes[1].style.left=this.parentMap.viewWidth-35+"px";
this.controlDiv.childNodes[3].style.top=this.parentMap.halfViewHeight-15+"px";
this.controlDiv.childNodes[4].style.top=this.parentMap.halfViewHeight-15+"px";
this.controlDiv.childNodes[4].style.left=this.parentMap.viewWidth-30+"px";
this.controlDiv.childNodes[5].style.top=this.parentMap.viewHeight-20+"px";
this.controlDiv.childNodes[5].style.left=this.parentMap.halfViewWidth-15+"px";
this.controlDiv.childNodes[6].style.top=this.parentMap.viewHeight-25+"px";
this.controlDiv.childNodes[6].style.left=this.parentMap.viewWidth-35+"px";
this.controlDiv.childNodes[7].style.top=this.parentMap.viewHeight-25+"px";
};
__l.ScrollArrowsControl.prototype.getImportance=function(){return 7;
};
__l.ScrollArrowsControl.prototype.position=function(C){if(!this.isPositionable()){return ;
}var G=__u.Geometry.squeeze({left:5,top:30,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},C);
var D=G.left;
var I=G.top;
var J=G.right;
var A=G.bottom;
var H=Math.round((G.left+G.right)/2);
var B=Math.round((G.top+G.bottom)/2);
var F=[{left:H-16,top:I,right:H+17,bottom:I+22},{left:J-27,top:I,right:J,bottom:I+28},{left:D,top:I,right:D+28,bottom:I+26},{left:D,top:B-16,right:D+22,bottom:B+17},{left:J-21,top:B-16,right:J,bottom:B+17},{left:H-16,top:A-21,right:H+17,bottom:A},{left:J-28,top:A-28,right:J,bottom:A},{left:D,top:A-28,right:D+27,bottom:A}];
for(var E=0;
E<8;
E++){this.controlDiv.childNodes[E].style.left=F[E].left+"px";
this.controlDiv.childNodes[E].style.top=F[E].top+"px";
C.push(F[E]);
}};
__l.AutoDriveControl=function(){this.parentMap=null;
var A=this;
this.playClick=new __u.AbstractEvent("resizeView",this);
this.stopClick=new __u.AbstractEvent("resizeView",this);
this.pauseClick=new __u.AbstractEvent("resizeView",this);
this.playDiv=__d.ce("div");
this.backImgLong=__u.Image.MakePng(__l.Defaults.SP+"ad-bg.png",0,0,100);
this.backImgLong.className="op";
this.backImgLong.id="img_background_long";
this.backImgLong.style.display="";
this.playOnImg=__u.Image.MakeGif(__l.Defaults.SP+"go_green_arrow.gif",7,10,101);
this.playOnImg.className="op";
this.playOnImg.title="Play Directions";
this.playOnImg.onclick=function(B){A.parentMap.autoDriving=true;
A.playOnImg.style.display="none";
A.pauseImg.style.display="";
A.stopImg.style.display="none";
A.stopOnImg.style.display="";
A.playClick.fire();
sct(44064);
};
this.playOnImg.style.cursor=__u.Browser.handCursor;
this.playOnImg.style.display="";
this.playDiv.appendChild(this.playOnImg);
this.pauseImg=__u.Image.MakeGif(__l.Defaults.SP+"pause_orange.png",7,10,101);
this.pauseImg.className="op";
this.pauseImg.title="Pause Directions";
this.pauseImg.onclick=function(){A.parentMap.autoDriving=false;
A.playOnImg.style.display="";
A.pauseImg.style.display="none";
A.stopImg.style.display="none";
A.stopOnImg.style.display="";
A.pauseClick.fire();
sct(44063);
};
this.pauseImg.style.cursor=__u.Browser.handCursor;
this.pauseImg.style.display="none";
this.playDiv.appendChild(this.pauseImg);
this.stopImg=__u.Image.MakeGif(__l.Defaults.SP+"darker_stop_button.gif",23,12,101);
this.stopImg.className="op";
this.stopImg.title="Stop Directions";
this.stopImg.style.display="";
this.playDiv.appendChild(this.stopImg);
this.stopOnImg=__u.Image.MakeGif(__l.Defaults.SP+"stop_red_button.gif",23,12,101);
this.stopOnImg.className="op";
this.stopOnImg.title="Stop Directions";
this.stopOnImg.onclick=function(){A.parentMap.autoDriving=false;
A.playOnImg.style.display="";
A.pauseImg.style.display="none";
A.stopImg.style.display="";
A.stopOnImg.style.display="none";
A.stopClick.fire();
sct(44065);
};
this.stopOnImg.style.cursor=__u.Browser.handCursor;
this.stopOnImg.style.display="none";
this.playDiv.appendChild(this.stopOnImg);
this.controlDiv=__d.ce("div");
this.controlDiv.id="autoDrive";
this.controlDiv.className="autoDriveControl";
this.controlDiv.style.position="absolute";
this.controlDiv.style.zIndex=301;
this.controlDiv.onselectstart=__u.Events.returnFalse;
this.controlDiv.appendChild(this.playDiv);
this.controlDiv.appendChild(this.backImgLong);
};
__l.AutoDriveControl.prototype=new __l.Control();
__l.AutoDriveControl.prototype.subscribeToEvents=function(){};
__l.AutoDriveControl.prototype.toggleVisible=function(A){if(A){this.controlDiv.style.display="";
}else{this.controlDiv.style.display="none";
}};
__l.AutoDriveControl.prototype.getImportance=function(){return 0;
};
__l.AutoDriveControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}var C=__u.Geometry.squeeze({left:0,top:0,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.left-40,top:C.top+252,right:C.left+45,bottom:C.top+285};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
B.push(A);
};
__l.SmallMapControl=function(){this.parentMap=null;
var E=this;
var A;
A=__u.Image.MakePng(__l.Defaults.SP+"zoom_background_sm1.png",0,0,100);
A.style.height="94px";
var B=__u.Image.MakePng(__l.Defaults.SP+"zoom_text.gif",5,7,102);
B.alt="zoom";
var D=__u.Image.MakeGif(__l.Defaults.SP+"zoom_in.gif",11,25,102);
D.alt=D.title="zoom in";
D.style.cursor=__u.Browser.handCursor;
__u.Events.addListener(D,"click",this.zoomIn,this,true);
var F=__u.Image.MakeGif(__l.Defaults.SP+"zoom_out.gif",11,42,102);
F.alt=F.title="zoom out";
F.style.cursor=__u.Browser.handCursor;
__u.Events.addListener(F,"click",this.zoomOut,this,true);
this.controlDiv=__d.ce("div");
this.controlDiv.id="smMapCtrl";
this.controlDiv.style.position="absolute";
this.controlDiv.className="smallMapControl";
this.controlDiv.onselectstart=__u.Events.returnFalse;
this.controlDiv.style.zIndex=301;
this.controlDiv.appendChild(A);
var C=__u.Image.MakeGif(__l.Defaults.SP+"center.gif",7,68,102);
C.style.cursor=__u.Browser.handCursor;
C.title=C.alt="Zoom to all locations";
__u.Events.addListener(C,"click",function(){E.parentMap.showAllOverlays();
sct(44056);
});
this.controlDiv.appendChild(B);
this.controlDiv.appendChild(C);
this.controlDiv.appendChild(F);
this.controlDiv.appendChild(D);
};
__l.SmallMapControl.prototype=new __l.Control();
__l.SmallMapControl.prototype.subscribeToEvents=function(){this.parentMap.zoomChange.subscribe(this.onZoomChange,this);
};
__l.SmallMapControl.prototype.onZoomChange=function(B,A,C){};
__l.SmallMapControl.prototype.zoomIn=function(A){if(this.parentMap){this.parentMap.zoomIn();
}sct(44058);
};
__l.SmallMapControl.prototype.zoomOut=function(A){if(this.parentMap){this.parentMap.zoomOut();
}sct(44062);
};
__l.SmallMapControl.prototype.getImportance=function(){return 5;
};
__l.SmallMapControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}var C=__u.Geometry.squeeze({left:0,top:25,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.left+5,top:C.top+5,right:C.left+39,bottom:C.top+89};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
B.push(A);
};
__l.LargeMapControl=function(){this.parentMap=null;
var E=this;
var A;
A=__u.Image.MakePng(__l.Defaults.SP+"zoom_background_small.png",0,0,100);
A.className="op";
A.id="img_background";
this.zoomBackground=__u.Image.MakePng(__l.Defaults.SP+"zoombackground.png",10,46,101);
this.zoomBackground.style.width=28;
this.zoomBackground.style.height=175;
this.zoomBackground.style.cursor=__u.Browser.handCursor;
this.zoomBackground.onclick=function(G){E.zoomBackgroundClick(G);
};
var B=__u.Image.MakePng(__l.Defaults.SP+"zoom_text.gif",7,7,102);
B.alt="zoom";
var D=__u.Image.MakeGif(__l.Defaults.SP+"zoom_plus_icon.gif",13,25,102);
D.alt=D.title="zoom in";
D.style.cursor=__u.Browser.handCursor;
D.onclick=function(){E.zoomIn();
sct(44058);
};
var F=__u.Image.MakeGif(__l.Defaults.SP+"zoom_minus_icon.gif",13,228,102);
F.alt=F.title="zoom out";
F.style.cursor=__u.Browser.handCursor;
F.onclick=function(){E.zoomOut();
sct(44062);
};
this.zoomFader=__u.Image.MakeGif(__l.Defaults.SP+"arrow_marker.gif",8,58,102);
this.zoomFader.style.cursor=__u.Browser.handCursor;
this.zoomFader.ondragstart=__u.Events.returnFalse;
this.zoomFader.onmousedown=function(G){sct(44057);
return E.beginZoomDrag(G);
};
this.controlDiv=__d.ce("div");
this.controlDiv.id="lgMapCtrl";
this.controlDiv.style.position="absolute";
this.controlDiv.className="largeMapControl";
this.controlDiv.onselectstart=__u.Events.returnFalse;
this.controlDiv.style.zIndex=301;
this.controlDiv.appendChild(A);
var C=__u.Image.MakeGif(__l.Defaults.SP+"centermap_icon.gif",10,253,102);
C.style.cursor=__u.Browser.handCursor;
C.title=C.alt="Zoom to all locations";
C.onclick=function(){E.parentMap.showAllOverlays();
sct(44056);
};
this.controlDiv.appendChild(C);
this.controlDiv.appendChild(this.zoomBackground);
this.controlDiv.appendChild(this.zoomFader);
this.controlDiv.appendChild(F);
this.controlDiv.appendChild(D);
this.controlDiv.appendChild(B);
this.zoomFader.style.top=46+9*(__u.GeoMath.MAXZOOM-5)+"px";
};
__l.LargeMapControl.prototype=new __l.Control();
__l.LargeMapControl.prototype.subscribeToEvents=function(){this.parentMap.zoomChange.subscribe(this.onZoomChange,this);
this.parentMap.zoomBackgroundChange.subscribe(this.onZoomBackgroundChange,this);
this.parentMap.togglePlayDirControl.subscribe(this.onTogglePlayDirControl,this);
};
__l.LargeMapControl.prototype.onTogglePlayDirControl=function(B,A,C){var D=A[0];
if(D){C.backImg.style.display="none";
C.backImgLong.style.display="";
C.playDiv.style.display="";
}else{C.backImg.style.display="";
C.backImgLong.style.display="none";
C.playDiv.style.display="none";
}};
__l.LargeMapControl.prototype.onZoomBackgroundChange=function(B,A,C){C.setZoomBackground();
};
__l.LargeMapControl.prototype.onZoomChange=function(B,A,C){if(C.zoomFader){C.zoomFader.style.top=46+9*(parseInt(A[0]))+"px";
C.setZoomBackground();
}};
__l.LargeMapControl.prototype.zoomBackgroundClick=function(C){if(this.parentMap){var A=this.parentMap.getMousePos(__u.Events.getEvent(C)).y-46-parseInt(this.controlDiv.style.top)-4;
if(A<0||A>(9*__u.GeoMath.MAXZOOM)){return ;
}var B=Math.round(A/9);
this.parentMap.setZoom(B);
}};
__l.LargeMapControl.prototype.zoomIn=function(A){if(this.parentMap){this.parentMap.zoomIn();
}};
__l.LargeMapControl.prototype.zoomOut=function(A){if(this.parentMap){this.parentMap.zoomOut();
}};
__l.LargeMapControl.prototype.beginZoomDrag=function(A){var B=this;
__d.documentElement.onmousemove=function(C){return B.doZoomDrag(C);
};
__d.documentElement.onmouseup=function(C){return B.endZoomDrag(C);
};
return false;
};
__l.LargeMapControl.prototype.doZoomDrag=function(C){if(this.parentMap){var A=this.parentMap.getMousePos(__u.Events.getEvent(C)).y-46-parseInt(this.controlDiv.style.top)-4;
if(A<0){A=0;
}if(A>(__u.GeoMath.MAXZOOM-2)*9){A=(__u.GeoMath.MAXZOOM-2)*9;
}if(this.parentMap.viewMode==3||this.parentMap.viewMode==4){if(A<(__l.ZoomLevel.Min_Physical*9)){A=__l.ZoomLevel.Min_Physical*9;
}}this.zoomFader.style.top=A+46+"px";
var B=Math.round(A/9);
return false;
}};
__l.LargeMapControl.prototype.endZoomDrag=function(C){if(this.parentMap){__d.documentElement.onmousemove=null;
__d.documentElement.onmouseup=null;
var A=this.parentMap.getMousePos(__u.Events.getEvent(C)).y-46-parseInt(this.controlDiv.style.top)-4;
var B=Math.round(A/9);
this.parentMap.setZoom(B);
return false;
}};
__l.LargeMapControl.prototype.setZoomBackground=function(){var B=parseInt((this.parentMap.zoom+1)/2+1);
var A;
if(parseInt(this.parentMap.zoom%2)==1){if((this.parentMap.viewMode==3||this.parentMap.viewMode==4)){A=__l.Defaults.SP+"zoombackgroundsmall.png";
}else{A=__l.Defaults.SP+"zoombackground.png";
}}else{if(B<10){if((this.parentMap.viewMode==3||this.parentMap.viewMode==4)){A=__l.Defaults.SP+"zoombackgroundsmall_0"+B+".png";
}else{A=__l.Defaults.SP+"zoom_mark_0"+B+".png";
}}else{if((this.parentMap.viewMode==3||this.parentMap.viewMode==4)){A=__l.Defaults.SP+"zoombackgroundsmall_"+B+".png";
}else{A=__l.Defaults.SP+"zoom_mark_"+B+".png";
}}}if(this.zoomBackground){this.zoomBackground.style.width=28;
this.zoomBackground.style.height=175;
if(__u.Browser.isIE6){this.zoomBackground.src=__u.Defaults.SP+"transparent.gif";
this.zoomBackground.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='none')";
}else{this.zoomBackground.src=A;
}}};
__l.LargeMapControl.prototype.getImportance=function(){return 5;
};
__l.LargeMapControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}var C=__u.Geometry.squeeze({left:0,top:25,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.left+5,top:C.top+5,right:C.left+45,bottom:C.top+285};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
B.push(A);
};
__l.CanvasControl=function(){this.parentMap=null;
this.toolClick=new __u.AbstractEvent("toolClick",this);
this.lineColor="rgb(1,102,254)";
this.fillColor="rgb(1,102,254)";
this.lineWidth=7;
this.fillAlpha=0.4;
this.lineAlpha=0.6;
this.activeTool=null;
var D=__d.ce("div");
D.id="canvasCtrl";
D.className="canvasControl";
D.style.zIndex=400;
D.style.position="absolute";
var J=__d.ce("div");
J.id="canvasColorPicker";
J.style.position="absolute";
J.style.border="1px solid silver";
J.style.backgroundColor="whitesmoke";
J.style.paddingLeft="2px";
J.style.zIndex=500;
J.style.width="120px";
J.style.height="48px";
J.style.display="none";
J.style.top="-200px";
J.style.left="75px";
if(__u.Browser.isIE){J.style.paddingTop="3px";
}this.lineColors=["rgb(255,255,255)","rgb(255,255,0)","rgb(255,102,0)","rgb(204,0,1)","rgb(0,153,0)","rgb(1,102,254)","rgb(0,0,254)","rgb(0,0,0)"];
this.fillColors=["rgb(255,255,255)","rgb(255,255,0)","rgb(255,102,0)","rgb(204,0,1)","rgb(0,153,0)","rgb(1,102,254)","rgb(0,0,254)","rgb(0,0,0)"];
var b="2px";
var H=__d.ce("table");
var M=__d.ce("tbody");
var E=__d.ce("tr");
var e=__d.ce("tr");
var d=__d.ce("tr");
var Z=__d.ce("tr");
H.appendChild(M);
H.cellPadding=0;
H.cellSpacing=0;
H.width="100%";
M.appendChild(E);
M.appendChild(e);
M.appendChild(d);
M.appendChild(Z);
J.appendChild(H);
var O=__d.ce("table");
var Q=__d.ce("tbody");
var B=__d.ce("tr");
var Y=__d.ce("td");
var N=__d.ce("td");
N.vAlign="middle";
O.appendChild(Q);
O.cellPadding=0;
O.cellSpacing=0;
O.width="100%";
Q.appendChild(B);
B.appendChild(Y);
B.appendChild(N);
D.appendChild(O);
var R=__d.ce("img");
R.src=__l.UI.Defaults.SP+"pointer.gif";
R.height=7;
R.width=10;
R.align="top";
this.linePntr=R;
this.fillPntr=R.cloneNode(false);
var L=this;
function U(o,l,f,n,j){var k=o?L.linePntr:L.fillPntr;
var h=__d.ce("td");
h.style.paddingTop="2px";
h.valign="top";
h.style.fontSize="0px";
var m=__d.ce("img");
m.src=__l.Defaults.SP+"transparent.gif";
m.index=l;
if(o){m.style.backgroundColor="whitesmoke";
m.style.border="2px solid "+L.lineColors[l];
}else{m.style.backgroundColor=L.fillColors[l];
m.style.border="2px solid black";
}m.align="absmiddle";
m.height=10;
m.width=10;
m.style.cursor=__u.Browser.handCursor;
__u.Events.addListener(m,"click",function(c,i){i.setColor(o,__u.Events.getTarget(c));
},L);
h.appendChild(m);
n.appendChild(h);
var g=__d.ce("td");
g.align="center";
g.vAlign="top";
g.style.fontSize="0px";
if(l==f){g.appendChild(k);
}j.appendChild(g);
}for(var X=0;
X<this.lineColors.length;
X++){U(true,X,5,E,e);
}this.lineColor=this.lineColors[5];
for(var X=0;
X<this.fillColors.length;
X++){U(false,X,0,d,Z);
}L.fillColor=this.fillColors[0];
J.colorType=-1;
this.colorPicker=J;
var a=__d.ce("img");
a.style.position="absolute";
a.style.display="none";
a.style.left="-100px";
a.style.top="-100px";
a.style.zIndex="1000";
a.fromTop=0;
a.fromLeft=0;
__d.body.appendChild(a);
this.cursor=a;
var S=__d.ce("img");
S.src=__l.UI.Defaults.SP+"open_hand.gif";
__u.Events.addListener(S,"click",this.onToolClick,this);
S.alt=S.title="map tool";
this.mapTool=S;
var A=__d.ce("img");
A.src=__l.UI.Defaults.SP+"text.gif";
__u.Events.addListener(A,"click",this.onToolClick,this);
__u.Events.addListener(A,"mousedown",function(){sct(43981,this);
});
A.alt=A.title="add a text label";
this.textTool=A;
var V=__d.ce("img");
__u.Image.SetPng(V,__l.UI.Defaults.SP+"blue_i_dot.png");
V.alt=V.title="add a location to the map";
__u.Events.addListener(V,"click",this.onToolClick,this);
__u.Events.addListener(V,"mousedown",function(){sct(43980,this);
});
this.pinTool=V;
this.waypointTool={};
var T=__d.ce("img");
T.src=__l.UI.Defaults.SP+"paint.gif";
T.alt=T.title="free-hand draw";
__u.Events.addListener(T,"click",this.onToolClick,this);
__u.Events.addListener(T,"mousedown",function(){sct(43987,this);
});
this.polyTool=T;
var I=__d.ce("img");
I.src=__l.UI.Defaults.SP+"line.gif";
I.alt=I.title="segmented line";
__u.Events.addListener(I,"click",this.onToolClick,this);
__u.Events.addListener(I,"mousedown",function(){sct(43992,this);
});
this.lineTool=I;
var P=__d.ce("img");
P.src=__l.UI.Defaults.SP+"polygon.gif";
__u.Events.addListener(P,"click",this.onToolClick,this);
__u.Events.addListener(P,"mousedown",function(){sct(43988,this);
});
P.alt=P.title="polygon";
this.polygonTool=P;
var G=__d.ce("img");
G.src=__l.UI.Defaults.SP+"circle.gif";
__u.Events.addListener(G,"click",this.onToolClick,this);
__u.Events.addListener(G,"mousedown",function(){sct(43982,this);
});
G.alt=G.title="circle";
this.circleTool=G;
var F=__d.ce("img");
F.src=__l.UI.Defaults.SP+"rect.gif";
F.alt=F.title="rectangle";
__u.Events.addListener(F,"click",this.onToolClick,this);
__u.Events.addListener(F,"mousedown",function(){sct(43989,this);
});
this.rectTool=F;
var C=__d.ce("img");
C.src=__l.UI.Defaults.SP+"clear.gif";
__u.Events.addListener(C,"click",this.onToolClick,this);
__u.Events.addListener(C,"mousedown",function(){sct(43984,this);
});
C.alt=C.title="clear all drawings";
C.style.marginBottom="3px";
this.clearTool=C;
var K=__d.ce("img");
K.src=__l.UI.Defaults.SP+"undo.gif";
K.alt=K.title="undo the last draw action";
__u.Events.addListener(K,"click",this.onToolClick,this);
__u.Events.addListener(K,"mousedown",function(){sct(43994,this);
});
K.style.marginBottom="3px";
this.undoTool=K;
Y.appendChild(this.mapTool);
Y.appendChild(this.textTool);
Y.appendChild(this.pinTool);
Y.appendChild(this.polyTool);
Y.appendChild(this.lineTool);
Y.appendChild(this.polygonTool);
Y.appendChild(this.rectTool);
Y.appendChild(this.circleTool);
Y.appendChild(this.clearTool);
Y.appendChild(this.undoTool);
var W=__d.ce("img");
W.src=__l.UI.Defaults.SP+"down.gif";
W.style.cursor=__u.Browser.handCursor;
W.alt=W.title="Hide save control";
__u.Events.addListener(W,"click",function(f){var c=__d.get("saveCtrl");
if(c){if(c.style.display=="none"){this.src=__l.UI.Defaults.SP+"down.gif";
this.alt=this.title="Hide save control";
c.style.display="";
}else{this.src=__l.UI.Defaults.SP+"up.gif";
this.alt=this.title="Show save control";
c.style.display="none";
}__l.UI.map.positionControls();
__l.UI.map.drawOverlays();
}});
N.appendChild(W);
__u.Events.addListener(D,"mousedown",__u.Events.stopPropagation);
this.controlDiv=D;
this.leftArea=Y;
this.rightArea=N;
this.setTool(this.mapTool);
this.hideDrawTools();
};
__l.CanvasControl.prototype=new __l.Control();
__l.CanvasControl.prototype.moveCursor=function(A,B){A=__u.Events.getEvent(A);
B.cursor.style.top=__u.Events.getPageY(A)+B.cursor.fromTop+"px";
B.cursor.style.left=__u.Events.getPageX(A)+B.cursor.fromLeft+"px";
B.cursor.style.display="";
};
__l.CanvasControl.prototype.hideCursor=function(A,B){B.cursor.style.display="none";
};
__l.CanvasControl.prototype.removeCursorListeners=function(){__u.Events.removeListener(this.parentMap.mapDiv,"mousemove",this.moveCursor);
__u.Events.removeListener(this.parentMap.mapDiv,"mouseup",this.moveCursor);
__u.Events.removeListener(this.parentMap.mapDiv,"dblclick",this.hideCursor);
__u.Events.removeListener(this.parentMap.mapDiv,"mouseout",this.hideCursor);
this.cursor.style.display="none";
};
__l.CanvasControl.prototype.initStyle=function(){var B=(this.fillColor.substring(0,this.fillColor.length-1)+","+this.fillAlpha+")").replace(/rgb\(/,"rgba(");
var D=(this.lineColor.substring(0,this.lineColor.length-1)+","+this.lineAlpha+")").replace(/rgb\(/,"rgba(");
var A=this.parentMap.canvas.context;
if(A){A.fillStyle=B;
A.strokeStyle=D;
A.lineWidth=this.lineWidth;
}var C=this.parentMap.drawCanvas.context;
if(C){C.fillStyle=B;
C.strokeStyle=D;
C.lineWidth=this.lineWidth;
}};
__l.CanvasControl.prototype.undo=function(){if(__l.Canvas.drawings.length>0){var A=__l.Canvas.drawings.pop();
this.parentMap.removeOverlay(A);
this.parentMap.drawOverlays();
}};
__l.CanvasControl.prototype.setColor=function(I,C){var B;
var H;
if(I){this.lineColor=this.lineColors[C.index];
B=this.linePntr;
H=1;
}else{this.fillColor=this.fillColors[C.index];
B=this.fillPntr;
H=3;
}var G=this.parentMap.canvas.context;
var E=this.parentMap.drawCanvas.context;
var D=(this.lineColor.substring(0,this.lineColor.length-1)+","+this.lineAlpha+")").replace(/rgb\(/,"rgba(");
G.strokeStyle=D;
E.strokeStyle=D;
var F=(this.fillColor.substring(0,this.fillColor.length-1)+","+this.fillAlpha+")").replace(/rgb\(/,"rgba(");
G.fillStyle=F;
E.fillStyle=F;
this.activeTool.style.border="2px solid "+this.lineColor;
var A=C.parentNode.parentNode.parentNode.childNodes[H].childNodes[C.index];
A.appendChild(B);
};
__l.CanvasControl.prototype.subscribeToEvents=function(){};
__l.CanvasControl.prototype.onToolClick=function(A,B){B.setTool(this);
B.toolClick.fire();
};
__l.CanvasControl.prototype.setTool=function(B){if(__l.Canvas.drawPoints.length>0){__l.Canvas.createOverlay();
}var A=false;
if(B==this.waypointTool){B=this.pinTool;
A=true;
}if(B!=this.clearTool&&B!=this.undoTool){for(var D=0;
D<this.leftArea.childNodes.length;
D++){var E=this.leftArea.childNodes[D];
if(E&&E.style&&E.tagName=="IMG"){if(E.style.border.indexOf("black")==-1){E.style.border="2px solid white";
}E.style.cursor=__u.Browser.handCursor;
}}this.activeTool=B;
B.style.border="2px solid "+this.lineColor;
if(this.parentMap){this.removeCursorListeners();
}}var C=this.parentMap;
if(C){if(B==this.mapTool){if(__u.Browser.isIE){C.mapDiv.style.cursor=__u.Browser.openHandCursor;
}else{C.mapDiv.style.cursor="-moz-grab";
}}else{if(B!=this.undoTool&&B!=this.clearTool){C.mapDiv.style.cursor=__u.Browser.defaultCursor;
}}if(B==this.mapTool){C.cursorMode=__l.CursorMode.Pan;
C.drawCanvas.style.display="none";
this.hideDrawTools();
}else{if(B==this.textTool){__u.Image.SetPng(this.cursor,__l.UI.Defaults.SP+"text.png");
this.cursor.fromTop=-10;
this.cursor.fromLeft=10;
C.cursorMode=__l.CursorMode.Text;
C.drawCanvas.style.display="none";
this.hideDrawTools();
}else{if(B==this.pinTool){this.cursor.fromTop=-30;
this.cursor.fromLeft=10;
__u.Image.SetPng(this.cursor,__l.UI.Defaults.SP+(A?"orange_m.png":"blue_m_dot.png"));
C.cursorMode=__l.CursorMode.Marker;
C.drawCanvas.style.display="none";
this.hideDrawTools();
}else{if(B==this.clearTool){C.removeAllOverlays(__l.Canvas.drawings);
__l.Canvas.drawings=[];
}else{if(B==this.undoTool){this.undo();
}else{if(B==this.polyTool){C.mapDiv.style.cursor="crosshair";
C.cursorMode=__l.CursorMode.Draw;
__l.Canvas.shape=__l.Shapes.Polyline;
C.drawCanvas.style.display="";
C.moveView();
this.showDrawTools();
}else{if(B==this.lineTool){__u.Image.SetPng(this.cursor,__l.UI.Defaults.SP+"polytip.gif");
this.cursor.fromTop=-10;
this.cursor.fromLeft=10;
C.mapDiv.style.cursor="crosshair";
C.cursorMode=__l.CursorMode.Draw;
__l.Canvas.shape=__l.Shapes.Line;
C.drawCanvas.style.display="";
C.moveView();
this.showDrawTools();
}else{if(B==this.rectTool){C.mapDiv.style.cursor="crosshair";
C.cursorMode=__l.CursorMode.Draw;
__l.Canvas.shape=__l.Shapes.Rectangle;
C.drawCanvas.style.display="";
C.moveView();
this.showDrawTools();
}else{if(B==this.circleTool){C.mapDiv.style.cursor="crosshair";
C.cursorMode=__l.CursorMode.Draw;
__l.Canvas.shape=__l.Shapes.Circle;
C.drawCanvas.style.display="";
C.moveView();
this.showDrawTools();
}else{if(B==this.polygonTool){__u.Image.SetPng(this.cursor,__l.UI.Defaults.SP+"polytip.gif");
this.cursor.fromTop=-10;
this.cursor.fromLeft=10;
C.mapDiv.style.cursor="crosshair";
C.cursorMode=__l.CursorMode.Draw;
__l.Canvas.shape=__l.Shapes.Polygon;
C.drawCanvas.style.display="";
C.moveView();
this.showDrawTools();
}}}}}}}}}}if((B==this.textTool||B==this.pinTool||B==this.lineTool||B==this.polygonTool)&&this.parentMap){if(B!=this.polygonTool&&B!=this.lineTool){__u.Events.addListener(this.parentMap.mapDiv,"mousemove",this.moveCursor,this);
__u.Events.addListener(this.parentMap.mapDiv,"mouseout",this.hideCursor,this);
}else{__u.Events.addListener(this.parentMap.mapDiv,"mousedown",this.moveCursor,this);
__u.Events.addListener(this.parentMap.mapDiv,"dblclick",this.hideCursor,this);
}}}};
__l.CanvasControl.prototype.showDrawTools=function(){this.colorPicker.style.display="";
};
__l.CanvasControl.prototype.hideDrawTools=function(){this.colorPicker.style.display="none";
};
__l.CanvasControl.prototype.appendTo=function(A){if(A){A.appendChild(this.controlDiv);
A.appendChild(this.colorPicker);
}__l.Canvas.parentMap=this.parentMap;
this.initStyle();
};
__l.CanvasControl.prototype.getImportance=function(){return 9;
};
__l.CanvasControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}var C=__u.Geometry.squeeze({left:0,top:0,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.left,top:C.bottom-28,right:C.right,bottom:C.bottom,opaque:true};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
this.colorPicker.style.top=(A.top-50)+"px";
B.push(A);
};
__l.Canvas={parentMap:null,drawPoints:[],startPos:{x:-1,y:-1},curPos:{x:-1,y:-1},shape:__l.Shapes.Polyline,drawings:[],dx:0,dy:0,getCanvasPos:function(C){var D=__u.Dom.getXY(this.parentMap.canvas);
var B=__u.Events.getPageX(C)-D[0];
var A=__u.Events.getPageY(C)-D[1];
return{x:B,y:A};
},onMouseDown:function(A){A=__u.Events.getEvent(A);
var B=this;
if(this.drawPoints.length>0){return ;
}__d.documentElement.onmousemove=function(C){B.onMouseMove(C);
};
__d.documentElement.onmouseup=function(C){return B.onMouseUp(C);
};
if(this.shape==__l.Shapes.Line||this.shape==__l.Shapes.Polygon){this.parentMap.canvas.context.beginPath();
__d.documentElement.onkeyup=function(C){B.onKeyUp(C);
};
__d.documentElement.ondblclick=function(C){return B.onDblClick(C);
};
}this.drawPoints=[];
this.startPos=this.getCanvasPos(A);
this.drawPoints[0]=this.startPos;
this.curPos=this.startPos;
this.parentMap.drawCanvas.context.moveTo(this.curPos.x,this.curPos.y);
this.parentMap.canvas.context.moveTo(this.curPos.x,this.curPos.y);
},onKeyUp:function(A){A=__u.Events.getEvent(A);
if(A.keyCode==13){this.createOverlay();
}else{if(A.keyCode==27){this.drawPoints=[];
this.clearDraw();
this.parentMap.drawOverlays();
this.removeCanvasMouseListeners();
}}__u.Events.stopPropagation(A);
},onDblClick:function(A){A=__u.Events.getEvent(A);
this.createOverlay();
__u.Events.stopPropagation(A);
},onMouseMove:function(B){this.parentMap.drawCanvas.context.beginPath();
this.parentMap.drawCanvas.context.moveTo(this.curPos.x,this.curPos.y);
var A=this.parentMap.getMousePos(B);
this.dx+=Math.abs(this.curPos.x-A.x);
this.dy+=Math.abs(this.curPos.y-A.y);
this.curPos=A;
switch(this.shape){case __l.Shapes.Line:this.clearDraw();
this.parentMap.drawCanvas.context.moveTo(this.startPos.x,this.startPos.y);
this.parentMap.canvas.context.moveTo(this.startPos.x,this.startPos.y);
this.drawLine(this.curPos);
break;
case __l.Shapes.Polyline:if(this.dx>3||this.dy>3){this.drawPoints.push(this.curPos);
this.drawLine(this.curPos);
this.dx=0;
this.dy=0;
}break;
case __l.Shapes.Polygon:this.clearDraw();
this.parentMap.drawCanvas.context.moveTo(this.startPos.x,this.startPos.y);
this.parentMap.canvas.context.moveTo(this.startPos.x,this.startPos.y);
this.drawLine(this.curPos);
break;
case __l.Shapes.Circle:this.clearDraw();
this.drawCircle(this.startPos,this.curPos);
this.drawPoints[1]=this.curPos;
break;
case __l.Shapes.Rectangle:this.clearDraw();
this.drawRect(this.startPos,this.curPos);
this.drawPoints[1]=this.curPos;
break;
}},onMouseUp:function(A){this.curPos=this.getCanvasPos(A);
if(this.shape==__l.Shapes.Line||this.shape==__l.Shapes.Polygon){var B=this.curPos;
if(this.drawPoints.length==0){this.parentMap.canvas.context.moveTo(B.x,B.y);
}else{this.parentMap.canvas.context.lineTo(B.x,B.y);
this.parentMap.canvas.context.stroke();
}this.drawPoints.push(this.curPos);
this.startPos=this.curPos;
return false;
}else{this.createOverlay();
}},pixToLL:function(G){var B=this.parentMap;
var A=B.getBounds();
var C=[];
for(var E=0;
E<G.length;
E++){var K=G[E];
var J=K.x+A.minX;
var I=K.y+A.minY;
var F=__u.GeoMath.pix2lat(I,B.zoom);
var H=__u.GeoMath.pix2long(J,B.zoom);
var D=new __l.Point(F,H);
C.push(D);
}return C;
},rectBounds:function(A){var F=this.parentMap;
var B=F.getBounds();
var G=__u.GeoMath.pix2lat(A[0].y+B.minY,F.zoom);
var E=__u.GeoMath.pix2long(A[0].x+B.minX,F.zoom);
var D=__u.GeoMath.pix2lat(A[1].y+B.minY,F.zoom);
var C=__u.GeoMath.pix2long(A[1].x+B.minX,F.zoom);
return(new __l.Bounds(Math.min(G,D),Math.min(E,C),Math.max(G,D),Math.max(E,C)));
},circleBounds:function(J){var E=(J[0].x+J[1].x)/2;
var C=(J[0].y+J[1].y)/2;
var L=J[0].x-J[1].x;
var K=J[0].y-J[1].y;
var G=Math.sqrt(L*L+K*K)/2;
var B=this.parentMap;
var A=B.getBounds();
var F=__u.GeoMath.pix2lat(C-G+A.minY,B.zoom);
var I=__u.GeoMath.pix2long(E-G+A.minX,B.zoom);
var D=__u.GeoMath.pix2lat(C+G+A.minY,B.zoom);
var H=__u.GeoMath.pix2long(E+G+A.minX,B.zoom);
return(new __l.Bounds(Math.min(F,D),Math.min(I,H),Math.max(F,D),Math.max(I,H)));
},createOverlay:function(){var A=null;
if(this.drawPoints.length>1){switch(this.shape){case __l.Shapes.Polyline:A=new __l.Polyline(this.pixToLL(this.drawPoints),null,0,null);
break;
case __l.Shapes.Line:A=new __l.Polyline(this.pixToLL(this.drawPoints),null,0,null,true);
break;
case __l.Shapes.Polygon:A=new __l.Polygon(this.pixToLL(this.drawPoints),null,0,null,true);
break;
case __l.Shapes.Circle:A=new __l.Circle(this.circleBounds(this.drawPoints),null,0,null,true);
break;
case __l.Shapes.Rectangle:A=new __l.Rectangle(this.rectBounds(this.drawPoints),null,0,null,true);
break;
}}this.drawPoints=[];
this.removeCanvasMouseListeners();
if(A){__l.UI.hookupShapeEvents(A);
this.parentMap.addOverlay(A);
this.clearDraw();
this.parentMap.drawOverlays();
this.drawings.push(A);
}},removeCanvasMouseListeners:function(){__d.documentElement.onmousemove=null;
__d.documentElement.onmouseup=null;
__d.documentElement.ondblclick=null;
__d.documentElement.onkeyup=null;
},drawLine:function(A){this.parentMap.drawCanvas.context.lineTo(A.x,A.y);
this.parentMap.drawCanvas.context.stroke();
},drawCircle:function(E,A){var D=Math.max(E.x,A.x)-Math.abs(E.x-A.x)/2;
var C=Math.max(E.y,A.y)-Math.abs(E.y-A.y)/2;
var B=this.parentMap.drawCanvas.context;
B.beginPath();
if(__u.Browser.isOpera){B.moveTo(E.x,E.y);
}B.arc(D,C,this.getDistance(E,A)/2,0,Math.PI*2,true);
B.closePath();
B.stroke();
B.beginPath();
if(__u.Browser.isOpera){B.moveTo(E.x,E.y);
}B.arc(D,C,this.getDistance(E,A)/2-B.lineWidth/2,0,Math.PI*2,true);
B.closePath();
B.fill();
},drawRect:function(F,C){var D=this.parentMap.drawCanvas.context;
var B=Math.min(F.x,C.x);
var G=Math.min(F.y,C.y);
var E=Math.abs(C.x-F.x);
var A=Math.abs(C.y-F.y);
D.strokeRect(B,G,E,A);
D.fillRect(B+D.lineWidth/2,G+D.lineWidth/2,E-D.lineWidth,A-D.lineWidth);
},getDistance:function(B,A){return Math.sqrt(Math.pow(B.x-A.x,2)+Math.pow(B.y-A.y,2));
},clear:function(){if(this.parentMap){this.parentMap.canvas.context.beginPath();
this.parentMap.canvas.context.clearRect(0,0,this.parentMap.canvas.width,this.parentMap.canvas.height);
this.parentMap.canvas.context.closePath();
}},clearDraw:function(){if(this.parentMap){this.parentMap.drawCanvas.context.beginPath();
this.parentMap.drawCanvas.context.clearRect(0,0,this.parentMap.drawCanvas.width,this.parentMap.drawCanvas.height);
this.parentMap.drawCanvas.context.closePath();
}}};
__l.SaveControl=function(){this.parentMap=null;
var A=this;
var K=__d.ce("div");
K.id="saveCtrl";
K.className="saveControl";
K.style.zIndex=400;
K.style.position="absolute";
K.closed=false;
K.maxHeight=100;
K.minHeight=15;
var C=__d.ce("table");
var I=__d.ce("tbody");
var F=__d.ce("tr");
var H=__d.ce("td");
var G=__d.ce("td");
var D=__d.ce("td");
C.style.width="100%";
C.style.height="100%";
H.style.width="10px";
H.vAlign="top";
var B=__d.ce("img");
B.src=__l.UI.Defaults.SP+"left.gif";
B.style.marginTop="20px";
B.style.cursor=__u.Browser.handCursor;
B.alt=B.title="Scroll left";
__u.Events.addListener(B,"click",function(L,M){M.tdm.scrollLeft-=110;
},this);
H.appendChild(B);
G.style.width="100%";
G.style.whiteSpace="nowrap";
G.vAlign="top";
D.style.width="10px";
D.vAlign="top";
var J=__d.ce("img");
J.src=__l.UI.Defaults.SP+"right.gif";
J.style.marginTop="20px";
J.style.cursor=__u.Browser.handCursor;
J.alt=J.title="Scroll right";
__u.Events.addListener(J,"click",function(L,M){M.tdm.scrollLeft+=110;
},this);
D.appendChild(J);
F.appendChild(H);
F.appendChild(G);
F.appendChild(D);
I.appendChild(F);
C.appendChild(I);
K.appendChild(C);
var E=__d.ce("div");
E.id="saveCtrlTileDiv";
E.style.width="93%";
E.style.height="95px";
E.style.position=__u.Browser.isIE?"absolute":"relative";
E.style.overflow="hidden";
E.style.border="1px solid silver";
G.appendChild(E);
G.id="saveCtrlTileCell";
this.tdm=E;
this.controlDiv=K;
this.keyTmr=null;
};
__l.SaveControl.prototype=new __l.Control();
__l.SaveControl.prototype.subscribeToEvents=function(){};
__l.SaveControl.prototype.appendTo=function(A){if(A){A.appendChild(this.controlDiv);
}var B=this;
if(__l.Defaults.eraserEnabled){this.render([]);
}else{setTimeout(function(){__l.MyStuff.get(function(C){B.render(C);
});
},250);
}};
__l.SaveControl.prototype.render=function(I){var N=[];
for(var G=0;
G<I.length;
G++){if(!I[G].permalink){N.push(I[G]);
}}I=N;
__u.Dom.removeAllChildNodes(this.tdm);
var H=[1,2,3,4,5,6,7,8,9,10];
var F=__d.ce("table");
F.cellPadding=0;
F.cellSpacing=0;
var M=__d.ce("tbody");
var K=__d.ce("tr");
M.appendChild(K);
F.appendChild(M);
this.tdm.appendChild(F);
for(var G=0;
G<H.length;
G++){var D=__d.ce("td");
D.vAlign="top";
K.appendChild(D);
var E=__d.ce("div");
E.style.position="relative";
D.appendChild(E);
var P=I[G];
var J=__d.ce("img");
J.id="saveTile_"+G;
J.index=G;
var L="";
J.id="save_img_"+G;
if(P&&P.id&&P.thumbUrl){L=P.title;
J.src=this.parentMap.getPrintImageHost()+P.thumbUrl.replace(/__/g,"&").replace("[$iroot]",__l.UI.Defaults.SP)+"&lc=off";
J.alt=J.title="Load "+L;
J.saved=true;
}else{J.src=__l.UI.Defaults.SP+"save-to-map.gif";
J.alt=J.title="Save a snapshot of the current map";
J.saved=false;
}if(P&&P.id){J.saveId=P.id;
}J.style.margin="4px";
J.style.marginBottom="0px";
J.style.cursor=__u.Browser.handCursor;
J.height=70;
J.width=100;
J.loader=__d.ce("img");
J.loader.id="save_img_loader_"+G;
J.loader.onload=function(){var Q=__d.get(this.id.replace(/_loader/,""));
Q.src=this.src;
};
J.loader.onerror=function(){var Q=__d.get(this.id.replace(/_loader/,""));
Q.src=__l.UI.Defaults.SP+"save-to-map.gif";
alert("Could not generate map thumnail.");
};
__u.Events.addListener(J,"click",this.onTileClick,this);
__u.Events.addListener(J,"mousedown",function(){sct(43993,this);
});
var C=__d.ce("div");
C.id="actionTile_"+G;
C.style.width="40px";
C.style.height="20px";
C.style.top=__u.Browser.isIE?"63px":"59px";
C.style.left="4px";
C.style.position="absolute";
C.style.whiteSpace="nowrap";
C.style.zIndex=2;
if(!P||!P.id){C.style.display="none";
}J.action=C;
var O=__d.ce("img");
O.index=G;
O.src=__l.UI.Defaults.SP+"delete-button.gif";
O.width=50;
O.height=11;
O.alt=O.title="Delete";
O.style.cursor=__u.Browser.handCursor;
__u.Events.addListener(O,"click",this.onDeleteClick,this);
var A=__d.ce("img");
A.index=G;
A.src=__l.UI.Defaults.SP+"save-button.gif";
A.style.cursor=__u.Browser.handCursor;
A.alt=A.title="Save again";
A.width=50;
A.height=11;
__u.Events.addListener(A,"click",this.onSaveClick,this);
C.appendChild(A);
C.appendChild(O);
E.appendChild(C);
var B=__u.Dhtml.getEditBox("",97);
B.id="save_title_"+G;
B.style.marginLeft="5px";
B.style.display=J.saved?"":"none";
B.style.padding="0px";
B.value=L;
B.className="doSelect textOverlay";
__u.Events.addListener(B,"selectstart",__u.Events.stopPropagation);
__u.Events.addListener(B,"dblclick",__u.Events.stopPropagation);
__u.Events.addListener(B,"mousemove",__u.Events.stopPropagation);
__u.Events.addListener(B,"focus",function(){__l.Keys.typing=true;
});
__u.Events.addListener(B,"blur",function(){__l.Keys.typing=false;
});
__u.Events.addListener(B,"keyup",function(R,S){R=__u.Events.getEvent(R);
var Q=this;
if(R.keyCode==13){clearTimeout(S.keyTmr);
S.rename(__d.get(Q.id.replace(/_title_/,"_img_")),Q.value);
Q.blur();
}else{if(R.keyCode==27){}else{clearTimeout(S.keyTmr);
S.keyTmr=setTimeout(function(){S.rename(__d.get(Q.id.replace(/_title_/,"_img_")),Q.value);
},3000);
}}__u.Events.stopPropagation(R);
},this);
J.titleBox=B;
E.appendChild(J);
E.appendChild(__d.ce("br"));
E.appendChild(B);
}};
__l.SaveControl.prototype.onTileClick=function(A,B){if(!__l.Defaults.eraserEnabled&&!__u.Browser.supportsCookies()){alert("Please enable your cookies to save maps.");
}else{if(this.saved){B.load(this);
}else{B.save(this);
}}};
__l.SaveControl.prototype.onDeleteClick=function(A,B){B.remove(__d.get("save_img_"+this.index));
};
__l.SaveControl.prototype.onSaveClick=function(A,B){B.save(__d.get("save_img_"+this.index));
};
__l.SaveControl.prototype.remove=function(A){try{var C=A.saveId.replace(/save_img_/,"");
A.action.style.display="none";
A.titleBox.style.display="none";
A.titleBox.value="";
A.saved=false;
A.src=__l.UI.Defaults.SP+"save-to-map.gif";
A.alt=A.title="Save a snapshot of the current map";
A.saveId=undefined;
__l.MyStuff.remove(C);
}catch(B){alert("Could not remove saved map.");
}};
__l.SaveControl.prototype.save=function(F){if(__l.Defaults.eraserEnabled){if(__l.UI){__l.UI.showEraserDialog();
}return ;
}var H=F.titleBox.value;
if(H.length==0){H=__l.UI.getTitle(true);
}F.titleBox.value=H;
F.titleBox.style.display="";
F.src=__l.UI.Defaults.SP+"saving.gif";
var E=this.parentMap.getPrintImagePath(null,null,100,70,40);
try{F.loader.src=this.parentMap.getPrintImageHost()+E.replace("[$iroot]",__l.UI.Defaults.SP)+"&lc=off";
}catch(G){}__l.UI.search.saveMode=true;
for(var D=0;
D<this.parentMap.overlays.length;
D++){var I=this.parentMap.overlays[D];
if(I.id&&I.saved){I.savedToMyStuff=true;
}}var C=__l.UI.serialize(true);
__l.UI.search.render();
var B=F.saveId?F.saveId:"";
var A=__l.UI.map.infoWindow.owner;
if(A){__l.UI.map.infoWindow.setHtml(__l.UI.getBubbleMsg(A));
}__l.MyStuff.save(B,H,E,false,C,function(K,J){F.action.style.display="";
F.saveId=K;
F.shareId=J;
F.saved=true;
F.alt=F.title="Load "+H;
});
};
__l.SaveControl.prototype.load=function(A){var C=A.saveId;
var B=this;
__l.MyStuff.get(function(E){var F=E[0];
if(F){var D=F.data;
__l.UI.search.saveMode=true;
__l.UI.deserialize(D,true);
__l.History.update();
}else{alert("Save item not found in MyStuff.");
}},C);
};
__l.SaveControl.prototype.rename=function(A,B){var C=A.saveId;
__l.MyStuff.rename(C,B,function(){});
};
__l.SaveControl.prototype.share=function(B,A){var C=B.saveId;
__l.MyStuff.share(C,A,function(){});
};
__l.SaveControl.prototype.getImportance=function(){return 10;
};
__l.SaveControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}if(this.controlDiv.style.display=="none"){return ;
}var C=__u.Geometry.squeeze({left:0,top:0,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.left,top:C.bottom-this.controlDiv.maxHeight,right:C.right,bottom:C.bottom,opaque:true};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
this.tdm.style.width=((A.right-A.left)-50)+"px";
B.push(A);
};
__l.ScaleControl=function(){this.textWidth=70;
this.scaleWidth=115;
this.width=this.textWidth+this.scaleWidth;
this.height=27;
var C={tag:"div",attr:{style:{position:"absolute",width:this.width+"px",height:this.height+"px",zIndex:400,display:"none",backgroundColor:"white",MozOpacity:"0.66",opacity:"0.66",filter:"alpha(opacity=66)",border:"1px solid #CBCBCB",textAlign:"center",cursor:__u.Browser.trueDefaultCursor}},kids:{tag:"table",attr:{cellPadding:0,cellSpacing:0},kids:{tag:"tbody",kids:{tag:"tr",kids:[{tag:"td",key:"left",attr:{style:{width:this.textWidth+"px",fontWeight:"bold",fontSize:"11px",textAlign:"center"}},kids:""},{tag:"td",key:"right",style:{align:"center"}}]}}}};
var B={};
this.controlDiv=__u.Dom.createTree(C,B);
this.left=B["left"];
this.right=B["right"];
this.controlDiv.onselectstart=__u.Events.returnFalse;
this.controlDiv.onmousedown=__u.Events.returnFalse;
var A=__d.ce("img");
__u.Image.SetPng(A,__l.Defaults.SP+"scale.png");
A.onmousedown=function(){sct(44059);
};
this.left.onmousedown=function(){sct(44059);
};
this.right.appendChild(A);
};
__l.ScaleControl.prototype=new __l.Control();
__l.ScaleControl.prototype.getImportance=function(){return 3;
};
__l.ScaleControl.prototype.position=function(B){if(!this.isPositionable()){return ;
}var C=__u.Geometry.squeeze({left:0,top:25,right:this.parentMap.viewWidth,bottom:this.parentMap.viewHeight},B);
var A={left:C.right-this.width-5,top:C.top+5,right:C.right-5,bottom:C.top+this.height+5};
this.controlDiv.style.left=A.left+"px";
this.controlDiv.style.top=A.top+"px";
this.controlDiv.style.width=(A.right-A.left)+"px";
this.controlDiv.style.height=(A.bottom-A.top)+"px";
this.controlDiv.style.display="";
B.push(A);
};
__l.ScaleControl.prototype.subscribeToEvents=function(){this.parentMap.zoomChange.subscribe(this.update,this,true);
this.parentMap.mapMove.subscribe(this.update,this,true);
};
__l.ScaleControl.prototype.update=function(){var B=this.parentMap.centerX-this.scaleWidth/2;
var A=B+this.scaleWidth;
var H=this.parentMap.centerY;
var G=this.parentMap.getZoom();
var F=__u.GeoMath.pix2long(B,G);
var E=__u.GeoMath.pix2long(A,G);
var D=__u.GeoMath.pix2lat(H,G);
var C=__u.GeoMath.calculateDistance(D,F,D,E);
this.left.innerHTML=this.getDisplayString(C);
};
__l.ScaleControl.prototype.getDisplayString=function(B){var A=B*0.621371192;
return A<1?this.approximate(A*5280)+" feet":this.approximate(A)+" miles";
};
__l.ScaleControl.prototype.approximate=function(B){var A;
if(B<10){A=__u.Math.Round(B,1);
}else{if(B<100){A=Math.round(B);
}else{if(B<1000){A=(Math.round(B/10)*10);
}else{A=(Math.round(B/100)*100);
}}}return A;
};

__l.DirectionsMode=new function(){this.Driving=0;
this.Walking=1;
};
__l.DirectionsData=function(){this.start=null;
this.end=null;
this.xml=null;
this.html=null;
this.type=__l.DirectionsMode.Driving;
this.time=0;
this.length=0;
};
__l.Proxy=new function(){this.ProxyPath="";
this.geoPath="max";
this.incidentPath="incident";
this.getProxyPath=function(){var A="";
if(__l.Proxy.ProxyPath.length>1){A="http://"+window.location.host+__l.Proxy.ProxyPath;
}return A;
};
this.lookupIncident=function(E,B,C){C=C?C:32000;
var D=E.GetCenterPoint().Lat;
var F=E.GetCenterPoint().Lon;
var A=__l.Proxy.getProxyPath()+__l.Defaults.AMX_HOST+"/"+this.incidentPath+"?lat="+D+"&long="+F;
AjaxRequest.get({"url":A,"onSuccess":function(G){__l.Proxy.lookupIncidentCallBack(E,G,B);
},"timeout":C});
};
this.lookupIncidentCallBack=function(C,B,A){if(B.status==200){if(A){A.call(window,C,B.responseXML);
}}};
this.findAddresses=function(D,B,A){function G(H,I,J){__l.Proxy.findAddressCallBack(H,I,J,true);
if(A<D.length-1){A++;
__l.Proxy.findAddresses(D,I,A);
}}var F=D[A];
var E="sbLocInput_"+A;
var C=__l.UI.map||Page.Map;
if(F.length==0){G(null,B,E);
}else{C.find(F,function(H){G(H,B,E);
});
}};
this.findAddress=function(A,B,D){var C=__l.UI.map||Page.Map;
C.find(A,function(E){__l.Proxy.findAddressCallBack(E,B,D);
});
};
this.findAddressCallBack=function(A,I,C,D){var F=[];
var J=new __l.Point();
if(A!=null){for(var E=0;
E<A.length;
E++){var H=parseFloat(A[E].LatLong.Latitude);
var B=parseFloat(A[E].LatLong.Longitude);
var G=A[E].Name;
F.push(new __l.Point(H,B,G));
}J=F[0];
}if(C!=null){J.id=C;
}if(I){I.call(window,J,F,D);
}};
this.findLocations=function(A,B,E){var C=new VELatLong(A.lat,A.lng);
var D=__l.UI.map||Page.Map;
D.findLocations(C,function(F){__l.Proxy.findLocationsCallBack(F,B,A,E);
});
};
this.findLocationsCallBack=function(A,I,D,C){var F=[];
var J=D;
if(A!=null&&A.length>0){for(var E=0;
E<A.length;
E++){var H=parseFloat(A[E].LatLong.Latitude);
var B=parseFloat(A[E].LatLong.Longitude);
var G=A[E].Name;
F.push(new __l.Point(H,B,G));
}J=F[0];
}else{J.address=J.lat+","+J.lng;
}if(C!=null){J.id=C;
}if(I){I.call(window,J,F);
}};
this.getSatCopy=function(A,F,E,C,D){var B=__l.Proxy.getProxyPath()+__l.Defaults.AMX_HOST+"/satinfo/"+E+"/"+A+"/"+F+"?partner="+__l.Defaults.partnerId+"&qsrc="+__l.Defaults.qsrc;
AjaxRequest.get({"url":B,"onSuccess":function(G){__l.Proxy.getSatCopyCallBack(G,C);
}});
};
this.getSatCopyCallBack=function(B,A){if(B.status==200){var E="";
try{var D=B.responseXML.getElementsByTagName("Copyright");
if(D.length>0){E=D[0].firstChild.nodeValue;
}}catch(C){}if(A){A.call(window,E);
}}};
this.getPointsFromGeoRSS=function(A,C,B,D){D=D?D:30000;
A=__l.Proxy.getProxyPath()+A;
AjaxRequest.get({"url":A,"onSuccess":function(E){__l.Proxy.getPointsFromGeoRSSCallBack(E,C);
},"timeout":D});
};
this.getPointsFromGeoRSSCallBack=function(B,A){if(B.status==200){if(A){A.call(window,__l.Proxy.getPointsFromGeoRSSDoc(B.responseXML));
}}};
this.getPointsFromGeoRSSDoc=function(C){var E=C.documentElement.getElementsByTagName("item");
if(E.length==0){E=C.documentElement.getElementsByTagName("entry");
}var M=[];
if(E.length>0){for(var N=0;
N<E.length;
N++){try{var P=E[N];
var B,R;
if(!__u.Browser.isIE){B=P.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","lat").length>0?P.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","lat")[0].childNodes[0].nodeValue:null;
R=P.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","long").length>0?P.getElementsByTagNameNS("http://www.w3.org/2003/01/geo/wgs84_pos#","long")[0].childNodes[0].nodeValue:null;
}else{B=P.getElementsByTagName("geo:lat").length>0?P.getElementsByTagName("geo:lat")[0].childNodes[0].nodeValue:null;
R=P.getElementsByTagName("geo:long").length>0?P.getElementsByTagName("geo:long")[0].childNodes[0].nodeValue:null;
}var D;
if(!__u.Browser.isIE){D=P.getElementsByTagNameNS("http://www.opengis.net/gml","pos");
}else{D=P.getElementsByTagName("gml:pos");
}if(D.length>0){var I=D[0].childNodes[0].nodeValue;
var H=I.split(" ");
B=H[0];
R=H[1];
}var K=new __l.Point(B,R);
if(K.isValid()){for(var L=0;
L<P.childNodes.length;
L++){var J=P.childNodes[L];
if(J&&J.childNodes[0]){K[J.tagName]=J.childNodes[0].nodeValue;
}}M[N]=K;
}}catch(O){}}}var F=[];
if(!__u.Browser.isIE){F=C.getElementsByTagNameNS("http://www.opengis.net/gml","posList");
}else{F=C.getElementsByTagName("gml:posList");
}if(F.length>0){for(var N=0;
N<F.length;
N++){var A=F[N].childNodes[0].nodeValue;
var Q=A.trim().split(" ");
var G=[];
for(var L=0;
L<Q.length;
L=L+2){var B=Q[L];
var R=Q[L+1];
if(B&&R){if(B.length>0&&R.length>0){G[G.length]=new __l.Point(B,R);
}}}if(G.length>0){M[M.length]=G;
}}}return M;
};
this.generateGeoRss20=function(A){var G="";
var B=new Date().toString();
G+='<feed xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><title>Generated by Ask.com Maps Javascript API</title><link href="http://www.ask.com/maps"/><updated>'+B+"</updated><author><name>Ask.com</name><email>information@ask.com</email></author><id>http://www.ask.com/maps</id>";
var L,C,I;
for(var F=0;
F<A.overlays.length;
F++){var E=A.overlays[F];
if(E.point){var K=E.point;
L=K.title||"";
C=K.link||"";
I=K.description||"";
G+="<entry><title>"+L+'</title><link href="'+C+'"/><id>http://www.ask.com/maps</id><updated>'+B+"</updated><content>"+I+"</content><georss:where><gml:Point><gml:pos>"+K.lat+" "+K.lng+"</gml:pos></gml:Point></georss:where></entry>";
}else{if(E.points){G+="<georss:where><gml:LineString><gml:posList>";
for(var D=0;
D<E.points.length;
D++){var K=E.points[D];
G+=K.lat+" "+K.lng+" ";
}G+="</gml:posList></gml:LineString></georss:where>";
}}}G+="</feed>";
var J;
try{J=__u.Xml.parseFromString(G,"application/xml");
}catch(H){}return J;
};
this.getDirections=function(E,H,J,I,G,D){var F=[];
for(var B=0;
B<E.length;
B++){var K=new Object();
K.Point=new ask.Map.Point(E[B].fullLat,E[B].fullLong);
K.address=E[B].address;
F.push(K);
}var A=__l.UI.map||Page.Map;
var C=A.DirectionManage;
C.DrawDirection(H==__l.DirectionsMode.Driving?VERouteMode.Driving:VERouteMode.Walking,F);
C.OnReady=function(M,L){J.call(window,L);
};
return C;
};
this.getLatNode=function(A){return parseFloat(A.getAttribute("lat"));
};
this.getLongNode=function(A){return parseFloat(A.getAttribute("long"));
};
this.pointsToString=function(C){var A="";
if(C){for(var B=0;
B<C.length;
B++){if(B>0){A+="|";
}A+=C[B].lat+","+C[B].lng;
}}return A;
};
this.getSponsoredResults=function(B,A){var D="bottom";
var C={q:B,ctsppos:D};
AjaxRequest.get({"url":__l.Proxy.getProxyPath()+__l.Defaults.AMX_HOST+"/mapssl","parameters":C,"onSuccess":function(H){if(__d.get("debug")&&_debugEnabled){var I=__d.ce("div");
I.innerHTML=H.responseText;
var F=I.childNodes;
var E;
for(var G=0;
G<F.length;
G++){if(F[G].id=="debug"){E=F[G];
break;
}}if(E){__d.get("debug").innerHTML=E.innerHTML;
I.removeChild(E);
}A.innerHTML=I.innerHTML;
}else{A.innerHTML=H.responseText;
}},"timeout":20000,"onTimeout":function(E){}});
};
};

