/**
 * @author EticWeb
 */
var scnWid = 1024, scnHei = 768;
var winWContenu = 1024;
var winWResult = 829;
var heigthbandeau = 270;
var heigthfooter = 340;

var scnWid,scnHei;
function getScreenXY() {
	if (self.innerHeight) {
		// all except Explorer
		scnWid = self.innerWidth;
		scnHei = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		// Explorer 6 Strict Mode
		scnWid = document.documentElement.clientWidth;
		scnHei = document.documentElement.clientHeight;
	} else if (document.body) {
		 // other Explorers
		scnWid = document.body.clientWidth;
		scnHei = document.body.clientHeight;
	}
	//alert('body.clientHeight '+document.body.clientHeight+' body.clientWidth '+document.body.clientWidth+' scnHei '+scnHei+' scnWid '+scnWid);
}
/*
if( document.body && ( document.body.clientHeight || document.body.clientWidth ) ) {
    scnHei = document.body.clientHeight;
    scnWid = document.body.clientWidth;
}*/

var scrOfX = 0, scrOfY = 0;
function getScrollXY() {
	if( typeof( window.pageYOffset ) == 'number' ) {
	    alert('Netscape compliant');
	    scrOfY = window.pageYOffset;
	    scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.clientHeight || document.body.clientWidth ) ) {
	    alert('DOM compliant');
	    scrOfY = document.body.clientHeight;
	    scrOfX = document.body.clientWidth;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	    alert('IE6 standards compliant mode');
	    scrOfY = document.documentElement.scrollTop;
	    scrOfX = document.documentElement.scrollLeft;
	} else alert('???');
	//alert('Horizontal scrolling = ' + scrOfX + '\nVertical scrolling = ' + scrOfY );
}

function resizecolGaucheV0() {
	getScreenXY();
	winWResult = parseInt(getStyleById("result","width"));
	var pixcentrestant = scnWid-winWResult;
	//alert(scnWid+' - '+winWResult+' = '+pixcentrestant);
	pixcentrestant = Math.round(pixcentrestant/2);
	winWContenu = winWResult+pixcentrestant;
	//alert(pixcentrestant+' + '+winWResult+' = '+winWContenu);
	setStyleById("gauche","width",winWContenu+'px');
	setStyleById("result","marginLeft",pixcentrestant+'px');
	//getScrollXY();
	var x = findX(document.getElementById("designer"));
	if (x<document.body.clientHeight) {
		//alert('x = '+x+' body.clientHeight = '+document.body.clientHeight);
		setStyleById("contenu","height",document.body.clientHeight+'px');
		setStyleById("gauche","height",document.body.clientHeight+'px');
		setStyleById("result","height",document.body.clientHeight+'px');
		setStyleById("contentResult","height",document.body.clientHeight-heigthbandeau-heigthfooter+'px');
	}
}
function resizecolGauche() {
	getScreenXY();
	winWResult = parseInt(getStyleById("result","width"));
	var pixcentrestant = scnWid-winWResult;
	//alert(scnWid+' - '+winWResult+' = '+pixcentrestant);
	pixcentrestant = Math.round(pixcentrestant/2);
	winWContenu = winWResult+pixcentrestant;
	//alert(pixcentrestant+' + '+winWResult+' = '+winWContenu);
	setStyleById("gauche","width",winWContenu+'px');
	if (navigator.appName=='Microsoft Internet Explorer' && navigator.appVersion.indexOf('MSIE 6')!=-1 && navigator.appVersion.indexOf('MSIE 7')==-1) {
		/* HACK IE6 POUR CENTRAGE*/
		//alert('navigator.appName '+navigator.appName+' navigator.appVer '+navigator.appVer+' navigator.appVersion '+navigator.appVersion);
		setStyleById("gauche","marginLeft",-pixcentrestant+'px');
	}
	setStyleById("result","marginLeft",pixcentrestant+'px');
	//alert(' '+getStyleById("gauche","marginLeft"));
	//getScrollXY();
	/* ON FORCE LE HEIGHT */
	var x = findX(document.getElementById("designer"));
	if (x<document.body.clientHeight) {
		//alert('x = '+x+' body.clientHeight = '+document.body.clientHeight);
		setStyleById("contenu","height",document.body.clientHeight+'px');
		setStyleById("gauche","height",document.body.clientHeight+'px');
		setStyleById("result","height",document.body.clientHeight+'px');
		setStyleById("contentResult","height",document.body.clientHeight-heigthbandeau-heigthfooter+'px');
	}
}
function findX(obj) {
	var x = 0;
	while (obj.offsetParent) {
		x += obj.offsetTop
		obj = obj.offsetParent;
	}
	return x;
} 
