/* nav menu */
jQuery(function(){
    jQuery("#"+Cur).attr("class", Cur+"_selected" )
    jQuery(".nav > ul > li").hover(function(){
        var id = $(this).attr("id");
        if(Cur!=id){
            $(this).attr("class" , id+"_cur");
        }
    },function(){
        var id = $(this).attr("id");
        if(Cur!=id){
            $(this).attr("class" , id);
        }
    });
});
/* subject menu */

jQuery(function(){
    jQuery(".subject_menus > li").hover(function(){
        $(this).attr("class" , "mouseoverStyle");
    },function(){
        $(this).attr("class" , "mouseoutStyle");
    });
    var f = [["Software", "subject_Software"],["Knowledge","subject_Knowledge"],["Support","subject_Support"]];
    for (var n = 0; n < f.length; n++) {
        subject_menu(f[n][0], f[n][1]);
    }
});
/* subject menu set function. */
function subject_menu(id, showid){
    jQuery("#" + id).hover(function(){
        jQuery("#" + showid).show();
    }, function(){
        jQuery("#" + showid).hide();
    });
    jQuery("#" + showid).mouseenter(function(){
        jQuery(this).show();
    });
    jQuery("#" + showid).mouseleave(function(){
        jQuery(this).hide();
    });
}

/* banner set */
jQuery(function(){
    var len = jQuery(".banner_key").children("li").length;
    var index = 1;
    var t = 3000;
    var ints;
    function showSys(num){
        for (var i = 1; i <= len; i++) {
            if (num == i) {
                jQuery(".banner_" + i).fadeIn(600);
                jQuery("#show_" + i).attr("class", "onli");
            }
            else {
                jQuery(".banner_" + i).hide();
                jQuery("#show_" + i).attr("class", "li");
            }
        }
    }
    function ziDong(){
        if (index > len) {
            index = 1;
        }
        showSys(index);
        index++;
    }
    
    ints = setInterval(ziDong, t);
    
    jQuery(".banner_key > li").click(function(){
        var index_num = parseInt(jQuery(this).html());
        showSys(index_num);
        index = index_num + 1;
    });
    
    jQuery(".banner_key > li").mouseover(function(){
        clearInterval(ints);
    });
    jQuery(".banner_key > li").mouseout(function(){
        ints = setInterval(ziDong, t);
    }); 
});

