String.prototype.trim = function() {
temp = this;
while (escape(temp).indexOf('%u2018') > -1)
   { 
   temp = escape(temp).replace('%u2018', '%27');
   temp = unescape(temp);
   }
return temp.replace(/^\s*/,"").replace(/\s*$/,"").replace("’","'").replace("–","-")
}

function Imprimer(){
	if (window.print) window.print();
	else alert('Votre navigateur ne suporte pas le format pour impression.');
	return false;
}

function OuvrirEnvoyerAUnAmi(langue)
   {
   EnvoyerAmi = open('', 'EnvoyerAmi', 'resizable=no,scrollbars=no,status=no,menubar=no,' + StringGrandeur(500,465));
   document.DonneesImprimer.action = 'demandeDEnvoyerAUnAmi' + langue + '.php';
   document.DonneesImprimer.target = 'EnvoyerAmi';
   document.DonneesImprimer.submit();
   window.setTimeout('EnvoyerAmi.focus();', 100);
   } 
   
function OuvrirEvaluerCettePage(langue)
   {
   EvaluerCettePage = open('', 'EvaluerCettePage', 'resizable=no,scrollbars=no,status=no,menubar=no,' + StringGrandeur(320,430));
   document.DonneesImprimer.action = 'demandeDEvaluerCettePage' + langue + '.php';
   document.DonneesImprimer.target = 'EvaluerCettePage';
   document.DonneesImprimer.submit();
   window.setTimeout('EvaluerCettePage.focus();', 100);
   }    
   
function OuvrirSalonImage(noSalonImage, langue){
   WindowVideo = open('evenementsPhotosPop' + langue + '.php?noSalonImage=' + noSalonImage, 'ImageSalon', 'scrollbars=no,status=yes,' + StringGrandeur(500,430));
   WindowVideo.focus();	   
   };
function OuvrirGrandeImage(page)
   {
   WindowGrandeImage = open(page, 'WindowGrandeImage', 'resizable=no,scrollbars=no,status=no,menubar=no,width=670,height=535,left=0,top=0,screenX=0,screenY=0');
   WindowGrandeImage.focus();
   }    

//Script pour affichage des boites d'infos à droite
var info = new Array(true, true, true, true, true);
function ouvrirInfo(no)
{
	if(info[no-1] == true){	
	    //Ferme
		new Effect.SlideUp('infoDroite_block'+no, {duration:.4});
		info[no-1] = false;
	}else{
	    //Ouvre	
		new Effect.SlideDown('infoDroite_block'+no, {duration:.4});
		info[no-1] = true;
	}
}

//Script pour le menu
//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["menuHaut"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
		 setTimeout("buildsubmenus_horizontal2('" + g_lang + "')",1000);
}

function buildsubmenus_horizontal2(lang){
var image_menu = "images/bg_menu" + lang + ".gif";
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
		if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
		else //else if this is a sub level submenu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
		  var tagLiNiveau2=ultags[t].parentNode.getElementsByTagName("ul")[0].getElementsByTagName("li")//pointe vers chaque li de deuxieme niveau pour pouvoir leur dire de dire au li de premier niveau de changer sa position de background
		  for(var l=0; l<tagLiNiveau2.length;l++){
			  switch(tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.id){
				  case "menu317":
				      //cette section gere le rollover du bouton de premier niveau
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseover=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -33px";
					  this.getElementsByTagName("ul")[0].style.display="block"
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseout=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -33px";
					  this.getElementsByTagName("ul")[0].style.display="none"
					  }
				  	  //cette section s'occupe de garder le premier niveau du menu a l'état roll
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseover=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -33px";
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseout=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -33px";
					  }
					  break;
				  case "menu318":
				  	  //cette section gere le rollover du bouton de premier niveau
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseover=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -57px";
					  this.getElementsByTagName("ul")[0].style.display="block"
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseout=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -57px";
					  this.getElementsByTagName("ul")[0].style.display="none"
					  }
				  	  //cette section s'occupe de garder le premier niveau du menu a l'état roll
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseover=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -57px";
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseout=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -57px";
					  }
					  break;
				  case "menu319":
				  	  //cette section gere le rollover du bouton de premier niveau
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseover=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -81px";
					  this.getElementsByTagName("ul")[0].style.display="block"
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseout=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -81px";
					  this.getElementsByTagName("ul")[0].style.display="none"
					  }
				      //cette section s'occupe de garder le premier niveau du menu a l'état roll
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseover=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -81px";
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseout=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -81px";
					  }
					  break;
				  case "menu320":
				      //cette section gere le rollover du bouton de premier niveau
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseover=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -105px";
					  this.getElementsByTagName("ul")[0].style.display="block"
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseout=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -105px";
					  this.getElementsByTagName("ul")[0].style.display="none"
					  }
				      //cette section s'occupe de garder le premier niveau du menu a l'état roll
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseover=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -105px";
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseout=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -105px";
					  }
					  break;
				  case "menu321":
				  	  //cette section gere le rollover du bouton de premier niveau
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseover=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -129px";
					  this.getElementsByTagName("ul")[0].style.display="block"
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].parentNode.parentNode.parentNode.onmouseout=function(){
					  this.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -129px";
					  this.getElementsByTagName("ul")[0].style.display="none"
					  }
				      //cette section s'occupe de garder le premier niveau du menu a l'état roll
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseover=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll 0px -129px";
					  }
					  tagLiNiveau2[l].getElementsByTagName("a")[0].onmouseout=function(){
						  this.parentNode.parentNode.parentNode.getElementsByTagName("a")[0].style.background="transparent url(" + image_menu+ ") no-repeat scroll -164px -129px";
					  }
					  break;
		  	  }
		  }
    }
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
		ultags[t].style.visibility="visible"
		ultags[t].style.display="none"
		}
  }
}

function StringGrandeur (width, height)
   {
   var string = 'width=' + width + ',height=' + height + ',left=' + ((screen.width - width) / 2) + ',top=' + ((screen.height - height) / 2) + ',screenX=' + ((screen.width - width) / 2) + ',screenY=' + ((screen.height - height) / 2);
   return string;
   }
   
function ValiderNewsletter(lang)
   {    
   obj = document.DonneesNewsletter.courriel;
   if (!ValiderCourriel(obj.value, lang) || (obj.value == 'nom@domaine.com') || (obj.value == 'name@domaine.com'))
      {
      obj.focus();
      return false;
      }	  
   return true;
   }
   
function ValiderSondage(lang)
   {    
   i = 0;
   cocheQuelqueChose = false;
   while (i < document.DonneesSondage.noReponse.length)
      {
      if (document.DonneesSondage.noReponse[i].checked == true)
         {
         cocheQuelqueChose += 1;
         }
      i = i + 1;
      }
	  
   if (!cocheQuelqueChose)
      {
      alert('Vous devez indiquer votre réponse.');
      window.setTimeout('document.DonneesSondage.noReponse[1].focus();', 100);
      return false;
      }		 
	   
	  
   return true;
   }   

function ValiderCourriel(valeur, langue)
   {
   var stringErreur = '';
   var nAccepte = 'abcdefghijklmnopqrstuvwxyz0123456789-_.@';
   var nChar;
   valeur = valeur.toLowerCase();
   valeur = valeur.trim();  
   var indexOfArobas     = valeur.indexOf('@');
   var indexOf2Arobas    = valeur.lastIndexOf('@');
   var lastIndexOfPoint  = valeur.lastIndexOf('.');
   var indexOf2Point     = valeur.indexOf('..');
   var valeurLength      = valeur.length;		
   var indexOfEspace     = valeur.indexOf(' ');   
   
   if (indexOfEspace     != -1)
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail must not contain any spaces.';   
      else
	  	  stringErreur = 'Votre courriel doit pas contenir d\'espace.';   
   if (indexOfArobas     < 0)
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail must contain an @ character.';   
      else
	  	  stringErreur = 'Votre courriel doit contenir un arobas (@).';
   if (indexOfArobas     == 0)
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail must have at least one character in front of the @ character.';   
      else
	  	  stringErreur = 'Votre courriel doit avoir un minimum d\'un caractère avant l\'arobas (@).';		  
   if (lastIndexOfPoint     < (indexOfArobas + 1))
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail must contain at least one dot (.) after the @ character.';   
      else
	  	  stringErreur = 'Votre courriel doit contenir au moins un point (.) après l\'arobas (@).';
   if (lastIndexOfPoint     == valeurLength-1)
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail must not end with a dot (.).';   
      else
	  	  stringErreur = 'Votre courriel ne peut se terminer par un point (.).';		  
   if (indexOf2Arobas       != indexOfArobas)
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail must only have one @ character.';   
      else
	  	  stringErreur = 'Votre courriel doit contenir seulement un arobas (@).';	  
   if (indexOf2Point       != -1)
      if (langue == '_ang')
	  	  stringErreur = 'Your e-mail cannot have two dots (..) in a row.';   
      else
	  	  stringErreur = 'Votre courriel ne peut pas contenir 2 points de suite (..).';
   if (stringErreur == '')
      {       
      for (var i=0; i<valeur.length; i++)
         {
         nChar = '' + valeur.substring(i, i+1).toLowerCase();
         if (nAccepte.indexOf(nChar) == -1){		
                if (langue == '_ang')
                   stringErreur = 'Your e-mail contains the (' + valeur.substring(i, i+1) + ') which is not a valid character for an e-mail.';   
                else
                   stringErreur = 'Votre courriel contient le caractère (' + valeur.substring(i, i+1) + ') qui n\'est pas un caractère valide dans un courriel.';
				i = valeur.length;
			}
         }  
      }
   if (stringErreur == '')
      return true;   	
   else
   	  {
      if (langue == '_ang')
         alert(stringErreur + '\nHere is an example of a valid e-mail: name@domain.com');
      else
         alert(stringErreur + '\nVoici l\'exemple d\'un courriel valide : nom@domaine.com');
	    return false;	  
	  }      
   }

function TraiterCollection(obj, event){
		 obj2 = document.getElementById(obj + 'On');
		 obj3 = document.getElementById(obj);		 
		 if (event.type == 'click'){		 
		        lien = "";
				if (g_lang == '_ang'){				
                    switch (obj) {
                    	case "colClassique":
                    		 lien = 'bath-361-our-collections-classique.php';
                    	break;
                    	case 'colEstime':
                    		 lien = 'bath-362-our-collections-estime.php';
                    	break;
                    	case 'colHarmonie':
                    		 lien = 'bath-363-our-collections-harmony.php';
                    	break;
                    	case 'colElegance':
                    		 lien = 'bath-364-our-collections-elegance.php';
                    	break;
                    	case 'colEntree':
                    		 lien = 'bath-365-our-collections-entree.php';
                    	break;		
                    	case 'colDouches':
                    		 lien = 'bath-366-our-collections-shower.php';
                    	break;														
                    }	
				}
				else{
                    switch (obj) {
                    	case "colClassique":
                    		 lien = 'bain-361-nos-collections-classique.php';
                    	break;
                    	case 'colEstime':
                    		 lien = 'bain-362-nos-collections-estime.php';
                    	break;
                    	case 'colHarmonie':
                    		 lien = 'bain-363-nos-collections-harmonie.php';
                    	break;
                    	case 'colElegance':
                    		 lien = 'bain-364-nos-collections-elegance.php';
                    	break;
                    	case 'colEntree':
                    		 lien = 'bain-365-nos-collections-entree.php';
                    	break;		
                    	case 'colDouches':
                    		 lien = 'bain-366-nos-collections-douches.php';
                    	break;														
                    }				
				}	

				
				window.location = lien;
		 }
		 else if (event.type == 'mouseover'){
		 	 obj3.style.display = 'none';
		 	 obj2.style.display = 'block';			 
		 }
		 else if (event.type == 'mouseout'){
		 	 obj3.style.display = 'block';
		 	 obj2.style.display = 'none';		 
		 }		 
		 return false;
}

function ValiderRecherche(langue, formulaire)
   {
   formulaire = eval(formulaire)
   formulaire.recherche.value = formulaire.recherche.value.trim();
   if ((formulaire.recherche.value.length < 4) || (formulaire.recherche.value == 'Rechercher') || (formulaire.recherche.value == 'Search'))
      {
	  if (langue == '_ang')
      	 alert('You must enter at least 4 characters\nEx.: Shower, Accessory, Retailer, Employment');
	  else
      	 alert('Vous devez entrer un minimum de 4 caractères.\nEx.: Douche, Accessoire, Détaillant, Emploi');	  
      formulaire.recherche.focus();
      return false;
      }
   return true;
   }
   
function OuvrirFenetre(page, largeur, hauteur)
   {
   WindowFenetre = open(page, 'WindowFenetre', 'resizable=no,scrollbars=yes,status=yes,menubar=no,' + StringGrandeur(largeur,hauteur));
   WindowFenetre.focus();
   }   
   
function OuvrirFenetre2(page, largeur,hauteur)
   {
   WindowFenetre2 = open(page, 'WindowFenetre2', 'resizable=no,scrollbars=no,status=no,menubar=no,' + StringGrandeur(largeur,hauteur));
   WindowFenetre2.focus();
   }      