$(document).ready(
	function(){
			
		$('#front_display ul').innerfade({
			speed: 2000,
			timeout: 5000,
			type: 'sequence',
			containerheight: '530px'
		});

		$('#hero').innerfade({
			speed: 2000,
			timeout: 5000,
			type: 'sequence',
			containerheight: '460px'
		});

	if ($('#photogallery').length == 0) {
	$('#masthead ul').hide();
	$('#masthead ul').fadeOut('slow');
					
		$('#masthead').hover(
			function(){
				//$('#masthead ul').fadeIn('fast')
				$('#masthead ul').show();
				},
			function(){
				//$('#masthead ul').fadeOut('fast')
				$('#masthead ul').hide();
				});

		$("input:text").labelify({
				text: "label",
				labelledClass: "labeltext"
				});

		$('#contact-send').click(function() {
				$('#loading').fadeIn("slow");
				});
				
		$('#contact-form').ajaxForm(function(data) {
            if (data==1){
                $('#success').fadeIn("slow");
                $('#bademail').fadeOut("slow");
                $('#contact-form').resetForm();
                $('#contact-form').fadeOut("slow");
                $('#loading').fadeOut("slow");
            }
            else if (data==2) {
            	$('#badserver').fadeIn("slow");
            	$('#loading').fadeOut("slow");
            	}
            else if (data==3) {
                $('#bademail').fadeIn("slow");
                $('#email').css("background-color","#990000");
                $('#email').focus();
                $('#loading').fadeOut("slow");
            }
        });
       }


    $("a[rel='external']").click(function() { 
    	window.open(this.href); 
    	return false; 
    });

	$("#gallery a").fancybox({
		padding				:	10,
		imageScale			:	true,
		zoomOpacity			:	false,
		zoomSpeedIn			:	0,
		zoomSpeedOut		:	0,
		zoomSpeedChange		:	300,
		easingIn			:	'swing',
		easingOut			:	'swing',
		easingChange		:	'swing',
		frameWidth			:	425,
		frameHeight			:	355,
		overlayShow			:	true,
		overlayOpacity		:	0.4,
		hideOnContentClick	:	true,
		centerOnScroll		:	true,
		itemArray			:	[],
		callbackOnStart		:	null,
		callbackOnShow		:	null,
		callbackOnClose		:	null
	});

});
