",{value:i.value,text:i.text,selected:i.selected}))});r.makes&&$.each(r.makes,function(n,i){t.append($("",{value:i.value,text:i.text,selected:i.selected}))});r.models&&$.each(r.models,function(n,t){i.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:"/en/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"),t=$("#make-loading-progress");t.show();$.ajax({cache:!1,type:"GET",url:"/en/WidgetsFitments/PublicGetMakesOnYear",data:{year: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()})});$("#MakeId").change(function(){var i=$(this).val(),n=$("#ModelId"),t=$("#model-loading-progress");t.show();$.ajax({cache:!1,type:"GET",url:"/en/WidgetsFitments/PublicGetModelsOnMake",data:{make:i}}).done(function(i){n.empty();$.each(i,function(t,i){n.append($("",{value:i.value,text:i.text,selected:i.selected}))});t.hide()})});$("#ModelId").change(function(){var n=$(this).val(),i=$("#SubModelId"),t=$("#submodel-loading-progress");t.show();$.ajax({cache:!1,type:"GET",url:"/en/WidgetsFitments/PublicGetSubModelOnModel",data:{model:n}}).done(function(){modelChange()})})})