function LoadBrand(n,t){$.getJSON("/ashx/GetCarSelect.ashx",function(i){$.each(i,function(t,i){$("").val(i.BrandId).text(i.BrandName).appendTo("#"+n)}),t!=undefined&&$("#"+n).find("option[value="+t+"]").attr("selected",!0)})}function RefreshSeriesSelect(n,t,i,r,u,f,e){ResetSelect(1,u,f),n>0&&$.getJSON("/ashx/GetCarSelect.ashx",{brandId:n,isNewCar:t,isInMarket:i},function(n){var t;$.each(n,function(n,i){i.Series&&(t!=i.ManufacturerId&&(r==0?$("").appendTo("#"+u):$("").val(i.ManufacturerId).text("==="+i.ManufacturerName+"===").appendTo("#"+u),t=i.ManufacturerId),$.each(i.Series,function(n,t){$("").val(t.SeriesId).text(t.SeriesName).appendTo("#"+u)}))}),$("#"+u).removeAttr("disabled"),e!=undefined&&$("#"+u).find("option[value="+e+"]").attr("selected",!0)})}function RefreshTrimSelect(n,t,i,r,u,f){ResetSelect(2,r,u),n>0&&$.getJSON("/ashx/GetCarSelect.ashx",{seriesId:n,isNewCar:t,isInMarket:i},function(n){var t;$.each(n,function(n,i){t!=i.TrimYear&&($("").appendTo("#"+u),t=i.TrimYear),$("").val(i.TrimId).text(i.TrimName).appendTo("#"+u)}),$("#"+u).removeAttr("disabled"),f!=undefined&&$("#"+u).find("option[value="+f+"]").attr("selected",!0)})}function ResetSelect(n,t,i){n<2&&$("#"+t)!=null&&$("#"+t).empty().html('').attr("disabled","disabled"),n<3&&$("#"+i)!=null&&$("#"+i).empty().html('').attr("disabled","disabled")};