		function myRound(val) {
			strVal = val+"n" ; // on convertit en chaine
			endStr = strVal.substring(strVal.lastIndexOf(".")) ; // on recupere la fin
			if (endStr == strVal) return val+".00" ; // nombre entier
			else if (endStr.length == 3) return val+"0" ; // 1 apres la virgule
			else return val ; // 2 apres la virgule
		} 
				
		
		function PopupImage(img) {
			titre="Aperçu de l'image";
			w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');	
			w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
			w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
			w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><div height='50' align='center'><IMG src='"+img+"' border=0></div><br><br>");
			w.document.write("");
			w.document.write("</BODY></HTML>");
			w.document.close();
		}						
		
		function verifiermail(mail) {
	      if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
	         return true 
	      } else {
	         return false
	      }
	   	}
	   	
	   	function verifiercp(code_postal) {
      		if (code_postal>=01000 && code_postal<=99999) {
         		return true 
      		} else {
         		return false
      		}
   		}

		function veriftel(telephone) {
      		regexp = /^[0-9+][0-9 -]*[0-9]$/;
      		if (regexp.test(telephone)) {
         		return true 
      		} else {
         		return false
      		}
   		}
		
		function ValidMdP(){
			if(document.form1.email.value!="" && verifiermail(document.form1.email.value)==true) document.form1.submit();
			else alert("Veuillez renseigner correctement votre email");
		}		
	
		function EnvoyerActu(prefix){
			document.form1.submit();
		}
		
		var Champs=new Array("nom","prenom","email");
		var Message=new Array("Nom","Prenom","Email");
		
		
		function EnvoyerIns(){
			tmp="";
			msg="";
			msg2="";
			for (i=0;i<Champs.length;i++){			
				if (eval("document.form1."+Champs[i]+".value")==""){
					msg+="- "+Message[i]+"\n";
				}
			}
		
			var mail_v=1;
			if (document.form1.email.value!="" && verifiermail(document.form1.email.value)==false){
				msg2+="- Adresse email incorrecte\n";
				mail_v=0;
			}
			
			var cpok=1;
			if (document.form1.codepostal.value!="" && verifiercp(document.form1.codepostal.value)==false){
				msg2+="- Code Postal incorrect\n";
				cpok=0;
			}
			
			var telok=1;
			if (document.form1.telephone.value!="" && veriftel(document.form1.telephone.value)==false){
				msg2+="- Numéro de téléphone incorrect\n";
				telok=0;
			}
			
			if(document.form1.formation.options[document.form1.formation.options.selectedIndex].value=="") msg+="- Formation\n";
			
			if (msg=="" && msg2=="" && mail_v!=0 && cpok!=0 && telok!=0){
				document.form1.submit();
			}else{
				if (msg!=""){ 
					tmp="Merci de remplir les champs suivants:\n\n"+msg;				
				}
				if (msg2!=""){
					if(tmp!="") tmp+="\n\nEt de corriger les champs suivants :\n\n"+msg2;
					else tmp+="\n\nMerci de corriger les champs suivants :\n\n"+msg2;
				}
				if(tmp!=""){
					window.alert(tmp);
					tmp = "";
				}
			}
		}
		
		function MailExist(){
			alert("L'adresse email que vous avez fournit est déjà utilisée");
		}				
		
		function ChgGam(link){
			window.location.href=link;	
			//return document.MM_returnValue;
		}
		
		function EnvoyerMot(){
			document.form1.submit();	
		}
		
		function Courriel(mail){			
			if(verifiermail(document.form1.courriel.value)==false) alert("Adresse Email incorrecte");
			else document.form1.submit();
		}
		
		function Search(critere,i){		
			document.formSearch.critere.value=critere;
			document.formSearch.identifiant.value=i;
			document.formSearch.submit();
		}
		
		function Contact(){
			tmp="";
			msg="";
			msg2="";
			for (i=0;i<Champs.length;i++){			
				if (eval("document.form1."+Champs[i]+".value")==""){
					msg+="- "+Message[i]+"\n";
				}
			}
		
			var mail_v=1;
			if (document.form1.email.value!="" && verifiermail(document.form1.email.value)==false){
				msg2+="- Adresse email incorrecte\n";
				mail_v=0;
			}
			
			var cpok=1;
			if (document.form1.codepostal.value!="" && verifiercp(document.form1.codepostal.value)==false){
				msg2+="- Code Postal incorrecte\n";
				cpok=0;
			}
			
			var telok=1;
			if (document.form1.telephone.value!="" && veriftel(document.form1.telephone.value)==false){
				msg2+="- Numéro de téléphone incorrect\n";
				telok=0;
			}
			
			//if(document.form1.formation.options[document.form1.formation.options.selectedIndex].value=="") msg+="- Formation\n";
			
			if (msg=="" && msg2=="" && mail_v!=0 && cpok!=0 && telok!=0){
				document.form1.submit();
			}else{
				if (msg!=""){ 
					tmp="Merci de remplir les champs suivants:\n\n"+msg;				
				}
				if (msg2!=""){
					if(tmp!="") tmp+="\n\nEt de corriger les champs suivants :\n\n"+msg2;
					else tmp+="\n\nMerci de corriger les champs suivants :\n\n"+msg2;
				}
				if(tmp!=""){
					window.alert(tmp);
					tmp = "";
				}
			}
		}
		
		function ChangeFormation(){
			//alert ("tuytuy");
			if(document.form1.formation.options[document.form1.formation.options.selectedIndex].value=="aucune") document.form1.annee.options.selectedIndex=0;
		}
		
		function Email(){
			if(document.formUns.email.value!="" && verifiermail(document.formUns.email.value)!=false) document.formUns.submit();
			else alert("Adresse incorrecte");
		}
		
		//	Actu-Grande photo identique à petite photo
		function PhotoIdem(input,prefix){		
			o=eval("input.form."+prefix+"PhotoBig");
			o.disabled=input.checked;
		}