$(document).ready(function() {
		$('#galleryListCell').serialScroll({
		items:'li',
		prev:'#galleryLeftBtn a',
		next:'#galleryRightBtn a',
		axis:'x',
		step: 1,
		offset: 0,
		start:0,
		duration:300,
		force:true,
		stop:true,
		lock: true,
		cycle: false, //don't pull back once you reach the end
		jump: false //click on the images to scroll to them
	});
	
	var initSrc = $("#galleryListCell img:eq(0)").attr("lowsrc"); //grab lowsrc of clicked element
	var initTitle = $("#galleryListCell img:eq(0)").attr("title"); //grab the title of clicked element
	//set the image source
	$("#galleryMainImg").html('<img id="MainImg" src="../phpThumb/phpThumb.php?src='+initSrc+'&q=95&wp=480&hp=500&wl=730&hl=480" title="'+initTitle+'" alt="'+initTitle+'">');
	//set the image caption based on element index
	$("#galleryCaptionCell").html($("#galleryCaptions div:eq(0)").html());
			//set the image description based on element index
	$("#galleryDescCell").html($("#galleryDescriptions div:eq(0)").html());
	$("#galleryListCell img:eq(0)").addClass("current");
	
	$('#galleryListCell img').click(function() {
			$('#galleryListCell img').removeClass("current");
			var elIndex = $("#galleryListCell img").index(this); //grab index of clicked element
			var LgSrc = $(this).attr("lowsrc"); //grab lowsrc of clicked element
			var imgTitle = $(this).attr("title"); //grab the title of clicked element
			$("#mainImgContent").fadeOut(800, function() {
				//set the image source
				$("#galleryMainImg").html('<img id="MainImg" src="../phpThumb/phpThumb.php?src='+LgSrc+'&q=95&wp=480&hp=500&wl=730&hl=480" title="'+imgTitle+'" alt="'+imgTitle+'">');
				//set the image caption based on element index
				$("#galleryCaptionCell").html($("#galleryCaptions div:eq("+elIndex+")").html());
				//set the image description based on element index
				$("#galleryDescCell").html($("#galleryDescriptions div:eq("+elIndex+")").html());
			}).fadeIn(2000);
			$(this).addClass("current");			
		});

	});
