$(document).ready(function() {

	/**
	 * Animate the navigation menu on mouseover/out
	 */
	$('.navigation a[class!="selected"]')
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px -12px)"}, {duration:200});
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0px 0px"});
			}})
		});


	/* Gallery thumbnails */

	$('.thumbnail_link').click(function() {
		var file = $(this).attr('href');
		$('.gallery-bigpicture-container').html('<img src="' + file + '" height="210" width="228" alt="" rel="prettyPhoto" />');
		return false;
	});
	$('.thumbnail_link:first').trigger('click');

    $("a[rel^='prettyPhoto']").prettyPhoto();

    $('#contactForm').submit(function() {
	if( $('#name').val() == '' ) {
		alert('Your name is required in order to submit the contact form');
		$('#name').focus();
		return false;
	}
	if( $('#emailaddress').val() == '' ) {
		alert('Your email address is required in order to submit the contact form');
		$('#emailaddress').focus();
		return false;
	}
	if( $('#message').val() == '') {
		alert('A message of sort is required in order to submit the contact form');
		$('#message').focus();
		return false;
	}
        return true;
    });

    $('#submitButton').click(function() { $('#contactForm').trigger('submit'); });
});