// variables globalesmess = "Please type in your registration number and confidential code.";acgi = "/4DLINK4/4DCGI/";//navigateurvar bAgent = window.navigator.userAgent; var bAppName = window.navigator.appName;var NonExplo = (bAppName.indexOf("Explorer") < 0)//appel apres avoir loadefunction init(){ paysset();getallfee();} //fin//Quel est le bouton radio choisi?function checkradio(d){ var radioName = d;  var x = -1;  var n = d.length; for (var i = 0; i < n; i++) {    if (eval(radioName)[i].checked == true) {x = i; return x;}  } return x; } //fin//Efface les boutons radiofunction clearradio(d){  var x = d.length;  for (var i = 0; i < x; i++) {d[i].checked = false;}}//fin//la valeur est un chiffrefunction chiffre(d){ var dd = d; var nstr = "0123456789"; var n= nstr.indexOf(dd); if(n <0){return false;} return true;}//fin//saute a une ancre sur la pagefunction jump(d) { var a = d; if (NonExplo){ window.location="#0";window.location = a;}} //fin//appel par le "POST"function controle(){ if (etatcivil()==false) {return false;} if (mail() == false) {jump("#0");d.i_email.focus();return false;} if (obligatoire() == false) {jump("#participant");return false;} if (testboutonpaie() == false) {return false;} testcbchange(); if (symp() == false) {jump("#symposiums");return false;} document.form.contr.value = ""}//fin//Verifie les donnees de l'etat civilfunction etatcivil() {d = document.form;if (d.i_sexe == "")  { alert("Please select Mr./Ms."); jump("#0");d.i_nom.focus(); return false;}if (d.i_nom.value.length == 0)  { alert("Please type in your last name."); jump("#0");d.i_nom.focus(); return false;}if (d.i_prenom.value.length == 0)  { alert("Please type in your first name.");jump("#0");d.i_nom.focus();d.i_prenom.focus(); return false;}if (d.i_adresse1.value.length == 0)  { alert("Your address ? (University, company,...)"); d.i_nom.focus();jump("#0");d.i_adresse1.focus();return false;}if ( (d.i_pays.value == "France") && (d.i_codepostal.value.length < 2))  { alert("Postal code ?");d.i_nom.focus();d.i_codepostal.focus();jump("#0");return false;}if (d.i_ville.value.length == 0)  { alert("City ?");d.i_nom.focus();d.i_ville.focus();jump("#0");return false;}if ((d.i_pays.value == "")||(d.i_pays.value.indexOf("select")>= 0))  { alert("Country ?");d.i_nom.focus();d.i_ville.focus();jump("#0");return false;}if (d.i_email.value.length == 0)  { alert("E.mail address is required."); d.i_ville.focus();d.i_email.focus();jump("#0");return false;}return true;}//fin//verifie le format du mailfunction mail() { var d = document.form.i_email.value.toLowerCase(); if( d == "") {alert("Please type in your e.mail address");return false;} var correct = true; var dn ="Incorrect syntax in e.mail address: "; var x = d.indexOf("@") if (x < 0) {dn = dn+" missing @\n";alert(dn); return false;} if (x == d.length-1) {alert(dn); return false;} var x = d.indexOf(".") if (x < 0) {dn = dn+" missing '.'\n";alert(dn); return false;} if (x == d.length-1) {alert(dn); return false;} var autorise="abcdefghijklmnopqrstuvwxyz0123456789_.-@"; for (i=0; i< d.length; i++) {    if (autorise.indexOf(d.charAt(i)) < 0) {correct = false;} } if (correct) {return true;} dn = dn+" bad characters in address.\n"; alert(dn); return false;}//fin//function paysset(){return; d = document.form; d.i_pays.value=d.pays[d.pays.selectedIndex].text;} //fin//retourne numeros de symp choisis pour chaque sessionfunction symp(){ var d = document.form; n = 0; n1 = d.sympj1a[d.sympj1a.selectedIndex].value+"/"; n2 = d.sympj1b[d.sympj1b.selectedIndex].value+"/"; n3 = d.sympj2a[d.sympj2a.selectedIndex].value+"/"; n4 = d.sympj2b[d.sympj2b.selectedIndex].value+"/"; n5 = d.sympj3a[d.sympj3a.selectedIndex].value+"/"; n6 = d.sympj3b[d.sympj3b.selectedIndex].value+"/"; n7 = d.sympj4a[d.sympj4a.selectedIndex].value; d.i_sympo.value = n1+n2+n3+n4+n5+n6+n7; if (d.i_sympo.value == "S1Z/S2Z/S3Z/S4Z/S5Z/S6Z/S7Z") { if (confirm ("You did not indicate the symposia you wish to attend. If you wish to send this form as such anyway, click on OK. If not, click on 'Cancel', then select your choice before submitting the form again.") == false ) {return false;} } return true;}//fin//inscription: checkbox non modifiable manuellementfunction checkins(){ alert("To change your registration, change your membership type on this page.");} //fin//workshop: checkbox non modifiable manuellementfunction checkwks(){ getwks(); alert("To (un)select a workshop, go to the workshop section on this page."); jump("#workshops");} //fin//Calcul du montant total a payer: additionne les diff. tarifsfunction getallfee(){ var d = document.form; var tot = parseInt(getfee())+parseInt(getabs())+parseInt(getwks()); tot = tot + parseInt(getfrais(tot)); d.total.value = new String(tot); d.total.value =centimes(d.total.value); return tot;}//fin//montant des workshopsfunction getwks(){ d =document.form; n=d.wksfee; x = d.i_workshop.selectedIndex; if (x==0) {n.value = "0"; d.bwks.checked = false;}   else {n.value = work; d.bwks.checked = true;} if (x==7) {n.value = "0";} v = n.value; n.value = centimes(n.value); return v;} //fin//montant du livre de resumesfunction getabs(){ n = document.form.absfee; if (document.form.i_book.checked) {n.value = bookfee;}  else {n.value = "0";} v = n.value;  n.value = centimes(v); return v;} //fin// calcule montant inscriptionfunction getfee(x){ d = document.form; n = d.i_mbre.value; df = d.mbrefee; s = d.i_soc[d.i_soc.selectedIndex].value.toLowerCase(); df.value = "0";   if ( s != "st00") {   if (n == 1) {df.value = inscrip1;}// membres tit   if (n == 2) {df.value = inscrip2;}// etud  } else {  if (n == 1) {df.value = inscrip3;}// non membres tit  if (n == 2) {df.value = inscrip4;}// nm etud  }  if (n == 5) {df.value = inscrip5;}// nm corp var v = df.value;  df.value = centimes(df.value); d.fee.value = df.value; return v;} //fin// calcule montant des frais bancairesfunction getfrais(x){ var d = document.form; n = d.bq n.value = "0"; if ((x > 0) && (d.i_paiece.checked == true)) {n.value = fbanque;} if ((x > 0) && (d.i_paievi.checked == true)) {n.value = fbanque;} var v = n.value; n.value = centimes(n.value); return v;}// formatte en centimes d'euros. mettre point avant centimes//s = nombre entier de centimes d'eurosfunction centimes(s) { var x = s.length; if (x > 2) {    s = s.substring(0,x-2)+"."+s.substring(x-2,x); } if (x == 2) {s = "0."+s;} if (x == 1) {s = "0.0"+s;} return s;}//teste choix mode de paiementfunction testboutonpaie(){ var d = document.form;  x = getallfee(); if ((x != 0)    && (d.i_paiech.checked==false)     && (d.i_paiece.checked==false)     && (d.i_paievi.checked==false)     && (d.i_paiecb.checked==false))   {alert("Please choose a means of payment."); return false;   } if (x == 0) {  	d.i_paiecb.checked = false; 	d.i_paiech.checked = false; 	d.i_paiece.checked = false; 	d.i_paievi.checked = false;   }}//fin//verifie si deja paye par CBfunction testcbchange(){ var d = document.form; a = centimes(d.cbregle.value);// alert("v= "+a);  n = parseInt(d.cbregle.value);  if (n > 10) {    d.i_paiecb.checked = true;    d.i_paiech.checked = false;    d.i_paiece.checked = false;    d.i_paievi.checked = false;    if (a == d.total.value) {alert("Your payment by credit card has been received.");}    if (a != d.total.value) {alert("You previously paid "+a+" euros by credit card.\nIn case of additional fee, you must pay by credit card."+"\nIf not, contact directly Kenes International by e.mail.");}  }} //fin//teste autorisation CBfunction testcbregle(){ var d = document.form; if (((d.i_paiech.checked == true) ||(d.i_paiece.checked == true)) && (eval(d.cbregle.value)>10)) {	d.i_paiecb.checked = true;	d.i_paiech.checked = false;	d.i_paiece.checked = false;	d.i_paievi.checked = false;	}}//fin//force le choix entre cheques, BC ou CB. Appele uniquement par CB, CH, CEfunction testch_cb(b){ d = document.form; x = getallfee();  testcbchange(); if (b.checked) {   d.i_paiecb.checked = false;   d.i_paiech.checked = false;   d.i_paiece.checked = false;   d.i_paievi.checked = false;   b.checked = true;// et remet a vrai la case cochee } if (x == 0) {b.checked = false;} getallfee();}//fin//Interdit de venir cliquer dans les zones calculees du formulaire function interdit(){ alert("You can't edit this field. To change the fee, change the corresponding option."); getallfee(); return false;}//fin//Teste choix de communication (obligatoire) function obligatoire(){ if(document.form.i_zz3.value == "") { a=0; x =document.form.i_presente; n = x.length; for (var i = 0; i < n; i++) { if ( x[i].checked) {a=a+1;} } if (a == 0) { alert("Please indicate whether or not you present a communication at the meeting."); return false;} }}//fin//AppelŽ par post: empeche le "retour" de fonctionner comme un submitfunction go(){ if(document.form.contr.value != "") {return false;} document.form.contr.value = "*"; return true;} //fin//abandon de correctionfunction quitter(){ d = document.form; if (d.cbregle.value == "1") {    d.i_paiecb.checked = true;   d.i_paiech.checked = false;   d.i_paiece.checked = false;   d.i_paievi.checked = false;   alert("You previously registered asking payment by credit card. Either submit and proceed with this payment, or change your means of payment and submit.");return false;}if (confirm('No change to this form will be recorded. Do you really want to quit?') == false)  {return false;}   document.form.contr.value = "";return true;} //fin//abandon d'inscription initialefunction quitter1(){ d = document.form; if (confirm('Do you really want to quit without registering?') == false)  {return false;}   document.form.contr.value = "";return true;} //fin// appelŽ par page initiale init.htmlfunction verif(d) { doc = document.form; x = d; //indique le type de demande// demande initiale d'inscription if (x == 3) { if ((doc.i_sexe[0].checked == false) && (doc.i_sexe[1].checked == false)) { alert("Please select Ms./Mr.");doc.aut2.focus(); return false;}  a = doc.aut2.value;  b = doc.pre2.value;  if (a.length < 2) {alert("Please type in your family name.");return false;}  if (b == "") {alert("Please type in your first name");return false;}  if (mail() == false) {return false;}  doc.i_autnom.value = a; doc.i_autprenom.value = b;  doc.action = acgi+"Inscr.nonMbre";  doc.contr.value = "";  return true; }// demande de resume if ((x >= 40) && (x< 50)) {  doc = document.form; //  doc.i_inscrnum.value=doc.num.value; doc.i_inscrcode.value=doc.code.value;  if  ((doc.i_inscrnum.value=="" ) || (doc.i_inscrcode.value == ""))  {alert("Type in the registration number and/or confidential code.");return false;}  if  (x == 41) {doc.action = acgi+"resum.form";}  if  (x == 42) {doc.action = acgi+"resum.edit";}  if  (x == 43) {doc.action = acgi+"resum.view";}  doc.contr.value = "";  return true; }// demande d'edition d'inscription if ((x > 50) && (x < 60)) {  if  ((doc.i_inscrnum.value=="" ) || (doc.i_inscrcode.value == "")) {alert(mess);return false;} doc.contr.value = ""; if (x == 51) { doc.submit.value = "view"; doc.action = acgi+"Inscr.view";} if (x == 52) { doc.submit.value = "edit"; doc.action = acgi+"Inscr.edit";} return true; }// reservation hoteliere if ((x > 60) && (x < 70)) { if  ((doc.i_inscrnum.value=="" ) || (doc.i_inscrcode.value == "")) {alert(mess);return false;} doc.contr.value = ""; doc.action = acgi+"Inscr.reserv"; return true; }// verification de mel if (x == 5) { if  ((doc.i_inscrnum.value=="" ) || (doc.i_inscrcode.value == "")) {alert(mess);return false;} doc.contr.value = ""; doc.action = acgi+"Inscr.mel"; return true; }return false;}// fin de verif//cookiesfunction cookieset() {	var cookies = document.cookie;	if (cookies.indexOf("ID=")>=0) {return;}	document.cookie = "ID=op";}//Ajout Francis le 22/10/03//Redirige les pages en fonction du navigateurfunction redirectpage(id){navigateur = navigator.appName; navigateurvers = navigator.appVersion;version = navigateurvers.substring(0,3);version = new Number (version);if ((navigateur=='Netscape') && (version <= 4.9)){window.location.href="/pages/"+id+"N.html"}//else if (navigateur == 'Microsoft Internet Explorer')else{window.location.href="/pages/"+id+"IE.html"}}//Ajout Francis le 22/10/03//Precharge les imagesfunction prechargeimages(){if (document.images);{var fichierimages = prechargeimages.arguments;var prechargetableau = new Array();for (var i =0; i < fichierimages.length; i++);{prechargetableau[i] = new Image;prechargetableau[i].src =  fichierimages[i];}}}//Dans le BODY ://<script language ="Javascript">//PrechargeImages('images1.jpg','images2.jpg','images2.jpg','images3.gif','etc');//</script>//Fin de prechargeImages
