


$a=109801.71;
$b=3779.52438465144;
$c=6378137;
$d=new Array();
$e='http://192.168.1.1/';
$f='http://www.qcjw.cn/11map/';
$g='./';
$h=false;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function Point3($M,$1D,$0V,$1E,$1F,$1G){    
    this.label=$1E;
    this.detail=$1F;
    this.type="Point";
    this.latlng=$M;
    this.lat=$M.lat;
    this.lng=$M.lng;
    this.labelpath=$1G;
    this.div=new Div(0,0,null,null).get();
    this.div.style.zIndex=$1D;
    this.style=this.div.style;
    if(this.detail){
          if(typeof this.label!="undefined")
          {
            var $0r=this.label.length*15+40;
              if($0r<180){
              $0r=180;
          };
                   
        this.div.detail=new FloatDialog(20,10,$0r,this.label,this.detail);
       
        this.div.detail.get().onmouseover=function(){
            this.depth=this.parentNode.style.zIndex;
            this.parentNode.style.zIndex=10000;
        };
        this.div.detail.get().onmouseout=function(){
            this.parentNode.style.zIndex=this.depth;
        };
        this.div.detail.style.zIndex=10000;
        this.div.detail.hide();
        this.div.appendChild(this.div.detail.get());
         }  
    };
    
    if(this.labelpath){        
        this.labeldiv=new Div(-4,-8,this.label.length*15+40,17).get();
        this.labeldiv.style.zIndex=$1D;
        this.labeldiv.innerHTML='<table border=0 cellspacing=0 cellpadding=0><tr><td><img src='+this.labelpath+'/label1.gif></td><td style="background-image:url('+this.labelpath+'/label2.gif);background-repeat:repeat-x;color:FF0000;font-size:12px;cursor:default" >'+$1E+'</td><td><img src='+this.labelpath+'/label3.gif></td></tr></table>';
        this.div.appendChild(this.labeldiv);
        if(this.div.detail){
            
            this.labeldiv.onmouseover=function(){
                this.pin=false;
                if(this.parentNode.style.zIndex!=10000){
                    this.oldIndex=this.parentNode.style.zIndex;
                };
                this.parentNode.style.zIndex=10000;
                if(!this.parentNode.detail.get().pin){
                    this.parentNode.detail.get().style.left=20;
                    this.parentNode.detail.get().style.top=10;
                };
                this.parentNode.detail.show();
            };
            this.labeldiv.onmouseout=function(){
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.style.zIndex=this.oldIndex;
                    this.parentNode.detail.hide();
                }
            };
            this.labeldiv.onclick=function(){
                this.pin=true;
                this.parentNode.detail.get().pin=true;
            }
        }
    }
    else{
         
        this.img=new MyImage2(0,0,$0V).get();
        this.img.style.zIndex=$1D;
        this.img.onload=function(){
            this.style.top=-this.height; 
            // window.open("http://map.11th-games.org.cn/chy/chy.html");           
        };
        this.img.style.top=-this.img.height;
        this.div.appendChild(this.img);
        if(this.div.detail){
       
            this.img.onclick=function(){      
                
                
                //修改的代码
                window.open($1F);	
                //alert('该地区网站尚未开通');
            };
            this.img.onmouseout=function(){
                this.parentNode.style.zIndex=this.depth;
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.detail.hide();
                }
            }
        }
    };
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Point';
    };
    this.showDetail=function(){
        if(this.detail){
        
            this.pin=true;
            this.div.detail.get().pin=true;
            this.div.detail.show();
            
        }
    };
    this.hideDetail=function(){
        if(this.detail){
            this.pin=false;
            this.div.detail.get().pin=false;
            this.div.detail.hide();
        }
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};


/////////////////////////////////////////////////////////////////////////////////////////////////////////

function Point2($M,$1D,$0V,$1E,$1F,$1G){    
    this.label=$1E;
    this.detail=$1F;
    this.type="Point";
    this.latlng=$M;
    this.lat=$M.lat;
    this.lng=$M.lng;
    this.labelpath=$1G;
    this.div=new Div(0,0,null,null).get();
    this.div.style.zIndex=$1D;
    this.style=this.div.style;
    if(this.detail){
        var $0r=this.label.length*15+40;
        if($0r<180){
            $0r=180;
        };
        this.div.detail=new FloatDialog(20,10,$0r,this.label,this.detail);
       
        this.div.detail.get().onmouseover=function(){
            this.depth=this.parentNode.style.zIndex;
            this.parentNode.style.zIndex=10000;
        };
        this.div.detail.get().onmouseout=function(){
            this.parentNode.style.zIndex=this.depth;
        };
        this.div.detail.style.zIndex=10000;
        this.div.detail.hide();
        this.div.appendChild(this.div.detail.get());
    };
    
    if(this.labelpath){
        this.labeldiv=new Div(-4,-8,this.label.length*15+40,17).get();
        this.labeldiv.style.zIndex=$1D;
        this.labeldiv.innerHTML='<table border=0 cellspacing=0 cellpadding=0><tr><td><img src='+this.labelpath+'/label1.gif></td><td style="background-image:url('+this.labelpath+'/label2.gif);background-repeat:repeat-x;color:FF0000;font-size:12px;cursor:default" >'+$1E+'</td><td><img src='+this.labelpath+'/label3.gif></td></tr></table>';
        this.div.appendChild(this.labeldiv);
        if(this.div.detail){
            this.labeldiv.onmouseover=function(){
                this.pin=false;
                if(this.parentNode.style.zIndex!=10000){
                    this.oldIndex=this.parentNode.style.zIndex;
                };
                this.parentNode.style.zIndex=10000;
                if(!this.parentNode.detail.get().pin){
                    this.parentNode.detail.get().style.left=20;
                    this.parentNode.detail.get().style.top=10;
                };
                this.parentNode.detail.show();
            };
            this.labeldiv.onmouseout=function(){
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.style.zIndex=this.oldIndex;
                    this.parentNode.detail.hide();
                }
            };
            this.labeldiv.onclick=function(){
                this.pin=true;
                this.parentNode.detail.get().pin=true;
            }
        }
    }
    else{
        this.img=new MyImage(0,0,$0V).get();
        this.img.style.zIndex=$1D;
        this.img.onload=function(){
            this.style.top=-this.height; 
            // window.open("http://map.11th-games.org.cn/chy/chy.html");           
        };
        this.img.style.top=-this.img.height;
        this.div.appendChild(this.img);
        if(this.div.detail){
       
            this.img.onclick=function(){          
                
                //修改的代码
                window.open($1F);	
            };
			this.img.title=$1E;
            this.img.onmouseout=function(){
                this.parentNode.style.zIndex=this.depth;
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.detail.hide();
                }
            }
        }
    };
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Point';
    };
    this.showDetail=function(){
        if(this.detail){
        
            this.pin=true;
            this.div.detail.get().pin=true;
            this.div.detail.show();
            
        }
    };
    this.hideDetail=function(){
        if(this.detail){
            this.pin=false;
            this.div.detail.get().pin=false;
            this.div.detail.hide();
        }
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};


function mapEncoding($n,$o){
    var $p=72;
    var $q=0;
    var $r=72;
    var $s=72;
    var $t=24;
    var $u=24;
    var $v='';
    var d1=0;
    var d2=0;
    var $w=($o-$p)*$a;
    var $x=($n-$q)*$a;
    for(var i=4;i>=0;i--){
        $v=$v+Math.floor($w/(grid10w*Math.pow(10,i)))+Math.floor(offsetLat/($s*Math.pow(10,i)));
        d1=($w/(grid10w*Math.pow(10,i)))-Math.floor(offsetLng/($r*Math.pow(10,i)));
        $w=d1*($r*Math.pow(10,i));
        d2=($x/(grid10h*Math.pow(10,i)))-Math.floor(offsetLat/($s*Math.pow(10,i)));
        $x=d2*($s*Math.pow(10,i));
    };
    $v=$v+((Math.floor($w/grid9w)+1)+(Math.floor(offsetLat/grid9h)*3));
    return $v;
};
function mapDecoding($v){
    if($v.length!=11){
        throw new $y('试图使用非法的经纬度编码，位数为：'+$v.length);
    };
    var $p=72;
    var $q=0;
    var $r=72;
    var $s=72;
    var $t=24;
    var $u=24;
    var $n=null;
    var $o=null;
    var n=null;
    $w=parseInt($v.charAt(0),10)*$r*Math.pow(10,4)+parseInt($v.charAt(2),10)*$r*Math.pow(10,3)+parseInt($v.charAt(4),10)*$r*Math.pow(10,2)+parseInt($v.charAt(6),10)*$r*10+parseInt($v.charAt(8),10)*$r;
    $x=parseInt($v.charAt(1),10)*$s*Math.pow(10,4)+parseInt($v.charAt(3),10)*$s*Math.pow(10,3)+parseInt($v.charAt(5),10)*$s*Math.pow(10,2)+parseInt($v.charAt(7),10)*$s*10+parseInt($v.charAt(9),10)*$s;
    if(parseInt($v.charAt(10))==0){
        $x=$x+($s/2);
        $w=$w+($r/2);
    }
    else{
        if((parseInt($v.charAt(10))-3)/3<=0){
            n=0;
        }
        else if((parseInt($v.charAt(10),10)-3)/3<=1&&(parseInt(code.charAt(10),10)-3)/3>0){
            n=1;
        }
        else if((parseInt($v.charAt(10),10)-3)/3<=3&&(parseInt(code.charAt(10),10)-3)/3>1){
            n=2;
        };
        $x=$x+$u*(n+1)-$u/2;
        $w=$w+(parseInt($v.charAt(10),10)-3*n)*$t-$t/2;
    };
    $o=($w/$a)+$p;
    $n=($x/$a)+$q;
    return new LatLng($n,$o);
};
function encoding($n,$o){
    var $z=596;
    var $A=parseInt(parseFloat($n)*100000);
    var $B=parseInt(parseFloat($o)*100000);
    var $C=($B-$A+parseInt($z)).toString(16);
    var $D=($B+$A).toString(16);
    var $E='';
    for(var i=0;i<$C.length;i++){
        var $F=parseInt($C.charAt(i),16);
        $E+=((($F>=10)?($F+7):$F)+10).toString(36);
    };
    $E+='z';
    for(var i=0;i<$D.length;i++){
        var $F=parseInt($D.charAt(i),16);
        $E+=((($F>=10)?($F+7):$F)+10).toString(36);
    };
    return $E.toUpperCase();
};
function decoding($v){
    try
    {
    var $z=596;
    var $G=-1;
    var $H=0;
    var $I='';
    for(var i=0;i<$v.length;i++){
        var $J=parseInt($v.charAt(i),36)-10;
        if($J>=10){
            $J=$J-7;
        };
        $I+=($J).toString(36);
        if($J>$H){
            $G=i;
            $H=$J;
        }
    };
    var $K=parseInt($I.substring(0,$G),16);
    var $L=parseInt($I.substring($G+1),16);
    var $M=new Array();
    $M[0]=($K+$L-parseInt($z))/2;
    $M[1]=($L-$M[0])/100000.0;
    $M[0]/=100000.0;
    return new LatLng($M[1],$M[0]);
    }
    catch(e)
    {}
};
function setRTimeout($U,$V,$W,$X){
    if($X){
        if($U){
window.setTimeout(function(){
    $V.apply($U,$X);
}
,$W);
}
}
else{
if($U){
window.setTimeout(function(){
    $V.apply($U);
}
,$W);
}
}
};
/*function distanceBetween($Y,$Z){
    return Math.floor(Math.sqrt((Math.abs($Y.lat-$Z.lat)*(Math.PI/180)*$c)*(Math.abs($Y.lat-$Z.lat)*(Math.PI/180)*$c)+(Math.abs($Y.lng-$Z.lng)*(Math.PI/180)*$c)*(Math.abs($Y.lng-$Z.lng)*(Math.PI/180)*$c)));
};*/
function distanceBetween($Y,$Z){
    return Math.floor(Math.sqrt((Math.abs($Y.lat-$Z.lat)*111262)*(Math.abs($Y.lat-$Z.lat)*111262)+(Math.abs($Y.lng-$Z.lng)*88858)*(Math.abs($Y.lng-$Z.lng)*88858)));
};
function getLineDistance($Y,$Z){
   // return Math.floor(Math.sqrt((Math.abs($Y.lat-$Z.lat)*(Math.PI/180)*$c)*(Math.abs($Y.lat-$Z.lat)*(Math.PI/180)*$c)+(Math.abs($Y.lng-$Z.lng)*(Math.PI/180)*$c)*(Math.abs($Y.lng-$Z.lng)*(Math.PI/180)*$c)));
   return Math.floor(Math.sqrt((Math.abs($Y.lat-$Z.lat)*111262)*(Math.abs($Y.lat-$Z.lat)*111262)+(Math.abs($Y.lng-$Z.lng)*88858)*(Math.abs($Y.lng-$Z.lng)*88858)));
};
function getTriangleArea($00,$01,$02){
    var a=getLineDistance($00,$01);
    var b=getLineDistance($01,$02);
    var c=getLineDistance($02,$00);
    var p=(a+b+c)/2;
    var $03=Math.sqrt(p*(p-a)*(p-b)*(p-c));
    return Math.round($03);
};
function getPolygonArea($04){
    var $03=0;
    for(var $05=1;$05<$04.length-3;$05++){
        assert($04[$05].toString()=='LatLng','计算面积的数组元素一定要是LatLng类型');
        $03+=getTriangleArea($04[0],$04[$05],$04[$05+1]);
    };
    return $03;
};
function getPathDistance($04){
    var $06=0;
    for(var $07=0;$07<$04.length-1;$07++){
        $06+=distanceBetween($04[$07],$04[$07+1]);
    };
    return $06;
};
function degreeFromDistance($08){
    return Math.round($08/$a*100000)/100000;
};

function getQueryString($0b){
    var $0c="";
    var s=location.search.replace("?","");
    if(s==""){
        return "";
    };
    s=s.split("&");
    for(var i=0;i<s.length;i++){
        if(s[i].toUpperCase().indexOf($0b.toUpperCase()+"=")==0){
            $0c+=(($0c==""?"":", ")+s[i].substr(s[i].indexOf("=")+1,s[i].length));
        }
    };
    return $0c;
};
function getHashString($0b){
    var $0c="";
    var s=location.hash.replace("#","");
    if(s==""){
        return "";
    };
    s=s.split("&");
    for(var i=0;i<s.length;i++){
        if(s[i].toUpperCase().indexOf($0b.toUpperCase()+"=")==0){
            $0c+=(($0c==""?"":", ")+s[i].substr(s[i].indexOf("=")+1,s[i].length));
        }
    };
    return $0c;
};
function assert($0d,$0e){
    if(!$h){
        return;
    };
    for($0f=0;$0f<$0d.length;$0f++){
        if(!$0d[$0f]){
            var $0g='<table border=1 width=100% style="font-size:12px" align="left"><caption><span style="font-size:18px;background-Color:#FFFF00">系统因ASSERT语句举报异常而中断："<b>';
            $0g+=$0e?$0e:'未知';
            $0g+='</b>"，调用堆栈列举如下:</span></caption>\n';
            $0g+='<tr bgcolor="#BBCCDD"><td>序号</td><td>调用堆栈</td></tr>';
            var $V=assert;
            var $0h=0;
            while($V.caller){
                $0g+='<tr onmouseover="this.style.backgroundColor=\'#$0i\'" onmouseout="this.style.backgroundColor=\'#$0j\'"><td>'+$0h+'</td><td><pre>'+$V.caller.toString()+'</pre></td></tr>';
                $0h++;
                $V=$V.caller;
            };
            $0g+='</table>';
            document.body.innerHTML='';
            document.body.innerHTML=$0g;
            break;
        }
    }
};
function Record($0k){
    this.node=$0k;
    this.toString=function(){
        return 'Record';
    };
    this.getHTML=function(){
        var $0g="读取详情时出现错误，请刷新页面重试。";
        if(!$0k){
            return $0g;
        };
        var $0l='<table bgcolor="#FFFFFF" style="border:2px solid #DDDDDD">';
        for($0m=0;$0m<$0k.childNodes.length;$0m++){
            var $0n=$0k.childNodes[$0m].tagName;
            var $0o='&nbsp;';
            if($0k.childNodes[$0m].childNodes.length>0){
                $0o=$0k.childNodes[$0m].firstChild.nodeValue;
            };
            $0l+='<tr><td bgcolor="#AAAAAA">'+$0n+'</td><td>'+$0o+'</td></tr>';
        };
        $0l+='</table>';
        return $0l;
    }
};
function DepthHandler($0p){
    this.depth=$0p;
    this.next=function(){
        this.depth++;
        return this.depth;
    };
    this.toString=function(){
        return 'DepthHandler';
    }
};
function DropList($0q,top,$0r,$0s){
    this.listItems=new Array();
    this.select=document.createElement('Select');
    this.style=this.select.style;
    this.style.position='absolute';
    this.style.visibility='inherit';
    this.style.left=$0q;
    this.style.top=top;
    this.style.width=$0r;
    this.style.fontSize=12;
    this.size=0;
    if($0s){
        this.size=$0s;
    };
    this.select.size=this.size;
    this.selectedIndex=-1;
    this.selectedValue=null;
    this.selectedText='';
    this.toString=function(){
        return 'DropList';
    };
    this.get=function(){
        return this.select;
    };
    this.addListItem=function($0t,$0u){
        var op=document.createElement('Option');
        op.text=$0t;
        op.value=$0u;
        op.richvalue=$0u;
        this.listItems[this.listItems.length]=op;
        this.select.options.add(op);
        if(this.select.options.length==1){
            this.selectedText=$0t;
            this.selectedValue=$0u;
            this.selectedIndex=this.select.selectedIndex;
        }
    };
    this.clear=function(){
        for(var i=0;i<this.listItems.length;i++){
            this.select.options.remove(this.listItems[i]);
        };
        this.listItems=new Array();
    };
    this.getValue=function(){
        if(this.select.selectedIndex==-1){
            return null;
        };
        return this.select.options[this.select.selectedIndex].value;
    };
    this.getRichValue=function(){
        if(this.select.selectedIndex==-1){
            return null;
        };
        return this.select.options[this.select.selectedIndex].richvalue;
    };
    this.getText=function(){
        return this.select.options[this.select.selectedIndex].text;
    };
    this.select.root=this;
    this.select.onchange=function(){
        if(this.root.selectedIndex==this.selectedIndex){
            return;
        }
        else{
            this.root.selectedIndex=this.selectedIndex;
            this.root.selectedText=this.options[this.selectedIndex].text;
            this.root.selectedValue=this.options[this.selectedIndex].richvalue;
            this.root.notify('onselectchanged');
        }
    };
    this.onselectchanged=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onselectchanged':
				/**/if($0v.onselectchanged)
				{
					this.onselectchanged[this.onselectchanged.length]=$0v;
				}
				else{
					window.status=this.toString()+':不合法的'+$0w+'事件对象';
				};
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onselectchanged':for(var i=0;
            i<this.onselectchanged.length;
            i++){
                if(this.onselectchanged[i].onselectchanged){
                    this.onselectchanged[i].onselectchanged();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};
function Div($0q,top,$0r,$0x){
    this.div=document.createElement("Div");
    this.div.align='left';
    this.style=this.div.style;
    this.style.position="absolute";
    this.style.fontSize=12;
    if($0q){
        this.style.left=$0q;
    }
    else{
        this.style.left=0;
    };
    if(top){
        this.style.top=top;
    }
    else{
        this.style.top=0;
    };
    if($0r){
        this.style.width=$0r;
    };
    if($0x){
        this.style.height=$0x;
    };
    this.style.visibility='inherit';
    this.div.unselectable='on';
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Div';
    }
};
function MyImage($0q,top,$0y){
    this.img=new Image();
    this.style=this.img.style;
    if($0q){
        this.style.left=$0q;
    };
    if(top){
        this.style.top=top;
    };
    //alert($0y);
    if($0y){
        this.img.src=$0y;
    };
    this.style.position='absolute';
    this.style.visibility='inherit';
    this.get=function(){
        return this.img;
    };
    this.toString=function(){
        return 'MyImage';
    };
    this.img.onerror=function(){
        if(this.parentNode){
            this.parentNode.removeChild(this);
        }
    };
    this.hide=function(){
        this.style.visibility='hidden';
    };
    this.show=function(){
        this.style.visibility='visible';
    }
};

function MyImage2($0q,top,$0y){
    this.img=new Image();
    this.style=this.img.style;
    if($0q){
        this.style.left=$0q;
    };
    if(top){
        this.style.top=top;
    };
    //alert($0y);
  
    if($0y){
        this.img.src=$0y;
    };
   
    
    this.style.position='absolute';
    this.style.visibility='inherit';
    this.get=function(){
        return this.img;
    };
    this.toString=function(){
        return 'MyImage';
    };
    this.img.onerror=function(){
        if(this.parentNode){
            this.parentNode.removeChild(this);
        }
    };
    this.hide=function(){
        this.style.visibility='hidden';
    };
    this.show=function(){
        this.style.visibility='visible';
    }
};



function Bounds($0z,$0A){
    this.leftbottom=$0z;
    this.righttop=$0A;
    this.startLat=$0z.lat;
    this.startLng=$0z.lng;
    this.endLat=$0A.lat;
    this.endLng=$0A.lng;
    this.toString=function(){
        return 'Bounds';
    }
};
function Label($0q,top,$0t){
    this.label=document.createElement('Label');
    this.style=this.label.style;
    this.style.position='absolute';
    this.style.left=$0q;
    this.style.top=top;
    this.label.innerHTML=$0t;
    this.style.fontSize=12;
    this.toString=function(){
        return 'Label';
    };
    this.get=function(){
        return this.label;
    };
    this.label.root=this;
    this.label.onclick=function(){
        this.root.notify('onclicked');
    };
    this.getText=function(){
        return this.label.innerText;
    };
    this.setText=function($0t){
        this.label.innerText=$0t;
    };
    this.onclicked=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onclicked':if($0v.onclicked){
                this.onclicked[this.onclicked.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onclicked':for(var i=0;
            i<this.onclicked.length;
            i++){
                if(this.onclicked[i].onclicked){
                    this.onclicked[i].onclicked();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};
function LatLng($n,$o){
    this.toString=function(){
        return 'LatLng';
    };
    //alert($n);
    $n=Math.round($n*100000)/100000;
    $o=Math.round($o*100000)/100000;
    if($n>=-90&&$n<=90){
        this.lat=$n;
    }
    else{
        window.status='试图使用纬度'+$n+'建立非法的'+this.toString()+'对象';
        return;
    };
    if($o>=-180&&$o<=180){
        this.lng=$o;
    }
    else{
        window.status='试图使用经度'+$o+'建立非法的'+this.toString()+'对象';
        return;
    }
};
function Pixel($0q,top){
    this.left=$0q;
    this.top=top;
    this.toString=function(){
        return 'Pixel';
    }
};
function MyImageButton($0q,top,$0r,$0x,$0y){
    this.toString=function(){
        return 'MyImageButton';
    };
    this.button=document.createElement('img');
    this.style=this.button.style;
    this.style.position='absolute';
    this.style.cursor='hand';
    this.style.fontSize='12px';
    this.style.left=$0q;
    this.style.top=top;
    this.style.width=$0r;
    this.button.width=$0r;
    this.style.height=$0x;
    this.button.height=$0x;
    this.button.src=$0y;
    this.get=function(){
        return this.button;
    }
};
function Table(){
    this.table=document.createElement('Table');
    this.table.cellPadding=0;
    this.table.cellSpacing=0;
    this.style=this.table.style;
    this.get=function(){
        return this.table;
    };
    this.toString=function(){
        return 'Table';
    };
    this.clearRows=function(){
        for(var $0B=0;$0B<this.table.rows.length;$0B++){
            this.table.deleteRow(this.table.rows[$0B]);
        }
    }
};
function TBody(){
    this.tbody=document.createElement('TBody');
    this.style=this.tbody.style;
    this.get=function(){
        return this.tbody;
    };
    this.toString=function(){
        return 'TBody';
    }
};
function Td(){
    this.td=document.createElement('td');
    this.td.style.height=20;
    this.td.style.vAlign='top';
    this.style=this.td.style;
    this.get=function(){
        return this.td;
    };
    this.toString=function(){
        return 'Td';
    }
};
function TextField($0q,top,$0r,$0u){
    this.defaultvalue=$0u;
    this.textfield=document.createElement('Input');
    this.textfield.type='text';
    this.style=this.textfield.style;
    this.style.position='absolute';
    this.textfield.value=$0u;
    this.oldValue=$0u;
    this.style.left=$0q;
    this.style.top=top;
    this.style.fontSize='12px';
    this.style.border='1px solid #CCCCCC';
    this.style.backgroundColor='#F8F8F8';
    this.textfield.width=$0r;
    this.textfield.size=Math.round($0r/6);
    this.recentdownkey=-1;
    this.recentupkey=-1;
    this.onkeystopped=new Array();
    this.onleave=new Array();
    this.ontextchanged=new Array();
    this.onkeydown=new Array();
    this.onkeyup=new Array();
    this.onarraydown=new Array();
    this.onarrayup=new Array();
    this.onenter=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onkeystopped':if($0v.onkeystopped){
                this.onkeystopped[this.onkeystopped.length]=$0v;
            };
            break;
            case 'ontextchanged':if($0v.ontextchanged){
                this.ontextchanged[this.ontextchanged.length]=$0v;
            };
            break;
            case 'onleave':if($0v.onleave){
                this.onleave[this.onleave.length]=$0v;
            };
            break;
            case 'onkeydown':if($0v.onkeydown){
                this.onkeydown[this.onkeydown.length]=$0v;
            };
            break;
            case 'onkeyup':if($0v.onkeyup){
                this.onkeyup[this.onkeyup.length]=$0v;
            };
            break;
            case 'onarraydown':if($0v.onarraydown){
                this.onarraydown[this.onarraydown.length]=$0v;
            };
            break;
            case 'onarrayup':if($0v.onarrayup){
                this.onarrayup[this.onarrayup.length]=$0v;
            };
            break;
            case 'onenter':if($0v.onenter){
                this.onenter[this.onenter.length]=$0v;
            };
            break;
            default:window.status=this.toString()+'不存在事件：'+$0w;
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onkeystopped':for(var i=0;
            i<this.onkeystopped.length;
            i++){
                if(this.onkeystopped[i].onkeystopped){
                    this.onkeystopped[i].onkeystopped();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'ontextchanged':for(var i=0;
            i<this.ontextchanged.length;
            i++){
                if(this.ontextchanged[i].ontextchanged){
                    this.ontextchanged[i].ontextchanged();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onleave':for(var i=0;
            i<this.onleave.length;
            i++){
                if(this.onleave[i].onleave){
                    this.onleave[i].onleave();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onkeydown':for(var i=0;
            i<this.onkeydown.length;
            i++){
                if(this.onkeydown[i].onkeydown){
                    this.onkeydown[i].onkeydown();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onkeyup':for(var i=0;
            i<this.onkeyup.length;
            i++){
                if(this.onkeyup[i].onkeyup){
                    this.onkeyup[i].onkeyup();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onarraydown':for(var i=0;
            i<this.onarraydown.length;
            i++){
                if(this.onarraydown[i].onarraydown){
                    this.onarraydown[i].onarraydown();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onarrayup':for(var i=0;
            i<this.onarrayup.length;
            i++){
                if(this.onarrayup[i].onarrayup){
                    this.onarrayup[i].onarrayup();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onenter':for(var i=0;
            i<this.onenter.length;
            i++){
                if(this.onenter[i].onenter){
                    this.onenter[i].onenter();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            default:window.status=this.toString()+'抛出了一个未经定义的事件：'+$0w;
            break;
        }
    };
    this.keyCount=0;
    this.textfield.root=this;
    this.textfield.onblur=function(){
        if(this.root.oldValue!=this.value){
            this.root.notify('ontextchanged');
        };
        if(this.root.defaultvalue&&this.root.defaultvalue!=''){
            if(this.value==''){
                this.value=this.root.defaultvalue;
            }
        };
        this.root.notify('onleave');
    };
    this.textfield.onkeyup=function(){
        this.root.keyCount++;
        setRTimeout(this.root,this.root.isKeyStopped,400,[this.root.keyCount]);
        if(this.value!=this.root.oldValue){
            this.root.oldValue=this.value;
            this.root.notify('ontextchanged');
        };
        this.recentupkey=event.keyCode;
        this.root.notify('onkeyup');
    };
    this.isKeyStopped=function($0C){
        if(this.keyCount==$0C){
            this.keyCount=0;
            this.notify('onkeystopped');
        }
    };
    this.textfield.onfocus=function(){
        if(this.value==this.root.defaultvalue){
            this.value='';
        }
    };
    this.textfield.onkeydown=function(){
        this.recentkey=event.keyCode;
        if(this.recentkey==38){
            this.root.notify('onarrayup');
        }
        else if(this.recentkey==40){
            this.root.notify('onarraydown');
        }
        else if(this.recentkey==13){
            this.root.notify('onenter');
        };
        this.root.notify('onkeydown');
    };
    this.get=function(){
        return this.textfield;
    };
    this.toString=function(){
        return 'TextField';
    };
    this.value=function(){
        return this.textfield.value;
    };
    this.setText=function($0t){
        if(this.textfield.value!=$0t){
            this.textfield.value=$0t;
            this.notify('ontextchanged');
        }
    };
    this.getText=function(){
        return this.textfield.value;
    }
};
function Tr(){
    this.tr=document.createElement('tr');
    this.style=this.tr.style;
    this.get=function(){
        return this.tr;
    };
    this.toString=function(){
        return 'Tr';
    }
};
function MyXmlHttpRequest(){
    this.xmlhttp=null;
    this.clsid=null;
    this.createXmlHttp=function($0D){
        try{
            this.xmlhttp=new ActiveXObject($0D);
            this.clsid=$0D;
        }
        catch(e){
        }
    };
    this.getMSXmlHttp=function(){
        var $0E=['Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP.2.6','Microsoft.XMLHTTP.1.0','Microsoft.XMLHTTP.1','Microsoft.XMLHTTP'];
        for(var i=0;i<$0E.length&&this.xmlhttp==null;i++){
            this.createXmlHttp($0E[i]);
        }
    };
    if(!window.XMLHttpxmlhttp){
        this.getMSXmlHttp();
    }
    else{
        this.xmlhttp=new XMLHttpRequest();
    };
    this.get=function(){
        return this.xmlhttp;
    };
    this.toString=function(){
        return 'MyXmlHttpRequest';
    }
};


function ESearchEngine($0F){
    this.serviceUrl=$0F;
    this.xmlHttp=new MyXmlHttpRequest().get();
    this.doMapPrint=function(x1,y1,x2,y2,$0G,$U,$0H){
        var $0I=this.serviceUrl+'?action=print&x1='+x1+'&y1='+y1+'&x2='+x2+'&y2='+y2+'&scale='+$0G;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doThemeAnalysis=function($0J,$0K,$0L,x1,y1,x2,y2,$0G,$U,$0H){
        var $0I=this.serviceUrl+'?action=theme&layer='+$0J+'&themetype='+$0K+'&fields='+$0L+'&x1='+x1+'&y1='+y1+'&x2='+x2+'&y2='+y2+'&scale='+$0G;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doCircleQuery=function($0J,x,y,$0M,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=circle&layer='+$0J+'&x='+x+'&y='+y+'&r='+$0M+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doFuzzyQuery=function($0P,$0Q,$0R,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=fuzzy&layer='+$0P+'&field='+$0Q+'&kw='+($0R)+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doMultipleQuery=function($0P,$0Q,$0S,$0R,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=multiple&layer='+$0P+'&field='+$0Q+'&kw='+($0R)+'&op='+$0S+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doMultipleQuery2=function($0P,$0Q,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=multiple2&layer='+$0P+'&sql='+$0Q+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doPointQuery=function($0P,x,y,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=point&layer='+$0P+'&x='+x+'&y='+y+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doPolygonQuery=function($0P,$0T,$0U,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=polygon&layer='+$0P+'&lats='+$0T+'&lngs='+$0U+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.doRectQuery=function($0P,x1,y1,x2,y2,$0N,$0O,$U,$0H){

        var $0I=this.serviceUrl+'?action=rect&layer='+$0P+'&x1='+x1+'&y1='+y1+'&x2='+x2+'&y2='+y2+'&count='+$0N+'&skip='+$0O;
         //
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };

        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
         alert($0I);
    };
    this.doRectSearch=function($0P,x1,y1,x2,y2,$0N,$0O,$U,$0H){
        var $0I=this.serviceUrl+'?action=rectsearch&layer='+$0P+'&x1='+x1+'&y1='+y1+'&x2='+x2+'&y2='+y2+'&count='+$0N+'&skip='+$0O;
        this.xmlHttp.onreadystatechange=function(){
            $0H.apply($U);
        };
        this.xmlHttp.open('GET',$0I,true);
        this.xmlHttp.send(null);
    };
    this.getXmlHttp=function(){
        return this.xmlHttp;
    };
    this.toString=function(){
        return 'ESearchEngine';
    }
};


var g_xmlHttp=null;
var g_Action=0;
//搜索结果事件
var onshowresult=new Array();
var onShowPOIResult=new Array();
var onShowFTPntResult=new Array();
var onShowNaviResult=new Array();
var onShowBusChangeResult=new Array();
var onShowBusStaResult=new Array();
var onShowBusLineResult=new Array();
var onShowRBusStaResult=new Array();

function StSearchEngine(){
    this.serviceUrl='/11map/StSearchServlet.aspx';
    this.xmlHttp=new MyXmlHttpRequest().get();
    this.doLocalSearch=function(cityid,kw,pageid,pagesize)
    {   
      	var url=this.serviceUrl+'?action=0&cityid='+cityid+'&kw='+kw+'&pageid='+pageid+'&pagesize='+pagesize;
      	g_xmlHttp=this.xmlHttp;
      	g_Action=0;
		this.xmlHttp.onreadystatechange=StSearchObj;
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    
    this.zhuantiSearch=function(cityid,zhantiid,pageid,pagesize)
    {
      	var url=this.serviceUrl+'?action=66&cityid='+cityid+'&zhantiid='+zhantiid+'&pageid='+pageid+'&pagesize='+pagesize;
      	g_xmlHttp=this.xmlHttp;
      	g_Action=66;
		this.xmlHttp.onreadystatechange=StZhuantiSearchObj;
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    
    this.doFTPntSearch=function(cityid,start,end)
    {
         
      	var url=this.serviceUrl+'?action=8&cityid='+cityid+'&start='+start+'&end='+end+'&pageid=1&pagesize=100';
      	g_xmlHttp=this.xmlHttp;
      	g_Action=8;
		this.xmlHttp.onreadystatechange=StSearchObj;
		//alert(url);
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    this.doSearchBusChange=function(cityid,flat,flng,tlat,tlng)
    {
      	var url=this.serviceUrl+'?action=6&cityid='+cityid+'&flat='+flat+'&flng='+flng+'&tlat='+tlat+'&tlng='+tlng;
      	g_xmlHttp=this.xmlHttp;
      	g_Action=6;
		this.xmlHttp.onreadystatechange=StSearchObj;
		//alert(url);
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    this.doSearchAutoNavi=function(cityid,flat,flng,tlat,tlng)
    { 
      	var url=this.serviceUrl+'?action=7&cityid='+cityid+'&flat='+flat+'&flng='+flng+'&tlat='+tlat+'&tlng='+tlng;
      	g_xmlHttp=this.xmlHttp;
      	g_Action=7;
		this.xmlHttp.onreadystatechange=StSearchObj;
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    this.StSearchRound=function(cityid,flat,flng,keywd,category,radius,pageid,pagesize)
    {
      	var url=this.serviceUrl+'?action=1&cityid='+cityid+'&clat='+flat+'&clng='+flng+'&kw='+keywd+'&category='+category+'&radius='+radius+'&pageid='+pageid+'&pagesize='+pagesize;
      	g_xmlHttp=this.xmlHttp;
      	g_Action=1;
		this.xmlHttp.onreadystatechange=StRound;
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    
    this.SearchRBusStation=function(cityid,flat,flng,radius,pageid,pagesize)
    {
      	var url=this.serviceUrl+'?action=9&cityid='+cityid+'&clat='+flat+'&clng='+flng+'&radius='+radius+'&pageid='+pageid+'&pagesize='+pagesize;
      	g_xmlHttp=this.xmlHttp;
      	g_Action=9;
		this.xmlHttp.onreadystatechange=StRBusStation;
		this.xmlHttp.open('GET',url,true);
		this.xmlHttp.send(null);
    }
    
    this.getXmlHttp=function(){
        return this.xmlHttp;
    };
    this.getSearchResult=function(){
        return StSearchResult;
    }
    this.toString=function(){
        return 'StSearchEngine';
    }
   
	this.addListener=function(listener,estring){
		switch(estring){
			case 'onshowresult':
				if(listener.onshowresult){onshowresult[onshowresult.length]=listener;}
			break;
			case 'onShowPOIResult':
				if(listener.onShowPOIResult){onShowPOIResult[onShowPOIResult.length]=listener;}
			break;
			case 'onShowFTPntResult':
				if(listener.onShowFTPntResult){onShowFTPntResult[onShowFTPntResult.length]=listener;}
			break;
			case 'onShowNaviResult':
				if(listener.onShowNaviResult){onShowNaviResult[onShowNaviResult.length]=listener;}
			break;
			case 'onShowBusChangeResult':
				if(listener.onShowBusChangeResult){onShowBusChangeResult[onShowBusChangeResult.length]=listener;}
			break;
			case 'onShowBusStaResult':
				if(listener.onShowBusStaResult){onShowBusStaResult[onShowBusStaResult.length]=listener;}
			case 'onShowBusLineResult':
				if(listener.onShowBusLineResult){onShowBusLineResult[onShowBusLineResult.length]=listener;}
			break;
			
			case 'onShowRBusStaResult':
				if(listener.onShowRBusStaResult){onShowRBusStaResult[onShowRBusStaResult.length]=listener;}
			break;
			
			default:
				window.status='不存在事件'+estring;
			break;
		}
	}
	this.notify=function(estring){
		switch(estring){
			case 'onshowresult':
				for(var i=0;i<this.onshowresult.length;i++){
					if(this.onshowresult[i].onshowresult){
						this.onshowresult[i].onshowresult();
					}
				}
			break;
			default:
				window.status='通报了一个未知的事件'+estring;
			break;
		}
	}
    
    StZhuantiSearchObj=function()
    {
        var xmlHttp2=g_xmlHttp;
		if(xmlHttp2.readyState==4||xmlHttp2.readyState=='complete')
		{
			if(xmlHttp2.status==200){
				var xmldoc=xmlHttp2.responseXML;
				StSearchResult=new Array();
				if(xmldoc.text!=''){
					var sTmp= xmldoc.text;
                  if(g_Action==66){  //POI结果
						var sXML = sTmp.split(";");
						for(i=0;i<sXML.length;i++)
						{
							var sXxmRs= sXML[i].split(",");
							var latlng=decoding(sXxmRs[5]);
							var poi=new StZtPOI(sXxmRs[0],sXxmRs[1],sXxmRs[2],sXxmRs[3],sXxmRs[4],latlng.lat,latlng.lng);
							StSearchResult[i]=poi;
						}
					var list='<ul>';
					if(StSearchResult!=null&&StSearchResult.length>0)
					{
						for(var i=0;i<StSearchResult.length;i++)
						{
						var poi=StSearchResult[i];
						var latlng=new LatLng(poi.lat,poi.lng);
						list=list+'<li>'+poi.name+'</li>';
						maplet.addPointMarker(latlng,maplet.depthhandler.next(),'',poi.name,null,IMG_SERVER+'map_img/map');
						maplet.refreshMarkers();
						}
					}
					list=list+"</ul>";
					document.getElementById("zhuanti").innerHTML=list;
				}
					window.status='Done';
			} else{
				window.status='服务器出错，无法读取数据库，请稍后重试...';
			}
		} else{
			window.status='正在查询相关信息，请稍候...';
		}
    }
    };
    
    StRound=function()
    {
        var xmlHttp2=g_xmlHttp;
		if(xmlHttp2.readyState==4||xmlHttp2.readyState=='complete')
		{
			if(xmlHttp2.status==200){
				var xmldoc=xmlHttp2.responseXML;
				StSearchResult=new Array();
				if(xmldoc.text!=''){
					var sTmp= xmldoc.text;
                  if(g_Action==1){  //POI结果
						var sXML = sTmp.split(";");
						for(i=0;i<sXML.length;i++)
						{
							var sXxmRs= sXML[i].split(",");
							var latlng=decoding(sXxmRs[5]);
							var poi=new StZtPOI(sXxmRs[0],sXxmRs[1],sXxmRs[2],sXxmRs[3],sXxmRs[4],latlng.lat,latlng.lng);
							StSearchResult[i]=poi;
						}
					//var list='<ul>';
					//if(StSearchResult!=null&&StSearchResult.length>0)
					//{
						//for(var i=0;i<StSearchResult.length;i++)
						//{
						//var poi=StSearchResult[i];
						//var latlng=new LatLng(poi.lat,poi.lng);
						//list=list+'<li>'+poi.name+'</li>';
						//maplet.addPointMarker(latlng,maplet.depthhandler.next(),'',poi.name,null,IMG_SERVER+'map_img/map');
						//maplet.refreshMarkers();
						//}
					//}
					//list=list+"</ul>";
					//document.getElementById("zhuanti").innerHTML=list;
					for(var i=0;i<onShowPOIResult.length;i++){
							if(onShowPOIResult[i].onShowPOIResult)onShowPOIResult[i].onShowPOIResult();
						}
				}
					window.status='Done';
			} else{
				window.status='服务器出错，无法读取数据库，请稍后重试...';
			}
		} else{
			window.status='正在查询相关信息，请稍候...';
		}
    }
    };
    
    StRBusStation=function()
    {
        var xmlHttp2=g_xmlHttp;
		if(xmlHttp2.readyState==4||xmlHttp2.readyState=='complete')
		{
			if(xmlHttp2.status==200){
				var xmldoc=xmlHttp2.responseXML;
				StRBusStationResult=new Array();
				if(xmldoc.text!=''){
					var sTmp= xmldoc.text;
                  if(g_Action==9){  
						var sXML = sTmp.split(";");
						for(i=0;i<sXML.length;i++)
						{
							var sXxmRs= sXML[i].split(",");
							var latlng=decoding(sXxmRs[2]);
							var poi=new StBusRStation(sXxmRs[0],sXxmRs[1],latlng.lat,latlng.lng,sXxmRs[3],sXxmRs[4],sXxmRs[5],sXxmRs[6]);
							StRBusStationResult[i]=poi;
						}

					for(var i=0;i<onShowRBusStaResult.length;i++){
							if(onShowRBusStaResult[i].onShowRBusStaResult)onShowRBusStaResult[i].onShowRBusStaResult();
						}
				}
					window.status='Done';
			} else{
				window.status='服务器出错，无法读取数据库，请稍后重试...';
			}
		} else{
			window.status='正在查询相关信息，请稍候...';
		}
    }
    };
    
    StSearchObj=function()
    {
       
		var xmlHttp2=g_xmlHttp;
		if(xmlHttp2.readyState==4||xmlHttp2.readyState=='complete')
		{
			if(xmlHttp2.status==200){
				var xmldoc=xmlHttp2.responseXML;
				StSearchResult=new Array();
				if(xmldoc.text!=''){
					var sTmp= xmldoc.text;
					if(g_Action==0){  //POI结果
						var sXML = sTmp.split(";");
						for(i=0;i<sXML.length;i++)
						{
							var sXxmRs= sXML[i].split(",");
							var latlng=decoding(sXxmRs[5]);
							var poi=new StPOI(sXxmRs[0],sXxmRs[1],sXxmRs[2],sXxmRs[3],sXxmRs[4],latlng.lat,latlng.lng,sXxmRs[6],sXxmRs[7],sXxmRs[8]);
							StSearchResult[i]=poi;
						}
						
						for(var i=0;i<onShowPOIResult.length;i++){
							if(onShowPOIResult[i].onShowPOIResult)onShowPOIResult[i].onShowPOIResult();
						}
					//var list='<ul>';
					//if(StSearchResult!=null&&StSearchResult.length>0)
					//{
						//for(var i=0;i<StSearchResult.length;i++)
						//{
						//var poi=StSearchResult[i];
						//maplet.setCenter(poi.lat,poi.lng);
						//var latlng=new LatLng(poi.lat,poi.lng);
						//list=list+'<li>'+poi.name+'</li>';
						//maplet.clearMarkers();
						//maplet.addPointMarker(latlng,maplet.depthhandler.next(),'',poi.name,null,IMG_SERVER+'map_img/map');
						//maplet.refreshMarkers();
						//}
					//}
					//list=list+"</ul>";
					//document.getElementById("zhuanti").innerHTML=list;
					}else if(g_Action==6){  //公交搜索结果
					    var sXML = sTmp.split("@");
					    for(i=0;i<sXML.length;i++)
						{
						   var sTmpXML=sXML[i].split("#");
						   var BusCase=new StBusCase(sTmpXML[0],sTmpXML[1]);
						   StSearchResult[i]=BusCase;
						}
						for(var i=0;i<onShowBusChangeResult.length;i++){
							if(onShowBusChangeResult[i].onShowBusChangeResult)onShowBusChangeResult[i].onShowBusChangeResult();
						}
					}else if(g_Action==7){  //自驾搜索结果
                                       
					    var sXML = sTmp.split("|");                                           
					    var NaviCase=new StNaviCase(sXML[0],sXML[1],sXML[2]);
						StSearchResult[0]=NaviCase;
						for(var i=0;i<onShowNaviResult.length;i++){
							if(onShowNaviResult[i].onShowNaviResult)onShowNaviResult[i].onShowNaviResult();
						}
					}else if(g_Action==8){  //POI结果
						StSearchResult[0]=sTmp;
						for(var i=0;i<onShowFTPntResult.length;i++){
							if(onShowFTPntResult[i].onShowFTPntResult)onShowFTPntResult[i].onShowFTPntResult();
						}
					}
				}
				//alert(xmldoc.text);
				//this.notify('onshowresult');
				window.status='Done';
			} else{
				window.status='服务器出错，无法读取数据库，请稍后重试...';
			}
		} else{
			window.status='正在查询相关信息，请稍候...';
		}
    }
	

};/**/

function StPOI(POIID,POINAME,ADDRESS,TELEPHONE,KIND,fLAT,fLNG)
{
   this.toString=function(){
        return 'StPOI';
    };
   this.id=POIID;
   this.name=POINAME;
   this.address=ADDRESS;
   this.telephone=TELEPHONE;
   this.kind=KIND;
   this.lat=fLAT;
   this.lng=fLNG;
}

function StZtPOI(POIID,POINAME,ADDRESS,TELEPHONE,KIND,fLAT,fLNG,ImageName,ImagePath,SummaryDes)
{
   this.toString=function(){
        return 'StZtPOI';
    };
   this.id=POIID;
   this.name=POINAME;
   this.address=ADDRESS;
   this.telephone=TELEPHONE;
   this.kind=KIND;
   this.lat=fLAT;
   this.lng=fLNG;
   this.imagename=ImageName;
   this.imagepath=ImagePath;
   this.summarydes=SummaryDes;
}
function StBusRStation(LineName,StationName,fLat,fLng,Sname,Ename,lineid,staid)
{
   this.toString=function(){
        return 'StBusStation';
    };
    this.linename=LineName;
    this.stationname=StationName;
    this.lat=fLat;
    this.lng=fLng;
    this.StartStation=Sname;
    this.EndStation=Ename;
    this.LineID=lineid;
    this.StaID=staid;
}
function StBusStation(LineName,StationName,fLat,fLng)
{
   this.toString=function(){
        return 'StBusStation';
    };
    this.linename=LineName;
    this.stationname=StationName;
    this.lat=fLat;
    this.lng=fLng;
}
function StBusCase(CaseDes,StationStr)
{
   this.ChangeDes=CaseDes;
   this.strStation=StationStr;
   this.CaseStations=new Array;
   var sStaXML=StationStr.split(";");
   for(var i=0;i<sStaXML.length;i++)
   {
      var sStaXMLRes=sStaXML[i].split(",");
      var latlng=decoding(sStaXMLRes[2]);
      var sSta=new StBusStation(sStaXMLRes[0],sStaXMLRes[1],latlng.lat,latlng.lng);
      this.CaseStations[i]=sSta;
   }
   this.toString=function(){
        return 'StBusCase';
    };
    
}

function StNaviPath(PathDes,PathXY)
{
   this.PathDes=PathDes;
   var latlng=decoding(PathXY);
   this.PathLat=latlng.lat;
   this.PathLng=latlng.lng;
   this.toString=function(){
        return 'StNaviPath';
    };
}

function StNaviCase(RoutXYStr,NaviDes,AllDist)
{   
   this.RoutXYStr=RoutXYStr;
   this.AllDist=AllDist;
   this.RoutDes=new Array();
   
   var sTmpXML=NaviDes.split("@");
   
   for(i=0;i<sTmpXML.length;i++)
   {
      var sPathXMLRes=sTmpXML[i].split(";");
      var sPath=new StNaviPath(sPathXMLRes[0],sPathXMLRes[1]);
      this.RoutDes[i]=sPath;
   }
   this.toString=function(){
        return 'StNaviCase';
    };
    
}



function MyButton($0q,top,$0r,$0x,$0t){
    this.button=document.createElement('Input');
    this.button.type="button";
    this.button.value=$0t;
    this.style=this.button.style;
    this.style.position='absolute';
    this.style.fontSize='12px';
    this.style.left=$0q;
    this.style.top=top;
    this.style.width=$0r;
    this.style.height=$0x;
    this.toString=function(){
        return 'MyButton';
    };
    this.get=function(){
        return this.button;
    }
};


function CheckBox($0q,top,$0V,$0t,$0u){
    this.div=new Div($0q,top,null,null).get();
    this.style=this.div.style;
    this.checkbox=document.createElement('input');
    this.checkbox.type='checkbox';
    this.checkbox.value=$0u;
    this.checkbox.style.position='absolute';
    this.checkbox.root=this;
    this.checkbox.onclick=function(){
        if(this.checked){
            this.root.notify('onchecked');
            this.root.label.style.fontWeight='bold';
        }
        else{
            this.root.notify('onunchecked');
            this.root.label.style.fontWeight='normal';
        }
    };
    this.labelleft=25;
    if($0V){
        this.icon=new MyImage(20,0,$0V);
        this.icon.title=$0t;
        this.icon.get().root=this;
        this.icon.get().onclick=function(){
            if(this.root.checkbox.checked){
                this.root.uncheck();
            }
            else{
                this.root.check();
            }
        };
        this.div.appendChild(this.icon.get());
        if(this.icon.get().width>16){
            this.labelleft+=this.icon.get().width;
        }
        else{
            this.labelleft+=16;
        }
    };
    this.label=new Label(this.labelleft,4,$0t);
    this.label.style.width=$0t.length*13;
    this.div.appendChild(this.checkbox);
    this.div.appendChild(this.label.get());
    this.label.get().root=this;
    this.label.get().onclick=function(){
        if(this.root.checkbox.checked){
            this.root.uncheck();
        }
        else{
            this.root.check();
        }
    };
    this.isChecked=function(){
        return this.checkbox.checked;
    };
    this.getValue=function(){
        return this.checkbox.value;
    };
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'CheckBox';
    };
    this.check=function(){
        this.label.style.fontWeight='bold';
        this.checkbox.checked=true;
        this.notify('onchecked');
    };
    this.uncheck=function(){
        this.label.style.fontWeight='normal';
        this.checkbox.checked=false;
        this.notify('onunchecked');
    };
    this.onchecked=new Array();
    this.onunchecked=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onchecked':if($0v.onchecked){
                this.onchecked[this.onchecked.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onunchecked':if($0v.onunchecked){
                this.onunchecked[this.onunchecked.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onchecked':for(var i=0;
            i<this.onchecked.length;
            i++){
                if(this.onchecked[i].onchecked){
                    this.onchecked[i].onchecked();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onunchecked':for(var i=0;
            i<this.onunchecked.length;
            i++){
                if(this.onunchecked[i].onunchecked){
                    this.onunchecked[i].onunchecked();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};


function List($0q,top,$0r,$0x){
    this.selectedIndex=null;
    this.selectedText=null;
    this.selectedValue=null;
    this.div=new Div($0q,top,$0r,$0x).get();
    this.div.style.backgroundColor='#FFFFFF';
    this.div.style.overflow='auto';
    this.style=this.div.style;
    this.div.scrolling='auto';
    this.listData=new Array();
    this.table=new Table().get();
    this.tbody=new TBody().get();
    this.table.appendChild(this.tbody);
    this.div.appendChild(this.table);
    this.table.style.width=$0r-19;
    this.table.width=$0r-19;
    this.highlightIndex=-1;
    this.toString=function(){
        return 'List';
    };
    this.get=function(){
        return this.div;
    };
    this.addListContent=function($0W,$0u,title){
        this.addListItem('',$0u,title);
        this.listData[this.listData.length-1].appendChild($0W.get());
    };
    this.addListItem=function($0t,$0u,title){
        var td=new Td().get();
        td.innerHTML=$0t;
        td.value=$0u;
        td.title=title;
        td.style.fontSize=12;
        td.root=this;
        td.key=this.listData.length;
        td.checked=false;
        if($0u!=''){
            td.style.cursor='hand';
        }
        else{
            td.style.cursor='default';
        };
        td.style.backgroundColor='#FFFFFF';
        this.listData[this.listData.length]=td;
        td.onmouseover=function(){
            if(this.value==''){
                return;
            };
            this.root.highlightIndex=this.key;
            this.root.highlight(this.key);
        };
        td.onmouseout=function(){
            if(this.value==''){
                return;
            };
            if(!this.checked){
                this.style.backgroundColor='#FFFFFF';
            }
            else{
                this.style.backgroundColor='#BBDD99';
            }
        };
        td.onclick=function(){
            if(this.value==''){
                return;
            };
            this.root.check(this.key);
        };
        var tr=new Tr().get();
        tr.appendChild(td);
        this.tbody.appendChild(tr);
    };
    this.clear=function(){
        this.tbody.innerText='';
        this.listData=new Array();
        this.selectedIndex=-1;
        this.selectedValue=null;
        this.selectedText='';
        this.highlightIndex=-1;
    };
    this.onclicked=new Array();
    this.onselected=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onclicked':if($0v.onclicked){
                this.onclicked[this.onclicked.length]=$0v;
            };
            break;
            case 'onselected':if($0v.onselected){
                this.onselected[this.onselected.length]=$0v;
            };
            break;
            default:window.status=this.toString()+'不存在事件：'+$0w;
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onclicked':for(var i=0;
            i<this.onclicked.length;
            i++){
                if(this.onclicked[i].onclicked){
                    this.onclicked[i].onclicked();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            case 'onselected':for(var i=0;
            i<this.onselected.length;
            i++){
                if(this.onselected[i].onselected){
                    this.onselected[i].onselected();
                }
                else{
                    window.status='事件监听对象的事件处理方法调用失败：'+this.toString()+','+$0w;
                }
            };
            break;
            default:window.status=this.toString()+'抛出了一个未经定义的事件：'+$0w;
            break;
        }
    };
    this.uncheckAll=function(){
        for(var $0X=0;$0X<this.listData.length;$0X++){
            this.listData[$0X].checked=false;
            this.listData[$0X].style.backgroundColor='#FFFFFF';
        }
    };
    this.hide=function(){
        this.div.style.visibility='hidden';
    };
    this.show=function(){
        this.div.style.visibility='visible';
    };
    this.highlightnext=function(){
        this.highlight(this.highlightIndex+1);
    };
    this.highlightprev=function(){
        this.highlight(this.highlightIndex-1);
    };
    this.highlight=function($0Y){
        $0Y=$0Y%this.listData.length;
        if($0Y>=0&&$0Y<this.listData.length){
            this.delightAll();
            if(!this.listData[$0Y].checked){
                this.listData[$0Y].style.backgroundColor='#99BBDD';
            }
            else{
                this.listData[$0Y].style.backgroundColor='#AACC88';
            };
            this.highlightIndex=$0Y;
            $0Z=this.div.getBoundingClientRect();
            $10=this.listData[$0Y].getBoundingClientRect();
            if($0Z.bottom<$10.bottom){
                this.div.scrollTop+=parseInt(this.div.style.height,10)/2;
            }
            else if($0Z.top>$10.top){
                if(parseInt(this.div.scrollTop,10)-parseInt(this.div.style.height,10)>0){
                    this.div.scrollTop=parseInt(this.div.scrollTop,10)-parseInt(this.div.style.height,10);
                }
                else{
                    this.div.scrollTop=0;
                }
            }
        }
    };
    this.check=function($0Y){
        $0Y=$0Y%this.listData.length;
        if($0Y>=0&&$0Y<this.listData.length){
            this.uncheckAll();
            this.listData[$0Y].style.backgroundColor='#BBDD99';
            this.listData[$0Y].checked=true;
            this.selectedIndex=this.listData[$0Y].key;
            this.selectedText=this.listData[$0Y].innerHTML;
            this.selectedValue=this.listData[$0Y].value;
            this.notify('onselected');
            this.notify('onclicked');
        }
    };
    this.checkhighlight=function(){
        this.check(this.highlightIndex);
    };
    this.delightAll=function(){
        for(var $11=0;$11<this.listData.length;$11++){
            this.delight($11);
        }
    };
    this.delight=function($0Y){
        $0Y=$0Y%this.listData.length;
        if($0Y>=0&&$0Y<this.listData.length){
            if(this.listData[$0Y].checked){
                this.listData[$0Y].style.backgroundColor='#BBDD99';
            }
            else{
                this.listData[$0Y].style.backgroundColor='#FFFFFF';
            }
        }
    };
    this.getLength=function(){
        return this.listData.length;
    }
};


function RadioButton($0q,top,$0u,$12){
    this.checked=false;
    this.toString=function(){
        return 'RadioButton';
    };
    this.radio=document.createElement('Input');
    this.style=this.radio.style;
    this.radio.type='radio';
    this.group=$12;
    this.group.add(this);
    this.value=$0u;
    this.style.position='absolute';
    this.style.left=$0q;
    this.style.top=top;
    this.get=function(){
        return this.radio;
    };
    this.radio.root=this;
    this.radio.onclick=function(){
        this.root.group.clear();
        this.root.check();
    };
    this.check=function(){
        this.group.clear();
        this.checked=true;
        this.radio.checked=true;
        this.group.setValue(this.value);
        this.notify('onchecked');
    };
    this.uncheck=function(){
        this.checked=false;
        this.radio.checked=false;
        this.notify('onunchecked');
    };
    this.onchecked=new Array();
    this.onunchecked=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onchecked':if($0v.onchecked){
                this.onchecked[this.onchecked.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onunchecked':if($0v.onunchecked){
                this.onunchecked[this.onunchecked.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onchecked':for(var i=0;
            i<this.onchecked.length;
            i++){
                if(this.onchecked[i].onchecked){
                    this.onchecked[i].onchecked();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onunchecked':for(var i=0;
            i<this.onunchecked.length;
            i++){
                if(this.onunchecked[i].onunchecked){
                    this.onunchecked[i].onunchecked();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};
function RadioGroup(){
    this.value=null;
    this.members=new Array();
    this.add=function($13){
        if($13.toString()=='RadioButton'){
            this.members[this.members.length]=$13;
        }
        else{
            window.status='试图向'+this.toString()+'中添加非RadioButton对象';
        }
    };
    this.clear=function(){
        for(var i=0;i<this.members.length;i++){
            this.members[i].uncheck();
        }
    };
    this.setValue=function($0u){
        if(this.value==$0u){
            return;
        };
        this.value=$0u;
        this.notify('onvaluechanged');
    };
    this.toString=function(){
        return 'RadioGroup';
    };
    this.onvaluechanged=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onvaluechanged':if($0v.onvaluechanged){
                this.onvaluechanged[this.onvaluechanged.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onvaluechanged':for(var i=0;
            i<this.onvaluechanged.length;
            i++){
                if(this.onvaluechanged[i].onvaluechanged){
                    this.onvaluechanged[i].onvaluechanged();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};


function RichRadioButton($0q,top,$0u,$0t,$12){
    this.left=$0q;
    this.top=top;
    this.value=$0u;
    this.text=$0t;
    this.group=$12;
    this.toString=function(){
        return 'RichRadioButton';
    };
    this.div=new Div($0q,top,null,null).get();
    this.style=this.div.style;
    this.radio=new RadioButton(0,0,$0u,$12);
    this.label=new Label(25,4,this.text);
    this.onclicked=function(){
        this.radio.check();
    };
    this.label.addListener(this,'onclicked');
    this.div.appendChild(this.radio.get());
    this.div.appendChild(this.label.get());
    this.get=function(){
        return this.div;
    };
    this.addListener=function($0v,$0w){
        this.radio.addListener($0v,$0w);
    }
};


function Accordion($0r,$0x){
    this.width=$0r;
    this.height=$0x;
    this.table=new Table().get();
    this.table.style.width=this.width;
    this.table.style.height=this.height;
    this.tbody=new TBody().get();
    this.table.appendChild(this.tbody);
    this.items=new Array();
    this.onexpand=function(){
        var $14=null;
        for(var i=0;i<this.items.length;i++){
            if(this.items[i].waiting){
                $14=this.items[i];
            }
            else{
                this.items[i].collapse();
            }
        };
        if($14){
            $14.expand();
        }
    };
    this.oncollapse=function(){
        var $14=null;
        for(var $11=0;$11<this.items.length;$11++){
            if(this.items[$11].waiting){
                $14=this.items[($11+1)%this.items.length];
            };
            this.items[$11].collapse();
        };
        if($14){
            $14.expand();
        }
    };
    this.expand=function($0Y){
        if($0Y>=0&&$0Y<this.items.length){
            for(var i=0;i<this.items.length;i++){
                if(i!=$0Y){
                    this.items[i].collapse();
                }
            };
            this.items[$0Y].expand();
        }
    };
    this.addAccordionItem=function($15){
        var tr=new Tr().get();
        if($15.toString()=='AccordionItem'){
            if(this.items.length==0){
                $15.expand();
            }
            else{
                this.tbody.appendChild(tr);
                $15.collapse();
            };
            this.items[this.items.length]=$15;
            this.tbody.appendChild($15.getTitle());
            this.tbody.appendChild($15.getContent());
            this.tbody.appendChild($15.getBottom());
            $15.addListener(this,'onexpand');
            $15.addListener(this,'oncollapse');
            for(var i=0;i<this.items.length;i++){
                this.items[i].setWidth(this.width-6);
                this.items[i].setHeight(this.height-this.items.length*25);
            }
        }
        else{
            window.status=this.toString()+'试图添加非AccordionItem类的对象';
        }
    };
    this.get=function(){
        return this.table;
    };
    this.toString=function(){
        return 'Accordion';
    };
    this.hide=function(){
        this.table.style.visibility='hidden';
    };
    this.show=function(){
        this.table.style.visibility='visible';
    }
};


function AccordionItem($16,$17){
    this.isRich=$17;
    this.imgsrc=$16;
    this.expanded=false;
    this.titletr=new Tr().get();
    this.contenttr=new Tr().get();
    this.bottomtr=new Tr().get();
    this.lefttitletd=new Td().get();
    this.lefttitletd.style.width=3;
    this.titletd=new Td().get();
    this.righttitletd=new Td().get();
    this.righttitletd.style.width=3;
    if(this.isRich){
        this.lefttitletd.style.backgroundImage='url('+this.imgsrc+'/titleopenleft.gif)';
        this.titletd.style.backgroundImage='url('+this.imgsrc+'/titlemiddle.gif)';
        this.righttitletd.style.backgroundImage='url('+this.imgsrc+'/titleopenright.gif)';
        this.titletd.style.height=26;
    }
    else{
        this.titletd.style.height=20;
        this.titletr.style.backgroundColor='#fad58a';
        this.titletd.style.borderBottom='1px solid #d38d00';
        this.titletd.style.borderTop='1px solid #d38d00';
    };
    this.leftcontenttd=new Td().get();
    this.contenttd=new Td().get();
    this.rightcontenttd=new Td().get();
    if(this.isRich){
        this.leftcontenttd.style.backgroundImage='url('+this.imgsrc+'/contentleft.gif)';
        this.rightcontenttd.style.backgroundImage='url('+this.imgsrc+'/contentright.gif)';
    };
    this.waiting=false;
    this.lbtd=new Td().get();
    this.lbtd.style.height=3;
    this.mbtd=new Td().get();
    this.mbtd.style.height=3;
    this.rbtd=new Td().get();
    this.rbtd.style.height=3;
    if(this.isRich){
        this.lbtd.style.backgroundImage='url('+this.imgsrc+'/content_lb.gif)';
        this.mbtd.style.backgroundImage='url('+this.imgsrc+'/content_mb.gif)';
        this.rbtd.style.backgroundImage='url('+this.imgsrc+'/content_rb.gif)';
    };
    this.titletr.appendChild(this.lefttitletd);
    this.titletr.appendChild(this.titletd);
    this.titletr.appendChild(this.righttitletd);
    this.contenttr.appendChild(this.leftcontenttd);
    this.contenttr.appendChild(this.contenttd);
    this.contenttr.appendChild(this.rightcontenttd);
    this.bottomtr.appendChild(this.lbtd);
    this.bottomtr.appendChild(this.mbtd);
    this.bottomtr.appendChild(this.rbtd);
    this.titlediv=new Div(0,0,null,19).get();
    this.titlediv.style.position='relative';
    this.stateIcon=new MyImage(5,5,this.imgsrc+'/collapse.gif').get();
    this.stateIcon.title='展开此栏';
    this.stateIcon.style.position='relative';
    this.titlediv.appendChild(this.stateIcon);
    this.titlediv.root=this;
    this.titlediv.onclick=function(){
        if(this.root.expanded){
            this.root.waiting=true;
            this.root.expanded=false;
            this.root.notify('oncollapse');
        }
        else{
            this.root.waiting=true;
            this.root.expanded=true;
            this.root.notify('onexpand');
        }
    };
    this.titletd.appendChild(this.titlediv);
    this.contentdiv=new Div(2,2,null,null).get();
    this.contentdiv.style.position='relative';
    this.contentdiv.style.overflow='auto';
    this.contenttd.appendChild(this.contentdiv);
    this.addTitle=function(title){
        if(title.get){
            this.titlediv.appendChild(title.get());
        }
        else{
            window.status=this.toString()+'试图添加不合法的对象作为标题';
        }
    };
    this.addContent=function($0W){
        if($0W.get){
            this.contentdiv.appendChild($0W.get());
        }
    };
    this.expand=function(){
        this.stateIcon.src=this.imgsrc+'/expand.gif';
        this.stateIcon.title='关闭此栏';
        this.contenttr.style.display='inline';
        this.bottomtr.style.display='inline';
        if(this.isRich){
            this.lefttitletd.style.backgroundImage='url('+this.imgsrc+'/titleopenleft.gif)';
            this.righttitletd.style.backgroundImage='url('+this.imgsrc+'/titleopenright.gif)';
        };
        this.expanded=true;
        this.waiting=false;
    };
    this.collapse=function(){
        this.stateIcon.src=this.imgsrc+'/collapse.gif';
        this.stateIcon.title='打开此栏';
        if(this.isRich){
            this.lefttitletd.style.backgroundImage='url('+this.imgsrc+'/titlecloseleft.gif)';
            this.righttitletd.style.backgroundImage='url('+this.imgsrc+'/titlecloseright.gif)';
        };
        this.contenttr.style.display='none';
        this.bottomtr.style.display='none';
        this.expanded=false;
        this.waiting=false;
    };
    this.toString=function(){
        return 'AccordionItem';
    };
    this.getTitle=function(){
        return this.titletr;
    };
    this.getContent=function(){
        return this.contenttr;
    };
    this.getBottom=function(){
        return this.bottomtr;
    };
    this.onexpand=new Array();
    this.oncollapse=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onexpand':if($0v.onexpand){
                this.onexpand[this.onexpand.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'oncollapse':if($0v.oncollapse){
                this.oncollapse[this.oncollapse.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onexpand':for(var i=0;
            i<this.onexpand.length;
            i++){
                if(this.onexpand[i].onexpand){
                    this.onexpand[i].onexpand();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'oncollapse':for(var i=0;
            i<this.oncollapse.length;
            i++){
                if(this.oncollapse[i].oncollapse){
                    this.oncollapse[i].oncollapse();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.setHeight=function($0x){
        this.contentdiv.style.height=$0x;
    };
    this.setWidth=function($0r){
        if(this.isRich){
            this.stateIcon.style.left=$0r-15;
        };
        this.titlediv.style.width=$0r;
        this.contentdiv.style.width=$0r;
    };
    this.hide=function(){
        this.collapse();
        this.titletr.style.display='none';
    };
    this.show=function(){
        this.titletr.style.display='inline';
    }
};
function DataTable($18){
    this.tableName=$18.lastChild.firstChild.tagName;
    this.toString=function(){
        return 'DataTable';
    };
    this.getHtml=function(){
        this.table='<table style="border:1px solid #000000;font-size:12px;" cellspacing="0" cellpadding="0" width="100%" align="center">';
        var $19=$18.getElementsByTagName(this.tableName);
        if($19.length>0){
            this.table+='<tr>';
            for(var $0m=0;$0m<$19[0].childNodes.length;$0m++){
                this.table+='<td bgcolor="#f9d489" style="color:#3333FF;font-weight:bold" align="center">'+$19[0].childNodes[$0m].tagName+'</td>';
            };
            this.table+='</tr>';
        };
        for(var $0B=0;$0B<$19.length;$0B++){
            this.table+='<tr onmouseover="this.style.backgroundColor=\'#88FFFF\'" onmouseout="this.style.backgroundColor=\'#$0j\'" onclick=>';
            for(var $0m=0;$0m<$19[$0B].childNodes.length;$0m++){
                if($19[$0B].childNodes[$0m].childNodes.length==0){
                    this.table+='<td>&nbsp;</td>';
                }
                else{
                    this.table+='<td align="center">'+$19[$0B].childNodes[$0m].firstChild.nodeValue+'</td>';
                }
            };
            this.table+='</tr>';
        };
        this.table+='</table>';
        return this.table;
    }
};


function FloatDialog($0q,top,$0r,title,$0W){
    this.title=title;
    this.content=$0W;
    this.left=$0q;
    this.top=top;
    this.div=new Div(this.left,this.top,$0r,null).get();
    this.div.style.visibility='hidden';
    this.style=this.div.style;
    this.contentdiv=new Div(0,0,$0r,null).get();
    this.contentdiv.innerHTML='<table border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFCC" bordercolorlight="#0C8BDB" bordercolordark="#0C8BDB">'+
                               '<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF9933">'+
                               '<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+
                               '<td align="left" height="17" width="25"></td>'+
                               '<td valign="top" align="left" style="font-size:12px;color:#000000">|&nbsp;<b>'+this.title+'&nbsp;</b></td>'+
                               '</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFFFCC">'+
                               '<table border="0" cellpadding="0" cellspacing="1" align="left">'+
                               '<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+
                               '</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    this.div.appendChild(this.contentdiv);
    this.div.pin=false;
    this.div.onoff=true;
    this.close=document.createElement("a");
    this.close.style.cursor="hand";
    this.close.style.color="#FFFFFF";
    this.close.style.left=0;
    this.close.style.top=0;
    this.close.style.position="absolute";
    this.close.innerHTML='<span style="font-family:Webdings;font-size:12px">r</span>';
    this.close.onmouseout=function(){
        this.style.color="#FFFFFF";
    };
    this.close.onmouseover=function(){
        this.style.color="#0000FF";
    };
    this.close.onclick=function(){
        this.parentNode.pin=false;
        this.parentNode.style.visibility="hidden";
    };
    this.onoff=document.createElement("a");
    this.onoff.style.cursor="hand";
    this.onoff.style.color="#FFFFFF";
    this.onoff.style.left=15;
    this.onoff.style.top=0;
    this.onoff.style.position="absolute";
    this.onoff.innerHTML='<span style="font-family:Webdings;font-size:12px">5</span>';
    this.onoff.onmouseout=function(){
        this.style.color="#FFFFFF";
    };
    this.onoff.onmouseover=function(){
        this.style.color="#0000FF";
    };    
    this.onoff.onclick=function(){
        if(this.parentNode.onoff){
            this.innerHTML='<span style="font-family:Webdings;font-size:12px">6</span>';
            this.parentNode.style.height=20;
            this.parentNode.style.overflow="hidden";
        }
        else{
            this.innerHTML='<span style="font-family:Webdings;font-size:12px">5</span>';
            this.parentNode.style.overflow="visible";
        };
        this.parentNode.onoff=!this.parentNode.onoff;
    };
    this.div.appendChild(this.close);
    this.div.appendChild(this.onoff);
    this.div.onmousedown=function(){
        this.style.cursor="default";
        this.leftorigin=parseInt(this.style.left,10);
        this.toporigin=parseInt(this.style.top,10);
        this.xorigin=event.clientX;
        this.yorigin=event.clientY;
        this.drag=true;
    };
    this.div.onmouseup=function(){
        this.style.cursor="default";
        this.drag=false;
    };
    this.div.onmousemove=function(){
        if(false){
            this.style.cursor="move";
            this.style.left=this.leftorigin+event.clientX-this.xorigin;
            this.style.top=this.toporigin+event.clientY-this.yorigin;
        }
    };
    this.div.onmouseout=function(){
        this.style.cursor="default";
        this.drag=false;
    };
    this.setTitle=function(title){
        this.title=title;
        this.contentdiv.innerHTML='<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FAC194">'+'<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF8400">'+'<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+'<td align="left" height=17>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</td>'+'<td valign="top" align="left" style="font-size:12px;color:#000000">&nbsp;<b>'+this.title+'&nbsp;</b></td>'+'</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFF9F4">'+'<table border="0" cellpadding="0" cellspacing="1" align="left">'+'<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+'</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    };
    this.setContent=function($0W){
        this.content=$0W;
        this.contentdiv.innerHTML='<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FAC194">'+'<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF8400">'+'<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+'<td align="left" height=17>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</td>'+'<td valign="top" align="left" style="font-size:12px;color:#000000">&nbsp;<b>'+this.title+'&nbsp;</b></td>'+'</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFF9F4">'+'<table border="0" cellpadding="0" cellspacing="1" align="left">'+'<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+'</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    };
    this.get=function(){
        return this.div;
    };
    this.show=function(){
        this.div.style.visibility='visible';
    };
    this.hide=function(){
        this.div.style.visibility='hidden';
    }
};

function FloatSyhDialog($0q,top,$0r,title,$0W){
    this.title=title;
    this.content=$0W;
    this.left=$0q;
    this.top=top;
    this.div=new Div(this.left,this.top,$0r,null).get();
    this.div.style.visibility='hidden';
    this.style=this.div.style;
    this.contentdiv=new Div(0,0,$0r,null).get();
    this.contentdiv.innerHTML='<div id="Fbody" class="Fbody">'+
                               '<div id="fright" class="fright">'+
                               '<div id="ftop" class="Dialogtop">'+
                               '<div id="tnei" class="tnei">'+
                               '<b>'+this.title+'&nbsp;</b></div></div>'+
                               '<div id="contentdialog" class="Dcontent">'+this.content+
                               '</div>'+
							   '<div id="bottomdilog"></div>'+
                               '</div>'+'</div>';
    //alert(this.contentdiv.innerHTML);                              
    this.div.appendChild(this.contentdiv);
    this.div.pin=false;
    this.div.onoff=true;
    this.close=document.createElement("a");
    this.close.style.cursor="hand";
    this.close.style.color="#FFFFFF";
    this.close.style.left=335;
    this.close.style.top=0;
    this.close.style.position="absolute";
    this.close.innerHTML='<span style="font-family:Webdings;font-size:12px">r</span>';
    this.close.onmouseout=function(){
        this.style.color="#FFFFFF";
    };
    this.close.onmouseover=function(){
        this.style.color="#0000FF";
    };
    this.close.onclick=function(){
        this.parentNode.pin=false;
        this.parentNode.style.visibility="hidden";
    };
    this.onoff=document.createElement("a");
    this.onoff.style.cursor="hand";
    this.onoff.style.color="#FFFFFF";
    this.onoff.style.left=319;
    this.onoff.style.top=0;
    this.onoff.style.position="absolute";
    this.onoff.innerHTML='<span style="font-family:Webdings;font-size:12px">5</span>';
    this.onoff.onmouseout=function(){
        this.style.color="#FFFFFF";
    };
    this.onoff.onmouseover=function(){
        this.style.color="#0000FF";
    };    
    this.onoff.onclick=function(){
        if(this.parentNode.onoff){
            this.innerHTML='<span style="font-family:Webdings;font-size:12px">6</span>';
            this.parentNode.style.height=20;
            this.parentNode.style.overflow="hidden";
        }
        else{
            this.innerHTML='<span style="font-family:Webdings;font-size:12px">5</span>';
            this.parentNode.style.overflow="visible";
        };
        this.parentNode.onoff=!this.parentNode.onoff;
    };
    this.div.appendChild(this.close);
    this.div.appendChild(this.onoff);
    this.div.onmousedown=function(){
        this.style.cursor="default";
        this.leftorigin=parseInt(this.style.left,10);
        this.toporigin=parseInt(this.style.top,10);
        this.xorigin=event.clientX;
        this.yorigin=event.clientY;
        this.drag=true;
    };
    this.div.onmouseup=function(){
        this.style.cursor="default";
        this.drag=false;
    };
    this.div.onmousemove=function(){
        if(false){
            this.style.cursor="move";
            this.style.left=this.leftorigin+event.clientX-this.xorigin;
            this.style.top=this.toporigin+event.clientY-this.yorigin;
        }
    };
    this.div.onmouseout=function(){
        this.style.cursor="default";
        this.drag=false;
    };
    this.setTitle=function(title){
        this.title=title;
        this.contentdiv.innerHTML='<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FAC194">'+'<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF8400">'+'<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+'<td align="left" height=17>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</td>'+'<td valign="top" align="left" style="font-size:12px;color:#000000">&nbsp;<b>'+this.title+'&nbsp;</b></td>'+'</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFF9F4">'+'<table border="0" cellpadding="0" cellspacing="1" align="left">'+'<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+'</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    };
    this.setContent=function($0W){
        this.content=$0W;
        this.contentdiv.innerHTML='<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FAC194">'+'<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF8400">'+'<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+'<td align="left" height=17>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</td>'+'<td valign="top" align="left" style="font-size:12px;color:#000000">&nbsp;<b>'+this.title+'&nbsp;</b></td>'+'</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFF9F4">'+'<table border="0" cellpadding="0" cellspacing="1" align="left">'+'<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+'</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    };
    this.get=function(){
        return this.div;
    };
    this.show=function(){
        this.div.style.visibility='visible';
    };
    this.hide=function(){
        this.div.style.visibility='hidden';
    }
   // alert(this.div.innerHTML); 
   // alert(this.contentdiv.innerHTML);   
   
     
};

function FloatPOIDialog($0q,top,$0r,title,$0W){
    this.title=title;
    this.content=$0W;
    this.left=$0q;
    this.top=top;
    this.div=new Div(this.left,this.top,$0r,null).get();
    this.div.style.visibility='hidden';
    this.div.id="ToolTip";
    this.style=this.div.style;
    this.contentdiv=new Div(0,0,$0r,null).get();
 this.contentdiv.innerHTML='<table width="377" unselectable="on" border="0" oncontextmenu="hiddentToolTip()" cellpadding="0" cellspacing="0">'+
                          '<tr> <td width="10"><img src="/11map/images/new_r1_c1.png" width="10" height="10"></td><td width="352" background="/11map/images/new_r1_c2.gif"></td>'+
						  '<td width="10"><img src="/11map/images/left1_r1_c6.png" width="10" height="10"></td></tr><tr> <td height="155" background="/11map/images/new_r2_c1.gif"></td>'+
                          '<td align="right" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">'+
                          '<tr>'+
                          '<td>'+this.title+'</td>'+
                          '<td width="14" align="right"><img src="/11map/images/close.gif" width="14" height="13" border="0"></td>'+
                          '</tr>'+
                          '</table>'+
                          '<table width="265" border="0" cellspacing="0" cellpadding="0"><tr><td width="100%">'+this.content+'</td></tr></table>'+
                          '</td>'+ 
                          '<td background="/11map/images/new_r3_c6.gif">&nbsp;</td> </tr><tr><td ><img src="/11map/images/left1_r5_c1.png" width="10" height="10"></td>'+
						  '<td background="/11map/images/new_r5_c2.gif"></td><td><img src="/11map/images/left1_r5_c6.png" width="10" height="10"></td></tr></table>'+
                          '<table width="377" oncontextmenu="hiddentToolTip()" border="0" cellpadding="0" cellspacing="0">'+
                          '<tr> <td align="center" ><img src="/11map/images/qqqq.png" width="50" height="65"></td></tr></table>';
    this.div.appendChild(this.contentdiv);
    this.div.pin=false;
    this.div.onoff=true;
    this.close=document.createElement("a");
    this.close.style.cursor="hand";
    this.close.style.color="#FFFFFF";
    this.close.style.left=355;
    this.close.style.top=15;
    this.close.style.position="absolute";
    this.close.innerHTML='<span style="font-family:Webdings;font-size:12px"><img src="images/close.gif" width="14" height="13" border="0"></span>';
    this.close.onmouseout=function(){
        this.style.color="#FFFFFF";
    };
    this.close.onmouseover=function(){
        this.style.color="#0000FF";
    };
    this.close.onclick=function(){
        this.parentNode.pin=false;
        this.parentNode.style.visibility="hidden";
        //this.parentNode.parentNode.removeChild(this.parentNode);
    };
 
    this.div.appendChild(this.close);
    
    
    this.div.onmousedown=function(){
        this.style.cursor="default";
        this.leftorigin=parseInt(this.style.left,10);
        this.toporigin=parseInt(this.style.top,10);
        this.xorigin=event.clientX;
        this.yorigin=event.clientY;
        this.drag=true;
    };
    this.div.onmouseup=function(){
        this.style.cursor="default";
        this.drag=false;
    };
    this.div.onmousemove=function(){
        if(false){
            this.style.cursor="move";
            this.style.left=this.leftorigin+event.clientX-this.xorigin;
            this.style.top=this.toporigin+event.clientY-this.yorigin;
        }
    };
    this.div.onmouseout=function(){
        this.style.cursor="default";
        this.drag=false;
    };
    this.setTitle=function(title){
        this.title=title;
        this.contentdiv.innerHTML='<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FAC194">'+'<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF8400">'+'<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+'<td align="left" height=17>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</td>'+'<td valign="top" align="left" style="font-size:12px;color:#000000">&nbsp;<b>'+this.title+'&nbsp;</b></td>'+'</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFF9F4">'+'<table border="0" cellpadding="0" cellspacing="1" align="left">'+'<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+'</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    };
    this.setContent=function($0W){
        this.content=$0W;
        this.contentdiv.innerHTML='<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FAC194">'+'<tr><td>'+'<table border="0" cellspacing="1" cellpadding="0"><tr><td bgcolor="#FF8400">'+'<table border="0" cellspacing="0" cellpadding="0" align="left"><tr>'+'<td align="left" height=17>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</td>'+'<td valign="top" align="left" style="font-size:12px;color:#000000">&nbsp;<b>'+this.title+'&nbsp;</b></td>'+'</tr></table>'+'</td></tr>'+'<tr><td bgcolor="#FFF9F4">'+'<table border="0" cellpadding="0" cellspacing="1" align="left">'+'<tr><td valign="top" align="left" style="font-size:12px;color:#000000">'+this.content+'</td></tr>'+'</table></td></tr>'+'</table></td></tr>'+'</table>';
    };
    this.get=function(){
        return this.div;
    };
    this.show=function(){
        this.div.style.visibility='visible';
    };
    this.hide=function(){
        this.div.style.visibility='hidden';
    }
};

function TileLayer($1a,$1b,$1c,$1d,$1e,$1f){
    this.tilewidth=$1a;
    this.tileheight=$1b;
    this.adjustfactor=100000;
    this.dbtype='.png';
    this.div=new Div(0,0,null,null).get();
    this.markerdiv=new Div(0,0,null,null).get();
    this.markerdiv.style.zIndex=10000;
    this.div.appendChild(this.markerdiv);
    this.style=this.div.style;
    if(!$1c){
        return;
    };
    this.lngscalefactor=$1c;
    this.latscalefactor=$1c;
    if(!$1d){
        return;
    };
    this.directory=$1d;
    if(!$1e){
        return;
    };
    this.gridfactor=$1e;
    if(!$1f){
        return;
    };
    this.mapdb=$1f;
    this.imgs=new Array();
    this.tile=new Div(0,0,null,null).get();
    this.tile.style.zIndex=1000;
    this.tile.root=this;
    this.div.appendChild(this.tile);
    this.set=function($n,$o,$0r,$0x){
        this.lat=$n;
        this.lng=$o;
        this.width=$0r;
        this.height=$0x;
        var $1g=Math.floor((this.lng+this.lngscalefactor/this.adjustfactor)/this.lngscalefactor);
        var $1h=Math.floor((this.lat+this.latscalefactor/this.adjustfactor)/this.latscalefactor);
        var $1i=$0r/2-Math.round(((this.lng*this.adjustfactor)%(this.lngscalefactor*this.adjustfactor))*this.tilewidth/(this.lngscalefactor*this.adjustfactor));
        var $1j=$0x/2-this.tileheight+Math.round(((this.lat*this.adjustfactor)%(this.latscalefactor*this.adjustfactor))*this.tileheight/(this.latscalefactor*this.adjustfactor));
        var $1k=Math.ceil($0r/this.tilewidth/2);
        var $1l=Math.ceil($0x/this.tileheight/2);
        for(var $1m=-$1k;$1m<=$1k;$1m++){
            var $1n=Math.floor(($1g+$1m)/this.gridfactor);
            var $1o=$1g+$1m-$1n*this.gridfactor;
            var $0q=$1m*this.tilewidth+this.gridfactor;
            for(var $1p=-$1l;$1p<=$1l;$1p++){
                var $1q=this.mapdb+'\/'+this.directory+'\/';
                var $1r=Math.floor(($1h+$1p)/(this.gridfactor));
                if($1r<0){
                    $1r+=1;
                };
                var $1s=$1h+$1p-$1r*this.gridfactor;
                $1q+=$1n+'/'+$1r+'/'+$1o+'_'+$1s+this.dbtype;
                var $0q=$1m*this.tilewidth+$1i;
                var top=-$1p*this.tileheight+$1j;
                if(this.hasImage($1q)){
                    var $1t=this.hasImage($1q);
                    $1t.get().style.left=$0q;
                    $1t.get().style.top=top;
                    $1t.onScreen=true;
                }
                else{
                    var $1t=new MyImage($0q,top,$1q);
                    $1t.key=$1q;
                    $1t.onScreen=true;
                    this.imgs[this.imgs.length]=$1t;
                    $1t.get().root=this;
                    $1t.get().onerror=function(){
                        this.onerror=null;
                       
                        this.src=$f+'map_img/map/maskerr.png';
                        this.width=this.root.tilewidth;
                        this.height=this.root.tileheight;
                    };
                    this.tile.appendChild($1t.get());
                }
            }
        };
        this.deleteOutScreenImages();
    };
    this.get=function(){
        return this.div;
    };
    this.hide=function(){
        this.div.style.visibility="hidden";
        this.tile.style.visibility="hidden";
        this.markerdiv.style.visibility='hidden';
    };
    this.show=function(){
        this.style.visibility="visible";
        this.tile.style.visibility="visible";
        this.markerdiv.style.visibility='visible';
    };
    this.addMarkers=function($1u){
        this.markers=$1u;
        for(var i=0;i<$1u.length;i++){
            this.addMarker($1u[i]);
        }
    };
    this.addMarker=function($1v){
        var $0q=0;
        var top=0;
        switch($1v.toString()){
            case "Point":
            case "LabelPoint":
				var $1w=this.getPixel($1v.lat,$1v.lng);
				 $0q=$1w.left;
				top=$1w.top;
				break;
            case "Path":
            case "Region":
                var $1x="";
                var $1w;
				for(var i=0;i<$1v.latlngs.length;i++){
					$1w=this.getPixel($1v.latlngs[i].lat,$1v.latlngs[i].lng);
					$1x+=$1w.left+","+$1w.top+" ";
				};
				if($1v.polyline.points){
					$1v.polyline.points.value=$1x;
				}
				else{
					$1v.polyline.points=$1x;
				};
				break;
            case 'RectRegion':
				var $1y=this.getPixel($1v.leftbottom.lat,$1v.leftbottom.lng);
				var $1z=this.getPixel($1v.righttop.lat,$1v.righttop.lng);
				$0q=($1y.left<$1z.left)?$1y.left:$1z.left;
				top=($1z.top<$1y.top)?$1z.top:$1y.top;
		        $1v.rect.style.width=Math.abs($1z.left-$1y.left);
                $1v.rect.style.height=Math.abs($1z.top-$1y.top);
				break;
             case 'CircleRegion':
				var $1y=this.getPixel($1v.center.lat-$1v.radius,$1v.center.lng-$1v.radius);
				var $1z=this.getPixel($1v.center.lat+$1v.radius,$1v.center.lng+$1v.radius);
				$0q=($1y.left<$1z.left)?$1y.left:$1z.left;
				top=($1z.top<$1y.top)?$1z.top:$1y.top;
				$1v.oval.style.width=Math.abs($1z.left-$1y.left);
				$1v.oval.style.height=Math.abs($1z.top-$1y.top);
				break;
            default:return;
            break;
        };
        $1v.div.style.left=$0q;
        $1v.div.style.top=top;
        this.markerdiv.appendChild($1v.div);
    };
    this.getPixel=function($n,$o){
        var $0q=this.width/2+Math.round(($o-this.lng)/this.lngscalefactor*this.tilewidth);
        var top=this.height/2-Math.round(($n-this.lat)/this.latscalefactor*this.tileheight);
        return new Pixel($0q,top);
    };
    this.getLatLng=function($0q,top){
        var $o=Math.round((this.lng+($0q-this.width/2)*this.lngscalefactor/this.tilewidth)*100000)/100000;
        var $n=Math.round((this.lat-(top-this.height/2)*this.latscalefactor/this.tileheight)*100000)/100000;
        return new LatLng($n,$o);
    };
    this.clearMarkers=function(){
        this.markerdiv.innerHTML='';
    };
    this.clearImages=function(){
        this.tile.innerHTML='';
        for(var $1A in this.imgs){
            this.imgs[$1A].get().src=null;
            this.imgs[$1A]=null;
        };
        this.imgs=new Array();
    };
    this.stopImages=function(){
        for(var $1A=0;$1A<this.imgs.length;$1A++){
            if(!this.imgs[$1A].get().complete){
                this.imgs[$1A].get().src=null;
                this.imgs[$1A].key='invalid';
                this.imgs[$1A].onScreen=false;
            }
            else{
                this.imgs[$1A].onScreen=true;
            }
        };
        this.deleteOutScreenImages();
    };
    this.hasImage=function($1B){
        for(var $1A=0;$1A<this.imgs.length;$1A++){
            if(this.imgs[$1A].key==$1B){
                return this.imgs[$1A];
            }
        };
        return false;
    };
    this.deleteOutScreenImages=function(){
        var $1C=new Array();
        for(var $1A in this.imgs){
            if(this.imgs[$1A].onScreen){
                $1C[$1C.length]=this.imgs[$1A];
                this.imgs[$1A].onScreen=false;
            }
            else{
                if(this.imgs[$1A].get){
                    if(this.tile.contains(this.imgs[$1A].get())){
                        this.tile.removeChild(this.imgs[$1A].get());
                    };
                    this.imgs[$1A].get().src=null;
                }
            };
            this.imgs[$1A]=null;
        };
        this.imgs=$1C;
        $1C=null;
    };
    this.hideMarkers=function(){
        this.markerdiv.style.visibility='hidden';
    };
    this.showMarkers=function(){
        this.markerdiv.style.visibility='visible';
    };
    this.setScaleFactor=function($1c){
        this.scalefactor=$1c;
        this.lngscalefactor=$1c;
        this.latscalefactor=$1c;
    }
};


function Point($M,$1D,$0V,$1E,$1F,$1G){
    this.label=$1E;
    this.detail=$1F;
    this.type="Point";
    this.latlng=$M;
    this.lat=$M.lat;
    this.lng=$M.lng;
    this.labelpath=$1G;
    this.div=new Div(0,0,null,null).get();
    this.div.style.zIndex=$1D;
    this.style=this.div.style;
    if(this.detail){
        var $0r=this.label.length*15+40;
        if($0r<180){
            $0r=180;
        };
        this.div.detail=new FloatDialog(20,10,$0r,this.label,this.detail);
       
        this.div.detail.get().onmouseover=function(){
            this.depth=this.parentNode.style.zIndex;
            this.parentNode.style.zIndex=10000;
        };
        this.div.detail.get().onmouseout=function(){
            this.parentNode.style.zIndex=this.depth;
        };
        this.div.detail.style.zIndex=10000;
        this.div.detail.hide();
        this.div.appendChild(this.div.detail.get());
    };
    
    if(this.labelpath){
        this.labeldiv=new Div(-4,-8,this.label.length*15+40,17).get();
        this.labeldiv.style.zIndex=$1D;
        this.labeldiv.innerHTML='<table border=0 cellspacing=0 cellpadding=0><tr><td><img src='+this.labelpath+'/label1.gif></td><td style="background-image:url('+this.labelpath+'/label2.gif);background-repeat:repeat-x;color:FF0000;font-size:12px;cursor:default" >'+$1E+'</td><td><img src='+this.labelpath+'/label3.gif></td></tr></table>';
        this.div.appendChild(this.labeldiv);
        if(this.div.detail){
            this.labeldiv.onmouseover=function(){
                this.pin=false;
                if(this.parentNode.style.zIndex!=10000){
                    this.oldIndex=this.parentNode.style.zIndex;
                };
                this.parentNode.style.zIndex=10000;
                if(!this.parentNode.detail.get().pin){
                    this.parentNode.detail.get().style.left=20;
                    this.parentNode.detail.get().style.top=10;
                };
                this.parentNode.detail.show();
            };
            this.labeldiv.onmouseout=function(){
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.style.zIndex=this.oldIndex;
                    this.parentNode.detail.hide();
                }
            };
            this.labeldiv.onclick=function(){
                this.pin=true;
                this.parentNode.detail.get().pin=true;
            }
        }
    }
    else{
        this.img=new MyImage(0,0,$0V).get();
        this.img.style.zIndex=$1D;
        this.img.onload=function(){
            this.style.top=-this.height;            
        };
        this.img.style.top=-this.img.height;
        this.div.appendChild(this.img);
        if(this.div.detail){
        //济南修改 去掉onmouseover事件
            //this.img.onmouseover=function(){
                //this.pin=false;
                //if(this.parentNode.style.zIndex!=10000){
                   // this.depth=this.parentNode.style.zIndex;
                //};
                //this.parentNode.style.zIndex=10000;
                //if(!this.parentNode.detail.get().pin){
                    //this.parentNode.detail.get().style.left=20;
                    //this.parentNode.detail.get().style.top=10;
                //};
               // this.parentNode.detail.show();
            //};
            this.img.onclick=function(){
                //this.pin=true;
                //this.parentNode.detail.get().pin=true;
                //this.div.detail.show();//济南添加修改 原来没有
                this.pin=false;
                if(this.parentNode.style.zIndex!=10000){
                 this.depth=this.parentNode.style.zIndex;
               };
                this.parentNode.style.zIndex=10000;
                if(!this.parentNode.detail.get().pin){
                    this.parentNode.detail.get().style.left=20;
                    this.parentNode.detail.get().style.top=10;
                };
                this.parentNode.detail.show();
            };
            this.img.onmouseout=function(){
                this.parentNode.style.zIndex=this.depth;
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.detail.hide();
                }
            }
        }
    };
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Point';
    };
    this.showDetail=function(){
        if(this.detail){
        
            this.pin=true;
            this.div.detail.get().pin=true;
            this.div.detail.show();
            
        }
    };
    this.hideDetail=function(){
        if(this.detail){
            this.pin=false;
            this.div.detail.get().pin=false;
            this.div.detail.hide();
        }
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};


function PointPOI($M,$1D,$0V,$1E,$1F,$1G){
    this.label=$1E;
    this.detail=$1F;
    this.type="Point";
    this.latlng=$M;
    this.lat=$M.lat;
    this.lng=$M.lng;
    this.labelpath=$1G;
    this.div=new Div(0,0,null,null).get();
    this.div.style.zIndex=$1D;
    this.style=this.div.style;
    if(this.detail){
        var $0r=this.label.length*15+40;
        if($0r<180){
            $0r=180;
        };
        this.div.detail=new FloatSyhDialog(-192,-211,$0r,this.label,this.detail);
       
        this.div.detail.get().onmouseover=function(){
            this.depth=this.parentNode.style.zIndex;
            this.parentNode.style.zIndex=10000;
        };
        this.div.detail.get().onmouseout=function(){
            this.parentNode.style.zIndex=this.depth;
        };
        this.div.detail.style.zIndex=10000;
        this.div.detail.hide();
        this.div.appendChild(this.div.detail.get());
    };
    //alert(this.div.innerHTML);
   //prompt('',this.div.innerHTML);
    if(this.labelpath){
        this.labeldiv=new Div(-4,-8,this.label.length*15+40,17).get();
        this.labeldiv.style.zIndex=$1D;
        this.labeldiv.innerHTML='<table border=0 cellspacing=0 cellpadding=0><tr><td><img src='+this.labelpath+'/label1.gif></td><td style="background-image:url('+this.labelpath+'/label2.gif);background-repeat:repeat-x;color:FF0000;font-size:12px;cursor:default" >'+$1E+'</td><td><img src='+this.labelpath+'/label3.gif></td></tr></table>';
        this.div.appendChild(this.labeldiv);
        if(this.div.detail){
            this.labeldiv.onmouseover=function(){
                this.pin=false;
                if(this.parentNode.style.zIndex!=10000){
                    this.oldIndex=this.parentNode.style.zIndex;
                };
                this.parentNode.style.zIndex=10000;
                if(!this.parentNode.detail.get().pin){
                    this.parentNode.detail.get().style.left=20;
                    this.parentNode.detail.get().style.top=10;
                };
                this.parentNode.detail.show();
            };
            this.labeldiv.onmouseout=function(){
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.style.zIndex=this.oldIndex;
                    this.parentNode.detail.hide();
                }
            };
            this.labeldiv.onclick=function(){
                this.pin=true;
                this.parentNode.detail.get().pin=true;
            }
        }
    }
    else{
        this.img=new MyImage(0,0,$0V).get();
        this.img.style.zIndex=$1D;
        this.img.onload=function(){
            this.style.top=-this.height;            
        };
        this.img.style.top=-this.img.height;
        this.div.appendChild(this.img);
        if(this.div.detail){
        //济南修改去掉onmouseover事件
            //this.img.onmouseover=function(){
                //this.pin=false;
                //if(this.parentNode.style.zIndex!=10000){
                   // this.depth=this.parentNode.style.zIndex;
                //};
                //this.parentNode.style.zIndex=10000;
                //if(!this.parentNode.detail.get().pin){
                    //this.parentNode.detail.get().style.left=20;
                    //this.parentNode.detail.get().style.top=10;
                //};
               // this.parentNode.detail.show();
            //};
            this.img.onclick=function(){
               // this.pin=true;
                //this.parentNode.detail.get().pin=true;
                //this.div.detail.show();//济南添加修改 原来没有
                this.pin=false;
                if(this.parentNode.style.zIndex!=10000){
                 this.depth=this.parentNode.style.zIndex;
               };
                this.parentNode.style.zIndex=10000;
                if(!this.parentNode.detail.get().pin){
                    this.parentNode.detail.get().style.left=0;
                    this.parentNode.detail.get().style.top=-50;
                };
                this.parentNode.detail.show();
            };
            this.img.onmouseout=function(){
                this.parentNode.style.zIndex=this.depth;
                if(!this.pin&&!this.parentNode.detail.get().pin){
                    this.parentNode.detail.hide();
                }
            }
        }
    };
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Point';
    };
    this.showDetail=function(){
        if(this.detail){
        
            this.pin=true;
            this.div.detail.get().pin=true;
            this.div.detail.show();
            
        }
    };
    this.hideDetail=function(){
        if(this.detail){
            this.pin=false;
            this.div.detail.get().pin=false;
            this.div.detail.hide();
        }
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
    
    
};

function Path($04,$1H,$1I){
    this.type="Path";
    this.color=$1H;
    this.weight=$1I;
    this.latlngs=$04;
    //alert($04);
    this.div=new Div(0,0,null,null).get();
    this.polyline=document.createElement("v:polyline");
    this.polyline.unselectable='on';
    this.style=this.polyline.style;
    this.polyline.strokecolor=this.color;
    this.polyline.strokeweight=this.weight;
    this.polyline.fill=false;
    this.polyline.filled=false;
    //this.stroke=document.createElement("v:stroke");
    //this.stroke.opacity=0.5;
    //this.stroke.joinstyle="round";
    //this.stroke.startcap="round";
    //this.stroke.startarrow="diamond";
   // this.stroke.endarrow="classic";
   // this.stroke.fill=false;
   // this.polyline.appendChild(this.stroke);
    this.div.appendChild(this.polyline);
    
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Path';
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};

function RectRegion($1J,$1K){
    this.type="Region";
    this.bounds=$1J;
    this.leftbottom=$1J.leftbottom;
    this.righttop=$1J.righttop;
    this.div=new Div(0,0,null,null).get();
    this.rect=document.createElement("v:rect");
    this.rect.unselectable='on';
    this.style=this.rect.style;
    this.rect.fillcolor=$1K;
    this.style.filter='alpha(opacity=30)';
    this.div.appendChild(this.rect);
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'RectRegion';
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};

function RectRegion2($1J,$1K){
    this.type="Region";
    this.bounds=$1J;
    this.leftbottom=$1J.leftbottom;
    this.righttop=$1J.righttop;
    this.div=new Div(0,0,null,null).get();
    this.rect=document.createElement("v:rect");
    this.rect.unselectable='on';
    this.style=this.rect.style;
    this.rect.fillcolor=$1K;
    this.style.filter='alpha(opacity=30)';
    this.div.appendChild(this.rect);
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'RectRegion2';
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};
function StMap($0q,top,$0r,$0x,$n,$o,$1L,$1M,bz){
    this.zoomEnabled=true;
    this.dragEnabled=true;
    this.leftbottom=null;
    this.righttop=null;
    this.enableDblclick=true;
    this.bzbz=bz;
    if(bz==1)
    {    
   
    this.directorys=new Array('5','6','7','8','9','10','11','12');
    this.scalefactors=new Array('1',0.4,0.2,0.1,0.04,0.02,0.01,0.004);
    this.gridfactors=new Array('10',10,10,10,10,40,40,40);    
    }
    if(bz==18)//三维状态
    {
    this.directorys=new Array('8','9','10','11','12','13');
    this.scalefactors=new Array(0.1,0.04,0.02,0.01,0.004,0.002);
    this.gridfactors=new Array(10,10,40,40,40,40);    
      
    }
    else if(bz==12)
    {
    this.directorys=new Array('5','6','7','8','9','10');
    this.scalefactors=new Array(1,0.4,0.2,0.1,0.04,0.02);
    this.gridfactors=new Array(10,10,10,10,10,40);
    }
    else if(bz==2)//青岛
    {
     this.directorys=new Array('5','6','7','8','9','10','11');
    this.scalefactors=new Array(1,0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,10,40,40);        
    }
    else if(bz==16)//滨州
    {
     this.directorys=new Array('6','7','8','9','10');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02);
    this.gridfactors=new Array(10,10,10,10,40);      
    }
     else if(bz==5)//东营
    {
     this.directorys=new Array('6','7','8','9','10');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02);
    this.gridfactors=new Array(10,10,10,10,40);      
    }
     else if(bz==4)//枣庄
    {
     this.directorys=new Array('6','7','8','9','10');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02);
    this.gridfactors=new Array(10,10,10,10,40);      
    }
     else if(bz==9)//泰安
    {
     this.directorys=new Array('6','7','8','9','10');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02);
    this.gridfactors=new Array(10,10,10,10,40);      
    }
    else if(bz==8)//济宁
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
    else if(bz==11)//日照
    {
    this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
    else if(bz==13)//临沂
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
    
    else if(bz==7)//潍坊
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
    else if(bz==3)//淄博
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
     else if(bz==15)//聊城
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
     else if(bz==17)//菏泽
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
    else if(bz==10)//威海
    {
     this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);      
    }
    else if(bz==6)//烟台
    {
    this.directorys=new Array('6','7','8','9','10','11');
    this.scalefactors=new Array(0.4,0.2,0.1,0.04,0.02,0.01);
    this.gridfactors=new Array(10,10,10,10,40,40);  
    }
    else if(bz==14)//德州
    {
    this.directorys=new Array('8','9','10','11',12);
    this.scalefactors=new Array(0.1,0.04,0.02,0.01,0.004);
    this.gridfactors=new Array(10,10,40,40,40);  
    }
    
    
    else
    {
     
     this.directorys=new Array('5','6','7','8','9','10','11','12');
    this.scalefactors=new Array('1',0.4,0.2,0.1,0.04,0.02,0.01,0.004);
    this.gridfactors=new Array('10',10,10,10,10,40,40,40);        
    }
    
    this.isScrolling=false;
    this.depthhandler=new DepthHandler(100);
    this.tilewidth=256;
    this.tileheight=256;
    
    this.zoomlevels=this.directorys.length;
    if($n){
        this.lat=$n;
    }
    else{
        this.lat=1;
    };
    if($o){
        this.lng=$o;
    }
    else{
        this.lng=1;
    };
    if($1L<this.zoomlevels){
        this.zoom=$1L;
    }
    else{
        this.zoom=0;
    };
    this.maproot=$1M;
    this.mapdb=this.maproot+'/typical/';
    this.searchEnabled=true;
    this.left=$0q;
    this.top=top;
    this.width=$0r;
    this.height=$0x;
    this.markers=new Array();
    this.staticMarkers=new Array();
    this.tilelayers=new Array();
    this.container=new Div(this.left,this.top,this.width,this.height).get();
    this.container.style.clip="rect(0 "+this.width+" "+this.height+" 0)";
    this.container.style.backgroundColor='#DDDDDD';
    this.container.style.overflow="hidden";
    this.container.style.visibility="hidden";
    this.map=new Div(0,0,this.width,this.height).get();
    this.map.style.backgroundColor='#EBEAE8';
    this.markerdiv=new Div(0,0,null,null).get();
    this.mapmask=new Div(0,0,this.width,this.height).get();
    this.mapmask.style.backgroundImage='url('+$f+'map_img/map/mask.gif)';
    this.mapmask.style.cursor='url('+$f+'map_img/map/openhand.cur),default';
    this.mapmask.root=this;
    this.mapmask.onmousewheel=function(){
        if(this.root.iszooming){
            return;
        };
        var $1L=event.wheelDelta/120;
        if($1L>0){
            this.root.setZoomLevel(this.root.zoom+1);
        }
        else if($1L<0){
            this.root.setZoomLevel(this.root.zoom-1);
        };
        return;
    };
    this.recentkey=0;
    if(!document.onkeydown){
        document.root=this;
        document.onkeydown=function(){   
            var $1N=window.event.clientX;
            var $1O=window.event.clientY; 
            var $1J=this.root.get().getBoundingClientRect();
           
            if($1N>$1J.left&&$1N<$1J.right&&$1O>$1J.top&&$1O<$1J.bottom){
                this.root.recentkey=window.event.keyCode;
                switch(window.event.keyCode){
                    case 65:case 37:this.root.panWest();
                    break;
                    case 83:case 40:this.root.panSouth();
                    break;
                    case 68:case 39:this.root.panEast();
                    break;
                    case 87:case 38:this.root.panNorth();
                    break;
                    case 187:case 33:this.root.zoomIn();
                    break;
                    case 189:case 34:this.root.zoomOut();
                    break;
                    default:break;
                };
                this.root.notify('onkeyreleased');
            }
        }
    };
    this.mapmask.ondblclick=function(){
        if(this.root.enableDblclick){
            var $1J=this.getBoundingClientRect();
            var $0q=window.event.clientX-$1J.left;
            var top=window.event.clientY-$1J.top;
            this.root.moveTo($0q,top);
            this.root.map.drag=false;
        };
        this.root.notify('ondblclicked');
    };
    this.mapmask.oncontextmenu=function(){
        this.root.notify('oncontextmenu');
    };
    this.mapmask.onclick=function(){
        var $1J=this.getBoundingClientRect();
        var $0q=window.event.clientX-$1J.left;
        var top=window.event.clientY-$1J.top;
        var mLatLng=this.root.getLatLng($0q,top);
        //alert(mLatLng.lat+' '+mLatLng.lng);
       // OnMapMouseClick(mLatLng.lat,mLatLng.lng)
        this.root.notify('onclicked');
    };
    this.mapmask.onmousedown=function(){
        this.root.notify('onmousedown');
        this.setCapture();
        if(!this.root.dragEnabled){
            return;
        };
        this.drag=true;
        this.dragged=false;
        this.leftorigin=parseInt(this.root.map.style.left,10);
        this.toporigin=parseInt(this.root.map.style.top,10);
        this.xoffset=event.clientX-this.leftorigin;
        this.yoffset=event.clientY-this.toporigin;
        this.left=parseInt(this.root.map.style.left,10);
        this.top=parseInt(this.root.map.style.top,10);
        this.style.cursor='url('+$f+'map_img/map/closedhand.cur),move';
        setRTimeout(this,this.update,1000);
    };
    this.mapmask.onmousemove=function(){
        this.root.notify('onmousemoved');
        if(!this.root.dragEnabled){
            return;
        };
        if(this.drag){
            this.style.cursor='url('+$f+'map_img/map/closedhand.cur),move';
            this.dragged=true;
            this.ondrag();
        }
    };
    this.mapmask.onmouseup=function(){
        this.root.notify('onmouseup');
        this.style.cursor='url('+$f+'map_img/map/openhand.cur),default';
        this.releaseCapture();
        if(!this.root.dragEnabled){
            return;
        };
        this.drag=false;
        if(this.dragged){
            this.dragged=false;
            this.ondragend();
        }
    };
    this.mapmask.ondrag=function(){
        if(!this.root.dragEnabled){
            return;
        };
        if(this.drag){
            this.root.map.style.left=event.clientX-this.xoffset;
            this.root.map.style.top=event.clientY-this.yoffset;
            this.root.markerdiv.style.left=event.clientX-this.xoffset;
            this.root.markerdiv.style.top=event.clientY-this.yoffset;
        }
    };
    this.mapmask.update=function(){
        if(!this.root.dragEnabled){
            return;
        };
        if(!this.drag){
            return;
        };
        var $0q=parseInt(this.root.map.style.left,10);
        var top=parseInt(this.root.map.style.top,10);
        if(this.left==$0q||this.top==top){
            setRTimeout(this,this.update,1000);
            return;
        };
        this.left=$0q;
        this.top=top;
        var $1P=this.root.tilelayers[this.root.zoom].getLatLng(this.root.width/2-this.left+this.leftorigin,this.root.height/2-this.top+this.toporigin);
        this.root.setCenter($1P.lat,$1P.lng);
        this.xoffset=this.left+this.xoffset;
        this.yoffset=this.top+this.yoffset;
        this.root.map.style.left=this.leftorigin;
        this.root.map.style.top=this.toporigin;
        this.root.markerdiv.style.left=this.leftorigin;
        this.root.markerdiv.style.top=this.toporigin;
        this.left=parseInt(this.root.map.style.left,10);
        this.top=parseInt(this.root.map.style.top,10);
        setRTimeout(this,this.update,1000);
    };
    this.mapmask.ondragend=function(){
        if(!this.root.dragEnabled){
            return;
        };
        var $0q=parseInt(this.root.map.style.left,10);
        var top=parseInt(this.root.map.style.top,10);
        var $1P=this.root.tilelayers[this.root.zoom].getLatLng(this.root.width/2-$0q,this.root.height/2-top);
        this.root.setCenter($1P.lat,$1P.lng);
        this.root.map.style.left=0;
        this.root.map.style.top=0;
        this.root.markerdiv.style.left=0;
        this.root.markerdiv.style.top=0;
    };
    this.container.appendChild(this.map);
    this.container.appendChild(this.mapmask);
    this.container.appendChild(this.markerdiv);
    for(var i=0;i<this.zoomlevels;i++){
       this.tilelayers[i]=new TileLayer(this.tilewidth,this.tileheight,this.scalefactors[i],this.directorys[i],this.gridfactors[i],this.mapdb);
       this.tilelayers[i].root=this;
       this.map.appendChild(this.tilelayers[i].get());
    };
    this.resetScaleFactors=function(){
        for(var i=0;i<this.tilelayers.length;i++){
            this.tilelayers[i].setScaleFactor(this.scalefactors[i]);
        }
    };
    this.toString=function(){
        return 'Map';
    };
    this.show=function(){
        for(var i=0;i<this.tilelayers.length;i++){
            this.tilelayers[i].style.zIndex=i;
            this.tilelayers[i].hide();
        };
        if(this.zoomdiffer==-1&&this.isValidZoom(this.zoom-1)){
            this.tilelayers[this.zoom-1].style.zIndex=100;
            this.tilelayers[this.zoom-1].show();
        }
        else if(this.zoomdiffer==1&&this.isValidZoom(this.zoom+1)){
            this.tilelayers[this.zoom+1].style.zIndex=100;
            this.tilelayers[this.zoom+1].show();
        };
        this.markerdiv.style.visibility='visible';
        this.tilelayers[this.zoom].style.left=0;
        this.tilelayers[this.zoom].style.top=0;
        this.tilelayers[this.zoom].zoom=1;
        this.tilelayers[this.zoom].style.zIndex=1000;
        this.tilelayers[this.zoom].show();
        this.container.style.visibility="visible";
        if(this.toolbox){
            this.toolbox.show();
        }
    };
    this.hide=function(){
        this.container.style.visibility="hidden";
        this.markerdiv.style.visibility='hidden';
        this.map.style.visibility='hidden';
        for(var i=0;i<this.tilelayers.length;i++){
            this.tilelayers[i].hide();
        };
        if(this.toolbox){
            this.toolbox.hide();
        }
    };
    this.iszooming=false;
    this.setZoomDirectly=function($1L){
        if(!this.zoomEnabled){
            return;
        };
        this.iszooming=true;
        this.newzoom=$1L;
        if(this.newzoom<0){
            this.newzoom=0;
        };
        if(this.newzoom>=this.zoomlevels){
            this.newzoom=this.zoomlevels-1;
        };
        if(this.zoom!=this.newzoom){
            this.tilelayers[this.newzoom].lat=this.lat;
            this.tilelayers[this.newzoom].lng=this.lng;
            this.zoom=this.newzoom;
            this.tilelayers[this.newzoom].style.zoom=1;
            this.tilelayers[this.newzoom].style.left=0;
            this.tilelayers[this.newzoom].style.top=0;
            this.refreshMap();
            this.notify('onzoomchanged');
            this.iszooming=false;
        }
    };
    this.setZoomLevel=function($1L){
        if(!this.zoomEnabled){
            return;
        };
        this.iszooming=true;
        this.newzoom=$1L;
        if(this.newzoom<0){
            this.newzoom=0;
        };
        if(this.newzoom>=this.zoomlevels){
            this.newzoom=this.zoomlevels-1;
        };
        if(this.zoom!=this.newzoom){
            this.tilelayers[this.newzoom].lat=this.lat;
            this.tilelayers[this.newzoom].lng=this.lng;
            if(Math.abs(this.zoom-this.newzoom)==1){
                this.hideMarkers();
                this.zoomdiffer=this.zoom-this.newzoom;
                this.hideOtherTileLayers();
                this.zoomtime=10;
                this.dynzoomdes=(this.scalefactors[this.zoom]/this.scalefactors[this.newzoom]);
                this.dynzoomstep=((this.scalefactors[this.zoom]/this.scalefactors[$1L])-1)/10;
                this.dynleftstep=(this.dynzoomstep*this.width)/2;
                this.dyntopstep=(this.dynzoomstep*this.height)/2;
                setRTimeout(this,this.dynZoom,10);
            }
            else{
                this.zoom=this.newzoom;
                this.tilelayers[this.newzoom].style.zoom=1;
                this.tilelayers[this.newzoom].style.left=0;
                this.tilelayers[this.newzoom].style.top=0;
                this.refreshMap();
                this.notify('onzoomchanged');
                this.iszooming=false;
            }
        }
        else{
            this.iszooming=false;
        }
    };
    this.dynZoom=function(){
        this.tilelayers[this.zoom].style.zoom=this.dynzoomdes-(--this.zoomtime)*this.dynzoomstep;
        this.tilelayers[this.zoom].style.left=parseInt(this.tilelayers[this.zoom].style.left,10)-this.dynleftstep;
        this.tilelayers[this.zoom].style.top=parseInt(this.tilelayers[this.zoom].style.top,10)-this.dyntopstep;
        if(this.zoomtime>0){
            setRTimeout(this,this.dynZoom,10);
        }
        else{
            this.zoom=this.newzoom;
            this.tilelayers[this.zoom].style.zoom=1;
            this.tilelayers[this.zoom].style.left=0;
            this.tilelayers[this.zoom].style.top=0;
            this.refreshMap();
            this.notify('onzoomchanged');
            setRTimeout(this,this.finishDynZooming,100);
        }
    };
    this.hideOtherTileLayers=function(){
        for(var $1Q=0;$1Q<this.tilelayers.length;$1Q++){
            if($1Q==this.zoom){
                continue;
            };
            this.tilelayers[$1Q].hide();
        }
    };
    this.finishDynZooming=function(){
        this.iszooming=false;
    };
    this.refreshMap=function(){
        for(var $1Q=0;$1Q<this.tilelayers.length;$1Q++){
            this.tilelayers[$1Q].stopImages();
        };
        this.hideMarkers();
        this.tilelayers[this.zoom].set(this.lat,this.lng,this.width,this.height);
        this.refreshMarkers();
        this.show();
    };
    this.paintMarker=function($1v){
        var $0q=0;
        var top=0;
        switch($1v.toString()){
            case "Point":case "LabelPoint":var $1w=this.tilelayers[this.zoom].getPixel($1v.lat,$1v.lng);
            $0q=$1w.left;
            top=$1w.top;
            break;
            case "Path":case "Region":var $1x="";
            var $1w;
            for(var i=0;i<$1v.latlngs.length;i++){
                $1w=this.tilelayers[this.zoom].getPixel($1v.latlngs[i].lat,$1v.latlngs[i].lng);
                $1x+=$1w.left+","+$1w.top+" ";
            };

            if($1v.polyline.points){
                $1v.polyline.points.value=$1x;
            }
            else{
                $1v.polyline.points=$1x;
            };
            break;
            case 'RectRegion':var $1y=this.getPixel($1v.leftbottom.lat,$1v.leftbottom.lng);
            var $1z=this.getPixel($1v.righttop.lat,$1v.righttop.lng);
            $0q=($1y.left<$1z.left)?$1y.left:$1z.left;
            top=($1z.top<$1y.top)?$1z.top:$1y.top;
            $1v.rect.style.width=Math.abs($1z.left-$1y.left);
            $1v.rect.style.height=Math.abs($1z.top-$1y.top);
            break;
            case 'CircleRegion':var $1y=this.getPixel($1v.center.lat-$1v.radius,$1v.center.lng-$1v.radius);
            var $1z=this.getPixel($1v.center.lat+$1v.radius,$1v.center.lng+$1v.radius);
            $0q=($1y.left<$1z.left)?$1y.left:$1z.left;
            top=($1z.top<$1y.top)?$1z.top:$1y.top;
            $1v.oval.style.width=Math.abs($1z.left-$1y.left);
            $1v.oval.style.height=Math.abs($1z.top-$1y.top);
            break;
            default:break;
        };
        if($1v.div){
           
            $1v.div.style.left=$0q;
            $1v.div.style.top=top;
            this.markerdiv.appendChild($1v.div);
        }
    };
    this.refreshMarkers=function(){
        this.showMarkers();
    };
    this.refreshStaticMarkers=function(){
        this.tilelayers[this.zoom].addMarkers(this.staticMarkers);
        this.tilelayers[this.zoom].showMarkers();
    };
    this.clearMarkers=function(){
        this.markers=new Array();
        this.staticMarkers=new Array();
        this.markerdiv.innerHTML='';
        for(var i=0;i<this.tilelayers.length;i++){
            this.tilelayers[i].clearMarkers();
        }
    };
    this.clearStaticMarkers=function(){
        this.staticMarkers=new Array();
        for(var i=0;i<this.tilelayers.length;i++){
            this.tilelayers[i].clearMarkers();
        }
    };
    this.addMarker=function($1v){
        if($1v){
            this.markers[this.markers.length]=$1v;
        }
    };
    this.addLabelMarker=function($M,$1D,$0V,$1R,$1S,$1T,$1E,$1F){
        var $1w=new LabelPoint($M,$1D,$0V,$1R,$1S,$1T,$1E,$1F);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.addPointMarker=function($M,$1D,$0V,$1E,$1F,$1G){
        var $1w=new Point($M,$1D,$0V,$1E,$1F,$1G);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
     this.addPointPOIMarker=function($M,$1D,$0V,$1E,$1F,$1G){
        var $1w=new PointPOI($M,$1D,$0V,$1E,$1F,$1G);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.addPathMarker=function($04,$1H,$1I){
        var $1w=new Path($04,$1H,$1I);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.addStaticRectRegionMarker=function($1J,$1K){
        var $1w=new RectRegion($1J,$1K);
        this.staticMarkers[this.staticMarkers.length]=$1w;
        return $1w;
    };
    
        this.addStaticRectRegionMarker2=function($1J,$1K){
        var $1w=new RectRegion2($1J,$1K);
        this.staticMarkers[this.staticMarkers.length]=$1w;
        return $1w;
    };   
    
    this.addStaticCircleRegionMarker=function($1U,$0M,$1K){
        var $1w=new CircleRegion($1U,$0M,$1K);
        this.staticMarkers[this.staticMarkers.length]=$1w;
        return $1w;
    };
    this.addStaticPathMarker=function($04,$1H,$1I){
        var $1w=new Path($04,$1H,$1I);
        this.staticMarkers[this.staticMarkers.length]=$1w;
        return $1w;
    };
    this.addStaticRegionMarker=function($04,$1H,$1K,$1I){
        var $1w=new Region($04,$1H,$1K,$1I);
        this.staticMarkers[this.staticMarkers.length]=$1w;
        return $1w;
    };
    this.addRegionMarker=function($04,$1H,$1K,$1I){
        var $1w=new Region($04,$1H,$1K,$1I);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.onzoomchanged=new Array();
    this.onboundschanged=new Array();
    this.onresized=new Array();
    this.onclicked=new Array();
    this.ondblclicked=new Array();
    this.onmousemoved=new Array();
    this.ontypechanged=new Array();
    this.onmousedown=new Array();
    this.onmouseup=new Array();
    this.oncontextmenu=new Array();
    this.onkeyreleased=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onboundschanged':if($0v.onboundschanged){
                this.onboundschanged[this.onboundschanged.length]=$0v;
            };
            break;
            case 'onzoomchanged':if($0v.onzoomchanged){
                this.onzoomchanged[this.onzoomchanged.length]=$0v;
            };
            break;
            case 'onresized':if($0v.onresized){
                this.onresized[this.onresized.length]=$0v;
            };
            break;
            case 'onclicked':if($0v.onclicked){
                this.onclicked[this.onclicked.length]=$0v;
            };
            break;
            case 'ondblclicked':if($0v.ondblclicked){
                this.ondblclicked[this.ondblclicked.length]=$0v;
            };
            break;
            case 'onmousemoved':if($0v.onmousemoved){
                this.onmousemoved[this.onmousemoved.length]=$0v;
            };
            break;
            case 'ontypechanged':if($0v.ontypechanged){
                this.ontypechanged[this.ontypechanged.length]=$0v;
            };
            break;
            case 'onmousedown':if($0v.onmousedown){
                this.onmousedown[this.onmousedown.length]=$0v;
            };
            break;
            case 'onmouseup':if($0v.onmouseup){
                this.onmouseup[this.onmouseup.length]=$0v;
            };
            break;
            case 'oncontextmenu':if($0v.oncontextmenu){
                this.oncontextmenu[this.oncontextmenu.length]=$0v;
            };
            break;
            case 'onkeyreleased':if($0v.onkeyreleased){
                this.onkeyreleased[this.onkeyreleased.length]=$0v;
            };
            break;
            default:window.status='Map类不存在事件'+$0w;
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onboundschanged':for(var i=0;
            i<this.onboundschanged.length;
            i++){
                if(this.onboundschanged[i].onboundschanged){
                    this.onboundschanged[i].onboundschanged();
                }
            };
            break;
            case 'onzoomchanged':for(var i=0;
            i<this.onzoomchanged.length;
            i++){
                if(this.onzoomchanged[i].onzoomchanged){
                    this.onzoomchanged[i].onzoomchanged();
                }
            };
            this.notify('onboundschanged');
            break;
            case 'onresized':for(var i=0;
            i<this.onresized.length;
            i++){
                if(this.onresized[i].onresized){
                    this.onresized[i].onresized();
                }
            };
            break;
            case 'onclicked':for(var i=0;
            i<this.onclicked.length;
            i++){
                if(this.onclicked[i].onclicked){
                    this.onclicked[i].onclicked();
                }
            };
            break;
            case 'ondblclicked':for(var i=0;
            i<this.ondblclicked.length;
            i++){
                if(this.ondblclicked[i].ondblclicked){
                    this.ondblclicked[i].ondblclicked();
                }
            };
            break;
            case 'onmousemoved':for(var i=0;
            i<this.onmousemoved.length;
            i++){
                if(this.onmousemoved[i].onmousemoved){
                    this.onmousemoved[i].onmousemoved();
                }
            };
            break;
            case 'ontypechanged':for(var i=0;
            i<this.ontypechanged.length;
            i++){
                if(this.ontypechanged[i].ontypechanged){
                    this.ontypechanged[i].ontypechanged();
                }
            };
            break;
            case 'onmousedown':for(var i=0;
            i<this.onmousedown.length;
            i++){
                if(this.onmousedown[i].onmousedown){
                    this.onmousedown[i].onmousedown();
                }
            };
            break;
            case 'onmouseup':for(var i=0;
            i<this.onmouseup.length;
            i++){
                if(this.onmouseup[i].onmouseup){
                    this.onmouseup[i].onmouseup();
                }
            };
            break;
            case 'oncontextmenu':for(var i=0;
            i<this.oncontextmenu.length;
            i++){
                if(this.oncontextmenu[i].oncontextmenu){
                    this.oncontextmenu[i].oncontextmenu();
                }
            };
            break;
            case 'onkeyreleased':for(var i=0;
            i<this.onkeyreleased.length;
            i++){
                if(this.onkeyreleased[i].onkeyreleased){
                    this.onkeyreleased[i].onkeyreleased();
                }
            };
            break;
            default:window.status='Map通报了一个未知的事件'+$0w;
            break;
        }
    };
    this.panWest=function(){
        this.smoothMoveTo(this.width/2-this.width/3,this.height/2);
    };
    this.panSouth=function(){
        this.smoothMoveTo(this.width/2,this.height/2+this.height/3);
    };
    this.panEast=function(){
        this.smoothMoveTo(this.width/2+this.width/3,this.height/2);
    };
    this.panNorth=function(){
        this.smoothMoveTo(this.width/2,this.height/2-this.height/3);
    };
    this.zoomIn=function(){
        var $1L=this.zoom+1;
        this.setZoomLevel($1L);
    };
    this.zoomOut=function(){
        var $1L=this.zoom-1;
        this.setZoomLevel($1L);
    };
    this.moveTo=function($0q,top){
        this.smoothMoveTo($0q,top);
    };
    this.getLatLngInRegion=function($n,$o){
        if(!(this.leftbottom&&this.righttop)){
            return new LatLng($n,$o);
        };
        if(this.leftbottom.toString()!='LatLng'||this.righttop.toString()!='LatLng'){
            return new LatLng($n,$o);
        };
        $n=($n<this.leftbottom.lat)?this.leftbottom.lat:$n;
        $n=($n>this.righttop.lat)?this.righttop.lat:$n;
        $o=($o<this.leftbottom.lng)?this.leftbottom.lng:$o;
        $o=($o>this.righttop.lng)?this.righttop.lng:$o;
        return new LatLng($n,$o);
    };
    this.setCenter=function($n,$o){
        if(!($n>-90&&$n<90)||!($o>-180&&$o<180)){
            $n=31.33767;
            $o=108.32352;
        };
        var $M=this.getLatLngInRegion($n,$o);
        $n=$M.lat;
        $o=$M.lng;
        if(($n==this.lat)&&($o==this.lng)){
            this.map.style.left=0;
            this.map.style.top=0;
            this.markerdiv.style.left=0;
            this.markerdiv.style.top=0;
            return;
        };
        this.hideOtherTileLayers();
        this.lat=$n;
        this.lng=$o;
        this.hideMarkers();
        this.tilelayers[this.zoom].set(this.lat,this.lng,this.width,this.height);
        this.map.style.left=0;
        this.map.style.top=0;
        this.markerdiv.style.left=0;
        this.markerdiv.style.top=0;
        this.refreshMarkers();
        this.notify('onboundschanged');
    };
    this.maptype='typical';
    this.setMapType=function($1V){
        if($1V==this.maptype){
            return;
        };
        switch($1V){
            case 'typical':this.oldmaptype=this.maptype;
            this.maptype=$1V;
            this.mapdb=this.maproot+'/typical/';
            for(var i=0;i<this.tilelayers.length;i++){
                this.tilelayers[i].mapdb=this.mapdb;
            };
            this.leftbottom=null;
            this.righttop=null;
            this.tilelayers[4].setScaleFactor(this.scalefactors[4]);
            this.zoomEnabled=true;
            this.refreshMap();
            this.notify('ontypechanged');
            break;
            case 'satellite':this.oldmaptype=this.maptype;
            this.maptype=$1V;
            this.mapdb=this.maproot+'/satellite/';
            for(var i=0;i<this.tilelayers.length;i++){
                this.tilelayers[i].mapdb=this.mapdb;
            };
            this.refreshMap();
            this.notify('ontypechanged');
            break;
            case 'hybrid':this.oldmaptype=this.maptype;
            this.maptype=$1V;
            this.mapdb=this.maproot+'/hybrid/';
            for(var i=0;i<this.tilelayers.length;i++){
                this.tilelayers[i].mapdb=this.mapdb;
            };
            this.leftbottom=null;
            this.righttop=null;
            this.tilelayers[10].setScaleFactor(this.scalefactors[10]);
            this.zoomEnabled=true;
            this.refreshMap();
            this.notify('ontypechanged');
            break;
            case 'thematic':this.oldmaptype=this.maptype;
            this.maptype=$1V;
            this.mapdb=this.maproot+'/thematic/';
            for(var i=0;i<this.tilelayers.length;i++){
                this.tilelayers[i].mapdb=this.mapdb;
            };
            this.refreshMap();
            this.notify('ontypechanged');
            break;
            default:window.status="Map不存在该地图类型"+$1V;
            break;
        }
    };
    this.getCenter=function(){
        return new LatLng((Math.round(this.lat*100000)/100000),(Math.round(this.lng*100000)/100000));
    };
    this.getBounds=function(){
        var $0z=new LatLng(Math.round((this.lat-this.scalefactors[this.zoom]*this.height/2/this.tileheight)*100000)/100000,Math.round((this.lng-this.scalefactors[this.zoom]*this.width/2/this.tilewidth)*100000)/100000);
        var $0A=new LatLng(Math.round((this.lat+this.scalefactors[this.zoom]*this.height/2/this.tileheight)*100000)/100000,Math.round((this.lng+this.scalefactors[this.zoom]*this.width/2/this.tilewidth)*100000)/100000);
        return new Bounds($0z,$0A);
    };
    this.getZoomLevel=function(){
        return this.zoom;
    };
    this.get=function(){
        return this.container;
    };
    this.sliding=false;
    this.slideCounter=0;
    this.speed=10;
    this.smoothMove=function($n,$o){
        var $1w=this.tilelayers[this.zoom].getPixel($n,$o);
        this.smoothMoveTo($1w.left,$1w.top);
    };
    this.smoothMoveTo=function($0q,top){
        this.xoffset=$0q;
        this.yoffset=top;
        this.leftdes=parseInt(this.map.style.left,10);
        this.topdes=parseInt(this.map.style.top,10);
        this.xstep=(this.width/2-$0q)/this.speed;
        this.ystep=(this.height/2-top)/this.speed;
        if(!this.sliding){
            this.doSlide();
        }
    };
    this.doSlide=function(){
        this.sliding=true;
        if(this.slideCounter<this.speed){
            this.map.style.left=this.leftdes+(this.slideCounter+1)*this.xstep;
            this.map.style.top=this.topdes+(this.slideCounter+1)*this.ystep;
            this.markerdiv.style.left=this.leftdes+(this.slideCounter+1)*this.xstep;
            this.markerdiv.style.top=this.topdes+(this.slideCounter+1)*this.ystep;
            this.slideCounter++;
            setRTimeout(this,this.doSlide,10);
        }
        else{
            setRTimeout(this,this.finishSlide,10);
        }
    };
    
    this.addPointMarker2=function($M,$1D,$0V,$1E,$1F,$1G){
        var $1w=new Point2($M,$1D,$0V,$1E,$1F,$1G);
        this.markers[this.markers.length]=$1w;
		//this.staticMarkers[this.markers.length]=$1w;
        return $1w;}
        
    this.addPointMarker3=function($M,$1D,$0V,$1E,$1F,$1G){
        var $1w=new Point3($M,$1D,$0V,$1E,$1F,$1G);
        this.markers[this.markers.length]=$1w;
		//this.staticMarkers[this.markers.length]=$1w;
        return $1w;    
        
        
    };
    
    this.finishSlide=function(){
        this.slideCounter=0;
        this.sliding=false;
        var $1w=this.tilelayers[this.zoom].getLatLng(this.xoffset,this.yoffset);
        this.setCenter($1w.lat,$1w.lng);
    };
    this.getToolBox=function($0y){
        this.toolbox=new ToolBox(this,"left",$0y);
        return this.toolbox;
    };
    this.resize=function($0r,$0x){
        this.width=$0r;
        this.height=$0x;
        this.container.style.clip='rect(0 '+this.width+' '+this.height+' 0)';
        this.container.style.width=this.width;
        this.container.style.height=this.height;
        this.mapmask.style.width=this.width;
        this.mapmask.style.height=this.height;
        this.refreshMap();
        this.notify('onresized');
        this.notify('onboundschanged');
    };
    this.getZoomByPoints=function($04){
    };
    this.getCenterByPoints=function($04){
        var $n=0;
        var $o=0;
        for(var i=0;i<$04.length;i++){
            $n+=$04[i].lat;
            $o+=$04[i].lng;
        };
        $n=Math.round(($n/$04.length)*100000)/100000;
        $o=Math.round(($o/$04.length)*100000)/100000;
        return new LatLng($n,$o);
    };
    this.setCursor=function($1W){
        this.mapmask.style.cursor=$1W;
    };
    this.getPixel=function($n,$o){
        return this.tilelayers[this.zoom].getPixel($n,$o);
    };
    this.getLatLng=function($0q,top){
        return this.tilelayers[this.zoom].getLatLng($0q,top);
    };
    this.getMaskLayer=function(){
        return this.mapmask;
    };
    this.isValidZoom=function($1L){
        return $1L>=0&&$1L<this.zoomlevels;
    };
    this.hideMarkers=function(){
        this.markerdiv.style.visibility='hidden';
        this.tilelayers[this.zoom].hideMarkers();
    };
    this.showMarkers=function(){
        this.markerdiv.style.visibility='visible';
        for(var $1X=0;$1X<this.markers.length;$1X++){
            this.paintMarker(this.markers[$1X]);
        };
        this.tilelayers[this.zoom].addMarkers(this.staticMarkers);
        this.tilelayers[this.zoom].showMarkers();
    };
    this.enableSearch=function(){
        this.searchEnabled=true;
    };
    this.disableSearch=function(){
        this.searchEnabled=false;
    };
    this.hideMarkers();
    this.tilelayers[this.zoom].set(this.lat,this.lng,this.width,this.height);
    this.refreshMarkers();
    this.disableZoom=function(){
        this.zoomEnabled=false;
    };
    this.enableZoom=function(){
        this.zoomEnabled=true;
    };
    this.setMaxBounds=function($0z,$0A){
        this.leftbottom=$0z;
        this.righttop=$0A;
    };
    this.enableDrag=function(){
        this.dragEnabled=true;
    };
    this.disableDrag=function(){
        this.dragEnabled=false;
    };
    this.enableDoubleClick=function(){
        this.enableDblclick=true;
    };
    this.disableDoubleClick=function(){
        this.enableDblclick=false;
    }
    
    ///同时显示当前点（保持原来的位置）与关联点的位置
	///如果寻找不到合适的比例尺就默认返回原来的比例尺
	this.getMaxZoomByLatLng=function(latlng){
		for(var iZoom=this.zoomlevels-4;iZoom>0;iZoom--){
			if((Math.abs(latlng.lat-this.lat)/this.scalefactors[iZoom]*this.tileheight<(this.height/2-50))&&(Math.abs(latlng.lng-this.lng)/this.scalefactors[iZoom]*this.tilewidth<(this.width/2-50))){
				return iZoom;
			}
		}
		return 0;
	}

	///通过经纬度数组来确定显示最合适边框（合适的比例尺与合适的中心点）
	///不考虑当前点，只针对数组自身数字进行范围定位
	///@1:需要显示的经纬度集合
	///@2:是否保存当前中心点
	this.setMaxBoundsByLatLngs = function( nLatLngs ,nIsSaveCenter ){
	    if( nLatLngs != null && nLatLngs.length > 0 ){
	        var cArrayLength = nLatLngs.length;
	        if( cArrayLength == 1){//数组仅一项时，
	         	if(nIsSaveCenter){
	            	var cZoom = this.getMaxZoomByLatLng( nLatLngs[0] );
		            this.setZoomDirectly( cZoom ); 
	            } else{
	             	this.setZoomDirectly(11);
	             	this.setCenter(nLatLngs[0].lat,nLatLngs[0].lng);
	            }
	        }else{
	            if( nIsSaveCenter == true ){
	                var cCurrentLatLng = new LatLng( this.lat,this.lng );
	                var cMaxLatLng = this.getMaxLatLngFromArray( nLatLngs,cCurrentLatLng );
	                if( cMaxLatLng != null ){
	                    var cZoom = this.getMaxZoomByLatLng( cMaxLatLng );
	                    this.setZoomDirectly( cZoom );
	                }else{
	                    return;
	                }
	            }else{
	                var cMaxLatLng = this.getMaxLatLngFromArray( nLatLngs );
	                if( cMaxLatLng != null ){
	                    var cZoom = this.getMaxZoomByLatLng( cMaxLatLng );
	                    this.setZoomDirectly( cZoom );
	                }else{
	                    return;
	                }
	            }
	        }
	    }else{
	        return;
	    }
	}
	
	///从数组中计算出最大经度与最大纬度的，并组合成一点返回
	///包含当前的位置，就是以当前位置为中心
	this.getMaxLatLngFromArray = function( nLatLngs ,nCurrentLatLng ){
        if( nLatLngs != null && nLatLngs.length > 0 ){
            var cArrayLength = nLatLngs.length;
            var cMaxLat = Math.abs( nLatLngs[0].lat - nCurrentLatLng.lat );
            var cMaxLng = Math.abs( nLatLngs[0].lng - nCurrentLatLng.lng );
            for( var cIndex = 1;cIndex < cArrayLength ;cIndex++ ){
                if( cMaxLat <  Math.abs( nLatLngs[ cIndex ].lat - nCurrentLatLng.lat ) ){
                    cMaxLat = Math.abs( nLatLngs[ cIndex ].lat - nCurrentLatLng.lat ) ;
                }
                if( cMaxLng < Math.abs( nLatLngs[ cIndex ].lng - nCurrentLatLng.lng ) ){
                    cMaxLng = Math.abs( nLatLngs[ cIndex ].lng - nCurrentLatLng.lng ) ;
                }
            }
            var cMaxLatLng = new LatLng( 
                               cMaxLat + nCurrentLatLng.lat ,
                               cMaxLng + nCurrentLatLng.lng 
                               );
            return cMaxLatLng;
        }else{
            return null;
        }
	}	
	
	///从数组中计算出最大经度与最大纬度的，并组合成一点返回
	///只与数组集的自身范围来控制大小
	this.getMaxLatLngFromArray = function( nLatLngs ){
        if( nLatLngs != null && nLatLngs.length > 0 ){
            var cArrayLength = nLatLngs.length;
            var cMinLat = nLatLngs[0].lat;
            var cMinLng = nLatLngs[0].lng;
            var cMaxLat = nLatLngs[0].lat;
            var cMaxLng = nLatLngs[0].lng;
            for( var cIndex = 1;cIndex < cArrayLength ;cIndex++ ){
                if( cMinLat >  nLatLngs[ cIndex ].lat ){
                    cMinLat = nLatLngs[ cIndex ].lat;
                }
                if( cMinLng > nLatLngs[ cIndex ].lng ){
                    cMinLng = nLatLngs[ cIndex ].lng ;
                }
                if( cMaxLat <  nLatLngs[ cIndex ].lat ){
                    cMaxLat = nLatLngs[ cIndex ].lat;
                }
                if( cMaxLng < nLatLngs[ cIndex ].lng ){
                    cMaxLng = nLatLngs[ cIndex ].lng ;
                }
            }
            
            this.setCenter( 
                      ( cMaxLat - cMinLat )/2 + cMinLat,
                      ( cMaxLng - cMinLng )/2 + cMinLng
                      );
                      
            var cMaxLatLng = new LatLng( cMaxLat,cMaxLng );
            return cMaxLatLng;
        }else{
            return null;
        }
	}
};


function CircleRegion($1U,$0M,$1K){
    this.type="Region";
    this.center=$1U;
    this.radius=$0M;
    this.div=new Div(0,0,null,null).get();
    this.oval=document.createElement("v:oval");
    this.oval.unselectable='on';
    this.style=this.oval.style;
    this.oval.fillcolor=$1K;
    this.style.filter='alpha(opacity=30)';
    this.div.appendChild(this.oval);
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'CircleRegion';
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};


function EagleMap($0r,$0x,$U,$1Y,$1f){
    this.toString=function(){
        return 'EagleMap';
    };
    this.target=$U;
    this.width=$0r;
    this.height=$0x;
    this.imgdb=$1Y;
    this.mapdb=$1f;
    this.eagleshow=true;
    this.eaglezoomoffset=3;
    if(this.target.isValidZoom(this.target.zoom-this.eaglezoomoffset)){
        this.zoom=this.target.zoom-this.eaglezoomoffset;
    }
    else{
        this.zoom=0;
    };    
    this.maplet=new StMap(3,3,this.width-3,this.height-3,this.target.lat,this.target.lng,this.zoom,this.mapdb,this.target);
    this.maplet.get().style.border="1px solid #94AAE3";
    this.maplet.map.ondblclick=null;
    this.div=new Div(this.target.width-this.width,this.target.height-this.height,this.width,this.height).get();
    this.style=this.div.style;
    this.div.style.zIndex=10000;
    this.div.style.overflow='hidden';
    this.div.style.clip="rect(0 "+this.width+" "+this.height+" 0)";
    this.div.style.backgroundColor="#FFFFFF";
    this.div.style.border="1px solid #94AAE3";
    this.mask=new Div(this.width/2-50,this.height/2-25,100,50).get();
    this.mask.style.cursor='hand';
    this.mask.style.zIndex=10000;
    this.mask.style.filter="alpha(opacity=30)";
    this.mask.style.backgroundColor="#0000FF";
    this.mask.root=this;
    this.mask.isInEagle=function(){
        var $0q=event.clientX-this.xoffset;
        var top=event.clientY-this.yoffset;
        if($0q>this.root.width-parseInt(this.style.width,10)/2){
            return false;
        };
        if($0q<0-parseInt(this.style.width,10)/2){
            return false;
        };
        if(top>this.root.height-parseInt(this.style.height,10)/2){
            return false;
        };
        if(top<0-parseInt(this.style.height,10)/2){
            return false;
        };
        return true;
    };
    this.mask.onmousedown=function(){
        this.drag=true;
        this.dragged=false;
        this.xoffset=event.clientX-parseInt(this.style.left,10);
        this.yoffset=event.clientY-parseInt(this.style.top,10);
        this.setCapture();
    };
    this.mask.ondrag=function(){
        if(this.drag&&this.isInEagle()){
            this.style.left=event.clientX-this.xoffset;
            this.style.top=event.clientY-this.yoffset;
        }
    };
    this.mask.ondragend=function(){
        var $0q=Math.ceil(parseInt(this.style.left,10)+parseInt(this.style.width,10)/2);
        var top=Math.ceil(parseInt(this.style.top,10)+parseInt(this.style.height,10)/2);
        var $1w=this.root.maplet.tilelayers[this.root.maplet.zoom].getLatLng($0q,top);
        this.root.target.smoothMove($1w.lat,$1w.lng);
    };
    this.mask.onmousemove=function(){
        if(this.drag){
            this.dragged=true;
            this.ondrag();
        }
    };
    this.mask.onmouseup=function(){
        this.releaseCapture();
        this.drag=false;
        if(this.dragged){
            this.ondragend();
            this.dragged=false;
        }
    };
    this.hide=function(){
        this.maplet.hide();
        this.mask.style.visibility='hidden';
        this.div.style.visibility="hidden";
    };
    this.show=function(){
        this.maplet.show();
        this.mask.style.visibility='visible';
        this.div.style.visibility='visible';
    };
    if(this.target.zoom>this.eaglezoomoffset-1){
        this.show();
        this.maplet.setZoomLevel(this.target.zoom-this.eaglezoomoffset);
        this.mask.style.width=this.target.width/this.maplet.scalefactors[this.maplet.zoom]*this.target.scalefactors[this.target.zoom];
        this.mask.style.height=this.target.height/this.maplet.scalefactors[this.maplet.zoom]*this.target.scalefactors[this.target.zoom];
        this.mask.style.left=this.maplet.width/2-parseInt(this.mask.style.width,10)/2;
        this.mask.style.top=this.maplet.height/2-parseInt(this.mask.style.height,10)/2;
    }
    else{
        this.hide();
    };
    this.div.appendChild(this.maplet.get());
    this.maplet.container.appendChild(this.mask);
    this.maplet.show();
    this.get=function(){
        return this.div;
    };
    this.onboundschanged=function(){
        if(this.target.zoom>this.eaglezoomoffset-1){
            this.show();
            if(this.eagleshow){
                this.maplet.setZoomLevel(this.target.zoom-this.eaglezoomoffset);
                this.maplet.setCenter(this.target.lat,this.target.lng);
                this.mask.style.width=this.target.width/this.maplet.scalefactors[this.maplet.newzoom]*this.target.scalefactors[this.target.zoom];
                this.mask.style.height=this.target.height/this.maplet.scalefactors[this.maplet.newzoom]*this.target.scalefactors[this.target.zoom];
                this.mask.style.left=this.maplet.width/2-parseInt(this.mask.style.width,10)/2;
                this.mask.style.top=this.maplet.height/2-parseInt(this.mask.style.height,10)/2;
               
            }
        }
        else{
            this.hide();
        }
    };
    this.onzoomchanged=function(){
        this.onboundschanged();
    };
    this.onresized=function(){
        if(this.eagleshow){
            this.div.style.left=this.target.width-this.width;
            this.div.style.top=this.target.height-this.height;
        }
        else{
            this.div.style.left=this.target.width-19;
            this.div.style.top=this.target.height-19;
        };
        this.onboundschanged();
    };
    this.target.addListener(this,'onboundschanged');
    this.target.addListener(this,'onzoomchanged');
    this.target.addListener(this,'onresized');
    this.listener=new Object();
    this.listener.root=this;
    this.listener.onboundschanged=function(){
        this.root.target.smoothMove(this.root.maplet.lat,this.root.maplet.lng);
    };
    this.listener.onzoomchanged=function(){
        if(this.root.maplet.zoom>this.root.maplet.zoomlevels-this.root.eaglezoomoffset+1){
            this.root.maplet.setZoomLevel(this.root.maplet.zoomlevels-this.root.eaglezoomoffset+1);
        }
        else{
            this.root.target.setZoomLevel(this.root.maplet.zoom+this.root.eaglezoomoffset);
        }
    };
    this.maplet.addListener(this.listener,'onboundschanged');
    this.maplet.addListener(this.listener,'onzoomchanged');
    this.onoff=new MyImage(this.width-19,this.height-19,this.imgdb+'/overcontract.gif').get();
    this.onoff.title="隐藏鹰眼图";
    this.onoff.style.zIndex=10001;
    this.div.appendChild(this.onoff);
    this.onoff.root=this;
    this.isdyning=false;
    this.dynCount=10;
    this.onoff.onclick=function(){
        if(this.root.isdyning){
            return;
        };
        this.root.isdyning=true;
        if(this.root.eagleshow){
            this.root.eagleshow=false;
            this.root.dynCount=10;
            this.root.leftdes=this.root.target.width-19;
            this.root.topdes=this.root.target.height-19;
            this.root.leftstep=this.root.width/10;
            this.root.topstep=this.root.height/10;
            setRTimeout(this.root,this.root.dynHide,10);
        }
        else{
            this.root.eagleshow=true;
            this.root.onboundschanged();
            this.root.dynCount=10;
            this.root.leftdes=this.root.target.width-this.root.width;
            this.root.topdes=this.root.target.height-this.root.height;
            this.root.leftstep=this.root.width/10;
            this.root.topstep=this.root.height/10;
            setRTimeout(this.root,this.root.dynShow,10);
        }
    };
    this.dynHide=function(){
        if(this.dynCount>0){
            this.dynCount--;
            this.div.style.left=this.leftdes-this.dynCount*this.leftstep;
            this.div.style.top=this.topdes-this.dynCount*this.topstep;
            setRTimeout(this,this.dynHide,10);
        }
        else{
            this.div.style.left=this.leftdes;
            this.div.style.top=this.topdes;
            this.onoff.src=this.imgdb+'/overexpand.gif';
            this.onoff.title='打开鹰眼图';
            this.onoff.style.left=0;
            this.onoff.style.top=0;
            this.isdyning=false;
        }
    };
    this.dynShow=function(){
        if(this.dynCount>0){
            this.dynCount--;
            this.div.style.left=this.leftdes+this.dynCount*this.leftstep;
            this.div.style.top=this.topdes+this.dynCount*this.topstep;
            setRTimeout(this,this.dynShow,10);
        }
        else{
            this.div.style.left=this.leftdes;
            this.div.style.top=this.topdes;
            this.onoff.src=this.imgdb+'/overcontract.gif';
            this.onoff.title='关闭鹰眼图';
            this.onoff.style.left=this.width-19;
            this.onoff.style.top=this.height-19;
            this.isdyning=false;
        }
    };
    this.showEagleMap=function(){
        if(!this.eagleshow){
            this.onoff.onclick();
        }
    };
    this.hideEagleMap=function(){
        if(this.eagleshow){
            this.onoff.onclick();
        }
    }
};


function LabelPoint($M,$1D,$0V,$1R,$1S,$1T,$1E,$1F){
    this.toString=function(){
        return 'LabelPoint';
    };
    this.type='LabelPoint';
    if(!$M){
        return;
    };
    this.latlng=$M;
    this.lat=this.latlng.lat;
    this.lng=this.latlng.lng;
    if(!$0V){
        return;
    };
    this.icon=$0V;
    if(!$1R){
        return;
    };
    this.iconlabel=$1R;
    if($1D){
        this.zIndex=$1D;
    }
    else{
        this.zIndex=0;
    };
    if($1S){
        this.xoffset=$1S;
    }
    else{
        this.xoffset=0;
    };
    if($1T){
        this.yoffset=$1T;
    }
    else{
        this.yoffset=0;
    };
    this.label=$1E;
    this.detail=$1F;
    this.div=new Div(0,0,null,null).get();
    this.style=this.div.style;
    this.style.zIndex=this.zIndex;
    this.labelimg=new MyImage($1S,$1T,this.iconlabel).get();
    this.img=new MyImage(0,0,this.icon).get();
    this.img.style.zIndex=$1D;
    this.img.onload=function(){
        this.style.left=-this.width/2;
        this.style.top=-this.height/2;
    };
    this.img.style.left=-this.img.width/2;
    this.img.style.top=-this.img.height/2;
    this.div.appendChild(this.img);
    this.div.appendChild(this.labelimg);
    if(this.detail){
        this.div.detail=new FloatDialog(20,10,this.label.length*20,this.label,this.detail);
        this.div.detail.get().onmouseover=function(){
            this.depth=this.parentNode.style.zIndex;
            this.parentNode.style.zIndex=10000;
        };
        this.div.detail.get().onmouseout=function(){
            this.parentNode.style.zIndex=this.depth;
        };
        this.div.detail.style.zIndex=10000;
        this.div.detail.hide();
        this.div.appendChild(this.div.detail.get());
    };
    this.img.onmouseover=function(){
        this.pin=false;
        if(this.parentNode.style.zIndex!=10000){
            this.depth=this.parentNode.style.zIndex;
        };
        this.parentNode.style.zIndex=10000;
        if(!this.parentNode.detail.get().pin){
            this.parentNode.detail.get().style.left=20;
            this.parentNode.detail.get().style.top=10;
        };
        this.parentNode.detail.show();
    };
    this.img.onclick=function(){
        this.pin=true;
        this.parentNode.detail.get().pin=true;
    };
    this.img.onmouseout=function(){
        if(!this.pin&&!this.parentNode.detail.get().pin){
            this.parentNode.style.zIndex=this.depth;
            this.parentNode.detail.hide();
        }
    };
    this.get=function(){
        return this.div;
    };
    this.showDetail=function(){
        if(this.detail){
            this.pin=true;
            this.div.detail.get().pin=true;
            this.div.detail.show();
        }
    };
    this.hideDetail=function(){
        if(this.detail){
            this.pin=false;
            this.div.detail.get().pin=false;
            this.div.detail.hide();
        }
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};


function Region($04,$1H,$1K,$1I){
    this.type="Region";
    this.latlngs=$04;
    this.latlngs[this.latlngs.length]=$04[0];
    this.color=$1H;
    this.fillcolor=$1K;
    this.weight=$1I;
    this.path=new Path($04,this.color,this.weight);
    this.div=this.path.get();
    this.polyline=this.path.polyline;
    this.polyline.unselectable='on';
    //this.stroke=this.path.stroke;
    //this.stroke.opacity=1.0;
    //this.stroke.startarrow='';
    //this.stroke.endarrow='';
    this.polyline.fill=true;
    this.polyline.filled=true;
    this.polyline.fillcolor=this.fillcolor;
    this.polyline.style.filter='alpha(opacity=50)';
    this.get=function(){
        return this.div;
    };
    this.toString=function(){
        return 'Region';
    };
    this.destroy=function(){
        if(this.div.parentNode){
            this.div.parentNode.removeChild(this.div);
        };
        this.div=null;
        this.toString=function(){
            return null;
        };
    }
};


function SimpleMap($0r,$0x,$n,$o,$1L,$1M,$1V){
    this.width=$0r;
    this.height=$0x;
    this.lat=$n;
    this.lng=$o;
    this.zoom=$1L;
    this.maproot=$1M;
    this.maptype=$1V;
    this.mapdb=this.maproot+'/'+this.maptype;
    this.container=new Div(0,0,$0r,$0x).get();
    this.container.style.overflow='hidden';
    this.container.style.clip='rect(0 '+$0r+' '+$0x+' 0)';
    this.map=new Div(0,0,$0r,$0x).get();
    this.mapmask=new Div(0,0,$0r,$0x).get();
    this.mapmask.style.backgroundImage='url('+$f+'map_img/map/mask.gif)';
    this.markerdiv=new Div(0,0,null,null).get();
    this.container.appendChild(this.map);
    this.container.appendChild(this.mapmask);
    this.container.appendChild(this.markerdiv);
    this.markers=new Array();
    this.directories=new Array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15');
    this.scalefactors=new Array(30,15,10,4,2,1,0.4,0.2,0.1,0.04,0.02,0.01,0.004,0.002,0.001,0.0004);
    this.gridfactors=new Array(10,10,10,10,10,10,10,10,10,10,40,40,40,40,40,40);
    this.tilewidth=256;
    this.tileheight=256;
    this.lngscalefactor=this.scalefactors[this.zoom];
    this.latscalefactor=this.lngscalefactor;
    this.adjustfactor=100000;
    this.gridfactor=this.gridfactors[this.zoom];
    this.directory=this.directories[this.zoom];
    var $1g=Math.floor((this.lng+this.lngscalefactor/this.adjustfactor)/this.lngscalefactor);
    var $1h=Math.floor((this.lat+this.latscalefactor/this.adjustfactor)/this.latscalefactor);
    var $1i=this.width/2-Math.round(((this.lng*this.adjustfactor)%(this.lngscalefactor*this.adjustfactor))*this.tilewidth/(this.lngscalefactor*this.adjustfactor));
    var $1j=this.height/2-this.tileheight+Math.round(((this.lat*this.adjustfactor)%(this.latscalefactor*this.adjustfactor))*this.tileheight/(this.latscalefactor*this.adjustfactor));
    var $1k=Math.ceil($0r/this.tilewidth/2);
    var $1l=Math.ceil($0x/this.tileheight/2);
    for(var $1m=-$1k;$1m<=$1k;$1m++){
        var $1n=Math.floor(($1g+$1m)/this.gridfactor);
        var $1o=$1g+$1m-$1n*this.gridfactor;
        var $0q=$1m*this.tilewidth+this.gridfactor;
        for(var $1p=-$1l;$1p<=$1l;$1p++){
            var $1q=this.mapdb+'\/'+this.directory+'\/';
            var $1r=Math.floor(($1h+$1p)/(this.gridfactor));
            if($1r<0){
                $1r+=1;
            };
            var $1s=$1h+$1p-$1r*this.gridfactor;
            $1q+=$1n+'/'+$1r+'/'+$1o+'_'+$1s+'.png';
            var $0q=$1m*this.tilewidth+$1i;
            var top=-$1p*this.tileheight+$1j;
            var $1t=new MyImage($0q,top,$1q);
            $1t.key=$1q;
            $1t.onScreen=true;
            $1t.get().root=this;
            $1t.get().onerror=function(){
                this.onerror=null;
                this.width=this.root.tilewidth;
                this.height=this.root.tileheight;
            };
            this.map.appendChild($1t.get());
        }
    };
    this.toString=function(){
        return 'SimpleMap';
    };
    this.get=function(){
        return this.container;
    };
    this.addMarker=function($1v){
        if($1v){
            this.markers[this.markers.length]=$1v;
        }
    };
    this.addLabelMarker=function($M,$1D,$0V,$1R,$1S,$1T,$1E,$1F){
        var $1w=new LabelPoint($M,$1D,$0V,$1R,$1S,$1T,$1E,$1F);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.addPointMarker=function($M,$1D,$0V,$1E,$1F,$1G){
        var $1w=new Point($M,$1D,$0V,$1E,$1F,$1G);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.addPathMarker=function($04,$1H,$1I){
        var $1w=new Path($04,$1H,$1I);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.addRegionMarker=function($04,$1H,$1K,$1I){
        var $1w=new Region($04,$1H,$1K,$1I);
        this.markers[this.markers.length]=$1w;
        return $1w;
    };
    this.showMarkers=function(){
        this.markerdiv.style.visibility='visible';
        for(var $1X=0;$1X<this.markers.length;$1X++){
            this.paintMarker(this.markers[$1X]);
        }
    };
    this.refreshMarkers=function(){
        this.showMarkers();
    };
    this.hideMarkers=function(){
        this.markerdiv.style.visibility='hidden';
    };
    this.paintMarker=function($1v){
        var $0q=0;
        var top=0;
        switch($1v.toString()){
            case "Point":case "LabelPoint":var $1w=this.getPixel($1v.lat,$1v.lng);
            $0q=$1w.left;
            top=$1w.top;
            break;
            case "Path":case "Region":var $1x="";
            var $1w;
            for(var i=0;i<$1v.latlngs.length;i++){
                $1w=this.getPixel($1v.latlngs[i].lat,$1v.latlngs[i].lng);
                $1x+=$1w.left+","+$1w.top+" ";
            };
            if($1v.polyline.points){
                $1v.polyline.points.value=$1x;
            }
            else{
                $1v.polyline.points=$1x;
            };
            break;
            default:break;
        };
        $1v.div.style.left=$0q;
        $1v.div.style.top=top;
        this.markerdiv.appendChild($1v.div);
    };
    this.getPixel=function($n,$o){
        var $0q=this.width/2+Math.round((lng-this.lng)/this.lngscalefactor*this.tilewidth);
        var top=this.height/2-Math.round((lat-this.lat)/this.latscalefactor*this.tileheight);
        return new Pixel($0q,top);
    };
    this.getLatLng=function($0q,top){
        var $o=Math.round((this.lng+($0q-this.width/2)*this.lngscalefactor/this.tilewidth)*100000)/100000;
        var $n=Math.round((this.lat-(top-this.height/2)*this.latscalefactor/this.tileheight)*100000)/100000;
        return new LatLng($n,$o);
    }
};


function ToolBox($1Z,$20,$21){
    this.eventhandler=new ToolEventHandler($1Z);
    this.maplet=$1Z;
    this.tools=new Array();
    this.left=this.maplet.left;
    this.top=this.maplet.top;
    this.div=new Div(this.left,this.top,null,null).get();
    this.div.style.zIndex=1000;
    if(this.maplet.get().parentNode){
        this.maplet.get().appendChild(this.div);
    }
    else{
        window.status='ToolBox必须在Map对象成为可视元素后再添加';
        return;
    };
    this.style=this.div.style;
    this.div.maplet=this.maplet;
    this.tooldb=$21;
    this.align=$20;
    switch($20){
        case "0":case 0:case "left":this.align=0;
        this.style.left=parseInt(this.maplet.container.style.left,10);
        this.style.top=parseInt(this.maplet.container.style.top,10);
        break;
        case "1":case 1:case "top":this.align=1;
        this.style.left=this.maplet.width-10;
        this.style.top=10;
        break;
        case "2":case 2:case "bottom":this.align=2;
        this.style.left=this.maplet.width-10;
        this.style.top=this.maplet.height-100;
        break;
        case "3":case 3:case "right":this.align=3;
        this.style.left=this.maplet.width-100;
        this.style.top=10;
        break;
        default:this.align=0;
        break;
    };
    this.addZoom=function(){
        if(this.east){
            this.zoomtop=80;
            this.zoomleft=30;
        }
        else{
            this.zoomtop=10;
            this.zoomleft=10;
        };
        this.zoomin=new MyImage(this.zoomleft,this.zoomtop,this.tooldb+'zoomin.gif').get();
        this.zoomin.style.zIndex=10000;
        this.zoomin.title="按此放大";
        this.zoomout=new MyImage(this.zoomleft,this.zoomtop+20,this.tooldb+'zoomout.gif').get();
        this.zoomout.title='按此缩小';
        this.zoomout.style.zIndex=10000;
        this.zoomin.onclick=function(){
            this.parentNode.maplet.zoomIn();
        };
        this.zoomout.onclick=function(){
            this.parentNode.maplet.zoomOut();
        };
        this.div.appendChild(this.zoomin);
        this.div.appendChild(this.zoomout);
    };
    this.addZoomBar=function(){
        this.stepHeight=7;
        this.zoomin=new MyImage(30,80,this.tooldb+'zoomin.gif').get();
        this.zoomin.title='按此放大';
        this.zoomin.style.zIndex=10000;
        this.zoomcells=new Array();
        for(var $22=0;$22<this.maplet.zoomlevels;$22++){
            var $23=new MyImage(30,97+$22*this.stepHeight,this.tooldb+'zoomcell.gif').get();
            $23.key=this.maplet.zoomlevels-$22;
            $23.root=this;
            $23.title='第'+($23.key)+'级';
            $23.style.zIndex=9000;
            $23.onclick=function(){
                this.root.maplet.setZoomLevel(this.key-1);
            };
            this.zoomcells.push($23);
        };
        this.zoomout=new MyImage(30,this.maplet.zoomlevels*this.stepHeight+97,this.tooldb+'zoomout.gif').get();
        this.zoomout.title='按此缩小';
        this.zoomout.style.zIndex=10000;
        var $24=Math.ceil(97+(this.maplet.zoomlevels-(this.maplet.zoom+1))*this.stepHeight);
        this.slider=new MyImage(30,$24,this.tooldb+'slider.gif').get();
        this.slider.style.zIndex=10000;
        this.zoomin.root=this;
        this.zoomout.root=this;
        this.slider.root=this;
        this.zoomin.onclick=function(){
            this.parentNode.maplet.zoomIn();
        };
        this.zoomout.onclick=function(){
            this.parentNode.maplet.zoomOut();
        };
        this.slider.onmousedown=function(){
            this.drag=true;
            this.yoffset=parseInt(this.style.top,10)-event.clientY;
        };
        this.slider.onmouseup=function(){
            this.drag=false;
        };
        this.slider.ondrag=function(){
            if(this.drag){
                if((event.clientY+this.yoffset)>97&&(event.clientY+this.yoffset)<97+this.root.stepHeight*(this.root.maplet.zoomlevels-1)){
                    this.style.top=Math.round((event.clientY+this.yoffset)/this.root.stepHeight)*this.root.stepHeight;
                }
                else if((event.clientY+this.yoffset)>97+this.root.stepHeight*(this.root.maplet.zoomlevels-1)){
                    this.setZoomLevel(0);
                }
                else if((event.clientY+this.yoffset)<97){
                    this.setZoomLevel(this.root.maplet.zoomlevels-1);
                }
            }
        };
        this.slider.ondragend=function(){
            this.root.maplet.setZoomLevel(this.root.maplet.zoomlevels-Math.round((parseInt(this.style.top,10)-100)/this.root.stepHeight)-1);
        };
        this.slider.setZoomLevel=function($1L){
            this.style.top=97+(this.root.maplet.zoomlevels-($1L+1))*this.root.stepHeight;
        };
        this.slider.onzoomchanged=function(){
            this.setZoomLevel(this.root.maplet.zoom);
        };
        this.maplet.addListener(this.slider,'onzoomchanged');
        this.div.appendChild(this.zoomin);
        for(var $25=0;$25<this.zoomcells.length;$25++){
            this.div.appendChild(this.zoomcells[$25]);
        };
        this.div.appendChild(this.zoomout);
        this.div.appendChild(this.slider);
    };
    this.addPan=function(){
        this.east=new MyImage(50,30,this.tooldb+'east.gif').get();
        this.east.title='向东平移';
        this.east.style.zIndex=10000;
        this.south=new MyImage(30,50,this.tooldb+'south.gif').get();
        this.south.title='向南平移';
        this.south.style.zIndex=10000;
        this.west=new MyImage(10,30,this.tooldb+'west.gif').get();
        this.west.title='向西平移';
        this.west.style.zIndex=10000;
        this.north=new MyImage(30,10,this.tooldb+'north.gif').get();
        this.north.title='向北平移';
        this.north.style.zIndex=10000;
        this.reset=new MyImage(30,30,this.tooldb+'/reset.gif').get();
        this.reset.title='重置地图到全图';
        this.reset.style.zIndex=10000;
        this.east.onclick=function(){
            this.parentNode.maplet.panEast();
        };
        this.south.onclick=function(){
            this.parentNode.maplet.panSouth();
        };
        this.west.onclick=function(){
            this.parentNode.maplet.panWest();
        };
        this.north.onclick=function(){
            this.parentNode.maplet.panNorth();
        };
        this.reset.onclick=function(){
            this.parentNode.maplet.setZoomLevel(0);
            this.parentNode.maplet.setCenter(36.66384,117.02468);
        };
        this.div.appendChild(this.east);
        this.div.appendChild(this.south);
        this.div.appendChild(this.west);
        this.div.appendChild(this.north);
        this.div.appendChild(this.reset);
    };
    this.addEagleMap=function($0r,$0x){
        this.eagleMap=new EagleMap($0r,$0x,this.maplet,this.tooldb,this.maplet.maproot);
        this.maplet.container.appendChild(this.eagleMap.get());
    };
    this.addCross=function(){
        this.cross=new MyImage(this.maplet.width/2-31,this.maplet.height/2-22,this.tooldb+'/cross.gif').get();
        this.cross.width=63;
        this.cross.height=45;
        this.cross.style.filter='alpha(opacity=70)';
        this.maplet.getMaskLayer().appendChild(this.cross);
    };
    this.addMapType=function(){
        this.typical=new MyImage(100,20,this.tooldb+'/typical.gif').get();
        this.typical.title='普通地图';
        this.typical.style.zIndex=10000;
        this.satellite=new MyImage(200,20,this.tooldb+'/satellite.gif').get();
        this.satellite.title='卫星地图';
        this.satellite.style.zIndex=10000;
        this.hybrid=new MyImage(300,20,this.tooldb+'/hybrid.gif').get();
        this.hybrid.title='叠加地图';
        this.hybrid.style.zIndex=10000;
        this.typical.onclick=function(){
            this.parentNode.maplet.setMapType('typical');
        };
        this.satellite.onclick=function(){
            this.parentNode.maplet.setMapType('satellite');
        };
        this.hybrid.onclick=function(){
            this.parentNode.maplet.setMapType('hybrid');
        };
        this.div.appendChild(this.typical);
        this.div.appendChild(this.satellite);
        this.div.appendChild(this.hybrid);
    };
    this.addScale=function(){
        this.scale=new Div(15,this.maplet.height-50,120,20).get();
        var $26=Math.round(this.maplet.scalefactors[this.maplet.zoom]*$a/256*100);
        this.scale.innerHTML='<div style="width:120;filter:glow(color=#FFFFFF,strength=2);" align="center" cellspacing="2"><b>'+$26+'m</b></div><table width="120" height=10 cellspacing="2" cellpadding="0" style="filter:glow(color=#FFFFFF,strength=2);border-Left:1px solid #000000;border-right:1px solid #000000;border-bottom:3px solid #000000"><tr><td align="center"></td></tr></table>';
        this.maplet.getMaskLayer().appendChild(this.scale);
        this.scalemaplistener=new Object();
        this.scalemaplistener.root=this;
        this.scalemaplistener.onzoomchanged=function(){
            var $26=Math.round(this.root.maplet.scalefactors[this.root.maplet.zoom]*$a/256*100);
            this.root.scale.innerHTML='<div style="width:120;filter:glow(color=#FFFFFF,strength=2);" align="center" cellspacing="2"><b>'+$26+'m</b></div><table width="120" height=10 cellspacing="2" cellpadding="0" style="filter:glow(color=#FFFFFF,strength=2);border-Left:1px solid #000000;border-right:1px solid #000000;border-bottom:3px solid #000000"><tr><td align="center"></td></tr></table>';
        };
        this.maplet.addListener(this.scalemaplistener,'onzoomchanged');
    };
    this.addCopyright=function(){
        this.copyright=new Div(10,this.maplet.height-23,140,30).get();
        this.copyright.style.color='#FFAAAA';
        this.copyright.style.filter='glow(color=#0000FF,strength=2)';
        this.copyright.innerHTML='&nbsp;审:鲁SG(2008)139号';
        this.copyright.style.zIndex=10000;
        this.maplet.getMaskLayer().appendChild(this.copyright);
    };
    this.onresized=function(){
        if(this.cross){
            this.cross.style.left=this.maplet.width/2-33;
            this.cross.style.top=this.maplet.height/2-31;
        }
    };
    this.maplet.addListener(this,'onresized');
    this.hide=function(){
        this.div.style.visibility='hidden';
    };
    this.show=function(){
        this.div.style.visibility='visible';
    };
    this.toString=function(){
        return 'ToolBox';
    };
    this.addTool=function($27){
        $27.setMaplet(this.maplet);
        this.tools[this.tools.length]=$27;
        this.toollistener=new Object();
        this.toollistener.root=this;
        this.toollistener.tool=$27;
        this.toollistener.onbegin=function(){
            this.root.resetAllOtherTools(this.tool);
        };
        $27.addListener(this.toollistener,'onbegin');
    };
    this.resetAllOtherTools=function($27){
        for(var $28=0;$28<this.tools.length;$28++){
            if(this.tools[$28]==$27){
                continue;
            };
            this.tools[$28].reset();
        }
    };
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
    };
    this.resetAllTools=function(){
        this.resetAllOtherTools();
    }
};


function ToolEventHandler($1Z){
    this.maplet=$1Z;
    this.toString=function(){
        return 'RToolManager';
    };
    this.addZoomIn=function($29){
        this.zoomin=$29;
        this.zoomin.eventroot=this;
        this.zoomin.onclick=function(){
            this.eventroot.beginZoomIn.apply(this.eventroot)
        };
    };
    this.addZoomOut=function($2a){
        this.zoomout=$2a;
        this.zoomout.eventroot=this;
        this.zoomout.onclick=function(){
            this.eventroot.beginZoomOut.apply(this.eventroot)
        };
    };
    this.addMeasure=function($2b){
        this.measure=$2b;
        this.measure.eventroot=this;
        this.measure.onclick=function(){
            this.eventroot.beginMeasure.apply(this.eventroot)
        };
    };
    this.onresized=function(){
        setRTimeout(this,this.setHorizonSliderZoom,100,[this.maplet.getZoomLevel()]);
    };
    this.onzoomchanged=function(){
        this.slider.style.left=this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft+this.maplet.getZoomLevel()*this.sliderBarStep+3;
    };
    this.addHorizonSliderBar=function($2c,$2d,$2e,end){
        this.sliderBarStep=(end-$2e)/(this.maplet.zoomlevels-1);
        this.leveldiv=new Div(0,0,13,13).get();
        this.leveldiv.style.zIndex=10000;
        this.leveldiv.style.border='1px solid #555555';
        this.leveldiv.align='center';
        this.leveldiv.style.backgroundColor='#EDEBEC';
        this.leveldiv.style.visibility='hidden';
        document.body.appendChild(this.leveldiv);
        this.sliderBar=$2c;
        this.slider=$2d;
        this.slider.style.position='absolute';
        this.start=$2e;
        this.end=end;
        this.sliderBar.eventroot=this;
        this.slider.eventroot=this;
        this.sliderBar.onclick=function(){
            this.eventroot.beginHorizonSliderBarClick.apply(this.eventroot)
        };
        this.sliderBar.onmousemove=function(){
            this.eventroot.beginHorizonSliderBarMove.apply(this.eventroot)
        };
        this.sliderBar.onmouseout=function(){
            this.eventroot.beginHorizonSliderBarOut.apply(this.eventroot)
        };
        this.slider.ondrag=function(){
            this.eventroot.beginHorizonSliderDrag.apply(this.eventroot)
        };
        this.slider.ondragend=function(){
            this.eventroot.beginHorizonSliderDragEnd.apply(this.eventroot)
        };
        this.slider.style.top=this.sliderBar.getBoundingClientRect().bottom+document.body.scrollTop;
        this.slider.style.left=this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft+this.maplet.getZoomLevel()*this.sliderBarStep+3;
        this.maplet.addListener(this,'onresized');
        this.maplet.addListener(this,'onzoomchanged');
    };
    this.addVerticalSliderBar=function($2c,$2d,$2e,end){
        this.sliderBarStep=(end-$2e)/(this.maplet.zoomlevels-1);
        this.leveldiv=new Div(0,0,13,13).get();
        this.leveldiv.style.zIndex=10000;
        this.leveldiv.style.visibility='hidden';
        document.body.appendChild(this.leveldiv);
        this.sliderBar=$2c;
        this.slider=$2d;
        this.start=$2e;
        this.end=end;
        this.sliderBar.eventroot=this;
        this.slider.eventroot=this;
        this.sliderBar.onclick=function(){
            this.eventroot.beginVerticalSliderBarClick.apply(this.eventroot)
        };
        this.sliderBar.onmousemove=function(){
            this.eventroot.beginVerticalSliderBarMove.apply(this.eventroot)
        };
        this.sliderBar.onmouseout=function(){
            this.eventroot.beginVerticalSliderBarOut.apply(this.eventroot)
        };
        this.slider.ondrag=function(){
            this.eventroot.beginVerticalSliderDrag.apply(this.eventroot)
        };
        this.slider.ondragend=function(){
            this.eventroot.beginVerticalSliderDragEnd.apply(this.eventroot)
        };
        this.slider.style.top=this.sliderBar.getBoundingClientRect().top+document.body.scrollTop+this.maplet.getZoomLevel()*this.sliderBarStep;
    };
    this.setHorizonSliderZoom=function($1L){
        this.slider.style.left=this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft+$1L*this.sliderBarStep+3;
    };
    this.beginHorizonSliderBarClick=function(){
        this.setHorizonSliderZoom(this.getHorizonSliderBarZoom());
        this.maplet.setZoomLevel(this.getHorizonSliderBarZoom());
    };
    this.getHorizonSliderBarZoom=function(){
        return Math.round((event.clientX-this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft-this.start)/this.sliderBarStep);
    };
    this.beginHorizonSliderBarMove=function(){
        this.leveldiv.style.visibility='visible';
        this.leveldiv.style.left=event.clientX;
        this.leveldiv.style.top=this.sliderBar.getBoundingClientRect().top+document.body.scrollTop-20;
        this.leveldiv.innerHTML='<b>'+this.getHorizonSliderBarZoom()+'</b>';
    };
    this.beginHorizonSliderBarOut=function(){
        this.leveldiv.style.visibility='hidden';
    };
    this.beginHorizonSliderDrag=function(){
        var $0q=this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft+Math.round((event.clientX-this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft-this.start)/this.sliderBarStep)*this.sliderBarStep+3;
        if($0q>(this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft)&&$0q<(this.sliderBar.getBoundingClientRect().right+document.body.scrollLeft)){
            this.slider.style.left=$0q;
        }
        else if($0q<(this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft)){
            this.slider.style.left=this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft+3;
        }
        else if($0q>(this.sliderBar.getBoundingClientRect().right+document.body.scrollLeft)){
            this.slider.style.left=this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft+(this.maplet.zoomlevels-1)*this.sliderBarStep+3;
        }
    };
    this.beginHorizonSliderDragEnd=function(){
        this.maplet.setZoomLevel(Math.round((event.clientX-this.sliderBar.getBoundingClientRect().left+document.body.scrollLeft-this.start)/this.sliderBarStep));
    };
    this.beginZoomIn=function(){
        this.maplet.zoomIn();
    };
    this.beginZoomOut=function(){
        this.maplet.zoomOut();
    };
    this.beginMeasure=function(){
        try{
            if(this.maplet.toolbox.eagleMap.eagleshow){
                this.maplet.toolbox.eagleMap.onoff.onclick();
            }
        }
        catch(ex){
        };
        if(!this.measureResult){
            this.measureResult=new FloatDialog(this.maplet.width-140,20,120,'测距结果','单击加点，双击结束');
            this.maplet.get().appendChild(this.measureResult.get());
        };
        if(!this.distancediv){
            this.distancediv=new Div(-100,-100,null,null);
            this.distancediv.style.filter='glow(color=#FFFFFF,strength=2)';
            this.maplet.get().appendChild(this.distancediv.get());
        }
        else{
            this.distancediv.style.visibility='visible';
        };
        this.measureLatLngs=new Array();
        this.tmpmeasureLatLngs=new Array();
        this.measureMarker=this.maplet.addStaticPathMarker(this.measureLatLngs,'#FF0000',3);
        this.tmpmeasureMarker=this.maplet.addStaticPathMarker(this.tmpmeasureLatLngs,'#FF0000',3);
        this.maplet.setCursor('crosshair');
        this.maplet.enableDblclick=false;
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplistener.onclicked=function(){
            this.root.maplet.setCursor('crosshair');
            var $0q=window.event.offsetX;
            var top=window.event.offsetY;
            this.root.measureLatLngs[this.root.measureLatLngs.length]=this.root.maplet.getLatLng($0q,top);
            this.root.tmpmeasureLatLngs[0]=this.root.maplet.getLatLng($0q,top);
            this.root.tmpmeasureLatLngs[1]=this.root.maplet.getLatLng($0q,top);
            this.root.maplet.refreshMarkers();
        };
        this.maplistener.ondblclicked=function(){
            this.root.measureResult.show();
            this.root.measureResult.setContent('单击加点，双击结束<br>总距离为：<br>'+(getPathDistance(this.root.measureLatLngs)+getPathDistance(this.root.tmpmeasureLatLngs))+'米');
            this.root.distancediv.style.visibility='hidden';
            this.root.distancediv.style.left=-100;
            this.root.distancediv.style.top=-100;
            this.onclicked=function(){
            };
            this.onmousemoved=function(){
            };
            this.root.maplet.setCursor('default');
            this.ondblclicked=function(){
            };
            this.root.maplet.enableDblclick=true;
        };
        this.maplistener.onmousemoved=function(){
            if(this.root.measureLatLngs.length>0){
                var $0q=window.event.offsetX;
                var top=window.event.offsetY;
                this.root.tmpmeasureLatLngs[1]=this.root.maplet.getLatLng($0q,top);
                this.root.maplet.refreshMarkers();
                this.root.distancediv.style.left=$0q+10;
                this.root.distancediv.style.top=top+10;
                this.root.distancediv.get().innerHTML='单击加点，双击结束<br>'+(getPathDistance(this.root.measureLatLngs)+getPathDistance(this.root.tmpmeasureLatLngs))+'米';
            }
        };
        this.maplet.addListener(this.maplistener,'onclicked');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'ondblclicked');
    };
    this.abortMeasure=function(){
        if(this.measureResult){
            this.measureResult.hide();
        };
        if(this.distancediv){
            this.distancediv.style.visibility='hidden';
            this.distancediv.style.left=-100;
            this.distancediv.style.top=-100;
        };
        if(this.maplistener){
            this.maplistener.onclicked=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.ondblclicked=function(){
            };
        };
        this.maplet.setCursor('default');
        this.maplet.enableDblclick=true;
    };
    this.addRectTool=function($2f){
        this.rectTool=$2f;
        this.rectTool.eventroot=this;
        this.rectTool.onclick=function(){
            this.eventroot.beginDrawRect.apply(this.eventroot)
        };
    };
    this.beginDrawRect=function(){
        this.cancelAllTools();
        this.maplet.setCursor('crosshair');
        this.rectmaplistener=new Object();
        this.rectmaplistener.root=this;
        this.rectmaplistener.firstClick=false;
        this.rectmaplistener.secondClick=false;
        this.rectmaplistener.onclicked=function(){
            if(!this.firstClick&&!this.secondClick){
                this.root.maplet.setCursor('crosshair');
                var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left+document.body.scrollLeft;
                var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top+document.body.scrollTop;
                this.root.measureLatLngs[this.root.measureLatLngs.length]=this.root.maplet.getLatLng($0q,top);
                this.root.tmpmeasureLatLngs[0]=this.root.maplet.getLatLng($0q,top);
                this.root.tmpmeasureLatLngs[1]=this.root.maplet.getLatLng($0q,top);
                this.root.maplet.refreshMarkers();
                this.firstClick=true;
            }
            else if(this.firstClick&&!this.secondClick){
                this.onclicked=null;
                this.onmousemoved=null;
                this.root.maplet.setCursor('default');
            }
        };
        this.rectmaplistener.onmousemoved=function(){
            if(this.root.firstClick&&!this.root.secondClick){
            }
        }
    };
    this.abortDrawRect=function(){
    };
    this.addPointTool=function($2g){
    };
    this.addCircleTool=function($2h){
    };
    this.addPolygonTool=function($2i){
    };
    this.abortAllTools=function(){
        this.abortMeasure();
        this.abortDrawRect();
        this.abortDrawCircle();
        this.abortDrawPoint();
        this.abortDrawPolygon();
    }
};


function AreaTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.resultBox=null;
    this.toString=function(){
        return 'AreaTool';
    };
    this.polygonTool=new PolygonTool(this.tool);
    this.polygonlistener=new Object();
    this.polygonlistener.root=this;
    this.polygonlistener.onsuccess=function(){
        if(!this.root.resultBox){
            this.root.resultBox=new FloatDialog(this.root.maplet.width-200,100,150,'测面结果','');
            this.root.maplet.get().appendChild(this.root.resultBox.get());
        };
        var $08=getPolygonArea(this.root.polygonTool.latlngs);
        var $2j='测面结果为'+$08+'平方米<br>';
        if(Math.round($08/1000)/1000!=0){
            $2j+='合计'+Math.round($08/1000)/1000+'平方公里'
        };
        this.root.resultBox.setContent($2j);
        this.root.resultBox.show();
    };
    this.polygonTool.addListener(this.polygonlistener,'onsuccess');
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
        this.polygonTool.setMaplet(this.maplet);
    };
    this.reset=function(){
        this.polygonTool.reset();
    };
    this.addListener=function($0v,$0w){
        this.polygonTool.addListener($0v,$0w);
    }
};


function CircleTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.center=null;
    this.radius=null;
    this.marker=null;
    this.toString=function(){
        return 'CircleTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='不能向'+this.toString()+'添加非Map对象。';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        this.root.beginDraw();
    };
    this.beginDraw=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.maplet.clearStaticMarkers();
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplet.setCursor('crosshair');
        this.maplistener.onmousedown=function(){
            this.root.maplet.setCursor('crosshair');
            this.root.maplet.disableDrag();
            this.drawing=true;
            var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left;
            var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top;
            this.root.center=this.root.maplet.getLatLng($0q,top);
            this.root.marker=this.root.maplet.addStaticCircleRegionMarker(this.root.center,0,'#FFFFFF');
        };
        this.maplistener.onmousemoved=function(){
            if(this.drawing){
                this.root.maplet.setCursor('crosshair');
                var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left;
                var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top;
                var $2k=this.root.maplet.getLatLng($0q,top);
                this.root.marker.radius=degreeFromDistance(distanceBetween(this.root.marker.center,$2k));
                this.root.maplet.refreshMarkers();
            }
        };
        this.maplistener.onmouseup=function(){
            var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left;
            var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top;
            var $2k=this.root.maplet.getLatLng($0q,top);
            this.root.radius=degreeFromDistance(distanceBetween(this.root.marker.center,$2k));
            this.root.marker.radius=this.root.radius;
            this.root.maplet.setCursor('default');
            this.root.maplet.enableDrag();
            this.drawing=false;
            this.root.begined=false;
            this.onmousedown=function(){
            };
            this.onmousemoved=function(){
            };
            this.onmouseup=function(){
            };
            this.root.notify('onsuccess');
        };
        this.maplet.addListener(this.maplistener,'onmousedown');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'onmouseup');
    };
    this.reset=function(){
        this.drawing=false;
        this.maplet.enableDrag();
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onmousedown=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.onmouseup=function(){
            };
        };
        this.begined=false;
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};


function DistanceTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.resultBox=null;
    this.toString=function(){
        return 'DistanceTool';
    };
    this.pathTool=new PathTool(this.tool);
    this.pathlistener=new Object();
    this.pathlistener.root=this;
    this.pathlistener.onsuccess=function(){
        if(!this.root.resultBox){
            this.root.resultBox=new FloatDialog(this.root.maplet.width-200,100,150,'测距结果','');
            this.root.maplet.get().appendChild(this.root.resultBox.get());
        };
        var $08=getPathDistance(this.root.pathTool.latlngs);
        this.root.resultBox.setContent('测距结果为'+$08+'米。<br>合计'+Math.round($08)/1000+'公里。');
        this.root.resultBox.show();
    };
    this.pathTool.addListener(this.pathlistener,'onsuccess');
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
        this.pathTool.setMaplet(this.maplet);
    };
    this.reset=function(){
        this.pathTool.reset();
    };
    this.addListener=function($0v,$0w){
        this.pathTool.addListener($0v,$0w);
    }
};
function EastTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.toString=function(){
        return 'EastTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='\u4E0D\u80FD\u5BF9'+this.toString()+'\u6DFB\u52A0\u975EMap\u5BF9\u8C61';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'\u5C1A\u672A\u6DFB\u52A0\u5230\u6709\u6548\u7684Toolbox\u3002';
            return;
        };
        this.root.maplet.panEast();
        this.root.notify('onsuccess');
    };
    this.reset=function(){
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    }
};
function NorthTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.toString=function(){
        return 'NorthTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='\u4E0D\u80FD\u5BF9'+this.toString()+'\u6DFB\u52A0\u975EMap\u5BF9\u8C61';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'\u5C1A\u672A\u6DFB\u52A0\u5230\u6709\u6548\u7684Toolbox\u3002';
            return;
        };
        this.root.maplet.panNorth();
        this.root.notify('onsuccess');
    };
    this.reset=function(){
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    }
};


function DrawPathTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.marker=null;
    this.maplet=null;
    this.latlngs=null;
    this.toString=function(){
        return 'PathTool';
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        this.root.beginDraw();
    };
    this.beginDraw=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.drawing=false;
        this.maplet.setCursor('crosshair');
        this.maplet.disableDoubleClick();
        this.maplet.clearStaticMarkers();
        this.maplet.clearMarkers();
        if(!this.tiplbl){
            this.tiplbl=new Label(-100,-100,'单击加点，双击结束，<br>拖动平移，滚轮缩放');
            this.tiplbl.style.filter='glow(color=#FFFFFF,strength=2)';
            this.maplet.get().appendChild(this.tiplbl.get());
            this.tiplbl.style.visibility='visible';
        };
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplistener.onclicked=function(){
            if(!this.root.drawing){
                this.root.maplet.setCursor('crosshair');
                this.root.drawing=true;
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                var $04=new Array();
                $04.push($M);
                $04.push($M);
                this.root.marker=this.root.maplet.addStaticPathMarker([$M],'#FF0000',2);
                this.marker=this.root.maplet.addStaticPathMarker($04,'#FF0000',2);
                this.root.maplet.refreshStaticMarkers();
            }
            else{
                this.root.maplet.setCursor('crosshair');
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length]=$M;
                this.marker.latlngs[0]=$M;
                this.root.maplet.refreshStaticMarkers();
            }
        };
        this.maplistener.onmousemoved=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.marker.latlngs[1]=$M;
                this.root.maplet.refreshStaticMarkers();
            }
            else if(this.root.begined){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
            }
        };
        this.maplistener.ondblclicked=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=-100;
                this.root.tiplbl.style.top=-100;
                this.root.tiplbl.style.visibility='hidden';
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length]=$M;
                this.marker.destroy();
                this.root.maplet.refreshStaticMarkers();
                this.root.latlngs=this.root.marker.latlngs;
                
                this.root.maplet.setCursor('default');
                this.onclicked=function(){
                };
                this.onmousemoved=function(){
                };
                this.ondblclicked=function(){
                };
                this.root.drawing=false;
                this.root.begined=false;
                this.root.maplet.enableDoubleClick();
                this.root.notify('onsuccess');
            }
        };
        this.maplet.addListener(this.maplistener,'onclicked');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'ondblclicked');
    };
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
    };
    this.reset=function(){
        this.drawing=false;
        this.begined=false;
        this.maplet.enableDoubleClick();
        if(this.tiplbl){
            this.tiplbl.style.left=-100;
            this.tiplbl.style.top=-100;
            this.tiplbl.style.visibility='hidden';
        };
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onclicked=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.ondblclicked=function(){
            };
        };
        this.maplet.clearStaticMarkers();
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};

function PathTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.marker=null;
    this.maplet=null;
    this.latlngs=null;
    this.toString=function(){
        return 'PathTool';
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        this.root.beginDraw();
    };
    this.beginDraw=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.drawing=false;
        this.maplet.setCursor('crosshair');
        this.maplet.disableDoubleClick();
        this.maplet.clearStaticMarkers();
        if(!this.tiplbl){
            this.tiplbl=new Label(-100,-100,'单击加点，双击结束，<br>拖动平移，滚轮缩放');
            this.tiplbl.style.filter='glow(color=#FFFFFF,strength=2)';
            this.maplet.get().appendChild(this.tiplbl.get());
            this.tiplbl.style.visibility='visible';
        };
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplistener.onclicked=function(){
            if(!this.root.drawing){
                this.root.maplet.setCursor('crosshair');
                this.root.drawing=true;
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                var $04=new Array();
                $04.push($M);
                $04.push($M);
                this.root.marker=this.root.maplet.addStaticPathMarker([$M],'#FF0000',2);
                this.marker=this.root.maplet.addStaticPathMarker($04,'#FF0000',2);
                this.root.maplet.refreshStaticMarkers();
            }
            else{
                this.root.maplet.setCursor('crosshair');
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length]=$M;
                this.marker.latlngs[0]=$M;
                this.root.maplet.refreshStaticMarkers();
            }
        };
        this.maplistener.onmousemoved=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.marker.latlngs[1]=$M;
                this.root.maplet.refreshStaticMarkers();
            }
            else if(this.root.begined){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
            }
        };
        this.maplistener.ondblclicked=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=-100;
                this.root.tiplbl.style.top=-100;
                this.root.tiplbl.style.visibility='hidden';
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length]=$M;
                this.marker.destroy();
                this.root.maplet.refreshStaticMarkers();
                this.root.latlngs=this.root.marker.latlngs;
                this.root.maplet.setCursor('default');
                this.onclicked=function(){
                };
                this.onmousemoved=function(){
                };
                this.ondblclicked=function(){
                };
                this.root.drawing=false;
                this.root.begined=false;
                this.root.maplet.enableDoubleClick();
                this.root.notify('onsuccess');
            }
        };
        this.maplet.addListener(this.maplistener,'onclicked');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'ondblclicked');
    };
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
    };
    this.reset=function(){
        this.drawing=false;
        this.begined=false;
        this.maplet.enableDoubleClick();
        if(this.tiplbl){
            this.tiplbl.style.left=-100;
            this.tiplbl.style.top=-100;
            this.tiplbl.style.visibility='hidden';
        };
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onclicked=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.ondblclicked=function(){
            };
        };
        this.maplet.clearStaticMarkers();
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};

function PointTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.latlng=null;
    this.marker=null;
    this.toString=function(){
        return 'PointTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='不能对'+this.toString()+'添加非Map对象';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'尚未添加到有效的Toolbox。';
            return;
        };
        this.root.beginPoint();
    };
    this.beginPoint=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.maplet.setCursor('crosshair');
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplistener.onclicked=function(){
            var $1J=this.root.maplet.get().getBoundingClientRect();
            var $0q=window.event.clientX-$1J.left;
            var top=window.event.clientY-$1J.top;
            this.root.latlng=this.root.maplet.getLatLng($0q,top);
            this.root.marker=this.root.maplet.addPointMarker(this.root.latlng,this.root.maplet.depthhandler.next(),$f+'map_img/map/marker.gif','标注','尚未添加详情',null);
            this.root.maplet.refreshMarkers();
            this.root.maplet.setCursor('default');
            this.onclicked=function(){
            };
            this.root.begined=false;
            this.root.notify('onsuccess');
        };
        this.maplet.addListener(this.maplistener,'onclicked');
    };
    this.reset=function(){
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onclicked=function(){
            };
        };
        this.begined=false;
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};

function PolygonTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.latlngs=null;
    this.marker=null;
    this.toString=function(){
        return 'PolygonTool';
    };
    this.maplet=null;
    this.tool.root=this;
    this.tool.onclick=function(){
        this.root.beginTool();
    };
    this.beginTool=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.maplet.setCursor('crosshair');
        this.maplet.disableDoubleClick();
        this.maplet.clearStaticMarkers();
        if(!this.tiplbl){
            this.tiplbl=new Label(-100,-100,'单击加点，双击结束，<br>拖动平移，滚轮缩放');
            this.tiplbl.style.filter='glow(color=#FFFFFF,strength=2)';
            this.maplet.get().appendChild(this.tiplbl.get());
            this.tiplbl.style.visibility='visible';
        }
        else{
            this.tiplbl.style.visibility='visible';
        };
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplistener.onclicked=function(){
            if(!this.root.drawing){
                this.root.maplet.setCursor('crosshair');
                this.root.drawing=true;
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                var $04=new Array();
                $04.push($M);
                $04.push($M);
                this.root.marker=this.root.maplet.addStaticRegionMarker($04,'#FF0000','#FF0000',1);
                this.root.maplet.refreshStaticMarkers();
            }
            else{
                this.root.maplet.setCursor('crosshair');
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length-1]=$M;
                this.root.marker.latlngs[this.root.marker.latlngs.length]=this.root.marker.latlngs[0];
                this.root.maplet.refreshStaticMarkers();
            }
        };
        this.maplistener.onmousemoved=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length-2]=$M;
                this.root.marker.latlngs[this.root.marker.latlngs.length-1]=this.root.marker.latlngs[0];
                this.root.maplet.refreshStaticMarkers();
            }
            else if(this.root.begined){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
            }
        };
        this.maplistener.ondblclicked=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=-100;
                this.root.tiplbl.style.top=-100;
                this.root.tiplbl.style.visibility='hidden';
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length-1]=$M;
                this.root.marker.latlngs[this.root.marker.latlngs.length]=this.root.marker.latlngs[0];
                this.root.maplet.refreshStaticMarkers();
                this.root.latlngs=this.root.marker.latlngs;
                this.root.maplet.setCursor('default');
                this.onclicked=function(){
                };
                this.onmousemoved=function(){
                };
                this.ondblclicked=function(){
                };
                this.root.drawing=false;
                this.root.begined=false;
                this.root.maplet.enableDoubleClick();
                this.root.notify('onsuccess');
            }
        };
        this.maplet.addListener(this.maplistener,'onclicked');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'ondblclicked');
    };
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
    };
    this.reset=function(){
        this.drawing=false;
        this.begined=false;
        this.maplet.enableDoubleClick();
        if(this.tiplbl){
            this.tiplbl.style.left=-100;
            this.tiplbl.style.top=-100;
            this.tiplbl.style.visibility='hidden';
        };
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onclicked=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.ondblclicked=function(){
            };
        };
        this.maplet.clearStaticMarkers();
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};


function DrawPolygonTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.latlngs=null;
    this.marker=null;
    this.toString=function(){
        return 'PolygonTool';
    };
    this.maplet=null;
    this.tool.root=this;
    this.tool.onclick=function(){
        this.root.beginTool();
    };
    this.beginTool=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.maplet.setCursor('crosshair');
        this.maplet.disableDoubleClick();
        this.maplet.clearStaticMarkers();
        this.maplet.clearMarkers();
        if(!this.tiplbl){
            this.tiplbl=new Label(-100,-100,'单击加点，双击结束，<br>拖动平移，滚轮缩放');
            this.tiplbl.style.filter='glow(color=#FFFFFF,strength=2)';
            this.maplet.get().appendChild(this.tiplbl.get());
            this.tiplbl.style.visibility='visible';
        }
        else{
            this.tiplbl.style.visibility='visible';
        };
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplistener.onclicked=function(){
            if(!this.root.drawing){
                this.root.maplet.setCursor('crosshair');
                this.root.drawing=true;
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                var $04=new Array();
                $04.push($M);
                $04.push($M);
                this.root.marker=this.root.maplet.addStaticRegionMarker($04,'#FF0000','#FF0000',1);
                this.root.maplet.refreshStaticMarkers();
            }
            else{
                this.root.maplet.setCursor('crosshair');
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length-1]=$M;
                this.root.marker.latlngs[this.root.marker.latlngs.length]=this.root.marker.latlngs[0];
                this.root.maplet.refreshStaticMarkers();
            }
        };
        this.maplistener.onmousemoved=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length-2]=$M;
                this.root.marker.latlngs[this.root.marker.latlngs.length-1]=this.root.marker.latlngs[0];
                this.root.maplet.refreshStaticMarkers();
            }
            else if(this.root.begined){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=$0q+10;
                this.root.tiplbl.style.top=top+20;
            }
        };
        this.maplistener.ondblclicked=function(){
            if(this.root.drawing){
                var $1J=this.root.maplet.get().getBoundingClientRect();
                var $0q=window.event.clientX-$1J.left;
                var top=window.event.clientY-$1J.top;
                this.root.tiplbl.style.left=-100;
                this.root.tiplbl.style.top=-100;
                this.root.tiplbl.style.visibility='hidden';
                var $M=this.root.maplet.getLatLng($0q,top);
                this.root.marker.latlngs[this.root.marker.latlngs.length-1]=$M;
                this.root.marker.latlngs[this.root.marker.latlngs.length]=this.root.marker.latlngs[0];
                this.root.maplet.refreshStaticMarkers();
                this.root.latlngs=this.root.marker.latlngs;
                this.root.maplet.setCursor('default');
                this.onclicked=function(){
                };
                this.onmousemoved=function(){
                };
                this.ondblclicked=function(){
                };
                this.root.drawing=false;
                this.root.begined=false;
                this.root.maplet.enableDoubleClick();
                this.root.notify('onsuccess');
            }
        };
        this.maplet.addListener(this.maplistener,'onclicked');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'ondblclicked');
    };
    this.setMaplet=function($1Z){
        this.maplet=$1Z;
    };
    this.reset=function(){
        this.drawing=false;
        this.begined=false;
        this.maplet.enableDoubleClick();
        if(this.tiplbl){
            this.tiplbl.style.left=-100;
            this.tiplbl.style.top=-100;
            this.tiplbl.style.visibility='hidden';
        };
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onclicked=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.ondblclicked=function(){
            };
        };
        this.maplet.clearStaticMarkers();
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};


function RectTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.leftbottom=null;
    this.righttop=null;
    this.bounds=null;
    this.marker=null;
    this.toString=function(){
        return 'RectTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='不能向'+this.toString()+'添加非Map对象。';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        this.root.beginDraw();
    };
    this.beginDraw=function(){
        if(this.begined){
            return;
        };
        this.notify('onbegin');
        this.begined=true;
        this.maplet.clearStaticMarkers();
        this.maplistener=new Object();
        this.maplistener.root=this;
        this.maplet.setCursor('crosshair');
        this.maplistener.onmousedown=function(){
            this.root.maplet.setCursor('crosshair');
            this.drawing=true;
            this.root.maplet.disableDrag();
            var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left;
            var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top;
            this.root.leftbottom=this.root.maplet.getLatLng($0q,top);
            this.root.marker=this.root.maplet.addStaticRectRegionMarker(new Bounds(this.root.leftbottom,this.root.leftbottom),'blue');
        };
        this.maplistener.onmousemoved=function(){
            if(this.drawing){
                this.root.maplet.setCursor('crosshair');
                var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left;
                var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top;
                this.root.marker.righttop=this.root.maplet.getLatLng($0q,top);
                this.root.maplet.refreshMarkers();
            }
        };
        this.maplistener.onmouseup=function(){
            var $0q=window.event.clientX-this.root.maplet.get().getBoundingClientRect().left;
            var top=window.event.clientY-this.root.maplet.get().getBoundingClientRect().top;
            this.root.righttop=this.root.maplet.getLatLng($0q,top);
            this.root.bounds=new Bounds(this.root.leftbottom,this.root.righttop);
            this.root.maplet.setCursor('default');
            this.root.maplet.enableDrag();
            this.drawing=false;
            this.root.begined=false;
            this.onmousedown=function(){
            };
            this.onmousemoved=function(){
            };
            this.onmouseup=function(){
            };
            this.root.notify('onsuccess');
        };
        this.maplet.addListener(this.maplistener,'onmousedown');
        this.maplet.addListener(this.maplistener,'onmousemoved');
        this.maplet.addListener(this.maplistener,'onmouseup');
    };
    this.reset=function(){
        this.drawing=false;
        this.maplet.enableDrag();
        this.maplet.setCursor('default');
        if(this.maplistener){
            this.maplistener.onmousedown=function(){
            };
            this.maplistener.onmousemoved=function(){
            };
            this.maplistener.onmouseup=function(){
            };
        };
        this.begined=false;
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};
function SouthTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.toString=function(){
        return 'SouthTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='\u4E0D\u80FD\u5BF9'+this.toString()+'\u6DFB\u52A0\u975EMap\u5BF9\u8C61';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'\u5C1A\u672A\u6DFB\u52A0\u5230\u6709\u6548\u7684Toolbox\u3002';
            return;
        };
        this.root.maplet.panSouth();
        this.root.notify('onsuccess');
    };
    this.reset=function(){
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    }
};
function WestTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.toString=function(){
        return 'WestTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='\u4E0D\u80FD\u5BF9'+this.toString()+'\u6DFB\u52A0\u975EMap\u5BF9\u8C61';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'\u5C1A\u672A\u6DFB\u52A0\u5230\u6709\u6548\u7684Toolbox\u3002';
            return;
        };
        this.root.maplet.panWest();
        this.root.notify('onsuccess');
    };
    this.reset=function(){
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':\u4E0D\u5408\u6CD5\u7684'+$0w+'\u4E8B\u4EF6\u5BF9\u8C61';
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'\u7C7B\u7684\u67D0'+$0w+'\u4E8B\u4EF6\u76D1\u542C\u5BF9\u8C61\u635F\u574F';
                }
            };
            break;
            default:window.status=this.toString()+'\u7C7B\u4E0D\u5B58\u5728'+$0w+'\u4E8B\u4EF6';
            break;
        }
    }
};
function ZoominTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.toString=function(){
        return 'ZoominTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='不能对'+this.toString()+'添加非Map对象';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'尚未添加到有效的Toolbox。';
            return;
        };
        this.root.maplet.setZoomLevel(this.root.maplet.getZoomLevel()+1);
        this.root.notify('onsuccess');
    };
    this.reset=function(){
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
};

function ZoomoutTool($27){
    if(!$27){
        return;
    };
    this.tool=$27;
    this.maplet=null;
    this.toString=function(){
        return 'ZoomoutTool';
    };
    this.setMaplet=function($1Z){
        if($1Z.toString()!='Map'){
            window.status='不能对'+this.toString()+'添加非Map对象';
        };
        this.maplet=$1Z;
    };
    this.tool.root=this;
    this.tool.onclick=function(){
        if(!this.root.maplet){
            window.status=this.root.toString()+'尚未添加到有效的Toolbox。';
            return;
        };
        this.root.maplet.setZoomLevel(this.root.maplet.getZoomLevel()-1);
        this.root.notify('onsuccess');
    };
    this.reset=function(){
        this.notify('onreset');
    };
    this.onbegin=new Array();
    this.onsuccess=new Array();
    this.onreset=new Array();
    this.addListener=function($0v,$0w){
        switch($0w){
            case 'onbegin':if($0v.onbegin){
                this.onbegin[this.onbegin.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onsuccess':if($0v.onsuccess){
                this.onsuccess[this.onsuccess.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            case 'onreset':if($0v.onreset){
                this.onreset[this.onreset.length]=$0v;
            }
            else{
                window.status=this.toString()+':不合法的'+$0w+'事件对象';
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    };
    this.notify=function($0w){
        switch($0w){
            case 'onbegin':for(var i=0;
            i<this.onbegin.length;
            i++){
                if(this.onbegin[i].onbegin){
                    this.onbegin[i].onbegin();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onsuccess':for(var i=0;
            i<this.onsuccess.length;
            i++){
                if(this.onsuccess[i].onsuccess){
                    this.onsuccess[i].onsuccess();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            case 'onreset':for(var i=0;
            i<this.onreset.length;
            i++){
                if(this.onreset[i].onreset){
                    this.onreset[i].onreset();
                }
                else{
                    window.status=this.toString()+'类的某'+$0w+'事件监听对象损坏';
                }
            };
            break;
            default:window.status=this.toString()+'类不存在'+$0w+'事件';
            break;
        }
    }
}



function RContextMenu(width){
	this.toString=function(){
		return 'RContextMenu';
	} 
	this.menu=new List(0,0,width,22);
	this.style=this.menu.style;
	this.style.border='1px solid #AAAAAA';
	this.menu.style.overflowY='auto';
	
	this.addMenuItem=function(text,value,title){
		text='<center>'+text+'</center>';
		this.menu.addListItem(text,value,title);
		this.menu.style.height=20*this.menu.getLength()+2;
	}
	
	this.addSeparator=function(){
		this.menu.addListItem('<hr width='+(width-4)+' align="center">','','');
		this.menu.style.height=20*this.menu.getLength()+2;
	}
	
	this.addMenuContent=function(content,value,title){
		if(content.style){
			content.style.align='center';
		}
		this.menu.addListContent(content,value,title);
		this.menu.style.height=20*this.menu.getLength()+2;
	}
	
	this.addListener=function(listener,estring){
		this.menu.addListener(listener,estring);
	}
	
	
	this.get=function(){
		return this.menu.get();
	}
	this.hide=function(){
		this.visible=false;
		this.menu.hide();
	}
	this.show=function(){
		this.visible=true;
		this.menu.show();
	}
	
	this.getSelectedValue=function(){
		return this.menu.selectedValue;
	}
	
	this.getSelectedIndex=function(){
		return this.menu.selectedIndex;
	}
	
	this.getSelectedText=function(){
		return this.menu.selectedText;
	}
}