jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){
	
	$('.SlideHolder').serialScroll({
		items:'li',
		prev:'.SlidePrev a',
		next:'.SlideNext a',
		offset:-155, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:1, //as we are centering it, start at the 2nd
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		cycle:false, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: false //click on the images to scroll to them
	});
	
	$('.SlideClick').click(function(){
		$.ajax({
		   type: "POST",
		   url: "/initPrdPicture/"+$(this).attr("rel")+"/",
		   data: "id="+$(this).attr("rel"),
		   success: function(html){
			   $("#PrdPicHolder").html("<img src='/assets/products/images/"+html+"' height='300' width='650' />");
			   }
		});
		$.ajax({
		   type: "POST",
		   url: "/initPrdTitle/"+$(this).attr("rel")+"/",
		   data: "id="+$(this).attr("rel"),
		   success: function(html){
			   $("#PrdTitle").html(html);
			   }
		});
		$.ajax({
		   type: "POST",
		   url: "/initPrdPrice/"+$(this).attr("rel")+"/",
		   data: "id="+$(this).attr("rel"),
		   success: function(html){
			   $("#PrdPrice").html("$ "+html);
			   }
		});
	});
	
});