// The setImage function sets the image src of the big main image to a new image.
// The new image is defined by the offset of the image within the thumbnail list (stored in the li's).
// The "active" state of the thumbnail images is also reset and set correctly on the clicked image
function setImage(offset)
{
	$("#main_image").attr("src", $("#gallery li:eq(" + (offset - 1) + ") img").attr("src"));
	
	// Set all gallery images to be inactive
	$("#gallery li").each(function( intIndex ){
		$(this).find('img').attr("class", "");
	});	
	
	// Now set the newly selected image to be active
	$("#gallery li:eq(" + (offset - 1) + ") img").attr("class", "active");		
}

