function compare(n,t){return n.localeCompare(t)}$(function(){var t,r,i,n,u;if(inIframe()&&$("#header").hide(),t=$(".infolder[folder]").each(function(){$("div.item[folderid='"+$(this).attr("folder")+"']").appendTo(this)}),t.length>2&&(t.hide(),r=$("<i class='f-rr f0' title='全部展开/折叠'><\/i>").appendTo("#header td:first").on("click",function(){r.is(".r2")?t.slideUp(280,tryFitParent):t.slideDown(280,tryFitParent);r.toggleClass("r2")})),$("#main").removeClass("hide"),i=$(".item").hover(function(){$(this).toggleClass("hover")}).click(function(){toLoad(baseUrl+$(this).attr("rid"))}).attr("title",function(){return $(this).text()}),n=$("#ac"),n.length>0){u={source:function(n,t){var r=n.term.toLowerCase(),u=i.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();t(u.sort(compare))},position:{at:"left bottom",my:"left top+1"},minLength:0,select:function(n,t){var r=t.item.value;return i.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(u).data("acinited",!0)}).keydown(function(t){if((t.which||t.keyCode)!=13)return!0;var u=n.val(),r=i.filter(function(){return $(this).text()==u});return r.length>0?r.click():t.keyCode=40,!1});$(window).on("scroll",function(){n.data("acinited")&&n.autocomplete("close")})}$(".dirTitle").click(function(){$(this).toggleClass("f-dir f-dir0").next("div.infolder").slideToggle(280,tryFitParent);$("span",this).toggleClass("r2")}).attr("title","展开/折叠")})