$(document).ready(function(){
	var options = {
		zoomType: 'standard',//'reverse'
		zoomWidth: 300,
		zoomHeight: 200,
		xOffset: 10,
		yOffset: 38,
		position: 'right',
		lens: true,//显示小框
		imageOpacity: 0.2,
		title: false,
		showEffect: 'fadein',
		hideEffect: 'fadeout',
		fadeinSpeed: 'slow',
		fadeoutSpeed: 'fast',
		showPreload: true,
		preloadText: '加载中...',
		preloadPosition: 'center'//'bycss'
	};

	//$('.zoomPic').jqzoom(options);

	//经过预览小图换大图
	bindRollPics();
});

//经过预览小图换大图
function bindRollPics(){
	$('ul.rollPics li').bind('mouseover', function(){
		//换上当前选中的class
		$(this).siblings().children('img.curren').removeClass('curren');
		$(this).children('img').addClass('curren');
		//大图换上
		var bigimg = $(this).children('img').attr('bigimg');
		$('.zoomPic').attr('href', bigimg);
		//小图换上
		//var smallimg = $(this).children('img').attr('src');
		$('.zoomPic').children('img').attr('src', bigimg);
	});
}

/*商品展示缩略图滑动*/
var counter = 0;
var totalAmount = 0;
var displayAmount = 5;//展示数
function moveDown(num, amount)
{
	totalAmount = amount - displayAmount;
	counter = counter + 1;

	if (counter <= totalAmount)
	{
		var rightPx = num * (64) * counter;
		$(".rollPics").animate({left: rightPx}, 500);
	}
	else
	{
		counter = totalAmount;
	}
}

function moveUp(num, amount)
{
	totalAmount = amount - displayAmount;
	counter = counter - 1;
	if (counter >= 0)
	{
		var leftPx = num * (64) * counter;
		$(".rollPics").animate({left: leftPx}, 500);
	}
	else
	{
		counter = 0;
	}
}
