﻿//$("#CenterConsoleMenu .slide").click(function () {
//    // Close dropdown when clicking on an active pulldown
//    if ($(this).parent(".active").length > 0) {
//        $("#CenterConsoleMenu .dropDown").fadeOut();
//        $(this).removeClass("active");
//        $(this).parent().removeClass("active");

//        return false;
//    }

//    // Close any open dropdown 
//    if ($("#CenterConsoleMenu .active").length > 0) {
//        $("#CenterConsoleMenu .active").removeClass("active");
//        $("#CenterConsoleMenu .dropDown").fadeOut();

//        var tmp = this;
//        setTimeout(function () { openConsoleDropDown(tmp) }, 200);
//        return false;
//    }

//    openConsoleDropDown(this);
//    return false;
//})

//$("#CenterConsoleMenu .dropDown .close").click(function () {
//    $("#CenterConsoleMenu .active").removeClass("active");
//    $("#CenterConsoleMenu .dropDown").hide();
//})

//$("#CenterConsoleMenu .dropDown").mouseleave(function () {
//    $("#CenterConsoleMenu .active").removeClass("active");
//    $("#CenterConsoleMenu .dropDown").fadeOut();
//})

/**************************************************************************************
***** Global Menu                                                                ******
**************************************************************************************/
//function openDropDown(dropDown) {
//    if (dropDown.is(".active"))
//        jQuery(".dropDownFocus").removeClass("active");
//    else {
//        jQuery(".dropDownFocus").removeClass("active");
//        dropDown.children(".indent").width(dropDown.width());
//        dropDown.addClass("active");
//    }
//}

//PortalNavigationInit = function () {
//    jQuery(".dropDownFocus a[href='#']").click(function () {
//        openDropDown(jQuery(this).closest(".dropDownFocus"));
//        return false;
//    })

//    jQuery("#GlobalMenu a.home").mouseover(function () {
//        jQuery(".dropDownFocus").removeClass("active");
//        return false;
//    })

//    // DropDown (Global Menu) Toggle
//    jQuery("#GlobalMenu .dropDownFocus a").mouseover(function () {
//        if (!jQuery(this).closest(".dropDownFocus").is(".active"))
//            openDropDown(jQuery(this).closest(".dropDownFocus"));
//        return false;
//    })

//    // DropDown Close Button
//    jQuery(".dropDown .close").click(function () {
//        jQuery(this).closest(".dropDownFocus").removeClass("active");
//        return false;
//    })

//};

PortalNavigationUserPanel = function (name) {
    if (name.length < 1) return;
    if (jQuery("#UserInfo").length > 0)
        jQuery("#UserInfo").html(name).attr("title", name);
    jQuery("#WelcomePnl").show();
    jQuery("#Login").hide();
}
