function StateChange(){
	state_obj = document.getElementById('frm_state_id');
	city_obj = document.getElementById('frm_city_id');
	city_obj.disabled = false;
	
	currState = state_obj.options[state_obj.selectedIndex].value;	
	currCity = city_obj.options[city_obj.selectedIndex].value;
	
	if (currState.match(/(\d+),(\d+)/))
	{
		currState = RegExp.$1;
		currSubState = RegExp.$2;
	}
	else
	{
		currState = currState;
		currSubState = 0;
	}
	
	
	city_obj.options.length = 0;
	city_obj.options[0] = new Option("Any",0);	

	o_count = 1;
	o_selected = 0;
	for (i=0;i<=listing_cities.length-1;i++) 
	{
	    if (listing_cities[i][1]==currState) {
			if (listing_cities[i][2]==currSubState||currSubState=='0') 
			{
  			    city_obj.options.length = o_count;
  			    if (listing_cities[i][0]==currCity) o_selected = o_count;
				city_obj.options[o_count++] = new Option(listing_cities[i][3],listing_cities[i][0]);
			}
		}
	};
	if (o_selected>0) city_obj.selectedIndex = o_selected;
	if (o_count==1) city_obj.disabled = true;
}

