function is_scroll(){
var cw, iw, ow;
var d=document;
//clientWidth
if (d.dElement&&d.dElement.clientWidth)
cw=d.dElement.clientWidth;
if (d.body&&d.body.clientWidth)
cw=d.body.clientWidth;
// firefox, mozilla, netscape
if (window.innerWidth){
iw=window.innerWidth;
if (iw!=cw){
return true;
}else{
return false;
}
}else{
// IE
// offsetWidth
if (d.dElement&&d.dElement.offsetWidth)
ow=d.dElement.offsetWidth;
if (d.body&&d.body.offsetWidth)
ow=d.body.offsetWidth;
if (ow!=cw){
return true;
}else{
return false;
}
}
}



var colonnes=new Array("colonne_1","colonne_2","colonne_3");
var cat_to_colonne=new Array("none","colonne_1","colonne_2","colonne_3");
var res_colonnes;
var old_col_style;
function hover_colonnes(save)
{

res_colonnes=new Array();
  for(i=0;i<3;i++)
  {
    if(save)
       res_colonnes[i]=document.getElementById(colonnes[i]).className;
    else
      res_colonnes[i]=colonnes[i];
    document.getElementById(colonnes[i]).className=colonnes[i]+"_hover";
  }
}

function light_colonnes(save)
{

res_colonnes=new Array();
  for(i=0;i<3;i++)
  {
    if(save)
       res_colonnes[i]=document.getElementById(colonnes[i]).className;
    else
      res_colonnes[i]=colonnes[i];
    document.getElementById(colonnes[i]).className=colonnes[i];
  }
}


function restore_colonnes()
{
for(i=0;i<3;i++)
  {
    document.getElementById(colonnes[i]).className= res_colonnes[i];
  }
}

function grey_colonnes()
{
  for(i=0;i<3;i++)
  {
      document.getElementById(colonnes[i]).className=colonnes[i]+"_hors";
  }
}


function open_colonne(col,lang)
{
  grey_statics(lang);
  for(i=0;i<3;i++)
  {
    if(colonnes[i]!=col)
      document.getElementById(colonnes[i]).className=colonnes[i]+"_hors";
  }
  document.getElementById(col).className=col;
  old_col_style=col;
 
}

function over_colonne(col)
{
  old_col_style=document.getElementById(col).className;
  document.getElementById(col).className=col+"_hover";
}
function out_colonne(col)
{
  document.getElementById(col).className=old_col_style;
}
var statics=new Array("definition","laboratoire","partenaire","contact");
var res_statics;
var old_statics_src;
function open_static(id,lang)
{
  grey_colonnes();
  for(i=0;i<statics.length;i++)
  {
    if(statics[i]!=id)
      document.getElementById(statics[i]).src="images/"+statics[i]+"_hors"+lang+".jpg";
  }
  old_statics_src="images/"+id+lang+".jpg";
}

function over_static(stat,lang)
{
  old_statics_src=document.getElementById(stat).src;
  document.getElementById(stat).src="images/"+stat+"_hover"+lang+".jpg";
}
function out_static(stat,lang)
{
  document.getElementById(stat).src=old_statics_src;
}
function grey_statics(lang)
{
  //if(lang=="undefined")
    lang=document.getElementById('lang_hidden').value;
  for(i=0;i<statics.length;i++)
  {
      document.getElementById(statics[i]).src="images/"+statics[i]+"_hors"+lang+".jpg";
  }
}
function light_statics(lang)
{
  for(i=0;i<statics.length;i++)
  {
      document.getElementById(statics[i]).src="images/"+statics[i]+lang+".jpg";
  }
}

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];} 
  }
   
// Global variable
function initialisation()
{
      //  Nom_Browser = navigator.appName;
       //        Version_Browser = navigator.appVersion;
           
          if((navigator.appName.indexOf('Microsoft Internet Explorer')==-1)|(navigator.appCodeName.indexOf("Macintosh")==-1)) 
          {  
            if (!window.opera)    
              update_main_height();
            if (window.opera) 
            {
              d.FormName.WidthMinusScrollbar.value = window.innerWidth;
              d.FormName.HeightMinusScrollbar.value = window.innerHeight; 
            }
            else if (document.layers) 
            {
              window.captureEvents(Event.RESIZE) ; 
              window.onresize = update_main_height ; 
            }
            else if (document.all) 
              window.onresize = update_main_height ; 
            else if (window.addEventListener) 
            { 
              window.addEventListener("resize" , update_main_height , false) ; 
            } 
          }
//           else
//             alert('merde'); 
}

function bandeauEntree()
{
	// affiche un bandeau au chargement du site pour annoncer un événement en particulier
	if(false)
		show_img_fullscreen("bandeau.png",649,173);
}
 
function WindowHasBeenResized () 
{ 
    // if(is_scroll()) 
    //   document.getElementById('marge').innerHTML="<img src='images/fond.gif' width='15' border='0'>";
    // else
    //   document.getElementById('marge').innerHTML="";
    var w=get_w();
    // if(window.name=='menu')
    //  alert(w);
    if(isNaN(w))
    {
    
           w=get_w();
    //     if(window.name=='menu')
    //     {
    //       w=window.parent.contenu.document.get_w();
    //       alert('new w : '+w);
    //     }
    //     if(isNaN(w))
    //     {
    //
    //           window.location.reload();
    //    }

    }
    else
    {
    //alert(w);
    document.getElementById('marge').setAttribute('width',w);
    document.getElementById('marge').innerHTML="<img src='images/fond.gif'  height='1' width='"+w+"' border='0'>";
    if(window.name=='contenu')
    {
      w=w-1;
      window.parent.menu.document.getElementById('marge').setAttribute('width',w);
      window.parent.menu.document.getElementById('marge').innerHTML="<img src='images/fond.gif' width='"+w+"' height='1' border='0'>";
    }
    //document.getElementById('w').value=w;
    }
    
    }
    
    function get_w()
    {
    var cw, iw, ow,w;
    var d=document;
    //clientWidth
    if (d.dElement&&d.dElement.clientWidth)
      cw=d.dElement.clientWidth;
    if (d.body&&d.body.clientWidth)
      cw=d.body.clientWidth;
    // firefox, mozilla, netscape
    if (window.innerWidth){
      iw=window.innerWidth;
    if (iw!=cw){
      w=iw;
    }else{
      w=cw;
    }
    }else{
    // IE
    // offsetWidth
      if (d.dElement&&d.dElement.offsetWidth)
        ow=d.dElement.offsetWidth;
      if (d.body&&d.body.offsetWidth)
        ow=d.body.offsetWidth;
      if (ow!=cw){
        w=ow;
    }else{
      w=cw;
    }
    }
    //alert('cw '+cw+' iw:'+iw+' ow:'+ow);
    if((window.name=='menu'))// & (navigator.appName=='Netscape'))
    {
    
    //   //alert(' w:'+w);
    return w-1;
    }else
    return w;
    }
    
    function get_h()
    {
    var ch, ih, oh,h;
    var d=document;
    //clientWidth
    if (d.dElement&&d.dElement.clientHeight)
      ch=d.dElement.clientHeight;
    if (d.body&&d.body.clientHeight)
      ch=d.body.clientHeight;
    // firefox, mozilla, netscape
    if (window.innerHeight){
      ih=window.innerHeight;
    if (ih!=ch){
      h=ih;
    }else{
      h=ch;
    }
    }else{
    // IE
    // offsetHeight
      if (d.dElement&&d.dElement.offsetHeight)
        oh=d.dElement.offsetHeight;
      if (d.body&&d.body.offsetHeight)
        oh=d.body.offsetHeight;
      if (oh!=ch){
        h=oh;
    }else{
      h=ch;
    }
    }
   return h;
    }

function update_main_height()
{
 // alert (document.getElementById('menu').offsetHeight+" "+document.getElementById('menu').offsetTop);
 // alert(get_h());
 h=get_h()-document.getElementById('menu').offsetHeight-document.getElementById('menu').offsetTop-30;
  document.getElementById('content').style.height=h+"px";
   //mise à jour hauteur main
//   var h=document.getElementById('content').offsetHeight+document.getElementById('content').offsetTop;
//   if(h>document.getElementById('main').offsetHeight)
//   {
//       h=h+50;
//       document.getElementById('main').style.height=h+"px";
//   }
}

function show_img_fullscreen(img,w,h)
{
  var fond=document.getElementById('jesersarien');
  var image=document.getElementById('full_creen_img');
  //alert(get_w());
  if(w>(get_w()-50))
  {  
    var wn=get_w()-200;
     h=wn*h/w;
     w=wn;
  }
  if(h>(get_h()-50))
  {  
    var hn=get_h()-200;
     w=hn*w/h;
     h=hn;
  }
  
  image.style.width=w+"px";
  image.style.height=h+"px";
  w2=-1*w/2;
  h2=-1*h/2;
  image.style.marginTop=h2+"px";
  image.style.marginLeft=w2+"px";
  
 

  //   margin-top: -135px; /* moitié de la hauteur */
   //  margin-left: -135px; /* moitié de la largeur */
  image.innerHTML="<img src='image.php?file="+img+"&w="+w+"' >";
  fond.style.display='block';
  image.style.display='block';  
  
}

function hide_img_fullscreen()
{
  var fond=document.getElementById('jesersarien');
  var image=document.getElementById('full_creen_img');
  image.style.display="none";
  fond.style.display="none";
}

function change_langue(lang)
{
  var page = document.getElementById('called_page').value;
  //var args = document.getElementById('called_args').value;
  page_element=page.split('_');
  
  var last = page_element[page_element.length-1];
  if(last=='en'||last=='fr')
  //si il y a déjà une langue on la remplace
    page_element[page_element.length-1]=lang;
  else
  //sinon on l'ajoute
    page_element[page_element.length]=lang;
    page=page_element.join('_');
  document.location=page;
  return false;
}

function content_focus()
{
  document.getElementById('content').focus();
    document.getElementById('content').blur();
}

function jump_to(id)
{
  document.getElementById(id).focus();
    document.getElementById(id).blur();
}




