function sendConsult()
{

  var msg = '';

  if ($F('firstname').empty() || $F('lastname').empty())
  {
    msg += '- Contacting the name has to fill in.' + '\n';
  }
	
  
  if ($F('email').empty())
  {
    msg += "- E-mail can't be empty!" + '\n';
  }
  else
  {
    REstr = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/;
    if (!REstr.test($F('email')))
    {
        msg += '- The E-mail format is incorrect! ' + '\n';
    }
  }
  
  if ($F('spcontent').empty())
  {
    msg += "- You didn't fill in a consultation content." + '\n';
  }
  
  if (msg.length > 0)
  {
    alert(msg);
  }
  else
  {
    var url = 'common.php?step=send_consult';

    new Ajax.Request(url, {
                     method: 'post',
                     parameters: $("ConsultInfo").serialize(),
                     onLoading: showLoader,
                     onComplete: hideLoader,
                     onSuccess: sendConsultResponse});
  }
}

function sendConsultResponse(result)
{

  var result = result.responseText.evalJSON(true);
  if (result.error > 0)
  {
    alert(result.message);
  }
  else
  {
    alert("The system has already forwarded the data that you fill-in, we will contact you as soon as possible. ");
    Form.reset('ConsultInfo');
  }
}