<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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.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 format(valeur,decimal,separateur) {
var deci=Math.round( Math.pow(10,decimal)*(Math.abs(valeur)-Math.floor(Math.abs(valeur)))) ; 
var val=Math.floor(Math.abs(valeur));
if ((decimal==0)||(deci==Math.pow(10,decimal))) {val=Math.floor(Math.abs(valeur)); deci=0;}
var val_format=val+"";
var nb=val_format.length;
for (var i=1;i<4;i++) {
	if (val>=Math.pow(10,(3*i))) {
		val_format=val_format.substring(0,nb-(3*i))+separateur+val_format.substring(nb-(3*i));
	}
}
if (decimal>0) {
	var decim=""; 
	for (var j=0;j<(decimal-deci.toString().length);j++) {decim+="0";}
	deci=decim+deci.toString();
	val_format=val_format+"."+deci;
}
if (parseFloat(valeur)<0) {val_format="-"+val_format;}
return val_format;
}

function openWindow(theURL,winName,features)
{
window.open(theURL,winName,features)
}

function affcancel()
{
this.close();
}


function openwin(f, w, h) {
if (w >800) w=800;
if (h >600) h=600;
w=w+40;
h=h+40;
mywin=window.open(f, w, "width=" + w + ", height=" + h + ", status=no, scrollbars=yes, resizable=yes"); //, status=yes
mywin.moveTo((screen.width-w)/2,(screen.height-(h+80))/2);
mywin.resizeTo(w,h);
mywin.creator = self;
}

function preload(imgObjet, imgSrc)
{
if (document.images)
	{
	eval(imgObjet+'=new Image()')
	eval(imgObjet+'.src="'+imgSrc+'"')
	}
}

function changeImage(layer, imgName, imgObj){
if (document.layers&&layer!=null)
	eval('document'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
else
	document.images[imgName].src = eval(imgObj+".src");
}
function openwinform(f,w,h) 
{
mywin=window.open(f,"mywin","width="+w+", height="+h+", scrollbars=yes, resizable=yes");
mywin.creator=self;
}
function redimform(f, w, h)
{
w=w+40;
h=h+40;
f.moveTo((screen.width-w)/2,(screen.height-(h+80))/2);
f.resizeTo(w,h);
}

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 testvalid(){
	var f=document.contact;

if(f.nom.value== ""){
	alert("Veuillez saisir votre nom.");
	f.nom.focus();
	return false;
}
if (f.telephone.value== "") {
	alert("Veuillez saisir votre téléphone");
	f.telephone.focus();
	return false;
}
if (f.message.value== "") {
	alert("Veuillez saisir votre message");
	f.message.focus();
	return false;
}

f.submit();
}





function ValidForm (Form)  {
if (Form['Nom'].value =='') {
alert ('La saisie de "Nom" est obligatoire! \n');
return (false);
}
if (Form.NETLORSTUDIO_Envoyeur.value =='') {
alert ('La saisie de "E-mail" est obligatoire! \n');
return (false);
}
var email = Form.NETLORSTUDIO_Envoyeur.value;
var aroba = email.indexOf("@");
ok = true;
if (aroba == -1) {
alert("L'adresse email n'est pas valide...\nIl n'y a pas de caractère @\nUne adresse email valide est de type \"adresse@domaine.com\"");
ok=false;
}
if (ok==true)
{
var point = email.indexOf(".", aroba);
if ((point == -1) || (point == (aroba + 1))) {
alert("L'adresse email n'est pas valide...\nIl ne peut pas y avoir un point (.) juste après @\nUne adresse email valide est du type \"adresse@domaine.com\"");
ok=false;
}
}
if (ok==true)
{
var point = email.lastIndexOf(".");
if ((point + 1) == email.length) {
alert("L'adresse email n'est pas valide...\nL'adresse email ne peut pas finir par un point (.)\nUne adresse email valide est du type \"adresse@domaine.com\"");
ok=false;
}
}
if (Form['Telephone'].value =='') {
alert ('La saisie de "Téléphone" est obligatoire! \n');
return (false);
}
return (ok);
}
//-->
