/* Fonction pour que le menu fonctionne dans les navigateurs 

qui ne supporte pas css2 completement (ie6) */



$(function(){

	brows = navigator.appName.toLowerCase();

	$("#nav li").each(function(){
		if ($('ul',this).length != 0) {
			$(this).addClass("hassub");
			
			
			
			$(this).bind("mouseover",function(){
				$(this).addClass("hover");
				$("ul:first",this).addClass("over");
			})

			//si c'est ie on utilise mouseleave pour eviter le flickering
			if (brows.indexOf("microsoft") != -1 || brows.indexOf("msie") != -1) {
				$(this).bind("mouseleave",function(){
					$(this).removeClass("hover");
					$("ul:first",this).removeClass("over");
				});
			} else {
				$(this).bind("mouseout",function(){
					$(this).removeClass("hover");
					$("ul:first",this).removeClass("over");
				})
			}
		} else {
			//this.onmouseover = function() {	$(this).addClass("hover"); }
			
			//si c'est ie on utilise mouseleave pour eviter le flickering
			if (brows.indexOf("microsoft") != -1 || brows.indexOf("msie") != -1) {
				this.onmouseleave = function() { $(this).removeClass("hover"); }
			} else {
			 	this.onmouseout = function() {	$(this).removeClass("hover"); }
			}
		}
	});		
});
