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").click(RowClick).dblclick(function(){toPopup($(this).find("td:eq(2) a").attr("href"))}).attr("title","双击行空白处就地打开");t.find("td.cbtd :checkbox").click(function(){selectRow(this)});t.find(">td:eq(2) a").poshytip({content:function(){return $(this).width()+24<$(this).parent().width()?null:$(this).text()},showTimeout:1,timeOnScreen:1e4});$("#btnBatch").css("display",t.length>0?"":"none");t.find("td:last").addClass("pointer").attr("title","删除").click(delMsg);$("#upPager").show();tryFitParent()}function sortBy(n){return __doPostBack("btnOpera","Sort|"+n),!1}function delMsg(n){if(!confirm("确定删除该消息吗？"))return!1;var t=$(getEventSrc(n)).closest("tr.dr").attr("rid");return __doPostBack("btnOpera","Del|"+t),!1}function toFind(){var n=$(".ui-tabs").tabs("option","active");$("#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")}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(n){var t=getEventSrc(n);if($(t).is("a,img,:checkbox")||$.browser.chrome&&getSelection().toString()!="")return!0;$(t).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(){$(".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='loading mtop_l'><div class=\"loadbar\"><div><\/div><div><\/div><div><\/div><div><\/div><div><\/div><\/div><\/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']").focus(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(n){var i=n.keyCode||n.which,t=null;switch(i){case 37:case 33:t="btnPrevious";break;case 39:case 34:t="btnNext";break;case 36:t="btnFirst";break;case 35:t="btnLast"}return $("#"+t+":not(:disabled)").length>0?(__doPostBack(t,""),!1):!0})})