function compare(n,t){return n.localeCompare(t)}$(function(){var t,i,u,r,n,f;if(inIframe()&&$("#header").hide(),t=$(".infolder[folder]").each(function(){$("div.item[folderid='"+$(this).attr("folder")+"']").appendTo(this)}),t.length>2&&(t.hide(),i=$("#header td:first"),i.length==0&&(i=$("#header")),u=$("<i class='switcher f-more3 r1' title='全部展开/折叠'><\/i>").appendTo(i).on("click",function(){var n=u.is(".r3");n?t.slideUp(280,tryFitParent):t.slideDown(280,tryFitParent);u.toggleClass("r3");$(".dirTitle span").toggleClass("r2",n)})),$("#main").removeClass("hide"),r=$(".item").hover(function(){$(this).toggleClass("hover")}).click(function(){toLoad(baseUrl+$(this).attr("rid"))}).attr("title",function(){return $(this).text()}),n=$("#ac"),n.length>0){f={source:function(n,t){var i=n.term.toLowerCase(),u=r.map(function(){var n=$(this).text();return n.toLowerCase().indexOf(i)>-1||new RegExp("^[a-zA-Z]$").test(i)&&getPinyinFirstChar(n)==i?n:null}).toArray();t(u.sort(compare))},position:{at:"left bottom",my:"left top+1"},minLength:0,select:function(n,t){var i=t.item.value;return r.filter(function(){return $(this).text()==i}).click(),!0},create:function(){n.bind("focus",function(){n.autocomplete("search",n.val())})}};n.mouseover(function(){n.data("acinited")||n.autocomplete(f).data("acinited",!0)}).keydown(function(t){if((t.which||t.keyCode)!=13)return!0;var u=n.val(),i=r.filter(function(){return $(this).text()==u});return i.length>0?i.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","展开/折叠");InitScroller()})