
function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "You didn't enter an email address.\n";
}

//    var emailFilter=/^.+@.+\..{0,3}$/;
//    if (!(emailFilter.test(strng))) { 
//       error = "You didn't enter a valid email address.\n";
//    }
//    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
//    }
return error;    
}


// phone number - strip out delimiters and check for 10 digits

function checkPhone (strng) {
var error = "";
if (strng == "") {
   error = "You didn't enter a phone number.\n";
}

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
    if (isNaN(parseInt(stripped))) {
       error = "The phone number contains illegal characters.";
  
    }
return error;
}


// company name

function checkCompany (strng) {
var error = "";
if (strng == "") {
   error = "You didn't enter a company name.\n";
}
return error;
}       


function checkName(strng) {
var error = "";
if (strng == "") {
   error = "You didn't enter your full name.\n";
}
return error;
}

function checkMailboxes (strng) {
var error = "";
if (strng == "") {
   error = "You didn't enter the number of mailboxes you require. Please estimate if unsure.\n";
}
if (isNaN(strng)) {
   error = "Enter a single numeric value for the number of mailboxes.";
}
return error;
}  

// non-empty textbox

function isEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "The mandatory text area has not been filled in.\n"
  }
return error;	  
}



