jQuery(function () {
	function initBox() {
		w_width = jQuery(window).width();
		w_height = jQuery(window).height();
		var mtop = jQuery('.mtop').height();
		$('.banner-swiper').css('height', w_height-mtop);
		$('.banner-slide figure').css('height', w_height-mtop);
		setImgMax($('.banner-slide figure img'), 1920, 870, w_width, w_height-mtop);
	};
	initBox();
	jQuery(window).resize(function () {
		initBox();
	});
	var indexFn = {
		init:function (){
			this.getBanner();
			this.getSolute();
			this.getNews();
			this.getAbout();
		},
		getBanner: function() {
			new Swiper('.banner-swiper', {
				speed: 1000,
				slidesPerView: 1,
				parallax: true,
				loop: true,
				effect : 'fade',
				autoplay : 8000,
				pagination : '.swiper-pagination',
				paginationClickable :true,
			});
		},
		getSolute: function(){
			var solute = new Swiper('.solute-tab-swiper', {
				speed: 1000,
				slidesPerView: 1,
				spaceBetween : 40,
				parallax: true,
				loop: false,
				autoplay : 0,
				onTransitionStart : function(swiper) {
					$(".solute-btn li").eq(swiper.realIndex).addClass("active").siblings().removeClass("active");
				},
			});

			$(".solute-btn li").click(function(){
				$(this).addClass("active").siblings().removeClass("active");
				solute.slideTo($(this).index(), 800, false);
			});
		},
		getNews: function(){
			new Swiper('.news-swiper', {
				speed: 1200,
				slidesPerView: "auto",
				parallax: true,
				loop: true,
				autoplay: 3600,
			})
		},
		getAbout: function(){
			new Swiper('.about-swiper', {
				speed: 1000,
				slidesPerView: "auto",
				parallax: true,
				loop: true,
				autoplay: 3600,
				mousewheelControl : true,
			})

			new Swiper('.expert-swiper', {
				speed: 1000,
				slidesPerView: "auto",
				parallax: true,
				loop: true,
				autoplay: 4500,
			});

			new Swiper('.cooperate-swiper', {
				speed: 1000,
				slidesPerView: 6,
				slidesPerColumn : 3,
				spaceBetween : 26,
				parallax: true,
				loop: false,
				autoplay: 4000,
				pagination : '.swiper-pagination1',
				paginationClickable :true,
				breakpoints: { 
					1024: {
					  slidesPerView: 5,
					},
					860: {
						slidesPerView: 4,
						spaceBetween : 18,
					},
					480: {
						slidesPerView: 3,
						spaceBetween : 12,
					}
				}
			});
		}
		
	}

	indexFn.init();
});
