/*Swiper Banner*/
if($('.swiper-wrapper .swiper-slide').length<2){$('.swiper-pagination').hide()}
if($('.swiper-wrapper .swiper-slide').length<2){$('.swiper-pagination').hide()}
var mySwiper = new Swiper('.slider_banner',{
	/*effect: 'fade',*/
    speed: 1000,
	loop:true,
	
	autoplay: {
       delay: 3500,
       disableOnInteraction: false,
     },
	 pagination: {
       el: '.slider_banner .swiper-pagination',
       clickable: true,
    },
	navigation: {
        nextEl: '.slider_banner .swiper-button-next',
        prevEl: '.slider_banner .swiper-button-prev',
      },
  });
 
 
var swiper = new Swiper('.items_content', {
	direction: 'vertical',
	  slidesPerView:5,
      spaceBetween: 0,
	  navigation: {
        nextEl: '.btn-next',
        prevEl: '.btn-prev',
      }
    });
if($('.product_items').length>0){
var _this=$('.product_items')
var mySwiper = new Swiper(_this,{
	 slidesPerView:4,
	  spaceBetween:29,
	  pagination: {
       el: _this.find(".pagination"),
	   clickable: true,
		},
	  breakpoints: {
		 414: {
          slidesPerView: 1,
		  spaceBetween:0,
        },
		480: {
          slidesPerView: 2,
        },
        768: {
          slidesPerView:3,
		  spaceBetween:20,
        },
		
      }
    });
}
if($('.image-additional').length>0){
var _this=$('.image-additional')
var mySwiper = new Swiper(_this,{
	 slidesPerView:4,
      spaceBetween:18,
      pagination: {
        el:_this.find('.swiper-pagination') ,
        clickable: true,
      },
	  navigation: {
        nextEl:_this.parents('.product-view').find('.swiper-button-next'),
        prevEl:_this.parents('.product-view').find('.swiper-button-prev'),
      },
	  breakpoints: {
        768: {
          slidesPerView: 2
        },
        480: {
          slidesPerView: 1,
		  spaceBetween:0
        }
      }
    });
}
$(".nav_wrap .head_nav li").each(function(){
	if($(this).find("ul").length>0){
		$(this).addClass("ico")
		}
	})  
tabContainer('.tab-content-wrap','.tab-title','.tab-panel')
function hideMsgPop(){$('.inquiry-pop-bd').fadeOut('fast');$('.pop_task').fadeOut('fast')}
	if($('body .inquiry-form-wrap').length>0){
		var webTop=$('body .inquiry-form-wrap').offset().top-80
		$('.product-btn-wrap .email,.foot_item04 .button,.side_content .side_list .email,.add_email12').click(function(){
			 $("html, body").animate({ scrollTop:webTop }, 1000);
			 $(".ad_prompt").show().delay(3000).hide(300);
			})
		}else{
			$('.product-btn-wrap .email,.foot_item04 .button,.side_content .side_list .email,.add_email12').click(function(){
				$('.inquiry-pop-bd').fadeIn('fast')
				 $('.pop_task').fadeIn('fast')
			})
}

$(document).on('click','.add_email12',function(){
    
    	$('.inquiry-pop-bd').fadeIn('fast')
				 $('.pop_task').fadeIn('fast')
				 e.stopPropagation();
})

$(document).on('click','.else_items li',function(){
    
    window.location.href="https://www.chanxanlaser.com/contact-us/"
})

$('.inquiry-pop,.product-btn-wrap .email,.foot_item04 .button,.side_content .side_list .email,.add_email12').click(function(e) {e.stopPropagation();})
$(document).click(function() {hideMsgPop()})
function changeuRL(link){
	var curUrl=document.location.href; 
 	var oldUrl=window.location.host+'/';
 	var lgArr=['fr/','de/','pt/','es/','ru/','ko/','ar/','ga/','ja/','el/','tr/','it/','da/','ro/','id/','cs/','af/','sv/','pl/','eu/','ca/','eo/','hi/','lo/','sq/','am/','hy/','az/','be/','bn/','bs/','bg/','ceb/','ny/','co/','hr/','nl/','et/','tl/','fi/','fy/','gl/','ka/','gu/','ht/','ha/','haw/','iw/','hmn/','hu/','is/','ig/','jw/','kn/','kk/','km/','ku/','ky/','la/','lv/','lt/','lb/','mk/','mg/','ms/','ml/','mt/','mi/','mr/','mn/','my/','ne/','no/','ps/','fa/','pa/','sr/','st/','si/','sk/','sl/','so/','sm/','gd/','sn/','sd/','su/','sw/','tg/','ta/','te/','th/','uk/','ur/','uz/','vi/','cy/','xh/','yi/','yo/','zu/','zh-CN/','zh-TW/','zh/'];
	$.each(lgArr,function(i,lenItem){  
		var lgUrl=oldUrl.toString()+lenItem;
		if(curUrl.indexOf(lgUrl)!=-1){
			link.each(function(i){
				if(!$(this).parents().hasClass('language-flag')){
					var iLink;
					if($(this).prop('href')){
						iLink=$(this).prop('href');
					}
					if(String(iLink).indexOf(oldUrl)!=-1 &&  String(iLink).indexOf(lgUrl)==-1 && curUrl.indexOf(lgUrl)!=-1){
						var newLink=iLink.replace(oldUrl,lgUrl);
						$(this).attr('href',newLink);
					}
				}
			})
		}
	}); 
}
$(function(){
	changeuRL($('a'));
})
$(document).ready(function(){
		$('.change-language .change-language-cont').append("<div class='change-empty'>Untranslated</div>")
		$('.prisna-wp-translate-seo').append("<div class='lang-more'>More Language</div>")
		if($('body .prisna-wp-translate-seo').length>0 && $('.change-language .prisna-wp-translate-seo').length<1){
			$('.prisna-wp-translate-seo').appendTo('.change-language .change-language-cont')
			if($('.change-language .change-language-cont .prisna-wp-translate-seo li').length>0){
				$('.change-language .change-language-cont .change-empty').hide()
				$('.change-language .change-language-cont .prisna-wp-translate-seo li').each(function(index){
					if(index>35 ){
						$(this).addClass('lang-item lang-item-hide')
						$('.change-language-cont').find('.lang-more').fadeIn()
						}else{
							$('.change-language-cont').find('.lang-more').fadeOut()
							}
					})
					if($('.change-language-cont .lang-more').length>0){
						$('.change-language-cont .lang-more').click(function(){
							if($(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').hasClass('lang-item-hide')){
								$(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').removeClass('lang-item-hide')
								$(this).addClass('more-active').text('Ãƒâ€”')
								}else{
									$(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').addClass('lang-item-hide')
									$(this).removeClass('more-active').text('More Language')
									}
							})
						}
				}else{
					$('.change-language .change-language-cont .change-empty').fadeIn()
					}
			}
		})
var mHeadTop=0; 
    var $backToTopEle = $('<span class="gotop"></span>').appendTo($("body"))
        .click(function() {
            $("html, body").animate({ scrollTop:0 }, 600);
    }), $backToTopFun = function() {	
        var st = $(document).scrollTop(), winh = $(window).height();
        (st > mHeadTop)? $backToTopEle.addClass('active'): $backToTopEle.removeClass('active');  		
        if (!window.XMLHttpRequest) {
            $backToTopEle.css("top", st + winh - 210); 
        }
    };
 $(window).bind("scroll", $backToTopFun);
    $(function() { $backToTopFun();});
	var $nav = $('.web_head'), navH = $('.web_head').outerHeight(),winTop_1=0,winWidth=$(window).width(),winHeight=$(window).height(),spr=$('body').height()-$nav.height();
		$(window).on('scroll',function(){
			var winTop_2 = $(window).scrollTop();
			if(winTop_2>mHeadTop && winWidth>980){
				$nav.addClass('fixed-nav');
				$nav.parents('body').addClass('fixed-body');
				setTimeout(function(){$nav.addClass('fixed-nav-active')});
			}else{
				$nav.removeClass('fixed-nav fixed-nav-active');
				$nav.parents('body').removeClass('fixed-body');
			}
			if(winTop_2>winTop_1 && winWidth>980){
				$nav.removeClass('fixed-nav-appear');
			}else if(winTop_2<winTop_1){
				$nav.addClass('fixed-nav-appear');
			}
			winTop_1 = $(window).scrollTop();
		})     
$('.faq-item').each(function(index){
		var _this=$(this)
		var title=_this.find('.faq-title')
		var cont=_this.find('.faq-cont')
		if(index==0){
			title.addClass('show-title')
			}
		title.on('click',function(){
			if(cont.is(':hidden') && !$(this).hasClass('show-title')){
				cont.slideDown('fast')
				$(this).addClass('show-title')
				_this.siblings().find('.faq-title').removeClass('show-title')
				_this.siblings().find('.faq-cont').slideUp('fast')
				}
				else{
					cont.slideUp('fast')
					$(this).removeClass('show-title')
					}
			})
		}) 
    function mSizeChange()
    {
        if (window.innerWidth)
            winWidth = window.innerWidth;
        else if ((document.body) && (document.body.clientWidth))
            winWidth = document.body.clientWidth;
        if (window.innerHeight)
            winHeight = window.innerHeight;
        else if ((document.body) && (document.body.clientHeight))
            winHeight = document.body.clientHeight;
        if (document.documentElement  && document.documentElement.clientHeight && document.documentElement.clientWidth)
        {
            winHeight = document.documentElement.clientHeight;
            winWidth = document.documentElement.clientWidth;
        }
        if(winWidth<=1080){
            if($('.mobile-head-items').length<1){
                var mobileService='<div class="mobile-head-items"><div class="mobile-head-item mobile-head-nav"><div class="title"></div><div class="main-content-wrap side-content-wrap"><div class="content-wrap"></div></div></div><div class="mobile-head-item mobile-head-language"><div class="title"></div><div class="main-content-wrap side-content-wrap"><div class="content-wrap"></div></div></div>'
                $('body').append(mobileService)
                if($('body .aside').length>0){
                    $('.mobile-head-items').append('<div class="mobile-head-item mobile-head-aside"><div class="title"></div><div class="main-content-wrap side-content-wrap"><div class="content-wrap"></div></div></div>')
                }
                $('.mobile-head-item').each(function(){
                    $(this).find('.title').click(function(){
                        if($(this).parents('.mobile-head-item').find('.main-content-wrap').length>0){
                            var pItem=$(this).parents('.mobile-head-item')
                            if(!pItem.find('.main-content-wrap').hasClass('show-content-wrap')){
                                pItem.find('.main-content-wrap').addClass('show-content-wrap')
                                pItem.find('.side-content-wrap').stop().animate({'left':'0'},300)
                                pItem.find('.middle-content-wrap').addClass('middle-show-content-wrap')
                                pItem.find('.side-content-wrap').append("<b class='mobile-ico-close'></b>")
                                pItem.siblings('.mobile-head-item').find('.main-content-wrap').removeClass('show-content-wrap')
                                pItem.siblings('.mobile-head-item').find('.side-content-wrap').stop().animate({'left':'-70%'},300)
                                pItem.siblings('.mobile-head-item').find('.middle-content-wrap').removeClass('middle-show-content-wrap')
                                pItem.siblings('.mobile-head-item').find('.side-content-wrap .mobile-ico-close').remove()
                                if($('.mobile-head-items').find('.mobile-body-mask').length<1){
                                    $('.mobile-head-items').append('<div class="mobile-body-mask"></div>')
                                }
                            }
                            else{
                                pItem.find('.main-content-wrap').removeClass('show-content-wrap')
                                pItem.find('.side-content-wrap').stop().animate({'left':'-70%'},300)
                                pItem.find('.middle-content-wrap').removeClass('middle-show-content-wrap')
                                pItem.find('.side-content-wrap .mobile-ico-close').remove()
                            }
                            $('.mobile-body-mask').click(function(){
                                $('.mobile-body-mask').remove()
                                $('.mobile-head-item .main-content-wrap').removeClass('show-content-wrap')
                                $('.mobile-head-item .side-content-wrap').animate({'left':'-70%'},300)
                                $('.mobile-head-item .middle-content-wrap').removeClass('middle-show-content-wrap')
                                $('.mobile-head-item .side-content-wrap .mobile-ico-close').remove()
                            })
                            $('.mobile-ico-close').click(function(){
                                $('.mobile-body-mask').remove()
                                $('.mobile-head-item .main-content-wrap').removeClass('show-content-wrap')
                                $('.mobile-head-item .side-content-wrap').stop().animate({'left':'-70%'},300)
                                $('.mobile-head-item .middle-content-wrap').removeClass('middle-show-content-wrap')
                                $('.mobile-head-item .side-content-wrap .mobile-ico-close').remove()
                            })
                        }
                    })
                })
                $('.change-currency ').clone().appendTo('.mobile-head-item.mobile-head-currency .main-content-wrap .content-wrap')
                $('.change-language .change-language-cont').clone().appendTo('.mobile-head-item.mobile-head-language .main-content-wrap .content-wrap')
                $('.nav_wrap .head_nav').clone().appendTo('.mobile-head-item.mobile-head-nav .main-content-wrap .content-wrap')
                $('.ct-modal.ct-modal-search .ct-modal-content').clone().appendTo('.mobile-head-item.mobile-head-search .main-content-wrap .content-wrap')
				$('.head_sns').clone().appendTo('.mobile-head-item.mobile-head-social .main-content-wrap .content-wrap')
                $('.aside .aside-wrap').clone().appendTo('.mobile-head-item.mobile-head-aside .main-content-wrap .content-wrap')
            }
        }
        //mobile end
        else {
            $(document).ready(function(){
            $('.mobile-body-mask,.mobile-head-items,.mobile-head-items,.mobile-nav-items,.mobile-cart-items,.mobile-tab-items').remove()
            });
        } 
    }
$(function(){mSizeChange();})
$(window).resize(function() {mSizeChange()});
$(function(){
$('.side-widget .side-cate li').each(function(){
		if($(this).find('ul').length>0){
			$(this).append("<span class='icon-cate icon-cate-down'></span>")
			$(this).children('.icon-cate').click(function(e){
							if($(this).parent('li').children('ul').is(':hidden')){
								$(this).parent('li').children('ul').slideDown(100);
									$(this).removeClass('icon-cate-down').addClass('icon-cate-up');
								}else{
									$(this).parent('li').children('ul').slideUp(100);
									$(this).removeClass('icon-cate-up').addClass('icon-cate-down');
									}
									e.stopPropagation();
							})
			}
		})
	
		if($('.side-widget .side-cate .nav-current').parents('ul').length>0 && $('.side-widget .side-cate .nav-current').find('ul').length>0) {
		$('.side-widget .side-cate .nav-current').parents('ul').show()
		$('.side-widget .side-cate .nav-current').parents('li').addClass("show_li")
		$('.side-widget .side-cate .nav-current').parents('li.show_li').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up')
		$('.side-widget .side-cate .nav-current').children('ul').show()
		$('.side-widget .side-cate .nav-current ').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up');
		}
		 else if($('.side-widget .side-cate .nav-current').parents('ul').length>0 && $('.side-widget .side-cate .nav-current').find('ul').length<1){
			 $('.side-widget .side-cate .nav-current').parents('ul').show()
			 $('.side-widget .side-cate .nav-current').parents('li').addClass("show_li")
			 $('.side-widget .side-cate .nav-current').parents('li.show_li').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up')
			}
		 else if($('.side-widget .side-cate .nav-current').parents('ul').length<1 && $('.side-widget .side-cate .nav-current').find('ul').length>0){
			$('.side-widget .side-cate .nav-current').children('ul').show()
			$('.side-widget .side-cate .nav-current').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up');
			}
})
/*tabContainer*/
function tabContainer(container,title,panel){$(container).each(function(){$(this).find(title).each(function(){if($(this).hasClass('current')){j=$(this).index();$(this).parents(container).find(panel).eq(j).removeClass('disabled')}$(this).click(function(){i=$(this).index();$(this).addClass('current').siblings().removeClass('current');$(this).parents(container).find(panel).eq(i).show();$(this).parents(container).find(panel).not($(this).parents(container).find(panel).eq(i)).hide();})})})}

$(function() { $("#scrollsidebar").fix({float : 'right',durationTime : 400 });}); 
$('.business_right .events li').on('click',function(){
	$(this).addClass('current').siblings("li").removeClass('current')
	var i=$(this).index()
	$(this).parents('.index_business').find('.business_middle .tab_content').eq(i).addClass('current').siblings(".tab_content").removeClass('current')
})
$('table').each(function(){
		 if(!$(this).parent().hasClass('table_wrap')){
			 	$(this).wrap("<div class='table_wrap'><//div>")
			 }
		 })
/* -------------- index --------------*/
    var brandSwiper = new Swiper('.brands_slider', {
      slidesPerView: 6,
      speed:400,
      loop:false,
      spaceBetween: 10,
	  pagination: {
        el: '.brands_slider .swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.brands_slider .swiper-button-next',
        prevEl: '.brands_slider .swiper-button-prev',
      },
      breakpoints: {
        1024: {
          slidesPerView: 4,
        },
        950: {
          slidesPerView: 3,
        },
        768: {
          slidesPerView: 2,
          spaceBetween: 0
        }
      }
    });
    var pdSwiper = new Swiper('.product_slider', {
      slidesPerView: 4,
      slidesPerGroup:4,
      speed:600,
      spaceBetween: 30,
	  pagination: {
        el: '.product_slider .swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.product_slider .swiper-button-next',
        prevEl: '.product_slider .swiper-button-prev',
      },
      breakpoints: {
        1280: {
          slidesPerView: 3,
      	  slidesPerGroup:3,
        },
        950: {
          slidesPerView: 2,
          slidesPerGroup:2,
          spaceBetween: 10
        },
        480: {
          slidesPerView: 1,
          slidesPerGroup:1,
          spaceBetween: 0
        }
      }
    });
 
$('.fancybox-media')
				.attr('rel', 'media-gallery')
				.fancybox({
					openEffect : 'none',
					closeEffect : 'none',
					prevEffect : 'none',
					nextEffect : 'none',
					arrows : false,
					helpers : {
						media : {},
						buttons : {}
					}
				});
$(".faq_item").each(function(){
	$(".faq_item").eq(0).find(".item_info").slideDown()
	var title=$(this).find(".item_title")
	var content=$(this).find(".item_info")
	var itemLi=$(this)
	title.click(function(){
		if(itemLi.hasClass("current")){
			itemLi.removeClass("current")
			content.slideUp()
		}else{
			itemLi.addClass("current")
			content.slideDown()
			itemLi.siblings().removeClass("current")
			itemLi.siblings().find(".item_info").slideUp()
			}
		})
	
	}) 

$(".search_enter").click(function(){
	if($(".ct-modal").hasClass("open")){ 
		$(".ct-modal").removeClass("open")
		}else{
			 
			$(".ct-modal").addClass("open")
			}
	
	})
$(".ct-modal-close").click(function(){
	$(".ct-modal").removeClass("open")
	})	
$(".category_nav li").eq(0).addClass('active')
$(".category_pannel").eq(0).addClass('active')
$(".category_nav li").each(function(){
	$(this).mouseenter(function() {
		$(this).addClass('active').siblings('li').removeClass('active');
		$(".category_pannel").eq($(this).index()).addClass('active').siblings('.category_pannel').removeClass('active');
	});
})	
$(".service_nav li").eq(0).addClass('active')
$(".service_pannel").eq(0).addClass('active')
$(".service_category").css("background-image","url("+$(".service_pannel").eq(0).attr("data-url")+")")
$(".service_nav li").each(function(){
	$(this).mouseenter(function() {
		$(this).addClass('active').siblings('li').removeClass('active');
		$(".service_pannel").eq($(this).index()).addClass('active').siblings('.service_pannel').removeClass('active');
		$(".service_category").css("background-image","url("+$(".service_pannel").eq($(this).index()).attr("data-url")+")")
	});
})	
$('.data_item .item_num').countUp();

$(function(){


if(window.screen.width>640){
$(".mode_list .mode_item").eq(0).addClass('active')


$(".mode_list .mode_item").each(function(){
	$(this).mouseenter(function() {
		$(this).addClass('active').siblings('.mode_item').removeClass('active'); 
	});
})
}else{
    $(".mode_list").addClass('swiper-wrapper');
    $(".mode_list .mode_item").addClass('swiper-slide');
    
var caseSwiper = new Swiper('.index_about', {
      slidesPerView: 1,
      slidesPerGroup:1,
      spaceBetween: 10,
    });
}
})

$(".case_nav li").eq(0).addClass('active')
$(".case_pannel").eq(0).addClass('active')
$(".case_nav li").each(function(){
	$(this).mouseenter(function() {
		$(this).addClass('active').siblings('li').removeClass('active');
		$(".case_pannel").eq($(this).index()).addClass('active').siblings('.case_pannel').removeClass('active');
	});
}) 
 var demo = $(".inquiry_form form").Validform({
      tiptype : 3,
      showAllError : true,
      ajaxPost : false
   });	
   

   
var caseSwiper = new Swiper('.thesocase', {
      slidesPerView: 4,
      slidesPerGroup:1,
      speed:600,
      spaceBetween: 30,
      loop:true,
	  pagination: {
        el: '.solucase .case-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.solucase .case-next',
        prevEl: '.solucase .case-prev',
      },
      breakpoints: {
        1280: {
          slidesPerView: 3,
      	  slidesPerGroup:3,
        },
        950: {
          slidesPerView: 2,
          slidesPerGroup:2,
          spaceBetween: 10
        },
        480: {
          slidesPerView: 1,
          slidesPerGroup:1,
          spaceBetween: 0
        }
      }
    });
    
var caseSwiper = new Swiper('.thesocase1', {
      slidesPerView: 4,
      slidesPerGroup:1,
      speed:600,
      spaceBetween: 30,
      loop:true,
	  pagination: {
        el: '.solucase1 .case-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.solucase1 .case-next',
        prevEl: '.solucase1 .case-prev',
      },
      breakpoints: {
        1280: {
          slidesPerView: 3,
      	  slidesPerGroup:3,
        },
        950: {
          slidesPerView: 2,
          slidesPerGroup:2,
          spaceBetween: 10
        },
        480: {
          slidesPerView: 1,
          slidesPerGroup:1,
          spaceBetween: 0
        }
      }
    });
    
    
$(function(){
    
    let ajax_ = (data_arr) =>{
        
         $.ajax({   
          type:"POST",
          url:'/wp-admin/admin-ajax.php?action=show_data_by_industry',
          async:false,
          data:JSON.stringify(data_arr),
          dataType:"json",
          success:function(data){
          	if(data.status == true){
          	    var product = data.data;
          	    var prodata = '';
          	    var product_data = product.data
          	    if(product_data){
          	        $.each(product_data,function(key,value){
              	        prodata += '<li class="product_item"><div class="wow fadeInLeftA item_img"><a href="'+value.link+'"><img src="'+value.image+'" alt="'+value.post_title+'"></a></div><div class="wow fadeInRightA item_info"><h2 class="item_title"><a href="'+value.link+'">'+value.post_title+'</a></h2><div class="item_text">'+value.post_content+'</div><div class="item_button"><a href="'+value.link+'"  class="item_more">了解详情</a><a href="javascript:" class="item_contact add_email12">获取报价</a></div></div></li>';
              	    })
              	    
              	    
          	    }else{
          	        prodata = '<li class="no_data">There are no products from related industries</li>';
          	    }
          	    $('.items_list_items').html(prodata)
          	    $('.page_bar > .pages').html(product.page)
        
                	    $('.page_bar > .pages a').click(function(){
  	        
              	        data_arr['paged'] = $(this).attr('value')
              	        
              	         ajax_(data_arr);
              	    })
          	}
          }		
        
        })
        
    }
    
    $('#by_industry > ul > li > a').click(function(){
        $('#by_industry li').removeClass('nav-current')
        $(this).parent('li').addClass('nav-current')
        var by_industry = $(this).attr('data-value')
        var cat_ID = $('#by_industry > ul').attr('data-cat')
        var data_arr = {'cat_ID':cat_ID,'by_industry':by_industry,'paged':1}
       
        ajax_(data_arr);
 
    })
})    







$(function(){
if(window.screen.width<640){
    $(".case_pannel_wrap").addClass('swiper-wrapper');
    $(".case_pannel_wrap .case_pannel").addClass('swiper-slide');
    $(".index_news .news_items").addClass('swiper-wrapper');
    $(".index_news .news_item").addClass('swiper-slide');
    
    
var caseSwiper = new Swiper('.case_category', {
      slidesPerView: 1,
      slidesPerGroup:1,
      spaceBetween: 10,
    });
    
 var newsSwiper = new Swiper('.index_news', {
      slidesPerView: 1,
      slidesPerGroup:1,
      spaceBetween: 10,
      loop:true,
    });   

    
}
})

$(".contact-phone .ewm-box").click(function(e){
		e.preventDefault();
		var _this = $(this),
			$img = _this.children(".ewm");
		if($img.is(":hidden")){
			$img.show();
		}else{
			$img.hide();
		}
		
	})
	
$('.head_nav li').each(function(){
	if($(this).find('ul').length>0){
		$(this).children('a').append("<b></b>");
		$(this).addClass('has-child');
	}
	else{
		if(!$(this).siblings('li').find('ul').length){
			$(this).addClass('siblings-no-menu')
		}
	}
	
})   

$(function(){
	$('.nav_wrap').append('<span class="nav_btn_close"></span>');

	$('body').delegate('.head_nav li b','click',function(){
		var navItem=$(this).closest('li');
		var navMenu=navItem.children('ul');
		if(navMenu.is(':hidden')){
			navMenu.slideDown(150,function(){
				navItem.addClass('active');
			});
		}
		else{
			navItem.removeClass('active');
			navMenu.slideUp(150);
		}
		return false;
	})
})


//动态设置侧边栏滚动
 $(function () {
    var offset_top = $('.right_nav').offset().top; //获取右侧导航距离顶部的高度
    var begin = 0,
       end = 0,
       timer = null;
    $('.right_nav li:last').hide(); //先将回到顶部隐藏

    $(window).scroll(function (evt) {
       clearInterval(timer);
       var scroll_top = $(window).scrollTop();
       end = offset_top + scroll_top;
       scroll_top > 100 ? $('.right_nav li:last').fadeIn() : $('.right_nav li:last').fadeOut(); //滚动距离判断是否显示回到顶部

       timer = setInterval(function () { //滚动定时器
          begin = begin + (end - begin) * 0.2;
          if (Math.round(begin) === end) {
             clearInterval(timer);
          }
       }, 10);
    });
 });

 //右侧导航伸缩效果
 var right_nav = $(".right_nav");
 var tempS;
 
 $(".right_nav li").each(function(){
     $(this).mouseenter(function () {
         $(this).animate({right: "0" }, 300);
    })
     $(this).mouseleave(function () {
          $(this).animate({right: "-50" }, 100);
          
       });
 })

 //右侧导航点击事件
 $(".right_nav li").each(function (i) {//若需要添加版块，请添加if条件
    if (i == 0 || i == 1 || i == 2 || i == 3 ) {
       $(this).mouseover(function () {
          $(this).children(".hideBox").stop().fadeIn();
          right_nav.css('overflow', 'visible')
       });
       $(this).mouseout(function () {
          $(this).children(".hideBox").hide();
          right_nav.css('overflow', 'hidden')
       });
    } else if (i == 4) {
       $(this).click(function () {
          $('body,html').animate({
             scrollTop: 0
          }, 400);
       })
    }
 })
 $(".right_nav li .top").click(function() {
            $("html, body").animate({ scrollTop:0 }, 600);
    })