function toPickDate(){WdatePicker({el:"datetb",dateFmt:$("#ddlfs option:selected").attr("fmt")||"yyyy-MM-dd",onpicked:function(){if($("#modes").val()=="介于"){var n=$.trim(tbKey.val());n!=""?n+=" "+this.value:n=this.value;tbKey.val(n)}else tbKey.val(this.value);setCleaner()}})}function SelectedDir(n){__doPostBack("selectDir",n)}function setSubOptions(){$("#divSubDir").css("display",$f("cbDir").checked?"block":"none");tryFitParent()}function selectDir(){return $f("cbDir").checked=!0,setSubOptions(),showDirTree()}function delSc(n){return confirm("确定删除吗？")&&__doPostBack("btnDelSc",n),!1}function delInfoFav(n){return confirm("确定删除吗？")&&__doPostBack("btnDelFav",n),!1}function InitDdl(){tbKey||(tbKey=$("#kw"));AutoWidth("#search select").change(ddlChanged).each(ddlChanged)}function ddlChanged(){var t,i,r,n;if($(this).is("#ddlts,#ddlfs")&&tbKey.val(""),this.id=="ddlfs"&&(t=$(this).val(),$("#modes").css("display",t==""?"none":""),i=$("option:selected",this).attr("type"),r=i=="DateTime",$("#dtPicker").css("display",r?"":"none"),t==""?tbKey.removeAttr("acfid").attr("autocomplete","on"):tbKey.attr("acfid",$("#ddlts").val()+"|"+t)),this.id=="ddlts"&&(n=$("#ddlts").val(),(n=="Data"||n=="Info"||n=="Google"||n=="Baidu"||n=="File")&&($("#ddlfs,#modes").css("display","none"),tbKey.removeAttr("acfid").attr("autocomplete","on")),n=="Info"||n=="Google"||n=="Baidu"||n=="File"?$("#divDir").addClass("hidden"):$("#divDir").removeClass("hidden"),$("#dtPicker").css("display","none")),tbKey.is("[acfid]"))AC(tbKey);else try{tbKey.autocomplete("destroy").unbind("click")}catch(u){}setTimeout(function(){tbKey.filter(":visible").click().select().focus()},0)}function kwKeyup(){var n=$("#ddlfs option:selected").attr("type"),t=$.trim(tbKey.val());t!=""&&(n=="DateTime"||n=="Boolean"||n=="Decimal")?tbKey.attr("disac","1"):tbKey.removeAttr("disac");setCleaner()}function setCleaner(){$("#cleaner").toggleClass("hidden",tbKey.val()=="")}function doClean(){tbKey.val("").click().focus();setCleaner()}function AC(n){if(n.attr("disac")!="1"){var t=" ",i={source:function(i,r){var u=n.attr("acfid"),f,e;if(!u)return!1;f=lastIndexOf(i.term,t);e=i.term.substr(f+1);$.getJSON("ajax.aspx?action=ac&acfid="+u+"&count=24",{term:e},r)},minLength:0,position:{at:"left bottom",my:"left top+1"},focus:function(){return!1},create:function(){$(this).bind("click",function(){$(this).autocomplete("search",$(this).val())})},select:function(n,i){var r=lastIndexOf(this.value,t);return this.value=this.value.substr(0,r+1)+i.item.value,setCleaner(),$("#btnDo").click(),this.blur(),!1}};n.autocomplete(i)}}function enterEdit(n){$(n).hide().closest(".ui-tabs-panel").toggleClass("readmode")}function delFavs(){return hasSelected("favs")&&confirm("确定要从收藏夹中删除选中项吗？")&&__doPostBack("btnDel",""),!1}var tbKey=null;$(function(){var n=0,t=(getUrlParam("Area")||"").toLowerCase();t=="shortcuts"?n=2:t=="favs"&&(n=1);$(".ui-tabs").tabs({active:n,activate:tryFitParent}).show();tbKey=$("#kw").select().focus();setCleaner()})