function checknewemail_1 (strng) {
var error="";
if (strng == "") {
   error = "Missing information. You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address in box #1.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;    
}

function checknewemail_2 (strng) {
var error="";
if (strng == "") {
   error = "Missing information.  Enter the exact email address in the confirmation box as entered above.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address in box #2. \n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters in the confirmation email address box.\n";
       }
    }
//test to compare the with the other email address.

return error;    
}

// exactly one radio button is chosen
// -----------------------------------------------------------------------------------//
function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "Missing information in Step 1. You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address in Step 1.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters in Step 1.\n";
       }
    }
return error;    
}

function checkEmail2 (strng) {
var error="";
if (strng == "") {
   error = "Missing information in Step 2.  Enter the exact email address in the confirmation box as in Step 1.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address in Step 2.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters in Step 2.\n";
       }
    }
//test to compare the with the other email address.

return error;    
}

// exactly one radio button is chosen

function checkchkbox(checkvalue) {
var error = "";
   if (!(checkvalue)) {
       error = "Please select at least one district or select 'Citywide'.\n";
    }
return error;
}


// exactly one radio button is chosen

function checkRadio(checkvalue) {
var error = "";
   if (!(checkvalue)) {
       error = "Please select from one of the options.\n";
    }
return error;
}
function validateEmail1(vfld,   // element to be validated
                         ifld )  // id of element to receive info/error msg
{
  var stat = commonCheck (vfld, ifld, true);
  if (stat != proceed) return stat;

  msg (ifld, "warn", "");  
  return true;
};
