$(document).ready(function() {
	// If there are errors ...
	if ( errorFields.length ) {	
		// ... give the corresponding field labels an error state
		$('#street-team-application label').each(function(i, label) {
			var fieldAssociation = (label.getAttribute("for") || "").split(",")
			
			fieldAssociation = fieldAssociation;
			
			if ( fieldAssociation.length == 1 ) {
				if ( $.inArray(fieldAssociation[0], errorFields) != -1 ) {
					$(label).addClass("form-error");
				}
			} else if ( fieldAssociation.length > 1 ) {
				$(fieldAssociation).each(function(i, field) {
					if ( $.inArray(field, errorFields) != -1 ) {
						$(label).addClass("form-error");
					}
				});
			}
		});
	}
});