$(document).ready(function() {
	$('.btn-swap').bind('mouseover mouseout', function() {
		$(this).children().each(function() {
			if($(this).hasClass('hide')) {
				$(this).removeClass('hide');
			} else {
				$(this).addClass('hide');
			}
		});
	});
	
	$('#gallery-nav a').hover(function(e) {
		var gal_id = $(this).attr('id');
		var current = this;
		
		if($('#gallery-image img[id="gallery-image-' + gal_id + '"]').css('display') == 'none') {
			$('#gallery-image img').fadeOut(300);

			setTimeout(function(){
				$('#gallery-image img[id="gallery-image-' + gal_id + '"]').fadeIn(300);
			}, 300);
			
			$('#gallery-caption div').hide();
			$('#gallery-caption div[id="gallery-caption-' + gal_id + '"]').show();
			
			$('#gallery-nav a img').attr('src', 'images/gal-nav.gif');															 
			$(current).children('img').attr('src', 'images/gal-nav-on.gif');
		}
	});
	
	$('#gallery-nav a').click(function(e) { e.preventDefault(); });
}); // end document ready
