$(document).ready(function() {

    $(".AspNet-Menu-WC > a").css("color", "white");
    $(".AspNet-Menu-WC-Selected > a").css("color", "white");

    var curBG = $("#MenuRgn").css("backgroundColor");

    if (jQuery.browser.version == "6.0") {
        $(".AspNet-Menu-WC:first > a").hover(
            function() {
                //hover over the link
            },

            function() {
                //out of the link but displaying a menu
                $(this).css("color", curBG);
                $(this).parent().css("backgroundColor", "#FFFFFF");
            }
        )

        $(".AspNet-Menu-WC:first").hover(
            function() {

            },

            function() {
                //out of the menu and the childs
                $(this).find("a").css("color", "white");
                $(this).css("backgroundColor", curBG);
            }
        )
    } else {
        $(".Depth0.AspNet-Menu-WC > a").hover(
            function() {
                //hover over the link
            },

            function() {
                //out of  the link but displaying a menu
                $(this).css("color", curBG);
                $(this).parent().css("backgroundColor", "#FFFFFF");
            }
        )

        $(".Depth0.AspNet-Menu-WC").hover(
            function() {

            },

            function() {
                //out of the menu and the childs
                $(this).find("a").css("color", "white");
                $(this).css("backgroundColor", curBG);
            }
        )
    }
    //center the menu
    var menuTb = $("#MenuRgn > table");

    if (menuTb.length > 0) {
        menuTb.center({
            vertical: true,
            horizontal: false
        });
    }

    //hide the panel if there is no content in it
    var aCheck = $("#SecondMenuRgn .EditorPanel *");
    if (aCheck.length == 0) {
        $("#SecondMenuRgn .PanelWrapper").height("1px");
    }
});
