/*
 * JS MENU
 */

function setHandler_Desc(tabLiens)
{
	if (tabLiens)	for (var i=0; i<tabLiens.length; i++)
	{
		// attribution d'un handler
		tabLiens[i].onmouseover=function () {
			var o=document.getElementById("myDesc");
			if (o && ""!=this.title) {
				this.descOldInnerHTML=o.innerHTML;
				o.innerHTML=this.descOldTitle=this.title;
				o.innerHTML='<span style="font-size:80%">'+o.innerHTML+'</span>';
				this.title='';
				o.style.backgroundColor='#E65C5C'; //'#ffc';
				o.style.color='#000';
				o.style.textAlign='center';
				o.style.padding='0 1px';
				this.oldDescBorderColor=o.style.borderColor;
				this.myTitle=true; // OK
				o.style.borderColor='#000';
			}
		};
		tabLiens[i].onmouseout=function () {
			var o=document.getElementById("myDesc");
			if (o && this.myTitle) {
				o.innerHTML=this.descOldInnerHTML;
				// restauration du style
				o.style.backgroundColor='';
				o.style.color='';
				o.style.textAlign='';
				o.style.borderColor=this.oldDescBorderColor;
				// et du title
				this.title=this.descOldTitle;
			}
		};
	}
}
function gereInfobullesMenu()
{
	setHandler_Desc(document.getElementById("entete_links").getElementsByTagName("A"));
	setHandler_Desc(document.getElementById("menu-h").getElementsByTagName("A"));
}

/*
 * function outDebug(str)
 * {
 * 	var outD=document.getElementById("outdebug"),o1,o2,h=new Date();
 * 	if (o1=outD.getElementsByTagName("LEGEND")) o1[0].innerHTML="Debug output @ "+h.toLocaleTimeString()+" [<a href=\"#\" onclick=\"return clearDebug();\">effacer</a>]";
 * 	if (o2=outD.getElementsByTagName("SPAN")) o2[0].innerHTML+="<br>"+str.toString();
 * }
 * function clearDebug()
 * {
 * 	var outD=document.getElementById("outdebug"),o2;
 * 	if (o2=outD.getElementsByTagName("SPAN")) o2[0].innerHTML="<br>";
 * 	return false;
 * }
 */
 
// ONLOAD
if (window.addEventListener)
{
	window.addEventListener('load', gereInfobullesMenu, false);
}
if (window.attachEvent)
{
	window.attachEvent('onload', gereInfobullesMenu);
}