var ScreenWidth;
var ScreenHeight;

function findScreenResolution()
{
	var ns4, ie4, moz;
	// current screen définitions Width
	var TheWidth = new Array(9);
		TheWidth[0] = 800;
		TheWidth[1] = 1024;
		TheWidth[2] = 1152;
		TheWidth[3] = 1280;
		TheWidth[4] = 1360;
		TheWidth[5] = 1400;
		TheWidth[6] = 1600;
		TheWidth[7] = 1680;		// LCD 22'
		TheWidth[8] = 1920;		// LCD 24'
		TheWidth[9] = 2560;		// LCD 30'
	// current screen définitions Height
	var TheHeight = new Array(9);
		TheHeight[0] = 600;
		TheHeight[1] = 768;
		TheHeight[2] = 864;
		TheHeight[3] = 768;
		TheHeight[4] = 768;
		TheHeight[5] = 1050;
		TheHeight[6] = 1200;
		TheHeight[7] = 1050;	// LCD 22'
		TheHeight[8] = 1200;	// LCD 24'
		TheHeight[9] = 1600;	// LCD 30'
	// Found the browner type
   	ns4 = (document.layers) ? 1 : 0;
   	ie4 = (document.all) ? 1 : 0;
   	if (!ie4)      moz = (document.getElementById) ? 1 : 0;
   	else           moz = 0;

	//Found the real width displayed
   	ScreenWidth = 800  //default size 
   	if (ie4)   	ScreenWidth = (document.body.clientWidth-document.body.leftMargin)
   	if (moz)   	ScreenWidth = (window.innerWidth-document.body.offsetLeft)
   	if (ns4)	ScreenWidth = window.innerWidth

   	// Deduce the real height ( the height of the navigators toolbars are not deduced )
	var i=0;
	var found=0;
	while (i<10) {
     	if (ScreenWidth<=TheWidth[i])
		{ 
			found = i;
			break;
		}
		i=i+1;
	}
	ScreenHeight = TheHeight[found]
	//return ScreenWidth;
	return Array(ScreenWidth,ScreenHeight);
}

function findScreenResolutionResize()
{
/*
	if (navigator.appName=="Netscape"){
		var FirstDivId = document.body.firstChild.nextSibling;
	}else if(navigator.appName=="Microsoft Internet Explorer"){
		var FirstDivId = document.body.firstChild;
	}
*/	
	//var widthContains = FirstDivId.clientWidth;
	var calculWidth = Math.abs((findScreenResolution()[0] - 1280) / 2);
	window.scrollTo(calculWidth,0);

	//	alert(FirstDivId.id);
}      

if (window.addEventListener){
	window.addEventListener("load", findScreenResolutionResize, false);
}
if (window.attachEvent){
	window.attachEvent("onload", findScreenResolutionResize);
}

