texte = new Array
lien = new Array
w = new Array
hasSub = new Array
var currentSub = ""

texte[0] = "Présentation"; lien[0] = "presentation.php"; w[0] = 124; hasSub[0] = false;
texte[1] = "Produits"; lien[1] = "consommable_medical.php"; w[1] = 124; hasSub[1] = true;
texte[2] = "Recrutement"; lien[2] = "recrutement.php"; w[2] = 124;hasSub[2] = false;
texte[3] = "Contact"; lien[3] = "contact.php"; w[3] = 124;hasSub[3] = false;




// chargement de la puce dans le cache
rnd_off = new Image();
rnd_on = new Image();
rnd_off.src = "img/puce1.gif"
rnd_on.src = "img/puce2.gif"




function goSelect()
{
	source = event.srcElement;
	while (source.tagName != "TD") { source = source.parentElement; }
	source.style.backgroundColor='#808080';

	

}
function goSelect1()
{
	source = event.srcElement;
	while (source.tagName != "TABLE") { source = source.parentElement; }
	source.style.backgroundColor='#808080';
	source.className = 'table04';
	

}
function goUnselect1()
{
	source = event.srcElement;
	while (source.tagName != "TABLE") { source = source.parentElement; }
	source.className='table0';
	source.style.backgroundColor='#004792';
}

function goUnselect()
{
	source = event.srcElement;
	while (source.tagName != "TD") { source = source.parentElement; }
	source.style.backgroundColor='#004792';

}

function goHideAllSub()
{
	sub1.style.visibility = "hidden";
}
function goShowSub(obj)
{
	obj.style.visibility = "visible";
}
function goHideSub(obj)
{
	pause = 5000
	currentSub = obj.id
	timer= setTimeout('goHideSub_timedOut('+currentSub+')',pause)
}
function goHideSub_timedOut(obj)
{
	obj.style.visibility = "hidden";
}

function goLed(obj)
{
//	goHideSub_timedOut(sub2); goHideSub_timedOut(sub6); 
	obj.src = rnd_on.src //"img/rnd3.gif";
}
function goUnLed(obj)
{
	obj.src = rnd_off.src //"img/rnd2.gif";
}

function go(obj)
{
	window.location = obj 
}


// générer les 3 sous-menus

submenu1 = '<div id=sub1 style=\"position: absolute; z-index: 50; top: 238; left: 147; visibility: hidden\"><table style="cursor: pointer;"  cellpadding=0 cellspacing=0 border=0 bgcolor=#004792 	width =  190px><tr><td height=28 onmouseover="javascript:this.style.background= \'#808080\';" onmouseout="javascript:this.style.background= \'#004792\';" onclick="go(\'consommable_medical.php\')" class=table3><a class=l2 href=consommable_medical.php>Consommable médical</a></td></tr><tr><td  onclick="go(\'consommable_de_laboratoire.php\')" height=28  class=table3 onmouseover="javascript:this.style.background= \'#808080\';" onmouseout="javascript:this.style.background= \'#004792\';"><a class=l2 href=consommable_de_laboratoire.php>Consommable de laboratoire</a></td></tr><tr><td onclick="go(\'articles_de_pansement.php\')" height=28  class=table4 onmouseover="javascript:this.style.background= \'#808080\';" onmouseout="javascript:this.style.background= \'#004792\';"><a class=l2 href=articles_de_pansement.php>Articles de pansement</a></td></tr></table></div>';


function affiche_menu()
{

for (i=0; i < texte.length; i++) { 
	if (texte[i] != "no") 
	{
		if (hasSub[i] == true) { overplus = '; goHideAllSub(); goShowSub(sub'+i+')'; outplus = '; goHideSub(sub'+i+')' } else { overplus = '; goHideAllSub()'; outplus = '' }
		
		document.write('<table border=0 cellpadding=0 cellspacing=0 width='+w[i]+' onmouseover="javascript:this.style.background= \'#808080\';this.style.border= \'solid\';this.style.borderColor= \'#FFFFFF\';this.style.borderWidth= \'1px\';goLed(im'+i+')'+overplus+'" onmouseout="javascript:this.style.background= \'#004792\';this.style.border= \'solid\';this.style.borderColor= \'#FFFFFF\';this.style.borderTop= \'none\';this.style.borderBottom= \'none\';this.style.borderLeft= \'none\';this.style.borderWidth= \'1px\';goUnLed(im'+i+')'+outplus+'" ><tr valign=baseline><td  height=27 valign=middle width=20 ><img name=im'+i+' src="img/puce1.gif" width="20" height="27" border=0 alt=""></td><td style="cursor: pointer;" class=table2 valign=middle height=27 onclick="go(lien['+i+'])"><p style=\'padding-left: 10;\'><a class=l2 href='+lien[i]+' onmouseover="goLed(im'+i+')'+overplus+'" onmouseout="goUnLed(im'+i+')'+outplus+'">'+texte[i]+'&nbsp;</a></td></td></tr></table>')
	}
	else 
	{
		document.write('<table border=0 cellpadding=0 cellspacing=0><tr valign=baseline><td class=table3>&nbsp;</td></tr></table>')
	}

}
}












