
// set content height

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 setFooter() {

	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		
		
			//alert(windowHeight);
		
		
		if (windowHeight > 0) {
		
			var pageElement=document.getElementById('page');
			
								
			var contentElement=document.getElementById('conteneur_central');
			var contentHeight = contentElement.offsetHeight;
			var headerHeight = document.getElementById('header2').clientHeight;
			
			heightNotUsed=(windowHeight-headerHeight);

			//alert(windowHeight+">>>"+headerHeight);
			//contentElement.style.height=(heightNotUsed-5)+"px";	
			
			var leftShadow=document.getElementById('ombre_gauche');
			var rightShadow=document.getElementById('ombre_droite');
			
			
			
			var text_content=document.getElementById('corps_contenu_texte');
			//text_content.style.height=(heightNotUsed-60)+"px";	
			
			//alert(text_content.offsetHeight);
			
			
			if (text_content.offsetHeight < (heightNotUsed-60))
			{				
				contentElement.style.height = (heightNotUsed-5)+"px";
				text_content.style.height=(heightNotUsed-60)+"px";
				leftShadow.style.height = (heightNotUsed-5)+"px";
				rightShadow.style.height = (heightNotUsed-5)+"px";
				return;
			}
			else
			{				
				var newHeight = text_content.offsetHeight+70+"px";				
				contentElement.style.height = newHeight;
				leftShadow.style.height = newHeight;
				rightShadow.style.height = newHeight;	
			}			
			
		}					
		
	}
}

window.onload = function() {

	setFooter();
	
	//resizeInfoBar();
	
}


window.onresize = function() {
	
	setFooter();
	
}