<!-- 
var whitespace = " \t\n\r";

function isValidEmail(elementValue){  
	var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  
	return emailPattern.test(elementValue);  
}  
 
function isEmpty(s)
{   
	return ((s == null) || (s.length == 0))
}

function checkForm() { 

	z=0;
	celements=document.getElementsByName('lid');
		for (c=0;c<celements.length;c++){
		if (celements[c].checked){
			z=z+1;
			}
		}
	if (z<1){
	alert("Please select at least one list.");
		return false;
	}

	if (isEmpty(document.subscribeForm.elements['Full Name'].value)) {
		document.subscribeForm.elements['Full Name'].style.backgroundColor='yellow';
		alert("Please enter your Full Name.");
		document.subscribeForm.elements['Full Name'].focus();
		return false;
	}

	if (isEmpty(document.subscribeForm.elements['Company Name'].value)) {
		document.subscribeForm.elements['Company Name'].style.backgroundColor='yellow';
		alert("Please enter your Company.");
		document.subscribeForm.elements['Company Name'].focus();
		return false;
	}

	if (!isValidEmail(document.subscribeForm.elements['Email Address'].value)) {
	document.subscribeForm.elements['Email Address'].style.backgroundColor='yellow';
		alert("Please enter a valid Email Address. (name@host.com)");
		document.subscribeForm.elements['Email Address'].focus();
		return false;
	}
}


function checkColumnsForm() { // RJS 2011-05-18 testing renaming lid to lid[] for php form handler that splits full name into F/L names (PHP requires "[]" field name suffix for arrays)

	z=0;
	celements=document.getElementsByName('lid[]');
		for (c=0;c<celements.length;c++){
		if (celements[c].checked){
			z=z+1;
			}
		}
	if (z<1){
	alert("Please select at least one list.");
		return false;
	}

	if (isEmpty(document.subscribeForm.elements['Full Name'].value)) {
		document.subscribeForm.elements['Full Name'].style.backgroundColor='yellow';
		alert("Please enter your Full Name.");
		document.subscribeForm.elements['Full Name'].focus();
		return false;
	}

	if (isEmpty(document.subscribeForm.elements['Company Name'].value)) {
		document.subscribeForm.elements['Company Name'].style.backgroundColor='yellow';
		alert("Please enter your Company.");
		document.subscribeForm.elements['Company Name'].focus();
		return false;
	}

	if (!isValidEmail(document.subscribeForm.elements['Email Address'].value)) {
	document.subscribeForm.elements['Email Address'].style.backgroundColor='yellow';
		alert("Please enter a valid Email Address. (name@host.com)");
		document.subscribeForm.elements['Email Address'].focus();
		return false;
	}
}
//--> 

