
crss = function() {
	
	countries = document.forms.rss_form['CritCat_crits_regio'];
	states = document.forms.rss_form['crits_regio_tmp'];
	coptions = countries.options;
	if (coptions.length == 1) {
		init_selects();
	}
	optionselected = 0;
	optionlength = coptions.length;
	USA_index = -1;
	selected_index = -1;

	for (i = 0; i < optionlength; i++) {
		if ((i > 0) && (coptions[i].selected == true)) {
			optionselected = 1;
			selected_index = i;
		}
		if (coptions[i].value == USA_value) {
			USA_index = i;
		}
	}
	if (optionselected == 0) {
		if (USA_index >= 0) {
			coptions[USA_index].selected = true;
			get_range(countries.options[USA_index].value,countries.form.crits_regio_tmp)
			window.setTimeout(function(){ // we must give the UI a chance to update
				coptions[USA_index].selected = true;
			},0);
		}
	} else {
		//alert("no - USA_index = "+USA_index+" optionlength = "+optionlength+"option selected = "+optionselected+"selected_index = "+selected_index);
	}

	get_range(countries.options[USA_index].value,countries.form.crits_regio_tmp);

	window.setTimeout(function(){ // we must give the UI a chance to update
		for (i = 0; i < USA_index; i++) {
			countries.options[0] = null;
		}
		for (i = 1; i < optionlength-USA_index; i++) {
			countries.options[1] = null;
		}
		for (i = 0; i < 53; i++) {
			states.options[11] = null;
		}
	},0);


	//alert('USA_index = '+USA_index+' optionlength = '+optionlength+a);
	
}

obj = window;
evt = 'load';
if (obj.addEventListener)
	obj.addEventListener(evt,crss,false);
else if (obj.attachEvent)
	obj.attachEvent('on'+evt,crss);

