//tabSwitch plug-in.
jQuery.fn.tabSwitch=function(){
	return this.each(function(){
		$this=$(this);
		$li=$this.children("li");
		$li.each(function(){
			$(this).click(function(){
				$li.each(function(){
					$(this).removeClass().addClass("tab_b");
					$($(this).attr("ref")).hide();
				});
				$(this).removeClass().addClass("tab_f");
				$($(this).attr("ref")).fadeIn("slow");
				return false;								   
			});
		});
	});
}

$(function() {
	/////////////////////////////////////////////////////////////////////////
    $("#thumbnail").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		circular: false,
		visible: 4
    });
	
	$("#thumbnail li a").click(function(){
		var newlink = $(this).attr("mpic");
		$("#productMainImage > img").attr('src',newlink);
		return false;
	});
	
	$("#tabSwitch").tabSwitch();
});
