// fading effect for temp site
$(document).ready(function() {
	// find the div.fade elements and hook the hover event
	$('.fadeThis').hover(function() {
		// on hovering over find the element we want to fade *up*
		var fade = $('> .hover', this);

		// if the element is currently being animated (to fadeOut)...
		if (fade.is(':animated')) {
			// ...stop the current animation, and fade it to 1 from current position
			fade.stop().fadeTo(500, 1);
		} else {
			fade.fadeIn(500);
		}
	}, function () {
		var fade = $('> .hover', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(500, 0);
		} else {
			fade.fadeOut(500);
		}
	});

	// get rid of the text
	$('.fadeThis > .hover').empty();


//contact form
$('#contactform').submit(function(){
 
		var action = $(this).attr('action');
 
		$('#submit')
			//.before('<img src="/images/ajax-loader.gif" class="loader" />')
			.attr('disabled','disabled');
 		$('#reset')
			//.after('<img src="/images/ajax-loader.gif" class="loader" />')
			
		$.post(action, { 
			first_name: $('#first_name').val(),
			last_name: $('#last_name').val(),
			email: $('#email').val(),

		},
			function(data){
				$('#contactform #submit').attr('disabled','');
				$('.response').remove();
				$('#contactform').before('<span class="response">'+data+'</span>');
				$('.response').slideDown();
				$('#contactform img.loader').fadeOut(500,function(){$(this).remove()});
				if(data=='<span class="success">Thank you for signing up!</span>') $('#contactform').slideUp();
			}
		);
 
		return false;
 
	});
});