$(function(){
    if (!$("#ban299").length || $("#ban299 li").length <= 1) {    return false; }
    $("#ban299 ul li:gt(0)").css({"display":"none"});
    var b = $("#ban299"),
        me = $("#ban299 ul"),
        tip = $("#ban299 .tip"),
        t, interval = 2000,
        speed = 1000,
        speed2 = 700,
        n = 0,
        N = me.children("li").length;
        wid = b.children("li").width();
        step = 200,time = 3000;
    if ($("#ban299 .tip").length) {
        var htmlTip = "";
        for (var i = 0; i < N; i++) {
            if (i == 0) {
                htmlTip += "<span class='cur'>"+(i+1)+"</span>";
            } else {
                htmlTip += "<span>"+(i+1)+"</span>";
            }
        }
        tip.html(htmlTip);
    }
    var func = function() {
        if (n >= N - 1) {
            n = 0;
        }else if(n < -1){
            n = N-1;
        }
        else {
            n++;
        }
        me.children("li").eq(n).css({
            "z-index": 2
        }).stop().fadeIn(speed).siblings("li").css({
            "z-index": 1
        }).stop().fadeOut(speed2);
        if ($("#ban299 .tip").length) {
            tip.children("span").eq(n).addClass("cur").siblings("span").removeClass("cur");
        }
    }
    $("#ban299").hover(function(){
        $("#btn_prev,#btn_next").fadeIn()
        },function(){
        $("#btn_prev,#btn_next").fadeOut()
        })
    $dragBln = false;
     $("#btn_prev").click(function(){
          clearInterval(t); 
          n -= 2;
          func();
          t = setInterval(func, time)
      });
      $("#btn_next").click(function(){
          clearInterval(t);
          func();
          t = setInterval(func, time)
      });
      
    tip.children("span").click(function() {
        clearInterval(t);
        n = $(this).index() - 1;
        func();
        t = setInterval(func, interval);
    })
    $("#ban299 ul.list li").mouseenter(function() {
        clearInterval(t);
    }).mouseleave(function() {
        t = setInterval(func, time);
    });
    t = setInterval(func, interval);

    $(".e299 .item").eq(1).addClass("hover");
    $(".e299 .item").hover(function() {
              $(this).addClass("hover").siblings().removeClass("hover");
        },function() {
        }
    );    
    
});
$(".news .news_type li").mouseenter(function() {
        $(this).addClass("cur").siblings().removeClass("cur");
        $(".news .news_con .conbox").eq($(this).index()).addClass("cur").siblings().removeClass(
            "cur");
    })
$(function () {
   $('#qq315 dd').bind({
        'mouseenter': function(){
            if($(this).children('.box').length){
                var _this = $(this).children('.box');
                _this.show().animate({'right': 65}, 200);
            }
        },
        'mouseleave': function(){
            if($(this).children('.box').length){
                var _this = $(this).children('.box');
                _this.hide().animate({'right': 90}, 200);
            }
        }
    });
    $(".top315").click(function () {
        $("body, html").stop().animate({ "scrollTop": 0 });
    });
});

