﻿$(function() {
    $("a").focus(function() {
        $(this).blur();
    });
    
    $(".tabBar_red").each(function(i) {
        var el;
        $(this).children("div").each(function(j) {
            if (j == 0) el = $(this);
            $(this).mouseover(function() {
                el.removeClass("tabBar_red-div-hover");
                el = $(this);
                el.addClass("tabBar_red-div-hover");
            });
        });
    });

    $(".tabBar_blue").each(function(i) {
        var el;
        $(this).children("div").each(function(j) {
            if (j == 0) el = $(this);
            $(this).mouseover(function() {
                el.removeClass("tabBar_blue-div-hover");
                el = $(this);
                el.addClass("tabBar_blue-div-hover");
            });
        });
    });

    $("#mainMenu li").each(function(i) {
        var el = $(this);
        el.mouseover(function() {
            $(this).addClass("menu-li-hover");
        });
        el.mouseout(function() {
            if ($(this).attr("selected") != "true") {
                $(this).removeClass("menu-li-hover");
            }
        });
    });

    $("#RoleSelect").dialog({
        bgiframe: true,
        resizable: false,
        draggable: false,
        width: 350,
        autoOpen: false,
        modal: true,
        buttons: {
            "关闭": function() {
                $("#RoleSelect").dialog('close');
            }
        }
    });

    var pxkc_el = $(".pxkc");
    var pxkc_height = pxkc_el.attr("offsetHeight");
    var pxkc_minHeight = parseInt(pxkc_el.css("min-height"));
    if (pxkc_height < pxkc_minHeight) {
        pxkc_el.css("height", pxkc_minHeight + "px");
    }

    var xxtmenu_selected;
    $(".xxtmenu ul li").each(function(i) {
        $(this).mouseover(function() {
            if (xxtmenu_selected != null)
                xxtmenu_selected.children("ul").css("display", "none");
            $(this).children("ul").css("display", "block");
            xxtmenu_selected = $(this);

            $(this).children("ul").mouseout(function() {
                $(this).css("display", "none");
            });
        });
    });

});
