// Bibliothèque de scripts - 

//****************************************************************
// Détection de la hauteur et de la largeur de la fenêtre
//****************************************************************

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 getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}

//****************************************************************
// Gestion de la hauteur du bloc de contenu
//****************************************************************

function setHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();

			var wrapperElement = document.getElementById('wrapper');
			var headerElement = document.getElementById('header');
			var mainElement = document.getElementById('main');
			var containerElement = document.getElementById('container');

			wrapperElement.style.height = (windowHeight - 60) + 'px';
			headerElement.style.height = (windowHeight - 60) + 'px';
			mainElement.style.height = (windowHeight - 60) + 'px';
			containerElement.style.height = (windowHeight - 110) + 'px';
	}
}


window.onload = function() {
	setHeight();
	$('#container').jScrollPane();
}
window.onresize = function() {
	setHeight();
	$('#container').jScrollPane();
}


