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 change_iframe(iframename, iheight) {
  var pTar = null;

  if (document.getElementById(iframename) != null){
    pTar = document.getElementById(iframename);
  }
  else{
    pTar = iframename;
  }
  if (pTar && !window.opera){
    
    if (pTar.contentDocument && pTar.contentDocument.body != null &&pTar.contentDocument.body.offsetHeight){
      //ns6 syntax
      var hei = pTar.contentDocument.body.offsetHeight+FFextraHeight;

      if(hei > iheight)
      {
        pTar.height = hei; 
      }
      else
      {
        pTar.height = iheight;
      }
    }
    else if (pTar.Document && pTar.Document.body != null && pTar.Document.body.scrollHeight){
      //ie5+ syntax
      var hei = pTar.Document.body.scrollHeight;

      if(hei > iheight)
      {
        pTar.height = pTar.Document.body.scrollHeight;
      }
      else
      {
        pTar.height = iheight;
      }
    }
  }
}

function frameLoad(iframename, iheight)
{
    var iframeObj = document.getElementById(iframename);
    
	var tmp = setInterval(function(){change_iframe(iframename, iheight)}, 10);
}
