function Validatenewlistingform(theForm)
	{
	
	if (theForm.name.value == "")
	{
	  alert("Please enter a title for this listing.");
	  theForm.name.focus();
	  return (false);
	} /* First_Name */
	
	if (theForm.locationid.value == "")
	{
	  alert("Please select where this service is located.");
	  theForm.locationid.focus();
	  return (false);
	} /* locationid */
	
	
	} /* Validatenewlistingform */
	
	
function Validatebasicsearchform(theForm)
	{
	
	
	if (theForm.locationid.value == "")
	{
	  alert("Please select a location.");
	  theForm.locationid.focus();
	  return (false);
	} /* locationid */
	
	
	} /* Validatebasicsearchform */
	
	
	
	
function Validatecontactform(theForm)
	{

		
		if (theForm.firstname.value == "")
		{
		  alert("Please enter your name.");
		  theForm.firstname.focus();
		  return (false);
		} /* First_Name */

		if (theForm.email.value == "")
		{
		  alert("Please enter your email address so you can be contacted if necessary.");
		  theForm.email.focus();
		  return (false);
		} /* email */
		
		
		
		
	var emailpat;
	emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$/;
		if( !emailpat.test( theForm.email.value ) ) {
		  alert("Please enter a valid email address.");
      			theForm.email.focus();
      			return (false);
		} /* Email */
		
	
		if (theForm.comments.value == "")
		{
		  alert("Please give a brief description of why you are contacting us.");
		  theForm.comments.focus();
		  return (false);
		} /* comments */
  
	    return (true);
	    
	} /* Validatecontactform */
	


function Validateregistrationform(theForm)
	{
		var illegalChars = /[\W_]/; // allow only letters and numbers 
		
		
		if (theForm.username.value == "")
		{
		  alert("Please enter a username.");
		  theForm.username.focus();
		  return (false);
		} /* username */
		
		if (illegalChars.test(theForm.username.value))
		{
			alert("Please only use letters and numbers in your username.");
			theForm.username.focus();
		  	return (false);
		}
		
		
		if (theForm.username.value.length < 6)
		{
		  alert("Please enter at least 6 characters for username.");
		  theForm.username.focus();
		  return (false);
		} /* login length */
		

			 
		if (theForm.email.value == "")
		{
		  alert("Please enter your email address so we can validate your account.");
		  theForm.email.focus();
		  return (false);
		} /* email */
		
	var emailpat;
	emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$/;
		if( !emailpat.test( theForm.email.value ) ) {
		  alert("Please enter a valid email address.");
      			theForm.email.focus();
      			return (false);
		} /* Email */
		
		if (!(theForm.email.value == theForm.confirmemail.value))
		{
		  alert("The 2 email addresses entered do not match - please try again");
		  theForm.email.focus();
		  return (false);
		}
		
		
		if (theForm.password.value.length < 4)
			{
			  alert("Please enter at least 4 characters for password.");
			  theForm.password.focus();
			  return (false);
		}
		

			 
		if (!(theForm.password.value == theForm.confirm.value))
		{
		  alert("Passwords entered do not match - please try again");
		  theForm.password.focus();
		  return (false);
		}	 
	
		
		
		if (theForm.firstname.value == "")
		{
		  alert("Please enter your first name.");
		  theForm.firstname.focus();
		  return (false);
		} /* First_Name */

		
		
	
	
		if (theForm.businessname.value == "")
			{
			  alert("Please enter a Business Name.");
			  theForm.businessname.focus();
			  return (false);
		} /* businessname */
	

  
	    return (true);
	    
	} /* validat rego form */
	
	
	
	
function Validatechangepwform(theForm)
	{
	
		if (theForm.password.value.length < 4)
			{
			  alert("Please enter at least 4 characters for password.");
			  theForm.password.focus();
			  return (false);
		}



		if (!(theForm.password.value == theForm.confirm.value))
		{
		  alert("Passwords entered do not match - please try again");
		  theForm.password.focus();
		  return (false);
		}
	}


function Validaterequestform(theForm)
	{

		
		if (theForm.firstname.value == "")
		{
		  alert("Please enter your name.");
		  theForm.firstname.focus();
		  return (false);
		} /* First_Name */

		if (theForm.email.value == "")
		{
		  alert("Please enter your email address so we can contact you.");
		  theForm.email.focus();
		  return (false);
		} /* email */
		
		
		
		
	var emailpat;
	emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$/;
		if( !emailpat.test( theForm.email.value ) ) {
		  alert("Please enter a valid email address.");
      			theForm.email.focus();
      			return (false);
		} /* Email */
		
	
		if (theForm.comments.value == "")
		{
		  alert("Please give a brief description of what you are looking for.");
		  theForm.comments.focus();
		  return (false);
		} /* comments */
  
	    return (true);
	    
	} /* Validaterequestform */



function Validatemonthsform(theForm)
	{
		var checkFound = false;
		for (var counter=0; counter < theForm.length; counter++) {
		if ((theForm.elements[counter].name == "nummonths") && (theForm.elements[counter].checked == true)) {
		checkFound = true;
		}
		}
		if (checkFound != true) {
		alert("Please make a selection");
		return (false);
		}
	return (true);

	}
	

function Validateleaderboardmonthsform(theForm)
	{
		var checkFound = false;
		for (var counter=0; counter < theForm.length; counter++) {
		if ((theForm.elements[counter].name == "leaderboardmonths") && (theForm.elements[counter].checked == true)) {
		checkFound = true;
		}
		}
		if (checkFound != true) {
		alert("Please make a selection");
		return (false);
		}
	return (true);

	}
