<!--- hide script from old browsers

function addListingFormValidator(field) 
{	
	var str,i,c;
	if (field.whatToDo.options[field.whatToDo.selectedIndex].value=="Select one --->")
	{
		alert("Please select what you want to do.")
		field.whatToDo.focus();
		return false;
	}
	if (field.name.value == "")
	{
		alert("Please enter your name.");
		field.name.focus();
		return false;
	}
	if (field.name.value != "")			/* check for a valid name format */
	{
		str = field.name.value
		for(i = 0; i < str.length; i++) 
		{ 
			c = str.charAt(i);
			if ((c >= "A" && c <= "Z") || (c >= "a" && c <= "z") || (c == "'") || (c == " "))
				;
			else
			{
				alert("Invalid Name!");
				field.name.focus();
				return false;
			}
		}
	}		
	if (field.companyName.value == "")
	{
		alert("Please enter the name of your Company.");
		field.companyName.focus();
		return false;
	}
	if (field.companyName.value != "")		
	{
		str = field.companyName.value;
		for(i = 0; i < str.length; i++)
		{
			c = str.charAt(i);
			if((c >= "A" && c <= "Z") || (c >= "a" && c <= "z") || (c == " ") || (c == "&") || (c >= "0" && c <= "9") || (c == "-") || (c == "+") || (c == ".") || (c == ","))
				;
			else
			{
				alert("Invalid Company name!");
				field.companyName.focus();
				return false;
			}
		}
	}
	if (field.address.value == "")
	{
		alert("Please enter your Address.");
		field.address.focus();
		return false;
	}
	if (field.address.value != "")		
	{
		str = field.address.value;
		for(i = 0; i < str.length; i++)
		{
			c = str.charAt(i);
			if((c >= "A" && c <= "Z") || (c >= "a" && c <= "z") || (c == " ") || (c == "&") || (c >= "0" && c <= "9") || (c == "-") || (c == ".") || (c == ",") || (c == "'") || (c == "#"))
				;
			else
			{
				alert("Invalid Address!");
				field.address.focus();
				return false;
			}
		}
	}
	if (field.emailAddress.value == "")
	{
		alert("Please enter your E-Mail Address.");
		field.emailAddress.focus();
		return false;
	}
	if (field.emailAddress.value != "")
	{
		str = field.emailAddress.value
		var filter=/^.+@.+\..{2,3}$/
		
		if (filter.test(str))
			;
		else
		{
			alert("Invalid E-Mail address!");
			field.emailAddress.focus();
			return false;
		}
	}
	if (field.telephone.value == "")	
  	{
    	alert("Please enter your Phone Number.");
    	field.telephone.focus();
    	return false;
  	}
  	if (field.telephone.value != "")
  	{
  		str = field.telephone.value
  		for(i = 0; i < str.length; i++)
  		{
  			c = str.charAt(i);
  			if((c >= "0" && c <= "9") || (c == "-") || (c == "(") || (c == ")") || (c == " "))
  				;
  			else
  			{
				alert("Invalid Phone Number!");
				field.telephone.focus();
				return false;
			}
  		}
  	}
	if (field.typeOfBusiness.value == "Select Type of Business")
	{
		alert("Please select the type of Business..");
    	field.typeOfBusiness.focus();
    	return false;
	}
	if (field.typeOfBusiness.value == "Other")
	{
		if (field.other.value == "")
		{
			alert("Please enter what kind of Business.");
			field.other.focus();
			return false;
		}
		if (field.other.value != "")
		{
			str = field.other.value
			for(i = 0; i < str.length; i++) 
			{ 
				c = str.charAt(i);
				if ((c >= "A" && c <= "Z") || (c >= "a" && c <= "z") || (c == "'") || (c == " "))
				;
				else
				{
					alert("Invalid kind of Business!");
					field.other.focus();
					return false;
				}
			}
		}
		if (field.otherTypeOfBusiness.value == "")
		{
			alert("Please what type of Business.");
			field.otherTypeOfBusiness.focus();
			return false;
		}
		if (field.otherTypeOfBusiness.value != "")
		{
			str = field.otherTypeOfBusiness.value
			for(i = 0; i < str.length; i++) 
			{ 
				c = str.charAt(i);
				if ((c >= "A" && c <= "Z") || (c >= "a" && c <= "z") || (c == "'") || (c == " "))
				;
				else
				{
					alert("Invalid type of Business!");
					field.otherTypeOfBusiness.focus();
					return false;
				}
			}
		}
	}
	if (field.description.value == "")
	{
		alert("Please a description of your Business.");
		field.description.focus();
		return false;
	}
	
	return true;
}

// end hiding --->
		