function frame_auto(iframd){
  
  parent.document.all(iframd).height = document.body.scrollHeight;

}  

function reinitIframe(iframeid){
    
var iframe = document.getElementById(iframeid);

try{

var bHeight = iframe.contentWindow.document.body.scrollHeight;

var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;

//var height = Math.max(bHeight, dHeight);

var height = Math.min(bHeight, dHeight);

iframe.height =  height;

}catch (ex){}

}


/*自适应高度的代码开始*/

function frameauto(iframeids){
	
var iframehide="yes"

function dyniframesize()
{
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++)
{
if (document.getElementById)
{
 dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
if (dyniframe[i] && !window.opera)
{
 dyniframe[i].style.display="block"
if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight)
 dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight;
else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) 
 dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
}
}
if ((document.all || document.getElementById) && iframehide=="no")
{
var tempobj=document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

if(window.addEventListener){ window.addEventListener("load", dyniframesize, false); }
else if(window.attachEvent){ window.attachEvent("onload", dyniframesize); }
else{ window.onload = dyniframesize; }

delete iframeids;

}
/*自适应高度的代码结束*/ 


/* 说明：用 JavaScript 实现网页图片等比例缩放         */
/* <img src="2220.jpg" alt="自动缩放后的效果" onload="javascript:DrawImage(this,100,100);" />  */

function DrawImage(ImgD,FitWidth,FitHeight){     
    
    var image=new Image();     
    
    image.src=ImgD.src;     
    
    if(image.width>0 && image.height>0){         
     
      if(image.width/image.height>= FitWidth/FitHeight){             
     
       if(image.width>FitWidth){                 
      
         ImgD.width=FitWidth;                 
      
         ImgD.height=(image.height*FitWidth)/image.width;
      
       }else{                 
      
        ImgD.width=image.width;
     
        ImgD.height=image.height; 
     
     }         
       
     } else{             
        
     if(image.height>FitHeight){                 
     
        ImgD.height=FitHeight;                 
      
        ImgD.width=(image.width*FitHeight)/image.height;             
     
     }else{                 
     
        ImgD.width=image.width;                 
      
        ImgD.height=image.height;             
    
      }  
    } 
  }
} 