$("#form").validate({
		rules: {
			email: "required email"
		},
		messages: {
			email: {
				required:"<br />Please type in your email address.",
				email:"<br />Please type in a valid email address."
			}

		}
	});
function fnDosubmit(){
	if ($("#form").valid()){
		$('#dialog').jqmShow();
		$.postJSON("services/forgotten_password.php",$("#form").serialize(),
			function(data){
				if (data.status=='0'){
					$('.greenboxheader').html('Thank you!');
					$("#form_area").html('<table cellspacing="0px" cellpadding="0px" border="0" style="width:550px;height:300px;"><tr><td></td><p>Your Acorn Ideas password has been mailed to your inbox.</p></tr></table>');
				}else if (data.status=='1'){
					$('#forgot_password_message p').html('The code did not match. Please try again.');
					document.getElementById('captcha').src = 'includes/securimage/securimage_show.php?' + Math.random();
				}else if(data.status=='2'){
					$('#forgot_password_message p').html('Check that your email address is correct.');
					document.getElementById('captcha').src = 'includes/securimage/securimage_show.php?' + Math.random();
				}else{
					$("#form_area").html('<table cellspacing="0px" cellpadding="0px" border="0" style="width:550px;height:300px;"><tr><td></td><p class="error">An error occurred. Sorry for the inconvenience, please try again later.</p></tr></table>');
					document.getElementById('captcha').src = 'includes/securimage/securimage_show.php?' + Math.random();
				}
				$('#dialog').jqmHide();
			});
	}
}
$.postJSON = function(url, data, callback) {
	$.post(url, data, callback, "json");
};