/*fonction zoom image pleine page*/
	
	function getAbsoluteLeft(oNode){
		// Fonction prise chez microsoft pour ie
		if (IE6 || IE7) {
			var oCurrentNode=oNode;
			var iLeft=0;
			while(oCurrentNode.tagName!="BODY"){
				iLeft+=oCurrentNode.offsetLeft;
				oCurrentNode=oCurrentNode.offsetParent;
			}
			return iLeft;
		}
		else return oNode.offsetLeft;
	}
	
	function getAbsoluteTop(oNode){
		// Fonction prise chez microsoft pour ie
		if (IE6 || IE7) {
			var oCurrentNode=oNode;
			var iTop=0;
			while(oCurrentNode.tagName!="BODY"){
				iTop+=oCurrentNode.offsetTop;
				oCurrentNode=oCurrentNode.offsetParent;
			}
			return iTop;
		}
		else return oNode.offsetTop;
	}
	
	var img = document.createElement('img');
	
	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;
	}
	
	/************************************ zoomMedia *******************************/
	var zoomTimeout = 30000; // Timeout permettant d'arreter le script de zoom si le fichier n'existe pas ou si il met trop de temps à charger;
	var zoomTime = 0;
	
	function onOffImg(onoff, monImage,monTitre) {
		// !!! Ne pas oublier de définir le style de divZoom, divZoomContenu et imgZoom2 dans la css !!!
		if (document.getElementById('divZoom')) nodeZoom = document.getElementById('divZoom');
		else {
			var nodeZoom = document.createElement("div");
			nodeZoom.id = "divZoom";
		}
		if (document.getElementById('divZoomContenu')) nodeZoomContenu = document.getElementById('divZoomContenu');
		else {
			var nodeZoomContenu = document.createElement("div");
			nodeZoomContenu.id = "divZoomContenu";
		}
		
		nodeZoom.style.display = "block";
		nodeZoomContenu.style.visibility = "hidden";
		if (IE6) {
			nodeZoom.style.position = "absolute";
			nodeZoomContenu.style.position = "absolute";
		}
		
		nodeZoomContenu.innerHTML = '<a href="#null" onclick="hideZoom();return false;"><img id="imgZoom2" src="'+monImage+'" alt="'+monTitre+'" border="0"/></a><br /><br /><a href="#null" onclick="hideZoom();return false;">Fermer</a>';
		
		if (FF) nodeZoom.style.top = "0px";
		else nodeZoom.style.pixelTop = 0;
			
		if (FF) nodeZoomContenu.style.top = "0px";
		else nodeZoomContenu.style.pixelTop = 0;
			
		nodeZoomContenu.style.textAlign = "center";
		document.body.appendChild(nodeZoom);
		document.body.appendChild(nodeZoomContenu);
		nodeZoom.style.width = "100%";
		nodeZoom.style.height = "100%";
		nodeZoom.style.margin = "0px 0px 0px 0px";
		nodeZoom.style.padding = "10px 0px 0px 0px";
		nodeZoom.onclick = hideZoom;
		setTimeout("_preload()", 100);
	}
	
	function _preload() {
		if (!document.getElementById('imgZoom2').complete){
			zoomTime+=200;
			if (zoomTime<=zoomTimeout) setTimeout("_preload()", 200);
		} else {
			w = document.getElementById('imgZoom2').width;
			h = document.getElementById('imgZoom2').height;
			_resize();
			document.getElementById('divZoomContenu').style.display = "block";
			document.getElementById('divZoomContenu').style.visibility = "visible";
		}
	}
	
	function hideZoom() {
		GetE('divZoom').style.display = "none";
		GetE('divZoomContenu').style.visibility = "hidden";
		GetE('imgZoom2').style.display = "none";
	
	}
	
	function _resize() {
		if (document.getElementById('divZoomContenu') && document.getElementById('divZoom').style.display != "none") {
			document.getElementById('divZoomContenu').style.overflow = 'visible';
			var w = document.getElementById('imgZoom2').width;
			var h = document.getElementById('imgZoom2').height;
			var m = Math.floor(getWindowWidth()/2 - w/2);
			if (m<0) m="0px";
		else m+="px";
			document.getElementById('divZoomContenu').style.marginLeft = m;
			var m2 = Math.floor(getWindowHeight()/2 - h/2);
			if (m2<0) m2="0px";
		else m2+="px";
			document.getElementById('divZoomContenu').style.marginTop= m2;
			// Si l'image dépasse la taille de la page on affiche les scrolls supplémentaires
			if (w > getWindowWidth()) {
				document.getElementById('divZoomContenu').style.overflow = 'scroll';
				document.getElementById('divZoomContenu').style.width = (getWindowWidth()-15)+"px";
			}
			if (h > getWindowHeight()) {
				document.getElementById('divZoomContenu').style.overflow = 'scroll';
				document.getElementById('divZoomContenu').style.height = (getWindowHeight()-15)+"px";
			}
			if (IE6) IE6_resize(h, w);
		}
	}
	
	function IE6_resize(h, w) {
		document.getElementById('divZoom').style.width = getWindowWidth()+document.documentElement.scrollLeft + "px";
		document.getElementById('divZoom').style.height = getWindowHeight()+"px";
		document.getElementById('divZoom').style.top = document.documentElement.scrollTop;
		m = Math.floor(getWindowHeight()/2 - h/2)+document.documentElement.scrollTop;
		if (m<0) m = "0px";
		else m+= "px";
	
		m2 = Math.floor(getWindowWidth()/2 - w/2)+document.documentElement.scrollLeft;
		if (m2<0) m2 = "0px";
		else m2+= "px";
		document.getElementById('divZoomContenu').style.marginTop = m
		document.getElementById('divZoomContenu').style.marginLeft= m2;
	}
	
	
	window.onresize = _resize;
	if (IE6) window.onscroll = _resize;