function init()
{
	doResize();

	window.onresize = doResize;
}

function doResize()
{
	fixMainHeight();
//	fixMainMenu();
}

function fixMainMenu()
{
	if (!document.getElementById)
		return;

	var menu = document.getElementById('menu');
	var fx_menu = document.getElementById('FX1');

	var left = ((document.body.offsetWidth - 1005) / 2);

	// correct negative values
	if (left < 0)
		left = 0;

	// Add correction (10 px)
	left += 10;

	if (fx_menu.style.position == 'absolute')
		fx_menu.style.left = left+'px';
}

function fixMainHeight()
{
	if (!document.getElementById)
		return;
	
	var content = document.getElementById('content');
	var main = document.getElementById('main');
	var left = document.getElementById('left');
	var schools = document.getElementById('schools');
	var title = document.getElementById('title');

	if (!main || !left || !content || !schools || !title)
		return;
	
	var leftHeight = left.offsetHeight;
	var mainHeight = main.offsetHeight;

	if (mainHeight < leftHeight)
	{
		main.style.height = (leftHeight + 10) + 'px';

		content.style.height = (leftHeight - (schools.offsetHeight + 56)) + 'px';
	}
}

function doRedirect(url, newWindow)
{
	if (!url)
		return;

	if (newWindow)
		window.open(url);
	else
		document.location.href = url;
}

window.onload = init;
