( function($) {
	$( function() {
		
		// bind click to the submit button
		$("#updatePasswordForm #updatePwdBtn").click( function() {
		});
		
		// bind event to the reset button
		$("#updatePasswordForm #reset").bind("click", function() {
			if (confirm("Are you sure you want to cancel?")) {
				$("#updatePasswordForm").resetForm();
				$("#updateUserForm .general").css("color", "rgb(116, 108, 97)");
				$("#updateUserForm td").css("background-color", null);
				$("#updateUserForm .red").hide();
				$("#error-alert").hide();
				return false;
			} else {
				return false;
			}
		});

		// for enter keyboard submit
		$("#updatePasswordForm :input").each( function() {
			$(this).keypress( function(e) {
				var key = window.event ? e.keyCode : e.which;
				if (key.toString() == "13") {
					$("#updatePasswordForm").submit();
				}
			});
		});
		
		$("#updatePasswordForm #currentPassword").keydown( function() {
			$("#updatePasswordForm #currentPassword").addClass("zip-input");
		});

		$("#updatePasswordForm #password").keydown( function() {
			$("#updatePasswordForm #password").addClass("zip-input");
		});

		$("#updatePasswordForm #confirmPassword").keydown( function() {
			$("#updatePasswordForm #confirmPassword").addClass("zip-input");
		});
		
	});
})(jQuery);
