",{value:i.value,text:i.text,selected:i.selected}))});u.makes&&$.each(u.makes,function(n,i){t.append($("",{value:i.value,text:i.text,selected:i.selected}))});u.models&&$.each(u.models,function(n,t){i.append($("",{value:t.value,text:t.text,selected:t.selected}))});u.submodels&&$.each(u.submodels,function(n,t){r.append($("",{value:t.value,text:t.text,selected:t.selected}))})})}$(document).ready(function(){refreshInitialData();$("#fitment-clear").click(function(n){n.preventDefault();$.ajax({cache:!1,type:"POST",url:"/WidgetsFitments/ClearCustomerFitment",success:function(n){n.result&&n.result==="success"&&(refreshInitialData(),window.location.pathname.indexOf("FitmentSearch")!=-1?window.location.href="/":window.location.reload())}})});$("#YearId").change(function(){var i=$(this).val(),n=$("#MakeId"),r=$("#ModelId"),u=$("#SubModelId"),t=$("#make-loading-progress");t.show();$.ajax({cache:!1,type:"GET",url:"/WidgetsFitments/PublicGetMakesOnYear",data:{year:i}}).done(function(i){n.empty();r.find("option:gt(0)").remove();u.find("option:gt(0)").remove();$.each(i,function(t,i){n.append($("",{value:i.value,text:i.text,selected:i.selected}))});t.hide()})});$("#MakeId").change(function(){var i=$(this).val(),n=$("#ModelId"),r=$("#SubModelId"),t=$("#model-loading-progress");t.show();$.ajax({cache:!1,type:"GET",url:"/WidgetsFitments/PublicGetModelsOnMake",data:{make:i}}).done(function(i){n.empty();r.find("option:gt(0)").remove();$.each(i,function(t,i){n.append($("",{value:i.value,text:i.text,selected:i.selected}))});t.hide()})});$("#ModelId").change(function(){var i=$(this).val(),n=$("#SubModelId"),t=$("#submodel-loading-progress");t.show();$.ajax({cache:!1,type:"GET",url:"/WidgetsFitments/PublicGetSubModelOnModel",data:{model:i}}).done(function(i){n.empty();$.each(i,function(t,i){n.append($("",{value:i.value,text:i.text,selected:i.selected}))});t.hide()})});$("#SubModelId").change(function(){var n=$(this).val(),t=$("#submodel-loading-progress");$.ajax({cache:!1,type:"GET",url:"/WidgetsFitments/PublicSaveSubModel",data:{submodel:n}}).done(function(){}).fail(function(n){alert(n)})})})