	var isMoving = false; var decalY = 100; var gHeight = erit_h || 0;
	var moveList = function(sens,elem){
		var iTop = parseInt(Element.getStyle(elem, 'top')) || 0;
		//var iHeight = parseInt($(elem).clientHeight) || 0;
		var iHeight = parseInt($(elem).getHeight()) || 0;
		//alert("iTop : "+iTop+" | iHeight : "+iHeight);
		//alert("Hauteur : "+$(elem).getHeight());
		if (sens == 1) { if (iTop <= 0 && (iTop > -(iHeight-(gHeight-20))) && !isMoving) moveNow(sens,elem,-decalY);
		} else { if (iTop < 0 && !isMoving) moveNow(sens,elem,decalY); }
	}
	var moveNow = function(sens,elem,decal){
		new Effect.Move(elem, { 
			'duration': 0.5, 'y': decal,
			'beforeStart': function() { isMoving = true; Element.setOpacity(elem, 0.7); }.bind(this),
			'afterFinish': function() { isMoving = false; Element.setOpacity(elem, 1.0); }.bind(this)
		});
	}
	var detailVisibleEx = false; var mapVisibleEx = false; var idFicheEx = null; var eritGeoInfoEx = null;
	var tabFilesEx = new Array(); var tabWsEx = new Array(); var tabHsEx = new Array();
	var nbNode2Ex = 0; var timeoutID1Ex = null; var timeoutID2Ex = null; var timeoutID3Ex = null;

	var handlerFuncEx = function(t) { var htmlText = t.responseText; showDetailEx(htmlText); }
	var handlerFunc2Ex = function(t) {
		tabFilesEx = new Array(); tabWsEx = new Array(); tabHsEx = new Array(); nbNode2Ex = 0;
		var xmlDoc = t.responseXML.documentElement;
		var ttNodes = xmlDoc.childNodes;
		for(var i=0;i<xmlDoc.childNodes.length;i++){
			if(xmlDoc.childNodes[i].nodeType==1){
				for(var j=0;j<xmlDoc.childNodes[i].childNodes.length;j++){
					if(xmlDoc.childNodes[i].childNodes[j].nodeType==1) {
						switch(xmlDoc.childNodes[i].childNodes[j].nodeName) {
							case "file":
								nbNode2Ex++;
								if (xmlDoc.childNodes[i].childNodes[j].firstChild) {
									var theValue = xmlDoc.childNodes[i].childNodes[j].firstChild.nodeValue; 
								} else { var theValue = ""; }
								tabFilesEx.push(theValue);
								break;
							case "width":
								if (xmlDoc.childNodes[i].childNodes[j].firstChild) {
									var theValue = xmlDoc.childNodes[i].childNodes[j].firstChild.nodeValue; 
								} else { var theValue = ""; }
								tabWsEx.push(theValue);
								break;
							case "height":
								if (xmlDoc.childNodes[i].childNodes[j].firstChild) {
									var theValue = xmlDoc.childNodes[i].childNodes[j].firstChild.nodeValue;
								} else { var theValue = ""; }
								tabHsEx.push(theValue);
								break;
						}
					}
				}
			}
		}
		setTimeout(showSlideEx(nbNode2Ex),500);
	}
	var start_slideshowEx = function(start_frame, end_frame, delay) { timeoutID3Ex = setTimeout(switch_slides_FadeAppearEx(start_frame,start_frame,end_frame, delay), delay); }
	var switch_slides_FadeAppearEx = function(frame, start_frame, end_frame, delay) {
		return (function() {
			var last_frame = 0; last_frame = frame;
			Effect.Fade('slideFiche' + frame);
			if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
			timeoutID1Ex = setTimeout("Effect.Appear('slideFiche" + frame + "');", 850);
			timeoutID2Ex = setTimeout(switch_slides_FadeAppearEx(frame, start_frame, end_frame, delay), delay + 850);
		})
	}
	var showSlideEx = function(nb){
		var str = '';
		for(var i=0; i<tabFilesEx.length; i++){
			if (i==0) {
				str+= '<div id="slideFiche'+(i+1)+'" class="slideE"><div class="imgholder"><img id="imgZone" src="'+path_photos+tabFilesEx[i]+'" width="'+tabWsEx[i]+'" height="'+tabHsEx[i]+'" alt="'+tabFilesEx[i]+'" title="'+tabFilesEx[i]+'" /></div></div>';
			} else {
				str+= '<div id="slideFiche'+(i+1)+'" class="slideE" style="display: none;"><div class="imgholder"><img id="imgZone" src="'+path_photos+tabFilesEx[i]+'" width="'+tabWsEx[i]+'" height="'+tabHsEx[i]+'" alt="'+tabFilesEx[i]+'" title="'+tabFilesEx[i]+'" /></div></div>';
			}
		}
		$('eritSlide').innerHTML = str;
		if (nb > 1) start_slideshowEx(1, nb, 5000);
	}
	var showDetailEx = function(str){
		var strMsg = '<div class="columnCenter"><p id="warning">'+lMsg+'</p></div>';
		var strBox = '<div id="eritDetail" class="fdNoir"><div class="aBox x760"><div class="aBoxTop hasTitle c666h"><h3><a href="javascript:closeDetailEx();"><img src="/img/gui/close.png" width="15" height="15" class="closeBut" />'+lClose+'<img src="/img/gui/z.gif" width="250" height="1" />'+lDetail+'</a></h3></div><div id="eritDetailContent" class="aBoxIn line_fefefe">'+str+strMsg+'</div><div class="aBoxFoot fefefe"> </div></div></div>';
		var strMap = '<div id="eritMap"><div class="aBox x760"><div class="aBoxTop hasTitle c666h"><h3><a href="javascript:closeMap();"><img src="/img/gui/close.png" width="15" height="15" class="closeBut" />'+lClose+'<img src="/img/gui/z.gif" width="280" height="1" />'+lMap+'</a></h3></div><div id="eritMapContent" class="aBoxIn line_fefefe"></div><div class="aBoxFoot fefefe"> </div></div></div>';

		Shadowbox.open({
			player:'html', content:strBox+strMap, width:800, height:750
			},{ onFinish: function() {
				$('eritMap').hide(); var bordereau = idFicheEx.substr(0,3);
				new Ajax.Request(path_RES+'loadPhotos.php', {method:'post', parameters:'fiche='+idFicheEx, onSuccess:handlerFunc2Ex});
			}
		});
	}
	var closeDetailEx = function(){
		clearTimeout(timeoutID1Ex); clearTimeout(timeoutID2Ex); clearTimeout(timeoutID3Ex);
		if (!mapVisibleEx) { $('eritDetail').hide(); Shadowbox.close(); } else { $('eritDetail').show(); }
		if ($('eritSlide')) $('eritSlide').innerHTML = '';
		if (mapVisibleEx) closeMap();
	}
	var callDetailEx = function(fiche){
		idFicheEx = fiche; var bordereau = idFicheEx.substr(0,3);
		switch(bordereau){
			case "HOT":
			case "HPA":
			case "HLO":
			case "VIL":
				new Ajax.Request(path_HOT+'detail.php', {method:'get', parameters:'fiche='+idFicheEx, onSuccess:handlerFuncEx}); break;
			case "FMA":
				new Ajax.Request(path_FMA+'detail.php', {method:'get', parameters:'fiche='+idFicheEx, onSuccess:handlerFuncEx}); break;
			case "LOI":
				new Ajax.Request(path_LOI+'detail.php', {method:'get', parameters:'fiche='+idFicheEx, onSuccess:handlerFuncEx}); break;
			case "PCU":
				new Ajax.Request(path_PCU+'detail.php', {method:'get', parameters:'fiche='+idFicheEx, onSuccess:handlerFuncEx}); break;
			case "RES":
				new Ajax.Request(path_RES+'detail.php', {method:'get', parameters:'fiche='+idFicheEx, onSuccess:handlerFuncEx}); break;
			case "DEG":
				new Ajax.Request(path_DEG+'detail.php', {method:'get', parameters:'fiche='+idFicheEx, onSuccess:handlerFuncEx}); break;
		}
	}
	var showMap = function(adr){
		$('eritMap').show();
		Effect.Appear('eritDetailContent', {duration:0.5, fps:25, from:1.0, to:0.0, 'afterFinish': function() { $('eritDetailContent').hide(); }.bind(this)});
		detailVisibleEx = false;
		Effect.Appear('eritMapContent', {duration:0.5, fps:25, from:0.0, to:1.0, 'afterFinish': function() { $('eritMapContent').show(); }.bind(this)});
		mapVisibleEx = true;
		initializeEx(adr);
	}
	var closeMap = function(){
		if (mapVisibleEx) {
			if ($('eritMap')){ $('eritMap').hide(); }; mapVisibleEx = false; detailVisibleEx = true;
			Effect.Appear('eritDetailContent', {duration:0.5, fps:25, from:0.0, to:1.0, 'afterFinish': function() { $('eritDetailContent').show(); }.bind(this) });
		}
	}

	var printDetail = function(fiche){
		idFichePrint = fiche; var bordPrint = idFichePrint.substr(0,3);
		switch(bordPrint){
			case "HOT":
			case "HPA":
			case "HLO":
			case "VIL":
				//new Ajax.Request(path_HOT+'print.php', {method:'get', parameters:'fiche='+idFichePrint}); break;
				displayWindow(path_HOT+"print.php?fiche="+idFichePrint,"Impression","1000","700",""); break;
			case "FMA":
				new Ajax.Request(path_FMA+'print.php', {method:'get', parameters:'fiche='+idFichePrint}); break;
			case "LOI":
				new Ajax.Request(path_LOI+'print.php', {method:'get', parameters:'fiche='+idFichePrint}); break;
			case "PCU":
				new Ajax.Request(path_PCU+'print.php', {method:'get', parameters:'fiche='+idFichePrint}); break;
			case "RES":
				new Ajax.Request(path_RES+'print.php', {method:'get', parameters:'fiche='+idFichePrint}); break;
			case "DEG":
				new Ajax.Request(path_DEG+'print.php', {method:'get', parameters:'fiche='+idFichePrint}); break;
		}
	}
	var mapEx = null; var geocoderEx = null; var theAddressEx = "";
	
	var showAddressEx = function(address) {
		if (geocoderEx) {
			theAddressEx = address;
			geocoderEx.getLatLng(address,
				function(point) {
					if (!point) { alert(address + " not found");
					} else {
						mapEx.setCenter(point, 8); mapEx.addControl(new GSmallMapControl());
						var marker = new GMarker(point); mapEx.addOverlay(marker);
						setTimeout("mapEx.zoomIn()",500);
						//marker.openInfoWindowHtml(address);
						
						//GEvent.addListener(map,"mouseover", function(overlay,point) {
						//GEvent.addListener(marker,"mouseover", function(overlay,point) {
							//var myHtml = "Adresse : "+theAddress;
							//map.openInfoWindow(point, myHtml);
							//marker.openInfoWindowHtml(address);
						//});
						
					}
				}
			);
		}
    }
    var initializeEx = function(adr) { if (GBrowserIsCompatible()) { mapEx = new GMap2($('eritMapContent')); geocoderEx = new GClientGeocoder(); showAddressEx(adr); } }
	Event.observe(window,'load', function(){ Shadowbox.init(); });
	
	var addPanier = function(fiche,type){
		new Ajax.Request('/include/models/panier/liste/addPanier.php', {method:'get', parameters:'fiche='+fiche+'&type='+type, onSuccess:handlerFuncPanier});
	}
	var handlerFuncPanier = function(t) {
		var xmlDoc = t.responseXML.documentElement;
		var retMsg = xmlDoc.getAttribute('msg');
		switch(retMsg){
			case "EXIST": var msg = 'La fiche exsite déjà !'; break;
			case "AJOUT": var msg = 'La fiche a été ajoutée !'; break;
			case "ERROR": var msg = 'Erreur !'; break;
		}
		$('msgPanier').innerHTML = msg; showMsg();
		new Ajax.Updater('navPanier', '/include/models/panier/navPanierContent.php');
	}
	var showMsg = function(){
		Effect.Appear('msgPanier', { duration: 1.0, afterFinish: function() { setTimeout(hideMsg, 2000); } });
	}
	var hideMsg = function(){
		Effect.Fade('msgPanier', { duration: 0.5 });
	}