function compare(n,t){return n.localeCompare(t)}$(function(){var i,t,n,r,u;if(inIframe()&&$("#header").hide(),i=$(".infolder[folder]").each(function(){$("div.item[folderid='"+$(this).attr("folder")+"']").appendTo(this)}).hide(),$("#main").removeClass("hide"),t=$(".item").hover(function(){$(this).toggleClass("hover")}).click(function(){toLoad(baseUrl+$(this).attr("rid"))}).attr("title",function(){return $(this).text()}),n=$("#ac"),n.length>0){r={source:function(n,i){var r=n.term.toLowerCase(),u=t.map(function(){var n=$(this).text();return n.toLowerCase().indexOf(r)>-1||new RegExp("^[a-zA-Z]$").test(r)&&getPinyinFirstChar(n)==r?n:null}).toArray();i(u.sort(compare))},position:{at:"left bottom",my:"left top+1"},minLength:0,select:function(n,i){var r=i.item.value;return t.filter(function(){return $(this).text()==r}).click(),!0},create:function(){n.bind("focus",function(){n.autocomplete("search",n.val())})}};n.mouseover(function(){n.data("acinited")||n.autocomplete(r).data("acinited",!0)}).keydown(function(i){if((i.which||i.keyCode)!=13)return!0;var u=n.val(),r=t.filter(function(){return $(this).text()==u});return r.length>0?r.click():i.keyCode=40,!1});$(window).on("scroll",function(){n.data("acinited")&&n.autocomplete("close")})}u=$(".dirTitle").click(function(){$(this).toggleClass("f-dir f-dir0").next("div.infolder").slideToggle(280,tryFitParent);$("span",this).toggleClass("r2")}).attr("title","展开/收拢");i.length<3&&u.click()})