
function loaddoc() { 
// loaddoc() v1.0 by Coco http://www.infodus.net/
// charge plusieurs documents dans differentes fenetres.
// syntaxe :
// loaddoc('url1!target1','doc2!target2','rep3/doc3!newwin3' ...)
// usage de la fonction libre de droits.

   var i, j, w=window, a=loaddoc.arguments;
   for(i=0; i<a.length; i++) {
	b=a[i].split("!");
	window.open(b[0],b[1]);
   }
   return;
}
// fin de la fonction loaddoc()

//------------------------------------------------------------------------------------

function voir(fichier){
	var fichier;
	image=window.open('galerie/images/'+fichier+'.jpg','image','location=no,menubar=no,scrollbars=no,resize=no,resizable=no,status=no,toolbar=no,directories=no,width=816,height=620,top=0,left=0,titlebar=no');
	if (image != null)
		image.focus();
	return;
}

//------------------------------------------------------------------------------------

var PopUpWindow;
function PopUp(src,name,width, height, screenx, screeny, scrollbar, resize, toolbar, status, menubar, location, directories) {
	var size, pos;
	size = '';
	pos = '';
	if (width > 0)		size = ',width='+width;
	if (height > 0)		size = size + ',height='+height;
	if (screenx >= 0)	pos = ',screenX='+screenx+',left='+screenx;
	if (screeny >= 0)	pos = pos + ',screenY='+screeny+',top='+screeny;
	scrollbar = (scrollbar == 1)?'yes':'no';
	resize = (resize == 1)?'yes':'no';
	toolbar = (toolbar == 1)?'yes':'no';
	status = (status == 1)?'yes':'no';
	menubar = (menubar == 1)?'yes':'no';
	location = (location == 1)?'yes':'no';
	directories = (directories == 1)?'yes':'no';
	//Ouverture de la pop-up
	PopUpWindow = window.open(src, name,'scrollbars='+scrollbar+',resizable='+resize+',toolbar='+toolbar+',status='+status+',menubar='+menubar+',location='+location+',directories='+directories+size+pos);
	if (PopUpWindow != null)
		PopUpWindow.focus();
}

//------------------------------------------------------------------------------------

function soumettre(formulaire){
	msg="";
	valid=true;
	if (document.forms[formulaire].elements["Nom"].value==""){
		msg="un Nom";
		valid=false;
	}
	if (document.forms[formulaire].elements["Email"].value==""){
		if (msg==""){
			msg="un Email";
		}else{
			msg+=", un Email";
		}
		valid=false;
	}else{
	
	}
	
	if (valid){
		return true;
	}else{
		msg="Vous devez indiquer "+msg+" !";
		alert (msg);
		return false;
	}
}

//------------------------------------------------------------------------------------

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+' doit contenir une adresse E-Mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' doit contenir un nombre.\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+' doit contenir un nombre entre '+min+' et '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' est obligatoire.\n'; }
  } if (errors) alert('Il y a des erreurs dans le formulaire:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//MM_validateForm('Nom','','R','Email','','RisEmail','Message','','R');return document.MM_returnValue

//------------------------------------------------------------------------------------


