$(document).ready(function() {
	$('.text').click(function() {
		$('.text').parent().removeClass('highlight');
		$(this).parent().addClass('highlight');
	});
});

jQuery(function() {
	// show a simple loading indicator
	var loader = jQuery("#loader");
	jQuery().ajaxStart(function() {
		loader.show();
	}).ajaxStop(function() {
		loader.hide();
	}).ajaxError(function(a, b, e) {
		throw e;
	});
	
	var v = jQuery("#contactForm form").validate({
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				success: doSuccess
			});
		}
	});
});


function doSuccess(){
	$('#loader').fadeOut('fast');
	$('#contactForm').fadeOut('slow', function() {
		$('#success').fadeIn('slow');
	});
}