$(document).ready(function() {
		// SHOW THE PASSWORD STRENGTH METER
	// OR DON'T :( $(".pwstrengthpara").show()
	
	$("a.newwin").attr("target","_blank");
	
	// REMOVE DEFAULTS
	$("#UserForename, #UserSurname").focus(function() {
		if ($(this).val() == "Forename" || $(this).val() == "Surname") {
			$(this).val("");
		}
	}).blur(function() {
		if ($(this).val() == "") {
			// $(this).val($(this)[0].defaultValue);
		}
	});
	
	$("#UserForename")[0].focus();	
	
	// VALIDATION
	$("#signupform").validate({
		rules: {
			UserForename: { required: true },
			UserSurname:  { required: true },
			UserEmail:    { required: true, email: true },
			pass1:        { required: true, minLength: 6, maxLength: 12 },
			agreetc:      { required: true }
		},
		messages: {
			UserForename: "Please enter your forename",
			UserSurname:  "Please enter your surname",
			UserEmail:    "Please supply your e-mail address",
			pass1: {
				required:  "A password must be supplied",
				minLength: "The supplied password is too short - it must be at least 6 characters",
				maxLength: "The supplied password is too long - it must be at most 12 characters"
			},
			agreetc:     "You must indicate you have accepted our terms and conditions"
		},
		errorLabelContainer: $("#signuperrors"),
		wrapper: "p"
	});
});
