if (typeof Effect == 'undefined')
  throw("You must have the script.aculo.us library to use this gallery");
  
document.observe("dom:loaded", function() {
	var curStep = 1;
	$$('div#sidebar ul.thumbs li').each(function(a, index){
		index = index+1;
		a.observe('click', function(){
			if (index != curStep) {
				elem = $("gallery" + index);
				prevElem = $("gallery" + curStep);
				elem.appear();
				prevElem.hide();
				curStep = index;
			}
		});
	});
});
