// JavaScript Document

/* FORM VALIDATION ----------------------------------------------------------- */


		function invalids(field){
		
			if (field == ""){  //make sure email field is not empty!!
				return false;
			}
			
			if(field.length < 5){
				return false;
			}
			invalidChars = "/:,;*''!$%^&|{}[]?()#" 
			for (i=0; i<invalidChars.length; i++){//does it contain any invalid chars??
				badChar = invalidChars.charAt(i)
				if (field.indexOf(badChar,0) > -1){
					return false;
				}
			}
		return true;
		}		
			
			
		function validEmail(Email) {
			invalidChars = " /:,;*''!$%^&|{}[]?()#" 
		
			if(Email ==""){  //make sure email field is not empty!!
				return false
			}
			for (i=0; i<invalidChars.length; i++)  {//does it contain any invalid chars??
				badChar = invalidChars.charAt(i)
				if (Email.indexOf(badChar,0) > -1){
					return false
				}
			}
			atPos = Email.indexOf("@", 1)  //make sure that there is at least on at symbol in email address
			if (atPos == -1){
				return false
			}
			if (Email.indexOf("@",atPos+1) != -1) {//make sure there are no more at symbols after the first at symbol
				return false
			}
			periodPos = Email.indexOf(".",atPos)
			if (periodPos == -1) { //check for a period - start looking after the at symbol
				return false
			}
			if (periodPos+3 > Email.length) {  //check to make sure that there are at least 2 characters after the period
				return false
			}
		
			return true
		}	

