//auto    zhongjian height;
function SetCwinHeight(){
var mright=document.getElementById("mright"); //iframe id
if (document.getElementById){
   if (mright && !window.opera){
    if (mright.contentDocument && mright.contentDocument.body.offsetHeight){
     mright.height = mright.contentDocument.body.offsetHeight;
    }else if(mright.Document && mright.Document.body.scrollHeight){
     mright.height = mright.Document.body.scrollHeight;
    }

   }
}

//left content height
var mleft=document.getElementById("mleft"); //iframe id
if (document.getElementById){
   if (mleft && !window.opera){
    if (mleft.contentDocument && mleft.contentDocument.body.offsetHeight){
     mleft.height = mleft.contentDocument.body.offsetHeight;
    }else if(mleft.Document && mleft.Document.body.scrollHeight){
     mleft.height = mleft.Document.body.scrollHeight;
    }
   }
}

mleft.height = mright.height;

}

//chang right page
 
   function   changeRight(right_Url){
      document.getElementById("mright").src=right_Url;
  //    SetCwinHeight();
      dyniframesize("mright");
   } 
   
   //change left content
   function   changeLeft(left_Url){
      document.getElementById("mleft").src=left_Url;
      //SetCwinHeight();
   dyniframesize("mleft");
   } 
   
   
  //read cookies
     function readCookies(name) { 
           var cookieValue = ""; 
           var search = name + "="; 
           if(document.cookie.length > 0) { 
             offset = document.cookie.indexOf(search); 
             if (offset != -1) { 
                 offset += search.length; 
                 end = document.cookie.indexOf(";", offset); 
                if (end == -1) end = document.cookie.length; 
                    cookieValue = unescape(document.cookie.substring(offset, end)) 
                         } 
                 } 
              return cookieValue; 
       } 
        
 
    //write to cookie;
      function writeCookie(name, value, hours) { 
      var expire = ""; 
     if(hours != null)  { 
             expire = new Date((new Date()).getTime() + hours * 3600000); 
             expire = "; expires=" + expire.toGMTString(); 
                                           } 
             document.cookie = name + "=" + escape(value) + expire; 
             } 
    
     // del cookie    
      function delCookie(name)
{ 
    var exp = new Date(); 
    exp.setTime(exp.getTime() - 1); 
    var cval=readCookies(name); 
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString(); 
}
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]      
//extra height in px to add to iframe in FireFox 1.0+ browsers      
var FFextraHeight=getFFVersion>=0.1? 16 : 0       
function dyniframesize(iframename) {   
  
  var pTar = null;      
 if (document.getElementById){        
  pTar = document.getElementById(iframename);      
 }else{      
  eval('pTar = ' + iframename + ';');      
 }      
  if (pTar && !window.opera){      
    //begin resizing iframe        
    pTar.style.display="block"     
   if (pTar.contentDocument && pTar.contentDocument.documentElement.scrollHeight){      
    
         pTar.height =0;   
        pTar.height=pTar.contentDocument.documentElement.scrollHeight;       
        

   }else if (pTar.Document && pTar.Document.body.scrollHeight){      
     //ie5+ syntax      
      pTar.height = pTar.Document.body.scrollHeight;      
         
       
   }      
  }        
}    
 function SettopHeight(){
var top=document.getElementById("top"); //iframe id
if (document.getElementById){
   if (top && !window.opera){
    if (top.contentDocument && top.contentDocument.body.offsetHeight){
     top.height = top.contentDocument.body.offsetHeight;
    }else if(top.Document && top.Document.body.scrollHeight){
     top.height = top.Document.body.scrollHeight;
    }
   }
}alert("SettopHeight()");
}

function SetcenHeight(){
var cen=document.getElementById("cen"); //iframe id
if (document.getElementById){
   if (cen && !window.opera){
    if (cen.contentDocument && cen.contentDocument.body.offsetHeight){
     cen.height = cen.contentDocument.body.offsetHeight;
    }else if(cen.Document && cen.Document.body.scrollHeight){
     cen.height = cen.Document.body.scrollHeight;
    }
   }
}alert("SetcenHeight()");
}
function SetfooHeight(){
var foo=document.getElementById("foo"); //iframe id
if (document.getElementById){
   if (foo && !window.opera){
    if (foo.contentDocument && foo.contentDocument.body.offsetHeight){
     foo.height = foo.contentDocument.body.offsetHeight;
    }else if(foo.Document && foo.Document.body.scrollHeight){
     foo.height = foo.Document.body.scrollHeight;
    }
   }
} alert("SetfooHeight()");
}
function   changeTop(right_Url){
      document.getElementById("top").src=right_Url;
  //    SetCwinHeight();
      dyniframesize("top");
   } 
  
function   changeCen(right_Url){
      document.getElementById("cen").src=right_Url;
  //    SetCwinHeight();
      dyniframesize("cen");
   } 
function   changeFoo(right_Url){
      document.getElementById("foo").src=right_Url;
  //    SetCwinHeight();
      dyniframesize("foo");
   } 
 function   changeThree(top_url,cen_url,foo_url){
      document.getElementById("top").src=top_url;

document.getElementById("cen").src=cen_url;

document.getElementById("foo").src=foo_url;

  //    SetCwinHeight();
 dyniframesize("top");
 dyniframesize("cen");
      dyniframesize("foo");
   } 