		function createNote(note, idobj){
			var histoNotes = document.getElementById(idobj);
			if(note != 0){
				var result = 150-((note*150)/5);
			}
			else{
				var result = '150';
			}
			histoNotes.style.backgroundPosition = '-'+result+'px'; 
		}
		
		function placeNote(note2, idobj2){
			var numNote = document.getElementById(idobj2);
			if(note2 != 0){
				var place = (note2*140)/5;
			}
			else{
				var place = 0;
			}
			numNote.style.marginLeft = place+'px';
		}
		
		function afficheHotels(check){
			var xhr_object = null; 
				 
			if(window.XMLHttpRequest) // Firefox 
			   xhr_object = new XMLHttpRequest(); 
			else if(window.ActiveXObject) // Internet Explorer 
			   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
			else { // XMLHttpRequest non supporté par le navigateur 
			   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
			   return; 
			} 
			
			if(check == 1){
				filename = 'html/hotels.php?check=1';
			}
			else if(check > 1){
				filename = 'html/hotels.php?limHot='+check;
			}
			else if(check == 'cure'){
				filename = 'hotelsCure.php?check=cure';
			}
			else{
				filename = 'html/hotels.php';
			}
			xhr_object.open("GET", filename, true); 
				 
			xhr_object.onreadystatechange = function() { 
				document.getElementById('hotelsFromAjax').innerHTML = "<p style='text-align: center; margin-top: 0px;'><br /><br /><img src='html/loading.gif' alt='Loading' title='Loading' width='42' height='42' /><br />Loading...<br /><br /></p>";
			   if(xhr_object.readyState == 4) { 
					document.getElementById('hotelsFromAjax').innerHTML = xhr_object.responseText;
				}
			} 
				 
			xhr_object.send(null);
		return false;
		}
		
		function redirection(id, date, nuits, numProd){
			if(navigator.appName == "Microsoft Internet Explorer"){
				document.location.href='../resa.php?id='+id+'&date='+date+'&nuits='+nuits+'&numProd='+numProd;
			}
			else{
				document.location.href='resa.php?id='+id+'&date='+date+'&nuits='+nuits+'&numProd='+numProd;
			}
		}
		
		function openNbPers(id){
		//var tabId = new Array("nbAdults", "nbChilds", "nbBabies");
			var liste = document.getElementById(id);
				liste.style.display = 'block';
			/*
			for(var i=0; i<tabId.length; i++){
				if(tabId[i] != id){
					document.getElementById(tabId[i]).style.display = 'none';
				}
			}*/
		}
		
		function closeNbPers(id){
			var liste = document.getElementById(id);
			liste.style.display = 'none';
		}
		
		function openSuite(div, link, loca){
			if(loca == 'avis'){
				var tmp = div.split('avis');
				if(link.innerHTML == 'Lire la suite'){
					link.innerHTML = 'Fermer';
					filename = 'html/suites.php?num='+tmp[1]+'&troncate=0&avis=1';

				}
				else{
					link.innerHTML = 'Lire la suite';
					filename = 'html/suites.php?num='+tmp[1]+'&troncate=1&avis=1';
				}	
			}
			else if(loca == 'hotel'){
				if(link.innerHTML == 'Lire la suite'){
					link.innerHTML = 'Fermer';
					filename = 'html/suites.php?troncate=0&hotel=1';

				}
				else{
					link.innerHTML = 'Lire la suite';
					filename = 'html/suites.php?troncate=1&hotel=1';
				}	
			}
			else{
				var tmp = div.split('descri');
				if(link.innerHTML == 'Lire la suite'){
					link.innerHTML = 'Fermer';
					if(loca == 1){
						filename = 'html/suites.php?num='+tmp[1]+'&troncate=0&cure=1';
					}
					else{
						filename = 'html/suites.php?num='+tmp[1]+'&troncate=0';
					}
				}
				else{
					link.innerHTML = 'Lire la suite';
					if(loca == 1){
						filename = 'html/suites.php?num='+tmp[1]+'&troncate=1&cure=1';
					}
					else{
						filename = 'html/suites.php?num='+tmp[1]+'&troncate=1';
					}
				}
			}
			
			
			var xhr_object = null; 
				 
			if(window.XMLHttpRequest) // Firefox 
			   xhr_object = new XMLHttpRequest(); 
			else if(window.ActiveXObject) // Internet Explorer 
			   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
			else { // XMLHttpRequest non supporté par le navigateur 
			   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
			   return; 
			} 	 
			
			xhr_object.open("GET", filename, true); 
				 
			xhr_object.onreadystatechange = function() { 
				document.getElementById(div).innerHTML = "<p style='text-align: center; margin-top: 0px;'><br /><br /><img src='html/smalloading.gif' alt='Loading' title='Loading' width='16' height='16' /><br />Loading...<br /><br /></p>";
			   if(xhr_object.readyState == 4) { 
					document.getElementById(div).innerHTML = xhr_object.responseText;
					}
			} 
				 
			xhr_object.send(null);
		return false;
		}
		
		function startTimeNbPers(id){
			timeOpen = setTimeout("closeNbPers('"+id+"')", 2000);
		}

		function stopTimeNbPers(){
			if(typeof timeOpen != 'undefined'){
				clearTimeout(timeOpen);
			}
		}
		
		function exergue(obj){
			obj.style.backgroundColor = '#F8FCFF';
			obj.style.cursor = 'pointer';
		}
		
		function noexergue(obj){
			obj.style.backgroundColor = 'white';
			obj.style.cursor = 'auto';
		}
		
		function putValue(obj, id, inp){
			if(inp != 1){
				var valeur = obj.getAttribute('value');
				document.getElementById(id).value = valeur;
			}
			else{
				valeur = document.getElementById(id).value;
			}
			if(valeur != 0 && id == 'nbC'){
				document.getElementById('selectsForChilds').style.display = 'block';
				var insideSelects = '';
				var nbEnfants = '';
				var a = 1;
				for(var i=0; i<valeur; i++){
					if(i == 0){
						nbEnfants += 'Age du 1<sup>er</sup> enfant<br />';
					}
					else{
						a = i+1;
						nbEnfants += 'Age du '+a+'<sup>ème</sup> enfant<br />';
					}
					insideSelects += '<input type="text" name="ageChild'+a+'" id="child'+i+'" size=4 maxlength=2 />'+
					'<span class="imgSelect" onClick="openNbPers(\'listChild'+i+'\'); startTimeNbPers(\'listChild'+i+'\');"></span>'+
					'<span class="listeNb" id="listChild'+i+'" onmouseover="stopTimeNbPers();" onmouseout="startTimeNbPers(\'listChild'+i+'\');">'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="3">3</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="4">4</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="5">5</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="6">6</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="7">7</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="8">8</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="9">9</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="10">10</span>'+
						'<span class="nombres" onmouseover="exergue(this);" onmouseout="noexergue(this);" onClick="putValue(this, \'child'+i+'\');" value="11">11</span>'+
					'</span> ans<br /><br />';
				}
				document.getElementById('selectsForChildsLeft').innerHTML = nbEnfants;
				document.getElementById('selectsForChildsRight').innerHTML = insideSelects;
			}
			if(valeur == 0 && id == 'nbC'){
				document.getElementById('selectsForChilds').style.display = 'none';
				document.getElementById('selectsForChildsLeft').innerHTML = '';
				document.getElementById('selectsForChildsRight').innerHTML = '';
			}
		}
		
		function verifChamps(){
			var a = document.getElementById('customerLastName');
			var b = document.getElementById('customerName');
			var c = document.getElementById('customerPhone');
			var d = document.getElementById('customerMail');
			var e = document.getElementById('nbA');
			var f = document.getElementById('nbC');
			var g = document.getElementById('nbB');
			var expTel = /^0[1-68]([-. ]?[0-9]{2}){4}$/;
			var expMail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			
					if(a.value == '' || b.value == '' || c.value == '' || d.value == '' || e.value == '' || f.value == '' || g.value == ''){
						alert('Tous les champs n\'ont pas été remplis.');
						return false;
					}
					else if(c.value.lenght < 10 ){
						alert('Numéro de téléphone invalide');
						return false;
					}
					else if(expMail.test(d.value) == false){
						alert('mail invalide');
						return false;
					}
					else{
						insertValues();
					}
		}
		
		function convertKeyCode(charCode){
			var charactere = "";
			 if (charCode == 8) charactere = "backspace"; //  backspace
			 if (charCode == 9) charactere = "tab"; //  tab
			 if (charCode == 13) charactere = "enter"; //  enter
			 if (charCode == 16) charactere = "shift"; //  shift
			 if (charCode == 17) charactere = "ctrl"; //  ctrl
			 if (charCode == 18) charactere = "alt"; //  alt
			 if (charCode == 19) charactere = "pause/break"; //  pause/break
			 if (charCode == 20) charactere = "caps lock"; //  caps lock
			 if (charCode == 27) charactere = "escape"; //  escape
			 if (charCode == 33) charactere = "page up"; // page up, to avoid displaying alternate character and confusing people	         
			 if (charCode == 34) charactere = "page down"; // page down
			 if (charCode == 35) charactere = "end"; // end
			 if (charCode == 36) charactere = "home"; // home
			 if (charCode == 37) charactere = "left arrow"; // left arrow
			 if (charCode == 38) charactere = "up arrow"; // up arrow
			 if (charCode == 39) charactere = "right arrow"; // right arrow
			 if (charCode == 40) charactere = "down arrow"; // down arrow
			 if (charCode == 45) charactere = "insert"; // insert
			 if (charCode == 46) charactere = "delete"; // delete
			 if (charCode == 91) charactere = "left window"; // left window
			 if (charCode == 92) charactere = "right window"; // right window
			 if (charCode == 93) charactere = "select key"; // select key
			 if (charCode == 96) charactere = "numpad 0"; // numpad 0
			 if (charCode == 97) charactere = "numpad 1"; // numpad 1
			 if (charCode == 98) charactere = "numpad 2"; // numpad 2
			 if (charCode == 99) charactere = "numpad 3"; // numpad 3
			 if (charCode == 100) charactere = "numpad 4"; // numpad 4
			 if (charCode == 101) charactere = "numpad 5"; // numpad 5
			 if (charCode == 102) charactere = "numpad 6"; // numpad 6
			 if (charCode == 103) charactere = "numpad 7"; // numpad 7
			 if (charCode == 104) charactere = "numpad 8"; // numpad 8
			 if (charCode == 105) charactere = "numpad 9"; // numpad 9
			 if (charCode == 106) charactere = "multiply"; // multiply
			 if (charCode == 107) charactere = "add"; // add
			 if (charCode == 109) charactere = "subtract"; // subtract
			 if (charCode == 110) charactere = "decimal point"; // decimal point
			 if (charCode == 111) charactere = "divide"; // divide
			 if (charCode == 112) charactere = "F1"; // F1
			 if (charCode == 113) charactere = "F2"; // F2
			 if (charCode == 114) charactere = "F3"; // F3
			 if (charCode == 115) charactere = "F4"; // F4
			 if (charCode == 116) charactere = "F5"; // F5
			 if (charCode == 117) charactere = "F6"; // F6
			 if (charCode == 118) charactere = "F7"; // F7
			 if (charCode == 119) charactere = "F8"; // F8
			 if (charCode == 120) charactere = "F9"; // F9
			 if (charCode == 121) charactere = "F10"; // F10
			 if (charCode == 122) charactere = "F11"; // F11
			 if (charCode == 123) charactere = "F12"; // F12
			 if (charCode == 144) charactere = "num lock"; // num lock
			 if (charCode == 145) charactere = "scroll lock"; // scroll lock
			 if (charCode == 186) charactere = ";"; // semi-colon
			 if (charCode == 187) charactere = "="; // equal-sign
			 if (charCode == 188) charactere = ","; // comma
			 if (charCode == 189) charactere = "-"; // dash
			 if (charCode == 190) charactere = "."; // period
			 if (charCode == 191) charactere = "/"; // forward slash
			 if (charCode == 192) charactere = "`"; // grave accent
			 if (charCode == 219) charactere = "["; // open bracket
			 if (charCode == 220) charactere = "\\"; // back slash
			 if (charCode == 221) charactere = "]"; // close bracket
			 if (charCode == 222) charactere = "'"; // single quote
			 if (charCode == 65) charactere = "a";
			 if (charCode == 66) charactere = "b";
			 if (charCode == 67) charactere = "c";
			 if (charCode == 68) charactere = "d";
			 if (charCode == 69) charactere = "e";
			 if (charCode == 70) charactere = "f";
			 if (charCode == 71) charactere = "g";
			 if (charCode == 72) charactere = "h";
			 if (charCode == 73) charactere = "i";
			 if (charCode == 74) charactere = "j";
			 if (charCode == 75) charactere = "k";
			 if (charCode == 76) charactere = "l";
			 if (charCode == 77) charactere = "m";
			 if (charCode == 78) charactere = "n";
			 if (charCode == 79) charactere = "o";
			 if (charCode == 80) charactere = "p";
			 if (charCode == 81) charactere = "q";
			 if (charCode == 82) charactere = "r";
			 if (charCode == 83) charactere = "s";
			 if (charCode == 84) charactere = "t";
			 if (charCode == 85) charactere = "u";
			 if (charCode == 86) charactere = "v";
			 if (charCode == 87) charactere = "w";
			 if (charCode == 88) charactere = "x";
			 if (charCode == 89) charactere = "y";
			 if (charCode == 90) charactere = "z";
		return charactere;
		}
		
		function getStations(charPush){
			document.getElementById('listeStationsChar').innerHTML = '';
			var arrayChar = new Array();
			var a = 0;
			var stations = document.getElementById('listeStation');
			var inStations = stations.innerHTML;
			var arraySpans = inStations.split("</span>");
			var spans = stations.getElementsByTagName('SPAN');
			for(var i=0; i<spans.length; i++){
				var smallChaine = spans[i].innerHTML.toLowerCase();
				if(charPush == smallChaine.charAt(0)){
					arrayChar[a] = spans[i];
				a++;
				}
			}
			for(i=0; i<arrayChar.length; i++){
				for(r=0; r<arraySpans.length; r++){
					if(arraySpans[r].match(arrayChar[i].innerHTML)){
						var loc = arraySpans[r]+"</span>";
					}
					else{
					
					}
				}
				document.getElementById('listeStationsChar').innerHTML += loc;
			}
			stations.style.display = 'none';
			document.getElementById('listeStationsChar').style.display = 'block';
		}
		
		function divCreate(nomClass, nomId, nomDiv){
			var block = document.createElement("div");
			block.className = nomClass;
			block.setAttribute("id", nomDiv);
			document.getElementById(nomId).appendChild(block);
			
		}
		
		function openSearch(checker){
			var selectRegion = document.getElementById('selectRegion');
			var selectStation = document.getElementById('selectStation');
				if(checker == 1){
					if(!selectRegion){ return }
					else{
							var toOpen = document.getElementById('listeRegion');
							if(toOpen.style.display == 'none'){
								toOpen.style.display = 'block';
							}
							else{
								toOpen.style.display = 'none';
							}
					}
				}
				if(checker == 2){
					if(!selectStation){ return }
					else{
							var toOpen2 = document.getElementById('listeStation');
							if(toOpen2.style.display == 'none'){
								toOpen2.style.display = 'block';
								document.getElementById('listeStationsChar').style.display = 'none';
								document.onkeydown=function(e){
									var charactere = convertKeyCode((e||window.event).keyCode);
									getStations(charactere);
								}
							}
							else{
								toOpen2.style.display = 'none';
								document.onkeydown='';
							}
						}
				}
		}
		
		function openBabies(valeur){
			if(valeur != 0){
				document.getElementById('selectsForChilds').style.display = 'block';
				var insideSelects = '';
				var nbEnfants = '';
				var a = 1;
				for(var i=0; i<valeur; i++){
					if(i == 0){
						nbEnfants += 'Age du 1<sup>er</sup> enfant<br />';
					}
					else{
						a = i+1;
						nbEnfants += 'Age du '+a+'<sup>ème</sup> enfant<br />';
					}
					insideSelects += '<select name="ageChild'+a+'">'+
										'<option value="3">3 ans</option>'+
										'<option value="4">4 ans</option>'+
										'<option value="5">5 ans</option>'+
										'<option value="6">6 ans</option>'+
										'<option value="7">7 ans</option>'+
										'<option value="8">8 ans</option>'+
										'<option value="9">9 ans</option>'+
										'<option value="10">10 ans</option>'+
										'<option value="11">11 ans</option>'+
									 '</select><br /><br />';
				}
				document.getElementById('selectsForChildsLeft').innerHTML = nbEnfants;
				document.getElementById('selectsForChildsRight').innerHTML = insideSelects;
			}
			if(valeur == 0){
				document.getElementById('selectsForChilds').style.display = 'none';
				document.getElementById('selectsForChildsLeft').innerHTML = '';
				document.getElementById('selectsForChildsRight').innerHTML = '';
			}
		}
		
		function insertValues(){
			var former = document.formResa;
			var params = "customerLastName="+escape(encodeURI(former.customerLastName.value));
				params +=	"&customerName="+escape(encodeURI(former.customerName.value));
				params += 		"&customerPhone="+escape(encodeURI(former.customerPhone.value));
				params += 		 "&customerMail="+escape(encodeURI(former.customerMail.value));
				params += 		 "&nbAdults="+escape(encodeURI(former.nbAdults.value));
				params +=		 "&nbChildren="+escape(encodeURI(former.nbChildren.value));
				params +=		 "&nbBabies="+escape(encodeURI(former.nbBabies.value));
				params +=		 "&numProd="+escape(encodeURI(former.numProd.value));
				params +=		 "&numHotel="+escape(encodeURI(former.numHotel.value));
				params +=		 "&nightDuration="+escape(encodeURI(former.nightDuration.value));
				params +=		 "&dayDuration="+escape(encodeURI(former.dayDuration.value));
			
			var xhr_object = null; 
				 
			if(window.XMLHttpRequest) // Firefox 
			   xhr_object = new XMLHttpRequest(); 
			else if(window.ActiveXObject) // Internet Explorer 
			   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
			else { // XMLHttpRequest non supporté par le navigateur 
			   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
			   return false; 
			} 	 
			
			filename = "resaForm.php";
			
			xhr_object.open("POST", filename, true); 
			xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xhr_object.setRequestHeader("Content-length", params.length);
			xhr_object.setRequestHeader("Connection", "close");

				 
			xhr_object.onreadystatechange = function() { 
			   if(xhr_object.readyState == 4) { 
					var reponse = xhr_object.responseText;
					}
			}  
				 
			xhr_object.send(params);
		return false;
		}
		
		function adjustRightBar(){
			if(navigator.appName == "Microsoft Internet Explorer" && document.body.clientWidth > 1270){
				var rightbar = document.getElementById('rightbar');
				var wrap = document.getElementById('wrapper');
				rightbar.style.left = "940px";
			}
		}
		
		function mouseCoords(ev)
		{
			var coords = new Array();
		  var x, y;
		  if (ev.x!=null && ev.y!=null)
		  {
		   coords['x'] = ev.x;
		   coords['y'] = ev.y;
		  }
		 
		  if (ev.clientX!=null && ev.clientY!=null)
		  {
		   coords['x'] = ev.clientX;
		   coords['y'] = ev.clientY;
		  }
		  return coords;
		}
		
		function divCreate2(txt, e){
			var pos = mouseCoords(e);
			var block = document.createElement("div");
			var posx = pos['x'];
			var posy = pos['y']+10;
			block.setAttribute("id", "bulle");
			block.className = "bulle";
			block.style.top = posy+"px";
			block.style.left = posx+"px";
			block.innerHTML = txt;
			document.body.appendChild(block);
		}
		
		function montre(txt, e){
			divCreate2(txt, e);
		}
		
		function cache(){
			if(!document.getElementById('bulle')){ return }
			else{
				document.body.removeChild(document.getElementById('bulle'));
			}
		}
		
		/*
		function init(){

			/*fastSearch
			var selectRegion = document.getElementById('selectRegion');
			var selectStation = document.getElementById('selectStation');
				
				if(!selectRegion){ return }
				else{
					selectRegion.onclick = function(){
						var toOpen = document.getElementById('listeRegion');
						if(toOpen.style.display == 'none'){
							toOpen.style.display = 'block';
						}
						else{
							toOpen.style.display = 'none';
						}
					}
				}
				if(!selectStation){ return }
				else{
					selectStation.onclick = function(){
						var toOpen2 = document.getElementById('listeStation');
						if(toOpen2.style.display == 'none'){
							toOpen2.style.display = 'block';
							document.getElementById('listeStationsChar').style.display = 'none';
							document.onkeydown=function(e){
								var charactere = convertKeyCode((e||window.event).keyCode);
								getStations(charactere);
							}
						}
						else{
							toOpen2.style.display = 'none';
							document.onkeydown='';
						}
					}
				}
		}
		*/
		
		function checkEmail(){ 
				
				var email = document.formNewsletter.email.value; 
				if (email.search(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == -1)
				{ 
					alert ('entrez une adresse Email valide'); 
					document.formNewsletter.email.focus(); 
					return false; 
				} 
				
		else {return true;}
		}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

		function initScrollLayer() {
		  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
		  // if horizontal scrolling, id of element containing scrolling content (table?)
		  var wndo = new dw_scrollObj('wn', 'lyr1');
		  
		  // bSizeDragBar set true by default (explained at www.dyn-web.com/dhtml/scroll/ )
		  // wndo.bSizeDragBar = false;
		  
		  // arguments: dragBar id, track id, axis ("v" or "h"), x offset, y offset
		  // (x/y offsets of dragBar in track)
		  wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
		  
		  // pass id('s) of scroll area(s) if inside table(s)
		  // i.e., if you have 3 (with id's wn1, wn2, wn3): dw_scrollObj.GeckoTableBugFix('wn1', 'wn2', 'wn3');
		  dw_scrollObj.GeckoTableBugFix('wn'); 
		}
		