function contact_submit()
{

  // Get the user's input from the form
  var vc_CustomerName = document.getElementById('vc_CustomerName').value;
  var vc_EmailAddress = document.getElementById('vc_EmailAddress').value;
  var vc_Subject = document.getElementById('vc_Subject').value;
  var txt_Message = document.getElementById('txt_Message').value;

  // Clear out any existing error messages
  document.getElementById('req_CustomerName').innerHTML = '';
  document.getElementById('req_EmailAddress').innerHTML = '';
  document.getElementById('req_Message').innerHTML = '';

  // Set the validation flag
  var ValidForm = true;

  // Check the integrity of the customer name
  if( vc_CustomerName.length < 2 )
  {
    document.getElementById('req_CustomerName').innerHTML = 'name is required';
    ValidForm = false;
  }

  // Check the integrity of the email address
  if( vc_EmailAddress.length == 0 )
  {
    document.getElementById('req_EmailAddress').innerHTML = 'email is required';
    ValidForm = false;
  }
  else if( vc_EmailAddress.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1 )
  {
    document.getElementById('req_EmailAddress').innerHTML = 'invalid email address';
    ValidForm = false;
  }

  // Check the integrity of the message
  if( txt_Message.length == 0 )
  {
    document.getElementById('req_Message').innerHTML = 'you must compose a message before sending';
    ValidForm = false;
  }
  else if( txt_Message.length < 10 )
  {
    document.getElementById('req_Message').innerHTML = 'this message is too short';
    ValidForm = false;
  }

  // If the form is still valid after these checks, send it
  if( ValidForm )
    document.getElementById('contact_form').submit();

}
