jQuery( document ).ready( function( $ ) {
	// Form validation
	$('form').validator({
		message: '' // Don't show any messages, using classes on the input field instead
	});
	$('form').bind('onFail', function(e, errors) {
		if (e.originalEvent.type == 'submit') {
			$.each(errors, function(i,e)  {
				// This will only execute on the first element in the loop
				if( i == 0 )
				{
					$.scrollTo( this.input, 500, {offset:{top:-35}} );
				}
			});   
		}
	});
});
