setInterval('changeBackground()',30000)

function dsp_sousMenu(TR_name){	
	if(navigator.appName.indexOf("Internet Explorer") != -1){
		dsp_block = "block";
	}else{
		dsp_block = "table-row";
	}	
	tr_all = zone_sommaire.getElementsByTagName('TR')
	for(tr=0;tr<tr_all.length;tr++){
		if(tr_all[tr].className == 'sousMenu' ){
			tr_all[tr].style.display = 'none';
		}
	}
	for(tr=0;tr<tr_all.length;tr++){
		if(tr_all[tr].id == TR_name ){
			tr_all[tr].style.display = dsp_block;
		}
	}
}

/*
*************************************************************************************
Fonctions de navigation
*************************************************************************************
*/

function echanger(img1,img2){
	if(document.images){
		img1.src = img2
	}
}

function opn_window(page,nom,proprietes){	
	window.open(page,nom,proprietes)
}

function att_type(typeS){
	document.rechercher.typeS.value = typeS
}

function Go_navi(page,MID,pageR){		
	document.sommair.page.value=page
	document.sommair.MID.value=MID;
	document.sommair.pageR.value=pageR;
	document.sommair.TID.value=1;
	document.sommair.submit();	
}

function goPanier(panier_action,Nvid,lng){
	switch(lng){
		case '1':
			txt_areUsure 		= "Etes vous sur ? ";
			txt_viderP 			= "Etes vous sur de vouloir vider votre panier ?";
		break;
		case '2':
			txt_areUsure 		= "Are your sure ?";
			txt_viderP	 		= "Are your sure to want to erase your basket ?";			
		break;
		case '3':
			txt_areUsure 	 	= "Are your sure ?";
			txt_viderP 		 	= "Are your sure to want to erase your basket ?";
		break;
	}
	switch(panier_action){
		case "view":
			location.href="index.php?page=panier&panier_action="+panier_action+"&langue_id="+lng;		
		break;
		case "add":		
			QTE = document.F_art.FLD_Qte.options[document.F_art.FLD_Qte.selectedIndex].value;			
			lst_ids = document.F_art.lst_ids.value;
			MID = Nvid
			dec_lstids = lst_ids.split(',');
			for(i=1;i<dec_lstids.length;i++){
				N_idx = eval("document.F_art.feat_"+dec_lstids[i]+".selectedIndex")
				N_idxVal = eval("document.F_art.feat_"+dec_lstids[i]+".options[document.F_art.feat_"+dec_lstids[i]+".selectedIndex].value")
				MID += ","+N_idxVal				
			}
			window.open('page/panier.php?&page=panier&panier_action=add&MID='+MID+'&QTE='+QTE+"&VID="+lst_ids+'&langue_id='+lng,'caddy','width=300 height=150 status=yes')
		break;	
		case "vider":
			if(confirm(txt_viderP)){				
				location.href="index.php?page=panier&panier_action="+panier_action+"&langue_id="+lng;						
				return false
			}			
		break;
		case "remove_P":
			if(confirm(txt_areUsure)){	
				location.href="index.php?page=panier&panier_action="+panier_action+"&MIDS="+Nvid+"&langue_id="+lng;		
				return false
			}				
		break;
		default:// inscription,mdp,unlogin,login
			location.href="index.php?page=panier&panier_action="+panier_action+"&langue_id="+lng;		
		break;				
	}	
}

function consult_panier(lng){
	//opener.fctCallWaitMessage()
	window.opener.window.opener.location.href="../panier-view-"+lng+"-panier.html";
	window.opener.window.close();
	//window.opener.location.href="../index.php?page=panier&panier_action=view";
	window.close();
}

function att_featVal(formulaire,element){	
	oForm = document.forms[formulaire]
	idx = oForm.elements[element].selectedIndex
	lstVal_field = oForm.val_ids.value
	if(idx > 0){
		featId = oForm.elements[element].options[idx].value3		
		featPrix = oForm.elements[element].options[idx].value2	
		oForm.val_ids.value += ","+featId
		
		alert(lstVal_field.indexOf(featId,0));
		if(lstVal_field.indexOf(featId,0) == -1){			
			oForm.val_ids.value += ","+featId
			if(featPrix){			
				strInt = document.getElementById("TD_tarif").innerHTML	
				//document.getElementById("TD_tarif").innerHTML += "<br>"+"+"+featPrix+" € TTC";
			}				
		}				
	}else{
		//location.href = location.href
	}	
}

/* *********************************************************************************
update du panier
********************************************************************************* */
function upt_Qte(MID,FQTE,toto,lng){
	location.href="index.php?page=panier&panier_action=upt_panier&MID="+MID+"&F_Qte="+FQTE+"&langue_id="+lng		
}
function upt_Dst(pays_id,lng){
	location.href="index.php?page=panier&panier_action=view&pays_id="+pays_id+"&langue_id="+lng
}
function upt_Liv(livraison_id,lng){
	location.href="index.php?page=panier&panier_action=view&livraison_id="+livraison_id+"&langue_id="+lng
}

function dsp_val(element,valeur){
	document.forms[0].elements[element].value = valeur
}

/*
*************************************************************************************
Fonctions de navigation
*************************************************************************************
*/

//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

/*
*************************************************************************************
Fonctions d'inscription
*************************************************************************************
*/
function act_livraison(action){
	liv_zone = zone_livraison.getElementsByTagName('input');	
	switch(action){
		case '1':
			document.getElementById('zone_livraison').style.visibility="hidden";			
			for(i=0;i<liv_zone.length-1;i++){	
				document.forms[0].elements[liv_zone[i].name].disabled=true;
			}			
		break;
		case '0':
			document.getElementById('zone_livraison').style.visibility="visible";			
			for(i=0;i<liv_zone.length-1;i++){	
				document.forms[0].elements[liv_zone[i].name].disabled=false;			
			}				
		break;
	}		
}

function verif_PanierForm(formulaire,lng){
	oForm = document.forms[formulaire];
	switch(lng){
		case '1':			
			txt_alert_email					= "Veuillez saisir E-mail";
			txt_alert_email_inc 			= "E-mail invalide\nvérifiez la syntaxe";			
			txt_alert_mdp					= "Veuillez saisir un mot de passe";
			txt_alert_mdp_confirm			= "Veuillez confirmer votre mot de passe";
			txt_alert_nom 					= "Veuillez saisir votre nom";
			txt_alert_prenom 				= "Veuillez saisir votre prénom";
			txt_alert_adresse 				= "Veuillez saisir votre adresse";
			txt_alert_code_postal 			= "Veuillez saisir votre code postal";
			txt_alert_code_ville			= "Veuillez saisir votre ville";
			txt_alert_code_tel 				= "Veuillez saisir votre n° de téléphone";
			txt_cond_ventes					= "Vous devez accepter les conditions générales de ventes";
			
			txt_alert_nom_liv 				= "Veuillez saisir votre nom";
			txt_alert_prenom_liv 			= "Veuillez saisir votre prénom";
			txt_alert_adresse_liv 			= "Veuillez saisir votre adresse";
			txt_alert_code_postal_liv 		= "Veuillez saisir votre code postal";
			txt_alert_code_ville_liv 		= "Veuillez saisir votre ville";
			txt_alert_code_tel_liv 			= "Veuillez saisir votre n° de téléphone";
			
			txt_alert_typeS					= "Veuillez sélection un critère de recherche";
			txt_alert_mot					= "Veuillez saisir un mot clé";
			txt_alert_cat					= "Veuillez sélectionner une catégorie";
			txt_alert_alpha					= "Veuillez sélectionner une lettre";
			txt_alert_incCat				= "Sélection incorrecte";
			// demande de devis
			txt_alert_demande				= "Veuillez saisir votre demande";	
		break;
		case '2':
			txt_alert_email					= "Please type your E-mail";
			txt_alert_email_inc 			= "Incorrect E-mail ";			
			txt_alert_mdp					= "Please type a password";
			txt_alert_mdp_confirm			= "please confirm your password";
			txt_alert_nom 					= "Please type your last name";
			txt_alert_prenom 				= "Please type your first name";
			txt_alert_adresse 				= "Please type your adress";
			txt_alert_code_postal 			= "Please type your zip code";
			txt_alert_code_ville			= "Please type your city";
			txt_alert_code_tel 				= "Please type your phine number";
			txt_cond_ventes					= "You must be agree with the generals conditions terms";
			
			txt_alert_nom_liv 				= "Please type your last name";
			txt_alert_prenom_liv 			= "Please type your first name";
			txt_alert_adresse_liv 			= "Please type your adress";
			txt_alert_code_postal_liv 		= "Please type your zip code";
			txt_alert_code_ville_liv 		= "Please type your city";
			txt_alert_code_tel_liv 			= "Please type your phine number";
			
			txt_alert_typeS					= "please sélect a search option";
			txt_alert_mot					= "please type a key word";
			txt_alert_cat					= "please select a category";
			txt_alert_alpha					= "please select a letter";
			txt_alert_incCat				= "Incorrect selection";
			// demande de devis
			txt_alert_demande				= "please type your request";	
		break;
	}
	
	
	
	switch(formulaire){		
		case 'rechercher':
			if(!oForm.typeS.value){
				alert(txt_alert_typeS)				
				return false
			}
			
			switch(oForm.typeS.value){
				case '1':
					if(oForm.sAlpha.selectedIndex < 1){
						alert(txt_alert_alpha)
						oForm.sAlpha.focus();
						return false
					}
				break;
				case '2':
					sCatid = oForm.sCat.options[oForm.sCat.selectedIndex].id
					if(sCatid == 'Prub'){
						alert(txt_alert_incCat)
						oForm.sCat.focus();
						return false
					}	
					if(oForm.sCat.selectedIndex < 1){
						alert(txt_alert_cat)
						oForm.sCat.focus();
						return false
					}
				break;
				case '3':
					if(!oForm.mot.value){
						alert(txt_alert_mot)	
						oForm.mot.focus();			
						return false
					}			
				break;
			}
		break;
		case 'mdp':
			if(!oForm.email.value){
				alert(txt_alert_email)
				oForm.email.focus();
				return false
			}
			
			if ((oForm.email.value.indexOf("@",1)>1)&&(oForm.email.value.indexOf(".",1)>0)){			
			}else{
				alert(txt_alert_email_inc);
				oForm.email.focus();
				return false
			}			
					
			oForm.panier_action.value="mdp";
			oForm.submit();
		break;
		case 'login':
			/*
			if(!oForm.nom.value){
				alert(txt_alert_email)
				oForm.nom.focus();
				return false
			}
			
			if(!oForm.prenom.value){
				alert(txt_alert_email)
				oForm.prenom.focus();
				return false
			}
			*/
			if(!oForm.email.value){
				alert(txt_alert_email)
				oForm.email.focus();
				return false
			}
			
			if ((oForm.email.value.indexOf("@",1)>1)&&(oForm.email.value.indexOf(".",1)>0)){			
			}else{
				alert(txt_alert_email_inc);
				oForm.email.focus();
				return false
			}			
			
			if(!oForm.mdp.value){
				alert(txt_alert_mdp)
				oForm.mdp.focus();
				return false
			}
			oForm.panier_action.value="login";
			oForm.submit();
		break;
		case 'mailing':
			if(!oForm.nom.value){
				alert(txt_alert_nom_liv)
				oForm.nom.focus();
				return false
			}
			
			if(!oForm.prenom.value){
				alert(txt_alert_prenom_liv)
				oForm.prenom.focus();
				return false
			}
			
			if(!oForm.email.value){
				alert(txt_alert_email)
				oForm.email.focus();
				return false
			}
			
			if ((oForm.email.value.indexOf("@",1)>1)&&(oForm.email.value.indexOf(".",1)>0)){			
			}else{
				alert(txt_alert_email_inc);
				oForm.email.focus();
				return false
			}			
			
		break;
		case 'devis':
			if(!oForm.nom.value){
				alert(txt_alert_nom_liv)
				oForm.nom.focus();
				return false
			}
			
			if(!oForm.prenom.value){
				alert(txt_alert_prenom_liv)
				oForm.prenom.focus();
				return false
			}
			
			if(!oForm.email.value){
				alert(txt_alert_email)
				oForm.email.focus();
				return false
			}
			
			if ((oForm.email.value.indexOf("@",1)>1)&&(oForm.email.value.indexOf(".",1)>0)){			
			}else{
				alert(txt_alert_email_inc);
				oForm.email.focus();
				return false
			}		
				
			if(!oForm.demande.value){
				alert(txt_alert_demande)
				oForm.demande.focus();
				return false
			}
		break;
		default:
		//case 'inscription'||'upt_inscription':			
			if(!oForm.email.value){
				alert(txt_alert_email)
				oForm.email.focus();
				return false
			}
			
			if ((oForm.email.value.indexOf("@",1)>1)&&(oForm.email.value.indexOf(".",1)>0)){			
			}else{
				alert(txt_alert_email_inc);
				oForm.email.focus();
				return false
			}			
			
			if(!oForm.mdp.value){
				alert(txt_alert_mdp)
				oForm.mdp.focus();
				return false
			}
			
			if(!oForm.mdp_confirm.value){
				alert(txt_alert_mdp_confirm)
				oForm.mdp_confirm.focus();
				return false
			}
			
			if(oForm.mdp.value!=oForm.mdp_confirm.value){
				alert(txt_alert_mdp_confirm)
				oForm.mdp_confirm.focus();
				return false
			}
			
			if(!oForm.nom.value){
				alert(txt_alert_nom)
				oForm.nom.focus();
				return false
			}
			
			if(!oForm.prenom.value){
				alert(txt_alert_prenom)
				oForm.prenom.focus();
				return false
			}
			
			if(!oForm.adresse.value){
				alert(txt_alert_adresse)
				oForm.adresse.focus();
				return false
			}
			
			if(!oForm.code_postal.value){
				alert(txt_alert_code_postal)
				oForm.code_postal.focus();
				return false
			}
						
			if(!oForm.ville.value){
				alert(txt_alert_code_ville)
				oForm.ville.focus();
				return false
			}			
			
			if(!oForm.tel.value){
				alert(txt_alert_code_tel)
				oForm.tel.focus();
				return false
			}
			
			if(formulaire=='upt_inscription'){
				if(!oForm.acc_cond.checked==true){
					alert(txt_cond_ventes)
					oForm.acc_cond.focus();
					return false
				}			
			}
			if(oForm.same_adr[1].checked==1){				
				if(!oForm.nom_liv.value){
					alert(txt_alert_nom_liv)
					oForm.nom_liv.focus();
					return false
				}
				
				if(!oForm.prenom_liv.value){
					alert(txt_alert_prenom_liv)
					oForm.prenom_liv.focus();
					return false
				}
				
				if(!oForm.adresse_liv.value){
					alert(txt_alert_adresse_liv)
					oForm.adresse_liv.focus();
					return false
				}
				
				if(!oForm.code_postal_liv.value){
					alert(txt_alert_code_postal_liv)
					oForm.code_postal_liv.focus();
					return false
				}
							
				if(!oForm.ville_liv.value){
					alert(txt_alert_code_ville_liv)
					oForm.ville_liv.focus();
					return false
				}			
				
				if(!oForm.tel_liv.value){
					alert(txt_alert_code_tel_liv)
					oForm.tel_liv.focus();
					return false
				}		
				
				if(oForm.email_liv.value){
					if ((oForm.email_liv.value.indexOf("@",1)>1)&&(oForm.email_liv.value.indexOf(".",1)>0)){			
					}else{
						alert(txt_alert_email_inc);
						oForm.email_liv.focus();
						return false
					}	
				}												
			}				
		break;		
	}
}
/*
*************************************************************************************
Fonctions d'inscription
*************************************************************************************
*/
function verif_seach(formulaire,lng){
	switch(lng){
		case '1':	
			txt_alert_mot					= "Veuillez saisir un mot clé";
		break;
		case '2':
			txt_alert_mot					= "Please type a key word";
		break;
	}
	oForm = document.forms[formulaire]
	if(!oForm.mot.value){	
		alert(txt_alert_mot)
		oForm.mot.focus()
		return false
	}
}


function ouvrir_fenetre(page,nom,proprietes){
	largeur = 600;
	hauteur = 420;
	M_largeur = (screen.width /2)-(largeur/2);
	M_hauteur = 185;	
	window.open(page,nom,"width="+largeur+" height="+hauteur+" top="+M_hauteur+" left="+M_largeur+"status=1 scrollbars=yes")
}
/*
**********************************************************************************************************************************
Fonctions de Delai pour chargement d'une nouvelle page
	Le seul parametre obligatoire est l'url cible
	Il est possible de modifier le delai par defaut (5 sec) comme suit
	fctDelayPageLoading('http://URLCible',0,Nouveau Delai) ou Nouveau delai est exprime en sec.
**********************************************************************************************************************************
*/
function fctDelayPageLoading(){
	if(!top.P){top.P=arguments[0];top.M=(arguments[1])?arguments[1]:0;top.D=(arguments[2])?arguments[2]:5}
	switch(top.M){
		case 0:
			top.M = 1;hTO = setTimeout(fctDelayPageLoading,D*1000);break;
		case 1:
			window.location = top.P;break;
		}
	}
/*
*********************************************************************************************************************************
Fonctions d'ouverture du calendrier
*********************************************************************************************************************************
*/
function fctOpenCalendar(sForm,sField,iLangue,bSubmit){
	bSubmit = (typeof(bSubmit)!='undefined')?bSubmit:false;
	sURL = 'page/calendar.php?myform='+sForm+'&myfield='+sField+'&mylangue='+iLangue+'&bSubmit='+bSubmit
	sFeature = 'directories=0,height=220,width=250,left=150,top=150,location=0,resizable=0,scrollbars=0,status=1,titlebar=0,toolbar=0'
	oCalWin = window.open(sURL,'wCalendard', sFeature)
	}
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Fonctions Booléenne																																										*/
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
function getBooleanValue(b){
	return (eval(b) == "true" || (eval(b) == "1" || eval(b) == "-1"));
	}
	
function fctCheckPlace(sField,sName){
	var aF	= document.getElementsByTagName(sField)
	var rM  = new RegExp(sName+'[0-9]+','gi')
	var bH	= false
	var iC	= 0
	for(var i=0;i<aF.length;i++){
		if(aF[i].name.match(rM)){
			if(!bH)var oT = aF[i]
			bH = true
			iC = (aF[i].value!=0)?iC+1:iC
		}
	}
	//alert('bH='+(bH)+' iC='+iC+';\n'+(' 1:'+(!bH&&iC==0)+' 2:'+(bH&&iC!=0))+' '+(!bH&&iC==0||(bH&&iC!=0)))
	var bChk = (!bH&&iC==0||(bH&&iC!=0))
	if(bH&&!bChk){
		fctAlert(aErrMsgOneBookAtLeast[top.Lng-1],oT,0)
	}
	return bChk
}
/*
*********************************************************************************************************************************
Fonctions de gestion de la navigation dans les pages de Services aux Agences
*********************************************************************************************************************************
*/
function fctSubmit(sMode,sParam){
	with(document.FRM_Agency){
		switch(sMode){
			case 'Sor-URL':
				action = sParam
				break
			case 'Sor-Content':
				FLD_Param.value = sParam
				break
			case 'Sor-Feature':
				FLD_Param.value = fctExtractParam(FLD_Param,1)+sParam
				break
			}
		submit()
		}
	}
function fctExtractParam(oF,iN,bE){
	var sNew = ''
	var aP = oF.value.split('|')
	bE = (bE)?bE:false
	for(i=0;i<iN;i++){
		sNew += aP[i]+'|'
		}
	sNew += (bE)?'|':''
	return sNew
	}
/*
*********************************************************************************************************************************
Fonctions de Login d'une agence
*********************************************************************************************************************************
*/
aMsgBadLogin 			= new Array('vous devez correctement saisir votre e-mail et/ou votre mot de passe','Wrong e-mail and/or password','Wrong e-mail and/or password')
aMsgMailNotFilled		= new Array('vous devez saisir votre e-mail dans le champ en surbrillance\net cliquer à nouveau sur \'Mot de Passe oublié\'','Please, fill the enlighted field with your e-mail and clic again on \'Forgotten password\'')
aMsgConfirmDeletion		= new Array('Confirmez-vous la suppression ?','Do you confirm this deletion ?','Do you confirm this deletion ?')

aErrMsgBadInsertDate	= new Array('Vous devez choisir une date valide !','You must choose a valid date !','You must choose a valid date !')
aErrMsgMissingInput		= new Array('Saisie obligatoire !','Field is required','Field is required')
aErrMsgBadPhone			= new Array('Mauvais numéro de téléphone !','Wrong phone format','Wrong phone format')
aErrMsgSelRequired		= new Array('Vous devez sélectionner une valeur dans la liste !','You must choose an item in the list !')
aErrMsgValueNotZero		= new Array('Vous devez indiquer une valeur autre que zéro','You do not choose a correct value','You do not choose a correct value')

aErrMsgOneBookAtLeast	= new Array('Vous devez réserver au moins une place en sélectionnant\n soit \'A\' pour Adulte, soit \'E\' pour Enfant !','Vous devez réserver au moins une place en sélectionnant\n \'A\' pour Adulte ou \'E\' pour Enfant','Vous devez réserver au moins une place en sélectionnant\n \'A\' pour Adulte ou \'E\' pour Enfant')

aWarMsgNotFilled		= new Array('Attention, certains champs ne sont pas renseignés','Warning : some fields have not been filled','Warning : some fields have not been filled')


aMisMsgConfirm			= new Array('Confirmez-vous le passage à l\'étape suivante ?','Do you want to continue ?','Do you want to continue ?')

function fctOnSubmit(Cmd){
	switch(Cmd){
		case 'Check':
			if(!fctCheckPlace('select','FLD_User_TypePerson_'))return false
			reMail 	= /^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/gi
			rePwd	= /^[a-zA-Z][a-zA-Z0-9]{3,18}[a-zA-Z0-9]$/gi
			switch(top.ActCmd){
				case 'Caddy':
				/* Check des formulaires de reservation											*/
				case 'Sortie':
				case 'Excursion':
				case 'Transfer':
				case 'Hotel':
					var bStopOnError 	= (arguments[1])?arguments[1]:false
					var aSrcInput 		= document.getElementsByTagName('INPUT')
					var aSrcSelect 		= document.getElementsByTagName('SELECT')
					var aCheck 			= new Array()
					var aHiddenField	= new Array()
					var aControl 		= new Array()
					var aCtrlClone		= new Array()
					var aAlt			= new Array()
					var aIdx			= new Array()
					var aWarning		= new Array()
					var reHandleCTRL 	= /_control/gi
					var reHandleWARNING = /_warning/gi
					var reDataType		= /TEXT|PHONE_FR|PHONE_INT|INSERTDATE|EMAIL|SEL-NOTZERO|ALTERNATE|CHECKED|WARNING/
					var reDataRequired	= /REQUIRED|FREE|POSITIF|NOTFILLED/
					var reName			= /[a-zA-Z0-9_]+/
					var bCheck 			= true
					/* Determine les champs INPUT a controler en fonction de la presence d'un champ hidden suffixe avec _control 	*/
					for(var i=0;i<aSrcInput.length;i++){
						if(aSrcInput[i].type=='hidden'){
							aHiddenField[aHiddenField.length] = aSrcInput[i]
							if(aSrcInput[i].name.match(reHandleCTRL)!=null){
								sF 								= aSrcInput[i].name.replace(/_control/gi,'')
								aF 								= document.getElementsByName(sF)
								aCheck[aCheck.length]			= aF[0]
								aControl[sF] 					= aSrcInput[i].value
								aCtrlClone[aCtrlClone.length]	= aSrcInput[i].value
								}
							}
						}
					/* Determine les champs INPUT a controler en fonction de la presence d'un champ hidden suffixe avec _warning 	*/
					for(var i=0;i<aHiddenField.length;i++){
						if(aHiddenField[i].type=='hidden'&&aHiddenField[i].name.match(reHandleWARNING)!=null){
							sF 								= aHiddenField[i].name.replace(/_warning/gi,'')
							aF 								= document.getElementsByName(sF)
							aCheck[aCheck.length]			= aF[0]
							aControl[sF] 					= aHiddenField[i].value
							aCtrlClone[aCtrlClone.length]	= aHiddenField[i].value
							}
						}
					/* Check les champs devant etre verifies																		*/
					for(var i=0;i<aCheck.length;i++){
						//alert(aCheck[i].outerHTML)
						//alert(aCheck[i].name)
						
						sCfg 		= aControl[aCheck[i].name].split('|')
						tstType 	= sCfg[0].match(reDataType)[0]
						tstRequired = sCfg[1].match(reDataRequired)[0]
						if(sCfg.length>2)tstName = sCfg[2].match(reName)[0]
						aCheck[i].style.backgroundColor = 'white';
						switch(tstType){
							// Pour le mode warning
							case 'WARNING':
								switch(tstRequired){
									case 'NOTFILLED':
										if(!aCheck[i].value.length&&typeof(aWarning[0])=='undefined'){
											fctAlert('',aCheck[i],1)
											aWarning[0] = (aWarning.length +1)+' - '+aWarMsgNotFilled[top.Lng-1]
										}
										break
									}
								break;
							// Pour le mode control
							case 'CHECKED':
								bTest = (	(tstRequired=='FREE')||
											(tstRequired=='REQUIRED'&&aCheck[i].checked)
										)?bCheck:false
								bCheck = bTest
								if(!bTest)fctAlert(aErrMsgMissingInput[top.Lng-1],aCheck[i],0)
								break
							case 'SEL-NOTZERO':
								bMatch = (aCheck[i].value==aCheck[i].value.match(/0/gi))
								bTest  = (!bMatch)?bCheck:false
								bCheck = bTest;	
								if(!bTest)fctAlert(aErrMsgSelRequired[top.Lng-1],aCheck[i],0)
								break
							// Test une serie de champ et verifie que l'un d'eux, dans le regroupement donne, soit :
							// POSITIF => different de 0 (zero)
							case 'ALTERNATE':
								bTest = false
								if(typeof(aAlt[tstName])=='undefined'){
									aAlt[tstName] = new Array()
									aIdx[tstName] = fctGetArrayItem(aCtrlClone,tstType,'last')
									}
								aAlt[tstName][aAlt[tstName].length] = aCheck[i].value
								if(aIdx[tstName]==i){
									switch(tstRequired){
										case 'POSITIF':
											for(var j =0;j < aAlt[tstName].length;j++){
												if(aAlt[tstName][j]>0){
													bTest = true
													break
													}
												}
											break
										}
									if(!bTest)fctAlert(aErrMsgValueNotZero[top.Lng-1],aCheck[i],0)
									bCheck = bTest	
									}
								break
							/* test alphanumerique (toute chaine, tout caractere)													*/
							case 'PHONE_INT':
								bMatch = (aCheck[i].value==aCheck[i].value.match(/[0-9 \(\)\.-]+/gi))
								bTest = (	(tstRequired=='FREE'&&!aCheck[i].value.length)||
											(tstRequired=='FREE'&&aCheck[i].value.length&&bMatch!=false)||
											(tstRequired=='REQUIRED'&&bMatch!=false)
										)?bCheck:false
								if(!bTest)fctAlert(aErrMsgBadPhone[top.Lng-1],aCheck[i],0)
								bCheck = bTest										
								break
							case 'TEXT':
								bMatch = aCheck[i].value.match(/.+/gi)
								bTest = (	(tstRequired=='FREE'&&!aCheck[i].value.length)||
											(tstRequired=='FREE'&&aCheck[i].value.length&&bMatch!=null)||
											(tstRequired=='REQUIRED'&&bMatch!=null)
										)?bCheck:false
								if(!bTest)fctAlert(aErrMsgMissingInput[top.Lng-1],aCheck[i],0)
								bCheck = bTest										
								break
							/* test des dates inserees via le calendrier	(format : DD/MM/YYYY);									*/
							case 'INSERTDATE':
								bMatch = aCheck[i].value.match(/[0-9]{2}\/[0-9]{2}\/[2][0][0-9]{2}/)
								bTest = (	(tstRequired=='FREE'&&!aCheck[i].value.length)||
											(tstRequired=='FREE'&&aCheck[i].value.length&&bMatch!=null)||
											(tstRequired=='REQUIRED'&&bMatch!=null)
										)?bCheck:false
								if(!bTest)fctAlert(aErrMsgBadInsertDate[top.Lng-1],aCheck[i],0)
								bCheck = bTest
								break
							}
							if(bStopOnError&&!bCheck)break
						}
					if(aWarning.length){
						return 	confirm(aWarning.join('\n')+' !\n'+aMisMsgConfirm[top.Lng-1])
						}
					return bCheck
					break
				case 'Log':
					with(document.FRM_LoginAgency){
						/*alert(FLD_User_Login.value.match(reMail)+'\n'+FLD_User_Pwd.value.match(rePwd))*/
						if(FLD_User_Login.value.match(reMail)==null||FLD_User_Pwd.value.match(rePwd)==null){
							alert(aMsgBadLogin[top.Lng-1]+'.')
							return false
							}
						action = 'agency-account-login-top.html'
						return true
						}
					break;
				case 'Pwd':
					with(document.FRM_LoginAgency){
						if(FLD_User_Login.value.match(reMail)==null){
							alert(aMsgMailNotFilled[top.Lng-1]+'.')
							FLD_User_Login.style.backgroundColor = 'infoBackground'
							FLD_User_Login.focus()
							return false
							}					
						action = 'agency-account-pwd-top.html'
						submit()
						break
						}
				case 'Logoff':
					window.location = 'agency-account-logoff-top.html'
					break
				}
			break;
		case 'Pwd':
		case 'Logoff':
			if(document.FRM_LoginAgency.FLD_User_Login)document.FRM_LoginAgency.FLD_User_Login.style.backgroundColor = 'white'
			top.ActCmd = Cmd
			fctOnSubmit('Check')
			break
		// Gestion des appels de fonction a partir du panier général															
		case 'Caddy':
			sCaddyAction = document.FRM_Agency.FLD_CaddyAction.value
			top.ActCmd = Cmd
			switch(arguments[1]){
				case 'previous':		
					with(document.FRM_Agency){
						action = arguments[2]
						submit()
						}
					break
				case 'next':
					with(document.FRM_Agency){
						switch(sCaddyAction){
							case 'address':
								if(!fctOnSubmit('Check',true))return		
								break
						}						
						action = arguments[2]
						submit()
					}
					break
				default:
					top.ActCmd = Cmd
					break				
				}
			break;
		// Gestion des appels de fonction a partir des paniers des prestations
		case 'Transfer':
			switch(arguments[1]){
				case 'del':
					if(!confirm(aMsgConfirmDeletion[top.Lng-1]))return
				case 'edi':					
					aArg = arguments[2].split('|')
					with(document.FRM_Agency){
						FLD_CaddyParam.value = aArg[1]+'|'+aArg[2]+'|'+aArg[3]
						action = aArg[0]
						submit()
						}
					break					
				case 'add':	
					top.ActCmd = Cmd	
					aArg = arguments[2].split('|')	
					if(!fctOnSubmit('Check',true))return
					with(document.FRM_Agency){
						action = aArg[0]
						submit()
						}
					break
				default:
					top.ActCmd = Cmd
					break
			}
			break
		case 'Sortie':
		case 'Excursion':
		case 'Hotel':
			switch(arguments[1]){
				case 'del':
					if(!confirm(aMsgConfirmDeletion[top.Lng-1]))return
				case 'edi':
					aArg = arguments[2].split('|')
					with(document.FRM_Agency){
						FLD_CaddyParam.value = aArg[1]+'|'+aArg[2]
						action = aArg[0]
						submit()
						}
					break
				case 'upd':
				case 'val':
					top.ActCmd = Cmd
					aArg = arguments[2].split('|')
					if(!fctOnSubmit('Check',true))return
					with(document.FRM_Agency){
						action = aArg[0]
						submit()
						}
					break
				default:
					top.ActCmd = Cmd
					break	
				}
			break
		default:
			top.ActCmd = Cmd
			break
		}
	}
	
	function fctGetArrayItem(oArray,tstType,sOp){
		var j = 0
		switch(sOp){
			case 'last':
				for(var i=0;i < oArray.length;i++){
					s = oArray[i].split('|')
					if(s[0].indexOf(tstType)!=-1)j = i
					}
				return j
				break
			}
		}
	
	function fctAlert(sMsg,oF,iMode){
		aBgColour = new Array('orange','wheat','white')
		switch(oF.type){
			case 'checkbox':
			case 'radio':
			case 'text':
			case 'textarea':
			case 'select-one':
				oF.style.backgroundColor = aBgColour[iMode]
				oF.focus()
				break
			}
		if(sMsg.length)alert(sMsg)
		}
		
function changeBackground(){
    if(document.getElementById('idTargetBackground')==null)return
    var bg      = document.getElementById('idTargetBackground');
    var iI      = 4      // Nombre d'image indexée de 1 à x
    var last    = 0
    var rn      = 0
    with(Math){
        while(rn==last){
            var rn = round(random()*(iI-1))+1
        }
        last = rn
    }
    //window.defaultStatus = ' Tirage : '+rn
    bg.style.backgroundImage = 'url(img/bg-home'+rn+'.jpg)'
}		
