function reloadPage(){var n=$(".ui-tabs").tabs("option","active"),t=$(".ui-tabs .ui-tabs-nav li:eq("+n+") a").attr("id");__doPostBack("btnOpera","ChangeTab|"+t)}function InitList(n){$(".ui-tabs").find(".ui-tabs-active .hide").css("display",n?"inline":"none");var t=$("#main tr.dr").hover(function(){$(this).addClass("RowMouseOver")},function(){$(this).removeClass("RowMouseOver")}).click(RowClick).dblclick(function(){toPopup($(this).find("td:eq(2) a").attr("href"))}).attr("title","双击行空白处就地打开");t.find("td.cbtd :checkbox").click(function(){selectRow(this)});$("#btnBatch").css("display",t.length>0?"":"none");t.find("td:last img").addClass("pointer").attr("title","删除").click(delMsg);$("#upPager").show();tryFitParent()}function sortBy(n){return __doPostBack("btnOpera","Sort|"+n),!1}function delMsg(){if(!confirm("确定删除该消息吗？"))return!1;var n=$(getEventSrc()).closest("tr.dr").attr("rid");return __doPostBack("btnOpera","Del|"+n),!1}function toFind(){var n=$(".ui-tabs").tabs("option","active"),t;$("#find_popup .head .title").text("查找 "+$("ul.ui-tabs-nav li:eq("+n+") span:first").text());$("#liSender").css("display",n<2?"block":"none");$("#liSendee").css("display",n==2?"block":"none");ShowPop("find_popup");t=$("#find_rbInput").offset().left-$("#find_cbTime").offset().left;$("#find_rbSelect").css("margin-left",t)}function showBatchPop(){ShowPop("batch_popup");var n=$("#dt tr.dr td.cbtd :checkbox:checked").length>0?"batch_rbSelected":"batch_rbAll";return $("#"+n).prop("checked",!0),$("#batch_btnMark").css("display",$(".ui-tabs").tabs("option","active")<2?"":"none"),setBatchPop(),!1}function setBatchPop(){var t,n;$("#batch_popup").is(":hidden")||(t=$("#dt tr.dr td.cbtd :checkbox:checked").length,$("label[for='batch_rbSelected']").text("选中的消息 ("+t+")"),n=$(".ui-tabs").tabs("option","active"),n==0?($("label[for='batch_rbAll']").text("所有未读消息"),$("#batch_btnMark").css("display","").val("标为已读")):n==1?($("label[for='batch_rbAll']").text("所有已读消息"),$("#batch_btnMark").css("display","").val("标为未读")):($("label[for='batch_rbAll']").text("所有已发送消息"),$("#batch_btnMark").css("display","none")))}function setSelection(){var n="";return $("#dt tr.dr td.cbtd :checkbox:checked").each(function(){n+=(n==""?"":",")+$(this).closest("tr").attr("rid")}),n}function selectAll(){var n=$("#cbAll").prop("checked"),t=$("#dt tr.dr td.cbtd :checkbox").prop("checked",n);n?t.closest("tr").addClass("selectedRow").removeClass("RowMouseOver"):t.closest("tr").removeClass("selectedRow RowMouseOver");$("#batch_rbSelected").prop("checked",!0);setBatchPop()}function selectRow(n){n.checked?$(n).closest("tr").addClass("selectedRow").removeClass("RowMouseOver"):$(n).closest("tr").removeClass("selectedRow RowMouseOver");$("#batch_rbSelected").prop("checked",!0);setBatchPop()}function RowClick(){var n=getEventSrc();if($(n).is("a,img,:checkbox")||$.browser.chrome&&getSelection().toString()!="")return!0;$(n).closest("tr").find("td.cbtd :checkbox").each(function(){this.checked=!this.checked;selectRow(this)})}function toMark(){var n=$(".ui-tabs").tabs("option","active"),t;if($("#batch_rbSelected").is(":checked")){if(t=setSelection(),t=="")return showAndExit("当前未选择记录！");__doPostBack("batch$btnMark",n+"|"+t)}else if(n==0)confirm("确定要将所有未读消息标记为已读吗？")&&__doPostBack("batch$btnMark",n+"|All");else if(n==1)confirm("确定要将所有已读消息标记为未读吗？")&&__doPostBack("batch$btnMark",n+"|All");else return showAndExit("意外错误！");return!1}function beforeDel(){var n=$(".ui-tabs").tabs("option","active"),t,i;if($("#batch_rbSelected").is(":checked")){if(t=setSelection(),t=="")return showAndExit("当前未选择记录！");confirm("确定要删除当前选中的消息吗？")&&__doPostBack("batch$btnDel",n+"|"+t)}else i=n==0?"确定要删除所有未读消息吗？":n==1?"确定要删除所有已读消息吗？":"确定要删除发件箱中所有消息吗？",confirm(i)&&__doPostBack("batch$btnDel",n+"|All");return!1}function unreadChanged(){try{inPopup()?parent.parent.leftFrame.lastTime="":parent.leftFrame.lastTime=""}catch(n){}}LoadDatePicker();var tabIndex=0;$(function(){top.needRefreshMsgs==!0&&(top.needRefreshMsgs=null,location.reload(!0));$(".ui-tabs").tabs({active:tabIndex,activate:function(n,t){$("#upPager,div.pop").hide();var i=t.newTab.find("a").attr("id");t.newPanel.html("<div class='footBtnArea middle'><img src='images/loading.gif' />　正在加载 …<\/div>");t.newTab.closest("ul").find("span.hide").removeAttr("style");__doPostBack("btnOpera","ChangeTab|"+i);tryFitParent()}}).fadeIn(300);AutoComplete("#find_popup :text[acfid]");$("ul.conds li :input[type!='checkbox']").click(function(){var n=$(this);n.closest("li").find(":checkbox:first").prop("checked",!0);n.isIn(".times")&&!n.is(":radio")&&n.prevAll(":radio:first").prop("checked",!0)});$(document).keydown(function(){var t=getEvent(),i=t.keyCode||t.which,n=null;switch(i){case 37:case 33:n="btnPrevious";break;case 39:case 34:n="btnNext";break;case 36:n="btnFirst";break;case 35:n="btnLast"}return $("#"+n+":not(:disabled)").length>0?(__doPostBack(n,""),!1):!0})})