var ResetPW = {
	getEmail:function() {
		new Ajax.Request(engineURL, {
			method:'get',parameters: { control:'resetpw',email:$('email').value},onSuccess:function(trans) {
				if (trans.responseText == 1) {
					window.location='/resetpw/sent';	
				}
				else { $('error').update(trans.responseText); }
			}
		});
	},
	updatePassword:function() {
		if ($('password1').value!=$('password2').value) {
			window.alert('Your passwords don\'t match. Please try again.');
			return false;
		}
		new Ajax.Request(engineURL, {
			method:'get',parameters: { control:'resetpw',key:$('key').value,password1:$('password1').value,password2:$('password2').value},onSuccess:function(trans) {
				if (trans.responseText == 1) {
					window.location='/resetpw/finish';	
				}
				else { $('error').update(trans.responseText); }
			}
		});
	}
};
