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'){
						$("#form_area").html("<img src=\"images/spacer.gif\" width=\"1\" height=\"80\" border=\"0\" alt=\"\" /><h1 align=\"center\">Mail Sent. Thank You!!!</h1><img src=\"images/spacer.gif\" width=\"1\" height=\"100\" border=\"0\" alt=\"\" />");
					}else if (data.status=='1'){
						alert('The code did not match. Please try again.');
						document.getElementById('captcha').src = 'includes/securimage/securimage_show.php?' + Math.random();
						sent = false;
					}else{
						alert('An error occured, please try again later.');
					}
					$('#dialog').jqmHide();
				}
			);
		}
	}
}
$.postJSON = function(url, data, callback) {$.post(url, data, callback, "json");};