// JavaScript Document
function windowHeight()
{
	// Standard browsers (Mozilla, Safari, etc.)
	if (self.innerHeight)
		return self.innerHeight;
	// IE 6
	if (document.documentElement && document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
	// IE 5
	if (document.body)
		return document.body.clientHeight;
	// Just in case.
	return 0;
}

function handleResize()
{
	var height = windowHeight() - document.getElementById('header-panel').offsetHeight - 75;
	
	var divHeight = (height);

	//var mainObj = document.getElementById('main-body-cell');
	//if (mainObj != null && mainObj.style != null)
	//	mainObj.style.height = divHeight + 'px';
	
	if ((divHeight) > 0)
	{
		var mapObj = document.getElementById('map');
		if (mapObj != null && mapObj.style != null)
			mapObj.style.height = (divHeight) + 'px';
			
		//var navObj = document.getElementById('left-nav-panel')
		//if (navObj != null && navObj.style != null)
		//	navObj.style.height = (divHeight - 30) + 'px';
	}

	//alert('Height = ' + divHeight);
}

window.onresize = handleResize;
