/*
 * setting DIV size in CSS does not correctly work in IE.
 * Therefore these scripts are required to set the DIV sizes in DHTML.
 */

// This allows firefox to shrink the iframe
var FIREFOX_SHRINKING_IFRAME = 50;
var IE_OFFSET = 16;
var FIREFOX_OFFSET = 16;


/*
 * This function resizes the central IFRAME (if exists), lengthening to its content height.
 * By doing this, we get only one vertical scroll for the whole page.
 */

function adjustFrame(doc, iframeName)
{
    var myIframe = doc.getElementById(iframeName);
    if (myIframe) 
    {
        if (myIframe.contentDocument) // Firefox
        {
            myIframe.height = FIREFOX_SHRINKING_IFRAME;
                                
            myIframe.height = myIframe.contentDocument.documentElement.scrollHeight + FIREFOX_OFFSET; 
        }
        else
        {
				    if (myIframe.Document && myIframe.Document.body && myIframe.Document.body.scrollHeight)  // IE
            {
                if (myIframe.height != myIframe.Document.body.scrollHeight)
                    myIframe.height = myIframe.Document.body.scrollHeight + IE_OFFSET;
            }
        }             
    }   
    // Scroll up to the top of the page
    // window.scrollTo(0,0);
}

function adjust()
{
		if ( document.getElementById("contentFrame") )
    	adjustFrame(document, "contentFrame");    
    if ( document.getElementById("contentFrameLesson") )
    	adjustFrame(document, "contentFrameLesson");
}

