function _selectCanada()
{
	northAmericanPhones();
}

function _selectUSA()
{
	northAmericanPhones();
}

function _selectOther()
{
	internationalPhones();
}

function northAmericanPhones()
{
	northAmericanPhone('contact_phone');
	northAmericanPhone('contact_fax');
	northAmericanPhone('alternate_phone');
	northAmericanPhone('alternate_fax');
}

function internationalPhones()
{
	internationalPhone('contact_phone');
	internationalPhone('contact_fax');
	internationalPhone('alternate_phone');
	internationalPhone('alternate_fax');
}

function splitPhones()
{
	splitPhone('contact_phone');
	splitPhone('contact_fax');
	splitPhone('alternate_phone');
	splitPhone('alternate_fax');
}

function unsplitPhones()
{
	if (getFormElement('country').selectedIndex == 2)
		return;
	unsplitPhone('contact_phone');
	unsplitPhone('contact_fax');
	unsplitPhone('alternate_phone');
	unsplitPhone('alternate_fax');
}

function validInput()
{
	if (warnIfBlank('name', 'Organization Name'))
		return false;
	if (!validLogin())
		return false;
	if (!validAddress())
		return false;
	if (warnIfBlank('contact_name', "Contact Person's Name"))
		return false;
	if (getFormElement('country').selectedIndex == 2)
	{
		if (warnIfBlank('contact_phone', "Contact Person's Phone Number"))
			return false;
	}
	else
	{
		if (document.getElementById)
		{
			if (warnIfBlank('contact_phone1', "Contact Person's Phone Number"))
				return false;
		}
		else
		{
			if (warnIfBlank('contact_phone', "Contact Person's Phone Number"))
				return false;
		}
	}
	if (warnIfBlank('contact_email', "Contact Person's Email address"))
		return false;
	if (warnIfInvalidEmail("contact_email"))
		return false;
	if (!isBlank(getFormElement("alternate_name").value)
	    && !isBlank(getFormElement("alternate_email").value))
		if (warnIfInvalidEmail("alternate_email"))
			return false;
	return validPhones();
}

function fixupInput()
{
	trim('name');
	fixupLogin();
	fixupAddress();
	trim('contact_name');
	trim('contact_email');
	trim('contact_pos');
	trim('alternate_name');
	trim('alternate_email');
	trim('alternate_pos');
	fixupPhones();
}

function fixupPhones()
{
	fixupPhone('contact_phone');
	fixupPhone('contact_fax');
	fixupPhone('alternate_phone');
	fixupPhone('alternate_fax');
}

function validPhones()
{
	if (getFormElement('country').selectedIndex == 2)
		return validInternationalPhone('contact_phone')
			&& validInternationalPhone('contact_fax')
			&& validInternationalPhone('alternate_phone')
			&& validInternationalPhone('alternate_fax');
	else
		return validNorthAmericanPhone('contact_phone')
			&& validNorthAmericanPhone('contact_fax')
			&& validNorthAmericanPhone('alternate_phone')
			&& validNorthAmericanPhone('alternate_fax');
}
