function StateSelectorChange (stateSelector, stateOtherSpan, countrySelector, countryOtherSpan) 
{
	var stateIndex = stateSelector.selectedIndex - 1;

	if(StateA[stateIndex]) 
	{
		CountryID = StateA[stateIndex]['countryid'];
		stateOtherSpan.style.display = 'none';

		if(CountryID && (countrySelector != null)) 
		{
			for (i = 0; i < CountryA.length; i++)
			{
				if (CountryA[i]['id'] == CountryID)
				{
					countrySelector.selectedIndex = i + 1;
					countryOtherSpan.style.display = 'none';
				}				
			}
		}
	}
	else if (stateIndex == -1) 
	{
		stateOtherSpan.style.display = 'none';
	} 
	else 
	{
		stateOtherSpan.style.display = 'inline';
	}
	return true;
}
