看看了126 D版的设计,的确不错,让人很舒服。
126 javascript 的编写者真不愧是一个高手。把js技术用的炉火纯清。
今天摘了些核心的代码如下:
mainmodule.js 由于全是Ajax 生成,所以很乱,不过技术是全在这了:
function FolderMain()
{
this.deleteFolder=new Object();
this.emptyFolder=new Object();
this.renameFolder=new Object();
this.setNewMail=fSetNewMail;
this.insertDefinedFolder=fInsertDefinedFolder;
this.renameFdr=fFolderMain_renameFdr;
this.deleteFdr=fFolderMain_deleteFdr;
this.cleanFolder=fFolderMain_cleanFolder;
this.newFolder=fFolderMain_newFolder;
this.emptyDeleted=null;
this.emptySpam=null;
this.getHtml=fFolderMain_getHtml;
this.init=fFolderMain_init;
this.getToolbar=fFolderMain_getToolbar;
this.info=fFolderMain_info;
this.toggleMyFolder=fFolderMain_toggleMyFolder;
this.createMyFolder=fFolderMain_createMyFolder;
this.newFolderKeydown=fFolderMain_newFolderKeydown;
this.getDefinedFolderName=fFolderMain_getDefinedFolderName;
this.newFolderByToolbar=fFolderMain_newFolderByToolbar;
this.getFolderUnread=fFolderMain_fGetFolderUnread;
}
function FolderMain_init()
{
var OFolderMain=new FolderMain();
MM["folderMain"].deleteFolder=new Object();
MM["folderMain"].emptyFolder=new Object();
MM["folderMain"].renameFolder=new Object();
MM["folderMain"].emptyDeleted=null;
MM["folderMain"].emptySpam=null;
MM["folderMain"].setNewMail=OFolderMain.setNewMail;
MM["folderMain"].insertDefinedFolder=OFolderMain.insertDefinedFolder;
MM["folderMain"].renameFdr=OFolderMain.renameFdr;
MM["folderMain"].deleteFdr=OFolderMain.deleteFdr;
MM["folderMain"].cleanFolder=OFolderMain.cleanFolder;
MM["folderMain"].newFolder=OFolderMain.newFolder;MM["folderMain"].getHtml=OFolderMain.getHtml;
MM["folderMain"].init=OFolderMain.init;
MM["folderMain"].getToolbar=OFolderMain.getToolbar;
MM["folderMain"].info=OFolderMain.info;
MM["folderMain"].toggleMyFolder=OFolderMain.toggleMyFolder;
MM["folderMain"].createMyFolder=OFolderMain.createMyFolder;
MM["folderMain"].newFolderKeydown=OFolderMain.newFolderKeydown;
MM["folderMain"].getDefinedFolderName=OFolderMain.getDefinedFolderName;
MM["folderMain"].newFolderByToolbar=OFolderMain.newFolderByToolbar;
MM["folderMain"].getFolderUnread=OFolderMain.getFolderUnread;
}
FolderMain_init();
function fFolderMain_getHtml()
{
var l=gLang["folderMain"];
var c=gLang["common"];
var d=CM.folderMain;
var html='';
html+='<div class="fdMainDiv border1" style="height:406px;" style="background-color:#ffffff"><div style="display:none">'+ d.renameForm + d.newForm +'</div>' +' <div class="bgF2 readMailHeaderBG" ></div><!--背景底纹-->' +' <div class="fdListDiv bgcolor2 border3" >' +' <div class="pad1 fLeft wid4">文件夹名称</div>' +' <div class="wid3 fLeft">新邮件</div>' +' <div class="wid3 fLeft">总封数</div>' +' <div class="wid3 fLeft">空间大小 </div>' +' <div style="width:40px " class="fLeft">百分比 </div> ' +' </div><div id="foldersList">';
var arrOrder=fSetFolderOrder(d.folderItems);
for(var n=0;n<arrOrder.length;n++)
{
for(var i=0;i<d.folderItems.length;i++)
{
var folder=d.folderItems[i];
if(arrOrder[n]!=folder[0])
continue;
var sFolder=CC.getModuleByFid(folder[0],folder[1]);
html+='<div class="fdListDiv2 border3">' +' <div class="pad1 fLeft wid4"><a href="javascript:fGoto();" onclick="fGoto(\'MM.getModule\',\''+ sFolder +'\')" class="fgn">'+ folder[1] +'</a></div>' +' <div class="wid3 fLeft"><b class="fred">'+ cm2ntes_foldernew(folder[0], folder[4]) +'</b></div>' +' <div class="wid3 fLeft">'+ folder[3] +'</div>' +' <div class="wid3 fLeft">'+ folder[5] +' </div>' +' <div class="wid3 fLeft">'+ folder[6] +' </div>' +fGenerateOptions(folder, sFolder) +' </div>';
}
}
html+='</div>';
var gTotal=d.useTableB[2];
var gTotalLength=d.totallength;
var gNotUsed=d.useTableB[1];
var gNotUsedCent=d.useTableP[1];
var sHtmlTotal="";var strPer='%';
var gNotFreeWidth=100-parseFloat(gNotUsedCent);
var sNotFree="0%";
if(gNotFreeWidth!=0&&!isNaN(gNotFreeWidth))
{
sNotFree=gNotFreeWidth+strPer;
}
sHtmlTotal=fGbToMb(gTotal);
html+='<div class="fdListDiv2 " style="border-bottom-color:#FFFFFF">' +' <div class="pad1 fLeft wid5 " style="margin-top:3px">总空间'+ sHtmlTotal +':已用<span class="fred">'+ fGbToMb(gTotalLength) +'</span>,剩余'+ fGbToMb(gNotUsed) +'</div>' +' <table class="wid4 border2" style="border-style:solid; border-width:1px;">' +' <tr>' +' <td style="padding:1px">' +' <table style="width:'+ sNotFree +'" class="bgcolor6"><!--这里控制容量条的百分比长度-->' +' <tr>' +' <td style="padding:1px">' + sNotFree +' </td>' +' </tr>' +' </table>' +' </td>' +' </tr>' +' </table>' +' </div>' +' </div>';
return html;
};
function fFolderMain_init()
{
this.insertDefinedFolder();
this.setNewMail();
fSaveFolders();
var bottomHeight=GE.leftHeight;
this.div.firstChild.style.height=bottomHeight + "px";CC.resetNavScroll();
};
function fFolderMain_getToolbar(sModule)
{
var lhtml="", rhtml="";
lhtml='<table class="tlbtn1" onMouseOver="addClass(this,\'over\')" onMouseOut="if(this.getAttribute(\'isMenu\'))return;setClass(this,\'tlbtn1\')" onMouseDown="addClass(this,\'click\')" onMouseUp="delClass(this,\'click\')" onclick="fGoto(\'MM.folderMain.newFolderByToolbar\')"> ' +' <tr> ' +' <td class="bgF1 tbtn_l"></td> ' +' <td class="bgF2 tbtn_m"><b class="btnS icoBtn btnAddFd"></b></td> ' +' <td class="bgF2 tbtn_m">新建文件夹 </td> ' +' <td class="bgF1 tbtn_r"></td> ' +' </tr> ' +' </table>';
rhtml="";
return [lhtml, rhtml];
};
function fFolderMain_info(name)
{
switch(name)
{
case "new_from_toolbar":$("txtNewFolderByToolbar").select();
break;
case "new_from_link":$("txtNewFolderByLink").select();
break;
}
};
function fSetFolderOrder(d)
{
var arr=[];
for(var i in d)
{
arr[arr.length]=d[i][0];
}
return arr.sort(function(a,b){return a-b});
}
function fGenerateOptions(folder,sFolder)
{
var html="";
html+='<div class="fLeft wid1" ><a href="javascript:fGoto();" class="fgn" onclick="fGoto(\'MM.folderMain.cleanFolder\',\''+ folder[7] +'\',\''+ sFolder +'\',\''+ folder[3] +'\')" style="visibility:'+ (folder[7]?"visible":"hidden") +'">' + gLang["common"]["empty"] + '</a></div>';html+='<div class="fLeft wid1" ><a href="javascript:fGoto();" class="fgn" onclick="'+ ((folder[8])?'fGoto(\'MM.folderMain.deleteFdr\',\''+ folder[8] +'\',\''+ sFolder +'\')':'fGoto(\'CC.showSysMsg\',\''+ ((folder[10]!="0")?'想删除该文件夹,请到邮箱选项的POP选项里删除该POP帐号!':'请先清空邮件!') +'\')') +'" style="visibility:'+ ((folder[0]>10)?"visible":"hidden") +'">' + gLang["common"]["del"] + '</a></div>';html+='<div class="fLeft wid1" ><a href="javascript:fGoto();" class="fgn" onclick="fGoto(\'MM.folderMain.renameFdr\',\''+ folder[9] +'\')" style="visibility:'+ (folder[9]?"visible":"hidden") +'">' + gLang["common"]["rename"] + '</a></div>';if(folder[7]){eval('MM["folderMain"].emptyFolder["'+ sFolder +'"]=function(){MM.folderMain.cleanFolder("'+ folder[7].usc_hdc() +'", "'+ sFolder +'", "'+ folder[3] +'");}');
}
if(folder[8]){eval('MM["folderMain"].deleteFolder["'+ sFolder +'"]=function(){MM.folderMain.deleteFdr("'+ folder[8].usc_hdc() +'", "'+ sFolder +'");}');}else{eval('MM["folderMain"].deleteFolder["'+ sFolder +'"]=function(){CC.showSysMsg(("'+ folder[10] +'"!="0")?"想删除该文件夹,请到邮箱选项的POP选项里删除该POP帐号!":"请先清空邮件!")}');}if(folder[9]){eval('MM["folderMain"].renameFolder["'+ sFolder +'"]=function(){MM.folderMain.renameFdr("'+ folder[9] +'");}');}return html;}function fInsertDefinedFolder(){try{var folders=CM.folderMain.folderItems;var ulMyFolders=$("ulMyFolders");var myHtml='<li><b class="btnS icoClose" onclick="fGoto(\'MM.folderMain.toggleMyFolder\')"></b><a href="javascript:fGoto()" class="lstName fbk3" onclick="fGoto(\'MM.getModule\',\'folderMain\')" id="lnkfolderMain">我的文件夹</a> <a href="javascript:fGoto()" class="lstOpt fbk3" id="lnkAddFolder" onclick="fGoto(\'MM.folderMain.createMyFolder\')">添加</a></li>';var arr=[];for(var i=0;i<folders.length;i++){var folder=folders[i];var sFolder=CC.getModuleByFid(folder[0],folder[1]);if(folder[0] > 10){if(folder[10]=="0"||1==1){arr[arr.length]='<li class="gSubFd" id="dvTab'+ sFolder +'" onclick="return fGoto(\'MM.getModule\',\'defined'+ folder[0] +'\');" onmouseover="fFolderOver(this)" onmouseout="fFolderOut(this)"><b class="btnS icoMfd"></b><a href="javascript:fGoto()" class="lstName fbk3" title="'+ folder[1] +'" id="lnk'+ sFolder +'" >'+ folder[1].left(10) +'<span id="spnNew'+ sFolder +'"></span></a></li>';}}}ulMyFolders.innerHTML=myHtml + arr.join("");}catch(exp){fDebug("fInsertDefinedFolder",exp.description);}}function fSetNewMail(){try{var folders=CM["folderMain"].folderItems;var total=0;for(var i=0;i<folders.length;i++){var folder=folders[i];var sFolder=CC.getModuleByFid(folder[0],folder[1]);var count=folder[4] - 0;var o=$("spnNew" + sFolder);if(!o){continue;}if(count>0){o.innerHTML='('+ count +')';}else{o.innerHTML='';}}}catch(exp){fDebug("fSetNewMail",exp.description);}}function fFolderMain_newFolderByToolbar(){var foldersList=$("foldersList");var inputList=foldersList.getElementsByTagName("INPUT");if(inputList.length!=0){return;}var div=El.createElement("DIV");div.className="fdListDiv2 border3";div.innerHTML='<div class="pad1 fLeft wid4"><input type="text" id="txtNewFolderByToolbar" style="width:100%;border:1px #000000 solid;padding:2px;" value="'+ MM["folderMain"].getDefinedFolderName(1) +'" onblur="fSaveObj(this, event);fGoto(\'MM.folderMain.newFolder\')" onkeydown="fSaveObj(this, event);fGoto(\'MM.folderMain.newFolderKeydown\')"></div>';foldersList.appendChild(div);div.firstChild.firstChild.select();}function fFolderMain_newFolder( ){frame["indexFrame"].document.body.onselectstart=function(){return false};var nn=GE.getThis();var ev=GE.getEvent();var name=(nn.id=="txtNewFolderByToolbar")?"new_from_toolbar":"new_from_link";if(nn.value.trim()==""){CC.showSysMsg({"info":gLang["folderMain"][8], "module":"folderMain", "flag":name});
return;
}
if( !checkFdrName( nn.value)){MM["folderMain"].info(name);
return;
}
nn=nn.value.cleanBlank();
var dml=$("makenewfolder");
dml.newfoldername.value=nn;
dml.submit();
}
function fFolderMain_cleanFolder(sURL,sFolder,count)
{
if(count==0)
{
CC.showSysMsg(gLang["folderMain"][14]);
return;
}
if(sURL.indexOf("http")==-1)
{
sURL=GE.cmDomain + sURL;
}
if(window.confirm("您确定删除这个文件夹下的所有邮件么?"))
{
CM.urlReffer(sURL, "folderMain");
MM[sFolder].load=false;
if(GE.laterRequestModule==sFolder)
{
window.setTimeout('CM.setCMReffer("'+ sFolder +'");',2000);
}
}
}
function fFolderMain_deleteFdr(sURL, sFolder)
{
if(window.confirm("您确定删除这个文件夹么?"))
{
if(sURL.indexOf("http")<0)
{
sURL=GE.cmDomain + sURL;
}
CM.urlReffer(sURL, "folderMain");MM[sFolder].load=false;if(TLabel.exist(sFolder)){TLabel.close(sFolder);}}}function cm2ntes_foldernew( fid, num){var s=num;if( num -0 >0){s="<a href='javascript:fGoto();' style='font-weight:bold;color:red;' onclick=\"fGoto('MM.folderMain.getFolderUnread','/coremail/fcg/ldsrchapp?funcid=srchhand2&sid="+ gSID +"&stateflag=1&fid=" + fid + "')\">" + num + "</a>";}return s;}function fFolderMain_fGetFolderUnread(sUrl){var oldUrl=MM["unRead"].cmURL;MM["unRead"].cmURL=GE.cmDomain + sUrl;MM.getModule("unRead");MM["unRead"].cmURL=oldUrl;}function fFolderMain_renameFdr( parentfid ){var nn=window.prompt(gLang["folderMain"][12],"");if(!nn||typeof(nn)=="undefined"){return;}if(nn.trim()==""){CC.showSysMsg("文件夹名称不能为空!");return;}if( !checkFdrName( nn)){return;}var dml=$("frmRenameFdr");dml.parentfid.value=parentfid;dml.newfoldername.value=nn;if(dml.action.indexOf("http")<0){dml.action=GE.cmDomain + dml.action;}dml.submit();}function checkFdrName( nn ){if( nn==null)return false;nn=nn.cleanBlank();if( nn==""){CC.showSysMsg("文件夹名称不能为空!");return false;}if( fByteLength(nn)>12){CC.showSysMsg("长度不能大于12!");return false;}return nn.checkSpecialChar(true);}function fByteLength(str){var l=str.length;var n=l;for (var i=0;i<l;i++){if (str.charCodeAt(i)<0||str.charCodeAt(i)>255){n++;}}return n;}function fGbToMb(sSize){var sMB=gLang["folderMain"][9];if(sSize.indexOf('G')==sSize.length-1){var iNewSize;iNewSize=parseFloat(sSize);iNewSize*=1000;return iNewSize + sMB;}if(sSize.indexOf('M')==sSize.length-1){var sNewSize;sNewSize=sSize.substr(0,sSize.length-1);return sNewSize + sMB;}return sSize;}function fSaveFolders(){var d=CM["folderMain"];var arr=[];for(var i=0;i<d.folderItems.length;i++){var folder=d.folderItems[i];arr[arr.length]=[folder[0],folder[1]];}GE.folders=arr;}function fFolderMain_toggleMyFolder(){var ulMyFolders=$("ulMyFolders");if(ulMyFolders.firstChild.firstChild.className=="btnS icoClose"){ulMyFolders.firstChild.firstChild.className="btnS icoOpen";for(var i=1;i<ulMyFolders.childNodes.length;i++){ulMyFolders.childNodes[i].style.display='none';}}else{ulMyFolders.firstChild.firstChild.className="btnS icoClose";for(var i=1;i<ulMyFolders.childNodes.length;i++){ulMyFolders.childNodes[i].style.display='block';}}CC.resetNavScroll();};function fFolderMain_createMyFolder(){var ulMyFolders=$("ulMyFolders");var inputList=ulMyFolders.getElementsByTagName("INPUT");if(inputList.length!=0){return;}var li=El.createElement("LI");li.className="gSubFd";li.innerHTML='<b class="btnS icoInbox"></b><span><input type="text" style="width:80px;border:1px #000000 solid;padding:2px;" value="'+ this.getDefinedFolderName(1) +'" onblur="fSaveObj(this, event);fGoto(\'MM.folderMain.newFolder\')" onkeydown="fSaveObj(this, event);fGoto(\'MM.folderMain.newFolderKeydown\');" id="txtNewFolderByLink" class="lstName ReName"></span>';ulMyFolders.appendChild(li);frame["indexFrame"].document.body.onselectstart=function(){return true};li.getElementsByTagName("INPUT")[0].select();CC.resetNavScroll();};function fFolderMain_newFolderKeydown(){var ev=GE.getEvent();var obj=GE.getThis();if(ev.keyCode==27){var obj=obj.parentNode.parentNode;obj.parentNode.removeChild(obj);}else if(ev.keyCode==13){MM.folderMain.newFolder();}CC.resetNavScroll();};function fFolderMain_getDefinedFolderName(n){var name="未命名" + n;var folders=CM.folderMain.folderItems;for(var i=0;i<folders.length;i++){var folder=folders[i];if(folder[1]==name){n ++;return this.getDefinedFolderName(n);}}return name;};function Folder(){this.setPartEvent=fSetPartEvent;this.readLetter=fReadLetter;this.insertMail=fInsertMail;this.del=fFolder_Delete;this.refuse=fFolder_refuse;this.mark=fFolder_mark;this.move=fFolder_move;this.folderHandle=fFolderHandle;this.folderDop=fMoveLettersByDrop;this.createChks=fCreateChks;this.getHtml=fFolder_getHtml;this.getToolbar=fFolder_getToolbar;this.getToolbarMenu=fFolder_getToolbarMenu;this.init=fFolder_init;this.setContentHeight=fFolder_setContentHeight;this.resize=fFolder_resize;this.getDataGrid=fFolder_getDataGrid;this.synData=fFolder_synData;this.reset=fFolder_reset;this.fDG_Click=fFolder_fDG_Click;this.getModuleByDGEvent=fFolder_getModuleByDGEvent;this.fDG_DoubleClick=fFolder_fDG_DoubleClick;this.readByKeyEnter=fFolder_readByKeyEnter;this.readByContextMenuByNewWin=fFolder_readByContextMenuByNewWin;this.readByContextMenuByNewTab=fFolder_readByContextMenuByNewTab;this.fDG_Mousedown=fMailMouseDown;this.fDG_Keydown=fMailKeyDown;this.fDG_ContextMenu=fFolder_fDG_ContextMenu;this.removeLetters=fFolder_removeLetters;this.getNewSubmitFrame=fFolder_getNewSubmitFrame;this.changeMailStatus=fFolder_changeMailStatus;this.changeMailStatusByMid=fFolder_changeMailStatusByMid;this.goSearch=fFolder_goSearch;this.goPageN=fFolder_goPageN;}function Folder_init(){var OFolder=new Folder();MM["folder"].setPartEvent=OFolder.setPartEvent;MM["folder"].readLetter=OFolder.readLetter;MM["folder"].insertMail=OFolder.insertMail;MM["folder"].del=OFolder.del;MM["folder"].refuse=OFolder.refuse;MM["folder"].mark=OFolder.mark;MM["folder"].move=OFolder.move;MM["folder"].folderHandle=OFolder.folderHandle;MM["folder"].folderDop=OFolder.folderDop;MM["folder"].createChks=OFolder.createChks;MM["folder"].getHtml=OFolder.getHtml;MM["folder"].getToolbar=OFolder.getToolbar;MM["folder"].getToolbarMenu=OFolder.getToolbarMenu;MM["folder"].init=OFolder.init;MM["folder"].setContentHeight=OFolder.setContentHeight;MM["folder"].resize=OFolder.resize;MM["folder"].getDataGrid=OFolder.getDataGrid;MM["folder"].synData=OFolder.synData;MM["folder"].reset=OFolder.reset;MM["folder"].fDG_Click=OFolder.fDG_Click;MM["folder"].getModuleByDGEvent=OFolder.getModuleByDGEvent;MM["folder"].fDG_DoubleClick=OFolder.fDG_DoubleClick;MM["folder"].readByKeyEnter=OFolder.readByKeyEnter;MM["folder"].readByContextMenuByNewWin=OFolder.readByContextMenuByNewWin;MM["folder"].readByContextMenuByNewTab=OFolder.readByContextMenuByNewTab;MM["folder"].fDG_Mousedown=OFolder.fDG_Mousedown;MM["folder"].fDG_Keydown=OFolder.fDG_Keydown;MM["folder"].fDG_ContextMenu=OFolder.fDG_ContextMenu;MM["folder"].removeLetters=OFolder.removeLetters;MM["folder"].getNewSubmitFrame=OFolder.getNewSubmitFrame;MM["folder"].changeMailStatus=OFolder.changeMailStatus;MM["folder"].changeMailStatusByMid=OFolder.changeMailStatusByMid;MM["folder"].goSearch=OFolder.goSearch;MM["folder"].goPageN=OFolder.goPageN;}Folder_init();function fFolder_getHtml(){var sModule=this.moduleName;var l=gLang["folder"];var c=gLang["common"];var d=CM[sModule];var html="";html+="<div style='display:none'>" + d.frmsHTML + "</div>";html+='<form method="post" action="'+ GE.cmDomain + d.urlAction +'" name="frmHeaderList" id="frmHeaderList'+ sModule +'" target="'+ sModule +'" style="display:inline"><div style="display:none">' +d.postElsHTML+'<span id="spnFolderFormUrl'+ sModule +'" style="display:none;">'+ GE.cmDomain + d.urlAction +'</span></div>';html+=' <div style="border-width:1px; border-style:solid" id="MailListDiv'+ sModule +'" class="border1" onselectstart="return false;">' +'</div></form>';if(GE.readType=="0"){html+='<div class="gRsbr3 mouseRsRow" id="dvVSplitter'+ sModule +'"><b class="gRbBlk btnS alignCen"></b></div>'+' <div class="border1" style="height:238px; height:239px; border-width:1px; border-style:solid;overflow:hidden" id="dvLetterContent'+ sModule +'">'+' <div class="bgF2 readMailHeaderBG" ></div>'+' <table border="0" cellpadding="0" cellspacing="0" class="readMailHeaderTable bgcolor2 fbk3" id="readMailHeaderTab'+ sModule +'" name="readMailHeaderTab" height="50" >'+' <tr>'+' <td class="readMailHeaderCont fgn fbold">' +' <div id="moreCont" style="display:none;" class="bgcolor5 readMailHeaderCont">'+' </div> </td>'+' </tr>'+' <tr>'+' <td colspan="2" style="border-bottom-style:solid; border-bottom-width:1px; "class="readMailHeaderCont fbk3 border1" > '+' <table width="100%">'+' <tr>'+' <td width="50" height="25" valign="top" class="readMailHeaderPad1 fbk3" ></td>'+' </tr>'+' </table> </td>'+' </tr>'+' </table><div style="height:160px; background-color:#ffffff" id="dvLetterContentText'+ sModule +'"><div id="ifrReadPart'+ sModule +'">' +'<div style="padding:15px; line-height:200%; color:#333"><br>' +'<h3><b class="btnS top_ico"></b> 小提示:</h3>' +'<p style="padding:5px 0 0 24px ">' +'上方区域为<b class="fgn">邮件列表区</b>,只需单击标题即可在下方<b class="fgn">阅读区</b>浏览邮件内容<br>' +'按住<b class="fgn">Shift</b>或者<b class="fgn">Ctrl</b>键,更可复选多封邮件,同时支持邮件拖动、标准快捷键操作<br>' +'</p>' +'</div>' +'</div></div>';
}return html;};
function fFolder_getToolbar(sModule)
{
var lhtml="", rhtml="";
var arrToolbarOption=[new toolbarOption("reply", "回复", "fGoto('MM.read.setReplyContent','"+ sModule +"','reply', 'folder')", false, true, false, "btnRe", "tlbtn2", true),new toolbarOption("forward","转发", "fGoto('MM.read.setReplyContent','"+ sModule +"','forward', 'folder')", false, false, true, "btnFwd", "tlbtn1", true),new toolbarOption("move", "移动", "", true, false, false, "btnMov", "tlbtn2", true),new toolbarOption("del", "删除", "top.frames['jsFrame'].MM['"+ sModule +"'].folderHandle('del');", false, true, true, "btnDel", "tlbtn2", true),new toolbarOption("check", "查看", "", true, false, false, "btnView", "tlbtn2", true),new toolbarOption("more", " 更多","", true, false, false, "", "tlbtn1", false)];lhtml=CC.getBatchToolbarOption(arrToolbarOption, sModule);rhtml=initPageGo(sModule);return [lhtml, rhtml];};
function fFolder_getToolbarMenu(name)
{
var OMenu=[];
var obj=this;switch(name)
{
case "del":OMenu=[{width: "100"},['删除', function(){obj.folderHandle("del");}],['彻底删除', function(){obj.folderHandle("reldel");}]];break;case "reply":OMenu=[{width: "100"},eval("['回复', function(){MM.read.setReplyContent('"+ this.moduleName +"', 'reply', 'folder');}]"),eval("['回复所有', function(){MM.read.setReplyContent('"+ this.moduleName +"', 'replyall', 'folder');}]")];break;case "move":uncOMenu=[{width: "150"}];var uncfolders=GE.folders;var sys=false;for(var j=0;j<uncfolders.length;j++){if(CC.getFidByModule(this.moduleName)==uncfolders[j][0]) continue;if(uncfolders[j][0]>10&&!sys){uncOMenu[uncOMenu.length]="empty";sys=true;}eval('uncOMenu[uncOMenu.length]=[uncfolders[j][1].left(13), function(){MM["'+ this.moduleName +'"].folderHandle("folder_'+ uncfolders[j][0] +'")}];');}OMenu=uncOMenu;break;case "check":OMenu=[{width: "130"},eval("['全部', function(){MM.folder.goSearch(0, '"+ this.moduleName +"');}]"),"empty",eval("['未读', function(){MM.folder.goSearch(1, '"+ this.moduleName +"');}]"),eval("['已读', function(){MM.folder.goSearch(5, '"+ this.moduleName +"');}]"),"empty",eval("['已回复', function(){MM.folder.goSearch(2, '"+ this.moduleName +"');}]"),"empty",eval("['已转发', function(){MM.folder.goSearch(3, '"+ this.moduleName +"');}]")];break;case "more":OMenu=[{width: "130"},['拒收', function(){obj.refuse();}],"empty",['标记为未读', function(){obj.folderHandle("setnew");}],['标记为已读', function(){obj.folderHandle("setreaded");}],['标记为紧急', function(){obj.folderHandle("mer");}],['标记为普通', function(){obj.folderHandle("normal");}],"empty",(obj.viewType==1)?['查看邮件', function(){MM["read"].view(0, obj.moduleName)}]:['查看完整信头', function(){MM["read"].view(1, obj.moduleName)}],['打印', function(){window.print();}]];break;}return OMenu;};function fFolder_init(){var sModule=this.moduleName;GE.currentFolder=sModule;this.getDataGrid();this.setContentHeight();this.readData=null;try{MM["folder"].bottomInit=true;frame["indexFrame"].vSplitterMove(70 + GE.localConfig["con_bottom_height"]);}catch(exp){}initGotoPageFAL(sModule);};function fFolder_setContentHeight(){try{var sModule=this.moduleName;var MailListDiv=$("MailListDiv" + sModule);var MailListDivH=MailListDiv.firstChild.childNodes[0];var dvLetterContainerView=MailListDiv.firstChild.childNodes[1];var dvVSplitter=$("dvVSplitter" + sModule);var dvLetterContent=$("dvLetterContent" + sModule);var readMailHeaderTab=$("readMailHeaderTab" + sModule);var dvLetterContentText=$("dvLetterContentText" + sModule);var ifrReadPart=$("ifrReadPart" + sModule);this.p1=MailListDiv;this.p1_1=MailListDivH;this.p1_2=dvLetterContainerView;this.p2=dvVSplitter;this.p3=dvLetterContent;this.p3_1=readMailHeaderTab;this.p3_2=dvLetterContentText;this.p3_2_1=ifrReadPart;var arr=["p1", "p1_1", "p1_2", "p2", "p3", "p3_1", "p3_2", "p3_2_1"];this.setPartEvent(sModule, arr);this.resize();}catch(exp){}};function fFolder_resize(){var sModule=this.moduleName;var MailListDiv=$("MailListDiv" + sModule);var bottomHeight=GE.leftHeight - MailListDiv.offsetHeight - 7;if(bottomHeight<0){bottomHeight=0;}if(GE.readType=="0"){this.p2.onmousedown=frame["indexFrame"].vSplit;this.p3.setH(bottomHeight);var letterHeight=this.p3.getH() - this.p3_1.getH() - 6;if(letterHeight<0){letterHeight=0;}this.p3_2.setH(letterHeight);this.p3_2_1.setH(letterHeight);}else{}}function fFolder_getDataGrid(sModule){var sModule=this.moduleName;var MailListDiv=$("MailListDiv" + sModule);var addrTitle=(sModule=="draft"||sModule=="sended")?"收件人":"发件人";var arrTitle=[];arrTitle[0]=["","","按照是否有附件来排序邮件",0,true,"fDGClick",0,"fDGClick"];arrTitle[1]=["","","按照邮件状态来排序邮件",0,false,"fDGClick",0,"fDGClick"];arrTitle[2]=[addrTitle,"","按照"+addrTitle+"来排序邮件",0,true,"fDGClick",0,"fDGClick"];arrTitle[3]=["主题","","按照主题来排序邮件",0,true,"fDGClick",0,"fDGClick"];arrTitle[4]=["日期","","按照日期先后来排序邮件",0,true,"fDGClick",0,"fDGClick"];arrTitle[5]=["大小","","按照邮件大小来排序邮件",0,true,"fDGClick",0,"fDGClick"];var aDL=[];var aLW=[];var iScreen=window.screen.width;if(iScreen==800){aLW=[[1,18,12],[22,19,37],[50,121,160],[175,210,374],[385,95,467],[483,80,550]];aDL=[23,26,118,215,95,100];}else{aLW=[[0,18,12],[22,19,37],[50,161,200],[215,310,514],[525,95,607],[623,80,690]];aDL=[23,26,155,315,95,100];}var aTCLW=[];aTCLW[0]=[aLW[0][0],aLW[0][1],aLW[0][2],"msgTableHeaders","btnS rm_tableIconHeader attachmentIcon","bgF1 rm_msgTableResizerHotspot eResizeCursor"];aTCLW[1]=[aLW[1][0],aLW[1][1],aLW[1][2],"msgTableHeaders","newIcon rm_tableIconHeader btnS","bgF1 rm_msgTableResizerHotspot eResizeCursor"];aTCLW[2]=[aLW[2][0],aLW[2][1],aLW[2][2],"msgTableHeaders","","bgF1 rm_msgTableResizerHotspot eResizeCursor"];aTCLW[3]=[aLW[3][0],aLW[3][1],aLW[3][2],"msgTableHeaders","","bgF1 rm_msgTableResizerHotspot eResizeCursor"];aTCLW[4]=[aLW[4][0],aLW[4][1],aLW[4][2],"msgTableHeaders","","bgF1 rm_msgTableResizerHotspot eResizeCursor"];aTCLW[5]=[aLW[5][0],aLW[5][1],aLW[5][2],"msgTableHeaders","","bgF1 rm_msgTableResizerHotspot eResizeCursor"];var aDCLW=[];aDCLW[0]=[aDL[0], "tableViewCell tableViewCellPaddingVert",true,false];aDCLW[1]=[aDL[1], "tableViewCell",true,false];aDCLW[2]=[aDL[2],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];aDCLW[3]=[aDL[3],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];aDCLW[4]=[aDL[4], "tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];aDCLW[5]=[aDL[5],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];var arrData=[];var oDG=new DataGrid();this.dg=oDG.getDG();oDG.init();oDG.System.main();oDG.System.setParentNode(MailListDiv);oDG.CSS.setTitleCSS(aTCLW);oDG.CSS.setDataCSS(aDCLW);oDG.System.setTitle(arrTitle);oDG.System.setData(arrData);oDG.HTML.setDataOnClick(MM[sModule].fDG_Click);oDG.HTML.setDataOnDblClick(MM[sModule].fDG_DoubleClick);oDG.HTML.setDataOnMouseDown(MM[sModule].fDG_Mousedown);oDG.HTML.setDataOnKeyDown(MM[sModule].fDG_Keydown);oDG.HTML.setDataOnContextmenu(MM[sModule].fDG_ContextMenu);oDG.create();$("MailListDiv" + sModule).firstChild.childNodes[1].module=sModule;};function fFolder_synData(sModule){GE.currentFolder=sModule;};
function fFolder_reset(sModule){if(sModule=="inbox"){if(!MM[sModule].load){GE.laterRequestModule="";MM.getModule("inbox");}else{CC.getNewMailCount();CC.showMsg("数据加载中,请稍候..");}}};function fFolder_fDG_Click(ev){var ev=MM[GE.currentFolder].dg.HTML.getEvent(ev);var o=GE.IsIE?ev.srcElement:ev.target;while(o.tagName!="TABLE"){o=o.parentNode;}var sModule=o.parentNode.parentNode.module;if((new Date()).valueOf() - GE.time.valueOf() < 600){GE.time=new Date();return;}GE.time=new Date();window.setTimeout('MM.folder.readLetter("'+ o.readUrl.htmldecode() +'", "'+ sModule +'", "'+ (ev.ctrlKey||ev.shiftKey) +'");',500);};function fFolder_getModuleByDGEvent(ev){var o=GE.IsIE?ev.srcElement:ev.target;while(o.tagName!="TABLE"){o=o.parentNode;}var sModule=o.parentNode.parentNode.module;return sModule;};function fFolder_fDG_DoubleClick(ev){GE.isLetterDbClick=true;};function fFolder_readByKeyEnter(){GE.isLetterDbClick=true;MM.folder.readLetter(MM[GE.currentFolder].dg.HTML.getSelectTarget().readUrl.htmldecode(), this.moduleName, false);};function fFolder_readByContextMenuByNewWin(){var win=window.open("/dmstyle/html/newread.htm");};function fFolder_readByContextMenuByNewTab(){GE.isLetterDbClick=true;MM.folder.readLetter(this.dg.HTML.getSelectTarget().readUrl.htmldecode(), this.moduleName, false);};function fMailKeyDown(ev){var ev=MM[GE.currentFolder].dg.HTML.getEvent(ev);var keyCode=ev.keyCode;var sModule=MM["folder"].getModuleByDGEvent(ev);var del=46, down=40, up=38;switch(keyCode){case del:MM[sModule].folderHandle("del");break;case down:case up:MM.folder.readLetter(MM[GE.currentFolder].dg.HTML.getSelectTarget().readUrl.htmldecode(), sModule, false);break;}}function fFolder_fDG_ContextMenu(ev){var ev=MM[GE.currentFolder].dg.HTML.getEvent(ev);var sModule=MM["folder"].getModuleByDGEvent(ev);var f=frame["indexFrame"];var o=[{width: "150", top:Event.pointerY(ev),left:Event.pointerX(ev)}];o[o.length]=["打开", function(){MM[sModule].readByContextMenuByNewTab();}];o[o.length]=["在新窗口打开", function(){MM[sModule].readByContextMenuByNewWin();}];o[o.length]=["打印", function(){window.print();}];o[o.length]="empty";o[o.length]=["回复作者", function(){MM.read.setReplyContent(sModule, "reply", "folder");}];o[o.length]=["回复所有", function(){MM.read.setReplyContent(sModule, "replyall", "folder");}];o[o.length]=["转发", function(){MM.read.setReplyContent(sModule, "forward", "folder");}];o[o.length]="empty";o[o.length]=["标志为已读", function(){MM[sModule].folderHandle("setreaded");}];o[o.length]=["标志为未读", function(){MM[sModule].folderHandle("setnew");}];o[o.length]="empty";o[o.length]=["删除", function(){MM[sModule].folderHandle("del");}];if(sModule!="defined5"){o[o.length]=["这是垃圾邮件", function(){MM[sModule].refuse();}];}CMenu.create(o);MM.folder.readLetter(MM[GE.currentFolder].dg.HTML.getSelectTarget().readUrl.htmldecode(), sModule, false);};function initGotoPageFAL(sModule){try{var d=CM[sModule];var currPage,pagecount;currPage=calculatePageID(sModule);pagecount=calculatePageCount(sModule);if ( currPage==1) {}else{d.hasPre=true;d.preClick="fGoto(
\\'MM.folder.goPrevPage\\',\\'"+ d.nStartOfThisPage +"
\\',\\'"+ d.nMailCountPerPage +"
\\',
\\'"+ sModule +"
\\',\\'"+ d.fromsearch +"
\\');";}var toCount=d.nStartOfThisPage + d.nMailCountPerPage;if(toCount>d.nTotalMailCount){toCount=d.nTotalMailCount;}if ( currPage >=pagecount ) {}else{d.hasNext=true;d.nextClick="fGoto(
\\'MM.folder.goNextPage\\',\\'"+ d.nStartOfThisPage +"
\\',\\'"+ d.nMailCountPerPage +"
\\',\\'"+ d.nTotalMailCount +"
\\',
\\'"+ sModule +"
\\',\\'"+ d.fromsearch +"
\\');";}}catch(exp){fDebug('initGotoPageFAL',exp.description);}}function initPageGo(sModule){var i , html;var n , sum;var arr=[];n=calculatePageID(sModule);sum=calculatePageCount(sModule);html='<select class="tlSel fbk3" id="selPages'+ sModule +'" onchange="fGoto(\'MM.folder.goPageN\', this.value,\''+ CM[sModule].nMailCountPerPage +'\',\''+ sModule +'\', \''+ CM[sModule].fromsearch +'\')" >';for(i=1; i<=sum; i++){arr[arr.length]='<option value="'+ i +'"'+ (i==n ? " selected":"") +'>'+ i+" / "+ sum +'</option>';}html+=arr.join("") + "</select>";return html;}function calculatePageID(sModule){var d=CM[sModule];if (d.nMailCountPerPage <=0 ) return;var nPageID=Math.ceil( (d.nStartOfThisPage+1) / d.nMailCountPerPage );return nPageID;}function calculatePageCount(sModule){var d=CM[sModule];if (d.nMailCountPerPage <=0 ) return;if( d.nTotalMailCount <=0 ) return 1;var nTotalPage=Math.ceil(d.nTotalMailCount / d.nMailCountPerPage);return nTotalPage;}function goPageByStart( theStart,sModule, fromsearch){var flag=gInboxFlag[sModule];var theForm=$("goPage"+flag);theForm.start.value=theStart;theForm.funcid.value='mails';if ( '1'==fromsearch ){var tHidden=El.getObjById(MM[sModule].div,"fromsearch");if(tHidden.length>0){tHidden[0].name="fromsearch";tHidden[0].value="1";}}theForm.submit();}function fFolder_goPageN( n,nMailCountPerPage,sModule, fromsearch ){var n=n-0;var nMailCountPerPage=nMailCountPerPage-0;var theStart=(n-1) * nMailCountPerPage;if(sModule=="unRead"){}goPageByStart( theStart,sModule, fromsearch );
}
function fInsertMail(o,sModule)
{
if(MM["folder"].removing)
{
return;
}
if(o.priority=="1")
{
o.subject='<b class="ImportantIcon tableIcon btnS"> </b>' + o.subject;
}
var aData=[((o.iconGroupAttach>0)?true:false),parseInt(o.icon,10),OutGroupFrom(GE.UID, o.trueName, o.fromEmail, o.from),o.subject,fConverDate(o.date),o.size,fFormatDate(o.date),o.readURL,(o.icon==5?true:false),o.chkValue,o.chkName];if(gGettingNewMail){var data=MM[sModule].dg.System.getData();for(var i=0;i<data.length;i++){if(CC.getMidByUrl(data[i][7])==CC.getMidByUrl(o.readURL)){return;}}MM[sModule].dg.setDG(MM[sModule].dg);MM[sModule].dg.System.setDataOBO(aData, true);var dvNewMailMovie=$("dvNewMailMovie");if(!dvNewMailMovie||(dvNewMailMovie&&dvNewMailMovie.style.display=="none")){fPlayGetNewMail();}}else{MM[sModule].dg.setDG(MM[sModule].dg);MM[sModule].dg.System.setDataOBO(aData, false);}}function fFormatDate(date){try{var d=fGetDate(date,".");var sDate=(d.getMonth()+1) + "月" + d.getDate() + "日" + " ("+ gArrWeek[d.getDay()] +")";return sDate;}catch(exp){return date;}}function fMoveLettersByDrop(to)
{
try
{
var sModule=GE.laterRequestModule;
if(sModule==to)
{
return;
}
if(!window.confirm(gLang["folder"][34]+ MM[to].name +"?"))
{return;}
this.createChks();
this.move(CC.getFidByModule(to));
window.setTimeout('CM.setCMReffer("folderMain")',2000);
}
catch(exp){
fDebug("fMoveLettersByDrop",exp.description);
}
}
function fGetDragItem()
{
var arrTbs=MM[GE.currentFolder].dg.HTML.getSelectTargetArray();
var obj=$("dvDragItem");
if(obj){obj.parentNode.removeChild(obj);}
obj=El.createElement("DIV");
obj.id="dvDragItem";El.setStyle(obj, {"position":"absolute", "zIndex":"99", "display":"none"});
var content="";
if(arrTbs.length==1
{
var tb=arrTbs[0];
var row=tb.rows[0];
content=row.cells[3].innerHTML;
}else if(arrTbs.length >1){
content=arrTbs.length + "条邮件";
}
obj.innerHTML='<div id="Layer1" class="border2 bgcolor2 dragDiv" >' +' <div class="dragIconBot bgcolor6" >' +' <div class="icoBtn4 btnS btnNoMov" id="moveIcon"></div>' +' </div>' +' <div class="dragCont">' +'<table class="dragContTB">' +' <tr>' +' <td ><nobr>'+ content +'</nobr></td>' +' </tr>' +'</table>' +'</div></div>';obj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=70)";frame["indexFrame"].document.body.appendChild(obj);$("moveIcon").isNoDrop=true;}function fMailMouseDown(ev){var arrTbs=MM[GE.currentFolder].dg.HTML.getSelectTargetArray();if(!arrTbs||arrTbs.length==0){return;}var ev=MM[GE.currentFolder].dg.HTML.getEvent(ev);gSourceDiv=this;var target=GE.IsIE?ev.srcElement:ev.target;if(target.tagName=="INPUT"){return;}gSourceDiv.mouseDownY=ev.clientY;gSourceDiv.mouseDownX=ev.clientX;gBeginMoving=true;fGetDragItem();var dvDragItem=$("dvDragItem");dvDragItem.style.top=ev.clientY-10;dvDragItem.style.left=ev.clientX-10;frame["indexFrame"].document.body.onselectstart=function(){return false;};frame["indexFrame"].fGetContentLayer(MM[GE.currentFolder].p3_2);}
function OutGroupFrom( uidatdomain,truename,fromemail,From ){if( uidatdomain==fromemail){sMailFrom="<font color=green>"+ gLang["folder"][37] +"</font>";}else{stemp=fReplaceQuot(truename);if( stemp!=""){sMailFrom=stemp;}else if ( fromemail!=""){sMailFrom=fromemail;}else{sMailFrom=fReplaceQuot(From);}}return sMailFrom;}function fReadLetter(sUrl, sModule, ctrlshiftKey){
if(gLetterMoved){gLetterMoved=false;return;}
if(ctrlshiftKey=="true"){return;}
if(sModule=="draft"){if(!GE.isLetterDbClick){return;}GE.composeType="draft";MM.getModule("compose");var newCompose="compose" + MM["compose"].index;MM[newCompose].cmURL=sUrl;CM.setCMReffer(newCompose);CC.showMsg(gLang["common"]["wait"] + "..");GE.isLetterDbClick=false;return;}if(!GE.isLetterDbClick&&MM[sModule].readData&&CC.getMidByUrl(sUrl)==MM[sModule].readData.mid){return;}var mid=CC.getMidByUrl(sUrl);for(var o in MM){if(!frame["indexFrame"].TLabel.exist(o)||!CM["letter"][o]) continue;if(mid==CM["letter"][o].mid){fGetCacheLetter(o);return;}}for(var o in CM["letter"]){if(mid==CM["letter"][o].mid){fGetCacheLetter(o);return;}}MM["read"].cmURL=sUrl;MM.getModule("read");if(!GE.isLetterDbClick){GE.laterRequestModule=sModule;}function fGetCacheLetter(o){if(!GE.isLetterDbClick){CM["read"]=CM["letter"][o].data;MM["read"].moduleName=o;MM.createModule("read");MM["read"].moduleName="read";}
else{if(MM[o]){MM.getModule(o);GE.isLetterDbClick=false;}else{GE.laterRequestModule=o;MM.createModule(o);}}}}
function fShowHeardersEnd(sModule){if(sModule=="inbox"){if(CM["inbox"].hasPre){gAutoRecieve=false;}else{gAutoRecieve=true;}}
gGettingNewMail=false;CC.hideWaiting();MM["folder"].removing=false;}
function fFolder_Delete(flag)
{
var sModule=this.moduleName;
var frm=$("frmHeaderList" + sModule);
if(flag=="del"&&sModule!="deleted"){MM["deleted"].load=false;}else if(flag=="reldel"||(flag=="del"&&sModule=="deleted"))
{
if (!confirm(gLang["folder"][38])){return;}}var btn="";if(flag=="del")
{btn="btnDelete.x";}else if(flag=="reldel"){btn="btnRealDelete.x";}
frm.action=$("spnFolderFormUrl" + sModule).innerHTML + "&"+ btn +"=true&optypes=" + flag;this.removeLetters("fromfolder");this.getNewSubmitFrame(frm);window.setTimeout('CM.setCMReffer("folderMain");',2000);if(sModule=="unRead"){CC.cleanFoldersCach();}}function fFolder_refuse(){var sModule=this.moduleName;var arr=[];var arrTbs=MM[sModule].dg.HTML.getSelectTargetArray();if(!arrTbs||arrTbs.length==0){CC.showSysMsg("请选择邮件!");return;}for(var i=0;i<arrTbs.length;i++){arr[arr.length]=arrTbs[i].chkName.split("_")[1];}if(arr.length==0){return CC.showSysMsg(gLang["folder"][39]);}var sUrl=GE.cmDomain + "/coremail/fcg/ldapapp?funcid=opuserattr&optype=print&tempname=options%2Frefuselist.htm&request_srcSafeList="+ arr.join(",") +"&sid=" + gSID;MM["refuselist"].load=false;var filterUrl=MM["refuselist"].cmURL;MM["refuselist"].cmURL=sUrl;MM.getModule("refuselist");MM["refuselist"].cmURL=filterUrl;MM["refuselist"].load=false;this.folderHandle("folder_5");GE.laterRequestModule="refuselist";}function fFolder_mark(handle){var sModule=this.moduleName;var frm=$("frmHeaderList" + sModule);var mark="";var flag=-1;if(handle=="setnew"){mark="&markflag=1&btnMark.x=true";flag=5;}else if(handle=="setreaded"){mark="&markflag=2&btnMark.x=true";flag=6;}else if(handle=="slow"){mark="&markflag=3&btnMark.x=true";flag=5;}else if(handle=="normal")
{mark="&markflag=4&btnMark.x=true";flag=8;}
else if(handle=="mer")
{mark="&markflag=5&btnMark.x=true";flag=7;}
frm.action=$("spnFolderFormUrl" + sModule).innerHTML + mark + "&optypes=mark";
frm.submit();
MM["folder"].changeMailStatus(flag);}function fFolder_move(handle){var sModule=this.moduleName;
var frm=$("frmHeaderList" + sModule);if(sModule=="unRead"){MM["inbox"].load=false;}frm.ToFolder.value=handle;var sName="";
if(handle==1){sName=gLang["folder"][40];}var desModule=CC.getModuleByFid(handle, sName);MM[desModule].load=false;
frm.action=$("spnFolderFormUrl" + sModule).innerHTML + "&optypes=move&btnMove.x=1";this.removeLetters("fromfolder");
frm.submit();window.setTimeout('CM.setCMReffer("folderMain");',2000);if(sModule=="unRead"){CC.cleanFoldersCach();}}
function fFolderHandle(handle){var sModule=this.moduleName;CC.hideSysMsg();if(handle==""){return;}
if(!fCheckIfSelect(sModule)){CC.showSysMsg(gLang["folder"][41]);return;}this.createChks();
if(handle.indexOf("folder_")>-1){handle=handle.split("_")[1];}switch(handle){case "reldel":case "del":this.del(handle);break;case "mer":case "normal":case "slow":case "setreaded":case "setnew":this.mark(handle);break;default:this.move(handle);}}function fCheckIfSelect(sModule){try{return MM[sModule].dg.HTML.getSelectTargetArray().length;}catch(exp){return 0;}}function fSetPartEvent(sModule, arr){try{for(var i=0;i<arr.length;i++){this[arr[i]].part=arr[i];this[arr[i]].module=sModule;this[arr[i]].getH=function(){return this.offsetHeight;};this[arr[i]].setH=function(h){this.style.height=parseInt(h+"",10) + "px";};this[arr[i]].reflesh=function(){var getH=this.getH;var setH=this.setH;var reflesh=this.reflesh;var part=this.part;var sModule=this.module;MM[sModule][this.part]=$(this.id);MM[sModule][this.part].getH=getH;MM[sModule][this.part].setH=setH;MM[sModule][this.part].reflesh=reflesh;MM[sModule][this.part].part=part;MM[sModule][this.part].module=sModule;};}}catch(exp){}}function fCreateChks(){var sModule=this.moduleName;var arrTbs=MM[sModule].dg.HTML.getSelectTargetArray();var MailListDiv=$("MailListDiv" + sModule);var chks=$("chks" + sModule);if(chks){chks.parentNode.removeChild(chks);}chks=El.createElement("span");chks.id="chks" + sModule;chks.style.display="none";var arr=[];for(var i=0;i<arrTbs.length;i++){arr[arr.length]='<input type="checkbox" name="'+ arrTbs[i].chkName +'" value="'+ arrTbs[i].chkValue +'" checked>';}chks.innerHTML=arr.join("");MailListDiv.appendChild(chks);}function fFolder_goSearch( stateflag, sModule ){try{if (stateflag==-1) {CC.showSysMsg('请选择子类!');return;}var theForm=$("frmSearch" + CC.getFidByModule(sModule));theForm.funcid.value='srchhand2';GE.laterRequestModule="unRead";if(theForm.target=="unRead"){theForm.target="submitFrame";}theForm.priority.value=-1;if(theForm.action.indexOf("http")<0){theForm.action=GE.cmDomain + theForm.action;}theForm.action=theForm.action.replace(/\?.*/gi,"")+"?stateflag="+stateflag;theForm.submit();}catch(exp){fDebug("fFolder_goSearch",exp.description);}}
function fFolder_removeLetters(type, chkvalues){var sModule=this.moduleName;var dg=MM[sModule].dg;
var letters=dg.System.getData();var newArr=[];var nextSel1="", nextSel2="", nextChkValue="";if(type=="fromfolder"){MM["folder"].removing=true;var selLetters=dg.HTML.getSelectTargetArray();if(!selLetters&&selLetters.length==0){return false;}var chkvalues=[];for(var i=0;i<selLetters.length;i++){chkvalues[chkvalues.length]=selLetters[i].chkValue;}chkvalues=chkvalues.join("|");}for(var i=0;i<letters.length;i++){if(chkvalues.indexOf(letters[i][9].replace(/%0A.+/,""))==-1){newArr[newArr.length]=letters[i];}else{if(nextSel1==""&&i>0){nextSel1=letters[i-1][9];}if(nextSel2==""||nextSel2==letters[i][9]){if(i+1==letters.length){nextSel2="";}else{nextSel2=letters[i+1][9];}}}}nextChkValue=(nextSel2!="")?nextSel2:nextSel1;if(newArr.length < 6){MM["folder"].removing=false;return false;}else{dg.System.setData(newArr);dg.refresh();}for(var i=0;i<newArr.length;i++){if(newArr[i][9]==nextChkValue){dg.HTML.setLastSelectFocus(i);MM.folder.readLetter(this.dg.HTML.getSelectTarget().readUrl.htmldecode(), sModule, false);return true;}}return true;};function fFolder_getNewSubmitFrame(frm){var target=frm.target;if(!this.index){this.index=1;}else{this.index ++;}var frmName=this.moduleName + "_submit_" + this.index;fGetCMFrame(frmName);frm.target=frmName;frm.submit();frm.target=target;};function fFolder_changeMailStatus(status){gGettingNewMail=true;var dg=MM[GE.currentFolder].dg;var arr=dg.HTML.getSelectTargetArray();var y=-1;if(status==5||status==6){y=1;}else if(status==7||status==8){y=3;}var value;var newCount=0;for(var i=0;i<arr.length;i++){if(status==7){value=arr[i].rows[0].cells[3].firstChild.innerHTML;if(value.indexOf("ImportantIcon")==-1){value='<b class="ImportantIcon tableIcon btnS"> </b>' + value;}}else if(status==8){value=arr[i].rows[0].cells[3].firstChild.innerHTML;value=value.replace(/<.+>/,"");}else if(status==5){value=status;if(arr[i].status!=5){newCount ++;arr[i].status=5;}}else if(status==6){value=status;if(arr[i].status!=5){continue;}else{arr[i].status=6;newCount --;}}dg.HTML.changeMailStatus(dg.System.getData().length - arr[i].index -1, y, value);}if(status==5||status==6){CC.refleshFolders(CC.getFidByModule(GE.currentFolder), newCount, "set");}};function fFolder_changeMailStatusByMid(mid, flag){var dg=MM[GE.currentFolder].dg;var alls=dg.System.getData();mid=mid.replace(/%0A.+/,"");for(var i=0;i<alls.length;i++){var mid1=CC.getMidByUrl(alls[i][7]);if(mid1==mid){var status=-1;switch(flag){case "readed":if(alls[i][1]==5){status=6;CC.refleshFolders(CC.getFidByModule(GE.currentFolder), -1, "set");}break;case "new":status=5;if(alls[i][1]==6){CC.refleshFolders(CC.getFidByModule(GE.currentFolder), 1, "set");}break;case "reply":if(alls[i][1]!=4){status=3;}else{status=2;}break;case "forward":if(alls[i][1]!=3){status=4;}else{status=2;}break;}if(status==-1){return;}dg.HTML.changeMailStatus(i,1, status);return;}}};function Read(){this.setPartEvent=fSetPartEvent;this.addAddress=fRead_addAddress;this.getData=fRead_getData;this.view=fRead_view;this.refuse=fRead_refuse;this.invite=fRead_invite;this.openNewWin=fRead_openNewWin;this.getHtml=fRead_getHtml;this.getToolbar=fRead_getToolbar;this.getToolbarMenu=fRead_getToolbarMenu;this.init=fRead_init;this.resize=fRead_resize;this.operate=fRead_operate;this.readOperateAgen=fRead_readOperateAgen;this.replyHead=fRead_replyHead;this.part=fRead_part;this.isDeleted=fRead_isDeleted;this.getModuleByOutlink=fRead_getModuleByOutlink;this.backFromNetFolder=fRead_backFromNetFolder;this.setReplyContent=fRead_setReplyContent;this.attachOption=fRead_attachOption;}function Read_init(){var ORead=new Read();MM["read"].read_netfolder_mapping=new Object();MM["read"].midReplyMapping=new Object();MM["read"].midForwardMapping=new Object();MM["read"].index=0;MM["read"].deletedLetter=[];MM["read"].moduleName="read";MM["read"].operateRead="";MM["read"].setPartEvent=ORead.setPartEvent;MM["read"].addAddress=ORead.addAddress;MM["read"].getData=ORead.getData;MM["read"].view=ORead.view;MM["read"].refuse=ORead.refuse;MM["read"].invite=ORead.invite;MM["read"].openNewWin=ORead.openNewWin;MM["read"].getHtml=ORead.getHtml;MM["read"].getPanelHtml=ORead.getHtml;MM["read"].getToolbar=ORead.getToolbar;MM["read"].getToolbarMenu=ORead.getToolbarMenu;MM["read"].init=ORead.init;MM["read"].resize=ORead.resize;MM["read"].operate=ORead.operate;MM["read"].readOperateAgen=ORead.readOperateAgen;MM["read"].replyHead=ORead.replyHead;MM["read"].part=ORead.part;MM["read"].isDeleted=ORead.isDeleted;MM["read"].getModuleByOutlink=ORead.getModuleByOutlink;MM["read"].backFromNetFolder=ORead.backFromNetFolder;MM["read"].setReplyContent=ORead.setReplyContent;MM["read"].attachOption=ORead.attachOption;}Read_init();function fRead_addAddress(sModule){var data=this.getData(sModule);fGotoModule("iaddress",data.urls["addaddr"],0);};function fRead_getData(sModule){var data=null;if(sModule.indexOf("letter")>-1){data=CM["letter"][sModule].data;}else{if(!MM[sModule].readData){CC.showSysMsg("请选择邮件!");return false;}data=MM[sModule].readData.data;}return data;};function fRead_view(type, sModule){var data=this.getData(sModule);if(!data){return;}var ifrm=MM[sModule].div.getElementsByTagName("IFRAME")[0];if(type==0){ifrm.src=data.urls["part"];MM[sModule].viewType=0;}else{ifrm.src=data.urls["headpart"];MM[sModule].viewType=1;}};function fRead_refuse(sModule){var data=this.getData(sModule);var sName="refuselist";var sAddr=data.from;sAddr=sAddr.htmldecode();sAddr=sAddr.replace(/.*</g,"").replace(/>.*/g,"");MM[sName].email=sAddr;MM[sName].load=false;MM.getModule(sName);};function fRead_invite(sModule){var data=this.getData(sModule);var to=data.from;if(to.indexOf("\"")>-1){to=to.match(/<.+>/gi)+"";to=to.replace(/[<>]/gi,"");}var sUrl="";if(GE.domain=="188.com"){sUrl=GE.cmDomain+'/cgi/invite.fcgi?sid='+ GE.SID +'&sender=sezi&from=' + GE.UID;}else{sUrl='http://invite.mail.'+ GE.domain +'/servlet/inv?disk=1&sid='+ GE.SID +'&origin='+ window.top.zDomain +'&username='+ GE.User;}if(to&&to!="null"){sUrl+="&to=" + escape(to);}CC.getOutLink_new(sUrl, "invite", "邀请朋友", 0);GE.outLink["invite"]=null;};function fRead_openNewWin(url, folder, sModule){GE.isLetterDbClick=true;MM.folder.readLetter(url.htmldecode(), folder, false);};function fRead_getHtml(){var sModule=this.moduleName;var d=CM[sModule];if(!d){d=CM["letter"][sModule].data;}if(!sModule||sModule=="read"){var sModule="letter" + MM["read"].index;MM["read"].index ++;}var f=GE.currentFolder;if(GE.isLetterDbClick){f=sModule;}CM["letter"][sModule]={};var arr=d.readUrl.split("&");arr.length=arr.length - 1;CM["letter"][sModule].cmURL=arr.join("&");CM["letter"][sModule].mid=d.mid.replace(/%0A.+/,"");CM["letter"][sModule].postmid=d.mid;CM["letter"][sModule].data=d;CM["letter"][sModule].module=sModule;var html='';html+='<div class="bgF2 readMailHeaderBG" ></div><span id="spnReadArea">'+' <table border="0" cellpadding="0" cellspacing="0" class="readMailHeaderTable bgcolor2 fbk3" id="readMailHeaderTab'+ f +'" name="readMailHeaderTab">'+' <tr>'+' <td class="readMailHeaderCont fbold">'+ d.subject +'<b class="btnS icoNewWin"> </b><a href="javascript:fGoto()" class="fnoml fgn3" onclick="fGoto(\'MM.'+ f +'.readByContextMenuByNewWin\');return false;">新窗口打开</a></td>'+' <td width="210" align="right" class="readMailHeaderCont" ><div id="icoDown" class="btnS icoDown" style="display:block" onclick="fToggleReadMore(\'moreCont'+ f +'\',\''+ f +'\', this)"></div><div id="icoUp" class="btnS icoUp" style="display:none"></div></td>'+' </tr>'+' <tr>'+' <td class="readMailHeaderCont fbold fbk">'+ fSetFromFormat(d.from) +'<b class="btnS icoAdd"> </b><a href="javascript:fGoto()" class="fnoml fgn3" onclick=\'fGoto("MM.read.addAddress", "'+ f +'")\'>'+gLang.read[13]+'</a><b class="btnS icoRef"> </b><a href="javascript:fGoto()" class="fnoml fgn3" onclick=\'fGoto("MM.read.refuse","'+ f +'")\'>'+gLang.read[12]+'</a>'+ fGetInviteHtml(d,f) +'</td>'+' <td align="right" valign="top" class="fgy readMailHeaderCont" >'+ fReadMakeDate(d.date) +'</td>'+' </tr>'+'<tr >'+' <td colspan="2" class=" fbk3 border1" >'+' <div style="display:none;" class="bgcolor5 readMailHeaderCont" id="moreCont'+ f +'">'+' <table width="100%" >'+' <tr>'+' <td width="50" height="20" class="fbk3">收件人:</td>'+' <td>'+ fSetGroupMail(d.to) +'</td>'+' </tr>'+' <tr>'+' <td height="20" class="readMailHeaderPad1 fbk3" valign="top" >抄 送:</td>'+' <td class="readMailHeaderPad2">'+ fSetGroupMail(d.cc) +'</td>'+' </tr>'+' </table>'+' </div> </td>'+' </tr>'+' <tr>'+' <td colspan="2" style="border-bottom-style:solid; border-bottom-width:1px; "class="readMailHeaderCont fbk3 border1" > ';if(d.attach.length>0){html+='<form name="frmAttaToNetFdr'+ f +'" id="frmAttaToNetFdr'+ f +'" action="'+ GE.netfdr_host +'/netfolder/servlet/nfapp/PostMailPart" method="get">' +' <span style="display:none"><input type="hidden" name="sid" value="'+ GE.SID +'" >' +' <input type="hidden" name="srcmid" value="'+ d.msgid +'" >' +' <input type="hidden" name="srcmsid" value="'+ d.msid +'" >' +' <input type="hidden" name="part" id="txtPart'+ f +'" value="" >' +' <input type="hidden" name="backurl" value="'+ d.readletturl +'" ></span>';html+=' <table width="100%">'+' <tr>'+' <td width="50" height="25" valign="top" class="readMailHeaderPad1 fbk3" ><b>附 件:</b></td>'+' <td valign="top" class="readMailHeaderPad2">';var arr=new Array();for(var i=0,t;i<d.attach.length;i++){arr[arr.length]='<a href="'+ d.attach[i].down +'" class="fgn" onclick="fSaveObj(this,event);fGoto(\'MM.read.attachOption\','+ d.attach[i].netfolderPara +',\''+ f +'\',this.href);return false;" onmouseout=""><b class="attachmentIcon tableIcon btnS" > </b>'+ d.attach[i].name +'</a>';}html+=arr.join("");html+='</td></tr></table></form> ';}html+='</td>'+' </tr>'+' </table></span><div style="height:160px; background-color:#e1e1e1" id="dvLetterContentText'+ f +'">';if(!CM["letter"][sModule].data.ifrm){html+='<iframe id="ifrReadPart'+ f +'" name="ifrReadPart'+ f +'" scrolling="auto" src="'+ d.urls.part +'" style="width:100%;height:100%" frameborder="0"></iframe>';}html+='</div>'+'<div style="display:none"><form method="post" target="submitFrame" id="frmReadMove'+ f +'" action="'+d.urls.move+'">' +d.hide +' <input type="hidden" name="btnMove.x" value="1">' +' <input type="hidden" name="tofolder">' +'</form></div>';html+='<span style="display:none"><span id="urlReply'+ f +'">'+ d.urls["reply"] +'</span><span id="urlReplayAll'+ f +'">'+ d.urls["replyall"] +'</span><span id="urlForward'+ f +'">'+ d.urls["forward"] +'</span></span>';CM["letter"][sModule].html="";MM["read"].currentData=CM["letter"][sModule];if(GE.isLetterDbClick){html='<div class="border1" style="height:238px; height:239px; border-width:1px; border-style:solid;overflow:hidden" id="dvBorder'+ f +'">' + html + '</div>';html=html.replace("新窗口打开", "").replace("btnS icoNewWin","");}else{MM[f].readData=CM["letter"][sModule];MM[f].viewType=0;}return html;};function fRead_getToolbar(sModule){var lhtml="", rhtml="";var arrToolbarOption=[new toolbarOption("reply", "回复", "fGoto('MM.read.setReplyContent','"+ sModule +"','reply' , 'read')", false, true, false, "btnRe", "tlbtn2", true),new toolbarOption("forward","转发", "fGoto('MM.read.setReplyContent','"+ sModule +"','forward' , 'read')", false, false, true, "btnFwd", "tlbtn1", true),new toolbarOption("move", "移动", "", true, false, false, "btnMov", "tlbtn2", true),new toolbarOption("del", "删除", 'fGoto(\'MM.read.readOperateAgen\',\''+ sModule +'\',\'del\')', false, true, true, "btnDel", "tlbtn2", true),(CM["letter"][sModule].data.urls["pre"]=="")?"":new toolbarOption("pre", "前一封", 'fGoto(\'MM.read.readOperateAgen\',\''+ sModule +'\',\'pre\')', false, false, false, "btnPre", "tlbtn2", true),(CM["letter"][sModule].data.urls["next"]=="")?"":new toolbarOption("next", "后一封", 'fGoto(\'MM.read.readOperateAgen\',\''+ sModule +'\',\'next\')', false, false, false, "btnNet", "tlbtn2", true),new toolbarOption("more", " 更多","", true, false, false, "", "tlbtn1", false)];lhtml=CC.getBatchToolbarOption(arrToolbarOption, sModule);rhtml="";return [lhtml, rhtml];};function fRead_getToolbarMenu(name){var sModule=this.moduleName;var obj=this;var OMenu=[];switch(name){case "del":OMenu=[{width: "120"},['删除', function(){obj.operate("del")}],['彻底删除', function(){obj.operate("reldel")}]];break;case "reply":OMenu=[{width: "120"},['回复', function(){MM.read.setReplyContent(sModule, "reply", "read")}],['回复所有', function(){MM.read.setReplyContent(sModule, "replyall", "read")}]];break;case "move":uncOMenu=[{width: "150"}];var folders=GE.folders;for(var j=0;j<folders.length;j++){if(CM["letter"][sModule].data.fid==folders[j][0]) continue;eval('uncOMenu[uncOMenu.length]=[folders[j][1].left(13), function(){MM[sModule].operate("move", "'+ folders[j][0] +'")}];')}OMenu=uncOMenu;break;case "more":OMenu=[{width: "130"},['拒收', function(){obj.refuse(obj.moduleName);}],"empty",(obj.viewType==1)?['查看邮件', function(){obj.view(0, obj.moduleName)}]:['查看完整信头', function(){obj.view(1, obj.moduleName)}],['打印', function(){window.print();}]];break;}return OMenu;};function fRead_init(){var sModule=this.moduleName;GE.isLetterDbClick=false;var readMailHeaderTab=$("readMailHeaderTab" + sModule);var dvLetterContentText=$("dvLetterContentText" + sModule);var ifrReadPart=$("ifrReadPart" + sModule);this.p3=this.div;this.p3_1=readMailHeaderTab;this.p3_2=dvLetterContentText;this.p3_2_1=ifrReadPart;var ifrm=this.p3.getElementsByTagName("IFRAME");if(ifrm.length >0){if(MM["read"].currentData){MM["read"].currentData.data.ifrm=ifrm[0];var newIfrm=ifrm[0].cloneNode(true);if(GE.IsIE&&gVersion<5.5){this.p3_2.innerHTML=newIfrm.outerHTML;}else{this.p3_2.removeChild(ifrm[0]);this.p3_2.appendChild(newIfrm);}}}else{if(MM["read"].currentData&&MM["read"].currentData.data.ifrm){if(GE.IsIE&&gVersion<5.5){this.p3_2.innerHTML=MM["read"].currentData.data.ifrm.outerHTML;}else{var newIfrm=MM["read"].currentData.data.ifrm.cloneNode(true);this.p3_2.appendChild(newIfrm);}this.p3_2_1=this.p3_2.firstChild;}}var arr=["p3","p3_1", "p3_2", "p3_2_1"];this.setPartEvent(sModule, arr);with(MM[sModule]){var h=GE.bodyHeight - p3_1.getH() - 110;p3_2.setH(h);p3_2_1.setH(h);$("dvBorder" + sModule).style.height=p3_2.getH() + p3_1.getH() + 8 + "px";}if(!MM["read"].operateRead){MM.folder.readLetter(CM["letter"][sModule].cmURL.htmldecode(), GE.currentFolder, "false");}GE.laterRequestModule=sModule;this.dat=CM["letter"][sModule].data;this.viewType=0;};function fRead_resize(){var sModule=this.moduleName;with(MM[sModule]){var h=GE.bodyHeight - p3_1.getH() - 110;p3_2_1.setH(h);p3_2.setH(h);$("dvBorder" + sModule).style.height=p3_2.getH() + p3_1.getH() + 8 + "px";}}function fRead_operate(sType){var sModule=this.moduleName;var mod=this;GE.isLetterDbClick=true;if(this.isDeleted(sModule)){return;}GE.readOperating=true;MM["read"].operateRead=sModule;switch(sType){case "move":var fid=arguments[1];if(!fid){return;}var form=$("frmReadMove" + sModule);form.tofolder.value=fid;form.submit();CM["letter"][sModule].data.fid=fid;if(fid==1){var f="inbox";}else{var f=CC.getModuleByFid(fid,"");}MM[f].load=false;if(GE.afterdel==0){MM.getModule(GE.currentFolder);MM["folder"].removing=true;GE.readOperating=false;GE.isLetterDbClick=false;}MM[GE.currentFolder].removeLetters("fromletter", CM["letter"][sModule].mid);break;case "del":fReadOuterLink(mod.dat.urls["del"]);if(GE.afterdel==0){MM.getModule(GE.currentFolder);MM["folder"].removing=true;GE.readOperating=false;GE.isLetterDbClick=false;}MM["deleted"].load=false;MM["read"].deletedLetter[MM["read"].deletedLetter.length]=CM["letter"][sModule].mid;MM[GE.currentFolder].removeLetters("fromletter", CM["letter"][sModule].mid);break;case "reldel":if(window.confirm("确定彻底删除这封邮件?")){fReadOuterLink(mod.dat.urls["del"].replace( "btnDelete.x","btnRealDelete.x"));if(GE.afterdel==0){MM.getModule(GE.currentFolder);}MM["read"].deletedLetter[MM["read"].deletedLetter.length]=CM["letter"][sModule].mid;}break;case "pre":fReadOuterLink(mod.dat.urls["pre"]);break;case "next":fReadOuterLink(mod.dat.urls["next"]);break;}if(sType=="move"||sType=="del"){CM.setCMReffer("folderMain");}};function fRead_readOperateAgen(sModule,flag){eval('MM["'+ sModule +'"].operate("'+ flag +'");');};function fRead_replyHead(d){if(GE.addo==1){return "";}var b={"text":"\n","html":"<br>"};var br=b["html"];var s=br;s+=gLang.read[25] + br;s+=gLang.read[26] + d.from + br;s+=gLang.read[27] + d.date + br;s+=gLang.read[28] + d.to + br;s+=gLang.read[29] + d.cc + br;s+=gLang.read[30] + d.subject.unescapeHTML() + br;s+=br + br;return s;};function fRead_part(win, winName){var mod=null;var sModule=winName.replace("ifrReadPart","");if(winName.indexOf("letter")>-1){mod=CM["letter"][sModule];}else{mod=MM[sModule].readData;}var doc=win.document.body;var text="";var html=doc.innerHTML;if(document.all){text=doc.innerText;}else{text=html.replace(/<br>/ig,"\n");text=text.unescapeHTML();}mod.text=text;mod.html=html;};function fRead_isDeleted(sModule){var b=0;var deletedMails=MM["read"].deletedLetter.join("|");if(sModule.indexOf("letter")>-1){b=deletedMails.indexOf(CM["letter"][sModule].mid);}else{b=deletedMails.indexOf(MM[sModule].readData.mid);}if(b > -1){CC.showSysMsg("该邮件已经被删除,不能再对该邮件进行操作。");if(sModule.indexOf("letter")>-1){TLabel.close(sModule);}GE.readOperating=false;GE.isLetterDbClick=false;return true;}return false;};function fRead_getModuleByOutlink(outlink){var mappings=MM["read"].read_netfolder_mapping;for(var o in mappings){if(mappings[o]==outlink){return o;}}};function fRead_backFromNetFolder(win){var sModule=MM["read"].getModuleByOutlink( win.name );MM.getModule( sModule );TLabel.replace(win.name, sModule);};function fReadMakeDate(sTime){var t , logTime=CM["folderMain"].loginTime.trim();t=logTime.split(/[-: ]/);var log=new Date(t[0],t[1]-1,t[2],t[3]-1,t[4]-1,t[5]-1);t=sTime.split(/[-: ]/);var now=new Date(t[0],t[1]-1,t[2],t[3]-1,t[4]-1,t[5]-1);var order=gLang.read[31];if(log < now){t=log;log=now;now=t;order=gLang.read[32];}t=Math.floor((log.getTime() - now.getTime())/60000);var day=Math.floor(t / (24*60));t -=day * 24 * 60;var hour=Math.floor(t / 60);t -=hour * 60;var minute=t;var rt="";if(day){rt+=day + gLang.read[33];}if(rt){rt+=order}else{rt="今天";}return "<span title='"+ rt +"'>" + now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日" + " " + sTime.split(" ")[1] + "</span>";}function fGetInviteHtml(dat, sModule){var from=dat.from;var getname=function(addr){if(addr.indexOf("\"")>-1){addr=addr.match(/\".+\"/gi)+"";addr=addr.replace(/\"/gi,"");}else{addr=addr.replace(
/@.+/gi,"");}return '"' + addr + '"';};if(from.indexOf("163.com")>-1||from.indexOf("126.com")>-1||from.indexOf("188.com")>-1){return "";}from=getname(from);if(!from||from=="null"){from=dat.from;}var html='<b class="btnS icoInt"> </b> <a href="javascript:fGoto()" onclick=\'fGoto("MM.read.invite","'+ sModule +'")\' class="fnoml fgn3">' +gLang.read[36]+ '</a>';return html;}function fDeleteSplit(s){if(s.indexOf("\,\,")>-1){s=s.replace(/\,\,/gi,"\,");return fDeleteSplit(s);}else{return s;}}function fGetMeOut(sAddr){var sReg="\,?[^\,]*"+ GE.UID +"[\>\,?|\,?]?";var reg=new RegExp(sReg,"gi");sAddr=sAddr.replace(reg,",");sAddr=fDeleteSplit(sAddr);if(sAddr.indexOf(",")==0){sAddr=sAddr.substring(1,sAddr.length);return fGetMeOut(sAddr);}else if(sAddr.lastIndexOf(",")==sAddr.length-1&&sAddr.length!=0){sAddr=sAddr.substring(0,sAddr.length-1);return fGetMeOut(sAddr);}else{return sAddr;}}function fReadOuterLink(sUrl){MM["read"].moduleFrame.location.href=sUrl;}function fSetGroupMail(s){try{var str=s.trim();var arr=str.split(",");for(var i in arr){arr[i]=fSetFromFormat(arr[i]);}return arr.join(",");}catch(exp){return s;}}function fSetFromFormat(s){try{var str=s.trim();if(str.indexOf('""')==0){str=str.replace(/.+</,"");str=str.replace('>',"");}return str;}catch(exp){return s;}}function fRead_setReplyContent(sModule, flag , from){if(sModule=="draft"){CC.showSysMsg("草稿不能转发或者回复!");return;}var mod=null;if(from=="folder"){var arr=MM[GE.currentFolder].dg.HTML.getSelectTargetArray();if(arr&&arr.length>1){CC.showSysMsg("请选择一封邮件后再选择回复或者转发!");return;}if(!sModule){mod=false;}else{mod=MM[sModule].readData;}}else{mod=CM["letter"][sModule];}if(!mod){CC.showSysMsg("请选择邮件!");return;}if(MM["read"].isDeleted(sModule)){return;}if(flag=="reply"||flag=="replyall"){GE.composeType="reply";}else{GE.composeType=flag;}var replyModule=MM["read"].midReplyMapping[mod.mid];
if(replyModule&&TLabel.exist(replyModule)&&GE.composeType=="reply"){MM.getModule(replyModule);return;}
MM.getModule("compose");var index=MM["compose"].index;var newCompose="compose" + index;if(GE.composeType=="reply"){MM["read"].midReplyMapping[mod.postmid]="compose" + index;var dat=mod.data;with(dat){subject=subject.unescapeHTML();from=from.unescapeHTML();to=to.unescapeHTML();cc=cc.unescapeHTML();}var html='';html+='<blockquote style="padding-left:5px;margin-left:5px;border-left:#a0c6e5 2px solid;margin-right:0px"><hr style="color:#a0c6e5" size="1">';html+=MM["read"].replyHead(dat);html+=mod.html;html+='</blockquote>';if(GE.addo==1){html="";}var to="", cc="";to=dat.from;if(flag=="replyall"){var sTo=fGetMeOut(dat.to);var sCC=fGetMeOut(dat.cc);if(sTo!=""&&sTo!="(无)"){to+="," + sTo;}if(sCC!=""&&sCC!="(无)"){cc=sCC;}}var o={text:html , to:to};o["subject"]=GE.replyf + dat.subject;if(flag=="replyall"){o["cc"]=cc;}MM[newCompose].message(o);MM[newCompose].name=TLabel.title(newCompose);}else if(GE.composeType=="forward"){MM["read"].midForwardMapping[mod.postmid]="compose" + index;var url=GE.cmDomain + "/coremail/fcg/ldmmapp?sid=" + GE.SID;url+='&funcid=forwhand&optypes=modify.x';url+='&fid=' + mod.data.fid;url+='&oldmid=' + mod.data.mid;url+='&email=&modify.x=1&fromforward2=y';MM[newCompose].cmURL=url;CM.setCMReffer(newCompose);CC.showMsg(gLang["common"]["wait"] + "..");}if(from!="folder"){TLabel.replace(sModule, newCompose);}}function fSaveToNetFolder(index, start, length, encode, filename, conttype, sModule){var doc=MM["read"].targetFrame.document;var obj=$("frmAttaToNetFdr" + sModule);if (!obj||obj==null) return;var greQuot=/"/gi;var ContType=conttype.replace(greQuot, '"');var sPara=start + "\n" + length + "\n" + encode + "\n" + filename + "\n" + ContType;$("txtPart" + sModule).value=sPara;var outModule=CC.getOutLink_new("", "savetonetfolder", "保存到网盘", 0);if(!outModule){outModule=GE.outLink["savetonetfolder"];}obj.target=outModule;TLabel.replace(sModule, outModule);obj.submit();MM["read"].read_netfolder_mapping[sModule]=outModule;}function fRead_attachOption(index, start, length, encode, filename, conttype, sModule, sUrl){var f=frame["indexFrame"];var t=GE.getThis();var ev=GE.getEvent();var OMenu=[{width: "120",ie5:true, top:Event.pointerY(ev),left:Event.pointerX(ev)},['打开附件', function(){window.open(sUrl.replace("&download=1",""));}],['下载附件', function(){window.location.href=sUrl;}],['保存附件到网盘', function(){fSaveToNetFolder(index, start, length, encode, filename, conttype, sModule);}]];f.fButtonMenu(t,ev,OMenu);}function Compose(){this.getHtml=fComposeGetHtml;this.getSend=fComposeGetSend;this.getToolbar=fComposeGetToolbar;this.getToolbarMenu=fComposeGetToolbarMenu;this.getMid=fComposeGetMid;this.init=fComposeInit;this.exit=fComposeExit;this.empty=fComposeEmpty;this.synData=fComposeSynData;this.clone=fComposeClone;this.control=fComposeControl;this.setBcc=fComposeSetBcc;this.setTitle=fComposeSetTitle;this.setTime=fComposeSetTime;this.setEditor=fComposeSetEditor;this.getEditor=fComposeGetEditor;this.fixEditor=fComposeFixEditor;this.attach=fComposeAttach;this.address=fComposeAddress;this.preview=fComposePreview;this.message=fComposeMessage;this.setContent=fComposeSetContent;this.sign=fComposeSign;this.subject=fComposeSubject;this.info=fComposeInfo;this.draftFile=fAttachFileInit;this.addFile=fAttachFileAdd;this.disableFile=fAttachFileDisable;this.resend=fReSendCompose;this.sendCheck=fCheckCompose;this.send=fSendCompose;this.allEmpty=fCheckAllEmpty;}(function (){var t=new Compose();MM["compose"].mid="";MM["compose"].pid=0;MM["compose"].index=0;MM["compose"].getHtml=t.getHtml;MM["compose"].getSend=t.getSend;MM["compose"].getToolbar=t.getToolbar;MM["compose"].getToolbarMenu=t.getToolbarMenu;MM["compose"].getMid=t.getMid;MM["compose"].init=t.init;MM["compose"].exit=t.exit;MM["compose"].empty=t.empty;MM["compose"].synData=t.synData;MM["compose"].clone=t.clone;MM["compose"].control=t.control;MM["compose"].setBcc=t.setBcc;MM["compose"].setTitle=t.setTitle;MM["compose"].setTime=t.setTime;MM["compose"].setEditor=t.setEditor;MM["compose"].getEditor=t.getEditor;MM["compose"].fixEditor=t.fixEditor;MM["compose"].attach=t.attach;MM["compose"].address=t.address;MM["compose"].preview=t.preview;MM["compose"].message=t.message;MM["compose"].setContent=t.setContent;MM["compose"].sign=t.sign;MM["compose"].subject=t.subject;MM["compose"].info=t.info;MM["compose"].draftFile=t.draftFile;MM["compose"].addFile=t.addFile;MM["compose"].disableFile=t.disableFile;MM["compose"].resend=t.resend;MM["compose"].sendCheck=t.sendCheck;MM["compose"].send=t.send;MM["compose"].allEmpty=t.allEmpty;})();function fComposeGetHtml(){var sInput='';if(document.all){sInput='<textarea tabindex="1" class="cMitxt cMitra cMt0" rows="1" name="to" autocomplete="off" style="overflow-x:hidden"></textarea>';}else{sInput='<input tabindex="1" class="cMitxt cMt0" type="text" name="to" autocomplete="off">';}var sHtml='<div class="cmpMsgAll2 border2" style="height:'+GE.leftHeight+'px"><form id="frmCompose$id$" method="post" enctype="multipart/form-data"><input type="hidden" name="setdraft"><input type="hidden" name="sendtype" value="1"><input type="hidden" name="optype"><input type="hidden" name="funcid" value="compose"><input type="hidden" name="mid"><input type="hidden" name="text"><input type="hidden" name="netfdrhost"><input type="hidden" name="remotehost"><input type="hidden" name="afrc_backpara"><input type="hidden" name="stationery"><input type="hidden" name="chkHtmlMessage"><input type="checkbox" name="priority" value="1" class="hide"><input type="checkbox" name="return_receipt" value="1" class="hide"><input type="checkbox" name="ifsavetosent" value="y" class="hide"><input type="checkbox" name="setTime" value="y" class="hide"><input type="checkbox" name="chkTextMessage" value="y" class="hide"><input type="checkbox" name="chkSourceMessage" value="y" class="hide"><input type="hidden" name="year"><input type="hidden" name="month"><input type="hidden" name="day"><input type="hidden" name="hour"><input type="hidden" name="compinfo_minute"><table class="cmpMsg"><col class="cmc1"><col class="cmc2"><col class="cmc3"><tr class="tr1"><td class="cmc1"><table class="cmbtl" onclick=fGoto("MM.compose$id$.control","address:to") onmouseover=addClass(this,"over") onmouseout=setClass(this,"cmbtl") onmousedown=addClass(this,"click") onmouseup=delClass(this,"click")><tr><td class="bgF1 cmb_l"></td><td class="bgF2 cmb_m"> 收件人</td><td class="bgF1 cmb_r"></td></tr></table></td><td>' + sInput + '</td><td></td></tr><tr class="tr1"><td><table class="cmbtl" onclick=fGoto("MM.compose$id$.control","address:cc") onmouseover=addClass(this,"over") onmouseout=setClass(this,"cmbtl") onmousedown=addClass(this,"click") onmouseup=delClass(this,"click")><tr><td class="bgF1 cmb_l"></td><td class="bgF2 cmb_m"> 抄 送</td><td class="bgF1 cmb_r"></td></tr></table></td><td><table class="cm_cc"><tr><td class="td1"><input tabindex="2" class="cMitxt cMt0" type="text" name="cc" autocomplete="off"></td><td class="td2"><a id="aComposeBcc$id$" onclick=fGoto("MM.compose$id$.control","setBcc") href="javascript:fGoto()" class="fbl" hidefocus>显示密送</a></td></tr></table></td><td></td></tr><tr class="tr1" style="display:none" id="trComposeBcc$id$"><td><table class="cmbtl" onclick=fGoto("MM.compose$id$.control","address:bcc") onmouseover=addClass(this,"over") onmouseout=setClass(this,"cmbtl") onmousedown=addClass(this,"click") onmouseup=delClass(this,"click")><tr><td class="bgF1 cmb_l"></td><td class="bgF2 cmb_m"> 密 送</td><td class="bgF1 cmb_r"></td></tr></table></td><td><input class="cMitxt cMt0" type="text" name="bcc" autocomplete="off"></td><td></td></tr><tr class="tr1"><td><table class="cmbtl" onclick=fGoto("MM.compose$id$.control","subject") onmouseover=addClass(this,"over") onmouseout=setClass(this,"cmbtl") onmousedown=addClass(this,"click") onmouseup=delClass(this,"click")><tr><td class="bgF1 cmb_l"></td><td class="bgF2 cmb_m"> 主 题</td><td class="bgF1 cmb_r"></td></tr></table></td><td><input tabindex="4" class="cMitxt cMt0" type="text" name="subject" maxlength="250"></td><td></td></tr><tr class="tr1"><td><table class="cmbtl" id="tabComposeFile$id$" onmouseover=addClass(this,"over") onmouseout="if(this.getAttribute(\'isMenu\'))return;setClass(this,\'cmbtl\')" onmousedown=addClass(this,"click") onmouseup=delClass(this,"click")><tr><td class="bgF1 cmb_l"></td><td class="bgF2 cmb_m"> 附 件</td><td class="bgF2 cmb_m" onclick="var t=this.parentNode.parentNode.parentNode;t.setAttribute(\'isMenu\',true);var o=top.frames[\'jsFrame\'].MM.compose$id$.getToolbarMenu(\'attach\');fButtonMenu(t,event,o)"><b class="btnS btnExp3"></b></td><td class="bgF1 cmb_r"></td></tr></table></td><td><table class="cMfile" id="tabComposeAttach$id$"><tr><td class="fgy cMfTxt">点击“▼”按钮下拉,可选择多种附件形式。</td></tr><tr style="display:none"><td class="fbrow"><div></div><div></div></td></tr></table></td><td></td></tr><tr><td colspan="3" id="tdComposeEditor$id$" style="padding:0"></td></tr></table></form></div>';return sHtml.replace(/\$id\$/ig,this.index);}function fComposeGetSend(o){var mod=this;var text=["邮件发送成功!","邮件已通过卡巴斯基杀毒引擎扫描","",">>点击此处将收信人保存到通讯录"];var name='aComposeSaveAdd'+mod.index;var url=GE.cmDomain + '/coremail/fcg/ldvcapp?funcid=pqadd&qaddinfo='+ o.escaped_dest +'&sid='+ GE.SID +'&tempname=address/quickadd_simple.htm';var html='';var height=GE.leftHeight;if(o.save){text[2]=" ,同时保存在发件箱中";}html+=fGetSendTopAdHTML(1);var iAdHeight=GE.topAdHeight;if(html){height -=iAdHeight;}html+='<div class="cmpSusAll border2" style="height:'+height+'px"><h2 class="csTit fgn"><b class="icoSus"></b><span>' +text[0]+ '</span></h2><p class="fgy">' + text[1] + text[2] +'<br>'+o.okinfo+'<div class="fbk3 sendMlist">'+o.destination.replace(",",", ")+'</div><br> <a hidefocus href="javascript:fGoto()" class="udl fbl" id="'+name+'">' +text[3]+ '</a><br></p></div>';mod.div.innerHTML=html;$(name).onclick=function(){fGetCMFrame(mod.moduleName).src=url;};html=CC.getBatchToolbarOption([new toolbarOption("resend","再发一封","fGoto('MM.compose"+mod.index+".control','resend')",false, false, false, "btnSend" , "tlbtn5",true)]);html='<div class="bgF1 tlbar_l"></div>'+html+'<div class="bgF1 fRig tlbar_r"></div>';$("dvToolbar").innerHTML=mod.toolbarHtml=html;mod.resize=function(){var oDiv=mod.div.firstChild;var iHeight=GE.leftHeight - iAdHeight;iHeight=(iHeight>=0) ? iHeight : 0;oDiv=iAdHeight ? oDiv.nextSibling : oDiv;oDiv.style.height=iHeight + "px";};TLabel.title(mod.moduleName , text[0]);mod.type="complete";}function fComposeGetToolbar(sModule){var sEvent="fGoto('MM.compose"+this.index+".control','$op$')";function fEvent(s){return sEvent.replace("$op$",s);}var arrToolbarOption=[new toolbarOption("send", "发送", fEvent("send"), false, false, false, "btnSend" , "tlbtn1" , true),new toolbarOption("save", "存草稿", fEvent("save"), false, false, false, "btnSave" , "tlbtn4" , true),new toolbarOption("preview","预览", fEvent("preview"), false, false, true, "btnPvw" , "tlbtn1" , true),new toolbarOption("setup", "设置", "", true, false, false, "btnSet", "tlbtn2", true),new toolbarOption("option", "高级选项", "", true, false, false, "", "tlbtn2", false)];return [CC.getBatchToolbarOption(arrToolbarOption, sModule), ''];}function fComposeGetToolbarMenu(sName){var mod=this;var form=mod.form;var menu=[];switch(sName){case "setup":menu=[{width: "180"},['紧急', form.priority],['已读回执', form.return_receipt],['发送时保存到[已发送]', form.ifsavetosent],'empty',['定时发信', form.setTime]];break;case "option":menu=[{width: "140"},[form.chkTextMessage.checked ? '多媒体编辑模式':'纯文本编辑模式', function(){form.chkTextMessage.onclick()}],[form.chkSourceMessage.checked ? '常规编辑模式':'HTML源码编辑', form.chkTextMessage.checked ? false:function(){form.chkSourceMessage.onclick()}]];break;case "attach":menu=[{width: "110" , ie5:true},['本地附件', function(){mod.control('attach:file')}, 'icoLcf'],['网盘附件', function(){mod.control('attach:disk')}, 'icoNdf']];break;}return menu;}function fComposeGetMid(){var mod=MM["compose"];var t=new Date();var a=[t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()];var m=mod.mid.replace(/^\d+/g , a.join(""));return m;}function fComposeSubject(){var mod=this;var arr=gLang["subject"];var len=arr.length;var txt=mod.form.subject.value;function random(){var i=Math.floor( Math.random() * len );var s=arr[i];if(txt.indexOf(s)==-1){return s;}else{return random();}}with(mod.form){subject.value=random();subject.onblur();}}function fComposeInit(){var module=MM["compose"];var mod=this;var id=mod.index;var t , i , len;if(id===0){GE.address=frame["addressFrame"].addr_data;return;}function inputFocus(o){o.style.color='#000000';o.style.borderColor='#AFAFAF';o.style.backgroundColor='#FFFFDB';var oDiv=$("divComposeAddress"+id);if(oDiv){El.hide(oDiv);}}function inputBlur(o){o.style.color='#666666';o.style.borderColor='#CCCCCC';o.style.backgroundColor='#FFFFFF';}mod.form=$("frmCompose"+mod.index);mod.br='<div> </div><div> </div><div> </div><div> </div>';mod.temp="";mod.editor=false;mod.quit=false;mod.attachLen=0;mod.attachArr=[];mod.attachList=[];$("tabComposeFile"+id).onclick=function(){mod.control('attach:file');};with(mod.form){ifsavetosent.checked=module.ifsavetosent;ifsavetosent.onclick=priority.onclick=return_receipt.onclick=function(){this.checked=!this.checked;};setTime.onclick=function(){mod.control('setTime');};chkTextMessage.onclick=function(){var flag=this.checked;try{mod.htmlEditor.parent.changeEditType(flag);this.checked=!flag;}catch(e){}};chkSourceMessage.onclick=function(){try{mod.htmlMode.click();this.checked=mod.htmlMode.checked;}catch(e){}};subject.onfocus=function(){inputFocus(this);};subject.onblur=function(){mod.setTitle(this.value);inputBlur(this);};mid.value=mod.getMid();var arr=[to,cc,bcc];}var aa=new AutoAddress();aa.create(GE.address, arr);for(i=0,len=arr.length; i<len; i++){t=arr[i];t.format=function(){var s=this.value.trim();var r=new RegExp("[ ,;]*$","i");s=s.replace(r,"");this.value=s;return s;};t.onfocus=function(){inputFocus(this);};t.onblur=function(){inputBlur(this);};}mod.loadEditor=function(){try{mod.fixEditor();mod.editor=true;}catch(e){setTimeout('MM.compose'+id+'.loadEditor()',50);return;}if(!document.all){if(mod.form.chkSourceMessage.checked){try{mod.htmlMode.click();}catch(e){mod.form.chkSourceMessage.checked=false;}}if(mod.form.chkTextMessage.checked){try{mod.htmlEditor.parent.changeEditType(false);}catch(e){mod.form.chkTextMessage.checked=false;}}}if(mod.editor&&mod.temp){mod.setEditor(mod.temp , true);mod.temp="";}};var height=GE.leftHeight - 120;var name="ifrComposeEditor"+id;t='<iframe onload=fGoto("MM.compose'+id+'.loadEditor") id="'+name+'" name="'+name+'" src="/dmstyle/HtmlEditor/htmltool_dm.htm" tabindex="5" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" style="margin:0;padding:0;height:'+height+'px!important;height:100%;width:100%"></iframe>';$("tdComposeEditor"+id).innerHTML=t;if(document.all&&gVersion<=5.01){mod.loadEditor();}if(mod.type=="compose"){mod.setEditor(mod.br);mod.sign("default");mod.form.text.value=mod.getEditor();}}function fComposeExit(){var mod=this;var sInfo="确定放弃对此信件所作的操作?";var bFlag=false;function fClose(){try{f_SetDivDisplay(false);}catch(e){}return true;}if(mod.quit){mod.quit=false;return fClose();}if(!mod.empty()){bFlag=window.confirm(sInfo);}else{bFlag=true;}if(bFlag){return fClose();}else{return false;}}function fComposeEmpty(){var mod=this;var form=mod.form;var text=form.text.value;var html=mod.getEditor();var flag=false;if(mod.type=="compose"){flag=form.to.value||form.subject.value||false;}flag=flag||html!=text;return !flag;}function fComposeSynData(){var mod=this;var id=mod.index;if(!document.all){var ifr=$("ifrComposeEditor"+id);mod.temp=mod.getEditor();mod.editor=false;$("tdComposeEditor"+id).replaceChild(ifr,ifr);}}function fComposeClone(id){var mod=MM[id];var type=mod.type=GE.composeType;var text={draft:"草稿。。。",forward:"转发。。。"};var icon={draft:"drIcon",reply:"reIcon",forward:"fwIcon"};mod.oldType="";if(text[type]){mod.name=text[type];}if(icon[type]){mod.icon=icon[type];}MM.createModule(id);}function fComposeControl(sFun){var mod=this;var t , operate="";if(sFun.indexOf(":")!=-1){t=sFun.split(":");operate=t[0];t=t[1];}else{operate=sFun;}switch(operate){case "setBcc":mod.setBcc();break;case "setTime":mod.setTime();break;case "subject":mod.subject();break;case "attach":mod.attach(t);break;case "address":mod.address(t);break;case "preview":mod.preview();break;case "send":mod.send("send.x" , mod);break;case "save":mod.send("savetodraft.x" , mod);break;case "resend":mod.resend(mod);break;default:break;}}function fComposeSetBcc(sFun){var mod=this;var id=mod.index;var a=$("aComposeBcc"+id);var obj=mod.form.bcc;var flag=(a.innerHTML=="隐藏密送");if(sFun==(flag?"show":"hide")){return;}if(flag&&obj.value.trim()){if(window.confirm("要删除已经存在的所有密送地址吗?")){Field.clear(obj);}else{return;}}flag=!flag;El.toggle("trComposeBcc"+id);a.innerHTML=flag ? "隐藏密送" : "显示密送";obj.tabIndex=flag ? 3 : 0;if(!sFun&&flag){try{obj.focus();}catch(e){}}}function fComposeSetTitle(sTitle){TLabel.title(this.moduleName , sTitle.trim());}function fComposeSetTime(){var mod=this;var id=mod.index;var name="divComposeSetTime"+id;var date=new Date();date.setDate(date.getDate()+1);function html(){function c(start,end){var i , a=[];for(i=start;i<end;i++){a[a.length]='<option value="'+i+'">'+i+'</option>';}return a.join("");}var d=[date.getFullYear() , date.getFullYear()+2];if(d[0] > d[1]){d[0]=d[1];}d[1]++;var s='<div class="wbdyOut"><div class="wbdy"><form id="frmComposeSetTime'+id+'"><div class="whd"><b class="fLeft fgy">定时发信设置</b><a id="aComposeSetTime'+id+'" href="javascript:fGoto()" class="btnS btnClose wClos" hidefocus></a></div><div class="wCtn stCtn"><select name="year">';s+=c(d[0],d[1]);s+='</select> 年<select name="month">';s+=c(1,13);s+='</select> 月<select name="day">';s+=c(1,32);s+='</select> 日<br><br><select name="hour">';s+=c(0,24);s+='</select> 时<select name="compinfo_minute">';s+=c(0,60);s+='</select> 分</div><div class="wBot"><input name="ok" type="button" value="确 定" class="btnFn"> <input name="cancel" type="button" value="删 除" class="btnFn"></div></form></div></div>';return s;}function fix(f){var d=[parseInt(f.year.value,10) , parseInt(f.month.value,10)-1 , parseInt(f.day.value,10)];var t=new Date(d[0] , d[1] , d[2]);f.year.value=t.getFullYear();f.month.value=t.getMonth() + 1;f.day.value=t.getDate();}if(document.all&&gVersion<=5.01){var sHtml="";sHtml+='<div class="opWin" style="width:290px;position:absolute;left:-2px;top:-2px">';sHtml+='<a href="javascript:fGoto()"></a>';sHtml+=html() + '</div>';var o={title:"定时发信" , body:sHtml};o.start=function(win){var $=function(id){return win.document.getElementById(id);};El.hide($("aComposeSetTime"+id));with($("frmComposeSetTime"+id)){if(mod.form.year.value){year.value=mod.form.year.value;month.value=mod.form.month.value;day.value=mod.form.day.value;hour.value=mod.form.hour.value;compinfo_minute.value=mod.form.compinfo_minute.value;}else{year.value=date.getFullYear();month.value=date.getMonth() + 1;day.value=date.getDate();}}};o.init=function(){var win=this;var doc=win.document;var $=function(id){return doc.getElementById(id);};var form=$("frmComposeSetTime"+id);with(form){ok.onclick=function(){fix(form);mod.form.year.value=form.year.value;mod.form.month.value=form.month.value;mod.form.day.value=form.day.value;mod.form.hour.value=form.hour.value;mod.form.compinfo_minute.value=form.compinfo_minute.value;mod.form.setTime.checked=true;win.close();};cancel.onclick=function(){mod.form.setTime.checked=false;with(mod.form){Field.clear(year,month,day,hour,compinfo_minute);}win.close();};}};fOpenIe5Window(o , {dialogHeight:"156px",dialogWidth:"290px"});return;}var form , div=$(name);if(!div){var body=mod.div;div=El.createElement("div");div.id=name;div.className="opWin";div.style.position="absolute";div.style.display="none";div.style.zIndex="800";div.style.width="290px";div.innerHTML=html();div.style.top=(El.getY(body) + (body.offsetHeight-160)/2) + "px";div.style.left=(El.getX(body) + (body.offsetWidth-300)/2) + "px";body.appendChild(div);var a=$("aComposeSetTime"+id);a.onclick=function(){El.hide(div);};form=$("frmComposeSetTime"+id);with(form){ok.onclick=function(){fix(form);mod.form.year.value=form.year.value;mod.form.month.value=form.month.value;mod.form.day.value=form.day.value;mod.form.hour.value=form.hour.value;mod.form.compinfo_minute.value=form.compinfo_minute.value;mod.form.setTime.checked=true;a.onclick();};cancel.onclick=function(){mod.form.setTime.checked=false;with(mod.form){Field.clear(year,month,day,hour,compinfo_minute);}form.hour.value=form.compinfo_minute.value="0";a.onclick();};}}else{form=$("frmComposeSetTime"+id);}if(mod.form.year.value){form.year.value=mod.form.year.value;form.month.value=mod.form.month.value;form.day.value=mod.form.day.value;form.hour.value=mod.form.hour.value;form.compinfo_minute.value=mod.form.compinfo_minute.value;}else{form.year.value=date.getFullYear();form.month.value=date.getMonth() + 1;form.day.value=date.getDate();}El.show(div);}function fComposeSetEditor(sContent , b){if(!sContent){sContent="";}if(this.editor){if(this.form.chkTextMessage.checked){this.textArea.value=sContent;return;}var objEditor;if(this.htmlMode.checked){objEditor=this.textEditor;objEditor.value=sContent;}else{try{objEditor=this.htmlEditor.document.body;objEditor.innerHTML=sContent;}catch(e){GE.editContent=sContent;setTimeout('MM.compose'+this.index+'.setEditor(GE.editContent , true)',10);return;}if(b){this.form.text.value=this.getEditor();}}}else{this.temp=sContent;}}function fComposeGetEditor(){var sContent;if(this.editor){if(this.form.chkTextMessage.checked){return this.textArea.value;}var objEditor;if(this.htmlMode.checked){objEditor=this.textEditor;sContent=objEditor.value;}else{objEditor=this.htmlEditor.document.body;sContent=objEditor.innerHTML;}}else{sContent=this.temp;}return sContent;}function fComposeFixEditor(){var id=this.index;var win , doc;if(document.all){win=frame["indexFrame"].frames["ifrComposeEditor"+id];doc=win.document;this.htmlEditor=win.frames["HtmlEditor"];}else{doc=$("ifrComposeEditor"+id).contentDocument;win=doc.getElementById("HtmlEditor").contentWindow;this.htmlEditor=win;}this.htmlMode=doc.getElementsByName("switchMode")[0];this.textEditor=doc.getElementById("sourceEditor");this.textArea=doc.getElementById("dvtext");var mod=this;$("ifrComposeEditor"+id).onfocus=function(){var obj;try{if(mod.editor){if(mod.form.chkTextMessage.checked){obj=mod.textArea;}else{if(mod.htmlMode.checked){obj=mod.textEditor;}else{obj=mod.htmlEditor;}}obj.focus();}}catch(e){}};}function fComposeAttach(sType){var mod=this;switch(sType){case "file":mod.addFile(mod);break;case "disk":if(parent.cos_netfolder){mod.send("attach_from_netfdr.x" , mod);}else{fAlert("对不起,您还没开通网盘!");}break;case "photo":break;case "init":mod.draftFile(mod);break;default:break;}}function fComposeAddress(sOrigin){var mod=this;var id=mod.index;var input=mod.form.elements[sOrigin];var obj={"to" :"selComposeAddrTo","cc" :"selComposeAddrCc","bcc":"selComposeAddrBcc"};sOrigin=obj[sOrigin] + id;var div , body;var i , j , t , len;function funSubmitAddr(){function fGetAddrStr(obj){var str , arr=[];for(i=0,len=obj.length; i<len; i++){arr[i]=obj.options[i].text;}str=arr.join(",");if(str){str+=',';}return str;}
var str;mod.form.elements["to"].value=fGetAddrStr($("selComposeAddrTo"+id));mod.form.elements["cc"].value=fGetAddrStr($("selComposeAddrCc"+id));if(str=fGetAddrStr($("selComposeAddrBcc"+id))){mod.form.elements["bcc"].value=str;mod.setBcc("show");}$("objComposeAddrCancel"+id).click();}function funGetAddr(objInput){var arrAddr=[];if(objInput.format()){arrAddr=objInput.value.split(",");}for(i=0,len=arrAddr.length ; i<len ; i++){arrAddr[i]=[arrAddr[i] , arrAddr[i].replace(/.*</g,"").replace(/>.*/g,"") ];}return arrAddr;}function funAddAddr(objDest){var option , flag;var source=$("selComposeAddrList"+id);for(i=0,len=source.length; i<len; i++){t=source.options[i];if(t.selected){flag=true;for(j=0 ; j<objDest.length; j++){if(objDest.options[j].value==t.value){flag=false;break;}}if(flag){option=El.createElement("option");option.value=t.value;option.text=t.text;objDest.options[j]=option;}}}}function funDelAddr(objDest){for(len=objDest.length,i=len-1; i>=0; i--){if(objDest.options[i].selected){objDest.remove(i);}}}function funGetHtml(){var address=GE.address;var arr=new Array();arr[arr.length]='<div class="wbdyOut"><div class="wbdy"><div class="whd"><b class="fLeft fgy">添加发送地址</b><a id="aComposeAddrClose'+id+'" href="javascript:fGoto()" class="btnS btnClose wClos" hidefocus></a></div><div class="wCtn AdsWin"><select id="selComposeAddrList'+id+'" multiple size="18" class="sel1" style="border:1px solid #CCC">';for(i=0,len=address.length; i<len; i++) {arr[arr.length]='<option value="' + address[i][1] + '">"'+ address[i][0].replace(/\"/g,"")+ '"<' +address[i][1] + '>' +'</option>';}arr[arr.length]='</select><div class="Adbtns"><b id="btnComposeAddTo'+id+'" class="add" title="添加" onmouseover=addClass(this,"over1") onmouseout=setClass(this,"add") onmousedown=addClass(this,"click1") onmouseup=delClass(this,"click1") style="margin-top:25px"></b><b id="btnComposeDelTo'+id+'" class="remove" title="移除" onmouseover=addClass(this,"over2") onmouseout=setClass(this,"remove") onmousedown=addClass(this,"click2") onmouseup=delClass(this,"click2")></b><b id="btnComposeAddCc'+id+'" class="add" title="添加" onmouseover=addClass(this,"over1") onmouseout=setClass(this,"add") onmousedown=addClass(this,"click1") onmouseup=delClass(this,"click1") style="margin-top:50px!important;margin-top:40px"></b><b id="btnComposeDelCc'+id+'" class="remove" title="移除" onmouseover=addClass(this,"over2") onmouseout=setClass(this,"remove") onmousedown=addClass(this,"click2") onmouseup=delClass(this,"click2")></b><b id="btnComposeAddBcc'+id+'" class="add" title="添加" onmouseover=addClass(this,"over1") onmouseout=setClass(this,"add") onmousedown=addClass(this,"click1") onmouseup=delClass(this,"click1") style="margin-top:45px!important;margin-top:38px"></b><b id="btnComposeDelBcc'+id+'" class="remove" title="移除"onmouseover=addClass(this,"over2") onmouseout=setClass(this,"remove") onmousedown=addClass(this,"click2") onmouseup=delClass(this,"click2")></b></div><div class="col3"><h4>收件人:</h4><select id="selComposeAddrTo'+id+'" multiple size="4" class="sel2">';for(i=0,len=arrTo.length; i<len; i++){arr[arr.length]='<option value="'+ arrTo[i][1] +'">'+ arrTo[i][0].replace(/</g,"<") +'</option>';}arr[arr.length]='</select><h4 style=" margin-top:15px!important;margin-top:8px ">抄 送:</h4><select id="selComposeAddrCc'+id+'" multiple size="4" class="sel2">';for(i=0,len=arrCc.length; i<len; i++) {arr[arr.length]='<option value="'+ arrCc[i][1] +'">'+ arrCc[i][0].replace(/</g,"<") +'</option>';}arr[arr.length]='</select><h4 style=" margin-top:15px!important;margin-top:8px ">密 送:</h4><select id="selComposeAddrBcc'+id+'" multiple size="4" class="sel2">';for(i=0,len=arrBcc.length; i<len; i++) {arr[arr.length]='<option value="'+ arrBcc[i][1] +'">'+ arrBcc[i][0].replace(/</g,"<") +'</option>';}arr[arr.length]='</select></div></div><div class="wBot"><input id="objComposeAddrOk'+id+'" type="button" value="确 定" class="btnFn"/> <input id="objComposeAddrCancel'+id+'" type="button" value="取 消" class="btnFn"/></div></div></div>';return arr.join("");}function funIE5Cross(b){if(document.all&&gVersion<=5.01){$("ifrComposeEditor"+id).style.visibility=(b ? "" : "hidden");}}var arrTo=funGetAddr(mod.form.elements["to"]);var arrCc=funGetAddr(mod.form.elements["cc"]);var arrBcc=funGetAddr(mod.form.elements["bcc"]);body=mod.div;div=$("divComposeAddrList"+id);if(!div){div=El.createElement("div");div.id="divComposeAddrList"+id;div.className="opWin";div.style.position="absolute";div.style.display="none";div.style.zIndex="800";div.style.width="470px";div.style.top=(El.getY(body)-34) + "px";div.style.left=(El.getX(body)+2) + "px";body.appendChild(div);}funIE5Cross(false);El.show(div);div.innerHTML=funGetHtml();$("objComposeAddrOk"+id).onclick=funSubmitAddr;$("objComposeAddrCancel"+id).onclick=$("aComposeAddrClose"+id).onclick=function(){El.hide(div);funIE5Cross(true);};$("selComposeAddrList"+id).ondblclick=function(){funAddAddr( $(sOrigin) );};$("selComposeAddrTo"+id).ondblclick=$("selComposeAddrCc"+id).ondblclick=$("selComposeAddrBcc"+id).ondblclick=function(){funDelAddr(this);};$("btnComposeAddTo"+id).onclick=$("btnComposeAddCc"+id).onclick=$("btnComposeAddBcc"+id).onclick=function(){funAddAddr( $("selComposeAddr" + this.id.replace("btnComposeAdd","")) );};$("btnComposeDelTo"+id).onclick=$("btnComposeDelCc"+id).onclick=$("btnComposeDelBcc"+id).onclick=function(){funDelAddr( $("selComposeAddr" + this.id.replace("btnComposeDel","")) );};}function fComposePreview(){var oWin , sUrl="
http://mimg."+GE.domain+"/dmstyle/html/preview.htm";MM["compose"].pid=this.index;try{oWin=window.open(sUrl,"preview","status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");oWin.focus();}catch(e){}}function fComposeMessage(o){var i , mod=this;var obj={to:'',cc:'',bcc:'',subject:'',text:'',year:'',month:'',day:'',hour:'',compinfo_minute:'',mid:'',draftmid:'',priority:false,return_receipt:false,attachList:[]};obj["ifsavetosent"]=MM["compose"].ifsavetosent;for(i in o){obj[i]=o[i]}mod.setContent(obj);}function fComposeSetContent(o){var mod=this;var form=mod.form;var type=mod.type;var name="compose"+mod.index;var t;t=form.to;if(t.value==""){t.value=o["to"];}t=form.cc;if(t.value==""){t.value=o["cc"];}t=form.bcc;if(t.value==""&&o["bcc"].trim()){t.value=o["bcc"];mod.setBcc("show");}t=form.subject;if(t.value==""){t.value=o["subject"];t.onblur();}form.ifsavetosent.checked=o["ifsavetosent"];form.priority.checked=o["priority"];form.return_receipt.checked=o["return_receipt"];if(o["year"]||o["month"]||o["day"]||o["hour"]||o["compinfo_minute"]){form.year.value=o["year"];form.month.value=o["month"];form.day.value=o["day"];form.hour.value=o["hour"];form.compinfo_minute.value=o["compinfo_minute"];}t=o["mid"];if(t){form.mid.value=t;}if(o["draftmid"]){t=form.setdraft;t.name="draftmid";t.value=o["draftmid"];}if(o["attachList"].length){mod.attachList=o["attachList"];mod.attach("init");}t=o["text"];if(type=="reply"||type=="forward"){var reg=new RegExp('id="*spnEditorSign"*',"ig");t=t.replace(reg,"");}if(type=="reply"){t=mod.br + '<span id="spnEditorSign"></span>' + t;}else{t=t||mod.br;}mod.setEditor(t);if(type!="forward"){mod.sign("default");}form.text.value=mod.getEditor();var focus="";if(type=="reply"){focus="subject";}else{focus="to";}setTimeout('try{$("'+mod.form.id+'").'+focus+'.focus()}catch(e){}',0);}function fComposeSign(sType){var compose=MM["compose"];if(!compose.moduleFrame){return false;}if(typeof sType=="object"){compose.arrSign=sType.list;compose.signIndex=sType.index;compose.sign("init");return;}if(sType=="custom"&&compose==this){var sName="compose" + arguments[1].replace("ifrComposeEditor","");MM[sName].sign(sType,arguments[2]);return;}var dat=compose.arrSign;var len=dat.length;var mod=this;var arr=[];var t , i;switch(sType){case "init":var f=function(i , name){var sName="compose" + name.replace("ifrComposeEditor","");MM[sName].sign(i);};for(i=0;i<len;i++){t=dat[i];var o={name:t.name,value:i,callback:f};arr.push(o);}arr.push({name:"个性签名"});arr.push({name:"设置签名",callback:function(){MM.getModule("signature");}});GE.signs=arr;break;case "default":i=compose.signIndex;if(i){mod.sign(i-1);}break;default:var sSign="";var sText=mod.getEditor();if(sType=="custom"){sSign=arguments[1];}else{i=sType;t=dat[i];sSign=t.content;if(t.mode==0){sSign=sSign.htmlencode();}}sSign="<br>--<br>" + sSign;var sHtml='<span id="spnEditorSign">' + sSign + '</span>';sText=sText.replace(new RegExp('<span id="*spnEditorSign"*>.*<\/span>|$',"i") , sHtml);mod.setEditor(sText);break;}}function fComposeInfo(name , obj){var mod=this;var id=mod.moduleName;if(obj.name!=id){return;}switch(name){case "Send_SavedToDraftSuccess":mod.quit=true;MM["draft"].load=false;CC.backDraft(obj.okurl.htmldecode(), id);break;case "Timeset_Success":if(TLabel.exist(id)){mod.quit=true;TLabel.close(id);}MM["timeset"].load=false;MM.getModule("timeset");break;case "Info_Success_Address":if(TLabel.exist(id)){TLabel.close(id);}break;default:mod.form.mid.value=mod.getMid();mod.type=mod.oldType;break;}try{if(obj["quickAdd"]){if(mod.form.ifsavetosent.checked){MM["sended"].load=false;}if(!mod.close){mod.getSend(obj);mod.quit=true;}}}catch(e){}CC.hideWaiting();}function fAttachFileInit(m){var arr=m.attachList;var t , i , len=arr.length;var table=$("tabComposeAttach"+m.index);t=table.rows;var tr1=t[0];var tr2=t[1];t=tr2.getElementsByTagName('div');var div1=t[0];var div2=t[1];var tab , tr , td , b;var sCheck , sStyle;function f(){var index=this.getAttribute("index");var obj=$("chkCompose"+m.index+"Attach"+index);obj.checked=!obj.checked;var style=obj.checked ? "line-through":"";this.parentNode.previousSibling.style.textDecoration=style;}for(i=0;i<len;i++){t=arr[i];sCheck=t.deleted ? "checked" : "";sStyle=t.deleted ? "line-through" : "";tab=El.createElement("table");tab.className='cmf_tb';tr=tab.insertRow(-1);td=tr.insertCell(-1);td.className='btnS icoNdf';td.innerHTML='<input id="chkCompose'+m.index+'Attach'+t.index+'" type="checkbox" name="attachtodel" value="'+t.value+'" class="hide" '+sCheck+'>';td=tr.insertCell(-1);td.style.textDecoration=sStyle;td.innerHTML='<nobr>'+t.name+'</nobr>';td=tr.insertCell(-1);b=El.createElement("b");b.className='bgF1 cmIcoDel';b.setAttribute("index",t.index);b.onclick=f;td.appendChild(b);td=tr.insertCell(-1);td.innerHTML=';';div2.appendChild(tab);}El.hide(tr1);El.show(tr2);}function fAttachFileAdd(m){var i , t;var table=$("tabComposeAttach"+m.index);t=table.rows;var tr1=t[0];var tr2=t[1];t=tr2.getElementsByTagName('div');var div1=t[0];var div2=t[1];var a=m.attachArr;if(a.length){i=a.shift();}else{i=m.attachLen;}var id="spnCompose"+m.index+"Attach"+i;var name="attachfile"+i;function del(){div1.removeChild($(id));m.attachLen--;if(m.attachLen < 1){a.length=0;if(m.attachList.length==0){El.hide(tr2);El.show(tr1);}}else{a.push(i);}}function add(){var s=El.createElement("span");s.id=id;var f=El.createElement('input');f.type="file";f.name=name;f.size="42";f.className="inpBf";var b=El.createElement("input");b.type="button";b.value="删除";b.className="inpDf";b.onclick=del;s.appendChild(f);s.appendChild(b);return s;}div1.appendChild(add());m.attachLen++;if(document.all){El.hide(div1);var f=$(id).firstChild;f.click();var v=f.value;if(v){var tab , tr , td , b;tab=El.createElement("table");tab.className='cmf_tb';tr=tab.insertRow(-1);td=tr.insertCell(-1);td.className='btnS icoLcf';td=tr.insertCell(-1);td.innerHTML='<nobr>'+v.replace(/.*\\/,'')+'</nobr>';td=tr.insertCell(-1);b=El.createElement("b");b.className='bgF1 cmIcoDel';b.onclick=function(){div2.removeChild(tab);del();};td.appendChild(b);td=tr.insertCell(-1);td.innerHTML=';';div2.appendChild(tab);}else{del();}}else{if(m.attachList.length==0){El.hide(div2);}tr2.bugHeight=tr2.offsetHeight;}if(m.attachLen==1){El.hide(tr1);El.show(tr2);}}function fAttachFileDisable(m){if(document.all){return;}var a=$("tabComposeAttach"+m.index).getElementsByTagName("input");var i , l , t;for(i=0,l=a.length; i<l; i++){t=a[i];if(t.type=="file"&&t.value.trim()==""){t.disabled=true;}}}function fReSendCompose(m){var id=fGoCompose();TLabel.replace(m.moduleName , id);}function fCheckCompose(o){var type=o.type;var form=o.form;form.to.format();form.cc.format();form.bcc.format();form.subject.value=form.subject.value.trim();function check(){with(form){var n=new Date();var y=parseInt(year.value , 10);var m=parseInt(month.value , 10) - 1;var d=parseInt(day.value , 10);var h=parseInt(hour.value , 10);var c=parseInt(compinfo_minute.value , 10);var o=new Date(y , m , d , h , c);return o <=n;}}switch(type){case "timeset.x":if(check()){fAlert(IC["Send_BeforeNow"]);return false;}case "send.x":if( form.to.value=="" ){fAlert("请填写收件人邮件地址!" , function(){Field.activate(form.to)});return false;}break;case "savetodraft.x":case "attach_from_remote.x":case "attach_from_netfdr.x":return true;default:break;}function fCheckAddress( input ){var sMail=input.value;if(sMail==""){return true}sMail=sMail.replace(/;/g , ",");var arrMail=sMail.split(",");var t , i , iPos;var len=arrMail.length;var sDomain , sDebug="";var
reg=/^@([\w-]+\.)+[\w-]{2,4}$/;for(i=0; i<len; i++){t=arrMail[i];iPos=t.lastIndexOf("@");if( iPos==-1||t.length==iPos + 1){sDebug+=t + "\n";continue;}if( t.indexOf(">")==-1&&t.indexOf("<
")==-1 ){if( t.indexOf("@")!=iPos||t.indexOf("@")==0){sDebug+=t + "\n";continue;}}if( t.charAt(t.length-1)==">" ){sDomain=t.substring( iPos , t.length-1 );}else{sDomain=t.substr( iPos );}if( !reg.test(sDomain) ){sDebug+=t + "\n";}}if(sDebug){sDebug="请正确填写以下邮件地址:" + "\n" + sDebug.substring(0 , sDebug.length-1);fAlert(sDebug , function(){Field.activate(input)});return false;;}return true;}if(!fCheckAddress(form.to)){return false;}if(!fCheckAddress(form.cc)){return false;}if(!fCheckAddress(form.bcc)){return false;}if(form.subject.value==""){if(confirm("确定真的不需要写 主题 吗?")){form.subject.value="来自" + GE.trueName + "的邮件";}else{Field.activate(form.subject);return false;}}return true;}function fSendCompose(sType , oMod){var mod=oMod;var win=MM["compose"].moduleFrame;if(!win){return fAlert("页面正在载入中,请稍候…………");}try{var doc=win.document;}catch(e){return fAlert("数据正在加载中,请稍候…………");}if(mod.type=="send"||mod.type=="save"){return fAlert("处理正在进行中,请稍候…………");}var form=mod.form;var type=mod.type;if(sType=="send.x"&&form.setTime.checked){sType="timeset.x";}if(!mod.sendCheck({type:sType,form:form})){return false;}var sAction=GE.cmDomain + "/coremail/cgi/attachfapps?sid=" + GE.SID;if(type=="reply"||type=="forward"){var oldmid;if(type=="reply"){oldmid=CC.getMidByComposeModule(mod.moduleName);}else{oldmid=CC.getMidByForwardModule(mod.moduleName);}sAction+="&oldmid=" +oldmid+ "&set" +type+ "flag=y&ord=0";MM["folder"].changeMailStatusByMid(oldmid , type);}form.action=sAction;var oType=form.sendtype;oType.name=form.optype.value=sType;oType.value=1;mod.disableFile(mod);if(sType=="attach_from_remote.x"||sType=="attach_from_netfdr.x"){if(sType=="attach_from_netfdr.x"){form.netfdrhost.value=GE.netfdr_host + '/netfolder/servlet/nfapp/att_list.html';}mod.quit=true;var outLink=CC.getOutLink_new("" , "netfolder_"+mod.moduleName , "从网盘添加附件" , 0);TLabel.replace(mod.moduleName , outLink);form.target=outLink;}else{form.target=mod.moduleName;}var sHtml=mod.getEditor();if(sType=="send.x"){var reg=new RegExp('id="*spnEditorSign"*',"ig");sHtml=sHtml.replace(reg,"");}form.text.value=sHtml;if(form.chkTextMessage.checked){form.chkHtmlMessage.value="";}else{form.chkHtmlMessage.value="y";}mod.oldType=mod.type;switch(sType){case "send.x":mod.type="send";break;case "timeset.x":case "savetodraft.x":mod.type="save";break;case "attach_from_netfdr.x":fChangeTab("netfolder");mod.type=GE.composeType="netfolder";break;case "attach_from_remote.x":GE.composeType="photo";break;}var sInfo="";switch(sType){case "timeset.x":sInfo='正在进行病毒扫描并保存定时发信...';break;case "savetodraft.x":sInfo='正在进行病毒扫描并保存邮件...';break;case "send.x":sInfo='正在进行病毒扫描并发送邮件...';break;}if(sInfo){CC.showMsg(sInfo);}function fError(){if(!mod.close){mod.type=mod.oldType;}}setTimeout(fError,1000 * 60 * 10);form.submit();}function fCheckAllEmpty(){var name="compose";var t , tabs=TLabel.tabs;for(t in tabs){if(TLabel.exist(t)&&t.indexOf(name)==0&&MM[t].type!="complete"){if(!MM[t].empty()){return false;}}}return true;}function fSetComposeContent(o){var mod=MM["compose"];var doc=mod.moduleFrame.document;var $$=function(id){return doc.getElementById(id);};mod.selStationery=$$("selStationery");mod.arrSign=o["signList"];mod.signIndex=$$("selSign").selectedIndex;mod.sign("init");mod.mid=o["mid"];mod.ifsavetosent=o["ifsavetosent"];if(mod.index){var sName="compose";var oMod=MM[o.name];if(oMod==mod){var i,len=mod.index;for(i=1;i<=len;i++){MM[sName+i].setContent(o);}}else{if(oMod.type=="save"){GE.composeType="draft";MM.getModule(sName);sName+=mod.index;MM[sName].setContent(o);if(TLabel.exist(o.name)){TLabel.replace(o.name , sName);}}else{if(!oMod.close){oMod.setContent(o);}}}}HM.isHistory=false;fRefreshHistory();}function fGoCompose(o){var id="";var name="compose";function check(){var t , tabs=TLabel.tabs;for(t in tabs){if(TLabel.exist(t)&&t.indexOf(name)==0&&MM[t].type==name&&MM[t].empty()){id=t;tabs[t].onclick();return false;}}return true;}GE.composeType=name;if(check()){MM.getModule(name);}if(!id){id=name + MM[name].index;}setTimeout('try{$("'+MM[id].form.id+'").to.focus()}catch(e){}',0);if(o){MM[id].message(o);}return id;}function fNetfolderToCompose(win){var sName="compose";var oMod=MM[sName];GE.composeType="netfolder";MM.getModule(sName);sName+=oMod.index;if(document.all){TLabel.replace(win.name , sName);}else{MM.getModule(win.name);setTimeout('TLabel.replace("'+win.name+'","'+sName+'")' , 0);}return sName;}function fOpenIe5Window(o , s){var i , url="
http://mimg.163.com/dmstyle/html/ie5.htm";var obj={win:window ,css:GE.cssStylePath ,title:"" ,body:"" ,init:function(){},start:function(){}};var style={status:0,help:0,scroll:0};var features="";for(i in o){obj[i]=o[i]}for(i in s){style[i]=s[i]}for(i in style){features+=i+":"+style[i]+";"}for(i=0;i<30;i++){obj.title+=' ';}return showModalDialog(url , obj , features);}function fAlert(s , f){var o={};o.info=s;if(f){o.callback=f;}CC.showSysMsg(o);}function Welcome(){this.getHtml=fWelcomeGetHtml;this.init=fWelcomeInit;this.weather=fWelcomeWeather;this.jifen=fWelcomeJiFen;this.count=fWelcomeCount;this.getFolder=fWelcomeGetFolder;this.hour=fWelcomeHour;this.space=fWelcomeSpace;this.info=fWelcomeInfo;}(function (){var t=new Welcome();MM["welcome"].getHtml=t.getHtml;MM["welcome"].init=t.init;MM["welcome"].weather=t.weather;MM["welcome"].jifen=t.jifen;MM["welcome"].count=t.count;MM["welcome"].getFolder=t.getFolder;MM["welcome"].hour=t.hour;MM["welcome"].space=t.space;MM["welcome"].info=t.info;})();function fWelcomeGetHtml(){var sHtml="";sHtml+='<div class="WelPagesAll" style="overflow:auto;height:'+GE.leftHeight+'px"><div class="WelPages"><div class="Wel_l"><ul class="wel_welcome"><li class="wel_w fbold">'+this.hour()+','+GE.trueName+'</li><span id="spnWelJiFen"></span></ul><ul class="wel_m_info"><li class="wel_m_i">您有<span class="fbold"><span>'+this.getFolder("new")+'</span>封<a href="javascript:fGoto()" onclick=fGoto("MM.getModule","unRead")>未读邮件</a></span></li><li>'+this.getFolder()+'</li>'+ fGetTodayHTML() +'</ul>'+ fGetInfoCenterHTML() +'<div class="wel_kf_mail">'+fGetServiceHTML()+'</div></div><div class="Wel_r"><div class="wel_rl"><div class="wel_rl_0" style="background-position:'+this.space("free")+' -99px">您使用了'+this.space("all")+'中的'+this.space("use")+'</div></div><div class="wel_weather"><ul><li class="wel_w_tlte"><b>天气预报</b></li><li class="wel_w_sj"><a id="aWelweather" hideFocus href="javascript:fGoto()"></a> </li></ul><iframe class="wel_w_if" id="ifrWelweather" src="" scrolling="no" frameborder="0" style="display:none"></iframe></div><div class="wel_ad">'+fGetWelAdHTML()+'</div></div><div class="wel_clear"> </div></div></div>';return sHtml;}function fWelcomeInit(){var t;var arrWeather=["隐藏","显示"];t=$("aWelweather");t.innerHTML=arrWeather[0];t.onclick=function(){var flag=(this.innerHTML==arrWeather[0]);this.innerHTML=arrWeather[flag?1:0];if(flag){El.hide(t);}else{El.show(t);}};t=$("aWelmail");if(t){t.onclick=function(){fGoCompose({to:this.innerHTML});return false;};}t=$("ifrWelweather");this.weather();this.jifen();MM.createModule("folderMain");}function fWelcomeWeather(){if(GE.city!=-1){if(GE.city==""){GE.city="55591";$("aWelweather").click();}else{El.show("ifrWelweather");}var domain=GE.domain.substr(0,3);var weather='http://mimg.' +domain+ '.com/tianqi/city/' + GE.city + '.html';$('ifrWelweather').src=weather;}else{window.setTimeout("MM.welcome.weather()",500);}}function fWelcomeJiFen(){if(GE.domain!="163.com"&&GE.domain!="126.com"){return;}if(GE.jifen_point!=-1){$('spnWelJiFen').innerHTML=this.count();}else{window.setTimeout("MM.welcome.jifen()",500);}}function fWelcomeCount(){var sHtml='';var iGrade=GE.jifen_level;var iJiFen=GE.jifen_point;var i , sGrade='';var iTemp=iGrade;var sUrl="";switch(GE.domain){case "163.com":sUrl='http://jifen.mail.163.com/cgi-bin/c/door163.fcgi';break;case "126.com":sUrl='http://jifen.mail.126.com/cgi-bin/126/login.fcgi?uid=' + GE.SID;break;}for(i=0; i<Math.floor(iTemp/16); i++){sGrade+='<b class="jf_3"></b>';}iTemp -=i*16;for(i=0; i<Math.floor(iTemp/4); i++){sGrade+='<b class="jf_4"></b>';}iTemp -=i*4;for(i=0; i<iTemp; i++){sGrade+='<b class="jf_5"></b>';}if(iGrade==0){sGrade='<b class="jf_6"></b>';}sHtml+='<li>积分:<a href="'+sUrl+'" target="_blank" style="text-decoration:none" title="您的积分为'+iJiFen+'分"><span class="wel_num">'+iJiFen+'</span></a></li>';sHtml+='<li><div class="w_jifen"><div class="w_dj">等级:</div><a href="'+sUrl+'" target="_blank" style="text-decoration:none;cursor:pointer" title="您的等级为'+iGrade+'级">'+sGrade+'</a></div></li>';return sHtml;}function fWelcomeGetFolder(sExtend){var fod=CM["folderMain"];if(sExtend=="new"){return fod.newCount;}var t , i , j , len;var sHtml="";var mod , folder=fod.folderItems;for(i=j=0,len=folder.length; i<len; i++){t=folder[i];if(t[4]){if(j!=0){sHtml+=',';}j++;mod=fGetModuleByFid(t[0],t[1]);sHtml+='<a href="javascript:fGoto()" onclick=fGoto("MM.getModule","'+ mod +'")>' + t[1];sHtml+='(<span class="wel_num">' +t[4]+ '</span>)</a>';}}if(j){sHtml+=' ';}sHtml+='[<a href="javascript:fGoto()" onclick=fGoto("MM.getModule","folderMain")>管理文件夹</a>]';return sHtml;}function fWelcomeHour(){var d=new Date();var h=d.getHours();var m=d.getMinutes();if(0<=h&&h<5){return "凌晨好";}if(5<=h&&h<10||h==10&&m<30){return "早上好";}if(h==10&&m>=30||11<=h&&h<13||h==13&&m<30){return "中午好";}if(h==13&&m>=30||14<=h&&h<18){return "下午好";}if(18<=h&&h<=23){return "晚上好";}}function fWelcomeSpace(sExtend){var t , d=CM["folderMain"];switch(sExtend){case "all":return fGbToMb(d.useTableB[2]);break;case "free":t=parseInt(d.useTableP[1],10);t /=100;t *=244;t=-t;t+="px";return t;break;case "use":t=100-parseInt(d.useTableP[1],10);if(t!=0&&!isNaN(t)){return t+"%";}else{return "0%";}break;}}function fWelcomeInfo(){return fGetInfoCenterHTML();}