 function OuvrirPop(url,nom,haut,gauche,largeur,hauteur,options) 
		 {  
		   ouvpop=window.open(url,nom);
		   /*  		  ouvpop=window.open(url,nom,"top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+","+options);*/
     }
	
  function OuvrirPopFormation(url,nom) 
		 {  
		 ouvpop=window.open(url,nom);
		 /*haut=0 ;
		 gauche=0 ;
		 largeur=900 ;
		 hauteur=600;
		 options='toolbar=yes,location=yes,menubar=yes,scrollbars=yes,statusbar=yes';
		 ouvpop=window.open(url,nom,"top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+","+options);*/
     }	 

function FermerLien(nomdiv,url,nom,type,typenom,nbj,taille)  
   {
     document.getElementById(nomdiv).innerHTML="<img src=\"Images\/"+type+".jpg\"  height=\"17\" width=\"25\" title=\""+typenom+"\" alt=\""+typenom+"\" \/><a onclick=\"javascript:OuvrirLien('"+nomdiv+"','"+url+"','"+nom+"','"+type+"','"+typenom+"','"+nbj+"','"+taille+"');return false;\" href=\""+url+"\">"+nom+"<\/a><span style=\"font-style: italic;\"> - " + nbj + " - <\/span>";
   }

function OuvrirLien(nomdiv,url,nom,type,typenom,nbj,taille)  
   {
     document.getElementById(nomdiv).innerHTML="<img src=\"Images\/"+type+".jpg\"  height=\"17\" width=\"25\"  title=\""+typenom+"\" alt=\""+typenom+"\" \/>"+nom+"<span style=\"font-style: italic;\" > - " + nbj + " - <\/span><a onclick=\"javascript:FermerLien('"+nomdiv+"','"+url+"','"+nom+"','"+type+"','"+typenom+"','"+nbj+"','"+taille+"');return false;\" href=\""+url+"\"> <img src=\"Images\/fermeture.jpg\" title=\"Fermer\" alt=\"Fermer\" \/><\/a><br \/><object data=\""+url+"\" type=\"text\/xml\" width=\"700\" height=\""+taille+"\"  ><\/object>";
   }

function FermerLienSimple(nomdiv,url,nom,taille)  
   {

     document.getElementById(nomdiv).innerHTML="<a onclick=\"javascript:OuvrirLienSimple('"+nomdiv+"','"+url+"','"+nom+"','"+taille+"');return false;\" href=\""+url+"\">"+nom+"<\/a>";
   }

function OuvrirLienSimple(nomdiv,url,nom,taille)  
   {
     document.getElementById(nomdiv).innerHTML=nom+"<a onclick=\"javascript:FermerLienSimple('"+nomdiv+"','"+url+"','"+nom+"','"+taille+"');return false;\" href=\""+url+"\"><img src=\"Images\/fermeture.jpg\" title=\"Fermer\" alt=\"Fermer\" /><\/a><br \/><object data="+url+" type=\"text\/html\" width=\"700\" height=\""+taille+"\" ><\/object>";
   }

function OuvrirLien2(nomdiv,url,nom,type,typenom,nbj,taille,mydiv)  
   {
     document.getElementById(nomdiv).innerHTML="<div style=\"z-index:99;\" class=\""+mydiv+"\"><a onclick=\"javascript:FermerLien2('"+nomdiv+"','"+url+"','"+nom+"','"+type+"','"+typenom+"','"+nbj+"','"+taille+"','"+mydiv+"');return false;\" href=\""+url+"\"> <img src=\"Images\/fermeture.jpg\" title=\"Fermer\" alt=\"Fermer\" \/><\/a><br \/><object data=\""+url+"\" type=\"text\/xml\" width=\"700\" height=\""+taille+"\"  ><\/object><\/div>";
   }
function FermerLien2(nomdiv,url,nom,type,typenom,nbj,taille,mydiv)  
   {
     document.getElementById(nomdiv).innerHTML="<a class=\""+mydiv+"\" onclick=\"javascript:OuvrirLien2('"+nomdiv+"','"+url+"','"+nom+"','"+type+"','"+typenom+"','"+nbj+"','"+taille+"','"+mydiv+"');return false;\" href=\""+url+"\"> <\/a>";
   }

var maintenant=new Date();
var jour=maintenant.getDate();
var mois=maintenant.getMonth()+1;
var an=maintenant.getFullYear();
var heure=maintenant.getHours(); 
var minute=maintenant.getMinutes();
var seconde=maintenant.getSeconds();
function checkTime(i)
{
if (i<10) 
  {i="0" + i}
  return i
}

entree = new Date;
entree = entree.getTime();
var dateinitial;
function ZsortIe()
{
  fin = new Date;
  fin = fin.getTime();
  secondes = (fin-entree)/1000;
  dateinitial="et la page a &eacute;t&eacute; charg&eacute;e le "+jour+"/"+mois+"/"+an+" à "+heure+":"+checkTime(minute)+":"+checkTime(seconde)+' en ' + secondes + ' seconde(s).';
}
function startTime()
{
  var today=new Date();
var j=today.getDate();
var mo=today.getMonth()+1;
var an=today.getFullYear();
 var h=today.getHours();
 var m=today.getMinutes();
 var s=today.getSeconds();
// add a zero in front of numbers<10
 m=checkTime(m);
 s=checkTime(s);
 mo=checkTime(mo);
  document.getElementById('datecourant').innerHTML="Nous sommes le "+j+"/"+mo+"/"+an+" à "+h+":"+m+":"+ s +" " + dateinitial;
  t=setTimeout('startTime()',500);
}


function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}
function efface(id) {
var d = document.getElementById(id);
if (d) {d.style.display='none';}
}

/* function FermerFormation(event,nomdiv,url,taille)  */
function FermerFormation(nomdiv,url,taille) 
/**
 * Fonction qui ferme le document
 * @param nomdiv : nom du div
 * @param url : url a ouvrir
 * @param taille : hauteur du document
 */
{
  document.getElementById(nomdiv).innerHTML="<a onclick=\"javascript:OuvrirFormation('"+nomdiv+"','"+url+"','"+taille+"');return false;\" href=\""+url+"\"> <\/a>";
}
/*function OuvrirFormation(event,nomdiv,url,taille)  */
function OuvrirFormation(ev,nomdiv,url,taille)  
/**
 * Fonction qui ouvre un document html
 * @param ev : evenement
 * @param nomdiv : nom du div
 * @param url : url a ouvrir
 * @param taille : hauteur du document
 */
{
  	e=document.getElementById(nomdiv);
/*	
	alert("l"+ev.clientX+":"+e.offsetLeft+":"+e.offsetParent.offsetLeft+":"+document.documentElement.scrollTop);
	    document.getElementById(nomdiv).style.left=(x1-ev.clientX) + 'px';
	position exacte de la souris
  	e=document.getElementById('shape1');
    document.getElementById(nomdiv).style.left=event.pageX + 'px';
	document.getElementById(nomdiv).style.top =event.pageY + 'px';	
	document.getElementById(nomdiv).style.left=event.screenX/2 + 'px';
	document.getElementById(nomdiv).style.top =event.screenY/2 + 'px';

	document.getElementById(nomdiv).style.left= 200 + 'px';
	document.getElementById(nomdiv).style.top = 300 + 'px';
	*/	
    rel=false;
    e.innerHTML="<div  id=\"form\">" +
      "<a onclick=\"javascript:FermerFormation('"+nomdiv+"','"+url+"','"+taille+"');return false;\" href=\""+url+"\"> " +
     "<img src=\"Images\/fermeture.jpg\" title=\"Fermer\" alt=\"Fermer\" \/><\/a>" +
      "<img id='imgdeplacer' src=\"Images\/deplacer.jpg\" title=\"Deplacement\" alt=\"Deplacement\" \/><br \/>" +
     "<object data=\""+url+"\" type=\"text\/xml\"  width=\"700\" height=\""+taille+"\"   >" +"<\/object><\/div>";
	e.style.position='absolute';	
	e.style.left= (ev.clientX - e.offsetParent.offsetLeft+document.documentElement.scrollLeft)  + 'px';	
	e.style.top= (ev.clientY - e.offsetParent.offsetTop+document.documentElement.scrollTop)  + 'px';	

}
   function position(e) {
     if(!e){var e = window.event;}
	 window.lastX=e.clientX;
     window.lastY=e.clientY; 
     texte = "abscisse : X = " + window.lastX + "<br>ordonnée : Y = " + window.lastY;
     document.getElementById("zone2").innerHTML = texte;
   }
   

function doDrag(e) {
 if(!e){var e = window.event;}
 id = "zone";
 var mon_div=document.getElementById(id);
 // Calcul de l'écart de position de la souris
 var difX=e.clientX-window.lastX;
 var difY=e.clientY-window.lastY;
 //Récupération de la position du div et ajout de l'écart de position de la souris
 var newX1 = parseInt(mon_div.style.left)+difX;
 var newY1 = parseInt(mon_div.style.top)+difY;
 // Assignation des nouvelles coordonnées au div
 mon_div.style.left=newX1+"px";
 mon_div.style.top=newY1+"px";
 //Assignation de l'anciènne position de la souris
 window.lastX=e.clientX;
 window.lastY=e.clientY; 
}

function coordinates(e)
{
if (e == null) { e = window.event;}
var sender = (typeof( window.event ) != "undefined" ) ? e.srcElement : e.target;

if (sender.id=="imgdeplacer")
  {
  mouseover=true;
  window.lastX=e.clientX;
  window.lastY=e.clientY;
  document.onmousemove=doDrag;
  return false;
  }
else { return true; }
}

function endDrag(e) {
    document.onmousemove = null;
}

function isEmail(email) { // vérif validité email par REGEXP
   var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/;
   return (reg.exec(email)!=null);
}
function isCodePostal(code) {
  var reg = /^(0[1-9]{0,1}|[1-9][0-9]{0,1})[0-9]{0,3}$/;
  return (reg.exec(code)!=null);
}
function isTelephone(num_tel)
{
var reg = /^(01|02|03|04|05|06|08|09)[0-9]{8}$/;
return (reg.exec(num_tel)!=null); 
}
 
function OuvrirHtml(url,taille)  
{
  var m=open(url, "_top,", "toolbar=0, directories=1, status=1, menubar=0, width=700, height=500, scrollbars=1, location=1, resizable=1");
}

