t=c="all";y=0;m="all";if(typeof dealerId=="undefined")dealerId="na";if(typeof condLbl=="undefined")condLbl="- ALL -";if(typeof typeLbl=="undefined")typeLbl="- ALL -";if(typeof yearLbl=="undefined")yearLbl="- ALL -";if(typeof makeLbl=="undefined")makeLbl="- ALL -";if(typeof modelLbl=="undefined")modelLbl="- ALL -";listType(c);listYear(c,t);listMake(c,t,y);listModel(c,t,y,m);
$("#cond_sel").change(function(){var a=typeof $("#cond_sel").val()=="undefined"?"all":$("#cond_sel").val();listType(a);listYear(a,t);listMake(a,t,y);listModel(a,t,y,m)});$("#type_sel").change(function(){var a=typeof $("#cond_sel").val()=="undefined"?"all":$("#cond_sel").val();listYear(a,$(this).val());listMake(a,$(this).val(),y);listModel(a,$(this).val(),y,m)});
$("#year_sel").change(function(){var a=typeof $("#cond_sel").val()=="undefined"?"all":$("#cond_sel").val();listMake(a,$("#type_sel").val(),$(this).val());listModel(a,$("#type_sel").val(),$(this).val(),m)});$("#make_sel").change(function(){var a=typeof $("#cond_sel").val()=="undefined"?"all":$("#cond_sel").val();listModel(a,$("#type_sel").val(),$("#year_sel").val(),$("#make_sel").val())});
function listCond(){$.getJSON("/cfc/generic_dealer.cfc?method=listCond&returnformat=json&dealerId="+dealerId,function(a){$.each(a.DATA,function(d,b){$("#cond_sel").children().end().append('<option value="'+b+'">'+b+"</option>")})})}
function listType(a){$.getJSON("/cfc/generic_dealer.cfc?method=listType&returnformat=json&dealerId="+dealerId+"&vehCond="+a,function(d){typeList=d.split(",");typeList.length>0&&$("#type_sel").empty().append('<option value="all">'+typeLbl+"</option>");$.each(typeList,function(b,e){$("#type_sel").children().end().append('<option value="'+e+'">'+e+"</option>")})})}
function listYear(a,d){$.getJSON("/cfc/generic_dealer.cfc?method=listYear&returnformat=json&dealerId="+dealerId+"&vehCond="+a+"&vehType="+d,function(b){b.DATA.length>0&&$("#year_sel").empty().append('<option value="0">'+yearLbl+"</option>");$.each(b.DATA,function(e,f){$("#year_sel").children().end().append('<option value="'+f+'">'+f+"</option>")})})}
function listMake(a,d,b){$.getJSON("/cfc/generic_dealer.cfc?method=listMakes&returnformat=json&dealerId="+dealerId+"&vehCond="+a+"&vehType="+d+"&vehYear="+b,function(e){e.DATA.length>0&&$("#make_sel").empty().append('<option value="all">'+makeLbl+"</option>");$.each(e.DATA,function(f,g){$("#make_sel").children().end().append('<option value="'+g[0]+'">'+g[0]+"</option>")})})}
function listModel(a,d,b,e){$.getJSON("/cfc/generic_dealer.cfc?method=listModels&returnformat=json&dealerId="+dealerId+"&vehCond="+a+"&vehType="+d+"&vehYear="+b+"&vehMake="+e,function(f){f.DATA.length>0&&$("#model_sel").empty().append('<option value="all">'+modelLbl+"</option>");$.each(f.DATA,function(g,h){$("#model_sel").children().end().append('<option value="'+h+'">'+h+"</option>")})})};
