﻿function flash(fichier,largeur,hauteur,mode,anim,langue)
{
   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="',largeur,'" height="',hauteur,'">\n');
   document.write('<param name="movie" value="',fichier,'?anim=',anim,'">\n');
   document.write('<param name="quality" value="high">\n');
	document.write('<param name="wmode" value="',mode,'">\n');
   document.write('<embed src="',fichier,'?anim=',anim,'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="',largeur,'" height="',hauteur,'"></embed></object>\n');
   document.write('</object>\n');
}

function verifier_saisie(zone,valeur)
{
if (zone==value)
{
alert('Vous n\'avez pas saisi toutes les zones obligatoires');
return false;
}
else
{
return true;	
}
}

function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

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_validateForm() { //v4.02 ext.
  const color = '#D900D9';
  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]; obj=MM_findObj(args[i]);
    if (obj) { if (obj.style.backgroundColor==color) obj.style.backgroundColor = 'white'; nm=obj.name; 
    if ((val=obj.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';
        	obj.style.backgroundColor = color; }	
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) { errors+='- '+nm+' must contain a number.\n';
        	obj.style.backgroundColor = color; }	
        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';
          	obj.style.backgroundColor = color; }	
    } } } else if (test.charAt(0) == 'R') {	errors += '- '+nm+' est nécessaire.\n'; 
    	obj.style.backgroundColor = color;  }}
    	
  } if (errors) alert('Vérifiez votre saisie :\n'+errors);
  document.MM_returnValue = (errors == '');
}