function viewImage(img){
	var photo= new Image();
	$(photo).load(function(){
		var width=photo.width+20;
		var height=photo.height+20;
		var params = "menubar=no,location=no,status=no,width=" + width + ",height=" + height;
		window.open(img, "", params);
	});
	photo.src=(img);
}

//JC: this is needed to slide the images
// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

$(function() {
	$("#catalog .productThumbNail").click(function() {
		$("#mainProductImage").attr("src", $(this).attr("medium"));
		$(".viewLargerImageLink").attr("href", "javascript:viewImage('" + $(this).attr("large") + "')");
	});
	
	$(".tabBox").tabs();
	
	$('.slideShow').serialScroll({
		items : 'div.productResult',
		target : '.scrollArea',
		prev : '.prev',
		next : '.next',
		start : 0, //as we are centering it, start at the 2nd
		duration : 2500,
		force : true,
		margin : true,
		stop : true,
		step : 3,
		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
	});
});