var ajax=new ajaxWrapper(validateCode,ajaxError);function validate_contactus(){var uname=document.getElementById('uname').value;var email=document.getElementById('email').value;var subject=document.getElementById('subject').value;var comment=document.getElementById('comment').value;var verify=document.getElementById('security_num').value;if((trim(uname).length)==0){alert("Please enter Name");document.getElementById('uname').focus();return false;}
if(!ValidateEMail(trim(email))){alert("Please enter Valid email");document.getElementById('email').focus();return false;}
if((trim(subject).length)==0){alert("Please enter subject");document.getElementById('subject').focus();return false;}
if((trim(comment).length)==0){alert("Please enter Comments");document.getElementById('comment').focus();return false;}
if((trim(verify).length)==0){alert("Please enter the code shown");document.getElementById('security_num').focus();return false;}
else{ajax.ajax_doGet("virtual-tour-contactus.php","code="+document.getElementById("security_num").value);return false;}}
function ajaxError(err){alert(err);}
function validateCode(data){if(data==1){document.getElementById("ispostback").value=1;document.getElementById("contactusform").submit();}
if(data==0){alert("The code you entered is incorrect, please try again.");return false;}}