function getWindowsDimensions( location )
{
	var dimensions = Array();

	if( typeof( window.innerWidth ) == 'number' )
	{
	//Non-IE
		myWidth = eval(location+'window.innerWidth');
		myHeight = eval(location+'window.innerHeight');
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
	//IE 6+ in 'standards compliant mode'
		myWidth = eval(location+'document.documentElement.clientWidth');
		myHeight = eval(location+'document.documentElement.clientHeight');
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
	//IE 4 compatible
		myWidth = eval(location+'document.body.clientWidth');
		myHeight = eval(location+'document.body.clientHeight');
	}
	
	dimensions[0] = myWidth;
	dimensions[1] = myHeight;

	return dimensions;
}

function align( object, horizontal, vertical)
{
	var window_dimensions = getWindowsDimensions('');
 
 	if ( horizontal == 'center' )
	{
		document.getElementById(object).style.left = Math.round(0.5*(window_dimensions[0]-parseInt(document.getElementById(object).style.width)))+'px';
	}
	else if ( parseInt(horizontal) > 0 )
	{
		document.getElementById(object).style.left = parseInt(horizontal)+'px';
	}

	if ( vertical == 'center' )
	{
		document.getElementById(object).style.top = Math.round(0.5*(window_dimensions[1]-parseInt(document.getElementById(object).style.height)))+'px';
	}
	else if ( parseInt(vertical) > 0 )
	{
		document.getElementById(object).style.top = parseInt(vertical)+'px';
	}	
}