function autotab(original,destination){
	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
		destination.focus()
}

function cntgi_validator(theForm)
{
	var alertsay = "";

	// check Name
	if (theForm.gc_name.value == "")
	{
		alert("You must enter your Full Name.");
		theForm.gc_name.focus();
		return (false);
	}

	if (theForm.gc_name.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"Full Name\" field.");
		theForm.gc_name.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr = theForm.gc_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 letters in the \"Full Name\" field.");
		theForm.gc_name.focus();
		return (false);
	}


   	// check Phone1
	if (theForm.gc_phone1.value == "")
	{
		alert("You must input complete phone number.");
		theForm.gc_phone1.focus();
		return (false);
	}

	if (theForm.gc_phone1.value.length < 3)
	{
		alert("Please enter 3 numbers in the \"Phone Area Code\" field.");
		theForm.gc_phone1.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.gc_phone1.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 input a valid \"Phone\" number.");
		theForm.gc_phone1.focus();
		return (false);
	}

   	// check Phone2
	if (theForm.gc_phone2.value == "")
	{
		alert("You must input complete phone number.");
		theForm.gc_phone1.focus();
		return (false);
	}

	if (theForm.gc_phone2.value.length < 3)
	{
		alert("Please enter 3 numbers in the \"Phone Index\" field.");
		theForm.gc_phone2.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.gc_phone2.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 input a valid \"Phone\" number.");
		theForm.gc_phone2.focus();
		return (false);
	}

   	// check Phone3
	if (theForm.gc_phone3.value == "")
	{
		alert("You must input complete phone number.");
		theForm.gc_phone3.focus();
		return (false);
	}

	if (theForm.gc_phone3.value.length < 4)
	{
		alert("Please enter 4 numbers in the \"Phone Number\" field.");
		theForm.gc_phone3.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.gc_phone3.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 input a valid \"Phone\" number.");
		theForm.gc_phone3.focus();
		return (false);
	}

	// check Email Address
	if (theForm.gc_eml.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		theForm.gc_eml.focus();
		return (false);
	}

	var checkEmail = "@.";
	var checkStr = theForm.gc_eml.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;

    for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkEmail.length;  j++)
		{
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
			if (EmailAt && EmailPeriod)
				break;
			if (j == checkEmail.length)
				break;
		}
		if (EmailAt && EmailPeriod)
		{
			EmailValid = true
			break;
		}
	}

    if (!EmailValid)
	{
		alert("The \"Email\" format is invalid.");
		theForm.gc_eml.focus();
		return (false);
	}

   	// check Zip
	if (theForm.gc_zip.value == "")
	{
		alert("You must enter a Postal Code.");
		theForm.gc_zip.focus();
		return (false);
	}

	if (theForm.gc_zip.value.length < 5)
	{
		alert("Please enter 5 numbers in the \"Postal Code\" field.");
		theForm.gc_zip.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.gc_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 5 numbers in the \"Postal Code\" field.");
		theForm.gc_zip.focus();
		return (false);
	}

	// Inquiry field
	if (theForm.gc_msg.value.length < 2)
	{
		alert("Please enter comments in the \"Inquiry\" field.");
		theForm.gc_msg.focus();
		return (false);
	}

	if (theForm.gc_msg.value == "")
	{
		alert("Please enter comments in the \"Inquiry\" field.");
		theForm.gc_msg.focus();
		return (false);
	}
}


function login_validator(theForm)
{
	var alertsay = "";

	if (theForm.l_user.value == "")
	{
		alert("You must enter your Username.");
		theForm.l_user.focus();
		return (false);
	}
	if (theForm.l_user.value.length < 8)
	{
		alert("Your username is too short.");
		theForm.l_user.focus();
		return (false);
	}
	if (theForm.l_pwd.value == "")
	{
		alert("You must enter your Password.");
		theForm.l_pwd.focus();
		return (false);
	}
	if (theForm.l_pwd.value.length < 8)
	{
		alert("Your password is too short.");
		theForm.l_pwd.focus();
		return (false);
	}
}

function lostpass_validator(theForm)
{
	var alertsay = "";

	if (theForm.lp_eml.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		theForm.lp_eml.focus();
		return (false);
	}

	var checkEmail = "@.";
	var checkStr = theForm.lp_eml.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;

    for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkEmail.length;  j++)
		{
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
			if (EmailAt && EmailPeriod)
				break;
			if (j == checkEmail.length)
				break;
		}
		if (EmailAt && EmailPeriod)
		{
			EmailValid = true
			break;
		}
	}

    if (!EmailValid)
	{
		alert("The \"Email\" format is invalid.");
		theForm.lp_eml.focus();
		return (false);
	}
}

function sprt_validator(theForm)
{
	var alertsay = "";

	// check Name
	if (theForm.sprt_name.value == "")
	{
		alert("You must enter the Contact Name.");
		theForm.sprt_name.focus();
		return (false);
	}

	if (theForm.sprt_name.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"Contact Name\" field.");
		theForm.sprt_name.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr = theForm.sprt_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 letters in the \"Contact Name\" field.");
		theForm.sprt_name.focus();
		return (false);
	}

	// check Address
	if (theForm.sprt_addr1.value == "")
	{
		alert("You must supply the Address.");
		theForm.sprt_addr1.focus();
		return (false);
	}

	if (theForm.sprt_addr1.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"Address\" field.");
		theForm.sprt_addr1.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789. ";
	var checkStr = theForm.sprt_addr1.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, numbers and . in the \"Address\" field.");
		theForm.sprt_addr1.focus();
		return (false);
	}

   	// check Zip
	if (theForm.sprt_zip.value == "")
	{
		alert("You must enter a Postal Code.");
		theForm.sprt_zip.focus();
		return (false);
	}

	if (theForm.sprt_zip.value.length < 5)
	{
		alert("Please enter 5 numbers in the \"Postal Code\" field.");
		theForm.sprt_zip.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.sprt_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 5 numbers in the \"Postal Code\" field.");
		theForm.sprt_zip.focus();
		return (false);
	}

   	// check Phone1
	if (theForm.sprt_phone1.value == "")
	{
		alert("You must input complete phone number.");
		theForm.sprt_phone1.focus();
		return (false);
	}

	if (theForm.sprt_phone1.value.length < 3)
	{
		alert("Please enter 3 numbers in the \"Phone Area Code\" field.");
		theForm.sprt_phone1.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.sprt_phone1.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 input a valid \"Phone\" number.");
		theForm.sprt_phone1.focus();
		return (false);
	}

   	// check Phone2
	if (theForm.sprt_phone2.value == "")
	{
		alert("You must input complete phone number.");
		theForm.sprt_phone2.focus();
		return (false);
	}

	if (theForm.sprt_phone2.value.length < 3)
	{
		alert("Please enter 3 numbers in the \"Phone Index\" field.");
		theForm.sprt_phone2.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.sprt_phone2.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 input a valid \"Phone\" number.");
		theForm.sprt_phone2.focus();
		return (false);
	}

   	// check Phone3
	if (theForm.sprt_phone3.value == "")
	{
		alert("You must input complete phone number.");
		theForm.sprt_phone3.focus();
		return (false);
	}

	if (theForm.sprt_phone3.value.length < 4)
	{
		alert("Please enter 4 numbers in the \"Phone Number\" field.");
		theForm.sprt_phone3.focus();
		return (false);
	}

	var checkOK = "0123456789";
	var checkStr = theForm.sprt_phone3.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 input a valid \"Phone\" number.");
		theForm.sprt_phone3.focus();
		return (false);
	}

	// check Email Address
	if (theForm.sprt_eml.value == "")
	{
		alert("Please enter a value for the \"Email\" field.");
		theForm.sprt_eml.focus();
		return (false);
	}

	var checkEmail = "@.";
	var checkStr = theForm.sprt_eml.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;

    for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkEmail.length;  j++)
		{
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
			if (EmailAt && EmailPeriod)
				break;
			if (j == checkEmail.length)
				break;
		}
		if (EmailAt && EmailPeriod)
		{
			EmailValid = true
			break;
		}
	}

    if (!EmailValid)
	{
		alert("The \"Email\" format is invalid.");
		theForm.sprt_eml.focus();
		return (false);
	}

	// Details field
	if (theForm.sprt_info.value.length < 2)
	{
		alert("Please enter comments in the \"Additional Information\" field.");
		theForm.sprt_info.focus();
		return (false);
	}

	if (theForm.sprt_info.value == "")
	{
		alert("Please enter comments in the \"Additional Information\" field.");
		theForm.sprt_info.focus();
		return (false);
	}
}

