var screenWidth = 0, screenHeight = 0;
window.onload = LoadPage;
window.onresize = SetupFooter;

function LoadPage() {
	SetupFooter();
}


function SetupFooter()
{
	GetSizeOfBrowser();
	var contentHeight = document.getElementById('content').offsetHeight ;
	var footerDiv = document.getElementById('footer');
	
	if( contentHeight != null)
	{
		var newHeight = 0;
		
		if( screenHeight-250>=contentHeight)
			newHeight = screenHeight-96;
		else
			newHeight = contentHeight+150;
			
		//alert(newHeight);
		footerDiv.style.top = newHeight+"px";
		footerDiv.style.display = "inline";
	}
}

function GetSizeOfBrowser() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    screenWidth = window.innerWidth;
    screenHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    screenWidth = document.documentElement.clientWidth;
    screenHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    screenWidth = document.body.clientWidth;
    screenHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}
