// JavaScript Document
$(function () {

	// 鍥哄畾top 
	$('.wx_top').click(function () {
		$('body,html').animate({
			scrollTop: 0
		},
			800);//鐐瑰嚮鍥炲埌椤堕儴鎸夐挳锛岀紦鎳傚洖鍒伴《閮�,鏁板瓧瓒婂皬瓒婂揩
		return false;
	});

	// banner -------------------------------------	
	var swiper = new Swiper('.home-swiper', {
		pagination: {
			el: '.home-pagination',
			dynamicBullets: false,
			clickable: true,
			type: 'bullets',
			type: 'fraction',
		},
		// effect: 'fade',
		// fadeEffect: {
		//     crossFade: true,
		// },
		autoplay: {
			delay: 5000,
			stopOnLastSlide: false,
			disableOnInteraction: false,
		},
		speed: 1000,
		loop: false,
		navigation: {
			nextEl: '.home_next',
			prevEl: '.home_prev'
		},
	});
	// banner ------------------------------------ end


	// 杞挱 --------------------------------------- start

	$(function(){

		var oFocus=$('#focus'),
	
			oRight=oFocus.find('.right'),
	
			oLeft=oFocus.find('.left'),
	
			aRLi=oRight.find('li'),
	
			aLLi=oLeft.find('li'),
	
			index=0,
	
			timer = null;
	
		aRLi.hover(function(){
	
			index=$(this).index()
	
			$(this).addClass('active').siblings().removeClass();
	
			aLLi.eq(index).addClass('active').siblings().removeClass();
	
			aLLi.eq(index).stop().animate({'opacity':1},300).siblings().stop().animate({'opacity':0},300);
	
			stopFoucs();
	
		})
	
		oLeft.mouseenter(function(){
	
			stopFoucs();
	
		}).mouseleave(function(){		
	
			startFocus();
	
		});
	
		timer = setInterval(function(){
	
			startFocus();
	
		},2500);
	
		function startFocus(){
	
			index++;
	
			index = index > aRLi.size()-1 ? 0 :index;
	
	
	
			aLLi.eq(index).addClass('active').siblings().removeClass();
	
			aLLi.eq(index).stop().animate({'opacity':1},300).siblings().stop().animate({'opacity':0},300);
	
			aRLi.eq(index).addClass('active').siblings().removeClass();
	
		}
	
		function stopFoucs(){
	
			clearInterval(timer);
	
		}
	
	})
	
	// 杞挱 --------------------------------------- end



})