function checkWholeForm(theForm,q1,q2,q3) {
	var why = "";
	why += nameEmpty(theForm[q1].value);
	why += companyEmpty(theForm[q2].value);
	why += emailEmpty(theForm[q3].value);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

function nameEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your name.\n"
  }
return error;	  
}

function companyEmpty(strng) {
var error = "";
  if (strng.length == 0) {
     error = "Please enter your company.\n"
  }
return error;	  
}

function emailEmpty (strng) {
	var error="";
	if (strng == "") {
   		error = "Please enter your e-mail address.\n";
	} else {
		var emailFilter=/^.+@.+\..{2,3}$/;
		if (!(emailFilter.test(strng))) { 
		   error = "Please enter a valid e-mail address.\n";
		} else {    
			//test email for illegal characters
			var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
			if (strng.match(illegalChars)) {
				error = "The e-mail address contains illegal characters.\n";
			}	
		}
	}
return error;    
}

