function fDebug(func,error){var sTime=(new Date()).toLocaleString();var doc=window.parent.frames[gDebugFrame].document;var div=doc.createElement("DIV");var info="FUNCTION:" + func + " --- Info:" + error;div.innerHTML=info;doc.getElementsByTagName("BODY")[0].appendChild(div);getAjaxMsg(gDebugInfo + " -- " + protimelist + " -- " + info  + " -- History:" + HM.arrHistory.join(" > "));}function fGetUserAgen(){var userAgent=window.navigator.userAgent;var AppName="";var Version="";if(userAgent.indexOf("MSIE")>-1){AppName="msie";Version=userAgent.replace(/.+MSIE/gi,"").replace(/;.+/gi,"") - 0;}else if(userAgent.toUpperCase().indexOf("FIREFOX")>-1){AppName="firefox";Version=userAgent.replace(/.+Firefox\//gi,"").replace(/\(.*\)/g,"") - 0;}else if(userAgent.toUpperCase().indexOf("NETSCAPE")>-1){AppName="netscape";Version=userAgent.replace(/.+NETSCAPE\//gi,"").replace(/\(.*\)/g,"") - 0;}gAppName=AppName;gVersion=Version;}var gErrorInfo="";function getAjaxMsg(info){var doc=window.parent.frames["debugFrame"].document;if(!doc.getElementById("ifrm")){var div=doc.createElement("DIV");div.innerHTML="<iframe id='ifrm'></iframe>";doc.getElementsByTagName("BODY")[0].appendChild(div);}var ifrm=doc.getElementById("ifrm");if(gErrorInfo!=info){ifrm.src="";ifrm.src="http://jslog.mail.126.com/servlet/jslog?strCmjsLog=" + info;}gErrorInfo=info;}function fParseCookie(varName){var srcCookie=window.document.cookie;if(srcCookie==""){return "";}var nPos=srcCookie.lastIndexOf(varName+"=");if(nPos>0){	if(nPos>=2){nPos=srcCookie.indexOf("; "+varName+"=",nPos-2);}else{nPos=srcCookie.indexOf("; "+varName+"=");}}if(nPos>=0){	nPos=srcCookie.indexOf('=',nPos)+1;var nTailPos=srcCookie.indexOf("; ",nPos);if(nTailPos>0){return srcCookie.substring(nPos,nTailPos);}else{return srcCookie.substr(nPos);}}return "";}function fUpdateCookie(sName,sValue){var sCookie="";var date=new Date(2099,12,31);sCookie=sName+'='+sValue+";expires=" + date.toGMTString();window.document.cookie=sCookie ;}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g, "");};String.prototype.ltrim=function(){return this.replace(/(^\s*)/g, "");};String.prototype.rtrim=function(){return this.replace(/(\s*$)/g, "");};String.prototype.cleanBlank=function(){return this.replace( /\s/g, "");};String.prototype.checkSpecialChar=function(flag){var reg=/[%\'\"\/\\]/;if( this.search( reg )!=-1){if(flag){alert( "请不要输入 ＂ % \' \" \\ \/ ＂ 等特殊字符。");}return false;}return true;};String.prototype.len=function(){var len=0;for (var i=0;i<this.length;i++){if (this.charCodeAt(i)>255){len+=2;}else{len++;}}return len;};String.prototype.html=function(){var html=this;html=html.replace( /</g,"&lt;");html=html.replace( />/g,"&gt;");return html;};String.prototype.left=function(len){var i=0;var j=0;if(this.len()<=len){return this;}while(j<len){if(this.charCodeAt(i)>255){j+=2;}else{j ++;}i ++;}return this.substring(0,i) + "..";};Date.prototype.dateAdd=function(n){return new Date(this.valueOf()+n*3600*24*1000);};function checkNoNamePart( str ){str.toLowerCase();str.replace(/\s/gi, "");if (str.search("@") < 0){return "";}return str;}function parseSingleEmail( strEmail ){strEmail.replace(/\s/gi, "");var pos1=strEmail.lastIndexOf("<");var pos2=strEmail.lastIndexOf(">");if (pos1>=0&&pos2>=0&&pos2>pos1){var NoNamePart=strEmail.substring(pos1, pos2);return checkNoNamePart(NoNamePart);}else{if (pos1>=0||pos2>=0){return "";}else{return checkNoNamePart(strEmail);}}return "";}function fConvertChar(s){s=s.replace(/&amp;/gi,"&");s=s.replace(/&lt;/gi,"<");s=s.replace(/&gt;/gi,">");s=s.replace(/&quot;/gi,"\"");return s;}function fConvertToURL(s){s=s.replace(/</gi,"&lt;");s=s.replace(/>/gi,"&gt;");s=s.replace(/\"/gi,"&quot;");s=s.replace(/&/gi,"&amp;");return s;}function fFixStr(str , n){var i,j;var s="";var len=str.length;for(i=0,j=1 ; i<len ; i++,j++){if(str.charCodeAt(i)>255){j++;}if( j>n ){break;}s+=str.charAt(i);}return s;}function fReplaceQuot(src){var re;var s="";re=/&quot;/g;s=src.replace(re, "");return s;}function fCheckDate(sDate){var arr=sDate.split("-");var d=new Date(arr[0],arr[1]-1,arr[2]);if(d.getFullYear()!=arr[0]||(d.getMonth()+1)!=parseInt(arr[1],10)||d.getDate()!=parseInt(arr[2],10)){return false;}return true;}window.onerror=fnErrorTrap;function fnErrorTrap(sMsg,sUrl,sLine){try{var info="";info+="Error: " + sMsg;info+=" > Line: " + sLine;fDebug("window.onerror",info);return true;}catch(e){};}function fInsertElement(dest,obj,place){try{var parent=dest.parentNode;var len=parent.childNodes.length;var pos=-1;for(var i=0;i<len;i++){if(parent.childNodes[i]==dest){pos=i;}}if(place=="beforeEnd"){dest.appendChild(obj);}else if(place=="afterEnd"){if(pos==len-1){parent.appendChild(obj);}else{parent.insertBefore(obj,parent.childNodes[pos+1]);}}else if(place=="beforeBegin"){dest.insertBefore(obj);}else if(place=="afterBegin"){if(dest.childNodes.length==0){dest.appendChild(obj);}else{dest.insertBefore(obj,dest.childNodes[0]);}}}catch(exp){fDebug("fInsertElement",exp.description);}}function fNextSibling(obj){try{var parent=obj.parentNode;var childs=parent.childNodes;for(var i=0;i<childs.length;i++){if(childs[i]==obj){if(i==childs.length-1){return null;}else{return childs[i+1];}}}}catch(exp){fDebug("fNextSibling",exp.description);}}function fPreSibling(obj){try{var parent=obj.parentNode;var childs=parent.childNodes;for(var i=0;i<childs.length;i++){if(childs[i]==obj){if(i==0){return null;}else{return childs[i-1];}}}}catch(exp){fDebug("fPreSibling",exp.description);}}function fGetObjById(obj,id){try{var objList=fGetAllObj(obj);var arr=new Array();for(var i=0;i<objList.length;i++){if(objList[i].nodeType==1){if(objList[i].id==id){arr[arr.length]=objList[i];}}}return arr;}catch(exp){fDebug("fGetObjById",exp.description);}}function fGetAllObj(obj){var objList=new Array();var childs=obj.childNodes;for(var i=0;i<childs.length;i++){objList[objList.length]=childs[i];objList=objList.concat(fGetAllObj(childs[i]));}return objList;}MM.folderMain.outputHTML=fFoldMainOutputContent;MM.unRead.outputHTML=fMailBoxOutputContent;MM.inbox.outputHTML=fMailBoxOutputContent;MM.draft.outputHTML=fMailBoxOutputContent;MM.sended.outputHTML=fMailBoxOutputContent;MM.deleted.outputHTML=fMailBoxOutputContent;MM.read.outputHTML=fReadOutputContent;MM.compose.outputHTML=fComposeOutputContent;MM.outLink.outputHTML=fOutLinkOutputContent;MM.searchMail.outputHTML=fSeachMailOutput;MM.assist.outputHTML=fAssistOutput;MM.welcome.outputHTML=fWelcomeOutput;