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 validateData() {
    var check =  this.document.literaturerequest;
    var invalid = " "; // Invalid character is a space
    var minLength = 4; // Minimum length
    var email =check.email.value;
            
    if (check.name.value == '') {
        alert ("Please enter your name.");
        check.name.focus();
        return (false);
    }
            
    if (!isEmailAddr(email)){
        alert("Please enter a complete email address in the form: yourname@yourdomain.com");
        check.email.focus();
        return (false);
    }
    
    if (check.address.value == '') {
        alert ("Please enter your address.");
        check.address.focus();
        return (false);
    }  
    
    if (check.phone.value == '') {
        alert ("Please enter your telephone number.");
        check.phone.focus();
        return (false);
    }     
            
    if (check.city.value == '') {
        alert ("Please enter the city name.");
        check.city.focus();
        return (false);
    }
    
    if (check.state.value == '') {
        alert ("Please enter the state/province name.");
        check.state.focus();
        return (false);
    }
    
    if (check.zip.value == '') {
        alert ("Please enter the zip/postal code.");
	check.zip.focus();
	return (false);
    }
    
    if (check.country.value == '') {
        alert ("Please enter the country name.");
    	check.country.focus();
    	return (false);
    }
    
    var chkRequest = -1;    
    for (var i=0; i < check.request.length; i++) {
    	if (check.request[i].selected) {
    		chkRequest = i;     		
     	}
    }
    
    
    if (chkRequest < 1) {
    	alert("Please select the requsted material.");
    	check.request[0].focus();
    	return (false);
    }
    
    check.submit();
}
