// JavaScript Document

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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';}
}

window.onload=montre; 

function validation(theForm)
{  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.identifiant.value;
  var allValid = true;
  var validGroups = true;
  
  if (theForm.identifiant.value=="")
  {
    alert("Merci de renseigner votre identifiant!");
    theForm.identifiant.focus();
    return (false);
  }
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Votre identifiant est invalide!");
    theForm.identifiant.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.motdepasse.value;
  var allValid = true;
  var validGroups = true;
  
    if (theForm.motdepasse.value=="")
  {
    alert("Merci de renseigner votre mot de passe!");
    theForm.motdepasse.focus();
    return (false);
  }
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Votre mot de passe est invalide!");
    theForm.motdepasse.focus();
    return (false);
  }
  return (true); } 
  
  function OuvreFenetreCentreeFixe(url,hauteur,largeur)
{
	//calcul du centre de l'écran

	//je récupère la hauteur et largeur en point
		var pixel_haut = window.screen.availHeight;
		var pixel_larg = window.screen.availWidth;

	//je determine la position a gauche
	//egual à la moitié de l'écran moins
	//la moitié de la taille de la fenetre
		var point_gauche = parseInt(pixel_larg/2) - parseInt(largeur/2);
		point_gauche = parseInt((pixel_larg-largeur)/2);

	//je determine la position supérieur
		var point_haut = parseInt(pixel_haut/2) - parseInt(hauteur/2);


	//ouverture de la fenetre avec les dimensions passées en paramètre
		newfenetre = window.open(url,"","height=" + hauteur + ",width=" + largeur + ",left=" + point_gauche + ",top=" + point_haut);
		newfenetre.focus();
}

function pop360(theUrl,winName,features) {
if (document.layers||document.getElementById) {
	theUrl=theUrl+"360.htm";
	window.open(theUrl, winName, 'toolbar=no, location=no, directories=no, statusbar=no, status=no, statusbar=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=385, height=228, left=0, top=0, screenX=0, screenY=0');
} else {
	window.open(theUrl, winName);
	}}

function zoomfull(theUrl,winName,features) {
if (window.screen.width<=800) theUrl=theUrl+"zoom800.htm"; 
if (window.screen.width==1024) theUrl=theUrl+"zoom1024.htm"; 
if (window.screen.width>=1280) theUrl=theUrl+"zoom1280.htm"; 
if (document.layers||document.getElementById) {
	window.open(theUrl, winName, 'fullscreen=yes, toolbar=no, location=no, directories=no, status=no, statusbar=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+screen.availWidth+', height='+screen.availHeight);
} else { window.open(theUrl, winName, 'fullscreen=yes, scrollbars=no, status=no');}
}
