// JavaScript Document
var tableau;
var tableau = new Array (22);
	for(i=0; i<24; i++) {
	tableau[i]= new Image();
	}

function init(){

	tableau[0].src='IMG/condition_on.gif';
	tableau[1].src='IMG/condition_off.gif';
	tableau[2].src='IMG/infos_on.gif';
	tableau[3].src='IMG/infos_off.gif';
	tableau[4].src='IMG/partenaires_on.gif';
	tableau[5].src='IMG/partenaires_off.gif';
	tableau[6].src='IMG/espace_profs_on.gif';
	tableau[7].src='IMG/espace_profs_off.gif';
	tableau[8].src='IMG/entrez_on.gif';
	tableau[9].src='IMG/entrez_off.gif';
	tableau[10].src='IMG/inscrire_on.gif';
	tableau[11].src='IMG/inscrire_off.gif';
	tableau[12].src='IMG/condition_on.gif';
	tableau[13].src='IMG/condition_off.gif';
	tableau[14].src='IMG/infos_on.gif';
	tableau[15].src='IMG/infos_off.gif';
	tableau[16].src='IMG/aide_on.gif';
	tableau[17].src='IMG/aide_off.gif';
	tableau[18].src='IMG/ludique_on.gif';
	tableau[19].src='IMG/ludique_off.gif';
	tableau[20].src='IMG/demo_on.gif';
	tableau[21].src='IMG/demo_off.gif';
	tableau[22].src='IMG/ressources_on.gif';
	tableau[23].src='IMG/ressources_off.gif';

	}

function verifChamps(){
		msg = "";
		nom = document.form_demande.nom.value;
		login = document.form_demande.login.value;
		mdp = document.form_demande.mdp.value;
		mdp2 = document.form_demande.mdp2.value;
		
		if (mdp.length<5){
			alert("Le mot de passe doit faire plus de 5 caractères.");
			return false;
		}
		if (mdp!= mdp2){
			alert("Les deux mots de passe ne sont pas identiques.");
			document.form_demande.mdp.value="";
			document.form_demande.mdp2.value="";
			return false;
		}
		if (nom=="" || login=="" || mdp=="" || mdp2==""){
			alert("Les champs marqués d'une étoile sont obligatoires.");
			return false;
		}
		document.form_demande.submit();
}


function MM_swapIMGRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

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+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
function bouton(nav)
{
	if (nav=='Microsoft Internet Explorer 5.0')
	{
		document.getElementById("entrez").style.display='none';
		document.getElementById("fleche").style.display='none';
	}
	else
	{
		document.getElementById("ok").style.display='none';
	
	}

}
function verifnav()
{
	// on crée la variable qui accueillera le message relatif au navigateur
	var navigateur = "";
	
	// Attention, l'ordre de recherche est important !! Parce que IE reprend la mention 'Mozilla' et Opera reprend la mention 'MSIE' !!
	// on teste si on trouve la mention 'Opera...' dans le nom du navigateur
	if ( navigator.userAgent.indexOf('Opera 5') != -1 ) { navigateur = 'Opera 5.x'; }
	
	// on teste si on trouve la mention 'MSIE...' dans le nom du navigateur
	else if ( navigator.userAgent.indexOf('MSIE 4.5') != -1 ) { navigateur = 'Microsoft Internet Explorer 4.5'; }
	else if ( navigator.userAgent.indexOf('MSIE 5.0') != -1 ) { navigateur = 'Microsoft Internet Explorer 5.0'; }
	else if ( navigator.userAgent.indexOf('MSIE 5.5') != -1 ) { navigateur = 'Microsoft Internet Explorer 5.5'; }
	
	// on teste si on trouve la mention 'Mozilla...' dans le nom du navigateur
	else if ( navigator.userAgent.indexOf('Mozilla/3.0') != -1 ) { navigateur = 'Netscape Navigator 3.0'; }
	else if ( navigator.userAgent.indexOf('Mozilla/4.0') != -1 ) { navigateur = 'Netscape Communicator 4.0'; }
	else if ( navigator.userAgent.indexOf('Mozilla/4.5') != -1 ) { navigateur = 'Netscape Communicator 4.5x'; }
	else if ( navigator.userAgent.indexOf('Mozilla/4.7') != -1 ) { navigateur = 'Netscape Communicator 4.7x'; }
	else if ( navigator.userAgent.indexOf('Mozilla/5.0') != -1 ) { navigateur = 'Netscape Communicator 6.0'; }
	
	// si rien n'a été reconnu...
	else { navigateur = 'Inconnu'; }
	
	bouton(navigateur);
	

}

var ie4=document.all; 
function etend(){
/*      var oEditor = this.FCKeditorAPI.GetInstance('FCKeditor1___Frame') ;     */

        var zone1=MM_findObj('haut');
        var zone2=MM_findObj('bas');
        var h;
        if (ie4){
                        h=document.body.clientHeight;
        } else {
                        h=window.innerHeight+10;
                }
        /*window.resizeTo(810,h);*/
	if (h>624){
//alert(h);
        h=h-420; /* centre de page */
        H=h/4; /* bandeau hauts et bas... */
	var bas=h-H;
        zone1.height=H;
        zone2.height=bas;
	}
}
	
	
