<!--


function CheckEmail(Email) {
 filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
 return filter.test(Email); 
}
function CheckPhone(Phone) {
filter=/^\d+$/;
 return filter.test(Phone); 
}



/* Form validating function.
It is bound to the given form object.
It MUST NOT accept any parameters.
In case form data is invalid, function SHOULD inform user about this fact, and MUST RETURN FALSE.
Otherwise function MUST RETURN TRUE. */
function SubmitContactForm() {
 if ((this.Firstname.value== '') || (this.Lastname.value== '') || (this.Phone.value== '') ||(this.Email.value == '') || (this.Inquiry.value == '') ) {
  alert('At least one of the required fields is empty. Until all the required fields are filled with the proper data, form submitting is unavailable.');
  return false;
 } 
 else if (!CheckEmail(this.Email.value)) {
  alert('Email address format is incorrect.');
  return false;
 }
 else if (!CheckPhone(this.Phone.value)) {
   alert('Phone number should consist of digits only.');
   return false;
 }
 return true;
}

function SubmitFraudForm() {
 if ((this.Name.value== '') ||(this.Description.value== '') ||(this.Property.value== '')) {
  alert('At least one of the required fields is empty. Until all the required fields are filled with the proper data, form submitting is unavailable.');
  return false;
 } 
 return true;
}

function SubmitMaintenanceForm() {
 if ((this.Name.value== '') ||(this.Address.value== '') ||(this.Phone.value== '')||(this.Description.value== '')) {
  alert('At least one of the required fields is empty. Until all the required fields are filled with the proper data, form submitting is unavailable.');
  return false;
 } 
 else if (!CheckPhone(this.Phone.value)) {
    alert('Phone number should consist of digits only.');
    return false;
 }
 return true;
}

function SubmitApplyForm() {
 if ((this.Firstname.value== '') ||(this.Email.value== '') ||(this.Telephone.value== '') ||(this.Lastname.value== '') || (this.Position.value== '') || (this.Resume.value == '') ) {
  alert('At least one of the required fields is empty. Until all the required fields are filled with the proper data, form submitting is unavailable.');
  return false;
 } 
 else if (!CheckEmail(this.Email.value)) {
  alert('Email address format is incorrect.');
  return false;
 } 
 return true;
}


-->
