function countryChange(form){
    if(form != null && form.state != null && form.country !=null) {
        var selectedCountryCode = form.country.options[form.country.selectedIndex].value.toUpperCase();
        // if selected country isn't Canada or the US, then pre-select 'Outside the US or Canada'
        if(selectedCountryCode != 'US' && selectedCountryCode != 'CA')
            form.state.selectedIndex = 0;  // 0 = 'Outside the US or Canada'
        // if the country selection is United States, jump to the first state in the list
        if(selectedCountryCode == 'US')
            form.state.selectedIndex = 1;  // 1 = 'Alabama'
        // if the country selection is Canada, jump to the first province in the list
        if(selectedCountryCode == 'CA')
            form.state.selectedIndex = 51;  // 51 = 'Alberta'
		// if the country selection is Australia, jump to the first province in the list
        if(selectedCountryCode == 'AU')
            form.state.selectedIndex = 64;  // 64 = 'Australian Capital Territory'
	}
}

function stateChange(form){
    if(form != null && form.state != null && form.country !=null) {
		// if other is selected, then pre-select -Select Country- for the country
        if(form.state.selectedIndex == 0)
			form.country.selectedIndex = 0;
        // if a state is selected, then pre-select United States for the country
		if(form.state.selectedIndex >= 1 && form.state.selectedIndex <= 50)
            form.country.selectedIndex = 227;
        // if a province/territory is selected, then pre-select Canada for the country
        if(form.state.selectedIndex >= 51 && form.state.selectedIndex <= 63)
            form.country.selectedIndex = 40;
        // if a province/territory is selected, then pre-select Australia for the country
        if(form.state.selectedIndex >= 64 && form.state.selectedIndex <= 71)
            form.country.selectedIndex = 14;
    }
}
