//Form Validator
   function donateValidator(form)
	 {
										
				if(notEmpty(form.bill_first_name.value)== false){
         alert("First name is required.");
         form.bill_first_name.focus();
         return false;
      }
      
				if(notEmpty(form.bill_last_name.value)== false){
         alert("Last name is required.");
         form.bill_last_name.focus();
         return false;
      }
			 if(notEmpty(form.bill_address_one.value)== false){
         alert("Address is required.");
         form.bill_address_one.focus();
         return false;
      }
			
			if(notEmpty(form.bill_city.value)== false){
         alert("City is required.");
         form.bill_city.focus();
         return false;
      }
			
			if(validateZip(form.bill_postal_code.value)== false)
			{
         alert("Enter a valid zip code.");
         form.bill_postal_code.focus();
         return false;
     }
			
			if(validateState(form.bill_state_or_province.value)== false)
			{
         alert("Enter your state.");
         form.bill_state_or_province.focus();
         return false;
      }
							
			if(validateEMail(form.bill_email.value)==false)
			{
         alert("Enter a valid E Mail address.");
         form.bill_email.focus();
         return false;
      }
      form.bill_email.value = 
        strip(" \n\r\t",form.bill_email.value);	
			
			if(validateUSPhone(form.bill_phone.value)==false)
			{
         alert("Enter a valid phone number.");
         form.bill_phone.focus();
         return false;
      }
		 if((form.accept.checked)==false){
							alert("Please accept the terms regarding storing information.");
     							form.accept.focus();
										return false;
				}
		 			       
   }
	 
//Validation Rules
   function notEmpty(str){
      if(strip(" \n\r\t",str).length ==0)
         return false;
      else
         return true;
   }
   function validateInteger(str){
      str = strip(' \n\r\t',str);
      //remove leading zeros, if any
      while(str.length > 1 && str.substring(0,1) == '0'){
         str = str.substring(1,str.length);
      }
      var val = parseInt(str);
      if(isNaN(val))
         return false;
      else
         return true;
   }
   
   function validateFloat(str){
      str = strip(' \n\r\t',str);
      //remove leading zeros, if any
      while(str.length > 1 && str.substring(0,1) == '0'){
         str = str.substring(1,str.length);
      }
      var val = parseFloat(str);
      if(isNaN(val))
         return false;
      else
         return true;
   }


   function validateUSPhone(str){
      str = strip("*() -./_\n\r\t\\",str);
      if(str.length == 10 || str.length == 7)
         return true;
      else
         return false;
   }
   
   function validateZip(str){
      str = strip("- \n\r\t",str);
      if(validateInteger(str) && (str.length==9 || 
         str.length==5))
      return true;
      else
         return false;
   }

	 function validateState(str){
	    if (str == "none")
							return false;
	 }
	 
	 
   function validateEMail(str){
      str = strip(" \n\r\t",str);
      if(str.indexOf("@") > -1 && str.indexOf(".") > -1)
         return true;
      else
         return false;
   }
   //End Validation Rules
