var formName = "email_service.form";
var successMessage = "<p><b>Thank you.</b></p>" 
	+ "<p>An e-mail has been sent to our Client Service team. You will be contacted soon regarding the status of your registration.</p>";

var errorMessage = "<p>There was a problem with your registration. We apologize for any inconvenience."
	+ "You may either return to the <a href='/support/e-mail_updates/'>registration form</a>, or contact Client Service at one of <a href='/about/client_service_contacts.html'>our 24 Hour Client Service Lines</a>. </p>";

$( function() {
	handleForm(formName, successMessage, errorMessage, {
		rules : {
			preferences : "required"
		},
		errorPlacement : function(error, element) {
			if (element.attr("name") == "preferences")
				error.insertAfter($("table#preferences"));
			else
				error.insertAfter(element);
		},
		messages : {
			preferences : {
				required : "Please choose at least one of the above options."
			}
		}
	});
});