// www.yzlcms.com
$(document).ready(function(){
	$( ".yzlcms-kefu .a").bind("mouseenter", function(){
		var _this = $(this);
		var s = $(".yzlcms-kefu");
		var isService = _this.hasClass("a-service");
		var isServicePhone = _this.hasClass("a-service-phone");
		var isQrcode = _this.hasClass("a-qrcode");
		if(isService){ s.find(".d-service").show().siblings(".d").hide();}
		if(isServicePhone){ s.find(".d-service-phone").show().siblings(".d").hide();}
		if(isQrcode){ s.find(".d-qrcode").show().siblings(".d").hide();}
	});
	$(".yzlcms-kefu, .yzlcms-kefu .a-top").bind("mouseleave", function(){
		$(".yzlcms-kefu").find(".d").hide();
	});
	$(".yzlcms-kefu .a-top").bind("mouseenter", function(){
		$(".yzlcms-kefu").find(".d").hide(); 
	});
	$(".yzlcms-kefu .a-top").bind("click", ".yzlcms-kefu .a-top", function(){
		$("html,body").animate({scrollTop: 0});
	});
	$(window).scroll(function(){
		var st = $(document).scrollTop();
		var $top = $(".yzlcms-kefu .a-top");
		if(st > 400){
			$top.css({display: 'block'});
		}else{
			if ($top.is(":visible")) {
				$top.hide();
			}
		}
	});	

	/*网站导航点击事件*/
	var menu_flag=0;
	$('.btn-menu').click(function(event){
		if(menu_flag==0){     	
			$(this).toggleClass('active');
			$('.navigation').slideToggle(300);
			menu_flag=1;
		}else{
			$(this).toggleClass('active');
			$('.navigation').slideToggle(300);
			menu_flag=0;
		 }
		event.stopPropagation();
	});

	/*产品目录收缩*/
	$(".menu_li>a").hover(function() {
	  $(".menu_li>ul").hide();
	  $(this).next('ul').show();
	}, function() {
	  
	});

	/*产品目录收缩*/
	$(".pro_mulu>ul>li").on('click',function(){
	  $(this).find('p').stop(true).toggleClass('on');
	  $(this).children('div').stop(true).slideToggle(300);
	});

	/*手机端产品目录展开*/
	var menu_tit_flag=0;
	$('.ny_content .content_left .c_tlt').on('click',function(){
		if ( matchMedia( 'only screen and (max-width:767px)' ).matches ) {
		
			if(menu_tit_flag==0){
				$('.ny_content .content_left .pro_mulu').stop(true).slideToggle(300);
				$(this).children('em').html('点击收起 -');
				menu_tit_flag=1;
			}else{
				$('.ny_content .content_left .pro_mulu').stop(true).slideToggle(300);
				$(this).children('em').html('点击展开+');
				menu_tit_flag=0;
				}
		} 
	});

});