//------------------------------
// calculate ScreenHeight
//------------------------------
function writeUserCookie(userHeight) {
	var today = new Date();
	var the_date = new Date("December 31, 2023");
	var the_cookie_date = the_date.toGMTString();
	var the_cookie = "users_resolution="+userHeight;
	var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	document.cookie = the_cookie;
}
function getWindowHeight()
{

	var headerHeight = 25;
	var row1Height = 120;
	var row2Height = 4;	
	var footerHeight = 25;
	var myMinHeight = 620;
	var unknownFiller = 30;
	var myHeight = 0;
	
	if( typeof( window.innerHeight ) == 'number' ) {
	
		//Non-IE
		myHeight = window.innerHeight;
		
	} else if( document.documentElement && document.documentElement.clientHeight ) {
	
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	
	} else if( document.body && document.body.clientHeight ) {
	
		//IE 4 compatible
		myHeight = document.body.clientHeight;
		
	}

	var availableHeight = myHeight - (headerHeight + row1Height + row2Height + footerHeight + unknownFiller);
	if(availableHeight < myMinHeight) availableHeight = myMinHeight;

	return availableHeight;

}
