$(document).ready(function() {

$("div.slides_big img").css('position', 'absolute');
	$("div.slides_thumb").each(function() { 
		$(this).bind('click', function(e) {
			e.preventDefault();
			
			// check semaphore
			if($('#slides_big').hasClass('disabled'))
				return;
			
			$('#slides_big').addClass('disabled');
			
			// change the display of the thumbnail:
			$('#slides_small .active').removeClass('active'); 
			$(this).addClass('active'); 
			
			 
			// last active big slide img tag
			var old_active = $("#slides_big .active");
			
			// what should be the next active big slide
			var new_active = $($("#slides_big img").get($("div#slideshow div.slides_thumb").index(this)));
			
			if(old_active.attr('src') == new_active.attr('src')) {
				$('#slides_big').removeClass('disabled');
				return;
			}
			
			new_active.css('height', 'auto');
			old_active.css('position', 'absolute');
			old_active.css('z-index', 0);
			new_active.css('z-index', 100);
			
			new_active.switchClass('inactive', 'active', 1000, function() {
				old_active.addClass('inactive').removeClass('active');
				$('#slides_big').removeClass('disabled');
			});
 		});
 	}); 
});
   