// [FONCTION] verifMail v2
function verifMail(a) {
	testm =	false ;
	
	// on donne les caracteres autorisés
      testchaine = 'ok';
      chaine = a;
      var alphabet     = 'a-z';     // alphabet
      var chiffre      = '0-9';     // chiffre
      var trait        = '\\-';     // trait d'union
      var underscore   = '\\_';     // underscore
      var caract_ok    = '['+alphabet+chiffre+trait+underscore+'@\.]';
      // on test les caractere valides
      jeTest = a;
      for (var j=0 ; j<(jeTest.length) ; j++) {
            var mon_exp = new RegExp (caract_ok, 'gi');
            var x = mon_exp.test(jeTest.charAt(j));
            var lepasbon = jeTest.charAt(j);
            if (lepasbon==' '){lepasbon = 'ESPACE';}
            if ( x == false ) {
            	alert('Le caractère \''+ lepasbon +'\' n\'est pas valide dans une adresse Email');
            	testchaine = 'ko';
                  return false;
            	}
            }
      // on regarde la coherence de la structure du mail
	for (var j=1 ; j<(a.length) ; j++) {
            if (a.charAt(j)=='@') {
			if (j<(a.length-4)){
				for (var k=j ; k<(a.length-2) ;	k++) {
					if (a.charAt(k)=='.') testm = true;
						}
				}
			}
		}
	if (testm==false) { alert('adresse e-mail incorrecte.');return false}
	else { return true; }
	
		// ELSE	facultatif ; la	fonction retournant testm, la suite du traitement du formulaire	peut donc avoir	lieu
	return testm ; 
	}

function check_recovideo(o){
      //alert('yes');
     	couleurFocus = '#FFD8BA';
        
      if ( o.prenom.value == '' || o.prenom.value == defaultvalue_prenom) {
	      alert('Veuillez saisir votre "prénom"');
	      o.prenom.style.background=couleurFocus;
	      o.prenom.focus();
	      return false;
	      }
      verifMail(o.email.value);
      if (testm==false) { 
      	o.email.style.background=couleurFocus;
      	o.email.focus();
      	return false;
      	}
      if ( o.email.value == defaultvalue_email ) {
	      alert('Veuillez saisir l\'Email de votre destinataire');
	      o.email.style.background=couleurFocus;
	      o.email.focus();
	      return false;
	      }
      if ( o.page.value == '' ) {
	      alert('Erreur');
	      return false;
	      }
      }

// efface champs 1.1
// onFocus="effaceChamps(this.form.name,this.name,'mots clés');
function effaceChamps (o,s,textToErase) {
	if (textToErase == document.forms[o].elements[s].value){ document.forms[o].elements[s].value="" }
	}

// [FONCTION] tof v2.0
// popUp dynamique image
function tof(monImage){
	w = window.open('','chargement','width=700,height=500');
	w.document.write( "<html><head><title>Photo</title>\n" );
	w.document.write( "<script language='JavaScript'>\n");
	w.document.write( "IE5=NN4=NN6=false;\n");
	w.document.write( "if(document.all)IE5=true;\n");
	w.document.write( "else if(document.getElementById)NN6=true;\n");
	w.document.write( "else if(document.layers)NN4=true;\n");
	w.document.write( "function autoSize() {\n");
	w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+28);\n");
	w.document.write( "else if(NN6) self.sizeToContent();\n");
	w.document.write( "else window.resizeTo(document.images[0].width,document.images[0].height+15);\n");
	w.document.write( "Ls=screen.width;Hs=screen.height;\n");
	w.document.write( "if(document.images[0].width>Ls||document.images[0].height>Hs){document.images[0].width=parseInt(Ls)-30;document.images[0].height=parseInt(Hs)-30};self.moveTo(0,0)\n");
	w.document.write( "self.focus();\n");
	w.document.write( "}\n</scri");
	w.document.write( "pt>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
	w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='Cliquez pour FERMER'></a>" );
	w.document.write( "</body></html>" );
	w.document.close();
	}
