$(document).ready(function()
{
	// Add a rollover to images with the "rollover" class.
	$(".rollover").hover(
		function(){
			if($(this).attr("src").indexOf("-rollover") == -1) {
				var newSrc = $(this).attr("src").replace(".gif","-rollover.gif#hover");
				$(this).attr("src",newSrc);
			}
		},
		function(){
			if($(this).attr("src").indexOf("-rollover.gif#hover") != -1) {
				var oldSrc = $(this).attr("src").replace("-rollover.gif#hover",".gif");
				$(this).attr("src",oldSrc);
			}
		}
	);

	 // Open external links in a new window.
	 $("a").filter(".link").click(function(){
	   return !window.open(this.href);
	 });
	 
    // Carousel images on the Gallery page.
    $('#galleryCarousel').jcarousel({
    });
    
    // Use Facebox for gallery images.
	jQuery(document).ready(function($) {
	  $('a[rel*=facebox]').facebox(); 
	});
});
