function validate(regForm)
{
  var msg = '';		// this is the error message
  var email = regForm.email.value;
  var fName = regForm.fName.value;
  var lName = regForm.lName.value;
  var address = regForm.address1.value;								// these are all my reg form fields
  var address2 = regForm.address2.value;
  var city = regForm.city.value;
  var state = regForm.state[regForm.state.selectedIndex].value
  var zip = regForm.zip.value;


  
  	// make sure they have a first name
	if(!fName)
		msg += "Please enter in your First Name\r\n";
		
	msg +=	bad_characters(fName, "in First Name field");
		
	// make sure they have a last name
	if(!lName)
		msg += "Please enter in your Last Name\r\n";
		
	msg +=	bad_characters(lName, "in Last Name field");
	
	// make sure they have a address
	if(!address)
		msg += "Please enter in your Address\r\n";
		
	msg +=	bad_characters(address, "in Address field");
	msg +=	bad_characters(address2, "in Address field");
	
	
	// make sure they have a city
	if(!city)
		msg += "Please enter in your City\r\n";
		
	msg +=	bad_characters(city, "in City field");
	
	if(!state)
		msg += "Please select in your State\r\n";
		
	
			
	// make sure they have a zip and it's at lease 5 characters
	if(!zip)
		msg += "Please enter in your Zip/Postal Code\r\n";
	else if(zip.length < 5)
		msg += "Please enter a valid Zip/Postal Code\r\n";
		
	msg +=	bad_characters(zip, "in Zip/Postal Code field");
	
	
	
  	// see if there is an email...if there is verify it fits the email pattern
	if (!email)  
		msg = msg + "Please enter your email address.\r\n";
	else  
  	{
    	var pattern = /^[\w-\.]+@[\w-\.]+\.[\w-\.]{2,}$/;

        if (!pattern.test(email))
             msg += "This does not appear to be a valid email address.\r\n";
	}
	
	msg +=	bad_characters(email, "in Email field");
	
		
									

	// if there was an error message fire off an alert box it out and reset the submit button so they can try again...else submit the form
	if(msg)
	{
		alert(msg);
		
		return false;
	}
	
	regForm.submit.disabled=true; 
	regForm.submit.value='Processing... Please Wait...';
	
	return true;
}

//-------------------------------------------------------------------------------------------------------------------------
// this function makes sure no bad symbols are entered in the reg form

function bad_characters(str,msg)  {

  var ourstr = String(str);
  var f;

  var numStr= ":`\"?|<>;/*$^~";

  var thisChar;	
  var counter=0;
  var regular='';
  var regularname='';

	for (var i= 0; i < ourstr.length; i++) 	{
		thisChar = ourstr.substring(i, i+1);
		
		if(numStr.indexOf(thisChar) != -1)  {
		    regular += thisChar;
			counter++;
		} 
            // this checks for valid ascii characters
        if(thisChar.charCodeAt(0) < 1 || thisChar.charCodeAt(0) > 127) {
            regular += thisChar;
            counter++;
        }
	}

	if (counter > 0)  {
		if (counter ==1)
		{
			regularname="Character: ";
			plural = "  is";
		}
		else
		{
			regularname="Characters: ";
			plural = "  are";
		}
		return(regularname +' '+ regular + plural +' not allowed '+msg+'\r\n');
	}

	return('');
}