function Form_Validator2(theForm)
{
	if (theForm.news1.value == "")
	{
	  alert("Please enter your name.");
	  theForm.news1.focus();
	  return (false);
	}
	if (!allValid(theForm.news1.value)){
        alert("Please enter only letter and numeric characters.");
        theForm.news1.focus();
        return (false);
    }
	if (theForm.news2.value == ""){
    	alert("Please enter your email address.");
    	theForm.news2.focus();
    	return (false);
 	}
	if (!isEmailAddr(theForm.news2.value)){
	    alert("Please enter an email address in the form: name@domain.com");
		theForm.news2.focus();
		return (false);
	}
	if (theForm.news2.value.length < 3){
		alert("Please enter at least 3 characters in the \"email\" field.");
		theForm.news2.focus();
		return (false);
	}

	return true
 }
 
 
 function isEmailAddr(email){var result = false
	var theStr = new String(email)
	var index = theStr.indexOf("@");
	if (index > 0)
	{
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	}
	return result;
}

function allValid(strText) {
    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'- ";
    var checkStr = strText;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++){
        ch = checkStr.charAt(i);
        for (j = 0;  j < checkOK.length;  j++)
            if (ch == checkOK.charAt(j))
            break;
            if (j == checkOK.length){
                allValid = false;
                break;
            }
    }
    return allValid;
}
function allValid2(strText) {
    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'-&:., ";
    var checkStr = strText;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++){
        ch = checkStr.charAt(i);
        for (j = 0;  j < checkOK.length;  j++)
            if (ch == checkOK.charAt(j))
            break;
            if (j == checkOK.length){
                allValid = false;
                break;
            }
    }
    return allValid;
}


function allNumbers(strText) {
    var checkOK = "0123456789+() ";
    var checkStr = strText;
    var allNumbers = true;
    for (i = 0;  i < checkStr.length;  i++){
        ch = checkStr.charAt(i);
        for (j = 0;  j < checkOK.length;  j++)
            if (ch == checkOK.charAt(j))
            break;
            if (j == checkOK.length){
                allNumbers = false;
                break;
            }
    }
    return allNumbers;
}
