/****************************************************
*													*
* Coding created by ninefortynine ltd 2005			*
*	admin@ninefortynine.com							*
*													*
****************************************************/

// ############################ 100% HEIGHT IN ALL BROWSERS #####################
// Returns the height in all browsers - or the minimum if its less
function getWindowHeight()
{
	minWindowHeight = 0;
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number')
		windowHeight = window.innerHeight;
	else
	{
		if (document.documentElement && document.documentElement.clientHeight)
			windowHeight = document.documentElement.clientHeight;
		else
		{
			if (document.body && document.body.clientHeight)
				windowHeight = document.body.clientHeight;
		}
	}
	if(windowHeight < minWindowHeight) windowHeight = minWindowHeight;
	return windowHeight;
}

//now we position the footer

function setMain()
{
	margin = 2;
	
	if (document.getElementById)
	{
		var windowHeight = getWindowHeight();
		if (windowHeight > 0)
		{
			var headerElement		= document.getElementById('header');
			var navbarElement		= document.getElementById('navbar');
			var iframeElement		= document.getElementById('iframe');
			var footerElement 		= document.getElementById('footer');
			
			var headerHeight  		= headerElement.offsetHeight;
			var navbarHeight  		= navbarElement.offsetHeight;
			var footerHeight		= footerElement.offsetHeight;
			
			iframeElement.style.height = (windowHeight-(headerHeight+navbarHeight+footerHeight))+'px';
			/*alert(columnHeight+' : '+sideBarHeight+' : '+textHeight+' : '+contentHeight+' : '+windowHeight+' : '+footerElement.style.bottom);*/
		}
	}
}


function openWindow(url,title)
{
	window.open(url,'_blank',"toolbar=no, location=yes, directories=no, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=800, height=600");
}

window.onload = function() { setMain(); }
window.onresize = function() { setMain(); }