// JavaScript Document
     function addBookmark(title,url) {
                         if (window.sidebar) {
                              window.sidebar.addPanel(title, url,"");
                         } else if( document.all ) {
                              window.external.AddFavorite( url, title);
                         } else if( window.opera && window.print ) {
                              return true;
                         }
                    }
//fonctions pour les layers cachés					

 function OpenLayer(id, btn){
   if(document.getElementById(id).style.display == "block") {
    document.getElementById(id).style.display = "none" ;
	
   } else {
    document.getElementById(id).style.display = "block" ;

   }
   
   if(document.getElementById(btn).value == "Éditer") {
    document.getElementById(btn).value = "Fermer" ;
	
   } else {
    document.getElementById(btn).value = "Éditer" ;

   }
   
   window.status =  document.getElementById(id).style.display;
 }
  function OpenLayerhoraire(id, btn){
   if(document.getElementById(id).style.display == "block") {
    document.getElementById(id).style.display = "none" ;
	
   } else {
    document.getElementById(id).style.display = "block" ;

   }
   
   if(document.getElementById(btn).value == "Fermer la grille horaire") {
    document.getElementById(btn).value = "Voir la grille horaire" ;
	
   } else {
    document.getElementById(btn).value = "Fermer la grille horaire" ;

   }
   
   window.status =  document.getElementById(id).style.display;
 }
 function OpenLayer2(id){
   if(document.getElementById(id).style.display == "block") {
    document.getElementById(id).style.display = "none" ;
	
   }  
      window.status =  document.getElementById(id).style.display;
 } 
  function OpenLayer5(id){
   if(document.getElementById(id).style.display == "block") {
    document.getElementById(id).style.display = "none" ;
	
   }  else {
    document.getElementById(id).style.display = "block" ;

   } 
      window.status =  document.getElementById(id).style.display;
 } 
   
   function OpenLayer3(id){
   if(document.getElementById(id).style.display == "none") {
    document.getElementById(id).style.display = "block" ;
	
   }  
    
   window.status =  document.getElementById(id).style.display;
 }
   function OpenLayer4(id){
   if(document.getElementById(id).style.display == "none") {
    document.getElementById(id).style.display = "block" ;
	
   }  
    
   window.status =  document.getElementById(id).style.display;
 } 
 
 // function pour les pop-ups
 
 function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=550,height=600');");
}
function popUp3(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300');");
}
function popUp4(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=600');");
}

//Fonction de redimension de l'image


							

function redimImage(inImg, inMW, inMH)
{
  // Cette function recoit 3 parametres
  // inImg : Chemin relatif de l'image
  // inMW  : Largeur maximale
  // inMH   : Hauteur maximale
  var maxWidth = inMW;
  var maxHeight = inMH;
  // Declarations des variables "Nouvelle Taille"
  var dW = 0;
  var dH = 0;
  // Declaration d'un objet Image
  var oImg = new Image();
  // Affectation du chemin de l'image a l'objet
  oImg.src = inImg;
  // On recupere les tailles reelles
  var h = dH = oImg.height;
  var w = dW = oImg.width;
  // Si la largeur ou la hauteur depasse la taille maximale
  if ((h >= maxHeight) || (w >= maxWidth)) {
    // Si la largeur et la hauteur depasse la taille maximale
    if ((h >= maxHeight) && (w >= maxWidth)) {
      // On cherche la plus grande valeur
      if (h > w) {
        dH = maxHeight;
        // On recalcule la taille proportionnellement
        dW = parseInt((w * dH) / h, 10);
      } else {
        dW = maxWidth;
        // On recalcule la taille proportionnellement
        dH = parseInt((h * dW) / w, 10);
      }
    } else if ((h > maxHeight) && (w < maxWidth)) {
      dH = maxHeight;
        // On recalcule la taille proportionnellement
      dW = parseInt((w * dH) / h, 10);
    } else if ((h < maxHeight) && (w > maxWidth)) {
      dW = maxWidth;
        // On recalcule la taille proportionnellement
      dH = parseInt((h * dW) / w, 10);
    }
  }
  // On ecrit l'image dans le document
  document.writeln("<img src=\"" + inImg  + "\" width=\"" + dW + "\" height=\"" + dH + "\" border=\"0\">");
};


function delmoi(theForm)
{
var sel = confirm('Êtes-vous sûr de supprimer la sélection ?');
	if (sel) 
	{
	theForm.submit();
	}
}

     function addBookmark(title,url) {
                         if (window.sidebar) {
                              window.sidebar.addPanel(title, url,"");
                         } else if( document.all ) {
                              window.external.AddFavorite( url, title);
                         } else if( window.opera && window.print ) {
                              return true;
                         }
                    }
					
					