// JavaScript Document

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
				
			}
		}
	}
	return windowHeight;
}

function setDiv() {
	if (document.getElementById) {
		var todo = 60;
		
		var windowHeight = getWindowHeight();
		
		var rightElement = document.getElementById('right');
		var rightHeight = rightElement.offsetHeight;
		
		var contenuElement = document.getElementById('page');
		var pageHeight = contenuElement.offsetHeight;
		
//		alert("Win "+windowHeight+" - page"+pageHeight+" - right"+rightHeight);
		
//		if(windowHeight < pageHeight+todo){
//			alert("toto1");
			document.getElementById('contenu').style.height = windowHeight-110+"px";
//		}else{
//			alert("toto2");
//			document.getElementById('contenu').style.height = windowHeight-100+"px";
//		}
	}
}


//ACTION
window.onload = function() {
	setDiv();
}
window.onresize = function() {
	setDiv();
}

