// JavaScript Document
 var bSaving = false;
	function validate(register) {

        if (bSaving) {
		   
            bSaving = false; // reset
			goemail = true;
            var msg = '';

			if (document.contact.first_name.value == '') {
                msg += 'First Name is missing.\n';
            }
			
			if (document.contact.last_name.value == '') {
                msg += 'Last Name is missing.\n';
            }
			
			if (document.contact.address.value == '') {
                msg += 'Address is missing.\n';
            }
			
			if (document.contact.city.value == '') {
                msg += 'City is missing.\n';
            }
			
			if (document.contact.state.value == '') {
                msg += 'State is missing.\n';
            }
			
			if (document.contact.zip_code.value == '') {
                msg += 'Zip Code is missing.\n';
            }
						
			if(document.contact.email.value==''){
			msg += 'Email is missing.\n';
			goemail = false
            }			
		  
		  if (document.contact.daytime_phone.value == '') {
                msg += 'Daytime Phone is missing.\n';
            }
			
			
			
			

			
			
			  str = document.contact.email.value
			  checkdot = str.indexOf(".")
			  checkarb = str.indexOf("@")
			  if(goemail){
              if((checkdot<=-1) || (checkarb<=-1)){
			  msg += 'Please use a valid Email Address.\n';
			  }
			  }

            if (msg != '') {
                msg = 'The following errors were found:\n\n' + msg;
                alert(msg);
                return false;
            } else {
                return true;
            }
		}
		}