

$.extend(om, {
	showLocatorCities: function() {
		//	Remove any current options
		//$("#newcity").get(0).options.length = 0;
		$("#newcity").empty();
		$("#newcity").addOption("", "Select a City");
	
		if ($("#newstate").val() != '') {
			$.ajax({
				type: "GET",
				url: "/locations/get_cities.asp",
				data: {"state": $("#newstate").val()},
				dataType: "json",
				success: function(json) {
					$("#newcity").addOption(json, false);
					
				/*	For some reason we get some blanks in there some times, kill them and recreate the default	*/
				$("#newcity").removeOption("");
				//$("#newcity").prepend(new Option("Select a City", ""));
				$("#newcity").prepend('<option value="">Select a City</option>');
				
				$("#newcity").selectOptions("");
				}
			});
		}
	},

	setupLocator: function() {
		$("#newstate").bind("change", om.showLocatorCities);
		om.showLocatorCities();
	}
});

$(document).ready(function() {
	om.setupLocator();
});
