function showHidePassageEnPolice(){	if(gup("Special") != "")	{		document.getElementById("philoContent").style.display = "inline";		document.getElementById("philoContent").style.visibility = "visible";		return;	}	document.getElementById("allContent").style.display = "inline";	document.getElementById("allContent").style.visibility = "visible";	if(RemerciementsFields.FamillePassageDirectEnPolice != "True")		return;	if(getRiskQuality(RemerciementsFields.FamilleRiskQuality))	{		var obj = document.getElementById("div_PassEnPolice");		if(obj != null)		{			obj.style.display = "inline";			obj.style.visibility = "visible";		}		obj = document.getElementById("nbrePossibilites");		if(obj != null)		{			switch(gup("L"))			{				case "I":					obj.innerHTML = "tre";					break;				case "D":					obj.innerHTML = "drei";					break;				default :					obj.innerHTML = "trois";					break;			}		}	}}function getRiskQuality(listRisk ){	var reg = new RegExp("Bon", "g");	listRisk = listRisk.replace(reg, "");	reg = new RegExp(",", "g");	listRisk = listRisk.replace(reg, "");	return (listRisk == "");}/*-------------------------------------------------* Function : countNbClick* Desc : Cr\u00E9e dun document dans la base sites web monitoring (pour la philosophie)* Last Updated : 12.10.2009-------------------------------------------------*/function countNbClick(sLangue){window.location.href = "/Web/SitesWebMonitoring.nsf/StatLink?OpenAgent&ID=FMER-7WMKLL&L="+sLangue}/*-------------------------------------------------* Function : backTotheHomePage()* Desc : Affiche la homePage du site* Last Updated : 25.09.2009-------------------------------------------------*/function backToTheHomePage(){var pathfile = (document.location.href).toLowerCase();pathfile = pathfile.substring(0, pathfile.indexOf("/", 7));window.location.href = pathfile}/*-------------------------------------------------* Function : checkCheckbox()* Desc : Check les checkbox pour la philosophie* Last Updated : 23.09.2009* Dependencies : FrameWork Prototype-------------------------------------------------*/function checkCheckbox(idCheckbox, num){	var box = $(idCheckbox);		if (num == 1) {			if (box.checked == true) {			tmpCheckBox1 = true;		}				else {			tmpCheckBox1 = null;		}	}		else		if (box.checked == true) {			tmpCheckBox2 = true;		}		else {			tmpCheckBox2 = null;		}}/*-------------------------------------------------* Function : getAjaxPhilosophie()* Desc : Lance l'agent wGetAjaxTxtPhilosophie et lance la function getNextPage()* Last Updated : 23.09.2009* Dependencies : FrameWork Prototype-------------------------------------------------*/function getAjaxPhilosophie(){var url  = document.getElementsByName("BaseCourante")[0].value+  "/wGetAjaxParamTxt?OpenAgent&L=" + document.getElementsByName("dLanguage")[0].value + "&CatKey=" + "WDocPhilosophie" + "&FieldName=" + "CategorieIntro"; var myAjax = new Ajax.Request(url, { method: 'get', onSuccess: function(transport){var txt =  transport.responseText;var tab = txt.split("|");$("idContentlayout1").innerHTML = tab[0];$("idContentlayout2").innerHTML = tab[1];$("idError").innerHTML = tab[2];setTimeout("getNextPage('1');", 100);} });}/*-------------------------------------------------* Function : scrollTopDoc()* Desc : Permet d'aller tout en haut d'un contenu* Last Updated : 23.09.2009* Dependencies : FrameWork Prototype-------------------------------------------------*/function scrollTopDoc(divTop){	var E1 = $(divTop);	E1.scrollTop = 0;}/*-------------------------------------------------* Function : erreurPageorOKpage()* Desc : Permet d'afficher la page d'erreur dans la philosophie* Last Updated : 23.09.2009* Dependencies : FrameWork Prototype & Dojo-------------------------------------------------*/function erreurPageorOKpage(){	var msgErreur = $("idError").innerHTML;		if ((tmpCheckBox2 == null)) {			var erreur = "<div style=\"width:500px; border:solid 1px #7BAACE;\">" + msgErreur + "</div>";			hideDojoDialog();		loadDojoDialog(erreur, "", true, true);	}	else {		hideDojoDialog();		window.location.href = document.getElementsByName("BaseCourante")[0].value + "/hvOffresByUniqueID/" + document.getElementsByName("dFamilleChefUniqueID")[0].value+"?EditDocument&S=WDocCoordLong&Type=Poste&L="+document.getElementsByName("dLanguage")[0].value;	}}/*-------------------------------------------------* Function : getNextPage()* Desc : Permet d'afficher la page de la philosophie suivante* Last Updated : 23.09.2009* Dependencies : FrameWork Prototype & Dojo-------------------------------------------------*/function getNextPage(param){	var Contentlayout1 = $("idContentlayout1").innerHTML;	var Contentlayout2 = $("idContentlayout2").innerHTML;	var sContenu;	var sBouton;		var contenu1 = "<div style='width:500px; border:solid 1px #7BAACE;'>" + Contentlayout1 + "</div>";	var bouton1 = "<br><input type='button' value='Ok' onclick='getNextPage(\"2\");' style=\"margin-left:470px; background-color: #7BAACE;\">";		var contenu2 = "<div id='content' style='width:510px; height:155px; overflow:auto; padding:0; margin:0; border:solid 1px #7BAACE;'>" + Contentlayout2 + "</div>";	var bouton2 = "<br><input type='button' value='Ok' onclick='erreurPageorOKpage();' style=\"margin-left:470px; background-color: #7BAACE;\">";		switch (param.toUpperCase()) {		case "1":			sContenu = contenu1;			sBouton = bouton1;			tmpCheckBox1 = null;			tmpCheckBox2 = null;			break;					case "2":			sContenu = contenu2;			sBouton = bouton2;			break;	}		hideDojoDialog();	loadDojoDialog(sContenu + sBouton, "", true, true);		if (param == "2") {		setTimeout("scrollTopDoc('content');", 300);	}}/*-------------------------------------------------* Function : strLeft()* Desc : Searches a string from left to right for a pattern and returns a substring*        consisting of the characters in the string that are to the left of the pattern.* Last Updated : 02.09.2009-------------------------------------------------*/function strLeft(source, subString){return (source.indexOf(subString) == -1 | subString == '') ? '' : source.split(subString)[0];}/*-------------------------------------------------* Function : leftBack()* Desc : Searches a string from right to left for a pattern and returns a substring*        consisting of the characters in the string that are to the left of the pattern.* Last Updated : 02.09.2009-------------------------------------------------*/function leftBack(source, startString){var arr = source.split(startString);arr.pop();return (startString == null | startString == '') ? '' : arr.join(startString)}/*-------------------------------------------------* Function : strRight()* Desc : Searches a string from left to right for a pattern and returns a substring*        consisting of the characters in the string that are to the right of the pattern.* Last Updated : 02.09.2009-------------------------------------------------*/function strRight(source, subString){var arr = source.indexOf(subString);return (arr == -1 | subString == '') ? '' : source.substr(arr + subString.length);}/*-------------------------------------------------* Function : rightBack()* Desc : Returns the rightmost characters in a string.* Last Updated : 02.09.2009-------------------------------------------------*/function rightBack(source, subString){var arr = source.split(subString);return (source.indexOf(subString) == -1 | subString == '') ? '' : arr.pop()}/*-------------------------------------------------* Function : Affiche_OBJ()* Desc : affichage d'un Objet* Last Updated : 07.04.2009-------------------------------------------------*/function Affiche_OBJ(obj_){	var Obj;		Obj = $(obj_); // R\u00E9cup Objet correspondant	if (Obj) {		Obj.style.visibility = "visible";		Obj.style.display = "";	}}/*-------------------------------------------------* Function : Masque_OBJ()* Desc : Masquage d'un Objet* Last Updated : 07.04.2009-------------------------------------------------*/function Masque_OBJ(obj_){	var Obj;		Obj = $(obj_); // R\u00E9cup Objet correspondant	if (Obj) {		Obj.style.visibility = "hidden";		Obj.style.display = "none";	}}/*-------------------------------------------------* Function : BoxPrime()* Desc : Test si l'on vient de la box prime de la HP pour afficher la ville* Last Updated : 07.04.2009-------------------------------------------------*/function BoxPrime(){	var gupTownList = gup('TownList');	if (gupTownList != "") {			Affiche_OBJ("tdTownList");	}}/*-------------------------------------------------* Function : getLoc()* Desc : Make ajax request using Prototype framwork* Last Updated : 07.04.2009* Dependencies : FrameWork Prototype 1.6.0.3-------------------------------------------------*/function getLoc(pNPA, pLocalite) {	if(pNPA.value.length==4){		var year = gup('SDY');		var Dateyear = document.getElementsByName("StartDateAA");		if(Dateyear.length > 0)		{			Dateyear = Dateyear[0];			if(Dateyear.options != null)				year = Dateyear.options[Dateyear.options.selectedIndex].text;			else			{				Dateyear = document.getElementsByName("dStartDateAA");				if(Dateyear.length > 0)				{					Dateyear = Dateyear[0];					year = Dateyear.options[Dateyear.options.selectedIndex].text;				}			}		}		var url="/web/gestionlistes.nsf/getajaxtown?openagent&npa="+pNPA.value+"&year="+year;		var myAjax = new Ajax.Request(url, {  			method: 'get',			onSuccess: function(transport){				handleHttpResponse(transport.responseText.evalJSON(), pLocalite);			}		});	}	else		Masque_OBJ("tdTownList");}/*-------------------------------------------------* Function : handleHttpResponse()* Desc : Traitement de l'ajax* Last Updated : 07.04.2009* Dependencies : FrameWork Prototype 1.6.0.3-------------------------------------------------*/function handleHttpResponse(jsonResponse, fieldId){	var loc = null;	if(fieldId != null)		loc = $(fieldId);	else		loc = $("TownList");			var result = jsonResponse;	var resJSON = new Array();	var ville;	var dataInfoSupl;		if (!result.isError) {		resJSON = result.data;		for (var j = 0; j < resJSON.length; j++){			if (ville != null){				ville += "," + resJSON[j].ville;				dataInfoSupl += ",#"+ resJSON[j].ville +","+ resJSON[j].suffixe +","+ resJSON[j].compl;				}			else {				ville = resJSON[j].ville;				dataInfoSupl = resJSON[j].ville +","+ resJSON[j].suffixe +","+ resJSON[j].compl;				}		}				addValueIntoSelect(loc, ville, dataInfoSupl);		Affiche_OBJ("tdTownList");	}	else {		// Message quand aucunes localit\u00E9s ne correspond au npa		var reg = new RegExp("&#233;", "g");		var reg2 = new RegExp("&#232;", "g");		var msgErreur = sErrMsg[20];		msgErreur = msgErreur.replace(reg, "\u00E9");		msgErreur = msgErreur.replace(reg2, "\u00E8");		msgErreur = msgErreur.replace("-", "");				// vide un select		loc.innerHTML = null;		var op = new Option(msgErreur, "", false, false);		loc.options.add(op);		loc.disabled = true;		Affiche_OBJ("tdTownList");	}}/*-------------------------------------------------* Function : addValueIntoSelect()* Desc : Ajout des valeurs dans le select de la ville* Last Updated : 07.04.2009-------------------------------------------------*/function addValueIntoSelect(elSel, ville, dataInfoSupl){	var op;	var language = document.getElementsByName("dLanguage")[0].value;	var text;		switch (language.toUpperCase()) {		case "D":			text = "W\u00E4hlen Sie Ihre Ortschaft";			break;		case "I":			text = "Scegliete la vostra localit\u00E0";			break;		default:			text = "Choisissez votre localit\u00E9";			break;	}		// Vide le select	elSel.innerHTML = null;		// Ajout des villes		var villeValues = ville.split(",");	var villeInfoSupl = dataInfoSupl.split(",#");		if (villeValues.length > 1) {		for (var i = -1; i < villeValues.length; i++) {			if (i != -1){				op = new Option(villeValues[i], villeInfoSupl[i], false, false);				}			else{				op = new Option(text, "", false, false);				}							elSel.options.add(op);			elSel.disabled = false;		}	}	else {		elSel.innerHTML = null;		op = new Option(villeValues[0], villeInfoSupl[0], false, false);		elSel.options.add(op);		elSel.disabled = true;	}}// Functions de WDocOffresfunction WDocOffresChangeStartDateAA(){	var f = document.forms[0];	var sel = f.StartDateAA.options[f.StartDateAA.options.selectedIndex].text;	var nextYear = f.dWorkYearNext.value;	if (sel == nextYear)		f.StartDateMM.options[0].selected = true;	if (sel == nextYear && f.dPhrasePrimeNextYear1.value != '')		window.top.document.getElementById('divPrimeNextYear').style.display  =  'inline';	else		window.top.document.getElementById('divPrimeNextYear').style.display  =  'none';}function WDocOffresChangedStartDateAA(){	var f = document.forms[0];	var sel = f.dStartDateAA.options[f.dStartDateAA.options.selectedIndex].text;		var nextYear = f.dWorkYearNext.value;		if (sel == nextYear)		f.dStartDateMM.options[0].selected = true;	if (sel == nextYear && f.dPhrasePrimeNextYear1.value != '')		window.top.document.getElementById('divPrimeNextYear').style.display  =  'inline';	else		window.top.document.getElementById('divPrimeNextYear').style.display  =  'none';}function WDocOffresGetMember(){	// retourne "Membre" dans la bonne langue	var f = document.forms[0];	sErrMem = new Array(2);	sErrMem[0] = 'Mitglied';	sErrMem[1] = 'Membro';	sErrMem[2] = 'Membre';	switch (f.dLanguage.value)	{		case 'D':			var member = sErrMem[0];			break;		case 'I':			var member = sErrMem[1];			break;		default:			var member = sErrMem[2];			break;	}	return member;}function WDocOffresValidateFields(retour){	// valide les champs	var f = document.forms[0];	var sErrorTxt = "";	var iErrorPos = 0;	var erreur = false;	var member = WDocOffresGetMember();	var town = $("TownList").value;	sort = false;	// check nb personnes	//	if(isNaN(parseInt(f.FamilleNBPersTotal.value)))		// Modification du 8.11.2006 / FM		if (isNaN(parseInt(f.FamilleNBPersTotal.value)) || (parseInt(f.FamilleNBPersTotal.value) > 6)) {		retour[2] = '<BR>' + sErrMsg[14];		sort = true;	}	if (f.dStatus.value == 1) {		// check NPA		if (isNaN(parseInt(f.Npa.value))) {			retour[2] = retour[2] + '<BR>' + sErrMsg[19];			sort = true;		}		if (f.Npa.value.length != 4) {			retour[2] = retour[2] + '<BR>' + sErrMsg[115];			sort = true;		}		// Test la valeur du champ TownList		if(town == ""){			retour[2] = retour[2] + '<BR>' + sErrMsg[126];			sort = true;		}		// check d\u00E9but contrat		var StartDate = "01." + f.StartDateMM.options[f.StartDateMM.options.selectedIndex].text + "." + f.StartDateAA.options[f.StartDateAA.options.selectedIndex].text;		if (!CompareDate(StartDate, ">=", false)) {			retour[2] = retour[2] + '<BR>' + sErrMsg[18];			sort = true;		}		// si on a une des 3 erreurs pr\u00E9c\u00E9dents		// on sort directement, sinon erreur sur les checks des pr\u00E9noms		if (sort == true) {			if (retour[2] != '')				retour[0] = false;			return retour;		}		if (f.FamilleNBPersTotal.value < 1 || f.FamilleNBPersTotal.value > 6)			retour[2] = '<BR>' + sErrMsg[14];	}	// contr\u00F4le de la ville	if ((f.dStatus.value != 1) && (f.dStatus.value != 0)) {		if (f.TownList[f.TownList.selectedIndex].value == '0')			retour[2] = '<BR>' + sErrMsg[35];	}	var nbPers = parseInt(f.FamilleNBPersTotal.value) + 1;	for (var i = 1; i < nbPers; i++) {		retour = checkFieldSerie(i, retour[2], member, 'FirstName_', 0, 0);		retour = checkFieldSerie(i, retour[2], member, 'Sex', 4, 0);		retour = checkNaissance(i, retour[2], member, '', 'f');	}	if (retour[2] != '')		retour[0] = false;	return retour;}function WDocOffresValidate(){	// fonction de validation de la page	// appelle WDocOffresValidateFields	var retour = new Array(3);	retour[0] = true;	retour[1] = 0;	retour[2] = '';		retour = WDocOffresValidateFields(retour);	if (retour[0] == false)	{		writeError(retour[2], 0, document.forms[0].dLanguage.value);		return false;	}	else	{		$("TownList").disabled = false;		return true;	}}function WDocOffresWriteErrorNPA(){	// \u00E9crit un message d'erreur si le NPA est inexistant	var f = document.forms[0];	if (f.dStatus.value == 0)		writeError('<BR>' + sErrMsg[20] + ' ' + '(' + f.dNPAErreur.value + ')', 0, f.dLanguage.value);	if (f.dStatus.value == 1)			f.Npa.focus();}function WDocOffresChangePrenom(){	// cette fonction affiche ou cache les	// rectangles de saisie des pr\u00E9noms	// dans la partie de droite	// se base sur la valeur saisie dans le champ 'FamilleNBPersTotal'	var f = document.forms[0];	if (isNaN(parseInt(f.FamilleNBPersTotal.value))) {				window.top.document.getElementById('NameAll').style.display  =  'none';		window.top.document.getElementById('NameIntro').style.display  =  'inline';		for (i=1; i<7; i++)			WDocOffresCachePrenom('Name' + 'A' + i.toString());	}	var nbPers = parseInt(f.FamilleNBPersTotal.value) + 1;	// limite du nb de personnes par famille :	if (nbPers >7) {nbPers = 7;}	if (nbPers >= 5)		window.top.document.getElementById('NameIntro').style.display  =  'none';	else		window.top.document.getElementById('NameIntro').style.display  =  'inline';	if (nbPers < 8)	{		window.top.document.getElementById('NameAll').style.display  =  'inline';		for (i=1; i<nbPers; i++) 			WDocOffresAffichePrenom('Name' + 'A' + i.toString());		for (i=nbPers; i<7; i++) 			WDocOffresCachePrenom('Name' + 'A' + i.toString());	}}function WDocOffresAffichePrenom(champ)	{	// affiche un champ pr\u00E9nom	window.top.document.getElementById(champ).style.display  =  'inline';	}function WDocOffresCachePrenom(champ)	{	// cache un champ pr\u00E9nom	window.top.document.getElementById(champ).style.display  =  'none';	}	function WDocOffresAll(qty)	{	var f = document.forms[0];	f.Npa.value = '1121';	getLoc(document.getElementById("Npa"));	f.FamilleNBPersTotal.value = qty;	WDocOffresChangePrenom();	f.FirstName_1.value = 'Jeannot1';	f.SexF_1.checked = true;	f.BirthDateJJ_1.value = 01;	f.BirthDateMM_1.value = 10;	f.BirthDateAA_1.value = 1974;	if (qty>1)		{		f.FirstName_2.value = 'Jeannot2';		f.SexF_2.checked = true;		f.BirthDateJJ_2.value = 02;		f.BirthDateMM_2.value = 02;		f.BirthDateAA_2.value = 1974;		}	if (qty>2)		{		f.FirstName_3.value = 'Jeannot3';		f.SexF_3.checked = true;		f.BirthDateJJ_3.value = 03;		f.BirthDateMM_3.value = 03;		f.BirthDateAA_3.value = 1993;		}	if (qty>3)		{		f.FirstName_4.value = 'Jeannot4';		f.SexF_4.checked = true;		f.BirthDateJJ_4.value = 04;		f.BirthDateMM_4.value = 04;		f.BirthDateAA_4.value = 1994;		}	if (qty>4)		{		f.FirstName_5.value = 'Jeannot5';		f.SexF_5.checked = true;		f.BirthDateJJ_5.value = 05;		f.BirthDateMM_5.value = 05;		f.BirthDateAA_5.value = 1995;		}	if (qty>5)		{		f.FirstName_6.value = 'Jeannot6';		f.SexF_6.checked = true;		f.BirthDateJJ_6.value = 06;		f.BirthDateMM_6.value = 06;		f.BirthDateAA_6.value = 1996;		}	WDocOffresChangePrenom();	}// Functions de WDocOffres// Functions de WDocCoordHiddenfunction WDocCoordGetMember()	{	// retourne "Membre" dans la bonne langue	var f = document.forms[0];	sErrMem = new Array(2);	sErrMem[0] = 'Mitglied';	sErrMem[1] = 'Membro';	sErrMem[2] = 'Membre';		switch (f.dLanguage.value)		{		case 'D':			var member = sErrMem[0];			break;		case 'I':			var member = sErrMem[1];			break;		default:			var member = sErrMem[2];			break;		}	return member;	}	function WDocCoordValidate(opt){	// fonction de validation de la page	// appelle validateFields	var retour = new Array(3);	retour[0] = true;	retour[1] = 0;	retour[2] = '';	retour = WDocCoordValidateFields(retour, opt);	if (retour[0] == false)		{		writeError(retour[2], 0, document.forms[0].dLanguage.value);		return false;		}	else		{		return true;			}}function WDocCoordValidateFields(retour, opt)	{	// valide les champs	var f = document.forms[0];	var member = WDocCoordGetMember();	var sErrorTxt = "";	var iErrorPos = 0;	retour[0] = true;	var checkedMail = false;	with (window.document.forms[0])		{switch (opt) {case 'court' :						// on sort de la fonction, on est en coordonn\u00E9es courtes			// on v\u00E9rifie tous les Noms et Pr\u00E9noms possibles			var nbPers = parseInt(f.FamilleNBPersTotal.value) + 1;			for (var i=1; i<nbPers; i++)				{				retour = checkFieldSerie(i, retour[2], member, 'LastName_', 0);				retour = checkFieldSerie(i, retour[2], member, 'FirstName_', 1);				retour = checkFieldSerie(i, retour[2], member, 'Title_', 107);				}			// Net Application			if (f.dNetVisible.value != 'Non')				{				if (getSelectedButton(PointNet) == -1)					{					retour[2] = retour[2] + '<BR>' + sErrMsg[119];					retour[0] = false;					}				if (getSelectedButton(PointNet) == '1')					{					checkedMail = true;										}				if (EmailAddress.value == "" && (getSelectedButton(PointNet) == '1'))					{					retour[2] = retour[2] + '<BR>' + sErrMsg[118];					}				}			if ( (EmailAddress.value != "" && !emailCheck(EmailAddress.value))  || (EmailAddress.value != EmailAddressConfirmation.value) )				{				retour[2] = retour[2] + '<BR>' + sErrMsg[9];				}	if (f.dDecouverteSiteVisible.value != 'Non') {	if (getSelectedButton(DecouverteSite) == -1) {		retour[2] = retour[2] + '<BR>' + sErrMsg[125];	}}				if (retour[2] != '') {	retour[0] = false;}return retour;case 'light' :			// Contr\u00F4le de la profession			if(WDocCoordFields.hideProfession == "0" & f.Profession.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[61];				retour[0] = false;			}			// Net Application			if (f.dNetVisible.value != 'Non')				{				if (getSelectedButton(PointNet) == -1)					{					retour[2] = retour[2] + '<BR>' + sErrMsg[119];					retour[0] = false;					}				if (getSelectedButton(PointNet) == '1')					{					checkedMail = true;										}				if (EmailAddress.value == "" && getSelectedButton(PointNet) == '1')					{					retour[2] = retour[2] + '<BR>' + sErrMsg[118];					}				}			if (Title.options[Title.selectedIndex].value == '-')				{				retour[2] = retour[2] + '<BR>' + sErrMsg[107];								}				// Contr\u00F4le du nom de famille			if (LastName.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[0];				}					// Contr\u00F4le du pr\u00E9nom			if (FirstName.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[1];			}			// Contr\u00F4le de l'adresse			if (LegalAddress.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[128];			}						// Contr\u00F4le des donn\u00E9es du repr\u00E9sentant l\u00E9gal		if (f.dAgePourCalcul.value < 18)		{			// Contr\u00F4le du nom du repr\u00E9sentant l\u00E9gal			if (LegalRepLastName.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[6];			}			// Contr\u00F4le du pr\u00E9nom du repr\u00E9sentant l\u00E9gal			if (LegalRepFirstName.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[7];			}			// Contr\u00F4le de la date de naissance du repr\u00E9sentant l\u00E9gal			retour = checkNaissance(0, retour[2], '', 'LegalRep', 'f');		}		// Contr\u00F4le de l'adresse E-Mail si elle a \u00E9t\u00E9 saisie			if ( (EmailAddress.value != "" && !emailCheck(EmailAddress.value)) || (EmailAddress.value != EmailAddressConfirmation.value) )			{			retour[2] = retour[2] + '<BR>' + sErrMsg[9];			}// Contr\u00F4le de donn\u00E9es pour les \u00E9trangers		var sNationality = Nationality.options[Nationality.selectedIndex].value;		var sPermis = PermisType.options[PermisType.selectedIndex].text;		if (sNationality != "CHE")			{			f.PermisUntil.value = "01." + PermisUntilMM.value + "." + PermisUntilAA.value;			if (sPermis == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[10];				}			if (PermisNumber.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[11];				}			if (f.PermisUntil.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[12];				}			else				{				if (f.PermisUntil.value.length < 10)					{					retour[2] = retour[2] + '<BR>' + sErrMsg[22];					}				else					{					if (!CheckDate(f.PermisUntil.value))						{						retour[2] = retour[2] + '<BR>' + sErrMsg[22];						}					else						{						if (!CompareDate(f.PermisUntil.value, ">", true))							{							retour[2] = retour[2] + '<BR>' + sErrMsg[23];							}						}					}				}			}		if (f.dHideMedFamille.value == 'False')		{			if (f.disObligMedFamille.value == 'Oui' & !f.eMedFamilleNotFound.checked)			{				if (eMedFamilleLastName.value == "" || eMedFamilleFirstName.value == "" || eMedFamilleNPA.value == "" || eMedFamilleTown.value == "")				{					retour[2] = retour[2] + '<BR>' + sErrMsg[120];				}			}		}						if (OtherLAMalInsuranceName.options[OtherLAMalInsuranceName.selectedIndex].value == "-")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[26];			}			if (getSelectedButton(OtherLAMalPoursuite) == -1)			{				retour[2] = retour[2] + '<BR>' + sErrMsg[117];			}		if (f.dDecouverteSiteVisible.value != 'Non')				{		if (getSelectedButton(DecouverteSite) == -1)			{			retour[2] = retour[2] + '<BR>' + sErrMsg[125];			}}if (retour[2] != ''){retour[0] = false;}return retour;default :		// Contr\u00F4le de la profession			if(WDocCoordFields.hideProfession == "0" & f.Profession.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[61];				retour[0] = false;			}			// en cas de coordonn\u00E9es longues			// Net Application			if (f.dNetVisible.value != 'Non')				{				if (getSelectedButton(PointNet) == -1)					{					retour[2] = retour[2] + '<BR>' + sErrMsg[119];					retour[0] = false;					}				if (getSelectedButton(PointNet) == '1')					{					checkedMail = true;										}				if (EmailAddress.value == "" && getSelectedButton(PointNet) == '1')					{					retour[2] = retour[2] + '<BR>' + sErrMsg[118];					}				}			if (Title.options[Title.selectedIndex].value == '-')				{				retour[2] = retour[2] + '<BR>' + sErrMsg[107];								}				// Contr\u00F4le du nom de famille			if (LastName.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[0];				}					// Contr\u00F4le du pr\u00E9nom			if (FirstName.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[1];				}				// Contr\u00F4le de l'adresse			if (LegalAddress.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[128];			}			// Newsletter			if (checkNewsletter() == true)				{				if ( EmailAddress.value == "" && getSelectedButton(InscrNewsletter) == "1" && checkedMail == false)					{					retour[2] = retour[2] + '<BR>' + sErrMsg[105];					}				}			}		// Contr\u00F4le des donn\u00E9es du repr\u00E9sentant l\u00E9gal		if (f.dAgePourCalcul.value < 18)			{			// Contr\u00F4le du nom du repr\u00E9sentant l\u00E9gal			if (LegalRepLastName.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[6];				}			// Contr\u00F4le du pr\u00E9nom du repr\u00E9sentant l\u00E9gal			if (LegalRepFirstName.value == "")			{				retour[2] = retour[2] + '<BR>' + sErrMsg[7];			}			// Contr\u00F4le de la date de naissance du repr\u00E9sentant l\u00E9gal			retour = checkNaissance(0, retour[2], '', 'LegalRep', 'f');			}		// Contr\u00F4le de l'adresse E-Mail si elle a \u00E9t\u00E9 saisie			if ( (EmailAddress.value != "" && !emailCheck(EmailAddress.value)) || (EmailAddress.value != EmailAddressConfirmation.value) )			{			retour[2] = retour[2] + '<BR>' + sErrMsg[9];			}		if (MaritalStatus.options[MaritalStatus.selectedIndex].text == "")			{			retour[2] = retour[2] + '<BR>' + sErrMsg[24];			}		// Contr\u00F4le de donn\u00E9es pour les \u00E9trangers		var sNationality = Nationality.options[Nationality.selectedIndex].value;		var sPermis = PermisType.options[PermisType.selectedIndex].text;		if (sNationality != "CHE")			{			f.PermisUntil.value = "01." + PermisUntilMM.value + "." + PermisUntilAA.value;			if (sPermis == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[10];				}			if (PermisNumber.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[11];				}			if (f.PermisUntil.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[12];				}			else				{				if (f.PermisUntil.value.length < 10)					{					retour[2] = retour[2] + '<BR>' + sErrMsg[22];					}				else					{					if (!CheckDate(f.PermisUntil.value))						{						retour[2] = retour[2] + '<BR>' + sErrMsg[22];						}					else						{						if (!CompareDate(f.PermisUntil.value, ">", true))							{							retour[2] = retour[2] + '<BR>' + sErrMsg[23];							}						}					}				}			}		if (f.dHideMedFamille.value == 'False')			{			if (f.disObligMedFamille.value == 'Oui' & !f.eMedFamilleNotFound.checked)				{				if (eMedFamilleLastName.value == "" || eMedFamilleFirstName.value == "" || eMedFamilleNPA.value == "" || eMedFamilleTown.value == "")					{					retour[2] = retour[2] + '<BR>' + sErrMsg[120];					}				}			}		// Contr\u00F4le de donn\u00E9es Autres assurances		f.OtherLCACanceledDate.value = "";		if (getSelectedButton(OtherLAMalPoursuite) == -1)		{			retour[2] = retour[2] + '<BR>' + sErrMsg[117];		}						if (OtherLAMalInsuranceName.options[OtherLAMalInsuranceName.selectedIndex].value == "-")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[26];				}		if (f.LCACheck.value == "1")			{					if (getSelectedButton(OtherLCAInsurance) == -1)				{				retour[2] = retour[2] + '<BR>' + sErrMsg[32];								}			if (getSelectedButton(OtherLCAInsurance) == "1")				{				if (OtherLCAInsuranceName.options[OtherLCAInsuranceName.selectedIndex].value == "-")					{					retour[2] = retour[2] + '<BR>' + sErrMsg[27];					}				}			if (getSelectedButton(OtherLCAInsuranceCanceled) == -1)				{				retour[2] = retour[2] + '<BR>' + sErrMsg[33];				}			if (getSelectedButton(OtherLCAInsuranceCanceled) == "1")				{				f.OtherLCACanceledDate.value = OtherLCACanceledJJ.value + "." +OtherLCACanceledMM.value + "." +OtherLCACanceledAA.value;				if (!CheckDate(f.OtherLCACanceledDate.value))					{					retour[2] = retour[2] + '<BR>' + sErrMsg[28];					}				}			}				//	Banque et poste pas obligatoire		if (getSelectedButton(RefundingType) == -1)			{			retour[0] = false;			retour[2] = retour[2] + '<BR>' + sErrMsg[34];			HolderFullName.value = "";			}		if (getSelectedButton(RefundingType) == "2")			{						if (IBANNumber.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[124];				}		}				if (getSelectedButton(RefundingType) == "1")			{						if (CCPNumber.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[29];				}		}				if (getSelectedButton(RefundingType) == "0")			{			if (BankName.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[30];				retour[0] = false;				}			if (BankPlace.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[30];				retour[0] = false;				}			if (BankClearingNr.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[30];				retour[0] = false;				}			if (BankCountNr.value == "")				{				retour[2] = retour[2] + '<BR>' + sErrMsg[30];				retour[0] = false;				}			}		if (getSelectedButton(PointNet) == -1 && dNetVisible=='Oui')			{			retour[2] = retour[2] + '<BR>' + sErrMsg[119];			retour[0] = false;			}if (f.dDecouverteSiteVisible.value != 'Non')				{		if (getSelectedButton(DecouverteSite) == -1)			{			retour[2] = retour[2] + '<BR>' + sErrMsg[125];			}}	if (retour[2] != '')		{		retour[0] = false;		}	return retour;}}// Functions de WDocCoordHidden// Functions de WDocCoordLongfunction WDocCoordLongDisplayNextMember(passageDirectEnPolice, poste){	//passageDirectEnPolice = "", si on n'est pas sur le dernier membre de la famille	//passageDirectEnPolice = True ou False, si on est sur le dernier membre de la famille	var f = document.forms[0];	if(f.idNext.value != 'vide')		window.location.href=f.BaseCourante.value + "/hvOffresByUniqueID/" + f.idNext.value + "?EditDocument&S=WDocCoordLong&Type=" + f.dType.value + "&PDF="+f.dHasPDF.value+"&PassEnPolice=" + passageDirectEnPolice + "&L=" + f.dLanguage.value;	else	{		if(poste == "poste")			window.location.href= f.BaseCourante.value + "/hvOffresByUniqueID/" + f.dFamilleChefUniqueID.value + "?OpenDocument&S=WDocFinalPoste&PDF="+f.dHasPDF.value+"&L=" + f.dLanguage.value;		else if(f.idNextQM.value != 'vide')			window.location.href=f.BaseCourante.value + "/WebQM?OpenForm&S=WDocQM&L=" + f.dLanguage.value + "&ParentUNID=" + f.idNextQM.value + "&FamilleChefUniqueID=" + f.dFamilleChefUniqueID.value + "&";		else		{			//Si passageDirectEnPolice = True, alores WDocSelectPolice			//Si non on passe \u00E0  WDocFinalPDF			if (passageDirectEnPolice.strip() == "True")			{				// Lancement des Requete Ajax pour la cr\u00E9ation des PDF				// Il faut que les PDF offres sont d\u00E8ja cr\u00E9\u00E9s				// Et attach\u00E9s aux documents offres dans le masque SelectPolice				// Boucle invers\u00E9e pour s'assurer que le redirect ne se fait qu'a la fin de g\u00E9n\u00E9ration				// de tous les fichiers PDF				var allUNIDs = f.dFamilleUniqueID.value.split(", ");				for (i= allUNIDs.length-1 ; i>=0 ; i--)					runPDFAjaxRequest(allUNIDs[i], i);			}			else				window.location.href = f.BaseCourante.value + "/hvOffresByUniqueID/" + f.dFamilleChefUniqueID.value + "?OpenDocument&S=WDocFinalPDF&L=" + f.dLanguage.value;		}	}}function runPDFAjaxRequest(offerUNID, unidIndex) {	var f = document.forms[0];	srcURL=f.BaseCourante.value + "/WPDFOfferLAMal?OpenAgent&" + offerUNID + "&AjaxRequest";	srcPDFURL=f.BaseCourante.value + "/WPDFResiliationLetter?OpenAgent&"  +  offerUNID + "&AjaxRequest";	     // Premi\u00E8re Req Ajax pour la g\u00E9n\u00E9ration PDF Lettre de r\u00E9siliation	 new Ajax.Request(srcPDFURL , {  			method: 'get',			onComplete: function ajax_response (transport) {			}	});			 // Deuxi\u00E8me Req Ajax pour la g\u00E9n\u00E9ration PDF Offre	new Ajax.Request(srcURL , {		method: 'get',		onComplete: function ajax_response(transport) {					if( unidIndex == 0)						window.location.href = f.BaseCourante.value + "/hvOffresByUniqueID/" + offerUNID + "?OpenDocument&S=WDocSelectPolice&L=" + f.dLanguage.value;				}	});		}function openNextLong(poste, opt, passageDirectEnPolice){	var param = (opt == null) ? "" : opt;	var f = document.forms[0];	var sendingtitle = f.SendingTitle.value;	var nationality = f.Nationality.options[f.Nationality.selectedIndex].value;	var nationalitytxt = f.Nationality.options[f.Nationality.selectedIndex].text;	var otherlamalname = f.OtherLAMalInsuranceName.options[f.OtherLAMalInsuranceName.selectedIndex].value;	var otherlamalnamefull = f.OtherLAMalInsuranceName.options[f.OtherLAMalInsuranceName.selectedIndex].text;	var netchecked = '';	var decouvertesite = 'inconnu';	// pas disponible dans version light :	if (param != 'light') {		var maritalstatus = f.MaritalStatus.options[f.MaritalStatus.selectedIndex].value;		var maritalstatustxt = f.MaritalStatus.options[f.MaritalStatus.selectedIndex].text;		var otherlcainsurancename = f.OtherLCAInsuranceName.options[f.OtherLCAInsuranceName.selectedIndex].value;		var otherlcainsurancenamefull = f.OtherLCAInsuranceName.options[f.OtherLCAInsuranceName.selectedIndex].text;	}		// DebitDirect coch\u00E9 ?	if (f.dLsvVisible.value == 'Oui' && f.PaymentModeDebit.checked) {		var paymentModeDebit = f.PaymentModeDebit.value	} else {		var paymentModeDebit = ''		}		// LSV coch\u00E9 ?	if (f.dLsvVisible.value == 'Oui' && f.PaymentModeLSV.checked) {		var paymentModeLSV = f.PaymentModeLSV.value	} else {		var paymentModeLSV = ''     }	if (f.dDecouverteSiteVisible.value == 'Oui')		decouvertesite = getSelectedButton(f.DecouverteSite);	if (f.dNetVisible.value == 'Oui')		netchecked = getSelectedButton(f.PointNet);	if (f.dAgePourCalcul.value < 18)	{		var lreplastname = f.LegalRepLastName.value;		var lrepfirstname = f.LegalRepFirstName.value;		var lrepLegalAddress = f.LegalRepAddress.value;		var lrepLegalAddressNum = f.LegalRepAddressNum.value;		var lrepLegalAddressMore = f.LegalRepAddressMore.value;		var lrepbirthdatejj = f.LegalRepBirthDateJJ.value;		var lrepbirthdatemm = f.LegalRepBirthDateMM.value;		var lrepbirthdateaa = f.LegalRepBirthDateAA.value;	}	else	{		var lreplastname = '';		var lrepfirstname = '';		var lrepLegalAddress = '';		var lrepLegalAddressNum = '';		var lrepLegalAddressMore = '';		var lrepbirthdatejj = '';		var lrepbirthdatemm = '';		var lrepbirthdateaa = '';	}	if (checkNewsletter())		var newsletter = getSelectedButton(f.InscrNewsletter);	else		newsletter = '0';	if (f.dAfficheLegalAdress.value == 'Oui')	{		var legadr = f.LegalAddress.value;		var legadrNum = f.LegalAddressNum.value;		var legadrmore = f.LegalAddressMore.value;	}	else	{		var legadr = f.dLegalAddress1.value;		var legadrNum = f.dLegalAddressNum1.value;		var legadrmore = f.dLegalAddressMore1.value;	}	ap_showWaitMessage('waitDiv', 1);	var paramsTable = new Array();	var index1 = f.PermisType.selectedIndex;	var index2 = f.Title.selectedIndex;	paramsTable [0]= f.dFamilleChefUniqueID.value;							paramsTable [1]= f.dLanguage.value;	paramsTable [2]= legadr;															paramsTable [3]= legadrNum;	paramsTable [4]= legadrmore;													paramsTable [5]= sendingtitle;	paramsTable [6]= f.SendingLastName.value;								paramsTable [7]= f.SendingFirstName.value;	paramsTable [8]= f.SendingAddress.value;									paramsTable [9]= f.SendingAddressMore.value;	paramsTable [10]= f.SendingNPA.value;										paramsTable [11]= f.SendingTown.value;	paramsTable [12]= '2';																paramsTable [13]= f.FirstName.value;	paramsTable [14]= f.LastName.value;											paramsTable [15] = lreplastname;	paramsTable [16]= lrepfirstname;												paramsTable [17] = lrepLegalAddress;		paramsTable [18] = lrepLegalAddressNum;									paramsTable [19] = lrepLegalAddressMore;	paramsTable [20]= lrepbirthdatejj;												paramsTable [21]= lrepbirthdatemm;	paramsTable [22]= lrepbirthdateaa;												paramsTable [23]= f.Phone.value;	paramsTable [24]= f.EmailAddress.value;										paramsTable [26]= f.Profession.value;	paramsTable [27]= nationality;														paramsTable [28]= f.PermisType.options[index1].text;	paramsTable [29]= f.PermisNumber.value;									paramsTable [30]= f.PermisUntilMM.value;	paramsTable [31]= f.PermisUntilAA.value;									paramsTable [32]= "1";	paramsTable [33]= otherlamalname;											paramsTable [49]= f.dUniqueID.value;	paramsTable [52]= nationalitytxt;													paramsTable [53]= otherlamalnamefull;	paramsTable [55]= f.cLegalTownSupp.value;								paramsTable [56]= f.cLegalTownComp.value;	paramsTable [57]= netchecked;													paramsTable [58]= f.ProfessionAffiliateNr.value;	paramsTable [59]= f.Title.options[index2].value;							paramsTable [60]= f.LegalTownDate.value;	paramsTable [61]= getSelectedButton(f.OtherLAMalPoursuite);    	paramsTable [63]= f.eMedFamilleLastName.value;						paramsTable [64]= f.eMedFamilleFirstName.value;	paramsTable [65]= f.eMedFamilleAddress.value;							paramsTable [66]= f.eMedFamilleNPA.value;	paramsTable [67]= f.eMedFamilleTown.value;								paramsTable [69]= decouvertesite;	paramsTable [70]= f.eMedFamilleNum1.value;								paramsTable [71]= f.eMedFamilleNum2.value;		paramsTable [72]= f.eMedFamilleCfm.value;								paramsTable [73]= paymentModeDebit;	paramsTable [74]= paymentModeLSV;										paramsTable [75]= f.dHasPDF.valueif (param != 'light') {	paramsTable [25]= maritalstatus;													paramsTable [34]= getSelectedButton(f.OtherLCAInsurance);		paramsTable [35]= otherlcainsurancename;									paramsTable [36]= getSelectedButton(f.OtherLCAInsuranceCanceled);	paramsTable [37]= f.OtherLCACanceledJJ.value;							paramsTable [38]= f.OtherLCACanceledMM.value;	paramsTable [39]= f.OtherLCACanceledAA.value;							paramsTable [40]= f.OtherInsuranceRemark.value;	paramsTable [41]= getSelectedButton(f.RefundingType);				paramsTable [42]= f.BankName.value;	paramsTable [43]= f.BankPlace.value;											paramsTable [44]= f.BankClearingNr.value;	paramsTable [45]= f.BankCountNr.value;										paramsTable [46]= f.CCPNumber.value;	paramsTable [47]= f.HolderFullName.value;									paramsTable [48]= f.PaymentMode.value;	paramsTable [50]= newsletter;													paramsTable [51]= maritalstatustxt;	paramsTable [54]= otherlcainsurancenamefull;								paramsTable [62]= f.Epoux.value;												paramsTable [68]= f.IBANNumber.value;} else {	paramsTable [25]= "";																	paramsTable [34]= "" ;	paramsTable [35]= "" ;																paramsTable [36]= "" ;	paramsTable [37]= "" ;																paramsTable [38]= "" ;	paramsTable [39]= "" ;																paramsTable [40]= "" ;	paramsTable [41]= "" ;																paramsTable [42]= "" ;	paramsTable [43]= "" ;																paramsTable [44]= "" ;	paramsTable [45]= "" ;																paramsTable [46]= "" ;	paramsTable [47]= "" ;																paramsTable [48]= "" ;	paramsTable [50]= "" ;																paramsTable [51]= "" ;	paramsTable [54]= "";																		paramsTable [62]= "";																	paramsTable [68]= "";}	//Post Data To Agent	var srcVal = paramsTable.join(escape("$$")) + escape("$$");	new Ajax.Request(f.BaseCourante.value + '/WDocCoord?OpenAgent' , {		method: 'post',		parameters : srcVal,		onComplete: function(transport) {					if(transport.responseText.indexOf("Failure Of") != -1)						alert(transport.responseText);					else					{						//Modifi\u00E9 par HH le 27.10.2009 V6R13SP0						//la personne peut choisir elle m\u00EAme passage direct en police ou impression						if(passageDirectEnPolice == "1" & f.idNext.value == 'vide')							passageDirectEnPolice = transport.responseText.strip();						WDocCoordLongDisplayNextMember(passageDirectEnPolice, poste);						//WDocCoordLongDisplayNextMember(transport.responseText, poste);						}				} 	});				}function WDocCoordLongAdresseLookup( sSendingTitle,sNom,sPrenom,sAdresse,sNPA, sVille, sCountry, sAdresseMore, sLanguage ) {	var oIdentity = eval('window.document.forms[0].' + sSendingTitle);	var sLetters = oIdentity.value.substr(0,3);	var titre = "Adresse de correspondance";	if(sLanguage == "D")		titre = "Korrespondenz-Adresse";	else if(sLanguage == "I")		titre = "Indirizzo di invio";	loadDojoDialog("<iframe src=\"" + document.forms[0].BaseCourante.value + "/WebChoixAdresse?OpenForm&" + sSendingTitle + ";" + sNom + ";" + sPrenom + ";" + sAdresse + ";" + sNPA + ";" + sVille + ";" + sCountry + ";" + sAdresseMore + "&SDY=" + WDocCoordFields.currentYear + "&L=" + sLanguage + "\" frameborder=0 style=\"width:500; height:370; border: 1px solid #7BAACE;\"></iframe>", titre, true, false);}function dspModePaiement()	{	var retour = getSelectedButton(window.document.forms[0].RefundingType);	switch (retour) {	case "2" :	   // IBAN	   with (window.document.forms[0])			{			BankName.value = "";			BankPlace.value = "";			BankClearingNr.value = "";			BankCountNr.value = "";			CCPNumber.value = "";			window.top.document.getElementById('Banque').style.display  =  'none';			window.top.document.getElementById('IBAN').style.display  =  'inline';			window.top.document.getElementById('CCP').style.display  =  'none';						if (dLsvVisible.value ==  'Oui') {				window.top.document.getElementById('DivLSV').style.display  =  'none';				window.top.document.getElementById('DivDebit').style.display  =  'none';				window.top.document.getElementById('DivModePmt').style.display  =  'none';							}							IBANNumber.focus();			}			break;	   	case "1" :		// a coch\u00E9 "Poste"		with (window.document.forms[0])			{			BankName.value = "";			BankPlace.value = "";			BankClearingNr.value = "";			BankCountNr.value = "";			IBANNumber.value = "";			window.top.document.getElementById('Banque').style.display  =  'none';			window.top.document.getElementById('IBAN').style.display  =  'none';			window.top.document.getElementById('CCP').style.display  =  'inline';			if (dLsvVisible.value ==  'Oui') {				if (window.document.forms[0].dLSV.value != 'Non')					{					window.top.document.getElementById('DivLSV').style.display  =  'none';					}				if (window.document.forms[0].dDebit.value != 'Non')					{					window.top.document.getElementById('DivDebit').style.display  =  'inline';					window.top.document.getElementById('DivModePmt').style.display  =  'inline';									}				else					{					if (window.document.forms[0].dDebit.value == 'Non')						{								window.top.document.getElementById('DivModePmt').style.display  =  'none';						}					}				}			CCPNumber.focus();			}		  break;		      default :		// a coch\u00E9 "Banque"				with (window.document.forms[0])			{			CCPNumber.value = "";			IBANNumber.value = "";			window.top.document.getElementById('Banque').style.display  =  'inline';			window.top.document.getElementById('IBAN').style.display  =  'none';						window.top.document.getElementById('CCP').style.display  =  'none';			if (dLsvVisible.value ==  'Oui') {				if (window.document.forms[0].dDebit.value != 'Non')					{					window.top.document.getElementById('DivDebit').style.display  =  'none';					}				if (window.document.forms[0].dLSV.value != 'Non')					{					window.top.document.getElementById('DivLSV').style.display  =  'inline';					window.top.document.getElementById('DivModePmt').style.display  =  'inline';									}				else					{					if (window.document.forms[0].dLSV.value == 'Non')						{						window.top.document.getElementById('DivModePmt').style.display  =  'none';						}					}				}			BankName.focus();			}		  break;		  }	}function allCoordLong(){		var f = document.forms[0];		f.Title.options[1].selected = true;		f.LastName.value  = 'asdf';		f.LegalAddress.value  = 'Rue du Lac L\u00E9man';	if (f.dAgePourCalcul.value < 18)	{		f.LegalRepLastName.value  = 'asdf';		f.LegalRepFirstName.value  = 'asdf';		f.LegalRepBirthDateJJ.value  = '12';		f.LegalRepBirthDateMM.value  = '12';		f.LegalRepBirthDateAA.value  = '1980';	}	f.EmailAddress.value  = 'toto@toto.ch';	f.EmailAddressConfirmation.value  = 'toto@toto.ch';	f.Profession.value = "PHARMACIEN";	f.ProfessionAffiliateNr.value = "2";	if (f.InscrNewsletter[1]!= null)	{		if (checkNewsletter() == true)			f.InscrNewsletter[1].checked = true;	}		if(f.MaritalStatus.options != null)		f.MaritalStatus.options[2].selected = true;	if(f.OtherLAMalInsurance[1] != null)		f.OtherLAMalInsurance[1].checked = true;	if(f.OtherLAMalInsuranceName != null)		f.OtherLAMalInsuranceName.options[1].selected = true;	if(f.OtherLCAInsurance[1] != null)		f.OtherLCAInsurance[1].checked = true;	if(f.OtherLCAInsuranceCanceled[1] != null)		f.OtherLCAInsuranceCanceled[1].checked = true;	if(f.RefundingType[2] != null)		f.RefundingType[2].checked = true;	f.IBANNumber.value  = 'CH00 0001 0002 0003 0004';	f.LegalTownDateJJ.value  = '12';	f.LegalTownDateMM.value  = '12';	f.LegalTownDateAA.value  = '2005';	if(f.OtherLAMalPoursuite[1] != null)		f.OtherLAMalPoursuite[1].checked = true;	f.Epoux.value = 'EpouxOuEpouse';	f.eMedFamilleLastName.value = 'King';	f.eMedFamilleFirstName.value = 'Stephen';	f.eMedFamilleAddress.value = 'rue du Maine 666';	f.eMedFamilleNPA.value = '1721';	f.eMedFamilleTown.value = 'Misery';	f.DecouverteSite[3].checked = true;	if (f.dNetVisible.value=='Oui')	{		f.PointNet[0].checked = true;	}}// Functions de WDocCoordLong// Functions de WDocCoordCourtfunction WDocCoordCourtAdresseLookup( sSendingTitle,sAdresseMore,sNom,sPrenom,sAdresse,sNPA, sVille, sCountry, sLanguage ) {		var f = document.forms[0];	var oIdentity = eval('window.document.forms[0].' + sSendingTitle);	var sLetters = oIdentity.value.substr(0,3);	var titre = "Adresse de correspondance";	if(sLanguage == "D")		titre = "Korrespondenz-Adresse";	else if(sLanguage == "I")		titre = "Indirizzo di invio";	loadDojoDialog("<iframe src=\"" + f.BaseCourante.value + "/WebChoixAdresse?OpenForm&" + sSendingTitle + ';' + sAdresseMore + ';' + sNom + ';' + sPrenom + ';' + sAdresse + ';' + sNPA + ';' + sVille + ';' + sCountry + '&L=' + sLanguage + "\" frameborder=0 style=\"width:500; height:370; border: 1px solid #7BAACE;\"></iframe>", titre, true, false);}function openNextCourt()	{	var f = document.forms[0];	var netchecked = '';	if (f.dNetVisible.value == 'Oui')		{		netchecked = getSelectedButton(f.PointNet);		}	if (f.dDecouverteSiteVisible.value == 'Oui')		{		decouvertesite = getSelectedButton(f.DecouverteSite);		}	var firstname=new Array();	var lastname=new Array();	var title=new Array();	if (f.FamilleNBPersTotal.value > 5)		{		firstname[6] = f.FirstName_6.value;		lastname[6] = f.LastName_6.value;		title[6] = f.Title_6.options[f.Title_6.selectedIndex].value;		}	if (f.FamilleNBPersTotal.value > 4)		{		firstname[5] = f.FirstName_5.value;		lastname[5] = f.LastName_5.value;		title[5] = f.Title_5.options[f.Title_5.selectedIndex].value;		}	if (f.FamilleNBPersTotal.value > 3)		{		firstname[4] = f.FirstName_4.value;		lastname[4] = f.LastName_4.value;		title[4] = f.Title_4.options[f.Title_4.selectedIndex].value;		}	if (f.FamilleNBPersTotal.value > 2)		{		firstname[3] = f.FirstName_3.value;		lastname[3] = f.LastName_3.value;		title[3] = f.Title_3.options[f.Title_3.selectedIndex].value;		}	if (f.FamilleNBPersTotal.value > 1)		{		firstname[2] = f.FirstName_2.value;		lastname[2] = f.LastName_2.value;		title[2] = f.Title_2.options[f.Title_2.selectedIndex].value;		}	if (f.FamilleNBPersTotal.value > 0)		{		firstname[1] = f.FirstName_1.value;		lastname[1] = f.LastName_1.value;		title[1] = f.Title_1.options[f.Title_1.selectedIndex].value;		}	var sendingtitle = f.SendingTitle.value;	var srcVal =f.BaseCourante.value + '/WDocCoord?OpenAgent&'		+ f.dFamilleChefUniqueID.value + escape("$$")		+ f.dLanguage.value + escape("$$") + f.LegalAddress.value + escape("$$") + f.LegalAddressNum.value + escape("$$") + f.LegalAddressMore.value + escape("$$") + sendingtitle + escape("$$")		+ f.SendingLastName.value + escape("$$") + f.SendingFirstName.value + escape("$$") + f.SendingAddress.value 		+ escape("$$") + f.SendingAddressMore.value + escape("$$")		+ f.SendingNPA.value + escape("$$") + f.SendingTown.value + escape("$$") + '1' + escape("$$") + firstname[1] + escape("$$")		+ lastname[1] + escape("$$") + firstname[2] + escape("$$") + lastname[2] + escape("$$") + firstname[3] + escape("$$")		+ lastname[3] + escape("$$") + firstname[4] + escape("$$") + lastname[4] + escape("$$") + firstname[5] + escape("$$")		+ lastname[5] + escape("$$") + firstname[6] + escape("$$") + lastname[6] + escape("$$") + f.cLegalTownSupp.value + escape("$$")		+ f.cLegalTownComp.value + escape("$$") + netchecked + escape("$$") + f.EmailAddress.value + escape("$$") + title[1] + escape("$$")		+ title[2] + escape("$$") + title[3] + escape("$$") + title[4] + escape("$$") + title[5] + escape("$$") + title[6] + escape("$$")		+ f.Newsletter.checked + escape("$$") + f.LegalTownDate.value + escape("$$") + f.dDisplayPosteOnly.value  + escape("$$") + decouvertesite + escape("$$")		+ f.dHasPDF.value + escape("$$");	//Post Data To Agent	var srcVal = f.BaseCourante.value + "/hvOffresByUniqueID/" + f.dFamilleChefUniqueID.value + "?OpenDocument&S=WDocFinalPoste&L=" + f.dLanguage.value;	new Ajax.Request(srcVal, {		method: 'get',		onComplete: function(transport) {window.location.href= f.BaseCourante.value + "/hvOffresByUniqueID/" + f.dFamilleChefUniqueID.value + "?OpenDocument&S=WDocFinalPoste&L=" + f.dLanguage.value;		} 	});}// Functions de WDocCoordCourt////////// Temporairement pour retro compatibilite avec l'ancien site Suprafunction doOpenProduct(url) { x = window.open(url, 'Produit', 'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=650,height=500,top=20, left=20') }/////////***************************************************************************************//****************** Fonctions JS pour la gestion des Dialog Dojo ***********************//***************************************************************************************/var dojoDialogEventHandels = null;function loadDojoDialog(content, titre, isModal, hideCloseButton, onCancelCallBack){	var dojoDialog = dijit.byId("dojoDialogDiv");	dojoDialog.setAttribute("title", titre);	dojoDialog.setContent(content);	dojoDialog.show();	dojoDialog.disconnect(dojoDialogEventHandels);	if (onCancelCallBack != null)		dojoDialogEventHandels = dojoDialog.connect(dojoDialog,"onCancel", onCancelCallBack);	document.getElementById("dijit_DialogUnderlay_0").style.zIndex = 99998;		document.getElementById("dojoDialogDiv").style.zIndex = 99999;	if(hideCloseButton)	{		try		{			$("dojoDialogDiv_title").nextSiblings()[0].setStyle({ display: 'none' });		}		catch(e){};	}	else	{		try		{			$("dojoDialogDiv_title").nextSiblings()[0].setStyle({ display: 'inline' });		}		catch(e){};	}	if(!isModal)		$('dijit_DialogUnderlay_0').style.visibility = 'hidden';}function hideDojoDialog(){	dijit.byId("dojoDialogDiv").hide();}/***************************************************************************************//***************************************************************************************//***************************************************************************************//***************Fonction JS pour la gestion du passage direct en Police*****************//***************************************************************************************/var checkBoxOfferID = "";var slectedOffersUNIDs = "";var chefFamilleOfferUNID = "";var lrToDisplayURL = "";function displayPDCheckedConfirm(checkID){}function uncheckCurrentOffer () {	if (checkBoxOfferID != "")		document.getElementById(checkBoxOfferID).checked = false; 	}function hidePDCheckedConfirm (acceptedPolice, urlLettreResiliation, checkBoxLettreResilID){	if (acceptedPolice == "0")		document.getElementById(checkBoxOfferID).checked = false;	hideDojoDialog();		//Affichage ou cr\u00E9ation de la lettre de r\u00E9siliation si la police est accept\u00E9e	if (urlLettreResiliation != "" )	{		if (document.getElementById(checkBoxLettreResilID).checked)			window.open(urlLettreResiliation, "", "");		else		{			new Ajax.Request(urlLettreResiliation + "&AjaxRequest", {				method: 'get',				onComplete: function ajax_response(transport) {				}			});			}		}}function displayLRConfirm (lrLink) {	var f = document.forms[0];	srcURL = f.BaseCourante.value +  "/wGetAjaxParamTxt?OpenAgent&L=" + f.dLanguage.value + "&CatKey=" + "WDocSelectPolice" + "&FieldName=" + "CategorieIntro";	new Ajax.Request(srcURL , {		method: 'get',				onComplete: function ajax_response(transport) {				lrToDisplayURL = lrLink;				var respTab = transport.responseText.split("|");				loadDojoDialog(respTab[12], "" , true, false);		}	});	}function displayLR () {		hideDojoDialog();		window.open(lrToDisplayURL, "", "");		lrToDisplayURL = "";}function cancelDisplayLR () {	hideDojoDialog();	lrToDisplayURL = "";}function displayPDNotAllCheckedConfirm(){	var f = document.forms[0];	srcURL = f.BaseCourante.value +  "/wGetAjaxParamTxt?OpenAgent&L=" + f.dLanguage.value + "&CatKey=" + "WDocSelectPolice" + "&FieldName=" + "CategorieIntro";	new Ajax.Request(srcURL , {		method: 'get',				onComplete: function ajax_response(transport) {						var respTab = transport.responseText.split("|");				loadDojoDialog(respTab[11], "" , true, false);		}	});	}function hidePDNotAllCheckedConfirm(continueProcess){	hideDojoDialog();	if (continueProcess == "1")		savePoliceDirectFields();}function savePoliceDirectFields(){	var f = document.forms[0];		srcURL = f.BaseCourante.value +  "/WSavePoliceFields?OpenAgent";	srcURL = srcURL + "&L=" + f.dLanguage.value ;	srcURL = srcURL + "&CHFUNID=" + chefFamilleOfferUNID ;	srcURL = srcURL + "&MUNIDs="	+ slectedOffersUNIDs;	srcURL = srcURL + "&RDate=" + new Date()  ;								new Ajax.Request(srcURL , {		method: 'get',				onComplete: function ajax_response(transport) {			window.location.href= f.BaseCourante.value + "/hvOffresByUniqueID/"  +chefFamilleOfferUNID  + 						"?OpenDocument&S=WDocFinalPolice&L=" + f.dLanguage.value;		}  	});	}var selectedChefFamilleUNID = "";var selectedFamilleUNIDs = "";function savePoliceDirectFieldsInOffersDoc(){    chefFamilleUNID = selectedChefFamilleUNID;	familleUNIDs = selectedFamilleUNIDs;	var f = document.forms[0];		var allOffersAreChecked = true;	var unids = familleUNIDs.split("|");	sep = escape("\u00A7");	chefFamilleOfferUNID = chefFamilleUNID;	slectedOffersUNIDs = "";	for(i=0; i < unids.length; i++)	{		if(document.getElementById("policeDirectCheckBox_" + unids[i]).checked)			slectedOffersUNIDs = slectedOffersUNIDs + "|" + unids[i];		else			allOffersAreChecked = false;	}		allOffersAreChecked = false;		if (slectedOffersUNIDs == "")		alert(unescape(sErrMsg[127]));	else		displayPDNotAllCheckedConfirm();}/***************************************************************************************//***************************************************************************************/var DHTML = (document.getElementById || document.all || document.layers);function ap_getObj(name) 	{ 	if (document.getElementById) 		{ 		return document.getElementById(name).style; 		}	else if (document.all) 		{		return document.all[name].style;		}	else if (document.layers) 		{		return document.layers[name];		} 		}////////function ap_showWaitMessage(div,flag)	{	if (!DHTML) 	return;	document.getElementById('waitDivBackground').style.visibility='visible';	var x = ap_getObj(div); x.visibility = (flag) ? 'visible':'hidden'	if(!document.getElementById) 	if(document.layers) 	x.left=screen.availWidth/2-(125);	x.top=ns6? window.pageYOffset*1+199+"px" : iecompattest().scrollTop*1+200+"px";	return true; 	}////////function DoctorLookup(sDoctorIdentity,sDoctorCantonNr,sDoctorAffiliateNr,sBaseMedecin,sLanguage, opt1, leftPosition, topPosition, sDoctorCfm, isMedGeneralistes){	var oIdentity = eval('window.document.forms[0].' + sDoctorIdentity);	var sLetters = oIdentity.value.substr(0,4);	var titre = "Choix du m\u00E9decin";	if(sLanguage == "D")		titre = "Auswahl eines Arztes";	else if(sLanguage == "I")		titre = "Scelta di un medico";	loadDojoDialog("<iframe src=\"" +sBaseMedecin + "/WChoixMedecin?OpenForm&" + sDoctorIdentity + ';' + sDoctorCantonNr + ';' + sDoctorAffiliateNr + ';' + sDoctorCfm + ';' +'&Med='+ isMedGeneralistes+ '&M=' + sLetters + '&L=' + sLanguage + opt1  + "\" frameborder=0 style=\"width:600; height:400; border: 1px solid #7BAACE;\"></iframe>", titre, true, false);}////////function ProfessionLookup( sProfessionIdentity,sProfessionCantonNr,sProfessionAffiliateNr,sBaseMedecin,sLanguage) {//	var f2 = document.forms[document.forms.length-1];//	var nbf = document.forms.length-opt;	var oIdentity = eval('window.document.forms[0].' + sProfessionIdentity);	var sLetters = oIdentity.value.substr(0,3);	var opt = '';	var titre = "Choix d'une profession";	if(sLanguage == "D")		titre = "Ihr Beruf";	else if(sLanguage == "I")		titre = "Scelta di una professione";	loadDojoDialog("<iframe src=\"" + sBaseMedecin + "/WChoixProfession?OpenForm&" + sProfessionIdentity + ';' + sProfessionCantonNr + ';' + sProfessionAffiliateNr + ';' + opt + ';&' + sLetters + '&L=' + sLanguage + "\" frameborder=0 style=\"width:600; height:350; border: 1px solid #7BAACE;\"></iframe>", titre, true, false);}////////function BankLookup( sBankName,sBankPlace,sBankClearingNr,sBaseMedecin,sLanguage ) {//	var nbf = document.forms.length-2;	var oIdentity = eval('window.document.forms[0].' + sBankName);	var sLetters = oIdentity.value.substr(0,3);	var titre = "Choix d'une banque";	if(sLanguage == "D")		titre = "Ihre Bank";	else if(sLanguage == "I")		titre = "Scelta di una banca";	loadDojoDialog("<iframe src=\"" + sBaseMedecin +"/WChoixBanque?OpenForm&" + sBankName + ";" + sBankPlace+ ";" + sBankClearingNr+ '&B=' + sLetters + '&L=' + sLanguage + "\" frameborder=0 style=\"width:600; height:300; border: 1px solid #7BAACE;\"></iframe>", titre, true, false);}////////function OpenOffer (){	// ouvre la page 1 des offres	window.location.href =window.document.forms[0].dDBCurrent.value + '/WOffreStart?OpenForm&S=WDocOffres&NBP=0&L=' + window.document.forms[0].dLanguage.value + '&Prov=';}////////function nextOffer(opt, uniqueid)	{	// ouvre la page suivante en fonction du contexte	var f = document.forms[0];	switch(opt) 			{			case '1':				// modification de l'offre et retour sur la premi\u00E8re couverture				window.location.href=f.BaseCourante.value + "/hvOffresByUniqueID/"+ uniqueid + "?EditDocument&S=WDocCouverture" + "&Version=" + f.dPageVersion.value + "&L=" + f.dLanguage.value;			break;			case '2':				// finalisation des couvertures, on affiche la page des remerciements				ap_showWaitMessage('waitDiv', 1);				window.location.href=f.BaseCourante.value + "/WebOffre?OpenForm&S=WDocRemerciements&FamilleChef=" + f.dFamilleChefUniqueID.value + "&L=" + f.dLanguage.value;			break;			case '2a':				// finalisation des couvertures, on affiche la page des remerciements				window.location.href=f.BaseCourante.value + "/WebOffre?OpenForm&S=WDocRemerciements&FamilleChef=" + f.dFamilleChefUniqueID.value + "&L=" + f.dLanguage.value;			break;			case '2b':				// finalisation des couvertures, on affiche la page des remerciements				ap_showWaitMessage('waitDiv', 1);				window.location.href=f.BaseCourante.value + "/WebOffre?OpenForm&S=WDocRemerciements&Special=Poste" + f.dSuccToDisplay.value + "&FamilleChef=" + f.dFamilleChefUniqueID.value + "&L=" + f.dLanguage.value;			break;			case '3':				// Choix pdf				window.location.href=f.BaseCourante.value + "/hvOffresByUniqueID/"+ f.dFamilleChefUniqueID.value + "?EditDocument&S=WDocCoordLong&PDF=Oui&PassEnPolice=0&L=" + f.dLanguage.value;							break;			case '3a':				// Choix pdf				// ajout\u00E9 par HH le 27.10.2009 V6R13SP0 pour diff\u00E9rencier entre les Passage direct en police et impression				window.location.href=f.BaseCourante.value + "/hvOffresByUniqueID/"+ f.dFamilleChefUniqueID.value + "?EditDocument&S=WDocCoordLong&PDF=Oui&PassEnPolice=1&L=" + f.dLanguage.value;			break;			case '4':				// Choix envoi par poste				//window.location.href=f.BaseCourante.value + "/hvOffresByUniqueID/"+ f.dFamilleChefUniqueID.value + "?EditDocument&S=WDocCoordCourt&L=" + f.dLanguage.value;				window.location.href=f.BaseCourante.value + "/hvOffresByUniqueID/"+ f.dFamilleChefUniqueID.value + "?EditDocument&S=WDocCoord" + f.dDocCoordVersion.value + "&Type=Poste&PDF=Non&L=" + f.dLanguage.value;			break;			case '5court':				// Sauvegarde des coordonn\u00E9es courtes, pour envoi par poste				ap_showWaitMessage('waitDiv', 1);				openNextCourt();			break;			case '5':				// Sauvegarde des coordonn\u00E9es longues de chaque membre de la famille				openNextLong('poste', '', WDocCoordFields.PassEnPolice);			break;			case '5light':				openNextLong('poste','light', WDocCoordFields.PassEnPolice);			break;			case '6':				// Sauvegarde des coordonn\u00E9es longues de chaque membre de la famille				openNextLong('', '', WDocCoordFields.PassEnPolice);			break;			case '6light':				openNextLong('','light', WDocCoordFields.PassEnPolice);			break;			case '7':				// Sauvegarde du questionnaire m\u00E9dical de chaque membre de la famille				ap_showWaitMessage('waitDiv', 1);				saveQM();			break;			default:			break;			}	}////////function writeError(sErrorTxt, opt, language){	// affiche un message d'erreur dans DivError	// les en-t\u00EAtes des messages d'erreur	switch(language) 	{		case 'D':			var ilng = 0;			var titre = "Fehler";			break;		case 'I':			var ilng = 1;			var titre = "Errore";			break;		default:			var ilng = 2;			var titre = "Erreur";			break;	}			var sErrorHead = new Array(3);	var sErrorFoot = new Array(3);	sErrorHead[0] = "Das Formular enth&#228;lt folgende(n) Fehler:";	sErrorFoot[0] = "Nehmen Sie bitte die Korrektur vor, bevor Sie weiterfahren.";	sErrorHead[1] = "Il formulario contiene il/i seguente/i errore/i:";	sErrorFoot[1] = "La invitiamo a correggere prima di continuare la sua richiesta.";	sErrorHead[2] = "Le formulaire contient l'(es) erreur(s) suivante(s) :";	sErrorFoot[2] = "Merci de corriger avant de continuer votre demande.";	if (opt == 0)	{		loadDojoDialog("<div style='color:red;'>" + sErrorHead[ilng] + sErrorTxt + '<BR>' + sErrorFoot[ilng] + "</div>", titre, true, false)	}	else	{		var objError = window.document.getElementById('DivError');		window.document.getElementById('DivError').innerHTML =  sErrorHead[ilng] + sErrorTxt + '<BR>' + sErrorFoot[ilng];		objError.style.display = 'inline';	}	/*if (opt == 0)	{		// erreurs dans les fen\u00EAtres principales		$('dialogDivContent').update("<div style='color:red;'>" + sErrorHead[ilng] + sErrorTxt + '<BR>' + sErrorFoot[ilng] + "</div>");		dijit.byId('dialogDiv').setAttribute("title", titre);		dijit.byId('dialogDiv').show() ;		//Pour forcer la Dialog au dessus du menu		$('dijit_DialogUnderlay_0').style.zIndex = 99998;			$('dialogDiv').style.zIndex = 99999;		//$('dijit_DialogUnderlay_0').style.visibility = 'hidden';	}	else	{		// erreurs dans les petites fen\u00EAtres (WindowOpen)		window.parent.$('dialogDivContent').update(sErrorHead[ilng] + sErrorTxt + '<BR>' + sErrorFoot[ilng]);		window.parent.$('dialogDivContent').style.display = 'inline';				window.parent.dijit.byId('dialogDiv').setAttribute("title", titre);		window.parent.dijit.byId('dialogDiv').show() ;		//Pour forcer la Dialog au dessus du menu		window.parent.$('dijit_DialogUnderlay_0').style.zIndex = 99998;			window.parent.$('dialogDiv').style.zIndex = 99999;		//$('dijit_DialogUnderlay_0').style.visibility = 'hidden';	}*/}////////function checkFieldSerie(opt, sErrorTxt, member, sFieldName, errMsg) 	{	 // v\u00E9rifie que le champ a bien \u00E9t\u00E9 saisi 	// l'indice est pass\u00E9 en param\u00E8tre (opt) 	// errMsg donne l'indice de l'array des messages d'erreur 	var f = document.forms[0];	var iErrorPos = 0; 	var retour = new Array(3); 	retour[0] = true; 	retour[1] = 0; 	retour[2] = sErrorTxt;	if ( sFieldName == "FirstName_" || sFieldName == "LastName_")		{		// check du pr\u00E9non		sFieldName = sFieldName + opt;		var FirstName; 		FirstName = eval("f." + sFieldName + ".value"); 		if (FirstName == "") 			{			sErrorTxt = sErrMsg[errMsg];			var erreur = true;			}		else 			{ 			retour[1] = iErrorPos; 			var erreur = false;			}					}	else if (sFieldName == "Title_")		{		var title = eval("f." + sFieldName + opt + ".options[f." + sFieldName + opt + ".selectedIndex].value" );		if (title == '-')			{			sErrorTxt = sErrMsg[errMsg];			var erreur = true;			}		else			{			retour[1] = iErrorPos; 			var erreur = false;			}		}		else			{			// check du sexe			var sFieldNameF = sFieldName + "F_" + opt;			var sFieldNameH = sFieldName + "H_" + opt;			var SexF;			var SexH;			SexF = eval("f." + sFieldNameF + ".checked");			SexH = eval("f." + sFieldNameH + ".checked");			if (SexF == false && SexH == false)				{				sErrorTxt = sErrMsg[errMsg];				var erreur = true;				}			else 				{ 				retour[1] = iErrorPos; 				var erreur = false;				}			}	if (iErrorPos == 0 && erreur == true) 		{		iErrorPos = 2; 		retour[1] = iErrorPos;		if (member != '') 			{			retour[2] = retour[2] + '<BR>' + sErrorTxt + ' (' + member + ' ' + opt + ')';			}		}	if (retour[2] != '') 		{ 		retour[0] = false; 		} 	return retour;}////////function checkNaissance(opt, sErrorTxt, member, prefixe, frm)	{	// v\u00E9rifie la validit\u00E9 de la date de naissance	// opt est l'indice des champs \u00E0 tester	// sErrorTxt est le message d'erreur	// member est le libell\u00E9 du membre (dans la bonne langue)	// prefixe, pour tester le repr\u00E9sentant l\u00E9gal	// frm est le form du champ pass\u00E9 en param\u00E8tre	// garder ces 2 variables f et f1 !!		var f = document.forms[0];//	var f1 = document.forms[1];		var sFieldName = new Array(3);	var tabM = new Array(3);		if (prefixe != 'LegalRep')		{		tabM[0] = 2;		tabM[1] = 3;		tabM[2] = 15;		}	else		{		tabM[0] = 8;		tabM[1] = 21;		tabM[2] = 16;		}		frm = frm + '.';	if(opt == 0)		{		sFieldName[1] = prefixe + "BirthDateJJ";		sFieldName[2] = prefixe + "BirthDateMM";		sFieldName[3] = prefixe + "BirthDateAA";		}	else		{		sFieldName[1] = "BirthDateJJ_" + opt;		sFieldName[2] = "BirthDateMM_" + opt;		sFieldName[3] = "BirthDateAA_" + opt;		}		var retour = new Array(3);	retour[0] = true;	retour[1] = 0;	retour[2] = sErrorTxt;	var BirthDate;	var iErrorPos = 0;	if (eval(frm + sFieldName[1] + ".value").length == 1)		{		eval(frm + sFieldName[1]).value = '0' + eval(frm + sFieldName[1] + ".value")		}	if (eval(frm + sFieldName[2] + ".value").length == 1)		{		eval(frm + sFieldName[2]).value = '0' + eval(frm + sFieldName[2] + ".value")		}	BirthDate = eval(frm + sFieldName[1] + ".value")  + "." +  eval(frm + sFieldName[2] + ".value")  + "." +  eval(frm + sFieldName[3] + ".value");			if (BirthDate == "")		{			sErrorTxt = sErrMsg[tabM[0]];			if (iErrorPos == 0)				{				iErrorPos = 3;				}		}		else		{		if (BirthDate.length != 10)			{			sErrorTxt = sErrMsg[tabM[1]];			if (iErrorPos == 0)				{				iErrorPos = 3;				}			}		else			{			if (!CheckDate(BirthDate))				{				sErrorTxt = sErrMsg[tabM[1]];									if (iErrorPos == 0)					{						iErrorPos = 3;					}				}			else				{				if (!CompareDate(BirthDate, "<", true))					{					sErrorTxt = sErrMsg[tabM[2]];					if (iErrorPos == 0)						{						iErrorPos = 3;						}					}				}			}		}	if (iErrorPos != 0)		{		iErrorPos = 2;		retour[0] = false;		retour[1] = iErrorPos;		if (member != '')			{			retour[2] = retour[2] + '<BR>' + sErrorTxt + ' (' + member + ' ' + opt + ')';			}		else			{			retour[2] = retour[2] + '<BR>' + sErrorTxt;			}		}	else		{		retour[0] = true;		retour[1] = iErrorPos;		}return retour;}////////function isPosInteger(inputVal){	inputStr = inputVal.toString();	for (var i = 0; i < inputStr.length; i++)		{		var oneChar = inputStr.charAt(i);		if (oneChar < "0" || oneChar > "9")			{			return false;			}				}			return true;	}////////function getCatAge(age)	{	if ( parseInt(age) < 19)		{		return '00';		}	if ( parseInt(age) < 26)		{		return '19';		}	if ( parseInt(age) < 31)		{		return '26';		}	if ( parseInt(age) < 36)		{		return '31';		}	if ( parseInt(age) < 41)		{		return '36';		}	if ( parseInt(age) < 46)		{		return '41';		}	if ( parseInt(age) < 51)		{		return '46';		}	if ( parseInt(age) < 56)		{		return '51';		}	if ( parseInt(age) < 61)		{		return '56';		}	if ( parseInt(age) < 66)		{		return '61';		}	if ( parseInt(age) < 71)		{		return '66';		}	if ( parseInt(age) < 76)		{		return '71';		}	if ( parseInt(age) < 81)		{		return '76';		}	if ( parseInt(age) < 86)		{		return '81';		}	else		{		return '86';		}	}////////function CheckDate(sDate){	// cette fonction v\u00E9rifie le format JJ/MM/AAAA saisi et la validit\u00E9 de la date.	// le s\u00E9parateur est d\u00E9fini dans la variable separateur	var sDay = sDate.substr(0,2);	var sMonth = sDate.substr(3,2);	var sYear = sDate.substr(6,4);	var iDay = parseInt(sDay,10);	var iMonth = parseInt(sMonth,10);	var iYear = parseInt(sYear,10);	 	if( (isNaN(iDay)) || (iDay < 1) || (iDay > 31) ) 		{		return false;		}	 	if ( (isNaN(iMonth)) || (sMonth < 1) || (sMonth > 12) ) 		{		return false;		}	 	if ( (isNaN(iYear)) ) 		{		return false;		}	var dParam = new Date(iYear,iMonth - 1,iDay);		 	iDay2 = dParam.getDate(); 	iMonth2 = dParam.getMonth() + 1;	iYear2 = dParam.getFullYear();	if ( (iDay != iDay2) || (iMonth != iMonth2) || (iYear != iYear2) )		{		return false;		}		if (iYear < 1900)		{		return false;				}		return true;	}////////function CompareDate(sDate, sSign, compareWithToday){// compareWithToday force la comparaison// avec aujourd'hui// sinon avec le premier jour du mois courant (01)	// compare 2 dates	var dNow = new Date()	var sSeparateur = ".";					// separateur entre jour/mois/annee	var sDay = (sDate.substring(0,2));	var sMonth = (sDate.substring(3,5));	var sYear = (sDate.substring(6));	if (compareWithToday == true)		{	 	var iDayNow = dNow.getDate();		}	else		{	 	var iDayNow = 01;		}// 	var iDayNow = dNow.getDate(); 	var iMonthNow = (dNow.getMonth() + 1) * 100;	var iYearNow = dNow.getFullYear() * 10000;	iDateYMD = parseInt(sYear + sMonth + sDay);	iNowYMD = iYearNow + iMonthNow + iDayNow;	return eval(iDateYMD + sSign + iNowYMD);	}////////function emailCheck(emailStr){		var emailPat=/^(.+)@(.+)$/;	var specialChars="\\(\\)\u00E9\u00E8\u00EA\u00EB\u00E0\u00E2\u00E4\u00E7\u00F9\u00FB\u00FC\u00EC\u00EE\u00EF\u00C9\u00C8\u00CA\u00CB\u00C0\u00C2\u00C4\u00C7\u00D9\u00DB\u00DC\u00CF<>@,;:\u00A6#\u00B0\u00A7\u00AC|+{}'`\u00B4~/!\u00A8$\u00A3^*%&=?\u00A2\\\\\\\"\\.\\[\\]";	var validChars="\[^\\s" + specialChars + "\]";	var quotedUser="(\"[^\"]*\")";	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;	var atom=validChars + '+';	var word="(" + atom + "|" + quotedUser + ")";	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");	var matchArray=emailStr.match(emailPat);	if (matchArray==null)		{		return false;		}		var user=matchArray[1]	var domain=matchArray[2]			if (user.match(userPat)==null)		{		return false		}		var IPArray=domain.match(ipDomainPat)	if (IPArray!=null)		{		for (var i=1;i<=4;i++)			{	    		if (IPArray[i]>255)	    			{	    			return false;	    			}			}				return true;		}		var domainArray=domain.match(domainPat)		if (domainArray==null)		{		return false;		}		var atomPat=new RegExp(atom,"g")	var domArr=domain.match(atomPat)	var len=domArr.length		if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>4)		{		return false;		}	if (len<2)		{		return false;		}	return true;}////////function checkwaitDivLocation(){	yy = eval(y);	if (document.getElementById)		{		if (yy > 150)			{			document.getElementById("waitDiv").style.top = yy + 150;			}		else			{			document.getElementById("waitDiv").style.top = 150;			}		}	else		{		eval(dS + "waitDiv" + sD + v + yy);		}	setTimeout("checkwaitDivLocation()", 1);}////////function setwaitDivVariables(){	if (document.layers)		{		v = ".top=";		dS = "document.";		sD = "";		y = "window.pageYOffset";		}	else if (document.all)		{		v = ".pixelTop=";		dS = "";		sD = ".style";		y = "document.body.scrollTop";		}	else if (document.getElementById)		{		y = "window.pageYOffset";		}	}function CompareTwoDates(sDate1, sDate2){ var sDay1 = (sDate1.substring(0,2)); var sMonth1 = (sDate1.substring(3,5)); var sYear1 = (sDate1.substring(6));  var sDay2 = (sDate2.substring(0,2)); var sMonth2 = (sDate2.substring(3,5)); var sYear2 = (sDate2.substring(6));  iDate1 = parseInt(sYear1 + sMonth1 + sDay1); iDate2 = parseInt(sYear2 + sMonth2 + sDay2);  return eval(iDate1 + "<" + iDate2); }function checkNewsletter()	{	var f = document.forms[0];	if (f.dDspNewsletter.value == '1')		{		return true;		}	else		{		return false;		}	}///// Fonctions utilis\u00E9es pour les iFrames - d\u00E9butvar dragapproved=falsevar minrestore=0var initialwidth,initialheightvar ie5=document.all&&document.getElementByIdvar ns6=document.getElementById&&!document.allfunction iecompattest(){return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}function closeit(){	// ferme les petites fen\u00EAtres dwindow	window.parent.hideDojoDialog();}///// Fonctions utilis\u00E9es pour les iFrames - fin///////////////////////////////////////////////////////////////////////////// R\u00E9cup\u00E9ration d'une offre archiv\u00E9e //////////////////////////////////////////////////////////////////////////function restaurePurgedOffer ( dbPath, docUnid){	$("tabExplanationContent1").hide();	$("tabExplanationContent2").hide();	var oldURL = window.location.href;	var url = "/" + dbPath + "/WRestorePurgedOffer?OpenAgent&" +    docUnid + "&" + new Date();	var myAjax = new Ajax.Request(url, {	  			method: 'get',				onSuccess : function(transport){							if(transport.responseText.indexOf("Offer Restored") != -1)								window.location.href =oldURL;							else							{								$("tabIntroContent").hide();								if(transport.responseText.indexOf("Offer Exported") != -1)									$("tabExplanationContent1").show();								else									$("tabExplanationContent2").show();											}						}			});}