<!--Hide


function validEmail(email) {       				 //VALIDATION OF FORM
	invalidChars = " /:,;"

	if (email == "") {							// Must be filled in
		return false
	}
	for (i=0; i<invalidChars.length; i++) {		// Check to see if it contains illegal characters
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0)> -1) {
			return false
		}
	}
	atPos = email.indexOf("@",1)				// There must be one "@" symbol
	if (atPos == -1) {
		return false
	}
	if (email.indexOf("@",atPos+1) != -1) {		// And only one "@" symbol
		return false
	}
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) {						// And at least one "." after the "@"
		return false
	}
	if (periodPos+3> email.length)	{			// Must be at least 2 characters after the "."
		return false
	}
	

return true;	

}


function valform(form){

whatState = form.State.selectedIndex;
howFindus = form.FindWebSite.selectedIndex;
whatMethod = form.PaymentMethod.selectedIndex;
taxOption = -1;
    
    for (i=0; i<form.taxapply.length; i++) {
       if (form.taxapply[i].checked) {
       taxOption = i;
       }
       }
       if (taxOption == -1) {
       alert("You must select a Maine Sales Tax option.  If you are not a resident of Maine, please select NO.  If you are a resident of Maine please select YES.  Thank you.");
       window.location = "#shipping";
       return false;
           }

    if (form.PaymentMethod.options[whatMethod].value == "") {
    	  alert("Please enter how you will pay for your order. Thank you.");
    	  form.PaymentMethod.focus();
    	  return false;
             }
 
     if (form.FirstName.value == "") {
            alert("Please enter your first name.  Thank you.");
            form.FirstName.focus();
            return false;
            }
            
     if (form.LastName.value == "") {
            alert("Please enter your last name.  Thank you.");
            form.LastName.focus();
            return false;
            }
            
     if (form.Address.value == "") {
            alert("Please enter your Street Address (We do not deliver to P.O. Boxes). Thank you.");
            form.Address.focus();
            return false;
            }
            
     if (form.City.value == "") {
            alert("Please enter your City.  Thank you.");
            form.City.focus();
            return false;
            }
         
          
     if (form.State.options[whatState].value == "") {
	  alert("Please enter your State. Thank you.");
	  form.State.focus();
	  return false;
             }
                      
         
            
    if (form.Zip.value == "") {
	    alert("Please enter your Zip Code.  Thank you.");
	    form.Zip.focus();
	    return false;
            }
            
      if (!validEmail(form.email.value)) {
            alert("Please enter a valid e-mail address.  Thank you.");
            form.email.focus();
             return false;
	    }       
            
     if (form.DayPhone.value == "") {
            alert("Please enter your Day Telephone number.  Thank you.");
            form.DayPhone.focus();
            return false;
            }
            
     if ((form.total.value == "") || (form.total.value == "$0.00")) {
            alert("You did not order anything???")
            window.location= "#orderinfo";
            return false;
            }
            
     else if (form.FindWebSite.options[howFindus].value == "")    {
     	    alert("Please indicate how you found out about our web site. Thank you.");
     	    form.FindWebSite.focus()
     	    return false;
     	    }            
     
              
         details = ("Click on the CANCEL button if you would like to review your Order one last time.\n\nClick on the OK button if your wish to submit your order now.");
     	
	
     	  if (!confirm(details)) {
     	  
     	  return false;
     	  form.FirstName.focus();
     	  
     	  }
     	  
     	  else {
     	  
     	  alert("We are now sending you to your print out page. Please follow final instructions to complete your order on that page.  Thank you.");
	      
	  return true;
	  
	  }
	        
	
	        
	}
	
       
  
  
//End Hide-->


