﻿//$(function() {
//   $("select.address-country").change(function() {
//      var field = this;
//      if (this.selectedIndex > 0) {
//         $.getJSON("FindRegionsByCountryId/" + this.options[this.selectedIndex].value, function(data) {
//            var regionList = $('#' + field.id).next('.address-region');
//            updateList('#' + regionList.id, data, 'default option', 'no items');
//         });
//      }
//   });
//});

//function updateRegionList(data) {
//   alert(this);
//   alert(data);

////   updateList("select#<%= this.IdFor( x => x.Address.RegionId ) %>",
////            data,
////            '<%= GetLocalResourceObject( "NoRegionsFound" ) %>');
//}

////$(function() {
////   $("select#<%= this.IdFor( x => x.Address.RegionId ) %>").change(function() {
////      var selectedRegion = $("#<%= this.IdFor( x => x.Address.RegionId ) %> > option:selected").attr("value");
////      $.getJSON("FindCitiesByRegionId/" + selectedRegion, updateCityList);
////   });
////});



////function updateCityList(data) {
////   updateList("select#<%= this.IdFor( x => x.Address.CityId ) %>",
////            data,
////            '<%= GetLocalResourceObject( "SelectCity" ) %>',
////            '<%= GetLocalResourceObject( "NoCitiesFound" ) %>');
////}
