<SCRIPT LANGUAGE="JavaScript"><!--

     //function to determine if all required fields are filled in.  Will check each field to see
     //in there is an empty value. If empty value will alert user to fill in the blank field.

	
     function DataCheck()
      {
       if ((document.studentid.Name.value=="")||(document.studentid.student_id.value=="") || (document.studentid.phone.value==""))
         {
         alert ("Please fill in all fields!")
		 
         return false
         }
 		
		 window.blur();
		myWindow = window.open ("info_submit.html","UMSL"," location=yes,toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,focus=yes,height=400,width=750");
onSubmit="return true;"

return true;
      }

var digits = "0123456789";

var lowercaseLetters = "abcdefghijklmnopqrstuvwxyz"

var uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"



// Returns true if character c is a digit 
// (0 .. 9).




// Returns true if character c is a letter or digit.

function isLetterOrDigit (c)
{   return (isLetter(c) || isDigit(c))
}





     //function that will be called by other functions to verify that theChar variable is a
     //character.
 
     function isLetter(theChar)
      {
       return ( ((theChar>="a") && (theChar<="z"))||((theChar>="A") && (theChar<="Z")) || (theChar==" ") )
      } 


     //function that will be called by other functions to verify that Digit is one of the
     //characters 0, 1, ..., 9.
 
     function isDigit(theChar)
      {
       return ((theChar >= "0") && (theChar <= "9")) 
      }  


     

     //function called by form to verify that the first name entered //(the string) is all
     //characters.  This function also calls function isLetter() //defined above.

     function isValidName(form)
      { 
       var theName = new String(document.studentid.Name.value)
       var theChar
       var i;

       for (var i = 0; i < theName.length; i++)
         { 
          theChar = theName.charAt(i)
          if ( !isLetter(theChar) )
            {
             alert("Not an appropriate form.  Please re-enter using only letters.")
             document.studentid.firstname.focus()
             document.studentid.firstname.select()
             return false
            }
         }
       return true
      } 


     //function called by form to verify that the last name entered (the string) is all
     //characters.  This function also calls function isLetter() defined above.

     

     //function called by form to verify that the phone number entered (the string) is all
     //numeric.  This function also calls function isDigit() defined above.

     function isValidPhoneNumber(form)
      { 
	    var theNumber = new String(document.studentid.phone.value)
	    var theChar
        var i;


       for (var i = 0; i < theNumber.length; i++)
         { 
          theChar = theNumber.charAt(i)
	          if ( !isDigit(theChar) && !(theChar=='-') )
	            {
					alert("Not in the appropriate form.  Please use only numerical data.")
					document.studentid.phone.focus()
					document.studentid.phone.select()
				return false
				}
			}
			return true;
       } 


 function isValidwPhoneNumber(form)
      { 
	    var theNumber = new String(document.studentid.wphone.value)
	    var theChar
        var i;


       for (var i = 0; i < theNumber.length; i++)
         { 
          theChar = theNumber.charAt(i)
	          if ( !isDigit(theChar) && !(theChar=='-') )
	            {
					alert("Not in the appropriate form.  Please use only numerical data.")
					document.studentid.wphone.focus()
					document.studentid.wphone.select()
				return false
				}
			}
			return true;
       } 





function isEma(form)

{ 
	    var theNumber = new String(document.studentid.saddress.value)
	    var theChar
			    	var sLength = theNumber.length -1;
        var i;
		var checked=0;


       for (var i = 0; i < theNumber.length; i++)
         { 
          theChar = theNumber.charAt(i)
	          if ( !isDigit(theChar) && !(theChar=='@') && !isLetter(theChar) && !(theChar=='.') )
	            {
					alert("Not in the appropriate form.  Please enter in the informed@company.country format.")
					document.studentid.elec_mail.focus()
					document.studentid.elec_mail.select()
				return false
				}
		
			if ((i == sLength) && (theChar == "@"))  	
				{	alert("You must enter a node name (such as informs.org) after the @")
					document.studentid.elec_mail.focus()
					document.studentid.elec_mail.select()
				return false}
				
			 if ((i >= 2) && (theChar == "@"))
		    {checked = 1;  return true}	
				
				
		 	// there must be >= 1 character before @, so we
    		// start looking at character position 1 
    		// (i.e. second character)
			
			if ((i <= 1) && (theChar == "@"))
				{
					alert("You must enter an account number (such as my.name) before the @")
					document.studentid.elec_mail.focus()
					document.studentid.elec_mail.select()
				return false
				}
				
			if ((i == sLength) && (checked != 1))  	
			{	alert("Not in the appropriate form.  Please enter in the foo@bear.com format.")
					document.studentid.elec_mail.focus()
					document.studentid.elec_mail.select()
				return false}
				
			
		
	
				
				
}
return true;
}
	  	

   //--></script>	
   
<SCRIPT LANGUAGE="JavaScript"><!--
   //email results of form to committee
   //check for format of browser first
    var version = parseInt(navigator.appVersion);
    var browser = navigator.appName.indexOf("Microsoft") + 1;
   
    function sendIt() 
    {
        if ((browser == "0") && (version >= "3")) {
            document.registerForm.encoding = 'text/plain';
            document.registerForm.action = 'mailto:Vicki.Sauter@umsl.edu';
        }
        return true;
    }
  //--></script>