var reEmail=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
var reText=/^([a-zA-Z0-9 \-']{2,30})+$/

//*************************************************************************************************
function validateFeedback(){  
  var ErrorMessage='';
  var FirstError='';
  if (!reText.test(document.forms.mainform.f_name.value)){
    ErrorMessage+="\n - First Name";
    if (FirstError=='') FirstError='f_name';
  }
  if (!reEmail.test(document.forms.mainform.f_email.value)){
    ErrorMessage+="\n - Email";
    if (FirstError=='') FirstError='f_email';
  }
  if (document.forms.mainform.f_comment.value==''){
    ErrorMessage+="\n - Comment";
    if (FirstError=='') FirstError='f_comment';
  }
  if (ErrorMessage==''){
    document.forms.mainform.action.value='SubmitContactRequest';
    document.forms.mainform.submit();
  }else{
    alert('You are required to complete the following fields: '+ErrorMessage);
    document.forms.mainform[FirstError].focus();
  }
}

//*************************************************************************************************
function SP(){
  if (document.forms.mainform.q.value.length<3){
    alert('Please enter min 3 chars');
    document.forms.mainform.q.focus();
    return false;
  }else{
    document.forms.mainform.page.value='Search';
    document.forms.mainform.submit();
  }
}