﻿//--------------------------------------------------------------------------------------
//Function used to Resize the body, to be mih height as Browsers full height.
function ResizeBody(OffsetValue, IEOffsetValue)
{
    var pageHeight;												//get current document height
    var windowheight = window.screen.height;					//get resolution height
    var innerHeight = document.documentElement.clientHeight;	//get browser's inner height
			
    if( window.innerHeight && window.scrollMaxY ) // Firefox 
    { pageHeight = window.innerHeight + window.scrollMaxY; }
    else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
    { pageHeight = document.body.scrollHeight; }
    else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
    { pageHeight = document.body.offsetHeight + document.body.offsetTop; }
			
    if(pageHeight < innerHeight)
    {
	    if(document.getElementById('InnerBody') != null)
	    {
		    if(document.all) //IE
		    {   document.getElementById('InnerBody').style.height = (innerHeight - IEOffsetValue) + "px"; } 
		    else  			//Firefox
		    {   document.getElementById('InnerBody').style.minHeight = (innerHeight - OffsetValue) + "px"; }
	    }
    }
    else
    {
	    if(document.getElementById('InnerBody') != null)
	    {
		    if(document.all) //IE
		    {   document.getElementById('InnerBody').style.height = (pageHeight - IEOffsetValue) + "px"; } 
		    else  			//Firefox
		    {   document.getElementById('InnerBody').style.minHeight = (pageHeight - OffsetValue) + "px"; }
	    }
    }
}