var IE=(navigator.appName=="Microsoft Internet Explorer")?1:0;var safari=(navigator.userAgent.match(/safari/i))?1:0;var sel1="#D3D3D3";var sel2="#FFFBDD";var sel3="#FFF9BB";var row1="#F9F9F9";var new1="#DDEEDD";var colorS="#0033FF";var colorU="#003366";var helpTxt={};var mons3=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];function setLevel(){return(top.window.folderView||!top.opener)?top.window:top.opener.window}function setInvisHere(fid){setLevel().checkWorking();if(fid)setTimeout('parent.remFrame('+fid+')',1000)}function remFrame(fid){var delf=document.getElementById('engine'+fid);if(delf){if(!safari)document.body.removeChild(delf);delf=null}}function comNum(num){num=num+'';var seps=parseInt((num.length-1)/3);var rem=num.length % 3;for(var j=seps;j>0;j--){num=num.substr(0,num.length-(3*j))+','+num.substr(num.length-(3*j))}return num}var mouseD,mdOffset;function showMouseTop(html,e,el,moffset){mouseD=top.gid('mouseDiv');resMD();mdOffset=moffset?moffset:0;mouseD.innerHTML=html;moveMDtop(e);mouseD.style.visibility="visible";document.onmousemove=moveMDtop;document.onmouseout=hideMD;document.onmousedown=hideMD}var showMouseTimer,hideMouseTimer;function showMouseDiv(html,e,soon){if(top.whDrag)return;clearTimeout(showMouseTimer);clearTimeout(hideMouseTimer);mouseD=gid('mouseDiv');if(!mouseD){mouseD=document.createElement('DIV');mouseD.id="mouseDiv";mouseD.className='divcss';mouseD.style.zIndex=250;document.body.appendChild(mouseD)}if(mouseD.innerHTML==html){return}resMD();mouseD.innerHTML=html;if(mouseD.offsetWidth>250)mouseD.style.width="250px";positionDiv(e,mouseD);if(soon){showMouseTimer=setTimeout('gid("mouseDiv").style.visibility="visible"',750);hideMouseTimer=setTimeout('hideMD()',3750)}else mouseD.style.visibility="visible";document.onmousemove=positionDiv;document.onmouseout=hideMD;document.onmousedown=hideMD}function hideMD(){clearTimeout(hideMouseTimer);clearTimeout(showMouseTimer);mouseD.style.visibility="hidden";mouseD.innerHTML="";document.onmousemove=null;document.onmouseout=null;document.onmousedown=null}function resMD(){mouseD.style.width=null;mouseD.style.left=null;mouseD.style.margin=0}function positionDiv(e,el){e=e?e:window.event;el=el?el:mouseD;var scroll=getScroll();var elt=e.clientY+scroll.y+15;if((elt+el.offsetHeight)>(getFrameHeight()+scroll.y))elt=e.clientY+scroll.y-el.offsetHeight-5;el.style.top=elt+'px';var ell=e.clientX+scroll.x+15;getDw();if((ell+el.offsetWidth+5)>(dw+0))ell=e.clientX+scroll.x-el.offsetWidth-5;el.style.left=ell+'px'}function moveMDtop(e){e=e?e:window.event;var scroll=top.getScroll();var mouseDTop=mdOffset+e.clientY+scroll.y+15;if((mouseDTop+mouseD.offsetHeight)>(top.getFrameHeight()+scroll.y))mouseDTop=mdOffset+e.clientY+scroll.y-mouseD.offsetHeight-5;mouseD.style.top=mouseDTop+'px';var mouseDLeft=e.clientX+scroll.x+15;getDw();if((mouseDLeft+mouseD.offsetWidth+5)>(top.dw+25))mouseDLeft=e.clientX+scroll.x-mouseD.offsetWidth-5;mouseD.style.left=mouseDLeft+'px'}function subEngine(subForm,engdebug){var tec=setLevel().engineSet();var newframe=document.createElement('iframe');newframe.name='engine'+tec;newframe.id=newframe.name;newframe.className='engClass';newframe.setAttribute("src", setLevel().imgURL+"/blank.html");document.body.appendChild(newframe);if(IE)newframe.outerHTML="<iframe id='"+newframe.name+"' src='"+setLevel().imgURL+"/blank.html' name='"+newframe.name+"' class='engClass'></iframe>";subForm.target=engdebug?"_blank":newframe.name;subForm.frameId.value=tec;subForm.submit()}function addJs(){return "<script language='JavaScript' src='"+setLevel().imgURL+"/atp.000.js' type='text/javascript'></script>"}function addCss(){return "<link rel='stylesheet' type='text/css' href='"+setLevel().imgURL+"/atp.000.css' />"}function makeSound(thisSound){if(setLevel().no_alert_sound)return "";thisSound=thisSound?thisSound:alertSound;if(navigator.appName=="Microsoft Internet Explorer")return "<BGSOUND SRC='"+thisSound+"'>";else{return "<EMBED SRC='"+thisSound+"' AUTOSTART=TRUE hidden=true volume='100%'>"}}var dw;function getDw(){dw=document.width?document.width:document.documentElement.offsetWidth-25}function setw(eName, width){if(!document.getElementById(eName)){alert(eName);return}document.getElementById(eName).style.width=width+'px'}function getScreenW(){return self.innerWidth?self.innerWidth:document.body.offsetWidth}function setWinH(mainName){fixWinPos();var winH=self.innerHeight?self.innerHeight:document.body.offsetHeight;var tabH=gid(mainName).offsetHeight;if(tabH>(.75 * screen.height))tabH=parseInt(.75 * screen.height);if(tabH<250)tabH=250;var diff=tabH-winH+4;self.resizeBy(0,diff);}function fixWinPos(){var yDiff=screen.height-(getScreenY()+getFrameHeight())-20;var yPos=getScreenY()+yDiff;if((yDiff<0)&&(yPos>0))self.moveBy(0,yDiff);var winDiff=screen.width-(getScreenX()+getScreenW())-20;var xPos=getScreenX()+winDiff;if(winDiff<0&&xPos>0){self.moveBy(winDiff,0)}}function selRowPop(e){e=e?e:window.event;var cell=e.target?e.target:e.srcElement;while(cell.tagName!='TD'){if(cell.parentNode){cell=cell.parentNode}else return}var row=cell.parentNode;if(!row.id)return;if(cell.className=='emailCell'){emailMO(cell)}else if(cell.className=='subjCell'){selMO(cell)}if(row.id!=top.window.realCurr)row.style.backgroundColor=sel1;row.onmouseout=function(){if(dragPop==row){setPopRow(row);row.chk=1;pointArrow();clearTextSel();top.startDragPop()}colPop(row);dragPop=0}}function clearTextSel(){if(IE)document.selection.empty();else getSelection().removeAllRanges()}function setPopRow(row){row.chk=1;row.getElementsByTagName('INPUT')[0].checked=1}function selRow(e,match){var e=e?e:window.event;var el=e.target?e.target:e.srcElement;while(el.tagName!='TD')el=el.parentNode;row=el;while(row.tagName!='TR')row=row.parentNode;if(!row.id)return;if(row.id==match)return;var rs=row.style;rs.backgroundColor=sel1;if(el.id=='X')rs.color=colorS;row.onmouseout=function(){row.onmouseout=null;rs.backgroundColor="";rs.color=""}}function selMO(el){el.style.color=colorS;el.onmouseout=function(){el.style.color=colorU}}function emailMO(el){var row=el.parentNode;while(row.tagName!='TR')row=row.parentNode;var email=row.getElementsByTagName('TD')[0].id;window.status=email;el.style.color=colorS;el.onmouseout=function(){window.status='';el.style.color=colorU}}function genericRow(){var cells=new Array();for(i=0;i<6;i++){cells[i]=document.createElement('TD')}cells[0].innerHTML='1';cells[0].style.textAlign="center";cells[2].className="emailCell";cells[3].className="popCellL";cells[4].className="subjCell";cells[5].className="popCellR";genRow=document.createElement('TR');for(i=0;i<6;i++){genRow.appendChild(cells[i])}genRow.style.cursor="default"}function addHelpDiv(hname,htext){var hdiv=document.createElement('DIV');hdiv.id='popup'+hname;hdiv.className='divcss';hdiv.innerHTML=htext;document.body.appendChild(hdiv)}function addNewMail(folder,MID,email,bg,d1,d2,d3,d4,d5){var pf=top.document.popForm1;if(folder!=pf.folder.value)return;if(pf.msg_start.value>1){pf.msg_start.value++;top.fixMsgNums();return}read=0;newRow=genRow.cloneNode(true);newRow.id=MID;newRow.className=read?"row1":"new1";cells=newRow.getElementsByTagName('TD');cells[0].id=email;cells[1].innerHTML=d1;cells[1].style.backgroundColor=bg;cells[1].id=read;cells[2].innerHTML=d2;cells[3].innerHTML=d3;cells[4].innerHTML=d4;if(!read)cells[4].style.fontWeight="bold";cells[5].innerHTML=d5;var rows=document.getElementById('folderTable').getElementsByTagName('TR');var firstRow=rows[0];var firstMsg=rows[1];var table=firstRow.parentNode;if(firstMsg){table.insertBefore(newRow,firstMsg)}else table.appendChild(newRow)}var dragPop;function emailMD(e){e=e?e:event;var elOrig=e.target?e.target:e.srcElement;el=elOrig;while(el.tagName!='TD')el=el.parentNode;var row=el.parentNode;if(!row.id)return;cells=row.getElementsByTagName('TD');var email=cells[0].id;whichBut=e.which?e.which:e.button;if(e.shiftKey)whichBut=2;if(whichBut==1){dragPop=row;el.onmouseup=function(){dragPop=0}}if(setLevel().selFolName=="Drafts")return;if(whichBut!=1){el.oncontextmenu=new Function("return false");el.onmouseup=function(){el.onmouseup=null;contextMenu(e,row.id,email)};el.onmouseout=function(){el.onmouseup=null}}}function colPop(row){if(row.id==top.window.realCurr)return;row.style.backgroundColor=row.chk?sel2:""}function Chk_all(val){pForm=top.window.folderView.document.popForm;if(!pForm.MID){pForm.chkItAll.checked=0;return}var rows=top.window.folderView.document.getElementById('folderTable').getElementsByTagName('TR');for(i=0;i<rows.length;i++){if(!rows[i].id)continue;rows[i].getElementsByTagName('INPUT')[0].checked=val;rows[i].chk=val;colPop(rows[i])}pointArrow()}function popClick(e){var elOrig=e.target?e.target:e.srcElement;if(elOrig.tagName=='IMG')return;el=elOrig;while(el.tagName!='TD'){if(!el.parentNode){return};el=el.parentNode}var row=el.parentNode;if(!row.id)return;var dcl=(e.type=='dblclick')?1:0;if(elOrig.tagName=='INPUT'){if(dcl)return;row.chk=elOrig.checked;pointArrow();colPop(row);return}if(setLevel().selFolName=="Drafts"){var did=row.id.replace('draft','');setLevel().Compose(0,0,0,0,"GetDraft",did);return}cells=row.getElementsByTagName('TD');var email=cells[0].id;if(el.className=='emailCell'){if(dcl)return;GlobalCompose(email)}else if(el.className=='subjCell'){readMess((e.ctrlKey?">":"")+row.id,dcl)}}function sizeFrame(ifn){var ifWin=eval(ifn);var ifh=(IE?ifWin.document.body.scrollHeight:ifWin.document.body.offsetHeight)+20;var newH=(ifh>400)?400:ifh;if(newH<50)newH=50;document.getElementById(ifn).style.height=newH+'px'}function GlobalCompose(to,cc,bcc){to=to?to:'';cc=cc?cc:'';bcc=bcc?bcc:'';setLevel().Compose(to,cc,bcc)}var hideCntxTimer;function contextMenu(e,MID,email){hideCntx();top.cntxMID=MID;top.cntxEmail=email;var justEmail=email.match(/[\w.+-]+@[\w.-]+/)[0];var emailEsc=email.replace(/>/g,'&gt;');emailEsc=emailEsc.replace(/</g,'&lt;');var d=top.document.getElementById('cntxTab');d.getElementsByTagName('TD')[0].innerHTML="Email:"+emailEsc;top.gid('cntxNr').innerHTML=(setLevel().checkNeedRe(MID)?"Remove Needs Response":"Needs Response");top.gid('cntxAb').innerHTML=(setLevel().email2id(justEmail))?"Edit Contact Info":((setLevel().selFolName=="Unverified Folder")?"Verify Sender":"Add Contact");var cw=d.offsetWidth;var ch=d.offsetHeight;var frameWidth=top.getFrameWidth();var maxX=frameWidth-cw-20;var popl=elLeft(top.gid('popFrame'));if((e.clientX+popl)>maxX){var dsl=e.clientX+popl-cw; d.style.left=((dsl<40)?40:dsl)+"px";}else d.style.left=e.clientX+popl+"px";var frameHeight=top.window.getFrameHeight();var maxY=getFrameHeight-ch-20;if(e.clientY>maxY){d.style.top=maxY+2+"px"}else d.style.top=e.clientY+2+"px";setTimeout('top.document.getElementById("cntxTab").style.visibility="visible"',1);sf=top.window.document.getElementById('storeFoc');sf.focus();sf.onblur=function(){hideCntxTimer=setTimeout('hideCntx()',200)}}function hideCntx(){clearTimeout(hideCntxTimer);top.window.document.getElementById('storeFoc').onblur=null;top.document.getElementById("cntxTab").style.visibility="hidden"}function getFrameHeight(){return self.innerHeight?self.innerHeight:document.body.offsetHeight-4}function getFrameWidth(){var frameWidth;if(self.innerWidth){frameWidth=self.innerWidth}else if(document.documentElement&&document.documentElement.clientWidth){frameWidth=document.documentElement.clientWidth}else if(document.body){frameWidth=document.body.clientWidth}return frameWidth}function calMO(e){var el=e.target?e.target:e.srcElement;while(el.tagName!='TD')el=el.parentNode;date=el.id;if(!date)return;el._oldBg=el.style.backgroundColor;el.style.backgroundColor="#FFFFFF";if(document.getElementById('popup'+date)){showPosPop(e,date);el.onmouseout=function(){el.style.backgroundColor=el._oldBg;document.getElementById('popup'+date).style.visibility='hidden'}}else{el.onmouseout=function(){el.style.backgroundColor=el._oldBg}}}function elLeft(eElement){var nLeftPos=eElement.offsetLeft;var eParElement=eElement.offsetParent;while(eParElement!=null){nLeftPos+=eParElement.offsetLeft;eParElement=eParElement.offsetParent}return nLeftPos}function gid(el){return document.getElementById(el)}function elTop(eElement){if(!eElement&&this){eElement=this}var nTopPos=eElement.offsetTop;var eParElement=eElement.offsetParent;while(eParElement!=null){nTopPos+=eParElement.offsetTop;eParElement=eParElement.offsetParent}return nTopPos}function getScroll(){if(window.pageYOffset||window.pageYOffset==0)return{x:window.pageXOffset, y:window.pageYOffset};if(document.body.scrollTop!=undefined){var ieBox=document.compatMode!="CSS1Compat";var cont=ieBox?document.body:document.documentElement;return{x:cont.scrollLeft, y:cont.scrollTop}}else{return{x:window.pageXOffset, y:window.pageYOffset}}}function hideIt(el){document.getElementById('popup'+el.name).style.visibility='hidden';el.onblur=null;el.onmouseout=null}function DetailDiv(e){e=e?e:window.event;var el=e.target?e.target:e.srcElement;if(e.type=='click'){while(el.tagName!="A")el=el.parentNode;el.onblur=function(){hideIt(el)}}else{while(el.tagName!="IMG"&&el.tagName!="DIV")el=el.parentNode;el.onmouseout=function(){hideIt(el)}}var index=el.name;showPosPop(e,index)}function showPosPop(e,index){var scroll=getScroll();var thisdiv=document.getElementById('popup'+index);if(thisdiv.offsetWidth>300)thisdiv.style.width=300;getDw();if(e.clientX>dw-thisdiv.offsetWidth){thisdiv.style.left=dw-thisdiv.offsetWidth+scroll.x+"px"}else thisdiv.style.left=e.clientX-2+scroll.x+"px";thisdiv.style.top=e.clientY+25+scroll.y+"px";thisdiv.style.visibility="visible"}function Void(){return}function jsWinCal(calhead){var calW=window.open("","cal","height=200,width=330,left=200,top=200,scrollbars=no,resizable=yes");}function WinCal(calHead){window.open("calendar.cgi?calHead="+calHead,"cal","height=200,width=330,left=200,top=200,scrollbars=no,resizable=yes")}function viewOther(){vo=prompt('Enter the ATPmail user name to view.','');if(vo==''||vo==null){return}winTaskOther2(vo)}function copyTask(index){if(!confirm('Click OK to copy task to your calendar.')){return}subTask("copyTask",index)}var tabs=["home","work"];function addrTab(which){for(var i=0;i<tabs.length;i++){gid(tabs[i]+'Div').style.visibility="hidden";gid(tabs[i]+'Tab').style.borderColor="#BBBBBB";gid(tabs[i]+'Tab').style.color="#DDDDDD"}gid(which+'Div').style.visibility="visible";gid(which+'Tab').style.borderColor="#FFFFFF";gid(which+'Tab').style.color="#FFFFFF"}function setAbSort(wh){top.perSort(wh)}function divPop(e,el){el.name=el.className;el.onmouseout=function(){hideIt(el)};showPosPop(e,el.className)}var aeAct=[];aeAct["vc"]="View Contact Info";aeAct["ec1"]="Edit Contact";aeAct["ec2"]="Edit Contact";aeAct["ec3"]="Edit Global Contact";aeAct["rc"]="Delete Contact";aeAct["eg"]="Edit Group";aeAct["ng"]="Edit Global Group";aeAct["vg"]="View Group Entries";aeAct["rg"]="Delete Group";aeAct["atg"]="Add To Group";function selAddrRow(e){var el=e.target?e.target:e.srcElement;if(el.tagName=="DIV"&&aeAct[el.className]){abFrame.showMouseDiv(aeAct[el.className],e,1);}while(el.tagName!='TD'){if(!el.parentNode)return;el=el.parentNode}row=el;while(row.tagName!='TR')row=row.parentNode;if(!row.id)return;var rs=row.style;rs.backgroundColor=sel1;if(el.id=='X')rs.color=colorS;row.onmouseout=function(){rs.backgroundColor=row.chk?sel2:"";rs.color=colorU}}function addrAct(e,dbl){var el=e.target?e.target:e.srcElement;ecl=dbl?"":el.className;row=el.parentNode;while(row.tagName!='TR'){if(!row.parentNode)return;row=row.parentNode}if(!row.id)return;if(el.tagName=='INPUT'){var cbs=row.getElementsByTagName('INPUT');for(i=0;i<cbs.length;i++){if(cbs[i]!=el)cbs[i].checked=0}markRow(row);return}contId=row.id;cells=row.getElementsByTagName('TD');if(ecl=='vc'){var tab=setLevel().globAbObj[row.id];showContactCard(tab,e)}else if(ecl=='vg'){fillButts(2,row.id)}else if(ecl=='rc'){delCont(row.id)}else if(ecl=='ec1'||ecl=='ec2'){fillButts(1,row.id)}else if(ecl=='ec3'){cEditNn(row.id)}else if(ecl=='eg'){fillButts(2,row.id)}else if(ecl=='rg'){remGroup(contId)}else if(ecl=='atg'){addToGroup(row.id)}else if(ecl=='ng'){fillButts(2,row.id);}else{while(el.tagName!='TD'){if(!el.parentNode)return;el=el.parentNode}if(el.id=='X'){if(dbl){if(globalOn)return;var gl=row.id.match(/^g/);var gr=setLevel().groupObj[row.id]?1:0;if(!gl&&!gr)fillButts(1,row.id);else if(gl&&!gr)cEditNn(row.id);else if(gr)fillButts(2,row.id);return}var cbs=row.getElementsByTagName('INPUT');if(cbs[0].checked){cbs[0].checked=0; cbs[1].checked=1;}else if(cbs[1].checked){cbs[1].checked=0; cbs[2].checked=1;}else if(cbs[2].checked){cbs[2].checked=0;}else cbs[0].checked=1;markRow(row)}}}function cEditNn(abid){var nn=setLevel().abObj[abid][0];var nnn=prompt('This is a global contact.\nEnter the new nick name.',nn);if(!nnn||nn==nnn)return;abf=abFrame.document.abForm;abf.GOTO.value="editGlobalContact";abf.abId.value=abid;abf.abVal.value=nnn;subEngine(abf)}function markRow(el){row=el;while(row.tagName!='TR')row=row.parentNode;var cbs=row.getElementsByTagName('INPUT');row.chk=0;for(var i=0;i<cbs.length;i++){if(cbs[i].checked)row.chk=i+1}var rs=row.style;rs.backgroundColor=row.chk?sel2:""}function SetCheckedAddr(globalOn){var rows=abFrame.gid('abDataDiv').getElementsByTagName('TR');var to='';var cc='';var bcc='';for(i=0;i<rows.length;i++){if(rows[i].chk){var abid=rows[i].id;var email=setLevel().emailFl(abid,globalOn);if(!email)continue;if(rows[i].chk==1){to+=', '+email}else if(rows[i].chk==2){cc+=', '+email}else if(rows[i].chk==3)bcc+=', '+email}}return{to:to,cc:cc,bcc:bcc}}function AddrCompose(globalOn){chkd=SetCheckedAddr(globalOn);var to=chkd.to;var cc=chkd.cc;var bcc=chkd.bcc;cwin=setLevel().checkCompAddr();if(cwin){oForm=cwin.document.compForm;if(oForm.to.value==''){to=to.substring(2, to.length)}oForm.to.value+=to;if(cc){if(!cwin.gid('ccRow'))cwin.addcc();if(oForm.cc.value==''){cc=cc.substring(2, cc.length)}oForm.cc.value+=cc}if(bcc){if(!cwin.gid('bccRow'))cwin.addbcc();if(oForm.bcc.value==''){bcc=bcc.substring(2, bcc.length)}oForm.bcc.value+=bcc}cwin.focus();selAllAb(0);return}if(to)to=to.substring(2, to.length);if(cc)cc=cc.substring(2, cc.length);if(bcc)bcc=bcc.substring(2, bcc.length);GlobalCompose(to,cc,bcc);selAllAb(0)}function changeNn(index,nn){clearSearch();addrSearch('',0);var row=top.window.addrBodyView.document.getElementById(index);var cells=row.getElementsByTagName('TD');if(cells[0].id)cells[0].id=nn;cells[3].innerHTML=nn}function copyLocal(){var chkdAddr=CheckAddrSel(1);if(!chkdAddr)return;abf=abFrame.document.abForm;abf.GOTO.value="copyLocal";abf.abId.value=chkdAddr;subEngine(abf);selAllAb(0)}function CheckAddrSel(all){var something='';var rows=abFrame.gid(all?'abDataDiv':'abList').getElementsByTagName('TR');for(i=0;i<rows.length;i++){if(rows[i].chk)something+=','+rows[i].id}if(!something){alert('No contacts selected.')}something=something.replace(/^,/,'');return something}function DelContacts(){var chkdAddr=CheckAddrSel();if(!chkdAddr)return;chkArr=chkdAddr.split(',');var nums=chkArr.length;var plural=(nums==1)?'':'s';if(!confirm('You are about to delete '+nums+' contact'+plural+'.'))return;abf=abFrame.document.abForm;abf.GOTO.value="delContacts";abf.abId.value=chkdAddr;subEngine(abf);for(i=0;i<chkArr.length;i++){var index=chkArr[i];delete setLevel().abObj[index]}abBegin(1)}function goOpts(){var pf=document.prefForm;var optSel=pf.optMenu;var GOTO=optSel.options[optSel.selectedIndex].value;pf.GOTO.value=GOTO;pf.submit()}function switchCompView(which){if(which){document.body.style.overflowY="hidden";document.getElementById('compDiv').style.visibility='hidden';document.getElementById('spellFrame').style.visibility='visible';document.getElementById('spellFrame').style.left='0px';spellFrame.focus()}else{document.body.style.overflowY="auto";document.getElementById('compDiv').style.visibility='visible';document.getElementById('spellFrame').style.visibility='hidden';document.getElementById('spellFrame').style.left='-2000px'}}function checkSpell(){copyBody();var sf=document.spellForm;sf.spellSubj.value=cf.subject.value;sf.spellBody.value=cf.compBody.value;sf.submit()}function SubDraft(which){dsel=cf.draftSel;if(dsel.options[dsel.selectedIndex].value==""){alert('No draft selected.');return}if(which==1){cf.GOTO.value='GetDraft'}else{cf.GOTO.value='DelDraft'}bodyUnc();cf.submit()}function SendMail(){if(cf.submitted.value==1){}if(cf.to.value==''&&(!cf.cc||cf.cc.value=='')&&(!cf.bcc||cf.bcc.value=='')){alert('You have not listed anyone to send this to.');cf.to.focus();return}if(cf.subject.value==''){if(!confirm('You have no Subject. Do you want to continue?')){cf.subject.focus();return}}if(!mainClosed){savePosNow("com")}cf.submitted.value=1;bodyUnc();subEngine(cf);cf.target='';Send_msg()}function End_send_msg(){var sm=gid('sendMsg');vis(sm,0);clearInterval(smi)}var smi;function Send_msg(){var sm=gid('sendMsg');var html="";if(addFileCnt)html+="Uploading File and ";html+="Sending Mail<br>";sm.innerHTML=html;vis(sm,1);smi=setInterval('gid("sendMsg").innerHTML+=". "',500)}function AddSig(){acc=cf.account;account=acc.options[acc.selectedIndex].value;sig=Sigs[account];if(sig==''){alert('no signature for that account');return}if(cf.rtf_mode.value){bDoc().body.innerHTML=sig+bDoc().body.innerHTML}else{cf.compBody.value=sig+cf.compBody.value;cf.compBody.focus()}}function fixSig(){if(bodyC())return;var accId=cf.account.value;if(!accId)return;cf.compBody.value=preSig+Sigs[accId]+origBody;copyForm();bodyUnc();}function NewFile(){cf.GOTO.value='NewFile';cf.submitted.value=1;bodyUnc();cf.submit()}function AddAttach(filename){as=cf.attachments;al=as.length;if(as.options[0].value==''){as.options[0].value=filename;as.options[0].text=filename}else{as.options[al]=new Option(filename)}cf.attach_list.value=cf.attach_list.value+filename+',';return 1}function ClearAttach(){as=cf.attachments;al=as.length;for(i=al-1;i>0;i--){as.options[i]=null}as.options[0].value='';as.options[0].text='-Click to attach saved file -';cf.attach_list.value=''}function startNew(){return(confirm('Start a new message?'))}function getScreenX(){return window.screenX?window.screenX:window.screenLeft}function getScreenY(){return window.screenY?window.screenY:window.screenTop}function fillComp(e){var row=e.target?e.target:e.srcElement;while(row.tagName!='TR')row=row.parentNode;var abid=row.id;var email=setLevel().emailFl(abid);if(!email)return;var cf=document.compForm;var thisfield=cf[storeField];if(thisfield.value!='')email=', '+email;thisfield.value=thisfield.value+email;}var storeField;function srchAB(field){var nc=prompt("Enter a partial email address or name to search for.","");if(!nc)return;var matches=setLevel().compSearch(nc);var found=matches.length;if(!found){alert('No matches found.');return}if(found>75){alert('Found '+found+' match. Please limit your search.');return}storeField=field;var html="<html><head><title>Address Book Search</title>"+addCss()+"</head><body><table cellspacing=0 cellpadding=2 width='100%' onMouseOver='opener.selRow(event)' onClick='opener.fillComp(event);if(!event.ctrlKey)window.close()'><tr><td class='col3' align=center>Click on email to add:<br>hold control-key to add multiple</td></tr>";for(var i in matches){var abid=matches[i];var em=setLevel().emailFl(abid);em=em.replace(/</g,'&lt;');html+="<tr id='"+abid+"' class='row1'><td nowrap class='clickCell'>"+em+"</td></tr>"}html+="</table></body></html>";var posx=getScreenX()+50;var posy=getScreenY()+170;var csw=window.open("","compSrch","left="+posx+",top="+posy+",width=300,height=300,scrollbars=yes,resizable=yes");csw.focus();var cd=csw.document;cd.open();cd.writeln(html);cd.close()}function compClose(){if(cf.compBodyBack.value)cf.compBody.value=cf.compBodyBack.value;if(!bodyC()||mainClosed)return;var sdf=setLevel().document.savedraftForm;for(var i=0;i<sdf.elements.length;i++){var en=sdf.elements[i].name;if(en=='frameId'||en=='GOTO')continue;var cfe=eval('cf.'+en);sdf.elements[i].value=cfe?cfe.value:""}setLevel().compSave()}function htmlIfy(tmp){tmp=tmp?tmp:'';tmp=tmp.replace(/</g,'&lt;');tmp=tmp.replace(/\n/g,'<br>');tmp=tmp.replace(/(https?:([^\s"')(<>])+\w)/g,"<a href='$1' target='_blank'>$1</a>");return tmp}function fixCompW(){var dw2=self.innerWidth?self.innerWidth:document.body.offsetWidth;toEl=document.getElementById('to');var fw=dw2-125;setw('to',fw);setw('subject',fw);setw('compBody',fw+10);nw=(fw-50)/2;setw('cc',nw);setw('bcc',nw)}function compLogOut(){if(cf.compBody){SubmitIt("compLogOut")}}var colArr=[['000000','111111','2d2d2d','434343','5b5b5b','737373','8b8b8b','a2a2a2','b9b9b9','d0d0d0','e6e6e6','ffffff'],['7f7f00','bfbf00','ffff00','ffff40','ffff80','ffffbf','525330','898a49','aea945','c3be71','e0dcaa','fcfae1'],['407f00','60bf00','80ff00','a0ff40','c0ff80','dfffbf','3b5738','668f5a','7f9757','8a9b55','b7c296','e6ebd5'],['007f40','00bf60','00ff80','40ffa0','80ffc0','bfffdf','033d21','438059','7fa37c','8dae94','acc6b5','ddebe2'],['007f7f','00bfbf','00ffff','40ffff','80ffff','bfffff','033d3d','347d7e','609a9f','96bdc4','b5d1d7','e2f1f4'],['00407f','0060bf','0080ff','40a0ff','80c0ff','bfdfff','1b2c48','385376','57708f','7792ac','a8bed1','deebf6'],['00007f','0000bf','0000ff','4040ff','8080ff','bfbfff','212143','373e68','444f75','585e82','8687a4','d2d1e1'],['40007f','6000bf','8000ff','a040ff','c080ff','dfbfff','302449','54466f','655a7f','726284','9e8fa9','dcd1df'],['7f007f','bf00bf','ff00ff','ff40ff','ff80ff','ffbfff','4a234a','794a72','936386','9d7292','c0a0b6','ecdae5'],['7f003f','bf005f','ff007f','ff409f','ff80bf','ffbfdf','451528','823857','a94a76','bc6f95','d8a5bb','f7dde9'],['800000','c00000','ff0000','ff4040','ff8080','ffc0c0','441415','82393c','aa4d4e','bc6e6e','d8a3a4','f8dddd'],['7f3f00','bf5f00','ff7f00','ff9f40','ffbf80','ffdfbf','482c1b','855a40','b27c51','c49b71','e1c4a8','fdeee0']];var compResizeTO;function compResize(nosave){clearTimeout(compResizeTO);fixCompH();if(nosave!=1){compResizeTO=setTimeout('saveSizeNow("com")',1000)}}function saveSizeNow(name){setLevel().saveWinSize(name,getFrameWidth(),getFrameHeight())}function savePosNow(name){setLevel().saveWinPos(name,getScreenX(),getScreenY())}function fixCompH(){var nowH=getFrameHeight();var bodyEl=gid('compBody');if(!bodyEl)return;var compH=document.getElementById('compDiv').offsetHeight;var bodyH=bodyEl.offsetHeight;var diff=nowH-(compH-bodyH);if(diff<75)diff=75;bodyEl.style.height=diff+"px"}function viewHTML(tmode){textMode=tmode;if(textMode){putText(bDoc().body.innerHTML)}else{bDoc().body.innerHTML=getText()}}function putText(newTxt){if(IE){bDoc().body.innerText=newTxt}else{var html=document.createTextNode(newTxt);bDoc().body.innerHTML="";bDoc().body.appendChild(html)}}function getText(){if(IE)return bDoc().body.innerText;var html=bDoc().body.ownerDocument.createRange();html.selectNodeContents(bDoc().body);return html.toString()}function noEd(){if(textMode){alert('You must uncheck "View HTML" to use the formatting toolbar.');return 1}}function newLink(){if(noEd())return;var nl=prompt('Enter URL(e.g. http://www.atpmail.com)','http://');if(!nl||nl=='http://')return;bDoc().execCommand('CreateLink',false,nl)}function callFormat(fmt){if(noEd())return;bDoc().execCommand(fmt,false,false);bfoc()}function copyBody(){if(cf.rtf_mode.value){cf.compBody.value=textMode?getText():bDoc().body.innerHTML}}function copyForm(){if(!cf.rtf_mode.value)return;if(textMode){putText(cf.compBody.value);cf.compBody.value=getText()}else{bDoc().body.innerHTML=cf.compBody.value;cf.compBody.value=bDoc().body.innerHTML}}function bodyUnc(){restoreCompBody();bodyChanged=0;copyBody();lastBody=cf.compBody.value}function bodyC(){copyBody();if(bodyChanged)return 1;return(cf.compBody.value!=lastBody)}function initRtf(notnew){bDoc().designMode="On";bDoc().open();bDoc().write("");bDoc().close();if(IE){var imgs=document.getElementsByTagName('IMG');for(i=0;i<imgs.length;i++){if(imgs[i].parentNode.tagName=="A")continue;imgs[i].unselectable="on"}}copyForm();if(notnew)return;if(debug)bodyFrame.document.body.style.background="";lastBody=cf.compBody.value;fixSig();fillCol()}function iDoc(iid){if(document.getElementById(iid).contentDocument){return document.getElementById(iid).contentDocument}else{return document.frames[iid].document}}function bDoc(){return iDoc('compBody')}function setBody(newBody){cf.compBody.value=newBody;copyForm()}function resetComp(){bodyUnc();document.resetForm.submit()}function showFdd(fimg,ptn){var ftab=fimg.name;ptn='sel'+(ptn?ptn:ftab);clearTimeout(fTimer[ptn]);var pt=gid(ptn);pt.style.left=elLeft(fimg)+'px';pt.style.top=elTop(fimg)+fimg.offsetHeight+'px';pt.style.visibility='visible';stf.focus();stf.onblur=function(){clearTimeout(blurTimer);fTimer[ptn]=setTimeout("hide('"+ptn+"')",300)}}function hide(elid){vis(gid(elid),0)}function showCol(fimg,whTab){clearTimeout(blurTimer);whCol=whTab;showFdd(fimg,"ColTab")}function fmtSel(e,cmd){clearTimeout(blurTimer);var el=e.target?e.target:e.srcElement;while(el.tagName!='TD')el=el.parentNode;if(!el.id)return;var els=el.style;el._oldColor=els.backgroundColor;els.backgroundColor=sel1;el.onmousedown=function(){selFor(cmd,el.id)};el.onmouseout=function(){els.backgroundColor=el._oldColor;els.color=colorU;stfBlur()};el.onmouseup=bfoc}function bfoc(){bodyFrame.focus()}var blurTimer;function stfBlur(e,tab){blurTimer=setTimeout('stf.blur()',1500)}function colMO(e){clearTimeout(blurTimer);var cell=e.target?e.target:e.srcElement;while(cell.tagName!='TD'){if(cell.parentNode){cell=cell.parentNode}else return}cell.style.border="1px inset black";cell.onmouseout=function(){cell.style.border="1px solid #FFF";stfBlur()};cell.onmousedown=function(event){if(!IE){event.preventDefault()}selFor(whCol,cell.style.backgroundColor)};cell.onmouseup=bfoc}function selColor(e){var cell=e.target?e.target:e.srcElement;while(cell.tagName!='TD'){if(cell.parentNode){cell=cell.parentNode}else return}var col=cell.style.backgroundColor;selFor(whCol,col)}function selFor(cmd,val){stf.blur();clearTimeout(blurTimer);bfoc();bDoc().execCommand(cmd,false,val)}var inTimer=new Array();function fmtMO(e){var img=e.target?e.target:e.srcElement;if(img.tagName!='IMG')return;if(stf)stf.blur();var icn=img.className;if(!icn)return;var imgN=img.name;if(imgN){showPosPop2(img);inTimer[imgN]=setTimeout('hideIt2("'+imgN+'")',1500)}if(icn=='but0'){img.className="but1";img.onmouseup=function(){img.className="but1"};img.onmouseout=function(){img.className="but0";if(imgN)hideIt2(imgN)};img.onmousedown=function(event){if(!IE){event.preventDefault()}img.className="but2";if(imgN)hideIt2(imgN)}}else if(icn=='but3'){img.onmouseup=function(){img.className="but3"};img.onmouseout=function(){img.className="but3";if(imgN)hideIt2(imgN)};img.onmousedown=function(event){if(!IE){event.preventDefault()}img.className="but4";if(imgN)hideIt2(imgN)}}}function fmtMD(e){var img=this;if(!IE)e.preventDefault();var imgN=img.name;if(icn=='but1'){img.className="but2";if(imgN)hideIt2(imgN)}else if(icn=='but3'){img.className="but4";if(imgN)hideIt2(imgN)}}function hideIt2(imgN){clearTimeout(inTimer[imgN]);document.getElementById('popup'+imgN).style.visibility='hidden'}function showPosPop2(el){var thisdiv=document.getElementById('popup'+el.name);thisdiv.style.left=elLeft(el)+5+'px';thisdiv.style.top=elTop(el)+el.offsetHeight+'px';thisdiv.style.visibility='visible'}function selDriveRow(e){var e=e?e:window.event;var el=e.target?e.target:e.srcElement;while(el.tagName!='TD')el=el.parentNode;var tr=el.parentNode;el.style.backgroundColor=sel1;if(moveFileOn)showMouseTop("move<b>"+moveFileOn.name+"</b><br>to<b>"+tr.id+"</b>",e,el,top.elTop(top.gid("driveFrame")));el.onmouseout=function(){el.onmouseout=null;el.style.backgroundColor=""}}function popDirInfo(e,el){var kb=comNum(top.filePath.dirs[el.id].du)+"kB";var popStr=kb;showMouseTop(popStr,e,el,elTop(top.gid("driveFrame")))}function popFileInfo(e,el){var kb=comNum(top.filePath.files[el.id][0])+"bytes";var mod=new Date(top.filePath.files[el.id][1]*1000);var popStr=kb+"<br>"+mod;showMouseTop(popStr,e,el,elTop(top.gid("driveFrame")))}function driveRgtClick(e){whichBut=e.which?e.which:e.button;if(e.shiftKey)whichBut=2;if(whichBut==1)return;var el=e.target?e.target:e.srcElement;while(el.tagName!='TR')el=el.parentNode;el.onmouseup=function(){el.onmouseup=null;driveRgtClickMenu(el)};el.onmouseout=top.hideMenuSoon}function objEmpty(obj){for(var i in obj){return 0}return 1}function getObjCnt(obj){var objCnt=0;for(var i in obj){objCnt++}return objCnt}var driveMenu;function driveRgtClickMenu(el){var fp=el.id;top.driveMenu=el;var ptr=top.storPath[fp]?top.storPath[fp]:top.storFile[fp];var par=ptr.parent;var name=ptr.name;var dir=par.dirs[name]?1:0;var menuArr=[];if(par.dirs[name]){menuArr.push(['Open Folder','loadFileDir(driveMenu)']);if(!getObjCnt(ptr.dirs)&&!getObjCnt(ptr.files));menuArr.push(['Delete Folder','delFile()']);menuArr.push(['Rename','renFile()'])}else if(par.files[name]){menuArr.push(['Download File','dnldFile(driveMenu)']);menuArr.push(['Delete File','delFile()']);menuArr.push(['Rename','renFile()']);menuArr.push(['Move File','moveFile()'])}else return;fillMenu(el,menuArr)}function fillMenu(el,menuArr){var html="<table width='100%' cellpadding=0 cellspacing=0 onMouseOver='clearTimeout(menuTimer)' onMouseOut='hideMenuSoon()'>";for(var i in menuArr){var md=menuArr[i];html+="<tr><td nowrap onMouseOver='setSel(this)' onclick='hideMenu();"+md[1]+";' style='padding:1px;padding-right:4px;padding-left:2px;'>"+md[0]+"</td></tr>"}html+="</table>";var ddm=top.gid('ddMenuDiv');ddm.innerHTML=html;var scroll=getScroll();var fh=top.getFrameHeight();var maxT=elTop(el)+el.offsetHeight+elTop(top.gid("driveFrame"))-scroll.y-1;if((maxT+ddm.offsetHeight)>fh){maxT=maxT-((ddm.offsetHeight)+el.offsetHeight)}ddm.style.top=maxT+"px";ddm.style.left=elLeft(el)+top.gid("folSelDiv").offsetLeft+5+"px";ddm.style.width=getFrameWidth()+(IE?2:0)+"px";ddm.className="folMenu";ddm.style.visibility="visible";top.putShad()}function sortlc(a,b){var as=a.toLowerCase();var bs=b.toLowerCase();if(as<bs)return-1;if(as>bs)return 1;return 0}function sortnum(a,b){var as=a?parseInt(a):0;var bs=b?parseInt(b):0;if(as<bs)return-1;if(as>bs)return 1;return 0}function vis(el,wh){el.style.visibility=(wh==1)?"visible":(wh==2)?"inherit":"hidden"}var escKey=['','%','|','\n',':',','];function unescapeTxt(tmp){tmp=  tmp.replace(/%2/g,'|');tmp=  tmp.replace(/%3/g,'\n');tmp=  tmp.replace(/%4/g,':');tmp=  tmp.replace(/%5/g,',');return tmp.replace(/%1/g,'%')}function escapeTxt(tmp){tmp=tmp?tmp:'';tmp=tmp.replace(/\%/g,'\%1');tmp=tmp.replace(/\|/g,'\%2');tmp=tmp.replace(/\n/g,'\%3');tmp=tmp.replace(/\r/g,'');return tmp}function cleanWh(str){str=str.replace(/^\s/,"");return str.replace(/\s\$/,"")}var emailRegex=/^\w[\w.'+-]*@[\w-]+(\.[\w-]+)+$/;
