			// ----------------------------------------
			// fonction generale d'ouverture de popup
			// ----------------------------------------
			var popup ;
			var popupOpened = false ;
			function openPopup(url,largeur,hauteur,boolScrollBar,boolResizable){
					gauche=(screen.width-largeur)/5;
			        haut=(screen.height-hauteur)/5;
			
					if (boolScrollBar) 
						scrollBarText = 'scrollbars=yes';
					else
						scrollBarText = 'scrollbars=no';
			
					if (boolResizable) 
						resizableText = 'resizable=yes';
					else
						resizableText = 'resizable=no';
				
					optionText= scrollBarText +','+ resizableText +
												',status=no'+
				 								',width='+largeur+
				 								',height='+hauteur+
				 								',top='+haut+
				 								',left='+gauche;
					if (popup) {
			        	popup.close();
			        }
			        if(!popupOpened){
				 		popupOpened=true;
				 		popup = window.open(url,'', optionText);
				 		popupOpened=false;
				 	}
			 }
 
			function openBigPopup(url){
			
						largeur = 650;
						hauteur = 500;
						scrollBarText = 'scrollbars=yes';
			
						resizableText = 'resizable=yes';
				
					optionText= scrollBarText +','+ resizableText +
												',status=no'+
				 								',width='+largeur+
				 								',height='+hauteur;
					
				 	window.open(url,'', optionText);
			 }

 			// ----------------------------------------
			// fonction de validation d'adresse mail
			// ----------------------------------------
 			function validateEmail(field) {            
                if (!checkEmail(field.value)) {
                   return false;
                }
                return true;
            }

            /**
             * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
             * http://javascript.internet.com
             */
            function checkEmail(emailStr) {
               if (emailStr.length == 0) {
                   return true;
               }
               var emailPat=/^(.+)@(.+)$/;
               var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
               var validChars="\[^\\s" + specialChars + "\]";
               var quotedUser="(\"[^\"]*\")";
               var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
               var atom=validChars + '+';
               var word="(" + atom + "|" + quotedUser + ")";
               var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
               var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
               var matchArray=emailStr.match(emailPat);
               if (matchArray == null) {
                   return false;
               }
               var user=matchArray[1];
               var domain=matchArray[2];
               if (user.match(userPat) == null) {
                   return false;
               }
               var IPArray = domain.match(ipDomainPat);
               if (IPArray != null) {
                   for (var i = 1; i <= 4; i++) {
                      if (IPArray[i] > 255) {
                         return false;
                      }
                   }
                   return true;
               }
               var domainArray=domain.match(domainPat);
               if (domainArray == null) {
                   return false;
               }
               var atomPat=new RegExp(atom,"g");
               var domArr=domain.match(atomPat);
               var len=domArr.length;
               if ((domArr[domArr.length-1].length < 2) ||
                   (domArr[domArr.length-1].length > 3)) {
                   return false;
               }
               if (len < 2) {
                   return false;
               }
               return true;
			}
	var bulleStyle=null
	//if (!document.layers && !document.all && !document.getElementById)
	//   event="chut";  //pour apaiser NN3 et autres antiquites
	   
	function afficherBulle(text,evt, hauteur)
	  {
	
		//Couleur d'arrière-plan principale
		//Généralement une couleur claire (blanc, jaune,etc)
		if (typeof fcolor == 'undefined') { var fcolor = "#FFFFE1";}
		  
		//Couleur du bord et du titre (caption)
		//Généralement une couleur foncée (noir, bleu marine,etc)
		if (typeof backcolor == 'undefined') { var backcolor = "#000000";}
		  
		//Couleur du texte de l'infobulle
		//Généralement une couleur foncée
		if (typeof textcolor == 'undefined') { var textcolor = "#000000";}
		
		//Epaisseur du bord en pixels 
		//Généralement entre 1 et 3 
		if (typeof border == 'undefined') { var border = "1";}
	  
	
		var xfenetre,yfenetre,xpage,ypage,element=null;
		var offset= 15;           // decalage par defaut
		var bulleWidth=150;       // largeur par defaut 
		if (!hauteur) hauteur=40; // hauteur par defaut
	
		txt = "<TABLE  BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
	  if (document.layers) { //ns4
	    bulleStyle=document.layers['bulle_div'];
	    bulleStyle.document.write('<layer bgColor="#ffffdd" '
	       +'style="width:150px;border:0px;color:black">'
	       + text + '</layer>' );
	    bulleStyle.document.close();
	    xpage = evt.pageX ; ypage  = evt.pageY;
	    xfenetre = xpage ;yfenetre = ypage ;		
	  } else if (document.all) { //ie4
	/*    element=document.all['bulle_div']
	    xfenetre = evt.x ;yfenetre = evt.y ;		
	    xpage=xfenetre ; ypage=yfenetre	;	
	    if (document.body.scrollLeft) xpage = xfenetre + document.body.scrollLeft ; 
	    if (document.body.scrollTop) ypage = yfenetre + document.body.scrollTop;
	*/
	  } else if (document.getElementById) { //ns6
		element=document.getElementById("bulle_div")
	    xfenetre = evt.clientX ;yfenetre = evt.clientY ;
	    xpage=xfenetre ; ypage=yfenetre	;	
	    if(evt.pageX) xpage = evt.pageX ;
	    if(evt.pageY) ypage  = evt.pageY ;
	  }
	  
	  if(element) {
	     bulleStyle=element.style;
		 element.innerHTML=txt;
	  }
			 	
	  if(bulleStyle) {
	     /* on met la bulle ˆ gauche du pointeur (si c'est possible) 
	        et en haut du pointeur si on est assez bas dans l'Žcran */
					
	    if (xfenetre > bulleWidth+offset) xpage=xpage-bulleWidth-offset;
	    else xpage=xpage+15;
	    if ( yfenetre > hauteur+offset ) ypage=ypage-hauteur-offset;
	    bulleStyle.width=bulleWidth;  
		if(typeof(bulleStyle.left)=='string') {
			 bulleStyle.left=xpage+'px'; bulleStyle.top=ypage+'px';  
		} else {
			bulleStyle.left=xpage     ; bulleStyle.top=ypage ; 
		}
	    bulleStyle.visibility="visible"; 
	  }
	}
	
	function cacher_bulle(){
		if(bulleStyle)  bulleStyle.visibility="hidden";   
	}
				
	
	
	function gotoAncre(url){
		window.location = url;
	
	}
	
	function isInt(myNum) {
         // get the modulus: if it's 0, then it's an integer
         return (myNum % 1) == 0;
	}
	
	function isDate(mystr){
		array = mystr.split("/");
		if(array==null || array.length!=3){
			return false;
		}
		day = array[1];
		month = array[1];
		year = array[2];
		return isInt(day) && isInt(month) && isInt(year);
	}
	
	function calendar1(cible,url){
		openPopup(url+'?cible=' + cible,200, 180, false	);
	}

	function calendar2( cible , dateAller,url){
		if (!isDate(dateAller)) {
			return calendar1(cible,url);
		}
		// recherche du moi et de l'annee de la Date Aller pour positionnement du calendrier pour le Retour
		array = dateAller.split("/");
		month = array[1];
		year = array[2];
		openPopup(url+'?cible='+cible+'&month='+array[1]+'&year='+array[2],200, 180, false);
	}

	// NTN: remplace dans la chaine expr la chaine a par la chaine b
		function remplace(expr,a,b)
		{
			var i=0
			while (i!=-1) {
				i=expr.indexOf(a,i);
				if (i>=0) {
				expr=expr.substring(0,i)+b+expr.substring(i+a.length);
				i+=b.length;
				}
			}
			return expr;
		}

	// NTN: fonction permettant de retirer tous les accents, trema, ds la chaine passée en parametre
		function parseCaracteresSpeciaux(val)
		{
			// mappe les accents et trema et les retire
			val=remplace(val,'ç','c');
			val=remplace(val,'â','a');
			val=remplace(val,'à','a');
			val=remplace(val,'ä','a');
			val=remplace(val,'ã','a');
			val=remplace(val,'é','e');
			val=remplace(val,'è','e');
			val=remplace(val,'ê','e');
			val=remplace(val,'ë','e');
			val=remplace(val,'î','i');
			val=remplace(val,'ï','i');
			val=remplace(val,'ì','i');
			val=remplace(val,'û','u');
			val=remplace(val,'ü','u');
			val=remplace(val,'ù','u');
			val=remplace(val,'ô','o');
			val=remplace(val,'ö','o');
			val=remplace(val,'ò','o');
			val=remplace(val,'õ','o');

			return val;
		}

		
		

// NTN PP510 : cette méthode DOM permet de récupérer l'ensemble des inputs (de type text, hidden et select uniquement)
// et créé l'url (encodée) d'appel de la popup permettant de valider le formulaire.
// Note: si modification du formulaire, si des composants HTML autres que input text, input hidden et select sont ajoutés,
// il faut ajouter la détection de ceux ci dans l'algo ci-dessous.
function valideFormAvecOuSansPopup(formId) {
	// récupération de l'objet formulaire
	var formObj = document.getElementById(formId);
	try {
		// récupération de tous les enfants DOM du form
		var listeChildrenForm = formObj.childNodes;
		var typetagInput;
		var attrInput;
		var premierParamIsSet = false;
		var debutUrl = formObj.action;
		debutUrl += "?";
		var url = "";
		var protection = 0;
		var profondeur = 0;
		var debug = "";
		function _subConstruitURL(url,domTree) {
			// en cas de boucle infinie, on arrete tout et on continue dans la iframe... sans cadenas mais bon... :-(
			protection++;
			if (protection>250) {
				throw "Trop de récursions: "+protection;
				return;
			}
			for (var i=0;i<domTree.length;i++) {
				// debug
				for (var j=0;j<profondeur;j++) debug += "-";
				// pour chaque fils, on va récupérer le type de tag
				var inode = domTree.item(i);
				attrInput = "";
				typetagInput = inode.tagName;
				if (typetagInput == "INPUT")
					attrInput = inode.getAttribute('TYPE');
				if (inode.hasChildNodes() && typetagInput.toLowerCase() != "select") { // attention aux inputs complexes
					profondeur++;
					url = _subConstruitURL(url,inode.childNodes); // appel récursif pour parcourir toute l'arborescence de l'arbre dom de form
				}
				else {
					// si le tag est définie
					if (typetagInput != "undefined" && typetagInput != null && typetagInput != "") {
						// s'il s'agit d'un input text ou d'un select, construction de l'url
						if (typetagInput.toLowerCase() == "input" && attrInput.toLowerCase() == "text"
							|| typetagInput.toLowerCase() == "input" && attrInput.toLowerCase() == "hidden"
							|| typetagInput.toLowerCase() == "select") { // c'est ici qu'il faut ajouter la détection d'autres élements
							//alert(url);
							debug += typetagInput;
							debug += "\n";
							if (premierParamIsSet) 
								url += "&";
							url += inode.name;
							url += "=";
							url += encodeURIComponent(inode.value); // il ne faut pas oublier d'urlencoder!!
							premierParamIsSet = true;
						}
					}
				}
			}
			profondeur--;
			return(url);
		}
		url = debutUrl+_subConstruitURL(url,listeChildrenForm);
		// ouverture de la popup
		//alert(debug); // debug pour voir l'arbre dom qu'à cu l'algorithme
		//alert(url); // debug
		openPopup(url,975, 835, true , true);
	}
	catch (e) {
		// si il y a eu le moindre problème, on continue dans la iframe, pour ne pas bloquer la réservation
		//alert("Impossible d'ouvrir la popup.\nOn continue dans la iframe.\n"+e); // debug
		formObj.submit();
	}
}
		