﻿
        
    //打开全屏
    function OpenFullScreen(){
        TopPanel.style.display = "none";  
        showRightPanel.style.display = "none";
        RightPanel.style.display = "none";   
        BottomPanel.style.display = "none";  
        ExitFullScreen.style.display = "block"; 
        
        //setTimeout("setMapFull()",200);
    }
    //设置地图全屏显示.
    function setMapFull(){
        var documentHeight = document.documentElement.clientHeight;
        var documentWidth = document.documentElement.clientWidth; 
        //MapPanel.style.width = documentWidth;
        //MapPanel.style.height = documentHeight;    
    }
    
    //关闭全屏
    function CloseFullScreen(){
        TopPanel.style.display = "block";  
        BottomPanel.style.display = "block"; 
        
        ExitFullScreen.style.display = "none";
        
        showRightPanel.style.display = "none";
        RightPanel.style.display = "block";   
        
        MapPanel.style.height = "100%";
        MapPanel.style.width = "100%";
        
        //setTimeout("doResize()",300);
    }
    
    //页面调整大小.
    function onPageResize(){
        
        var heights = document.body.clientHeight;
        if(document.body.clientHeight>94){
            heights = document.body.clientHeight - 94;
        }
        MapPanel.style.height  = heights;
        showRightPanel.style.height  = heights;
        RightPanel.style.height = heights;
    }
    
           
    //开启右框
    function OpenPanel(){           
        RightPanel.style.display="block"; 
        showRightPanel.style.display = "none";       
        document.getElementById("Shower").style.display = "none";
        
        MapPanel.style.height = "100%";
        MapPanel.style.width = "100%";
//        var MapPanelWidth = MapPanel.style.width.replace("px","");
//        var RightPanelWidth = showRightPanel.style.width.replace("px","");
//        MapPanel.style.width = MapPanelWidth - 280;
//        alert(RightPanelWidth);
//        MapPanel.style.width = MapPanelWidth - RightPanelWidth;
//        alert(MapPanel.style.width);
    }
    
    //测距
    function LocateDistance(){
        MapMethod.starSurvey();
    }
    
    var  resizeTimer = null;
    
    function doResize(){
       //top 71,bottom 23;  
       //bussearchFramer:height:543,width:295
       //RightPanel-rightFramer,showRightPanel,MapPanel:height:621,
       //RightPanel:width:285px
       
//       var DefaultBusSearchHeight = 543;
//       var DefaultBusSearchWidth = 295;
//       var DefaultRightHeight = 621;
//       var DefaultRightWidth = 285;
//       var DefaultTopHeight = 71;
//       var DefaultBottomHeight = 24;
        
       var DefaultBusSearchHeight = 543;
       var DefaultBusSearchWidth = 280;
       var DefaultRightHeight = 621;
       var DefaultRightWidth = 280;
       var DefaultTopHeight = 66;
       var DefaultBottomHeight = 24;
       
       var offsetTopBottom = DefaultTopHeight + DefaultBottomHeight;
       var offsetBusSearchHeight = DefaultRightHeight - DefaultBusSearchHeight;
       
       var documentHeight = document.documentElement.clientHeight;
       var documentWidth = document.documentElement.clientWidth; 
       
//       alert('网页可见区域宽： '+document.body.clientWidth+'\n'+
//'网页可见区域高：  '+document.body.clientHeight+'\n'+
//'网页可见区域宽：  '+document.body.offsetWidth +'(包括边线的宽)'+'\n'+
//'网页可见区域高： '+ document.body.offsetHeight+' (包括边线的高)'+'\n'+
//'网页正文全文宽：  '+document.body.scrollWidth+'\n'+
//'网页正文全文高： '+ document.body.scrollHeight+'\n'+
//'网页被卷去的高：  '+document.body.scrollTop+'\n'+
//'网页被卷去的左： '+ document.body.scrollLeft+'\n'+
//'网页正文部分上： '+ window.screenTop+'\n'+
//'网页正文部分左：  '+window.screenLeft+'\n'+
//'屏幕分辨率的高：  '+window.screen.height+'\n'+
//'屏幕分辨率的宽： '+ window.screen.width+'\n'+
//'屏幕可用工作区高度： '+ window.screen.availHeight+'\n'+
//'屏幕可用工作区宽度：  '+window.screen.availWidth
//)
       //alert("可用高度:" + window.screen.availHeight);

       
       resizeTimer=null;
       
       if(ExitFullScreen.style.display == "block"){//退出全屏按钮显示，说明是全屏状态，否则不是全屏状态,全屏状态地图高宽为窗口可见高宽..
            setMapFull();
       }else{
            if(documentHeight > offsetTopBottom){
                MapPanel.style.height = RightPanel.style.height = showRightPanel.style.height = documentHeight - offsetTopBottom + 61;
                rightFrmaer.document.getElementById("bussearchFramer").style.height = documentHeight - offsetTopBottom; - 61;
                rightFrmaer.EnterprisePanel.style.height = documentHeight - offsetTopBottom - 61;
            }
            if(documentWidth > DefaultRightWidth){
                if(RightPanel.style.display == "none"){
                    
                }else{                    
                    MapPanel.style.width = documentWidth - DefaultRightWidth;
                }
            }
       }
    }
    //隐藏选择图标菜单.
    function HideIconMenu(){
        IconSelectMenu.style.display = "none";
    }
    //显示选择图标菜单.
    function ShowIconMenu(){
        IconSelectMenu.style.display = "block";
    }
    //显示父节点.
    function ShowParent(obj){
        alert(obj.parent);
    }
    