// JavaScript Document
function getFrameHeight (frame)
{
   var doc = frame.document;
   //var doc_height = doc.height ? doc.height : 0; // Safari uses document.height
   var doc_height = doc.getElementById('mainFrame').offsetHeight;
   return doc_height;
   //alert(doc_height);
   var hajt = 0;
   if (doc.documentElement && doc.documentElement.scrollHeight) /* Strict mode */
   	{	
		hajt = Math.max(Math.max (doc.documentElement.scrollHeight, doc_height),545);
     	//alert(hajt);
	 return hajt;
	}
   else /* quirks mode */
   {	
   		hajt = Math.max(Math.max (doc.body.scrollHeight, doc_height),545);
     	//alert(hajt);
	 return hajt;
			
   }
} 

function iframeAutoResize(id)
{
	try{
	  var iframeWin = window.frames[id];
	  var iframeEl = window.document.getElementById? window.document.getElementById(id): document.all? document.all[id]: 					      //alert ("iframeWin=" + iframeWin);
      //alert ("iframeEl=" + iframeEl);
null;
	  if ( iframeEl && iframeWin )
	  {
		var docHt = getFrameHeight(iframeWin);
		//alert ("1: iframeEl=" + iframeEl.style.height);
		//docHt+=20;
		if (docHt != iframeEl.style.height) iframeEl.style.height = docHt + 'px';
	  }
	  else
	  { // FireFox
		var docHt = window.document.getElementById(id).contentDocument.height;
		window.document.getElementById(id).style.height = docHt + 'px';
	  }
  }
  catch(err){
    window.status= err.message;
  }
}

