$(document).ready(function(){
	xajax_loadCaptcha();
	$('#btnSubmit').click(function(){
		var isnoterror = true;
		validate.firstscroll = '';
		if (validate.valEmpty('txtName','errtxtName','Please fill in your name') == false){isnoterror = false;}
		if (validate.valEmail('txtEmail','errtxtEmail','Please fill in your email') == false){isnoterror = false;}
		if (validate.valEmpty('txtSubject','errtxtSubject','Please fill in subject') == false){isnoterror = false;}
		if (validate.valEmpty('txtMemo','errtxtMemo','Please fill in memo') == false){isnoterror = false;}
		if (validate.valEmpty('txtcaptcha_private_key','errtxtcaptcha_private_key','Please fill in letter above') == false){isnoterror = false;}
		if (isnoterror){
			xajax_sendMemo($('#txtName').val(),$('#txtEmail').val(),$('#txtSubject').val(),$('#txtMemo').val(),
					$('#hidcaptcha').val(),$('#hidcaptcha_public_key').val(),$('#txtcaptcha_private_key').val());
		}else{mform.scrolltoform(validate.firstscroll);}
	});
});
