
<!--  

function validate(form) {
   var EmailOk  = true;
   var xx = document.membership;
   var msg; 
 
 /* VALIDATE THE Name PERSON INFO */  
		
   if (xx.firstname.value.length == 0) { 
	    alert("Please enter your first name.") ;
	    xx.firstname.focus() ;
   		return false ; 
		}		
   if (xx.lastname.value.length == 0) { 
	    alert("Please enter your last name.") ;
	    xx.lastname.focus() ;
   		return false ; 
		}	
   if (xx.title.value.length == 0) { 
	    alert("Please enter your Title.") ;
	    xx.title.focus() ;
   		return false ; 
		}									
   if (xx.ph1.value.length == 0) {
   		validatePrompt(xx.ph1, "Please enter your Phone Number.") ;
   		return false ; 
		}
   else 
   		{
	   	 if (isNaN(xx.ph1.value)) {  
    		alert("Phone number must be numeric.") ;
			xx.ph1.focus();
		 	return false; 
			} 	
   		}	
   if (xx.ph2.value.length == 0) {
   		validatePrompt(xx.ph2, "Please enter your Phone Number.") ;
   		return false ; 
		}
   else 
   		{
	   	 if (isNaN(xx.ph2.value)) {  
    		alert("Phone number must be numeric.") ;
			xx.ph2.focus();
		 	return false; 
			} 	
   		}	
   if (xx.ph3.value.length == 0) {
   		validatePrompt(xx.ph3, "Please enter your Phone Number.") ;
   		return false ; 
		}
   else 
   		{
	   	 if (isNaN(xx.ph3.value)) {  
    		alert("Phone number must be numeric.") ;
			xx.ph3.focus();
		 	return false; 
			} 	
   		}						
   if (xx.email.value.length == 0) {
   		validatePrompt(xx.email, "Please enter your Email address.") ;
   		return false ; 
		}
   else 
   		{
	   	 EmailOK = checkEmail(xx.email);  
		 if (EmailOK == false) 
		 	return false;  	
   		}

   if (xx.business_name.value.length == 0) {
   		validatePrompt(xx.business_name, "Please enter the name of your company.") ;
   		return false ; 
		}							 
   if (xx.address1.value.length == 0) {
   		validatePrompt(xx.address1, "Please enter your company address.") ;
   		return false ; 
		}							 
			
   if (xx.city.value.length == 0) {
   		validatePrompt(xx.city, "Please enter your City.") ;
   		return false ; 
		}							 
   if (xx.zip.value.length == 0) {
   		validatePrompt(xx.zip, "Please enter your Zip Code.") ;
   		return false ; 
		}	
	 
    if (xx.os0.value.length == 0) {
   		validatePrompt(xx.os0, "Please select the appropriate Membership Fee Amount.") ;
   		return false ; 
		}							 
																
	return true;
   
}  		// end function

function isEmpty(inputStr) {
	if (inputStr == null || inputStr == "") {
		return true;
	}
	return false;
}

function validatePrompt(Ctrl, PromptStr) {
   alert(PromptStr) ;
   Ctrl.focus() ;
   return ;
}

function checkEmail(emailStr) {
   var Temp     = emailStr
   var AtSym    = Temp.value.indexOf('@')
   var Period   = Temp.value.lastIndexOf('.')
   var Space    = Temp.value.indexOf(' ')
   var Length   = Temp.value.length - 1   // Array is from 0 to length-1
   
   if ((AtSym < 1) ||                     // '@' cannot be in first position
    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) ||             // Must be atleast one valid char after '.'
    (Space  != -1))                    // No empty spaces permitted
   {  
      alert('Please enter a valid e-mail address!')
      Temp.focus()
      return false;
   }
}

//-->


