﻿$(function() {
    $(".ui-tabs-nav > li > a").mouseover(function(e) {
        if (this == e.target) {
            var container = $(this).parent().parent().parent();
            var arrNav = $(this).parent().parent().find("li");
            var index = $.inArray(this, $(this).parent().parent().find("a"));
            var panels = $(this).parent().parent().parent().find(".ui-tabs-panel");
            if (panels.eq(index).is(".ui-tabs-panel")) {
                arrNav.removeClass("ui-tabs-selected").eq(index).addClass("ui-tabs-selected");
                panels.addClass("ui-tabs-hide").eq(index).removeClass("ui-tabs-hide");
            }
        }
    }); //tab切换
});

$.fn.clearSelect = function() {
    return this.each(function() {
        if (this.tagName == 'SELECT')
            this.options.length = 0;
    });
}
$.fn.fillSelect = function(data) {
    return this.clearSelect().each(function() {
        if (this.tagName == 'SELECT') {
            var dropdownList = this;
            $.each(data, function(index, optionData) {
                var option = new Option(optionData.Text, optionData.Value);
                if ($.browser.msie) {
                    dropdownList.add(option);
                }
                else {
                    dropdownList.add(option, null);
                }
            });
        }
    });
}
$(document).ready(function() {
    $(".text").focus(function() {
        $(this).css({ color: "#09c", border: "#FA8932 1px solid" })
    });
    $(".text").blur(function() {
        $(this).css({ color: "#000", border: "#ccc 1px solid" })
    });
    $(".admin").parent().mouseover(function() { $(this).children(".admin").show(); });
    $(".admin").parent().mouseout(function() { $(this).children(".admin").hide(); });
    
});
