	function getDocHeight(doc)
	{
	  var docHt = 0, sh, oh;
	  if (doc.height) docHt = doc.height;
	  else if (doc.body) {
	    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
	    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
	    if (sh && oh) docHt = Math.max(sh, oh);
	    //alert("INTERNET EXPLORER/OPERA\n\nSCROLL HEIGHT: "+sh+"\nOFFSET HEIGHT: "+oh);
	  }
	  
	  return docHt;
	}

	function setIframeHeight(iframeName)
	{
	  var iframeWin = parent.window.frames[iframeName];
	  var iframeEl = parent.document.getElementById? parent.document.getElementById(iframeName): parent.document.all? parent.document.all[iframeName]: null;

	  if ( iframeEl && iframeWin ) {
	    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous

	    var docHt = getDocHeight(iframeWin.document);

	    // need to add to height to be sure it will all show
	    if (docHt) iframeEl.style.height = (docHt + 20) + "px";
	  }
	  else if(iframeEl)
	  {
	  	var sh = iframeEl.contentDocument.height; // iframeEl.scrollHeight;
	  	var oh = iframeEl.contentDocument.height; // iframeEl.offsetHeight;

	  	//alert("MOZILLA\n\nSCROLL HEIGHT: "+sh+"\nOFFSET HEIGHT: "+oh);


	  	if (sh && oh) docHt = Math.max(sh, oh);

	  	if (docHt) iframeEl.style.height = (docHt + 20) + "px";
	  }
	}

	var document_size = "100";
	function setIframe()
	{
		// set document size
		document_size = getDocHeight(document);

		var index = 0;
		setIframeHeight('appFrame');
	}
