function validateFormOnSubmit(theForm) 
{
	var reason = "";
	reason += validateUsertext(theForm.ssUserText);  
	if (reason != "") 
	{    
		alert("Some fields need correction:\n" + reason);			
		return false;
	}
return true;
}



function validateUsertext(fld) 
{var error = "";
var illegalChars = /\W/;     
if (fld.value == "") {        
	fld.style.background = 'Yellow'; 
	error = "You didn't enter a search text.\n";
} else if ((fld.value.length < 1) || (fld.value.length > 30)) {
	fld.style.background = 'Yellow'; 
	error = "Search Text is the wrong length.\n";
	} else if (illegalChars.test(fld.value)) {
			fld.style.background = 'Yellow'; 
			error = "The username contains illegal characters.\n";
	} else {
		fld.style.background = 'White';
	} 
return error;

}