function Profile_Form_Validator(theForm)
{
	if (theForm.first_name != null)
	{
		if (theForm.first_name.value == "")
		{
			alert("Please enter a value for this field.");
			theForm.first_name.focus();
			return (false);
		}
		if (theForm.first_name.value.length < 1)
		{
			alert("Please enter at least 1 characters in this field.");
			theForm.first_name.focus();
			return (false);
		}
		if (theForm.first_name.value.length > 25)
		{
			alert("Please enter at most 25 characters in this field.");
			theForm.first_name.focus(); return (false);
		}
		var checkOK = "~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ-'. \t\r\n\f";
		var checkStr = theForm.first_name.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only letter and whitespace characters in this field.");
			theForm.first_name.focus();
			return (false);
		}
	}
	if (theForm.last_name != null)
	{
		if (theForm.last_name.value == "")
		{
			alert("Please enter a value for this field.");
			theForm.last_name.focus();
			return (false);
		}
		if (theForm.last_name.value.length < 1)
		{
			alert("Please enter at least 1 characters in this field.");
			theForm.last_name.focus();
			return (false);
		}
		if (theForm.last_name.value.length > 25)
		{
			alert("Please enter at most 25 characters in this field.");
			theForm.last_name.focus();
			return (false);
		}
		var checkOK = "~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ-'. \t\r\n\f";
		var checkStr = theForm.last_name.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only letter and whitespace characters in this field.");
			theForm.last_name.focus();
			return (false);
		}
	}
	if (theForm.phone != null)
	{
		var checkOK = "0123456789--().xX ";
		var checkStr = theForm.phone.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only digit and \"-().\" characters in this field.");
			theForm.phone.focus();
			return (false);
		}
	}
	if (theForm.address1 != null)
	{
		if (theForm.address1.value == "")
		{
			alert("Please enter a value for this field.");
			theForm.address1.focus();
			return (false);
		}
	}
	if (theForm.city != null)
	{
		if (theForm.city.value == "")
		{
			alert("Please enter a value for this field.");
			theForm.city.focus();
			return (false);
		}
	}
        if (theForm.state_id != null)
        {
                if (theForm.state_id.value <= 0)
                {
                      alert("Please select an option.");
                      theForm.state_id.focus();
                      return (false);
                }
        }
	if (theForm.zip != null)
	{
		if (theForm.zip.value == "")
		{
			alert("Please enter a value for this field.");
			theForm.zip.focus();
			return (false);
		}
		if (theForm.zip.value.length < 1)
		{
			alert("Please enter at least 1 characters in this field.");
			theForm.zip.focus();
			return (false);
		}
		if (theForm.zip.value.length > 10)
		{
			alert("Please enter at most 10 characters in this field.");
			theForm.zip.focus();
			return (false);
		}
		var checkOK = "0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ.- \t\r\n\f";
		var checkStr = theForm.zip.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only letters and digits and \"-\" characters in this field.");
			theForm.zip.focus();
			return (false);
		}
	}
	if (theForm.country != null)
	{
		if (theForm.country.value == "")
		{
			alert("Please enter a value for this field.");
			theForm.country.focus();
			return (false);
		}
	}
	if (theForm.alternate_phone != null)
	{
		var checkOK = "0123456789--().xX ";
		var checkStr = theForm.alternate_phone.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only digit and \"()-.\" characters in this field.");
			theForm.alternate_phone.focus();
			return (false);
		}
	}
	if (theForm.pager != null)
	{
		var checkOK = "0123456789-().-";
		var checkStr = theForm.pager.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only digit and \"().-\" characters in this field.");
			theForm.pager.focus();
			return (false);
		}
	}
	if (theForm.email != null)
        {
                if (theForm.email.value.length > 50)
                {
                        alert("Please enter at most 50 characters in the \"Email\" field.");
                        theForm.email.focus();
                        return (false);
                }

                var checkOK = "~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\u0192\u0160\u0152\u017D\u0161\u0153\u017E\u0178ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@._ \t\r\n\f";
                var checkStr = theForm.email.value;
                var allValid = true;
                for (i = 0;  i < checkStr.length;  i++)
                {
                        ch = checkStr.charAt(i);
                        for (j = 0;  j < checkOK.length;  j++)
                                if (ch == checkOK.charAt(j))
                                        break;
                                if (j == checkOK.length)
                                {
                                        allValid = false;
                                        break;
                                }
                }
                if (!allValid)
                {
                        alert("Please enter only letter, digit, whitespace and \"@._\" characters in the \"Email\" field.");
                        theForm.email.focus();
                        return (false);
                }

                var x = theForm.email.value;
                var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
                if (!filter.test(x))
                {
                        alert("Please enter a valid \"Email\" address.");
                        theForm.email.focus();
                        return (false);
                }
        }

	return (true);
}

