function autoResize(id) {
    var newheight;
    var newwidth;

    if(document.getElementById)
    {
      var theObj = document.getElementById(id);
      
      if (theObj.contentDocument) // firefox
      {
        newheight = theObj.contentDocument.documentElement.scrollHeight;
      }
      else
      {    
        newheight = theObj.contentWindow.document.body.scrollHeight;
        // newwidth = theObj.contentWindow.document .body.scrollWidth;
      }

      theObj.height = (newheight) + "px";
      // theObj.width = (newwidth) + "px";
    }
}

