$(function(){
	
	var form = $('#contact_form');
	
	// Focus the first input or error field
	$('input:first').focus();
	$('form .highlight:first').next().focus();
	
	// Flash the errors
	form.find('.highlight').each(function() {
		$(this).animate({ opacity: .5 }, 500, function() {
			$(this).animate({ opacity: 1 }, 300, function() {
				$(this).animate({ opacity: .5 }, 300, function() {
					$(this).animate({ opacity: 1 }, 300);
				});
			});
		});
	});
	
});