// Navigateur client
var ns4=document.layers;
var ie4=document.all;
var ns6=document.getElementById&&!document.all;

window.onload=montre;
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 Affiche(nObjet) {
 if(ie4) { // Internet explorer
   eval(nObjet).style.visibility = 'visible' 
 }
 else if(ns4) { // Netscape 4.x
   document.eval(nObjet).visibility = 'show'
	}
 else if(ns6) { // Netscape 6 (mozilla)
   var divns6 = document.getElementsByTagName("div")
   divns6[nObjet].style.visibility = 'visible'
 }
}

function Cache(nObjet) {
 if(ie4) { // Internet explorer
   eval(nObjet).style.visibility = 'hidden' 
 }
 else if(ns4) { // Netscape 4.x
   document.eval(nObjet).visibility = 'hidden'
	}
 else if(ns6) { // Netscape 6 (mozilla)
   var divns6 = document.getElementsByTagName("div")
   divns6[nObjet].style.visibility = 'hidden'
 }
}

//Affiche la fiche de resultats
function Afficher_Fiche(nObjet,nObjet2) {
 if(ie4) { // Internet explorer
   eval(nObjet).style.visibility = 'visible';
    eval(nObjet).style.display = '';
    eval(nObjet2).style.height = '600';
 }
 else if(ns4) { // Netscape 4.x
   document.eval(nObjet).visibility = 'show';
	}
 else if(ns6) { // Netscape 6 (mozilla)
   var divns6 = document.getElementsByTagName("div")
   divns6[nObjet].style.visibility ='visible';
   divns6[nObjet].style.display ='';
 }
}


// fonctions de recherche pour recherche_pro.php
function rechercher_pro() {
      var annu = document.form1.annu.value;
//alert (annu);
    document.location.href = 'recherche_pro.php?annu='+annu;
  }
function rechercher_pro_spec(oList,oAnnu) {
     var spec = oList.value;
     var annu = document.form1.annu.value;
//alert (spec);
    document.location.href = 'recherche_pro.php?annu='+annu+'&spec='+spec;
  }
function rechercher_pro_specf(oList,oAnnu) {
     var specf = oList.value;
     var spec = document.form1.spec.value;
    var annu = document.form1.annu.value;
//alert (specf);
    document.location.href = 'recherche_pro.php?annu='+annu+'&spec='+spec+'&specf='+specf;
  }

// fonctions de recherche pour recherche_soc.php
function rechercher_soc() {
      var annu = document.form1.annu.value;
//alert (annu);
    document.location.href = 'recherche_soc.php?annu='+annu;
  }
function rechercher_soc_spec(oList,oAnnu) {
     var spec = oList.value;
     var annu = document.form1.annu.value;
//alert (spec);
    document.location.href = 'recherche_soc.php?annu='+annu+'&spec='+spec;
  }
function rechercher_soc_specf(oList,oAnnu) {
     var specf = oList.value;
     var spec = document.form1.spec.value;
    var annu = document.form1.annu.value;
//alert (specf);
    document.location.href = 'recherche_soc.php?annu='+annu+'&spec='+spec+'&specf='+specf;
  }

// fonctions de recherche pour recherche_org.php
function rechercher_org() {
      var categ = document.form1.categ.value;
//alert (secteur);
    document.location.href = 'recherche_org.php?categ='+categ;
  }
function rechercher_org_annu() {
      var categ = document.form1.categ.value;
      var annu = document.form1.annu.value;
//alert (annu);
    document.location.href = 'recherche_org.php?categ='+categ+'&annu='+annu;
  }

// fonctions de recherche pour recherche_med.php
function rechercher_med_spec(oList) {
     var spec = oList.value;
     var annu = document.form1.annu.value;
//alert (spec);
    document.location.href = 'recherche_med.php?annu='+annu+'&spec='+spec;
  }
function rechercher_med_specf(oList) {
     var specf = oList.value;
     var spec = document.form1.spec.value;
    var annu = document.form1.annu.value;
      var rech = document.form1.rech.value;
//alert (specf);
    document.location.href = 'recherche_med.php?annu='+annu+'&spec='+spec+'&specf='+specf;
  }

// fonctions de recherche pour recherche_cm.php
function rechercher_cm_spec(oList) {
     var spec = oList.value;
//alert (spec);
    document.location.href = 'recherche_cm.php?spec='+spec;
  }
function rechercher_cm_specf(oList) {
     var specf = oList.value;
     var spec = document.form1.spec.value;
//alert (specf);
    document.location.href = 'recherche_cm.php?spec='+spec+'&specf='+specf;
  }


// redimensionnement de la fenetre
function resizefen()
{
var name = navigator.appName
if (name == "Microsoft Internet Explorer")
{
  if (document.body.clientHeight>300)
  {
    window.resizeTo(160,196)
    document.getElementById("btnsize").src='images/ICONE_DOWN.png'
    document.getElementById("FRAME01").style.visibility='hidden'
    document.getElementById("FRAME01").style.display='none'
  }
  else
  {
    window.resizeTo(160,395)
    document.getElementById("btnsize").src='images/ICONE_UP.png'
    document.getElementById("FRAME01").style.visibility='visible'
    document.getElementById("FRAME01").style.display='block'
  }
}
else
{
  if (window.outerHeight>300)
  {
    window.resizeTo(160,190)
    document.getElementById("BTNSIZE").src='images/ICONE_DOWN.png'
    document.getElementById("FRAME01").style.visibility='hidden'
    document.getElementById("FRAME01").style.display='none'
  }
  else
  {
    window.resizeTo(160,395)
    document.getElementById("BTNSIZE").src='images/ICONE_UP.png'
    document.getElementById("FRAME01").style.visibility='visible'
    document.getElementById("FRAME01").style.display='block'
  }
}
window.focus();
}

// Fonction Popup
function Popup(page,nom,w,h,modsize)
{
  if(modsize==2)
  {
         newwindow=window.open(page,nom,'resizable=1,location=0,toolbar=0,status=0,menubar=0,width='+w+',height='+h+',scrollbars=0')
         newwindow.focus()
  }
  else
  {
         newwindow=window.open(page,nom,'resizable='+modsize+',location=0,toolbar=0,status=0,menubar=0,width='+w+',height='+h+',scrollbars='+modsize)
         newwindow.focus()
  }
return false; 
}

// Open window
function ouvre(page)
{
window.open(page,'Fiche',
'height=600,width=585,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no');
}


// permet de faire des input:focus avec IE
function focus4IE()
{
sfFocus = function() {
	var sfEls = document.getElementsByTagName("INPUT");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" sffocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfFocus);
}
