// JavaScript Document
//<![CDATA[
function getCityName(cpval)
{	
	cpvalall=""+cpval;
	if(cpvalall.length==5 && cpvalall > 0){
		arrParamsKeys=new Array("getCityList","cpval");
		arrParamsValues=new Array("",cpvalall);
		envoieRequete("includes/santiane/interface_villes.php","",arrParamsKeys,arrParamsValues,displayCityList,"");
	
	}
	else if(cpval!=""){
		document.getElementById("code_postal").className='error'; 
		document.getElementById("code_postal").focus(); 
		alert("Le code postal saisi n'est pas correct");	
	} 
}
function displayCityList(strVilles)
{
	
	//strVilles=encodeURI(strVilles);
	posEnd=strVilles.indexOf("/html");
	strVilles=strVilles.substring(posEnd+5);
	arrVilles=strVilles.split(";");
	
	document.getElementById("ville").options.length=arrVilles.length;
	
	if(strVilles!=""  ){
		
		for(i=0;i<arrVilles.length;i++){	
			arrIdVilles=arrVilles[i].split(":");
			
			cityName=unescape(arrIdVilles[1]);
			while(cityName.indexOf("+")>-1)
			{
				cityName=cityName.replace("+"," ");
			}
			document.getElementById("ville").options[i].text=cityName;
			document.getElementById("ville").options[i].value=arrIdVilles[0];
			//if(document.form1["ville_c1"].value==unescape(arrIdVilles[1])){
			//document.getElementById("ville").selectedIndex=i;
			//}	
		}	
		//document.getElementById("divVille").style.display="inline";
	}
		if (document.getElementById("ville").options[0].text == "undefined") { 
			document.getElementById("code_postal").className='error'; 
			document.getElementById("code_postal").focus(); 
				alert("Code postal inconnu. Merci de saisir un code postal valide"); 
				
		}	else { 
			document.getElementById("code_postal").className=''; 
		}
	
	
}

function convYahoo(){
	window.ysm_customData = new Object();
	window.ysm_customData.conversion = "transId=,currency=,amount=";
	var ysm_accountid  = "1TVJ797CS7ASTFSNIPPASFIBFNC";
	document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " + "SRC=//" + "srv1.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid + "></SCR" + "IPT>");
}
function substr_count(haystack, needle, offset, length ) {
 
    var pos = 0, cnt = 0;
 
    if(isNaN(offset)) offset = 0;
    if(isNaN(length)) length = 0;
    offset--;
 
    while( (offset = haystack.indexOf(needle, offset+1)) != -1 ){
        if(length > 0 && (offset+needle.length) > length){
            return false;
        } else{
            cnt++;
        }
    }
    return cnt;
}
function chkcompletenumtel(numtel,keycod)
{
	 if(keycod!=8 && keycod!=46 && keycod!=37 && keycod!=39)
	 {
		numteli=document.getElementById(numtel).value;
		numtellen=document.getElementById(numtel).value.length;
		numteltp="";
		for(i=0;i<numtellen;i++)
		{
			if(parseInt(numteli.substring(i,i+1))==numteli.substring(i,i+1) || numteli.substring(i,i+1)!="." || numteli.substring(i,i+1)!=" ")
			{
				numteltp+=numteli.substring(i,i+1);
			}
		}
		document.getElementById(numtel).value=numteltp.substring(0,14);
		numteli=document.getElementById(numtel).value;
		numtellen=document.getElementById(numtel).value.length;
		numteltp="";
		for(i=0;i<numtellen;i++)
		{
			if(parseInt(numteli.substring(i,i+1))==numteli.substring(i,i+1))
			{
				numteltp+=numteli.substring(i,i+1);
				if(numteltp.length==2 || numteltp.length==5 || numteltp.length==8 || numteltp.length==11)
				{
					numteltp+=".";
				}
			}		
		}
		document.getElementById(numtel).value=numteltp.substring(0,14);
	}
}
function isDateValid(chaineDate) {

   var ladate = (chaineDate).split("/")
   if ((ladate.length != 3) || isNaN(parseInt(ladate[0])) || isNaN(parseInt(ladate[1])) || isNaN(parseInt(ladate[2]))) return false
   var unedate = new Date(eval(ladate[2]),eval(ladate[1])-1,eval(ladate[0]))
   var annee = unedate.getYear()
   if ((Math.abs(annee)+"").length < 4) annee = annee + 1900
   return ((unedate.getDate() == eval(ladate[0])) && (unedate.getMonth() == eval(ladate[1])-1) && (annee == eval(ladate[2])))
}
function checkEmail(emailAddr) {
	// Cette fonction vérifie la bon format d'une adresse e-mail.
	// Comme :
	// user@domain.com ou user.perso@domain.com
	
	emailAddr=emailAddr.toLowerCase();
	document.getElementById("emailnonsess").value=emailAddr;
	var i;
	
	// Recherche de @
	i = emailAddr.indexOf("@");
	if (i == -1) {
		return false;
	}
	
	// Séparation du nom de l'utilisateur et du nom de domaine.
	var username = emailAddr.substring(0, i);
	var domain = emailAddr.substring(i + 1, emailAddr.length)

	// Recherche des espaces au début du nom de l'utilisateur.
	i = 0;
	while ((username.substring(i, i + 1) == " ") && (i < username.length)) {
		i++;
	}
	// Les enlève s'il en trouve.
	if (i > 0) {
		username = username.substring(i, username.length);
	}

	// Recherche d'espaces à la fin du nom de domaine.
	i = domain.length - 1;
	while ((domain.substring(i, i + 1) == " ") && (i >= 0)) {
		i--;
	}
	// Les enlève s'il en trouve.
	if (i < (domain.length - 1)) {
		domain = domain.substring(0, i + 1);
	}

	// Vérifie que le nom de l'utilisateur et du domaine ne soit pas vide.
	if ((username == "") || (domain == "")) {
		return false;
	}
	
	// Vérifie s'il n'y a pas de caractères interdits dans le nom de l'utilisateur.
	var ch;
	for (i = 0; i < username.length; i++) {
		ch = (username.substring(i, i + 1)).toLowerCase();
		if (!(((ch >= "a") && (ch <= "z")) || 
			((ch >= "0") && (ch <= "9")) ||
			(ch == "_") || (ch == "-") || (ch == "."))) {
				return false;
		}
	}
	
	// Vérifie s'il n'y a pas de caractères interdits dans le nom de domaine
	for (i = 0; i < domain.length; i++) {
		ch = (domain.substring(i, i + 1)).toLowerCase();
		if (!(((ch >= "a") && (ch <= "z")) || 
			((ch >= "0") && (ch <= "9")) ||
			(ch == "_") || (ch == "-") || (ch == "."))) {
				return false;
		}
	}

// Ajouter ci-dessous de nouveaux noms de domaine.
// Voir tous les noms de domaine sur http://www.toulouse-renaissance.net/c_outils/c-nom-domaine.htm
//
var aSuffix = new Array("com","net","int","aero","biz","museum","name","info","coop","pro","eu","edu","org","gov","mil","bj","dz","de","ad","be","ca","bf","bi","cm","cf","cg","cd","ci","dj","fr","ga","gp","gf","lu","mg","ml","ma","mq","mr","mc","nc","pf","re","pm","sn","ch","td","tf","tn","tv");
	var bFoundSuffix = false;
	i = 0;
	while (i < aSuffix.length) {
		if (("." + aSuffix[i]) == domain.substring(domain.length - aSuffix[i].length - 1, domain.length)) {
			return true;
		}
		i++;
	}
	// Si le nom de domaine est inconnu  : return false
	return false;
}	
	

function emailOK(emailAddr) {
	if (!(checkEmail(emailAddr))) {
		alert("Merci de vérifier votre adresse e-mail. Elle n\'est pas dans le bon format.");
	}
}

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_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_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_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];}
}
function Verifier_Numero_Telephone(num_tel)
{
arrnum_tel=num_tel.split(".");
arrnum_tel[0]="";
/*
for(i=1;i<arrnum_tel.length;i++)
{
	if(substr_count(num_tel,arrnum_tel[i])>2 || (i>2 && arrnum_tel[i][0]==arrnum_tel[i][1] && arrnum_tel[i][0]==arrnum_tel[i-1][0] && arrnum_tel[i][0]==arrnum_tel[i-1][1] && arrnum_tel[i][0]==arrnum_tel[i-2][0] && arrnum_tel[i][0]==arrnum_tel[i-2][1]) || (i>2 && parseInt(arrnum_tel[i])==parseInt(arrnum_tel[i-2])+1 && parseInt(arrnum_tel[i])==parseInt(arrnum_tel[i-1])+1 && parseInt(arrnum_tel[i])==parseInt(arrnum_tel[i-2])+1)){
		return false;	
	}
}
*/
while(num_tel.indexOf(".")>-1)
{
	num_tel=num_tel.replace(".","");
}
// Definition du motif a matcher
var regex = new RegExp(/^(01|02|03|04|05|06|08|09)[0-9]{8}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(num_tel))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
} 
function Verifier_Numero_SS(num_ss)
{
// Definition du motif a matcher
var regex = new RegExp(/^[a-z0-9]{13}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(num_ss))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
}
function Verifier_Cle_SS(cle_ss)
{
// Definition du motif a matcher
var regex = new RegExp(/^[0-9]{2}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(cle_ss))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
}
function Verifier_Cp(cp)
{
// Definition du motif a matcher
var regex = new RegExp(/^[0-9]{5}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(cp))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
}
function Verifier_CCp(cp)
{
// Definition du motif a matcher
var regex = new RegExp(/^[0-9]{3}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(cp))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
} 
function Verifier_Codeetab(code)
{
// Definition du motif a matcher
var regex = new RegExp(/^[0-9]{5}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(code))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
}
function Verifier_Codeguich(code)
{
// Definition du motif a matcher
var regex = new RegExp(/^[0-9]{5}/gi);
// Definition de la variable booleene match
var match = false;
// Test sur le motif
if(regex.test(code))
{
match = true;
}
else
{
match = false;
}
// On renvoie match
return match;
}
function isRIBvalid(arguments)
{
	if (arguments.length>=3)
		{
		var bqe=arguments[0];
		var gui=arguments[1];
		var cpt=arguments[2].toUpperCase();
		var tab= "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
		var tab1="123456789123456789234567890123456789".split("");
		while (cpt.match(/\D/) != null)
			cpt=cpt.replace(/\D/, tab1[tab.indexOf(cpt.match(/\D/))]);
		var cp=parseInt(cpt, 10);
		
		a=bqe%97;
		a=a*100000+parseInt(gui, 10);
		a=a%97;
		a=a*Math.pow(10, 11) + cp;
		a=a%97
		a=a*100;
		a=a%97
		a=97-a;
		if (arguments.length>3)
		{
			if(arguments[3]!=a)
			{
				return a;
			}
		}
		else
			return a;
		}
	else
		{
		return a;
		}
}
function genListDays(){
	strDays="<option value=\"\"></option>";
	for(i=1;i<=31;i++){
		iVal=String(i);
		dayVal=(iVal.length==1)?"0"+iVal:iVal;
		strDays+="<option value=\""+dayVal+"\">"+dayVal+"</option>";
	}
	return strDays;
}
function genListMonths(){
	strMonth="<option value=\"\"></option>";
	for(i=1;i<=12;i++){
		iVal=String(i);
		monthVal=(iVal.length==1)?"0"+iVal:iVal;
		strMonth+="<option value=\""+monthVal+"\">"+monthVal+"</option>";
	}
	return strMonth;
}
function genListYears(yeari,yearf){
	strYears="<option value=\"\"></option>";
	for(i=parseInt(yeari);i>=parseInt(yearf);i--){
		strYears+="<option value=\""+i+"\">"+i+"</option>";
	}
	return strYears;
}
function genDtn(individu)
{
	currentDate=new Date();

	switch(individu.substring(0,1))
	{
		case "a":
		yeari=currentDate.getFullYear()-16;
		yearf=String(parseInt(yeari)-74);			
		break;
		
		case "e":
		yeari=currentDate.getFullYear();
		yearf=String(parseInt(yeari)-30);			
		break;		
	}
	typeDemande=(document.getElementById("typeDemande"))?document.getElementById("typeDemande").value:"santé";
	switch(typeDemande)
	{
		case "obseques":
		yeari=currentDate.getFullYear()-40;
		yearf=String(parseInt(yeari)-35);			
		break;
	}
	strDtn="<select name=\"date_d_dtn"+individu+"\" class=\"texte10gris\" id=\"date_d_dtn"+individu+"\">"+genListDays()+"</select>/";
	strDtn+="<select name=\"date_m_dtn"+individu+"\" class=\"texte10gris\" id=\"date_m_dtn"+individu+"\">"+genListMonths()+"</select>/";
	strDtn+="<select name=\"date_y_dtn"+individu+"\" class=\"texte10gris\" id=\"date_y_dtn"+individu+"\">"+genListYears(yeari,yearf)+"</select>";
	return strDtn;
}
function manage_divConjoint()
{
	if(document.formMain.selectconjoint.value=="oui"){
		document.getElementById("divConjoint").style.display="block";
		document.getElementById("divDtn_a2").innerHTML=genDtn("a2");
		document.getElementById("divRegime_a2").innerHTML=getListRegime("a2");
	}else{
		document.getElementById("divDtn_a2").innerHTML="";
		document.getElementById("divRegime_a2").innerHTML="";
		document.getElementById("divConjoint").style.display="none";
	}
}
function manage_divEnfants()
{
	selectedValueEnfant=document.getElementById("nbenfants").selectedIndex;
	nbEnfants=document.getElementById("nbenfants").options[selectedValueEnfant].value;
	if(!document.nbEnfantsMax){ document.nbEnfantsMax=7; }
	for(j=1;j<=document.nbEnfantsMax;j++){
		if(parseInt(nbEnfants)>=parseInt(j)){
			document.getElementById("divEnfant"+j).style.display="block";	
			document.getElementById("divDtn_e"+j).innerHTML=genDtn("e"+j);
			document.getElementById("divRegime_e"+j).innerHTML=getListRegime("e"+j);
		}
		else{
			document.getElementById("divDtn_e"+j).innerHTML="";
			document.getElementById("divRegime_e"+j).innerHTML="";
			document.getElementById("divEnfant"+j).style.display="none";
		}
	}
	manage_RegimesEnfants();
}
function getListRegime(individu)
{
	arrOptionsVal=new Array();
	arrOptionsText=new Array();
	stronchange="";
	switch(individu)
	{
		case "a1":
		arrOptionsVal=new Array("3","1","2","2","1","1","1");
		arrOptionsText=new Array("Agricole","Etudiant","Indépendant","Retraité TNS","Retraité salarié","Salarié","Sans emploi");
		break;
		
		case "a2":
		arrOptionsVal=new Array("principal","3","1","2","2","1","1","1");
		arrOptionsText=new Array("Le même que le vôtre","Agricole","Etudiant","Indépendant","Retraité TNS","Retraité salarié","Salarié","Sans emploi");
		stronchange="onChange=\"javascript:manage_RegimesEnfants();\""
		break;		
	}
	if(individu.substr(0,1)=="e"){
		arrOptionsVal=new Array("principal","1","1");
		arrOptionsText=new Array("Le même que le vôtre","Etudiant","Salarié");
	}
	strList="<select name=\"id_regime_"+individu+"\" class=\"texte10gris\" id=\"id_regime_"+individu+"\" "+stronchange+">";    
	strList+="<option value=\"\">Régime</option>"
	strList+="<option value=\"\">------</option>"
	for(k=0;k<arrOptionsVal.length;k++){
		strList+="<option value=\""+arrOptionsVal[k]+"\">"+arrOptionsText[k]+"</option>";
	}
	strList+="</select>";
	
	return strList;
}
function manage_RegimesEnfants()
{
	if(!document.nbEnfantsMax){
		document.nbEnfantsMax=7;
	}
	if(document.getElementById("id_regime_a2") && getAffiliation("a2")!="principal" && document.getElementById("id_regime_e1") && document.getElementById("id_regime_e1").options[3].value!="conjoint")
	{
		for(i=1;i<=document.nbEnfantsMax;i++)
		{
			if(document.getElementById("id_regime_e"+i)){
				arrOptionsValues=new Array("","","principal","conjoint","1","1");
				arrOptionsText=new Array("Régime","------","Le même que le vôtre","Celui de votre conjoint","Etudiant","Salarié");
				currentSelected=document.getElementById("id_regime_e"+i).selectedIndex;
				currentSelectedText=document.getElementById("id_regime_e"+i).options[currentSelected].text;
				document.getElementById("id_regime_e"+i).options.length=6;
				indexToSelect=0;
				for(j=0;j<arrOptionsValues.length;j++)
				{
					if(currentSelectedText==arrOptionsText[j]){
						indexToSelect=j;
					}
					document.getElementById("id_regime_e"+i).options[j].value=arrOptionsValues[j];
					document.getElementById("id_regime_e"+i).options[j].text=arrOptionsText[j];
				}
				document.getElementById("id_regime_e"+i).selectedIndex=indexToSelect;
			}
		}
	}
	else if(document.getElementById("id_regime_a2") && getAffiliation("a2")=="principal" && document.getElementById("id_regime_e1") && document.getElementById("id_regime_e1").options[3].value=="conjoint")
	{
		for(i=1;i<=document.nbEnfantsMax;i++)
		{
			if(document.getElementById("id_regime_e"+i)){				
				arrOptionsValues=new Array("","","principal","1","1");
				arrOptionsText=new Array("Régime","------","Le même que le vôtre","Etudiant","Salarié");
				currentSelected=document.getElementById("id_regime_e"+i).selectedIndex;
				currentSelectedText=document.getElementById("id_regime_e"+i).options[currentSelected].text;
				document.getElementById("id_regime_e"+i).options.length=5;
				indexToSelect=0;
				for(j=0;j<arrOptionsValues.length;j++)
				{
					if(currentSelectedText==arrOptionsText[j]){
						indexToSelect=j;
					}
					document.getElementById("id_regime_e"+i).options[j].value=arrOptionsValues[j];
					document.getElementById("id_regime_e"+i).options[j].text=arrOptionsText[j];
				}
				document.getElementById("id_regime_e"+i).selectedIndex=indexToSelect;
			}
		}	
	}
}
function checkDateEffet()
{
	arrChpsDemande=new Array("date_debut_contrat");
	arrChpsDemandeVal=new Array(getValueDateSlashed("debutcontrat"));	
	if(isDateValid(getValueDateSlashed("debutcontrat")))
	{
		for(i=0;i<arrChpsDemande.length;i++)
		{	
			var newInput = document.createElement('input');
			newInput.setAttribute('type', 'hidden');
			newInput.setAttribute('name', arrChpsDemande[i]);
			newInput.setAttribute('id', arrChpsDemande[i]);
			newInput.setAttribute('value', arrChpsDemandeVal[i]);
			document.formDemande.appendChild(newInput);
		}

		selectedIndexMontant=document.getElementById("prix_moyen").selectedIndex;
		if(document.getElementById("prix_moyen").options[selectedIndexMontant].value==""){
			alert("Veuillez indiquer le montant de votre budget");
			return false;
		}
		else
		{	
			document.getElementById("BtnDisplayComp").value="Veuillez patienter...";
			document.getElementById("BtnDisplayComp").disabled="disabled";
			document.formDemande.submit();
		}
	}
	else
	{
		alert("Veuillez saisir une date d'effet valide pour votre contrat");
		return false;
	}
}
function getBudget()
{
	budget="";
	selectedBudget=document.formDemande["budget"].selectedIndex;
	budget=document.formDemande["budget"].options[selectedBudget].value;
	return budget;
}
function getGenre(civilite)
{
	genre="";
	switch(civilite.toLowerCase())
	{
		case "mr":
		genre="homme";
		break;
		
		case "mme":
		genre="femme";
		break;
		
		case "mlle":
		genre="femme";
		break;			
	}
	return genre;
}
function checkForm(){

	//ADULTE ADHERENT PRINCIPAL
	id_civilite_a1=getCivilite("a1");
	if(id_civilite_a1==""){
		alert("Veuillez indiquer votre civilité (M, Mme ou Mlle)");
		document.getElementById("divCivilitesPrincipal").className="classMissingCivilites";		
		return false;
	}
	document.getElementById("divCivilitesPrincipal").className="classCivilites";	

	date_de_naissance_a1=getValueDateSlashed("dtna1");
	arrFields=new Array("date_d_dtna1","date_m_dtna1","date_y_dtna1");
	if(isDateValid(date_de_naissance_a1)==false){
		alert("Veuillez indiquer votre date de naissance");		
		setClassToFields(arrFields,"classMissingList");
		return false;	
	}
	setClassToFields(arrFields,"classList");
	
	id_regime_a1=getRegime("a1");
	arrFields=new Array("id_regime_a1");
	if(id_regime_a1==""){
		alert("Veuillez indiquer votre régime social");		
		setClassToFields(arrFields,"classMissingList");
		return false;		
	}
	setClassToFields(arrFields,"classList");
	id_regimelib_a1=escape(getRegimeLib("a1"));
	
	// CONJOINT
	isConjoint="false";
	id_civilite_a2="";
	date_de_naissance_a2="";
	id_regime_a2="";
	id_regimelib_a2="";		
	ayantdroitde_a2="";
	if(document.formMain.selectconjoint.value=="oui"){
		isConjoint="true";
		id_civilite_a2=getCivilite("a2");
		if(id_civilite_a2==""){
			alert("Veuillez indiquer la civilité de votre conjoint (M, Mme ou Mlle)");
			document.getElementById("divCivilitesConjoint").className="classMissingCivilites";
			return false;
		}
		document.getElementById("divCivilitesConjoint").className="classCivilites";
		date_de_naissance_a2=getValueDateSlashed("dtna2");
		arrFields=new Array("date_d_dtna2","date_m_dtna2","date_y_dtna2");
		if(isDateValid(date_de_naissance_a2)==false){
			alert("Veuillez indiquer la date de naissance de votre conjoint");
			setClassToFields(arrFields,"classMissingList")
			return false;	
		}
		setClassToFields(arrFields,"classList");
		
		id_regime_a2=getRegime("a2");
		arrFields=new Array("id_regime_a2");
		if(id_regime_a2==""){
			alert("Veuillez indiquer le régime social de votre conjoint");
			setClassToFields(arrFields,"classMissingList");
			return false;		
		}
		setClassToFields(arrFields,"classList");
		id_regimelib_a2=escape(getRegimeLib("a2"));	
		ayantdroitde_a2=getAffiliation("a2");
	}
	
	//ENFANTS
	nbEnfants=0;
	if(document.getElementById("nbenfants")){
	selectednbEnfants=document.getElementById("nbenfants").selectedIndex;
	nbEnfants=document.getElementById("nbenfants")[selectednbEnfants].value;
	}
	strCivilitesEnfants="";
	strDtnEnfants="";
	strRegimesEnfants="";	
	strRegimesLibEnfants="";	
	strAyantDroitDeEnfants="";
	for(k=0;k<nbEnfants;k++)
	{
		strCivilitesEnfants+=(k>0)?",":"";
		strDtnEnfants+=(k>0)?",":"";
		strRegimesEnfants+=(k>0)?",":"";
		strRegimesLibEnfants+=(k>0)?",":"";
		strAyantDroitDeEnfants+=(k>0)?",":"";
		numEnfant=parseInt(k+1);
		isConjoint="true";
		id_civilite=getCivilite("e"+numEnfant);
		if(id_civilite==""){
			document.getElementById("divCivilitesEnfant"+numEnfant).className="classMissingCivilites";
			alert("Veuillez indiquer le genre de votre enfant "+numEnfant);
			return false;
		}
		document.getElementById("divCivilitesEnfant"+numEnfant).className="classCivilites";
		strCivilitesEnfants+=id_civilite;
		date_de_naissance=getValueDateSlashed("dtne"+numEnfant);
		arrFields=new Array("date_d_dtne"+numEnfant,"date_m_dtne"+numEnfant,"date_y_dtne"+numEnfant);
		if(isDateValid(date_de_naissance)==false){
			alert("Veuillez indiquer la date de naissance votre enfant "+numEnfant);
			setClassToFields(arrFields,"classMissingList");
			return false;	
		}
		
		setClassToFields(arrFields,"classList");
		strDtnEnfants+=date_de_naissance;
		id_regime=getRegime("e"+numEnfant);
		arrFields=new Array("id_regime_e"+numEnfant);
		if(id_regime==""){
			alert("Veuillez indiquer le régime social de votre enfant "+numEnfant);
			setClassToFields(arrFields,"classMissingList");
			return false;		
		}
		setClassToFields(arrFields,"classList");
		id_regimelib=getRegimeLib("e"+numEnfant);	
		strRegimesEnfants+=id_regime;
		strRegimesLibEnfants+=escape(id_regimelib);
		strAyantDroitDeEnfants+=getAffiliation("e"+numEnfant);
	}
	emailnonsess=document.getElementById("emailnonsess").value;
	tel=document.getElementById("tel").value;
	code_postal=document.getElementById("code_postal").value;
	ancien_assureur="";
	if(document.getElementById("ancien_assureur"))
	{
		ancien_assureur=document.getElementById("ancien_assureur").value;
	}
	capitalObseques="";
	if(document.getElementById("capital")){
		capitalObsequesIndex=document.getElementById("capital").selectedIndex;
		capitalObseques=document.getElementById("capital").options[capitalObsequesIndex].value;
	}
	ville="";
	if(document.getElementById("ville").options.length>0){
		selectedVille=document.getElementById("ville").selectedIndex;
		ville=escape(document.getElementById("ville").options[selectedVille].text);
	}
	arrchps=new Array("code_postal","tel");
	arrchpsalert=new Array("votre code postal","votre numéro de téléphone");
	if(checkEmail(document.formMain["emailnonsess"].value)==false)
	{
		alert("L'adresse email saisie n'est pas valide");
		document.formMain["emailnonsess"].className="classMissingList";
		return false;
	}	
	document.formMain["emailnonsess"].className="field3d";
	for(i=0;i<arrchps.length;i++)
	{
		if(document.formMain[arrchps[i]].value=="")
		{
			alert("Veuillez indiquer "+arrchpsalert[i]);
			document.formMain[arrchps[i]].className="classMissingList";
			return false;
		}
		document.formMain[arrchps[i]].className="field3d";
	}
	if(Verifier_Numero_Telephone(document.formMain["tel"].value)==false)
	{
		alert("Le numéro de télephone saisi n'est pas valide");
		return false;
	}	
	categorie_source=document.getElementById("categorie_source").value;
	typeDemande=(document.getElementById("typeDemande"))?document.getElementById("typeDemande").value:"santé";
	arrCalculs=new Array("remb_fraisReels","remb_prestation","remb_categorie","remb_formule","remb_compagnie");
	for(i=0;i<arrCalculs.length;i++){
		this[arrCalculs[i]]=(document.getElementById(arrCalculs[i]) && document.getElementById(arrCalculs[i]).value)?escape(document.getElementById(arrCalculs[i]).value):"";
	}
	arrParamsKeys=new Array("getTarifsSante","emailnonsess","code_postal","tel","ancien_assureur","ville","id_civilite_a1","date_de_naissance_a1","id_regime_a1","isConjoint","id_civilite_a2","date_de_naissance_a2","id_regime_a2","nbEnfants","strCivilitesEnfants","strDtnEnfants","strRegimesEnfants","strRegimesLibEnfants","strAyantDroitDeEnfants","categorie_source","typeDemande","capitalObseques","remb_fraisReels","remb_prestation","remb_categorie","remb_formule","remb_compagnie");
	
	arrParamsValues=new Array('',emailnonsess,code_postal,tel,ancien_assureur,ville,id_civilite_a1,date_de_naissance_a1,id_regime_a1,isConjoint,id_civilite_a2,date_de_naissance_a2,id_regime_a2,nbEnfants,strCivilitesEnfants,strDtnEnfants,strRegimesEnfants,strRegimesLibEnfants,strAyantDroitDeEnfants,categorie_source,typeDemande,capitalObseques,remb_fraisReels,remb_prestation,remb_categorie,remb_formule,remb_compagnie);

	document.getElementById("imgBtnComparer").onclick="disabled";

	for(i=0;i<arrParamsKeys.length;i++)
	{
		var newInput = document.createElement('input');
		newInput.setAttribute('type', 'hidden');
		newInput.setAttribute('name', arrParamsKeys[i]);
		newInput.setAttribute('id', arrParamsKeys[i]);
		newInput.setAttribute('value', arrParamsValues[i]);
		document.formDemande.appendChild(newInput);		
	}
	//ENFANTS
	nbEnfants=0;
	if(document.getElementById("nbenfants")){
		selectednbEnfants=document.getElementById("nbenfants").selectedIndex;
		nbEnfants=document.getElementById("nbenfants")[selectednbEnfants].value;
	}
	poste_Hi=(document.getElementById("niveauf1"))?document.getElementById("niveauf1").value:"1";
	poste_Di=(document.getElementById("niveauf2"))?document.getElementById("niveauf2").value:"1";
	poste_Oi=(document.getElementById("niveauf3"))?document.getElementById("niveauf3").value:"1";	
	poste_Mi=(document.getElementById("niveauf4"))?document.getElementById("niveauf4").value:"1";
	switch(document.getElementById("categorie_source").value.toUpperCase())
	{
			case "HOSPITALISATION":
			poste_Hi="4";
			poste_Oi="1";
			poste_Di="1";
			poste_Mi="1";				
			break;
			
			case "MATERNITE":
			poste_Hi="4";
			poste_Oi="1";
			poste_Di="1";
			poste_Mi="1";				
			break;
			
			case "DENTAIRE":
			poste_Hi="1";
			poste_Oi="1";
			poste_Di="4";
			poste_Mi="1";				
			break;
			
			case "ORTHODONTIE":
			poste_Hi="1";
			poste_Oi="1";
			poste_Di="4";
			poste_Mi="1";				
			break;
			
			case "LUNETTES ET LENTILLES":
			poste_Hi="1";
			poste_Oi="4";
			poste_Di="1";
			poste_Mi="1";				
			break;			
	}
	prix_moyen=(document.getElementById("prix_moyen"))?document.getElementById("prix_moyen").value:"0";
	arrChpsDemande=new Array("code_postal","date_naissance","id_civilite","id_regime","id_regimelib_a1","nbenfants","demandeType","niveauf1","niveauf2","niveauf3","niveauf4","prix_moyen");
	arrChpsDemandeVal=new Array(document.formMain["code_postal"].value,getValueDateSlashed("dtna1"),getGenre(getCivilite("a1")),getRegime("a1"),getRegimeLib("a1"),nbEnfants,"Santé",poste_Hi,poste_Di,poste_Oi,poste_Mi,prix_moyen);	
	for(i=0;i<arrChpsDemande.length;i++)
	{	
		var newInput = document.createElement('input');
		newInput.setAttribute('type', 'hidden');
		newInput.setAttribute('name', arrChpsDemande[i]);
		newInput.setAttribute('id', arrChpsDemande[i]);
		newInput.setAttribute('value', arrChpsDemandeVal[i]);
		document.formDemande.appendChild(newInput);
	}
	// CONJOINT
	if(document.formMain.selectconjoint.value=="oui"){
		arrChpsDemande=new Array("conjoint","date_naissance_a2","id_civilite_a2","ayantdroitde_a2","id_regime_a2","id_regimelib_a2");
		arrChpsDemandeVal=new Array("oui",getValueDateSlashed("dtna2"),getGenre(getCivilite("a2")),getAffiliation("a2"),getRegime("a2"),getRegimeLib("a2"));
		for(i=0;i<arrChpsDemande.length;i++)
		{	
			var newInput = document.createElement('input');
			newInput.setAttribute('type', 'hidden');
			newInput.setAttribute('name', arrChpsDemande[i]);
			newInput.setAttribute('id', arrChpsDemande[i]);
			newInput.setAttribute('value', arrChpsDemandeVal[i]);
			document.formDemande.appendChild(newInput);
		}		
	}
	for(k=0;k<nbEnfants;k++)
	{
		numEnfant=parseInt(k+1);
		arrChpsDemande=new Array("enfant"+k,"date_naissance_e"+k,"id_civilite_e"+k,"id_regime_e"+k,"id_regimelib_e"+k,"ayantdroitde_e"+k);
		arrChpsDemandeVal=new Array("oui",getValueDateSlashed("dtne"+numEnfant),getGenre(getCivilite("e"+numEnfant)),getRegime("e"+numEnfant),getRegimeLib("e"+numEnfant),getAffiliation("e"+numEnfant));
		for(i=0;i<arrChpsDemande.length;i++)
		{	
			var newInput = document.createElement('input');
			newInput.setAttribute('type', 'hidden');
			newInput.setAttribute('name', arrChpsDemande[i]);
			newInput.setAttribute('id', arrChpsDemande[i]);
			newInput.setAttribute('value', arrChpsDemandeVal[i]);
			document.formDemande.appendChild(newInput);
		}		
	}
	document.formDemande.submit();
}
function manageuser(logstate){

	switch(logstate.substring(0,7)){
		case "newuser":
		arrloginfos=logstate.split("&");
		document.getElementById("iddemandetouse").value=arrloginfos[1];		
		document.getElementById("tdLogin").innerHTML="<strong>"+document.getElementById("emailnonsess").value+"</strong>";
		document.getElementById("tdMdp").innerHTML="<strong>"+arrloginfos[2]+"</strong>";	
		displayPopIn();
		break;
		
		case "newiden":
		document.location="connexion.php?ident=";
		break;		
	}
}	
function getCivilite(individu)
{	
	civilite="";
	for(i=0;i<document.getElementsByName("id_civilite_"+individu).length;i++){
		if(document.getElementsByName("id_civilite_"+individu)[i].checked){
			civilite=document.getElementsByName("id_civilite_"+individu)[i].value;
		}
	}	
	return civilite;
}
function getAffiliation(individu)
{
	affiliation="affilieensonnom";
	selectedRegime=document.formMain["id_regime_"+individu].selectedIndex;
	idregime=document.formMain["id_regime_"+individu].options[selectedRegime].value;
	switch(idregime)
	{
		case "principal":
		affiliation="principal";
		break;
		
		case "conjoint":
		affiliation="conjoint";
		break;		
	}	
	return affiliation;
}
function getRegime(individu)
{
	selectedRegime=document.formMain["id_regime_"+individu].selectedIndex;
	idregime=document.formMain["id_regime_"+individu].options[selectedRegime].value;
	switch(getAffiliation(individu))
	{
		case "principal":
		idregime=getRegime("a1");
		break;
		
		case "conjoint":
		idregime=getRegime("a2");
		break;		
	}
	return idregime;
}
function getRegimeLib(individu)
{
	selectedRegime=document.formMain["id_regime_"+individu].selectedIndex;
	regimeLib=document.formMain["id_regime_"+individu].options[selectedRegime].text;
	switch(getAffiliation(individu))
	{
		case "principal":
		regimeLib=getRegimeLib("a1");
		break;
		
		case "conjoint":
		regimeLib=getRegimeLib("a2");
		break;		
	}	
	return regimeLib;	
}
function getValueDateBd(nameChp)
{
	dateToReturn=document.getElementById("date_y_"+nameChp).value+"-"+document.getElementById("date_m_"+nameChp).value+"-"+document.getElementById("date_d_"+nameChp).value
	return dateToReturn;
}
function getValueDateSlashed(nameChp)
{
	dateToReturn=document.getElementById("date_d_"+nameChp).value+"/"+document.getElementById("date_m_"+nameChp).value+"/"+document.getElementById("date_y_"+nameChp).value;
	return dateToReturn;
}
function manage_conjoint_civ(){
	if (document.formMain.id_civilite_m1.checked){
		document.formMain.id_civilite_m2.disabled=true;
		document.formMain.id_civilite_mme2.disabled=false;
		document.formMain.id_civilite_mlle2.disabled=false;
		document.formMain.id_civilite_mme2.checked=true;
	}else{
		document.formMain.id_civilite_m2.disabled=false;
		document.formMain.id_civilite_mme2.disabled=true;
		document.formMain.id_civilite_mlle2.disabled=true;
		document.formMain.id_civilite_m2.checked=true;
	}
}
function displayPopIn(){
	document.getElementById("divLoading").style.display = "none";
	document.getElementById("darkBackgroundLayer").style.display = "block";
	document.getElementById("divInnfosSupp").style.display = "block";
	centrer_calque(document.getElementById("divInnfosSupp"));
	document.getElementById("divInnfosSupp").style.top="20px";
	document.getElementById("divInnfosSupp").style.zIndex=21;
	//ENFANTS
	nbEnfants=0;
	if(document.getElementById("nbenfants")){
		selectednbEnfants=document.getElementById("nbenfants").selectedIndex;
		nbEnfants=document.getElementById("nbenfants")[selectednbEnfants].value;
	}
	poste_Hi="1";
	poste_Oi="1";
	poste_Di="1";
	poste_Mi="1";	
	switch(document.getElementById("categorie_source").value.toUpperCase())
	{
			case "HOSPITALISATION":
			poste_Hi="4";
			poste_Oi="1";
			poste_Di="1";
			poste_Mi="1";				
			break;
			
			case "MATERNITE":
			poste_Hi="4";
			poste_Oi="1";
			poste_Di="1";
			poste_Mi="1";				
			break;
			
			case "DENTAIRE":
			poste_Hi="1";
			poste_Oi="1";
			poste_Di="4";
			poste_Mi="1";				
			break;
			
			case "ORTHODONTIE":
			poste_Hi="1";
			poste_Oi="1";
			poste_Di="4";
			poste_Mi="1";				
			break;
			
			case "LUNETTES ET LENTILLES":
			poste_Hi="1";
			poste_Oi="4";
			poste_Di="1";
			poste_Mi="1";				
			break;			
	}
	arrChpsDemande=new Array("code_postal","date_naissance","id_civilite","id_regime","id_regimelib_a1","nbenfants","demandeType","niveauf1","niveauf2","niveauf3","niveauf4");
	arrChpsDemandeVal=new Array(document.formMain["code_postal"].value,getValueDateSlashed("dtna1"),getGenre(getCivilite("a1")),getRegime("a1"),getRegimeLib("a1"),nbEnfants,"Santé",poste_Hi,poste_Di,poste_Oi,poste_Mi);	
	for(i=0;i<arrChpsDemande.length;i++)
	{	
		var newInput = document.createElement('input');
		newInput.setAttribute('type', 'hidden');
		newInput.setAttribute('name', arrChpsDemande[i]);
		newInput.setAttribute('id', arrChpsDemande[i]);
		newInput.setAttribute('value', arrChpsDemandeVal[i]);
		document.formDemande.appendChild(newInput);
	}
	// CONJOINT
	if(document.formMain.selectconjoint.value=="oui"){
		arrChpsDemande=new Array("conjoint","date_naissance_a2","id_civilite_a2","ayantdroitde_a2","id_regime_a2","id_regimelib_a2");
		arrChpsDemandeVal=new Array("oui",getValueDateSlashed("dtna2"),getGenre(getCivilite("a2")),getAffiliation("a2"),getRegime("a2"),getRegimeLib("a2"));
		for(i=0;i<arrChpsDemande.length;i++)
		{	
			var newInput = document.createElement('input');
			newInput.setAttribute('type', 'hidden');
			newInput.setAttribute('name', arrChpsDemande[i]);
			newInput.setAttribute('id', arrChpsDemande[i]);
			newInput.setAttribute('value', arrChpsDemandeVal[i]);
			document.formDemande.appendChild(newInput);
		}		
	}
	for(k=0;k<nbEnfants;k++)
	{
		numEnfant=parseInt(k+1);
		arrChpsDemande=new Array("enfant"+k,"date_naissance_e"+k,"id_civilite_e"+k,"id_regime_e"+k,"id_regimelib_e"+k,"ayantdroitde_e"+k);
		arrChpsDemandeVal=new Array("oui",getValueDateSlashed("dtne"+numEnfant),getGenre(getCivilite("e"+numEnfant)),getRegime("e"+numEnfant),getRegimeLib("e"+numEnfant),getAffiliation("e"+numEnfant));
		for(i=0;i<arrChpsDemande.length;i++)
		{	
			var newInput = document.createElement('input');
			newInput.setAttribute('type', 'hidden');
			newInput.setAttribute('name', arrChpsDemande[i]);
			newInput.setAttribute('id', arrChpsDemande[i]);
			newInput.setAttribute('value', arrChpsDemandeVal[i]);
			document.formDemande.appendChild(newInput);
		}		
	}
	typeDemande=(document.getElementById("typeDemande"))?document.getElementById("typeDemande").value:"santé";
	switch(typeDemande)
	{
		case "obseques":
		document.formDemande.submit();
		break;
	}
	document.images['conv1'].src='http://www.googleadservices.com/pagead/conversion/1058714582/imp.gif?value=1&label=pageview&script=0';
	document.images['conv2'].src='http://www.googleadservices.com/pagead/conversion/1057084231/imp.gif?value=1&label=pageview&script=0';
	_uacct = "UA-2450077-3";
	urchinTracker("/affichage_popin.php");	
}

function CheckFormRappel() { 
//setClassToFields(field, class); 
tel = document.getElementById("num_tel"); 
	if (tel.value=="") {
		alert("Pour être rappelé n'oubliez pas votre numéro de téléphone"); 
		tel.focus(); 
			return false; 
	}
		if(Verifier_Numero_Telephone(tel.value)==false)
		{
			alert("Le numéro de télephone saisi n'est pas valide");
			tel.value=''; 
			tel.focus(); 
			return false;
		}


		document.getElementById("form1").submit(); 

}
function deletePrestation(idPrestation){
	document.arrUserPrestationsTp=new Array();
	document.arrUserPrestationsFRTp=new Array();
	document.arrUserPrestationsNbTp=new Array();
	document.arrUserPrestationsIndTp=new Array();

	strPrestation="";
	numPrestation=0;

	for(j=0;j<document.arrUserPrestationsInd.length;j++){
		if(idPrestation!=j){
			document.arrUserPrestationsTp.push(document.arrUserPrestations[j]);
			document.arrUserPrestationsFRTp.push(document.arrUserPrestationsFR[j]);
			document.arrUserPrestationsNbTp.push(document.arrUserPrestationsNb[j]);
			document.arrUserPrestationsIndTp.push(document.arrUserPrestationsInd[j]);	
			strPrestation=strPrestation+"&idPrestation"+numPrestation+"="+document.arrUserPrestations[j];
			strPrestation=strPrestation+"&frPrestation"+numPrestation+"="+document.arrUserPrestationsFR[j];
			strPrestation=strPrestation+"&nbPrestation"+numPrestation+"="+document.arrUserPrestationsNb[j];
			strPrestation=strPrestation+"&indPrestation"+numPrestation+"="+document.arrUserPrestationsInd[j];			
			document.arrUserPrestationsInd[j]="";
			numPrestation++;
		}
	}
	strPrestation="&nbPrestations="+document.arrUserPrestationsIndTp.length +""+strPrestation;
	
	document.arrUserPrestations=document.arrUserPrestationsTp;
	document.arrUserPrestationsFR=document.arrUserPrestationsFRTp;
	document.arrUserPrestationsNb=document.arrUserPrestationsNbTp;
	document.arrUserPrestationsInd=document.arrUserPrestationsIndTp;
	
	recordPrestationUserForm(strPrestation);
}
function cancelAddPrestation(){
	document.getElementById("divAddPrestation").innerHTML="";
	document.getElementById("divAddPrestation").style.display="none";
}
function addPrestation(){
	strHTML=document.getElementById("popInPrestation").innerHTML;
	strHTML=strHTML.replace("{listPrestationCategories}","categoriesPrestations_add");
	strHTML=strHTML.replace("{listPrestation}","prestations_add");
	strHTML=strHTML.replace("{listPrestation}","prestations_add");
	strHTML=strHTML.replace("{fraisreelsInput}","prestation_fraisreel_add");
	strHTML=strHTML.replace("{frequenceInput}","nbprestation_add");	
	strHTML=strHTML.replace("{listPrestationIndividu}","prestation_ind_add");	
	document.getElementById("divAddPrestation").innerHTML=strHTML;
	document.getElementById("divAddPrestation").style.display="block";
	//document.getElementById("popInPrestation").innerHTML="";
}
function validNewPrestation(){
	document.nbPrestations=document.nbPrestations+1;
	idPrestation=document.getElementById("prestations_add").value;
	prestation_fraisreel_add=document.getElementById("prestation_fraisreel_add").value;
	nbprestation_add=document.getElementById("nbprestation_add").value;
	indprestation_add=document.getElementById("prestation_ind_add").value;

	document.arrUserPrestations.push(idPrestation);
	document.arrUserPrestationsFR.push(prestation_fraisreel_add);
	document.arrUserPrestationsNb.push(nbprestation_add);
	document.arrUserPrestationsInd.push(indprestation_add);

	document.arrUserPrestationsTp=new Array();
	document.arrUserPrestationsFRTp=new Array();
	document.arrUserPrestationsNbTp=new Array();
	document.arrUserPrestationsIndTp=new Array();
	
	strPrestation="&nbPrestations="+document.arrUserPrestationsInd.length;
	numPrestation=0;
	for(i=0;i<document.arrUserPrestationsIndList.length;i++){
		for(j=0;j<document.arrUserPrestationsInd.length;j++){
			if(document.arrUserPrestationsInd[j]==document.arrUserPrestationsIndList[i]){				
				document.arrUserPrestationsTp.push(document.arrUserPrestations[j]);
				document.arrUserPrestationsFRTp.push(document.arrUserPrestationsFR[j]);
				document.arrUserPrestationsNbTp.push(document.arrUserPrestationsNb[j]);
				document.arrUserPrestationsIndTp.push(document.arrUserPrestationsInd[j]);
				strPrestation=strPrestation+"&idPrestation"+numPrestation+"="+document.arrUserPrestations[j];
				strPrestation=strPrestation+"&frPrestation"+numPrestation+"="+document.arrUserPrestationsFR[j];
				strPrestation=strPrestation+"&nbPrestation"+numPrestation+"="+document.arrUserPrestationsNb[j];
				strPrestation=strPrestation+"&indPrestation"+numPrestation+"="+document.arrUserPrestationsInd[j];
				document.arrUserPrestationsInd[j]="";
				numPrestation++;
			}
		}
	}
	
	document.arrUserPrestations=document.arrUserPrestationsTp;
	document.arrUserPrestationsFR=document.arrUserPrestationsFRTp;
	document.arrUserPrestationsNb=document.arrUserPrestationsNbTp;
	document.arrUserPrestationsInd=document.arrUserPrestationsIndTp;
	
	recordPrestationUserForm(strPrestation);
}
function loadPrestations(listeElement,categorieParent){
	if(document.arrIdPrestations[categorieParent]){
		nbPrestations=document.arrIdPrestations[categorieParent].length;
		document.getElementById(listeElement).options.length=nbPrestations;
		for(i=0;i<nbPrestations;i++){
			document.getElementById(listeElement).options[i].text=document.arrPrestations[document.arrIdPrestations[categorieParent][i]]["prestation"];
			document.getElementById(listeElement).options[i].value=document.arrIdPrestations[categorieParent][i];
		}
	}
}
function recordPrestationUserForm(strPrestation){
	arrParamsKeys=new Array("strPrestation");
	arrParamsValues=new Array(strPrestation);
	envoieRequete("recordPrestationsUser.php","",arrParamsKeys,arrParamsValues,refreshTable,"");	
}
function refreshTable(){
	buildformules(document.iddeb,document.idfin);
}
function modifDivDateEffet()
{
	currentStyle=document.getElementById("divTableAlertEffet").style.display;	
	document.getElementById("divTableAlertEffet").style.display=(currentStyle=="block")?"none":"block";
	document.getElementById("divTableChangeEffet").style.display=(currentStyle=="block")?"block":"none";
}

//]]>