function mainmenu(){
$(".header-menu1 ul").css({display: "none"}); // Opera Fix
$(".header-menu1 li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown("normal", function () { $(this).parent().addClass("open")});
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 $(document).ready(function(){					
	mainmenu();
});
 


$(document).ready(function(){
    $(".oldnews ul.submenu:not('.open_at_load')").hide();

    $(".oldnews li.toggleoldnews span").each(function(){
        var TexteSpan = $(this).text();
        $(this).replaceWith('<a class="title" href="" title="Afficher les archives">' + TexteSpan + '<\/a>'); 
    });

    $(".oldnews li.toggleoldnews > a").click(function(){ 
        if ($(this).next("ul.submenu:visible").length != 0){
            $(this).next("ul.submenu").slideUp("normal", function () { $(this).parent().removeClass("open")});
        }
        else {
            $(this).next("ul.submenu").slideDown("normal", function () { $(this).parent().addClass("open")});
        }
        return false;
    });
 
});



$(document).ready(function(){
    $(".promotion-submenu ul.submenu:not('.open_at_load')").hide();

    $(".promotion-submenu li.togglesubmenu span").each(function(){
        var TexteSpan = $(this).text();
        $(this).replaceWith('<a href="" title="Afficher la promotion">' + TexteSpan + '<\/a>'); 
    });

    $(".promotion-submenu li.togglesubmenu > a").click(function(){ 
        if ($(this).next("ul.submenu:visible").length != 0){
            $(this).next("ul.submenu").slideUp("normal", function () { $(this).parent().removeClass("open")});
        }
        else {
            $(".promotion-submenu ul.submenu").slideUp("normal", function () { $(this).parent().removeClass("open")});
            $(this).next("ul.submenu").slideDown("normal", function () { $(this).parent().addClass("open")});
        }
        return false;
    });
 
});



$(document).ready(function(){
    $(".diplome-submenu ul.submenu:not('.open_at_load')").hide();

    $(".diplome-submenu li.togglesubmenu span").each(function(){
        var TexteSpan = $(this).text();
        $(this).replaceWith('<a href="" title="Afficher la r&eacute;ponse">' + TexteSpan + '<\/a>'); 
    });

    $(".diplome-submenu li.togglesubmenu > a").click(function(){ 
        if ($(this).next("ul.submenu:visible").length != 0){
            $(this).next("ul.submenu").slideUp("normal", function () { $(this).parent().removeClass("open")});
        }
        else {
            $(this).next("ul.submenu").slideDown("normal", function () { $(this).parent().addClass("open")});
        }
        return false;
    });
 
});
