var sent=false;
function fnDosubmit(){
	if ($("#form").valid()){
		if (!sent){
			sent = true;
			$('#dialog').jqmShow();
			$.postJSON("services/send_message.php?type=feedback",$("#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>Thank you. Your feedback has been passed on to the Acorn Ideas team.</p></tr></table>');
					}else if (data.status=='1'){
						$('#feedback_message p').html('The code did not match. Please try again.');
						document.getElementById('captcha').src = 'includes/securimage/securimage_show.php?' + Math.random();
						sent = false;
					}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>');
					}
					$('#dialog').jqmHide();
				}
			);
		}
	}
}
$.postJSON = function(url, data, callback) {$.post(url, data, callback, "json");};