Code where <select> changes options in another <select>
===

I have made samo code in Javascript that will change options in drop-down list of citys when user changes state.

The problem with the code is that it wont work. I think that is code OK, but I am very new in JavaScript, so I cant see error.

Can you please check my code and see where I made error. Thanks.

JavaScript:

    function drzava_promjena() {
				var obj_state = document.getElementById("id_drzava")
				var index = obj_states.selectedIndex;
				
				var value_state = obj_state.options[index].value;
				
				towns = town_list[value_state];
				
				var obj_town = document.getElementById("id_gradovi");	
				
				while(obj_town.options.length > 0) {
					obj_town.remove(0);
				}
				
				var new_value;				
				
				for (var i = 0; i < gradovi.length; i++) {
					new_value = document.createElement("option");
					new_value.value = towns[i];
					new_value.text = towns[i];
					try { 
 						obj_town.add(new_value);
 					} 
 					catch (e) { 
 						obj_town.appendChild(new_value); 
 					} 
				}

And this is HTML:

    <select id="id_drzava" onchange="drzava_promjena(this);">
			<option value="Austrija">Austrija</option>
			<option value="Njemacka">Njemacka</option>
			<option value="Slovenija">Slovenija</option>
			<option value="Ceska">Ceska</option>
		</select>
		<br>
		<select id="id_gradovi" onchange="">
			<option value="0"></option>	
		</select>
		<br>
		<select id="id_uni" onchange="">
			<option></option>
		</select>		