<!--
 
/*
* Sets the CSS style of an HTML element with a given id
*/
function changeElementStyleById (id, newClassName) {
	var el = document.getElementById(id);
	if (el != null && el != 'undefined') {
		el.className=newClassName;
	}
}

function Popup(location, name)
{
	var width =  0, height = 0;
	if(location == "staffcontrol.php" || location == "staffcontrolsheet.php")
	{
		width = 1000;
		height = 700;	
	}
	else
	{
		width = 320;
		height = 280;			
	}
	if(location == "help/about.php")
	{
		width = 350;
		height = 300;	
	}
	LeftPosition = (screen.width) ? (screen.width - width)/2: 0;
	TopPosition = (screen.height) ? (screen.height - height)/2 : 0;
	
	var newwindow = window.open(location,name,"location=0,status=0,scrollbars=1,width="+width+",height="+height+"");
	newwindow.moveTo(LeftPosition,TopPosition);
}

function GetClientAreaWidth()
{
	return (window.innerWidth) ? window.innerWidth : ((document.body.clientWidth > document.body.offsetWidth) ? document.body.clientWidth : document.documentElement.clientWidth);
}

function GetClientAreaHeight()
{
	return (window.innerHeight) ? window.innerHeight : ((document.body.clientHeight > document.body.offsetHeight) ? document.body.clientHeight : document.documentElement.clientHeight);
}

function ShowLoadingMessage()
{	
	loadinger = document.getElementById('loader');
	faderer = document.getElementById('fader');
	headinger = document.getElementById('header');
	containinger = document.getElementById('container');
	
	iheader = document.getElementById('lheader');
	ifooter = document.getElementById('lfooter');
	
	if(!loadinger || !containinger)
		return false;
		
	var bodies = document.getElementsByTagName('body');
	bodies[0].style.overflow = 'hidden';
	
	loadinger.style.paddingLeft = 0 + 'px';
	loadinger.style.paddingTop = 0 + 'px';
	
	x = iheader.width;
	if(iheader.width == 0)
		x = 712;
	
	loadinger.style.paddingLeft = ((GetClientAreaWidth() / 2) - (x / 2)) + 'px';
	//loadinger.style.paddingRight = ((GetClientAreaWidth() / 2) - (parseInt(loadinger.style.paddingLeft))) + 'px';
	loadinger.style.paddingTop = ((GetClientAreaHeight() / 2) - ((iheader.height + ifooter.height) / 2)) + 'px';
	//loadinger.style.paddingBottom = ((GetClientAreaHeight() / 2) - (parseInt(loadinger.style.paddingTop))) + 'px';

	faderer.style.display = 'block';
	loadinger.style.display = 'block';
	
	if(headinger)
		headinger.style.display = 'none';
}

function HideLoadingMessage()
{
	loadinger = document.getElementById('loader');
	faderer = document.getElementById('fader');
	headinger = document.getElementById('header');
	containinger = document.getElementById('container');
	if(!loadinger || !containinger)
		return false;
		
	loadinger.style.display = 'none';
	faderer.style.display = 'none';
	headinger.style.display = 'block';
	
	var bodies = document.getElementsByTagName('body');
	bodies[0].style.overflow = 'auto';
}

function RenderFader()
{
	document.write('<div id="fader" style="position: absolute; z-index: 1; display: none;width:' + GetClientAreaWidth() + 'px; height: ' + GetClientAreaHeight() + 'px;"></div>');
}

//-->