// JavaScript Document
//  adjust window length
self.onload = adjustFrameHeight;
self.onresize = adjustFrameHeight;

	//alert (window.frameElement.id ); // this returns the name of the iframe we're in.
	//alert (window.name); // this returns the name of the iframe we're in. more straightforward!
	//alert( window.parent.name);
function adjustFrameHeight()
{   
return;
		var frameWidth = self.document.documentElement.clientWidth; // + 'px';
		var docHeight = 1000; 

		self.resizeTo(frameWidth, docHeight);
		self.height = docHeight;
}


function OLDadjustFrameHeight()
{   
	try
	{
		// this works. it is the height of the display window (not the document)
		//	var frameHeight = self.document.documentElement.clientHeight;
		var frameWidth = self.document.documentElement.clientWidth; // + 'px';
		var frameWidthPX = frameWidth + 'px';
	}
	catch (exception1)
	{
		alert("Houston, we have a problem. adjustFrameHeight() --> var frameWidth");
	}
	try
	{
		var docHeight = self.document.documentElement.scrollHeight; 
		var docHeightPX = docHeight + 'px';
		var h = (self.document.getElementById("myHeight"));
		divHeight = h.innerHTML;     // height hard-coded!!! shocking!!
		if (docHeight != divHeight) // temp fix to browser compatibility problem with scrollHeight
			{
				docHeight = divHeight;
			}
	}
	catch (exception2)
	{
		alert("Houston, we have a problem. adjustFrameHeight() --> var docHeight");
	}

		//alert ("Height = "+docHeight); // this is also working
	try
	{
		alert("frameWidth: "+frameWidth+"; docHeight: "+docHeight);
		self.resizeTo(frameWidth, docHeight);
		self.height = docHeight;
	}
	catch (exception3)
	{
		alert("Houston, we have a problem. adjustFrameHeight() --> self.resizeTo");
	}


}

//----------------------------------------
//-------------------------------------------------
//-----------------------------------------
/*
<iframe id='myFrame' frameborder=0 scrolling=no width=100%  src="..."
    onload='adjustMyFrameSize();'> 
</iframe> 

Then you need to place such script BEFORE IFrame element: 

 Collapse
*/
 <!--script type="text/javascript"-->
    
    function getElement(aID)
    {

        return (document.getElementById) ?
            document.getElementById(aID) : document.all[aID];

    }

    function getIFrameDocument(aID)
	{ 
        var rv = null; 
        var frame=getElement(aID);
        // if contentDocument exists, W3C compliant (e.g. Mozilla) 
        if (frame.contentDocument)
            rv = frame.contentDocument;
        else // bad IE  ;)
            rv = document.frames[aID].document;
        return rv;
    }

    function NEWERadjustFrameHeight()
    {

if (self.innerWidth)
{
	frameWidth = self.innerWidth;
	frameHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth)
{
	frameWidth = document.documentElement.clientWidth;
	frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
	frameWidth = document.body.clientWidth;
	frameHeight = document.body.clientHeight;
}

alert("Width: "+frameWidth+ ", Height: "+frameHeight);
    
	if (document.body)
	{
	frameWidth = document.documentElement.clientWidth;
	frameHeight = document.documentElement.clientHeight;
	}
	alert("Width: "+frameWidth+ ", Height: "+frameHeight);
	}
	
	
<!-- /script --> 


