// Bibliothèque de scripts - 



//****************************************************************
// Fonction d'import des animations Flash 
//****************************************************************

function RunFlash(swf, hauteur, largeur, nom) {
	document.write("<object width=\""+largeur+"\" height=\""+hauteur+"\" id=\""+nom+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\">\n");
	document.write("<param name=\"quality\" value=\"high\">\n");
	document.write("<param name=\"wmode\" value=\"transparent\">\n");
	document.write("<param name=\"movie\" value=\""+swf+"\">\n");
	document.write("<embed src=\""+swf+"\" quality=\"high\" wmode=\"transparent\" width=\""+largeur+"\" height=\""+hauteur+"\" name=\""+nom+"\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">\n");
	document.write("</object>\n");
}


//****************************************************************
// Affichage des POPUP 
//****************************************************************
/* 
function funcPopup(varUrl, varWidth, varHeight, varResize) {
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	var WinPopUp = window.open(varUrl, 'popup', "toolbar=no, menubar=no, scrollbars=yes, resizable=" + varResize + ", location=no, directories=no, status=no, width=" + varWidth + ", height=" + varHeight);
	WinPopUp.moveTo(Math.round((ScreenW-varWidth)/2), Math.round((ScreenH-varHeight)/2));	
}



if (browser.ie6) { 
	var wallpaper = document.getElementById('animation');
	var fixToTop = function () {
		wallpaper.style.height = getViewport()[1] + 'px';
		wallpaper.style.top = getWindowScroll()[1] + 'px';
		
	};
	addEvent(window, 'scroll', fixToTop);
	addEvent(window, 'resize', fixToTop);	
}
 */


//****************************************************************
// Affichage toggle des actus en page d'accueil
//****************************************************************

$(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready (a little sooner that page load)
 $('#slickbox').hide();

 // slides down, up, and toggle the slickbox on click
 $('#slick-slidetoggle').click(function() {
 $('#slickbox').slideToggle("slow");
 return false;
 });
});



$(document).ready(function() {
 $('#slickbox').hide();
 $('#slick-slidetoggle-actu1').click(function() {
 $('#slickbox').slideToggle("slow");
 return false;
 });
});

$(document).ready(function() {
 $('#slickbox').hide();
 $('#slick-slidetoggle-actu2').click(function() {
 $('#slickbox').slideToggle("slow");
 return false;
 });
});

$(document).ready(function() {
 $('#slickbox').hide();
 $('#slick-slidetoggle-arrow').click(function() {
 $('#slickbox').slideToggle("slow");
 return false;
 });
});


//****************************************************************
// Gestion de la hauteur et largeur de l'animation
//****************************************************************

/* 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 setHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('page').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'absolute';
			}
			else {
				footerElement.style.position = 'relative';
			}
		}
	}
}
*/
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;
}

function setHeightBackground() {
	
	var windowHeight 	= getWindowHeight();
	var windowWidth 	= getWindowWidth();

	if (windowHeight > windowWidth) {
		document.getElementById('imgBgd').style.height 	= '100%';
		document.getElementById('imgBgd').style.width 	= '';
	} else {
		document.getElementById('imgBgd').style.height 	= '';
		document.getElementById('imgBgd').style.width 	= '100%';
	}
}

window.onload = function() {
	setHeightBackground();
}
window.onresize = function() {
	setHeightBackground();
} 





