// Variables Navigateur
var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0) ? 1 : 0;
var isMinNS6 = (isMinNS4 && parseFloat(navigator.appVersion) >= 6) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
var isMinIE6 = (isMinIE4 && navigator.appVersion.indexOf("6.") >= 0) ? 1 : 0;

// Fonctions ROLL
function roll_on(nom) {
  if (document.images) document.images['lib'+nom].src = 'img/bt_' + nom + '_off.gif';
}

function roll_off(nom) {
  if (document.images) document.images['lib'+nom].src = 'img/bt_' + nom + '_roll.gif';
}

function init() {
  if (document.images) {
    boutrollsrc01 = new Image(71,31); boutrollsrc01.src = 'img/b_acc_roll.gif';
    boutrollsrc02 = new Image(79,31); boutrollsrc02.src = 'img/b_contr_roll.gif';
    boutrollsrc03 = new Image(202,31); boutrollsrc03.src = 'img/b_etud_roll.gif';
    boutrollsrc04 = new Image(202,31); boutrollsrc04.src = 'img/b_recrut_roll.gif';
    boutrollsrc05 = new Image(202,31); boutrollsrc05.src = 'img/b_con_roll.gif';
  }
}


function MM_validateForm() { //v4.0

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);

    if (val) { nm=val.name; if ((val=val.value)!="") {

      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

        if (p<1 || p==(val.length-1)) errors+='- '+nm+' doit contenir une adresse email.\n';

      } else if (test!='R') {

        if (isNaN(val)) errors+='- '+nm+' doit contenir un chiffre.\n';

        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

          min=test.substring(8,p); max=test.substring(p+1);

          if (val<min || max<val) errors+='- '+nm+' doit contenir un chiffre entre '+min+' et '+max+'.\n';

    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' est demand\xE9.\n'; }

  } if (errors) alert('l\'erreur suivante s\'est produite:\n'+errors);

  document.MM_returnValue = (errors == '');

}

//-->
