$.fn.validate = function() {
	var effect = 'slideDown'; // Pick default effect
	var speed = 'fast'; // Choose default speed
	this.submit(function(e) {
		$('.error').remove();
		var er = 0;
		// Simple empty field validation
		$('.required').each(function (i) {
			var v = $(this).val();
			var mID = $(this).attr('id');
			if (v == '') {
				// Format the Error div
				var html = '<span class="error">Please complete this field</span>';
				$('#'+this.id).after(html);
				//Set focus to field with error
				$('#'+this.id)[0].focus();
				er++;
			}else{
				// Remove error class
				//$('#'+this.id).removeClass('errorField');
			}
		});
		// Call Error effect
		$('div.error')[effect](speed);
		// Catch Submit Event on Error
		if (er) {
			alert('Please complete the fields in red!');
			e.preventDefault();
		}
	});
}