$(function(){
	WST.slides();
	swiperGoods('best');
	swiperGoods('recom');
	for (var i=1;i<5;i++){
		swiperArticle('article'+i);
	}
});
//商品滑动
function swiperGoods(n){
	var mySwiper = new Swiper ('.swiper-container-'+n, {
		autoplay : 8000,
		speed:600,
	    slidesPerView: 5,
	    slidesPerGroup : 5,
	    spaceBetween: 14,
	    //按钮
	    nextButton: '.button-next-'+n,
	    prevButton: '.button-prev-'+n,
        onSlideChangeEnd: function(swiper){
        	$('.goodsImg-'+n).lazyload({failurelimit : 10,skip_invisible : false,threshold: 100,placeholder:window.conf.RESOURCE_PATH+'/'+window.conf.GOODS_LOGO});//商品默认图片
        }
	})
}
//文章滑动
function swiperArticle(n){
	var mySwiper = new Swiper ('.swiper-'+n, {
	    slidesPerView: 1,
	    slidesPerGroup : 1,
	    spaceBetween: 0,
	    //按钮
	    nextButton: '.button-next-'+n,
	    prevButton: '.button-prev-'+n,
	    //分页
	    pagination: '.swiper-pagination',
	    paginationClickable :true,
        onSlideChangeEnd: function(swiper){
        	$('.goodsImg-'+n).lazyload({failurelimit : 10,skip_invisible : false,threshold: 100,placeholder:window.conf.RESOURCE_PATH+'/'+window.conf.GOODS_LOGO});//商品默认图片
        }
	})
}



/* 分类 */
$('.index-classify .title li').hover(function(){
	var obj = $(this);
	var type = obj.attr('type');
	$(obj).addClass('active').siblings('.index-classify .title li').removeClass('active');
	$('.right-goods'+type).show().siblings('.index-classify .content .right').hide();
});