/* fonction pour règle de gestion des boutons radio de la facture sur le net de prélèvment automatique */
function unchecked_factnet(id,id2) {
	var bcheckbox = getObject (id);
	var bcheckbox2 = getObject (id2);
	
	
	if (bcheckbox.checked == true && bcheckbox2.checked == true) {
		
		bcheckbox.checked = true;
		bcheckbox2.checked = false;
	}
	if (bcheckbox.checked == false && bcheckbox2.checked == true) {
		
		bcheckbox.checked = true;
		bcheckbox2.checked = false;
	}
	if (bcheckbox.checked == true && bcheckbox2.checked == false) {
		
		bcheckbox.checked = false;
		bcheckbox2.checked = true;
	}
	
}

/* ------- fonction de gestion des cases à cocher sur les formulaires lorsqu'on indique que l'on possède la TV -----------*/
/*------ utilisée pour les formulaires 19621,19622,19623 ----------------*/
function verifTV(id) {
	if(id == "option03") 
	{
	
		if(document.getElementById(id).checked == true) {
			document.getElementById('option04').checked = false;
			document.getElementById('option05a').checked = false;
			document.getElementById('option05b').checked = false;
			document.getElementById('option06').checked = false;
		}
	}
	
	if(id == "option04") 
	{
		if(document.getElementById(id).checked == true) {
			document.getElementById('option05a').checked = false;
			document.getElementById('option03').checked = false;
			document.getElementById('option05b').checked = false;
		}
	} 
	
	if(id == "option05a") 
	{
		if(document.getElementById(id).checked == true) {
			document.getElementById('option04').checked = false;
  			document.getElementById('option03').checked = false;
		}
	} 	
	if(id == "option05b") 
	{
		if(document.getElementById(id).checked == true) {
			document.getElementById('option04').checked = false;
			document.getElementById('option03').checked = false;
		}
	} 
	
	if(id == "option07") 
	{
		if(document.getElementById(id).checked == true) {
			document.getElementById('option06').checked = false;
		} 
		else
		{
			document.getElementById('option06').disabled = false;
		}
		if(document.getElementById(id).checked == false
			&& document.getElementById('option03').checked == true  
			&& document.getElementById('option04').checked == false
			&& document.getElementById('option05a').checked == false
			&& document.getElementById('option05b').checked == false)
		{
			document.getElementById('option06').checked = false;
		}
		if(document.getElementById(id).checked == true
			&& document.getElementById('option03').checked == false  
			&& document.getElementById('option04').checked == false
			&& document.getElementById('option05a').checked == false
			&& document.getElementById('option05b').checked == false)
		{
			document.getElementById('option07').checked = false;
		}
		
	}
	
	if(id == "option06") 
	{
		
		if(document.getElementById(id).checked == true) {
			document.getElementById('option03').checked = false;
			document.getElementById('option07').checked = false;
		} 
		if(document.getElementById(id).checked == true
			&& document.getElementById('option03').checked == false  
			&& document.getElementById('option04').checked == false
			&& document.getElementById('option05a').checked == false
			&& document.getElementById('option05b').checked == false)
		{
			document.getElementById('option06').checked = false;
		}		
	} 	
}

function verifTVPro(id) {
	if(id == "option03") 
	{
	
		if(document.getElementById(id).checked == true) {
			document.getElementById('option05a').checked = false;
			document.getElementById('option05b').checked = false;
			document.getElementById('option06').checked = false;
		}
	}
		
	if(id == "option05a") 
	{
		if(document.getElementById(id).checked == true) {
  			document.getElementById('option03').checked = false;
		}
	} 	
	if(id == "option05b") 
	{
		if(document.getElementById(id).checked == true) {
			document.getElementById('option03').checked = false;
		}
	} 
	
	if(id == "option07") 
	{
		if(document.getElementById(id).checked == true) {
			document.getElementById('option06').checked = false;
		} 
		else
		{
			document.getElementById('option06').disabled = false;
		}
		if(document.getElementById(id).checked == false
			&& document.getElementById('option03').checked == true  
			&& document.getElementById('option05a').checked == false
			&& document.getElementById('option05b').checked == false)
		{
			document.getElementById('option06').checked = false;
		}
		if(document.getElementById(id).checked == true
			&& document.getElementById('option03').checked == false  
			&& document.getElementById('option05a').checked == false
			&& document.getElementById('option05b').checked == false)
		{
			document.getElementById('option07').checked = false;
		}
		
	}
	
	if(id == "option06") 
	{
		
		if(document.getElementById(id).checked == true) {
			document.getElementById('option03').checked = false;
			document.getElementById('option07').checked = false;
		} 
		if(document.getElementById(id).checked == true
			&& document.getElementById('option03').checked == false  
			&& document.getElementById('option05a').checked == false
			&& document.getElementById('option05b').checked == false)
		{
			document.getElementById('option06').checked = false;
		}		
	} 	
}


function getObject (id) {
	if (document.getElementById) {
	return document.getElementById(id);
	}
	else if (document.all) {
	return document.all[id];
	}
	else if (document.layers) {
	return document.layers[id];
	}
}
/*
	Les 3 fonctions suivantes permettent de gérer les pop up (utilisés en autre dans prélèvement automatique
*/
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
	  links[i].onclick = function() {
        window.open(this.href,'','width=610px,height=610px,toolbar=no,scrollbars=auto,resizable=yes,top=50px,left=50x');
        return false;
      }
    }
  }
}

function retourPopup() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("retourpere")) {
      links[i].onclick = function() {
        self.close();
        return false;
      }
    }
  }
}

function initPopup() {
	doPopups();
	retourPopup();
}

function doPopupsFacture() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
	  links[i].onclick = function() {
	  //alert("test");
        window.open(this.href,'','width=800px,height=600px,toolbar=no,scrollbars=auto,resizable=yes,top=50px,left=50x');
        return false;
      }
    }
  }
}

function initPopupFacture() {
	doPopupsFacture();
	retourPopup();
}

function initPopupAtout() {
	doPopupsFacture();
	doPopupsAtout();
	doPopupsNumAtout();
	retourPopup();
}

function initPopupSyntheseAtout() {
	doPopupsSyntheseAtout();
	retourPopup();
}

function doPopupsAtout() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popupAtout")) {
	  links[i].onclick = function() {
	  //alert("test");
        window.open(this.href,'','width=400px,height=400px,toolbar=no,scrollbars=auto,resizable=yes,top=50px,left=50x');
        return false;
      }
    }
  }
}

function doPopupsSyntheseAtout()
{
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popupSyntheseAtout")) {
			links[i].onclick = function() {
	        window.open(this.href,'','width=400px,height=500px,toolbar=no,scrollbars=auto,resizable=yes,top=50px,left=50x');
	        return false;
	      }
	    }
	}
}

function doPopupsNumAtout() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popupNumAtout")) {
	  links[i].onclick = function() {
	  //alert("test");
        window.open(this.href,'','width=400px,height=450px,toolbar=no,scrollbars=auto,resizable=yes,top=50px,left=50x');
        return false;
      }
    }
  }
}

function formTarget(MyForm, url)
{
	var targetVar = url;
	
	for (var i = 0; i < MyForm.elements.length; i++) 
	{
		if(MyForm.elements[i].name != 'target')
		{
			if(MyForm.elements[i].type == 'checkbox')
			{
				if(MyForm.elements[i].checked == true)
				{
					targetVar += MyForm.elements[i].name+'='+MyForm.elements[i].value+'&';
				}
			}
			else if(MyForm.elements[i].type == 'radio')
			{
				if(MyForm.elements[i].checked == true)
				{
					targetVar += MyForm.elements[i].name+'='+MyForm.elements[i].value+'&';
				}
			}
			else
			{
				targetVar += MyForm.elements[i].name+'='+MyForm.elements[i].value+'&';
			}
		}
	}
	
	return targetVar;
}

<!-- Début Gestion des Cookies :  Bill Dortch, hIdaho Design / Benoit BOURGEOIS FRANCE TELECOM-->
function getCookieVal (offset){
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1) endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));}

function GetCookie (name){
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) 
	{
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;
}
return null;
}
function SetCookie(name,value){//sauvegarde les cookies dans la limite de 20 pour 4096 octets
	nbcookie=document.cookie.split(";").length;
	if(GetCookie(name)==null){longcookie=document.cookie.length+name.length+escape(value).length+3;nbcookie=document.cookie.split(";").length+1}
	else{longcookie=document.cookie.length-escape(GetCookie(name)).length+escape(value).length;nbcookie=document.cookie.split(";").length}
	if((nbcookie<21)&&(longcookie<4096)){
		var argv = SetCookie.arguments;
		var argc = SetCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + "=" + escape(value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString() )) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
	}
}
function DeleteCookie(name){
var exp = new Date ();
exp.setTime (exp.getTime()-1);  // Ce Cookie appartient au passé (modifié en -1)
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

//<!-- Fin Gestion des Cookies :  Bill Dortch, hIdaho Design / Benoit BOURGEOIS FRANCE TELECOM-->

function check_email(champ){
if (champ==""){
	return false;
}else{
	var sCheckString = champ;
	if (sCheckString.length != 0 ){
		var bErreur = false;
		var iCpt = 1;
		var iLength = sCheckString.length;
		// recherche qu'il n'y a pas de ; dans l'email
		if (sCheckString.indexOf(';') != -1) {bErreur=true;}
		// recherche qu'il n'y a pas d'espace dans l'email
		if (sCheckString.indexOf(' ') != -1) {bErreur=true;}
		// recherche qu'il n'y a pas de caractères accentués dans l'email
		if (sCheckString.indexOf('ù') != -1) {bErreur=true;}
		if (sCheckString.indexOf('à') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ç') != -1) {bErreur=true;}
		if (sCheckString.indexOf('è') != -1) {bErreur=true;}
		if (sCheckString.indexOf('é') != -1) {bErreur=true;}
		if (sCheckString.indexOf('â') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ô') != -1) {bErreur=true;}
		if (sCheckString.indexOf('î') != -1) {bErreur=true;}
		if (sCheckString.indexOf('û') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ê') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ä') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ë') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ï') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ö') != -1) {bErreur=true;}
		if (sCheckString.indexOf('ü') != -1) {bErreur=true;}
		// recherche du caractere @
		while((iCpt < iLength) && (sCheckString.charAt(iCpt) != "@")){iCpt++}
		var iCp2=iCpt+1 //controle unicite"@"
		while(iCp2 < iLength){
			if(sCheckString.charAt(iCp2) == "@") {bErreur = true;break }
			{iCp2++}
		}
		if((iCpt >= iLength) || (sCheckString.charAt(iCpt) != "@")) bErreur = true;
		// recherche du caractere .
		while ((iCpt < iLength) && (sCheckString.charAt(iCpt) != ".")){iCpt++}
		// il doit y avoir au moins un caractere apres le .
		if ((iCpt >= iLength - 1) || (sCheckString.charAt(iCpt) != ".")) bErreur = true;
		
		var modele2 = /^[a-z0-9\-\.]+@francetelecom\.fr$/i;
		var modele3 = /^[a-z0-9\-\.]+@france\.telecom\.fr$/i;
		var modele4 = /^[a-z0-9\-\.]+@wanadoo\.com$/i;
		if (modele2.test(champ) ) {
          bErreur = true;
        }
		if (modele3.test(champ) ) {
          bErreur = true;
        }
		if (modele4.test(champ) ) {
          bErreur = true;
        }
		
		if (bErreur == true) {
			msg('box',7);
			return paramfaux();
		}
		else return true;
	}
}
}
function badphonenumber(){
msg('box',2);
}
function badsupportnumber(){
//variable pour Eligibilite ADSL
Flag_Support_Renseigne=true;
msg('box',83);
}
function badCPnumber(){
msg('box',6);
}
function badmobilenumber(){
msg('box',86);
}
function badallonumber(){
msg('box',87);
}

function isphonenumber(num){
	if(isothernumber(num)){
		if(num.length!=10){badphonenumber();return paramfaux();}
		else{return true;}
	}
	return paramfaux();
}
function issupportnumber(num){
	if (isphonenumber(num)){
		if (flaghorstom&&estdom(num)){badallonumber();return paramfaux();}
		if (num.substring(0,2)>05){badsupportnumber();return paramfaux();}
		if (num.substring(0,2)=="00"){ badsupportnumber();return paramfaux();}
		return true;
	}
	return paramfaux();
}

function issupportnumberDOM(num)
{
	if (isphonenumber(num))
	{
		if (estdom(num))
		{
			return true;
		}
		else
		{
			alert("Cet indicatif n'est pas correct, saisir un indicatif DOM");
		}
	}
	return paramfaux();
}

function issupportnumberDOMGuyane(num)
{
	if (isphonenumber(num))
	{
		if (estdomGuyane(num))
		{
			return true;
		}
		else
		{
			alert("Cet indicatif n'est pas correct, saisir un indicatif DOM (Guyane)");
		}
	}
	return paramfaux();
}

function issupportnumberDOMReunion(num)
{
	if (isphonenumber(num))
	{
		if (estdomReunion(num))
		{
			return true;
		}
		else
		{
			alert("Cet indicatif n'est pas correct, saisir un indicatif DOM (Réunion)");
		}
	}
	return paramfaux();
}

function issupportnumberDOMAntilles(num)
{
	if (isphonenumber(num))
	{
		if (estdomAntilles(num))
		{
			return true;
		}
		else
		{
			alert("Cet indicatif n'est pas correct, saisir un indicatif DOM (Antilles)");
		}
	}
	return paramfaux();
}

function isNumCarte(Data)
{
	numChars = "0123456789";
	var isNum = true;
	var index = 0;
	while ((index < Data.length) && (isNum))
	{
	    isNum = (numChars.indexOf(Data.charAt(index)) != -1);
	    index ++;
	}
	if (!isNum || Data.length < 9)
	{
		return false;
	}
	else
	return true;
}
function isintranumber(num){
	if(issupportnumber(num)){
		if(test(num)==true){return true;}
		else{badallonumber();}
	}
	return paramfaux();
}

function ismobilenumber(num){
	if(isphonenumber(num)){
		if (num.substring(0,2)!=06 && num.substring(0,2)!=07){badmobilenumber();return paramfaux();}
		return true;
	}
	return paramfaux();
}
function isothernumber(num){
	if(num!=''){
		for(i=0;i<num.length;i++){
			if((num.charAt(i)==' ')||isNaN(num.charAt(i))){badphonenumber();return paramfaux();}
		}
		return true
	}
	return paramfaux()
}

function notamobile(num){
	if(isothernumber(num)){
		if(num.substring(0,2)=="06" || num.substring(0,2)=="07"){alert("Le numéro ne peut pas être un numéro de mobile");}
		else{return true;}}
	return paramfaux()
}

function replaceString(oldS,newS,fullS){
	for (var i=0; i<fullS.length; i++) {
		if (fullS.substring(i,i+oldS.length) == oldS) {
			fulls = fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length);
			}
	}
return fulls;
}
function conversion(num){
montant='';
cts='';	mnt='';
num=num.replace(/\+| /g,'');
mnt=num.substring(0,(num.length-3));
cts=num.substring((num.length-2),num.length);
cts1=num.substring((num.length-3),num.length);
if ((num!='') && (parseInt(num)<100000) && (isNaN(num)!=true) && (num.charAt(num.length-3)=='.')){
	montant=replaceString(".",",",num);
	return montant;
}
else if ((num!='') && (isNaN(num.charAt(num.length-3))==true) && (isNaN(cts)!=true) && (isNaN(mnt)!=true) &&(parseInt(num)<100000) && (num.charAt(num.length-3)==',')) {
	montant=mnt+','+cts;
	return montant;
}
else {
	alert('Le format d\'affichage doit être de type XXX,YY ou XXX.YY, Exemple: 693,85 ou 696.85');
	return num;
}
}
function isCPnumber(num){
regtest=/^\d{5}$/;
if (((parseInt(otezero(num))>999)&&(parseInt(num)<100000)&&regtest.test(num))||(num="")){return true}
badCPnumber();
return paramfaux()
}

function badamount(){
msg('box',3);
}
function isnumber(num){
	if((num.indexOf ('.')!=-1)||(num.indexOf('+')!= -1)||(num.indexOf('-')!= -1)||(num.indexOf(',')!=-1)){alert('La valeur entree n\'est pas valide.');return paramfaux();}
	else{if(isNaN(num)){alert('La valeur entree n\'est pas valide.');return paramfaux();}else{return true;}
	}
}

function isNumClient(num){
	if(num != '')
	{
		if((num.length < 5) || (num.length > 20))
			{
				alert('veuillez vérifier votre n° client');return paramfaux();
			}
			else
			{
				return true;
			}	
	}
}

function isdate(dte){
var err=0;
if(dte.length!=0){
	if (dte.length != 10){err=1}
	else{
		j=dte.substring(0, 2)//jour
		m=dte.substring(3, 5)//mois
		a=dte.substring(6, 10)//annee
		if(isNaN(j)||isNaN(m)||isNaN(a))err=1
		sep1=dte.substring(2,3)
		sep2=dte.substring(5,6)
		if((sep1!='/')||(sep2!='/'))err=1
		if((m<1||m>12)||(j<1||j>31)||(a<1900||a>2100)||((m==4||m==6||m==9||m==11)&&(j==31)))err=1
		if(m==2){
			var r=parseInt(a/4)
			if(isNaN(r)){err=1}
			if((j>29)||((j==29&&((a/4)!=parseInt(a/4)))))err=1
		}
	}
	if(err==1){baddate();return paramfaux();}
	else{return true}
}
else{return true}
}

function baddate(){
msg('box',310);
}

function filtre(chaine,lmax){//remplace les caracteres "+","&" par "et"; "=" par _; tronque la chaine
chaine=chaine.replace(/\+|&/g,"et")
chaine=chaine.replace("=","_")
chaine=chaine.substr(0,lmax)
return chaine
}
function validformcommun(){
	messagerr="";err=0;
	if(blocvalid){blocvalid=false;return false} ;
	nomsChampsOblig = document.forms[0].requiredjs.value.split(",")
	if(document.forms[0].caseOrdre){ 
		if(document.forms[0].caseOrdre[1]){
			if(document.forms[0].caseOrdre[1].checked) {document.forms[0].Ordre.value=document.forms[0].caseOrdre[1].value;}
			else if(document.forms[0].caseOrdre[0].checked){document.forms[0].Ordre.value=document.forms[0].caseOrdre[0].value;}
		}else{
			document.forms[0].Ordre.value=document.forms[0].caseOrdre.value;
		}
	}
	if((document.forms[0].Ordre.value!="MO")&&(document.forms[0].Ordre.value!="CR")){alert("Information manquante ");return paramfaux()}
	if(document.forms[0].Parrain){
		re1=/adsl/gi; var prescinterdite=prescok;
		presc_int=(document.forms[0].prescmodint&&(document.forms[0].prescmodint.value=="oui"))?true:false;
		if((document.forms[0].Abowan)&&(re1.test(document.forms[0].Abowan.value))){prescinterdite=true};
		if((document.forms[0].Parrain.value!=null)&&(document.forms[0].Parrain.value!="")&&(document.forms[0].Parrain.value!=" ")){
			document.forms[0].Parrain.value=document.forms[0].Parrain.value.replace(/ /g,"")
		}
		prec_aut=(document.forms[0].prescmodaut&&(document.forms[0].prescmodaut.value=="oui"))?true:false;
		if((document.forms[0].Parrain.value!="")&&(!prec_aut)&&((presc_int)||((document.forms[0].Ordre.value!="CR")&&(prescinterdite)))){alert("La prescription n'est pas valide pour ce type de modification de service;\n\n             Effacement du code identifiant !!!");document.forms[0].Parrain.value="";return paramfaux()
		}
	}
	if (document.forms[0].USER){champVid["Montant_Facture"]="le montant de votre dernière facture OU vos identifiants Espace Client\n";}
	for (i=0;i<nomsChampsOblig.length;i++){
		if(isEmpty(document.forms[0].elements[nomsChampsOblig[i]].value)) {
			if (nomsChampsOblig[i]=="Montant_Facture") {
				//ajout Yann : si les champs USER/PASS de l'EC sont renseignés, 
				//le montant facture est facultatifz
				if((!document.forms[0].USER)||(document.forms[0].USER && isEmpty(document.forms[0].USER.value))||
						(document.forms[0].PASSWORD && isEmpty(document.forms[0].PASSWORD.value))
					){messagerr+=champVid[nomsChampsOblig[i]]; err++}
			}
			else {
			messagerr+=champVid[nomsChampsOblig[i]]; err++
			}
		}
	}
	if (err==1){messagerr='Vous devez renseigner le champ:\n'+messagerr;alert(messagerr);return paramfaux()}
	else if(err>1){messagerr='Vous devez renseigner les champs:\n'+messagerr;alert(messagerr);return paramfaux()}
	else {
		SetTheCookieResid();
		mtCom='';
			filtreCS("");effacePlusDeFin("");effacePlusDeFin("")
			var ixcof=1;while(document.forms[0].elements["CodeOffre_"+ixcof]){filtreCS("_"+ixcof);effacePlusDeFin("_"+ixcof);effacePlusDeFin("_"+ixcof);ixcof++;}
			for (i=0;i<nomsChampsOblig.length;i++){
			if((nomsChampsOblig[i]=="Montant_Facture")&&(document.forms[0].elements["Montant_Facture"])&&(document.forms[0].Montant_Facture.value!="")){
				CSmtcom="";
				if (parseFloat(document.forms[0].Montant_Facture.value.replace(',','.'))==0.00&&(mtCom=='')){
					while (mtCom==''){tmpMt=prompt("Veuillez saisir le montant des communications HT ",""); if(tmpMt!=null){mtCom=conversion(tmpMt)}else {return paramfaux()}}
				CSmtcom="+MontantCom="+mtCom
				}
				document.forms[0].ComplementService.value+=plus("")+"MontantFact=" + document.forms[0].Montant_Facture.value+CSmtcom;
				var ixcof=1;while(document.forms[0].elements["CodeOffre_"+ixcof]){document.forms[0].elements["ComplementService_"+ixcof].value+=plus("_"+ixcof)+"MontantFact=" + document.forms[0].Montant_Facture.value+CSmtcom;ixcof++;}
				document.forms[0].Montant_Facture.value=""
			}
		}
	}
	if(document.forms[0].ComplementService){ 
		if(document.forms[0].Support.value==support_EP){
			document.forms[0].ComplementService.value+=plus("")+"Identifie_par_l_espace_client=OUI"
			ixcof=1;while(document.forms[0].elements["CodeOffre_"+ixcof]){document.forms[0].elements["ComplementService_"+ixcof].value+=plus("_"+ixcof)+"Identifié_par_l_espace_client=OUI";ixcof++;}
			}
		else{
			document.forms[0].ComplementService.value+=plus("")+"Identifie_par_l_espace_client=NON";
			ixcof=1;while(document.forms[0].elements["CodeOffre_"+ixcof]){document.forms[0].elements["ComplementService_"+ixcof].value+=plus("_"+ixcof)+"Identifie_par_l_espace_client=NON";ixcof++;}
			}
		if(document.forms[0].Opt_in){
			if(OPT_IN=="OUI"){document.forms[0].Opt_in.value="OUI"}else{document.forms[0].Opt_in.value="NEUTRE"}
			}
		if(document.forms[0].CodeOffre=="FDOC"){document.forms[0].ComplementService.value+="+"}
		ixcof=1;while(document.forms[0].elements["CodeOffre_"+ixcof]){if(document.forms[0].elements["CodeOffre_"+ixcof]=="FDOC"){document.forms[0].elements["ComplementService_"+ixcof].value+="+"};ixcof++}
	}
	if(blocvalid){blocvalid=false;return false} ;
	return true
}
//gestion "+" de fin
function effacePlusDeFingen(champ){
	if(champ){
		derplus=champ.value.lastIndexOf("+")
		dercarCS=(derplus==(champ.value.length-1))
		if (dercarCS){champ.value=champ.value.substring(0,derplus)}
	}
}
function effacePlusDeFin(chrang){effacePlusDeFingen(document.forms[0].elements["ComplementService"+chrang])}
function plusgen(champ){
	if(champ){return (champ.value=="")?(""):("+")}
	return ""
}
function plus(chrang){return plusgen(document.forms[0].elements["ComplementService"+chrang]);}

function afficheCS(fich){
	var chemin="/php/vf/accueil/conditions_contractuelles/"
	if (CS_pdf==true){chemin="/doc/contrats/";}
	conditionsspe=window.open(chemin+fich,"Conditions_contractuelles","width=512,height=512,scrollbars=yes,resizable=yes")
	conditionsspe.focus();
}
function afficheCS2(fich){
	var chemin="/doc/contrats/"
	conditionsspe=window.open(chemin+fich,"Conditions_contractuelles","width=512,height=512,scrollbars=yes,resizable=yes")
	conditionsspe.focus();
}
function retour(){if ((window.opener)&&(window.opener!=null)){self.close()} else {history.go(-1)}}

function vercodeAl(num){
if(num!=''){
	numok='';	
	numvalid='';
	for (i=0;i<num.length;i++){
		if(num.charAt(i)!=' '){numok=numok+num.charAt(i);}
	}
	if(numok.length!=8)
	{alert("Le code alliance n'est pas complet");
	return false;
	}
	else{
	numvalid=numok.substring(0,8);
	return numvalid;
	}
}
}
function deliv(delai){//renvoie la date du jour augmentée du délai en jours
	aujour=document.forms[0].aujourdhui.value.split("/");
	var tdliv=new Date(Number(aujour[0]),Number(aujour[1]-1),Number(aujour[2]));
	tdliv.setDate(tdliv.getDate()+delai);
	return tdliv;
}

function dateliv1(delai){
dliv=new Date();
dliv=deliv(delai);
annee=dliv.getYear();
if(annee<1900){annee+=1900}
dateliv=dliv.getDate()+"/"+(dliv.getMonth()+1)+"/"+annee;
dateliv=conversion_date(dateliv);
return dateliv;
}

function conversion_date(chaine){
	if (chaine==""){return ""};
	aujour=document.forms[0].aujourdhui.value.split("/");
	today= new Date(Number(aujour[0]),Number(aujour[1]-1),Number(aujour[2]));
	chaine=chaine.replace(/[- _|,;:]/g,"/");
	item_datelist=chaine.split("/")
	var _jour=today.getDate();
	var _mois=today.getMonth()+1;
	var _an=today.getYear();
	if(_an>=100&&_an<200){_an=_an+1900}
	// en cas d'entree d'un seul caractere separateur admis,on remplace par le jour et le mois courant
	if(chaine=="/"){chaine=_jour+"/"+_mois}
	//si un seul champ entre on complete par le mois en cours
	if(item_datelist.length<2){chaine+="/"+_mois}
	//si deux champs,on complete la date par l'annee en courset on reinitialise le tableau de champs date(jj/mm/aaaa)
	if(item_datelist.length<3){chaine+="/"+_an ;delete item_datelist;item_datelist=chaine.split("/")}
	if (item_datelist[0].length<2){item_datelist[0]="0"+(item_datelist[0])}//formatage du jour a deux caracteres
	if (item_datelist[1].length<2){item_datelist[1]="0"+(item_datelist[1])}//formatage mois a deux caracteres
	if ((item_datelist[2])<100){item_datelist[2]=(Number(item_datelist[2])+2000)}//formatage année a 4 caracteres
	chaine=item_datelist[0]+"/"+item_datelist[1]+"/"+item_datelist[2]
	return chaine
}

function contrdate(chaine,delai){
	if ((chaine=="")&&(delai==0)){return ""};
	errdat=false
	tmpdate=dateliv1(0);
	chaine=conversion_date(chaine)
	item_datelist=chaine.split("/");// traduction en type date
	date_a_controler=new Date(Number(item_datelist[2]),Number(item_datelist[1])-1,Number(item_datelist[0]),0,0,0);
	// verification si la date entree n'est pas traduite par une autre date(par exemple si mois=13)
	var _jour=date_a_controler.getDate();
	var _mois=date_a_controler.getMonth()+1;
	if(Number(_jour)<10){_jour="0"+_jour}
	if(Number(_mois)<10){_mois="0"+_mois}
	var _an=date_a_controler.getYear();
	if(_an>=100&&_an<200){_an=_an+1900}
	dateres=_jour+"/"+_mois+"/"+_an
	if(chaine!=dateres){errdat=true;
		alert("La date n'est pas conforme");if(delai==0){chaine=""}else {chaine=dateliv1(delai)}}
	else{
		if(date_a_controler<deliv(delai)){
			errdat=true;
			if(delai==0){alert('La date de mise en service souhaitée ne peut être antérieure à la date courante');chaine=""}
			else{alert("le délai minimun est de "+delai+" jours");chaine=dateliv1(delai)}}
			}
	return chaine
}
/*****************************************************
 * Vérification de la validité d'un numéro de compte *
 *****************************************************/

function verif_rib(code_banque,code_guichet,code_compte,cle_rib){
code=code_banque.toString()+code_guichet.toString()+code_compte.toString();
if (code.length != 21 ){return false;}
code=code.replace(/a|j/gi,"1")
code=code.replace(/b|k|s/gi,"2")
code=code.replace(/c|l|t/gi,"3")
code=code.replace(/d|m|u/gi,"4")
code=code.replace(/e|n|v/gi,"5")
code=code.replace(/f|o|w/gi,"6")
code=code.replace(/g|p|x/gi,"7")
code=code.replace(/h|q|y/gi,"8")
code=code.replace(/i|r|z/gi,"9")
sept1=code.substr(0,7)
sept2=code.substr(7,7)
sept3=code.substr(14,7)
if(cle_rib!=(97-(((62*sept1)+(34*sept2)+(3*sept3))%97))){return paramfaux()}else{return true}
}

function isCode_Alliance(codeIdentifiant){
	if((codeIdentifiant!=null)&&(codeIdentifiant!=""))
		{codeIdentifiant=codeIdentifiant.toUpperCase();
		reid=/^[A-Z]{4}\d{4}$|^[A-Z0-9]{3}[A-Z]{4}\d{4}$/;//
		if (reid.test(codeIdentifiant)){return true}
		alert("Le code identifiant est incorrect");
		_testClic="non";
		codeIdentifiant='';
		return paramfaux();
	}
	return true
}

function paramfaux()
{blocvalid=true;setTimeout("blocvalid=false",1000);return false}

function casesACocherCommeRadio(champ,rang,unmini)
{
for( var cptcc=0;cptcc<champ.form.elements[champ.name].length;cptcc++){if(rang==cptcc){if(unmini){champ.form.elements[champ.name][cptcc].checked=true}; ;} else {champ.form.elements[champ.name][cptcc].checked=false;};};
}
function zabpq(){
flaghorstom=true;
}
function estdom(numatester){
		maListedom=new Array("0590","05963","05964","05965","05966","05967","05968","05969","05942","05943","05944","05945","05949","0262");
		for(n=0;n<maListedom.length;n++){
			if(numatester.substring(0,maListedom[n].length)==maListedom[n]){return true;}
		}
return false;
}
function estdomGuyane(numatester){
		maListedom=new Array("05942","05943","05944","05945","05949");
		for(n=0;n<maListedom.length;n++){
			if(numatester.substring(0,maListedom[n].length)==maListedom[n]){return true;}
		}
return false;
}
function estdomReunion(numatester){
		maListedom=new Array("0262");
		for(n=0;n<maListedom.length;n++){
			if(numatester.substring(0,maListedom[n].length)==maListedom[n]){return true;}
		}
return false;
}
function estdomAntilles(numatester){
		maListedom=new Array("0590","05963","05964","05965","05966","05967","05968","05969");
		for(n=0;n<maListedom.length;n++){
			if(numatester.substring(0,maListedom[n].length)==maListedom[n]){return true;}
		}
return false;
}
function champVideMessage(){}

function filtreCS(chrang)//masque avec"\" les caracteres interprétés dans le complémént de service remplace tabulations et retour chariots par espaces
{if (document.forms[0].elements["ComplementService"+chrang])
	{
	regmess= new RegExp("\\s","g");regmess2= new RegExp("\\|","g");
	document.forms[0].elements["ComplementService"+chrang].value=document.forms[0].elements["ComplementService"+chrang].value.replace(regmess," ").replace(regmess2,"!")+"+"
	for(var nbform=0;nbform<document.forms.length;nbform++)
		{
		for(var nbel=0;nbel<document.forms[nbform].elements.length;nbel++)
			{
			if((document.forms[nbform].elements[nbel].type=="text")||(document.forms[nbform].elements[nbel].type=="textarea"))
				{document.forms[nbform].elements[nbel].value=document.forms[nbform].elements[nbel].value.replace(regmess," ").replace(regmess2,"!")
				var chaine=document.forms[nbform].elements[nbel].value;
				if((chaine.indexOf("+")>-1)||(chaine.indexOf("=")>-1)||(chaine.indexOf(String.fromCharCode(92))>-1)||(chaine.indexOf("&")>-1))
					{
					var compServ=document.forms[0].elements["ComplementService"+chrang].value;
					if (compServ.indexOf(chaine)>-1)
						{
						var chaine2=masque(masque(masque(masque(chaine,String.fromCharCode(92)),"="),"&"),"+")
						chaine="="+chaine+"+";chaine2="="+chaine2+"+";
						var debrech=0
						while(compServ.indexOf(chaine,debrech)>-1)
							{
							var idxchaine=compServ.indexOf(chaine,debrech);debrech=idxchaine+chaine.length
							if(compServ.charAt(debrech)!="+"){
							document.forms[0].elements["ComplementService"+chrang].value=compServ.substring(0,idxchaine)+chaine2+compServ.substring(idxchaine+chaine.length);
							compServ=document.forms[0].elements["ComplementService"+chrang].value;}
							//alert(chaine+" "+compServ+" "+debrech)
							}
						}
					}
				}
			}
		}
	}
}
function masque(chaine,anccar)
	{
	var chainetmp="";
	var masque=String.fromCharCode(92);
	for(var iii=0;iii<chaine.length;iii++){{var cartmp=chaine.charAt(iii)}if(cartmp==anccar){chainetmp+=masque};if(cartmp=="+"){cartmp="&"};chainetmp+=cartmp}
	return chainetmp
}
function metZerosDevant(chaine,nbcar)
	{chaine=chaine.replace(/ /g,"");
	if(chaine!=""){while(chaine.length<nbcar){chaine="0"+chaine;}}
	return chaine;
	}
function validationv7(){
if (clicValid && valide()) {window.document.forms[0].submit();} return false;}

function valide(){
	if(DesactiverBoutonValider(validform())){return true;}
	return false;
}
function DesactiverBoutonValider(boutonVal){
	if (clicValid && boutonVal){
		clicValid=false;
		return true;
	}
	return false;
}
function otezero(chaine){
	return chaine.replace(/^0+/g,"")
}
function ensavoirplus(numfp,URL){
	var taburl=URL.split("/");
	for(var ii=0;ii<taburl.length;ii++){
		if(taburl[ii]=="fp"){
		refp=new RegExp(taburl[ii+1]);
		URL=URL.replace(refp,numfp);
		break;
		}
	}
opener.location.href=URL;
opener.focus();
}
function isEmpty(val){
	if(val==null
	||val.length==0
	||typeof(val)=='undefined'
	||val.match(new RegExp(/^\s*$/))
	){
		return true;
	}
	else return false;
}
/*function creaEC(){
var telcrea="";
	if (document.forms[0].Support.value!=''){
		telcrea=document.forms[0].Support.value;
	}else {alert('vous devez saisir un numéro');return;}
window.location="http://dmworkflow.snpi.francetelecom.fr:9914/servlets/pu_CreationCompteAvecContexteServlet?site=boutique&retour=http://dmworkflow.snpi.francetelecom.fr:9914/appel_exterieur.htm&tel="+telcrea;
}*/

/*function creaEC(){
	
	if (document.forms[0].Support.value!=''){
		document.forms[0].action='/servlet/SAuthentification?task=creerEC';
		document.forms[0].submit();
	}else {alert('vous devez saisir un numéro');return;}
}*/

function creaEC(){
	//alert('passage dans creaEC');
	document.forms[0].action='http://boutique.orange.fr/servlet/SAuthentification?task=creerEC';
	var erreur=false;
	if (document.formcreation && document.formmodification) {
		if (formcreation.Support&&formcreation.Support.value!=""){
		document.forms[0].Support.value=formcreation.Support.value;
		}else if(formmodification.Support&&formmodification.Support.value!=""){
		document.forms[0].Support.value=formmodification.Support.value;
		}else {erreur=true;}
	}
	else if(document.forms[0].Support.value==''){erreur=true;}
	else{}
	if(erreur){alert('Veuillez saisir un numéro.');
		return false;
	}
	else{
		SetTheCookieResid();
		document.forms[0].submit();
	}
}

function SetTheCookieResid()//enregistre les cookie text,checkebox et select, les tableaux text et checkbox
{
	tabcookie=document.cookie.split(";")//effacement des cookies précédents
	for(ikk=0;ikk<tabcookie.length;ikk++)
	{
		descookie=tabcookie[ikk].split("=");
		var nomcookie=descookie[0].replace(/^0+/g,"");
		DeleteCookie(nomcookie);
	}
	var expdate = new Date ();
	expdate.setTime(expdate.getTime(24 * 60 * 60 * 1 * 1000));
	//balayage du document.forms
	var tmpNomschamps="";var tmpValeursChamps="";var sep="||";
	for (idxform=0;idxform<document.forms.length;idxform++){
		for(idd=0;idd<document.forms[idxform].elements.length;idd++){
			var nomparam=document.forms[idxform].elements[idd].name
			var parminter= new Array("Montant_Facture","NumCB","DatCB","CodBan","NumCompt","CodGui","RIB","ajoutep","opt_in")
			var autcookie=true;for(inter=0;inter<parminter.length;inter++){if(nomparam==parminter[inter]){autcookie=false;break}}
			if(autcookie&&(document.forms[idxform].elements[idd].type!="hidden")&&(nomparam!="")){
				valparam=document.forms[idxform].elements[idd].value;
				if(!document.forms[idxform].elements[nomparam][1]){//on n'a pas affaire à un tableau
					if((document.forms[idxform].elements[idd].type=="text")||(document.forms[idxform].elements[idd].type=="textarea")){
						if(valparam!=""){tmpNomschamps+=nomparam+sep;tmpValeursChamps+=valparam+sep}
					}else if(document.forms[idxform].elements[idd].type=="checkbox"){
						tmpNomschamps+='cAsEs'+nomparam+sep;tmpValeursChamps+=((document.forms[idxform].elements[idd].checked)?"V":"F")+sep;
					}else if(document.forms[idxform].elements[idd].type=="radio"){
					tmpNomschamps+='rAdIo'+nomparam+sep;tmpValeursChamps+=((document.forms[idxform].elements[idd].checked)?"V":"F")+sep;
					}
				}else{//on est dans un tableau
					if((document.forms[idxform].elements[idd].type=="text")||(document.forms[idxform].elements[idd].type=="textarea")){
						for(tmpix=0;tmpix<document.forms[idxform].elements[nomparam].length;tmpix++){
							if((valparam!="")&&(document.forms[idxform].elements[nomparam][tmpix].value==valparam)){
								tmpNomschamps+=nomparam+"["+tmpix+"]"+sep;tmpValeursChamps+=valparam+sep
							}
						}
					}
					else if(document.forms[idxform].elements[idd].type=="checkbox"){
						cases="";inoms="";
						for(tmpix=0;tmpix<document.forms[idxform].elements[nomparam].length;tmpix++){
							inoms=inoms+tmpix.toString()+"|";
							cases=cases+((document.forms[idxform].elements[nomparam][tmpix].checked)?"V":"F").toString()+"\t";
							}
							tmpNomschamps+='cAsEs'+nomparam+"["+inoms+"]"+sep;tmpValeursChamps+=cases+sep
						}
					else if(document.forms[idxform].elements[idd].type=="radio"){
						radiob="";inoms="";
						for(tmpix=0;tmpix<document.forms[idxform].elements[nomparam].length;tmpix++){
							inoms=inoms+tmpix.toString()+"|";
							radiob=radiob+((document.forms[idxform].elements[nomparam][tmpix].checked)?"V":"F").toString()+"\t";
						}
						tmpNomschamps+='rAdIo'+nomparam+"["+inoms+"]"+sep;tmpValeursChamps+=radiob+sep
					}
				}
				if(document.forms[idxform].elements[idd].type=="select-one"){
					lll=document.forms[idxform].elements[nomparam].length
					selec="";inoms="";
					for(tmpix=0;tmpix<lll;tmpix++){
						inoms=inoms+tmpix.toString()+"|";
						selec=selec+((document.forms[idxform].elements[nomparam].options[tmpix].selected)?"V":"F")+"\t";
					}
					tmpNomschamps+='sElEc'+nomparam+"["+inoms+"]"+sep;tmpValeursChamps+=selec+sep
				}
			}
		}
	}
	SetCookie("nomsChamps1",tmpNomschamps);
	SetCookie("valeursChamps1",tmpValeursChamps);
}

function recupInfosCookie(){
	flag_inf_EP=false;var tmpnomsChamps1="";var tmpValeursChamps1="";
	tabcookie=document.cookie.split(";");var sep="||";
	//recupération des cookies
	for(ikk=0;ikk<tabcookie.length;ikk++){
		descookie=tabcookie[ikk].split("=");
		var nomcookie=descookie[0]; if(nomcookie.charAt(0)==" "){nomcookie=nomcookie.substring(1)}
		valeurrecup=GetCookie(nomcookie);
		if(nomcookie=="infosPerso_EP"){cook_EP=GetCookie(nomcookie);
			if((cook_EP!=null)&&(cook_EP!="")){flag_inf_EP=true;}
		}else if(nomcookie=="nomsChamps1"){tmpnomsChamps1=GetCookie(nomcookie);
		}else if(nomcookie=="valeursChamps1"){tmpValeursChamps1=GetCookie(nomcookie);
		}
	}

	for(idxform=0;idxform<document.forms.length;idxform++){
		if((tmpnomsChamps1!=null)&&(tmpValeursChamps1!=null)&&(tmpnomsChamps1!="")&&(tmpValeursChamps1!="")){
			var nomsChamps = tmpnomsChamps1.split(sep);
			var valeursChamps = tmpValeursChamps1.split(sep);
			for(ikk=0;ikk<nomsChamps.length;ikk++){
				var nomcookie=nomsChamps[ikk];
				valeurrecup=valeursChamps[ikk];
				//si tableau ou select
				if(nomcookie.indexOf("[")>0){
					idxrecup=nomcookie.substring(nomcookie.indexOf("[")+1,nomcookie.indexOf("]"))
					index=idxrecup.split("|");etat=valeurrecup.split("\t")
					if(nomcookie.indexOf("cAsEs")>-1){
						nomparamrecup=nomcookie.substring(5,nomcookie.indexOf("["));
						if((document.forms[idxform].elements[nomparamrecup])&&(document.forms[idxform].elements[nomparamrecup][1])&&(document.forms[idxform].elements[nomparamrecup][1].type=="checkbox")){//tableau de cases
							for (iii=0;iii<index.length-1;iii++){
								if(etat[iii]=="V"){chk=true} else {chk=false}
								if(document.forms[idxform].elements[nomparamrecup][index[iii]]){document.forms[idxform].elements[nomparamrecup][index[iii]].checked=chk}
							}
						}
					}else if(nomcookie.indexOf("rAdIo")>-1){//si radioboutons
						nomparamrecup=nomcookie.substring(5,nomcookie.indexOf("["));
						if((document.forms[idxform].elements[nomparamrecup])&&(document.forms[idxform].elements[nomparamrecup][1])&&(document.forms[idxform].elements[nomparamrecup][1].type=="radio")){//tableau de boutons radio
							for (iii=0;iii<index.length-1;iii++){
								if(etat[iii]=="V"){chk=true} else {chk=false}
								if(document.forms[idxform].elements[nomparamrecup][index[iii]]){document.forms[idxform].elements[nomparamrecup][index[iii]].checked=chk}
							}
						}
					}else if(nomcookie.indexOf("sElEc")>-1){//si select
						nomparamrecup=nomcookie.substring(5,nomcookie.indexOf("["));
						if((document.forms[idxform].elements[nomparamrecup])&&(document.forms[idxform].elements[nomparamrecup].type=="select-one")){
							for (iii=0;iii<index.length-1;iii++){
								if(etat[iii]=="V"){chk=true} else {chk=false}
								if(document.forms[idxform].elements[nomparamrecup].options[index[iii]]){document.forms[idxform].elements[nomparamrecup].options[index[iii]].selected=chk}
							}
						}
					}else {nomparamrecup=nomcookie.substring(0,nomcookie.indexOf("["));
						if((document.forms[idxform].elements[nomparamrecup])&&(document.forms[idxform].elements[nomparamrecup][idxrecup])&&((document.forms[idxform].elements[nomparamrecup][idxrecup].type=="text")||(document.forms[idxform].elements[nomparamrecup][idxrecup].type=="textarea"))){document.forms[idxform].elements[nomparamrecup][idxrecup].value=valeurrecup}
					}
				}
				else if(nomcookie.indexOf("cAsEs")>-1){//checkbox simple
					nomparamrecup=nomcookie.substring(5,nomcookie.indexOf("["));
					if((document.forms[idxform].elements[nomparamrecup])&&(document.forms[idxform].elements[nomparamrecup].type=="checkbox")){
						if(valeurrecup=="V"){chk=true}else{chk=false}
						document.forms[idxform].elements[nomparamrecup].checked=chk
					}
				}
				else if(nomcookie.indexOf("rAdIo")>-1){//radiobouton
					nomparamrecup=nomcookie.substring(5,nomcookie.indexOf("["));
					if((document.forms[idxform].elements[nomparamrecup])&&(document.forms[idxform].elements[nomparamrecup].type=="radio")){
						if(valeurrecup=="V"){chk=true}else{chk=false}
						document.forms[idxform].elements[nomparamrecup].checked=chk
					}
				}
				//reprise des champs texte
				else {nomparamrecup=nomcookie;
					if((document.forms[idxform].elements[nomparamrecup])&&((document.forms[idxform].elements[nomparamrecup].type=="text")||((document.forms[idxform].elements[nomparamrecup].type=="hidden")&&(document.forms[idxform].elements[nomparamrecup].value=="")&&("Support,EmailClient".indexOf(nomparamrecup)>-1))||(document.forms[idxform].elements[nomparamrecup].type=="textarea"))){
						document.forms[idxform].elements[nomparamrecup].value=valeurrecup;
					}
				}
			}
			if(document.forms[idxform].Ordre&&document.forms[idxform].Ordre[1]){if (modif_EP==true){document.forms[idxform].Ordre[1].checked=true;document.forms[idxform].Ordre[0].checked=false;}}
			if(document.forms[idxform].caseOrdre){if(document.forms[idxform].caseOrdre[1]){if (modif_EP==true){document.forms[idxform].caseOrdre[1].checked=true;document.forms[idxform].caseOrdre[0].checked=false;}}}
			if(document.forms[idxform].caseOrdreinv){if(document.forms[idxform].caseOrdreinv[1]){if (modif_EP==true){document.forms[idxform].caseOrdreinv[0].checked=true;document.forms[idxform].caseOrdreinv[1].checked=false;}}}
		}
		if(flag_inf_EP==true){
			tabinf_EP=cook_EP.split("|")
			if((tabinf_EP[0]!=null)&&(tabinf_EP[0]!="")&&(document.forms[idxform].EmailClient)){document.forms[idxform].EmailClient.value=tabinf_EP[0];}
			if((tabinf_EP[1]!=null)&&(tabinf_EP[1]!="")&&(document.forms[idxform].NDContact)){document.forms[idxform].NDContact.value=tabinf_EP[1];}
			if((tabinf_EP[2]!=null)&&(tabinf_EP[2]!="")&&(document.forms[idxform].Nom)){document.forms[idxform].Nom.value=tabinf_EP[2];}
			if((tabinf_EP[3]!=null)&&(tabinf_EP[3]!="")&&(document.forms[idxform].Prenom)){document.forms[idxform].Prenom.value=tabinf_EP[3];}
			if((tabinf_EP[4]!=null)&&(tabinf_EP[4]!="")&&(document.forms[idxform].Adresse)){document.forms[idxform].Adresse.value=tabinf_EP[4];}
			if((tabinf_EP[5]!=null)&&(tabinf_EP[5]!="")&&(document.forms[idxform].CodePostal)){document.forms[idxform].CodePostal.value=tabinf_EP[5];}
			if((tabinf_EP[6]!=null)&&(tabinf_EP[6]!="")&&(document.forms[idxform].Ville)){document.forms[idxform].Ville.value=tabinf_EP[6];}
		}
	}
}

champVid= new Array();
champVid["Support"]= "Numéro de téléphone (de la ligne concernée par le service)\n" ;
champVid["EmailClient"]= "Email\n";
//champVid["Montant_Facture"]="le montant de votre dernière facture OU vos identifiants Espace Client\n";
champVid["Montant_Facture"]="le montant de votre dernière facture\n";
champVid["Montant_Communications"]="le montant des communications\n";
champVid["NDContact"]= "Numéro de téléphone de contact\n";
blocvalid=false;
prescok=true;
CS_pdf=false;
var actionFormulaire=""; //sert à stocker l'action du formulaire
flaghorstom=false;
OPT_IN="vide";
clicValid=true;
