// JavaScript Document

$(".nav li").hover(function(){
	$(this).find("ul").slideDown("fast");
},function(){
	$(this).find("ul").stop().slideUp("fast");
});

$('#banner').flexslider({
    animation: "slide",
	directionNav:false,
});

$('#news-l-box').flexslider({
    animation: "slide",
	controlNav:false,
	prevText: "",
	nextText: "",
});


if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
	new WOW().init();
};

$('.news-r-tit li').click(
	function(){
		$(this).addClass('click').siblings().removeClass('click');
		$('.news-r-box').eq($(this).index()).show().siblings().hide();
		$('.checkmores').eq($(this).index()).show().siblings().hide();
	}
);

$('#pic-1').flexslider({
    animation: "slide",
    controlNav:false,
    itemWidth: 325,
    itemMargin: 0,
	minItems: 1,
    maxItems: 4,
    prevText: "",
	nextText: "",
	slideshow: false,  
});

$('#pic-2').flexslider({
    animation: "slide",
    controlNav:false,
    itemWidth: 325,
    itemMargin: 0,
	minItems: 1,
    maxItems: 4,
    prevText: "",
	nextText: "",
	slideshow: false,  
});

$('#pic-3').flexslider({
    animation: "slide",
    controlNav:false,
    itemWidth: 325,
    itemMargin: 0,
	minItems: 1,
    maxItems: 4,
    prevText: "",
	nextText: "",
	slideshow: false,  
});

$('.pub_header2 li').click(
	function(){
		$(this).addClass('click').siblings().removeClass('click');
		$('.pic-box').eq($(this).index()).show().siblings().hide();
		$('.pic_a2').eq($(this).index()).show().siblings().hide();
	}
);

$(document).ready(function () {
    $("#back-to-top").hide();
    $(function () {
        $(window).scroll(function () {
            if ($(window).scrollTop() > 100) {
                $("#back-to-top").fadeIn(500);
            }
            else {
                $("#back-to-top").fadeOut(500);
            }
        });
        $("#back-to-top").click(function () {
            $('body,html').animate({ scrollTop: 0 }, 100);
            return false;
        });
    });
});

$('.suggestion').on('click',function(){
	$('.suggestion-box').show();
	});
$('.close').on('click',function(){
	 $('.suggestion-box').hide();

});

var nt = !1;
  $(window).bind("scroll",
    function() {
    var st = $(document).scrollTop();//往下滚的高度
    nt = nt ? nt: $("#nav").offset().top;
    // document.title=st;
    var sel=$("#nav");
    if (nt < st) {
      sel.addClass("nav_fixed");
    } else {
      sel.removeClass("nav_fixed");
    }
  });