/*
Author: Juan J. Mendez
Date: aug/21/2003

description:
the following scripts were written for the purpose of allowing the main layer in every page
to be located at the very center of the page... 
*/

function center(id) 
{   var hor_ctr, vrt_ctr, el = getElement(id);
	if (el && el.style) 
	{
		hor_ctr = getClientHorizCenter();
		vrt_ctr = getClientVertCenter();
		if (hor_ctr && vrt_ctr) 
		{
			el.style.left = hor_ctr - el.offsetWidth/2 + 'px';
			el.style.top = vrt_ctr - el.offsetHeight/2 + 'px';
		}
	}
}

function getElement(id) 
{
	return document.getElementById ? document.getElementById(id) :
	document.all ? document.all(id) : null;
}

function getClientHorizCenter() 
{
	return document.body && document.body.clientWidth ? document.body.clientWidth/2 :
	window.innerWidth ? innerWidth/2 : null;
}

function getClientVertCenter() 
{
	return document.body && document.body.clientHeight ? document.body.clientHeight/2 :
	window.innerHeight? innerHeight/2 : null;
}





