// JavaScript Document
var slideShowSpeed = 5000
var crossFadeDuration = 3
var Pic = new Array() // don't touch this
Pic[0] = 'images/logos/LogoAITE.jpg'
Pic[1] = 'images/logos/logo_LEPLAST.jpg'
Pic[2] = 'images/logos/logoBALISE1.jpg'
var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply() 
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}


function netie(net, ie) {
  if ((navigator.appVersion.substring(0,3) >= net && navigator.appName == 'Netscape' && net != -1) || (navigator.appVersion.substring(0,3) >= ie && navigator.appName.substring(0,9) == 'Microsoft' && ie != -1))
    return true;
else return false;
}

function verif_email(formulaire) {
  adresse = formulaire.email.value;
  taille = formulaire.email.value.length;
  validelog = false;
  validedom = false;
  valideext = false;
  arob = adresse.lastIndexOf("@");
  login = adresse.substring(0,arob);
  pointfinal = adresse.lastIndexOf(".");
  extension = adresse.substring(pointfinal,taille);
  domaine = adresse.substring(arob+1,pointfinal);
  
  if ( login.length > 2 ) {
     validelog = true;
  } else {
     alert('Ceci n\'est pas une adresse e-mail conforme.\nUne adresse e-mail comporte un arobase (@) precede d\'un login \'convenable\'. Exemple mon.nom@mondomaine.fr');
     validelog = false;
  }

  if ( domaine.length > 1 ) {
     validedom = true;
  } else {
     alert('Ceci n\'est pas une adresse e-mail valide.\nLe nom de domaine n\'existe pas ou n\'a pas été saisi.'); 
     validelog = false;
  }

  if ( pointfinal > -1 && (extension.length == 3 || extension.length == 4) ) {
     valideext = true;
  } else {
     alert('Ceci n\'est pas une adresse e-mail valide.\nL\'extension du domaine n\'est pas bonne.');
     valideext = false;
  }

  if ( validelog == true && validedom == true && valideext == true ) {
     return true;
  } else {
     return false;
  }
}