$(function(){function m(d,e,a){var f=toZenkakuKana(d.val().toLowerCase()).replace(/\u3000/g," ").split(" ");if(""===d.val())a.each(function(){$(this).css({display:$(this).attr("initialDisplay")})}),$(".is-excluded").removeClass("is-excluded"),$(".delexp1").addClass("expand1"),$(".delexp1").removeClass("delexp1").show(),e.each(function(){$(this).css({display:$(this).attr("initialDisplay")})});else{$(".expand2").show();$(".expand1").addClass("delexp1");$(".expand1").removeClass("expand1");$(".is-excluded").removeClass("is-excluded").show();
a.each(function(){for(i=0;i<f.length;i++)0>=toZenkakuKana($(this).text().toLowerCase()).indexOf(f[i])&&$(this).addClass("is-excluded")});var b=0;e.each(function(){var c=!1,g=$(this).attr("id");if("undefined"!=typeof g){for(;b<a.length;){var n=a.eq(b).attr("id"),p=a.eq(b).attr("class");1===$(this).children("a").length&&(c=!0);if(0>n.indexOf(g))break;0>p.indexOf("is-excluded")&&(c=!0);b++}!1===c&&$(this).addClass("is-excluded")}});$(".delexp1").each(function(){"undefined"==typeof $(this).attr("id")&&
0===$(this).find(".delexp1").not(".is-excluded").length&&$(this).addClass("is-excluded")});$(".is-excluded").hide()}}var h=$("#searchmenu"),k=$(".expand1"),l=$(".expand2");k.each(function(){$(this).attr("initialDisplay",$(this).css("display"))});l.each(function(){$(this).attr("initialDisplay",$(this).css("display"))});h.on("input propertychange",function(){m(h,k,l)})});
