function leftright(){setLeftBar(!leftBarShown(),!0)}function leftBarShown(){return parent.document.getElementById("lr").cols!="0,*"}function setLeftBar(n,t){parent.document.getElementById("lr").cols=n?"288,*":"0,*";$("#switcher").toggleClass("showbar",n);parent.leftFrame.leftShown=null;t&&isPc&&$.get("ajax.aspx",{action:"setProfile",key:"LeftBarClosed",value:!n})}function showMsgs(n){var t,i,r;if(n&&(showNewCount("msg",n.Total),isPc&&n.Total)){t=n.List[0];i="msgDetail.aspx?id="+t.ID+"&from=Unread";try{r=new Date(t.SendTime);r>openat&&($("#bgs").attr("src","images/sms.mp3"),!mainFully()||parent.mainFrame.$("#colorbox:visible").length?toOpen(i,null,null,"w_msg"):parent.mainFrame.toPopup(i))}catch(u){}}}function resetConfirm(){return confirm("演示版中，您与他人的操作会互相影响，重置系统可恢复到初始状态。\n\n确定重置系统吗？")&&__doPostBack("reset",""),!1}function InitDdl(){tbKey||(tbKey=$("#kw"));AutoWidth("#find select",36,102).change(ddlChanged).each(ddlChanged)}function ddlChanged(n){var u=n&&n.type=="change"&&!window.nofocus,i=this,r,t;if(u&&$(i).is("#ddlts,#ddlfs")){tbKey.select();try{parent.mainFrame.CloseAcHelper()}catch(f){}}if(i.id=="ddlfs"&&(r=$(i).val(),r==""||tbKey.attr({acfid:$("#ddlts").val()+"|"+r,autocomplete:"off"})),i.id=="ddlts"&&(t=$("#ddlts").val(),(t=="Data"||t=="Info"||t=="Baidu"||t=="File")&&($("#ddlfs").css("display","none"),t=="Info"&&tbKey.attr("acfid","Info"))),tbKey.is("[acfid]"))AC(tbKey);else try{tbKey.autocomplete("destroy").unbind("click")}catch(f){}if(u)try{i.id!="ddlts"&&tbKey.autocomplete("search",tbKey.val());tbKey.select()[0].focus()}catch(f){}}function showNewCount(n,t){var i=$(n=="msg"?"#msgCount":"#taskCount");t>0?i.text(t).show():i.hide()}function showFinder(){var n=$("#ddlts").val();isNaN(n)||!mainFully()?toLoad("select.aspx?action=Search"):parent.mainFrame.fixedFinder(n,$("#ddlts option:selected").text())}function finderAdapter(n){var t,i;(window.syncFinder||!isPc)&&n&&!isNaN(n)&&(t=$("#ddlts"),t.is(":visible")&&t.find("option[value="+n+"]").length&&t.offset().top<50&&(i=t.val(),i!=n&&(window.nofocus=!0,t.val(n).trigger("change"),tbKey.val(""),setTimeout("window.nofocus = null;",0))))}function AC(n){var t=" ",i={source:function(i,r){var u=n.attr("acfid"),e,f;return u?(e=lastIndexOf(i.term,t),f=i.term.substr(e+1),mainFully()?$.getJSON("ajax.aspx?action=ac&acfid="+u+"&count=40",{term:f},function(t){parent.mainFrame.AcHelper(t,n)}):$.getJSON("ajax.aspx?action=ac&acfid="+u+"&count=5",{term:f},r),!1):!1},minLength:0,position:{at:"left bottom",my:"right-1 bottom"},focus:function(){return!1},create:function(){$(this).on("click",function(){$(this).autocomplete("search",$(this).val())})},select:function(n,i){var r=lastIndexOf(this.value,t),u=this.value.substr(0,r+1)+i.item.value;return doSearch(u),!1}};n.autocomplete(i)}function doSearch(n){tbKey.val(n);$f("btnDo").click();tbKey.blur()}var tbKey=null,openat=new Date;$(function(){$("#ddlts").change(function(){try{if(parent.mainFrame.$("#fixedFinder").is(":visible")){var n=$("#ddlts").val();isNaN(n)||parent.mainFrame.fixedFinder(n,$("#ddlts option:selected").text())}}catch(t){}});$("#msg").attr("title","点击查看消息，右键发送消息").on("contextmenu",function(n){try{return parent.mainFrame.toSend("msg")}catch(t){toLoad("msg.aspx")}return CanelEvent(n)});$("#tran").attr("title","点击打开，右键发起流程").on("contextmenu",function(n){return toLoad("select.aspx?action=AddFlow"),CanelEvent(n)});$("#info").attr("title","点击打开，右键发布").on("contextmenu",function(n){return toLoad("infoEdit.aspx"),CanelEvent(n)});$("#data").attr("title","点击打开，右键添加数据").on("contextmenu",function(n){return toLoad("select.aspx"),CanelEvent(n)});$("#sousuo").attr("title","点击快捷搜索，右键高级搜索").on("contextmenu",function(n){return toLoad("select.aspx?action=Search"),CanelEvent(n)});tbKey=AutoWidth("#kw",null,132);$("#navbar a[href]").on("click",function(n){return this.target=="_blank"?!0:(toLoad(this.href),CanelEvent(n))});$("#btnDo").on("contextmenu",function(n){return showFinder(),CanelEvent(n)})})