window.onResize = calcDivHeight();
var CurrentWindowHeight = 0;

function calcDivHeight()
{

	var windowHeight = 0;
	var divHeight = 0;
	var sepBarHeight = 0;
	var frameHeight = 0;
	
	if (CurrentWindowHeight == document.documentElement.clientHeight && CurrentWindowHeight !=0) return;

	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;
	}
	
    CurrentWindowHeight = document.documentElement.clientHeight;	

	for (i = 0; i < arguments.length; i += 2)
	{
		if (arguments[i] == 0)
		{
			divHeight = (windowHeight - 162);
			frameHeight = (windowHeight - 162);
		}
		else if (arguments[i] == 1)
		{
			divHeight = (windowHeight - 162);
			frameHeight = (windowHeight - 192);
		}
		else if (arguments[i] == 2)
		{
			divHeight = (windowHeight - 162);
			frameHeight = (windowHeight - 222);
		}
		
		if (divHeight < 1) divHeight = 1;
		if (frameHeight < 1) frameHeight = 1;		
		
		divHeight = divHeight + "px";
		frameHeight = frameHeight + "px";		
		
		document.getElementById(arguments[i + 1] + "Div").style.height = divHeight
		document.getElementById(arguments[i + 1] + "Frame").style.height = frameHeight		
	}
}