<!--This javascript validates the email address, sent here from the SendIt() function-->

function CheckEmail(addr){
        var badChars = "/*;,:";

        if (addr==""){
                alert("Email address is missing!");
                return (false)
        }

        for (i=1; i < badChars.length; i++) {
                badun = badChars.charAt(i);

                if(addr.indexOf(badun,0) != -1) {
                        alert("Email address contains an invalid Character");
                        return(false);
                        }
                }
        WheresAt = addr.indexOf("@",0);

                if(WheresAt == -1) {
                        alert("Email address must contain the '@' sign")
                        return(false);
                        }
        return(true);
}


<!--Javascript for validating the name goes here. Call it from SendIt()-->


<!--This function creates the window for feedback from CGI form-->
function do_windows(){
	var new_window=window.open("","temp","height=200,width=200,left=50,top=50")
	newcontent="<html><head><title>Thanks</title></head><body>"
	newcontent += "</body></html>"
	new_window.document.write(newcontent)
	}
	
function SendIt(newsltr) {
	if((newsltr.Name.value == "")||(newsltr.Name.value =="Name")) {
		alert("Please enter your name.");
		newsltr.Name.focus();
		newsltr.Name.select();
		return(false);
		}
        if(!CheckEmail(newsltr.Email.value)) {
                newsltr.Email.focus();
                newsltr.Email.select();
                return(false)
        } else {
		do_windows();
		return(true) 
        }
}
