function __doPanZoom(_1,_2,_3,_4){
var _5=null;
try{
_5=eval(_1);
}
catch(ex){
}
if(_5==null){
return;
}
var _6=__getMapTools(_2);
if(_6==null){
return;
}
var _7=_6.GetZoom();
switch(_3){
case "ZoomFull":
_5.updateThumb(0);
break;
case "ZoomIn":
_5.updateThumb(_7+1);
break;
case "ZoomOut":
_5.updateThumb(_7-1);
break;
case "SetZoom":
_5.updateThumb(_4);
break;
}
_6[_3](_4);
}
function __UpdateAnimationLayer(_8,_9){
try{
var _a=_8.split("``");
if(_a[0]=="LAYER"){
var _b=__$(_9+"_animdiv");
__clearDiv(_b);
_b.innerHTML=_a[2];
__$(_9+"_animarg").value=_a[1];
}else{
var _c=__$(_9);
__clearDiv(_c);
_c.innerHTML=_a[1];
}
}
catch(e){
}
var _d=__getMapTools(_9);
if(!_d){
return;
}
if(_d.GetEnableAnimation()){
_d.RunAnimationTimer();
}
}
function __UpdateAnimationLayerError(_e,_f){
var map=__getMapTools(_f);
if(!map){
return;
}
if(map.GetEnableAnimation()){
map.RunAnimationTimer();
}
}
function __AspMapTools(){
this.ZOOMFULL=100;
this.PIXELPAN=101;
this.ZOOMIN=102;
this.ZOOMOUT=103;
this.SETZOOM=104;
this.CENTERAT=105;
this.SETSCALE=106;
this.CENTERANDZOOM=107;
this.CENTERANDSCALE=108;
this.RESIZETO=109;
this.mouseMoveHandler=null;
this.panToolHandler=null;
this.pointToolHandler=null;
this.infoToolHandler=null;
this.apiVar=null;
this.Add_MouseMove=function(_11){
this.mouseMoveHandler=_11;
};
this.Remove_MouseMove=function(_12){
this.mouseMoveHandler=null;
};
this.Add_PanToolClick=function(_13){
this.panToolHandler=_13;
};
this.Remove_PanToolClick=function(_14){
this.panToolHandler=null;
};
this.Add_PointTool=function(_15){
this.pointToolHandler=_15;
};
this.Remove_PointTool=function(_16){
this.pointToolHandler=null;
};
this.Add_InfoTool=function(_17){
this.infoToolHandler=_17;
};
this.Remove_InfoTool=function(_18){
this.infoToolHandler=null;
};
this.PanLeft=function(_19){
this.Pan(-this.MapWidth()*_19/100,0);
};
this.PanTop=function(_1a){
this.Pan(0,-this.MapHeight()*_1a/100);
};
this.PanRight=function(_1b){
this.Pan(this.MapWidth()*_1b/100,0);
};
this.PanBottom=function(_1c){
this.Pan(0,this.MapHeight()*_1c/100);
};
this.ZoomFull=function(){
this.ApiCall(this.ZOOMFULL);
};
this.ZoomIn=function(){
this.ApiCall(this.ZOOMIN);
};
this.ZoomOut=function(){
this.ApiCall(this.ZOOMOUT);
};
this.Pan=function(dx,dy){
this.ApiCallXY(this.PIXELPAN,"",dx,dy);
};
this.Refresh=function(){
this.Pan(0,0);
};
this.CenterAt=function(x,y){
this.ApiCallXY(this.CENTERAT,"",x,y);
};
this.CenterAndZoom=function(x,y,_23){
this.ApiCallXY(this.CENTERANDZOOM,_23,x,y);
};
this.CenterAndScale=function(x,y,_26){
this.ApiCallXY(this.CENTERANDSCALE,_26,x,y);
};
this.ResizeTo=function(_27,_28){
if(this.MapWidth()!=_27||this.MapHeight()!=_28){
this.ApiCallXY(this.RESIZETO,"",_27,_28);
}
};
this.Resize=function(){
var d=__$(this.MapID);
if(d.parentNode){
map.resizeTo(__getDivW(d.parentNode),__getDivH(d.parentNode));
}
};
this.SetZoom=function(_2a){
if(this.GetZoom()!=_2a){
this.ApiCall(this.SETZOOM,_2a);
}
};
this.GetZoom=function(){
return this.GetInt("zoom");
};
this.GetZoomLevelCount=function(){
return this.GetInt("zlct");
};
this.GetMapScale=function(){
return this.GetDbl("scl");
};
this.SetMapScale=function(_2b){
this.ApiCall(this.SETSCALE,_2b);
};
this.ApiCall=function(cmd,arg){
this.ApiCallXY(cmd,arg,"","");
};
this.ApiCallXY=function(cmd,arg,x,y){
if(typeof (arg)=="undefined"){
arg="";
}
this.SetApiCall();
this.SubmitTool(cmd,x,y,arg);
};
this.ttimer=null;
this.OnLoad=function(){
if(this.ttimer==null&&this.GetEnableAnimation()){
this.RunAnimationTimer();
}
};
this.RunAnimationTimer=function(){
if(this.GetAnimationInterval()>0){
clearTimeout(this.ttimer);
this.ttimer=null;
this.ttimer=setTimeout(__getMapToolsName(this.MapID)+".DoAnimation()",this.GetAnimationInterval());
}
};
this.DoAnimation=function(){
map_callback(this.UniqueID,__UpdateAnimationLayer,"ANIM",this.MapID,__UpdateAnimationLayerError);
};
this.RefreshAnimationLayer=function(){
if(!this.GetEnableAnimation()){
this.DoAnimation();
}
return false;
};
this.SetAnimationInterval=function(_32){
this.SetInt("animint",_32);
};
this.GetAnimationInterval=function(){
return this.GetInt("animint");
};
this.GetEnableAnimation=function(){
return this.GetBool("at");
};
this.SetEnableAnimation=function(_33){
if(_33!=this.GetEnableAnimation()){
this.SetBool("at",_33);
if(_33){
this.DoAnimation();
}else{
clearTimeout(this.ttimer);
this.ttimer=null;
}
}
return false;
};
this.hspc=0;
this.vspc=0;
this.MapCanvas=null;
this.MapID="";
this.UniqueID="";
this.ZoomBarVar="";
this.TOOL_ZOOMIN=1;
this.TOOL_ZOOMOUT=2;
this.TOOL_CENTER=3;
this.TOOL_PAN=4;
this.TOOL_INFO=5;
this.TOOL_DISTANCE=6;
this.TOOL_QINFO=7;
this.TOOL_POINT=8;
this.TOOL_LINE=9;
this.TOOL_POLYLINE=10;
this.TOOL_RECT=11;
this.TOOL_CIRCLE=12;
this.TOOL_POLYGON=13;
this.isDragging=false;
this.x1=0;
this.y1=0;
this.x2=0;
this.y2=0;
this.prevPanX=0;
this.prevPanY=0;
this.Xpts=null;
this.Ypts=null;
this.rleft=0;
this.rright=0;
this.rtop=0;
this.rbottom=0;
this.isOnMoveInited=false;
this.qInfoX=0;
this.qInfoY=0;
this.SetTool=function(_34){
this.CancelTool();
this.SetMapTool(_34);
this.UpdateCursor();
};
this.SetArgument=function(arg){
this.SetToolArgument(arg);
};
this.GetArgument=function(){
return this.GetToolArgument();
};
this.GetTool=function(){
return this.GetMapTool();
};
this.UpdateCursor=function(){
this.SetCursor(this.GetCursor());
};
this.StartTool=function(x,y){
this.MapCanvas.setStroke(this.LineWidth());
this.MapCanvas.setColor(this.LineColor());
switch(this.GetTool()){
case this.TOOL_POINT:
this.StartPoint(x,y);
break;
case this.TOOL_ZOOMIN:
case this.TOOL_RECT:
this.StartRect(x,y);
break;
case this.TOOL_LINE:
this.StartLine(x,y);
break;
case this.TOOL_PAN:
this.StartPan(x,y);
break;
case this.TOOL_CIRCLE:
this.StartPolyline(x,y);
this.StartCircle(x,y);
break;
case this.TOOL_DISTANCE:
case this.TOOL_POLYLINE:
this.StartPolyline(x,y);
break;
case this.TOOL_POLYGON:
this.StartPolygon(x,y);
break;
case this.TOOL_ZOOMOUT:
this.StartZoomOut(x,y);
break;
case this.TOOL_CENTER:
this.StartCenter(x,y);
break;
case this.TOOL_INFO:
this.StartInfo(x,y);
break;
case this.TOOL_QINFO:
this.StartQuickInfo(x,y);
break;
}
};
this.DragTool=function(x,y){
switch(this.GetTool()){
case this.TOOL_RECT:
case this.TOOL_ZOOMIN:
this.DrawRect(x,y);
break;
case this.TOOL_LINE:
this.DrawLine(x,y);
break;
case this.TOOL_PAN:
this.DrawPan(x,y);
break;
case this.TOOL_CIRCLE:
this.DrawDistance(x,y,false);
this.DrawCircle(x,y,false);
break;
case this.TOOL_POLYLINE:
this.DrawPolyline(x,y);
break;
case this.TOOL_DISTANCE:
this.DrawDistance(x,y,true);
break;
case this.TOOL_POLYGON:
this.DrawPolygon(x,y);
break;
case this.TOOL_INFO:
this.DrawInfo(x,y);
break;
case this.TOOL_QINFO:
this.DrawInfo(x,y);
break;
}
};
this.StopTool=function(x,y){
switch(this.GetTool()){
case this.TOOL_RECT:
this.StopRect();
break;
case this.TOOL_LINE:
this.StopLine();
break;
case this.TOOL_PAN:
this.StopPan();
break;
case this.TOOL_CIRCLE:
this.StopCircle();
this.StopDistance();
break;
case this.TOOL_ZOOMIN:
this.StopZoomIn();
break;
case this.TOOL_INFO:
this.StopInfo();
break;
case this.TOOL_QINFO:
this.StopQuickInfo();
break;
}
};
this.CancelTool=function(){
this.StopDrag();
this.MapCanvas.clear();
};
this.StopCompTool=function(){
switch(this.GetTool()){
case this.TOOL_POLYLINE:
this.StopPolyline();
break;
case this.TOOL_DISTANCE:
this.StopDistance();
break;
case this.TOOL_POLYGON:
this.StopPolygon();
break;
}
};
this.StartPoint=function(x,y){
this.MapCanvas.clear();
this.OnPointTool(x,y);
};
this.StartZoomOut=function(x,y){
this.MapCanvas.clear();
this.OnZoomOutTool(x,y);
};
this.StartCenter=function(x,y){
this.MapCanvas.clear();
this.OnCenterTool(x,y);
};
this.StartInfo=function(x,y){
this.MapCanvas.clear();
if(this.EnablePan()){
this.StartPan(x,y);
}else{
this.OnInfoTool(x,y);
}
};
this.StartQuickInfo=function(x,y){
this.HideInfoWindow();
this.MapCanvas.clear();
if(this.EnablePan()){
this.StartPan(x,y);
}else{
this.OnQuickInfoTool(x,y);
}
};
this.DrawInfo=function(x,y){
this.UpdateDrag(x,y);
if(Math.abs(this.x1-this.x2)>1||Math.abs(this.y1-this.y2)>1){
this.DrawPan(x,y);
}
};
this.StopInfo=function(){
this.StopDrag();
if(Math.abs(this.x1-this.x2)>1||Math.abs(this.y1-this.y2)>1){
this.SetOverrideTool(this.TOOL_PAN);
this.StopPan();
}else{
this.OnInfoTool(this.x1,this.y1);
}
};
this.StopQuickInfo=function(){
this.StopDrag();
if(Math.abs(this.x1-this.x2)>1||Math.abs(this.y1-this.y2)>1){
this.SetOverrideTool(this.TOOL_PAN);
this.StopPan();
}else{
this.OnQuickInfoTool(this.x1,this.y1);
}
};
this.StopZoomIn=function(){
this.StopDrag();
this.MapCanvas.clear();
this.UpdateRect();
if(this.rright-this.rleft>1){
this.OnZoomInRectTool(this.rleft,this.rtop,this.rright,this.rbottom);
}else{
this.OnZoomInTool(this.x1,this.y1);
}
};
this.StartRect=function(x,y){
this.StartDrag(x,y);
this.UpdateRect();
};
this.DrawRect=function(x,y){
this.MapCanvas.clear();
this.UpdateDrag(x,y);
this.UpdateRect();
this.MapCanvas.drawRect(this.rleft,this.rtop,this.rright-this.rleft,this.rbottom-this.rtop);
this.MapCanvas.paint();
};
this.StopRect=function(){
this.StopDrag();
this.MapCanvas.clear();
this.UpdateRect();
if(this.rright-this.rleft>1){
this.OnRectTool(this.rleft,this.rtop,this.rright,this.rbottom);
}
};
this.UpdateRect=function(){
var _4c=this.x1;
var _4d=this.y1;
if(this.x1>this.x2){
this.rright=this.x1;
this.rleft=this.x2;
}else{
this.rleft=this.x1;
this.rright=this.x2;
}
if(this.y1>this.y2){
this.rbottom=this.y1;
this.rtop=this.y2;
}else{
this.rtop=this.y1;
this.rbottom=this.y2;
}
};
this.StartLine=function(x,y){
this.StartDrag(x,y);
};
this.DrawLine=function(x,y){
this.MapCanvas.clear();
this.UpdateDrag(x,y);
this.MapCanvas.drawLine(this.x1,this.y1,this.x2,this.y2);
this.MapCanvas.paint();
};
this.StopLine=function(){
this.StopDrag();
this.MapCanvas.clear();
if(Math.abs(this.x1-this.x2)>1||Math.abs(this.y1-this.y2)>1){
this.OnLineTool(this.x1,this.y1,this.x2,this.y2);
}
};
this.StartPan=function(x,y){
this.HideInfoWindow();
this.StartDrag(x,y);
this.prevPanX=x;
this.prevPanY=y;
};
this.DrawPan=function(x,y){
this.SetPanCursorForInfo();
this.UpdateDrag(x,y);
try{
var img=__$(this.MapID+"_Image");
var _57=(this.x2-this.x1)+"px";
var top=(this.y2-this.y1)+"px";
img.style.left=_57;
img.style.top=top;
var _59=0;
while(true){
img=__$(this.MapID+"wms"+_59);
if(!img){
break;
}
img.style.left=_57;
img.style.top=top;
_59++;
}
_57=(this.x2-this.x1);
top=(this.y2-this.y1);
_59=0;
while(true){
var id=this.MapID+"tile"+_59;
img=__$(id);
if(!img){
break;
}
var _5b=img.offsetTop;
var _5c=img.offsetLeft;
if(!img.getAttribute("itop")){
img.setAttribute("itop",img.offsetTop);
img.setAttribute("ileft",img.offsetLeft);
}else{
_5b=parseInt(img.getAttribute("itop"));
_5c=parseInt(img.getAttribute("ileft"));
}
img.style.left=(_5c+_57)+"px";
img.style.top=(_5b+top)+"px";
_59++;
}
this.PanBackLayer(x-this.prevPanX,y-this.prevPanY);
}
catch(e){
}
this.prevPanX=x;
this.prevPanY=y;
};
this.StopPan=function(){
this.UpdateCursor();
this.StopDrag();
if(Math.abs(this.x1-this.x2)>1||Math.abs(this.y1-this.y2)>1){
this.OnLineTool(this.x1,this.y1,this.x2,this.y2);
}else{
if(this.panToolHandler){
try{
this.panToolHandler(this.ApiVar,this.GetMouseEventArgs(true));
}
catch(e){
}
}
}
};
this.StartCircle=function(x,y){
this.StartDrag(x,y);
};
this.DrawCircle=function(x,y,_61){
if(_61){
this.MapCanvas.clear();
}
this.UpdateDrag(x,y);
var d=this.dist(this.x1,this.y1,this.x2,this.y2);
this.MapCanvas.drawEllipse(this.x1-d,this.y1-d,d*2,d*2);
this.MapCanvas.paint();
};
this.StopCircle=function(){
this.StopDrag();
this.MapCanvas.clear();
if(Math.abs(this.x1-this.x2)>1){
var d=this.dist(this.x1,this.y1,this.x2,this.y2);
this.OnCircleTool(this.x1,this.y1,d);
}
};
this.dist=function(x1,y1,x2,y2){
return Math.round(Math.abs(this.hypot(x1-x2,y1-y2)));
};
this.hypot=function(a,b){
return Math.sqrt((a*a)+(b*b));
};
this.StartPolyline=function(x,y){
if(!this.isDragging){
this.Xpts=new Array();
this.Ypts=new Array();
}
this.StartDrag(x,y);
this.Xpts[this.Xpts.length]=x;
this.Ypts[this.Ypts.length]=y;
};
this.DrawPolyline=function(x,y){
this.MapCanvas.clear();
this.UpdateDrag(x,y);
this.MapCanvas.drawPolyline(this.Xpts,this.Ypts);
this.MapCanvas.drawLine(this.x1,this.y1,this.x2,this.y2);
this.MapCanvas.paint();
};
this.StopPolyline=function(){
this.StopDrag();
this.MapCanvas.clear();
if(this.Xpts.length>1&&this.dist(this.Xpts[0],this.Ypts[0],this.Xpts[1],this.Ypts[1])>1){
this.OnPolylineTool(this.Xpts,this.Ypts);
}
};
this.DrawDistance=function(x,y,_70){
var _71="#000000";
var _72="#FFFFFF";
this.MapCanvas.clear();
this.UpdateDrag(x,y);
this.MapCanvas.drawPolyline(this.Xpts,this.Ypts);
this.MapCanvas.drawLine(this.x1,this.y1,this.x2,this.y2);
var _73=0;
for(var i=0;i<this.Xpts.length-1;i++){
_73+=this.dist(this.Xpts[i],this.Ypts[i],this.Xpts[i+1],this.Ypts[i+1]);
}
_73+=this.dist(this.x1,this.y1,this.x2,this.y2);
_73*=this.mpp();
var top=this.MapHeight()-28;
if((_73/1609.34)>1){
var _76=Math.round(1000*_73/1609.34)/1000;
this.MapCanvas.drawString(_76+" "+this.miles(),1,top,_71,_72);
}else{
_76=Math.round(_73/0.3048);
this.MapCanvas.drawString(_76+" "+this.feet(),1,top,_71,_72);
}
if((_73/1000)>1){
_76=Math.round(1000*_73/1000)/1000;
this.MapCanvas.drawString(_76+" "+this.km(),1,top+14,_71,_72);
}else{
this.MapCanvas.drawString((Math.round(10*_73)/10)+" "+this.meters(),1,top+14,_71,_72);
}
if(_70){
this.MapCanvas.paint();
}
};
this.StopDistance=function(){
this.StopDrag();
this.MapCanvas.clear();
};
this.StartPolygon=function(x,y){
if(!this.isDragging){
this.Xpts=new Array();
this.Ypts=new Array();
}
this.StartDrag(x,y);
this.Xpts[this.Xpts.length]=x;
this.Ypts[this.Ypts.length]=y;
};
this.DrawPolygon=function(x,y){
this.MapCanvas.clear();
this.UpdateDrag(x,y);
var tx=new Array().concat(this.Xpts);
var ty=new Array().concat(this.Ypts);
tx[tx.length]=this.x2;
ty[ty.length]=this.y2;
this.MapCanvas.drawPolygon(tx,ty);
this.MapCanvas.paint();
};
this.StopPolygon=function(){
this.StopDrag();
this.MapCanvas.clear();
if(this.Xpts.length>2&&this.dist(this.Xpts[0],this.Ypts[0],this.Xpts[1],this.Ypts[1])>1){
this.Xpts[this.Xpts.length]=this.Xpts[0];
this.Ypts[this.Ypts.length]=this.Ypts[0];
this.OnPolygonTool(this.Xpts,this.Ypts);
}
};
this.StartDrag=function(x,y){
this.x1=x;
this.y1=y;
this.x2=this.x1+1;
this.y2=this.y1+1;
this.isDragging=true;
};
this.UpdateDrag=function(x,y){
this.x2=x;
this.y2=y;
};
this.StopDrag=function(){
this.isDragging=false;
return true;
};
this.mouseX=0;
this.mouseY=0;
this.IsLeftDown=function(e){
var _82;
if(e.which==null){
_82=(e.button<2)?1:((e.button==4)?2:3);
}else{
_82=(e.which<2)?1:((e.which==2)?2:3);
}
return (_82==1);
};
this.OnMouseDown=function(e){
if(!this.IsLeftDown(e)){
this.CancelTool();
return;
}
this.OnResize();
this.GetImageXY(e);
if(this.mouseX>=0&&this.mouseX<this.MapWidth()&&this.mouseY>=0&&this.mouseY<this.MapHeight()){
this.StartTool(this.mouseX,this.mouseY);
return false;
}
return false;
};
function CallOnMouseMove(){
var t=_85;
var W=t.MapWidth();
var H=t.MapHeight();
if(t.mouseX>W){
t.mouseX=W-1;
}
if(t.mouseY>H){
t.mouseY=H-1;
}
if(t.mouseX<=0){
t.mouseX=1;
}
if(t.mouseY<=0){
t.mouseY=1;
}
if(t.isDragging){
t.DragTool(t.mouseX,t.mouseY);
}
return false;
}
var _88;
var _89;
var _8a=0;
var _85=null;
this.OnMouseMove=function(e){
_85=this;
if(!this.isDragging){
this.RefreshCursor();
this.OnResize();
}
this.GetImageXY(e);
if(this.isDragging){
clearTimeout(_88);
_8a++;
_89=function(){
CallOnMouseMove();
};
if(_8a<=3){
_88=setTimeout(_89,80);
}else{
_89();
_8a=0;
}
}
this.ShowLatLong(true);
return false;
};
this.RefreshCursor=function(){
var _8c=__$(this.MapID+"_rf");
if(_8c==null){
return;
}
if(_8c.value=="1"){
this.UpdateCursor();
_8c.value="0";
}
};
this.OnMouseLeave=function(e){
this.ShowLatLong(false);
return false;
};
this.GetCenterLatLong=function(){
return new AspMap.Point(this.GetDbl("_xd"),this.GetDbl("_yd"));
};
this.GetCenterInMapUnits=function(){
return new AspMap.Point(this.GetDbl("_xu"),this.GetDbl("_yu"));
};
this.GetMouseEventArgs=function(_8e){
var dpp=this.GetDbl("_dpp");
var upp=this.GetDbl("_upp");
var _91=this.GetCenterLatLong();
var lng=_91.x+(this.mouseX-Math.round(this.MapWidth()/2))*dpp;
var lat=_91.y-(this.mouseY-Math.round(this.MapHeight()/2))*dpp;
_91=this.GetCenterInMapUnits();
var x=_91.x+(this.mouseX-Math.round(this.MapWidth()/2))*upp;
var y=_91.y-(this.mouseY-Math.round(this.MapHeight()/2))*upp;
var _96=new AspMap.MouseEventArgs();
_96.x=this.mouseX;
_96.y=this.mouseY;
_96.isInside=_8e;
_96.longitude=lng;
_96.latitude=lat;
_96.mapPoint=new AspMap.Point(x,y);
return _96;
};
this.ShowLatLong=function(_97){
try{
if(this.mouseMoveHandler){
this.mouseMoveHandler(this.ApiVar,this.GetMouseEventArgs(_97));
}
}
catch(ex){
}
};
this.OnMouseOver=function(e){
this.RefreshCursor();
return false;
};
this.OnMouseUp=function(e){
if(this.isDragging){
this.GetImageXY(e);
this.StopTool(this.mouseX,this.mouseY);
}
return false;
};
this.OnDoubleClick=function(e){
var _9b=this.GetTool();
if(this.isDragging){
this.StopCompTool();
}else{
if(_9b==this.TOOL_PAN||_9b==this.TOOL_INFO||_9b==this.TOOL_QINFO){
if(!this.IsLeftDown(e)){
return;
}
this.OnResize();
this.GetImageXY(e);
this.SetOverrideTool(this.TOOL_ZOOMIN);
this.OnZoomInTool(this.mouseX,this.mouseY);
}
}
return false;
};
this.OnKeyDown=function(e){
if(e.keyCode==27){
this.CancelTool();
}
};
this.OnMouseWheel=function(e){
if(this.isDragging||!this.EnableMouseWheel()){
return;
}
this.OnResize();
this.GetImageXY(e);
e=e?e:window.event;
var _9e=e.detail?e.detail*-1:e.wheelDelta/40;
var res=__cancelEvent(e);
this.OnWheel(_9e>0,this.mouseX,this.mouseY);
return res;
};
this.GetImageXY=function(_a0){
if(_a0.pageX){
this.mouseX=_a0.pageX;
this.mouseY=_a0.pageY;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
this.mouseX=_a0.clientX+document.documentElement.scrollLeft-2;
this.mouseY=_a0.clientY+document.documentElement.scrollTop-2;
}else{
this.mouseX=_a0.clientX+document.body.scrollLeft-2;
this.mouseY=_a0.clientY+document.body.scrollTop-2;
}
}
this.mouseX=this.mouseX-this.hspc;
this.mouseY=this.mouseY-this.vspc;
};
this.Init=function(_a1,_a2,_a3){
var _a4=_a1+"_Canvas";
this.MapID=_a1;
this.UniqueID=_a2;
this.ZoomBarVar=_a3;
this.MapCanvas=new jsGraphicsEx(_a4);
this.MapCanvas.setStroke(1);
this.MapCanvas.setColor("#FF0000");
this.MapCanvas.setFont("verdana,geneva,helvetica,sans-serif","12px","font-weight:bold;");
this.UpdateCursor();
};
this.MapWidth=function(){
return parseInt(this.GetMapCanvas().style.width);
};
this.MapHeight=function(){
return parseInt(this.GetMapCanvas().style.height);
};
this.OnResize=function(){
try{
this.vspc=0;
this.hspc=0;
var _a5=this.GetMapCanvas();
do{
this.hspc+=_a5.offsetLeft;
this.vspc+=_a5.offsetTop;
}while((_a5=_a5.offsetParent));
}
catch(ex){
}
};
this.GetMapCanvas=function(){
return __$(this.MapID+"_Canvas");
};
this.GetMapImg=function(){
return __$(this.MapID+"_Image");
};
this.OnPointTool=function(x,y){
var _a8=false;
if(this.pointToolHandler){
try{
_a8=this.pointToolHandler(this.ApiVar,this.GetMouseEventArgs(true));
}
catch(e){
}
}
if(!_a8){
this.Submit(x,y,"");
}
};
this.OnRectTool=function(x1,y1,x2,y2){
this.Submit(this.pack(x1,x2),this.pack(y1,y2),"");
};
this.OnLineTool=function(x1,y1,x2,y2){
this.OnRectTool(x1,y1,x2,y2);
};
this.OnCircleTool=function(x,y,_b3){
this.Submit(x,y,_b3);
};
this.OnPolylineTool=function(_b4,_b5){
this.Submit(_b4.join(";"),_b5.join(";"),"");
};
this.OnPolygonTool=function(_b6,_b7){
this.Submit(_b6.join(";"),_b7.join(";"),"");
};
this.OnZoomInTool=function(x,y){
this.Submit(x,y,"");
};
this.OnZoomInRectTool=function(x1,y1,x2,y2){
this.OnRectTool(x1,y1,x2,y2);
};
this.OnZoomOutTool=function(x,y){
this.Submit(x,y,"");
};
this.OnCenterTool=function(x,y){
this.Submit(x,y,"");
};
this.OnInfoTool=function(x,y){
var _c4=false;
if(this.infoToolHandler){
try{
_c4=this.infoToolHandler(this.ApiVar,this.GetMouseEventArgs(true));
}
catch(e){
}
}
if(!_c4){
this.Submit(x,y,"");
}
};
this.OnWheel=function(_c5,x,y){
if(_c5){
var cx=Math.round(this.MapWidth()/2+(x-this.MapWidth()/2)/2);
var cy=Math.round(this.MapHeight()/2+(y-this.MapHeight()/2)/2);
this.AnimateZoom(x,y,_c5);
this.SubmitTool(this.TOOL_ZOOMIN,cx,cy,"");
}else{
var xy=this.Rotate(this.MapWidth()/2,this.MapHeight()/2,x-this.MapWidth()/2,y-this.MapHeight()/2,180);
this.AnimateZoom(x,y,_c5);
this.SubmitTool(this.TOOL_ZOOMOUT,xy.x,xy.y,"");
}
};
this.AnimateZoom=function(x,y,_cd){
var _ce="";
if(_cd){
_ce="aspmap_whzi";
}else{
_ce="aspmap_whzo";
}
var img=__$(_ce);
if(img){
var ext=__getDivExt(this.MapID);
img.style.left=(ext.left+x-29)+"px";
img.style.top=(ext.top+y-29)+"px";
img.src=img.src;
img.style.display="block";
setTimeout("try{__$('"+_ce+"').style.display = 'none';}catch(e){}",320);
}
};
this.Rotate=function(_d1,_d2,x,y,_d5){
_d5=(_d5)*Math.PI/180;
var px=Math.round(x*Math.cos(_d5)-y*Math.sin(_d5)+_d1);
var py=Math.round(x*Math.sin(_d5)+y*Math.cos(_d5)+_d2);
return {x:px,y:py};
};
this.OnQuickInfoTool=function(x,y){
this.SetCmdParams(this.GetTool(),this.GetArgument(),x,y,"");
this.qInfoX=x;
this.qInfoY=y;
map_callback(this.UniqueID,__showQuickInfo,"QINFO",this);
};
this.HideInfoWindow=function(){
__hideQuickInfo(this.MapID);
};
this.ShowInfo=function(_da){
var _db=__$(this.MapID+"_infodiv");
if(!_db){
return;
}
var _dc=__$(this.MapID+"_infoct");
if(!_dc){
return;
}
var _dd=__$(this.MapID+"_infodivc");
if(!_dd){
return;
}
__hideQuickInfo(this.MapID);
_dd.innerHTML=_da;
var x=this.qInfoX;
var y=this.qInfoY;
var _e0=__getDivW(_db);
var _e1=__getDivH(_db);
var _e2=this.MapWidth();
var _e3=this.MapHeight();
var _e4=12;
var _e5=20;
var _e6=20;
var _e7=0;
var _e8=0;
if(_e0<=_e2){
_e7=x-_e0/2-_e5/2;
if(_e7+_e0>_e2){
var d=_e7+_e0-_e2+1;
if(_e2-x<=_e4){
d-=_e4-(_e2-x)+1;
}
_e7-=d;
}
if(_e7<=0){
var d=Math.abs(_e7);
if(x<=_e5+_e4){
d-=_e5+_e4-x;
}else{
d+=1;
}
_e7+=d;
}
}else{
_e7=x-_e0/2-_e5/2;
if(_e7<=0){
var d=Math.abs(_e7);
if(x<_e5+_e4){
d-=_e5+_e4-x;
}else{
d+=1;
}
_e7+=d;
}else{
_e7=1;
}
}
x-=_e5;
if(((y+_e1+_e6>=_e3)||(y-_e1-_e6>0))&&(y-_e1-_e6)>=0){
_e8=y-_e1-_e6;
y-=22;
}else{
_e8=y+_e6;
}
if(_e8>y){
_dc.src=__$("rtct$").src;
}else{
_dc.src=__$("rbct$").src;
}
_db.style.left=_e7+"px";
_db.style.top=_e8+"px";
_dc.style.left=x+"px";
_dc.style.top=y+"px";
_dc.style.visibility="visible";
_db.style.visibility="visible";
};
this.Submit=function(x,y,arg){
this.HideInfoWindow();
this.SetCmdParams(this.GetTool(),this.GetArgument(),x,y,arg);
__submitMapToolCmd();
};
this.SubmitTool=function(_ed,x,y,arg){
this.HideInfoWindow();
this.SetCmdParams(this.GetTool(),this.GetArgument(),x,y,arg);
this.SetOverrideTool(_ed);
__submitMapToolCmd();
};
this.SetCmdParams=function(_f1,_f2,x,y,arg){
__$(this.MapID+"_arg").value=arg;
__$(this.MapID+"_targ").value=_f2;
__$(this.MapID+"_tool").value=_f1;
__$(this.MapID+"_x").value=x;
__$(this.MapID+"_y").value=y;
};
this.SetInfoCursor=function(){
this.GetMapCanvas().style.cursor="help";
};
this.SetCrossCursor=function(){
this.GetMapCanvas().style.cursor="crosshair";
};
this.SetPanCursor=function(){
this.GetMapCanvas().style.cursor="move";
};
this.SetPanCursorForInfo=function(){
var c=this.GetStr("_curspan");
if(c.length>0){
this.GetMapCanvas().style.cursor=c;
}
};
this.SetDefCursor=function(){
this.GetMapCanvas().style.cursor="default";
};
this.GetCursor=function(){
return __$(this.MapID+"_curs").value;
};
this.SetCursor=function(c){
if(c==null){
return;
}
__$(this.MapID+"_curs").value=c;
if(c.length>0){
this.GetMapCanvas().style.cursor=c;
return;
}
var _f8=this.GetTool();
if(_f8==this.TOOL_CENTER){
this.SetCrossCursor();
}else{
if(_f8==this.TOOL_PAN){
this.SetPanCursor();
}else{
if(_f8==this.TOOL_INFO||_f8==this.TOOL_QINFO){
this.SetInfoCursor();
}else{
this.SetDefCursor();
}
}
}
};
this.GetMapTool=function(){
return parseInt(__$(this.MapID+"_tool").value);
};
this.SetMapTool=function(_f9){
__$(this.MapID+"_tool").value=_f9;
};
this.SetOverrideTool=function(_fa){
__$(this.MapID+"_otool").value=_fa;
};
this.SetApiCall=function(){
__$(this.MapID+"_api").value="1";
};
this.SetToolArgument=function(arg){
__$(this.MapID+"_targ").value=arg;
};
this.GetToolArgument=function(){
return __$(this.MapID+"_targ").value;
};
this.mpp=function(){
return parseFloat(__$(this.MapID+"_mpp").value);
};
this.miles=function(){
return __$(this.MapID+"_mis").value;
};
this.feet=function(){
return __$(this.MapID+"_fts").value;
};
this.km=function(){
return __$(this.MapID+"_kms").value;
};
this.meters=function(){
return __$(this.MapID+"_mts").value;
};
this.LineWidth=function(){
return parseInt(__$(this.MapID+"_tlw").value);
};
this.LineColor=function(){
return __$(this.MapID+"_tlc").value;
};
this.EnablePan=function(){
return __$(this.MapID+"_enpan").value=="1";
};
this.EnableMouseWheel=function(){
return __$(this.MapID+"_emw").value=="1";
};
this.BackLayerService=function(){
var s=__$(this.MapID+"blservice");
if(s){
return s.value;
}
return null;
};
this.BackLayerType=function(){
var s=__$(this.MapID+"bltype");
if(s){
return parseInt(s.value);
}
return 0;
};
this.BackLayerVisible=function(){
var s=__$(this.MapID+"blvisible");
if(s){
return s.value=="1";
}
return false;
};
this.GetDbl=function(_ff){
return parseFloat(this.GetStr(_ff));
};
this.SetDbl=function(_100,_101){
this.SetStr(_100,_101);
};
this.GetBool=function(_102){
return this.GetStr(_102)=="1";
};
this.SetBool=function(_103,_104){
this.SetStr(_103,_104?"1":"0");
};
this.GetInt=function(_105){
return parseInt(this.GetStr(_105));
};
this.SetInt=function(_106,_107){
this.SetStr(_106,Math.round(_107));
};
this.GetStr=function(_108){
return __$(this.MapID+_108).value;
};
this.SetStr=function(_109,_10a){
__$(this.MapID+_109).value=_10a;
};
this.pack=function(a,b){
return (a+";"+b);
};
this.backLayerDiv=null;
this.backLayer=null;
this.InitBackLayerDiv=function(){
var _10d=document.createElement("div");
_10d.style.position="absolute";
_10d.id=this.MapID+"bglayer";
this.InitBackLayerSize(_10d);
_10d.style.zIndex="180";
_10d.style.visibility="hidden";
document.body.appendChild(_10d);
this.backLayerDiv=_10d;
var _10e=this.BackLayerService();
if(_10e){
if(_10e=="google"){
this.backLayer=new AspMapGM(this.backLayerDiv,this.BackLayerType());
}else{
if(_10e=="ve"){
this.backLayer=new AspMapVE(this.backLayerDiv,this.BackLayerType());
}
}
if(this.backLayer.IsValid()){
this.backLayer.CenterAndZoom(this.GetCenterLatLong(),this.GetZoom());
if(this.BackLayerVisible()){
_10d.style.visibility="visible";
}
}else{
this.backLayer=null;
}
}
};
this.UpdateBackLayer=function(){
if(this.backLayer){
if(this.BackLayerVisible()){
this.backLayerDiv.style.visibility="visible";
}else{
this.backLayerDiv.style.visibility="hidden";
}
this.backLayer.SetMapType(this.BackLayerType());
this.backLayer.CenterAndZoom(this.GetCenterLatLong(),this.GetZoom());
}
};
this.PanBackLayer=function(dx,dy){
if(this.backLayer){
this.backLayer.Pan(dx,dy);
}
};
this.ResizeBackLayer=function(){
if(this.backLayerDiv){
this.InitBackLayerSize(this.backLayerDiv);
if(this.backLayer){
this.backLayer.Resize(this.MapWidth(),this.MapHeight());
}
}
};
this.InitBackLayerSize=function(div){
var ext=__getDivExt(this.MapID);
div.style.left=ext.left+"px";
div.style.top=ext.top+"px";
div.style.width=this.MapWidth()+"px";
div.style.height=this.MapHeight()+"px";
};
this.load=function(){
this.InitBackLayerDiv();
};
this.pageLoaded=function(_113,args){
this.ResizeBackLayer();
this.UpdateBackLayer();
};
this.resize=function(e){
this.ResizeBackLayer();
};
__addHandlerCtx(window,"load",this);
__addHandlerCtx(window,"resize",this);
try{
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(__getAjaxEventCtx(this,"pageLoaded"));
}
catch(ex){
}
}
function AspMapGM(div,_117){
this.mapObj=null;
this.dragObj=null;
this.IsValid=function(){
return (this.mapObj!=null);
};
this.CenterAndZoom=function(_118,zoom){
if(!this.IsValid()){
return;
}
try{
this.mapObj.setCenter(new GLatLng(_118.y,_118.x),zoom);
}
catch(e){
}
};
this.Pan=function(dx,dy){
if(!this.IsValid()){
return;
}
try{
this.dragObj.moveBy(new GSize(dx,dy));
}
catch(e){
}
};
this.SetMapType=function(type){
if(!this.IsValid()){
return;
}
try{
switch(type){
case 0:
this.mapObj.setMapType(G_NORMAL_MAP);
break;
case 1:
this.mapObj.setMapType(G_SATELLITE_MAP);
break;
case 2:
this.mapObj.setMapType(G_HYBRID_MAP);
break;
case 3:
this.mapObj.setMapType(G_PHYSICAL_MAP);
break;
}
}
catch(e){
}
};
this.Resize=function(_11d,_11e){
if(!this.IsValid()){
return;
}
try{
this.mapObj.checkResize();
}
catch(e){
}
};
try{
this.mapObj=new GMap2(div);
this.SetMapType(_117);
if(typeof this.mapObj.getDragObject=="function"){
this.dragObj=this.mapObj.getDragObject();
}
}
catch(e){
this.mapObj=null;
}
}
function AspMapVE(div,_120){
this.mapObj=null;
this.dragObj=null;
this.IsValid=function(){
return (this.mapObj!=null);
};
this.CenterAndZoom=function(_121,zoom){
if(!this.IsValid()){
return;
}
try{
this.mapObj.SetCenterAndZoom(new VELatLong(_121.y,_121.x),zoom+1);
}
catch(e){
}
};
this.Pan=function(dx,dy){
if(!this.IsValid()){
return;
}
try{
this.mapObj.vemapcontrol.PanMap(-dx,-dy);
}
catch(e){
}
};
this.SetMapType=function(type){
if(!this.IsValid()){
return;
}
try{
switch(type){
case 0:
this.mapObj.SetMapStyle(VEMapStyle.Road);
break;
case 1:
this.mapObj.SetMapStyle(VEMapStyle.Aerial);
break;
case 2:
this.mapObj.SetMapStyle(VEMapStyle.Hybrid);
break;
}
}
catch(e){
}
};
this.Resize=function(_126,_127){
if(!this.IsValid()){
return;
}
try{
this.mapObj.Resize(_126,_127);
}
catch(e){
}
};
try{
this.mapObj=new VEMap(div.id);
if(this.mapObj!=null){
try{
this.mapObj.LoadMap(null,null,null,true);
this.mapObj.AttachEvent("onmousedown",function(){
return true;
});
}
catch(e){
}
this.SetMapType(_120);
this.mapObj.HideDashboard();
}
}
catch(e){
this.mapObj=null;
}
}
function AspMapZoomBar(_128,_129,_12a,_12b,_12c,pos){
this.mapID=_129;
this.clientID=_128;
this.showBar=_12c;
this.levelCount=_12a;
this.levelH=_12b;
this.drag=false;
this.pos=pos;
this.mousedown=function(e){
if(!this.showBar){
return true;
}
if(e.preventDefault){
e.preventDefault();
}
this.drag=true;
return false;
};
this.mousemove=function(e){
if(!this.drag||!this.showBar){
return true;
}
this.moveThumb(e);
return false;
};
this.mouseup=function(e){
if(!this.drag||!this.showBar){
return true;
}
this.drag=false;
var _131=this.moveThumb(e);
if(_131>=0){
var map=__getMapTools(this.mapID);
if(!map){
return false;
}
map.SetZoom(_131);
}
return false;
};
this.resize=function(e){
if(this.drag||!this.showBar){
return true;
}
var ext=__getDivExt(this.mapID);
if(!ext){
return true;
}
var div=__$(this.clientID);
div.style.top=ext.top+2+"px";
if(this.pos==1){
div.style.left=ext.left+2+"px";
}else{
div.style.left=ext.right-__getDivW(div)-2+"px";
}
div.style.visibility="visible";
return true;
};
this.load=function(e){
this.resize();
return true;
};
this.moveThumb=function(e){
e=e||window.event;
var _138=this.getMouseY(this.barID(),e);
var barH=__getDivH(__$(this.barID()));
var _13a=0;
if(_138<=0){
_13a=this.levelCount-1;
}else{
if(_138>=barH){
_13a=0;
}else{
_13a=this.mouseToLevel(_138);
}
}
if(_13a<0||_13a>=this.levelCount){
return -1;
}
this.updateThumb(_13a);
return _13a;
};
this.updateThumb=function(_13b){
if(_13b<0||_13b>=this.levelCount){
return;
}
var _13c=__$(this.thumbID());
if(!_13c){
return;
}
var _13d=__getDivH(_13c);
_13c.style.top=(this.levelCount-_13b-1)*this.levelH-Math.round((_13d-this.levelH)/2)+"px";
};
this.mouseToLevel=function(_13e){
return this.levelCount-Math.floor(_13e/this.levelH)-1;
};
this.getMouseY=function(_13f,ev){
var _141=__$(_13f);
if(!_141){
return 0;
}
var top=0,y=0;
while(_141.offsetParent){
top+=_141.offsetTop;
_141=_141.offsetParent;
}
top+=_141.offsetTop;
var _144=__$(this.clientID);
top+=Math.round((_144.offsetHeight-_144.clientHeight)/2);
ev=ev||window.event;
if(ev.pageY){
y=ev.pageY;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
y=ev.clientY+document.documentElement.scrollTop-document.documentElement.clientTop;
}else{
y=ev.clientY+document.body.scrollTop-document.body.clientTop;
}
}
return y-top;
};
this.thumbID=function(){
return this.clientID+"_th";
};
this.barID=function(){
return this.clientID+"_bar";
};
this.pageLoaded=function(_145,args){
var _147=__getMapTools(this.mapID);
if(_147==null){
return;
}
this.updateThumb(_147.GetZoom());
};
if(this.showBar){
__addHandlerCtx(document.body,"mousemove",this);
__addHandlerCtx(document.body,"mouseup",this);
__addHandlerCtx(__$(this.thumbID()),"mousedown",this);
}
if(this.pos>0){
__addHandlerCtx(window,"load",this);
__addHandlerCtx(window,"resize",this);
this.resize(null);
}
try{
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(__getAjaxEventCtx(this,"pageLoaded"));
}
catch(ex){
}
}
function __selectMapTool(_148,_149,_14a,arg){
if(_14a==null){
return;
}
var _14c=__$(_148+"_tbutt");
if(_14c==null){
return;
}
var _14d=__$(_14c.value);
var _14e=__getMapTools(_148);
if(_14e==null){
return;
}
_14e.SetTool(_149);
_14e.SetArgument(arg);
var attr=_14a.getAttribute("curs");
if(attr!=null){
_14e.SetCursor(attr);
}
if(_14d){
var attr=_14d.getAttribute("normimg");
if(attr!=null){
_14d.src=attr;
}
attr=_14d.getAttribute("normbord");
if(attr!="notset"){
_14d.style.borderStyle=attr;
}
}
attr=_14a.getAttribute("selimg");
if(attr!=null){
_14a.src=attr;
}
attr=_14a.getAttribute("selbord");
if(attr!="notset"){
_14a.style.borderStyle=attr;
}
_14c.value=_14a.id;
}
function __showQuickInfo(_150,_151){
if(!_150||_150.length==0||!_151){
return;
}
_151.ShowInfo(_150);
}
function __hideQuickInfo(_152){
try{
__$(_152+"_infodiv").style.visibility="hidden";
__$(_152+"_infoct").style.visibility="hidden";
}
catch(e){
}
}
function __$(id){
if(id==null||id.length==0){
return null;
}
var elem=(document.getElementById?document.getElementById(id):document.all?document.all[id]:null);
if(elem==null){
var _155=document.getElementsByName(id);
if(_155!=null){
elem=_155[0];
}
}
return elem;
}
function __getDivExt(_156){
var _157=__$(_156);
if(!_157){
return null;
}
var top=0,left=0;
var div=_157;
while(_157.offsetParent){
top+=_157.offsetTop;
left+=_157.offsetLeft;
_157=_157.offsetParent;
}
top+=_157.offsetTop;
left+=_157.offsetLeft;
return {left:left,top:top,right:left+__getDivW(div),bottom:top+__getDivH(div)};
}
function __getDivW(el){
return (el?(el.offsetWidth||el.style.pixelWidth||0):0);
}
function __getDivH(el){
return (el?(el.offsetHeight||el.style.pixelHeight||0):0);
}
function __clearDiv(elem){
if(elem){
while(elem.hasChildNodes()){
elem.removeChild(elem.firstChild);
}
elem.innerHTML="";
}
}
function __cancelEvent(e){
e=e?e:window.event;
if(e.stopPropagation){
e.stopPropagation();
}
if(e.preventDefault){
e.preventDefault();
}
e.cancelBubble=true;
e.cancel=true;
e.returnValue=false;
return false;
}
function __MWFF(_15f,_160){
var el=__$(_15f);
if(!el){
return;
}
if(el.addEventListener){
el.addEventListener("DOMMouseScroll",_160,false);
}
}
function __addHandler(el,_163,_164){
if(!el){
return;
}
if(el.addEventListener){
el.addEventListener(_163,_164,false);
}else{
if(el.attachEvent){
el.attachEvent("on"+_163,_164);
}else{
el["on"+_163]=_164;
}
}
}
function __addHandlerCtx(el,_166,_167){
var _168=__getHandlerCtx(_167,_166);
__addHandler(el,_166,_168);
}
function __getHandlerCtx(_169,_16a){
return (function(e){
return _169[_16a](e);
});
}
function __getAjaxEventCtx(_16c,_16d){
return (function(_16e,args){
return _16c[_16d](_16e,args);
});
}
function __getMapTools(_170){
var _171=null;
try{
_171=eval(_170.toLowerCase()+"_tools");
}
catch(ex){
}
return _171;
}
function __getMapToolsName(_172){
return _172.toLowerCase()+"_tools";
}
var jg_ok,jg_ie,jg_fast,jg_dom,jg_moz;
function chkDHTM(x,i){
x=document.body||null;
jg_ie=x&&typeof x.insertAdjacentHTML!="undefined"&&document.createElement;
jg_dom=(x&&!jg_ie&&typeof x.appendChild!="undefined"&&typeof document.createRange!="undefined"&&typeof (i=document.createRange()).setStartBefore!="undefined"&&typeof i.createContextualFragment!="undefined");
jg_fast=jg_ie&&document.all&&!window.opera;
jg_moz=jg_dom&&typeof x.style.MozOpacity!="undefined";
jg_ok=!!(jg_ie||jg_dom);
}
function pntCnvDom(){
var x=this.wnd.document.createRange();
var _176=this.cnv();
x.setStartBefore(_176);
x=x.createContextualFragment(jg_fast?this.htmRpc():this.htm);
if(_176){
_176.appendChild(x);
}
this.htm="";
}
function pntCnvIe(){
var _177=this.cnv();
if(_177){
_177.insertAdjacentHTML("BeforeEnd",jg_fast?this.htmRpc():this.htm);
}
this.htm="";
}
function pntDoc(){
this.wnd.document.write(jg_fast?this.htmRpc():this.htm);
this.htm="";
}
function pntN(){
}
function mkDiv(x,y,w,h){
this.htm+="<div style=\"position:absolute;"+"left:"+x+"px;"+"top:"+y+"px;"+"width:"+w+"px;"+"height:"+h+"px;"+"clip:rect(0,"+w+"px,"+h+"px,0);"+"background-color:"+this.color+(!jg_moz?";overflow:hidden":"")+";\"></div>";
}
function mkDivIe(x,y,w,h){
this.htm+="%%"+this.color+";"+x+";"+y+";"+w+";"+h+";";
}
function mkDivPrt(x,y,w,h){
this.htm+="<div style=\"position:absolute;"+"border-left:"+w+"px solid "+this.color+";"+"left:"+x+"px;"+"top:"+y+"px;"+"width:0px;"+"height:"+h+"px;"+"clip:rect(0,"+w+"px,"+h+"px,0);"+"background-color:"+this.color+(!jg_moz?";overflow:hidden":"")+";\"></div>";
}
var regex=/%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;
function htmRpc(){
return this.htm.replace(regex,"<div style=\"overflow:hidden;position:absolute;background-color:"+"$1;left:$2;top:$3;width:$4;height:$5\"></div>\n");
}
function htmPrtRpc(){
return this.htm.replace(regex,"<div style=\"overflow:hidden;position:absolute;background-color:"+"$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1\"></div>\n");
}
function mkLin(x1,y1,x2,y2){
if(x1>x2){
var _x2=x2;
var _y2=y2;
x2=x1;
y2=y1;
x1=_x2;
y1=_y2;
}
var dx=x2-x1,dy=Math.abs(y2-y1),x=x1,y=y1,_18e=(y1>y2)?-1:1;
if(dx>=dy){
var pr=dy<<1,pru=pr-(dx<<1),p=pr-dx,ox=x;
while(dx>0){
--dx;
++x;
if(p>0){
this.mkDiv(ox,y,x-ox,1);
y+=_18e;
p+=pru;
ox=x;
}else{
p+=pr;
}
}
this.mkDiv(ox,y,x2-ox+1,1);
}else{
var pr=dx<<1,pru=pr-(dy<<1),p=pr-dy,oy=y;
if(y2<=y1){
while(dy>0){
--dy;
if(p>0){
this.mkDiv(x++,y,1,oy-y+1);
y+=_18e;
p+=pru;
oy=y;
}else{
y+=_18e;
p+=pr;
}
}
this.mkDiv(x2,y2,1,oy-y2+1);
}else{
while(dy>0){
--dy;
y+=_18e;
if(p>0){
this.mkDiv(x++,oy,1,y-oy);
p+=pru;
oy=y;
}else{
p+=pr;
}
}
this.mkDiv(x2,oy,1,y2-oy+1);
}
}
}
function mkLin2D(x1,y1,x2,y2){
if(x1>x2){
var _x2=x2;
var _y2=y2;
x2=x1;
y2=y1;
x1=_x2;
y1=_y2;
}
var dx=x2-x1,dy=Math.abs(y2-y1),x=x1,y=y1,_19e=(y1>y2)?-1:1;
var s=this.stroke;
if(dx>=dy){
if(dx>0&&s-3>0){
var _s=(s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy)/dx;
_s=(!(s-4)?Math.ceil(_s):Math.round(_s))+1;
}else{
var _s=s;
}
var ad=Math.ceil(s/2);
var pr=dy<<1,pru=pr-(dx<<1),p=pr-dx,ox=x;
while(dx>0){
--dx;
++x;
if(p>0){
this.mkDiv(ox,y,x-ox+ad,_s);
y+=_19e;
p+=pru;
ox=x;
}else{
p+=pr;
}
}
this.mkDiv(ox,y,x2-ox+ad+1,_s);
}else{
if(s-3>0){
var _s=(s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy)/dy;
_s=(!(s-4)?Math.ceil(_s):Math.round(_s))+1;
}else{
var _s=s;
}
var ad=Math.round(s/2);
var pr=dx<<1,pru=pr-(dy<<1),p=pr-dy,oy=y;
if(y2<=y1){
++ad;
while(dy>0){
--dy;
if(p>0){
this.mkDiv(x++,y,_s,oy-y+ad);
y+=_19e;
p+=pru;
oy=y;
}else{
y+=_19e;
p+=pr;
}
}
this.mkDiv(x2,y2,_s,oy-y2+ad);
}else{
while(dy>0){
--dy;
y+=_19e;
if(p>0){
this.mkDiv(x++,oy,_s,y-oy+ad);
p+=pru;
oy=y;
}else{
p+=pr;
}
}
this.mkDiv(x2,oy,_s,y2-oy+ad+1);
}
}
}
function mkOv(left,top,_1a9,_1aa){
var a=(++_1a9)>>1,b=(++_1aa)>>1,wod=_1a9&1,hod=_1aa&1,cx=left+a,cy=top+b,x=0,y=b,ox=0,oy=b,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1),w,h;
while(y>0){
if(st<0){
st+=bb2*((x<<1)+3);
tt+=bb4*(++x);
}else{
if(tt<0){
st+=bb2*((x<<1)+3)-aa4*(y-1);
tt+=bb4*(++x)-aa2*(((y--)<<1)-3);
w=x-ox;
h=oy-y;
if((w&2)&&(h&2)){
this.mkOvQds(cx,cy,x-2,y+2,1,1,wod,hod);
this.mkOvQds(cx,cy,x-1,y+1,1,1,wod,hod);
}else{
this.mkOvQds(cx,cy,x-1,oy,w,h,wod,hod);
}
ox=x;
oy=y;
}else{
tt-=aa2*((y<<1)-3);
st-=aa4*(--y);
}
}
}
w=a-ox+1;
h=(oy<<1)+hod;
y=cy-oy;
this.mkDiv(cx-a,y,w,h);
this.mkDiv(cx+ox+wod-1,y,w,h);
}
function mkOv2D(left,top,_1bf,_1c0){
var s=this.stroke;
_1bf+=s+1;
_1c0+=s+1;
var a=_1bf>>1,b=_1c0>>1,wod=_1bf&1,hod=_1c0&1,cx=left+a,cy=top+b,x=0,y=b,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1);
if(s-4<0&&(!(s-2)||_1bf-51>0&&_1c0-51>0)){
var ox=0,oy=b,w,h,pxw;
while(y>0){
if(st<0){
st+=bb2*((x<<1)+3);
tt+=bb4*(++x);
}else{
if(tt<0){
st+=bb2*((x<<1)+3)-aa4*(y-1);
tt+=bb4*(++x)-aa2*(((y--)<<1)-3);
w=x-ox;
h=oy-y;
if(w-1){
pxw=w+1+(s&1);
h=s;
}else{
if(h-1){
pxw=s;
h+=1+(s&1);
}else{
pxw=h=s;
}
}
this.mkOvQds(cx,cy,x-1,oy,pxw,h,wod,hod);
ox=x;
oy=y;
}else{
tt-=aa2*((y<<1)-3);
st-=aa4*(--y);
}
}
}
this.mkDiv(cx-a,cy-oy,s,(oy<<1)+hod);
this.mkDiv(cx+a+wod-s,cy-oy,s,(oy<<1)+hod);
}else{
var _a=(_1bf-(s<<1))>>1,_b=(_1c0-(s<<1))>>1,_x=0,_y=_b,_aa2=(_a*_a)<<1,_aa4=_aa2<<1,_bb2=(_b*_b)<<1,_bb4=_bb2<<1,_st=(_aa2>>1)*(1-(_b<<1))+_bb2,_tt=(_bb2>>1)-_aa2*((_b<<1)-1),pxl=new Array(),pxt=new Array(),_pxb=new Array();
pxl[0]=0;
pxt[0]=b;
_pxb[0]=_b-1;
while(y>0){
if(st<0){
pxl[pxl.length]=x;
pxt[pxt.length]=y;
st+=bb2*((x<<1)+3);
tt+=bb4*(++x);
}else{
if(tt<0){
pxl[pxl.length]=x;
st+=bb2*((x<<1)+3)-aa4*(y-1);
tt+=bb4*(++x)-aa2*(((y--)<<1)-3);
pxt[pxt.length]=y;
}else{
tt-=aa2*((y<<1)-3);
st-=aa4*(--y);
}
}
if(_y>0){
if(_st<0){
_st+=_bb2*((_x<<1)+3);
_tt+=_bb4*(++_x);
_pxb[_pxb.length]=_y-1;
}else{
if(_tt<0){
_st+=_bb2*((_x<<1)+3)-_aa4*(_y-1);
_tt+=_bb4*(++_x)-_aa2*(((_y--)<<1)-3);
_pxb[_pxb.length]=_y-1;
}else{
_tt-=_aa2*((_y<<1)-3);
_st-=_aa4*(--_y);
_pxb[_pxb.length-1]--;
}
}
}
}
var ox=-wod,oy=b,_oy=_pxb[0],l=pxl.length,w,h;
for(var i=0;i<l;i++){
if(typeof _pxb[i]!="undefined"){
if(_pxb[i]<_oy||pxt[i]<oy){
x=pxl[i];
this.mkOvQds(cx,cy,x,oy,x-ox,oy-_oy,wod,hod);
ox=x;
oy=pxt[i];
_oy=_pxb[i];
}
}else{
x=pxl[i];
this.mkDiv(cx-x,cy-oy,1,(oy<<1)+hod);
this.mkDiv(cx+ox+wod,cy-oy,1,(oy<<1)+hod);
ox=x;
oy=pxt[i];
}
}
this.mkDiv(cx-a,cy-oy,1,(oy<<1)+hod);
this.mkDiv(cx+ox+wod,cy-oy,1,(oy<<1)+hod);
}
}
function mkRect(x,y,w,h){
var s=this.stroke;
this.mkDiv(x,y,w,s);
this.mkDiv(x+w,y,s,h);
this.mkDiv(x,y+h,w+s,s);
this.mkDiv(x,y+s,s,h-s);
}
function jsgFont(){
this.PLAIN="font-weight:normal;";
this.BOLD="font-weight:bold;";
this.ITALIC="font-style:italic;";
this.ITALIC_BOLD=this.ITALIC+this.BOLD;
this.BOLD_ITALIC=this.ITALIC_BOLD;
}
var Font=new jsgFont();
function jsgStroke(){
this.DOTTED=-1;
}
var Stroke=new jsgStroke();
function jsGraphicsEx(cnv,wnd){
this.setColor=new Function("arg","this.color = arg.toLowerCase();");
this.setStroke=function(x){
this.stroke=x;
if(!(x+1)){
}else{
if(x-1>0){
this.drawLine=mkLin2D;
this.mkOv=mkOv2D;
this.drawRect=mkRect;
}else{
this.drawLine=mkLin;
this.mkOv=mkOv;
this.drawRect=mkRect;
}
}
};
this.setPrintable=function(arg){
this.printable=arg;
if(jg_fast){
this.mkDiv=mkDivIe;
this.htmRpc=arg?htmPrtRpc:htmRpc;
}else{
this.mkDiv=arg?mkDivPrt:mkDiv;
}
};
this.setFont=function(fam,sz,sty){
this.ftFam=fam;
this.ftSz=sz;
this.ftSty=sty||Font.PLAIN;
};
this.drawPolyline=this.drawPolyLine=function(x,y){
for(var i=x.length-1;i;){
--i;
this.drawLine(x[i],y[i],x[i+1],y[i+1]);
}
};
this.fillRect=function(x,y,w,h){
this.mkDiv(x,y,w,h);
};
this.drawPolygon=function(x,y){
this.drawPolyline(x,y);
this.drawLine(x[x.length-1],y[x.length-1],x[0],y[0]);
};
this.drawEllipse=this.drawOval=function(x,y,w,h){
this.mkOv(x,y,w,h);
};
this.drawString=function(txt,x,y,_201,_202){
this.htm+="<div style=\"position:absolute;white-space:nowrap;"+"left:"+x+"px;"+"top:"+y+"px;"+"font-family:"+this.ftFam+";"+"font-size:"+this.ftSz+";"+"color:"+_201+";"+"background-color:"+_202+";"+this.ftSty+"\">"+txt+"</div>";
};
this.clear=function(){
this.htm="";
__clearDiv(this.cnv());
};
this.mkOvQds=function(cx,cy,x,y,w,h,wod,hod){
var xl=cx-x,xr=cx+x+wod-w,yt=cy-y,yb=cy+y+hod-h;
if(xr>xl+w){
this.mkDiv(xr,yt,w,h);
this.mkDiv(xr,yb,w,h);
}else{
w=xr-xl+w;
}
this.mkDiv(xl,yt,w,h);
this.mkDiv(xl,yb,w,h);
};
this.setStroke(1);
this.setFont("verdana,geneva,helvetica,sans-serif","12px",Font.PLAIN);
this.color="#000000";
this.htm="";
this.wnd=wnd||window;
this.cnvID=cnv;
if(!jg_ok){
chkDHTM();
}
if(jg_ok){
if(cnv){
if(typeof (cnv)=="string"){
this.cont=document.all?(this.wnd.document.all[cnv]||null):document.getElementById?(this.wnd.document.getElementById(cnv)||null):null;
}else{
if(cnv==window.document){
this.cont=document.getElementsByTagName("body")[0];
}else{
this.cont=cnv;
}
}
this.paint=jg_dom?pntCnvDom:pntCnvIe;
}else{
this.paint=pntDoc;
}
}else{
this.paint=pntN;
}
this.setPrintable(false);
this.cnv=function(){
var _20f=__$(this.cnvID);
var _210=_20f.getElementsByTagName("DIV");
if(_210==null){
return _20f;
}
return _210[0];
};
}
function CompInt(x,y){
return (x-y);
}
function map_enableAutoRefresh(){
alert("The map_enableAutoRefresh() function has been deprecated. Use the Map.set_enableAnimation property.");
}
function map_setAnimationInterval(){
alert("The map_setAnimationInterval() function has been deprecated. Use the Map.set_animationInterval property.");
}
function map_refreshAnimationLayer(){
alert("The map_refreshAnimationLayer() function has been deprecated. Use the Map.refreshAnimationLayer method.");
}

