   function ouvrir_menu(url)
 {
  
    
    var heightMax=580;
     var widthMax=800;
     
      monImage = new Image;
      monImage.src = url;
      var tailleW = monImage.width
      var tailleH = monImage.height 
      if(tailleH >heightMax)
      {      
        tailleW=tailleW /(tailleH/heightMax);
        tailleH=heightMax;
      } 
      if(tailleW >widthMax)
      {      
        tailleH=tailleH /(tailleW/widthMax);
        tailleW=widthMax;
      } 
   
    
   // alert(position_x +" - " +position_y);
    document.getElementById("menuimg").src=url;
    document.getElementById("menuimg").width = tailleW;
    document.getElementById("menuimg").height = tailleH;
    document.getElementById("menu_context").style.width = tailleW;
    document.getElementById("menu_context").style.height = tailleH;
    document.getElementById("menu_context").style.display = "block";
    var position_x = (document.body.clientWidth -tailleW )/2 ;
    var position_y = (document.body.scrollTop+00) ;
    document.getElementById("menu_context").style.top = position_y;
    document.getElementById("menu_context").style.left = position_x;
    
      //deactiv_pop = setTimeout("fermer_menu()",30000)
  }
   function fermer_menu()
  {
    
    document.getElementById("menu_context").style.display = "none";
  //activ_pop = setTimeout("ouvrir_menu()",30000)
  }
  function initImage() 
{
  imageId = 'thephoto';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}
function spanload(nom)
{
   document.getElementById(nom).style.background='white no-repeat top center';
  
}
function setOpacity(obj, opacity) 
{
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) 
{
  
  if (document.getElementById)
  {
    obj = document.getElementById(objId);
    if (opacity <= 100)
    {
      setOpacity(obj, opacity);
      opacity += 5;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 10);
    }
  }
}
function fadeOut(objId,opacity,opacity2) 
{
  if(opacity2==undefined)
  {
    opacity2=30;
  }
  

  if (document.getElementById)
  {
    obj = document.getElementById(objId);
    if (opacity >= opacity2)
    {
      setOpacity(obj, opacity);
      opacity += -10;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+","+opacity2+")", 10);
    }
  }
}
function PlaySound(soundobj)
{
 var thissound= eval("document."+soundobj);
 thissound.Play();
}
function StopSound(soundobj)
{
 var thissound= eval("document."+soundobj);
 thissound.Stop();
}

 
  function tailleimg(id,url)
  {
     var heightMax=170;
     var widthMax=170;
     
      monImage = new Image;
      monImage.src = document.getElementById(id).src;
      var tailleW = monImage.width
      var tailleH = monImage.height 
      if(tailleH >heightMax)
      {      
        tailleW=tailleW /(tailleH/heightMax);
        tailleH=heightMax;
      } 
      if(tailleW >widthMax)
      {      
        tailleH=tailleH /(tailleW/widthMax);
        tailleW=widthMax;
      } 
     
     
      
     // alert(position_x +" - " +position_y);
      //document.getElementById(id).src=url;
      document.getElementById(id).width = tailleW;
      document.getElementById(id).height = tailleH;
     
  }
  
  function showorhide(id)
  {
    if(document.getElementById(id).style.display=="none")
      document.getElementById(id).style.display="block";
    else  
      document.getElementById(id).style.display="none";
  }
  function changeImg(obj,obj2,url,txt)
  {
  //alert(txt);
    document.getElementById(obj).src="../admin/"+url;
    //document.getElementById(obj2).innertext=txt;
  }
