<!--

function organize(theForm)
{
	if (theForm.organization.options[theForm.organization.selectedIndex].value == "0")
  {
	  if(theForm.new_organization.value == "")
	  {
		alert("Please enter a value for the \"Organization\" field.");
    	theForm.new_organization.focus();
    	return (false); 
	  }
  }
  if ((theForm.organization.options[theForm.organization.selectedIndex].value != "0") && (theForm.new_organization.value != ""))
  {
	alert("Please select a value OR enter a value for the \"Organization\" field.");
    	theForm.organization.focus();
    	return (false); 
  }
 return (true)
}


function validate(theForm)
{
	
	 if (theForm.fname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.fname.focus();
    return (false);
  }

  if (theForm.lname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lname.focus();
    return (false);
  }

 if (theForm.email.value == "")
  {
    alert("You have not entered an email address.");
    theForm.email.focus();
    return (false);
  }

invalidChars = " /:,;"
  for (i=0; i<invalidChars.length; i++)
  	badChar = invalidChars.charAt(i)
  	if (theForm.email.value.indexOf(badChar,0) > -1) {
  		alert ('email address contains invalid chars.');
  		return (false);
  		}
  		
  atPos = theForm.email.value.indexOf("@",1)
  if (atPos == -1) {
  	alert ('email address doesn\'t contain \"@\" ');
  	return (false);
  	}
  	
  if (theForm.email.value.indexOf("@",atPos+1) >	 -1) {
 	alert ('email address contains 2 \"@s\" ');
  	return (false);
  	}
  	
  	periodPos = theForm.email.value.indexOf(".",atPos)
  	if (periodPos == -1) {
  		alert ('email address doesn\'t contain \".\" ');
		return (false);
  	}
  
  if (periodPos +3 > theForm.email.value.length) {
		alert ('email address incorrect. ');
		return (false);
	}
	
  if (theForm.phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  phoneLength = theForm.phone.value.length;
  if (phoneLength < 12 )
  {
  alert("Please include the Area Code in the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  
  if(theForm.organization.value == "")
	  {
		alert("Please enter a value for the \"Organization\" field.");
    	theForm.organization.focus();
    	return (false); 
	  }
  
   if (theForm.products.options[theForm.products.selectedIndex].value == "")

  {
    alert("Please enter a value(s) for the \"Products\" field.");
    theForm.products.focus();
    return (false);
  }

return (true)
}
//-->