",{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:"/fr/PublicFitmentsWidget/ClearCustomerFitment",success:function(n){n.result&&n.result==="success"&&(refreshInitialData(),window.location.pathname.indexOf("FitmentSearch")!=-1?window.location.href="/":window.location.reload(),$("#YearIdError").html(""),$("#MakeIdError").html(""),$("#ModelIdError").html(""))}})});$("#YearId").change(function(){var n=$(this).val();n!=""&&n!=null&&$("#YearIdError").html("");var t=$("#MakeId"),r=$("#ModelId"),u=$("#SubModelId"),i=$("#make-loading-progress");i.show();$.ajax({cache:!1,type:"GET",url:"/fr/PublicFitmentsWidget/PublicGetMakesOnYear",data:{year:n}}).done(function(n){t.empty();r.find("option:gt(0)").remove();u.find("option:gt(0)").remove();$.each(n,function(n,i){t.append($("",{value:i.Value,text:i.Text,selected:i.Selected}))});i.hide()})});$("#MakeId").change(function(){var n=$(this).val();n!=""&&n!=null&&$("#MakeIdError").html("");var t=$("#ModelId"),r=$("#SubModelId"),i=$("#model-loading-progress");i.show();$.ajax({cache:!1,type:"GET",url:"/fr/PublicFitmentsWidget/PublicGetModelsOnMake",data:{make:n}}).done(function(n){t.empty();r.find("option:gt(0)").remove();$.each(n,function(n,i){t.append($("",{value:i.Value,text:i.Text,selected:i.Selected}))});i.hide()})});$("#ModelId").change(function(){var n=$(this).val(),t,i;n!=""&&n!=null&&$("#ModelIdError").html("");t=$("#SubModelId");i=$("#submodel-loading-progress");i.show();$.ajax({cache:!1,type:"GET",url:"/fr/PublicFitmentsWidget/PublicGetSubModelOnModel",data:{model:n}}).done(function(n){t.empty();$.each(n,function(n,i){t.append($("",{value:i.Value,text:i.Text,selected:i.Selected}))});i.hide()})});$("#SubModelId").change(function(){var n=$(this).val(),t=$("#submodel-loading-progress");$.ajax({cache:!1,type:"GET",url:"/fr/PublicFitmentsWidget/PublicSaveSubModel",data:{submodel:n}}).done(function(){}).fail(function(n){alert(n)})})});$("#fitment-search").click(function(){$("#YearId").val()==null||$("#YearId").val()==""?$("#YearIdError").html("Select a year..."):$("#YearIdError").html("");$("#MakeId").val()==null||$("#MakeId").val()==""?$("#MakeIdError").html("Select a make..."):$("#MakeIdError").html("");$("#ModelId").val()==null||$("#ModelId").val()==""?$("#ModelIdError").html("Select a model..."):$("#ModelIdError").html("")})