$(function(){
	$("#fSignUp").validate({
		rules: {
			fEmail: {
				email: true,
				required: true
			}
		},
		messages: {
			fEmail:{
				email: "Please enter a valid email address.",
				required: "Please enter a valid email address."
			}
		}
	});

	/* Sets initial state if there is content in the search box. */
	if (jQuery.trim($('#fEmail')[0].value).length != 0) {
		$('#fSignUpLabel').addClass('hidden');
	}

	/* Hide the label when the input gets focus */
	$('#fEmail').focus(function() {
		$('#fSignUpLabel').addClass('hidden');
	});

	/* Show the label when the input loses focus if it's empty */
	$('#fEmail').blur(function() {
		if (jQuery.trim(this.value).length == 0) {
			$('#fSignUpLabel').removeClass('hidden');
		}
	});

});
