
   
	
function isEmpty(s){
             return ((s == null) || (s.length == 0))
             }

function isWhitespace(s){
         if (isEmpty(s)) return true;
 
    // Search through string's characters one by one
    for (var i = 0; i < s.length; i++) {   
        var whitespace = " \t\n\r";
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
    // All characters are whitespace.
    return true;
}
	
function list_click(df1){
               
         
        if (checkForm(df1)!=true)
           {
            return false;
           }
        document.defaultsForm.submit();
        return true;
}


function getbusiness(){
        return "howard";
		}
        
        

function checkForm(df) 
       {
	
        return true;

  	if (df.church.value.length == 0  && 
        df.minister.value.length == 0)
		
         {
          alert("Please supply a Church or Minister\n");
      		return false;
         }  	 
	
		if ( isWhitespace(df.church.value) && isWhitespace(df.minister.value))   
		
         {
          alert("Please supply a Church or Minister\n");
      		return false;
         }  	 
		
		
		 return true;
		 }

function list_click2(df1){
                
      //alert('We are sorry but submission is temporally down for maintenance. Please check back later.');
      //return false;

        if (checkForm2(df1)!=true)
           {
            return false;
           }
        document.defaultsForm.submit();
        return true;
}
   
function checkPhone(arg1) {
var stripped = arg1.replace(/[\(\)\.\-\ ]/g, '');
//strip out acceptable non-numeric characters
if (isNaN(parseInt(stripped))) {
   alert('The phone number contains illegal characters.');
   return false;
}

if (!(stripped.length == 10)) {
	alert('The phone number is the wrong length. Make sure you included an area code');
              return false;
             }
     
//function checkBlanks(strng) {
// var error = "";
// if (strng == "") 
//   {
//    alert('You didn't enter a name');
//   return false;
 //  } 

return true;
}
 

function checkForm2(df) 
       {
	
//var Comments2=document.defaultsForm.state.options.selectedIndex;
var type_idx=df.denomination.options.selectedIndex;
var state_idx=df.state.options.selectedIndex;
//var emailFilter="/^-.+@.+\..{2,3,4,6}$/";

//var myresult=df.state.value;

   if (checkPhone(df.TelBus.value)!=true)
           {
            return false;
           }

//   if (checkBlanks(df.ORG_NAME.value)!=true)
//          {
//           return false;
//          }
var email_val=df.EMAIL.value;
     alert(df.EMAIL.value);

      if (!(ereg("^.+@.+\..+$",email_val))) 
      {
        alert('Please enter a valid email address.');
       alert(df.EMAIL.value);
       return false;
       }


//if (!(emailFilter.test(df.EMAIL.value))) { 
//       alert('Please enter a valid email address. Example myemail@website.com');
//      alert(df.EMAIL.value);
//      return false;
//}



//alert("hh"+Comments2)
//if (state_idx == 0) {

//   alert('Please select a State');
//   }

  	if (state_idx == 0)
		
         {
          alert("Please select a State");
      		return false;
         }  	 
	
	if (type_idx  == 0)
		
         {
          alert("Please select a Denomination");
      		return false;
         }  	 

			
		 return true;
		 }


