List_combo = new Array();

function RemplirCombo(champ,libelle,valeur,division,classe){
	var sel="";
	sel ="<select  name='"+champ+"' id='"+champ+"'   OnChange=\"RemplirComboo('sltssfam','Toutes les SSfamille',sltfam.value,sltsfam.value,'divssfam','"+classe+"');\" style='margin:1px;font-size: 10px;height:18px;color: #000;width:220px;background-color: #F7F7F7;border:1px solid #E9EEF5;'>";
		// Parcourir le tableau
		sel= sel + "<option value=0>"+libelle+"</option>";
		for (var i=0;i<List_combo.length;i++){
		  // tester si la ligne du tableau (Sous-cat?gorie) correspond r la valeur de la cat?horie
		  if (List_combo[i][1]==valeur){
			// Ajouter une rubrique sous-cat?gorie au variable SEL
			sel= sel + "<option value="+List_combo[i][0]+">"+List_combo[i][2]+"</option>";
		  }
		}
	sel=sel+"</select>";
	// Modifier le DIV scat par la nouvelle List r partir du variable SEL
	obj(division).innerHTML=sel;
}


List_combo_ = new Array();
function RemplirCombo_(champ,libelle,valeur,division,classe){
	var sel="";
	sel ="<select  name='"+champ+"' id='"+champ+"'  style='margin:1px;font-size: 10px;height:18px;color: #000;width:130px;background-color: #F7F7F7;border:1px solid #E9EEF5;'>";
		// Parcourir le tableau
		sel= sel + "<option value=0>"+libelle+"</option>";
		for (var i=0;i<List_combo_.length;i++){
		  // tester si la ligne du tableau (Sous-cat?gorie) correspond r la valeur de la cat?horie
		  if (List_combo_[i][1]==valeur){
			// Ajouter une rubrique sous-cat?gorie au variable SEL
			sel= sel + "<option value="+List_combo_[i][0]+">"+List_combo_[i][2]+"</option>";
		  }
		}
	sel=sel+"</select>";
	// Modifier le DIV scat par la nouvelle List r partir du variable SEL
	obj(division).innerHTML=sel;
}


List_comboo = new Array();
function RemplirComboo(champ,libelle,valeur1,valeur2,division,classe){
	var sel="";
	sel ="<select  name='"+champ+"' id='"+champ+"'  OnChange=\"RemplirCombooo('sltsssfam','Toutes les SSSfamille',sltsfam.value,sltssfam.value,'divsssfam','"+classe+"');\" style='margin:1px;font-size: 10px;height:18px;color: #000;width:220px;background-color: #F7F7F7;border:1px solid #E9EEF5;'>";
		// Parcourir le tableau
		sel= sel + "<option value=0>"+libelle+"</option>";
		for (var i=0;i<List_comboo.length;i++){
		  // tester si la ligne du tableau (Sous-cat?gorie) correspond r la valeur de la cat?horie
		  if (List_comboo[i][0]==valeur1 && List_comboo[i][1]==valeur2){
			// Ajouter une rubrique sous-cat?gorie au variable SEL
			sel= sel + "<option value="+List_comboo[i][2]+">"+List_comboo[i][3]+"</option>";
		  }
		}
	sel=sel+"</select>";
	// Modifier le DIV scat par la nouvelle List r partir du variable SEL
	obj(division).innerHTML=sel;
	//alert(sel);
}

List_combooo = new Array();
function RemplirCombooo(champ,libelle,valeur1,valeur2,division,classe){
	var sel="";
	sel ="<select  name='"+champ+"' id='"+champ+"' style='margin:1px;font-size: 10px; height:18px; color: #000;width:220px;background-color: #F7F7F7;border:1px solid #E9EEF5;'>";
		// Parcourir le tableau
		sel= sel + "<option value=0>"+libelle+"</option>";
		for (var i=0;i<List_combooo.length;i++){
		  // tester si la ligne du tableau (Sous-cat?gorie) correspond r la valeur de la cat?horie
		  if (List_combooo[i][0]==valeur1 && List_combooo[i][1]==valeur2){
			// Ajouter une rubrique sous-cat?gorie au variable SEL
			sel= sel + "<option value="+List_combooo[i][2]+">"+List_combooo[i][3]+"</option>";
		  }
		}
	sel=sel+"</select>";
	// Modifier le DIV scat par la nouvelle List r partir du variable SEL
	obj(division).innerHTML=sel;
	//alert(sel);
}

function isExtsAllowed(path) {
	var lastDot = path.lastIndexOf("."); //index of last dot, the extension will follow this dot
	if(lastDot != 1) { //if we found a dot, that means we have an extension
		var fileExts = path.substring(lastDot + 1, path.length).toLowerCase();
		//loop through array of allowed extensions and check if this one is allowed
		for(var i = 0; i < allowedExts.length; i++) {
			//alert (fileExts);
			if(fileExts == allowedExts[i]) //if the extension is in the list of allowed
				return true;
		}
	}
	
	return false;
}

function chawaib(chaine){
	var chawa=new RegExp("'", "g");
	return chaine.replace(chawa,"\'")
}

function cacher(objet){
	document.getElementById(objet).style.visibility='hidden';	
	document.getElementById(objet).style.display='none';
}


//FONCTION POUR AGRANDIR UNE IMAGE
	function agrandir_photo(chemin,photo){
		window.open(chemin+photo)	
	}

function getHTTPObject() {
	var xmlhttp;
	if (navigator.appName=="Microsoft Internet Explorer")
		var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
		//il faut remplacer "Microsoft.XMLHTTP" par "Msxml2.XMLHTTP.5.0" pour eviter l'erreur system : 1072896748 
		//pour les actentues : test r ussi est valid		
	else 	
		var xmlhttp = new XMLHttpRequest();  

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
      } catch (e) {
      	xmlhttp = false;
      }
    }
  return xmlhttp;
}

var http = getHTTPObject();

function setCheckboxColumn(theCheckbox){
    if (document.getElementById(theCheckbox)) {
        document.getElementById(theCheckbox).checked = (document.getElementById(theCheckbox).checked ? false : true);
        if (document.getElementById(theCheckbox + 'r')) {
            document.getElementById(theCheckbox + 'r').checked = document.getElementById(theCheckbox).checked;
        }
    } else {
        if (document.getElementById(theCheckbox + 'r')) {
            document.getElementById(theCheckbox + 'r').checked = (document.getElementById(theCheckbox +'r').checked ? false : true);
            if (document.getElementById(theCheckbox)) {
                document.getElementById(theCheckbox).checked = document.getElementById(theCheckbox + 'r').checked;
            }
        }
    }
}


//POUR AFFICHER UNE GRANDE IMAGE SOUS FORME D'UNE POPUS
function PopupImage(img,largeur,hauteur) { 
	w=open("",'image','weigth=toolbar=no,scrollbars=no,resizable=no, width='+largeur+', height='+hauteur+', left=200, top=100'); 
	w.document.write("<HTML><BODY topmargin='0px' bottommargin='0px'   leftmargin='0px' rightmargin='0px' onblur=\"window.close();\"><IMG src="+img+">"); 		
	w.document.write("</BODY></HTML>"); 
	w.document.close(); 
} 
function PopupImage1(img,largeur,hauteur) { 
	w=open("",'image','weigth=toolbar=no,scrollbars=yes,resizable=no, width='+largeur+', height='+hauteur+', left=200, top=100');
	w.document.write("<HTML><BODY topmargin='0px' bottommargin='0px'   leftmargin='0px' rightmargin='0px' onblur=\"window.close();\"><IMG src="+img+">"); 		
	w.document.write("</BODY></HTML>"); 
	w.document.close(); 
} 

//POUR AFFICHER UNE GRANDE IMAGE SAUS UNE AUTRE PAGE WEB NOT A POPUS
function grande(liencontrol,imgcontrol){	
	v=document.getElementById(liencontrol)
	v.target="_blank"
	v1=document.getElementById(imgcontrol).src
	//v1=v1.replace('petites','grandes')
	v.href=v1
}	

function changeImages(name,image) {
	document.images[name].src=image
}

function mailtooo(email,titre){
	chaine_mail = "mailto:"+email+"?subject=" + titre;      
	chaine_mail += "&body="; 
	chaine_mail += ""; location.href = chaine_mail;     
} 

function messages(champs,libelle){
	if (document.getElementById(champs).value==""){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Le champs <span style='text-decoration:underline;font-weight:bold'>"+libelle+"</span> ne doit pas  être une chaine vide "
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}

function messages_login(champs,libelle){
	if (document.getElementById(champs).value==""){
		alert("Le champ "+libelle+" ne doit pas être une chaine vide !")
		document.getElementById(champs).focus()		
		return false
	}
}

var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

function checkmail(champs,libelle){
	
	if ( !filter.test(document.getElementById(champs).value) ){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="L'adresse email du champ <span style='text-decoration:underline;font-weight:bold'>"+libelle+"</span> n'est pas valide "
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}

function checkdate(champs,libelle){
	if(!isDate(document.getElementById(champs).value)  ) {
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Le format de la date du champs "+libelle+" n'est pas valide (ex: 31-02-2007) "
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}
function checkdate_2(champs,libelle){
	if(!isDate(document.getElementById(champs).value)  ) {
		//document.getElementById('id_validation').style.visibility='visible'
		alert("Le format de la date du champs "+libelle+" n'est pas valide (ex: 31-02-2007) ")
		document.getElementById(champs).focus()
		return false
	}else{
		//document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}
function comparerdates(champ1,champ2,chaine1,chaine2){
	var reg=new RegExp("/", "g");
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si galit , 1 si la premire est sup rieure, sinon 2
	
	date1=document.getElementById(champ1).value.replace(reg,"-")
	date2=document.getElementById(champ2).value.replace(reg,"-")
	
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");

	date1 = Date.parse(date1);
	date2 = Date.parse(date2);

	//if (date1 == date2) { return true;}
	if (date1 > date2){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML=chaine1+ " doit tre inf rieure ou gal (<=)   "+chaine2
		document.getElementById(champ2).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}

}
function comparerdates_2(champ1,champ2,chaine1,chaine2){
	var reg=new RegExp("/", "g");
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2
	
	date1=document.getElementById(champ1).value.replace(reg,"-")
	date2=document.getElementById(champ2).value.replace(reg,"-")
	
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");

	date1 = Date.parse(date1);
	date2 = Date.parse(date2);
	
	//if (date1 == date2) { return true;}
	if (date1 > date2){
		//document.getElementById('id_validation').style.visibility='visible'
		alert(chaine1+ " doit etre inférieure (<)  "+chaine2)
		document.getElementById(champ2).focus()
		return false
	}else{
		//document.getElementById('id_validation').style.visibility='hidden'
		return true
	}

}

function dato(date,sep){
	var elem = date.split(sep); 
	jour = elem[0]; 
	mois = elem[1]; 
	annee = elem[2]; 
	return annee+"/"+mois+"/"+jour
}

function dateact(date1,date2,chaine){
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si galit , 1 si la premire est sup rieure, sinon 2
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");

	date1 = Date.parse(date1);
	date2 = Date.parse(date2);

	//if (date1 == date2) { return true;}
	if (date1 > date2){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML=chaine + " doit tre sup rieure ou gal (>=)   la date d'ajourd'hui"
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}

}

function DateSystem (){
		d= new Date();
		d.setDate(d.getDate());
		strDay = (d.getDate()<10?"0":"")+d.getDate();
		month = d.getMonth()+1;
		strMonth = (month<10?"0":"")+month;
		strDate = ""+strDay+"-"+strMonth+"-"+d.getFullYear();	
		return strDate;
}

function isDate(d) {
	var reg=new RegExp("/", "g");
	d=d.replace(reg,"-")
	// Cette fonction permet de vrifier la validit  d'une date au format jj/mm/aa ou jj/mm/aaaa
	// Par Romuald
	
	if (d == "") // si la variable est vide on retourne faux
		return false;
	
	e = new RegExp("^[0-9]{1,2}\-[0-9]{1,2}\-([0-9]{2}|[0-9]{4})$");
	
	if (!e.test(d)) // On teste l'expression rguli re pour valider la forme de la date
		return false; // Si pas bon, retourne faux

	// On spare la date en 3 variables pour v rification, parseInt() converti du texte en entier
	j = parseInt(d.split("-")[0], 10); // jour
	m = parseInt(d.split("-")[1], 10); // mois
	a = parseInt(d.split("-")[2], 10); // anne

	// Si l'ann e n'est compose que de 2 chiffres on compl te automatiquement
	if (a < 1000) {
		if (a < 89)	a+=2000; // Si a < 89 alors on ajoute 2000 sinon on ajoute 1900
		else a+=1900;
	}

	// Dfinition du dernier jour de f vrier
	// Anne bissextile si annn e divisible par 4 et que ce n'est pas un sicle, ou bien si divisible par 400
	if (a%4 == 0 && a%100 !=0 || a%400 == 0) fev = 29;
	else fev = 28;

	// Nombre de jours pour chaque mois
	nbJours = new Array(31,fev,31,30,31,30,31,31,30,31,30,31);

	// Enfin, retourne vrai si le jour est bien entre 1 et le bon nombre de jours, idem pour les mois, sinon retourn faux
	return ( m >= 1 && m <=12 && j >= 1 && j <= nbJours[m-1] );
}

function visibilite(thingId){
	var targetElement;
	targetElement = document.getElementById(thingId) ;
	if (ancien!=""){
		document.getElementById(ancien).style.display = "none"
		document.getElementById(ancien).style.visibility = "hidden"
	}
	if (targetElement.style.display == "none"){
		targetElement.style.display = "" ;
		targetElement.style.visibility = "visible" ;
	} else {
		targetElement.style.display = "none" ;
		targetElement.style.visibility = "hidden" ;
	}
	ancien=thingId

}



/*
* Le code suivant va apprendre la balise blink   IE
*/
if ( document.all )
{
	function blink_show()
	{
		blink_tags  = document.all.tags('blink');
		blink_count = blink_tags.length;
		for ( i = 0; i < blink_count; i++ )
		{
			blink_tags[i].style.visibility = 'visible';
		}
		
		window.setTimeout( 'blink_hide()', 700 );
	}
	
	function blink_hide()
	{
		blink_tags  = document.all.tags('blink');
		blink_count = blink_tags.length;
		for ( i = 0; i < blink_count; i++ )
		{
			blink_tags[i].style.visibility = 'hidden';
		}
		
		window.setTimeout( 'blink_show()', 250 );
	}
	
	window.onload = blink_show;
}


function imprime_zone(titre, obj) {
	// Dfinie la zone   imprimer
	var zi = document.getElementById(obj).innerHTML;

	// Ouvre une nouvelle fenetre
	var f = window.open("", "ZoneImpr", "height=500, width=600,toolbar=0, menubar=0, scrollbars=1, resizable=1,status=0, location=0, left=10, top=10");
	
	// Ajoute les Donnes
	f.document.title = titre;

	f.document.body.innerHTML += " " + zi + "	";

	// Imprime et ferme la fenetre
	f.window.print();
	f.window.close();
	return true;
} 


//Function pour r cuperer la valeur d'un element radio d'un groupe
function radioCliked(form,champ) { 
var r = false; 
var d = document.getElementById(form); 

for(var i=0; i<d.length; i++) { 

   for(var k=0; k<d.length; k++) { 
     if(d[k].type=='radio' && d[k].name==champ) { 
       for(var j=0; j<d[champ].length; j++) 
       if(d[champ][j].checked) 
          r = d[champ][j].value; 
       } 
     } 


} 



	return r?r:0; 
} 

function obj(champs){
	return document.getElementById(champs)
	}
function remplacer(chaine1,chaine2,champs){
	var reg=new RegExp(chaine1, "g");
	return document.getElementById(champs).value.replace(reg,chaine2)
	}
	
function adad(champs,libelle){
	if (isNaN(document.getElementById(champs).value) || eval(document.getElementById(champs).value==0)){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Le champs "+libelle+" n'est pas une valuer numérique !"
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}
function adad_posit(champs,libelle){
	if (isNaN(document.getElementById(champs).value) || eval(document.getElementById(champs).value<=0)){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Le champs "+libelle+" n'est pas une valuer numérique !"
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}

function adad_(champs,libelle){
	if (isNaN(document.getElementById(champs).value)){
		alert("Le champs "+libelle+" n'est pas une valuer numérique !")
		document.getElementById(champs).value=""
		document.getElementById(champs).focus()
		
		return false
	}else{
		//document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}

function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
	if (theAction=='over'){
		if (document.getElementById(theRow).className!=theMarkColor)
			document.getElementById(theRow).className=thePointerColor
	}
	if (theAction=='out'){
		if (document.getElementById(theRow).className!=theMarkColor)
			document.getElementById(theRow).className=theDefaultColor
	}
	if (theAction=='click'){
		if (document.getElementById(theRow).className!=theMarkColor){
			document.getElementById(theRow).className=theMarkColor
		}else{
			document.getElementById(theRow).className=thePointerColor			
		}
			
	}
	
	return true
} // end of the 'setPointer()' function


function longchaine(champs,libelle,longeur){	
	if (document.getElementById(champs).value.length<longeur){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Le champs "+libelle+" doit avoir au moins "+longeur+" caractères"
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}
/////////
function Voir_offre(codehot,Prixhot,type){
	//alert(codehot+","+Prixhot+","+type)
	obj('actions').value="dethotel"	 
	obj('txtcodehot').value=codehot	
	obj('txtPrxhot').value=Prixhot	 
	obj('formvoy').method="post"	
	if(type=='hotels')
		obj('formvoy').action="fiche_hot_mar.php"
	if(type=='sejours')
		obj('formvoy').action="fiche_sejour.php"		
	if(type=='circuits')
		obj('formvoy').action="fiche_circuit.php"		
	if(type=='voiture')
		obj('formvoy').action="fiche_reservation_voiture.php"			
	if(type=='voyages')
		obj('formvoy').action="fiche_voyages_organises.php"			
	if(type=='omra')
		obj('formvoy').action="fiche_omra.php"			
	obj('formvoy').submit()	 
}
function Reservation(codehot,Prixhot,type){
	//alert(codehot+","+Prixhot+","+type)
	obj('actions').value="dethotel"	 
	obj('txtcodehot').value=codehot	
	obj('txtPrxhot').value=Prixhot	 
	obj('formvoy').method="post"	
	
		obj('formvoy').action="fiche_reservation_hot_mar.php"	 	
	obj('formvoy').submit()	 
}
function ReservationH(type,total){	
if(type=='hotels'){
 if(total<=0){
 	alert('Chambre Non disponible, Veuillez choisir une autre date.')
	return false
 }
		obj('form1').method="post"
		obj('form1').action="fiche_reservation_hot_mar.php"
		obj('form1').submit()
}
if(type=='hotels_etr'){
 if(total<=0){
 	alert('Chambre Non disponible, Veuillez choisir une autre date.')
	return false
 }
 document.getElementById('Mes_id').style.display='block';
	document.getElementById('Mes_id').innerHTML=Message
	document.getElementById('fade').style.display='block';
	
		obj('form1').method="post"
		obj('form1').action="fiche_reservation_hot_etr.php"
		obj('form1').submit()
		
		document.getElementById('Mes_id').style.display='block';
	document.getElementById('Mes_id').innerHTML=Message
	document.getElementById('fade').style.display='block';
	
}
	}

function ReservationH_xml(codehot,type){	
 
 obj('actions').value="dethotel"	 
	obj('txtcodehotXml').value=codehot	
	  obj('NTypeXml').value=type
	
 document.getElementById('Mes_id').style.display='block';
	document.getElementById('Mes_id').innerHTML=Message
	document.getElementById('fade').style.display='block';
	
		obj('formvoy').method="post"
		obj('formvoy').action="fiche_reservation_hot_etr.php"
		obj('formvoy').submit()
		
		document.getElementById('Mes_id').style.display='block';
	document.getElementById('Mes_id').innerHTML=Message
	document.getElementById('fade').style.display='block';
	
 
	}


function Reservation_Circuits(NPer,Nlign){
	 
	obj('actions').value="rescircuits"	 
	obj('txtNPeride').value=NPer
	obj('txtNLgnRes').value=Nlign
	obj('form1').method="post"		
	obj('form1').action="fiche_reservation_circuit.php"	 	
	obj('form1').submit()	 
}function Reservation_Omra(NPer,Nlign){
	 
	obj('actions').value="resomra"	 
	obj('txtNPeride').value=NPer
	obj('txtNLgnRes').value=Nlign
	obj('form1').method="post"		
	obj('form1').action="fiche_reservation_omra.php"	 	
	obj('form1').submit()	 
}

function Reservation_voyages_organises(NPer,Nlign){
	 
	obj('actions').value="rescircuits"	 
	obj('txtNPeride').value=NPer
	obj('txtNLgnRes').value=Nlign
	obj('form1').method="post"		
	obj('form1').action="fiche_reservation_voyages_organises.php"	 	
	obj('form1').submit()	 
}

function Reservation_Sejours(NPer){
	  
	obj('actions').value="ressejours"	 
	obj('txtNPeride').value=NPer		 
	obj('form1').method="post"		
	obj('form1').action="fiche_reservation_sejour.php"	 	
	obj('form1').submit()	 
}
function Retour(type){	
	 
if(type=='hotels') document.location='hot_mar_liste.php';
if(type=='sejours') document.location='sejour_liste.php';
if(type=='circuits') document.location='circuit_liste.php';
if(type=='voyages') document.location='voyages_organises_liste.php';
if(type=='omra') document.location='omra_liste.php';
	 
	}
	function choix_Recharger(){	 		 
		obj('form1').method="post"
		obj('form1').action=""
		obj('form1').submit()
	}
	function choix_RechargerVille(vil){	 
		obj('sltvil1').value=vil
		obj('sltvil2').value=vil
		obj('form1').method="post"
		obj('form1').action=""
		obj('form1').submit()
	}
	function choix_RechargerCat(cat){	 
		obj('sltcat1').value=cat
		obj('sltcat2').value=cat
		obj('form1').method="post"
		obj('form1').action=""
		obj('form1').submit()
	}
	function choix_RechargerPrix(type){	 
		obj('sltPrix1').value=type
		obj('sltPrix2').value=type
		obj('form1').method="post"
		obj('form1').action=""
		obj('form1').submit()
	}
	function choix_RechargerPage(page){	 
		obj('page1').value=page
		obj('page2').value=page
		obj('form1').method="post"
		obj('form1').action=""
		obj('form1').submit()
	}
	
	function Page_suiv(Npage,Nbpage){
		if(eval(Npage)<eval(Nbpage)){
			obj('page1').value=Npage-(-1)
			obj('page2').value=Npage-(-1)
			obj('form1').method="post"
			obj('form1').action=""
			obj('form1').submit()
			 
		}
		
	}
	function Page_prec(Npage,Nbpage){
		if(eval(Npage)>1){
			obj('page1').value=Npage-(1)
			obj('page2').value=Npage-(1)
			obj('form1').method="post"
			obj('form1').action=""
			obj('form1').submit()
			 
		}
		
	}

function dateinf_recher(champ1,champ2,message,champs){
	var reg=new RegExp("/", "g");
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2
	
	date1=document.getElementById(champ1).value.replace(reg,"-")
	date2=document.getElementById(champ2).value.replace(reg,"-")
	
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");
//alert(date1+"-"+date2)
	date1 = Date.parse(date1);
	date2 = Date.parse(date2)+1;
	
	//if (date1 == date2) { return true;}
	if (date1 < date2){
	alert(message)		 
		document.getElementById(champs).value=''
		document.getElementById(champs).focus()
		return false
	}else{
		 
		return true
	}

}


function number_format(number, decimals, dec_point, thousands_sep) {
 
    var n = !isFinite(+number) ? 0 : +number, 
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
        dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
        s = '',
        toFixedFix = function (n, prec) {
            var k = Math.pow(10, prec);
            return '' + Math.round(n * k) / k;
        };
    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
    if (s[0].length > 3) {
        s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
    }
    if ((s[1] || '').length < prec) {
        s[1] = s[1] || '';
        s[1] += new Array(prec - s[1].length + 1).join('0');
    }
    return s.join(dec);
}
 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

///////////////  Vols e-power /////////////////

function AfficheVille(vil,id){
document.getElementById("listVille1").style.display='none';
document.getElementById("listVille2").style.display='none';

if(eval((vil.value).length)>1){
		div_id=id
		vil_id=vil.name
		data="&vil="+vil.value
		 
		 
		  
		http.open("POST", "actions.php?actions=AficheVilles&"+data, true);
		http.onreadystatechange = ResultaVilles;
		http.send(null);
		 
		 
}
}
function ResultaVilles() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
	
		
		//alert(results)
		//document.getElementById('id_validation').style.visibility='visible'
		//document.getElementById('id_validation').innerHTML=results[1]
		//a=results[3].split(',');
		
		
		
		//alert(a[0])
		 
		   if(results[0]==1){
		   PaysName=results[6].split(',');
			VilleCode=results[2].split(',');
			VilleName=results[3].split(',');
			//alert(results[4])
			AirportCode=results[4].split(';');
			AirportName=results[5].split(';');
			//alert(AirportName.length)
		   ResVille1=""
		   //vil_id=results[7]
		   //div_id=results[8]
		   
			if(VilleCode.length>1){
			
		   ResVille1+="<table class=\"ACSearch_ResultTable\" id=\"ResultTable_txtFrom\"><tbody>"
		   for(i=0;i<VilleCode.length-1;i++){
		   ResVille1+=" <tr class=\"ACSearch_ItemStyle\" onmouseover=\"tr_OnMouseOver(this)\" onmouseout=\"tr_OnMouseOut(this)\" onclick=\"SelectedItem('"+VilleCode[i]+"','"+VilleName[i]+"')\">"
		   ResVille1+=" <td width=\"1\" nowrap=\"nowrap\"><img src=\"images/I_022.jpg\" width=\"15\" >&nbsp;</td>"
		   ResVille1+=" <td>&nbsp;"+VilleName[i]+",&nbsp;"+PaysName[i]+"&nbsp;<font size=\"-2\">("+VilleCode[i]+")</font></td></tr>"
		   AirportCode_=AirportCode[i].split(',');
		   AirportName_=AirportName[i].split(',');
		   for(j=0;j<AirportCode_.length-1;j++){
		  if((j%2)==0)
		   ResVille1+=" <tr class=\"ACSearch_AlternatingItemStyle\" onmouseover=\"tr_OnMouseOver(this)\"  onmouseout=\"tr_OnMouseOut(this)\" onclick=\"SelectedItem('"+AirportCode_[j]+"','"+AirportName_[j]+"')\">"
		   else  ResVille1+=" <tr class=\"ACSearch_ItemStyle\" onmouseover=\"tr_OnMouseOver(this)\"  onmouseout=\"tr_OnMouseOut(this)\" onclick=\"SelectedItem('"+AirportCode_[j]+"','"+AirportName_[j]+"')\">"

		   ResVille1+=" <td width=\"1\" nowrap=\"nowrap\"></td><td><img src=\"images/I_018.jpg\" width=\"15\">&nbsp;"+AirportName_[j]+"&nbsp;(<font size=\"-2\">"+AirportCode_[j]+")</font></td></tr>"
		   
		   }
		   }
		   //ResVille1+=" <tr class=\"ACSearch_ItemStyle\" onmouseover=\"tr_OnMouseOver(this)\" onmouseout=\"tr_OnMouseOut(this)\" onclick=\"SelectedItem('AGA;A','Al Massira')\">"
		   //ResVille1+=" <td width=\"1\" nowrap=\"nowrap\"></td><td><img src=\"images/I_018.htm\" width=\"15\">&nbsp;Al Massira2&nbsp;(<font size=\"-2\">AGA)</font></td></tr>"
		   ResVille1+=" </tbody></table>"
		   
		   
		  
		 document.getElementById(div_id).style.display='block';
		 document.getElementById(div_id).innerHTML=ResVille1
		 }
		
			}			 
		
			
	}
} 
function SelectedItem(code,Name){
 
obj(vil_id).value=Name	
 document.getElementById(div_id).style.display='none';
}
 function tr_OnMouseOver(obj)
{
var tableObj;
if(obj.parentElement)
{//IE
tableObj = obj.parentElement.parentElement;
}
else
{//Firefox
tableObj = obj.parentNode.parentNode;
}

if (tableObj.RowIndex != null)
{
tableObj.RowIndex = null;
ClearCells(tableObj);
}

ClassPreFix = tableObj.className.substr(0,tableObj.className.indexOf('_'));
//ClearCells(tableObj);
CurHighLight = obj;
tableObj.HighLightRow = obj;
tableObj.HighLightRowOldStyle = obj.className;
obj.className = ClassPreFix + "_HighLight";
}
function tr_OnMouseOut(obj)
{
var tableObj;
if(obj.parentElement)
{//IE
tableObj = obj.parentElement.parentElement;
}
else
{//Firefox
tableObj = obj.parentNode.parentNode;
}

//ClearCells(tableObj);
if (tableObj.HighLightRow)
{
tableObj.HighLightRow.className = tableObj.HighLightRowOldStyle;
}
}

function verifdate(){
 
	 
	if (!dateinf_recher("External_FlightFareSearch_DepartureDate","txtajrd2","La date Départ doit etre majorée avec "+obj('Nbjours').value+" jours","External_FlightFareSearch_DepartureDate")) return false 
	if (!dateinf_recher("External_FlightFareSearch_ReturnDate","txtajrd2","La date Retour doit etre supérieure a la date d\'aujourdui","External_FlightFareSearch_ReturnDate")) return false 

	if (!dateinf_recher("External_FlightFareSearch_ReturnDate","External_FlightFareSearch_DepartureDate","La date Retour doit etre supérieure a la date Départ","External_FlightFareSearch_ReturnDate")) return false 
}



////////////////   Recherche //////////////
function Bottun_Recherche(){	
 
	for(i=1;i<8;i++){
	 	if(obj('voyage_'+i).checked) 
			voyage=obj('voyage_'+i).value
	}
 
	 if(voyage=="ch_vol_epower"){
		 
		 	if (!message('External_FlightFareSearch_From','Départ ')) return false
			if (!message('External_FlightFareSearch_To','Destination ')) return false
			if (!message('External_FlightFareSearch_DepartureDate','Départ le ')) return false
			if (!message('External_FlightFareSearch_ReturnDate','Arrivée le ')) return false
			if(obj('External_FlightFareSearch_NumberOfAdults').value==0 && obj('External_FlightFareSearch_NumberOfChilds').value==0){
				obj('External_FlightFareSearch_NumberOfAdults').value=1;
			}
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_vols.php'		 
		obj('recherche').submit()
	}
	
	if(voyage=="ch_hotel_maroc"){
		 
		 	/*if (!message('Pays_ville_reh_h','Ville de départ ')) return false
			if (!message('External_FlightFareSearch_To','Destination ')) return false*/
			if (!message('ch_data_A','Arrivée le ')) return false
			if (!message('ch_data_D','Départ le ')) return false
			/*if(obj('External_FlightFareSearch_NumberOfAdults').value==0 && obj('External_FlightFareSearch_NumberOfChilds').value==0){
				obj('External_FlightFareSearch_NumberOfAdults').value=1;
			}*/
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_hot_mar.php'		 
		obj('recherche').submit()
	}
	if(voyage=="ch_circuit"){
		 
		 	 
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_circuit.php'		 
		obj('recherche').submit()
	}
	if(voyage=="ch_voyage_organises"){
		 
		 	 
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_Voyages_Organise.php'		 
		obj('recherche').submit()
	}
	if(voyage=="ch_voiture"){
		 
		if (!message('ch_data_A_voi','Prise le ')) return false
		if (!message('ch_data_D_voi','Restitution le ')) return false 	 
		
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_voiture.php'		 
		obj('recherche').submit()
	}
	if(voyage=="ch_sejours"){		 		 	 
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_sejours.php'		 
		obj('recherche').submit()
	}
	
	if(voyage=="ch_haj_omra"){		 		 	 
		obj('recherche').method='POST'
		obj('recherche').action='Recherche_omra.php'		 
		obj('recherche').submit()
	}
	return false
}
function AficheRecherche(id) {
			
			
			document.getElementById("ch_hotel_maroc").style.display='none';		
			document.getElementById("ch_circuit").style.display='none';
			document.getElementById("ch_voyage_organises").style.display='none';	
			document.getElementById("ch_haj_omra").style.display='none';
			document.getElementById("ch_sejours").style.display='none';
			document.getElementById("ch_voiture").style.display='none';		 
			document.getElementById("ch_vol_epower").style.display='none';
		
			document.getElementById(id).style.display='block';
		
		
		
	}

function verifdate_HMar(){
 
	 
	if (!dateinf_recher("ch_data_A","txtajrd2","La date Départ doit etre majorée avec "+obj('Nbjours').value+" jours","ch_data_A")) return false 
	if (!dateinf_recher("ch_data_D","txtajrd2","La date Retour doit etre supérieure a la date d\'aujourdui","ch_data_D")) return false 

	if (!dateinf_recher("ch_data_D","ch_data_A","La date Retour doit etre supérieure a la date Départ","ch_data_D")) return false 
}
function verifdate_VoiRech(){
 
	 
	if (!dateinf_recher("ch_data_A_voi","txtajrd2","La date Départ doit etre majorée avec "+obj('Nbjours').value+" jours","ch_data_A_voi")) return false 
	if (!dateinf_recher("ch_data_D_voi","txtajrd2","La date Retour doit etre supérieure a la date d\'aujourdui","ch_data_D_voi")) return false 

	if (!dateinf_recher("ch_data_D_voi","ch_data_A_voi","La date Retour doit etre supérieure a la date Départ","ch_data_D_voi")) return false 
}
function verifdate_Sej(){
 
	 
	if (!dateinf_recher("ch_data_SejA","txtajrd2","La date Départ doit etre majorée avec "+obj('Nbjours').value+" jours","ch_data_SejA")) return false 
	if (!dateinf_recher("ch_data_SejD","txtajrd2","La date Retour doit etre supérieure a la date d\'aujourdui","ch_data_SejD")) return false 

	if (!dateinf_recher("ch_data_SejD","ch_data_SejA","La date Retour doit etre supérieure a la date Départ","ch_data_SejD")) return false 
}

function verifdate_HEtr(){
 
	 
	if (!dateinf_recher("data_Hetr_D","txtajrd2","La date Départ doit etre majorée avec "+obj('Nbjours').value+" jours","data_Hetr_D")) return false 
	if (!dateinf_recher("data_Hetr_R","txtajrd2","La date Retour doit etre supérieure a la date d\'aujourdui","data_Hetr_R")) return false 

	if (!dateinf_recher("data_Hetr_R","data_Hetr_D","La date Retour doit etre supérieure a la date Départ","data_Hetr_R")) return false 
}
function verifdate_Sej(){
 
	 
	if (!dateinf_recher("ch_data_SejA","txtajrd2","La date Départ doit etre majorée avec "+obj('Nbjours').value+" jours","ch_data_SejA")) return false 
	if (!dateinf_recher("ch_data_SejD","txtajrd2","La date Retour doit etre supérieure a la date d\'aujourdui","ch_data_SejD")) return false 

	if (!dateinf_recher("ch_data_SejD","ch_data_SejA","La date Retour doit etre supérieure a la date Départ","ch_data_SejD")) return false 
}


//////////////////////////////
function message(champs,libelle){
	if (document.getElementById(champs).value==""){
		 
		alert("Le champs "+libelle+" ne doit pas être une chaine vide !")
		document.getElementById(champs).focus()
		return false
	}else{
		
		return true
	}
}
function writediv12(nm,texte)
{
	document.getElementById(nm).innerHTML = texte;
}

function Ajouter_Panier(ID_PROD,TYPE,d_D,d_R){
	
	txtnom= new Array();
	txtprenom= new Array();
	txtage= new Array();
	TypeVoyages= new Array();
	Civilite= new Array();
	Chambre= new Array();
	//Nom_h=""
	//alert(ID_PROD+','+TYPE+','+d_D+','+d_R)
	var IDPrix=obj('DEPART_ID').value
	var PrixT=0;
	var Frais_id=0;
	var PrixTotal=0;
	Nbrchambre=obj('Nbrchambre').value;
	PrixT=obj('PrixTotal2_id').innerHTML;
	Frais_id=obj('Frais_id').innerHTML;
	PrixTotal=obj('Total_id').innerHTML;
	
	/**/
	var data="";
	 
	data+="&ID_PROD="+ID_PROD
	data+="&TYPE="+TYPE
	data+="&IDPrix="+IDPrix
	//data+="&Nom_h="+Nom_h
	data+="&d_D="+d_D
	data+="&d_R="+d_R
	data+="&Nbrchambre="+Nbrchambre
	data+="&PrixT="+PrixT
	data+="&Frais_id="+Frais_id
	data+="&PrixTotal="+PrixTotal	
	
	var sltadultes=0;
	var sltenfants=0;
	var sltbebes=0;
	
	var Adulte=0;
	var Enfant=0;
	var Bebe=0;
	
	var NbPers=0;
	
	j=0;
	for(i=1;i<=eval(Nbrchambre);i++){
		Adulte=obj('Adulte'+i).value;
		Enfant=obj('Enfant'+i).value;
		Bebe=obj('Bebe'+i).value; 
		NbPers=0;
		sltadultes=eval(Adulte)-(-eval(sltadultes));
		sltenfants=eval(Enfant)-(-eval(sltenfants));
		sltbebes=eval(Bebe)-(-eval(sltbebes));
		
		NbPers=eval(Adulte)-(-eval(Enfant));
		
		 for(k=1;k<=eval(NbPers);k++){
			Chambre[j]=i;
			TypeVoyages[j]=obj('TypeVoyages'+i+k).innerHTML;
			Civilite[j]=obj('Civilite'+i+k).value;
			txtnom[j]=obj('Nom'+i+k).value;
			txtprenom[j]=obj('Prenom'+i+k).value;					
			txtage[j]=obj('Age'+i+k).value;
			
			
		 if (!message('Nom'+i+k,'Nom ')) return false
			if (!message('Prenom'+i+k,'Prénom ')) return false
			if (!message('Age'+i+k,'Age ')) return false
	 		 
			 data+="&Chambre="+Chambre
			data+="&TypeVoyages="+TypeVoyages
			data+="&Civilite="+Civilite
			data+="&txtnom="+txtnom
			data+="&txtprenom="+txtprenom
			data+="&txtage="+txtage
			 
			
			j++;
		}
	}
 
		data+="&sltadultes="+sltadultes
		data+="&sltenfants="+sltenfants
		data+="&sltbebes="+sltbebes	 	
		/*alert(data);
		return false*/
		http.open("POST","actions.php?actions=Ajouter_Panier&"+data, true);
		http.onreadystatechange = recchaAjPanier;
		http.send(null);
		document.getElementById('ajouterPan').style.visibility='hidden'
		//document.getElementById('ajouterPan2').style.visibility='visible'
		writediv12('id_validation','<center><font color=green>Attendez s\'il vous plait....</font></center> ')
}
function Ajouter_Omra_Panier(ID_PROD,TYPE,d_D,d_R){
	txtnom= new Array();
	txtprenom= new Array();
	txtage= new Array();
	TypeVoyages= new Array();
	Civilite= new Array();
	Chambre= new Array();
	//Nom_h=""
	//alert(ID_PROD+','+TYPE+','+d_D+','+d_R)
	var IDPrix=obj('DEPART_ID').value
	var PrixT=0;
	var Frais_id=0;
	var PrixTotal=0;
	var Prix_p=0;
	Nbrchambre=obj('Nbrchambre').value;
	PrixT=obj('PrixTotal2_id').innerHTML;
	Frais_id=obj('Frais_id').innerHTML;
	PrixTotal=obj('Total_id').innerHTML;
	Prix_p=obj('Prix_id').innerHTML;
	/**/
	var data="";
	 
	data+="&ID_PROD="+ID_PROD
	data+="&TYPE="+TYPE
	data+="&IDPrix="+IDPrix
	//data+="&Nom_h="+Nom_h
	data+="&d_D="+d_D
	data+="&d_R="+d_R
	data+="&Nbrchambre="+Nbrchambre
	data+="&Prix_p="+Prix_p
	
	data+="&PrixT="+PrixT
	data+="&Frais_id="+Frais_id
	data+="&PrixTotal="+PrixTotal	
	
	var sltadultes=0;
	var sltenfants=0;
	var sltbebes=0;
	
	var Adulte=0;
	var Enfant=0;
	var Bebe=0;
	
	var NbPers=0;
	
	j=0;
	var sltadultes=0;
	var sltenfants=0;
	var sltbebes=0;
	
	var Adulte=0;
	var Enfant=0;
	var Bebe=0;
	
	var NbPers=0;
	
	j=0;
	for(i=1;i<=eval(Nbrchambre);i++){
		Adulte=1;
		Enfant=0;
		Bebe=0; 
		NbPers=0;
		sltadultes=eval(Adulte)-(-eval(sltadultes));
		sltenfants=eval(Enfant)-(-eval(sltenfants));
		sltbebes=eval(Bebe)-(-eval(sltbebes));
		
		NbPers=eval(Adulte)-(-eval(Enfant));
		
		 for(k=1;k<=eval(NbPers);k++){
			Chambre[j]=i;
			TypeVoyages[j]="Adulte";
			Civilite[j]=obj('Civilite'+i+k).value;
			txtnom[j]=obj('Nom'+i+k).value;
			txtprenom[j]=obj('Prenom'+i+k).value;					
			txtage[j]=obj('Age'+i+k).value;
			
			
		 if (!message('Nom'+i+k,'Nom ')) return false
			if (!message('Prenom'+i+k,'Prénom ')) return false
			if (!message('Age'+i+k,'Age ')) return false
	 		 
			 data+="&Chambre="+Chambre
			data+="&TypeVoyages="+TypeVoyages
			data+="&Civilite="+Civilite
			data+="&txtnom="+txtnom
			data+="&txtprenom="+txtprenom
			data+="&txtage="+txtage
			 
			
			j++;
		}
	}
 
		data+="&sltadultes="+sltadultes
		data+="&sltenfants="+sltenfants
		data+="&sltbebes="+sltbebes	 	
		/*alert(data);
		return false*/
		http.open("POST","actions.php?actions=Ajouter_Panier&"+data, true);
		http.onreadystatechange = recchaAjPanier;
		http.send(null);
		document.getElementById('ajouterPan').style.visibility='hidden'
		//document.getElementById('ajouterPan2').style.visibility='visible'
		writediv12('id_validation','<center><font color=green>Attendez s\'il vous plait....</font></center> ')
}

function Ajouter_Panier_Hxml(ID_PROD,ProcessId,TYPE,d_D,d_R){
	txtnom= new Array();
	txtprenom= new Array();
	txtage= new Array();
	TypeVoyages= new Array();
	Civilite= new Array();
	Chambre= new Array();
	//Nom_h=""
	//alert(ID_PROD+','+TYPE+','+d_D+','+d_R)
	var PrixT=0;
	var Frais_id=0;
	var PrixTotal=0;
	Nbrchambre=obj('Nbrchambre').value;
	PrixT=obj('PrixTotal2_id').innerHTML;
	Frais_id=obj('Frais_id').innerHTML;
	PrixTotal=obj('Total_id').innerHTML;
	var Designation=obj('Desn').innerHTML
	var IDPrix=ProcessId;
	/**/
	var data="";
	 
	data+="&ID_PROD="+ID_PROD
	data+="&IDPrix="+IDPrix
	
	data+="&TYPE="+TYPE
	//data+="&Nom_h="+Nom_h
	data+="&d_D="+d_D
	data+="&d_R="+d_R
	data+="&Nbrchambre="+Nbrchambre
	data+="&PrixT="+PrixT
	data+="&Frais_id="+Frais_id
	data+="&PrixTotal="+PrixTotal	
	data+="&Designation="+Designation
	var sltadultes=0;
	var sltenfants=0;
	var sltbebes=0;
	
	var Adulte=0;
	var Enfant=0;
	var Bebe=0;
	
	var NbPers=0;
	
	j=0;
	for(i=1;i<=eval(Nbrchambre);i++){
		Adulte=obj('Adulte'+i).value;
		Enfant=obj('Enfant'+i).value;
		Bebe=obj('Bebe'+i).value; 
		NbPers=0;
		sltadultes=eval(Adulte)-(-eval(sltadultes));
		sltenfants=eval(Enfant)-(-eval(sltenfants));
		sltbebes=eval(Bebe)-(-eval(sltbebes));
		
		NbPers=eval(Adulte)-(-eval(Enfant));
		
		 for(k=1;k<=eval(NbPers);k++){
			Chambre[j]=i;
			TypeVoyages[j]=obj('TypeVoyages'+i+k).innerHTML;
			Civilite[j]=obj('Civilite'+i+k).value;
			txtnom[j]=obj('Nom'+i+k).value;
			txtprenom[j]=obj('Prenom'+i+k).value;					
			txtage[j]=obj('Age'+i+k).value;
			
			
		 if (!message('Nom'+i+k,'Nom ')) return false
			if (!message('Prenom'+i+k,'Prénom ')) return false
			if (!message('Age'+i+k,'Age ')) return false
	 		 
			 data+="&Chambre="+Chambre
			data+="&TypeVoyages="+TypeVoyages
			data+="&Civilite="+Civilite
			data+="&txtnom="+txtnom
			data+="&txtprenom="+txtprenom
			data+="&txtage="+txtage
			 
			
			j++;
		}
	}
 
		data+="&sltadultes="+sltadultes
		data+="&sltenfants="+sltenfants
		data+="&sltbebes="+sltbebes	 	
		/*alert(data);
		return false*/
		http.open("POST","actions.php?actions=Ajouter_Panier&"+data, true);
		http.onreadystatechange = recchaAjPanier;
		http.send(null);
		document.getElementById('ajouterPan').style.visibility='hidden'
		//document.getElementById('ajouterPan2').style.visibility='visible'
		writediv12('id_validation','<center><font color=green>Attendez s\'il vous plait....</font></center> ')
}

function Ajouter_Panier_Location(ID_PROD,TYPE){
	txtnom= new Array();
	txtprenom= new Array();
	txtNperm= new Array();
	txtDelev= new Array();
	Conducteur= new Array();
	
	if (!message('txtdpc','A partir de ')) return false
	if (!message('txtdpc',"Jusqu'à ")) return false
	if(obj('Total_id').innerHTML=="--"){
		alert("Location voiture Non disponible, Veuillez choisir une autre date.");
		return false;
	}
	if (!message('sltvpc','Ville de pris en charge ')) return false
	if (!message('sltvdr','Ville de Restitution ')) return false
	
	//Nom_h=""
	//alert(ID_PROD+','+TYPE+','+d_D+','+d_R)
	var PrixT=0;
	var Frais_id=0;
	var PrixTotal=0;
	Nbrchambre=obj('Nbrchambre').value;
	PrixT=obj('PrixTotal2_id').innerHTML;
	Frais_id=obj('Frais_id').innerHTML;
	PrixTotal=obj('Total_id').innerHTML;
	
	var d_D_=(obj('txtdpc').value).split('-')
	var d_R_=(obj('txtddr').value).split('-')
	
	var d_D=d_D_[2]+'-'+d_D_[1]+'-'+d_D_[0]
	var d_R=d_R_[2]+'-'+d_R_[1]+'-'+d_R_[0]
	
	var Designation=obj('sltvpc').value+"-->"+obj('sltvdr').value
	
	/**/
	var data="";
	 
	data+="&ID_PROD="+ID_PROD
	data+="&TYPE="+TYPE
	//data+="&Nom_h="+Nom_h
	data+="&d_D="+d_D
	data+="&d_R="+d_R
	data+="&Nbrchambre="+Nbrchambre
	data+="&PrixT="+PrixT
	data+="&Frais_id="+Frais_id
	data+="&PrixTotal="+PrixTotal
	data+="&Designation="+Designation
	
	var sltadultes=Nbrchambre;
	var sltenfants=0;
	var sltbebes=0;
	
	var Adulte=0;
	var Enfant=0;
	var Bebe=0;
	
	var NbPers=0;
	
	if(eval(PrixT)<=0){
		alert("Véhicule n'est pas disponible. Veuillez choisir une autre date.");	
		return false
	}
		
	j=0;
	for(i=1;i<=eval(Nbrchambre);i++){
		
		
		k=1;
			Conducteur[j]=i;			
			txtnom[j]=obj('Nom'+i+k).value;
			txtprenom[j]=obj('Prenom'+i+k).value;					
			txtNperm[j]=obj('NPermis'+i+k).value;
			txtDelev[j]=obj('Delivre'+i+k).value;					
			
			
			
		 if (!message('Nom'+i+k,'Nom ')) return false
			if (!message('Prenom'+i+k,'Prénom ')) return false
			if (!message('NPermis'+i+k,'N° Permis ')) return false
	 		if (!message('Delivre'+i+k,'Délivré le ')) return false 
			
			 data+="&Chambre="+Conducteur				
			data+="&txtnom="+txtnom
			data+="&txtprenom="+txtprenom
			data+="&txtage="+txtNperm
			data+="&Civilite="+txtDelev 
			
			j++;
		
	}
 
		data+="&sltadultes="+sltadultes
		data+="&sltenfants="+sltenfants
		data+="&sltbebes="+sltbebes	 	
		/*alert(data);
		return false*/
		http.open("POST","actions.php?actions=Ajouter_Panier&"+data, true);
		http.onreadystatechange = recchaAjPanier;
		http.send(null);
		document.getElementById('ajouterPan').style.visibility='hidden'
		//document.getElementById('ajouterPan2').style.visibility='visible'
		writediv12('id_validation','<center><font color=green>Attendez s\'il vous plait....</font></center> ')
}
function recchaAjPanier() {
	//alert(http.readyState);
	if (http.readyState == 4) {		
		results = http.responseText.split("::");		
		//alert(results)
		  if(results[0]==2){
			//alert("Ajoute avec succès au panier ")
			obj('actionsP').value="commander_Ajouter"	
			/*alert(obj('actions').value)
			return false;*/
			obj('formvoy').method="post"
			obj('formvoy').action='panier.php'
			obj('formvoy').submit()
			
//			javascript:document.location='/home.php?mod=Moncompt&smod=Pan'
		}
		else if(results[0]==3){
			//alert("Vous devez être connecter !!")
			//javascript:document.location='./connexion.php'
			obj('actionsP').value="Ajouter"	
			/*alert(obj('actions').value)
			return false;*/
			obj('formvoy').method="post"
			obj('formvoy').action='Mon_Compte.php'
			obj('formvoy').submit()
			
		}
		else if(results[0]==4){
			//alert("Vous devez être connecter !!")
			//javascript:document.location='./connexion.php'
			obj('actionsP').value="Ajouter"						 
			obj('formvoy').method="post"
			obj('formvoy').action='Mon_Compte.php'
			obj('formvoy').submit()
			
		}
		else {
			alert("Erreur de Donnee !!?")
			return false
		}	
		
	}
}


/**************** connexion *****************/

function writediv(nm,texte)
{
	document.getElementById(nm).innerHTML = texte;
}
function connexion(Ajout){
 
document.f1.nom_login.focus();writediv('valider','');
writediv('valider','<span style="margin-left:0px;color:#009900">Patientez SVP.</span>');
	if(document.f1.nom_login.value != "" && document.f1.nom_login.value !=null ){
		writediv('log','');document.f1.pwd_login.focus();
		if(document.f1.pwd_login.value != "" && document.f1.pwd_login.value !=null){
		writediv('mdp','');
			 login=document.f1.nom_login.value
			pwd=document.f1.pwd_login.value
			data="&login="+login	 	 				
			data+="&pwd="+pwd	 	 				
			http.open("POST","actions.php?actions=connect&Panier="+Ajout+"&"+data, true);
			http.onreadystatechange = recchaconnexion;
			http.send(null);
//alert("actions.php?actions=connect&Panier="+Ajout+"&"+data)

	}else {
		writediv('mdp','<span style="color:#cc0000">Obligatoire</span>');writediv('valider','');
	}
	}
	else {
		writediv('log','<span style="color:#cc0000">Obligatoire</span>');writediv('valider','');
		if(document.f1.pwd_login.value == "" || document.f1.pwd_login.value == null){
			writediv('mdp','<span style="color:#cc0000">Obligatoire</span>');writediv('valider','');
			}else {writediv('mdp','');}

	}
}

function recchaconnexion() {
	
		if (http.readyState == 4) {		
			results = http.responseText.split("::");
			//alert(results)
		if(!filter.test(document.f1.nom_login.value)){
		 writediv('valider','<span style="margin-left:0px;color:#cc0000">Mot de passe ou compte erron&eacute;.</span><br><span style="margin-left:0px;color:#cc0000">Merci de r&eacute;essayer.</span>');
			 document.f1.nom_login.value="";
			 document.f1.pwd_login.value="";
			 document.f1.nom_login.focus();
		}else {
			if (results[0]==1){
				 	
			//javascript:document.location="./home.php?<?php echo $_GET[Lien];?>"
			if (results[1]==3){
				obj('actionsP').value="commander_Ajouter"			 
				obj('formvoy').method="post"
				obj('formvoy').action='panier.php'
				obj('formvoy').submit()
			}			
			else{
				 			 
				obj('formvoy').method="post"
				obj('formvoy').action='panier.php'
				obj('formvoy').submit()
			}	
						
			}
			else if (results[0]==2){
			 writediv('valider','<span style="margin-left:0px;color:#cc0000">Mot de passe ou compte erron&eacute;.</span><br><span style="margin-left:0px;color:#cc0000">Merci de r&eacute;essayer.</span>');
			 document.f1.nom_login.value="";
			 document.f1.pwd_login.value="";
			 document.f1.nom_login.focus();
			}else{
				
			//	alert("Erreur de donnees")
				 
			}
			}
			
		}
	}
function connexion_2(){
 
document.f1.nom_login.focus();writediv('valider','');
writediv('valider','<span style="margin-left:0px;color:#009900">Patientez SVP.</span>');
	if(document.f1.nom_login.value != "" && document.f1.nom_login.value !=null ){
		writediv('log','');document.f1.pwd_login.focus();
		if(document.f1.pwd_login.value != "" && document.f1.pwd_login.value !=null){
		writediv('mdp','');
			 login=document.f1.nom_login.value
			pwd=document.f1.pwd_login.value
			data="&login="+login	 	 				
			data+="&pwd="+pwd	 	 				
			http.open("POST","actions.php?actions=connect&&"+data, true);
			http.onreadystatechange = recchaconnexion2;
			http.send(null);
//alert("actions.php?actions=connect&Panier="+Ajout+"&"+data)

	}else {
		writediv('mdp','<span style="color:#cc0000">Obligatoire</span>');writediv('valider','');
	}
	}
	else {
		writediv('log','<span style="color:#cc0000">Obligatoire</span>');writediv('valider','');
		if(document.f1.pwd_login.value == "" || document.f1.pwd_login.value == null){
			writediv('mdp','<span style="color:#cc0000">Obligatoire</span>');writediv('valider','');
			}else {writediv('mdp','');}

	}
}

function recchaconnexion2() {
	
		if (http.readyState == 4) {		
			results = http.responseText.split("::");
			//alert(results)
		if(!filter.test(document.f1.nom_login.value)){
		 writediv('valider','<span style="margin-left:0px;color:#cc0000">Mot de passe ou compte erron&eacute;.</span><br><span style="margin-left:0px;color:#cc0000">Merci de r&eacute;essayer.</span>');
			 document.f1.nom_login.value="";
			 document.f1.pwd_login.value="";
			 document.f1.nom_login.focus();
		}else {
			if (results[0]==1){
				 	var URL=obj('URL_identif').value;
			javascript:document.location=URL
				/*obj('formvoy').method="post"
				obj('formvoy').action='panier.php'
				obj('formvoy').submit()*/
						
			}
			else if (results[0]==2){
			 writediv('valider','<span style="margin-left:0px;color:#cc0000">Mot de passe ou compte erron&eacute;.</span><br><span style="margin-left:0px;color:#cc0000">Merci de r&eacute;essayer.</span>');
			 document.f1.nom_login.value="";
			 document.f1.pwd_login.value="";
			 document.f1.nom_login.focus();
			}else{
				
			//	alert("Erreur de donnees")
				 
			}
			}
			
		}
	}
	
/*****************  Panier ***************************/
var TotelI=0;

function ChangeAvance(Av,NL){
	var Total_F=0
	Prix_Int=obj('Total_PInt'+NL).innerHTML
	
 
	Prix_f=number_format(eval(eval(Prix_Int)*(1-(1-eval(Av)/100))),2,'.','');
	 
	
 
	obj('Total_p'+NL).innerHTML=Prix_f
 
	ItPrices=obj('ItmesPrices').value.split(';')
 
	 ItPrices[NL-1]=obj('Total_p'+NL).innerHTML;
	obj('ItmesPrices').value=""
	for(i=0;i<ItPrices.length;i++){
	obj('ItmesPrices').value+=ItPrices[i]
	if(i<(ItPrices.length-1))
		obj('ItmesPrices').value+=';'
	Total_F=eval(Total_F-(-eval(ItPrices[i])))
	}
	obj('AmountTX').value=number_format(Total_F,2,'.','');
	obj('TotalP_T').innerHTML=number_format(Total_F,2,'.','');
	frais_p=obj('TotalP_fr').innerHTML
	obj('TotalP_T_AP').innerHTML=number_format(eval(Total_F-(-eval(frais_p))),2,'.','');
	obj('TotalmountTx').value=number_format(eval(Total_F-(-eval(frais_p))),0,'.','');
	obj('TotalMtTx').innerHTML=number_format(eval(Total_F-(-eval(frais_p))),0,'.','');
	
}
function ChangeAvance_(Av,NL){
	var Total_F=0
	Prix_Int=obj('Total_PInt'+NL).innerHTML
	
 
	Prix_f=number_format(eval(eval(Prix_Int)*(1-(1-eval(Av)/100))),2,'.','');
	 
	
 
	obj('Total_p'+NL).innerHTML=Prix_f
 	NBLG_=obj('NBLG').innerHTML
	//alert(NBLG_)
	//ItPrices=obj('ItmesPrices').value.split(';')
 
	// ItPrices[NL-1]=obj('Total_p'+NL).innerHTML;
	//obj('ItmesPrices').value=""
	for(i=1;i<=eval(NBLG_);i++){
	//obj('ItmesPrices').value+=ItPrices[i]
	//if(i<(ItPrices.length-1))
		//obj('ItmesPrices').value+=';'
	Total_F=eval(Total_F-(-eval(obj('Total_p'+i).innerHTML)))
	}
	//obj('AmountTX').value=number_format(Total_F,2,'.','');
	obj('TotalP_T').innerHTML=number_format(Total_F,2,'.','');
	//frais_p=obj('TotalP_fr').innerHTML
	//obj('TotalP_T_AP').innerHTML=number_format(eval(Total_F-(-eval(frais_p))),2,'.','');
	//obj('TotalmountTx').value=number_format(eval(Total_F-(-eval(frais_p))),0,'.','');
	//obj('TotalMtTx').innerHTML=number_format(eval(Total_F-(-eval(frais_p))),0,'.','');
	
}
function Init_Total(intTotel){

TotelI=intTotel;	
obj('TotalP').innerHTML=intTotel;
}
function SomeTotal(code,total){

if(code.checked)
	TotelT=eval(TotelI)-(-eval(total));
else
	TotelT=eval(TotelI)-eval(total);
	
	obj('TotalP').innerHTML=number_format(eval(TotelT),2,',','');
	TotelI=TotelT;
}
function suppression(code,libelle){
	if (confirm("Etes-vous sûr de vouloir supprimer ce produit de votre panier ?")){
	
		http.open("POST","actions.php?actions=supprimer_panier&&code="+code, true);
		http.onreadystatechange = recncosup;
		http.send(null);
		cacher('id_ligne'+code)
	}
}
function recncosup() {
	if (http.readyState == 4) {	
		results = http.responseText.split("::");
		
		if (results[0]==2){
			alert("Impossible de supprimer cette ligne !! ")
		}		
	}
}
function Proceder_Paiment(){
ProcP=0;
domlength=document.formres.choix.length;
sel= new Array();
data=""
for(i=0 ; i<domlength ; i++)
	{
		if(document.formres.choix[i].checked)
		{
			// alert(document.formres.choix[i].value)
			
			//data+="&choix[]="+document.formres.choix[i].value
			sel[ProcP]=document.formres.choix[i].value
			ProcP++;	
			  
		}
	}
if(ProcP>0){
	obj('formres').method="post"
	obj('formres').action="Mode_paiement.php?choix="+sel
	obj('formres').submit()
	return true;
}
else alert("Vous devez selectionner au moins une ligne !!");
return false
}

function Mode_Paiment_BT(choix){ 
 /*
	 domlength=formres.Mode_Paiment.length
 
	 if(!(formres.conditionGenr.checked)){	 
	 alert("Vous devez accepter les conditions générales de vente !!")
	 return false
	 }
	for(i=0 ; i<domlength ; i++)
	{
		if(document.formres.Mode_Paiment[i].checked)
		{
			ModeP=document.formres.Mode_Paiment[i].value
			break;
		}
	} */
	
	 var ModeP='CB'
	//obj('actions').value="modPaiem"
	obj('txtcodevoy').value=ModeP
	obj('formres').method="post"
	if(ModeP=='CB')
	obj('formres').action="Confirmation_paiement.php?choix="+choix
	//else obj('formvoy').action="/home.php?mod=Moncompt&smod=Virem&choix="+choix
	obj('formres').submit()
	
}
var actionSLK=""
function MisAjourProduit(IDPrds,url,NL){	 
 
 if(!(obj('conditionGenr').checked)){	 
	 alert("Vous devez accepter les conditions générales de vente !!")
	 return false
	 }
	
	actionSLK=url;
	
	data="&IDPrds="+IDPrds	
	data+="&TypsPay=EL"		
	//data+="&Nembre_Lign="+NL
	
	for(i=1;i<=NL;i++){
	data+="&Total_Prx"+i+"="+obj('Total_p'+i).innerHTML
	}		

	http.open("POST","actions.php?actions=MisAjours_Panier&"+data, true);
	http.onreadystatechange = recchaMisAjourProduit;
	http.send(null); 
	//
	//alert("Attendez s'il vous plait....")
	//paymentForm.paiement.disabled = true;
	document.getElementById('payer').style.visibility='hidden'
	writediv12('Messg','<center><font color=green>Attendez s\'il vous plait....</font></center>')
	
}
function recchaMisAjourProduit() {
	writediv12('Messg','<center><font color=green>Attendez s\'il vous plait....</font></center>')
	//alert(http.readyState);
	if (http.readyState == 4) {		
		results = http.responseText.split("::");		
//alert(results); return false;
		if(results[0]==1){
			obj('paymentForm').method='post';
			obj('paymentForm').action=actionSLK;
			obj('paymentForm').submit();			
		}
		else if(results[0]==3){
			 writediv12('Messg','<center><font color=red>Les lignes selectionner ne sont pas disponible !!</font></center>')
			alert("Les lignes selectionner ne sont pas disponible !!")
		}
		else if(results[0]==2){
			  writediv12('Messg','<center><font color=red>Les lignes Commander sont  En cours de traitement!!</font></center>')
			alert("Les lignes Commander sont  En cours de traitement!!")
		}

		else {
			alert("Erreur de Donnee !!?")
			return false
		}	
		
	}
}
function modifier_profil(codet){

	obj('id_validation').style.visibility='hidden'
	codecli	=	codet
	Civil	=	obj('Civil').value
	Nom	=	obj('txtnom').value
	Pren	=	obj('txtpn').value	 
	
	Pay	=	obj('txtpay').value
	Vil	=	obj('txtville').value	
	Tel	=	obj('txttel').value
	// Adress_LIVR	=	obj('txtadress_LIVR').value
	// Pay_LIVR	=	obj('txtpay_LIVR').value
	// Vil_LIVR	=	obj('txtville_LIVR').value	
	Email	=	obj('txtemail').value	
	passwActuel=obj('txtpasswActuel').value
	Pass=obj('txtpassw').value
	cpass=obj('txtcpass').value 
	
	if (!messages('txtnom','Nom')) return false
	if (!messages('txtpn','Prénom')) return false
	
	if (!messages('txtDateN_day_','Date de naissance')) return false
	if (!messages('txtDateN_month_','Date de naissance')) return false
	if (!messages('txtDateN_year_','Date de naissance')) return false
	//
	DATE_month=obj('txtDateN_month_').value
	DATE_day=obj('txtDateN_day_').value
	DATE_year=obj('txtDateN_year_').value
	
	if(DATE_month=='01' || DATE_month=='03' || DATE_month=='05' || DATE_month=='07' || DATE_month=='08' || DATE_month=='10' || DATE_month=='12' ){
		 if(DATE_day=='31'){
		 obj('txtDateN_day_').value='30'
		 DATE_day='30'
		
		}
		}
		if(DATE_month=='02'){
			 if(DATE_day=='31' || DATE_day=='30'){
				 obj('txtDateN_day_').value='29'
				 DATE_day='29'
				
			}
		}
		
	DateN=DATE_day+'-'+DATE_month+'-'+DATE_year
	//
	if (!messages('txttel','Téléphone')) return false
	//if (!messages('txtadress_LIVR','Adresse de livraison')) return false
	if (!messages('txtville','Ville')) return false
	if (!messages('txtpay','Pays')) return false
	if (!checkmail('txtemail','E-mail')) return false
	if(obj('txtpassw').value!="" && obj('txtpasswActuel').value==""){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Vous devez entrer votre mot de passe Actuel !"
		document.getElementById('txtpasswActuel').focus()
		return false;
	}
if(!(obj('txtpassw').value==obj('txtcpass').value)){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Les champs Password et Confirmation  ne correspondent pas !"
		document.getElementById('txtpassw').focus()
		return false;
	}
	
	if (confirm("Continuez-vous à modifier vos informations de compte ?")){	
		data="&codecli="+codecli
		data+="&Civil="+Civil
		data+="&Nom="+Nom
		data+="&Pren="+Pren	
		data+="&DateN="+DateN
		data+="&Pay="+Pay
		data+="&Vil="+Vil
		data+="&Tel="+Tel
		// data+="&Adress_LIVR="+Adress_LIVR
		// data+="&Vil_LIVR="+Vil_LIVR
		// data+="&Pay_LIVR="+Pay_LIVR
		data+="&Email="+Email
		data+="&passwActuel="+passwActuel
		data+="&Pass="+Pass
		http.open("POST", "actions.php?actions=modifier_prof&"+data, true);
		http.onreadystatechange = rec_ed_act;
		http.send(null);
	}
	return false
}//Modifier client
function rec_ed_act() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
	//alert(results)
		{
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML=results[1]
		}
		//obj('txtsoc').focus()
			
	}
} 
ListVille = new Array();
 
function RemplirComboVille(valeur,Vill){
		var sel="";
		 
		sel ="<select size='1' name='txtville' id='txtville' class='form_contact' style='width:95%;' >";
			// Parcourir le tableau
			 sel =sel + "<option value=''>selectionnez une ville</option>";	
		if(valeur!='0'){  
			for (var i=0;i<ListVille.length;i++){
			  // tester si la ligne du tableau (Sous-catégorie) correspond r la valeur de la catéhorie
			  if (ListVille[i][0]==valeur){
				// Ajouter une rubrique sous-catégorie au variable SEL
				vselectedVill=(ListVille[i][1]==Vill)?"selected":"";
				sel= sel + "<option value='"+ListVille[i][1]+"' "+vselectedVill+">"+ListVille[i][2]+"</option>";
			  }
			}
		}
		sel=sel+"</select>";
	
		// Modifier le DIV scat par la nouvelle List r partir du variable SEL
		obj('DivVille').innerHTML=sel;
	}
	
	function RemplirComboVille_inscr(valeur,Vill){
		var sel="";
		 
		sel ="<select size='1' name='txtville' id='txtville' class='form_chtxt' style='height:20px;width:220px' >";
			// Parcourir le tableau
			 sel =sel + "<option value=''>selectionnez une ville</option>";	
		if(valeur!='0'){  
			for (var i=0;i<ListVille.length;i++){
			  // tester si la ligne du tableau (Sous-catégorie) correspond r la valeur de la catéhorie
			  if (ListVille[i][0]==valeur){
				// Ajouter une rubrique sous-catégorie au variable SEL
				vselectedVill=(ListVille[i][1]==Vill)?"selected":"";
				sel= sel + "<option value='"+ListVille[i][1]+"' "+vselectedVill+">"+ListVille[i][2]+"</option>";
			  }
			}
		}
		sel=sel+"</select>";
	
		// Modifier le DIV scat par la nouvelle List r partir du variable SEL
		obj('DivVille').innerHTML=sel;
	}
	function vpass(){
	if (obj('chkpass').checked){
		obj('idvpass').innerHTML="<input type=text name=txtpassw id=txtpassw style='width:87%' class=form_contact value='"+obj('txtpassw').value+"'>"	
	}else{
		obj('idvpass').innerHTML="<input type=password name=txtpassw id=txtpassw style='width:87%' class=form_contact value='"+obj('txtpassw').value+"'>"			
	}
	
}
function dateinf(champ1,champ2,message,champs){
	var reg=new RegExp("/", "g");
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2
	
	date1=document.getElementById(champ1).value.replace(reg,"-")
	date2=document.getElementById(champ2).value.replace(reg,"-")
	
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");

	date1 = Date.parse(date1);
	date2 = Date.parse(date2);
	
	//if (date1 == date2) { return true;}
	if (date1 < date2){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML=message
		document.getElementById(champs).value=''
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}

}
function dateinf_2(champ1,champ2,message,champs){
	var reg=new RegExp("/", "g");
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2
	
	date1=document.getElementById(champ1).value.replace(reg,"-")
	date2=document.getElementById(champ2).value.replace(reg,"-")
	
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");

	date1 = Date.parse(date1);
	date2 = Date.parse(date2);
	
	//if (date1 == date2) { return true;}
	if (date1 < date2){
		//document.getElementById('id_validation').style.visibility='visible'
		//document.getElementById('id_validation').innerHTML=message
		alert(message)
		document.getElementById(champs).value=''
		document.getElementById(champs).focus()
		return false
	}else{
		//document.getElementById('id_validation').style.visibility='hidden'
		return true
	}

}

function dateinf_(champ1,champ2,message,champs){
	var reg=new RegExp("/", "g");
	// Compare 2 dates au format jj/mm/aaaa
	// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2
	
	date1=document.getElementById(champ1).value.replace(reg,"-")
	date2=document.getElementById(champ2).value.replace(reg,"-")
	
	var date1 = dato(date1,"-");// Ne pas oublier d'utiliser cette fonction
	// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript
	var date2 = dato(date2,"-");

	date1 = Date.parse(date1);
	date2 = Date.parse(date2);
	
	//if (date1 == date2) { return true;}
	if (date1 < date2){
		document.getElementById('id_validation_').style.visibility='visible'
		document.getElementById('id_validation_').innerHTML=message
		document.getElementById(champs).value=''
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation_').style.visibility='hidden'
		return true
	}

}

/*************** Hotel xml ****************************************/
function AfficheVille_hotel(vil){ 
 
		data="&vil="+vil.value
		http.open("POST", "actions.php?actions=AficheVilles_hotel&"+data, true);
		http.onreadystatechange = ResultaVilles_hotel;
		http.send(null);		 
		 
 
}
function ResultaVilles_hotel() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
		//alert(results)
		if(results[0]==1){
			VilleCode=results[2].split(',');
			VilleName=results[3].split(',');
			ResVille1=""
			if(VilleCode.length>1){
				leChoix = document.moteur.Ville_Hetr;
				leChoix.options.length=0;
				 
				sel = 0;
				for(i=0;i<VilleCode.length-1;i++){
					leChoix.options[i] = new Option(VilleName[i], VilleCode[i] + "|" + VilleName[i]);					 
				}
				leChoix.selectedIndex = sel;
			}		
		}			 
	
	
	}
} 

var Message=""
Message+='<div id="progbar2" style="position: absolute; top: 206px; z-index:1003; border: 2px solid rgb(226, 174, 118); background: none repeat scroll 0% 0% rgb(251, 209, 163); left: 420px; width: 420px; padding: 20px; opacity: 0.9;" align="center">'
Message+='<span style="padding: 20px; color: rgb(0, 0, 0); font-size: 18px;" id="progbar3">Veuillez patienter, nous mettons à jour les résultats...</span>'
Message+='<div><img src="./images/loading.gif"></div> '
Message+='</div> '

function Envoye_Requet(){
	/*Pays_Hetr=obj("Pays_Hetr").value;
	Ville_Hetr=obj("Ville_Hetr").value;
	data_Hetr_D=obj("data_Hetr_D").value;
	data_Hetr_R=obj("data_Hetr_R").value;*/
	/*NombreChambres=obj("NombreChambres").value;
	NombreAdultes=obj("NombreAdultes").value;
	NombreEnfants=obj("NombreEnfants").value;
	NombreBebes=obj("NombreBebes").value;*/
	
	
	if (!message('Pays_Hetr','Pays ')) return false
			if (!message('Ville_Hetr','Ville ')) return false
			if (!message('data_Hetr_D','Date Départ ')) return false
			if (!message('data_Hetr_R','Date Retour ')) return false
			/*if(obj('NombreAdultes').value==0 && obj('NombreEnfants').value==0){
				obj('NombreAdultes').value=1;
			}*/
			document.getElementById('Mes_id').style.display='block';
			document.getElementById('Mes_id').innerHTML=Message
			document.getElementById('fade').style.display='block';
			obj('moteur').method='post';
			obj('moteur').action="hot_etr_liste.php";
			
			obj('moteur').submit();
			document.getElementById('Mes_id').style.display='block';
			document.getElementById('Mes_id').innerHTML=Message
			document.getElementById('fade').style.display='block';
}

function Page_suiv_etr(Nbpage,N){
	var Npage=obj('Pg'+N).value
		if(eval(Npage)<eval(Nbpage)){
			obj('page1').value=Npage-(-1)
			obj('page2').value=Npage-(-1)
			obj('Pg1').value=Npage-(-1) 
			obj('Pg2').value=Npage-(-1) 
			 affiche_Hotel_xml(N)
		}
		
	}
	function Page_prec_etr(N){
			var Npage=obj('Pg'+N).value
		if(eval(Npage)>1){
			obj('page1').value=Npage-(1)
			obj('page2').value=Npage-(1)
			obj('Pg1').value=Npage-(1)
			obj('Pg2').value=Npage-(1)
			affiche_Hotel_xml(N)
		}
		
	}
	
	function tri_nombres(a,b)
{ return eval(a['Amount0'])-eval(b['Amount0']); }
function sortByFirstName(a, b) {
    var x = a.FirstName;//.toLowerCase();
    var y = b.FirstName;//.toLowerCase();
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	return x-y;
}
function tri_nombres_desc(a,b)
{ return eval(b['Amount0'])-eval(a['Amount0']); }
function sortByFirstName(a, b) {
    var x = a.FirstName;//.toLowerCase();
    var y = b.FirstName;//.toLowerCase();
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	return x-y;
}

function Voir_offre_xml(codehot,Prixhot,type){
	//alert(codehot+","+Prixhot+","+type)
	document.getElementById('Mes_id').style.display='block';
	document.getElementById('Mes_id').innerHTML=Message
	document.getElementById('fade').style.display='block';
	obj('actionsXml').value="dethotel"	 
	obj('txtcodehotXml').value=codehot	
	obj('txtPrxhotXml').value=Prixhot	
	obj('NTypeXml').value=type
	//alert(obj('txtcodehotXml').value)
	obj('formvoy').method="post"			
	obj('formvoy').action="fiche_hot_etr.php"		
	obj('formvoy').submit()	 
	document.getElementById('Mes_id').style.display='block';
	document.getElementById('Mes_id').innerHTML=Message
	document.getElementById('fade').style.display='block';
}
function change_Aff_NombrechambreXml(Nb){
	 
		document.getElementById('nb_chambre').innerHTML=Nb+' Chambre(s)'
		
		for(i=2;i<5;i++)
			document.getElementById('Person'+i).style.display='none';
		for(i=2;i<=eval(Nb);i++)	
			document.getElementById('Person'+i).style.display='block';
}
function change_Aff_NombrechambreXml2(Nb){
	 
		 
		for(i=2;i<5;i++)
			document.getElementById('Person1'+i).style.display='none';
		for(i=2;i<=eval(Nb);i++)	
			document.getElementById('Person1'+i).style.display='block';
			
			
			}
/**************************** Inscription  ***********************************/
function Affiche_Inscr(){
	document.getElementById('inscrip_id').style.display='block';
	document.getElementById('ident_id').style.display='none';
}

function ajouter_client(Ajout){
 
	Civil=document.f1.Civil.value
	Nom=document.f1.Nom.value
	
	Prenom=document.f1.Prenom.value
	birthday_day=document.f1.birthday_day.value
	birthday_month=document.f1.birthday_month.value
	birthday_year=document.f1.birthday_year.value
	Tel=document.f1.Tel.value
	Pays=document.f1.Pays.value
	Ville=document.f1.txtville.value
	Email=document.f1.Email.value	
	MDP=document.f1.MDP.value
	CMDP=document.f1.CMDP.value
	  
	/*PNom=document.f1.PNom.value
	
	Marie=document.f1.Marie.value
	Enf='0'
	if(Marie=='Oui')
		Enf=document.f1.Enf.value
	AgeEnf1='0'	
	if(Enf=='1')
		AgeEnf1=document.f1.AgeEnf1.value
	AgeEnf2='0'	
	if(Enf=='2')
		AgeEnf2=document.f1.AgeEnf2.value
	
	
	 
	comment=(obj('comment1').checked)?1:((obj('comment2').checked)?2:(obj('comment3').checked)?3:(obj('comment4').checked)?4:(obj('comment5').checked)?5:1);
	
	Autre=document.f1.Autre.value*/
	 
	//codeSec=document.f1.codeSec.value
	//offres=(document.f1.offres.checked)?1:0;
	offres=1;
	 
	//offres=(document.f1.offres.checked)?1:0;

	if (!message('Civil','Civilité ')) return false
	if (!message('Nom','Nom')) return false
	if (!message('Prenom','Prénom')) return false
	if(birthday_day<1){
		alert("Vous devez saisir la date de naissance")
		
		document.f1.birthday_day.focus()
		return false
	}
	if(birthday_month<1){
		alert("Vous devez saisir la date de naissance")
		document.f1.birthday_month.focus()
		return false
	}
	if(birthday_year<1){
		alert("Vous devez saisir la date de naissance")
		document.f1.birthday_year.focus()
		return false
	}
	if (!message('Tel','Téléphone')) return false
	if (!message('Pays','Pays')) return false
	if (!message('txtville','Ville')) return false
	if (!checkmail_('Email','Email')) return false
	verifyEmail(Email)
	if(document.f1.verif.value=='0'){
	 alert("Cette e-mail est déjà utilisée");
	 document.f1.Email.focus()
	return false
	}
	if (!message('MDP','Mot de passe ')) return false
	if (!message('CMDP','Confirmation mdp')) return false
	if(CMDP!=MDP){
		alert("vérifier votre Mot de passe")
		document.f1.MDP.value=""
		document.f1.CMDP.value=""
		document.f1.MDP.focus()
		return false
	}
	/*if(PNom!=""){
	if (!checkmail_('PNom','Email du parrain')) return false
	 
	}
	
	if(comment=='5'){
		if (!message('Autre','Autre')) return false
	}	*/
	//if (!message('codeSec','code de sécurité')) return false
	 
	 	//offres,codeSec,comment,AgeEnf2,AgeEnf1,Enf,Marie,PNom,CMDP,MDP,Email,Tel,birthday_year,birthday_month,birthday_day,Prenom,Nom,Civil
	
	// if (confirm("Continuez-vous à ajouter votre compte")){
				
					data="&Civil="+Civil
					data+="&Nom="+Nom			 
					data+="&Prenom="+Prenom			 
					data+="&birthday_day="+birthday_day		 					 
					data+="&birthday_month="+birthday_month
					data+="&birthday_year="+birthday_year
					data+="&Tel="+Tel
					data+="&Pays="+Pays
					data+="&Ville="+Ville
					data+="&Email="+Email
					data+="&MDP="+MDP						
					data+="&CMDP="+CMDP
					/*data+="&PNom="+PNom			 
					data+="&Marie="+Marie			 
					data+="&Enf="+Enf		 					 
					data+="&AgeEnf1="+AgeEnf1
					data+="&AgeEnf2="+AgeEnf2
					data+="&comment="+comment*/
					//data+="&codeSec="+codeSec
					data+="&offres="+offres	 	 				
					http.open("POST","actions.php?actions=ajouter&Panier="+Ajout+"&"+data, true);
					http.onreadystatechange = recchaClient;
					http.send(null);
					
					document.getElementById("Env_bt").style.display='none';				 
				 
					document.getElementById('Messg').style.visibility='visible'
					document.getElementById('Messg').innerHTML='<center><font color=green>Attendez s\'il vous plait....</font></center> '
			//	}
				
				return false
	}//AJOUT 
	
	
	
	 
			
			
	
	
	
	
	function recchaClient() {
	//alert(http.readyState);
	
		if (http.readyState == 4) {		
			results = http.responseText.split("::");
		//verifyEmail(document.f1.Email.value)
		
			if (results[0]==1){					
			alert("Votre Compte est ajoutée avec succès")		
			 if (results[1]==3){
				obj('actionsP').value="commander_Ajouter"			 
				obj('formvoy').method="post"
				obj('formvoy').action='panier.php'
				obj('formvoy').submit()
			}			
			else{
				 			 
				obj('formvoy').method="post"
				obj('formvoy').action='panier.php'
				obj('formvoy').submit()
			}	
				
			}
		/*	else if (results[0]==2){
			
					document.getElementById("Env_bt").style.display='block';					 
					document.getElementById('Messg').style.visibility='hidden'
			alert("les codes de sécurité ne sont pas valider")		 
				 
			}*/
			else{
				
				//alert("Erreur de données")
				 
			}
			
		}
	}
	function checkmail_(champs,libelle){
	if ( !filter.test(document.getElementById(champs).value) ){
		
		alert("L'adresse email du champ "+libelle+" n'est pas valide ")
		document.getElementById(champs).focus()
		return false
	}else{
		
		return true
	}
}

function verifyEmail(email){
	
		if (filter.test(email)){	  
			data="&Email="+email	 				
			http.open("POST","actions.php?actions=Verif_Email&"+data, true);
			http.onreadystatechange = recchaEmail;
			http.send(null);
		}
		else  writediv('vrfEmail',"<font style='color:red'><img src='./web/images/remove.gif'></font><input name=verif value=0 type=hidden>")
	}
function recchaEmail() {
	//alert(http.readyState);
		if (http.readyState == 4) {		
			results = http.responseText.split("::");
			 
		if(results[0]==1){
			 writediv('vrfEmail',"<font style='color:red'><img src='./web/images/remove.gif'></font><input name=verif value=0 type=hidden>")
				 return false
			}
			if(results[0]==2){
			writediv('vrfEmail',"<font style='color:green'><img src='./web/images/check_ok.gif'></font><input name=verif value=1 type=hidden>")
			}
			}
			
		}
		
/*************** Devise *******************************/
function RechargerDevise(){
obj('form_devise').method="post"			
	obj('form_devise').action=""		
	obj('form_devise').submit()	 	
}
/****************************** Congre *********************************/

 function change_Pays_Cong(P){
	 
 }
function Envoyer_Congres(){

	obj('id_validation').style.visibility='hidden'
	 
	companyname	=	obj('companyname').value
	Adresse	=	obj('Adresse').value
	CodeRc	=	obj('CodeRc').value
	postcode	=	obj('postcode').value
	Vil	=	obj('city').value
	Nom	=	obj('txtnom').value
	Pren	=	obj('txtpn').value
	Pay	=	obj('countryid').value
	 
	contactname	=	obj('contactname').value
	contacttitle	=	obj('contacttitle').value
	Email	=	obj('txtemail').value	
	
	NPers	=	obj('NPers').value
	var VDemandecheck=0;
	var VDemande=new Array();
	for(i=1;i<=12;i++){
		//VDemande[i]	=	obj('VDemande'+i).checked
		VDemande[i]=0;
		if(obj('VDemande'+i).checked){
			VDemandecheck=1;
			VDemande[i]=obj('VDemande'+i).value;
		}
	}
	
 
	 
	/*var varCombo = document.getElementById('country');
   alert(varCombo.options[varCombo.selectedIndex].text)*/
	  
	  
	if (!messages('companyname','Nom de la Société')) return false
	if (!messages('Adresse','Adresse ')) return false
	if (!messages('CodeRc','Code RC')) return false
	if (!messages('postcode','Code Postal')) return false
	if (!messages('city','Ville ')) return false
	if (!messages('countryid','Pays ')) return false		
	if (!messages('contactname','Personne de contact ')) return false
	if (!messages('contacttitle','Titre ')) return false
	if (!messages('txtpn','Prénom')) return false
	if (!messages('txtnom','Nom')) return false		
	
	if (!checkmail('txtemail','Adresse e-mail')) return false
	if(VDemandecheck=='0'){
		 document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Vous devez choisir un ou plusieurs services "
	return false
	}
	//if (!messages('VDemande','Votre demande concerne ')) 		
	if (!adad_posit('NPers','Nombre de personnes')) return false	
	
		data="&companyname="+companyname
		data+="&Adresse="+Adresse
		data+="&CodeRc="+CodeRc
		data+="&postcode="+postcode	
		data+="&Vil="+Vil
		data+="&Pay="+Pay
		data+="&Nom="+Nom
		data+="&Pren="+Pren
		data+="&contactname="+contactname
		data+="&contacttitle="+contacttitle
		
		data+="&Email="+Email
		data+="&VDemande="+VDemande
		data+="&NPers="+NPers
		
		 obj('form1').reset();
		 
		 document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Attendez s\'il vous plait...."
		http.open("POST", "actions.php?actions=envoyer_congre&"+data, true);
		http.onreadystatechange = ECongre;
		http.send(null);
	
	return false
}
function ECongre() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
	//alert(results)
		{
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML=results[1]
		}
		//obj('txtsoc').focus()
			
	}
} 

/*******************************/
function popupcentree(page,largeur,hauteur,options) 
{ 
    var top=(screen.height-hauteur)/2; 
    var left=(screen.width-largeur)/2;
    window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); 
} 

/********* Rejoindre Nous ************************/

function Envoyer_Emploi(){

	obj('id_validation').style.visibility='hidden'
	 
	
	Nom	=	obj('txtnom').value
	Pren	=	obj('txtpn').value
	Fonct	=	obj('Fonct').value
	txtTel	=	obj('txtTel').value
	
	  
	if (!messages('txtnom','Votre Nom ')) return false	
	if (!messages('txtpn','Votre Prénom ')) return false			 
	if (!messages('Fonct','Fonction souhaitée ')) return false		
	if (!messages('txtTel','Tel Mobile ')) return false	
	if (!messages('txtCV','Votre CV ')) return false	
		allowedExts = new Array("doc", "docx", "pdf");
		if(obj('txtCV').value!=""){
			if(!isExtsAllowed(obj('txtCV').value)) {
				alert("Désolé, vous ne pouvez uploder que les fichiers de type  Doc, pdf");
				return false;
			}
		}
		
		data="&Nom="+Nom
		data+="&Pren="+Pren
		data+="&Fonct="+Fonct
		data+="&txtTel="+txtTel
		
		 
		// obj('form1').reset();
		 
		 document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Attendez s\'il vous plait...."
		http.open("GET", "actions.php?actions=envoyer_emploi&"+data, true);
		http.onreadystatechange = EEmploi;
		http.send(null);
	
	return false
}
function EEmploi() {
	if (http.readyState == 4) {
		results = http.responseText.split("::");
	//alert(results)
		{
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML=results[1]
		//alert(obj('txtCV').value)
		 if(obj('txtCV').value!=""){
					obj('actions').value="ajCV"
					obj('txtcodeEmp').value=results[2]
					obj('form1').action="rejoindre_transatour.php"
					obj('form1').method="post"
					obj('id_validation').innerHTML="<img src='images/indicator.gif' width=16 height=16> Chargement de CV en cours ..."
					obj('form1').submit()
		 }
				 
				
		}
		//obj('txtsoc').focus()
			
	}
} 

/*************************** News lettre ***********************/

 function envoi_newsletter(){
	 
	 
 Email_NL=obj('txtnewsletteremail').value;
 if(!checkmail_NL('txtnewsletteremail')) return false; 	 
		data="&Email_NL="+Email_NL				
		http.open("POST","actions.php?actions=Envoye_NL&"+data, true);
		http.onreadystatechange = EnvoyeNL;
		http.send(null);		
	return false;		
}
function supprimer_NL(){
	 
	 
 Email_NL=obj('txtnewsletteremail').value;
 if(!checkmail_NL('txtnewsletteremail')) return false; 	 
		data="&Email_NL="+Email_NL				
		http.open("POST","actions.php?actions=Supprimer_NL&"+data, true);
		http.onreadystatechange = EnvoyeNL;
		http.send(null);		
	return false;		
}
function EnvoyeNL() {
	
	if (http.readyState == 4) {
		results = http.responseText.split("::");
	// alert(results)
		{		
		alert(results[1])
		obj('txtnewsletteremail').value="Votre E-mail"
		
		}
		
			
	}
} 

 function checkmail_NL(champs){
	if ( !filter.test(document.getElementById(champs).value) ){
		
		alert("L'adresse email n'est pas valide ")
		document.getElementById(champs).focus()
		return false
	}else{
		
		return true
	}
}

function Votremail_NL(champs) {
	
	if ( !filter.test(document.getElementById(champs).value) ){
		
		obj(champs).value="Votre E-mail"
		return false
	}else{
		
		return true
	}
} 

/**************** add favoris **************************************/
    
      var urlAddress = "http://www.transatour.ma";
      var pageName = "Transatour Maroc";
      function addToFavorites(anchor)
      {
      if (window.external)
      {
      window.external.AddFavorite(anchor.getAttribute('href'), anchor.getAttribute('title'));
      }
      }
/*********************************************************************/
 

var isNS = (navigator.appName == "Netscape") ? 1 : 0;
var EnableRightClick = 0;
if(isNS) document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler()
{ if(EnableRightClick==1)
{ return true; }
else {return false; }}
function mousehandler(e)
{ if(EnableRightClick==1){ return true; }
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;}
function keyhandler(e) { var myevent = (isNS) ? e : window.event;
if (myevent.keyCode==96) EnableRightClick = 1;
return;}document.oncontextmenu = mischandler;
document.onkeypress = keyhandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;



 function messages_mdp(champs,libelle){
	if (document.getElementById(champs).value==""){
		document.getElementById('id_validation').style.visibility='visible'
		document.getElementById('id_validation').innerHTML="Le champs "+libelle+" est obligatoire !"
		document.getElementById(champs).focus()
		return false
	}else{
		document.getElementById('id_validation').style.visibility='hidden'
		return true
	}
}

/*************************/

function Inscrire_programme_bt(NPer,type){
	  
	obj('actions').value="ressejours"	 
	obj('txtNPeride').value=NPer		 
	obj('form1').method="post"		
	if(type=='sejours')
		obj('form1').action="inscrire_sejour.php"	 	
	if(type=='circuits')
		obj('form1').action="inscrire_circuits.php"	 	
	if(type=='voyages')
		obj('form1').action="inscrire_voyages_organises.php"	 	
	if(type=='omra')
		obj('form1').action="inscrire_omra.php"	 				
	obj('form1').submit()	 
}

function Inscrire_programme(ID_HOT,type){

	var reg=new RegExp("\r", "g");
	//choix=toto
	//chambre=document.getElementById('sltchambres').value
	
	code=ID_HOT
	//da=document.getElementById('txtdr').value
	//dd=document.getElementById('txtdd').value
	//Chambre=document.getElementById('sltChambre').value
	//Pension=document.getElementById('sltPension').value
	//cha=document.getElementById('depart').value
 	prix=document.getElementById('prix_total').value
	Type=type;
	idprix=document.getElementById('depart').value
	
	nbra=document.getElementById('sltadultes').value
	nbre=document.getElementById('sltenfants').value
	nbrb=document.getElementById('sltbebes').value
	nom=document.getElementById('txtnom').value
	prenom=document.getElementById('txtprenom').value
	tel=document.getElementById('txtel').value
	email=document.getElementById('txtemail').value
	adresse=document.getElementById('txtadresse').value
	ville=document.getElementById('txtville').value
	cp=document.getElementById('txtcp').value
	pays=document.getElementById('txtpays').value
	//autre=document.getElementById('txtautre').value
	//codepai=radioCliked('formres','rdpai')	


	//if (!messages('txtdd','Date de départ')) return false
	//if (!messages('txtdr','Date de Retour')) return false
	 
	
	if (!messages('txtnom','Nom')) return false
	if (!messages('txtprenom','Prénom')) return false
	if (!messages('txtel','Téléphone')) return false

	if (!messages('txtemail','E-mail')) return false
	if (!checkmail('txtemail','E-mail')) return false

	/*if (radioCliked('formres','rdpai')==0)
		if (!messages('txtautre','Autres  prciser')) return false*/

	data="code="+code
	//data+="choix="+choix
	//data+="chambre="+chambre	
	//data+="&da="+da
	//data+="&dd="+dd
	
	//data+="&Chambre="+Chambre
	//data+="&Pension="+Pension
	 
	 data+="&idprix="+idprix
	 data+="&Type="+Type
	data+="&prix="+prix
	data+="&nbra="+nbra
	data+="&nbre="+nbre
	data+="&nbrb="+nbrb
	data+="&nom="+nom
	data+="&prenom="+prenom
	data+="&tel="+tel
	data+="&email="+email
	data+="&adresse="+adresse
	data+="&ville="+ville
	data+="&cp="+cp
	data+="&pays="+pays
	 
	//data+="&codepai="+codepai	
	//data+="&autre="+autre
	//data+="&obs="+obs
	 
	http.open("POST", "actions.php?actions=ajresProg&"+data, true);
	http.onreadystatechange = reshres;
	http.send(null);
	document.getElementById('id_validation').style.visibility='visible'
	document.getElementById('id_validation').innerHTML="<font color=green>Attendez s\'il vous plait....</font>"
	return false
	
}

function reshres() {
//alert(http.responseText)
	if (http.readyState == 4) {
		results = http.responseText.split("::");
	 //	alert(results)
		if (results[0]==1){
			document.getElementById('id_validation').style.visibility='visible'
			document.getElementById('id_validation').innerHTML="Votre demande est en cours de traitement"
			document.formvoy2.reset()
		}else{
			document.getElementById('id_validation').style.visibility='visible'
			document.getElementById('id_validation').innerHTML="Vos informations ne sont pas envoyes avec succs"
		}
		
	}
	
}  			
