/*  
/////CADMEN SYSTEM 共用JavaScript函式庫////////////////////////////////////
功能：共用內置框架高度自動調整 函式庫           
設計者：Ricky.Huang                
聯絡方式：xenogears123@gmail.com
授權：CADMEN 虎門科技
///////////////////////////////////////////////////////////////////////////
*/
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.body.offsetHeight){
      //ns6 syntax
      pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight + 50 ; 
    }
    else if (pTar.Document && pTar.Document.body.scrollHeight){
      //ie5+ syntax
      pTar.height = pTar.Document.body.scrollHeight+ 50 ;
    }
  }
  else
  {
	  //alert(pTar.contentDocument.body.offsetHeight);
      pTar.height = pTar.contentDocument.body.offsetHeight+ 50 ;
  }
 
}

