   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);
 		}
        return docHt;
    }

	function setIframeHeight(iframeName) {
  		var iframeWin = window.frames[iframeName];
  		var iframeEl = getIFrameObj(iframeName);
  		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 > 0 && docHt < 670) {
   		    	iframeEl.style.height = 700;
   		    } else if (docHt) {   		    
   		 	   iframeEl.style.height = docHt + 30;
   		    } else {
   		    	iframeEl.style.height = 623;
   		    }
  		} 
	}
	
	function getIFrameObj(iframeName) {		
       //detect browser settings for iframeName
       isNS4 = (document.layers) ? true : false;
       isIE4 = (document.all && !document.getElementById) ? true : false;
       isIE5 = (document.all && document.getElementById) ? true : false;
       isNS6 = (!document.all && document.getElementById) ? true : false;
     
       var objElement = null;
       //identify the element based on browser type
 		if (isNS4) {
   			objElement = document.layers[iframeName];
 		} else if (isIE4) {
   			objElement = document.all[iframeName];
 		} else if (isIE5 || isNS6) {
   			objElement = document.getElementById(iframeName);
 		}
 		
 		return objElement;
	}