// Gestion Taille 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;
}

// Gestion rezise Footer
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('contenu').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}

// Function OnLoad
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}

// Pré-chargement images footer
var img1 = new Image; img1.src = 'http://www.aeccp-cheval.net/template/img/img-theme/haras-logo-footer-hover.jpg';
var img2 = new Image; img2.src = 'http://www.aeccp-cheval.net/template/img/img-theme/sf-logo-footer-hover.jpg';
/* Préchargement image fond Sous Menu */
var img3 = new Image; img3.src = 'http://www.aeccp-cheval.net/template/img/img-theme/fond-menu-hover.png';
/* Préchargement image Association */
var img4 = new Image; img4.src = 'http://www.aeccp-cheval.net/template/img/img-theme/asso-hiron-jreaux.png';
function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

