$(document).ready(function(){
	/*= GESTION DU MENU TOP*/
	var menuTop = $("#menuTop");
	/*cache tout les ul de menutop	*/
	menuTop.find("ul").hide();

	/* ajoute la fonctionnalité de montrer/cacher les sous-menus*/
	menuTop.find("li:not(.selected):has(ul)").hover(function(){
		/* gére le décallage des blocs */
		var offset;
		if ($(this).children().next().attr("class") == "titre") {
			mySrc = $(this).children().children().attr("src");
			if(mySrc.indexOf(".jpg") != -1)
				offset = mySrc.substring(mySrc.search("_")+1,mySrc.search(".jpg"));
			$(this).attr({style: "background: #E67B13 url('images/menuTxt_"+offset+".gif')  no-repeat 2px 52px;"});
			/*if (offset < 7)
				$(this).children().children().attr({ style: "left:"+((offset-1)*60)+"px;"});
			else
				$(this).children().children().attr({ style: "right:"+ ((12-(offset-1))*60-380)+"px;"});
				/*$(this).children().children().attr({ style: "left:"+((offset-1)*60-150)+"px;"});*/
			}

		if ($.browser.msie)
			if($.browser.version == "6.0"){
				$(this).find("ul").attr({ style: "visibility: visible;"});
				}
			else
				$(this).find("ul").show();
		else
			$(this).find("ul").show();
		return false;
		},function(){
			menuTop.find("ul").hide();
			$(this).removeAttr("style");
			return false;
		});

	/*= GESTION DU MENU GAUCHE */
	var menuGauche = $("#menuGauche");
	menuGauche.find("li:not(.selected)").hover(function(){
		mySrc=$(this).children().children().attr("src");
		if(mySrc.indexOf("_over") == -1){
			mySrc = mySrc.substring(mySrc.search("/")+1,mySrc.search(".gif")) + "_over" + ".gif";
			$(this).children().children().attr({src: "images/"+mySrc});
			}
		return false;
		},function(){
		mySrc=$(this).children().children().attr("src");
		if(mySrc.indexOf("_over") != -1){
			mySrc = mySrc.substring(mySrc.search("/")+1,mySrc.search("_over.gif")) + ".gif";
			$(this).children().children().attr({src: "images/"+mySrc});
			}
		return false;
		});
	});


/*ANCIENNE FONCTION */
/*	menuTop.find("li:has(ul)").hover(function(){
			var offset;
		if ($(this).children().next().attr("class") == "titre") {
			mySrc = $(this).children().attr("src");
			$(this).attr({style: "background: #F18E00 url('images/menu_"+offset+"_txt.gif')  no-repeat 139px bottom;"});
			offset = mySrc.substring(mySrc.search("_")+1,mySrc.search(".jpg"));
				if (offset < 7)
					$(this).children().next().attr({ style: "left:"+((offset-1)*60+20)+"px;"});
				else
					$(this).children().next().attr({ style: "left:"+((offset-1)*60-150)+"px;"});
		}
		$(this).children().next().show();
		if ($(this).children().next().attr("class") == "titre") {
			$(this).find("ul.introDroite").attr({ style: "display: none;"});
			$(this).find("ul.introGauche").attr({ style: "display: none;"});
		}
		return false;
		},function(){
		menuTop.find("ul").hide();
		if ($(this).children().next().attr("class") == "titre") {
			$(this).removeAttr("style");
			}
			return false;
		});*/