// *******************************
// * country.js
// *******************************

function StateData( stateAbbr, stateName )
{
	this.stateAbbr = stateAbbr;
	this.stateName = stateName;
}

function CountryChange( country, state, stateselected )
{
	var cntID;
	var objCountry;
	var objState;
	
	if ( document.getElementById )
	{
		objCountry = document.getElementById( country );
		objState = document.getElementById( state );
		cntID = parseInt( objCountry.options[objCountry.selectedIndex].value );
		
		FillStates( objState, stateselected, cntID );
	}
}

function FillStates( objSel, stateselected, cntID )
{
	objSel.length = 0;
	for ( var i = 0; i < arrStates[cntID].length; i++ )
	{
		objSel.options[objSel.options.length] = new Option( arrStates[cntID][i].stateName, arrStates[cntID][i].stateAbbr, false, false );
		if ( arrStates[cntID][i].stateAbbr == stateselected )
		{
			objSel.options[objSel.options.length - 1].selected = true;
		}
	}
}