jQuery(document).ready(function(){

	jQuery(".pad img").hover(function(){
		jQuery(this).fadeTo("slow", 0.6); // Sets 60% on hover
		},function(){
		jQuery(this).fadeTo("slow", 1.0); // Sets opacity back to 100% on mouseout
	});
	
	jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
	  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
	};
	
	jQuery('#show_captions').click( function() {
		jQuery(".caption").each(function (i) {
        if (this.style.display == "none") {
          jQuery(this).show().animate({opacity:1}, 500);
        } else {
          jQuery(this).animate({opacity:0}, 500, function(){jQuery(this).hide();});
        }
      });

		jQuery(this).text(jQuery(this).text() == 'Caption' ? 'Hide caption' : 'Caption');
		return false; 
	});
	jQuery('#show_thumbnails').click( function() {
		jQuery('ul#slideshow_thumbnails').slideFadeToggle();
		jQuery(this).text(jQuery(this).text() == 'Hide thumbnails' ? 'Show thumbnails' : 'Hide thumbnails');
		return false; 
	});

});

// Disables right click on images
jQuery(function() {
    jQuery('img').bind("contextmenu", function(e) {
        e.preventDefault();
    });
}); 
