//<![CDATA[
	$(function(){
						$('#nav .nav-list>li').hover(function(){
							$(this).addClass('over');
							$(this).find('.sub-nav').fadeIn("slow");
						},function(){
							$(this).removeClass('over');
							$(this).find('.sub-nav').fadeOut("slow");
						})
					});


var t = n = count = 0;
$(function(){
    count = $("#play_list a").size();
    $("#play_list a:not(:first-child)").hide();
    $("#play_text li:first-child").css({"background":"#2f3492",'color':'#fff'});
    $("#play_text li").click(function() {
        var i = $(this).text() - 1;
        n = i;
        if (i >= count) return;
        $("#play_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(2000);
        $(this).css({'background':'#2f3492','color':'#fff'}).siblings().css({"background":"#fff",'color':'#2f3492'});
    });
        $("#play_list").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 8000);});  
    t = setInterval("showAuto()", 3000);
})
function showAuto()
{
    n = n >= (count - 1) ? 0 : n + 1;
    $("#play_text li").eq(n).trigger('click');
}

$(document).ready(function(){

	//Sidebar Accordion Menu:
		
		$(".sub-menu-cnt li ul").hide(); // Hide all sub menus
		$(".sub-menu-cnt li a.selected").parent().find("ul").slideToggle("slow"); // Slide down the current menu item's sub menu
		
		$(".sub-menu-cnt li a.sub-menu-link").click( // When a top menu item is clicked...
			function () {
				$(this).parent().siblings().children("a").removeClass("selected");
				$(this).parent().siblings().removeClass("current");
				$(this).parent().addClass("current");
				//$(this).parent().toggleClass("current");
				//$(this).toggleClass("selected");
				$(this).addClass("selected");
				$(this).parent().siblings().find("ul").slideUp("normal"); // Slide up all sub menus except the one clicked
				$(this).next().slideToggle("normal"); // Slide down the clicked sub menu
				return false;
			}
		);
		
		$(".sub-menu-cnt li a.sub-menu-link").click( // When a menu item with no sub menu is clicked...
			function () {
				window.location.href=(this.href); // Just open the link instead of a sub menu
				return false;
			}
		); 
});


(function($){
$.fn.extend({
        Scroll:function(opt,callback){
                //�����ʼ��
                if(!opt) var opt={};
                var _btnUp = $("."+ opt.up);//Shawphy:���ϰ�ť
                var _btnDown = $("."+ opt.down);//Shawphy:���°�ť
                var timerID;
                var _this=this.eq(0).find("ul:first");
                var     lineH=_this.find("li:first").height(), //��ȡ�и�
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //ÿ�ι���������Ĭ��Ϊһ�������������߶�
                        speed=opt.speed?parseInt(opt.speed,10):500; //�?�ٶȣ���ֵԽ���ٶ�Խ����룩
                        timer=opt.timer //?parseInt(opt.timer,10):3000; //������ʱ���������룩
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                //��������
                var scrollUp=function(){
                        _btnUp.unbind("click",scrollUp); //Shawphy:ȡ�����ϰ�ť�ĺ����
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("li:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                                _btnUp.bind("click",scrollUp); //Shawphy:�����ϰ�ť�ĵ���¼�
                        });
                }
                //Shawphy:���·�ҳ����
                var scrollDown=function(){
                        _btnDown.unbind("click",scrollDown);
                        for(i=1;i<=line;i++){
                                _this.find("li:last").show().prependTo(_this);
                        }
                        _this.css({marginTop:upHeight});
                        _this.animate({
                                marginTop:0
                        },speed,function(){
                                _btnDown.bind("click",scrollDown);
                        });
                }
               //Shawphy:�Զ�����
                var autoPlay = function(){
                        if(timer)timerID = window.setInterval(scrollUp,timer);
                };
                var autoStop = function(){
                        if(timer)window.clearInterval(timerID);
                };
                 //����¼���
                _this.hover(autoStop,autoPlay).mouseout();
                _btnUp.css("cursor","pointer").click( scrollUp ).hover(autoStop,autoPlay);//Shawphy:������������¼���
                _btnDown.css("cursor","pointer").click( scrollDown ).hover(autoStop,autoPlay);
        }      
})
})(jQuery);
$(document).ready(function(){
        $(".notice-rotate-list").Scroll({line:1,speed:1000,timer:10000,down:"rotate-prev",up:"rotate-next"});
});

//]]>
