function validatemaincontactform() 
{
  var sError = "";

  if ($("#ctl00_ctl00_cph_main_contactname").val().trim().length == 0)
    sError += "\r\n - Your name is a required field.";

  if (!$("#ctl00_ctl00_cph_main_contactemail").val().trim().isEmail())
    sError += "\r\n - Email address is a required field.";

  if ($("#ctl00_ctl00_cph_main_contactphone").val().trim().length == 0)
    sError += "\r\n - Your phone is a required field.";

  if (sError.length > 0)
    alert("The form was not completed correctly:" + sError);
  else {
    $("#aspnetForm").submit();
  }
}

