function joinSwich(obj,flag){// 人才招聘
    if(obj.hasClass('on')){
        obj.removeClass('on');
        obj.siblings('.content').eq(flag).find('.it').slideUp();
    }else{
        obj.addClass('on').siblings('.slide').removeClass('on');
        obj.siblings('.content').find('.it').slideUp();
        obj.siblings('.content').eq(flag).find('.it').slideDown();
    }
}
//二级下拉
$('#header .have-two .one').hover(function() {
    var height2 = $(this).parent().find('.h1').height();
    $(this).parent().find('.two').height(height2+30);
}, function() {
});
$('#header .have-two').hover(function() {
}, function() {
    $(this).find('.two').height(0);
});


//二级导航-面包屑
if ($('#bread_top').length) {
var breadSwiper = new Swiper('#bread_top',{
    slidesPerView : 'auto',
    slidesPerGroup: 1,
    autoHeight: true,
    autoplay: false,
    speed:1500,
    spaceBetween: 120,
    breakpoints:{
        1050:{
            spaceBetween: 80,
        },
        750:{
            spaceBetween: 40,
        },
        650:{
            spaceBetween: 30,
        }
    },
    navigation: {
      nextEl: '#bread_top .swiper-button-next',
      prevEl: '#bread_top .swiper-button-prev',
    },
});
}
// 首页-服务项目
if ($('#ind_project').length) {
    var projectSwiper = new Swiper('#ind_project',{
        slidesPerView : 'auto',
        slidesPerGroup: 1,
        autoHeight: true,
        autoplay: false,
        speed:1500,
        breakpoints:{
            850:{
                slidesPerView : 3,
                pagination: {
                    el: '#ind_project .swiper-pagination',
                    clickable:true,
                },
            },
            650:{
                slidesPerView : 2,
                pagination: {
                    el: '#ind_project .swiper-pagination',
                    clickable:true,
                },
            },
            410:{
                slidesPerView : 1,
                pagination: {
                    el: '#ind_project .swiper-pagination',
                    clickable:true,
                },
                spaceBetween: 5,
            }
        },
    });
    $(document).ready(function(){
        var SlideHeight = $('#ind_project .swiper-slide .block').height();
        $('#ind_project .swiper-slide').height(SlideHeight);
    });
    $('#ind_project .swiper-slide').hover(function(){
        var SlideHeight2 = $(this).height();
        $(this).siblings().find('.p').addClass('pt');
        $(this).find('.p').css({'height':SlideHeight2, 'padding-top': 0});
        $(this).find('.p').removeClass('pt');
        $(this).addClass('on-slide').siblings().removeClass('on-slide');

    });
}
//首页播放视频
$('.ind-about .video').click(function(){
    var src=$(this).attr('v-src');
    var w_w = $(window).width();
    if (w_w>1200) {
        $.alert({
            iframe:"/api/video?src="+src,
            wh:[1200,720],
        });
    }else if (w_w>750) {
        $.alert({
            iframe:"/api/video?src="+src,
            wh:[1200,720],
        });
    }else{
        $.alert({
            iframe:"/api/video?src="+src,
            wh:[1200,300],
        });
    }
});

// 首页-典型案例
if ($('#ind_case').length) {
    var projectSwiper = new Swiper('#ind_case',{
        slidesPerView : 3,
        slidesPerGroup: 1,
        spaceBetween: 41,
        autoHeight: true,
        autoplay: false,
        speed:1500,
        breakpoints:{
            1050:{
                spaceBetween: 25,
            },
            768:{
                spaceBetween: 20,
            },
            750:{
                spaceBetween: 15,
            },
            650:{
                slidesPerView : 2,
                spaceBetween: 15,
                pagination: {
                    el: '#ind_case .swiper-pagination',
                    clickable:true,
                },
            }
        }
    });
}
// 首页-新闻
if ($('#ind_news').length) {
    var newsSwiper = new Swiper('#ind_news',{
        slidesPerView : 3,
        spaceBetween: 20,
        slidesPerGroup: 1,
        autoHeight: true,
        autoplay: false,
        speed:1500,
        breakpoints:{
            750:{
                spaceBetween: 15,
            },
            650:{
                slidesPerView : 2,
                spaceBetween: 15,
                pagination: {
                    el: '#ind_news .swiper-pagination',
                    clickable:true,
                },
            }
        },
    });
}

$(function(){
    $('a[href*=#],area[href*=#]').click(function() {
        if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//, '')&&location.hostname==this.hostname){
            var $target=$(this.hash);
            $target=$target.length && $target || $('[name=' + this.hash.slice(1) + ']');
            if($target.length){
                var targetOffset=$target.offset().top;
                $('html,body').animate({scrollTop: targetOffset},500);
                return false;
            }
        }
    });
});

// 典型案例
$(document).ready(function(){
    var w_w = $(window).width();
    if (w_w<1381 && w_w>769) {
        var len = $('#main .case-list .item').length;
        for (var case1 = 0; case1 < len; case1++) {
           var boxbig = $('#main .case-list .item').eq(case1).find('.pic-box').height();
           $('#main .case-list .item').eq(case1).find('.info').height(boxbig);
        };
    }
    
});