﻿// JScript 文件
function layDefault(mainid, leftid , rightid)
{
    var mdiv = document.getElementById(mainid) ;
    var ldiv = document.getElementById(leftid) ;
    var rdiv = document.getElementById(rightid) ;
    var righttd = document.getElementById('righttd') ;
    var lefttd = document.getElementById('lefttd') ;
    var lefdiv = document.getElementById("webDirListDiv") ;
     if(ldiv == null || rdiv == null || mdiv == null)
           return ;   
     var w = document.documentElement.clientWidth ;
     var h = document.documentElement.clientHeight ;
     h = h - 70 ;
  //    ldiv.style.height  = String(h) + "px";   
    var maxh = rdiv.offsetHeight ;
//     if(maxh < h )
      maxh = h ;
//         if(maxh > 0 )
//         {
//            ldiv.style.height  = String(maxh) + "px";   
//         }
//         else  
//             ldiv.style.height  = String(h) + "px";          
     rdiv.style.height  = String(h) + "px";
     
     if(righttd != null)
       righttd.style.height = String(h -70) + "px"; 
       if(lefdiv!=null)
       {
            var width = String(parseInt(w * 0.18)) + "px" ;
            if(maxh > 0 )
               lefdiv.style.height  = String(maxh-70) + "px";   
            else
              
               lefdiv.style.height = String(h -70) + "px"; 
              
            
             lefdiv.style.width =width; 
       }
    if(lefttd != null)
      lefttd.style.height = String(h -70) + "px"; 
   
     
     var plogo =document.getElementById('pagelogo') ;
     if(plogo != null)
     {
        var top =  getTop(rdiv) ;
        var left = getLeft(rdiv) ;
        var index = rdiv.style.width.indexOf('px' , 0 ) ;
       
    
        moveObject('pagelogo' , document.documentElement.clientWidth - 90 , top ) ;
        
     }  
     var showdiv = document.getElementById("graphicDiv") ;
     if(showdiv!=null)
     {
        
        // showdiv.style.height = String(h ) + "px"; 
     } 
     
     var td = document.getElementById("righttd") ;
     if(td != null)
     {
         var mainviewdiv = document.getElementById("mainDivView") ;
         if(mainviewdiv!=null)
         {
            mainviewdiv.style.height = String(h - 90) + "px" ;
          
         }
     }
     
}
function layDivs(leftid , rightid)
{
       
        var ldiv = document.getElementById(leftid) ;//document.getElementById("googleMapPop") ;
         var rdiv = document.getElementById(rightid) ;
        if(ldiv == null || rdiv == null)
           return ;   
         var h = document.documentElement.clientHeight ;
         h = h - 70 ;  
        // alert(h) ;  
         ldiv.style.height  = String(h) + "px";          
         rdiv.style.height  = String(h) + "px";
         
         var plogo =document.getElementById('pagelogo') ;
         if(plogo != null)
         {
            var top =  getTop(rdiv) ;
            var left = getLeft(rdiv) ;
            var index = rdiv.style.width.indexOf('px' , 0 ) ;
           
        
          moveObject('pagelogo' , document.documentElement.clientWidth - 90 , top ) ;
            
         }  
        // rdiv.style.top = ldiv.style.top;
       
}
function layDivs2(leftid , rightid)
{
       
        var ldiv = document.getElementById(leftid) ;//document.getElementById("googleMapPop") ;
         var rdiv = document.getElementById(rightid) ;
        if(ldiv == null || rdiv == null)
           return ;   
         var h = document.documentElement.clientHeight ;
         h = h - 70 ;    
         ldiv.style.height  =  String(h) + "px";  
         ldiv.style.visibility= 'hidden' ;
         ldiv.style.width  =  "0px";    
           
         rdiv.style.height  = String(h) + "px";
         rdiv.style.width =  String(document.documentElement.clientWidth) + "px"; 
    
         moveObject(rightid , 0, 70) ;
       
         var plogo =document.getElementById('pagelogo') ;
         if(plogo != null)
         {
            var top =  getTop(rdiv) ;
            var left = getLeft(rdiv) ;
            var index = rdiv.style.width.indexOf('px' , 0 ) ;
            moveObject('pagelogo' , document.documentElement.clientWidth - 90 , top ) ;
         }  
        // rdiv.style.top = ldiv.style.top;
       
}

function getTop(e){
var offset=e.offsetTop;
if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
return offset;
}
//获取元素的横坐标
function getLeft(e){
var offset=e.offsetLeft;
if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
return offset;
} 
