var ie = /MSIE/.test(navigator.userAgent);

function hover(obj) {
  if (ie) {
    UL = obj.getElementsByTagName('ul');
    if (UL.length > 0) {
      sousMenu = UL[0].style;
      sousMenu.display = 'block';
    }
  }
}

function out(obj) {
  if (ie) {
    UL = obj.getElementsByTagName('ul');
    if(UL.length > 0) {
      sousMenu = UL[0].style;
      sousMenu.display = 'none';
    }
  }
}


function setHover() {
  if (ie) {
	LI = document.getElementById('menu').getElementsByTagName('li');
	for(i=0; i < LI.length; i++) {
		LI[i].onmouseover = function() { hover(this) };
		LI[i].onmouseout = function() { out(this) };
	}
  }
}

//window.onload = function() { setHover() };

dojo.addOnLoad(function(){
	if(!dojo.isIE)
		return;

	dojo.query("#menu li").connect("onmouseover", function(){
		var nlUl = dojo.query("> ul:first-of-type", this);
		if(nlUl.length == 0)
			return;
			
		var ul = nlUl[0];
		var largeur = dojo.style(ul, "width");
		
		dojo.style(ul, "display", "block");
		dojo.style(ul, "width", largeur + "px");
		
	}).connect("onmouseout", function(){
		dojo.query("> ul:first-of-type", this).style("display", "none");
	});

});
