var IM=new InfoManager();function InfoManager(){this.frame=new Array("topFrame","folderFrame","indexFrame");this.target=window.parent;this.divs=new Array();this.content=null;this.opacity=0;this.step=2;this.limit=10;this.timeout=70;this.color="#000000";this.back=null;this.obj=null;this.type="";this.info=new InfoContent();if(gUseFrame){this.frame=new Array("indexFrame");}this.state="";}InfoManager.prototype.SetStyle=function(tDiv){with(tDiv.style){position="absolute";top="0";left="0";width="100%";height="100%";zIndex=100;cursor="default";}};InfoManager.prototype.SetAlpha=function(iAlpha){var iIndex , len , tDiv;len=this.divs.length - 1;for(iIndex=0; iIndex<len; iIndex++){tDiv=this.divs[iIndex];tDiv.style.MozOpacity=iAlpha / 100;tDiv.style.filter="alpha(opacity=" + iAlpha + ")";}};InfoManager.prototype.NewDiv=function(tDoc){var tDiv;tDiv=tDoc.createElement("div");this.SetStyle(tDiv);tDoc.body.appendChild(tDiv);this.divs[this.divs.length]=tDiv;return tDiv;};InfoManager.prototype.Show=function(){if(this.content==null){return false;}this.opacity+=this.step;this.SetAlpha( this.opacity );if(this.opacity < this.limit){window.setTimeout("IM.Show()",this.timeout);}};InfoManager.prototype.Clear=function(){var iIndex , len , tDoc , tDiv;len=this.divs.length;for(iIndex=0; iIndex<len; iIndex++){tDiv=this.divs[iIndex];tDiv.style.display='none';tDiv.parentNode.removeChild(tDiv);}for(iIndex in this.frame){with(this.target){tDoc=frames[this.frame[iIndex]].document;}with(tDoc.body){oncontextmenu=onselectstart=null;}}this.opacity=0;this.divs.length=0;this.content=null;};InfoManager.prototype.Create=function(){if(this.content){this.Clear();}var iIndex , tDoc , tDiv , tFun , sAlpha;tFun=new Function("return false");for(iIndex in this.frame){with(this.target){tDoc=frames[this.frame[iIndex]].document;}with(tDoc.body){oncontextmenu=onselectstart=tFun;}tDiv=this.NewDiv(tDoc);sAlpha="-moz-opacity:" + (this.opacity/100) + ";";sAlpha+="filter:alpha(opacity=" + this.opacity + ");";with(tDiv.style){backgroundColor=this.color;height=tDoc.body.scrollHeight + "px";cssText=sAlpha + cssText;}}this.content=this.NewDiv(tDoc);this.Show();};InfoManager.prototype.Custom=function(sTitle , sInfo , sButton){MM.hideModules(0);fGetInfoHistory();this.Create();fResetScroll();if(!sButton){sButton='<input id="IM.default" type="button" value=" 确　定 " onclick=fGoto("fClose")>';}if(this.info[sInfo]){sInfo=this.info[sInfo];}sTitle="系统提示";var sHtml='<table width="100%" height="100%"><tr><td><table border="0" width="528" cellspacing="1" cellpadding="4" align="center" class="bgcolor5"><tr class="bgcolor2"><td class="f14w"><b>[ ' + sTitle + ' ]</b></td></tr><tr><td class="bgcolor1" align="center" height="100">' + sInfo + '</td></tr><tr class="bgcolor3" align="center"><td>' + sButton + '</td></tr></table></td></tr></table>';this.content.innerHTML=sHtml;this.state="";gCurDoc.getElementById("IM.default").focus();};InfoManager.prototype.Close=function( sFlag ){if(this.content==null){return false;}this.Clear();if(this.back){if(this.type=="confirm"){var bFlag=(sFlag=="ok") ? true : false;this.back(bFlag , this.obj);}else{this.back(this.obj);}}this.type="";this.back=this.obj=null;};function fClose( sFlag ){GE.laterRequestModule="";var aHist=HM.arrHistory;aHist.length--;if(sFlag=="yes"){aHist.length--;}if(aHist[aHist.length - 1]=="unRead"){MM.getModule( "folderMain" );}else{MM.getModule( aHist[aHist.length - 1] );}IM.Close( sFlag );}function fAlert(sInfo, callback , obj){var sTitle='警告';IM.back=callback;IM.obj=obj;IM.type="alert";IM.Custom(sTitle , sInfo);return false;}function fConfirm(sInfo, callback , obj){var sTitle='确认';var sButton='<input type="button" value=" 确　定 " onclick=fGoto("fClose","ok")>';sButton+='　　<input type="button" value=" 取  消 " onclick=fGoto("fClose") id="IM.default">';IM.back=callback;IM.obj=obj;IM.type="confirm";IM.Custom(sTitle , sInfo , sButton);return false;}function fInfoOutputContent(){var sName="info";var oData=CM[sName];var sTitle="提示";var sInfo=oData.info.trim();var aHist=HM.arrHistory;var sButton="";switch(IM.state){case "reload":var winParent=gCurWin.top;winParent.setTimeout("window.location.reload()",100);break;case "refuse":sButton='<input id="IM.default" type="button" value=" 确　定 " onclick=fGoto("fClose","yes")>';break;}switch(sInfo){case "popresult":fHideWaiting();oData.fid=parseInt(oData.fid);fSetPopNewMailCount(oData.fid , oData.count);var sModName=(oData.fid <=1) ? "inbox" : fGetModuleByFid(oData.fid ,"");var sFidName=fGetFolderName(sModName);if(MM[sModName]&&oData.count!="0"){MM[sModName].load=false;}sInfo='您用帐号 '+oData.user+' POP了 '+oData.count+' 封邮件<br><br>';if(oData.errinfo=="操作成功"){sInfo+='请到“<a href="javascript:fGoto()" onclick=fGoto("IM.Close");fGoto("MM.getModule","'+sModName+'")>'+sFidName+'</a>”文件夹中查看';}else{}break;case "Pop_Receiving_Mails":sButton='<input id="IM.default" type="button" value=" 确　定 " onclick=fGoto("IM.Close");fGoto("MM.getModule","folderMain")>';break;case "Timeset_Success":fCheckCompose();try{frame["indexFrame"].frames["htmlletter"].frames["HtmlEditor"].document.body.innerHTML="";}catch(exp){}sButton='<input type="button" value=" 确　定 " onclick=fGoto("IM.Close");fGoto("MM.getModule","folderMain") id="IM.default">  ';break;case "Send_SavedToDraftSuccess":fCheckCompose();sButton='<input type="button" value=" 确　定 " onclick=\'fGoto("fBackDraft","'+ oData.okurl +'");fGoto("fClose");\' id="IM.default">  ';break;
case "Preference_ChangedSuccessfully":
	try{
		if(GE.reloadInvite){
			GE.reloadInvite = false;
			top.location.reload();
			return;
		}
	}catch(exp){}
	break;
default:if(aHist[aHist.length - 2]=="option"){sButton='<input type="button" value=" 确　定 " onclick=fGoto("fClose","yes") id="IM.default">';sButton+='　　<input type="button" value=" 返　回 " onclick=fGoto("fClose")>';}break;}IM.type=sName;IM.Custom(sTitle , sInfo , sButton);}
var CC = {
	showSysMsg:function(o){
		CM[ "info" ] = o;
		fInfoOutputContent();
	}
};
function fWarningOutputContent(){var sName="warning";var oData=CM[sName];var sTitle="警告";var sInfo=oData.info.trim();var aHist=HM.arrHistory;var sButton="";switch(sInfo){case "TimeSet_Empty":case "Mails_EmptySearchResult":gFolderSearchType="";if(aHist[aHist.length - 1]=="timeset"||aHist[aHist.length - 1]=="unRead"){sButton='<input type="button" value=" 返　回 " onclick=fGoto("fClose","yes") id="IM.default">';}else if(aHist[aHist.length - 1]=="read"){sButton='<input id="IM.default" type="button" value=" 确　定 " onclick=fGoto("IM.Close");fGoto("MM.getModule","folderMain")>';}break;case "Send_BeforeNow":fCheckCompose();break;case "LdapApp_InvalidRequest":sButton='<input id="IM.default" type="button" value=" 确　定 " onclick=top.location.replace("'+gHomePage+'")>';break;case "Pop_Not_Setting":case "Address_EmailInvalid":sButton='<input id="IM.default" type="button" value=" 确　定 " onclick=fGoto("IM.Close");fGoto("MM.getModule","folderMain")>';break;
case "Warn_Exceed_Max_SendMail_Size":
	GE.composing = false;
	try{
		$("sending").style.visibility="hidden"; 
		$("sending_sub").innerHTML = '<img src="http://mimg.163.com/jsstyle/images/sending.gif" align="absmiddle">'; 
		fDisableSendAndSave(false); 
		fSetComposeMID();
	}catch(exp){}
	break;
}if(oData.pop){sTitle="提示";sInfo='<font color="red">Pop帐号连接成功</font>';}IM.type=sName;IM.Custom(sTitle , sInfo , sButton);}function InfoContent(){this["Info_Success"]="操作成功";this["Info_Antivirus_Scanning"]="正在检查邮件，请稍后检查收件箱";this["Address_Import_Success"]="地址簿导入成功";this["Send_SavedToDraftSuccess"]="成功将信存入草稿箱";this["Pop_Receiving_Mails"]="正在接收邮件，请稍后检查收件箱";this["Filter_Forward_ChangedSuccessfully"]="你的邮件转发已成功修改";this["Personal_ChangedSuccessfully"]="个人资料修改成功";this["Password_ChangedSuccessfully"]="你的密码已成功修改了";this["Preference_ChangedSuccessfully"]="您的设置已修改成功";this["LdapApp_AutoReplyModified"]="自动回复设置已改变";this["Timeset_Success"]="定时发信设置成功！<br><br>如需修改，请点击“邮箱选项”→“定时发信”；或直接进入[ 草稿箱 ]查看！";this["Info_Question_Update_Success"]="生日、忘记密码时的提示问题和答案已经更改成功";this["Warn_Exceed_Max_SendMail_Size"]="信件大小超过限制";this["Warn_In_Working"]="正在处理您的请求,请稍后再试";this["Lett_Structure_Nest_Too_Deep"]="信件嵌套层次过深";this["Info_Antivirus_Param_Err"]="查杀毒设置错误";this["Warn_Address_Item_Exist"]="此地址项已存在";this["Lett_Structure_Err"]="信件结构错误";this["AntiVirus_Setting_Wrong"]="查杀毒配置错误";this["TooManyReciever"]="邮件接收者数目超过限制";this["Address_Can_Not_Delet_System_Group"]="系统地址列表不能删除";this["Address_Group_Exist"]="地址列表已存在，请换一个名字";this["Str_Please_Try_Again"]="此次操作不成功,请稍后重试一遍";this["Address_InValid_Format"]="地址格式错误";this["Address_InFile_InValid"]="不支持的地址本格式";this["LdmsApp_Letter_Deleted"]="此信件暂时无法读取,请稍候重读或与客服联系";this["Str_Net_Error"]="网络错误";this["FoldMain_CanNOTDelOrRename"]="不能够删除或重命名此文件夹";this["Register_NetWorkBusy"]="系统繁忙，请稍后再试";this["Filter_Err_TooMany"]="过滤项的数量不能超过";this["Mails_EmptySearchResult"]="搜索结果为空。";this["Mails_SelectFolderFirst"]="请先选择要将文件移动到什么文件夹。";this["TimeSet_Empty"]="没有设定任何定时发信信息！";this["Password_OldPasswordInvalid"]="原密码错误";this["PopList_NumberInvalid"]="POP邮箱数目超过限制";this["PopList_PortInvalid"]="端口设置错误";this["PopList_TimeOutInvalid"]="超时设置错误";this["Signature_NumberInvalid"]="签名数超过限制";this["Warn_Signature_Duplicate_Name"]="重复的签名提示";this["Search_InputFolder"]="请先选择要搜索的文件夹。";this["Search_InputWord"]="请先输入要搜索的字或词条。";this["Send_BeforeNow"]="定时发送时间不能比当前时间早。";this["Send_NoTimeset"]="没有设定定时发信信息。";this["Send_TimeInvalid"]="定时时间设置错误。";this["LdapApp_InvalidRequest"]="您的请求无效，请重新登陆邮箱。";this["FoldMain_ArriveMaxFolderCount"]="已达到最大文件夹个数";this["FoldMain_SameFolderNameExists"]="已有同名的文件夹，请重新选择新文件夹名。";this["FoldMain_SelectParentFolder"]="请选择父文件夹。";this["ForwHand_ForwardAddressInvalid"]="转交邮件地址不正确。";this["Compose_LetterAlreadySent"]="您的信件已经发送了。";this["AttachF_CannotDeleteUnexistsFile"]="不能删除不存在的文件。";this["AttachF_AttachmentTooLarge"]="附件总大小超出限制";this["AttachF_SelectTheFileFirst"]="请先选择要删除的文件。";this["AttachF_AlreadyInTheList"]="已经在附件列表中了。";this["Address_TooManyIEmail"]="超过了最大个人地址簿条数限制";this["Address_IdInvalid"]="地址本Id错误";this["Address_TooManyGEmail"]="每个团体地址簿中不能有超过100个邮箱地址";this["Address_DateOfBirthInvalid"]="出生日期错误。";this["Address_MonthOfBirthInvalid"]="出生月份错误。";this["Address_YearOfBirthInvalid"]="出生年份错误。";this["Address_PhoneNumInvalid"]="电话号码错误。";this["Address_ZipCodeInvalid"]="错误的邮码。";this["Address_EmailInvalid"]="错误的EMAIL地址。";this["Address_EmailNotEmpty"]="EMAIL地址不能为空。";this["Address_NameNotEmpty"]="名字不能为空。";this["Warn_Address_Select_One"]="请选择一项添加到地址簿";this["Warn_Address_Item_NotFound"]="地址项没找到";this["AttachF_SingleAttachTooLarge"]="单个附件大小超过限制";this["Warn_Quota_Err"]="邮箱容量已满";this["Address_Import_Count_Zero"]="导入项目为0, 格式可能不对";this["Pop_Site_Info_Error"]="Pop帐号设置错误";this["Pop_Connect_Error"]="不能连接Pop服务器";this["Pop_User_Error"]="Pop用户出错，没有此用户名";this["Pop_Pass_Error"]="密码设置错误";this["Pop_Stat_Error"]="不能获得邮箱的统计资料";this["Pop_Last_Error"]="不能获得邮件信息";this["Pop_List_Error"]="不能获得邮件的大小信息";this["Pop_Retr_Error"]="不能获得邮件内容";this["Pop_MsgSize_Over_Limit_Error"]="信件大小超过最大允许接收信件大小";this["Pop_UD_Error"]="连接UD服务器错误";this["Pop_MS_Error"]="连接MS服务器错误";this["Pop_PutMail_Error"]="投信出错";this["Pop_Del_Error"]="删除信件出错";this["Pop_Count_Over_Limit_Error"]="Pop信封数达到一次Pop信封数限制";this["Pop_Not_Setting"]="Pop帐号没有设置";this["Checkinfo_BlankQuestionOrAnswer"]="值不能为空";this["Warn_Birthday_Or_Answer_Error"]="生日或者提示问题答错了";this["LdapApp_AutoReplyModified"]="自动回复设置已改变";this["Send_ToAddressInvalid"]="收件人地址有误";this["Warn_SetPOP_Duplicate_Item"]="新建的POP帐号已存在";this["AttachF_SelectAFileFirst"]="地址本导入故障，请稍后再试！";this["Warn_MsgCount_Exceed"]="邮箱容量将满,请及时清理";}function HelpCenter(){this.url="http://";var xport ,  pop , search , preference , signature , autoresp;var refuselist , friends , filter , junkfilter , timeset;switch(top.gDomain){case "188.com":this.url+="www.188.com/help/";xport="address09.htm";pop="receive10.htm";search="search02.htm";preference="options10.htm";signature="options11.htm";autoresp="options12.htm";refuselist="options06.htm";friends="options07.htm";filter="options08.htm";junkfilter="spam11.htm";timeset="write23.htm";break;case "126.com":this.url+="www.126.com/help/";xport="address_06.htm";pop="receive_12.htm";search="search_01.htm";preference="option_09.htm";signature="option_10.htm";autoresp="option_11.htm";refuselist="spam_07.htm";friends="spam_08.htm";filter="option_06.htm";junkfilter="spam_10.htm";timeset="write_24.htm";break;case "163.com":this.url+="mail.163.com/help/";xport="help_address_07.htm";pop="help_receive_13.htm";search="help_search_01.htm";preference="help_options_15.htm";signature="help_options_16.htm";autoresp="help_options_17.htm";refuselist="help_spam_07.htm";friends="help_spam_08.htm";filter="help_options_12.htm";junkfilter="help_spam_11.htm";timeset="help_write_26.htm";break;case "yeah.net":case "netease.com":this.url+="mail.163.com/mailhelp/";xport="address.htm#4";pop="options.htm#8";search="find.htm";preference="news.htm#1";signature="options.htm#5";autoresp="options.htm#6";refuselist="antispam.htm#3";friends="antispam.htm#4";filter="antispam.htm#5";junkfilter="antispam.htm#6";timeset="options.htm#7";break;}this["index"]="index.htm";this["address"]="address.htm";this["search"]=search;this["xport"]=xport;this["pop"]=pop;this["preference"]=preference;this["signature"]=signature;this["autoresp"]=autoresp;this["refuselist"]=refuselist;this["friends"]=friends;this["filter"]=filter;this["junkfilter"]=junkfilter;this["timeset"]=timeset;}HelpCenter.prototype.help=function(name){return this.url + this[name];};var HC=new HelpCenter();function fWelcomeOutput(){try{var s , d=CM["folderMain"];try{s=getHTML();}catch (e){s="";}MM["welcome"].div.innerHTML=s;MM.createModule("folderMain");fCheckWeatherIfLoad();fCheckJiFenIfLoad();}catch(e){fDebug("fWelcomeOutput",e.description);}function getHTML(){var i;var gInfo1='';var gInfo2=CM["folderMain"].MsgCntLimit ? '<br><span style="color:#f00">您的邮件总数已经超过'+CM["folderMain"].MsgCntLimit+'封的<a href="http://mail.163.com/help/help_manage_24.htm" target="_blank">总数限制</a>。</span>' : '';var gNewMail=new Array();var gTotal=fGbToMb(d.useTableB[2]);var gNotFreeWidth=100-parseFloat(d.useTableP[1]);var sNotFree="0%";if(gNotFreeWidth!=0&&!isNaN(gNotFreeWidth)){sNotFree=gNotFreeWidth+'%';if(gNotFreeWidth >=95){gInfo1='<br><span style="color:#f00">重要提示：您的存储空间即将用尽。</span>';}}var fHour=function(){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 "晚上好";}};var fFolder=function(){var i , j , t , s='';var sMod;var aFolder=d.folderItems;var iLen=aFolder.length;for(i=j=0; i<iLen; i++){t=aFolder[i];if(t[4]){if(j!=0){s+='，';}j++;sMod=fGetModuleByFid(t[0],t[1]);s+='<a href="javascript:fGoto()" onclick=fGoto("MM.getModule","'+ sMod +'")>'+t[1];s+='(<span class="wel_num" id="wel_new_'+sMod+'">' +t[4]+ '</span>)</a>';}}if(j){s+='　';}s+='[<a href="javascript:fGoto()" onclick=fGoto("MM.getModule","folderMain")>管理文件夹</a>]';return s;};var fGreet=function(){var s='';s=fHour() + '，' + GE.trueName;s='<span class="wel_w fbold">' + s + '</span>';if(GE.domain=="188.com"){s+='&nbsp;[<a href="javascript:fGoto()" onclick=fGoto("fGetOutLink",gObjUrl.bill)>账户管理</a>，<a href="javascript:fGoto()" onclick="this.href=gObjUrl.pay" target="_blank">我要续费</a>]';}return s;};var sHtml='<div class="WelPagesAll" style="overflow:auto"><div class="WelPages"><div class="Wel_l"><ul class="wel_welcome"><li>'+fGreet()+'</li><span id="wel_jifen"></span></ul><ul class="wel_m_info"><li class="wel_m_i">您有<span class="fbold"><span id="wel_new_count">'+d.newCount+'</span>封<a href="javascript:fGoto()" onclick=fGoto("MM.getModule","unRead")>未读邮件</a></span></li><li>'+fFolder()+'</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:'+ (100-parseInt(sNotFree,10)) +'% 0px ">您使用了'+gTotal+'中的'+sNotFree+'</div></div><div class="wel_weather"><ul id="wel_weather_open"><li class="wel_w_tlte"><b>天气预报</b></li><li class="wel_w_sj"><a href="javascript:fGoto()" onclick=fGoto("fSwitchWeatherShow","show")>显示</a> </li></ul><ul id="wel_weather_close" style="display:none"><li class="wel_w_tlte"><b>天气预报</b></li><li class="wel_w_sj"><a href="javascript:fGoto()" onclick=fGoto("fSwitchWeatherShow","hide")>隐藏</a> </li></ul><iframe class="wel_w_if" id="wel_rit_weather" src="" scrolling="no" frameborder="0" style="display:none"></iframe></div><div class="wel_ad">'+fGetWelAdHTML()+'</div></div><div class="wel_clear">&nbsp;</div></div></div>';sHtml+=fGetBottomHTML();return sHtml;}}function fCheckWelcomeIfLoad(){if(MM["welcome"].div.style.display=="none"){MM["welcome"].div.style.display="";}}function fSwitchWeatherShow(flag){var objWeather=gCurDoc.getElementById('wel_rit_weather');var objOpen=gCurDoc.getElementById('wel_weather_open');var objClose=gCurDoc.getElementById('wel_weather_close');if(flag=="show"){objWeather.style.display='';objClose.style.display='';objOpen.style.display='none';}else{objWeather.style.display='none';objClose.style.display='none';objOpen.style.display='';}}function fGetJiFenHTML(){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+='<img align="absmiddle"src="http://mimg.163.com/jsstyle/icon/jifen/jf_star.gif">';}iTemp -=i*16;for(i=0; i<Math.floor(iTemp/4); i++){sGrade+='<img align="absmiddle"src="http://mimg.163.com/jsstyle/icon/jifen/jf_diamond.gif">';}iTemp -=i*4;for(i=0; i<iTemp; i++){sGrade+='<img align="absmiddle"src="http://mimg.163.com/jsstyle/icon/jifen/jf_shell.gif">';}if(iGrade==0){sGrade='<img align="absmiddle"src="http://mimg.163.com/jsstyle/icon/jifen/jf_null.gif">';}sHtml+='<li><a href="'+sUrl+'" target="_blank" style="text-decoration:none" title="您的积分为'+iJiFen+'分">积分：<span class="wel_num">'+iJiFen+'</span></a></li>';sHtml+='<li><a href="'+sUrl+'" target="_blank" style="text-decoration:none" title="您的等级为'+iGrade+'级">等级：'+sGrade+'</a></li>';return sHtml;}function fCheckJiFenIfLoad(){if(GE.domain!="163.com"&&GE.domain!="126.com"){return;}if(GE.jifen_point!=-1){gCurDoc.getElementById('wel_jifen').innerHTML=fGetJiFenHTML();}else{window.setTimeout("fCheckJiFenIfLoad()",500);}}function fCheckWeatherIfLoad(){if(GE.city!=-1){if(GE.city==""){GE.city="55591";}else{fSwitchWeatherShow("show");}var domain=GE.domain.substr(0,3);var weather='http://mimg.' +domain+ '.com/tianqi/city/' + GE.city + '.html';gCurDoc.getElementById('wel_rit_weather').src=weather;}else{window.setTimeout("fCheckWeatherIfLoad()",500);}}