$(document).ready(function() {
	//call functions on page load.

	$("#header ul a").mouseenter(function() {
		$(this).animate({"height":"54px", "marginTop":0}, 150);
	}).mouseleave(function() {
		$(this).animate({"height":"50px", "marginTop":"4px"}, 150);
	});
	
	$("#galleryThumbnails .thumb").mouseenter(function() {
		$(this).animate({"opacity": 1}, 150);
	}).mouseleave(function() {
		$(this).animate({"opacity": 0.5}, 150);
	});
	$("#galleryThumbnails .thumb a").click(function() {
		galleryShow(this.href);
		$("#galleryThumbnails .current").removeClass("current");
		$(this).parent().addClass("current");
		return false;
	});

});



function galleryShow(imageFile) {

	$("#galleryTarget img").fadeOut(500, function() {
		$("#galleryTarget .loader").css("display", "block");
		var img = new Image();
		img.src = imageFile;
		$(img).load(function() {
			$("#galleryTarget .loader").css("display", "none");
			$("#galleryTarget img").attr("src", img.src).fadeIn(500);
		});
	});
	
};
