﻿// JScript 文件
         
        var topdownup=102;       
        var zoom=1;        
        var clickzoom=4;
        var viewportWidth=752;
        var viewportHeight=524;
        var tileSize=256;
        var dragging=false;
        var top;
        var left;
        var dragStartTop;
        var dragStartLeft;
        var YingYandragging=false;
        var YingYantop;
        var YingYanleft;
        var YingYandragStartTop;
        var YingYandragStartLeft;
        var IsMoveRight=0;
        var IsMoveLeft=0;
        var IsMoveUp=0;
        var IsMoveDown=0;        
        var MoveUp=262;
        var MoveRightLeft=376;
       var DivOuterTop=88;
       var DivDownUpTem=0;
       var downupTop;       
       var isdivRightDetial="visible";
       var YingMinLevel=2;	
       var DataType=2;
       var xPoint;
       var yPoint;
       var xWin;
       var yWin;
       var HouseDetialId;
       var HouseDetialTelPhone
       var HouseDetialDetial
       var HouseDetialAddress
       var HouseDetialHouseName
       var HouseDetialDataTop
       var HouseDetialDataLeft
       var HouseDetialDataWidth
       var HouseDetialDataHeight
       var HouseDetialImage
       var strViewHouse;
       var ViewLeft;
       var ViewTop;
       var IsViewMove=false;
       var AddHouse;       
       var IsOutClick=false;
       var BiaoZhuType=1;
       var GTwo;
       var GThree;
       var strViewGongJiao;
       var IsViewGuangGao=false;
       
       
       var indexX;
       var indexY;
       
       
       //测距
        //参数设置
        var scale=1;
        var modulus = 0.25;

        //Measure distance
        var measure = false;
        var nextX = 0;
        var nextY = 0;
        var distance = 0;
        var distanceSum = 0;
        var color = "blue";
        var size = "2pt";
        var v;  
       
       
       
       function indexmove(event)
       {
            indexX=event.screenX;
            indexY=event.screenY
            //alert(indexX);
       }      
       
       
        function menuLongOnclickHidden()                            
        {
                
           var divRightDetial=document.getElementById("divRightDetial");
                divRightDetial.style.visibility="hidden";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width= document.body.clientWidth-42;     
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="hidden";                
            
            var divRightBtnShow=document.getElementById("divRightBtnShow");
                divRightBtnShow.style.visibility="visible";
				divRightBtnShow.style.left=document.body.clientWidth-53;
                
            var outerDiv=window.frames["IfDivMap"].document.getElementById("outerDiv");
                outerDiv.style.width=document.body.clientWidth-42;  
            
            var divAllWindow=document.getElementById("divAllWindow");
                divAllWindow.style.visibility="hidden";            

          
            window.frames["IfDivMap"].checkTiles();              				
        }
        
        function menuLongOnclickShow()                      
        {
            var divRightDetial=document.getElementById("divRightDetial");
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";                
            
            var divRightBtnShow=document.getElementById("divRightBtnShow");
                divRightBtnShow.style.visibility="hidden";
                
            var outerDiv=window.frames["IfDivMap"].document.getElementById("outerDiv");
                outerDiv.style.width="100%";
            
            var divAllWindow=document.getElementById("divAllWindow");
                divAllWindow.style.visibility="visible";           
           				
        }
        
        function AllWindowShow()                              
        {        
            var divRightDetial=document.getElementById("divRightDetial");
                divRightDetial.style.visibility="hidden";
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width="100%";
                DivMap.style.top="0px";
                DivMap.style.height="100%";
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="hidden";                
            
            var divRightBtnShow=document.getElementById("divRightBtnShow");
                divRightBtnShow.style.visibility="hidden";
                
            var outerDiv=window.frames["IfDivMap"].document.getElementById("outerDiv");
                outerDiv.style.width="100%";
                outerDiv.style.height="100%";
            
            var divAllWindow=document.getElementById("divAllWindow");
                divAllWindow.style.visibility="hidden";
                
            var divSmallWindow=document.getElementById("divSmallWindow");
                divSmallWindow.style.visibility="visible";            

                
            var divtop=document.getElementById("divtop");
                divtop.style.visibility="hidden";
                
            var ShopType=document.getElementById("ShopType");
                ShopType.style.visibility="hidden";                

                
            window.frames["IfDivMap"].checkTiles();
        }
        
        function smallWindow()                                        
        {
            var divRightDetial=document.getElementById("divRightDetial");
                divRightDetial.style.visibility="visible";
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;
                DivMap.style.top="160px";
                DivMap.style.height=document.body.clientHeight-88;
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";                
            
            var divRightBtnShow=document.getElementById("divRightBtnShow");
                divRightBtnShow.style.visibility="hidden";
                
            var outerDiv=window.frames["IfDivMap"].document.getElementById("outerDiv");
                outerDiv.style.width=document.body.clientWidth-293;
                outerDiv.style.height=document.body.clientHeight-88;
            
            var divAllWindow=document.getElementById("divAllWindow");
                divAllWindow.style.visibility="visible";
                
            var divSmallWindow=document.getElementById("divSmallWindow");
                divSmallWindow.style.visibility="hidden";            

//                
            var divtop=document.getElementById("divtop");
                divtop.style.visibility="visible";
              

            
            var ShopType=document.getElementById("ShopType");
                ShopType.style.visibility="visible";
        }
        
        
        function ShowyingyanDiv()
        {
            var YingYan=document.getElementById("YingYan");                
                YingYan.style.visibility="visible";
                
            var NoDivYingYan=document.getElementById("NoDivYingYan");
                NoDivYingYan.style.visibility="visible";
                
             var IsDivYingYan=document.getElementById("IsDivYingYan");
                IsDivYingYan.style.visibility="hidden";   
              
        }
        
        function HiddenyingyanDiv()
        {
            var YingYan=document.getElementById("YingYan");                
                YingYan.style.visibility="hidden";
                
            var IsDivYingYan=document.getElementById("IsDivYingYan");
                IsDivYingYan.style.visibility="visible";
             
             var NoDivYingYan=document.getElementById("NoDivYingYan");
                NoDivYingYan.style.visibility="hidden";
        }        
        
 

            
            function getQueryString(key)           
            {
                var locString = location.search;
                var reg = new RegExp("(\\?|\\&)" + key + "=([^\\&]*)(\\&?)","i").exec(locString);
                return RegExp.$2;
            }
            
        
        
        
        
        
        
        
		
        function init(event)
        {
            
        
            document.oncontextmenu = function() { return false;}
//            GTwo=Map.GetTwo();
//            GThree=Map.GetThree(); 
            
            if(getQueryString("Id")==null||getQueryString("Id")==""||getQueryString("Id")=="null")
            {
                var getQueryStringValues=getQueryString(); 
                var ImageX=getQueryString("x");
                var ImageY=getQueryString("y");
                var level=getQueryString("Level");  
                
                var innerDiv=document.getElementById("innerDiv");
                innerDiv.style.left=ImageX;
                innerDiv.style.top=ImageY;
                zoom=level;                                  
                var divdownup=document.getElementById("divdownup");
                    divdownup.style.top="132px";
                    topdownup=132;                             
                                                               
                var YingYanImage=document.getElementById("YingYanImage");           

                    var YingYanImageLeft=parseFloat(ImageX)-205;
                    var YingYanImageTop=parseFloat(ImageY)-255;
                    
                    YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;   
                    YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
                    


                setInnerDivSize('2000px','1400px');
                setYingYanInnerDivSize('208px','146px');
                YingYanImageDivSize('2000px','1400px');
                
                checkTiles(); 
                
                 
                checkTilesYingYan();            

                   
                var outerDIV=document.getElementById("outerDiv");
                outerDiv.onmousedown=startMove;
                outerDiv.onmousemove=processMove;
                outerDiv.onmouseup=stopMove;           

                outerDiv.ondblclick=toggleZoomzbMaxDbclick;  
                
                var YingYan=document.getElementById("YingYan");
                YingYan.onmousedown=YingYanstartMove;
                YingYan.onmousemove=YingYanprocessMove;
                YingYan.onmouseup=YingYanstopMove;         
                
                
                var divdownup=document.getElementById("divdownup");         
                
               
                outerDiv.ondragstart=function()
                {
                    return false;
                }
                YingYan.ondragstart=function()
                {
                    return false;
                }
                LoadGuangGao();
            }
            else
            {   
                var GuideShow=window.parent.document.getElementById("GuideShow");   
                 GuideShow.style.visibility.visibility="hidden";
                 GuideShow.innerHTML="";
               
                
                
                if(getQueryString("T")=="H")
                {
                    var Response=Map.GetDetial(getQueryString("Id"));
                    zoom=2;                
                    HouseDetialHouseName=Response.value[11];
                    HouseDetialDataLeft=Response.value[6];
                    HouseDetialDataTop=Response.value[5];
                    
                    DivHouseDetialLayOnclick();
                    var CompanyName=document.getElementById("CompanyName");
                    CompanyName.innerHTML="&nbsp;<img src=image/book.gif width=16 height=12 />"+Response.value[11];
                    
                    var ResponseImage=Map.GetHouseImg(getQueryString("Id"));        
                    var DivCompanyImage=document.getElementById("DivCompanyImage");
		            if(ResponseImage.value[1]==""||ResponseImage.value[1]==null||ResponseImage.value[1]=="null")
		            {
			            DivCompanyImage.innerHTML="<img src=Image/no.gif width=105 height=80 border=0></img>";
		            }
		            else
		            {
			             DivCompanyImage.innerHTML="<a href=Upfile/HouseImage/"+ResponseImage.value[1]+" target=_blank><img src=Upfile/HouseImage/" +ResponseImage.value[1]+" width=105 height=80 border=0></img></a>";
		            }  
                        
                    var DivComPanDetialAddress=document.getElementById("DivComPanDetialAddress");
                        DivComPanDetialAddress.innerHTML="<strong>地址：</strong>"+Response.value[4];
                        
                    var DivComPanDetialPhone=document.getElementById("DivComPanDetialPhone");
                        DivComPanDetialPhone.innerHTML="<strong>电话：</strong>"+Response.value[1];
                        
                    var DivComPanDetialDe=document.getElementById("DivComPanDetialDe");
                        DivComPanDetialDe.innerHTML="<strong>简介：</strong>"+Response.value[3];
                        
                    var ComUrl=document.getElementById("ComUrl"); 
                        ComUrl.value="http://www.JinJe.com/default.aspx?Id="+getQueryString("Id")+"&T=H"; 
                        
                     
                    var AllCompanyList=document.getElementById("AllCompanyList");
                    AllCompanyList.innerHTML="<iframe id=IfHouComList scrolling=no width=100% frameborder=0 src=IfHoComL.aspx?houseid="+getQueryString("Id")+" onload=sizeChange()></iframe>";
              
                }
                if(getQueryString("T")=="C")
                {
                     var Response=Map.GetDetialCom(getQueryString("Id"));
                     zoom=2; 
                     HouseDetialHouseName=Response.value[11];
                    HouseDetialDataLeft=Response.value[5];
                    HouseDetialDataTop=Response.value[4];
                    
                    DivHouseDetialLayOnclick();
                    var CompanyName=document.getElementById("CompanyName");
                    CompanyName.innerHTML="&nbsp;<img src=image/book.gif width=16 height=12 />"+Response.value[11];
                    
                    var ResponseImage=Map.GetComImg(getQueryString("Id"));        
                    var DivCompanyImage=document.getElementById("DivCompanyImage");
		            if(ResponseImage.value[1]==""||ResponseImage.value[1]==null||ResponseImage.value[1]=="null")
		            {
			            DivCompanyImage.innerHTML="<img src=Image/no.gif width=105 height=80 border=0></img>";
		            }
		            else
		            {
			             DivCompanyImage.innerHTML="<a href=Upfile/CompanyImage/"+ResponseImage.value[1]+" target=_blank><img src=Upfile/CompanyImage/" +ResponseImage.value[1]+" width=105 height=80 border=0></img></a>";
		            }  
                        
                    var DivComPanDetialAddress=document.getElementById("DivComPanDetialAddress");
                        DivComPanDetialAddress.innerHTML="<strong>地址：</strong>"+Response.value[2];
                        
                    var DivComPanDetialPhone=document.getElementById("DivComPanDetialPhone");
                        DivComPanDetialPhone.innerHTML="<strong>电话：</strong>"+Response.value[0];
                        
                    var DivComPanDetialDe=document.getElementById("DivComPanDetialDe");
                        DivComPanDetialDe.innerHTML="<strong>简介：</strong>"+Response.value[3];
                        
                    var ComUrl=document.getElementById("ComUrl"); 
                        ComUrl.value="http://www.JinJe.com/default.aspx?Id="+getQueryString("Id")+"&T=C"; 
                        
                     
                    var AllCompanyList=document.getElementById("AllCompanyList");
                    AllCompanyList.innerHTML="";
                             
                }
                
                
                    
                var divdownup=document.getElementById("divdownup");
                    divdownup.style.top="132px";
                    topdownup=132;               
                
                
               var outerDIV=document.getElementById("outerDiv");
                outerDiv.onmousedown=startMove;
                outerDiv.onmousemove=processMove;
                outerDiv.onmouseup=stopMove;           

                outerDiv.ondblclick=toggleZoomzbMaxDbclick;  
                
                var YingYan=document.getElementById("YingYan");
                YingYan.onmousedown=YingYanstartMove;
                YingYan.onmousemove=YingYanprocessMove;
                YingYan.onmouseup=YingYanstopMove; 
               
            }
            
                              

           
            
        }
        
        
       
        function startMove(event)      //鼠标按下                               
        {
        
            if(!event) event=window.event; 
            
              
                                    
            dragStarLeft=event.clientX;
            dragStartTop=event.clientY;
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.cursor="move";
            innerDiv.setCapture(); 
            left=stripPx(innerDiv.style.left);
            top=stripPx(innerDiv.style.top);   
            
            
            if(BiaoZhuType==5) //5公交定位
            {
                var innerDiv=document.getElementById("innerDiv");
                
                var TextBox2=self.parent.frames["IdMoHoLi"].document.getElementById("TextBox2");
                TextBox2.value=(stripPx(innerDiv.style.left)-event.clientX)*Math.pow(2,zoom-1);
                var TextBox3=self.parent.frames["IdMoHoLi"].document.getElementById("TextBox3");
                TextBox3.value=(stripPx(innerDiv.style.top)-event.clientY)*Math.pow(2,zoom-1);
                //alert(BiaoZhuType)
                
                //strViewGongJiao="<div style=\"position:absolute;filter:alpha(opacity=100);left:"+dragStarLeft+"px;top:"+dragStartTop+"px\"><img src=Image/gongjiao.gif></div>";              
                //AddGongJiaoView();
                var GongJiao=document.getElementById("GongJiao");
                GongJiao.style.left=dragStarLeft+"px";
                GongJiao.style.top=dragStartTop+"px";
                
            }
            if(BiaoZhuType==6) //广告定位
            {
                //var innerDiv=window.frames["IfDivMapID"].document.getElementById("innerDiv");
                 //alert(BiaoZhuType);
                
                var txtAdverX=self.parent.frames["IdGuangGao"].document.getElementById("txtAdverX");
                txtAdverX.value=(stripPx(innerDiv.style.left)-event.clientX)*Math.pow(2,zoom-1);
                var txtAdverY=self.parent.frames["IdGuangGao"].document.getElementById("txtAdverY");
                txtAdverY.value=(stripPx(innerDiv.style.top)-event.clientY)*Math.pow(2,zoom-1);
                //alert(BiaoZhuType);
                
                //strViewGongJiao="<div style=\"position:absolute;filter:alpha(opacity=100);left:"+dragStarLeft+"px;top:"+dragStartTop+"px\"><img src=Image/gongjiao.gif></div>";              
                //AddGongJiaoView();
                var GuangGao=document.getElementById("GuangGao");  
                GuangGao.style.left=dragStarLeft+"px";
                GuangGao.style.top=dragStartTop+"px";
                
            }       
            

            dragging=true;
            return false;           
                           
        }        
      
    
        function processMove()                                  
        {
           
        
            if(!event) event=window.event;
             
             var innerDiv=document.getElementById("innerDiv");
             
             window.status="x="+(stripPx(innerDiv.style.left)-event.clientX)+" y="+(stripPx(innerDiv.style.top)-event.clientY);
             xPoint=stripPx(innerDiv.style.left)-event.clientX;
             yPoint=stripPx(innerDiv.style.top)-event.clientY;
             xWin=event.clientX;
             yWin=event.clientY;
         
             if(dragging)
             {  
                   if(BiaoZhuType==1)
                   {
                         var ComOut=document.getElementById("ComOut");
                         ComOut.style.zindex="0";
                         ComOut.style.visibility="hidden";
                         
                         HouseDetialHouseName="";
                        var DivCompanyName=document.getElementById("DivCompanyName");
                        DivCompanyName.style.visibility="hidden";
                        xPoint=0;
                        yPoint=0;                       
					

						                
                        innerDiv.style.left=parseFloat(left)+(event.clientX-dragStarLeft);
                        innerDiv.style.top=parseFloat(top)+(event.clientY-dragStartTop);
                        
                        
                        var YingYanImage=document.getElementById("YingYanImage");                
                        var YingYanImageLeft=parseFloat(left)+(event.clientX-dragStarLeft)-(outerDiv.offsetWidth/2);
                        var YingYanImageTop=parseFloat(top)+(event.clientY-dragStartTop)-(outerDiv.offsetHeight/2);
                        
                        YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;  
                        YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
                        //checkTilesYingYan();  
                        
                        if(window.parent.IsViewMove==true)
                        {
                           window.parent.AddHouse();                
                        }
                        
                        var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			            GuangGaoView.style.visibility="hidden"; 
                        
                   }
                   if(BiaoZhuType==2)
                   {
                         var innerDiv=document.getElementById("innerDiv");
                         innerDiv.style.cursor="";
                         strViewHouse="<div style=\"width:"+(Math.abs(event.clientX-dragStarLeft))+"px;height:"+(Math.abs(event.clientY-dragStartTop))+"px;position:absolute;background:blue;filter:alpha(opacity=40);left:"+dragStarLeft+"px;top:"+dragStartTop+"px\"></div>";              
                         AddHouseView();                         
                    }
                    if(BiaoZhuType==5)//图移动时公交移动
                    {
                         
                    }
             }  
                             
             //checkTiles();
        }
        
        function stopMove()                                  
        {
            if(!event) event=window.event;
            BiaoZhuType==1;//从公交返回 
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.cursor="";
			innerDiv.releaseCapture();
			checkTilesYingYan(); 
			checkTiles();		
			
			
			var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			GuangGaoView.innerHTML="";
			LoadGuangGao();
			
			
            dragging=false;
            if(BiaoZhuType==2)          
            {
                var TextBox2=window.parent.document.getElementById("TextBox2");
                    TextBox2.value=-((dragStarLeft+(Math.abs(event.clientX-dragStarLeft))/2)+(-left))*Math.pow(2,zoom-1);
                var TextBox3=window.parent.document.getElementById("TextBox3");
                    TextBox3.value=-((dragStartTop+(Math.abs(event.clientY-dragStartTop))/2)+(-top))*Math.pow(2,zoom-1);
                var TextBox4=window.parent.document.getElementById("TextBox4");
                    TextBox4.value=(Math.abs(event.clientX-dragStarLeft))*Math.pow(2,zoom-1);
                var TextBox5=window.parent.document.getElementById("TextBox5");
                    TextBox5.value=(Math.abs(event.clientY-dragStartTop))*Math.pow(2,zoom-1);
            }
                                         
        }
        
        function StopprocessMove()
        {
            alert("no");
        }
        
        
        
        function stripPx(value)                               
        {
            if(value=="") return 0;
            return parseFloat(value.substring(0,value.length-2));
        }
        
        function setInnerDivSize(width,height)
        {
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.width=width;
            innerDiv.style.height=height;
        }
        function setYingYanInnerDivSize(width,height)
        {
            var YingYanDivIn=document.getElementById("YingYanDivIn");
            YingYanDivIn.style.width=width;
            YingYanDivIn.style.height=height;
        }
        function YingYanImageDivSize(width,height)
        {
            var YingYanDivIn=document.getElementById("YingYanDivIn");
            YingYanDivIn.style.width=width;
            YingYanDivIn.style.height=height;
        }
        
        function checkTiles()                              
        {      
            
            var visibleTiles=getVisibleTiles();            
            var DivDataType=document.getElementById("DivDataType");              
            var innerDiv=document.getElementById("innerDiv");
            var visibleTilesMap={};            
            //var Response=Map.GetCheckTitle(); img
            //var ResponseGetId=Map.GetId();   id
            //var ResponseGetLink=Map.GetLink();  ,  
            //var ResponseGetBig=Map.GetBig();  jpg                     
            for(i=0;i<visibleTiles.length;i++)
            {                 
                var tileArray=visibleTiles[i];                
                var tileName=tileArray[0]+","+tileArray[1];               
                visibleTilesMap[tileName]=true;
                var img=document.getElementById(tileName);
                if(!img)
                {
                    img=document.createElement("img");  
                    img.src="PhotoLevel/"+DataType+"/BigLevel"+zoom+"/"+tileName+".jpg";
                    // img.src="G:/Show/ShowGuangZhou/PhotoLevel/"+DataType+GTwo.value+zoom+GThree.value+tileName+ResponseGetBig.value;
                    img.style.width="256px";
                    img.style.width="256px";
                    img.style.position="absolute";
                    img.style.left=(tileArray[0]*tileSize)+"px";
                    img.style.top=(tileArray[1]*tileSize)+"px";
                    img.setAttribute("id",tileName);             
                     innerDiv.appendChild(img);                   
                }

            }
                       
           var imgs=innerDiv.getElementsByTagName("img");
           for(i=0;i<imgs.length;i++)
           {
               var id=imgs[i].getAttribute("Id");
               if(!visibleTilesMap[id])
               {
                   if(id!="pushPin")
                   {
                       innerDiv.removeChild(imgs[i]);
                      i--; 
                   }                   
               }
           }
        }
      
//        function checkTiles()                              
//        {
//            
//            var visibleTiles=getVisibleTiles();
//            
//            var DivDataType=document.getElementById("DivDataType");            
//          
//            var innerDiv=document.getElementById("innerDiv");
//            var visibleTilesMap={};
//            var Response=Map.GetCheckTitle();
//            var ResponseGetId=Map.GetId(); 
//            var ResponseGetLink=Map.GetLink();    
//            var ResponseGetBig=Map.GetBig();                       
//            for(i=0;i<visibleTiles.length;i++)
//            {
//                
//                var tileArray=visibleTiles[i];                
//                var tileName=tileArray[0]+ResponseGetLink.value+tileArray[1];               
//                visibleTilesMap[tileName]=true;
//                var img=document.getElementById(tileName);
//                if(!img)
//                {
//                    img=document.createElement(Response.value);  
//                    img.src="G:/Show/ShowGuangZhou/PhotoLevel/"+DataType+GTwo.value+zoom+GThree.value+tileName+ResponseGetBig.value;
//                    img.style.width="256px";
//                    img.style.width="256px";
//                    img.style.position="absolute";
//                    img.style.left=(tileArray[0]*tileSize)+"px";
//                    img.style.top=(tileArray[1]*tileSize)+"px";
//                    img.setAttribute(ResponseGetId.value,tileName);             
//                    
//                    innerDiv.appendChild(img);
//                }            

//            }
//                       
//           var imgs=innerDiv.getElementsByTagName(Response.value);
//           for(i=0;i<imgs.length;i++)
//           {
//               var id=imgs[i].getAttribute(ResponseGetId.value);
//               if(!visibleTilesMap[id])
//               {
//                   if(id!="pushPin")
//                   {
//                       innerDiv.removeChild(imgs[i]);
//                      i--; 
//                   }                   
//               }
//           }
//        }
		
        function getVisibleTiles()                           
        {
            
            var innerDiv=document.getElementById("innerDiv");
            var outerDIV=document.getElementById("outerDiv");

            var mapX=stripPx(innerDiv.style.left);
            var mapY=stripPx(innerDiv.style.top);
           
            var startX=Math.abs(Math.floor(mapX/tileSize))-1;
            var startY=Math.abs(Math.floor(mapY/tileSize))-1;
            
            var tilesX=Math.ceil(outerDiv.offsetWidth/tileSize)+1;
            var tilesY=Math.ceil(outerDiv.offsetHeight/tileSize)+1;
            
            var visibleTileArray=[];
            var counter=0;
            for(x=startX;x<(tilesX+startX);x++)
            {
                for(y=startY;y<(tilesY+startY);y++)
                {
                    visibleTileArray[counter++]=[x,y];
                }
            }
            return visibleTileArray;
        }
        

     
        function toggleZoomzbMax()                                 
        {        
             var downup=document.getElementById("divdownup");
             var outerDIV=document.getElementById("outerDiv");
             if(topdownup==102)
             {}
             else
             {
                 downup.style.top=topdownup-30+"px"; 
                 topdownup=stripPx(downup.style.top);            
                 if(topdownup<102)
                 {
                    downup.style.top="102px";
                 }              
                zoom--;
                if(zoom<1)
                {
                    zoom=1;
                }            
                var innerDiv=document.getElementById("innerDiv");
                var imgs=innerDiv.getElementsByTagName("img"); 
                while(imgs.length>0) innerDiv.removeChild(imgs[0]);
                
                var divtop=document.getElementById("divtop");
                var innerDivLeft=stripPx(innerDiv.style.left);            
                var innerDivTop=stripPx(innerDiv.style.top); 

                  innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)*2+outerDiv.offsetWidth/2;
                  innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)*2+outerDiv.offsetHeight/2;                  
                
                
                var YingYanImage=document.getElementById("YingYanImage");
                var imgs=YingYanImage.getElementsByTagName("img");                 
                while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
                var YingYanImageLeft=((innerDivLeft-outerDiv.offsetWidth/2)*2+outerDiv.offsetWidth/2)-(outerDiv.offsetWidth/2);
                var YingYanImageTop=((innerDivLeft-outerDiv.offsetWidth/2)*2+outerDiv.offsetWidth/2)-(outerDiv.offsetHeight/2);
                
                
                YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
                YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
                checkTilesYingYan();               
                
                
                checkTiles();
                
                    
             }
        }
        
        function toggleZoomzbMin()                                    
        {
             var downup=document.getElementById("divdownup"); 
             var outerDIV=document.getElementById("outerDiv");
             if(topdownup==192)
             {}
             else
             {
                 downup.style.top=topdownup+30+"px"; 
                 topdownup=stripPx(downup.style.top);
                 if(topdownup>192)
                 {
                    downup.style.top="192px";
                 }
                 zoom++;
                if(zoom>=5)
                {
                    zoom=4;
                }            
                var innerDiv=document.getElementById("innerDiv");
                var imgs=innerDiv.getElementsByTagName("img");                 
                while(imgs.length>0) innerDiv.removeChild(imgs[0]); 
                
                var divtop=document.getElementById("divtop");
                var innerDivLeft=stripPx(innerDiv.style.left);           
                var innerDivTop=stripPx(innerDiv.style.top); 
                
                innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)/2+outerDiv.offsetWidth/2;
                innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)/2+outerDiv.offsetHeight/2; 
                
                
                var YingYanImage=document.getElementById("YingYanImage");
                var imgs=YingYanImage.getElementsByTagName("img");                 
                while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
                var YingYanImageLeft=((innerDivLeft-outerDiv.offsetWidth/2)/2+outerDiv.offsetWidth/2)-(outerDiv.offsetWidth/2);
                var YingYanImageTop=((innerDivTop-outerDiv.offsetHeight/2)/2+outerDiv.offsetHeight/2)-(outerDiv.offsetHeight/2);
                
                YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;
                YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
                checkTilesYingYan(); 

                checkTiles();
                
                
              }
           }
     
        function toggleZoomzbMaxDbclick()                          
        {   
                
             var downup=document.getElementById("divdownup"); 
             var outerDIV=document.getElementById("outerDiv");
                if(topdownup==102)
                 {}
                 else
                 {
                     downup.style.top="102px";
                     topdownup=102;            
                            
                     var innerDiv=document.getElementById("innerDiv");
                     var imgs=innerDiv.getElementsByTagName("img"); 
                     while(imgs.length>0) innerDiv.removeChild(imgs[0]) 
                   
                     var innerDivLeft=stripPx(innerDiv.style.left);           
                     var innerDivTop=stripPx(innerDiv.style.top); 
                     var outerDivLeft=event.clientX;
                     var outerDivTop=event.clientY;

                     var DbclickX=innerDivLeft-outerDivLeft;
                     var DbclickY=innerDivTop-outerDivTop;

                    innerDiv.style.left=DbclickX*Math.pow(2,zoom-1)+outerDiv.offsetWidth/2;  
                    innerDiv.style.top=DbclickY*Math.pow(2,zoom-1)+outerDiv.offsetHeight/2;
                    
                    
                    var YingYanImage=document.getElementById("YingYanImage"); 
                    var imgs=YingYanImage.getElementsByTagName("img");                 
                    while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
                    var YingYanImageLeft=parseFloat(DbclickX*Math.pow(2,zoom-1)+outerDiv.offsetWidth/2)-(outerDiv.offsetWidth/2);
                    var YingYanImageTop=parseFloat(DbclickY*Math.pow(2,zoom-1)+outerDiv.offsetHeight/2)-(outerDiv.offsetHeight/2);

                    
                    YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;
                    YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
                    
                    zoom=1;
                    checkTilesYingYan(); 
                    checkTiles();                  
                

                 }        
             
        }
       
        function moveRight(event)              
        {
        
            var ComOut=document.getElementById("ComOut");
             ComOut.style.visibility="hidden";
             ComOut.style.zindex="1";
        
        
            IsMoveRight=1;
            
            if(!event) event=window.event;      
            
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.left=parseFloat(left)+(event.clientX-MoveRightLeft-dragStarLeft);
            innerDiv.style.top=parseFloat(top)+(event.clientY-dragStartTop);
            
            
            var YingYanImage=document.getElementById("YingYanImage");
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
            var YingYanImageLeft=parseFloat(parseFloat(left)+(event.clientX-MoveRightLeft-dragStarLeft))-(outerDiv.offsetWidth/2);
            var YingYanImageTop=parseFloat(parseFloat(left)+(event.clientX-MoveRightLeft-dragStarLeft))-(outerDiv.offsetHeight/2);
            
            YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;
            YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
            checkTilesYingYan();
            checkTiles();            
        } 
        
        function moveLeft(event)                 
        {
        
            var ComOut=document.getElementById("ComOut");
             ComOut.style.visibility="hidden";
             ComOut.style.zindex="1";
        
            IsMoveLeft=1;
            
            if(!event) event=window.event;   
            
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.left=parseFloat(left)+(event.clientX+MoveRightLeft-dragStarLeft);
            innerDiv.style.top=parseFloat(top)+(event.clientY-dragStartTop);
            
            
            var YingYanImage=document.getElementById("YingYanImage"); 
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
            var YingYanImageLeft=parseFloat(parseFloat(left)+(event.clientX+MoveRightLeft-dragStarLeft))-(outerDiv.offsetWidth/2);
            var YingYanImageTop=parseFloat(parseFloat(top)+(event.clientY-dragStartTop))-(outerDiv.offsetHeight/2);
            
            YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;
            YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
            checkTilesYingYan();            
            
            checkTiles();            
        } 
        
        function moveUp(event)                     
        {
             var ComOut=document.getElementById("ComOut");
             ComOut.style.visibility="hidden";
             ComOut.style.zindex="1";
            
            
            IsMoveUp=1;
            
            if(!event) event=window.event;           
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.left=parseFloat(left)+(event.clientX-dragStarLeft);
            innerDiv.style.top=parseFloat(top)+(event.clientY+MoveUp-dragStartTop);
            
            var YingYanImage=document.getElementById("YingYanImage"); 
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
            var YingYanImageLeft=parseFloat(parseFloat(left)+(event.clientX-dragStarLeft))-(outerDiv.offsetWidth/2);
            var YingYanImageTop=parseFloat(parseFloat(top)+(event.clientY+MoveUp-dragStartTop))-(outerDiv.offsetHeight/2);
            
            YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;
            YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
            checkTilesYingYan(); 
            
            checkTiles();            
        }
        
        function moveDown(event)                    
        {
        
             var ComOut=document.getElementById("ComOut");
             ComOut.style.visibility="hidden";
             ComOut.style.zindex="1";
        
            IsMoveDown=1;
            
            if(!event) event=window.event;    
                        
            var innerDiv=document.getElementById("innerDiv");
            innerDiv.style.left=parseFloat(left)+(event.clientX-dragStarLeft);
            innerDiv.style.top=parseFloat(top)+(event.clientY-MoveUp-dragStartTop);
            
            
            var YingYanImage=document.getElementById("YingYanImage"); 
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]);              
            var YingYanImageLeft=parseFloat(parseFloat(left)+(event.clientX-dragStarLeft))-(outerDiv.offsetWidth/2);
            var YingYanImageTop=parseFloat(parseFloat(top)+(event.clientY-MoveUp-dragStartTop))-(outerDiv.offsetHeight/2);
            
            YingYanImage.style.left=Math.floor(YingYanImageLeft/YingMinLevel)+100;
            YingYanImage.style.top=Math.floor(YingYanImageTop/YingMinLevel)+69;
            checkTilesYingYan();
            
            
            checkTiles();  
            
                   
        }
     
      function youbiaolevel1Onclick()
      {
         var ComOut=document.getElementById("ComOut");
         ComOut.style.visibility="hidden";
         ComOut.style.zindex="1";
         
         
         if(zoom==1)
         {
         
         }
         else
         {
             var innerDiv=document.getElementById("innerDiv");
             var outerDiv=document.getElementById("outerDiv");
             var imgs=innerDiv.getElementsByTagName("img"); 
             while(imgs.length>0) innerDiv.removeChild(imgs[0]); 
             var innerDivLeft=stripPx(innerDiv.style.left);             
             var innerDivTop=stripPx(innerDiv.style.top); 
             innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)*Math.pow(2,zoom-1)+outerDiv.offsetWidth/2;
             innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)*Math.pow(2,zoom-1)+outerDiv.offsetHeight/2;

             zoom=1;
             checkTiles();
             var downup=document.getElementById("divdownup");
             topdownup=downup.style.top=102;
             
             
            var YingYanImage=document.getElementById("YingYanImage"); 
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]); 
            var NowInnerLeft=stripPx(innerDiv.style.left);
            var NowInnerTop=stripPx(innerDiv.style.top);
                      
            var YingYanImageLeft=NowInnerLeft-(outerDiv.offsetWidth/2);
            var YingYanImageTop=NowInnerTop-(outerDiv.offsetHeight/2);
            
            
            YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
            YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
            checkTilesYingYan();
            
            var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			LoadGuangGao();
            
         }       
         
         
      }
	  
      function youbiaolevel2Onclick()
      {
         var ComOut=document.getElementById("ComOut");
         ComOut.style.visibility="hidden";
         ComOut.style.zindex="1";
      
         if(zoom>2)
         {
             var innerDiv=document.getElementById("innerDiv");
             var outerDiv=document.getElementById("outerDiv");
             var imgs=innerDiv.getElementsByTagName("img"); 
             while(imgs.length>0) innerDiv.removeChild(imgs[0]); 
             var innerDivLeft=stripPx(innerDiv.style.left);         
             var innerDivTop=stripPx(innerDiv.style.top);
             innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)*Math.pow(2,zoom-2)+outerDiv.offsetWidth/2;
             innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)*Math.pow(2,zoom-2)+outerDiv.offsetHeight/2;
             zoom=2;
             checkTiles();
             var downup=document.getElementById("divdownup");
             topdownup=downup.style.top=132;
             
             
            var YingYanImage=document.getElementById("YingYanImage");
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]); 
            var NowInnerLeft=stripPx(innerDiv.style.left);
            var NowInnerTop=stripPx(innerDiv.style.top);
                      
            var YingYanImageLeft=NowInnerLeft-(outerDiv.offsetWidth/2);
            var YingYanImageTop=NowInnerTop-(outerDiv.offsetHeight/2);
            
            
            YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
            YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
            checkTilesYingYan();
            
            var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			LoadGuangGao();
            
            
         }
         else(zoom<2)
         {
             var innerDiv=document.getElementById("innerDiv");
             var outerDiv=document.getElementById("outerDiv");
             var imgs=innerDiv.getElementsByTagName("img"); 
             while(imgs.length>0) innerDiv.removeChild(imgs[0]);
             var innerDivLeft=stripPx(innerDiv.style.left);         
             var innerDivTop=stripPx(innerDiv.style.top);         
             innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)/Math.pow(2,2-zoom)+outerDiv.offsetWidth/2;
             innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)/Math.pow(2,2-zoom)+outerDiv.offsetHeight/2;             
             zoom=2;
             checkTiles();
             var downup=document.getElementById("divdownup");
             topdownup=downup.style.top=132;
             
             
            var YingYanImage=document.getElementById("YingYanImage");
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]); 
            var NowInnerLeft=stripPx(innerDiv.style.left);
            var NowInnerTop=stripPx(innerDiv.style.top);
                      
            var YingYanImageLeft=NowInnerLeft-(outerDiv.offsetWidth/2);
            var YingYanImageTop=NowInnerTop-(outerDiv.offsetHeight/2);
            
            
            YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
            YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
            checkTilesYingYan();
            
            var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			LoadGuangGao();            
            
         }
      }
	  
      function youbiaolevel3Onclick()
      {
          var ComOut=document.getElementById("ComOut");
         ComOut.style.visibility="hidden";
         ComOut.style.zindex="1";
            
         if(zoom>3)
         {
             var innerDiv=document.getElementById("innerDiv");
             var outerDiv=document.getElementById("outerDiv");
             var imgs=innerDiv.getElementsByTagName("img"); 
             while(imgs.length>0) innerDiv.removeChild(imgs[0]);
             var innerDivLeft=stripPx(innerDiv.style.left);         
             var innerDivTop=stripPx(innerDiv.style.top);
             innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)*Math.pow(2,zoom-3)+outerDiv.offsetWidth/2;
             innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)*Math.pow(2,zoom-3)+outerDiv.offsetHeight/2;
             zoom=3;
             checkTiles();
             var downup=document.getElementById("divdownup");
             topdownup=downup.style.top=162;
             
             
            var YingYanImage=document.getElementById("YingYanImage"); 
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]); 
            var NowInnerLeft=stripPx(innerDiv.style.left);
            var NowInnerTop=stripPx(innerDiv.style.top);
                      
            var YingYanImageLeft=NowInnerLeft-(outerDiv.offsetWidth/2);
            var YingYanImageTop=NowInnerTop-(outerDiv.offsetHeight/2);
            
            
            YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
            YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
            checkTilesYingYan();   
            
            var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			LoadGuangGao();         
            
         }
         else(zoom<3)
         {
             var innerDiv=document.getElementById("innerDiv");
             var outerDiv=document.getElementById("outerDiv");
             var imgs=innerDiv.getElementsByTagName("img"); 
             while(imgs.length>0) innerDiv.removeChild(imgs[0]);
             var innerDivLeft=stripPx(innerDiv.style.left);         
             var innerDivTop=stripPx(innerDiv.style.top);      
             innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)/Math.pow(2,3-zoom)+outerDiv.offsetWidth/2;
             innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)/Math.pow(2,3-zoom)+outerDiv.offsetHeight/2;             
             zoom=3;
             checkTiles();
             var downup=document.getElementById("divdownup");
             topdownup=downup.style.top=162;
             
             
            var YingYanImage=document.getElementById("YingYanImage"); 
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]); 
            var NowInnerLeft=stripPx(innerDiv.style.left);
            var NowInnerTop=stripPx(innerDiv.style.top);
                      
            var YingYanImageLeft=NowInnerLeft-(outerDiv.offsetWidth/2);
            var YingYanImageTop=NowInnerTop-(outerDiv.offsetHeight/2);
            
            
            YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
            YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
            checkTilesYingYan(); 
            
            var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			LoadGuangGao();
            

         }
      }
	  
      function youbiaolevel4Onclick()
      {
         var ComOut=document.getElementById("ComOut");
         ComOut.style.visibility="hidden";
         ComOut.style.zindex="1";
      
         if(zoom==4)
         {
         }
         else
         {
             var innerDiv=document.getElementById("innerDiv");
             var outerDiv=document.getElementById("outerDiv");
             var imgs=innerDiv.getElementsByTagName("img"); 
                 while(imgs.length>0) innerDiv.removeChild(imgs[0]);
             var innerDivLeft=stripPx(innerDiv.style.left);            
             var innerDivTop=stripPx(innerDiv.style.top);        
             innerDiv.style.left=(innerDivLeft-outerDiv.offsetWidth/2)/Math.pow(2,4-zoom)+outerDiv.offsetWidth/2;
             innerDiv.style.top=(innerDivTop-outerDiv.offsetHeight/2)/Math.pow(2,4-zoom)+outerDiv.offsetHeight/2;
             
             zoom=4;
             checkTiles();
             var downup=document.getElementById("divdownup");
             topdownup=downup.style.top=192;
             
             
            var YingYanImage=document.getElementById("YingYanImage");
            var imgs=YingYanImage.getElementsByTagName("img");                 
            while(imgs.length>0) YingYanImage.removeChild(imgs[0]); 
            var NowInnerLeft=stripPx(innerDiv.style.left);
            var NowInnerTop=stripPx(innerDiv.style.top);
                      
            var YingYanImageLeft=NowInnerLeft-(outerDiv.offsetWidth/2);
            var YingYanImageTop=NowInnerTop-(outerDiv.offsetHeight/2);
            
            
            YingYanImage.style.left=YingYanImageLeft/YingMinLevel+100;
            YingYanImage.style.top=YingYanImageTop/YingMinLevel+69;
            checkTilesYingYan(); 
            
            var GuangGaoView=document.getElementById("GuangGaoView");  //广告
			GuangGaoView.style.visibility="visible";
			strViewGuangGao="";
			LoadGuangGao();
            

         } 
      }



function YingYanstartMove()
{
    if(!event) event=window.event; 
                                         
    YingYandragStarLeft=event.clientX;
    YingYandragStartTop=event.clientY;
    var YingYanDivIn=document.getElementById("YingYanDivIn");
    YingYanDivIn.style.cursor="hand";
    
    YingYanleft=stripPx(YingYanDivIn.style.left);
    YingYantop=stripPx(YingYanDivIn.style.top);  
    
    YingYandragging=true;
    return false;
}
function YingYanprocessMove()
{
     if(!event) event=window.event;   
             
     var YingYanDivIn=document.getElementById("YingYanDivIn");
     if(YingYandragging)
     {
        YingYanDivIn.style.left=parseFloat(YingYanleft)+(event.clientX-YingYandragStarLeft);
        YingYanDivIn.style.top=parseFloat(YingYanleft)+(event.clientY-YingYandragStartTop);
        
        var ComOut=document.getElementById("ComOut");
             ComOut.style.visibility="hidden";
             ComOut.style.zindex="1";
        
     } 
                        

}

function YingYanstopMove()
{
    if(!event) event=window.event;
    
    var YingYanDivIn=document.getElementById("YingYanDivIn");
    YingYanDivIn.style.cursor="";
    
    var YingYanImage=document.getElementById("YingYanImage");
    YingYanImage.style.left=stripPx(YingYanImage.style.left)-stripPx(YingYanDivIn.style.left);
    YingYanImage.style.top=stripPx(YingYanImage.style.top)-stripPx(YingYanDivIn.style.top);
    checkTilesYingYan(); 
    
    

    var outerDIV=document.getElementById("outerDiv");
    var innerDiv=document.getElementById("innerDiv");
    innerDiv.style.left=(stripPx(YingYanImage.style.left)-100)*YingMinLevel+outerDiv.offsetWidth/2;
    innerDiv.style.top=(stripPx(YingYanImage.style.top)-69)*YingMinLevel+outerDiv.offsetHeight/2;
    checkTiles();

   
    
    
    
    YingYanDivIn.style.left="0px";
    YingYanDivIn.style.top="0px";
    
    YingYandragging=false;
    
    
    var GuangGaoView=document.getElementById("GuangGaoView");
    GuangGaoView.style.visibility="visible";
    strViewGuangGao="";
    LoadGuangGao(); 
}



        function checkTilesYingYan()                               
        {
           
            var visibleTiles=getVisibleTilesYingYan();
            
            
            var YingYanImage=document.getElementById("YingYanImage");
            var visibleTilesMap={};
			
//            var Response=Map.GetCheckTitle();
//            var ResponseGetId=Map.GetId();
//			var ResponseGetLink=Map.GetLink();
//			var ResponseGetSmall=Map.GetSmall();			
            for(i=0;i<visibleTiles.length;i++)
            {
              
               var tileArray=visibleTiles[i];               
			   var tileName=tileArray[0]+","+tileArray[1];  

                visibleTilesMap[tileName]=true;
                var img=document.getElementById(tileName);
                if(!img)
                {
                    img=document.createElement("img");                    
					img.src="PhotoLevel/SmallYingYan/SmallLevel"+zoom+"/"+tileName+".jpg";
                    img.style.position="absolute";
                    img.style.left=(tileArray[0]*tileSize)+"px";
                    img.style.top=(tileArray[1]*tileSize)+"px";
                    img.setAttribute("id",tileName);
                    YingYanImage.appendChild(img);
                }
            } 
                       
           var imgs=YingYanImage.getElementsByTagName("img");
           for(i=0;i<imgs.length;i++)
           {
               var id=imgs[i].getAttribute("id");
               if(!visibleTilesMap[id])
               {
                   if(id!="pushPin")
                   {
                       YingYanImage.removeChild(imgs[i]);
                      i--;
                   }                   
               }
           }
        }
		
        function getVisibleTilesYingYan()                           
        {            
            var YingYanImage=document.getElementById("YingYanImage");
            var YingYan=document.getElementById("YingYan");

            var mapX=stripPx(YingYanImage.style.left);
            var mapY=stripPx(YingYanImage.style.top);
           
            var startX=Math.abs(Math.floor(mapX/tileSize))-1;
            var startY=Math.abs(Math.floor(mapY/tileSize))-1;

            var tilesX=Math.ceil(YingYan.offsetWidth/tileSize)+1;
            var tilesY=Math.ceil(YingYan.offsetWidth/tileSize)+1;
            
            var visibleTileArray=[];
            var counter=0;
            for(x=startX;x<(tilesX+startX);x++)
            {
                for(y=startY;y<(tilesY+startY);y++)
                {
                    visibleTileArray[counter++]=[x,y];
                }
            }
            return visibleTileArray;
        }

 function DivMapWeiXingOnclick()
 {
    var DivMapWeiXing=document.getElementById("DivMapWeiXing");
        DivMapWeiXing.style.backgroundColor="2CA506";
        DivMapWeiXing.style.color="#ffffff";
    var DivMap3D=document.getElementById("DivMap3D");
        DivMap3D.style.backgroundColor="#D7D7D7";
        DivMap3D.style.color="#000000";
    var DivMapPingMian=document.getElementById("DivMapPingMian");
        DivMap3D.style.backgroundColor="#D7D7D7";
        DivMap3D.style.color="#000000";
           
    window.frames["IfDivMap"].DataType=3;

   var innerDiv=window.frames["IfDivMap"].document.getElementById("innerDiv");
   var imgs=window.frames["IfDivMap"].innerDiv.getElementsByTagName("img"); 
   while(imgs.length>0) innerDiv.removeChild(imgs[0])                  
   window.frames["IfDivMap"].checkTiles();
 }
 function DivDivMap3DOnclick()
 {
    var DivMap3D=document.getElementById("DivMap3D");
        DivMap3D.style.backgroundColor="#2CA506";
        DivMap3D.style.color="#ffffff";    
    var DivMapWeiXing=document.getElementById("DivMapWeiXing");
        DivMapWeiXing.style.backgroundColor="#D7D7D7";
        DivMapWeiXing.style.color="#000000";
    var DivMapPingMian=document.getElementById("DivMapPingMian");
        DivMapPingMian.style.backgroundColor="#D7D7D7";
        DivMapPingMian.style.color="#000000";
    
    window.frames["IfDivMap"].DataType=2;

   var innerDiv=window.frames["IfDivMap"].document.getElementById("innerDiv");
   var imgs=window.frames["IfDivMap"].innerDiv.getElementsByTagName("img"); 
   while(imgs.length>0) innerDiv.removeChild(imgs[0])                  
   window.frames["IfDivMap"].checkTiles();
 }
 
 function DivMapPingMianOnclick()
 {
    var DivMapPingMian=document.getElementById("DivMapPingMian");
        DivMapPingMian.style.backgroundColor="#2CA506";
        DivMapPingMian.style.color="#ffffff";
    var DivMap3D=document.getElementById("DivMap3D");
        DivMap3D.style.backgroundColor="#D7D7D7";
        DivMap3D.style.color="#000000";    
    var DivMapWeiXing=document.getElementById("DivMapWeiXing");
        DivMapWeiXing.style.backgroundColor="#D7D7D7";
        DivMapWeiXing.style.color="#000000"; 
        
    window.frames["IfDivMap"].DataType=1;

   var innerDiv=window.frames["IfDivMap"].document.getElementById("innerDiv");
   var imgs=window.frames["IfDivMap"].innerDiv.getElementsByTagName("img"); 
   while(imgs.length>0) innerDiv.removeChild(imgs[0])                  
   window.frames["IfDivMap"].checkTiles();
 }
 
 function DivcloseOnclick()
 {
    var ComOut=document.getElementById("ComOut");
    ComOut.style.zindex="0";
    ComOut.style.visibility="hidden";
    
 }
 
 function DivHouseDetialLayOnclick()
 {
    if(HouseDetialHouseName!="")
    {  
        var DivCompanyName=document.getElementById("DivCompanyName");
                DivCompanyName.style.visibility="hidden"; 
        
        var outerDiv=document.getElementById("outerDiv");                  
        innerDiv.style.left=(HouseDetialDataLeft)/Math.pow(2,zoom-1)+205;
        innerDiv.style.top=(HouseDetialDataTop)/Math.pow(2,zoom-1)+255;          
        
        
        var YingYanImage=document.getElementById("YingYanImage");            
                      
        YingYanImage.style.top=Math.floor(HouseDetialDataTop/Math.pow(2,zoom-1)/YingMinLevel)+69;                
        YingYanImage.style.left=Math.floor(HouseDetialDataLeft/Math.pow(2,zoom-1)/YingMinLevel)+100; 
        
        checkTiles(); 
        checkTilesYingYan();      
        
        
        var ComOut=document.getElementById("ComOut");
            ComOut.style.visibility="visible";
            ComOut.style.zindex="35";
     
        var CompanyName=document.getElementById("CompanyName");
            CompanyName.innerHTML="&nbsp;<img src=image/book.gif width=16 height=12 />"+HouseDetialHouseName;
            
        var ResponseImage=Map.GetHouseImg(HouseDetialId);        
        var DivCompanyImage=document.getElementById("DivCompanyImage");
		if(ResponseImage.value[1]==""||ResponseImage.value[1]==null||ResponseImage.value[1]=="null")
		{
			DivCompanyImage.innerHTML="<img src=Image/no.gif width=105 height=80 border=0></img>";
		}
		else
		{
			 DivCompanyImage.innerHTML="<a href=Upfile/HouseImage/"+ResponseImage.value[1]+" target=_blank><img src=Upfile/HouseImage/" +ResponseImage.value[1]+" width=105 height=80 border=0></img></a>";
		}  
            
        var DivComPanDetialAddress=document.getElementById("DivComPanDetialAddress");
            DivComPanDetialAddress.innerHTML="<strong>地址：</strong>"+HouseDetialAddress;
            
        var DivComPanDetialPhone=document.getElementById("DivComPanDetialPhone");
            DivComPanDetialPhone.innerHTML="<strong>电话：</strong>"+HouseDetialTelPhone;
            
        var DivComPanDetialDe=document.getElementById("DivComPanDetialDe");
            DivComPanDetialDe.innerHTML="<strong>简介：</strong>"+HouseDetialDetial; 
            
        var ComUrl=document.getElementById("ComUrl"); 
            ComUrl.value="http://www.JinJe.com/default.aspx?Id="+HouseDetialId+"&T=H";  
            
        var AllCompanyList=document.getElementById("AllCompanyList");
            AllCompanyList.innerHTML="<iframe id=IfHouComList scrolling=no width=100% frameborder=0 src=IfHoComL.aspx?houseid="+HouseDetialId+" onload=sizeChange()></iframe>";
    }  
    
 }
 

 function BigTypeCanYinOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=1";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeYuLeOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=2";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeZhuShuOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=3";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeGouWuOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=4";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeFangChanOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=5";
        
       var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeQiCheOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=6";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypePiaoWuOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=7";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeJiaoYuOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=8";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeYiLiaoOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=9";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 function BigTypeBianMinOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=10";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
   function BigTypeZhengWuOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=18";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
  function BigTypeQiTaOnclick()
 {
    var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="RightWindowDetial.aspx?BigTypeId=19";
        
        var divRightDetial=document.getElementById("divRightDetial");    
                divRightDetial.style.visibility="visible";                
                
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;      
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }

 function AddHouseView()  //添加房子框GongJiao
 {
    var HouseView=document.getElementById("HouseView");
    HouseView.innerHTML=strViewHouse;
    strViewHouse=""; 
 }
 
 function AddGongJiaoView()  //添加公交GongJiao
 {
    var HouseView=document.getElementById("GongJiao");
    HouseView.innerHTML=strViewGongJiao;
    strViewGongJiao=""; 
 }
 

 function IndexSearch()
 {
    var txtSearchText=document.getElementById("txtSearchText");
    if(txtSearchText.value!="")
    {
        var RightWindowDetial=document.getElementById("RightWindowDetial");
        RightWindowDetial.src="SearchList.aspx?search="+escape(txtSearchText.value);       

    }
    else
    {
        alert("不能输入空值")
    } 
        
    var divRightDetial=document.getElementById("divRightDetial");  
                divRightDetial.style.visibility="visible";   
            
            var DivMap=document.getElementById("DivMap"); 
                DivMap.style.width=document.body.clientWidth-293;     
                
            var divRightBtnHidden=document.getElementById("divRightBtnHidden");                
                divRightBtnHidden.style.visibility="visible";
 }
 
 
 function DeXYpoint()        
 {
     if(!event) event=window.event; 
     var divguideground=window.frames["IfDivMap"].xPoint=event.clientX;
 }
 
 
 
 //---------------测距---------------------------
 
 

 
 
 function DivMapCejuOnclick()
{
    window.frames["IfDivMap"].BiaoZhuType=3;    //不要移动地图  
    
    
   if (document.getElementById("distance")==null)
   {
      var str = "<div id='distance' style='position:absolute;top:0px;left:0px;width:" + (screen.width - 20) + "px;height:" + (screen.height - 167) + "px;z-index:199;background:url(trans.gif);'>"
      var div = document.createElement(str);
   
      document.body.insertAdjacentElement('beforeEnd',div);
      document.getElementById("distance").style.cursor = "hand";
      document.getElementById("distance").onclick = start;
      document.getElementById("distance").onmousemove = move;
   }
}


function start()  //start line   #ff9900提示文字颜色
{
   if(document.getElementById("lable")==null)
   {
    var str = "<div id='lable' style='filter: glow(color=#FF9900,strength=3); height:10px; color:white; padding:1px;position:absolute;top:"+event.y+"px;left:"+event.x+"px;'>"
    var oDiv = document.createElement(str);
    document.getElementById("distance").insertAdjacentElement('BeforeEnd',oDiv);
    document.getElementById("lable").insertAdjacentText('beforeEnd','  点击右键结束');
   }

   if(measure)
   {
      if(v!=null)
      {
         distance = Math.round(Math.sqrt(Math.pow((event.x - nextX),2) + Math.pow((event.y - nextY),2))) / scale * modulus;
         distance = Math.ceil(distance)  ; //修正
         distanceSum = distance + distanceSum
         nextX = event.x;
         nextY = event.y;
         
         var line = "<v:line from='"+nextX+","+nextY+"' to='"+(nextX)+","+(nextY)+"' id='"+nextX+"' style='position:absolute;left:0px;top:0px;' StrokeColor='blue' StrokeWeight='2pt' />";
         v = document.createElement(line); 
         
         var mark = document.createElement("div");
         mark.style.background = "#FEF9D3";
         mark.style.position = "absolute";
         mark.style.top = event.y;
         mark.style.left = event.x;
         mark.id = event.x + event.y;
        
         document.getElementById("distance").insertAdjacentElement('BeforeEnd',v);  
         
         document.getElementById("distance").insertAdjacentElement('BeforeEnd',mark);
  
         document.getElementById(mark.id).insertAdjacentText('BeforeEnd',distanceSum+"米"); 
      } 
   }
   else
   {
     measure = true;
     nextX = event.x;
     nextY = event.y;
     var line = "<v:line from='"+nextX+","+nextY+"' to='"+(nextX)+","+(nextY)+"' id='"+nextX+"' style='position:absolute;left:0px;top:0px;' StrokeColor='blue' StrokeWeight='2pt' />";
     v = document.createElement(line); 
        
     document.getElementById("distance").insertAdjacentElement('BeforeEnd',v); 
     
   }
}

function move()
{
   if(v!=null)
   {
      
      v.to = event.clientX+","+event.clientY;
      
      if(document.getElementById("lable")!=null)
      {
         document.getElementById("lable").style.top = event.y;
         document.getElementById("lable").style.left = event.x;
      }
   }
}

document.oncontextmenu = function() //点击右键
{
   if (document.getElementById("distance")!=null)//测距
   {
      document.getElementById("distance").removeNode(true);
      
      alert(distanceSum+"米");
      
      nextX = 0;
      nextY = 0;
      distance = 0;
      distanceSum = 0;
      measure = false;
      window.event.returnValue = false;//禁用右键
      window.frames["IfDivMap"].BiaoZhuType=1;  
      
    }      
    window.event.returnValue = false; //禁用右键 
}
 

        

        