jQuery(function() {
	//“五抓”党建工作模式
	var proApp = new Swiper('.proApp .swiper-container', {
	    loop: true,
	    slidesPerView: 'auto',
	    spaceBetween: '2%',
	    observer: true,
	    observeParents: true,
	    centeredSlides: true,
	    prevButton: '.proApp .appPrev',
	    nextButton: '.proApp .appNext',
	    pagination: '.proApp .hm1Page',
		paginationClickable: true,
	})
	// 党建荣誉
	var hm2Pic = new Swiper('.hm2Pic .swiper-container', {
	    loop: true,
	    slidesPerView: 1,
	    observer: true,
	    observeParents: true,
		autoplay: 3000,
	    prevButton: '.hm2Pic .appPrev',
	    nextButton: '.hm2Pic .appNext',
	    pagination: '.hm2Pic .hm2Page',
		paginationClickable: true,
	})
	//社会责任
	var proTopic = new Swiper('.proTopic .swiper-container', {
	    slidesPerView: 3,
	    spaceBetween: '2%',
	    observer: true,
	    observeParents: true,
	    resistanceRatio: 0,
	    prevButton: '.proTopic .topicPrev',
	    nextButton: '.proTopic .topicNext',
	    breakpoints: {
	        1200: {
	            slidesPerView: 3,
	        },
	        991: {
	            slidesPerView: 2,
	        },
	        640: {
	            slidesPerView: 2,
	        },
	        460: {
	            slidesPerView: 1,
	        }
	    }
	})
	var schoolBox = new Swiper('.schoolBox .swiper-container', {
	    slidesPerView: 4,
	    spaceBetween: '2%',
	    observer: true,
		autoplay: 3000,
	    observeParents: true,
	    resistanceRatio: 0,
		watchSlidesProgress : true,
		watchSlidesVisibility : true,
	    breakpoints: {
	        1200: {
	            slidesPerView: 3,
	        },
	        991: {
	            slidesPerView: 2,
	        },
	        640: {
	            slidesPerView: 2,
	        },
	        460: {
	            slidesPerView: 1,
	        }
	    }
	})
	//资质
	var intelHm = new Swiper('.intelHm .swiper-container', {
		loop: true,
		autoplay: 3000,
		speed: 800,
		autoplayDisableOnInteraction: false,
	    slidesPerView: 6,
	    spaceBetween: '2%',
	    observer: true,
	    observeParents: true,
	    resistanceRatio: 0,
		prevButton: '.intelHm .topicPrev',
		nextButton: '.intelHm .topicNext',
	    breakpoints: {
	        1200: {
	            slidesPerView: 5,
	        },
	        991: {
	            slidesPerView: 3,
	        },
	        640: {
	            slidesPerView: 3,
	        }
	    }
	})
	var honorHm = new Swiper('.honorHm .swiper-container', {
		loop: true,
		autoplay: 3000,
		speed: 800,
		autoplayDisableOnInteraction: false,
	    slidesPerView: 6,
	    spaceBetween: '2%',
	    observer: true,
	    observeParents: true,
	    resistanceRatio: 0,
		prevButton: '.honorHm .topicPrev',
		nextButton: '.honorHm .topicNext',
	    breakpoints: {
	        1200: {
	            slidesPerView: 5,
	        },
	        991: {
	            slidesPerView: 3,
	        },
	        640: {
	            slidesPerView: 3,
	        }
	    }
	})
	//aboutUs
	$(".aboutUs .sort .swiper-slide").click( function() {
		$(this).addClass("active").siblings('.swiper-slide').removeClass('active');
	});
	$(".culList li").hover( function() {
		var _index = $(this).index();
		$(this).addClass("active").siblings("li").removeClass("active");
		$(".culTips").eq(_index).addClass("current").siblings(".culTips").removeClass("current");
	});
	//分子公司
	$(".branchHmBox").each(function (index, element) {
		var $that = $(this);
		var branchHmBox = new Swiper($that.find('.swiper-container'), {
			slidesPerView: 6,
			spaceBetween: '2%',
			observer: true,
			observeParents: true,
			resistanceRatio: 0,
			prevButton: $that.find('.topicPrev'),
			nextButton: $that.find('.topicNext'),
			breakpoints: {
				1200: {
					slidesPerView: 3,
				},
				991: {
					slidesPerView: 3,
				}
			}
		})
	});
	var hm2Swiper = new Swiper('.hm2Swiper .swiper-container', {
	    slidesPerView: 4,
	    spaceBetween: '2%',
	    observer: true,
	    observeParents: true,
	    resistanceRatio: 0,
		prevButton:'.swiper-button-prev',
		nextButton:'.swiper-button-next',
	    breakpoints: {
	        1200: {
	            slidesPerView: 3,
	        },
	        991: {
	            slidesPerView: 2,
	        },
	        640: {
	            slidesPerView: 2,
	        },
	        460: {
	            slidesPerView: 1,
	        }
	    }
	})
	//关于我们
	var aboutHmOth1 = new Swiper('.aboutHmOth1.swiper-container', {
	    loop: true,
	    slidesPerView: 1,
	    observer: true,
	    observeParents: true,
	    autoplay: 4000,
		autoplayDisableOnInteraction: false,
	})
	//常见问题
	$(function (){
		$(".quesBox .right-faq li").on("click",function () {
			$('.quesBox .right-faq .list-con').stop();

			$(this).children(".list-title").removeAttr("id");
			if($(this).attr("id")=="open"){
				$(this).children(".list-title").removeClass("current");
				$(this).removeAttr("id").children(".list-con").slideUp();
			}else{
				$(this).siblings("li").children(".list-title").removeClass("current")
				$(this).children(".list-title").addClass("current");
				$(this).siblings("li").removeAttr("id");
				$(this).attr("id","open").children(".list-con").slideDown();
				$(this).siblings("li").children(".list-con").slideUp();
			}
		});
	});
	// 大事记
	$(".honItem").eq($(".honorYear li.active").index()).show();
	$(".honorYear li").click(function(){
		$(this).addClass("active").siblings().removeClass("active");
		$(".honItem").eq($(this).index()).addClass("animated fadeInUp").show().siblings().hide();
	})
	// $(".pilotLink").click(function() {
	// 	$(".pop-mask").show();
	// 	$(".pilotPop").show();
	// });
	// $(".close-pop").click(function() {
	// 	$(".pop-mask").hide();
	// 	$(".pilotPop").hide();
	// });
	//technical
	$(".technical input").focus(function(){
	  $(this).addClass('active');
	});
	$(".technical input").blur(function(){
	  $(this).removeClass('active');
	});
	$(".technical textarea").focus(function(){
	  $(this).addClass('active');
	});
	$(".technical textarea").blur(function(){
	  $(this).removeClass('active');
	});
	//关于我们导航吸顶
	$(function() {
		var _scrollDiv = $('.aboutUs .sort');
		var _offset = _scrollDiv.offset().top;
		$(window).scroll(function(){
			if ($(window).scrollTop() > _offset){
				$(".aboutUs .sort").addClass("sortFixed");
			}else{
				$(".aboutUs .sort").removeClass("sortFixed")
			}
		});
		if ($(window).scrollTop() > _offset){
			$(".aboutUs .sort").addClass("sortFixed");
		}else{
			$(".aboutUs .sort").removeClass("sortFixed")
		}
	});
	//下拉选择
	$(".selectBox").each(function(){
		var $elm=$(this);
		var optionList=$('.selectCon',$elm);
		var showOption=$('.selectTitle span',$elm);
		var isOpen = false;
		$elm.bind("click", function() {
			if(isOpen == false){
				optionList.show().siblings('.selectBox').find('.selectCon').hide();
				isOpen = true;
				showOption.addClass('active');
			}else {
				optionList.hide();
				isOpen = false;
				showOption.removeClass('active');
			}

		});
		$('li',optionList).bind('click',function(){
			// var $elm=$(this);
			// var op=$elm.text();
			// showOption.text(op);
			optionList.hide();
		});
	});
	(function() {
		var isOpen = false,
			$box = $('.selectBox');
		$box.each(function() {
			var selector = $(this);
			selector.on('click', '.selectCon li', function() {
				var $con = selector.find('.selectTitle span'),
					$text = $(this).text();
				$con.html($text);
				isOpen = false;
			});
		});

	})();

	//领航人物
	$(".popCont").mCustomScrollbar({
	    theme: "light-2",
	});
	//加入我们
	$(".sRigCon").mCustomScrollbar({
	    theme: "light-2",
	});
});