// validate abstract fields not empty

function checkSems() 
{
    with ( window.document.frmsems )
    {
    var why = "";
    why += isEmpty(sems_name.value,"Name");
    why += isEmpty(sems_org.value,"Organization");
    why += isEmpty(sems_email.value,"Email");
    why += checkEmail(sems_email.value,"Email");
    if (why != "") {
       alert(why);
       return false;
    		}
    }
return true;
} // end function

// check for simple valid email address

function checkEmail(strng) {
var error="";
if (strng == "") { 
//return true; 
} else {
//	error = "You didn't enter an email address.\n\n"; }

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n\n";
       }
    } }
return error;    
} // end function

// non-empty textbox

function isEmpty(strng,field) {
var fld = field;
var error = "";
  if (strng.length == 0) {
     error = "The mandatory text area \"" + fld + "\" has not been filled in.\n\n"
  }
return error;	  
} // end function
