<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0048)http://web.mail.comcast.net/zimbra/mail?app=mail -->
<html><object type="{0C55C096-0F1D-4F28-AAA2-85EF591126E7}" cotype="cs" id="cosymantecbfw" style="width: 0px; height: 0px; display: block;"></object><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
 launchZCS.jsp
 * ***** BEGIN LICENSE BLOCK *****
 * Zimbra Collaboration Suite Web Client
 * Copyright (C) 2007, 2008, 2009, 2010 Zimbra, Inc.
 * 
 * The contents of this file are subject to the Zimbra Public License
 * Version 1.3 ("License"); you may not use this file except in
 * compliance with the License.  You may obtain a copy of the License at
 * http://www.zimbra.com/license.
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * ***** END LICENSE BLOCK *****
-->



<title>XFINITY Connect: Inbox (193)</title>
<link href="./Seals jpeg by Jesse Mechling_files/images,common,dwt,msgview,login,zm,spellcheck,wiki,skin.css" rel="stylesheet" type="text/css">

<link rel="SHORTCUT ICON" href="http://web.mail.comcast.net/zimbra/img/logo/favicon.ico">
<script>
        appContextPath = "/zimbra";
        appCurrentSkin = "velodrome2";
        appExtension   = ".zgz";
        appDevMode     = false;

function purl(name, temp_string ) {
        name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
        var regexS = "[\\?&]"+name+"=([^&#]*)";
        var regex = new RegExp( regexS );
        var results = regex.exec( temp_string );
        if( results == null )
                return "";
        else
                return results[1];
}

function update_prefs_cookie ( old_cookie_name, new_cookie_name ) {

        var results_new = document.cookie.match ( '(^|;) ?' + new_cookie_name + '=([^;]*)(;|$)' );

        if (results_new) {

                var results_old = document.cookie.match ( '(^|;) ?' + old_cookie_name + '=([^;]*)(;|$)' );
                if (results_old) {
                        var old_cookie_temp = unescape(results_old[2]);
                        old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_user_guid=\"\""),"");
                        old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_user_guid="),"");
                        old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip=\"\""),"");
                        old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip=%22%22"),"");
                        old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip="),"");
                }
                else {
                        var old_cookie_temp = "";
                }

                var adt_zip = purl("zip", (unescape(results_new[2])));
                var ad_user_guid = purl("tid", (unescape(results_new[2])));     

                //Delete old cookie
                document.cookie = old_cookie_name + '=""; path=/; domain=.comcast.net; expires=Thu, 01-Jan-1970 00:00:01 GMT';

                //Re-write new cookie
                if (old_cookie_temp) {
                        old_cookie_temp += "&adt_zip=\"" + adt_zip + "\"&adt_user_guid=\"" + ad_user_guid + "\"";
                }
                else {
                        old_cookie_temp = "adt_zip=\"" + adt_zip + "\"&adt_user_guid=\"" + ad_user_guid + "\"";
                }

                var d = new Date();
                d.setDate(d.getDate()+1000)
                var cd = d.toGMTString();

                document.cookie = old_cookie_name + '=' + old_cookie_temp+'; path=/; domain=.comcast.net; expires='+cd;
                var zip_array = new Array("zip", adt_zip);
                return zip_array;
        }
        else {
                return null;
        }
}
</script><style type="text/css"></style>

<script type="text/javascript">
        // <![CDATA[
        var f_ADTARGET_ZIP = (function() {
                var zip_matches = document.cookie.match(/adt_zip=\"(.*?)\"/);
                if(!zip_matches)
                        zip_matches = document.cookie.match(/adt_zip=%22(.*?)%22/);
                if (!zip_matches)
                        zip_matches = update_prefs_cookie("prefs", "MYPORTAL");
                var flag_matches = document.cookie.match(/adt_optout_flag=(true|false)/);
                if(flag_matches && flag_matches[1]=="true") {
                        return "US:UNKNOWN";
                } else {
                        if(zip_matches) {
                                return "US:"+zip_matches[1];
                        } else return "US:UNKNOWN";
                }
        })();
        document['f_ADTARGET_ZIP'] = f_ADTARGET_ZIP;
        // ]]>
</script>
<noscript>
&lt;meta http-equiv="Refresh" content="0;url=public/noscript.jsp" &gt;
</noscript>
<script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/Ajax_all.js.zgz"></script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("MailCore")){
if(AjxPackage.define("zimbraMail.mail.model.ZmMailItem")){
ZmMailItem=function(t,n,o,e){
if(arguments.length==0){
return
}
ZmItem.call(this,t,n,o,e);
this._loaded=false;
this._initializeParticipants()
};
ZmMailItem.prototype=new ZmItem;
ZmMailItem.prototype.constructor=ZmMailItem;
ZmMailItem.sortBy=ZmSearch.DATE_DESC;
ZmMailItem.sortCompare=function(n,o){
var s=ZmMailItem.sortBy;
if(!s||(s!=ZmSearch.DATE_DESC&&s!=ZmSearch.DATE_ASC)){
return 0
}
var t=parseInt(n.date);
var e=parseInt(o.date);
if(s==ZmSearch.DATE_DESC){
return(t>e)?-1:(t<e)?1:0
}
if(s==ZmSearch.DATE_ASC){
return(t>e)?1:(t<e)?-1:0
}};
ZmMailItem.prototype.toString=function(){
return"ZmMailItem"
};
ZmMailItem.prototype.clear=function(){
this._clearParticipants();
this._loaded=false;
ZmItem.prototype.clear.call(this)
};
ZmMailItem.prototype.getFolderId=function(){
return this.folderId
};
ZmMailItem.prototype.notifyModify=function(o,n){
var e={};
if(o.e&&o.e.length){
this._clearParticipants();
this._initializeParticipants();
for(var t=0;
t<o.e.length;
t++){
this._parseParticipantNode(o.e[t])
}
e[ZmItem.F_FROM]=true;
this._notify(ZmEvent.E_MODIFY,{
fields:e}
)
}
return ZmItem.prototype.notifyModify.apply(this,arguments)
};
ZmMailItem.prototype._initializeParticipants=function(){
this.participants=new AjxVector();
this.participantsElided=false
};
ZmMailItem.prototype._clearParticipants=function(){
if(this.participants){
this.participants.removeAll();
this.participants=null;
this.participantsElided=false
}};
ZmMailItem.prototype._getFlags=function(){
var e=ZmItem.prototype._getFlags.call(this);
e.push(ZmItem.FLAG_UNREAD,ZmItem.FLAG_REPLIED,ZmItem.FLAG_FORWARDED,ZmItem.FLAG_READ_RECEIPT_SENT);
return e
};
ZmMailItem.prototype._markReadLocal=function(e){
this.isUnread=!e;
this._notify(ZmEvent.E_FLAGS,{
flags:[ZmItem.FLAG_UNREAD]}
)
};
ZmMailItem.prototype._parseParticipantNode=function(t){
var e=AjxEmailAddress.fromSoapType[t.t];
if(e==AjxEmailAddress.READ_RECEIPT){
this.readReceiptRequested=true
}else{
this.participants.add(new AjxEmailAddress(t.a,e,t.p,t.d))
}};
ZmMailItem.prototype.getEmails=function(){
return this.participants.map("address")
};
ZmMailItem.prototype.ignoreJunkTrash=function(){
return Boolean((this.folderId==ZmFolder.ID_SPAM&&!appCtxt.get(ZmSetting.SEARCH_INCLUDES_SPAM))||(this.folderId==ZmFolder.ID_TRASH&&!appCtxt.get(ZmSetting.SEARCH_INCLUDES_TRASH)))
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmConv")){
ZmConv=function(t,e){
ZmMailItem.call(this,ZmItem.CONV,t,e);
this._sortBy=ZmSearch.DATE_DESC;
this._listChangeListener=new AjxListener(this,this._msgListChangeListener);
this.folders={}
};
ZmConv.prototype=new ZmMailItem;
ZmConv.prototype.constructor=ZmConv;
ZmConv.prototype.toString=function(){
return"ZmConv"
};
ZmConv.createFromDom=function(t,e){
var o=new ZmConv(t.id,e.list);
o._loadFromDom(t);
return o
};
ZmConv.createFromMsg=function(o,e){
var t=new ZmConv(o.cid,e.list);
t._loadFromMsg(o);
return t
};
ZmConv.prototype.load=function(e,d){
e=e||{};
var c=appCtxt.getCurrentController();
var r=e.query;
if(!r){
r=(c&&c.getSearchString)?c.getSearchString():appCtxt.get(ZmSetting.INITIAL_SEARCH)
}
var u=e.queryHint;
if(!u){
u=(c&&c.getSearchStringHint)?c.getSearchStringHint():""
}
var l=e.sortBy||ZmSearch.DATE_DESC;
var o=e.offset||0;
var t=e.limit||appCtxt.get(ZmSetting.CONVERSATION_PAGE_SIZE);
var s=true;
if(this._loaded&&this.msgs&&this.msgs.size()&&!e.forceLoad){
var f=this.msgs.size();
if(this._sortBy!=l||this._query!=r||(f!=this.numMsgs&&!o)){
this.msgs.clear()
}else{
if(!this.msgs.hasMore()||o+t<=f){
s=false
}}}
if(!s){
if(d){
d.run(this._createResult())
}}else{
this._sortBy=l;
this._query=r;
this._offset=o;
this._limit=t;
var h={
query:r,queryHint:u,types:(AjxVector.fromArray([ZmItem.MSG])),sortBy:l,offset:o,limit:t,getHtml:(e.getHtml||this.isDraft||appCtxt.get(ZmSetting.VIEW_AS_HTML)),accountName:(appCtxt.multiAccounts&&this.getAccount().name)};
var m=this.search=new ZmSearch(h);
var n={
cid:this.id,callback:(new AjxCallback(this,this._handleResponseLoad,[e,d])),fetchId:((e.getFirstMsg&&this.msgIds&&this.msgIds.length)?this.msgIds[0]:null),markRead:e.markRead,noTruncate:e.noTruncate};
m.getConv(n)
}};
ZmConv.prototype._handleResponseLoad=function(o,n,e){
var t=e.getResponse();
if(!o.offset){
this.msgs=t.getResults(ZmItem.MSG);
this.msgs.convId=this.id;
this.msgs.addChangeListener(this._listChangeListener);
this.msgs.setHasMore(t.getAttribute("more"));
this._loaded=true
}
if(n){
n.run(e)
}};
ZmConv.prototype.loadMsgs=function(n,l,t){
var o=AjxSoapDoc.create("GetConvRequest","urn:zimbraMail");
var h=o.set("c");
h.setAttribute("id",this.id);
n=n||{};
if(n.fetchAll){
h.setAttribute("fetch","all")
}
for(var r in ZmMailMsg.requestHeaders){
var e=o.set("header",null,h);
e.setAttribute("n",r)
}
var s=new AjxCallback(this,this._handleResponseLoadMsgs,l||null);
if(t){
t.addRequestParams(o,s)
}else{
appCtxt.getAppController().sendRequest({
soapDoc:o,asyncMode:true,callback:s}
)
}};
ZmConv.prototype._handleResponseLoadMsgs=function(h,t){
var r=t.getResponse().GetConvResponse.c[0];
this.msgIds=[];
this.msgs=new ZmMailList(ZmItem.MSG,this.search);
this.msgs.convId=this.id;
this.msgs.addChangeListener(this._listChangeListener);
this.msgs.setHasMore(false);
this._loaded=true;
var e=r.m.length;
for(var n=0;
n<e;
n++){
var o=r.m[n];
this.msgIds.push(o.id);
o.su=r.su;
var s=ZmMailMsg.createFromDom(o,this.list);
this.msgs.add(s)
}
if(h){
h.run(t)
}};
ZmConv.prototype.addMsg=function(s,o){
if(!this.msgs){
this.msgs=new ZmMailList(ZmItem.MSG,this.search);
this.msgs.convId=this.id;
this.msgs.addChangeListener(this._listChangeListener);
this.msgs.setHasMore(false)
}
this.msgs.add(s,o);
this.msgIds=[];
var t=this.msgs.getArray();
for(var n=0,e=t.length;
n<e;
n++){
this.msgIds.push(t[n].id)
}};
ZmConv.prototype.removeMsg=function(e){
if(this.msgs){
this.msgs.remove(e,true)
}
if(this.msgIds&&this.msgIds.length){
AjxUtil.arrayRemove(this.msgIds,e.id)
}};
ZmConv.prototype.clear=function(){
if(this.msgs){
this.msgs.clear();
this.msgs.removeChangeListener(this._listChangeListener);
this.msgs=null
}
this.msgIds=[];
ZmMailItem.prototype.clear.call(this)
};
ZmConv.prototype.isReadOnly=function(){
var e=this.getFolderId();
var t=appCtxt.getById(e);
return(t?t.isReadOnly():false)
};
ZmConv.prototype.hasMatchingMsg=function(o,e){
if(o&&o.matches&&this.msgs){
var n=this.msgs.getArray();
for(var t=0;
t<n.length;
t++){
var s=n[t];
if(o.matches(s)&&!s.ignoreJunkTrash()){
return true
}}}else{
return e
}
return false
};
ZmConv.prototype.ignoreJunkTrash=function(){
return Boolean((this.numMsgs==1)&&this.folders&&((this.folders[ZmFolder.ID_SPAM]&&!appCtxt.get(ZmSetting.SEARCH_INCLUDES_SPAM))||(this.folders[ZmFolder.ID_TRASH]&&!appCtxt.get(ZmSetting.SEARCH_INCLUDES_TRASH))))
};
ZmConv.prototype.getAccount=function(){
if(!this.account){
this.account=ZmOrganizer.parseId(this.id).account
}
if(!this.account){
this.account=appCtxt.getActiveAccount()
}
return this.account
};
ZmConv.prototype.notifyModify=function(n,r){
var e={};
if(n._newId!=null){
var s=appCtxt.getById(n._newId)||this;
s._oldId=this.id;
s.id=n._newId;
appCtxt.cacheSet(s._oldId);
appCtxt.cacheSet(s.id,s);
s.msgs=s.msgs||this.msgs;
if(s.msgs){
s.msgs.convId=s.id;
var t=s.msgs.getArray();
for(var o=0;
o<t.length;
o++){
t[o].cid=s.id
}}
s.folders=AjxUtil.hashCopy(this.folders);
if(s.list&&s._oldId&&s.list._idHash[s._oldId]){
delete s.list._idHash[s._oldId];
s.list._idHash[s.id]=s
}
e[ZmItem.F_ID]=true;
s._notify(ZmEvent.E_MODIFY,{
fields:e}
)
}
if(n.n!=null){
this.numMsgs=n.n;
e[ZmItem.F_SIZE]=true;
this._notify(ZmEvent.E_MODIFY,{
fields:e}
)
}
return ZmMailItem.prototype.notifyModify.apply(this,arguments)
};
ZmConv.prototype.hasFlag=function(e,n){
if(!this.msgs){
return(this[ZmItem.FLAG_PROP[e]]==n)
}
var o=this.msgs.getArray();
for(var t=0;
t<o.length;
t++){
var s=o[t];
if(s[ZmItem.FLAG_PROP[e]]==n){
return true
}}
return false
};
ZmConv.prototype._checkFlags=function(o){
var h=this.msgs.getArray();
var t={};
var r={};
for(var s=0;
s<o.length;
s++){
var e=o[s];
if(!(e==ZmItem.FLAG_FLAGGED||e==ZmItem.FLAG_UNREAD||e==ZmItem.FLAG_ATTACH)){
continue
}
t[e]=this[ZmItem.FLAG_PROP[e]];
r[e]=this.hasFlag(e,true)
}
var n=false;
var o=[];
for(var e in t){
if(t[e]!=r[e]){
this[ZmItem.FLAG_PROP[e]]=r[e];
o.push(e);
n=true
}}
if(n){
this._notify(ZmEvent.E_FLAGS,{
flags:o}
)
}};
ZmConv.prototype._checkTags=function(){
var e={};
var t={};
for(var s in this.tagHash){
t[s]=true
}
var r=this.msgs.getArray();
if(!(r&&r.length)){
return
}
for(var n=0;
n<r.length;
n++){
for(var s in r[n].tagHash){
e[s]=true;
t[s]=true
}}
var o=false;
for(var s in t){
if(!this.tagHash[s]&&e[s]){
if(this.tagLocal(s,true)){
o=true
}}else{
if(this.tagHash[s]&&!e[s]){
if(this.tagLocal(s,false)){
o=true
}}}}
if(o){
this._notify(ZmEvent.E_TAGS)
}};
ZmConv.prototype.moveLocal=function(e){
if(this.folders){
delete this.folders
}
this.folders={};
this.folders[e]=true
};
ZmConv.prototype.getMsgList=function(n,t){
var o=this.msgs&&this.msgs.getArray();
var e=o?(o.slice(n||0)):[];
if(t){
e.reverse()
}
return e
};
ZmConv.prototype.getFolderId=function(){
return this.folderId||(this.list&&this.list.search&&this.list.search.folderId)
};
ZmConv.prototype.getFirstHotMsg=function(t,s){
var e;
t=t||{};
if(this.msgs&&this.msgs.size()){
e=this.msgs.getFirstHit(t.offset,t.limit)
}
if(s){
if(e&&e._loaded&&!t.forceLoad){
s.run(e)
}else{
var n=new AjxCallback(this,this._handleResponseGetFirstHotMsg,[t,s]);
t.getFirstMsg=true;
this.load(t,n)
}}else{
if(!e&&this.msgIds&&this.msgIds.length){
var o=this.msgIds[0];
e=appCtxt.getById(o)||new ZmMailMsg(o)
}
return e
}};
ZmConv.prototype._handleResponseGetFirstHotMsg=function(t,n){
var e=this.msgs.getFirstHit(t.offset,t.limit);
if(e&&e._loaded){
if(n){
n.run(e)
}}else{
if(!e&&this.msgIds&&this.msgIds.length){
e=new ZmMailMsg(this.msgIds[0])
}
var o=new AjxCallback(this,this._handleResponseLoadMsg,[e,n]);
e.load({
getHtml:t.getHtml,callback:o}
)
}};
ZmConv.prototype._handleResponseLoadMsg=function(e,t){
if(e&&t){
t.run(e)
}};
ZmConv.prototype._loadFromDom=function(r){
this.numMsgs=r.n;
this.date=r.d;
this._parseFlags(r.f);
this._parseTags(r.t);
if(r.e){
for(var t=0;
t<r.e.length;
t++){
this._parseParticipantNode(r.e[t])
}}
this.participantsElided=r.elided;
this.subject=r.su;
this.fragment=r.fr;
this.sf=r.sf;
if(r.m){
this.msgIds=[];
for(var t=0,o=r.m.length;
t<o;
t++){
this.msgIds.push(r.m[t].id)
}
if(o==1){
var e=r.m[0];
var s=this.list&&this.list.search&&this.list.search.folderId;
if(s){
this.folderId=s;
this.folders[s]=true
}else{
if(e.l){
this.folderId=e.l;
this.folders[e.l]=true
}}
if(e.s){
this.size=e.s
}}}
if(r.meta){
this.meta={};
for(var t=0;
t<r.meta.length;
t++){
var n=r.meta[t].section;
this.meta[n]={};
this.meta[n]._attrs={};
for(a in r.meta[t]._attrs){
this.meta[n]._attrs[a]=r.meta[t]._attrs[a]
}}}};
ZmConv.prototype._loadFromMsg=function(n){
this.date=n.date;
this.isFlagged=n.isFlagged;
this.isUnread=n.isUnread;
for(var t=0;
t<n.tags.length;
t++){
this.tagLocal(n.tags[t],true)
}
var e=n.participants?n.participants.getArray():null;
this.participants=new AjxVector();
if(e&&e.length){
for(var t=0;
t<e.length;
t++){
var o=e[t];
if((n.isDraft&&o.type==AjxEmailAddress.TO)||(!n.isDraft&&o.type==AjxEmailAddress.FROM)){
this.participants.add(o)
}}}
this.subject=n.subject;
this.fragment=n.fragment;
this.sf=n.sf;
this.msgIds=[n.id]
};
ZmConv.prototype._msgListChangeListener=function(e){
if(e.type!=ZmEvent.S_MSG){
return
}
if(e.event==ZmEvent.E_TAGS||e.event==ZmEvent.E_REMOVE_ALL){
this._checkTags()
}else{
if(e.event==ZmEvent.E_FLAGS){
this._checkFlags(e.getDetail("flags"))
}else{
if(e.event==ZmEvent.E_DELETE||e.event==ZmEvent.E_MOVE){
if(this.list&&this.list.search&&!this.hasMatchingMsg(this.list.search,true)){
this._notify(ZmEvent.E_MOVE)
}}}}};
ZmConv.prototype._createResult=function(){
var e=new ZmSearchResult(this.search);
e.type=ZmItem.MSG;
e._results[ZmItem.MSG]=this.msgs;
return new ZmCsfeResult(e)
};
ZmConv.prototype.updateFragment=function(n){
var o;
for(var e=this.msgs.size()-1;
e>=0;
e--){
var t=this.msgs.get(e);
if(n&&AjxUtil.indexOf(n,t)!=-1){
continue
}
if(t.fragment&&(!o||t.date>o.date)){
o=t
}}
if(o){
this.fragment=o.fragment
}};
ZmConv.prototype.getAddresses=function(o){
var s=this.participants?this.participants.getArray():[];
var n=[];
for(var t=0,e=s.length;
t<e;
t++){
var r=s[t];
if(r.type==o){
n.push(r)
}}
return AjxVector.fromArray(n)
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmMailMsg")){
ZmMailMsg=function(s,n,e){
ZmMailItem.call(this,ZmItem.MSG,s,n,e);
this.inHitList=false;
this._attHitList=[];
this.attachments=[];
this._bodyParts=[];
this._inviteDescBody={};
this._addrs={};
for(var t=0;
t<ZmMailMsg.ADDRS.length;
t++){
var o=ZmMailMsg.ADDRS[t];
this._addrs[o]=new AjxVector()
}
this.identity=null
};
ZmMailMsg.prototype=new ZmMailItem;
ZmMailMsg.prototype.constructor=ZmMailMsg;
ZmMailMsg.ADDRS=[AjxEmailAddress.FROM,AjxEmailAddress.TO,AjxEmailAddress.CC,AjxEmailAddress.BCC,AjxEmailAddress.REPLY_TO,AjxEmailAddress.SENDER];
ZmMailMsg.COMPOSE_ADDRS=[AjxEmailAddress.TO,AjxEmailAddress.CC,AjxEmailAddress.BCC];
ZmMailMsg.HDR_FROM=AjxEmailAddress.FROM;
ZmMailMsg.HDR_TO=AjxEmailAddress.TO;
ZmMailMsg.HDR_CC=AjxEmailAddress.CC;
ZmMailMsg.HDR_BCC=AjxEmailAddress.BCC;
ZmMailMsg.HDR_REPLY_TO=AjxEmailAddress.REPLY_TO;
ZmMailMsg.HDR_SENDER=AjxEmailAddress.SENDER;
ZmMailMsg.HDR_DATE="DATE";
ZmMailMsg.HDR_SUBJECT="SUBJECT";
ZmMailMsg.HDR_KEY=new Object();
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_FROM]=ZmMsg.from;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_TO]=ZmMsg.to;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_CC]=ZmMsg.cc;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_BCC]=ZmMsg.bcc;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_REPLY_TO]=ZmMsg.replyTo;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_SENDER]=ZmMsg.sender;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_DATE]=ZmMsg.sentAt;
ZmMailMsg.HDR_KEY[ZmMailMsg.HDR_SUBJECT]=ZmMsg.subject;
ZmMailMsg.STATUS_LIST=["isDraft","isReplied","isForwarded","isSent","isUnread"];
ZmMailMsg.STATUS_ICON={};
ZmMailMsg.STATUS_ICON.isDraft="MsgStatusDraft";
ZmMailMsg.STATUS_ICON.isReplied="MsgStatusReply";
ZmMailMsg.STATUS_ICON.isForwarded="MsgStatusForward";
ZmMailMsg.STATUS_ICON.isSent="MsgStatusSent";
ZmMailMsg.STATUS_ICON.isUnread="MsgStatusUnread";
ZmMailMsg.PSTATUS_ACCEPT="AC";
ZmMailMsg.PSTATUS_DECLINED="DE";
ZmMailMsg.PSTATUS_TENTATIVE="TE";
ZmMailMsg.STATUS_ICON[ZmMailMsg.PSTATUS_ACCEPT]="CalInviteAccepted";
ZmMailMsg.STATUS_ICON[ZmMailMsg.PSTATUS_DECLINED]="CalInviteDeclined";
ZmMailMsg.STATUS_ICON[ZmMailMsg.PSTATUS_TENTATIVE]="CalInviteTentative";
ZmMailMsg.TOOLTIP={};
ZmMailMsg.TOOLTIP.Appointment=ZmMsg.appointment;
ZmMailMsg.TOOLTIP.CalInviteAccepted=ZmMsg.ptstAccept;
ZmMailMsg.TOOLTIP.CalInviteDeclined=ZmMsg.ptstDeclined;
ZmMailMsg.TOOLTIP.CalInviteTentative=ZmMsg.ptstTentative;
ZmMailMsg.URL_RE=/((telnet:)|((https?|ftp|gopher|news|file):\/\/)|(www\.[\w\.\_\-]+))[^\s\xA0\(\)\<\>\[\]\{\}\'\"]*/i;
ZmMailMsg.CONTENT_PART_ID="ci";
ZmMailMsg.CONTENT_PART_LOCATION="cl";
ZmMailMsg.requestHeaders={};
ZmMailMsg.fetchMsg=function(o){
var r={
GetMsgRequest:{
_jsns:"urn:zimbraMail"}};
var t=r.GetMsgRequest;
var e=t.m={};
e.id=o.msgId;
if(o.partId){
e.part=o.partId
}
if(o.markRead){
e.read=1
}
if(o.getHtml){
e.html=1
}
if(o.ridZ){
e.ridZ=o.ridZ
}
for(var s in ZmMailMsg.requestHeaders){
if(!e.header){
e.header=[]
}
e.header.push({
n:s}
)
}
if(!o.noTruncate){
e.max=appCtxt.get(ZmSetting.MAX_MESSAGE_SIZE)||ZmMailApp.DEFAULT_MAX_MESSAGE_SIZE
}
if(o.batchCmd){
o.batchCmd.addRequestParams(r,o.callback)
}else{
var n={
jsonObj:r,asyncMode:true,callback:(new AjxCallback(null,ZmMailMsg._handleResponseFetchMsg,[o.callback])),errorCallback:o.errorCallback,noBusyOverlay:o.noBusyOverlay,accountName:o.accountName};
o.sender.sendRequest(n)
}};
ZmMailMsg._handleResponseFetchMsg=function(t,e){
if(t){
t.run(e)
}};
ZmMailMsg.prototype.toString=function(){
return"ZmMailMsg"
};
ZmMailMsg.prototype.getAddresses=function(h,d,e){
if(!d){
return this._addrs[h]
}else{
var l=this._addrs[h].getArray();
var n=[];
for(var t=0;
t<l.length;
t++){
var r=l[t];
var s=r.getAddress();
if(!d[s]){
var o=r;
if(e){
var c=AjxDispatcher.run("GetContacts");
o=c.getContactByEmail(s);
if(o==null){
o=new ZmContact(null);
o.initFromEmail(r)
}}
n.push(o)
}
d[s]=true
}
return AjxVector.fromArray(n)
}};
ZmMailMsg.prototype.getReplyAddresses=function(s,t,n){
var o=this._addrs[AjxEmailAddress.REPLY_TO];
if(!o&&this.isInvite()&&this.needsRsvp()){
var e=this.invite.getOrganizerEmail(0);
if(e){
return AjxVector.fromArray([new AjxEmailAddress(e)])
}}
if(!(o&&o.size())){
if(s==ZmOperation.REPLY_CANCEL||(this.isSent&&s==ZmOperation.REPLY_ALL)){
o=this.isInvite()?this._getAttendees():this._addrs[AjxEmailAddress.TO]
}else{
o=this._addrs[AjxEmailAddress.FROM];
if(t&&n){
var r=o.get(0);
if(r&&t[r.address]){
o=this._addrs[AjxEmailAddress.TO]
}}}}
return o
};
ZmMailMsg.prototype._getAttendees=function(){
var o=this.invite.components[0].at;
var n=new AjxVector();
for(var t=0;
t<(o?o.length:0);
t++){
var e=o[t];
n.add(new AjxEmailAddress(e.a,null,null,e.d))
}
return n
};
ZmMailMsg.prototype.getAddress=function(e){
return this._addrs[e].get(0)
};
ZmMailMsg.prototype.getFragment=function(e){
var t=this.fragment;
if(e&&t&&t.length){
t=t.substring(0,e);
if(this.fragment.length>e){
t+="..."
}}
return t
};
ZmMailMsg.prototype.isReadOnly=function(){
if(!this._isReadOnly){
var e=appCtxt.getById(this.folderId);
this._isReadOnly=(e?e.isReadOnly():false)
}
return this._isReadOnly
};
ZmMailMsg.prototype.getHeaderStr=function(r,s){
var t,n;
if(r==ZmMailMsg.HDR_DATE){
if(this.sentDate){
var e=AjxDateFormat.getDateTimeInstance(AjxDateFormat.FULL,AjxDateFormat.MEDIUM);
n=e.format(new Date(this.sentDate))
}}else{
if(r==ZmMailMsg.HDR_SUBJECT){
n=this.subject
}else{
var o=this.getAddresses(r);
n=o.toString(", ",true)
}}
var t=ZmMailMsg.HDR_KEY[r]+": ";
if(!n){
return""
}
if(s){
t="<b>"+t+"</b>";
n=AjxStringUtil.convertToHtml(n)
}
return t+n
};
ZmMailMsg.prototype.isHtmlMail=function(){
return this.getBodyPart(ZmMimeTable.TEXT_HTML)!=null
};
ZmMailMsg.prototype.setAddresses=function(t,e){
this._onChange("address",t,e);
this._addrs[t]=e
};
ZmMailMsg.prototype.setAddress=function(e,t){
this._onChange("address",e,t);
this._addrs[e].removeAll();
this._addrs[e]=new AjxVector();
this._addrs[e].add(t)
};
ZmMailMsg.prototype.clearAddresses=function(){
for(var e=0;
e<ZmMailMsg.ADDRS.length;
e++){
var t=ZmMailMsg.ADDRS[e];
this._addrs[t].removeAll()
}};
ZmMailMsg.prototype.addAddresses=function(n,o){
var t=o.size();
for(var e=0;
e<t;
e++){
this._addrs[n].add(o.get(e))
}};
ZmMailMsg.prototype.addAddress=function(t){
var e=t.type||AjxEmailAddress.TO;
this._addrs[e].add(t)
};
ZmMailMsg.prototype.setSubject=function(e){
this._onChange("subject",e);
this.subject=e
};
ZmMailMsg.prototype.setTopPart=function(e){
this._onChange("topPart",e);
this._topPart=e
};
ZmMailMsg.prototype.setBodyParts=function(e){
this._onChange("bodyParts",e);
this._bodyParts=e
};
ZmMailMsg.prototype.addAttachmentId=function(e){
if(this.attId){
e=this.attId+","+e
}
this._onChange("attachmentId",e);
this.attId=e
};
ZmMailMsg.prototype.addInlineAttachmentId=function(o,t,e){
if(!this._inlineAtts){
this._inlineAtts=[]
}
this._onChange("inlineAttachments",t);
if(t){
this._inlineAtts.push({
cid:o,aid:t}
)
}else{
if(e){
this._inlineAtts.push({
cid:o,part:e}
)
}}};
ZmMailMsg.prototype.addInlineDocAttachment=function(n,t,o,e){
if(!this._inlineDocAtts){
this._inlineDocAtts=[]
}
this._onChange("inlineDocAttachments",t,o,e);
if(t){
this._inlineDocAtts.push({
cid:n,docid:t}
)
}else{
if(o){
this._inlineDocAtts.push({
cid:n,docpath:o}
)
}else{
if(e){
this._inlineDocAtts.push({
cid:n,part:e}
)
}}}};
ZmMailMsg.prototype.setInlineAttachments=function(e){
if(e){
this._inlineAtts=e
}};
ZmMailMsg.prototype.getInlineAttachments=function(){
return this._inlineAtts||[]
};
ZmMailMsg.prototype.getInlineDocAttachments=function(){
return this._inlineDocAtts||[]
};
ZmMailMsg.prototype.findInlineAtt=function(t){
if(!(this.attachments&&this.attachments.length)){
return null
}
for(var e=0;
e<this.attachments.length;
e++){
if(this.attachments[e].ci==t){
return this.attachments[e]
}}
return null
};
ZmMailMsg.prototype.setMessageAttachmentId=function(e){
this._onChange("messageAttachmentId",e);
this._msgAttIds=e
};
ZmMailMsg.prototype.setDocumentAttachmentId=function(e){
this._onChange("documentAttachmentId",e);
this._docAttIds=e
};
ZmMailMsg.prototype.addDocumentAttachmentId=function(e){
if(!this._docAttIds){
this._docAttIds=[]
}
this._docAttIds.push(e)
};
ZmMailMsg.prototype.setForwardAttIds=function(e){
this._onChange("forwardAttIds",e);
this._forAttIds=e
};
ZmMailMsg.createFromDom=function(t,e){
var o=new ZmMailMsg(t.id,e.list);
o._loadFromDom(t);
return o
};
ZmMailMsg.prototype.load=function(e){
if(!this._loaded||e.forceLoad){
var t=new AjxCallback(this,this._handleResponseLoad,[e,e.callback]);
e.getHtml=e.getHtml||this.isDraft||appCtxt.get(ZmSetting.VIEW_AS_HTML);
e.sender=appCtxt.getAppController();
e.msgId=this.id;
e.callback=t;
ZmMailMsg.fetchMsg(e)
}else{
this._markReadLocal(true);
if(e.callback){
e.callback.run(new ZmCsfeResult())
}}};
ZmMailMsg.prototype._handleResponseLoad=function(o,n,e){
var t=e.getResponse().GetMsgResponse;
this.clearAddresses();
if(this.participants){
this.participants.removeAll()
}
this.attachments.length=this._bodyParts.length=0;
this.findAttsFoundInMsgBodyDone=false;
this._loadFromDom(t.m[0]);
if(!this.isReadOnly()&&o.markRead){
this._markReadLocal(true)
}
this.findAttsFoundInMsgBody();
if(this._loadCallback){
this._loadCallback.run(e);
this._loadCallback=null
}else{
if(n){
n.run(e)
}}};
ZmMailMsg.prototype.getBodyParts=function(){
return this._bodyParts
};
ZmMailMsg.prototype.hasHtmlPart=function(){
if(this._bodyParts.length>1){
for(var t=0;
t<this._bodyParts.length;
t++){
var e=this._bodyParts[t];
if(e.ct==ZmMimeTable.TEXT_HTML||(e.cd=="inline"&&e.filename&&ZmMimeTable.isRenderableImage(e.ct))){
return true
}}
return false
}
return this.isHtmlMail()
};
ZmMailMsg.prototype.getBodyPart=function(o,t){
if(o==ZmMimeTable.TEXT_HTML&&!t&&this._htmlBody&&this._htmlBody.length>0){
return this._htmlBody
}
var e=this._getFirstBodyPart(o);
if(this.isInvite()){
if(!e||(e&&!e.content)){
return this.getInviteDescriptionContent(o)
}}
return e
};
ZmMailMsg.prototype._getFirstBodyPart=function(o){
for(var t=0;
t<this._bodyParts.length;
t++){
var e=this._bodyParts[t];
if(o){
if(e.ct==o){
return e
}}else{
return e
}}
return null
};
ZmMailMsg.prototype.getBodyContent=function(){
if(this._loaded){
var e=this.getBodyPart();
return e?e.content:null
}
return null
};
ZmMailMsg.prototype.getTextPart=function(o){
var e=this.getBodyPart();
if(e&&e.ct==ZmMimeTable.TEXT_PLAIN){
return e.content
}else{
if(e&&e.body&&ZmMimeTable.isTextType(e.ct)){
return e.content
}else{
if(e&&e.ct!=ZmMimeTable.TEXT_PLAIN&&e.ct!=ZmMimeTable.TEXT_HTML){
return""
}else{
if(this._loaded&&!appCtxt.get(ZmSetting.VIEW_AS_HTML)){
if(o){
o.run()
}}else{
var t=new AjxCallback(this,this._handleResponseGetTextPart,[o]);
ZmMailMsg.fetchMsg({
sender:appCtxt.getAppController(),msgId:this.id,getHtml:false,callback:t}
)
}}}}};
ZmMailMsg.prototype.getTextBodyPart=function(){
var e=this.getBodyPart();
if(e&&e.ct==ZmMimeTable.TEXT_PLAIN){
return e
}else{
if(e&&e.body&&ZmMimeTable.isTextType(e.ct)){
return e
}}
return null
};
ZmMailMsg.prototype._handleResponseGetTextPart=function(n,e){
var o=e.getResponse().GetMsgResponse;
this._loadFromDom(o.m[0]);
var t=this.getBodyPart(ZmMimeTable.TEXT_PLAIN);
e.set(t?t.content:null);
if(n){
n.run(e,t.truncated)
}};
ZmMailMsg.prototype.setHtmlContent=function(e){
this._onChange("htmlContent",e);
this._htmlBody=e
};
ZmMailMsg.prototype.setInviteDescriptionContent=function(t,e){
this._inviteDescBody[t]=e
};
ZmMailMsg.prototype.getInviteDescriptionContent=function(r){
if(!r){
r=ZmMimeTable.TEXT_HTML
}
var n=this._inviteDescBody[r];
if(!n){
var s=this._inviteDescBody[ZmMimeTable.TEXT_HTML];
var o=this._inviteDescBody[ZmMimeTable.TEXT_PLAIN];
if(!s&&o){
s=AjxStringUtil.convertToHtml(o)
}
if(!o&&s){
o=AjxStringUtil.convertHtml2Text(s)
}
n=(r==ZmMimeTable.TEXT_HTML)?s:o
}
var e=n?n.indexOf(ZmItem.NOTES_SEPARATOR):-1;
if(e==-1&&this.isInvite()){
var t=this.invite.getSummary((r==ZmMimeTable.TEXT_HTML));
n=n?(t+n):null
}
if(n!=null){
return{
ct:r,s:n.length,content:n}
}};
ZmMailMsg.prototype.sendInviteReply=function(h,s,r,o,t,n,e){
this._origMsg=this._origMsg||this;
if(s==0){
this._origMsg._customMsg=true
}
return this._sendInviteReply(h,s||0,r,o,t,n,e)
};
ZmMailMsg.prototype._sendInviteReply=function(o,g,c,u,y,e,v){
var w={
SendInviteReplyRequest:{
_jsns:"urn:zimbraMail"}};
var l=w.SendInviteReplyRequest;
l.id=this._origMsg.id;
l.compNum=g;
var h="ACCEPT";
var f=true;
switch(this.inviteMode){
case ZmOperation.REPLY_ACCEPT_IGNORE:f=false;
case ZmOperation.REPLY_ACCEPT_NOTIFY:case ZmOperation.REPLY_ACCEPT:h="ACCEPT";
break;
case ZmOperation.REPLY_DECLINE_IGNORE:f=false;
case ZmOperation.REPLY_DECLINE_NOTIFY:case ZmOperation.REPLY_DECLINE:h="DECLINE";
break;
case ZmOperation.REPLY_TENTATIVE_IGNORE:f=false;
case ZmOperation.REPLY_TENTATIVE_NOTIFY:case ZmOperation.REPLY_TENTATIVE:h="TENTATIVE";
break;
case ZmOperation.REPLY_NEW_TIME:h="DELEGATED";
break
}
l.verb=h;
var t=this._origMsg.invite;
if(this.getAddress(AjxEmailAddress.TO)==null&&!t.isOrganizer()){
var s=t.getOrganizerEmail()||t.getSentBy();
if(s==null){
var b=window.parentAppCtxt||window.appCtxt;
var n=b.accountList.mainAccount.getEmail();
var p=this._origMsg.getAddresses(AjxEmailAddress.FROM).get(0);
if(p&&p.address!=n){
s=p.address
}}
if(s){
this.setAddress(AjxEmailAddress.TO,(new AjxEmailAddress(s)))
}}
if(!this.identity){
var b=window.parentAppCtxt||window.appCtxt;
var r=(b.multiAccounts&&b.getActiveAccount().isMain)?b.accountList.defaultAccount:null;
var m=b.getIdentityCollection(r);
this.identity=m.selectIdentity(this._origMsg)
}
if(this.identity){
l.idnt=this.identity.id
}
var d={};
d[ZmOperation.REPLY_ACCEPT_NOTIFY]=ZmOperation.REPLY_ACCEPT;
d[ZmOperation.REPLY_ACCEPT_IGNORE]=ZmOperation.REPLY_ACCEPT;
d[ZmOperation.REPLY_DECLINE_NOTIFY]=ZmOperation.REPLY_DECLINE;
d[ZmOperation.REPLY_DECLINE_IGNORE]=ZmOperation.REPLY_DECLINE;
d[ZmOperation.REPLY_TENTATIVE_NOTIFY]=ZmOperation.REPLY_TENTATIVE;
d[ZmOperation.REPLY_TENTATIVE_IGNORE]=ZmOperation.REPLY_TENTATIVE;
if(!d[this.inviteMode]){
f=this._origMsg.needsRsvp()
}
return this._sendInviteReplyContinue(w,f?"TRUE":"FALSE",o,c,u,y,e)
};
ZmMailMsg.prototype._sendInviteReplyContinue=function(m,r,h,d,s,f,l){
var n=m.SendInviteReplyRequest;
n.updateOrganizer=r;
if(f){
var t=AjxDateUtil.getServerDateTime(f);
var c=AjxTimezone.getServerId(AjxTimezone.DEFAULT);
var e=AjxTimezone.getClientId(c);
ZmTimezone.set(n,e,null,true);
n.exceptId={
d:t,tz:c}
}
if(h){
this._createMessageNode(n,null,l)
}
var u=new AjxCallback(this,this._handleResponseSendInviteReply,[d]);
var o=this._sendMessage({
jsonObj:m,isInvite:true,isDraft:false,callback:u,errorCallback:s,accountName:l}
);
if(window.parentController){
window.close()
}
return o
};
ZmMailMsg.prototype._handleResponseSendInviteReply=function(r,e){
var o=e.getResponse();
var s=o.id?o.id.split("-")[0]:null;
var t=(s||o.status=="OK");
if(t){
this._notifySendListeners();
this._origMsg.folderId=ZmFolder.ID_TRASH
}
var n;
if((this.acceptFolderId!=ZmOrganizer.ID_CALENDAR)||(appCtxt.multiAccounts&&!this.getAccount().isMain&&this.acceptFolderId==ZmOrganizer.ID_CALENDAR)){
n=true
}
if(this.acceptFolderId&&n&&o.apptId!=null){
this.moveApptItem(o.apptId,this.acceptFolderId)
}
if(r){
r.run(e)
}};
ZmMailMsg.prototype.moveApptItem=function(s,e){
var n=appCtxt.getById(e);
if(n&&n.isRemote()){
var t=appCtxt.getConfirmationDialog();
var o=AjxMessageFormat.format(ZmMsg.confirmMoveApptToShared,[n.getName()]);
var r=new AjxCallback(this,this._moveApptItem,[s,e]);
t.popup(o,r)
}else{
this._moveApptItem(s,e)
}};
ZmMailMsg.prototype._moveApptItem=function(s,n){
var r=new AjxCallback(this,this._handleMoveApptResponse,[n]);
var e=new AjxCallback(this,this._handleMoveApptError,[n]);
var o=window.parentAppCtxt||window.appCtxt;
var t=o.multiAccounts&&o.accountList.mainAccount.name;
ZmItem.move(s,n,r,e,t)
};
ZmMailMsg.prototype._handleMoveApptResponse=function(e,t){
this._lastApptFolder=e
};
ZmMailMsg.prototype._handleMoveApptError=function(e,o){
var t={
msg:ZmMsg.errorMoveAppt,level:ZmStatusView.LEVEL_CRITICAL};
appCtxt.setStatusMsg(t);
return true
};
ZmMailMsg.prototype.send=function(e,d,r,l,t,c,o){
var m=l;
if(!m){
var h=appCtxt.getActiveAccount();
if(h&&!h.isMain){
m=h.name
}}
if(this.isInviteReply&&!e){
return this.sendInviteReply(true,0,d,r,this._instanceDate,m,true)
}else{
var u,s;
if(e){
u={
SaveDraftRequest:{
_jsns:"urn:zimbraMail"}};
s=u.SaveDraftRequest
}else{
u={
SendMsgRequest:{
_jsns:"urn:zimbraMail"}};
s=u.SendMsgRequest;
if(this.sendUID){
s.suid=this.sendUID
}}
if(t){
s.noSave=1
}
this._createMessageNode(s,e,m,c);
appCtxt.notifyZimlets("addExtraMsgParts",[s,e]);
var n={
jsonObj:u,isInvite:false,isDraft:e,accountName:m,callback:(new AjxCallback(this,this._handleResponseSend,[e,d])),errorCallback:r,batchCmd:o};
return this._sendMessage(n)
}};
ZmMailMsg.prototype._handleResponseSend=function(t,n,e){
var o=e.getResponse().m[0];
if(!t){
if(o.id||!appCtxt.get(ZmSetting.SAVE_TO_SENT)){
this._notifySendListeners()
}}else{
this._loadFromDom(o)
}
if(n){
n.run(e)
}};
ZmMailMsg.prototype._createMessageNode=function(n,t,c,h){
var R=n.m={};
var d=window.parentAppCtxt||window.appCtxt;
var e=d.accountList.activeAccount;
var r=d.accountList.mainAccount;
var y=!d.isOffline&&d.multiAccounts&&r.name!=c;
if(this.origId){
var x=this.origId;
if(y){
x=ZmOrganizer.getSystemId(this.origId,r,true)
}
R.origid=x
}
var B=null;
if((t||this.isDraft)&&this.id){
var A=d.getById(this.id);
var D=A?d.getById(A.folderId):null;
if(!D||(D&&!D.isInTrash())){
if(!d.isOffline&&!t&&this._origMsg&&this._origMsg.isDraft){
var k=d.accountList.defaultAccount||d.accountList.mainAccount;
var u=this._origMsg.getAddresses(AjxEmailAddress.FROM).get(0);
if(u&&u.address!=k.getEmail()){
B=(this.id.indexOf(":")==-1)?([k.id,":",this.id].join("")):this.id;
R.id=B
}else{
R.id=this.nId
}}else{
R.id=this.nId
}}}
if(this.isForwarded){
R.rt="w"
}else{
if(this.isReplied){
R.rt="r"
}}
if(this.identity){
R.idnt=this.identity.id
}
if(this.isHighPriority){
R.f=ZmItem.FLAG_HIGH_PRIORITY
}else{
if(this.isLowPriority){
R.f=ZmItem.FLAG_LOW_PRIORITY
}}
if(ZmMailMsg.COMPOSE_ADDRS.length>0){
var O=R.e=[];
for(var F=0;
F<ZmMailMsg.COMPOSE_ADDRS.length;
F++){
var Y=ZmMailMsg.COMPOSE_ADDRS[F];
this._addAddressNodes(O,Y,t)
}
this._addFrom(O,R,t,c);
this._addReplyTo(O);
if(h){
this._addReadReceipt(O,c)
}}
R.su={
_content:this.subject};
var g={
ct:this._topPart.getContentType()};
R.mp=[g];
var W=this._topPart.children?this._topPart.children.size():0;
if(W>0){
var H=g.mp=[];
for(var F=0;
F<W;
F++){
var f=this._topPart.children.get(F);
var l=f.getContent();
var m=f.children?f.children.size():0;
if(l==null&&m==0){
continue
}
var b={
ct:f.getContentType()};
if(m>0){
var T=b.mp=[];
for(var S=0;
S<m;
S++){
var o=f.children.get(S);
T.push({
ct:o.getContentType(),content:{
_content:o.getContent()}}
)
}
if(f.getContentType()==ZmMimeTable.MULTI_RELATED){
var z=this.getInlineAttachments()||[];
if(z.length){
for(S=0;
S<z.length;
S++){
var p={
ci:z[S].cid};
var I=p.attach={};
if(z[S].aid){
I.aid=z[S].aid
}else{
var x=(t||this.isDraft)?(B||this.id||this.origId):(this.origId||this.id);
if(!x&&this._origMsg){
x=this._origMsg.id
}
if(x&&y){
x=ZmOrganizer.getSystemId(x,r,true)
}
if(x){
I.mp=[{
mid:x,part:z[S].part}
]
}}
T.push(p)
}}
var s=this.getInlineDocAttachments()||[];
if(s.length){
for(S=0;
S<s.length;
S++){
var C={
ci:s[S].cid};
var I=C.attach={};
if(s[S].docpath){
I.doc=[{
path:s[S].docpath,optional:1}
]
}else{
if(s[S].docid){
I.doc=[{
id:s[S].docid}
]
}}
T.push(C)
}}}}else{
b.content={
_content:l}
}
H.push(b)
}}else{
g.content={
_content:this._topPart.getContent()}
}
if(this.irtMessageId){
R.irt={
_content:this.irtMessageId}
}
if(this.attId||(this._msgAttIds&&this._msgAttIds.length)||(this._docAttIds&&this._docAttIds.length)||(this._forAttIds&&this._forAttIds.length)){
var I=R.attach={};
if(this.attId){
I.aid=this.attId
}
if(this._msgAttIds&&this._msgAttIds.length){
var w=I.m=[];
for(var F=0;
F<this._msgAttIds.length;
F++){
w.push({
id:this._msgAttIds[F]}
)
}}
if(this._docAttIds){
var q=I.doc=[];
for(var F=0;
F<this._docAttIds.length;
F++){
q.push({
id:this._docAttIds[F]}
)
}}
if(this._forAttIds&&this._forAttIds.length){
var v=this._forAttIds;
if(v&&v.length){
var M=I.mp=[];
for(var F=0;
F<v.length;
F++){
var x=(t||this.isDraft)?(B||this.id||this.origId):(this.origId||this.id);
if(!x&&this._origMsg){
x=this._origMsg.id
}
if(!x&&(t||this.isDraft)&&appCtxt.multiAccounts){
x=this.origAcctMsgId
}
if(x&&y){
x=ZmOrganizer.getSystemId(x,r,true)
}
if(x){
M.push({
mid:x,part:v[F]}
)
}}}}}};
ZmMailMsg.prototype._sendMessage=function(t){
var n=new AjxCallback(this,this._handleResponseSendMessage,[t]);
if(window.parentController){
var o={
jsonObj:t.jsonObj,accountName:t.accountName,errorCallback:t.errorCallback};
var e=appCtxt.getAppController().sendRequest(o);
if(!e){
return
}
if(e.SendInviteReplyResponse){
return e.SendInviteReplyResponse
}else{
if(e.SaveDraftResponse){
e=e.SaveDraftResponse;
this._loadFromDom(e.m[0]);
return e
}else{
if(e.SendMsgResponse){
return e.SendMsgResponse
}}}}else{
if(t.batchCmd){
t.batchCmd.addNewRequestParams(t.jsonObj,n,t.errorCallback)
}else{
appCtxt.getAppController().sendRequest({
jsonObj:t.jsonObj,asyncMode:true,noBusyOverlay:t.isDraft,callback:n,errorCallback:t.errorCallback,accountName:t.accountName,timeout:((t.isDraft&&this.attId)?0:null)}
)
}}};
ZmMailMsg.prototype._handleResponseSendMessage=function(o,e){
var t=e.getResponse();
if(o.isInvite){
e.set(t.SendInviteReplyResponse)
}else{
if(o.isDraft){
e.set(t.SaveDraftResponse)
}else{
e.set(t.SendMsgResponse)
}}
if(o.callback){
o.callback.run(e)
}};
ZmMailMsg.prototype._notifySendListeners=function(){
var e;
if(this.isForwarded){
e=ZmItem.FLAG_FORWARDED
}else{
if(this.isReplied){
e=ZmItem.FLAG_REPLIED
}}
if(e&&this._origMsg){
this._origMsg[ZmItem.FLAG_PROP[e]]=true;
if(this._origMsg.list){
this._origMsg.list._notify(ZmEvent.E_FLAGS,{
items:[this._origMsg],flags:[e]}
)
}}};
ZmMailMsg.prototype.isRealAttachment=function(t){
var e=t.ct;
if(ZmMimeTable.isIgnored(e)){
return false
}
if(e==ZmMimeTable.TEXT_CAL&&appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&this.isInvite()){
return false
}
return true
};
ZmMailMsg.prototype.getContentPartAttachUrl=function(o,n){
if(this.attachments&&this.attachments.length>0&&(o==ZmMailMsg.CONTENT_PART_ID||o==ZmMailMsg.CONTENT_PART_LOCATION)){
for(var t=0;
t<this.attachments.length;
t++){
var e=this.attachments[t];
if(e[o]==n){
return[appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&id=",this.id,"&part=",e.part].join("")
}}}
return null
};
ZmMailMsg.prototype.findAttsFoundInMsgBody=function(){
if(this.findAttsFoundInMsgBodyDone){
return
}
var s="",r;
var o=this.getBodyParts();
for(var n=0;
n<o.length;
n++){
var t=o[n];
if(t.ct==ZmMimeTable.TEXT_HTML){
s=t.content;
var e=this;
s.replace(/dfsrc=([\x27\x22])cid:([^\x27\x22]+)\1/ig,function(l,c,d){
var h=e.findInlineAtt("<"+d+">");
if(h){
h.foundInMsgBody=true
}}
)
}}
this.findAttsFoundInMsgBodyDone=true
};
ZmMailMsg.prototype.hasInlineImagesInMsgBody=function(){
var e=this.getBodyPart(ZmMimeTable.TEXT_HTML);
if(e){
e=AjxUtil.isString(e)?e:e.content;
if(e&&e.search(/dfsrc=([\x27\x22])cid:([^\x27\x22]+)\1/ig)!=-1){
return true
}}
return false
};
ZmMailMsg.prototype.getAttachmentLinks=function(n,e,O){
this._attLinks=[];
var T=this.attachments;
if(O){
var p=this.getBodyParts();
if(p&&p.length>1){
var g=[],y;
for(var b=0;
b<p.length;
b++){
y=p[b];
if(y.filename&&y.cd=="inline"){
g.push(y)
}}
T=[].concat(T,g)
}}
if(T&&T.length>0){
var l=appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI)+"&loc="+AjxEnv.DEFAULT_LOCALE+"&id="+this.id+"&part=";
this.findAttsFoundInMsgBody();
for(var v=0;
v<T.length;
v++){
var x=T[v];
if(!this.isRealAttachment(x)||(x.ct.match(/^image/)&&x.ci&&x.foundInMsgBody&&!e)||(x.cd=="inline"&&x.filename&&ZmMimeTable.isRenderable(x.ct)&&!O)){
continue
}
var o={};
o.label=x.name||x.filename||(ZmMsg.unknown+" <"+x.ct+">");
var u=false;
if(x.s!=null&&x.s>=0){
if(x.s<1024){
o.size=x.s+" "+ZmMsg.b
}else{
if(x.s<(1024*1024)){
o.size=Math.round((x.s/1024)*10)/10+" "+ZmMsg.kb
}else{
o.size=Math.round((x.s/(1024*1024))*10)/10+" "+ZmMsg.mb
}}}else{
u=x.cl&&(x.relativeCl||ZmMailMsg.URL_RE.test(x.cl))
}
if(x.ct==ZmMimeTable.MSG_RFC822){
var m=[];
var w=0;
m[w++]="<a href='javascript:;' onclick='ZmMailMsgView.rfc822Callback(";
m[w++]='"';
m[w++]=this.id;
m[w++]='"';
m[w++]=',"';
m[w++]=x.part;
m[w++]="\"); return false;' class='AttLink'>";
o.link=m.join("");
if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&x.mp&&x.mp.length==1&&x.mp[0].ct==ZmMimeTable.TEXT_CAL){
var z='ZmMailMsgView.addToCalendarCallback("'+this.id+'","'+x.mp[0].part+'");';
o.importICSLink="<a style='text-decoration:underline' class='AttLink' href='javascript:;' onclick='"+z+"'>"
}}else{
var s=u?x.cl:(l+x.part);
if(!u){
var c=s.indexOf("?auth=co&");
var d=AjxStringUtil.urlComponentEncode(x.filename);
d=d.replace(/\x27/g,"%27");
s=s.substring(0,c)+d+s.substring(c)
}
o.link="<a target='_blank' class='AttLink' href='"+s+"'>";
if(!u){
o.download=["<a style='text-decoration:underline' class='AttLink' href='",s,appCtxt.get(ZmSetting.ATTACHMENTS_BLOCKED)?"' target='_blank'>":"&disp=a' onclick='ZmZimbraMail.unloadHackCallback();'>"].join("")
}
var h=appCtxt.getById(this.folderId);
if((x.name||x.filename)&&appCtxt.get(ZmSetting.BRIEFCASE_ENABLED)&&(h&&!h.isRemote())){
var r=o.label;
r=r.replace(/\x27/g,"\\'");
var z='ZmMailMsgView.briefcaseCallback("'+this.id+'","'+x.part+'","'+r+'");';
o.briefcaseLink="<a style='text-decoration:underline' class='AttLink' href='javascript:;' onclick='"+z+"'>"
}
var f=(x.filename&&x.filename.match(/\./)&&x.filename.replace(/^.*\./,"").toLowerCase()=="ics");
if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&((x.ct==ZmMimeTable.TEXT_CAL)||f)){
var z='ZmMailMsgView.addToCalendarCallback("'+this.id+'","'+x.part+'");';
o.importICSLink="<a style='text-decoration:underline' class='AttLink' href='javascript:;' onclick='"+z+"'>"
}
if(!u){
if(x.ct==ZmMimeTable.TEXT_VCARD||x.ct==ZmMimeTable.TEXT_DIRECTORY){
var t='ZmMailMsgView.vcardCallback("'+this.id+'","'+x.part+'");';
o.vcardLink="<a style='text-decoration:underline' class='AttLink' href='javascript:;' onclick='"+t+"'>"
}else{
if(ZmMimeTable.hasHtmlVersion(x.ct)&&appCtxt.get(ZmSetting.VIEW_ATTACHMENT_AS_HTML)){
o.htmlLink="<a style='text-decoration:underline' target='_blank' class='AttLink' href='"+s+"&view=html'>"
}else{
o.objectify=x.ct&&x.ct.match(/^image/)
}}}else{
o.url=s
}
var t='ZmMailMsgView.removeAttachmentCallback("'+this.id+'","'+x.part+'");';
o.removeLink="<a style='text-decoration:underline' class='AttLink' href='javascript:;' onclick='"+t+"'>"
}
var q=ZmMimeTable.getInfo(x.ct);
o.linkIcon=q?q.image:"GenericDoc";
o.ct=x.ct;
o.isHit=n&&this._isAttInHitList(x);
o.part=x.part;
if(!u){
o.url=[appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&loc=",AjxEnv.DEFAULT_LOCALE,"&id=",this.id,"&part=",x.part].join("")
}
if(x.ci||(e&&x.cd=="inline")){
o.ci=true
}
o.foundInMsgBody=x.foundInMsgBody;
this._attLinks.push(o)
}}
return this._attLinks
};
ZmMailMsg.prototype._loadFromDom=function(e){
if(e.id){
this.id=e.id
}
if(e.cid){
this.cid=e.cid
}
if(e.s){
this.size=e.s
}
if(e.d){
this.date=e.d
}
if(e.sd){
this.sentDate=e.sd
}
if(e.l){
this.folderId=e.l
}
if(e.t){
this._parseTags(e.t)
}
if(e.cm){
this.inHitList=e.cm
}
if(e.su){
this.subject=e.su
}
if(e.fr){
this.fragment=e.fr
}
if(e.rt){
this.rt=e.rt
}
if(e.idnt){
this.identity=appCtxt.getIdentityCollection().getById(e.idnt)
}
if(e.origid){
this.origId=e.origid
}
if(e.hp){
this._attHitList=e.hp
}
if(e.mid){
this.messageId=e.mid
}
if(e.irt){
this.irtMessageId=e.irt
}
if(e._attrs){
this.attrs=e._attrs
}
if(e.sf){
this.sf=e.sf
}
if(e.cif){
this.cif=e.cif
}
if(e.header){
this.headers={};
for(var h=0;
h<e.header.length;
h++){
this.headers[e.header[h].n]=e.header[h]._content
}}
if(e.meta){
this.meta={};
for(var h=0;
h<e.meta.length;
h++){
var d=e.meta[h].section;
this.meta[d]={};
this.meta[d]._attrs={};
for(a in e.meta[h]._attrs){
this.meta[d]._attrs[a]=e.meta[h]._attrs[a]
}}}
var u=this.id.indexOf(":");
this.nId=(u!=-1)?(this.id.substr(u+1)):this.id;
if(e._convCreateNode){
this._convCreateNode=e._convCreateNode
}
if(e.cid&&e.l){
var m=appCtxt.getById(e.cid);
if(m){
m.folders[e.l]=true;
if(!m.msgIds){
m.msgIds=[this.id]
}}}
this._parseFlags(e.f);
if(e.mp){
var n={
attachments:this.attachments,bodyParts:this._bodyParts};
this._topPart=ZmMimePart.createFromDom(e.mp,n);
this._loaded=this._bodyParts.length>0||this.attachments.length>0;
this._cleanupCIds()
}
if(e.shr){
var t=AjxXmlDoc.createFromXml(e.shr[0].content);
try{
AjxDispatcher.require("Share");
this.share=ZmShare.createFromDom(t.getDoc());
this.share._msgId=e.id
}
catch(c){}}
if(e.e&&this.participants&&this.participants.size()==0){
for(var h=0;
h<e.e.length;
h++){
this._parseParticipantNode(e.e[h])
}
this.clearAddresses();
var r=this.participants.getArray();
for(var s=0;
s<r.length;
s++){
this.addAddress(r[s])
}}
if(e.inv){
try{
this.invite=ZmInvite.createFromDom(e.inv);
this.invite.setMessageId(this.id);
var l=this.invite.getComponentDescription();
var o=this.invite.getComponentDescriptionHtml();
if(o){
this.setHtmlContent(o);
this.setInviteDescriptionContent(ZmMimeTable.TEXT_HTML,o)
}
if(l){
this.setInviteDescriptionContent(ZmMimeTable.TEXT_PLAIN,l)
}
if(!appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&this.invite.type=="appt"){
this.flagLocal(ZmItem.FLAG_ATTACH,true)
}}
catch(c){}}};
ZmMailMsg.prototype._cleanupCIds=function(o){
o=o||this.attachments;
if(!o||o.length==0){
return
}
for(var t=0;
t<o.length;
t++){
var e=o[t];
if(e.ci&&!/^<.+>$/.test(e.ci)){
e.ci="<"+e.ci+">"
}}};
ZmMailMsg.prototype.isInvite=function(){
return(this.invite!=null)
};
ZmMailMsg.prototype.needsRsvp=function(){
if(!this.isInvite()||this.invite.isOrganizer()){
return false
}
var n=false;
var t=appCtxt.getActiveAccount().getEmail();
if(this.isInvite()){
var e=this.invite.getAttendees();
for(var o in e){
if(e[o].url==t){
return e[o].rsvp
}
if(e[o].rsvp){
n=true
}}
e=this.invite.getResources();
for(var o in e){
if(e[o].url==t){
return e[o].rsvp
}
if(e[o].rsvp){
n=true
}}}
return n
};
ZmMailMsg.prototype._addAddressNodes=function(o,m,e){
var s=appCtxt.get(ZmSetting.AUTO_ADD_ADDRESS);
var c=this._addrs[m];
var h=c.size();
if(h){
var f=appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&appCtxt.getApp(ZmApp.CONTACTS);
if(f&&!f.isContactListLoaded()){
f=null
}
for(var r=0;
r<h;
r++){
var u=c.get(r);
var d=u.getAddress();
var t=u.getName();
var n={
t:AjxEmailAddress.toSoapType[m],a:d};
if(t){
n.p=t
}
if(f){
var l=f.getContactByEmail(d);
n.add=(s&&!l)?"1":"0"
}
o.push(n)
}}};
ZmMailMsg.prototype._addFrom=function(t,c,y,e){
var q=window.parentAppCtxt||window.appCtxt;
var z=this.identity;
var p=z==null||z.isDefault;
if(this._origMsg&&this._origMsg.isInvite()&&this.isReplied&&(!this._origMsg._customMsg||!z)){
var b=this._origMsg._getAttendees();
var u=b&&b.size()>0?b.size():0;
var r=","+appCtxt.get(ZmSetting.MAIL_ALIASES).join(",")+",";
for(var w=0;
w<u;
w++){
var v=b.get(w).address;
if(v&&r.indexOf(","+v+",")>=0){
var j={
t:"f",a:v};
t.push(j);
return
}}}
if(!appCtxt.isOffline&&e&&p){
var n=q.accountList.mainAccount.getEmail();
var m=false;
var h=appCtxt.getById(this.folderId);
if((!h||h.isRemote())&&(!this._origMsg||!this._origMsg.sendAsMe)){
e=(h&&h.getOwner())||e;
m=(e!=n)
}
if(this._origMsg&&this._origMsg.isDraft&&!this._origMsg.sendAsMe){
var g=this._origMsg.getAddresses(AjxEmailAddress.FROM).get(0);
if(g&&g.address.toLowerCase()!=n.toLowerCase()){
e=g.address;
m=true
}}
if(!m&&appCtxt.isFamilyMbox&&this._origMsg){
m=(h.getOwner()!=n)
}
var l,s;
if(this.fromSelectValue){
l=this.fromSelectValue.addr.address;
s=this.fromSelectValue.addr.name
}else{
if(this._origMsg&&this._origMsg.isInvite()&&appCtxt.multiAccounts){
z=this._origMsg.getAccount().getIdentity();
l=z?z.sendFromAddress:this._origMsg.getAccount().name;
s=z&&z.sendFromDisplay
}else{
if(m){
l=e
}else{
l=z?z.sendFromAddress:e;
s=z&&z.sendFromDisplay
}}}
var f={
t:"f",a:l};
if(s){
f.p=s
}
t.push(f);
if(m||!(q.multiAccounts||y)){
t.push({
t:"s",a:n}
)
}}else{
if(z){
var n=q.accountList.mainAccount.getEmail();
var m=false;
var h=appCtxt.getById(this.folderId);
if(h&&h.isRemote()&&!this._origMsg.sendAsMe){
e=h.getOwner();
m=(e!=n)
}
if(this._origMsg&&this._origMsg.isDraft&&!this._origMsg.sendAsMe){
var g=this._origMsg.getAddresses(AjxEmailAddress.FROM).get(0);
if(g&&g.address.toLowerCase()!=n.toLowerCase()&&!appCtxt.isMyAddress(g.address.toLowerCase())){
e=g.address;
m=true
}}
var l,s;
if(m){
l=e
}else{
l=z.sendFromAddress||n;
s=z.sendFromDisplay
}
var j={
t:"f",a:l};
if(s){
j.p=s
}
t.push(j);
if(m){
t.push({
t:"s",a:n}
)
}
if(z&&z.isFromDataSource){
var k=q.getDataSourceCollection().getById(z.id);
if(k){
var x=ZmDataSource.getProviderForAccount(k);
var d=x&&x._nosender;
if(!d){
j.t="s";
j.p=q.get(ZmSetting.DISPLAY_NAME)||"";
j={};
t.push(j)
}
j.t="f";
j.a=k.getEmail();
if(q.get(ZmSetting.DEFAULT_DISPLAY_NAME)){
var o=k.identity&&k.identity.sendFromDisplay;
j.p=o||k.userName||k.getName()
}}}}}};
ZmMailMsg.prototype._addReplyTo=function(e){
if(this.identity){
if(this.identity.setReplyTo&&this.identity.setReplyToAddress){
var t={
t:"r",a:this.identity.setReplyToAddress};
if(this.identity.setReplyToDisplay){
t.p=this.identity.setReplyToDisplay
}
e.push(t)
}}};
ZmMailMsg.prototype._addReadReceipt=function(t,e){
var o={
t:"n"};
if(this.identity){
o.a=this.identity.readReceiptAddr||this.identity.sendFromAddress;
o.p=this.identity.sendFromDisplay
}else{
o.a=e||appCtxt.getActiveAccount().getEmail()
}
t.push(o)
};
ZmMailMsg.prototype._isAttInHitList=function(e){
for(var t=0;
t<this._attHitList.length;
t++){
if(e.part==this._attHitList[t].part){
return true
}}
return false
};
ZmMailMsg.prototype._onChange=function(o,t,e,n){
if(this.onChange&&this.onChange instanceof AjxCallback){
this.onChange.run(o,t,e,n)
}};
ZmMailMsg.prototype.getStatusIcon=function(){
if(this.isInvite()&&appCtxt.get(ZmSetting.CALENDAR_ENABLED)){
var n=this.invite.getInviteMethod();
var e;
if(n==ZmCalendarApp.METHOD_REPLY){
var o=this.invite.getAttendees();
e=o&&o[0]&&o[0].ptst
}else{
if(n==ZmCalendarApp.METHOD_CANCEL){
e=ZmMailMsg.PSTATUS_DECLINED
}}
return ZmMailMsg.STATUS_ICON[e]||"Appointment"
}
for(var t=0;
t<ZmMailMsg.STATUS_LIST.length;
t++){
var e=ZmMailMsg.STATUS_LIST[t];
if(this[e]){
return ZmMailMsg.STATUS_ICON[e]
}}
return"MsgStatusRead"
};
ZmMailMsg.prototype.getStatusTooltip=function(){
var e=[];
if(this.isInvite()){
var t=this.getStatusIcon();
e.push(ZmMailMsg.TOOLTIP[t])
}
if(this.isUnread){
e.push(ZmMsg.unread)
}
if(this.isReplied){
e.push(ZmMsg.replied)
}
if(this.isForwarded){
e.push(ZmMsg.forwarded)
}
if(this.isSent){
e.push(ZmMsg.sentAt)
}
if(e.length==0){
e=[ZmMsg.read]
}
return e.join(", ")
};
ZmMailMsg.prototype.notifyModify=function(e,t){
if(e.cid!=null){
this.cid=e.cid
}
return ZmMailItem.prototype.notifyModify.apply(this,arguments)
};
ZmMailMsg.prototype.isResourceInvite=function(){
if(!this.cif||!this.invite){
return false
}
var t=this.invite.getResources();
for(var e in t){
if(t[e]&&t[e].url==this.cif){
return true
}}
return false
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmMimePart")){
ZmMimePart=function(){
ZmModel.call(this,ZmEvent.S_ATT);
this.children=new AjxVector();
this.node=new Object()
};
ZmMimePart.prototype=new ZmModel;
ZmMimePart.prototype.constructor=ZmMimePart;
ZmMimePart.prototype.toString=function(){
return"ZmMimePart"
};
ZmMimePart.createFromDom=function(t,e){
var o=new ZmMimePart();
o._loadFromDom(t,e.attachments,e.bodyParts,e.parentNode);
return o
};
ZmMimePart.prototype.getContent=function(){
return this.node.content
};
ZmMimePart.prototype.getContentForType=function(o){
var t=this.children.getArray();
if(t.length){
for(var e=0;
e<t.length;
e++){
if(t[e].getContentType()==o){
return t[e].getContent()
}}}else{
if(this.getContentType()==o){
return this.getContent()
}}
return null
};
ZmMimePart.prototype.setContent=function(e){
this.node.content=e
};
ZmMimePart.prototype.getContentDisposition=function(){
return this.node.cd
};
ZmMimePart.prototype.getContentType=function(){
return this.node.ct
};
ZmMimePart.prototype.setContentType=function(e){
this.node.ct=e
};
ZmMimePart.prototype.setIsBody=function(e){
this.node.body=e
};
ZmMimePart.prototype.getFilename=function(){
return this.node.filename
};
ZmMimePart.prototype.isIgnoredPart=function(e){
if(e&&e.ct==ZmMimeTable.MULTI_APPLE_DBL&&this.node.ct==ZmMimeTable.APP_APPLE_DOUBLE){
return true
}
if(this.node.body&&AjxUtil.isSpecified(this.node.content)&&(this.node.ct==ZmMimeTable.TEXT_HTML||this.node.ct==ZmMimeTable.TEXT_PLAIN)){
return true
}
if(this.node.ct==ZmMimeTable.MULTI_DIGEST){
return true
}
return false
};
ZmMimePart.prototype._loadFromDom=function(r,t,n,e){
for(var s=0;
s<r.length;
s++){
this.node=r[s];
if(this.node.content){
this._loaded=true
}
var h=false;
if(this.node.cd=="attachment"||this.node.ct==ZmMimeTable.MSG_RFC822||this.node.ct==ZmMimeTable.TEXT_CAL||this.node.filename!=null||this.node.ci!=null||this.node.cl!=null){
if(!this.isIgnoredPart(e)){
t.push(this.node);
h=true
}}
if(this.node.body){
var o=AjxUtil.isSpecified(this.node.content);
if((ZmMimeTable.isRenderableImage(this.node.ct)||o)){
n.push(this.node)
}else{
if(!h&&this.node.size!=0&&!this.isIgnoredPart(e)){
t.push(this.node);
h=true
}}}
if(this.node.mp&&this.node.ct!=ZmMimeTable.MSG_RFC822){
var l={
attachments:t,bodyParts:n,parentNode:this.node};
this.children.add(ZmMimePart.createFromDom(this.node.mp,l))
}}}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmMailList")){
ZmMailList=function(t,e){
ZmList.call(this,t,e);
this.convId=null;
var o=appCtxt.getFolderTree();
if(o){
this._folderChangeListener=new AjxListener(this,this._folderTreeChangeListener);
o.addChangeListener(this._folderChangeListener)
}};
ZmMailList.prototype=new ZmList;
ZmMailList.prototype.constructor=ZmMailList;
ZmMailList.prototype.toString=function(){
return"ZmMailList"
};
ZmMailList.prototype.moveItems=function(n){
if(this.type!=ZmItem.CONV){
return ZmList.prototype.moveItems.apply(this,arguments)
}
n=Dwt.getParams(arguments,["items","folder","attrs","callback","finalCallback"]);
n.items=AjxUtil.toArray(n.items);
var o=AjxUtil.hashCopy(n);
o.attrs={};
o.attrs.tcon=this._getTcon();
o.attrs.l=n.folder.id;
o.action=(n.folder.id==ZmFolder.ID_TRASH)?"trash":"move";
if(o.folder.id==ZmFolder.ID_TRASH){
if(o.items.length>1){
o.actionText=ZmMsg.actionTrash
}}else{
o.actionText=ZmMsg.actionMove;
o.actionArg=o.folder.getName(false,false,true)
}
o.callback=new AjxCallback(this,this._handleResponseMoveItems,n);
if(appCtxt.multiAccounts){
var t=n.items[0].getFolderId();
var e=appCtxt.getById(t);
if((n.items[0].isDraft&&n.folder.id==ZmFolder.ID_DRAFTS)||(n.folder.isRemote())||(e&&e.isRemote())){
o.accountName=n.items[0].getAccount().name
}}
this._itemAction(o)
};
ZmMailList.prototype.spamItems=function(o){
var e=o.items=AjxUtil.toArray(o.items);
if(appCtxt.multiAccounts){
var t=this._filterItemsByAccount(e);
this._spamAccountItems(t,o)
}else{
this._spamItems(o)
}};
ZmMailList.prototype._spamAccountItems=function(o,n){
var e;
for(var t in o){
e=o[t];
break
}
if(e){
delete o[t];
n.accountName=appCtxt.accountList.getAccount(t).name;
n.items=e;
n.callback=new AjxCallback(this,this._spamAccountItems,[o,n]);
this._spamItems(n)
}};
ZmMailList.prototype._spamItems=function(t){
t=Dwt.getParams(arguments,["items","markAsSpam","folder","childWin"]);
var e=AjxUtil.hashCopy(t);
if(this.type==ZmItem.MIXED&&!this._mixedType){
return this._mixedAction("spamItems",t)
}
e.action=t.markAsSpam?"spam":"!spam";
e.attrs={};
e.attrs.tcon=this._getTcon(t.items);
if(t.folder){
e.attrs.l=t.folder.id
}
e.actionText=t.markAsSpam?ZmMsg.actionMarkAsJunk:ZmMsg.actionMarkAsNotJunk;
e.callback=new AjxCallback(this,this._handleResponseSpamItems,t);
this._itemAction(e)
};
ZmMailList.prototype._handleResponseSpamItems=function(s,p){
var h=p.getResponse();
var c;
if(h&&h.length){
var o=s.markAsSpam?ZmFolder.ID_SPAM:(s.folder?s.folder.id:ZmFolder.ID_INBOX);
this.moveLocal(h,o);
var u=appCtxt.getCurrentController()._app._groupBy;
var n={};
for(var r=0;
r<h.length;
r++){
var f=h[r];
if(f.cid&&u==ZmMailListController.GROUP_BY_SETTING[ZmId.VIEW_CONVLIST]){
var m=appCtxt.getById(f.cid);
if(m){
if(!n[m.id]){
n[m.id]={
conv:m,msgs:[]}
}
n[m.id].msgs.push(f)
}}
var e={
oldFolderId:f.folderId,fields:{}};
e.fields[ZmItem.F_FRAGMENT]=true;
f.moveLocal(o)
}
for(var t in n){
if(n.hasOwnProperty(t)){
var m=n[t].conv;
var d=n[t].msgs;
m.updateFragment(d)
}}
var f=h[0];
var l=f.list;
if(l){
l._evt.batchMode=true;
l._evt.item=f;
l._evt.items=h;
l._notify(ZmEvent.E_MOVE,e)
}
if(s.actionText){
c=ZmList.getActionSummary(s.actionText,s.numItems,s.type,s.actionArg)
}
if(s.childWin){
s.childWin.close()
}}
s.actionSummary=c;
if(s.callback){
s.callback.run(p)
}};
ZmMailList.prototype.deleteItems=function(o){
o=Dwt.getParams(arguments,["items","hardDelete","attrs","childWin"]);
if(this.type==ZmItem.CONV||this._mixedType==ZmItem.CONV){
var t=this.search?appCtxt.getById(this.search.folderId):null;
if(t&&t.isHardDelete()){
var e=appCtxt.getAppController().getInstantNotify();
if(e){
appCtxt.getAppController().setInstantNotify(false);
o.errorCallback=new AjxCallback(this,this._handleErrorDeleteItems)
}
o.attrs=o.attrs||{};
o.attrs.tcon=ZmFolder.TCON_CODE[t.nId];
o.action="delete";
o.actionText=ZmMsg.actionDelete;
o.callback=new AjxCallback(this,this._handleResponseDeleteItems,e);
return this._itemAction(o)
}}
ZmList.prototype.deleteItems.call(this,o)
};
ZmMailList.prototype._handleResponseDeleteItems=function(t,e){
var n=e.getResponse();
if(n&&n.length){
this.deleteLocal(n);
for(var o=0;
o<n.length;
o++){
n[o].deleteLocal()
}
ZmModel.notifyEach(n,ZmEvent.E_DELETE)
}
if(t){
appCtxt.getAppController().setInstantNotify(true)
}};
ZmMailList.prototype._handleErrorDeleteItems=function(){
appCtxt.getAppController().setInstantNotify(true)
};
ZmMailList.prototype.markRead=function(s){
var t=AjxUtil.toArray(s.items);
var e;
if(t[0]&&t[0] instanceof ZmItem){
e=[];
for(var o=0;
o<t.length;
o++){
var n=t[o];
if((n.type==ZmItem.CONV&&n.hasFlag(ZmItem.FLAG_UNREAD,s.value))||(n.isUnread==s.value)){
e.push(n)
}}}else{
e=t
}
if(e.length){
s.items=e;
s.op="read";
if(e.length>1){
s.actionText=s.value?ZmMsg.actionMarkRead:ZmMsg.actionMarkUnread
}
this.flagItems(s)
}};
ZmMailList.prototype.deleteLocal=function(e){
for(var t=0;
t<e.length;
t++){
this.remove(e[t],true)
}};
ZmMailList.prototype.moveLocal=function(t,e){
ZmList.prototype.moveLocal.call(this,t,e);
if(e!=ZmFolder.ID_TRASH){
return
}
var n=[];
for(var o=0;
o<t.length;
o++){
if(t[o].isUnread){
t[o].flagLocal(ZmItem.FLAG_UNREAD,false);
n.push(t[o])
}}
ZmModel.notifyEach(n,ZmEvent.E_FLAGS,{
flags:[ZmItem.FLAG_UNREAD]}
)
};
ZmMailList.prototype.notifyCreate=function(r,d){
var b=[];
var v=[];
var w=[];
var m=[];
var s=[];
var t={};
var g={};
var y=this.search?this.search.sortBy:null;
var h={};
if(this.type==ZmItem.CONV){
for(var p in r){
if(this.getById(p)){
continue
}
t[p]=r[p];
var o=r[p];
if(this.search&&this.search.matches&&this.search.matches(o)&&!o.ignoreJunkTrash()){
if(!appCtxt.multiAccounts||(appCtxt.multiAccounts&&(this.search.isMultiAccount()||o.getAccount()==appCtxt.getActiveAccount()))){
o.list=this;
v.push(o)
}}}
for(var p in d){
var l=d[p];
var c=l.cid;
var f=this.search&&this.search.matches;
var e=f&&f(l)&&!l.ignoreJunkTrash();
var u=(!appCtxt.multiAccounts||(appCtxt.multiAccounts&&l.getAccount()==appCtxt.getActiveAccount()));
var o=t[c]||this.getById(c);
if(e&&u){
if(!o){
var n={
list:this};
if(l._convCreateNode){
if(l._convCreateNode._newId){
l._convCreateNode.id=l._convCreateNode._newId
}
o=ZmConv.createFromDom(l._convCreateNode,n)
}else{
o=appCtxt.getById(c)||ZmConv.createFromMsg(l,n)
}
t[c]=o;
o.folders[l.folderId]=true;
v.push(o)
}
o.list=this
}
if(o&&!(o.msgs&&o.msgs.getById(p))){
if(!o.msgs){
o.msgs=new ZmMailList(ZmItem.MSG);
o.msgs.addChangeListener(o._listChangeListener)
}
l.list=o.msgs;
if(!l.isSent&&l.isUnread){
o.isUnread=true;
m.push(o)
}
if(e){
l.inHitList=true
}
if(e||(!f&&!l.isSent)){
if(o.fragment!=l.fragment){
o.fragment=l.fragment;
g[ZmItem.F_FRAGMENT]=true
}
if(o.date!=l.date){
o.date=l.date;
g[ZmItem.F_DATE]=true
}
if(!t[o.id]&&this._vector.contains(o)){
g[ZmItem.F_INDEX]=true
}
s.push(o)
}
w.push(l)
}}}else{
if(this.type==ZmItem.MSG){
for(var p in d){
var l=d[p];
if(this.getById(p)){
if(this.search.matches&&this.search.matches&&this.search.matches(l)&&!l.ignoreJunkTrash()){
l.list=this
}
continue
}
if(this.convId){
if(l.cid==this.convId&&!this.getById(l.id)){
l.list=this;
w.push(l)
}}else{
if(this.search.matches&&this.search.matches&&this.search.matches(l)&&!l.ignoreJunkTrash()){
l.list=this;
w.push(l)
}}}}}
if(v.length>1){
ZmMailItem.sortBy=y;
v.sort(ZmMailItem.sortCompare);
v.reverse()
}
this._sortAndNotify(v,y,ZmEvent.E_CREATE);
this._sortAndNotify(w,y,ZmEvent.E_CREATE);
ZmModel.notifyEach(m,ZmEvent.E_FLAGS,{
flags:[ZmItem.FLAG_UNREAD]}
);
this._sortAndNotify(s,y,ZmEvent.E_MODIFY,{
fields:g}
);
this._sortAndNotify(w,y,ZmEvent.E_MODIFY,{
fields:g}
)
};
ZmMailList.prototype.addMsgs=function(t){
var e=[];
for(var n in t){
var o=t[n];
if(o.cid==this.convId){
this.add(o,0);
o.list=this;
e.push(o)
}}
ZmModel.notifyEach(e,ZmEvent.E_CREATE)
};
ZmMailList.prototype.remove=function(e,t){
if(!this.convId||t){
ZmList.prototype.remove.call(this,e)
}};
ZmMailList.prototype.clear=function(){
if(this._folderChangeListener){
var t=appCtxt.getFolderTree();
if(t){
t.removeChangeListener(this._folderChangeListener)
}}
if(this._tagChangeListener){
var e=appCtxt.getTagTree();
if(e){
e.removeChangeListener(this._tagChangeListener)
}}
ZmList.prototype.clear.call(this)
};
ZmMailList.prototype.getFirstHit=function(h,t){
if(this.type!=ZmItem.MSG){
return null
}
var r=null;
h=h||0;
t=t||appCtxt.get(ZmSetting.CONVERSATION_PAGE_SIZE);
var s=this.size();
if(s>0&&h>=0&&h<s){
var e=(h+t>s)?s:h+t;
var n=this.getArray();
for(var o=h;
o<e;
o++){
if(n[o].inHitList){
r=n[o];
break
}}
if(!r){
r=n[0]
}}
return r
};
ZmMailList.prototype._getSortIndex=function(n,r){
if(!r||(r!=ZmSearch.DATE_DESC&&r!=ZmSearch.DATE_ASC)){
return 0
}
var s=parseInt(n.date);
var e=this.getArray();
for(var o=0;
o<e.length;
o++){
var t=parseInt(e[o].date);
if((r==ZmSearch.DATE_DESC&&(s>=t))||(r==ZmSearch.DATE_ASC&&(s<=t))){
return o
}}
return o
};
ZmMailList.prototype._sortAndNotify=function(h,c,t,e){
if(!(h&&h.length)){
return
}
var r=h[0]&&h[0].type;
if((this.type==ZmItem.MSG)&&(r==ZmItem.CONV)){
return
}
e=e||{};
var l=((t==ZmEvent.E_CREATE)||(e.fields&&e.fields[ZmItem.F_DATE]));
for(var n=0;
n<h.length;
n++){
var u=h[n];
if(l){
var o=(r==this.type);
var s=0;
if(this.type==ZmItem.CONV&&r==ZmItem.MSG){
var d=this.getById(u.cid);
if(d){
s=d.msgs._getSortIndex(u,d._sortBy);
if(t==ZmEvent.E_CREATE){
d.addMsg(u,s)
}}}else{
s=this._getSortIndex(u,c)
}
if(t!=ZmEvent.E_CREATE){
if(s!=this.indexOf(u)){
this.remove(u)
}else{
o=false
}}
if(o){
this.add(u,s)
}
e.sortIndex=s
}
u._notify(t,e)
}};
ZmMailList.prototype._getTcon=function(){
var s=[];
var n=[ZmFolder.ID_TRASH,ZmFolder.ID_SPAM,ZmFolder.ID_SENT];
var o=this.search&&appCtxt.getById(this.search.folderId);
var e=o&&(o.isRemote()?o.rid:o.nId);
for(var t=0;
t<n.length;
t++){
if(e!=n[t]){
s.push(ZmFolder.TCON_CODE[n[t]])
}}
return(s.length)?("-"+s.join("")):""
};
ZmMailList.prototype._folderTreeChangeListener=function(h){
if(this.size()==0){
return
}
var s=h.getDetail("flag");
var l=appCtxt.getCurrentViewId();
var d=appCtxt.getCurrentController();
if(h.event==ZmEvent.E_FLAGS&&(s==ZmItem.FLAG_UNREAD)){
if(this.type==ZmItem.CONV){
if(l==ZmId.VIEW_CONVLIST&&d._currentSearch.hasUnreadTerm){
this._redoSearch(d)
}}else{
if(this.type==ZmItem.MSG){
if(l==ZmId.VIEW_TRAD&&d._currentSearch.hasUnreadTerm){
this._redoSearch(d)
}else{
var n=h.getDetail("state");
var c=h.getDetail("item");
var r=[];
var o=this.getArray();
for(var t=0;
t<o.length;
t++){
var e=o[t];
if((c.type==ZmOrganizer.FOLDER&&e.folderId==c.id)||(c.type==ZmOrganizer.TAG&&e.hasTag(c.id))){
e.isUnread=n;
r.push(e)
}}
ZmModel.notifyEach(r,ZmEvent.E_FLAGS,{
flags:[s]}
)
}}}}else{
ZmList.prototype._folderTreeChangeListener.call(this,h)
}};
ZmMailList.prototype._tagTreeChangeListener=function(t){
if(this.size()==0){
return
}
var e=t.getDetail("flag");
if(t.event==ZmEvent.E_FLAGS&&(e==ZmItem.FLAG_UNREAD)){
this._folderTreeChangeListener(t)
}else{
ZmList.prototype._tagTreeChangeListener.call(this,t)
}}
}
if(AjxPackage.define("zimbraMail.mail.view.object.ZmImageAttachmentObjectHandler")){
ZmImageAttachmentObjectHandler=function(){
ZmObjectHandler.call(this,ZmImageAttachmentObjectHandler.TYPE);
this._imageHash={}
};
ZmImageAttachmentObjectHandler.prototype=new ZmObjectHandler;
ZmImageAttachmentObjectHandler.prototype.constructor=ZmImageAttachmentObjectHandler;
ZmImageAttachmentObjectHandler.TYPE="imageAttachemnt";
ZmImageAttachmentObjectHandler.THUMB_SIZE='width="320" height="240"';
ZmImageAttachmentObjectHandler.THUMB_SIZE_MAX=320;
ZmImageAttachmentObjectHandler.prototype._getHtmlContent=function(o,e,n,t){
o[e++]=n;
return e
};
ZmImageAttachmentObjectHandler.prototype.getToolTipText=function(e,t){
var n=this._imageHash[t.url];
if(!n){
n={
id:Dwt.getNextId()};
this._imageHash[t.url]=n;
this._preload(t.url,n.id)
}
var o=document.getElementById(n.id);
if(o&&!n.el){
n.el=o
}
if(n.el){
return n.el.xml||n.el.outerHTML
}
return'<img id="'+n.id+'" style="visibility:hidden;"/>'
};
ZmImageAttachmentObjectHandler.prototype.getActionMenu=function(e){
return null
};
ZmImageAttachmentObjectHandler.prototype._preload=function(t,o){
var e=new Image();
e.onload=AjxCallback.simpleClosure(this._setSize,this,o,e);
e.src=t
};
ZmImageAttachmentObjectHandler.prototype._setSize=function(s,t){
var n=document.getElementById(s);
if(n){
var o=t.width;
var e=t.height;
if(o>ZmImageAttachmentObjectHandler.THUMB_SIZE_MAX&&o>=e){
n.width=ZmImageAttachmentObjectHandler.THUMB_SIZE_MAX
}else{
if(e>ZmImageAttachmentObjectHandler.THUMB_SIZE_MAX&&e>o){
n.height=ZmImageAttachmentObjectHandler.THUMB_SIZE_MAX
}else{
n.width=o;
n.width=e
}}
n.src=t.src;
n.style.visibility="visible"
}
t.onload=null;
t=null
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmMailListView")){
ZmMailListView=function(e){
if(arguments.length==0){
return
}
e.pageless=true;
ZmListView.call(this,e);
this._folderId=null;
this._selectAllEnabled=true;
this._isMultiColumn=this.isMultiColumn();
if(!this._isMultiColumn){
this._normalClass=ZmMailListView.ROW_DOUBLE_CLASS
}};
ZmMailListView.prototype=new ZmListView;
ZmMailListView.prototype.constructor=ZmMailListView;
ZmMailListView.ROW_DOUBLE_CLASS="RowDouble";
ZmMailListView.FIRST_ITEM=-1;
ZmMailListView.LAST_ITEM=-2;
ZmMailListView.SINGLE_COLUMN_SORT=[{
field:ZmItem.F_FROM,msg:"from"}
,{
field:ZmItem.F_SUBJECT,msg:"subject"}
,{
field:ZmItem.F_SIZE,msg:"size"}
,{
field:ZmItem.F_DATE,msg:"date"}
];
ZmMailListView.prototype.toString=function(){
return"ZmMailListView"
};
ZmMailListView.prototype.markUIAsRead=function(o){
var e=this._getRowClass(o);
if(this._isMultiColumn){
var n=this._getElement(o,ZmItem.F_ITEM_ROW);
if(n){
n.className=e
}}else{
var n=this._getElement(o,ZmItem.F_ITEM_ROW);
if(n){
n.className=e
}
var t=this._getElement(o,ZmItem.F_ITEM_ROW_3PANE);
if(t){
t.className=e
}}};
ZmMailListView.prototype.set=function(r,t){
var n=this._controller._activeSearch&&this._controller._activeSearch.search;
this._folderId=n&&n.folderId;
ZmListView.prototype.set.apply(this,arguments);
var h=n&&n.sortBy;
if(h){
var o;
if(h==ZmSearch.SUBJ_DESC||h==ZmSearch.SUBJ_ASC){
o=ZmItem.F_SUBJECT
}else{
if(h==ZmSearch.DATE_DESC||h==ZmSearch.DATE_ASC){
o=ZmItem.F_DATE
}else{
if(h==ZmSearch.NAME_DESC||h==ZmSearch.NAME_ASC){
o=ZmItem.F_FROM
}else{
if(h==ZmSearch.SIZE_DESC||h==ZmSearch.SIZE_ASC){
o=ZmItem.F_SIZE
}}}}
if(o){
var e=(h==ZmSearch.SUBJ_ASC||h==ZmSearch.DATE_ASC||h==ZmSearch.NAME_ASC||h==ZmSearch.SIZE_ASC);
this.setSortByAsc(o,e)
}}
this.markDefaultSelection(r)
};
ZmMailListView.prototype.markDefaultSelection=function(n){
if(window.defaultSelection){
var o=[];
var e=n.getArray();
for(var t in e){
if(window.defaultSelection[e[t].id]){
o.push(e[t])
}}
if(o.length>0){
this.setSelectedItems(o)
}
window.defaultSelection=null
}};
ZmMailListView.prototype.handleKeyAction=function(t,o){
if(t==DwtKeyMap.SELECT_NEXT||t==DwtKeyMap.SELECT_PREV){
this._controller.lastListAction=t
}else{
if(t==DwtKeyMap.SELECT_ALL){
DwtListView.prototype.handleKeyAction.apply(this,arguments);
var e=this._controller;
e._resetOperations(e._toolbar[e._currentView],this.getSelectionCount());
return true
}}
return DwtListView.prototype.handleKeyAction.apply(this,arguments)
};
ZmMailListView.prototype.getTitle=function(){
var e=this._controller._activeSearch?this._controller._activeSearch.search:null;
return e?e.getTitle():""
};
ZmMailListView.prototype.replenish=function(e){
DwtListView.prototype.replenish.call(this,e);
this._resetColWidth()
};
ZmMailListView.prototype.resetSize=function(o,t){
this.setSize(o,t);
var e=(t==Dwt.DEFAULT)?t:t-DwtListView.HEADERITEM_HEIGHT;
Dwt.setSize(this._parentEl,o,e)
};
ZmMailListView.prototype.calculateMaxEntries=function(){
return(Math.floor(this._parentEl.clientHeight/(this._isMultiColumn?20:40))+5)
};
ZmMailListView.prototype.isMultiColumn=function(t){
var e=t||this._controller;
return !e.isReadingPaneOnRight()
};
ZmMailListView.prototype._getAbridgedContent=function(e,t){};
ZmMailListView.prototype._getStyleViaZimlet=function(o,t){
if(o!="fr"&&o!="su"&&o!="st"){
return""
}
if(appCtxt.zimletsPresent()&&this._ignoreProcessingGetMailCellStyle==undefined){
if(!this._zimletMgr){
this._zimletMgr=appCtxt.getZimletMgr()
}
var e=this._zimletMgr.processARequest("getMailCellStyle",t,o);
if(e!=undefined&&e!=null){
return e
}else{
if(e==null&&this._zimletMgr.isLoaded()){
this._ignoreProcessingGetMailCellStyle=true
}}}
return""
};
ZmMailListView.prototype._getAbridgedCell=function(l,h,c,r,o,e,n){
var t={};
l[h++]="<td";
l[h++]=this._getStyleViaZimlet(r,c);
if(e){
l[h++]=" width='";
l[h++]=e;
l[h++]="'"
}
l[h++]=" id='";
l[h++]=this._getCellId(c,r,t);
l[h++]="'";
var s=this._getCellClass(c,r,t);
if(s){
l[h++]=" class='";
l[h++]=s;
l[h++]="'"
}
if(n){
l[h++]=" ";
l[h++]=n
}
l[h++]=">";
h=this._getCellContents(l,h,c,r,o,t);
l[h++]="</td>";
return h
};
ZmMailListView.prototype._getCellContents=function(t,e,o,n,r,s){
if(n==ZmItem.F_ACCOUNT){
e=this._getImageHtml(t,e,o.getAccount().getIcon(),this._getFieldId(o,n))
}else{
e=ZmListView.prototype._getCellContents.apply(this,arguments)
}
return e
};
ZmMailListView.prototype.reRenderListView=function(){
var t=this.isMultiColumn();
if(t!=this._isMultiColumn){
this._saveState({
selection:true,focus:true,scroll:true,expansion:true}
);
this._isMultiColumn=t;
this.headerColCreated=false;
this._headerList=this._getHeaderList();
this._rowHeight=null;
this._normalClass=t?DwtListView.ROW_CLASS:ZmMailListView.ROW_DOUBLE_CLASS;
var e=this.getList()||(new AjxVector());
this.set(e.clone());
this._restoreState();
this._resetFromColumnLabel()
}};
ZmMailListView.prototype._initHeaders=function(){
if(!this._headerInit){
this._headerInit={};
this._headerInit[ZmItem.F_SELECTION]={
icon:"CheckboxUnchecked",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.selection,precondition:ZmSetting.SHOW_SELECTION_CHECKBOX};
this._headerInit[ZmItem.F_FLAG]={
icon:"FlagRed",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.flag,sortable:ZmItem.F_FLAG,noSortArrow:true,precondition:ZmSetting.FLAGGING_ENABLED};
this._headerInit[ZmItem.F_PRIORITY]={
icon:"PriorityHigh_list",width:ZmListView.COL_WIDTH_NARROW_ICON,name:ZmMsg.priority,precondition:ZmSetting.MAIL_PRIORITY_ENABLED};
this._headerInit[ZmItem.F_TAG]={
icon:"Tag",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.tag,precondition:ZmSetting.TAGGING_ENABLED};
this._headerInit[ZmItem.F_ACCOUNT]={
icon:"AccountAll",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.account,noRemove:true,resizeable:true};
this._headerInit[ZmItem.F_STATUS]={
icon:"MsgStatus",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.status};
this._headerInit[ZmItem.F_FROM]={
text:ZmMsg.from,width:ZmMsg.COLUMN_WIDTH_FROM_MLV,resizeable:true,sortable:ZmItem.F_FROM};
this._headerInit[ZmItem.F_ATTACHMENT]={
icon:"Attachment",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.attachment,sortable:ZmItem.F_ATTACHMENT,noSortArrow:true};
this._headerInit[ZmItem.F_SUBJECT]={
text:ZmMsg.subject,sortable:ZmItem.F_SUBJECT,noRemove:true,resizeable:true};
this._headerInit[ZmItem.F_FOLDER]={
text:ZmMsg.folder,width:ZmMsg.COLUMN_WIDTH_FOLDER,resizeable:true};
this._headerInit[ZmItem.F_SIZE]={
text:ZmMsg.size,width:ZmMsg.COLUMN_WIDTH_SIZE,sortable:ZmItem.F_SIZE,resizeable:true};
this._headerInit[ZmItem.F_DATE]={
text:ZmMsg.received,width:ZmMsg.COLUMN_WIDTH_DATE,sortable:ZmItem.F_DATE,resizeable:true};
this._headerInit[ZmItem.F_SORTED_BY]={
text:AjxMessageFormat.format(ZmMsg.arrangedBy,ZmMsg.date),sortable:ZmItem.F_SORTED_BY,resizeable:false}
}};
ZmMailListView.prototype._getHeaders=function(u,e){
this._initHeaders();
var m=[];
this._defaultCols=e.join(ZmListView.COL_JOIN);
var l=appCtxt.get(ZmSetting.READING_PANE_LOCATION)!=ZmSetting.RP_RIGHT;
var c=l&&appCtxt.get(ZmSetting.LIST_VIEW_COLUMNS,u);
var t=e;
if(c&&l){
t=c.split(ZmListView.COL_JOIN);
if(t.length!=e.length){
t=this._normalizeHeaders(t,e)
}}
for(var s=0,h=t.length;
s<h;
s++){
var r=t[s];
var d=r.substr(0,2);
var n=this._headerInit[d];
if(!n){
continue
}
var o=n.precondition;
if(!o||appCtxt.get(o)){
n.field=d;
if(appCtxt.multiAccounts&&appCtxt.inStartup&&appCtxt.accountList.size()>2&&appCtxt.get(ZmSetting.OFFLINE_SHOW_ALL_MAILBOXES)&&r.indexOf(ZmItem.F_ACCOUNT)!=-1){
n.visible=true;
this._showingAccountColumn=true
}else{
n.visible=(appCtxt.multiAccounts&&r==ZmItem.F_ACCOUNT&&!c)?false:(r.indexOf("*")==-1)
}
m.push(new DwtListHeaderItem(n))
}}
return m
};
ZmMailListView.prototype._normalizeHeaders=function(l,t){
var e=AjxUtil.arrayAsHash(t);
var o=[],u={}
,n={};
for(var r=0;
r<l.length;
r++){
var d=l[r];
var c=d.indexOf("*");
if(c!=-1){
d=d.substr(0,c);
n[d]=true
}
if(e[d]&&!u[d]){
o.push(d);
u[d]=true
}}
for(var s=0;
s<t.length;
s++){
var d=t[s];
if(!u[d]){
if(d==ZmId.FLD_ACCOUNT){
n[ZmItem.F_ACCOUNT]=true
}
o.splice(o.length-1,0,d)
}}
var h=AjxUtil.map(o,function(m){
return n[m]?m+"*":m
}
);
appCtxt.set(ZmSetting.LIST_VIEW_COLUMNS,h.join(ZmListView.COL_JOIN),this.view);
return h
};
ZmMailListView.prototype.createHeaderHtml=function(c){
if(appCtxt.multiAccounts){
var n=appCtxt.getSearchController().searchAllAccounts;
if(this._headerHash&&((this._showingAccountColumn&&!n)||(!this._showingAccountColumn&&n))){
var r=this._headerHash[ZmItem.F_ACCOUNT];
if(r){
r._visible=this._showingAccountColumn=n;
this.headerColCreated=false
}}}
if(this._headerList&&!this.headerColCreated){
var s=appCtxt.get(ZmSetting.READING_PANE_LOCATION);
if(s==ZmSetting.RP_RIGHT&&this._controller._itemCountText[s]){
this._controller._itemCountText[s].dispose()
}
DwtListView.prototype.createHeaderHtml.apply(this,arguments);
if(s==ZmSetting.RP_RIGHT){
var t=document.getElementById(this._itemCountTextTdId);
if(t){
var u=DwtId._makeId(this.view,s,"text");
var o=document.getElementById(u);
if(!o){
var d=this._controller._itemCountText[s]=new DwtText({
parent:this,className:"itemCountText",id:u}
);
t.appendChild(d.getHtmlElement())
}}}}
this._resetFromColumnLabel();
var l=this._headerHash[ZmItem.F_DATE];
if(l){
var e=ZmMsg.received;
if(this._isOutboundFolder()){
e=(this._folderId==ZmFolder.ID_DRAFTS)?ZmMsg.lastSaved:ZmMsg.sentAt
}
var h=document.getElementById(DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,l._field));
if(h){
h.innerHTML="&nbsp;"+e
}
if(this._colHeaderActionMenu){
this._colHeaderActionMenu.getItem(l._index).setText(e)
}}};
ZmMailListView.prototype._createHeader=function(c,l,s,o,t,e,h){
if(s._field==ZmItem.F_SORTED_BY){
var r=s._field;
var n=this._itemCountTextTdId=DwtId._makeId(this.view,ZmSetting.RP_RIGHT,"td");
c[l++]="<td id='";
c[l++]=e;
c[l++]="' class='";
c[l++]=(e==this._currentColId)?"DwtListView-Column DwtListView-ColumnActive'":"DwtListView-Column'";
c[l++]=" width='auto'><table border=0 cellpadding=0 cellspacing=0 width='100%'><tr><td id='";
c[l++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,r);
c[l++]="' class='DwtListHeaderItem-label'>";
c[l++]=s._label;
c[l++]="</td>";
c[l++]="<td class='itemSortIcon' id='";
c[l++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,r);
c[l++]="'>";
c[l++]=AjxImg.getImageHtml(this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow");
c[l++]="</td>";
c[l++]="<td align=right class='itemCountText' id='";
c[l++]=n;
c[l++]="'></td></tr></table></div></td>"
}else{
return DwtListView.prototype._createHeader.apply(this,arguments)
}};
ZmMailListView.prototype._resetColWidth=function(){
if(!this.headerColCreated){
return
}
var t=this._getLastColumnIndex();
if(t){
var e=this._headerList[t];
if(e._field!=ZmItem.F_SORTED_BY){
DwtListView.prototype._resetColWidth.apply(this,arguments)
}}};
ZmMailListView.prototype._mouseOverAction=function(t,n){
var e=this._getItemData(n,"type");
if(e==DwtListView.TYPE_HEADER_ITEM){
var o=this.getItemFromElement(n);
if(o&&this.sortingEnabled&&o._sortable&&o._sortable==ZmItem.F_FROM){
if(this._isOutboundFolder()){
n.className="DwtListView-Column DwtListView-ColumnHover";
return true
}}}
return ZmListView.prototype._mouseOverAction.apply(this,arguments)
};
ZmMailListView.prototype._columnClicked=function(o,l){
var c=this.getItemFromElement(o);
if(c&&c._sortable&&c._sortable==ZmItem.F_FROM){
if(this._isOutboundFolder()){
var e=this.getSelection();
var s=[];
for(var n=0,r=e.length;
n<r;
n++){
var t=e[n].getAddresses(AjxEmailAddress.TO);
s=s.concat(t.getArray())
}
var h=appCtxt.getAddrSelectDialog();
h.popup(s,this._folderId);
this._checkSelectionColumnClicked(o,l);
return
}}
ZmListView.prototype._columnClicked.call(this,o,l)
};
ZmMailListView.prototype._resetFromColumnLabel=function(){
var n=this._headerHash[ZmItem.F_FROM];
if(n){
var t=this._isOutboundFolder()?ZmMsg.to:ZmMsg.from;
var e=document.getElementById(DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,n._field));
if(e){
e.innerHTML="&nbsp;"+t
}
var o=(this._colHeaderActionMenu)?this._colHeaderActionMenu.getItem(n._index):null;
if(o){
o.setText(t)
}}};
ZmMailListView.prototype._isOutboundFolder=function(e){
e=e||(this._folderId&&appCtxt.getById(this._folderId));
return(e&&e.isOutbound())
};
ZmMailListView.prototype._getRowClass=function(e){
return e.isUnread?"Unread":null
};
ZmMailListView.prototype._getCellId=function(e,t){
return(t==ZmItem.F_SIZE||t==ZmItem.F_SUBJECT||t==ZmItem.F_SORTED_BY)?this._getFieldId(e,t):ZmListView.prototype._getCellId.apply(this,arguments)
};
ZmMailListView.prototype._getHeaderToolTip=function(t,e){
var o=this._isOutboundFolder();
if(t==ZmItem.F_FROM&&o){
return this._headerList[e]._sortable?ZmMsg.sortByTo:ZmMsg.to
}else{
if(t==ZmItem.F_STATUS){
return ZmMsg.messageStatus
}else{
return ZmListView.prototype._getHeaderToolTip.call(this,t,e,o)
}}};
ZmMailListView.prototype._getToolTip=function(h){
var n,r=h.field,o=h.item;
if(!o){
return
}
if(r==ZmItem.F_STATUS){
n=o.getStatusTooltip()
}else{
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&(r==ZmItem.F_FROM||r==ZmItem.F_PARTICIPANT)){
n={
callback:new AjxCallback(this,this._getParticipantToolTip,[o.getAddress(AjxEmailAddress.FROM)]),loading:true}
}else{
if(r==ZmItem.F_SUBJECT){
if((o.type==ZmItem.MSG)&&o.isInvite()&&o.needsRsvp()){
n=o.invite.getToolTip()
}else{
if(appCtxt.get(ZmSetting.SHOW_FRAGMENTS)){
n=AjxStringUtil.htmlEncode(o.fragment||ZmMsg.fragmentIsEmpty);
if(n==""){
n=null
}}}}else{
if(r==ZmItem.F_FOLDER){
var t=appCtxt.getById(o.folderId);
if(t&&t.parent){
var e=t.getName();
var s=t.getPath();
if(s!=e){
n=s
}}}else{
if(r==ZmItem.F_ACCOUNT){
n=o.getAccount().getDisplayName()
}else{
n=ZmListView.prototype._getToolTip.apply(this,arguments)
}}}}}
return n
};
ZmMailListView.prototype._getParticipantToolTip=function(e,n){
var o=e&&e.getAddress();
if(!o||!appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
return
}
if(n){
var t=new AjxCallback(this,this._handleResponseGetContact,[e,n]);
appCtxt.getApp(ZmApp.CONTACTS).getContactByEmail(o,t)
}else{
return this._handleResponseGetContact(e,null,appCtxt.getApp(ZmApp.CONTACTS).getContactByEmail(o))
}};
ZmMailListView.prototype._handleResponseGetContact=function(t,n,e){
var o;
if(e){
o=e.getToolTip(t.getAddress())
}else{
o=t&&AjxTemplate.expand("abook.Contacts#TooltipNotInAddrBook",{
addrstr:t.toString()}
)
}
if(n){
n.run(o)
}else{
return o
}};
ZmMailListView.prototype._getCell=function(p,f,y,u,s,n){
var o=this._getCellId(y,u,n);
var m=o?[" id=","'",o,"'"].join(""):"";
var t=this._getCellWidth(s,n);
var l=t?([" width=",t].join("")):(" width='100%'");
var c=this._getCellClass(y,u,n);
var r=c?[" class=",c].join(""):"";
var g=this._getCellAlign(s,n);
var d=g?[" align=",g].join(""):"";
var e=(this._getCellAttrText(y,u,n))||"";
var h=[m,l,r,d,e].join(" ");
p[f++]="<td";
p[f++]=this._getStyleViaZimlet(u,y);
p[f++]=h?(" "+h):"";
p[f++]=">";
f=this._getCellContents(p,f,y,u,s,n);
p[f++]="</td>";
return f
};
ZmMailListView.prototype._getCellClass=function(e,t,o){
return(!this._isMultiColumn&&t==ZmItem.F_SUBJECT)?"SubjectDoubleRow":null
};
ZmMailListView.prototype._getFlagIcon=function(t,e){
return(t||e)?"FlagRed":(this._isMultiColumn?"Blank_16":"FlagDis")
};
ZmMailListView.prototype._fitParticipants=function(l,s,n){
n=n*1.3;
if(l.length==1){
var o=l[0];
var t=o.name||o.dispName||o.address;
var r={
name:AjxStringUtil.htmlEncode(t),index:0};
return[r]
}
var c=new Array();
for(var h=0;
h<l.length;
h++){
var r={
name:AjxStringUtil.htmlEncode(l[h].dispName||l[h].address),index:h};
c.push(r)
}
var m=c.length;
var e=c.shift();
while(c.length){
var d=[e];
d=d.concat(c);
var f;
var r=[];
var u=0;
for(var h=0;
h<d.length;
h++){
u=u+(d[h].name.length*DwtUnits.WIDTH_EM)
}
if((d.length==m)&&!s){
u=u+(d.length-1)*DwtUnits.WIDTH_SEP;
for(var h=0;
h<d.length;
h++){
r.push(d[h].name)
}
f=r.join(", ")
}else{
u=u+DwtUnits.WIDTH_ELLIPSIS;
u=u+(d.length-2)*DwtUnits.WIDTH_SEP;
for(var h=0;
h<c.length;
h++){
r.push(c[h].name)
}
f=e.name+AjxStringUtil.ELLIPSIS+r.join(", ")
}
if(u<=n){
return d
}else{
c.shift()
}}
return[e]
};
ZmMailListView.prototype._getActionMenuForColHeader=function(s){
if(!this.isMultiColumn()){
if(!this._colHeaderActionMenu||s){
var l=this._colHeaderActionMenu=new ZmPopupMenu(this);
var r=new AjxListener(this,this._colHeaderActionListener);
for(var o=0;
o<ZmMailListView.SINGLE_COLUMN_SORT.length;
o++){
var n=ZmMailListView.SINGLE_COLUMN_SORT[o];
var t=AjxMessageFormat.format(ZmMsg.arrangedBy,ZmMsg[n.msg]);
var e=l.createMenuItem(n.field,{
text:t,style:DwtMenuItem.RADIO_STYLE}
);
if(n.field==ZmItem.F_DATE){
e.setChecked(true,true)
}
e.setData(ZmListView.KEY_ID,n.field);
l.addSelectionListener(n.field,r)
}}
var e=this._colHeaderActionMenu.getItemById(ZmItem.F_FROM);
if(e){
e.setVisible(!this._isOutboundFolder())
}
return this._colHeaderActionMenu
}
var h=(!this._colHeaderActionMenu||s);
var l=ZmListView.prototype._getActionMenuForColHeader.call(this,s);
if(h){
this._resetFromColumnLabel()
}
return l
};
ZmMailListView.prototype._colHeaderActionListener=function(o){
if(!this.isMultiColumn()){
var t=this._headerHash[ZmItem.F_SORTED_BY];
var e=document.getElementById(DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,t._field));
if(e){
e.innerHTML=o.item.getText()
}
t._sortable=o.item.getData(ZmListView.KEY_ID);
this._sortColumn(t,this._bSortAsc)
}else{
ZmListView.prototype._colHeaderActionListener.apply(this,arguments)
}};
ZmMailListView.prototype._getNoResultsMessage=function(){
if(appCtxt.isOffline&&!appCtxt.getSearchController().searchAllAccounts){
var o=ZmOrganizer.getSystemId(this._controller._getSearchFolderId());
var t=o&&appCtxt.getById(o);
if(t){
if(t.isOfflineSyncable&&!t.isOfflineSyncing){
var e="ZmMailListView.toggleSync('"+t.id+"', '"+this._htmlElId+"');";
return AjxMessageFormat.format(ZmMsg.notSyncing,e)
}}}
return DwtListView.prototype._getNoResultsMessage.call(this)
};
ZmMailListView.toggleSync=function(e,t){
var n=appCtxt.getById(e);
var s=n?document.getElementById(t):null;
var o=s?DwtControl.fromElement(s):null;
if(o){
var r=new AjxCallback(o,o._handleToggleSync,[n]);
n.toggleSyncOffline(r)
}};
ZmMailListView.prototype._handleToggleSync=function(e){
e.getAccount().sync();
this.removeAll(true)
};
ZmMailListView.prototype._changeListener=function(h){
var r=this._getItemFromEvent(h);
if(!r||h.handled||!this._handleEventType[r.type]){
return
}
if(h.event==ZmEvent.E_FLAGS){
var o=h.getDetail("flags");
for(var s=0;
s<o.length;
s++){
var t=o[s];
if(t==ZmItem.FLAG_UNREAD){
var e=r[ZmItem.FLAG_PROP[t]];
this.markUIAsRead(r,!e)
}}}
if(h.event==ZmEvent.E_CREATE){
if(this._controller.actionedMsgId){
var n=appCtxt.getById(this._controller.actionedMsgId);
this._itemToSelect=(this._controller._app.getGroupMailBy()==ZmId.ITEM_CONV)?appCtxt.getById(n.cid):n;
this._controller.actionedMsgId=null
}
if(this._list&&this._list.contains(r)){
return
}
if(!this._handleEventType[r.type]){
return
}
if((this._isPageless||this.offset==0)&&(!this._sortByString||this._sortByString==ZmSearch.DATE_DESC)){
this.addItem(r,h.getDetail("sortIndex")||0);
if(appCtxt.isOffline&&appCtxt.getActiveAccount().isOfflineInitialSync()){
this._controller._app.numEntries++
}}
h.handled=true
}
if(!h.handled){
ZmListView.prototype._changeListener.call(this,h)
}};
ZmMailListView.prototype._itemClicked=function(o,s){
ZmListView.prototype._itemClicked.apply(this,arguments);
var t=this._controller;
if(t.isReadingPaneOn()){
if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)&&s.button==DwtMouseEvent.LEFT){
if(!s.shiftKey&&!s.ctrlKey){
var h=(s.target.id&&s.target.id.indexOf("AjxImg")==-1)?s.target.id:o.id;
var e=h?this._parseId(h):null;
if(e&&e.field==ZmItem.F_SELECTION){
if(this.getSelectionCount()==1){
var n=this.getSelection()[0];
var r=(n instanceof ZmConv)?n.getFirstHotMsg():n;
if(r&&t._curMsg&&(r.id!=t._curMsg.id)){
t.reset()
}}}}}}};
ZmMailListView.prototype._setNextSelection=function(){
if(this._itemToSelect){
var e=this._getItemToSelect();
if(e){
this.setSelection(e,false);
this._itemToSelect=null
}}};
ZmMailListView.prototype._getItemToSelect=function(){
var e=this._itemToSelect||(this._list&&this._list.get(0));
if(e==ZmMailListView.FIRST_ITEM){
var t=this.getList(true).getArray();
e=t&&t[0]
}else{
if(e==ZmMailListView.LAST_ITEM){
var t=this.getList(true).getArray();
e=t&&t[t.length-1]
}}
return e
};
ZmMailListView.prototype._getSearchForSort=function(t,e){
e=e||this._controller;
var o=e.getSearchString();
if(!o){
return""
}
var n=(t==ZmItem.F_FLAG)?" is:flagged":" has:attachment";
if(o.indexOf(n)!=-1){
o=o.replace(n,"")
}else{
o=o+n
}
return o
};
ZmMailListView.prototype._getDefaultSortbyForCol=function(e){
return(e._sortable!=ZmItem.F_DATE)
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmDoublePaneView")){
ZmDoublePaneView=function(t){
if(arguments.length==0){
return
}
var e=t.controller._getViewType();
t.id=ZmId.getViewId(e);
DwtComposite.call(this,t);
this._controller=t.controller;
this._initHeader();
t.className=null;
t.id=DwtId.getListViewId(e);
this._mailListView=this._createMailListView(t);
this._vertMsgSash=new DwtSash({
parent:this,style:DwtSash.HORIZONTAL_STYLE,className:"AppSash-horiz",threshold:ZmDoublePaneView.SASH_THRESHOLD,posStyle:Dwt.ABSOLUTE_STYLE}
);
this._vertMsgSash.registerCallback(this._sashCallback,this);
this._horizMsgSash=new DwtSash({
parent:this,style:DwtSash.VERTICAL_STYLE,className:"AppSash-vert",threshold:ZmDoublePaneView.SASH_THRESHOLD,posStyle:Dwt.ABSOLUTE_STYLE}
);
this._horizMsgSash.registerCallback(this._sashCallback,this);
t.parent=this;
t.className=null;
t.id=ZmId.getViewId(ZmId.VIEW_MSG,null,e);
this._msgView=new ZmMailMsgView(t);
if(e==ZmId.VIEW_CONVLIST||e==ZmId.VIEW_TRAD){
this.setReadingPane()
}};
ZmDoublePaneView.prototype=new DwtComposite;
ZmDoublePaneView.prototype.constructor=ZmDoublePaneView;
ZmDoublePaneView.prototype.toString=function(){
return"ZmDoublePaneView"
};
ZmDoublePaneView.SASH_THRESHOLD=5;
ZmDoublePaneView._TAG_IMG="TI";
ZmDoublePaneView.prototype.getController=function(){
return this._controller
};
ZmDoublePaneView.prototype.getTitle=function(){
return this._mailListView.getTitle()
};
ZmDoublePaneView.prototype.setReadingPane=function(){
var t=this._mailListView,e=this._msgView;
var r=this._controller.isReadingPaneOn();
if(!r){
e.setVisible(false);
this._vertMsgSash.setVisible(false);
this._horizMsgSash.setVisible(false)
}else{
if(!e.getVisible()){
if(t.getSelectionCount()==1){
this._controller._setSelectedItem()
}else{
e.reset()
}}
e.setVisible(true);
var o=this._controller.isReadingPaneOnRight();
var n=o?this._vertMsgSash:this._horizMsgSash;
var h=o?this._horizMsgSash:this._vertMsgSash;
h.setVisible(false);
n.setVisible(true)
}
t.reRenderListView();
e.noTab=!r||AjxEnv.isIE;
var s=this.getSize();
this._resetSize(s.x,s.y,true)
};
ZmDoublePaneView.prototype._createMailListView=function(e){
e.parent=this;
e.posStyle=Dwt.ABSOLUTE_STYLE;
e.id=DwtId.getListViewId(this._controller._getViewType());
return new ZmMailMsgListView(e)
};
ZmDoublePaneView.prototype.getMailListView=function(){
return this._mailListView
};
ZmDoublePaneView.prototype.getMsgView=function(){
return this._msgView
};
ZmDoublePaneView.prototype.getSelectionCount=function(){
return this._mailListView.getSelectionCount()
};
ZmDoublePaneView.prototype.getSelection=function(){
return this._mailListView.getSelection()
};
ZmDoublePaneView.prototype.reset=function(){
this._mailListView.reset();
this._msgView.reset()
};
ZmDoublePaneView.prototype.getMsg=function(){
return this._msgView.getMsg()
};
ZmDoublePaneView.prototype.setMsg=function(e){
this._msgView.set(e);
this._controller._restoreFocus()
};
ZmDoublePaneView.prototype.addInviteReplyListener=function(e){
this._msgView.addInviteReplyListener(e)
};
ZmDoublePaneView.prototype.addShareListener=function(e){
this._msgView.addShareListener(e)
};
ZmDoublePaneView.prototype.resetMsg=function(e){
this._msgView.resetMsg(e)
};
ZmDoublePaneView.prototype.isMsgViewVisible=function(){
return this._msgView.getVisible()
};
ZmDoublePaneView.prototype.setBounds=function(t,n,o,e){
DwtComposite.prototype.setBounds.call(this,t,n,o,e);
this._resetSize(o,e)
};
ZmDoublePaneView.prototype.setItem=function(e){
this._mailListView.set(e,ZmItem.F_DATE);
this.isStale=false
};
ZmDoublePaneView.prototype._initHeader=function(){
return this
};
ZmDoublePaneView.prototype._resetSize=function(s,e,t){
if(s<=0||e<=0){
return
}
if(!t&&s==this._lastResetWidth&&e==this._lastResetHeight){
return
}
var o=this._controller.isReadingPaneOnRight();
if(this.isMsgViewVisible()){
var h=this.getSash();
var r=h.getSize();
var n=o?r.x:r.y;
if(o){
var l=this._vertSashX||Math.floor(s/2.5);
this._mailListView.resetSize(l,e);
h.setLocation(l,0);
this._msgView.setBounds(l+n,0,s-(l+n),e)
}else{
var c=this._horizSashY||(Math.floor(e/2)-DwtListView.HEADERITEM_HEIGHT);
this._mailListView.resetSize(s,c);
h.setLocation(0,c);
this._msgView.setBounds(0,c+n,s,e-(c+n))
}}else{
this._mailListView.resetSize(s,e)
}
this._mailListView._resetColWidth();
this._lastResetWidth=s;
this._lastResetHeight=e
};
ZmDoublePaneView.prototype._sashCallback=function(p){
var r=this._controller.isReadingPaneOnRight();
if(p>0){
if(r){
var n=this._msgView.getMinWidth();
var t=this._msgView.getSize().x;
p=Math.max(0,Math.min(p,t-n));
var f=((AjxEnv.isIE)?this._vertMsgSash.getLocation().x:this._mailListView.getSize().x)+p;
if(p>0){
this._mailListView.resetSize(f,Dwt.DEFAULT);
this._msgView.setBounds(this._msgView.getLocation().x+p,Dwt.DEFAULT,t-p,Dwt.DEFAULT)
}else{
p=0
}}else{
var l=this._msgView.getSize().y-p;
var d=this._msgView.getMinHeight();
if(l>d){
this._mailListView.resetSize(Dwt.DEFAULT,this._mailListView.getSize().y+p);
this._msgView.setBounds(Dwt.DEFAULT,this._msgView.getLocation().y+p,Dwt.DEFAULT,l)
}else{
p=0
}}}else{
var m=Math.abs(p);
if(r){
if(!this._minMLVWidth){
var s=this._mailListView._headerList[0];
var c=s._width;
if(c=="auto"){
var h=document.getById(s._id);
c=h&&Dwt.getSize(h).x
}
this._minMLVWidth=c
}
var o=((AjxEnv.isIE)?this._vertMsgSash.getLocation().x:this._mailListView.getSize().x);
m=Math.max(0,Math.min(m,o-this._minMLVWidth));
if(m>0){
p=-m;
this._mailListView.resetSize(o-m,Dwt.DEFAULT);
this._msgView.setBounds(this._msgView.getLocation().x-m,Dwt.DEFAULT,this._msgView.getSize().x+m,Dwt.DEFAULT)
}else{
p=0
}}else{
if(!this._minMLVHeight){
var u=this._mailListView.getList();
if(u&&u.size()){
var g=u.get(0);
var e=document.getElementById(this._mailListView._getItemId(g));
this._minMLVHeight=DwtListView.HEADERITEM_HEIGHT+(Dwt.getSize(e).y*2)
}else{
this._minMLVHeight=DwtListView.HEADERITEM_HEIGHT
}}
if(this.getSash().getLocation().y-m>this._minMLVHeight){
this._mailListView.resetSize(Dwt.DEFAULT,this._mailListView.getSize().y-m);
this._msgView.setBounds(Dwt.DEFAULT,this._msgView.getLocation().y-m,Dwt.DEFAULT,this._msgView.getSize().y+m)
}else{
p=0
}}}
if(p){
this._mailListView._resetColWidth();
if(r){
this._vertSashX=this._vertMsgSash.getLocation().x
}else{
this._horizSashY=this._horizMsgSash.getLocation().y
}}
return p
};
ZmDoublePaneView.prototype._selectFirstItem=function(){
var t=this._mailListView.getList();
var e=t?t.get(0):null;
if(e){
this._mailListView.setSelection(e,false)
}};
ZmDoublePaneView.prototype.getSash=function(){
var e=this._controller.isReadingPaneOnRight();
return e?this._vertMsgSash:this._horizMsgSash
};
ZmDoublePaneView.prototype.getLimit=function(e){
return this._mailListView.getLimit(e)
};
ZmDoublePaneView.prototype._staleHandler=function(){
var e=this._controller._currentSearch;
if(e){
e.lastId=e.lastSortVal=null;
e.offset=e.limit=0;
appCtxt.getSearchController().redoSearch(e)
}};
ZmDoublePaneView.prototype.handleRemoveAttachment=function(t,e){
this._msgView.handleRemoveAttachment(t,e)
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmTradView")){
ZmTradView=function(e){
e.className=e.className||"ZmTradView";
e.mode=ZmId.VIEW_TRAD;
ZmDoublePaneView.call(this,e)
};
ZmTradView.prototype=new ZmDoublePaneView;
ZmTradView.prototype.constructor=ZmTradView;
ZmTradView.prototype.toString=function(){
return"ZmTradView"
};
ZmTradView.prototype._createMailListView=function(e){
return ZmDoublePaneView.prototype._createMailListView.apply(this,arguments)
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmMailMsgView")){
ZmMailMsgView=function(e){
if(arguments.length==0){
return
}
e.className=e.className||"ZmMailMsgView";
DwtComposite.call(this,e);
this._mode=e.mode;
this._controller=e.controller;
this._viewId=(this._controller&&this._controller.sessionId)?ZmId.VIEW_MSG+this._controller.sessionId:ZmId.VIEW_MSG;
this._displayImagesId=ZmId.getViewId(this._viewId,ZmId.MV_DISPLAY_IMAGES,this._mode);
this._msgTruncatedId=ZmId.getViewId(this._viewId,ZmId.MV_MSG_TRUNC,this._mode);
this._infoBarId=ZmId.getViewId(this._viewId,ZmId.MV_INFO_BAR,this._mode);
this._tagRowId=ZmId.getViewId(this._viewId,ZmId.MV_TAG_ROW,this._mode);
this._tagCellId=ZmId.getViewId(this._viewId,ZmId.MV_TAG_CELL,this._mode);
this._attLinksId=ZmId.getViewId(this._viewId,ZmId.MV_ATT_LINKS,this._mode);
this._expandHeader=true;
this._expandDivId=ZmId.getViewId(this._viewId,ZmId.MV_EXPAND_DIV,this._mode);
this._scrollWithIframe=ZmMailMsgView.SCROLL_WITH_IFRAME;
this._limitAttachments=this._scrollWithIframe?3:0;
this._attcMaxSize=this._limitAttachments*16+8;
this.setScrollStyle(this._scrollWithIframe?DwtControl.CLIP:DwtControl.SCROLL);
if(!appCtxt.isChildWindow){
this._tagList=appCtxt.getTagTree();
if(this._tagList){
this._tagList.addChangeListener(new AjxListener(this,this._tagChangeListener));
this.addListener(ZmMailMsgView._TAG_CLICK,new AjxListener(this,this._msgTagClicked))
}}
this._setMouseEventHdlrs();
this._objectManager=true;
this._changeListener=new AjxListener(this,this._msgChangeListener);
this.addListener(DwtEvent.ONSELECTSTART,new AjxListener(this,this._selectStartListener));
this.addListener(DwtEvent.CONTROL,new AjxListener(this,this._controlEventListener));
if(!appCtxt.isOffline){
this._setAllowSelection()
}
this.noTab=true
};
ZmMailMsgView.prototype=new DwtComposite;
ZmMailMsgView.prototype.constructor=ZmMailMsgView;
ZmMailMsgView.displayAdditionalHdrsInMsgView={};
ZmMailMsgView.SCROLL_WITH_IFRAME=false;
ZmMailMsgView.LIMIT_ATTACHMENTS=ZmMailMsgView.SCROLL_WITH_IFRAME?3:0;
ZmMailMsgView.ATTC_COLUMNS=2;
ZmMailMsgView.ATTC_MAX_SIZE=ZmMailMsgView.LIMIT_ATTACHMENTS*16+8;
ZmMailMsgView.QUOTE_DEPTH_MOD=3;
ZmMailMsgView.MAX_SIG_LINES=8;
ZmMailMsgView.SIG_LINE=/^(- ?-+)|(__+)\r?$/;
ZmMailMsgView._inited=false;
ZmMailMsgView._TAG_CLICK="ZmMailMsgView._TAG_CLICK";
ZmMailMsgView._TAG_ANCHOR="TA";
ZmMailMsgView._TAG_IMG="TI";
ZmMailMsgView.OBJ_SIZE_TEXT=50;
ZmMailMsgView.OBJ_SIZE_HTML=50;
ZmMailMsgView.REPLY_INVITE_EVENT="inviteReply";
ZmMailMsgView.SHARE_EVENT="share";
ZmMailMsgView.IMG_FIX_RE=new RegExp("(<img\\s+.*dfsrc\\s*=\\s*)[\"']http[^'\"]+part=([\\d\\.]+)[\"']([^>]*>)","gi");
ZmMailMsgView.FILENAME_INV_CHARS_RE=/[\./?*:;{}'\\]/g;
ZmMailMsgView.SETHEIGHT_MAX_TRIES=3;
ZmMailMsgView.prototype.toString=function(){
return"ZmMailMsgView"
};
ZmMailMsgView.prototype.getController=function(){
return this._controller
};
ZmMailMsgView.prototype.reset=function(){
if(this._resizeAction){
AjxTimedAction.cancelAction(this._resizeAction);
this._resizeAction=null
}
if(this._objectsAction){
AjxTimedAction.cancelAction(this._objectsAction);
this._objectsAction=null
}
this._msg=null;
this._htmlBody=null;
if(this._expandButton){
this._expandButton.setVisible(Dwt.DISPLAY_NONE);
this._expandButton.reparentHtmlElement(this.getHtmlElement())
}
if(this._ifw){
this._ifw.dispose();
this._ifw=null
}
if(this._inviteToolbar){
this._inviteToolbar.setVisible(Dwt.DISPLAY_NONE);
this._inviteToolbar.reparentHtmlElement(this.parent.getHtmlElement());
this._hasInviteToolbar=false
}
if(this._shareToolbar){
this._shareToolbar.setVisible(Dwt.DISPLAY_NONE);
this._shareToolbar.reparentHtmlElement(this.parent.getHtmlElement());
this._hasShareToolbar=false
}
this.getHtmlElement().innerHTML="";
if(this._objectManager&&this._objectManager.reset){
this._objectManager.reset()
}
this.setScrollWithIframe(this._scrollWithIframe)
};
ZmMailMsgView.prototype.preventSelection=function(){
return false
};
ZmMailMsgView.prototype.set=function(s){
if(this._msg&&s&&(this._msg.id==s.id)){
return
}
var y=this._msg;
this.reset();
var p=this.getHtmlElement();
this._msg=s;
if(!s){
p.innerHTML=AjxTemplate.expand("mail.Message#viewMessage");
this.noTab=true;
return
}
this._dateObjectHandlerDate=s.sentDate?new Date(s.sentDate):new Date(s.date);
var w=s.invite;
var z=window.parentAppCtxt||window.appCtxt;
if((z.get(ZmSetting.CALENDAR_ENABLED)||z.multiAccounts)&&(w&&w.type!="task")){
var o=!w.isEmpty()&&w.hasCounterMethod();
if(!w.isEmpty()&&w.hasAcceptableComponents()&&(w.hasInviteReplyMethod()||o)&&s.folderId!=ZmFolder.ID_TRASH&&s.folderId!=ZmFolder.ID_SENT){
var x=this._getInviteToolbar();
x.reparentHtmlElement(p);
this.setInviteOptions(w);
x.setVisible(Dwt.DISPLAY_BLOCK);
if(this._respondOnBehalfLabel){
this._respondOnBehalfLabel.innerHTML=s.cif?AjxMessageFormat.format(ZmMsg.onBehalfOfText,[s.cif]):"";
Dwt.setVisible(this._respondOnBehalfLabel,new Boolean(s.cif))
}
var f=z.getApp(ZmApp.CALENDAR).getCalController();
var k=s.getAccount();
var n=z.get(ZmSetting.CALENDAR_ENABLED,null,k)?f.getCalendars({
includeLinks:true,account:k,onlyWritable:true}
):[];
if(appCtxt.multiAccounts){
var c=z.accountList.visibleAccounts;
for(var v=0;
v<c.length;
v++){
var d=c[v];
if(d==k||!z.get(ZmSetting.CALENDAR_ENABLED,null,d)){
continue
}
if(appCtxt.isOffline&&d.isMain){
continue
}
n=n.concat(f.getCalendars({
includeLinks:true,account:d,onlyWritable:true}
))
}
if(appCtxt.isOffline){
n.push(appCtxt.getById(ZmOrganizer.ID_CALENDAR))
}}
var e=(n.length>1||appCtxt.multiAccounts);
if(e){
this._inviteMoveSelect.clearOptions();
for(var v=0;
v<n.length;
v++){
var m=n[v];
var r=m.getAccount();
var q=appCtxt.multiAccounts?r.getIcon():m.getIcon();
var T=appCtxt.multiAccounts?([m.name," (",r.getDisplayName(),")"].join("")):m.name;
var l=(r&&k)?(r==k&&m.nId==ZmOrganizer.ID_CALENDAR):m.nId==ZmOrganizer.ID_CALENDAR;
var u=new DwtSelectOptionData(m.id,T,l,null,q);
this._inviteMoveSelect.addOption(u)
}
if(!z.get(ZmSetting.CALENDAR_ENABLED,null,k)){
this._inviteMoveSelect.setSelectedValue(ZmOrganizer.ID_CALENDAR)
}}
this._inviteMoveLabel.setVisible(e);
this._inviteMoveSelect.setVisible(e);
this._hasInviteToolbar=true
}}else{
if(appCtxt.get(ZmSetting.SHARING_ENABLED)&&s.share&&s.folderId!=ZmFolder.ID_TRASH&&appCtxt.getActiveAccount().id!=s.share.grantor.id){
AjxDispatcher.require("Share");
var b=s.share.action;
var j=b==ZmShare.NEW;
var g=b==ZmShare.EDIT;
var h=(appCtxt.getById(s.folderId).isDataSource(null,true)&&(s.folderId!=ZmFolder.ID_INBOX));
if(!h&&(j||(g&&!this.__hasMountpoint(s.share)))&&s.share.link.perm){
var x=this._getShareToolbar();
x.reparentHtmlElement(p);
x.setVisible(Dwt.DISPLAY_BLOCK);
this._hasShareToolbar=true
}}}
var t=new AjxCallback(this,this._handleResponseSet,[s,y]);
this._renderMessage(s,p,t);
this.noTab=AjxEnv.isIE
};
ZmMailMsgView.prototype.__hasMountpoint=function(t){
var e=appCtxt.getFolderTree();
return e?this.__hasMountpoint2(e.root,t.grantor.id,t.link.id):false
};
ZmMailMsgView.prototype.__hasMountpoint2=function(e,s,n){
if(e.zid==s&&e.rid==n){
return true
}
if(e.children){
var o=e.children.getArray();
for(var t=0;
t<o.length;
t++){
var r=this.__hasMountpoint2(o[t],s,n);
if(r){
return true
}}}
return false
};
ZmMailMsgView.prototype.highlightObjects=function(o){
var e=document.getElementById(this._iframeId).contentWindow.document;
if(o!=null){
this._lazyCreateObjectManager();
var t=this._objectManager.findObjects(o,true,null,true);
t=t.replace(/^ /mg,"&nbsp;").replace(/\t/g,"<pre style='display:inline;'>\t</pre>").replace(/\n/g,"<br>");
e.body.innerHTML=t
}else{
this._processHtmlDoc(e)
}};
ZmMailMsgView.prototype.resetMsg=function(e){
if(this._msg!=null){
this._msg.removeChangeListener(this._changeListener)
}};
ZmMailMsgView.prototype.getMsg=function(){
return this._msg
};
ZmMailMsgView.prototype.getSelection=function(){
return this._msg
};
ZmMailMsgView.prototype.getSelectionCount=function(){
return 1
};
ZmMailMsgView.prototype.getMinWidth=function(){
return 20
};
ZmMailMsgView.prototype.getMinHeight=function(){
if(!this._headerHeight){
var e=document.getElementById(this._hdrTableId);
this._headerHeight=e?Dwt.getSize(e).y:0
}
return this._headerHeight
};
ZmMailMsgView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,this._msg.subject].join(": ")
};
ZmMailMsgView.prototype.hasHtmlBody=function(){
return this._htmlBody!=null
};
ZmMailMsgView.prototype.getHtmlBodyElement=function(){
var o;
if(this._htmlBody){
var t=document.getElementById(this._iframeId);
var e=t?Dwt.getIframeDoc(t):null;
o=e?e.body:null
}
return o
};
ZmMailMsgView.prototype.addInviteReplyListener=function(e){
this.addListener(ZmMailMsgView.REPLY_INVITE_EVENT,e)
};
ZmMailMsgView.prototype.addShareListener=function(e){
this.addListener(ZmMailMsgView.SHARE_EVENT,e)
};
ZmMailMsgView.prototype._getInviteOps=function(){
return[ZmOperation.REPLY_ACCEPT,ZmOperation.REPLY_TENTATIVE,ZmOperation.REPLY_DECLINE,ZmOperation.PROPOSE_NEW_TIME,ZmOperation.ACCEPT_PROPOSAL,ZmOperation.DECLINE_PROPOSAL]
};
ZmMailMsgView.prototype._getInviteToolbar=function(){
if(this._inviteToolbar){
return this._inviteToolbar
}
var c=this._getInviteOps();
var r=[ZmOperation.INVITE_REPLY_ACCEPT,ZmOperation.INVITE_REPLY_TENTATIVE,ZmOperation.INVITE_REPLY_DECLINE];
var f=[ZmOperation.REPLY_ACCEPT_NOTIFY,ZmOperation.REPLY_TENTATIVE_NOTIFY,ZmOperation.REPLY_DECLINE_NOTIFY];
var p=[ZmOperation.REPLY_ACCEPT_IGNORE,ZmOperation.REPLY_TENTATIVE_IGNORE,ZmOperation.REPLY_DECLINE_IGNORE];
var h={
parent:this,buttons:c,posStyle:DwtControl.STATIC_STYLE,className:"ZmInviteToolBar",buttonClassName:"DwtToolbarButton",context:this._mode,toolbarType:ZmId.TB_INVITE};
this._inviteToolbar=new ZmButtonToolBar(h);
var n=new AjxListener(this,this._inviteToolBarListener);
c=this._inviteToolbar.opList;
for(var d=0;
d<c.length;
d++){
var t=c[d];
var u=this._inviteToolbar.getButton(t);
u._hoverClassName=u._className+"-"+DwtCssStyle.HOVER;
u._activeClassName=u._className+"-"+DwtCssStyle.ACTIVE;
this._inviteToolbar.addSelectionListener(t,n);
if(t==ZmOperation.ACCEPT_PROPOSAL||t==ZmOperation.DECLINED_PROPOSAL){
u.setVisible(false)
}
if(t==ZmOperation.PROPOSE_NEW_TIME||t==ZmOperation.ACCEPT_PROPOSAL||t==ZmOperation.DECLINE_PROPOSAL){
continue
}
var s=[f[d],r[d],p[d]];
var o=new ZmActionMenu({
parent:u,menuItems:s}
);
s=o.opList;
for(var l=0;
l<s.length;
l++){
var e=o.getItem(l);
e.addSelectionListener(n)
}
u.setMenu(o)
}
this._respondOnBehalfLabel=this._inviteToolbar.addFiller();
this._inviteToolbar.addFiller();
var m=new DwtText({
parent:this._inviteToolbar,className:"DwtText InviteSelectLabel"}
);
m.setSize(100,DwtControl.DEFAULT);
m.setText(AjxMessageFormat.format(ZmMsg.makeLabel,[ZmMsg.calendar]));
this._inviteMoveLabel=m;
this._inviteToolbar.addSpacer();
this._inviteMoveSelect=new DwtSelect({
parent:this._inviteToolbar}
);
return this._inviteToolbar
};
ZmMailMsgView.prototype.setInviteOptions=function(t){
var e=this._getInviteOps();
var o={};
o[ZmOperation.ACCEPT_PROPOSAL]=true;
o[ZmOperation.DECLINE_PROPOSAL]=true;
var r,s;
for(var n in e){
r=e[n];
s=this._inviteToolbar.getButton(r);
if(t.hasCounterMethod()){
s.setVisible(Boolean(o[r]))
}else{
s.setVisible(!Boolean(o[r]))
}}};
ZmMailMsgView.prototype.enableInviteReplyMenus=function(t){
if(!this._inviteToolbar){
return
}
var e=[ZmOperation.REPLY_ACCEPT,ZmOperation.REPLY_TENTATIVE,ZmOperation.REPLY_DECLINE];
var r=[ZmOperation.INVITE_REPLY_ACCEPT,ZmOperation.INVITE_REPLY_TENTATIVE,ZmOperation.INVITE_REPLY_DECLINE];
for(var n=0;
n<e.length;
n++){
var o=this._inviteToolbar.getButton(e[n]);
if(o){
var h=o.getMenu();
var s=h.getMenuItem(r[n]);
if(s){
s.setEnabled(t)
}}}};
ZmMailMsgView.prototype._getShareToolbar=function(){
if(this._shareToolbar){
return this._shareToolbar
}
var t=[ZmOperation.SHARE_ACCEPT,ZmOperation.SHARE_DECLINE];
var s={
parent:this,buttons:t,posStyle:DwtControl.STATIC_STYLE,className:"ZmShareToolBar",buttonClassName:"DwtToolbarButton",context:this._mode,toolbarType:ZmId.TB_SHARE};
this._shareToolbar=new ZmButtonToolBar(s);
var n=new AjxListener(this,this._shareToolBarListener);
for(var o=0;
o<t.length;
o++){
var r=t[o];
var e=this._shareToolbar.getButton(r);
e._hoverClassName=e._className+"-"+DwtCssStyle.HOVER;
e._activeClassName=e._className+"-"+DwtCssStyle.ACTIVE;
this._shareToolbar.addSelectionListener(r,n)
}
return this._shareToolbar
};
ZmMailMsgView.prototype._handleResponseSet=function(t,e){
if(!appCtxt.isChildWindow){
if(this._mode==ZmId.VIEW_MSG){
this._setTags(t);
if(e){
e.removeChangeListener(this._changeListener)
}
t.addChangeListener(this._changeListener)
}}
this.getHtmlElement().scrollTop=0;
appCtxt.notifyZimlets("onMsgView",[t,e,this]);
if(!t.isDraft&&t.readReceiptRequested){
this._controller.sendReadReceipt(t)
}};
ZmMailMsgView._URL_RE=/^((https?|ftps?):\x2f\x2f.+)$/;
ZmMailMsgView._MAILTO_RE=/^mailto:[\x27\x22]?([^@?&\x22\x27]+@[^@?&]+\.[^@?&\x22\x27]+)[\x27\x22]?/;
ZmMailMsgView.prototype._lazyCreateObjectManager=function(){
var e=(AjxUtil.isBoolean(this._objectManager)&&this._objectManager);
var t=(!this.zimletLoadFlag&&appCtxt.getZimletMgr().isLoaded());
if(e||t){
this.zimletLoadFlag=appCtxt.getZimletMgr().isLoaded();
this._objectManager=new ZmObjectManager(this)
}};
ZmMailMsgView.__localLinkClicked=function(s,l){
var t=this.getAttribute("href");
var o=null;
var c=this.ownerDocument;
if(t.substr(0,1)=="#"){
t=t.substr(1);
o=c.getElementById(t);
if(!o){
try{
o=c.getElementsByName(t)[0]
}
catch(r){}}
if(!o){
t=decodeURIComponent(t);
o=c.getElementById(t);
if(!o){
try{
o=c.getElementsByName(t)[0]
}
catch(r){}}}}
if(o){
var e=s.getHtmlElement();
var n=document.getElementById(s._iframeId);
var h=Dwt.getLocation(o);
e.scrollTop=h.y+n.offsetTop-20;
e.scrollLeft=h.x+n.offsetLeft
}
l.stopPropagation();
l.preventDefault();
return false
};
ZmMailMsgView.prototype.hasValidHref=function(o){
try{
var t=o.href;
return ZmMailMsgView._URL_RE.test(t)||ZmMailMsgView._MAILTO_RE.test(t)
}
catch(n){
return false
}};
ZmMailMsgView.prototype._processHtmlDoc=function(n){
if(!n){
return
}
var e=n.getElementsByTagName("img");
if(e.length>0){
var o=e.length;
for(var t=0;
t<e.length;
t++){
this._checkImgInAttachments(e[t])
}}
this.lazyFindMailMsgObjects(500,n)
};
ZmMailMsgView.prototype.lazyFindMailMsgObjects=function(e,t){
if(this._objectManager){
this._lazyCreateObjectManager();
this._objectsAction=new AjxTimedAction(this,this._findMailMsgObjects,[t]);
AjxTimedAction.scheduleAction(this._objectsAction,(e||500))
}};
ZmMailMsgView.prototype._findMailMsgObjects=function(e){
this._objectManager.processObjectsInNode(e,e.body)
};
ZmMailMsgView.prototype._checkImgInAttachments=function(h){
if(!this._msg||h.getAttribute("zmforced")){
return
}
var s=this._msg.attachments;
var o=appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI);
var t=h.getAttribute("src")||h.getAttribute("dfsrc");
var l;
if(/^cid:(.*)/.test(t)){
l="<"+RegExp.$1+">"
}
for(var r=0;
r<s.length;
r++){
var c=s[r];
if(c.foundInMsgBody){
continue
}
if(l&&c.ci==l){
c.foundInMsgBody=true;
break
}else{
if(t&&t.indexOf(o)==0){
var n=t.substring(t.lastIndexOf("=")+1);
if(n==c.part){
c.foundInMsgBody=true;
break
}}else{
if(c.cl){
var e=t.substring(t.lastIndexOf("/")+1);
if(e==c.filename){
c.foundInMsgBody=true;
break
}}}}}};
ZmMailMsgView.prototype._fixMultipartRelatedImages=function(e,s){
var h=s.getElementsByTagName("img");
var l=false;
var c=this;
var o=document.getElementById(this._iframeId);
var t=function(){
ZmMailMsgView._resetIframeHeight(c,o);
this.onload=null
};
for(var n=0;
n<h.length;
n++){
var r=ZmMailMsgView.__unfangInternalImage(e,h[n],"src");
if(!r){
h[n].onload=t
}
l=r||l
}
l=this._fixMultipartRelatedImagesRecurse(e,s.body)||l;
return !l
};
ZmMailMsgView.prototype._fixMultipartRelatedImagesRecurse=function(n,o){
var e=false;
function t(s){
var r=s.firstChild;
while(r){
if(r.nodeType==AjxUtil.ELEMENT_NODE){
e=ZmMailMsgView.__unfangInternalImage(n,r,"background")||e;
t(r)
}
r=r.nextSibling
}}
if(o.innerHTML.indexOf("dfbackground")!=-1){
t(o)
}
return e
};
ZmMailMsgView.__unfangInternalImage=function(s,n,t){
var o="df"+t;
var e=n.getAttribute(o);
if(e){
if(e.substr(0,4)=="cid:"){
var r="<"+e.substr(4)+">";
e=s.getContentPartAttachUrl(ZmMailMsg.CONTENT_PART_ID,r);
if(e){
n.setAttribute(t,e);
return false
}else{
return false
}}else{
if(e.substring(0,4)=="doc:"){
e=[appCtxt.get(ZmSetting.REST_URL),ZmFolder.SEP,e.substring(4)].join("");
if(e){
n.setAttribute(t,e);
return false
}}else{
if(e.indexOf("//")==-1){
e=s.getContentPartAttachUrl(ZmMailMsg.CONTENT_PART_LOCATION,e);
if(e){
n.setAttribute(t,e);
return false
}}}}
return true
}
return false
};
ZmMailMsgView.prototype._createDisplayImageClickClosure=function(n,e,s,o){
var t=this;
return function(){
var r=e.getElementsByTagName("img");
var m=function(){
ZmMailMsgView._resetIframeHeight(t,o);
this.onload=null
};
for(var d=0;
d<r.length;
d++){
var u=r[d].getAttribute("dfsrc");
if(u&&u.match(/https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\_\.]*(\?\S+)?)?)?/)){
r[d].onload=m;
if(AjxEnv.isIE){
var c=[r[d],d,r.length,n,e,o,t];
var h=new AjxTimedAction(null,ZmMailMsgView._swapIdAndSrc,c);
AjxTimedAction.scheduleAction(h,0)
}else{
r[d].src=r[d].getAttribute("dfsrc")
}}}
var l=document.getElementById(s);
if(l){
l.style.display="none"
}
this._htmlBody=e.documentElement.innerHTML;
if(n){
n.setHtmlContent(this._htmlBody);
n.showImages=true
}}
};
ZmMailMsgView.prototype._resetIframeHeightOnTimer=function(o,t){
var e=this._resizeAction=new AjxTimedAction(this,ZmMailMsgView._resetIframeHeight,[this,o,t]);
AjxTimedAction.scheduleAction(e,200)
};
ZmMailMsgView.prototype._makeHighlightObjectsDiv=function(o){
var e=this;
function t(){
var n=document.getElementById(e._highlightObjectsId);
n.innerHTML=ZmMsg.pleaseWaitHilitingObjects;
setTimeout(function(){
e.highlightObjects(o);
n.style.display="none";
ZmMailMsgView._resetIframeHeight(e,document.getElementById(e._iframeId))
}
,3);
return false
}
(function(){
var r=document.getElementById(e._infoBarId);
if(r){
e._highlightObjectsId=ZmId.getViewId(this._viewId,ZmId.MV_HIGHLIGHT_OBJ,e._mode);
var s={
id:e._highlightObjectsId,text:ZmMsg.objectsNotDisplayed,link:ZmMsg.hiliteObjects};
var n=AjxTemplate.expand("mail.Message#InformationBar",s);
r.appendChild(Dwt.parseHtmlFragment(n));
var h=document.getElementById(s.id+"_link");
Dwt.setHandler(h,DwtEvent.ONCLICK,t)
}}
)()
};
ZmMailMsgView.prototype._stripHtmlComments=function(e){
var t=/<(?:!(?:--[\s\S]*?--\s*)?(>)\s*|(?:script|style|SCRIPT|STYLE)[\s\S]*?<\/(?:script|style|SCRIPT|STYLE)>)/g;
e=e.replace(t,function(n,o){
return o?"":n
}
);
return e
};
ZmMailMsgView.prototype._makeIframeProxy=function(y,f,v,z){
if(f==null){
f=""
}
var e;
if(!v&&(!appCtxt.get(ZmSetting.DISPLAY_EXTERNAL_IMAGES)||(this._msg&&this._msg.folderId==ZmOrganizer.ID_SPAM))&&(this._msg==null||(this._msg&&!this._msg.showImages))&&/<img/i.test(f)){
var l=document.getElementById(this._displayImagesId);
if(!l){
var o=document.getElementById(this._infoBarId);
if(o){
var q={
id:this._displayImagesId,text:ZmMsg.externalImages,link:ZmMsg.displayExternalImages};
var x=AjxTemplate.expand("mail.Message#InformationBar",q);
e=Dwt.parseHtmlFragment(x);
o.appendChild(e)
}}}
var r;
var T=(f.length/1024);
if(v){
if(this._objectManager){
if(T<=ZmMailMsgView.OBJ_SIZE_TEXT){
r=new AjxCallback(this,this.lazyFindMailMsgObjects,[500]);
f=AjxStringUtil.convertToHtml(f)
}else{
this._makeHighlightObjectsDiv(f);
f=AjxStringUtil.convertToHtml(f)
}}else{
f=AjxStringUtil.convertToHtml(f)
}
if(AjxEnv.isSafari){
f="<html><head></head><body>"+f+"</body></html>"
}}else{
f=this._stripHtmlComments(f);
if(this._objectManager){
if(T<=ZmMailMsgView.OBJ_SIZE_HTML){
r=new AjxCallback(this,this._processHtmlDoc)
}else{
this._makeHighlightObjectsDiv()
}}}
var b;
this._isMsgTruncated=false;
if(z){
this._isMsgTruncated=true;
var g=document.getElementById(this._msgTruncatedId);
if(!g){
var o=document.getElementById(this._infoBarId);
if(o){
var q={
id:this._msgTruncatedId,text:ZmMsg.messageTooLarge,link:ZmMsg.viewEntireMessage};
var d=AjxTemplate.expand("mail.Message#InformationBar",q);
b=Dwt.parseHtmlFragment(d);
o.appendChild(b)
}}}
var u=AjxEnv.isIE?".MsgBody-text, .MsgBody-text * { font: 10pt monospace; }":"";
var j={
parent:this,className:"MsgBody",id:ZmId.getViewId(this._viewId,ZmId.MV_MSG_BODY,this._mode),hidden:true,html:f,styles:u,noscroll:!this._scrollWithIframe,posStyle:DwtControl.STATIC_STYLE,processHtmlCallback:r,useKbMgmt:true};
var h=this._ifw=new DwtIframe(j);
this._iframeId=h.getIframe().id;
var w=h.getDocument();
if(AjxEnv.isGeckoBased){
var p=AjxCallback.simpleClosure(ZmMailMsgView.__localLinkClicked,null,this);
var t=w.getElementsByTagName("a");
for(var k=t.length;
--k>=0;
){
var c=t[k];
if(!c.target){
c.onclick=p
}}}
w.body.className=v?"MsgBody MsgBody-text":"MsgBody MsgBody-html";
h.getIframe().onload=AjxCallback.simpleClosure(this._onloadIframe,this,h);
var s=w.getElementsByTagName("head")[0];
if(!s){
s=w.createElement("head");
w.body.parentNode.insertBefore(s,w.body)
}
var c=w.createElement("link");
c.rel="stylesheet";
c.href=appContextPath+"/css/msgview.css?v="+cacheKillerVersion;
s.appendChild(c);
h.getIframe().style.visibility="";
if(!v){
this._htmlBody=w.body.innerHTML;
var m=this._fixMultipartRelatedImages(this._msg,w);
if(m){
if(e){
e.style.display="none"
}}else{
var n=this._createDisplayImageClickClosure(this._msg,w,this._displayImagesId,h.getIframe());
if(e){
Dwt.setHandler(e,DwtEvent.ONCLICK,n)
}else{
if(appCtxt.get(ZmSetting.DISPLAY_EXTERNAL_IMAGES)||(this._msg&&this._msg.showImages)){
n.call()
}}}}
if(b){
Dwt.setHandler(b,DwtEvent.ONCLICK,AjxCallback.simpleClosure(this._handleMsgTruncated,this))
}
this._resetIframeHeightOnTimer(h.getIframe())
};
ZmMailMsgView.prototype._renderMessage=function(N,F,Y){
var p=appCtxt.getActiveAccount().id;
var C;
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&appCtxt.getApp(ZmApp.CONTACTS).contactsLoaded[p]){
C=AjxDispatcher.run("GetContacts")
}
var h=N.subject||ZmMsg.noSubject;
var A=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG,AjxDateFormat.SHORT);
var l=N.sentDate?A.format(new Date(N.sentDate)):A.format(new Date(N.date));
var v=N.getAddress(AjxEmailAddress.FROM)||ZmMsg.unknown;
var r=N.getAddress(AjxEmailAddress.SENDER);
var S=(r&&r.address)?r:v;
var e=String(S);
var X=C?(C.getContactByEmail((S&&S.address)?S.address:e)?"Contact":"NewContact"):null;
var _c=r?v:null;
var k=[];
var q=N.invite;
var g=appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&q&&!q.isEmpty()&&(q.type!="task")&&q.hasCounterMethod();
var M;
if(g&&N.folderId!=ZmFolder.ID_SENT){
k.push({
hdrName:ZmMsg.proposedTimeLabel,hdrVal:q.getProposedTimeStr()}
);
M=AjxMessageFormat.format(ZmMsg.counterInviteMsg,[(S&&S.name)?S.name:e])
}
if(N.attrs){
for(var K in ZmMailMsgView.displayAdditionalHdrsInMsgView){
if(N.attrs[K]){
k.push({
hdrName:ZmMailMsgView.displayAdditionalHdrsInMsgView[K],hdrVal:N.attrs[K]}
)
}}}
var P=appCtxt.getApp(ZmApp.CONTACTS);
if(P){
var u=[];
if(S){
u.push(S)
}
if(_c){
u.push(_c)
}
for(var _a=1;
_a<ZmMailMsg.ADDRS.length;
_a++){
var _d=ZmMailMsg.ADDRS[_a];
if(_d==AjxEmailAddress.SENDER){
continue
}
var O=N.getAddresses(_d).getArray();
for(var _e=0;
_e<O.length;
_e++){
if(O[_e]){
u.push(O[_e].address)
}}}
if(u.length>1){
P.setAddrLookupGroup(u)
}}
if(this._objectManager){
this._lazyCreateObjectManager();
appCtxt.notifyZimlets("onFindMsgObjects",[N,this._objectManager,this]);
this._objectManager.setHandlerAttr(ZmObjectManager.DATE,ZmObjectManager.ATTR_CURRENT_DATE,this._dateObjectHandlerDate);
h=this._objectManager.findObjects(h,true);
S=this._objectManager.findObjects(S,true,ZmObjectManager.EMAIL);
l=this._objectManager.findObjects(l,true,ZmObjectManager.DATE);
if(_c){
_c=this._objectManager.findObjects(v,true,ZmObjectManager.EMAIL)
}}else{
S=AjxStringUtil.htmlEncode(S.toString());
if(_c){
_c=AjxStringUtil.htmlEncode(_c.toString())
}}
var Q=[];
for(var _a=1;
_a<ZmMailMsg.ADDRS.length;
_a++){
var _d=ZmMailMsg.ADDRS[_a];
if(_d==AjxEmailAddress.SENDER){
continue
}
var O=N.getAddresses(_d).getArray();
if(O.length>0){
var _r=0;
var _o=[];
for(var _e=0;
_e<O.length;
_e++){
if(_e>0){
_o[_r++]=AjxStringUtil.htmlEncode(AjxEmailAddress.SEPARATOR)
}
var T=O[_e];
if(T.address){
_o[_r++]=this._objectManager?(this._objectManager.findObjects(T,true,ZmObjectManager.EMAIL)):AjxStringUtil.htmlEncode(T.address)
}else{
_o[_r++]=AjxStringUtil.htmlEncode(T.name)
}}
var I=AjxStringUtil.htmlEncode(ZmMsg[AjxEmailAddress.TYPE_STRING[_d]]);
var n=_o.join("");
Q.push({
prefix:I,partStr:n}
)
}}
var L=!appCtxt.get(ZmSetting.VIEW_AS_HTML);
var _u=N.getAttachmentLinks(true,L,true).length;
var o=_u!=0;
var x=(this._mode==ZmId.VIEW_MSG&&!appCtxt.isChildWindow);
var Z=appCtxt.getById(N.folderId);
var W=(Z&&Z.nId==ZmOrganizer.ID_SYNC_FAILURES);
this._hdrTableId=ZmId.getViewId(this._viewId,ZmId.MV_HDR_TABLE,this._mode);
var f=x?ZmId.getViewId(this._viewId,ZmId.MV_CLOSE_BTN_CELL,this._mode):null;
var _s=ZmId.getViewId(this._viewId,ZmId.MV_REPORT_BTN_CELL,this._mode);
this._expandRowId=ZmId.getViewId(this._viewId,ZmId.MV_EXPAND_ROW,this._mode);
var _t=ZmId.getViewId(this._viewId,ZmId.MV_EXPAND_HDR,this._mode);
var z={
id:this._htmlElId,hdrTableId:this._hdrTableId,hdrTableTopRowId:ZmId.getViewId(this._viewId,ZmId.MV_HDR_TABLE_TOP_ROW,this._mode),closeBtnCellId:f,reportBtnCellId:_s,expandRowId:this._expandRowId,expandHeaderId:_t,attachId:this._attLinksId,infoBarId:this._infoBarId,subject:h,dateString:l,sentBy:S,sentByNormal:e,sentByIcon:X,obo:_c,participants:Q,hasAttachments:o,attachmentsCount:_u,isSyncFailureMsg:W,additionalHdrs:k,inviteMessage:M};
var B=AjxTemplate.expand("mail.Message#MessageHeader",z);
var _i=F||this.getHtmlElement();
_i.appendChild(Dwt.parseHtmlFragment(B));
this._headerElement=Dwt.byId(this._htmlElId+"_headerElement");
var s=document.getElementById(_t);
if(s){
var R=ZmId.getButtonId(this._mode,ZmId.OP_EXPAND,ZmId.MSG_VIEW);
if(this._expandButton){
this._expandButton.dispose()
}
this._expandButton=new DwtToolBarButton({
parent:this,id:R,parentElement:_t}
);
this._expandButton.addSelectionListener(new AjxListener(this,this._expandButtonListener));
this._expandButton.setImage(this._expandHeader?"HeaderExpanded":"HeaderCollapsed");
this._expandButton.setVisible(Dwt.DISPLAY_BLOCK)
}
if(x){
var R=ZmId.getButtonId(this._mode,ZmOperation.CLOSE,ZmId.MSG_VIEW);
var t=new DwtButton({
parent:this,id:R,parentElement:f}
);
t.setImage("Close");
t.setText(ZmMsg.close);
t.addSelectionListener(new AjxListener(this,this._closeButtonListener))
}
var m=document.getElementById(_s);
if(m){
var R=ZmId.getButtonId(this._mode,ZmId.REPORT,ZmId.MSG_VIEW);
var J=new DwtButton({
parent:this,id:R,parentElement:m}
);
J.setText(ZmMsg.reportSyncFailure);
J.addSelectionListener(new AjxListener(this,this._reportButtonListener,N))
}
var U=N.getBodyParts();
var w=U.length;
if(w>1){
var B=[];
var b=N.hasHtmlPart();
for(var _a=0;
_a<w;
_a++){
var V=U[_a];
if(ZmMimeTable.isRenderableImage(V.ct)){
var E=(V.content)?["<img zmforced='1' class='InlineImage' src='",V.content,"'>"].join(""):["<img zmforced='1' class='InlineImage' src='",appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&id=",N.id,"&part=",V.part,"'>"].join("");
B.push(E)
}else{
if(V.ct==ZmMimeTable.TEXT_PLAIN){
B.push(b?"<pre>":"");
B.push(V.content);
B.push(b?"</pre>":"")
}else{
if(appCtxt.get(ZmSetting.VIEW_AS_HTML)){
B.push(V.content)
}else{
var _n=document.createElement("div");
_n.innerHTML=V.content;
var G=AjxStringUtil.convertHtml2Text(_n);
B.push(b?"<pre>":"");
B.push(AjxStringUtil.htmlEncode(G));
B.push(b?"</pre>":"")
}}}}
this._makeIframeProxy(_i,B.join(""),!b)
}else{
var D=N.getBodyPart();
if(D){
if(D.ct==ZmMimeTable.TEXT_HTML&&appCtxt.get(ZmSetting.VIEW_AS_HTML)){
var _h=D.content;
if(N._attachments&&ZmMailMsgView.IMG_FIX_RE.test(_h)){
var _l={};
for(var _a=0;
_a<N._attachments.length;
_a++){
var H=N._attachments[_a];
if(H.ci){
_l[H.part]=H.ci.substring(1,H.ci.length-1)
}}
_h=_h.replace(ZmMailMsgView.IMG_FIX_RE,function(c,_f,_m,j){
return _l[_m]?[_f,'"cid:',_l[_m],'"',j].join(""):c
}
)
}
this._makeIframeProxy(_i,_h,false,D.truncated)
}else{
if(ZmMimeTable.isRenderableImage(D.ct)){
var B=["<img zmforced='1' class='InlineImage' src='",appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&id=",N.id,"&part=",D.part,"'>"].join("");
this._makeIframeProxy(_i,B,false)
}else{
if(D.ct!=ZmMimeTable.TEXT_PLAIN){
var y=new AjxCallback(this,this._handleResponseRenderMessage,[_i,D,Y]);
var d=N.getTextPart(y);
if(d!=null){
this._makeIframeProxy(_i,d,true)
}
return
}else{
this._makeIframeProxy(_i,D.content,true,D.truncated)
}}}}}
this._setAttachmentLinks();
this._expandRows(this._expandHeader);
if(Y){
Y.run()
}};
ZmMailMsgView.prototype._handleResponseRenderMessage=function(t,o,c,m,l){
var h=m?m.getResponse():null;
if(h==null){
if(o.ct==ZmMimeTable.TEXT_CAL){
var u=o.content.split(/\r\n/);
var r=[];
for(var s=0;
s<u.length;
s++){
var d=u[s];
if(d.match(/^DESCRIPTION:/)){
r.push(d.substr(12));
for(var n=s+1;
n<u.length;
n++){
d=u[n];
if(d.match(/^\s+/)){
r.push(d.replace(/^\s+/," "));
continue
}
break
}
break
}}
if(r.length>0){
h=r.join("");
h=h.replace(/\\t/g,"\t");
h=h.replace(/\\n/g,"\n");
h=h.replace(/\\(.)/g,"$1")
}}else{
if(o.ct==ZmMimeTable.TEXT_HTML){
var e=document.createElement("div");
e.innerHTML=o.content;
h=AjxStringUtil.convertHtml2Text(e)
}}}
this._makeIframeProxy(t,(h||""),true,l);
this._setAttachmentLinks();
this._expandRows(this._expandHeader)
};
ZmMailMsgView.prototype._setTags=function(o){
if(!appCtxt.get(ZmSetting.TAGGING_ENABLED)||o==null||!this._tagList){
return
}
var c=o.tags.length;
var u=document.getElementById(this._hdrTableId);
var n=document.getElementById(this._tagRowId);
var f=null;
if(n!=null&&u.rows[u.rows.length-1]==n){
if(c>0){
f=n.cells[1]
}else{
u.deleteRow(-1);
return
}}else{
if(c>0){
n=u.insertRow(-1);
n.id=this._tagRowId;
var e=n.insertCell(-1);
e.className="LabelColName";
e.innerHTML=ZmMsg.tags+":";
e.style.verticalAlign="middle";
f=n.insertCell(-1)
}else{
return
}}
var h=[];
for(var r=0;
r<c;
r++){
h[r]=this._tagList.getById(o.tags[r])
}
h.sort(ZmTag.sortCompare);
var l=[];
var r=0;
l[r++]="<table cellspacing=0 cellpadding=0 border=0 width=100%><tr>";
l[r++]="<td style='overflow:hidden; id='";
l[r++]=this._tagCellId;
l[r++]=AjxEnv.isIE||AjxEnv.isSafari?"' class='Tags'>":"'>";
if(AjxEnv.isGeckoBased){
l[r++]="<table border=0 cellspacing=0 cellpadding=0><tr>"
}
for(var s=0;
s<h.length;
s++){
var m=h[s];
if(!m){
continue
}
var d=[this._tagCellId,ZmMailMsgView._TAG_ANCHOR,m.id].join("");
var t=[this._tagCellId,ZmMailMsgView._TAG_IMG,m.id].join("");
if(AjxEnv.isGeckoBased){
l[r++]="<td width=16>";
l[r++]=AjxImg.getImageHtml(ZmTag.COLOR_ICON[m.color],null,["id='",t,"'"].join(""));
l[r++]="</td><td class='Tags' style='white-space:nowrap;'>"
}
l[r++]="<a href='javascript:' onclick='ZmMailMsgView._tagClick(\"";
l[r++]=this._htmlElId;
l[r++]='","';
l[r++]=m.id;
l[r++]="\"); return false;' id='";
l[r++]=d;
l[r++]="'>";
if(AjxEnv.isIE||AjxEnv.isSafari){
l[r++]="<table style='display:inline; vertical-align:middle; width:16px' border=0 cellspacing=0 cellpadding=0><tr><td>";
l[r++]=AjxImg.getImageHtml(ZmTag.COLOR_ICON[m.color],null,["id='",t,"'"].join(""));
l[r++]="</td></tr></table>"
}
l[r++]=AjxStringUtil.htmlEncodeSpace(m.name);
l[r++]="</a>";
if(AjxEnv.isGeckoBased){
l[r++]="</td>"
}}
if(AjxEnv.isGeckoBased){
l[r++]="</tr></table>"
}
l[r++]="</td></tr></table>";
f.innerHTML=l.join("")
};
ZmMailMsgView.prototype._setAttachmentLinks=function(){
var s=!appCtxt.get(ZmSetting.VIEW_AS_HTML);
var d=this._msg.getAttachmentLinks(true,s,true);
var e=document.getElementById(this._attLinksId+"_container");
if(e){
e.style.display=d.length==0?"none":""
}
if(d.length==0){
return
}
var f=document.getElementById(this._attLinksId+"_table");
if(f){
return
}
var g=[];
var u=0;
var v=0;
var m=(this._controller.isReadingPaneOn()&&this._controller.isReadingPaneOnRight())?1:ZmMailMsgView.ATTC_COLUMNS;
var o=u;
g[u++]="<table id='"+this._attLinksId+"_table' border=0 cellpadding=0 cellspacing=0>";
var h=0;
for(var b=0;
b<d.length;
b++){
var p=d[b];
if((b%m)==0){
if(b!=0){
g[u++]="</tr>"
}
g[u++]="<tr>";
++h
}
g[u++]="<td>";
g[u++]="<table border=0 cellpadding=0 cellspacing=0 style='margin-right:1em; margin-bottom:1px'><tr>";
g[u++]="<td style='width:18px'>";
g[u++]=AjxImg.getImageHtml(p.linkIcon,"position:relative;");
g[u++]="</td><td style='white-space:nowrap'>";
var c=[];
var y=0;
c[y++]=p.isHit?"<span class='AttName-matched'>":"";
c[y++]=p.link;
c[y++]=AjxStringUtil.htmlEncode(AjxStringUtil.clipFile(p.label,30));
c[y++]=p.isHit?"</a></span>":"</a>";
var r=c.join("");
if(p.objectify&&this._objectManager){
this._lazyCreateObjectManager();
var l=this._objectManager.getImageAttachmentHandler();
u=this._objectManager.generateSpan(l,g,u,r,{
url:p.url}
)
}else{
g[u++]=r
}
if(p.size||p.htmlLink||p.vcardLink||p.download||p.briefcaseLink||p.importICSLink){
g[u++]="&nbsp;(";
if(p.size){
g[u++]=p.size;
g[u++]=") "
}
if(p.htmlLink){
g[u++]=p.htmlLink;
g[u++]=ZmMsg.preview;
g[u++]="</a>"
}else{
if(p.vcardLink){
g[u++]=p.vcardLink;
g[u++]=ZmMsg.addressBook;
g[u++]="</a>"
}}
if(p.download){
if(p.htmlLink||p.vcardLink){
g[u++]=" | "
}
g[u++]=p.download;
g[u++]=ZmMsg.download;
g[u++]="</a>"
}
if(p.briefcaseLink){
if(p.htmlLink||p.vcardLink||p.download){
g[u++]=" | "
}
g[u++]=p.briefcaseLink;
g[u++]=ZmMsg.addToBriefcase;
g[u++]="</a>"
}
if(p.importICSLink){
if(p.briefcaseLink||p.htmlLink||p.vcardLink||p.download){
g[u++]=" | "
}
g[u++]=p.importICSLink;
g[u++]=ZmMsg.addToCalendar;
g[u++]="</a>"
}
if(p.removeLink){
if(p.briefcaseLink||p.htmlLink||p.vcardLink||p.download||p.importICSLink){
g[u++]=" | "
}
g[u++]=p.removeLink;
g[u++]=ZmMsg.remove;
g[u++]="</a>"
}
if(ZmMailMsgView._attachmentHandlers){
var w=ZmMailMsgView._attachmentHandlers[p.ct];
var n;
if(w){
for(handlerId in w){
n=w[handlerId];
if(n){
g[u++]=" | "+n.call(this,p)
}}}}}
g[u++]="</td></tr></table>";
g[u++]="</td>";
if(p.ct.indexOf("image")!=-1){
++v
}}
if(this._limitAttachments!=0&&h>ZmMailMsgView._limitAttachments){
g[o]="<div style='height:";
g[o]=this._attcMaxSize;
g[o]="px; overflow:auto;' />"
}
g[u++]="</tr></table>";
if(d.length>1){
v=v>1;
g[u++]=ZmMailMsgView._buildZipUrl(this._msg.id,d,v,this._msg.subject)
}
var t=document.getElementById(this._attLinksId);
t.innerHTML=g.join("")
};
ZmMailMsgView.prototype.addAttachmentLinkHandler=function(o,t,e){
if(!ZmMailMsgView._attachmentHandlers){
ZmMailMsgView._attachmentHandlers={}
}
if(!ZmMailMsgView._attachmentHandlers[o]){
ZmMailMsgView._attachmentHandlers[o]={}
}
ZmMailMsgView._attachmentHandlers[o][t]=e
};
ZmMailMsgView.prototype._inviteToolBarListener=function(t){
t._inviteReplyType=t.item.getData(ZmOperation.KEY_ID);
var e=ZmOrganizer.ID_CALENDAR;
if(this._inviteMoveSelect&&this._inviteMoveSelect.getValue()){
e=this._inviteMoveSelect.getValue()
}
t._inviteReplyFolderId=e;
t._inviteComponentId=null;
t._msg=this._msg;
this.notifyListeners(ZmMailMsgView.REPLY_INVITE_EVENT,t)
};
ZmMailMsgView.prototype._controlEventListener=function(t){
var e=document.getElementById(this._iframeId);
if(e){
this._resetIframeHeightOnTimer(e)
}};
ZmMailMsgView.prototype._shareToolBarListener=function(e){
e._buttonId=e.item.getData(ZmOperation.KEY_ID);
e._share=this._msg.share;
this.notifyListeners(ZmMailMsgView.SHARE_EVENT,e)
};
ZmMailMsgView.prototype._msgChangeListener=function(e){
if(e.type!=ZmEvent.S_MSG){
return
}
if(e.event==ZmEvent.E_DELETE||e.event==ZmEvent.E_MOVE){
if(e.source==this._msg&&(appCtxt.getCurrentViewId()==this._viewId)){
this._controller._app.popView()
}}else{
if(e.event==ZmEvent.E_TAGS||e.event==ZmEvent.E_REMOVE_ALL){
this._setTags(this._msg)
}}};
ZmMailMsgView.prototype._selectStartListener=function(e){
e._stopPropagation=false;
e._returnValue=true
};
ZmMailMsgView.prototype._tagChangeListener=function(n){
if(n.type!=ZmEvent.S_TAG){
return
}
var t=n.getDetail("fields");
if(n.event==ZmEvent.E_MODIFY&&(t&&t[ZmOrganizer.F_COLOR])){
var e=n.getDetail("organizers")[0];
var o=document.getElementById(this._tagCellId+ZmDoublePaneView._TAG_IMG+e.id);
if(o){
AjxImg.setImage(o,ZmTag.COLOR_ICON[e.color])
}}
if(n.event==ZmEvent.E_DELETE||n.event==ZmEvent.MODIFY){
this._setTags(this._msg)
}};
ZmMailMsgView.prototype._expandButtonListener=function(e){
this._expandRows(!this._expandHeader)
};
ZmMailMsgView.prototype._expandRows=function(s){
this._expandHeader=s;
if(this._expandButton){
this._expandButton.setImage(s?"HeaderExpanded":"HeaderCollapsed")
}
var e=document.getElementById(this._expandRowId);
var r=e.parentNode;
if(!s){
this._addressRows=[];
while(e.nextSibling){
var h=e.nextSibling;
this._addressRows.push(h);
r.removeChild(h)
}}else{
if(this._addressRows){
for(var o=0;
o<this._addressRows.length;
o++){
var h=this._addressRows[o];
r.appendChild(h)
}
this._addressRows=null
}}
var t=document.getElementById(this._attLinksId+"_container");
if(t){
Dwt.setVisible(t,s)
}
if(this._scrollWithIframe){
var n=document.getElementById(this._iframeId);
if(n){
ZmMailMsgView._resetIframeHeight(this,n)
}}};
ZmMailMsgView.prototype._closeButtonListener=function(e){
if(!appCtxt.isOffline||(this._viewId==appCtxt.getCurrentViewId())){
this._controller._backListener()
}};
ZmMailMsgView.prototype._reportButtonListener=function(h,n){
var t=AjxUtil.createProxy(h);
t.clearAddresses();
var r=new AjxEmailAddress(appCtxt.get(ZmSetting.OFFLINE_REPORT_EMAIL));
t._addrs[AjxEmailAddress.TO]=AjxVector.fromArray([r]);
var o=h.getBodyPart();
if(o){
var s=new ZmMimePart();
s.setContentType(o.ct);
s.setContent(h.getBodyPart().content);
t.setTopPart(s)
}
var l=new AjxCallback(this,this._sendReportCallback,h);
var e=new AjxCallback(this,this._sendReportError);
t.send(false,l,e,null,true)
};
ZmMailMsgView.prototype._sendReportCallback=function(e){
this._controller._doDelete([e],true)
};
ZmMailMsgView.prototype._sendReportError=function(){
appCtxt.setStatusMsg(ZmMsg.reportSyncError,ZmStatusView.LEVEL_WARNING)
};
ZmMailMsgView.prototype._msgTagClicked=function(t){
var e=appCtxt.getById(t);
appCtxt.getSearchController().search({
query:e.createQuery()}
)
};
ZmMailMsgView.prototype._handleMsgTruncated=function(){
this._msg.viewEntireMessage=true;
var e=("/h/message?id="+this._msg.id);
window.open(appContextPath+e,"_blank")
};
ZmMailMsgView.prototype._focus=function(){
this._settingFocus=true;
this.getHtmlElement().focus();
this._settingFocus=false
};
ZmMailMsgView.prototype._blur=function(){
if(this._settingFocus){
return
}
this.getHtmlElement().blur()
};
ZmMailMsgView._swapIdAndSrc=function(h,s,e,l,o,r,t){
try{
h.src=h.getAttribute("dfsrc")
}
catch(n){}
if(s==e-1){
if(l){
l.setHtmlContent(o.documentElement.innerHTML)
}
t._resetIframeHeightOnTimer(r)
}};
ZmMailMsgView.prototype._onloadIframe=function(o){
var t=o.getIframe();
try{
t.onload=null
}
catch(e){}
ZmMailMsgView._resetIframeHeight(this,t)
};
ZmMailMsgView._resetIframeHeight=function(m,e,t){
var o;
if(m._scrollWithIframe){
o=m.getH();
function r(h){
if(h){
if(typeof h=="string"){
h=document.getElementById(h)
}
if(h){
o-=Dwt.getSize(h).y
}}}
r(m._headerElement);
r(m._displayImagesId);
r(m._highlightObjectsId);
if(m._isMsgTruncated){
r(m._msgTruncatedId)
}
if(m._hasInviteToolbar&&m._inviteToolbar){
r(m._inviteToolbar.getHtmlElement())
}
if(m._hasShareToolbar&&m._shareToolbar){
r(m._shareToolbar.getHtmlElement())
}
e.style.height=o+"px"
}else{
if(t==null){
t=0
}
try{
if(!e.contentWindow||!e.contentWindow.document||(AjxEnv.isFirefox3up&&t==0)){
if(t<ZmMailMsgView.SETHEIGHT_MAX_TRIES){
t++;
m._resetIframeHeightOnTimer(e,t)
}
return
}}
catch(s){
if(t<ZmMailMsgView.SETHEIGHT_MAX_TRIES){
t++;
m._resetIframeHeightOnTimer(e,t++)
}
return
}
var c=e.contentWindow.document;
var u=AjxEnv.isIE?c.body.scrollHeight:0;
e.style.width="100%";
if(AjxEnv.isGeckoBased&&Math.max(c.body.scrollHeight,c.documentElement.scrollHeight)>30000){
m.setScrollWithIframe(true);
return
}
var n=e.offsetWidth;
var l=c.body.scrollWidth;
if(l>n){
e.style.width=l+"px";
c.body.style.overflow="visible";
if(n>20){
c.body.style.width=n-20+"px"
}}
o=Math.max(c.body.scrollHeight,c.documentElement.scrollHeight,u);
e.style.height=o+"px";
if(AjxEnv.isWebKitBased){
var d=Math.max(c.body.scrollHeight,c.documentElement.scrollHeight);
if(d>o){
e.style.height=d+"px"
}}}};
ZmMailMsgView.prototype.setScrollWithIframe=function(t){
this._scrollWithIframe=t;
this._limitAttachments=this._scrollWithIframe?3:0;
this._attcMaxSize=this._limitAttachments*16+8;
this.setScrollStyle(t?DwtControl.CLIP:DwtControl.SCROLL);
var e=document.getElementById(this._iframeId);
if(e){
e.style.width="100%";
e.scrolling=t;
ZmMailMsgView._resetIframeHeight(this,e)
}};
ZmMailMsgView._tagClick=function(e,t){
var o=DwtControl.fromElementId(e);
o.notifyListeners(ZmMailMsgView._TAG_CLICK,t)
};
ZmMailMsgView._detachCallback=function(t,h,e){
var n=window.parentAppCtxt||window.appCtxt;
var r=e.getResponse().GetMsgResponse;
var o=n.getApp(ZmApp.MAIL).getMailListController().getList();
var s=new ZmMailMsg(r.m[0].id,o,true);
s._loadFromDom(r.m[0]);
s._loaded=true;
s.readReceiptRequested=false;
s._part=r.m[0].part;
ZmMailMsgView.detachMsgInNewWindow(s,t,h)
};
ZmMailMsgView.detachMsgInNewWindow=function(s,t,n){
var o=window.parentAppCtxt||window.appCtxt;
var e=o.getNewWindow(true);
e.command="msgViewDetach";
e.params={
msg:s,isRfc822:t,mode:n}
};
ZmMailMsgView.rfc822Callback=function(n,t,r){
var e=Boolean((t!=null));
var o=window.parentAppCtxt||window.appCtxt;
var s={
sender:o.getAppController(),msgId:n,partId:t,getHtml:o.get(ZmSetting.VIEW_AS_HTML),markRead:true,callback:(new AjxCallback(null,ZmMailMsgView._detachCallback,[e,r]))};
ZmMailMsg.fetchMsg(s)
};
ZmMailMsgView.contactIconCallback=function(s,o){
if(o=="Contact"){
var n={
action:ZmOperation.NEW_MESSAGE,toOverride:(s+AjxEmailAddress.SEPARATOR)};
AjxDispatcher.run("Compose",n)
}else{
AjxDispatcher.require(["ContactsCore","Contacts"],false);
var e=new ZmContact(null);
var t=AjxEmailAddress.parse(s);
e.initFromEmail(t);
AjxDispatcher.run("GetContactController").show(e,true)
}};
ZmMailMsgView.vcardCallback=function(o,t){
ZmZimbraMail.unloadHackCallback();
var e=window.parentAppCtxt||window.appCtxt;
e.getApp(ZmApp.CONTACTS).createFromVCard(o,t)
};
ZmMailMsgView.removeAttachmentCallback=function(t,e){
ZmZimbraMail.unloadHackCallback();
if(!(e instanceof Array)){
e=[e]
}
var n=(e.length>1)?ZmMsg.attachmentConfirmRemoveAll:ZmMsg.attachmentConfirmRemove;
var o=appCtxt.getYesNoMsgDialog();
o.registerCallback(DwtDialog.YES_BUTTON,ZmMailMsgView._removeAttachmentCallback,null,[t,e]);
o.setMessage(n,DwtMessageDialog.WARNING_STYLE);
o.popup()
};
ZmMailMsgView._removeAttachmentCallback=function(o,t){
appCtxt.getYesNoMsgDialog().popdown();
var s={
RemoveAttachmentsRequest:{
_jsns:"urn:zimbraMail"}};
var e=s.RemoveAttachmentsRequest;
e.m={
id:o,part:t.join(",")};
var n={
jsonObj:s,asyncMode:true,callback:(new AjxCallback(null,ZmMailMsgView._handleRemoveAttachment,[o])),noBusyOverlay:true};
return appCtxt.getAppController().sendRequest(n)
};
ZmMailMsgView._handleRemoveAttachment=function(n,m){
var u=window.parentAppCtxt||window.appCtxt;
var e=m.getResponse().RemoveAttachmentsResponse.m[0];
var r=u.getApp(ZmApp.MAIL).getMailListController();
r.actionedMsgId=e.id;
var s=r.getList();
var o=appCtxt.getAppViewMgr();
var c=o._views;
var t=new ZmMailMsg(e.id,s,true);
t._loadFromDom(e);
for(var l in c){
var d=c[l];
var h=d&&(d[ZmAppViewMgr.C_APP_CONTENT]||d[ZmAppViewMgr.C_APP_CONTENT_FULL]);
if(h){
if(AjxUtil.isFunction(h.handleRemoveAttachment)){
h.handleRemoveAttachment(n,t)
}}}};
ZmMailMsgView.prototype.handleRemoveAttachment=function(t,e){
if(!this._msg||this._msg.id==t){
this._msg=null;
this.set(e)
}};
ZmMailMsgView._buildZipUrl=function(l,s,c,e){
if(AjxUtil.isString(e)){
e=e.replace(ZmMailMsgView.FILENAME_INV_CHARS_RE,"")
}else{
e=null
}
e=AjxStringUtil.urlComponentEncode(e||ZmMsg.downloadAllDefaultFileName);
var t=[appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&id=",l,"&filename=",e,"&part="].join("");
var r=[];
for(var h=0;
h<s.length;
h++){
r.push(s[h].part)
}
var o=r.join(",");
var n={
url:(t+o),partIds:o,itemId:l};
if(c){
n.viewAllUrl="/h/viewimages?id="+l
}
return AjxTemplate.expand("mail.Message#AllAttachments",n)
};
ZmMailMsgView.briefcaseCallback=function(s,n,e){
ZmZimbraMail.unloadHackCallback();
AjxDispatcher.require("BriefcaseCore");
var o=appCtxt.isChildWindow?parentAppCtxt:appCtxt;
var t=o.getApp(ZmApp.BRIEFCASE);
t._createDeferredFolders();
appCtxt.getApp(ZmApp.BRIEFCASE).createFromAttachment(s,n,e)
};
ZmMailMsgView.prototype.deactivate=function(){
this._controller.inactive=true
};
ZmMailMsgView.addToCalendarCallback=function(s,n,t){
ZmZimbraMail.unloadHackCallback();
AjxDispatcher.require("CalendarCore");
var o=appCtxt.isChildWindow?parentAppCtxt:appCtxt;
var e=o.getApp(ZmApp.CALENDAR);
e._createDeferredFolders();
appCtxt.getApp(ZmApp.CALENDAR).importAppointment(s,n,t)
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmMailMsgListView")){
ZmMailMsgListView=function(e){
this._mode=e.mode;
this.view=e.view=(e.view||e.mode);
e.type=ZmItem.MSG;
e.headerList=this._getHeaderList(e.parent,e.controller);
ZmMailListView.call(this,e)
};
ZmMailMsgListView.prototype=new ZmMailListView;
ZmMailMsgListView.prototype.constructor=ZmMailMsgListView;
ZmMailMsgListView.INDENT="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
ZmMailMsgListView.prototype.toString=function(){
return"ZmMailMsgListView"
};
ZmMailMsgListView.prototype.markUIAsRead=function(e){
ZmMailListView.prototype.markUIAsRead.apply(this,arguments);
this._setImage(e,ZmItem.F_STATUS,e.getStatusIcon())
};
ZmMailMsgListView.prototype._addParams=function(n,o){
if(this._mode==ZmId.VIEW_TRAD){
return ZmMailListView.prototype._addParams.apply(this,arguments)
}else{
var t=appCtxt.getById(n.cid);
var e=this._controller._activeSearch&&this._controller._activeSearch.search;
o.isMatched=(e&&e.hasTextTerm&&n.inHitList)
}};
ZmMailMsgListView.prototype._getDivClass=function(t,e,o){
if(o.isMatched&&!o.isDragProxy){
return t+" "+[t,DwtCssStyle.MATCHED].join("-")
}else{
return ZmMailListView.prototype._getDivClass.apply(this,arguments)
}};
ZmMailMsgListView.prototype._getRowClass=function(o){
var e=[];
if(this._mode!=ZmId.VIEW_TRAD){
var t=appCtxt.getById(o.folderId);
if(t&&t.isInTrash()){
e.push("Trash")
}}
if(o.isUnread){
e.push("Unread")
}
if(o.isSent){
e.push("Sent")
}
return e.length?e.join(" "):null
};
ZmMailMsgListView.prototype._getCellId=function(e,t){
if(t==ZmItem.F_SUBJECT&&(this._mode==ZmId.VIEW_CONV||this._mode==ZmId.VIEW_CONVLIST)){
return this._getFieldId(e,t)
}else{
return ZmMailListView.prototype._getCellId.apply(this,arguments)
}};
ZmMailMsgListView.prototype._getCellContents=function(y,g,s,f,c,r){
if(f==ZmItem.F_STATUS){
g=this._getImageHtml(y,g,s.getStatusIcon(),this._getFieldId(s,f))
}else{
if(f==ZmItem.F_FROM||f==ZmItem.F_PARTICIPANT){
if(this._isOutboundFolder()){
var d=s.getAddresses(AjxEmailAddress.TO).getArray();
if(!d||d.length==0){
d=s.getAddresses(AjxEmailAddress.FROM).getArray()
}
if(d&&d.length){
var u=this._getFieldId(s,ZmItem.F_PARTICIPANT);
var p=d.length;
var o=false;
var l=this._fitParticipants(d,o,145);
for(var h=0;
h<l.length;
h++){
if(h==1&&(o||l.length<p)){
y[g++]=AjxStringUtil.ELLIPSIS
}else{
if(l.length>1&&h>0){
y[g++]=", "
}}
y[g++]="<span style='white-space: nowrap' id='";
y[g++]=[u,l[h].index+1].join(DwtId.SEP);
y[g++]="'>";
y[g++]=l[h].name;
y[g++]="</span>";
if(l.length==1&&l.length<p){
y[g++]=AjxStringUtil.ELLIPSIS
}}}else{
y[g++]="&nbsp;"
}}else{
var n=s.getAddress(AjxEmailAddress.FROM);
if(n){
if(this._mode==ZmId.VIEW_CONVLIST&&this._isMultiColumn){
y[g++]=ZmMailMsgListView.INDENT
}
y[g++]="<span style='white-space:nowrap' id='";
y[g++]=this._getFieldId(s,ZmItem.F_FROM);
y[g++]="'>";
var e=n.getName()||n.getDispName()||n.getAddress();
y[g++]=AjxStringUtil.htmlEncode(e);
y[g++]="</span>"
}}}else{
if(f==ZmItem.F_SUBJECT){
if(this._mode==ZmId.VIEW_CONV||this._mode==ZmId.VIEW_CONVLIST){
if(this._mode==ZmId.VIEW_CONVLIST&&this._isMultiColumn){
y[g++]=ZmMailMsgListView.INDENT
}
if(!this._isMultiColumn){
y[g++]="<span class='ZmConvListFragment'>"
}
y[g++]=AjxStringUtil.htmlEncode(s.fragment,true);
if(!this._isMultiColumn){
y[g++]="</span>"
}}else{
var m=s.subject||ZmMsg.noSubject;
y[g++]=AjxStringUtil.htmlEncode(m);
if(appCtxt.get(ZmSetting.SHOW_FRAGMENTS)&&s.fragment){
y[g++]=this._getFragmentSpan(s)
}}}else{
if(f==ZmItem.F_FOLDER){
y[g++]="<nobr id='";
y[g++]=this._getFieldId(s,f);
y[g++]="'>";
var t=appCtxt.getById(s.folderId);
if(t){
y[g++]=t.getName()
}
y[g++]="</nobr>"
}else{
if(f==ZmItem.F_SIZE){
y[g++]="<nobr>";
y[g++]=AjxUtil.formatSize(s.size);
y[g++]="</nobr>"
}else{
if(f==ZmItem.F_SORTED_BY){
y[g++]=this._getAbridgedContent(s,c)
}else{
g=ZmMailListView.prototype._getCellContents.apply(this,arguments)
}}}}}}
return g
};
ZmMailMsgListView.prototype._getAbridgedContent=function(n,s){
var t=[];
var e=0;
var o=(AjxEnv.isIE||AjxEnv.isSafari)?"22":"16";
t[e++]="<table border=0 cellspacing=0 cellpadding=0 width=100%>";
t[e++]=(n.isUnread)?"<tr class='Unread' ":"<tr ";
t[e++]="id='";
t[e++]=DwtId.getListViewItemId(DwtId.WIDGET_ITEM_FIELD,this._view,n.id,ZmItem.F_ITEM_ROW_3PANE);
t[e++]="'>";
if(appCtxt.multiAccounts&&appCtxt.getSearchController().searchAllAccounts){
e=this._getAbridgedCell(t,e,n,ZmItem.F_ACCOUNT,s,"16","align=right")
}
if(n.isHighPriority||n.isLowPriority){
e=this._getAbridgedCell(t,e,n,ZmItem.F_PRIORITY,s,"10","align=right")
}
e=this._getAbridgedCell(t,e,n,ZmItem.F_SUBJECT,s);
if(n.hasAttach){
e=this._getAbridgedCell(t,e,n,ZmItem.F_ATTACHMENT,s,"16")
}
if(appCtxt.get("FLAGGING_ENABLED")){
e=this._getAbridgedCell(t,e,n,ZmItem.F_FLAG,s,"16")
}
t[e++]="</tr></table>";
t[e++]="<table border=0 cellspacing=0 cellpadding=0 width=100%><tr>";
t[e++]="<td width=16></td>";
e=this._getAbridgedCell(t,e,n,ZmItem.F_STATUS,s,o,"style='padding-left:0px'");
e=this._getAbridgedCell(t,e,n,ZmItem.F_FROM,s);
e=this._getAbridgedCell(t,e,n,ZmItem.F_DATE,s,ZmMsg.COLUMN_WIDTH_DATE,"align=right");
e=this._getAbridgedCell(t,e,n,ZmItem.F_TAG,s,"16");
t[e++]="</tr></table>";
return t.join("")
};
ZmMailMsgListView.prototype._changeListener=function(s){
var h=this._getItemFromEvent(s);
if(!h||s.handled||!this._handleEventType[h.type]){
return
}
if(this._mode&&(this._mode!=appCtxt.getCurrentViewId())&&(this._mode!=appCtxt.getAppViewMgr().getLastViewId())){
return
}
if((s.event==ZmEvent.E_DELETE||s.event==ZmEvent.E_MOVE)&&this._mode==ZmId.VIEW_CONV){
if(!this._controller.handleDelete()){
if(s.event==ZmEvent.E_DELETE){
ZmMailListView.prototype._changeListener.call(this,s)
}else{
if(h.folderId==ZmFolder.ID_SPAM){
this._controller._list.remove(h,true);
ZmMailListView.prototype._changeListener.call(this,s)
}else{
this._changeFolderName(h,s.getDetail("oldFolderId"));
this._checkReplenishOnTimer()
}}}}else{
if(this._mode==ZmId.VIEW_CONV&&s.event==ZmEvent.E_CREATE){
var r=AjxDispatcher.run("GetConvController").getConv();
if(r&&(h.cid==r.id)){
ZmMailListView.prototype._changeListener.call(this,s)
}}else{
if(s.event==ZmEvent.E_FLAGS){
var o=s.getDetail("flags");
for(var n=0;
n<o.length;
n++){
var t=o[n];
var e=h[ZmItem.FLAG_PROP[t]];
if(t==ZmItem.FLAG_REPLIED&&e){
this._setImage(h,ZmItem.F_STATUS,"MsgStatusReply")
}else{
if(t==ZmItem.FLAG_FORWARDED&&e){
this._setImage(h,ZmItem.F_STATUS,"MsgStatusForward")
}}}
ZmMailListView.prototype._changeListener.call(this,s)
}else{
ZmMailListView.prototype._changeListener.call(this,s);
if(s.event==ZmEvent.E_CREATE||s.event==ZmEvent.E_DELETE||s.event==ZmEvent.E_MOVE){
this._resetColWidth()
}}}}};
ZmMailMsgListView.prototype._changeFolderName=function(n,o){
var t=appCtxt.getById(n.folderId);
if(!this._controller.isReadingPaneOn()||!this._controller.isReadingPaneOnRight()){
var e=t?this._getElement(n,ZmItem.F_FOLDER):null;
if(e){
e.innerHTML=t.getName()
}}
if(t&&(t.nId==ZmFolder.ID_TRASH||o==ZmFolder.ID_TRASH)){
this._changeTrashStatus(n)
}};
ZmMailMsgListView.prototype._changeTrashStatus=function(o){
var t=this._getElement(o,ZmItem.F_ITEM_ROW);
if(t){
if(o.isUnread){
Dwt.addClass(t,"Unread")
}
var e=appCtxt.getById(o.folderId);
if(e&&e.isInTrash()){
Dwt.addClass(t,"Trash")
}else{
Dwt.delClass(t,"Trash")
}
if(o.isSent){
Dwt.addClass(t,"Sent")
}}};
ZmMailMsgListView.prototype._getHeaderList=function(t,e){
var o;
if(this.isMultiColumn(e)){
o=[];
o.push(ZmItem.F_SELECTION);
if(appCtxt.get("FLAGGING_ENABLED")){
o.push(ZmItem.F_FLAG)
}
o.push(ZmItem.F_PRIORITY,ZmItem.F_TAG,ZmItem.F_STATUS,ZmItem.F_FROM,ZmItem.F_ATTACHMENT,ZmItem.F_SUBJECT,ZmItem.F_FOLDER,ZmItem.F_SIZE);
if(appCtxt.accountList.size()>2){
o.push(ZmItem.F_ACCOUNT)
}
o.push(ZmItem.F_DATE)
}else{
o=[ZmItem.F_SELECTION,ZmItem.F_SORTED_BY]
}
return this._getHeaders(this.view,o)
};
ZmMailMsgListView.prototype._sortColumn=function(o,h){
ZmMailListView.prototype._sortColumn.call(this,o,h);
var n;
var e=AjxDispatcher.run((this._mode==ZmId.VIEW_CONV)?"GetConvController":"GetTradController");
if(this._columnHasCustomQuery(o)){
n=this._getSearchForSort(o._sortable,e)
}else{
if(this.getList().size()>1&&this._sortByString){
n=e.getSearchString()
}}
var t=this._controller.getSearchStringHint();
if(n||t){
if(this._mode==ZmId.VIEW_CONV){
var r=e.getConv();
if(r){
var l=new AjxCallback(this,this._handleResponseSortColumn,[r,o,e]);
var s={
query:n,queryHint:t,sortBy:this._sortByString,getFirstMsg:e.isReadingPaneOn()};
r.load(s,l)
}}else{
var s={
query:n,queryHint:t,types:[ZmItem.MSG],sortBy:this._sortByString,limit:this.getLimit()};
appCtxt.getSearchController().search(s)
}}};
ZmMailMsgListView.prototype._columnHasCustomQuery=function(e){
return(e._sortable==ZmItem.F_FLAG||e._sortable==ZmItem.F_ATTACHMENT)
};
ZmMailMsgListView.prototype._handleResponseSortColumn=function(r,n,o,t){
var e=t.getResponse();
var s=e.getResults(ZmItem.MSG);
o.setList(s);
o._activeSearch=e;
this.offset=0;
this.set(r.msgs,n);
this.setSelection(r.getFirstHotMsg({
offset:this.offset,limit:this.getLimit(this.offset)}
))
};
ZmMailMsgListView.prototype._getParentForColResize=function(){
return this.parent
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmConvListView")){
ZmConvDoublePaneView=function(e){
e.className=e.className||"ZmConvDoublePaneView";
e.mode=ZmId.VIEW_CONVLIST;
ZmDoublePaneView.call(this,e)
};
ZmConvDoublePaneView.prototype=new ZmDoublePaneView;
ZmConvDoublePaneView.prototype.constructor=ZmConvDoublePaneView;
ZmConvDoublePaneView.prototype.toString=function(){
return"ZmConvDoublePaneView"
};
ZmConvDoublePaneView.prototype._createMailListView=function(e){
e.parent=this;
e.posStyle=Dwt.ABSOLUTE_STYLE;
return new ZmConvListView(e)
};
ZmConvListView=function(e){
this.view=e.view=ZmId.VIEW_CONVLIST;
e.type=ZmItem.CONV;
e.headerList=this._getHeaderList(parent,e.controller);
ZmMailListView.call(this,e);
this._handleEventType[ZmItem.CONV]=true;
this._handleEventType[ZmItem.MSG]=true;
this._mode=ZmId.VIEW_CONVLIST;
this._hasHiddenRows=true;
this._resetExpansion()
};
ZmConvListView.prototype=new ZmMailListView;
ZmConvListView.prototype.constructor=ZmConvListView;
ZmListView.FIELD_CLASS[ZmItem.F_EXPAND]="Expand";
ZmConvListView.MSG_STYLE="ZmConvExpanded";
ZmConvListView.prototype._changeFolderName=ZmMailMsgListView.prototype._changeFolderName;
ZmConvListView.prototype._changeTrashStatus=ZmMailMsgListView.prototype._changeTrashStatus;
ZmConvListView.prototype.toString=function(){
return"ZmConvListView"
};
ZmConvListView.prototype.set=function(t,e){
if(this.offset==0){
this._resetExpansion()
}
ZmMailListView.prototype.set.apply(this,arguments)
};
ZmConvListView.prototype.handleKeyAction=function(e,t){
switch(e){
case DwtKeyMap.DBLCLICK:return false;
default:return ZmMailListView.prototype.handleKeyAction.call(this,e,t)
}};
ZmConvListView.prototype.markUIAsRead=function(e){
ZmMailListView.prototype.markUIAsRead.apply(this,arguments);
if(e.type==ZmItem.MSG){
this._setImage(e,ZmItem.F_STATUS,e.getStatusIcon())
}};
ZmConvListView.prototype.getList=function(o){
if(!o){
return ZmMailListView.prototype.getList.call(this)
}else{
var s=[];
var r=this._parentEl.childNodes;
for(var e=0;
e<r.length;
e++){
var t=r[e];
if(Dwt.getVisible(t)){
var n=this.getItemFromElement(t);
if(n){
s.push(n)
}}}
return AjxVector.fromArray(s)
}};
ZmConvListView.prototype.getItemIndex=function(n,o){
var s=this.getList(o);
if(n&&s){
var e=s.size();
for(var t=0;
t<e;
++t){
var r=s.get(t);
if(r&&r.id==n.id){
return t
}}}
return null
};
ZmConvListView.prototype._initHeaders=function(){
if(!this._headerInit){
ZmMailListView.prototype._initHeaders.call(this);
this._headerInit[ZmItem.F_EXPAND]={
icon:"NodeCollapsed",width:ZmListView.COL_WIDTH_ICON,name:ZmMsg.expand};
this._headerInit[ZmItem.F_FROM]={
text:ZmMsg.from,width:ZmMsg.COLUMN_WIDTH_FROM_CLV,resizeable:true}
}};
ZmConvListView.prototype._getHeaderList=function(t,e){
var o;
if(this.isMultiColumn(e)){
o=[ZmItem.F_SELECTION,ZmItem.F_EXPAND,ZmItem.F_FLAG,ZmItem.F_PRIORITY,ZmItem.F_TAG,ZmItem.F_STATUS,ZmItem.F_FROM,ZmItem.F_ATTACHMENT,ZmItem.F_SUBJECT,ZmItem.F_FOLDER,ZmItem.F_SIZE];
if(appCtxt.accountList.size()>2){
o.push(ZmItem.F_ACCOUNT)
}
o.push(ZmItem.F_DATE)
}else{
o=[ZmItem.F_SELECTION,ZmItem.F_SORTED_BY]
}
return this._getHeaders(ZmId.VIEW_CONVLIST,o)
};
ZmConvListView.prototype._resetFromColumnLabel=function(){
var e=this._headerHash[ZmItem.F_FROM];
if(e){
e._sortable=this._isOutboundFolder()?ZmItem.F_FROM:null
}
ZmMailListView.prototype._resetFromColumnLabel.apply(this,arguments)
};
ZmConvListView.prototype._getDivClass=function(t,e,o){
if(e.type==ZmItem.MSG){
if(o.isDragProxy||o.isMatched){
return ZmMailMsgListView.prototype._getDivClass.apply(this,arguments)
}else{
return[t,ZmConvListView.MSG_STYLE].join(" ")
}}else{
return ZmMailListView.prototype._getDivClass.apply(this,arguments)
}};
ZmConvListView.prototype._getRowClass=function(e){
return(e.type==ZmItem.MSG)?ZmMailMsgListView.prototype._getRowClass.apply(this,arguments):ZmMailListView.prototype._getRowClass.apply(this,arguments)
};
ZmConvListView.prototype._addParams=function(e,t){
if(e.type==ZmItem.MSG){
ZmMailMsgListView.prototype._addParams.apply(this,arguments)
}};
ZmConvListView.prototype._getStyleViaZimlet=function(o,t){
if(o!="fr"&&o!="su"&&o!="st"){
return""
}
if(appCtxt.zimletsPresent()&&this._ignoreProcessingGetMailCellStyle==undefined){
if(!this._zimletMgr){
this._zimletMgr=appCtxt.getZimletMgr()
}
var e=this._zimletMgr.processARequest("getMailCellStyle",t,o);
if(e!=undefined&&e!=null){
return e
}else{
if(e==null&&this._zimletMgr.isLoaded()){
this._ignoreProcessingGetMailCellStyle=true
}}}
return""
};
ZmConvListView.prototype._getCell=function(t,e,o,n,r,s){
if(n==ZmItem.F_SORTED_BY&&o.type==ZmItem.MSG){
t[e++]="<td width=28>";
e=this._getCellContents(t,e,o,ZmItem.F_EXPAND,r,s);
t[e++]="</td>"
}
return ZmMailListView.prototype._getCell.apply(this,arguments)
};
ZmConvListView.prototype._getCellId=function(e,t){
return(t==ZmItem.F_FROM)?this._getFieldId(e,t):ZmMailListView.prototype._getCellId.apply(this,arguments)
};
ZmConvListView.prototype._getCellClass=function(e,t,o){
return(e.type==ZmItem.CONV&&t==ZmItem.F_SIZE)?"Count":(ZmMailListView.prototype._getCellClass.apply(this,arguments))
};
ZmConvListView.prototype._getCellContents=function(t,e,n,s,h,r){
if(s==ZmItem.F_SELECTION){
e=ZmMailListView.prototype._getCellContents.apply(this,arguments)
}else{
if(s==ZmItem.F_EXPAND){
e=this._getImageHtml(t,e,this._isExpandable(n)?"NodeCollapsed":null,this._getFieldId(n,s))
}else{
if(n.type==ZmItem.MSG){
e=ZmMailMsgListView.prototype._getCellContents.apply(this,arguments)
}else{
if(s==ZmItem.F_STATUS){
t[e++]="&nbsp;"
}else{
if(s==ZmItem.F_FROM){
t[e++]=this._getParticipantHtml(n,this._getFieldId(n,ZmItem.F_PARTICIPANT))
}else{
if(s==ZmItem.F_SUBJECT){
t[e++]=n.subject?AjxStringUtil.htmlEncode(n.subject,true):AjxStringUtil.htmlEncode(ZmMsg.noSubject);
if(appCtxt.get(ZmSetting.SHOW_FRAGMENTS)&&n.fragment){
t[e++]=this._getFragmentSpan(n)
}}else{
if(s==ZmItem.F_FOLDER){
if(n.folderId){
t[e++]="<nobr id='";
t[e++]=this._getFieldId(n,s);
t[e++]="'>";
var o=appCtxt.getById(n.folderId);
if(o){
t[e++]=o.getName()
}
t[e++]="</nobr>"
}}else{
if(s==ZmItem.F_SIZE){
if(n.size){
t[e++]="<nobr>";
t[e++]=AjxUtil.formatSize(n.size);
t[e++]="</nobr>"
}else{
if(n.numMsgs>1){
t[e++]="(";
t[e++]=n.numMsgs;
t[e++]=")"
}}}else{
if(s==ZmItem.F_TYPE){
if(n.isDraft){
t[e++]=AjxImg.getImageHtml("MsgStatusDraft",null,["id='",this._getFieldId(n,ZmItem.F_STATUS),"'"].join(""))
}else{
e=ZmMailListView.prototype._getCellContents.apply(this,arguments)
}}else{
if(s==ZmItem.F_SORTED_BY){
t[e++]=this._getAbridgedContent(n,h)
}else{
e=ZmMailListView.prototype._getCellContents.apply(this,arguments)
}}}}}}}}}}
return e
};
ZmConvListView.prototype._getAbridgedContent=function(s,r){
var t=[];
var e=0;
var n=(AjxEnv.isIE||AjxEnv.isSafari)?22:16;
t[e++]="<table border=0 cellspacing=0 cellpadding=0 width=100%>";
t[e++]=(s.isUnread)?"<tr class='Unread' ":"<tr ";
t[e++]="id='";
t[e++]=DwtId.getListViewItemId(DwtId.WIDGET_ITEM_FIELD,this._view,s.id,ZmItem.F_ITEM_ROW_3PANE);
t[e++]="'>";
if(s.type!=ZmItem.MSG){
e=this._getAbridgedCell(t,e,s,ZmItem.F_EXPAND,r,"16","style='padding:0px'");
if(s.isHighPriority||s.isLowPriority){
e=this._getAbridgedCell(t,e,s,ZmItem.F_PRIORITY,r,"10","align=right")
}}else{
e=this._getAbridgedCell(t,e,s,ZmItem.F_STATUS,r,n)
}
e=this._getAbridgedCell(t,e,s,ZmItem.F_SUBJECT,r);
if(s.hasAttach){
e=this._getAbridgedCell(t,e,s,ZmItem.F_ATTACHMENT,r,"16","valign=top")
}
if(appCtxt.get("FLAGGING_ENABLED")){
e=this._getAbridgedCell(t,e,s,ZmItem.F_FLAG,r,"16")
}
t[e++]="</tr></table>";
t[e++]="<table border=0 cellspacing=0 cellpadding=0 width=100%><tr>";
if(s.type==ZmItem.MSG&&(s.isHighPriority||s.isLowPriority)){
e=this._getAbridgedCell(t,e,s,ZmItem.F_PRIORITY,r,n,"align=right")
}else{
var o=(s.type==ZmItem.MSG)?n:(n+15);
t[e++]="<td width='"+o+"'";
t[e++]=this._getStyleViaZimlet(ZmItem.F_FROM,s);
t[e++]="></td>"
}
if(appCtxt.multiAccounts&&s.type==ZmItem.CONV&&appCtxt.getSearchController().searchAllAccounts){
e=this._getAbridgedCell(t,e,s,ZmItem.F_ACCOUNT,r,"16","align=right")
}
e=this._getAbridgedCell(t,e,s,ZmItem.F_FROM,r);
if(s.type!=ZmItem.MSG){
e=this._getAbridgedCell(t,e,s,ZmItem.F_SIZE,r,ZmMsg.COLUMN_WIDTH_SIZE)
}
e=this._getAbridgedCell(t,e,s,ZmItem.F_DATE,r,ZmMsg.COLUMN_WIDTH_DATE,"align=right");
e=this._getAbridgedCell(t,e,s,ZmItem.F_TAG,r,"16");
t[e++]="</tr></table>";
return t.join("")
};
ZmConvListView.prototype._getParticipantHtml=function(g,d){
var l=[];
var f=0;
var s=g.participants?g.participants.getArray():null;
var m=s?s.length:0;
if(m>0){
var t=appCtxt.getById(this._folderId);
if((m==1)&&(s[0].type==AjxEmailAddress.FROM)&&t&&(t.isUnder(ZmFolder.ID_SENT)||t.isUnder(ZmFolder.ID_DRAFTS)||t.isUnder(ZmFolder.ID_OUTBOX))){
var n=g.getFirstHotMsg();
if(n){
var c=n.getAddresses(AjxEmailAddress.TO).getArray();
if(c&&c.length){
s=c
}else{
return"&nbsp;"
}}}
var u=this._headerHash[ZmItem.F_FROM];
var e=u?u._width:ZmMsg.COLUMN_WIDTH_FROM_CLV;
var o=this._fitParticipants(s,g.participantsElided,e);
for(var h=0;
h<o.length;
h++){
if(h==1&&(g.participantsElided||o.length<m)){
l[f++]=AjxStringUtil.ELLIPSIS
}else{
if(o.length>1&&h>0){
l[f++]=", "
}}
var p=(o&&o[h]&&(o[h].index!=null))?o[h].index:"";
var r=[d,p].join(DwtId.SEP);
l[f++]="<span style='white-space: nowrap' id='";
l[f++]=r;
l[f++]="'>";
l[f++]=(o&&o[h])?o[h].name:"";
l[f++]="</span>"
}
if(o.length==1&&m>1){
l[f++]=AjxStringUtil.ELLIPSIS
}}else{
l[f++]=ZmMsg.noWhere
}
return l.join("")
};
ZmConvListView.prototype._getHeaderToolTip=function(t,e){
return(t==ZmItem.F_EXPAND)?ZmMsg.expandCollapse:ZmMailListView.prototype._getHeaderToolTip.call(this,t,e,this._isOutboundFolder())
};
ZmConvListView.prototype._getToolTip=function(t){
if(!t.item){
return
}
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&(t.field==ZmItem.F_PARTICIPANT||t.field==ZmItem.F_FROM)){
var o=t.item.participants&&t.item.participants.get(t.match.participant||0);
if(!o){
return""
}
var e=appCtxt.getApp(ZmApp.CONTACTS).getContactByEmail(o.getAddress());
if(e){
return this._getParticipantToolTip(o)
}else{
return{
callback:new AjxCallback(this,this._getParticipantToolTip,[o]),loading:true}
}}else{
return ZmMailListView.prototype._getToolTip.apply(this,arguments)
}};
ZmConvListView.prototype._expand=function(m,t){
var f=t||m;
var l=(f.type==ZmItem.CONV);
var n=this._msgRowIdList[f.id];
var g;
if(n&&n.length&&this._rowsArePresent(f)){
this._showMsgs(n,true);
g=document.getElementById(n[n.length-1])
}else{
this._msgRowIdList[f.id]=[];
var r=m.msgs;
if(!r){
return
}
if(l){
r.addChangeListener(this._listChangeListener)
}
var o=(appCtxt.get(ZmSetting.CONVERSATION_ORDER)==ZmSearch.DATE_ASC);
var c=this._getRowIndex(f);
if(o&&t){
c--
}
var s=this._msgOffset[f.id]||0;
var u=m.getMsgList(s,o);
for(var h=0;
h<u.length;
h++){
var t=u[h];
var e=this._createItemHtml(t);
this._addRow(e,c+h+1);
n=this._msgRowIdList[f.id];
if(n){
n.push(e.id)
}
if(h==u.length-1){
g=e
}}}
this._setImage(f,ZmItem.F_EXPAND,"NodeExpanded");
this._expanded[f.id]=true;
var d=l?f.id:f.cid;
if(!this._expandedItems[d]){
this._expandedItems[d]=[]
}
this._expandedItems[d].push(f);
this._resetColWidth();
if(g){
this._scrollList(g)
}
var p=n.length*Dwt.getSize(g).y;
if(p>Dwt.getSize(g.parentNode).y){
this._scrollList(this._getElFromItem(f))
}};
ZmConvListView.prototype._collapse=function(n){
var r=(n.type==ZmItem.CONV);
var s=r?n.id:n.cid;
var o=this._expandedItems[s];
if(o&&o.length){
var t=false;
while(!t){
var e=o.pop();
this._doCollapse(e);
t=((e.id==n.id)||(o.length==0))
}}
this._resetColWidth()
};
ZmConvListView.prototype._doCollapse=function(t){
var e=this._msgRowIdList[t.id];
if(e&&e.length){
this._showMsgs(e,false)
}
this._setImage(t,ZmItem.F_EXPAND,"NodeCollapsed");
this._expanded[t.id]=false
};
ZmConvListView.prototype._showMsgs=function(o,e){
if(!(o&&o.length)){
return
}
for(var t=0;
t<o.length;
t++){
var n=document.getElementById(o[t]);
if(n){
Dwt.setVisible(n,e)
}}};
ZmConvListView.prototype._rowsArePresent=function(o){
var e=this._msgRowIdList[o.id];
if(e&&e.length){
for(var t=0;
t<e.length;
t++){
if(document.getElementById(e[t])){
return true
}}}
this._msgRowIdList[o.id]=[];
this._expanded[o.id]=false;
return false
};
ZmConvListView.prototype._isExpandable=function(r){
var n=false;
if(r.type==ZmItem.CONV){
n=(r.numMsgs>1)
}else{
var h=appCtxt.getById(r.cid);
if(!h){
return false
}
var o=h.msgs?h.msgs.getArray():null;
if(o&&o.length){
var t=appCtxt.get(ZmSetting.CONVERSATION_PAGE_SIZE);
var e=null;
for(var s=0;
s<o.length;
s++){
if(o[s].id==r.id){
e=s+1;
break
}}
if(e&&(e%t==0)&&(e<o.length||h.msgs._hasMore)){
this._msgOffset[r.id]=e;
n=true
}}}
return n
};
ZmConvListView.prototype._resetExpansion=function(){
for(var t in this._expandedItems){
var e=this._expandedItems[t];
if(e.type==ZmItem.CONV&&e.msgs){
e.msgs.removeChangeListener(this._listChangeListener)
}}
this._expanded={};
this._msgRowIdList={};
this._msgOffset={};
this._expandedItems={}
};
ZmConvListView.prototype._expandItem=function(e){
if(e&&this._isExpandable(e)){
this._controller._toggle(e)
}else{
if(e.type==ZmItem.MSG&&this._expanded[e.cid]){
var t=appCtxt.getById(e.cid);
this._controller._toggle(t);
this.setSelection(t,true)
}}};
ZmConvListView.prototype._expandAll=function(o){
var e=this._list.getArray();
for(var t=0,n=e.length;
t<n;
t++){
var s=e[t];
if(!this._isExpandable(s)){
continue
}
if(o){
this._expandItem(s)
}else{
this._collapse(s)
}}};
ZmConvListView.prototype._sortColumn=function(t,s){
ZmMailListView.prototype._sortColumn.call(this,t,s);
var o;
if(this._columnHasCustomQuery(t)){
o=this._getSearchForSort(t._sortable)
}else{
if(this.getList().size()>1&&this._sortByString){
o=this._controller.getSearchString()
}}
var e=this._controller.getSearchStringHint();
if(o||e){
var n={
query:o,queryHint:e,types:[ZmItem.CONV],sortBy:this._sortByString,limit:this.getLimit()};
appCtxt.getSearchController().search(n)
}};
ZmConvListView.prototype._columnHasCustomQuery=function(e){
return(e._sortable==ZmItem.F_FLAG||e._sortable==ZmItem.F_ATTACHMENT)
};
ZmConvListView.prototype._changeListener=function(A){
var O=this._getItemFromEvent(A);
if(!O||A.handled||!this._handleEventType[O.type]){
return
}
var g=A.getDetail("fields");
var n=(O.type==ZmItem.CONV);
var y=this._sortByString||ZmSearch.DATE_DESC;
var c=false;
if(!n&&(A.event==ZmEvent.E_MOVE||A.event==ZmEvent.E_DELETE)){
var p=A.batchMode?this._getItemsFromBatchEvent(A):[O];
for(var x=0,q=p.length;
x<q;
x++){
var O=p[x];
var t=appCtxt.getById(O.cid);
c=true;
if(t){
if(O.folderId==ZmFolder.ID_SPAM||A.event==ZmEvent.E_DELETE){
t.removeMsg(O);
this.removeItem(O,true,A.batchMode);
var s=this._msgRowIdList[t.id];
if(this._expanded[t.id]&&s&&s.length<=1){
this._setImage(t,ZmItem.F_EXPAND,null);
this._collapse(t);
this._expanded[t.id]=false
}
this._controller._app._checkReplenishListView=this;
this._setNextSelection()
}else{
if(!(t.hasMatchingMsg(this._controller._app.currentSearch,true))){
this._list.remove(t);
this._controller._list.remove(t);
A.item=O=t;
n=true;
c=false
}else{
this._changeFolderName(O,A.getDetail("oldFolderId"));
if(A.event==ZmEvent.E_MOVE&&(O.folderId==ZmFolder.ID_TRASH)){
this._setNextSelection()
}}}}}}
if(n&&(A.event==ZmEvent.E_MOVE||A.event==ZmEvent.E_DELETE)){
var p=A.batchMode?this._getItemsFromBatchEvent(A):[O];
for(var x=0,q=p.length;
x<q;
x++){
var t=p[x];
if(this._itemToSelect&&this._itemToSelect.cid==t.id){
var W=t.msgs.getArray();
var o={};
for(var k=0,l=W.length;
k<l;
k++){
o[W[k].id]=true
}
this._itemToSelect=this._controller._getNextItemToSelect(o)
}
this._removeMsgRows(t.id);
this._expanded[t.id]=false;
delete this._msgRowIdList[t.id]
}}
if(!n&&(A.event==ZmEvent.E_CREATE)){
var s=this._msgRowIdList[O.cid];
var t=appCtxt.getById(O.cid);
if(s&&s.length&&this._rowsArePresent(t)){
var f=this._createItemHtml(O);
if(!this._expanded[O.cid]){
Dwt.setVisible(f,false)
}
var e=this._getRowIndex(t);
var r=A.getDetail("sortIndex");
var w=r||0;
this._addRow(f,e+w+1);
s.push(f.id)
}
c=A.handled=true
}
if(n&&(A.event==ZmEvent.E_MODIFY)&&(g&&g[ZmItem.F_ID])){
var f=document.getElementById(this._getItemId({
id:O._oldId}
));
if(f){
this._createItemHtml(O,{
div:f}
);
this.associateItemWithElement(O,f)
}
this._expanded[O.id]=this._expanded[O._oldId];
this._msgRowIdList[O.id]=this._msgRowIdList[O._oldId]||[]
}
if(n&&((A.event==ZmEvent.E_MODIFY)&&(g&&g[ZmItem.F_INDEX])||((A.event==ZmEvent.E_CREATE)&&(y==ZmSearch.DATE_DESC)))){
var r=this._getSortIndex(O,y);
var d=this.getItemIndex(O,true);
if((r!=null)&&(d!=null)&&(r!=d)&&!this._expanded[O.id]){
this._removeMsgRows(O.id);
this.removeItem(O);
this.addItem(O,r)
}}
if((A.event==ZmEvent.E_MODIFY||A.event==ZmEvent.E_MOVE)&&(g&&g[ZmItem.F_FRAGMENT])){
var t=n?O:appCtxt.getById(O.cid);
var T=this._getElement(t,ZmItem.F_FRAGMENT);
if(T){
T.innerHTML=this._getFragmentHtml(t)
}}
if(A.event==ZmEvent.E_MODIFY&&(g&&(g[ZmItem.F_PARTICIPANT]||g[ZmItem.F_FROM]))){
var v=this._getFieldId(O,ZmItem.F_FROM);
var B=document.getElementById(v);
if(B){
B.innerHTML=this._getParticipantHtml(O,v)
}}
if(n&&(A.event==ZmEvent.E_MODIFY)&&(g&&g[ZmItem.F_SIZE])){
var z=this._getElement(O,ZmItem.F_SIZE);
if(z){
z.innerHTML=O.numMsgs>1?["(",O.numMsgs,")"].join(""):""
}
var b=!this._isExpandable(O)?null:this._expanded[O.id]?"NodeExpanded":"NodeCollapsed";
this._setImage(O,ZmItem.F_EXPAND,b)
}
if(A.event==ZmEvent.E_MODIFY&&(g&&g[ZmItem.F_DATE])){
var v=this._getFieldId(O,ZmItem.F_DATE);
var h=document.getElementById(v);
if(h){
var u=[];
var m=this._headerHash[ZmItem.F_DATE]&&this._headerHash[ZmItem.F_DATE]._index;
this._getCellContents(u,0,O,ZmItem.F_DATE,m,new Date());
h.innerHTML=u.join("")
}}
if(!c){
if(n){
ZmMailListView.prototype._changeListener.apply(this,arguments)
}else{
ZmMailMsgListView.prototype._changeListener.apply(this,arguments)
}}};
ZmConvListView.prototype._getSortIndex=function(r,h){
var s=parseInt(r.date);
var e=this.getList(true).getArray();
for(var o=0;
o<e.length;
o++){
var n=e[o];
if(!n||(n&&n.type==ZmItem.MSG)){
continue
}
var t=parseInt(n.date);
if((h==ZmSearch.DATE_DESC&&(s>=t))||(h==ZmSearch.DATE_ASC&&(s<=t))){
return o
}}
return o
};
ZmConvListView.prototype._removeMsgRows=function(n){
var e=this._msgRowIdList[n];
if(e&&e.length){
for(var t=0;
t<e.length;
t++){
var o=document.getElementById(e[t]);
if(o){
this._selectedItems.remove(o);
this._parentEl.removeChild(o)
}}}};
ZmConvListView.prototype.removeItem=function(t,e){
if(t.type==ZmItem.MSG){
AjxUtil.arrayRemove(this._msgRowIdList[t.cid],this._getItemId(t))
}
DwtListView.prototype.removeItem.apply(this,arguments)
};
ZmConvListView.prototype._allowFieldSelection=function(o,t){
if(t==ZmItem.F_EXPAND){
var e=appCtxt.getById(o);
return(e&&!this._isExpandable(e))
}else{
return ZmListView.prototype._allowFieldSelection.apply(this,arguments)
}};
ZmConvListView.prototype.redoExpansion=function(){
var n=[];
var o={};
for(var r in this._expandedItems){
var e=this._expandedItems[r];
for(var t=0;
t<e.length;
t++){
var s=e[t];
n.push(s);
o[s]=this._msgOffset[s]
}}
this._expandAll(false);
this._resetExpansion();
for(var t=0;
t<n.length;
t++){
var s=n[t];
this._expand(s,o[s])
}};
ZmConvListView.prototype._getLastItem=function(){
var e=this.getList(true).getArray();
if(e&&e.length>1){
return e[e.length-1]
}
return null
};
ZmConvListView.prototype._getActionMenuForColHeader=function(t){
var o=ZmMailListView.prototype._getActionMenuForColHeader.apply(this,arguments);
if(!this.isMultiColumn()){
var e=this._colHeaderActionMenu.getItemById(ZmItem.F_FROM);
if(e){
e.setVisible(false)
}}
return o
};
ZmConvListView.prototype._saveState=function(e){
ZmMailListView.prototype._saveState.apply(this,arguments);
this._state.expanded=e&&e.expansion&&this._expandedItems
};
ZmConvListView.prototype._restoreState=function(){
var t=this._state;
if(t.expanded){
for(var o in t.expanded){
if(t.expanded[o]){
for(var e=0;
e<t.expanded[o].length;
e++){
this._expandItem(t.expanded[o][e])
}}}}
ZmMailListView.prototype._restoreState.call(this)
}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmMailFolderTreeController")){
ZmMailFolderTreeController=function(){
ZmFolderTreeController.apply(this,arguments)
};
ZmMailFolderTreeController.prototype=new ZmFolderTreeController;
ZmMailFolderTreeController.prototype.constructor=ZmMailFolderTreeController;
ZmMailFolderTreeController.prototype.toString=function(){
return"ZmMailFolderTreeController"
};
ZmMailFolderTreeController.prototype._updateOverview=function(n,r,o,t,s){
ZmTreeController.prototype._updateOverview.call(this,n,r,o,t,s);
if(appCtxt.multiAccounts&&(o[ZmOrganizer.F_UNREAD]&&t.isSystem())||(o[ZmOrganizer.F_TOTAL]&&(t.nId==ZmFolder.ID_DRAFTS||t.nId==ZmOrganizer.ID_OUTBOX))){
var e=appCtxt.getApp(ZmApp.MAIL).getOverviewContainer();
e.updateLabel(t)
}};
ZmMailFolderTreeController.prototype._deleteListener=function(r){
if(appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)){
var e=this._getActionedOrganizer(r);
if(e.isDataSource()){
var s=appCtxt.getDataSourceCollection().getPopAccountsFor(e.id);
var t=[e.getName(),s[0].getName()];
var n=AjxMessageFormat.format(ZmMsg.errorDeletePopFolder,t);
var o=appCtxt.getMsgDialog();
o.setMessage(n);
o.popup();
return
}}
ZmFolderTreeController.prototype._deleteListener.apply(this,arguments)
};
ZmMailFolderTreeController.prototype._dropListener=function(r){
if((appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)||appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED))&&r.action==DwtDropEvent.DRAG_DROP){
var l=r.srcData.data;
var h=l instanceof ZmOrganizer?l:null;
if(h&&h.isDataSource()){
var e=appCtxt.getDataSourceCollection();
var o=appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)?e.getPopAccountsFor(h.id):[];
var t=appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED)?e.getImapAccountsFor(h.id):[];
if(o.length||t.length){
var s=[h.getName(),o.length?o[0].getName():t[0].getName()];
var c=AjxMessageFormat.format(o.length?ZmMsg.errorMovePopFolder:ZmMsg.errorMoveImapFolder,s);
var n=appCtxt.getMsgDialog();
n.setMessage(c);
n.popup();
return
}}}
ZmFolderTreeController.prototype._dropListener.apply(this,arguments)
};
ZmMailFolderTreeController.prototype.resetOperations=function(o,t,n){
ZmFolderTreeController.prototype.resetOperations.apply(this,arguments);
if(appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)){
var e=appCtxt.getById(n);
if(e.isDataSource()){
o.enable(ZmOperation.MOVE,false)
}}};
ZmMailFolderTreeController.prototype._doMarkAllRead=function(e){
if(appCtxt.isOffline){
appCtxt.getApp(ZmApp.MAIL).clearNewMailBadge()
}
ZmTreeController.prototype._doMarkAllRead.apply(this,arguments)
}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmMailListController")){
ZmMailListController=function(e,t){
if(arguments.length==0){
return
}
ZmListController.call(this,e,t);
ZmMailListController.INVITE_REPLY_MAP={};
ZmMailListController.INVITE_REPLY_MAP[ZmOperation.INVITE_REPLY_ACCEPT]=ZmOperation.REPLY_ACCEPT;
ZmMailListController.INVITE_REPLY_MAP[ZmOperation.INVITE_REPLY_DECLINE]=ZmOperation.REPLY_DECLINE;
ZmMailListController.INVITE_REPLY_MAP[ZmOperation.INVITE_REPLY_TENTATIVE]=ZmOperation.REPLY_TENTATIVE;
ZmMailListController.REPLY_ACTION_MAP={};
ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_ACCEPT_NOTIFY]=ZmOperation.REPLY_ACCEPT;
ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_ACCEPT_IGNORE]=ZmOperation.REPLY_ACCEPT;
ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_DECLINE_NOTIFY]=ZmOperation.REPLY_DECLINE;
ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_DECLINE_IGNORE]=ZmOperation.REPLY_DECLINE;
ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_TENTATIVE_NOTIFY]=ZmOperation.REPLY_TENTATIVE;
ZmMailListController.REPLY_ACTION_MAP[ZmOperation.REPLY_TENTATIVE_IGNORE]=ZmOperation.REPLY_TENTATIVE;
ZmMailListController.ACTION_CODE_TO_OP={};
ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.REPLY]=ZmOperation.REPLY;
ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.REPLY_ALL]=ZmOperation.REPLY_ALL;
ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.FORWARD_INLINE]=ZmOperation.FORWARD_INLINE;
ZmMailListController.ACTION_CODE_TO_OP[ZmKeyMap.FORWARD_ATT]=ZmOperation.FORWARD_ATT;
this._listeners[ZmOperation.MARK_READ]=new AjxListener(this,this._markReadListener);
this._listeners[ZmOperation.MARK_UNREAD]=new AjxListener(this,this._markUnreadListener);
if(appCtxt.get(ZmSetting.REPLY_MENU_ENABLED)){
this._listeners[ZmOperation.REPLY]=new AjxListener(this,this._replyListener);
this._listeners[ZmOperation.REPLY_ALL]=new AjxListener(this,this._replyListener)
}
if(appCtxt.get(ZmSetting.FORWARD_MENU_ENABLED)){
this._listeners[ZmOperation.FORWARD]=new AjxListener(this,this._forwardListener)
}
this._listeners[ZmOperation.EDIT]=new AjxListener(this,this._editListener);
this._listeners[ZmOperation.CHECK_MAIL]=new AjxListener(this,this._checkMailListener);
if(appCtxt.get(ZmSetting.SPAM_ENABLED)){
this._listeners[ZmOperation.SPAM]=new AjxListener(this,this._spamListener)
}
this._listeners[ZmOperation.DETACH]=new AjxListener(this,this._detachListener);
this._inviteReplyListener=new AjxListener(this,this._inviteReplyHandler);
this._shareListener=new AjxListener(this,this._shareHandler);
this._acceptShareListener=new AjxListener(this,this._acceptShareHandler);
this._declineShareListener=new AjxListener(this,this._declineShareHandler)
};
ZmMailListController.prototype=new ZmListController;
ZmMailListController.prototype.constructor=ZmMailListController;
ZmMailListController.GROUP_BY_ITEM={};
ZmMailListController.GROUP_BY_SETTING={};
ZmMailListController.GROUP_BY_ICON={};
ZmMailListController.GROUP_BY_MSG_KEY={};
ZmMailListController.GROUP_BY_SHORTCUT={};
ZmMailListController.GROUP_BY_VIEWS=[];
ZmMailListController.READING_PANE_TEXT={};
ZmMailListController.READING_PANE_TEXT[ZmSetting.RP_OFF]=ZmMsg.readingPaneOff;
ZmMailListController.READING_PANE_TEXT[ZmSetting.RP_BOTTOM]=ZmMsg.readingPaneAtBottom;
ZmMailListController.READING_PANE_TEXT[ZmSetting.RP_RIGHT]=ZmMsg.readingPaneOnRight;
ZmMailListController.READING_PANE_ICON={};
ZmMailListController.READING_PANE_ICON[ZmSetting.RP_OFF]="SplitPaneOff";
ZmMailListController.READING_PANE_ICON[ZmSetting.RP_BOTTOM]="SplitPane";
ZmMailListController.READING_PANE_ICON[ZmSetting.RP_RIGHT]="SplitPaneVertical";
ZmMailListController.CONV_ORDER_DESC=ZmSearch.DATE_DESC;
ZmMailListController.CONV_ORDER_ASC=ZmSearch.DATE_ASC;
ZmMailListController.CONV_ORDER_TEXT={};
ZmMailListController.CONV_ORDER_TEXT[ZmMailListController.CONV_ORDER_DESC]=ZmMsg.convOrderDescending;
ZmMailListController.CONV_ORDER_TEXT[ZmMailListController.CONV_ORDER_ASC]=ZmMsg.convOrderAscending;
ZmMailListController.ACTION_CODE_TO_FOLDER={};
ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_INBOX]=ZmFolder.ID_INBOX;
ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_DRAFTS]=ZmFolder.ID_DRAFTS;
ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_JUNK]=ZmFolder.ID_SPAM;
ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_SENT]=ZmFolder.ID_SENT;
ZmMailListController.ACTION_CODE_TO_FOLDER[ZmKeyMap.GOTO_TRASH]=ZmFolder.ID_TRASH;
ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE={};
ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[ZmKeyMap.MOVE_TO_INBOX]=ZmFolder.ID_INBOX;
ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[ZmKeyMap.MOVE_TO_TRASH]=ZmFolder.ID_TRASH;
ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[ZmKeyMap.MOVE_TO_JUNK]=ZmFolder.ID_SPAM;
ZmMailListController.ACTION_CODE_TO_MENU_ID={};
ZmMailListController.ACTION_CODE_TO_MENU_ID[ZmKeyMap.READING_PANE_OFF]=ZmSetting.RP_OFF;
ZmMailListController.ACTION_CODE_TO_MENU_ID[ZmKeyMap.READING_PANE_BOTTOM]=ZmSetting.RP_BOTTOM;
ZmMailListController.ACTION_CODE_TO_MENU_ID[ZmKeyMap.READING_PANE_RIGHT]=ZmSetting.RP_RIGHT;
ZmMailListController.ACTION_CODE_WHICH={};
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.FIRST_UNREAD]=DwtKeyMap.SELECT_FIRST;
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.LAST_UNREAD]=DwtKeyMap.SELECT_LAST;
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.NEXT_UNREAD]=DwtKeyMap.SELECT_NEXT;
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.PREV_UNREAD]=DwtKeyMap.SELECT_PREV;
ZmMailListController.prototype.toString=function(){
return"ZmMailListController"
};
ZmMailListController.prototype.switchView=function(l,e){
if(l==ZmId.VIEW_TRAD||l==ZmId.VIEW_CONVLIST){
if(appCtxt.multiAccounts){
delete this._showingAccountColumn
}
var t=ZmMailListController.GROUP_BY_SETTING[l];
var r=this._app._groupBy[appCtxt.getActiveAccount().name];
if(t&&(t!=r)){
this._app.setGroupMailBy(t)
}else{
if(!e){
return
}}
var c=appCtxt.get(ZmSetting.SORTING_PREF,l);
var n=this._listView[this._currentView].getLimit();
var s=appCtxt.get(ZmSetting.VIEW_AS_HTML);
var h=this._app.getGroupMailBy();
var o={
types:[h],offset:0,limit:n,sortBy:c,getHtml:s};
appCtxt.getSearchController().redoSearch(this._app.currentSearch,null,o)
}};
ZmMailListController.prototype._setupReadingPaneMenuItems=function(){};
ZmMailListController.prototype._setupConvOrderMenuItems=function(){};
ZmMailListController.prototype.isReadingPaneOn=function(){
return(this._getReadingPanePref()!=ZmSetting.RP_OFF)
};
ZmMailListController.prototype.isReadingPaneOnRight=function(){
return(this._getReadingPanePref()==ZmSetting.RP_RIGHT)
};
ZmMailListController.prototype._getReadingPanePref=function(){
return appCtxt.get(ZmSetting.READING_PANE_LOCATION)
};
ZmMailListController.prototype._setReadingPanePref=function(e){
appCtxt.set(ZmSetting.READING_PANE_LOCATION,e)
};
ZmMailListController.prototype.getKeyMapName=function(){
return"ZmMailListController"
};
ZmMailListController.prototype.handleKeyAction=function(m){
var o=this._getSearchFolder();
var l=(o&&o.nId==ZmOrganizer.ID_SYNC_FAILURES);
var f=(o&&o.nId==ZmFolder.ID_DRAFTS);
var s=this._listView[this._currentView];
var h=s.getSelectionCount();
switch(m){
case ZmKeyMap.FORWARD:if(!f){
this._doAction({
action:ZmOperation.FORWARD}
)
}
break;
case ZmKeyMap.GET_MAIL:this._checkMailListener();
break;
case ZmKeyMap.GOTO_INBOX:case ZmKeyMap.GOTO_DRAFTS:case ZmKeyMap.GOTO_JUNK:case ZmKeyMap.GOTO_SENT:case ZmKeyMap.GOTO_TRASH:this._folderSearch(ZmMailListController.ACTION_CODE_TO_FOLDER[m]);
break;
case ZmKeyMap.MOVE_TO_INBOX:case ZmKeyMap.MOVE_TO_TRASH:case ZmKeyMap.MOVE_TO_JUNK:if(l){
break
}
if(h&&!(f&&m!=ZmKeyMap.MOVE_TO_TRASH)){
var n=ZmMailListController.ACTION_CODE_TO_FOLDER_MOVE[m];
o=appCtxt.getById(n);
var u=s.getSelection();
this._doMove(u,o)
}
break;
case ZmKeyMap.REPLY:case ZmKeyMap.REPLY_ALL:if(!f&&(h==1)&&!l){
this._doAction({
action:ZmMailListController.ACTION_CODE_TO_OP[m]}
)
}
break;
case ZmKeyMap.SELECT_ALL:s.selectAll(true);
break;
case ZmKeyMap.SPAM:if(h&&!f&&!l){
this._spamListener()
}
break;
case ZmKeyMap.MARK_READ:if(h&&(!o||(o&&!o.isReadOnly()))){
this._markReadListener()
}
break;
case ZmKeyMap.MARK_UNREAD:if(h&&(!o||(o&&!o.isReadOnly()))){
this._markUnreadListener()
}
break;
case ZmKeyMap.VIEW_BY_CONV:if(!l){
this.switchView(ZmId.VIEW_CONVLIST)
}
break;
case ZmKeyMap.VIEW_BY_MSG:if(!l){
this.switchView(ZmId.VIEW_TRAD)
}
break;
case ZmKeyMap.READING_PANE_BOTTOM:case ZmKeyMap.READING_PANE_RIGHT:case ZmKeyMap.READING_PANE_OFF:var d=ZmMailListController.ACTION_CODE_TO_MENU_ID[m];
this._updateViewMenu(d);
this.switchView(d,true);
break;
case ZmKeyMap.SHOW_FRAGMENT:if(h==1){
var g=s.getSelection()[0];
var t=s._getFieldId(g,ZmItem.F_SUBJECT);
var e=document.getElementById(t);
if(e){
var c=Dwt.getLocation(e);
var p;
if(g.type==ZmItem.MSG&&g.isInvite()&&g.needsRsvp()){
p=g.invite.getToolTip()
}else{
p=g.fragment?g.fragment:ZmMsg.fragmentIsEmpty;
if(p!=""){
s.setToolTipContent(AjxStringUtil.htmlEncode(p))
}}
var y=this._shell.getToolTip();
y.popdown();
if(p!=""){
y.setContent(AjxStringUtil.htmlEncode(p));
y.popup(c.x,c.y)
}}}
break;
case ZmKeyMap.NEXT_UNREAD:case ZmKeyMap.PREV_UNREAD:this.lastListAction=m;
case ZmKeyMap.FIRST_UNREAD:case ZmKeyMap.LAST_UNREAD:var r=this._getUnreadItem(ZmMailListController.ACTION_CODE_WHICH[m]);
if(r){
this._selectItem(s,r)
}
break;
default:return ZmListController.prototype.handleKeyAction.call(this,m)
}
return true
};
ZmMailListController.prototype._selectItem=function(e,o){
e._unmarkKbAnchorElement(true);
e.setSelection(o);
var t=e._getElFromItem(o);
if(t){
e._scrollList(t)
}};
ZmMailListController.prototype.mapSupported=function(e){
return(e=="list")
};
ZmMailListController.prototype.sendReadReceipt=function(o){
if(!appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED)||o.readReceiptSent||o.isSent){
return
}
var e=appCtxt.get(ZmSetting.MAIL_SEND_READ_RECEIPTS);
if(e==ZmMailApp.SEND_RECEIPT_PROMPT){
var n=new AjxCallback(this,this._sendReadReceipt,o);
var t=appCtxt.getYesNoMsgDialog();
t.registerCallback(DwtDialog.YES_BUTTON,this._sendReadReceipt,this,[o,t]);
t.registerCallback(DwtDialog.NO_BUTTON,this._sendReadReceiptNotified,this,[o,t]);
t.setMessage(ZmMsg.readReceiptSend,DwtMessageDialog.WARNING_STYLE);
t.popup()
}else{
if(e==ZmMailApp.SEND_RECEIPT_ALWAYS){
this._sendReadReceipt(o)
}}};
ZmMailListController.prototype._sendReadReceipt=function(o,t){
if(t){
t.popdown()
}
var s={
SendDeliveryReportRequest:{
_jsns:"urn:zimbraMail"}};
request=s.SendDeliveryReportRequest;
request.mid=o.id;
var n=new AjxCallback(this,this._handleSendReadReceipt);
var e=window.parentAppCtxt||window.appCtxt;
e.getRequestMgr().sendRequest({
jsonObj:s,asyncMode:true,callback:n}
)
};
ZmMailListController.prototype._handleSendReadReceipt=function(){
appCtxt.setStatusMsg(ZmMsg.readReceiptSent)
};
ZmMailListController.prototype._sendReadReceiptNotified=function(o,t){
var n=t?(new AjxCallback(t,t.popdown)):null;
var e=o.setFlag(ZmItem.FLAG_READ_RECEIPT_SENT,true);
o.list.flagItems({
items:[o],op:"update",value:e,callback:n}
)
};
ZmMailListController.prototype._updateViewMenu=function(n){
var t=this._toolbar[this._currentView].getButton(ZmOperation.VIEW_MENU);
var o=t&&t.getMenu();
if(o){
var e=o.getItemById(ZmOperation.MENUITEM_ID,n);
if(e){
e.setChecked(true,true)
}}};
ZmMailListController.prototype._initialize=function(e){
this._setActiveSearch(e);
ZmListController.prototype._initialize.call(this,e)
};
ZmMailListController.prototype._initializeParticipantActionMenu=function(){
if(!this._participantActionMenu){
var e=this._participantOps();
e.push(ZmOperation.SEP);
var t=this._getActionMenuOps();
if(t&&t.length){
e=e.concat(t)
}
this._participantActionMenu=new ZmActionMenu({
parent:this._shell,menuItems:e,controller:this,context:this._currentView,menuType:ZmId.MENU_PARTICIPANT}
);
this._addMenuListeners(this._participantActionMenu);
this._participantActionMenu.addPopdownListener(this._menuPopdownListener);
this._setupTagMenu(this._participantActionMenu);
this._setupEditButton(this._participantActionMenu);
appCtxt.notifyZimlets("onParticipantActionMenuInitialized",[this,this._participantActionMenu])
}
return this._participantActionMenu
};
ZmMailListController.prototype._initializeDraftsActionMenu=function(){
if(!this._draftsActionMenu){
var e=[ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.PRINT,ZmOperation.SEP,ZmOperation.SHOW_ORIG];
this._draftsActionMenu=new ZmActionMenu({
parent:this._shell,menuItems:e,context:this._currentView,menuType:ZmId.MENU_DRAFTS}
);
this._addMenuListeners(this._draftsActionMenu);
this._draftsActionMenu.addPopdownListener(this._menuPopdownListener);
this._setupTagMenu(this._draftsActionMenu)
}};
ZmMailListController.prototype._initializeToolBar=function(e){
if(!this._toolbar[e]){
ZmListController.prototype._initializeToolBar.call(this,e);
this._createViewMenu(e);
if(appCtxt.isOffline&&appCtxt.accountList.size()>2){
this._createSendReceiveMenu(this._toolbar[e])
}
this._setReplyText(this._toolbar[e]);
this._toolbar[e].addOp(ZmOperation.FILLER);
this._initializeNavToolBar(e)
}
this._setupViewMenu(e);
this._setupDeleteButton(this._toolbar[e]);
this._setupSpamButton(this._toolbar[e]);
this._setupCheckMailButton(this._toolbar[e]);
this._setNewButtonProps(e,ZmMsg.compose,"NewMessage","NewMessageDis",ZmOperation.NEW_MESSAGE)
};
ZmMailListController.prototype._getNumTotal=function(){
if(AjxEnv.is1024x768orLower){
return null
}
return ZmListController.prototype._getNumTotal.call(this)
};
ZmMailListController.prototype._initializeActionMenu=function(){
var e=(this._actionMenu!=null);
ZmListController.prototype._initializeActionMenu.call(this);
if(this._actionMenu){
this._setupSpamButton(this._actionMenu);
if(!e){
this._setupEditButton(this._actionMenu)
}}
appCtxt.notifyZimlets("onActionMenuInitialized",[this,this._actionMenu])
};
ZmMailListController.prototype._standardToolBarOps=function(){
return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.CHECK_MAIL,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.PRINT,ZmOperation.SEP]
};
ZmMailListController.prototype._flagOps=function(){
return[ZmOperation.MARK_READ,ZmOperation.MARK_UNREAD]
};
ZmMailListController.prototype._msgOps=function(){
var e=[];
if(appCtxt.get(ZmSetting.REPLY_MENU_ENABLED)){
e.push(ZmOperation.REPLY,ZmOperation.REPLY_ALL)
}
if(appCtxt.get(ZmSetting.FORWARD_MENU_ENABLED)){
e.push(ZmOperation.FORWARD)
}
return e
};
ZmMailListController.prototype._setActiveSearch=function(e){
if(this._activeSearch){
if(this._list){
this._list.setHasMore(this._activeSearch.getAttribute("more"))
}
if(this._listView[e]){
this._listView[e].offset=parseInt(this._activeSearch.getAttribute("offset"))
}}};
ZmMailListController.prototype._listSelectionListener=function(t){
if(appCtxt.isOffline&&t.detail==DwtListView.ITEM_DBL_CLICKED&&t.item&&t.item.isDraft&&appCtxt.getCurrentSearch().folderId==ZmFolder.ID_OUTBOX){
var o=t.item.account||ZmOrganizer.parseId(t.item.id).account;
var e=appCtxt.getById(ZmOrganizer.getSystemId(ZmFolder.ID_DRAFTS,o));
this._list.moveItems({
items:[t.item],folder:e}
)
}
ZmListController.prototype._listSelectionListener.apply(this,arguments)
};
ZmMailListController.prototype._listActionListener=function(c){
ZmListController.prototype._listActionListener.call(this,c);
var r=this._listView[this._currentView].getSelection();
var h=false;
var n=false;
var t=this._getSearchFolder();
if(!t||(t&&!t.isReadOnly())){
for(var o=0;
o<r.length;
o++){
var f=r[o];
if(f.type==ZmItem.MSG){
if(f.isUnread){
n=true
}else{
h=true
}}else{
if(f.type==ZmItem.CONV){
n=f.hasFlag(ZmItem.FLAG_UNREAD,true);
h=f.hasFlag(ZmItem.FLAG_UNREAD,false)
}}
if(n&&h){
break
}}}
var u=(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&c.field==ZmItem.F_PARTICIPANT)?c.detail:((c.item instanceof ZmMailMsg)?c.item.getAddress(AjxEmailAddress.FROM):null);
var f=(r&&r.length==1)?r[0]:null;
if(t&&t.nId==ZmFolder.ID_DRAFTS||(f&&f.isDraft)){
this._initializeDraftsActionMenu();
this._setTagMenu(this._draftsActionMenu);
this._resetOperations(this._draftsActionMenu,r.length);
this._draftsActionMenu.popup(0,c.docX,c.docY)
}else{
if(u&&r.length==1&&(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&(c.field==ZmItem.F_PARTICIPANT||c.field==ZmItem.F_FROM))){
this._initializeParticipantActionMenu();
this._setTagMenu(this._participantActionMenu);
this._actionEv.address=u;
this._setupSpamButton(this._participantActionMenu);
this._resetOperations(this._participantActionMenu,r.length);
this._enableFlags(this._participantActionMenu,n,h);
var e=this._participantActionMenu.getOp(ZmOperation.IM);
var d=appCtxt.getApp(ZmApp.CONTACTS);
if(d){
var s=d.getContactByEmail(u.getAddress());
if(s){
this._handleResponseGetContact(e,u,c,s)
}else{
this._participantActionMenu.getOp(ZmOperation.CONTACT).setText(ZmMsg.loading);
if(e){
if(ZmImApp.updateImMenuItemByAddress(e,u,false)){
e.setText(ZmMsg.loading)
}else{
e=null
}}
this._participantActionMenu.popup(0,c.docX,c.docY);
var m=new AjxCallback(this,this._handleResponseGetContact,[e,u,c]);
d.getContactByEmail(u.getAddress(),m)
}}else{
if(e){
ZmImApp.updateImMenuItemByAddress(e,u,true);
this._participantActionMenu.popup(0,c.docX,c.docY)
}}}else{
var l=this.getActionMenu();
this._setupSpamButton(l);
this._enableFlags(l,n,h);
l.popup(0,c.docX,c.docY);
if(c.ersatz){
l.setSelectedItem(0)
}}}};
ZmMailListController.prototype._handleResponseGetContact=function(o,t,n,e){
this._actionEv.contact=e;
this._setContactText(e!=null);
if(o){
if(e){
ZmImApp.updateImMenuItemByContact(o,e,t)
}else{
ZmImApp.handleResponseGetContact(o,t,true)
}}
this._participantActionMenu.popup(0,n.docX,n.docY)
};
ZmMailListController.prototype._markReadListener=function(e){
var t=this._getMarkReadCallback();
this._doMarkRead(this._listView[this._currentView].getSelection(),true,t)
};
ZmMailListController.prototype._getMarkReadCallback=function(){
var e=this._listView[this._currentView];
var t=e.getSelection();
if(this.isReadingPaneOn()&&appCtxt.get(ZmSetting.MARK_MSG_READ)==-1){
var r=e.parent.getMsgView?e.parent.getMsgView().getMsg():null;
if(r&&r.readReceiptRequested){
for(var o=0;
o<t.length;
o++){
var n=t[o];
var s=(n.id<0)?(n.id*(-1)):n.id;
if(s==r.id){
return(new AjxCallback(this,this.sendReadReceipt,r))
}}}}
return null
};
ZmMailListController.prototype._markUnreadListener=function(e){
this._doMarkRead(this._listView[this._currentView].getSelection(),false)
};
ZmMailListController.prototype._replyListener=function(e){
var t=e.item.getData(ZmOperation.KEY_ID);
if(!t||t==ZmOperation.REPLY_MENU){
t=ZmOperation.REPLY
}
this._doAction({
ev:e,action:t}
)
};
ZmMailListController.prototype._forwardListener=function(e){
var t=e.item.getData(ZmOperation.KEY_ID);
this._doAction({
ev:e,action:t}
)
};
ZmMailListController.prototype._doAction=function(o){
var t=this.getMsg(o);
if(!t){
return
}
var h=appCtxt.getIdentityCollection();
var c=h.selectIdentity(t);
var n=o.action;
if(!n||n==ZmOperation.FORWARD_MENU||n==ZmOperation.FORWARD){
n=o.action=(appCtxt.get(ZmSetting.FORWARD_INCLUDE_ORIG)==ZmSetting.INC_ATTACH)?ZmOperation.FORWARD_ATT:ZmOperation.FORWARD_INLINE;
if(t.isInvite()){
n=o.action=ZmOperation.FORWARD_ATT
}}
var r=appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED);
var s=(appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML);
var l=appCtxt.get(ZmSetting.COMPOSE_SAME_FORMAT);
o.getHtml=(r&&(n==ZmOperation.DRAFT||(s||(!t._loaded&&l))));
if(n==ZmOperation.DRAFT){
o.listController=this
}
if(n!=ZmOperation.NEW_MESSAGE||n!=ZmOperation.DRAFT){
if(t.viewEntireMessage){
o.noTruncate=true;
o.forceLoad=true
}}
if(n==ZmOperation.DRAFT||n==ZmOperation.FORWARD_INLINE||n==ZmOperation.REPLY||n==ZmOperation.REPLY_ALL){
var e=t.getBodyPart();
if(e&&e.truncated){
o.noTruncate=true;
o.forceLoad=true
}}
var d=new AjxCallback(this,this._handleResponseDoAction,o);
this._getLoadedMsg(o,d)
};
ZmMailListController.prototype._handleResponseDoAction=function(r,o){
if(!o){
return
}
o._instanceDate=r.instanceDate;
r.inNewWindow=(!appCtxt.isChildWindow&&this._app._inNewWindow(r.ev));
var h=r.action;
if(h==ZmOperation.FORWARD_ATT||h==ZmOperation.FORWARD_INLINE){
if(o.isInvite()){
var p=window.parentAppCtxt||window.appCtxt;
if(p.get(ZmSetting.CALENDAR_ENABLED)){
var c=p.getApp(ZmApp.CALENDAR).getCalController();
c.forwardInvite(o);
if(appCtxt.isChildWindow){
window.close()
}
return
}}
var t=this._listView[this._currentView];
var u,d;
if(t){
u=t.getSelection();
d=u.length;
if(t&&(h==ZmOperation.FORWARD_INLINE)&&(d>1)){
h=r.action=ZmOperation.FORWARD_ATT
}}
if(h==ZmOperation.FORWARD_ATT&&d>1){
var n=new ZmBatchCommand();
var m=new AjxCallback(this,this._handleLoadMsgs,[r,u]);
for(var l=0;
l<d;
l++){
var f=u[l];
if(f.type==ZmItem.CONV){
var s=new AjxCallback(f,f.loadMsgs,[null,null]);
n.add(s)
}}
if(n._cmds.length>0){
n.run(m)
}else{
this._handleLoadMsgs(r,u)
}
return
}}else{
if(appCtxt.isOffline&&h==ZmOperation.DRAFT){
var e=appCtxt.getById(o.folderId);
r.accountName=e&&e.getAccount().name
}else{
if(h==ZmOperation.DECLINE_PROPOSAL){
r.subjOverride=this._getInviteReplySubject(h)+o.subject
}}}
r.msg=o;
AjxDispatcher.run("Compose",r)
};
ZmMailListController.prototype._handleLoadMsgs=function(s,o){
var e=new AjxVector();
for(var t=0;
t<o.length;
t++){
var n=o[t];
if(n.type==ZmItem.CONV){
e.addList(n.msgIds)
}else{
if(!e.contains(n.id)){
e.add(n.id)
}}}
s.msgIds=e.getArray();
AjxDispatcher.run("Compose",s)
};
ZmMailListController.prototype._doMarkRead=function(t,e,s){
var n={
items:t,value:e,callback:s};
var o=this._setupContinuation(this._doMarkRead,[e,s],n);
o.markRead(n)
};
ZmMailListController.prototype._doSpam=function(e,r,t){
this._listView[this._currentView]._itemToSelect=this._getNextItemToSelect();
e=AjxUtil.toArray(e);
var s={
items:e,markAsSpam:r,folder:t,childWin:appCtxt.isChildWindow&&window};
var n=new AjxCallback(this,this._checkItemCount);
var o=this._setupContinuation(this._doSpam,[r,t],s,n);
o.spamItems(s)
};
ZmMailListController.prototype._inviteReplyHandler=function(h){
var r=window.parentAppCtxt||window.appCtxt;
this._listView[this._currentView]._itemToSelect=this._getNextItemToSelect();
r.getAppController().focusContentPane();
var s=h._inviteReplyType;
var t=h._inviteReplyFolderId||ZmOrganizer.ID_CALENDAR;
var n=h._inviteComponentId;
if(s==ZmOperation.PROPOSE_NEW_TIME){
var e=r.getApp(ZmApp.CALENDAR).getCalController();
e.proposeNewTime(h._msg);
if(appCtxt.isChildWindow){
window.close()
}}else{
if(s==ZmOperation.ACCEPT_PROPOSAL){
this._acceptProposedTime(n,h._msg)
}else{
if(s==ZmOperation.DECLINE_PROPOSAL){
this._declineProposedTime(n,h._msg)
}else{
if(s==ZmOperation.INVITE_REPLY_ACCEPT||s==ZmOperation.EDIT_REPLY_CANCEL||s==ZmOperation.INVITE_REPLY_DECLINE||s==ZmOperation.INVITE_REPLY_TENTATIVE){
this._editInviteReply(ZmMailListController.INVITE_REPLY_MAP[s],n,null,null,t)
}else{
var o=r.multiAccounts&&r.accountList.mainAccount.name;
var l=this._sendInviteReply(s,n,null,o,null,h._msg,t);
if(l&&appCtxt.isChildWindow){
window.close()
}}}}}
return false
};
ZmMailListController.prototype._shareHandler=function(o){
var s=this.getMsg();
var e=s?s.getAddress(AjxEmailAddress.FROM).address:null;
if(o._buttonId==ZmOperation.SHARE_ACCEPT){
var t=appCtxt.getAcceptShareDialog();
t.setAcceptListener(this._acceptShareListener);
t.popup(o._share,e)
}else{
if(o._buttonId==ZmOperation.SHARE_DECLINE){
var n=appCtxt.getDeclineShareDialog();
n.setDeclineListener(this._declineShareListener);
n.popup(o._share,e)
}}};
ZmMailListController.prototype._acceptShareHandler=function(t){
var n=appCtxt.getById(t._share._msgId);
var e=appCtxt.getById(ZmFolder.ID_TRASH);
this._listView[this._currentView]._itemToSelect=this._getNextItemToSelect();
var o=n.list||this.getList();
var s=(appCtxt.isChildWindow)?(new AjxCallback(this,this._handleAcceptShareInNewWindow)):null;
o.moveItems({
items:[n],folder:e,callback:s}
)
};
ZmMailListController.prototype._declineShareHandler=ZmMailListController.prototype._acceptShareHandler;
ZmMailListController.prototype._handleAcceptShareInNewWindow=function(){
window.close()
};
ZmMailListController.prototype.getReferenceView=function(){
return null
};
ZmMailListController.prototype._createViewMenu=function(e){
var t=this._toolbar[e].getButton(ZmOperation.VIEW_MENU);
if(!t){
return
}
t.setMenu(new AjxCallback(this,this._setupViewMenuItems,[e,t]));
t.noMenuBar=true
};
ZmMailListController.prototype._createSendReceiveMenu=function(t){
var e=t.getButton(ZmOperation.CHECK_MAIL);
if(!e){
return
}
e.setMenu(new AjxCallback(this,this._setupSendReceiveMenuItems,[t,e]))
};
ZmMailListController.prototype._setupViewMenu=function(e){
this._updateViewMenu(e);
this._updateViewMenu(this._getReadingPanePref());
this._updateViewMenu(appCtxt.get(ZmSetting.CONVERSATION_ORDER));
var t=this._toolbar[e].getButton(ZmOperation.VIEW_MENU);
if(t){
t.setImage(ZmMailListController.GROUP_BY_ICON[e])
}};
ZmMailListController.prototype._setupViewMenuItems=function(e,t){
var o=new ZmPopupMenu(t,null,null,this);
t.setMenu(o);
if(appCtxt.get(ZmSetting.CONVERSATIONS_ENABLED)){
this._setupGroupByMenuItems(e,o)
}
this._setupReadingPaneMenuItems(e,o,this.isReadingPaneOn());
if(appCtxt.get(ZmSetting.CONVERSATIONS_ENABLED)){
this._setupConvOrderMenuItems(e,o)
}
return o
};
ZmMailListController.prototype._setupSendReceiveMenuItems=function(c,o){
var t=new ZmPopupMenu(o,null,null,this);
o.setMenu(t);
var n=new AjxListener(this,this._sendReceiveListener);
var h=appCtxt.accountList.visibleAccounts;
for(var s=0;
s<h.length;
s++){
var l=h[s];
if(l.isMain){
continue
}
var e=[ZmOperation.CHECK_MAIL,l.id].join("-");
var r=t.createMenuItem(e,{
image:l.getIcon(),text:l.getDisplayName()}
);
r.setData(ZmOperation.MENUITEM_ID,l.id);
r.addSelectionListener(n)
}
return t
};
ZmMailListController.prototype._setupDeleteButton=function(t){
var n=this._getSearchFolder();
var e=(n&&n.nId==ZmFolder.ID_TRASH);
var r=t.getButton(ZmOperation.DELETE);
var o=t.getButton(ZmOperation.DELETE_MENU);
var s=e?ZmMsg.deletePermanentTooltip:ZmMsg.deleteTooltip;
if(r){
r.setToolTipContent(ZmOperation.getToolTip(ZmOperation.DELETE,ZmKeyMap.MAP_NAME_R[this.getKeyMapName()],s))
}
if(o){
o.setToolTipContent(ZmOperation.getToolTip(ZmOperation.DELETE_MENU,ZmKeyMap.MAP_NAME_R[this.getKeyMapName()],s))
}};
ZmMailListController.prototype._setupSpamButton=function(t){
if(!t){
return
}
var n=t.getOp(ZmOperation.SPAM);
if(n){
var e=this._getSearchFolderId();
var o=appCtxt.getById(e);
var r=((o&&o.nId==ZmFolder.ID_SPAM)||(!o&&e==ZmFolder.ID_SPAM));
n.setText(r?ZmMsg.notJunk:ZmMsg.junk);
n.setImage(r?"Inbox":"JunkMail");
if(n.setToolTipContent){
var s=r?ZmMsg.notJunkTooltip:ZmMsg.junkTooltip;
n.setToolTipContent(ZmOperation.getToolTip(ZmOperation.SPAM,ZmKeyMap.MAP_NAME_R[this.getKeyMapName()],s))
}}};
ZmMailListController.prototype._setupEditButton=function(e){
if(!e){
return
}
var t=e.getOp(ZmOperation.EDIT);
if(t){
t.setText(ZmMsg.editAsNew)
}};
ZmMailListController.prototype._setupCheckMailButton=function(r){
var d=r?r.getButton(ZmOperation.CHECK_MAIL):null;
if(!d){
return
}
var o=this._getSearchFolderId();
var t=appCtxt.getById(o);
var s=(o==ZmFolder.ID_INBOX);
var n=(t&&t.isFeed());
var l=false;
var h=appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)||appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED);
if(t&&!s&&!n&&h){
l=t.isDataSource(null,true)
}
if(!s&&n){
d.setText(ZmMsg.checkFeed);
d.setToolTipContent(ZmMsg.checkRssTooltip)
}else{
if(!s&&l){
d.setText(ZmMsg.checkExternalMail);
d.setToolTipContent(ZmMsg.checkExternalMail)
}else{
var e=appCtxt.isOffline?ZmMsg.sendReceive:ZmMsg.checkMail;
d.setText(e);
var c;
if(appCtxt.isOffline){
c=ZmMsg.sendReceive
}else{
c=(appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT)?ZmMsg.checkMailPrefDefault:ZmMsg.checkMailPrefUpdate
}
d.setToolTipContent(c)
}}};
ZmMailListController.prototype.getMsg=function(t){
var e=this._listView[this._currentView].getSelection();
return(e&&e.length)?e[0]:null
};
ZmMailListController.prototype._getLoadedMsg=function(t,n){
t=t||{};
var e=this.getMsg(t);
if(!e){
n.run()
}
if(e._loaded){
n.run(e)
}else{
if(e.id==this._pendingMsg){
return
}
e._loadPending=true;
this._pendingMsg=e.id;
var o=new AjxCallback(this,ZmMailListController.prototype._handleResponseGetLoadedMsg,[n,e]);
e.load({
getHtml:t.getHtml,markRead:t.markRead,callback:o,noBusyOverlay:false}
)
}};
ZmMailListController.prototype._handleResponseGetLoadedMsg=function(t,e){
if(this._pendingMsg&&(e.id!=this._pendingMsg)){
return
}
e._loadPending=false;
this._pendingMsg=null;
t.run(e)
};
ZmMailListController.prototype._getInviteReplyBody=function(n,e,o){
var t;
if(e){
switch(n){
case ZmOperation.REPLY_ACCEPT:t=ZmMsg.defaultInviteReplyAcceptInstanceMessage;
break;
case ZmOperation.REPLY_CANCEL:t=ZmMsg.apptInstanceCanceled;
break;
case ZmOperation.REPLY_DECLINE:t=ZmMsg.defaultInviteReplyDeclineInstanceMessage;
break;
case ZmOperation.REPLY_TENTATIVE:t=ZmMsg.defaultInviteReplyTentativeInstanceMessage;
break
}
if(o){
switch(n){
case ZmOperation.REPLY_ACCEPT:t=ZmMsg.defaultInviteReplyResourceAcceptInstanceMessage;
break;
case ZmOperation.REPLY_CANCEL:t=ZmMsg.apptInstanceCanceled;
break;
case ZmOperation.REPLY_DECLINE:t=ZmMsg.defaultInviteReplyResourceDeclineInstanceMessage;
break;
case ZmOperation.REPLY_TENTATIVE:t=ZmMsg.defaultInviteReplyResourceTentativeInstanceMessage;
break
}}
if(t){
return AjxMessageFormat.format(t,e)
}}
switch(n){
case ZmOperation.REPLY_ACCEPT:t=ZmMsg.defaultInviteReplyAcceptMessage;
break;
case ZmOperation.REPLY_CANCEL:t=ZmMsg.apptCanceled;
break;
case ZmOperation.DECLINE_PROPOSAL:t="";
break;
case ZmOperation.REPLY_DECLINE:t=ZmMsg.defaultInviteReplyDeclineMessage;
break;
case ZmOperation.REPLY_TENTATIVE:t=ZmMsg.defaultInviteReplyTentativeMessage;
break;
case ZmOperation.REPLY_NEW_TIME:t=ZmMsg.defaultInviteReplyNewTimeMessage;
break
}
if(o){
switch(n){
case ZmOperation.REPLY_ACCEPT:t=ZmMsg.defaultInviteReplyResourceAcceptMessage;
break;
case ZmOperation.REPLY_CANCEL:t=ZmMsg.apptCanceled;
break;
case ZmOperation.REPLY_DECLINE:t=ZmMsg.defaultInviteReplyResourceDeclineMessage;
break;
case ZmOperation.REPLY_TENTATIVE:t=ZmMsg.defaultInviteReplyResourceTentativeMessage;
break;
case ZmOperation.REPLY_NEW_TIME:t=ZmMsg.defaultInviteReplyNewTimeMessage;
break
}}
if(t){
t=AjxMessageFormat.format(t,[])
}
return t
};
ZmMailListController.prototype._getInviteReplySubject=function(e){
var t=null;
switch(e){
case ZmOperation.REPLY_ACCEPT:t=ZmMsg.subjectAccept+": ";
break;
case ZmOperation.DECLINE_PROPOSAL:t=ZmMsg.subjectDecline+" - ";
break;
case ZmOperation.REPLY_DECLINE:t=ZmMsg.subjectDecline+": ";
break;
case ZmOperation.REPLY_TENTATIVE:t=ZmMsg.subjectTentative+": ";
break;
case ZmOperation.REPLY_NEW_TIME:t=ZmMsg.subjectNewTime+": ";
break
}
return t
};
ZmMailListController.prototype._editInviteReply=function(r,s,e,n,o){
var t=this._getInviteReplyBody(r,e);
this._doAction({
action:r,extraBodyText:t,instanceDate:e,accountName:n,acceptFolderId:o}
)
};
ZmMailListController.prototype._acceptProposedTime=function(n,e){
var o=e.invite;
var r=o.getAppointmentId();
var s=window.parentAppCtxt||window.appCtxt;
var t=s.getApp(ZmApp.CALENDAR).getCalController();
var h=new AjxCallback(this,this._handleAcceptDeclineProposedTime,[e]);
t.acceptProposedTime(r,o,appCtxt.isChildWindow?null:h);
if(appCtxt.isChildWindow){
window.close()
}};
ZmMailListController.prototype._declineProposedTime=function(o,e){
var t=this._getInviteReplyBody(ZmOperation.DECLINE_PROPOSAL,null);
var n=new AjxCallback(this,this._handleAcceptDeclineProposedTime,[e]);
this._doAction({
action:ZmOperation.DECLINE_PROPOSAL,extraBodyText:t,instanceDate:null,sendMsgCallback:n}
)
};
ZmMailListController.prototype._handleAcceptDeclineProposedTime=function(e){
this._doDelete([e])
};
ZmMailListController.prototype._sendInviteReply=function(s,y,b,t,v,m,w,r){
var h=new ZmMailMsg();
AjxDispatcher.require("CalendarCore");
h._origMsg=m||this.getMsg();
h.inviteMode=s;
h.isReplied=true;
h.isForwarded=false;
h.isInviteReply=true;
h.acceptFolderId=w;
h.folderId=h._origMsg.folderId;
var e=ZmMailListController.REPLY_ACTION_MAP[s]?ZmMailListController.REPLY_ACTION_MAP[s]:s;
var n=this._getInviteReplyBody(e,b,h._origMsg.isResourceInvite());
if(n!=null){
var d=new ZmAppt();
d.setFromMessage(h._origMsg);
var f=d.getTextSummary()+"\n"+n;
var p=new ZmMimePart();
p.setContentType(ZmMimeTable.TEXT_PLAIN);
p.setContent(f);
var g=d.getHtmlSummary()+"<p>"+n+"</p>";
var u=new ZmMimePart();
u.setContentType(ZmMimeTable.TEXT_HTML);
u.setContent(g);
var o=new ZmMimePart();
o.setContentType(ZmMimeTable.MULTI_ALT);
o.children.add(p);
o.children.add(u);
h.setTopPart(o)
}
var c=this._getInviteReplySubject(e)+h._origMsg.invite.getEventName();
if(c!=null){
h.setSubject(c)
}
var l=new AjxCallback(this,this._handleErrorInviteReply);
return h.sendInviteReply(true,y,r,l,b,t,v)
};
ZmMailListController.prototype._handleErrorInviteReply=function(e){
if(e.code==ZmCsfeException.MAIL_NO_SUCH_ITEM){
var t=appCtxt.getErrorDialog();
t.setMessage(ZmMsg.inviteOutOfDate);
t.popup(null,true);
return true
}};
ZmMailListController.prototype._spamListener=function(n){
var e=this._listView[this._currentView].getSelection();
var s=this._getSearchFolderId();
if(appCtxt.multiAccounts){
var o=e[0];
if(o){
s=ZmOrganizer.getSystemId(s,o.getAccount())
}}
var t=appCtxt.getById(s);
var r=!(t&&t.nId==ZmFolder.ID_SPAM);
this._doSpam(e,r)
};
ZmMailListController.prototype._detachListener=function(e,o){
var t=this.getMsg();
if(t){
if(t._loaded){
ZmMailMsgView.detachMsgInNewWindow(t,false,this._msgControllerMode);
if(t.isUnread&&!appCtxt.getById(t.folderId).isReadOnly()){
t.list.markRead({
items:[t],value:true}
)
}}else{
ZmMailMsgView.rfc822Callback(t.id,null,this._msgControllerMode)
}}
if(o){
o.run()
}};
ZmMailListController.prototype._printListener=function(l){
var d=this._listView[this._currentView];
var h=d.getSelection();
h=AjxUtil.toArray(h);
var e=[];
var c=false;
for(var r=0;
r<h.length;
r++){
var u=h[r];
if(u.toString()=="ZmConv"){
if(appCtxt.isOffline&&u.id.split(":")[1]<0){
e.push(u.msgIds[0])
}else{
e.push("C:"+u.id)
}
if(u instanceof ZmConv){
var s=u.getMsgList();
for(var n=0;
n<s.length;
n++){
if(s[n].showImages){
c=true;
break
}}}}else{
e.push(u.id);
if(u.showImages){
c=true
}}}
var t=("/h/printmessage?id="+e.join(","))+"&tz="+AjxTimezone.getServerId(AjxTimezone.DEFAULT);
if(appCtxt.get(ZmSetting.DISPLAY_EXTERNAL_IMAGES)||c){
t=t+"&xim=1"
}
if(appCtxt.isOffline){
var o=h[0].getAccount().name;
t+="&acct="+o
}
window.open(appContextPath+t,"_blank")
};
ZmMailListController.prototype._editListener=function(e){
this._doAction({
ev:e,action:ZmOperation.DRAFT}
)
};
ZmMailListController.prototype._checkMailListener=function(){
if(appCtxt.isOffline){
var h=new AjxCallback(this,this._handleSyncAll);
appCtxt.accountList.syncAll(h)
}
var o=this._getSearchFolder();
var s=(o&&o.isFeed());
if(s){
o.sync()
}else{
var n=false;
if(!appCtxt.isOffline){
var e=appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)||appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED);
if(o&&!s&&e){
var r=o.getDataSources(null,true);
if(r){
n=true;
var t=AjxDispatcher.run("GetDataSourceCollection");
t.importMail(r)
}}}
if((o&&o.nId==ZmFolder.ID_INBOX)||!n){
if(appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT){
appCtxt.getApp(ZmApp.MAIL).mailSearch()
}else{
appCtxt.getAppController().sendNoOp()
}}}};
ZmMailListController.prototype._handleSyncAll=function(){
if(appCtxt.get(ZmSetting.OFFLINE_SHOW_ALL_MAILBOXES)&&appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT){
this._app.getOverviewContainer().highlightAllMboxes()
}};
ZmMailListController.prototype._sendReceiveListener=function(e){
var t=appCtxt.accountList.getAccount(e.item.getData(ZmOperation.MENUITEM_ID));
if(t){
t.sync()
}};
ZmMailListController.prototype._folderSearch=function(e){
appCtxt.getSearchController().search({
query:"in:"+ZmFolder.QUERY_NAME[e]}
)
};
ZmMailListController.prototype._setupGroupByMenuItems=function(e,n){
for(var o=0;
o<ZmMailListController.GROUP_BY_VIEWS.length;
o++){
var s=ZmMailListController.GROUP_BY_VIEWS[o];
var t=n.createMenuItem(s,{
image:ZmMailListController.GROUP_BY_ICON[s],text:ZmMsg[ZmMailListController.GROUP_BY_MSG_KEY[s]],shortcut:ZmMailListController.GROUP_BY_SHORTCUT[s],style:DwtMenuItem.RADIO_STYLE}
);
t.setData(ZmOperation.MENUITEM_ID,s);
t.addSelectionListener(this._listeners[ZmOperation.VIEW]);
if(s==this._defaultView()){
t.setChecked(true,true)
}}};
ZmMailListController.prototype._setContactText=function(t){
ZmListController.prototype._setContactText.call(this,t);
var e=t?ZmOperation.EDIT_CONTACT:ZmOperation.NEW_CONTACT;
var o=t?null:ZmMsg.AB_ADD_CONTACT;
ZmOperation.setOperation(this._participantActionMenu,ZmOperation.CONTACT,e,o)
};
ZmMailListController.prototype._setReplyText=function(t){
if(t&&appCtxt.get(ZmSetting.REPLY_MENU_ENABLED)){
var n=t.getOp(ZmOperation.REPLY_MENU);
if(n){
var o=n.getMenu();
var e=o.getOp(ZmOperation.REPLY);
e.setText(ZmMsg.replySender)
}}};
ZmMailListController.prototype._resetOperations=function(c,r){
ZmListController.prototype._resetOperations.call(this,c,r);
var t=this._getSearchFolderId();
var e=t&&appCtxt.getById(t);
c.enable(ZmOperation.PRINT,r>0);
if(e&&e.nId==ZmOrganizer.ID_SYNC_FAILURES){
c.enableAll(false);
c.enable([ZmOperation.NEW_MENU,ZmOperation.CHECK_MAIL],true);
c.enable([ZmOperation.DELETE,ZmOperation.FORWARD],r>0);
return
}
if(c&&c instanceof ZmToolBar){
var h=appCtxt.isChildWindow&&window.newWindowParams&&window.newWindowParams.isRfc822;
if(h||(e&&e.isReadOnly()&&r>0)){
c.enable([ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.TAG_MENU],false)
}else{
var u;
if(r==1&&(t!=ZmFolder.ID_DRAFTS)){
var o=this._listView[this._currentView].getSelection();
if(o&&o.length){
u=o[0]
}}
var d=(u&&u.isDraft)||(t==ZmFolder.ID_DRAFTS);
var s=(e&&e.isFeed());
c.enable([ZmOperation.REPLY,ZmOperation.REPLY_ALL],(!d&&!s&&r==1));
c.enable(ZmOperation.DETACH,(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)&&!d&&r==1));
c.enable([ZmOperation.SPAM,ZmOperation.MOVE,ZmOperation.FORWARD],(!d&&r>0));
c.enable([ZmOperation.CHECK_MAIL,ZmOperation.VIEW_MENU],true);
var n=c.getOp(ZmOperation.EDIT);
if(n){
n.setVisible(d)
}}}else{
if(e&&e.isReadOnly()&&r>0){
c.enable([ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.TAG_MENU],false)
}else{
c.enable([ZmOperation.SPAM],(!d&&r>0))
}}
if(this._draftsActionMenu){
var l=this._draftsActionMenu.getOp(ZmOperation.EDIT);
if(l){
l.setEnabled(r==1)
}}
if(appCtxt.multiAccounts&&r>1&&appCtxt.getCurrentSearch().isMultiAccount()){
c.enable(ZmOperation.TAG_MENU,false)
}};
ZmMailListController.prototype._enableFlags=function(o,t,e){
o.enable([ZmOperation.MARK_READ,ZmOperation.MARK_UNREAD],true);
if(!t){
o.enable(ZmOperation.MARK_READ,false)
}
if(!e){
o.enable(ZmOperation.MARK_UNREAD,false)
}};
ZmMailListController.prototype.pageItemSilently=function(o,e){
var t=this._getNextItem(o,e);
if(t){
var n=this._listView[this._currentView];
n.emulateDblClick(t)
}};
ZmMailListController.prototype._getNextItem=function(n,t){
var r=this._list.getArray();
var e=r.length;
for(var o=0;
o<e;
o++){
if(n==r[o]){
break
}}
if(o==e){
return
}
var s=t?o+1:o-1;
return r[s]
};
ZmMailListController.prototype._handleResponsePaginate=function(t,n,o,r,e){
ZmListController.prototype._handleResponsePaginate.apply(this,arguments);
var s=o?this._list.getVector().get(o):null;
if(s){
this._listView[this._currentView].emulateDblClick(s)
}};
ZmMailListController.prototype._getMenuContext=function(){
return this._getViewType()
};
ZmMailListController.prototype._doFlag=function(t,e){
ZmListController.prototype._doFlag.call(this,t,e);
appCtxt.notifyZimlets("onMailFlagClick",[t,e])
};
ZmMailListController.prototype._doTag=function(t,e,o){
ZmListController.prototype._doTag.call(this,t,e,o);
appCtxt.notifyZimlets("onTagAction",[t,e,o])
};
ZmMailListController.prototype._getUnreadItem=function(s,c,r){
var o=this._listView[this._currentView];
var l=o.getList(true).getArray();
var m=l.length;
if(!m){
return
}
var e,h;
if(s==DwtKeyMap.SELECT_FIRST){
h=0
}else{
if(s==DwtKeyMap.SELECT_LAST){
h=l.length-1
}else{
var t=o.getSelection();
var e,h;
if(t&&t.length){
e=(s==DwtKeyMap.SELECT_NEXT)?t[t.length-1]:t[0]
}else{
e=(s==DwtKeyMap.SELECT_NEXT)?l[0]:l[l.length-1]
}
if(e){
var d=o.getItemIndex(e,true);
if(t&&t.length&&!r){
h=(s==DwtKeyMap.SELECT_NEXT)?d+1:d-1
}else{
h=d
}}}}
var n=null;
while((h>=0&&h<m)&&!n){
var u=l[h];
if(u.isUnread&&(!c||u.type==c)){
n=u
}else{
h=(s==DwtKeyMap.SELECT_NEXT||s==DwtKeyMap.SELECT_FIRST)?h+1:h-1
}}
return n
};
ZmMailListController.prototype._getNextItemToSelect=function(){}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmDoublePaneController")){
ZmDoublePaneController=function(e,t){
if(arguments.length==0){
return
}
ZmMailListController.call(this,e,t);
this._dragSrc=new DwtDragSource(Dwt.DND_DROP_MOVE);
this._dragSrc.addDragListener(new AjxListener(this,this._dragListener));
this._listeners[ZmOperation.SHOW_ORIG]=new AjxListener(this,this._showOrigListener);
this._listeners[ZmOperation.ADD_FILTER_RULE]=new AjxListener(this,this._filterListener);
this._listeners[ZmOperation.CREATE_APPT]=new AjxListener(this,this._createApptListener);
this._listeners[ZmOperation.CREATE_TASK]=new AjxListener(this,this._createTaskListener);
this._listSelectionShortcutDelayAction=new AjxTimedAction(this,this._listSelectionTimedAction)
};
ZmDoublePaneController.prototype=new ZmMailListController;
ZmDoublePaneController.prototype.constructor=ZmDoublePaneController;
ZmDoublePaneController.LIST_SELECTION_SHORTCUT_DELAY=300;
ZmDoublePaneController.RP_IDS=[ZmSetting.RP_BOTTOM,ZmSetting.RP_RIGHT,ZmSetting.RP_OFF];
ZmDoublePaneController.prototype.toString=function(){
return"ZmDoublePaneController"
};
ZmDoublePaneController.prototype.show=function(t,o,r,n){
ZmMailListController.prototype.show.call(this,t);
if(this._doublePaneView){
var e=this._doublePaneView._mailListView;
e._saveState({
selection:true}
);
e.reset()
}
this._item=o;
this._setup(this._currentView);
var s=new AjxCallback(this,this._handleResponseShow,[o,r]);
this._loadItem(o,this._currentView,s,n);
this._toolbar[this._currentView].adjustSize()
};
ZmDoublePaneController.prototype._handleResponseShow=function(o,s,t){
if(s){
s.run()
}
var e=this._doublePaneView;
var n=this.isReadingPaneOn();
if(e.isMsgViewVisible()!=n){
e.setReadingPane()
}
if(!this._msgViewCurrent()){
e.setMsg()
}};
ZmDoublePaneController.prototype._msgViewCurrent=function(){
var n=this._doublePaneView;
var o=n._mailListView;
o._restoreState();
var l=n.getMsg();
if(l){
var h=o.getSelection();
for(var s=0,t=h.length;
s<t;
s++){
var r=h[s];
var e=(r.type==ZmItem.CONV)?r.getFirstHotMsg():r;
if(e&&e.id==l.id){
return true
}}}
return false
};
ZmDoublePaneController.prototype.switchView=function(e,t){
if(e==ZmSetting.RP_OFF||e==ZmSetting.RP_BOTTOM||e==ZmSetting.RP_RIGHT){
this._mailListView._colHeaderActionMenu=null;
if(e!=this._getReadingPanePref()){
this._setReadingPanePref(e);
this._doublePaneView.setReadingPane()
}}else{
ZmMailListController.prototype.switchView.apply(this,arguments)
}
this._resetNavToolBarButtons(this._currentView)
};
ZmDoublePaneController.prototype.reset=function(){
if(this._doublePaneView){
this._doublePaneView.reset()
}
var e=this._listView[this._currentView];
if(e){
e._itemToSelect=e._selectedItem=null
}};
ZmDoublePaneController.prototype._handleResponseSwitchView=function(e){
this._doublePaneView.setMsg(e)
};
ZmDoublePaneController.prototype.handleDelete=function(){
return false
};
ZmDoublePaneController.prototype.handleKeyAction=function(e){
var t=this._listView[this._currentView];
switch(e){
case DwtKeyMap.SELECT_NEXT:case DwtKeyMap.SELECT_PREV:if(t){
return t.handleKeyAction(e)
}
break;
default:return ZmMailListController.prototype.handleKeyAction.call(this,e)
}
return true
};
ZmDoublePaneController.prototype._createDoublePaneView=function(){};
ZmDoublePaneController.prototype._initialize=function(e){
if(!this._doublePaneView){
var t=this._doublePaneView=this._createDoublePaneView();
this._mailListView=t.getMailListView();
t.addInviteReplyListener(this._inviteReplyListener);
t.addShareListener(this._shareListener)
}
ZmMailListController.prototype._initialize.call(this,e)
};
ZmDoublePaneController.prototype._initializeNavToolBar=function(e){
this._toolbar[e].addOp(ZmOperation.TEXT);
var t=this._itemCountText[ZmSetting.RP_BOTTOM]=this._toolbar[e].getButton(ZmOperation.TEXT);
t.addClassName("itemCountText")
};
ZmDoublePaneController.prototype._getToolBarOps=function(){
var e=this._standardToolBarOps();
e.push(ZmOperation.SEP);
e=e.concat(this._msgOps());
e.push(ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.SPAM,ZmOperation.SEP,ZmOperation.TAG_MENU);
if(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)){
e.push(ZmOperation.SEP,ZmOperation.DETACH)
}
e.push(ZmOperation.SEP,ZmOperation.VIEW_MENU);
return e
};
ZmDoublePaneController.prototype._getActionMenuOps=function(){
var e=this._flagOps();
e.push(ZmOperation.SEP);
e=e.concat(this._msgOps());
e.push(ZmOperation.EDIT);
e.push(ZmOperation.SEP);
e=e.concat(this._standardActionMenuOps());
e.push(ZmOperation.SEP);
e.push(ZmOperation.SPAM);
e.push(ZmOperation.SHOW_ORIG);
if(appCtxt.get(ZmSetting.FILTERS_ENABLED)){
e.push(ZmOperation.ADD_FILTER_RULE)
}
if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)){
e.push(ZmOperation.CREATE_APPT)
}
if(appCtxt.get(ZmSetting.TASKS_ENABLED)){
e.push(ZmOperation.CREATE_TASK)
}
return e
};
ZmDoublePaneController.prototype._createNewView=function(){
if(this._mailListView){
this._mailListView.setDragSource(this._dragSrc)
}
return this._mailListView
};
ZmDoublePaneController.prototype.getReferenceView=function(){
return this._doublePaneView
};
ZmDoublePaneController.prototype._getTagMenuMsg=function(e){
return(e==1)?ZmMsg.tagMessage:ZmMsg.tagMessages
};
ZmDoublePaneController.prototype._getMoveDialogTitle=function(e){
return(e==1)?ZmMsg.moveMessage:ZmMsg.moveMessages
};
ZmDoublePaneController.prototype._initializeTabGroup=function(e){
if(this._tabGroups[e]){
return
}
ZmListController.prototype._initializeTabGroup.apply(this,arguments);
if(!AjxEnv.isIE){
this._tabGroups[e].addMember(this.getReferenceView().getMsgView())
}};
ZmDoublePaneController.prototype._setViewContents=function(e){
this._doublePaneView.setItem(this._item)
};
ZmDoublePaneController.prototype._displayMsg=function(o){
if(!o._loaded){
return
}
if(appCtxt.markReadActionId>0){
AjxTimedAction.cancelAction(appCtxt.markReadActionId);
appCtxt.markReadActionId=-1
}
this._doublePaneView.setMsg(o);
this._curMsg=o;
if(o.isUnread){
var e=appCtxt.getById(o.folderId);
var n=e?e.isReadOnly():false;
if(!n){
var t=appCtxt.get(ZmSetting.MARK_MSG_READ);
if(t==ZmSetting.MARK_READ_NOW){
this._doMarkRead([o],true)
}else{
if(t>0){
if(!appCtxt.markReadAction){
appCtxt.markReadAction=new AjxTimedAction(this,this._markReadAction)
}
appCtxt.markReadAction.args=[o];
appCtxt.markReadActionId=AjxTimedAction.scheduleAction(appCtxt.markReadAction,t*1000)
}}}}};
ZmDoublePaneController.prototype._markReadAction=function(e){
this._doMarkRead([e],true)
};
ZmDoublePaneController.prototype._preHideCallback=function(){
if(appCtxt.markReadActionId>0){
AjxTimedAction.cancelAction(appCtxt.markReadActionId);
appCtxt.markReadActionId=-1
}
return ZmController.prototype._preHideCallback.call(this)
};
ZmDoublePaneController.prototype._setupReadingPaneMenuItems=function(r,o,l){
if(o.getItemCount()>0){
new DwtMenuItem({
parent:o,style:DwtMenuItem.SEPARATOR_STYLE}
)
}
var h={
text:ZmMsg.readingPaneAtBottom,style:DwtMenuItem.RADIO_STYLE,radioGroupId:"RP"};
var e=ZmDoublePaneController.RP_IDS;
var c=this._getReadingPanePref();
for(var n=0;
n<e.length;
n++){
var t=e[n];
if(!o._menuItems[t]){
h.text=ZmMailListController.READING_PANE_TEXT[t];
h.image=ZmMailListController.READING_PANE_ICON[t];
var s=o.createMenuItem(t,h);
s.setData(ZmOperation.MENUITEM_ID,t);
s.addSelectionListener(this._listeners[ZmOperation.VIEW]);
if(t==c){
s.setChecked(true,true)
}}}};
ZmDoublePaneController.prototype._loadItem=function(o,e,h,s){
if(o instanceof ZmMailItem){
var n=o;
if(!n._loaded){
var r=new AjxCallback(this,this._handleResponseLoadConv,[e,h]);
var t=this.isReadingPaneOn();
s=s||(appCtxt.get(ZmSetting.MARK_MSG_READ)==ZmSetting.MARK_READ_NOW);
n.load({
getFirstMsg:t,markRead:s}
,r)
}else{
this._handleResponseLoadConv(e,h,n._createResult())
}}else{
this._displayResults(e);
if(h){
h.run()
}}};
ZmDoublePaneController.prototype._handleResponseLoadConv=function(o,s,t){
var e=t.getResponse();
var n=e.getResults(ZmItem.MSG);
if(n instanceof ZmList){
this._list=n;
this._activeSearch=e
}
this._displayResults(o);
if(s){
s.run()
}};
ZmDoublePaneController.prototype._displayResults=function(e){
var t={};
t[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar[e];
t[ZmAppViewMgr.C_APP_CONTENT]=this._doublePaneView;
this._doublePaneView.setReadingPane();
this._setView({
view:e,elements:t,isAppView:this._isTopLevelView()}
);
this._resetNavToolBarButtons(e);
var o=this._doublePaneView.getSize();
this._doublePaneView._resetSize(o.x,o.y)
};
ZmDoublePaneController.prototype._doGetMsg=function(e){
if(!e){
return
}
if(e.id==this._pendingMsg){
return
}
e._loadPending=true;
this._pendingMsg=e.id;
var t=new AjxCallback(this,this._handleResponseDoGetMsg,e);
e.load({
callback:t,noBusyOverlay:true}
)
};
ZmDoublePaneController.prototype._handleResponseDoGetMsg=function(e){
if(this._pendingMsg&&(e.id!=this._pendingMsg)){
return
}
e._loadPending=false;
this._pendingMsg=null;
this._doublePaneView.setMsg(e)
};
ZmDoublePaneController.prototype._resetOperations=function(n,t){
ZmMailListController.prototype._resetOperations.call(this,n,t);
var o=false;
var e=false;
if(t==1){
var h=this._mailListView.getSelection()[0];
if(h){
o=(h.type==ZmItem.MSG||(h.numMsgs==1));
e=h.isDraft
}}
n.enable(ZmOperation.SHOW_ORIG,o);
if(appCtxt.get(ZmSetting.FILTERS_ENABLED)){
var r=this._getSearchFolder();
var s=(r&&r.nId==ZmOrganizer.ID_SYNC_FAILURES);
n.enable(ZmOperation.ADD_FILTER_RULE,o&&!s)
}
n.enable(ZmOperation.DETACH,(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)&&o&&!e));
n.enable(ZmOperation.TEXT,true)
};
ZmDoublePaneController.prototype._isTopLevelView=function(){
return true
};
ZmDoublePaneController.prototype._handleEmptyList=function(e){
this.reset();
ZmMailListController.prototype._handleEmptyList.apply(this,arguments)
};
ZmDoublePaneController.prototype._listSelectionListener=function(n){
ZmMailListController.prototype._listSelectionListener.call(this,n);
var o=this._listView[this._currentView];
if(n.detail==DwtListView.ITEM_DBL_CLICKED){
var t=n.item;
if(!t){
return
}
var e=appCtxt.isOffline&&appCtxt.getCurrentSearch();
if(e&&e.isMultiAccount()){
appCtxt.accountList.setActiveAccount(t.getAccount())
}
var h=this._mailListView.getTargetItemDiv(n);
this._mailListView._itemSelected(h,n);
if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)){
this._mailListView.setSelectionHdrCbox(false)
}
var r=new AjxCallback(this,this._handleResponseListSelectionListener,t);
if(t.isDraft){
this._doAction({
ev:n,action:ZmOperation.DRAFT}
);
return true
}else{
if(appCtxt.get(ZmSetting.OPEN_MAIL_IN_NEW_WIN)){
this._detachListener(null,r);
return true
}else{
return false
}}}else{
if(this.isReadingPaneOn()){
if(n.kbNavEvent&&ZmDoublePaneController.LIST_SELECTION_SHORTCUT_DELAY){
if(this._listSelectionShortcutDelayActionId){
AjxTimedAction.cancelAction(this._listSelectionShortcutDelayActionId)
}
this._listSelectionShortcutDelayActionId=AjxTimedAction.scheduleAction(this._listSelectionShortcutDelayAction,ZmDoublePaneController.LIST_SELECTION_SHORTCUT_DELAY)
}else{
this._setSelectedItem()
}}else{
var s=o.getSelection()[0];
if(s){
this._doublePaneView.resetMsg(s)
}}}};
ZmDoublePaneController.prototype._handleResponseListSelectionListener=function(e){
if(e.type==ZmItem.MSG&&e._loaded&&e.isUnread&&(appCtxt.get(ZmSetting.MARK_MSG_READ)==ZmSetting.MARK_READ_NOW)){
this._list.markRead([e],true)
}
this._setSelectedItem()
};
ZmDoublePaneController.prototype._listSelectionTimedAction=function(){
if(this._listSelectionShortcutDelayActionId){
AjxTimedAction.cancelAction(this._listSelectionShortcutDelayActionId)
}
this._setSelectedItem()
};
ZmDoublePaneController.prototype._setSelectedItem=function(){
var e=this._listView[this._currentView].getSelectionCount();
if(e==1){
var o=new AjxCallback(this,this._handleResponseSetSelectedItem);
var t=(appCtxt.get(ZmSetting.MARK_MSG_READ)==ZmSetting.MARK_READ_NOW);
this._getLoadedMsg({
markRead:t}
,o)
}};
ZmDoublePaneController.prototype._handleResponseSetSelectedItem=function(r){
if(r){
if(appCtxt.isOffline){
this._app.clearNewMailBadge();
var l=r.getAccount();
var t=appCtxt.getCurrentSearch();
if(t&&t.isMultiAccount()){
var n=l||appCtxt.accountList.defaultAccount;
appCtxt.accountList.setActiveAccount(n)
}
if(l&&l.inNewMailMode){
l.inNewMailMode=false;
var o=appCtxt.getOverviewController()._overviewContainer;
for(var e in o){
o[e].updateAccountInfo(l,true,true)
}}}
var s=this._listView[this._currentView];
var h=(s.type==ZmItem.CONV)?r.cid:r.id;
if(s.hasItem(h)){
this._displayMsg(r)
}}};
ZmDoublePaneController.prototype._listActionListener=function(e){
ZmMailListController.prototype._listActionListener.call(this,e);
if(!this.isReadingPaneOn()){
var t=this._listView[this._currentView].getSelection()[0];
if(t){
this._doublePaneView.resetMsg(t)
}}};
ZmDoublePaneController.prototype._doDelete=function(){
this._listView[this._currentView]._itemToSelect=this._getNextItemToSelect();
ZmMailListController.prototype._doDelete.apply(this,arguments)
};
ZmDoublePaneController.prototype._doMove=function(){
this._listView[this._currentView]._itemToSelect=this._getNextItemToSelect();
ZmMailListController.prototype._doMove.apply(this,arguments)
};
ZmDoublePaneController.prototype._showOrigListener=function(){
var t=this.getMsg();
if(!t){
return
}
var e=appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI)+"&id="+t.id;
window.open(e,"_blank","menubar=yes,resizable=yes,scrollbars=yes")
};
ZmDoublePaneController.prototype._filterListener=function(){
var t=new AjxCallback(this,this._handleResponseFilterListener);
var e=this._getLoadedMsg(null,t)
};
ZmDoublePaneController.prototype._createApptListener=function(){
var t=new AjxCallback(this,this._handleResponseNewApptListener);
var e=this._getLoadedMsg(null,t)
};
ZmDoublePaneController.prototype._createTaskListener=function(){
var t=new AjxCallback(this,this._handleResponseNewTaskListener);
var e=this._getLoadedMsg(null,t)
};
ZmDoublePaneController.prototype._handleResponseNewApptListener=function(t){
if(!t){
return
}
var e=AjxDispatcher.run("GetCalController");
e.newApptFromMailItem(t,new Date())
};
ZmDoublePaneController.prototype._handleResponseNewTaskListener=function(e){
if(!e){
return
}
AjxDispatcher.require(["TasksCore","Tasks"]);
appCtxt.getApp(ZmApp.TASKS).newTaskFromMailItem(e,new Date())
};
ZmDoublePaneController.prototype._handleResponseFilterListener=function(s){
if(!s){
return
}
AjxDispatcher.require(["PreferencesCore","Preferences"]);
var n=new ZmFilterRule();
var h=s.getAddress(AjxEmailAddress.FROM);
if(h){
var o=ZmFilterRule.C_HEADER_VALUE[ZmFilterRule.C_FROM];
n.addCondition(ZmFilterRule.TEST_HEADER,ZmFilterRule.OP_CONTAINS,h.address,o)
}
var r=s.getAddress(AjxEmailAddress.CC);
if(r){
var o=ZmFilterRule.C_HEADER_VALUE[ZmFilterRule.C_CC];
n.addCondition(ZmFilterRule.TEST_HEADER,ZmFilterRule.OP_CONTAINS,r.address,o)
}
var e=s.subject;
if(e){
var o=ZmFilterRule.C_HEADER_VALUE[ZmFilterRule.C_SUBJECT];
n.addCondition(ZmFilterRule.TEST_HEADER,ZmFilterRule.OP_IS,e,o)
}
n.setGroupOp(ZmFilterRule.GROUP_ALL);
n.addAction(ZmFilterRule.A_KEEP);
var t=appCtxt.multiAccounts&&s.getAccount().name;
appCtxt.getFilterRuleDialog().popup(n,null,null,t)
};
ZmDoublePaneController.prototype._dragListener=function(e){
ZmListController.prototype._dragListener.call(this,e);
if(e.action==DwtDragEvent.DRAG_END){
this._resetOperations(this._toolbar[this._currentView],this._doublePaneView.getSelection().length)
}};
ZmDoublePaneController.prototype._draftSaved=function(o,t){
if(t){
if(!o){
o=new ZmMailMsg()
}
o._loadFromDom(t)
}
appCtxt.cacheSet(o.id,o);
this._redrawDraftItemRows(o);
var e=this._doublePaneView.getMsg();
if(e&&e.id==o.id){
this._doublePaneView.reset();
this._doublePaneView.setMsg(o)
}};
ZmDoublePaneController.prototype._redrawDraftItemRows=function(e){
this._listView[this._currentView].redrawItem(e);
this._listView[this._currentView].setSelection(e,true)
};
ZmDoublePaneController.prototype.selectFirstItem=function(){
this._doublePaneView._selectFirstItem()
};
ZmDoublePaneController.prototype._getNextItemToSelect=function(t){
t=t||{};
var l=this._listView[this._currentView];
var s=l.getSelectionCount();
if(s){
var h=l.getSelection();
var o={};
for(var n=0;
n<h.length;
n++){
o[h[n].id]=true
}
var u=appCtxt.get(ZmSetting.SELECT_AFTER_DELETE);
var e=(u==ZmSetting.DELETE_SELECT_PREV||(u==ZmSetting.DELETE_SELECT_ADAPT&&(this.lastListAction==DwtKeyMap.SELECT_PREV||this.lastListAction==ZmKeyMap.PREV_UNREAD)));
if(e&&(s==1)){
var r=l._getRowIndex(h[h.length-1]);
var c=l._parentEl.childNodes;
for(var n=r-1;
n>=0;
n--){
var d=l.getItemFromElement(c[n]);
if(d&&!o[d.id]&&!t[d.id]&&!(d.cid&&(o[d.cid]||t[d.cid]))){
return d
}}
return ZmMailListView.FIRST_ITEM
}else{
var r=l._getRowIndex(h[0]);
var c=l._parentEl.childNodes;
for(var n=r+1;
n<c.length;
n++){
var d=l.getItemFromElement(c[n]);
if(d&&!o[d.id]&&!t[d.id]&&!(d.cid&&(o[d.cid]||t[d.cid]))){
return d
}}
return ZmMailListView.LAST_ITEM
}}
return ZmMailListView.FIRST_ITEM
};
ZmDoublePaneController.prototype._setItemCountText=function(t){
t=t||this._getItemCountText();
var e=(this._getReadingPanePref()==ZmSetting.RP_RIGHT);
if(this._itemCountText[ZmSetting.RP_RIGHT]){
this._itemCountText[ZmSetting.RP_RIGHT].setText(e?t:"")
}
if(this._itemCountText[ZmSetting.RP_BOTTOM]){
this._itemCountText[ZmSetting.RP_BOTTOM].setText(e?"":t)
}
this._toolbar[this._currentView].adjustSize()
};
ZmDoublePaneController.prototype._postShowCallback=function(){
ZmMailListController.prototype._postShowCallback.apply(this,arguments);
var e=this._doublePaneView;
if(e&&e.isStale&&e._staleHandler){
e._staleHandler()
}}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmConvListController")){
ZmConvListController=function(e,t){
ZmDoublePaneController.call(this,e,t);
this._msgControllerMode=ZmId.VIEW_CONVLIST
};
ZmConvListController.prototype=new ZmDoublePaneController;
ZmConvListController.prototype.constructor=ZmConvListController;
ZmMailListController.GROUP_BY_ITEM[ZmId.VIEW_CONVLIST]=ZmItem.CONV;
ZmMailListController.GROUP_BY_SETTING[ZmId.VIEW_CONVLIST]=ZmSetting.GROUP_BY_CONV;
ZmMailListController.GROUP_BY_ICON[ZmId.VIEW_CONVLIST]="ConversationView";
ZmMailListController.GROUP_BY_MSG_KEY[ZmId.VIEW_CONVLIST]="byConversation";
ZmMailListController.GROUP_BY_SHORTCUT[ZmId.VIEW_CONVLIST]=ZmKeyMap.VIEW_BY_CONV;
ZmMailListController.GROUP_BY_VIEWS.push(ZmId.VIEW_CONVLIST);
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.FIRST_UNREAD_MSG]=DwtKeyMap.SELECT_FIRST;
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.LAST_UNREAD_MSG]=DwtKeyMap.SELECT_LAST;
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.NEXT_UNREAD_MSG]=DwtKeyMap.SELECT_NEXT;
ZmMailListController.ACTION_CODE_WHICH[ZmKeyMap.PREV_UNREAD_MSG]=DwtKeyMap.SELECT_PREV;
ZmConvListController.prototype.toString=function(){
return"ZmConvListController"
};
ZmConvListController.prototype.show=function(e){
this._list=e.getResults(ZmItem.CONV);
ZmDoublePaneController.prototype.show.call(this,e,this._list);
appCtxt.set(ZmSetting.GROUP_MAIL_BY,ZmSetting.GROUP_BY_CONV)
};
ZmConvListController.prototype.switchView=function(e,t){
if(e==ZmSearch.DATE_DESC||e==ZmSearch.DATE_ASC){
if((appCtxt.get(ZmSetting.CONVERSATION_ORDER)!=e)||t){
appCtxt.set(ZmSetting.CONVERSATION_ORDER,e);
this._mailListView.redoExpansion()
}
if(this._toolbar&&this._toolbar[this._currentView]){
this._toolbar[this._currentView].adjustSize()
}}else{
ZmDoublePaneController.prototype.switchView.apply(this,arguments)
}};
ZmConvListController.prototype.getKeyMapName=function(){
return"ZmConvListController"
};
ZmConvListController.prototype.handleKeyAction=function(t){
var e=this._mailListView;
switch(t){
case ZmKeyMap.EXPAND:if(e.getSelectionCount()!=1){
return false
}
var o=e.getItemFromElement(e._kbAnchor);
if(!o){
return false
}
if(o.type==ZmItem.CONV&&!e._isExpandable(o)){
return DwtListView.prototype.handleKeyAction.call(e,DwtKeyMap.DBLCLICK)
}else{
e._expandItem(o)
}
break;
case ZmKeyMap.EXPAND_ALL:e._expandAll(true);
break;
case ZmKeyMap.COLLAPSE_ALL:e._expandAll(false);
break;
case ZmKeyMap.NEXT_UNREAD_MSG:case ZmKeyMap.PREV_UNREAD_MSG:this.lastListAction=t;
var s,r=false;
if(e.getSelectionCount()==1){
var n=e.getSelection();
s=n[0];
if(s&&e._isExpandable(s)){
r=true
}}
case ZmKeyMap.FIRST_UNREAD_MSG:case ZmKeyMap.LAST_UNREAD_MSG:var o=(s&&s.type==ZmItem.MSG&&r)?s:this._getUnreadItem(ZmMailListController.ACTION_CODE_WHICH[t],null,r);
if(!o){
return
}
if(!e._expanded[o.id]&&e._isExpandable(o)){
var h=new AjxCallback(this,this._handleResponseExpand,[t]);
if(o.type==ZmItem.MSG){
this._expand({
conv:appCtxt.getById(o.cid),msg:o,offset:e._msgOffset[o.id],callback:h}
)
}else{
this._expand({
conv:o,callback:h}
)
}}else{
if(o){
this._selectItem(e,o)
}}
break;
case DwtKeyMap.DBLCLICK:return DwtListView.prototype.handleKeyAction.apply(e,arguments);
default:return ZmDoublePaneController.prototype.handleKeyAction.call(this,t)
}
return true
};
ZmConvListController.prototype._handleResponseExpand=function(t){
var e=this._getUnreadItem(ZmMailListController.ACTION_CODE_WHICH[t],ZmItem.MSG);
if(e){
this._selectItem(this._mailListView,e)
}};
ZmConvListController.prototype.pageItemSilently=function(l,n){
if(!l){
return
}
if(l.type==ZmItem.CONV){
ZmMailListController.prototype.pageItemSilently.apply(this,arguments);
return
}
var c=appCtxt.getById(l.cid);
if(!(c&&c.msgs)){
return
}
var d=false;
var r=c.msgs.getArray();
for(var o=0,s=r.length;
o<s;
o++){
if(r[o]==l){
d=true;
break
}}
if(!d){
return
}
var t=n?o+1:o-1;
if(t>0&&t<r.length){
var e=r[t];
var h=this._listView[this._currentView];
h.emulateDblClick(e)
}};
ZmConvListController.prototype._createDoublePaneView=function(){
return new ZmConvDoublePaneView({
parent:this._container,posStyle:Dwt.ABSOLUTE_STYLE,controller:this,dropTgt:this._dropTgt}
)
};
ZmConvListController.prototype._getViewType=function(){
return ZmId.VIEW_CONVLIST
};
ZmConvListController.prototype._paginate=function(o,n,e,t){
o=o?o:this._currentView;
return ZmDoublePaneController.prototype._paginate.call(this,o,n,e,t)
};
ZmConvListController.prototype._resetNavToolBarButtons=function(e){
ZmDoublePaneController.prototype._resetNavToolBarButtons.call(this,e);
if(!this._navToolBar[e]){
return
}
this._navToolBar[e].setToolTip(ZmOperation.PAGE_BACK,ZmMsg.previousPage);
this._navToolBar[e].setToolTip(ZmOperation.PAGE_FORWARD,ZmMsg.nextPage)
};
ZmConvListController.prototype._setupConvOrderMenuItems=function(e,h){
if(h.getItemCount()>0){
new DwtMenuItem({
parent:h,style:DwtMenuItem.SEPARATOR_STYLE}
)
}
var s=[ZmMailListController.CONV_ORDER_DESC,ZmMailListController.CONV_ORDER_ASC];
var n=appCtxt.get(ZmSetting.CONVERSATION_ORDER);
var r={
style:DwtMenuItem.RADIO_STYLE,radioGroupId:"CO"};
for(var o=0;
o<s.length;
o++){
var l=s[o];
if(!h._menuItems[l]){
r.text=ZmMailListController.CONV_ORDER_TEXT[l];
var t=h.createMenuItem(l,r);
t.setData(ZmOperation.MENUITEM_ID,l);
t.addSelectionListener(this._listeners[ZmOperation.VIEW]);
t.setChecked((n==l),true)
}}};
ZmConvListController.prototype._getNumTotal=function(){
return null
};
ZmConvListController.prototype._getMoreSearchParams=function(e){
e.fetch=this.isReadingPaneOn();
e.markRead=true
};
ZmConvListController.prototype._listSelectionListener=function(t){
var e=t.item;
if(!e){
return
}
if(t.field==ZmItem.F_EXPAND&&this._mailListView._isExpandable(e)){
this._toggle(e,false)
}else{
var o=ZmDoublePaneController.prototype._listSelectionListener.apply(this,arguments);
if(!o){
if(t.detail==DwtListView.ITEM_DBL_CLICKED){
var n=new AjxCallback(this,this._handleResponseListSelectionListener,e);
if(e.type==ZmItem.MSG){
AjxDispatcher.run("GetMsgController").show(e,this._msgControllerMode,n,true)
}else{
AjxDispatcher.run("GetConvController").show(this._activeSearch,e,this,n,true)
}}}}};
ZmConvListController.prototype._handleResponseListSelectionListener=function(e){
if(this.isReadingPaneOn()){
this._setSelectedItem()
}};
ZmConvListController.prototype.getMsg=function(o){
var t=this._listView[this._currentView].getSelection();
var e=(t&&t.length)?t[0]:null;
if(e){
if(e.type==ZmItem.CONV){
return e.getFirstHotMsg(o)
}else{
if(e.type==ZmItem.MSG){
return ZmDoublePaneController.prototype.getMsg.apply(this,arguments)
}}}
return null
};
ZmConvListController.prototype._getLoadedMsg=function(o,s){
o=o||{};
var t=this._listView[this._currentView].getSelection();
var e=(t&&t.length)?t[0]:null;
if(e){
o.markRead=(appCtxt.get(ZmSetting.MARK_MSG_READ)==ZmSetting.MARK_READ_NOW);
if(e.type==ZmItem.CONV){
var n=new AjxCallback(this,this._handleResponseGetLoadedMsg,s);
e.getFirstHotMsg(o,n)
}else{
if(e.type==ZmItem.MSG){
ZmDoublePaneController.prototype._getLoadedMsg.apply(this,arguments)
}}}else{
s.run()
}};
ZmConvListController.prototype._handleResponseGetLoadedMsg=function(t,e){
t.run(e)
};
ZmConvListController.prototype._getSelectedMsg=function(t){
var e=this._listView[this._currentView].getSelection()[0];
if(!e){
return null
}
return(e.type==ZmItem.CONV)?e.getFirstHotMsg(null,t):e
};
ZmConvListController.prototype._toggle=function(t,e){
if(this._mailListView._expanded[t.id]){
this._collapse(t)
}else{
var s=t,n=null,o=0;
if(t.type==ZmItem.MSG){
s=appCtxt.getById(t.cid);
n=t;
o=this._mailListView._msgOffset[t.id]
}
this._expand({
conv:s,msg:n,offset:o,getFirstMsg:e}
)
}};
ZmConvListController.prototype._expand=function(s){
var n=s.conv;
var o=s.offset||0;
var r=new AjxCallback(this,this._handleResponseLoadItem,[s]);
var t=false;
if(o){
if(this._paginateConv(n,o,r)){
this._handleResponseLoadItem(s,new ZmCsfeResult(n.msgs))
}}else{
if(!n._loaded){
var e=(s.getFirstMsg===false)?false:this.isReadingPaneOn();
n.load({
getFirstMsg:e}
,r)
}else{
this._handleResponseLoadItem(s,new ZmCsfeResult(n.msgs))
}}};
ZmConvListController.prototype._handleResponseLoadItem=function(t,e){
if(e){
this._mailListView._expand(t.conv,t.msg)
}
if(t.callback){
t.callback.run()
}};
ZmConvListController.prototype._paginateConv=function(l,o,h){
var n=l.msgs;
var t=appCtxt.get(ZmSetting.CONVERSATION_PAGE_SIZE);
if(o&&n&&((o+t>n.size())&&n.hasMore())){
var r=(o+t)-n.size();
var s=r<t&&r>0?r:t;
if(s<t){
o=((o+t)-s)+1
}
var c=new AjxCallback(this,this._handleResponsePaginateConv,[l,o,h]);
var e=this.isReadingPaneOn();
l.load({
offset:o,limit:t,getFirstMsg:e}
,c);
return false
}else{
return true
}};
ZmConvListController.prototype._handleResponsePaginateConv=function(s,n,r,t){
if(!s.msgs){
return
}
var e=t.getResponse();
s.msgs.setHasMore(e.getAttribute("more"));
var o=e.getResults(ZmItem.MSG).getVector();
s.msgs.cache(n,o);
if(r){
r.run(t)
}};
ZmConvListController.prototype._collapse=function(e){
if(this._mailListView._rowsArePresent(e)){
this._mailListView._collapse(e)
}else{
this._toggle(e)
}};
ZmConvListController.prototype._divvyItems=function(o){
var l=[],h=[];
var s={};
for(var n=0;
n<o.length;
n++){
var r=o[n];
if(r.type==ZmItem.CONV){
l.push(r);
s[r.id]=true
}else{
h.push(r)
}}
var t=[];
for(var n=0;
n<h.length;
n++){
if(!s[h[n].cid]){
t.push(h[n])
}}
var e={};
e[ZmItem.MSG]=t;
e[ZmItem.CONV]=l;
return e
};
ZmConvListController.prototype._draftSaved=function(s,n){
if(n){
if(!s){
s=new ZmMailMsg()
}
s._loadFromDom(n)
}
var o=appCtxt.getById(s.cid);
if(o&&o.msgs&&o.msgs.size()){
var e=o.msgs.getArray();
for(var t=0;
t<e.length;
t++){
if(e[t].id==s.id){
e[t]=s
}}}
ZmDoublePaneController.prototype._draftSaved.apply(this,[s])
};
ZmConvListController.prototype._redrawDraftItemRows=function(o){
var t=this._listView[this._currentView];
var e=appCtxt.getById(o.cid);
if(e){
e._loadFromMsg(o);
t.redrawItem(e);
t.setSelection(e,true)
}
t.redrawItem(o)
};
ZmConvListController.prototype._applyAction=function(o,s,n){
n=n?n:[];
var e=this._divvyItems(o);
var t=false;
if(e[ZmItem.MSG]&&e[ZmItem.MSG].length){
n.unshift(e[ZmItem.MSG]);
ZmDoublePaneController.prototype[s].apply(this,n);
t=true
}
if(e[ZmItem.CONV]&&e[ZmItem.CONV].length){
t?n[0]=e[ZmItem.CONV]:n.unshift(e[ZmItem.CONV]);
ZmDoublePaneController.prototype[s].apply(this,n)
}};
ZmConvListController.prototype._doFlag=function(t){
var e=!t[0].isFlagged;
this._applyAction(t,"_doFlag",[e])
};
ZmConvListController.prototype._doTag=function(t,e,o){
this._applyAction(t,"_doTag",[e,o])
};
ZmConvListController.prototype._doRemoveAllTags=function(e){
this._applyAction(e,"_doRemoveAllTags")
};
ZmConvListController.prototype._doDelete=function(t,e,o){
this._applyAction(t,"_doDelete",[e,o])
};
ZmConvListController.prototype._doMove=function(t,n,o,e){
this._applyAction(t,"_doMove",[n,o,e])
};
ZmConvListController.prototype._doMarkRead=function(t,e,o){
this._applyAction(t,"_doMarkRead",[e,o])
};
ZmConvListController.prototype._doSpam=function(e,o,t){
this._applyAction(e,"_doSpam",[o,t])
};
ZmConvListController.prototype._handleResponsePaginate=function(o,s,n,r,t,e){
ZmListController.prototype._handleResponsePaginate.call(this,o,s,n,r,t,true)
}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmTradController")){
ZmTradController=function(e,t){
ZmDoublePaneController.call(this,e,t);
this._msgControllerMode=ZmId.VIEW_TRAD
};
ZmTradController.prototype=new ZmDoublePaneController;
ZmTradController.prototype.constructor=ZmTradController;
ZmMailListController.GROUP_BY_ITEM[ZmId.VIEW_TRAD]=ZmItem.MSG;
ZmMailListController.GROUP_BY_SETTING[ZmId.VIEW_TRAD]=ZmSetting.GROUP_BY_MESSAGE;
ZmMailListController.GROUP_BY_ICON[ZmId.VIEW_TRAD]="MessageView";
ZmMailListController.GROUP_BY_MSG_KEY[ZmId.VIEW_TRAD]="byMessage";
ZmMailListController.GROUP_BY_SHORTCUT[ZmId.VIEW_TRAD]=ZmKeyMap.VIEW_BY_MSG;
ZmMailListController.GROUP_BY_VIEWS.push(ZmId.VIEW_TRAD);
ZmTradController.prototype.toString=function(){
return"ZmTradController"
};
ZmTradController.prototype.show=function(e){
this._list=e.getResults(ZmItem.MSG);
ZmDoublePaneController.prototype.show.call(this,e,this._list);
appCtxt.set(ZmSetting.GROUP_MAIL_BY,ZmSetting.GROUP_BY_MESSAGE);
this._resetNavToolBarButtons(ZmId.VIEW_TRAD)
};
ZmTradController.prototype._createDoublePaneView=function(){
return(new ZmTradView({
parent:this._container,posStyle:Dwt.ABSOLUTE_STYLE,controller:this,dropTgt:this._dropTgt}
))
};
ZmTradController.prototype._getViewType=function(){
return ZmId.VIEW_TRAD
};
ZmTradController.prototype._paginate=function(o,n,e,t){
o=o?o:this._currentView;
return ZmDoublePaneController.prototype._paginate.call(this,o,n,e,t)
};
ZmTradController.prototype._resetNavToolBarButtons=function(e){
ZmDoublePaneController.prototype._resetNavToolBarButtons.call(this,e);
if(!this._navToolBar[e]){
return
}
this._navToolBar[e].setToolTip(ZmOperation.PAGE_BACK,ZmMsg.previousPage);
this._navToolBar[e].setToolTip(ZmOperation.PAGE_FORWARD,ZmMsg.nextPage)
};
ZmTradController.prototype._getMoreSearchParams=function(e){
e.fetch=this.isReadingPaneOn();
e.markRead=true
};
ZmTradController.prototype._listSelectionListener=function(o){
var t=o.item;
if(!t){
return
}
var n=ZmDoublePaneController.prototype._listSelectionListener.apply(this,arguments);
if(!n&&o.detail==DwtListView.ITEM_DBL_CLICKED){
var s=new AjxCallback(this,this._handleResponseListSelectionListener,t);
var e=AjxDispatcher.run("GetMsgController",t.nId);
e.show(t,this._msgControllerMode,s,true)
}};
ZmTradController.prototype._handleResponsePaginate=function(o,s,n,r,t,e){
ZmListController.prototype._handleResponsePaginate.call(this,o,s,n,r,t,true)
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmIdentity")){
ZmIdentity=function(e){
this.name=e;
this.id="";
this.sendFromDisplay="";
this.sendFromAddress="";
this.setReplyTo=false;
this.setReplyToDisplay="";
this.setReplyToAddress="";
this.readReceiptAddr="";
this.signature="";
this.useWhenSentTo=false;
this.whenSentToAddresses=[];
this.useWhenInFolder=false;
this.whenInFolderIds=[];
this.isFromDataSource=false
};
ZmIdentity.prototype.toString=function(){
return"ZmIdentity"
};
ZmIdentity.COMPOSE_SAME="same";
ZmIdentity.COMPOSE_TEXT="text";
ZmIdentity.COMPOSE_HTML="html";
ZmIdentity.STRING=1;
ZmIdentity.ARRAY=2;
ZmIdentity.BOOLEAN=3;
ZmIdentity.DEFAULT_NAME="DEFAULT";
var i=0;
ZmIdentity.NAME=i++;
ZmIdentity.SEND_FROM_DISPLAY=i++;
ZmIdentity.SEND_FROM_ADDRESS=i++;
ZmIdentity.SET_REPLY_TO=i++;
ZmIdentity.SET_REPLY_TO_DISPLAY=i++;
ZmIdentity.SET_REPLY_TO_ADDRESS=i++;
ZmIdentity.SIGNATURE=i++;
ZmIdentity.USE_WHEN_SENT_TO=i++;
ZmIdentity.WHEN_SENT_TO_ADDRESSES=i++;
ZmIdentity.USE_WHEN_IN_FOLDER=i++;
ZmIdentity.WHEN_IN_FOLDERIDS=i++;
ZmIdentity.IS_DEFAULT=i++;
delete i;
ZmIdentity.FIELDS={};
ZmIdentity._SOAP={};
ZmIdentity.addField=function(e,t){
ZmIdentity.FIELDS[e]=t;
ZmIdentity._SOAP[t.soap]=t
};
ZmIdentity.addField(ZmIdentity.NAME,{
name:"name",soap:"zimbraPrefIdentityName",type:ZmIdentity.STRING}
);
ZmIdentity.addField(ZmIdentity.SEND_FROM_DISPLAY,{
name:"sendFromDisplay",soap:"zimbraPrefFromDisplay",type:ZmIdentity.STRING}
);
ZmIdentity.addField(ZmIdentity.SEND_FROM_ADDRESS,{
name:"sendFromAddress",soap:"zimbraPrefFromAddress",type:ZmIdentity.STRING}
);
ZmIdentity.addField(ZmIdentity.SET_REPLY_TO,{
name:"setReplyTo",soap:"zimbraPrefReplyToEnabled",type:ZmIdentity.BOOLEAN}
);
ZmIdentity.addField(ZmIdentity.SET_REPLY_TO_DISPLAY,{
name:"setReplyToDisplay",soap:"zimbraPrefReplyToDisplay",type:ZmIdentity.STRING}
);
ZmIdentity.addField(ZmIdentity.SET_REPLY_TO_ADDRESS,{
name:"setReplyToAddress",soap:"zimbraPrefReplyToAddress",type:ZmIdentity.STRING}
);
ZmIdentity.addField(ZmIdentity.SIGNATURE,{
name:"signature",soap:"zimbraPrefDefaultSignatureId",type:ZmIdentity.STRING}
);
ZmIdentity.addField(ZmIdentity.USE_WHEN_SENT_TO,{
name:"useWhenSentTo",soap:"zimbraPrefWhenSentToEnabled",type:ZmIdentity.BOOLEAN}
);
ZmIdentity.addField(ZmIdentity.WHEN_SENT_TO_ADDRESSES,{
name:"whenSentToAddresses",soap:"zimbraPrefWhenSentToAddresses",type:ZmIdentity.ARRAY}
);
ZmIdentity.addField(ZmIdentity.USE_WHEN_IN_FOLDER,{
name:"useWhenInFolder",soap:"zimbraPrefWhenInFoldersEnabled",type:ZmIdentity.BOOLEAN}
);
ZmIdentity.addField(ZmIdentity.WHEN_IN_FOLDERIDS,{
name:"whenInFolderIds",soap:"zimbraPrefWhenInFolderIds",type:ZmIdentity.ARRAY}
);
ZmIdentity.prototype.getField=function(e){
return this[ZmIdentity.FIELDS[e].name]
};
ZmIdentity.prototype.setField=function(e,t){
this[ZmIdentity.FIELDS[e].name]=t
};
ZmIdentity.prototype.create=function(o,t,e){
return this._doRequest("Create",this._handleCreateResponse,o,t,e)
};
ZmIdentity.prototype.save=function(o,t,e){
return this._doRequest("Modify",this._handleSaveResponse,o,t,e)
};
ZmIdentity.prototype.doDelete=function(o,t,e){
return this._doRequest("Delete",this._handleDeleteResponse,o,t,e)
};
ZmIdentity.prototype._doRequest=function(t,s,l,c,m){
var b=AjxSoapDoc.create(t+"IdentityRequest","urn:zimbraAccount");
var e=b.set("identity");
var w=this.isDefault?ZmIdentity.DEFAULT_NAME:this.name;
if(t!="Create"&&this.id!==""){
e.setAttribute("id",this.id)
}else{
e.setAttribute("name",this.name)
}
if(t!="Delete"){
for(var g in ZmIdentity.FIELDS){
var o=ZmIdentity.FIELDS[g];
if(this.hasOwnProperty(o.name)){
var f=this.getField(g);
if(o.type==ZmIdentity.ARRAY){
for(var p=0,d=f.length;
p<d;
p++){
if(f[p]){
var h=b.set("a",f[p],e);
h.setAttribute("name",o.soap)
}}}else{
if(o.type==ZmIdentity.BOOLEAN){
f=f?"TRUE":"FALSE"
}
var u=g==ZmIdentity.SIGNATURE;
var r=g==ZmIdentity.SEND_FROM_DISPLAY||g==ZmIdentity.SET_REPLY_TO_DISPLAY;
if(f||u||r){
var h=b.set("a",f,e);
h.setAttribute("name",o.soap)
}}}}}
var n=new AjxCallback(this,s,[l]);
if(m){
m.addNewRequestParams(b,n,c);
return
}
var y={
soapDoc:b,asyncMode:Boolean(l),callback:n,errorCallback:c};
return appCtxt.getAppController().sendRequest(y)
};
ZmIdentity.prototype._loadFromDom=function(n){
this.id=n.id;
var t=n._attrs;
if(t){
for(var e in t){
var s=ZmIdentity._SOAP[e];
if(s){
var o=t[e];
if(s.type==ZmIdentity.BOOLEAN){
this[s.name]=(o.toString().toUpperCase()=="TRUE")
}else{
if(s.type==ZmIdentity.ARRAY){
this[s.name]=AjxUtil.isArray(o)?o:[o]
}else{
this[s.name]=o
}}}}}
if(n.name){
if(n.name==ZmIdentity.DEFAULT_NAME){
this.isDefault=true;
this.name=ZmMsg.defaultIdentityName
}}};
ZmIdentity.prototype._handleCreateResponse=function(o,e,t){
this.id=t.identity[0].id;
delete this._new;
delete this._dirty;
appCtxt.getIdentityCollection().add(this);
if(o){
o.run(this,e)
}};
ZmIdentity.prototype._handleSaveResponse=function(s,e,o){
delete this._dirty;
var n=appCtxt.getIdentityCollection();
n.remove(this);
n.add(this);
var t=this.hasOwnProperty("name");
n.notifyModify(this,t);
if(s){
s.run(this,e)
}};
ZmIdentity.prototype._handleDeleteResponse=function(o,e,t){
appCtxt.getIdentityCollection().remove(this);
if(o){
o.run(this,e)
}}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmIdentityCollection")){
ZmIdentityCollection=function(){
ZmModel.call(this,ZmEvent.S_IDENTITY);
this.defaultIdentity=null;
this._initialized=false;
this._idToIdentity={};
this._addressToIdentity={};
this._folderToIdentity={};
this._size=0
};
ZmIdentityCollection.prototype=new ZmModel;
ZmIdentityCollection.prototype.constructor=ZmIdentityCollection;
ZmIdentityCollection.prototype.toString=function(){
return"ZmIdentityCollection"
};
ZmIdentityCollection.prototype.getSize=function(){
return this.getIdentities().length
};
ZmIdentityCollection.prototype.getIdentities=function(n){
var t,o=0,e=[],s=appCtxt.isOffline;
for(var r in this._idToIdentity){
t=this._idToIdentity[r];
if(s&&t.isFromDataSource){
continue
}
e[o++]=t
}
if(n){
e.sort(ZmIdentityCollection._comparator)
}
return e
};
ZmIdentityCollection.prototype.getById=function(e){
return this._idToIdentity[e]
};
ZmIdentityCollection.prototype.getByName=function(t){
t=t.toLowerCase();
for(var o in this._idToIdentity){
var e=this._idToIdentity[o];
if(e.name.toLowerCase()==t){
return e
}}
return null
};
ZmIdentityCollection.prototype.add=function(e){
if(!this._idToIdentity[e.id]){
this._idToIdentity[e.id]=e;
if(e.isDefault){
this.defaultIdentity=e
}
this._addToMaps(e);
this._size++;
this._notify(ZmEvent.E_CREATE,{
item:e}
)
}};
ZmIdentityCollection.prototype.remove=function(e){
if(this._idToIdentity[e.id]){
this._removeFromMaps(e);
delete this._idToIdentity[e.id];
this._size--;
this._notify(ZmEvent.E_DELETE,{
item:e}
)
}};
ZmIdentityCollection.prototype.selectIdentity=function(o,t){
if(!appCtxt.get(ZmSetting.IDENTITIES_ENABLED)||!o){
return this.defaultIdentity
}
if(t){
return this._selectIdentityFromAddresses(o,t)
}
var e=this._selectIdentityFromAddresses(o,AjxEmailAddress.TO);
if(e){
return e
}
e=this._selectIdentityFromAddresses(o,AjxEmailAddress.CC);
if(e){
return e
}
e=this._folderToIdentity[o.folderId];
if(e){
return e
}
if(o.isInvite()){
e=this._selectIdentityFromAttendees(o);
if(e){
return e
}}
return this.defaultIdentity
};
ZmIdentityCollection.prototype.initialize=function(s){
if(this._initialized||this.getSize()||!s){
return
}
var o=s.identity;
for(var t=0,n=o?o.length:0;
t<n;
t++){
var e=new ZmIdentity("");
e._loadFromDom(o[t]);
this.add(e)
}
this._initialized=true
};
ZmIdentityCollection.prototype.notifyModify=function(e,t){
this._notify(ZmEvent.E_MODIFY,{
item:e,rename:t}
)
};
ZmIdentityCollection.prototype._addToMaps=function(t){
if(t.useWhenSentTo){
var l=t.whenSentToAddresses;
for(var n=0,r=l.length;
n<r;
n++){
var e=l[n].toLowerCase();
this._addressToIdentity[e]=t
}}
if(t.useWhenInFolder){
var o=t.whenInFolderIds;
for(var n=0,r=o.length;
n<r;
n++){
var s=appCtxt.getById(o[n]);
if(s){
var h=s.getRemoteId();
this._folderToIdentity[h]=t
}}}};
ZmIdentityCollection.prototype._removeFromMaps=function(t){
for(var o=0,s=t.whenSentToAddresses.length;
o<s;
o++){
var e=t.whenSentToAddresses[o];
delete this._addressToIdentity[e]
}
for(var o=0,s=t.whenInFolderIds.length;
o<s;
o++){
var n=appCtxt.getById(t.whenInFolderIds[o]);
if(n){
var r=n.getRemoteId();
delete this._folderToIdentity[r]
}}};
ZmIdentityCollection._comparator=function(t,e){
if(t.isDefault){
return -1
}else{
if(e.isDefault){
return 1
}else{
return t.name==e.name?0:t.name<e.name?-1:1
}}};
ZmIdentityCollection.prototype._selectIdentityFromAddresses=function(r,n){
var t;
var h=r.getAddresses(n).getArray();
for(var o=0,s=h.length;
o<s;
o++){
var e=h[o].getAddress();
if(e){
t=this._addressToIdentity[e.toLowerCase()];
if(t){
return t
}}}
return null
};
ZmIdentityCollection.prototype._selectIdentityFromAttendees=function(r){
if(!r.isInvite()){
return null
}
var t;
var s=r.invite.getAttendees();
if(!s){
return null
}
for(var o=0,n=s.length;
o<n;
o++){
var e=s[o].url;
if(e){
t=this._addressToIdentity[e.toLowerCase()];
if(t){
return t
}}}
return null
};
ZmIdentityCollection.prototype.getIdentityBySendAddress=function(e){
for(var o in this._idToIdentity){
var t=this._idToIdentity[o];
if(t.sendFromAddress==e){
return t
}}
return null
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmDataSource")){
ZmDataSource=function(e,t){
if(arguments.length==0){
return
}
ZmAccount.call(this,e,t);
this.reset()
};
ZmDataSource.prototype=new ZmAccount;
ZmDataSource.prototype.constructor=ZmDataSource;
ZmDataSource.prototype.toString=function(){
return"ZmDataSource"
};
ZmDataSource.CONNECT_CLEAR="cleartext";
ZmDataSource.CONNECT_SSL="ssl";
ZmDataSource.CONNECT_DEFAULT=ZmDataSource.CONNECT_CLEAR;
ZmDataSource.POLL_NEVER="0";
ZmDataSource.DATASOURCE_ATTRS={
id:"id",name:"name",isEnabled:"enabled",emailAddress:"email",host:"mailServer",port:"port",username:"userName",password:"password",l:"folderId",connectionType:"connectionType",pollingInterval:"pollingInterval",leaveOnServer:"leaveOnServer"};
ZmDataSource.IDENTITY_ATTRS={
fromDisplay:"sendFromDisplay",fromAddress:"sendFromAddress",useAddressForForwardReply:"setReplyTo",replyToAddress:"setReplyToAddress",replyToDisplay:"setReplyToDisplay",defaultSignature:"signature"};
ZmDataSource.prototype.ELEMENT_NAME="dsrc";
ZmDataSource.prototype.enabled=true;
ZmDataSource.prototype.mailServer="";
ZmDataSource.prototype.userName="";
ZmDataSource.prototype.password="";
ZmDataSource.prototype.folderId=ZmOrganizer.ID_INBOX;
ZmDataSource.prototype.leaveOnServer=true;
ZmDataSource.prototype.connectionType=ZmDataSource.CONNECT_DEFAULT;
ZmDataSource.prototype.pollingInterval;
ZmDataSource.prototype.setEmail=function(e){
this.email=e
};
ZmDataSource.prototype.getEmail=function(){
var e=this.email!=null?this.email:this.identity.getField(ZmIdentity.SEND_FROM_ADDRESS);
if(!e){
var o=ZmDataSource.getProviderForAccount(this);
var t=(o&&o._host)||this.mailServer;
e="";
if(this.userName){
if(this.userName.match(/@/)){
e=this.userName
}else{
if(t){
e=[this.userName,t].join("@")
}}}}
return e
};
ZmDataSource.prototype.setFolderId=function(e){
if(e==-1&&this.folderId!=ZmOrganizer.ID_INBOX){
return
}
this.folderId=e
};
ZmDataSource.prototype.getFolderId=function(){
return this.folderId
};
ZmDataSource.prototype.getIdentity=function(){
return this.identity
};
ZmDataSource.prototype.create=function(c,s,t){
var l=AjxSoapDoc.create("CreateDataSourceRequest","urn:zimbraMail");
var u=l.set(this.ELEMENT_NAME);
for(var h in ZmDataSource.DATASOURCE_ATTRS){
var n=ZmDataSource.DATASOURCE_ATTRS[h];
var e=n=="folderId"?ZmOrganizer.normalizeId(this[n]):this[n];
if(n=="id"||(!e&&n!="enabled"&&n!="leaveOnServer")){
continue
}
u.setAttribute(h,String(e))
}
var r=this.getIdentity();
for(var h in ZmDataSource.IDENTITY_ATTRS){
var n=ZmDataSource.IDENTITY_ATTRS[h];
var e=r[n];
if(!e){
continue
}
u.setAttribute(h,String(e))
}
var d=new AjxCallback(this,this._handleCreateResponse,[c]);
if(t){
t.addNewRequestParams(l,d,s);
t.setSensitive(Boolean(this.password));
return
}
var o={
soapDoc:l,sensitive:Boolean(this.password),asyncMode:Boolean(c),callback:d,errorCallback:s};
return appCtxt.getAppController().sendRequest(o)
};
ZmDataSource.prototype.save=function(c,n,e){
var l=AjxSoapDoc.create("ModifyDataSourceRequest","urn:zimbraMail");
var u=l.set(this.ELEMENT_NAME);
u.setAttribute("id",this.id);
for(var h in ZmDataSource.DATASOURCE_ATTRS){
var o=ZmDataSource.DATASOURCE_ATTRS[h];
if(!this.hasOwnProperty(o)){
continue
}
var s=o=="folderId"?ZmOrganizer.normalizeId(this[o]):this[o];
u.setAttribute(h,String(s))
}
var r=this.getIdentity();
for(var h in ZmDataSource.IDENTITY_ATTRS){
var o=ZmDataSource.IDENTITY_ATTRS[h];
if(!r.hasOwnProperty(o)){
continue
}
var s=r[o];
u.setAttribute(h,String(s))
}
var d=new AjxCallback(this,this._handleSaveResponse,[c]);
if(e){
e.addNewRequestParams(l,d,n);
e.setSensitive(Boolean(this.password));
return
}
var t={
soapDoc:l,sensitive:Boolean(this.password),asyncMode:Boolean(c),callback:d,errorCallback:n};
return appCtxt.getAppController().sendRequest(t)
};
ZmDataSource.prototype.doDelete=function(h,e,n){
var t=AjxSoapDoc.create("DeleteDataSourceRequest","urn:zimbraMail");
var o=t.set(this.ELEMENT_NAME);
o.setAttribute("id",this.id);
var r=new AjxCallback(this,this._handleDeleteResponse,[h]);
if(n){
n.addNewRequestParams(t,r,e);
return
}
var s={
soapDoc:t,asyncMode:Boolean(h),callback:r,errorCallback:e};
return appCtxt.getAppController().sendRequest(s)
};
ZmDataSource.prototype.testConnection=function(d,s,e,l){
var h=AjxSoapDoc.create("TestDataSourceRequest","urn:zimbraMail");
var u=h.set(this.ELEMENT_NAME);
var c=["host","port","username","password","connectionType","leaveOnServer"];
for(var n=0;
n<c.length;
n++){
var r=c[n];
var o=ZmDataSource.DATASOURCE_ATTRS[r];
u.setAttribute(r,this[o])
}
if(e){
e.addNewRequestParams(h,d,s);
e.setSensitive(true);
return
}
var t={
soapDoc:h,sensitive:true,asyncMode:Boolean(d),noBusyOverlay:l,callback:d,errorCallback:s};
return appCtxt.getAppController().sendRequest(t)
};
ZmDataSource.prototype.getPort=function(){
return this.port||this.getDefaultPort()
};
ZmDataSource.prototype.isStatusOk=function(){
return this.enabled&&!this.failingSince
};
ZmDataSource.prototype.setFromJson=function(s){
if(s.failingSince){
this.failingSince=s.failingSince;
this.lastError=(s.lastError&&s.lastError[0]._content)||ZmMsg.unknownError
}else{
delete this.failingSince;
delete this.lastError
}
for(var o in ZmDataSource.DATASOURCE_ATTRS){
var e=s[o];
if(e==null){
continue
}
if(o=="isEnabled"||o=="leaveOnServer"){
e=e=="1"||String(e).toLowerCase()=="true"
}
var n=ZmDataSource.DATASOURCE_ATTRS[o];
this[n]=e
}
var t=this.getIdentity();
for(var o in ZmDataSource.IDENTITY_ATTRS){
var e=s[o];
if(e==null){
continue
}
if(o=="useAddressForForwardReply"){
e=e=="1"||String(e).toLowerCase()=="true"
}
var n=ZmDataSource.IDENTITY_ATTRS[o];
t[n]=e
}
this._setupIdentity()
};
ZmDataSource.prototype.reset=function(){
delete this.mailServer;
delete this.userName;
delete this.password;
delete this.folderId;
delete this.leaveOnServer;
delete this.connectionType;
delete this.pollingInterval;
this.email="";
this.port=this.getDefaultPort();
var e=this.identity=new ZmIdentity();
e.id=this.id;
e.isFromDataSource=true;
e.create=null;
e.save=null;
e.doDelete=null
};
ZmDataSource.prototype.getProvider=function(){
return ZmDataSource.getProviderForAccount(this)
};
ZmDataSource.addProvider=function(n){
var e=ZmDataSource.getProviders();
e[n.id]=n;
if(n.type){
n.type=n.type.toLowerCase()=="pop"?ZmAccount.TYPE_POP:ZmAccount.TYPE_IMAP
}else{
n.type=ZmAccount.TYPE_POP
}
if(n.connectionType){
var o=n.connectionType.toLowerCase()=="ssl";
n.connectionType=o?ZmDataSource.CONNECT_SSL:ZmDataSource.CONNECT_CLEAR
}else{
n.connectionType=ZmDataSource.CONNECT_CLEAR
}
if(!n.port){
var t=n.type==ZmAccount.TYPE_POP;
if(o){
n.port=t?ZmPopAccount.PORT_SSL:ZmImapAccount.PORT_SSL
}else{
n.port=t?ZmPopAccount.PORT_CLEAR:ZmImapAccount.PORT_CLEAR
}}};
ZmDataSource.getProviders=function(){
if(!ZmDataSource._providers){
ZmDataSource._providers={}
}
return ZmDataSource._providers
};
ZmDataSource.getProviderForAccount=function(e){
return ZmDataSource.getProviderForHost(e.mailServer)
};
ZmDataSource.getProviderForHost=function(t){
var e=ZmDataSource.getProviders();
for(var n in e){
hasProviders=true;
var o=e[n];
if(o.host==t){
return o
}}
return null
};
ZmDataSource.removeAllProviders=function(){
delete ZmDataSource._providers
};
ZmDataSource.prototype._setupIdentity=function(){
this.identity.useWhenSentTo=true;
this.identity.whenSentToAddresses=[this.getEmail()];
this.identity.name=this.name
};
ZmDataSource.prototype._loadFromDom=function(e){
this.setFromJson(e)
};
ZmDataSource.prototype._handleCreateResponse=function(m,f){
var r=f._data.CreateDataSourceResponse;
this.id=r[this.ELEMENT_NAME][0].id;
this.identity.id=this.id;
this._setupIdentity();
delete this._new;
delete this._dirty;
appCtxt.getDataSourceCollection().add(this);
var e=[ZmApp.MAIL,ZmApp.PORTAL];
for(var h=0;
h<e.length;
h++){
var t=appCtxt.getApp(e[h]);
if(t){
var s=t.getOverviewId();
var o=appCtxt.getOverviewController().getTreeView(s,ZmOrganizer.FOLDER);
var n=appCtxt.getActiveAccount().isMain?this.folderId:ZmOrganizer.getSystemId(this.folderId);
var c=o?o.getTreeItemById(n):null;
if(c){
if(this.type==ZmAccount.TYPE_POP&&this.folderId!=ZmFolder.ID_INBOX){
c.setImage("POPAccount")
}else{
if(this.type==ZmAccount.TYPE_IMAP){
c.dispose();
var u=ZmOrganizer.getSystemId(ZmOrganizer.ID_ROOT);
var l=o.getTreeItemById(u);
var d=appCtxt.getById(this.folderId);
o._addNew(l,d)
}}}}}
if(m){
m.run()
}};
ZmDataSource.prototype._handleSaveResponse=function(o,e){
delete this._dirty;
var t=appCtxt.getDataSourceCollection();
t.remove(this);
t.add(this);
if(o){
o.run()
}};
ZmDataSource.prototype._handleDeleteResponse=function(l,o){
appCtxt.getDataSourceCollection().remove(this);
var h=appCtxt.getApp(ZmApp.MAIL).getOverviewId();
var n=appCtxt.getOverviewController().getTreeView(h,ZmOrganizer.FOLDER);
var r=appCtxt.getActiveAccount().isMain?this.folderId:ZmOrganizer.getSystemId(this.folderId);
if(this.folderId==ZmAccountsPage.DOWNLOAD_TO_FOLDER&&this._object_&&this._object_.folderId){
r=this._object_.folderId
}
var s=n?n.getTreeItemById(r):null;
if(s){
if(this.type==ZmAccount.TYPE_POP&&this.folderId!=ZmFolder.ID_INBOX){
s.setImage("Folder")
}else{
if(this.type==ZmAccount.TYPE_IMAP){
s.dispose();
var t=n.getTreeItemById(ZmOrganizer.ID_ROOT);
var e=appCtxt.getById(r);
if(e){
n._addNew(t,e)
}}}}
if(l){
l.run()
}}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmDataSourceCollection")){
ZmDataSourceCollection=function(){
ZmModel.call(this,ZmEvent.S_DATA_SOURCE);
this._initialized=false;
this._itemMap={};
this._pop3Map={};
this._imapMap={}
};
ZmDataSourceCollection.prototype=new ZmModel;
ZmDataSourceCollection.prototype.constructor=ZmDataSourceCollection;
ZmDataSourceCollection.prototype.getItems=function(){
return AjxUtil.values(this._itemMap)
};
ZmDataSourceCollection.prototype.getItemsFor=function(e){
var t=[];
for(var n in this._itemMap){
var o=this._itemMap[n];
if(o.folderId==e&&o.enabled){
t.push(o)
}}
return t
};
ZmDataSourceCollection.prototype.getPopAccounts=function(){
return AjxUtil.values(this._pop3Map)
};
ZmDataSourceCollection.prototype.getImapAccounts=function(){
return AjxUtil.values(this._imapMap)
};
ZmDataSourceCollection.prototype.getPopAccountsFor=function(e){
var t=[];
for(var n in this._pop3Map){
var o=this._pop3Map[n];
if(o.folderId==e&&o.enabled){
t.push(o)
}}
return t
};
ZmDataSourceCollection.prototype.getImapAccountsFor=function(e){
var t=[];
for(var n in this._imapMap){
var o=this._imapMap[n];
if(o.folderId==e&&o.enabled){
t.push(o)
}}
return t
};
ZmDataSourceCollection.prototype.importMailFor=function(e){
this.importMail(this.getItemsFor(e))
};
ZmDataSourceCollection.prototype.importPopMailFor=function(e){
this.importMail(this.getPopAccountsFor(e))
};
ZmDataSourceCollection.prototype.importImapMailFor=function(e){
this.importMail(this.getImapAccountsFor(e))
};
ZmDataSourceCollection.prototype.importMail=function(e){
if(e&&e.length>0){
var s={};
var h=AjxSoapDoc.create("ImportDataRequest","urn:zimbraMail");
for(var n=0;
n<e.length;
n++){
var r=e[n];
s[r.id]=r;
var l=h.set(r.ELEMENT_NAME);
l.setAttribute("id",r.id)
}
var o={
soapDoc:h,asyncMode:true,noBusyOverlay:true,callback:null,errorCallback:null};
appCtxt.getAppController().sendRequest(o);
var c=2000;
var t=new AjxTimedAction(this,this._checkStatus,[s,c]);
AjxTimedAction.scheduleAction(t,c)
}};
ZmDataSourceCollection.prototype.getById=function(e){
return this._itemMap[e]
};
ZmDataSourceCollection.prototype.getByFolderId=function(e,t){
var n=[];
for(var s in this._itemMap){
var o=this._itemMap[s];
if(o.folderId==e){
if(!t||(t&&t==o.type)){
n.push(o)
}}}
return n
};
ZmDataSourceCollection.prototype.add=function(e){
this._itemMap[e.id]=e;
if(e.type==ZmAccount.TYPE_POP){
this._pop3Map[e.id]=e
}else{
if(e.type==ZmAccount.TYPE_IMAP){
this._imapMap[e.id]=e
}}
appCtxt.getIdentityCollection().add(e.getIdentity());
this._notify(ZmEvent.E_CREATE,{
item:e}
)
};
ZmDataSourceCollection.prototype.modify=function(e){
appCtxt.getIdentityCollection().notifyModify(e.getIdentity(),true);
this._notify(ZmEvent.E_MODIFY,{
item:e}
)
};
ZmDataSourceCollection.prototype.remove=function(e){
delete this._itemMap[e.id];
delete this._pop3Map[e.id];
delete this._imapMap[e.id];
appCtxt.getIdentityCollection().remove(e.getIdentity());
this._notify(ZmEvent.E_DELETE,{
item:e}
)
};
ZmDataSourceCollection.prototype.initialize=function(e){
if(!e||this._initialized){
return
}
var g=[];
if(appCtxt.get(ZmSetting.POP_ACCOUNTS_ENABLED)){
var r=e.pop3||[];
for(var h=0;
h<r.length;
h++){
var n=r[h];
var t=new ZmPopAccount(n.id);
t.setFromJson(n);
this.add(t);
if(!t.isStatusOk()){
g.push(t)
}}}
if(appCtxt.get(ZmSetting.IMAP_ACCOUNTS_ENABLED)){
var s=e.imap||[];
for(var h=0;
h<s.length;
h++){
var n=s[h];
var t=new ZmImapAccount(n.id);
t.setFromJson(n);
this.add(t);
if(!t.isStatusOk()){
g.push(t)
}}}
this._initialized=true;
var c=g.length;
if(c>0){
var u=[AjxMessageFormat.format(ZmMsg.dataSourceFailureDescription,[c])];
for(var h=0;
h<c;
h++){
var t=g[h];
var d=Number(t.failingSince);
var p=t.lastError;
if(isNaN(d)){
var f=ZmMsg.dataSourceFailureItem_noDate;
var o=[AjxStringUtil.htmlEncode(t.getName()),AjxStringUtil.htmlEncode(p)]
}else{
var f=ZmMsg.dataSourceFailureItem;
var o=[AjxStringUtil.htmlEncode(t.getName()),new Date(d*1000),AjxStringUtil.htmlEncode(p)]
}
u.push(AjxMessageFormat.format(f,o))
}
u.push(ZmMsg.dataSourceFailureInstructions);
var y=u.join("");
var l=DwtShell.getShell(window);
var m=new DwtMessageDialog({
parent:l,buttons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]}
);
m.setMessage(y,DwtMessageDialog.CRITICAL_STYLE,ZmMsg.dataSourceFailureTitle);
m.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this.__handleErrorDialogOk,[m]));
m.popup()
}};
ZmDataSourceCollection.prototype.__handleErrorDialogOk=function(e){
e.popdown();
var t=new AjxCallback(this,this.__gotoPrefSection,["ACCOUNTS"]);
appCtxt.getAppController().activateApp(ZmApp.PREFERENCES,true,t)
};
ZmDataSourceCollection.prototype.__gotoPrefSection=function(t){
var e=appCtxt.getApp(ZmApp.PREFERENCES).getPrefController();
e.getPrefsView().selectSection(t)
};
ZmDataSourceCollection.prototype._checkStatus=function(r,t){
if(t&&t<15000){
t+=2000
}
var e=AjxSoapDoc.create("GetImportStatusRequest","urn:zimbraMail");
var h=new AjxCallback(this,this._checkStatusResponse,[r,t]);
var s={
soapDoc:e,asyncMode:true,callback:h,errorCallback:null};
var n=appCtxt.getAppController();
var o=new AjxTimedAction(n,n.sendRequest,[s]);
AjxTimedAction.scheduleAction(o,t||2000)
};
ZmDataSourceCollection.prototype._checkStatusResponse=function(n,u,m){
var t=[];
var s=m._data.GetImportStatusResponse.pop3;
if(s){
for(var o in s){
t.push(s[o])
}}
var h=m._data.GetImportStatusResponse.imap;
if(h){
for(var o in h){
t.push(h[o])
}}
var d=m._data.GetImportStatusResponse.dsrc;
if(d){
for(var o in d){
t.push(d[o])
}}
if(t.length==0){
return
}
for(var o=0;
o<t.length;
o++){
var l=t[o];
if(!l.isRunning&&n[l.id]){
var e=n[l.id];
if(n[l.id]){
delete n[l.id];
if(l.success){
var c=AjxMessageFormat.format(ZmMsg.dataSourceLoadSuccess,e.name);
appCtxt.setStatusMsg(c)
}else{
var c=AjxMessageFormat.format(ZmMsg.dataSourceLoadFailure,e.name);
appCtxt.setStatusMsg(c,ZmStatusView.LEVEL_CRITICAL);
var r=appCtxt.getErrorDialog();
r.setMessage(c,l.error,DwtMessageDialog.CRITICAL_STYLE);
r.popup()
}}}}
if(AjxUtil.keys(n).length>0){
this._checkStatus(n,u)
}}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmPopAccount")){
ZmPopAccount=function(e){
ZmDataSource.call(this,ZmAccount.TYPE_POP,e)
};
ZmPopAccount.prototype=new ZmDataSource;
ZmPopAccount.prototype.constructor=ZmPopAccount;
ZmPopAccount.PORT_CLEAR=110;
ZmPopAccount.PORT_SSL=995;
ZmPopAccount.PORT_DEFAULT=ZmPopAccount.PORT_CLEAR;
ZmPopAccount.prototype.ELEMENT_NAME="pop3";
ZmPopAccount.prototype.port=ZmPopAccount.PORT_DEFAULT;
ZmPopAccount.prototype.toString=function(){
return"ZmPopAccount"
};
ZmPopAccount.prototype.getDefaultPort=function(){
return(this.connectionType==ZmDataSource.CONNECT_SSL)?ZmPopAccount.PORT_SSL:ZmPopAccount.PORT_DEFAULT
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmImapAccount")){
ZmImapAccount=function(e){
ZmDataSource.call(this,ZmAccount.TYPE_IMAP,e)
};
ZmImapAccount.prototype=new ZmDataSource;
ZmImapAccount.prototype.constructor=ZmImapAccount;
ZmImapAccount.PORT_CLEAR=143;
ZmImapAccount.PORT_SSL=993;
ZmImapAccount.PORT_DEFAULT=ZmImapAccount.PORT_CLEAR;
ZmImapAccount.prototype.ELEMENT_NAME="imap";
ZmImapAccount.prototype.port=ZmImapAccount.PORT_DEFAULT;
ZmImapAccount.prototype.toString=function(){
return"ZmImapAccount"
};
ZmImapAccount.prototype.getDefaultPort=function(){
return(this.connectionType==ZmDataSource.CONNECT_SSL)?ZmImapAccount.PORT_SSL:ZmImapAccount.PORT_DEFAULT
};
ZmImapAccount.sortCompare=function(s,n){
var e=ZmOrganizer.checkSortArgs(s,n);
if(e!=null){
return e
}
var o=ZmFolder.getIdForName(s.name);
var t=ZmFolder.getIdForName(n.name);
if(ZmFolder.SORT_ORDER[o]&&ZmFolder.SORT_ORDER[t]){
return(ZmFolder.SORT_ORDER[o]-ZmFolder.SORT_ORDER[t])
}
if(!ZmFolder.SORT_ORDER[o]&&ZmFolder.SORT_ORDER[t]){
return 1
}
if(ZmFolder.SORT_ORDER[o]&&!ZmFolder.SORT_ORDER[t]){
return -1
}
if(s.name.toLowerCase()>n.name.toLowerCase()){
return 1
}
if(s.name.toLowerCase()<n.name.toLowerCase()){
return -1
}
return 0
}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmSignature")){
ZmSignature=function(e){
this.id=e
};
ZmSignature.prototype.toString=function(){
return"ZmSignature"
};
ZmSignature.prototype.name="";
ZmSignature.prototype.contentType=ZmMimeTable.TEXT_PLAIN;
ZmSignature.prototype.value="";
ZmSignature.createFromJson=function(t){
var e=new ZmSignature(t.id);
e.setFromJson(t);
return e
};
ZmSignature.prototype.create=function(s,t,e){
var n=s?new AjxCallback(this,this._handleCreateResponse,[s]):null;
var o=this._sendRequest("CreateSignatureRequest",false,n,t,e);
if(!s&&!e){
this._handleCreateResponse(s,o)
}};
ZmSignature.prototype.save=function(s,t,e){
var n=s?new AjxCallback(this,this._handleModifyResponse,[s]):null;
var o=this._sendRequest("ModifySignatureRequest",false,n,t,e);
if(!s&&!e){
this._handleModifyResponse(s,o)
}};
ZmSignature.prototype.doDelete=function(s,t,e){
var n=s?new AjxCallback(this,this._handleDeleteResponse,[s]):null;
var o=this._sendRequest("DeleteSignatureRequest",true,n,t,e);
if(!s&&!e){
this._handleDeleteResponse(s,o)
}};
ZmSignature.prototype.setFromJson=function(e){
this.name=e.name||this.name;
if(e.content){
var t=(e.content[0]._content==""&&e.content[1]._content!="")?e.content[1]:e.content[0]
}
if(t){
this.contentType=t.type||this.contentType;
this.value=t._content!=null?t._content:this.value
}};
ZmSignature.prototype.getContentType=function(){
return this.contentType
};
ZmSignature.prototype.setContentType=function(e){
this.contentType=e||ZmMimeTable.TEXT_PLAIN
};
ZmSignature.prototype.getValue=function(n){
var t=this.contentType==ZmMimeTable.TEXT_HTML;
var o=this.value;
var e=n||this.contentType;
if(e!=this.contentType){
o=t?AjxStringUtil.convertHtml2Text(o):AjxStringUtil.convertToHtml(o)
}
return o
};
ZmSignature.prototype._sendRequest=function(t,u,d,h,n){
var l=AjxSoapDoc.create(t,"urn:zimbraAccount");
var r=l.set("signature");
if(this.id){
r.setAttribute("id",this.id)
}
if(!u){
r.setAttribute("name",this.name);
var o=l.set("content",this.value,r);
o.setAttribute("type",this.contentType);
var e=(this.contentType==ZmMimeTable.TEXT_HTML)?ZmMimeTable.TEXT_PLAIN:ZmMimeTable.TEXT_HTML;
o=l.set("content","",r);
o.setAttribute("type",e)
}
if(n){
n.addNewRequestParams(l,d,h);
return
}
var c=appCtxt.getAppController();
var s={
soapDoc:l,asyncMode:Boolean(d),callback:d,errorCallback:h};
return c.sendRequest(s)
};
ZmSignature.prototype._handleCreateResponse=function(o,t){
this.id=t._data.CreateSignatureResponse.signature[0].id;
var e=appCtxt.getSignatureCollection();
e.add(this);
if(o){
o.run()
}};
ZmSignature.prototype._handleModifyResponse=function(n,o){
var t=appCtxt.getSignatureCollection();
var e=t.getById(this.id);
e.name=this.name;
e.value=this.value;
e.contentType=this.contentType;
t._notify(ZmEvent.E_MODIFY,{
item:e}
);
if(n){
n.run()
}};
ZmSignature.prototype._handleDeleteResponse=function(o,t){
var e=appCtxt.getSignatureCollection();
e.remove(this);
if(o){
o.run()
}}
}
if(AjxPackage.define("zimbraMail.mail.model.ZmSignatureCollection")){
ZmSignatureCollection=function(){
ZmModel.call(this,ZmEvent.S_SIGNATURE);
this._idMap={};
this._nameMap={};
this._size=0
};
ZmSignatureCollection.prototype=new ZmModel;
ZmSignatureCollection.prototype.constructor=ZmSignatureCollection;
ZmSignatureCollection.prototype.toString=function(){
return"ZmSignatureCollection"
};
ZmSignatureCollection.prototype.add=function(e){
if(!this._idMap[e.id]){
this._idMap[e.id]=e;
this._nameMap[e.name]=e;
this._size++;
this._notify(ZmEvent.E_CREATE,{
item:e}
)
}};
ZmSignatureCollection.prototype.remove=function(e){
if(this._idMap[e.id]){
delete this._idMap[e.id];
delete this._nameMap[e.name];
this._size--;
this._notify(ZmEvent.E_DELETE,{
item:e}
)
}};
ZmSignatureCollection.prototype.getSize=function(){
return this._size
};
ZmSignatureCollection.prototype.getSignatures=function(){
return AjxUtil.values(this._idMap)
};
ZmSignatureCollection.prototype.getSignatureOptions=function(){
var n=[];
for(var s in this._idMap){
n.push(this._idMap[s])
}
n.sort(ZmSignatureCollection.BY_NAME);
var t=[];
for(var o=0;
o<n.length;
o++){
var e=n[o];
t.push(new DwtSelectOptionData(e.id,e.name))
}
t.push(new DwtSelectOptionData("",ZmMsg.signatureDoNotAttach));
return t
};
ZmSignatureCollection.prototype.getById=function(e){
return this._idMap[e]
};
ZmSignatureCollection.prototype.getByName=function(t){
var e=t.toLowerCase();
for(var o in this._nameMap){
if(o.toLowerCase()==e){
return this._nameMap[o]
}}};
ZmSignatureCollection.prototype.initialize=function(o){
if(this._size){
return
}
var n=o.signature;
if(!n){
return
}
for(var t=0;
t<n.length;
t++){
var e=ZmSignature.createFromJson(n[t]);
this.add(e)
}};
ZmSignatureCollection.BY_NAME=function(t,e){
return t.name.localeCompare(e.name)
}
}}
if(AjxPackage.define("mail.Message")){
AjxTemplate.register("mail.Message#MessageHeader",function(t,h,r,e){
var s=Boolean(e);
r=(typeof r=="string"?{
id:r}
:r)||{};
e=e||[];
var n=e.length;
e[n++]="<div><!-- empty container DIV here so Dwt.parseHtmlFragment returns the infoBar div below --><table class='MsgHeaderTable' id='";
e[n++]=r.id;
e[n++]="_headerElement'cellspacing=0 cellpadding=0 border=0 width=100%><tr><td><table cellspacing=0 cellpadding=0 border=0 width=100%><tr id='";
e[n++]=r.hdrTableTopRowId;
e[n++]="'>";
if(r.closeBtnCellId){
e[n++]="<td>&nbsp;</td><td id='";
e[n++]=r.closeBtnCellId;
e[n++]="'></td><td>&nbsp;</td>"
}
if(r.isSyncFailureMsg){
e[n++]="<td>&nbsp;</td><td id='";
e[n++]=r.reportBtnCellId;
e[n++]="'></td><td>&nbsp;</td>"
}
e[n++]="<td class='LabelColValue SubjectCol' valign=top width=100%>";
e[n++]=r.subject;
e[n++]="</td><td class='LabelColValue DateCol' align=right>";
e[n++]=r.dateString;
e[n++]="</td><td>&nbsp;</td></tr></table><table id='";
e[n++]=r.hdrTableId;
e[n++]="' cellspacing=0 cellpadding=1 border=0>";
if(r.inviteMessage){
e[n++]="<tr><td class='LabelColValue' colspan=11><table border=0 cellpadding=1 cellspacing=0 width=\"100%\"><tr><td width=20>";
e[n++]=AjxImg.getImageHtml("Information");
e[n++]='</td><td width="99%">';
e[n++]=r.inviteMessage;
e[n++]="</td></tr></table></td></tr>"
}
e[n++]="<tr id='";
e[n++]=r.expandRowId;
e[n++]="'><td><table align=right border=0 cellpadding=0 cellspacing=0><tr><td valign=top id='";
e[n++]=r.expandHeaderId;
e[n++]="' class='arrowbtn'></td><td class='LabelColName'>";
e[n++]=ZmMsg.fromLabel;
e[n++]="</td></tr></table></td><td class='LabelColValue' valign=top colspan=10><table border=0 cellpadding=0 cellspacing=0><tr>";
if(r.sentByIcon){
e[n++]='<td valign=top><a href="javascript:;" onclick="ZmMailMsgView.contactIconCallback(\'';
e[n++]=AjxStringUtil.xmlAttrEncode(r.sentByNormal);
e[n++]="', '";
e[n++]=r.sentByIcon;
e[n++]="'); return false;\">";
e[n++]=AjxImg.getImageHtml(r.sentByIcon,"cursor:pointer");
e[n++]="</a></td><td>&nbsp;</td>"
}
e[n++]="<td>";
e[n++]=r.sentBy;
e[n++]="&nbsp;&nbsp;</td></tr></table></td></tr>";
if(r.obo&&(AjxStringUtil.stripTags(r.obo)!=AjxStringUtil.stripTags(r.sentBy))){
e[n++]="<tr><td valign='top' class='LabelColName'>";
e[n++]=ZmMsg.onBehalfOfLabel;
e[n++]="</td><td class='LabelColValue' colspan=10>";
e[n++]=r.obo;
e[n++]="</td></tr>"
}
for(var o=0;
o<r.participants.length;
o++){
e[n++]="<tr><td class='LabelColName'>";
e[n++]=AjxMessageFormat.format(ZmMsg.makeLabel,r.participants[o].prefix);
e[n++]="</td><td class='LabelColValue' colspan='10'>";
e[n++]=r.participants[o].partStr;
e[n++]="</td></tr>"
}
for(var o=0;
o<r.additionalHdrs.length;
o++){
e[n++]="<tr><td valign='top' class='LabelColName'>";
e[n++]=r.additionalHdrs[o].hdrName;
e[n++]="</td><td class='LabelColValue' colspan='10'>";
e[n++]=r.additionalHdrs[o].hdrVal;
e[n++]="</td></tr>"
}
e[n++]="</table>";
if(r.hasAttachments){
e[n++]='<div class="MessageHeaderAttachments" id="';
e[n++]=r.attachId;
e[n++]='_container"><div id="';
e[n++]=r.attachId;
e[n++]="\" style='overflow:auto;'></div></div>"
}
e[n++]="</td><td id='";
e[n++]=r.id;
e[n++]="_contactArea' class='ContactArea'><!-- Area reserved zimlets to add to message views. --></td></tr></table><div id='";
e[n++]=r.infoBarId;
e[n++]="'></div></div>";
return s?e.length:e.join("")
}
,{
id:"mail.Message#MessageHeader"}
,false);
AjxTemplate.register("mail.Message",AjxTemplate.getTemplate("mail.Message#MessageHeader"),AjxTemplate.getParams("mail.Message#MessageHeader"));
AjxTemplate.register("mail.Message#AttachmentsView",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<table border='0' width='100%' height='100%'><tr><td width='20%'><div id='";
e[o++]=s.id;
e[o++]="_filters'></div></td><td><div id='";
e[o++]=s.id;
e[o++]="_results'>Loading...</div></td></tr></table>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#AttachmentsView"}
,false);
AjxTemplate.register("mail.Message#MessageListHeader",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<table border=0 class='SubjectBar' width=100%><tr><td id='";
e[o++]=s.id;
e[o++]="_closeBtnCell'></td><td></td><td width=15>";
e[o++]=AjxImg.getImageHtml("ConversationView");
e[o++]="</td><td width=99%><div class='Subject' id='";
e[o++]=s.id;
e[o++]="_subjDiv'></div></td></tr>";
if(s.tagDivId){
e[o++]="<tr><td colspan=4><div class='Tags' id='";
e[o++]=s.id;
e[o++]="_tagDiv'></div></td></tr>"
}
e[o++]="</table>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#MessageListHeader"}
,false);
AjxTemplate.register("mail.Message#InformationBar",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<div class='DisplayImages' id='";
e[o++]=s.id;
e[o++]="'><table width='100%' cellspacing=0 cellpadding=0><tr><td style='width:20px'>";
e[o++]=AjxImg.getImageHtml("Status");
e[o++]="</td><td>";
e[o++]=s.text;
e[o++]=" <span id='";
e[o++]=s.id;
e[o++]="_link' style='font:inherit; color:blue; text-decoration:underline'>";
e[o++]=s.link;
e[o++]="</span></td></tr></table></div>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#InformationBar"}
,false);
AjxTemplate.register("mail.Message#AllAttachments",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<table border=0 cellspacing=0 style='margin:5px 0px 1px 0px'>";
if(s.viewAllUrl){
e[o++]="<tr><td style='width:18px'>";
e[o++]=AjxImg.getImageHtml("ViewAll","position:relative;");
e[o++]="</td><td style='white-space:nowrap'><a style='text-decoration:underline' class='AttLink' href='";
e[o++]=s.viewAllUrl;
e[o++]='\' target="_blank">';
e[o++]=ZmMsg.viewAllImages;
e[o++]="</a></td></tr>"
}
e[o++]="<tr><td style='width:18px'>";
e[o++]=AjxImg.getImageHtml(ZmMimeTable.getInfo(ZmMimeTable.APP_ZIP).image,"position:relative;");
e[o++]="</td><td style='white-space:nowrap'><a style='text-decoration:underline' class='AttLink' onclick='ZmZimbraMail.unloadHackCallback();' href='";
e[o++]=s.url;
e[o++]="&disp=a&fmt=zip'>";
e[o++]=ZmMsg.downloadAll;
e[o++]="</a></td></tr><tr><td style='width:18px'>";
e[o++]=AjxImg.getImageHtml("AttachmentRemove","position:relative;");
e[o++]="</td><td style='white-space:nowrap'><a style='text-decoration:underline' class='AttLink' onclick='ZmMailMsgView.removeAttachmentCallback(\"";
e[o++]=s.itemId;
e[o++]='", "';
e[o++]=s.partIds;
e[o++]="\");' href='javascript:;'>";
e[o++]=ZmMsg.removeAllAttachments;
e[o++]="</a></td></tr></table>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#AllAttachments"}
,false);
AjxTemplate.register("mail.Message#Compose",function(o,l,r,t){
var s=Boolean(t);
r=(typeof r=="string"?{
id:r}
:r)||{};
t=t||[];
var n=t.length;
var e="width:"+(AjxEnv.isIE?60:64)+"px; overflow:visible; white-space:nowrap";
var h=AjxEnv.isSafari&&!AjxEnv.isSafariNightly?"height:52px;":"height:21px; overflow:hidden";
t[n++]="<!-- header --><table id='";
t[n++]=r.headerId;
t[n++]="' border=0 cellpadding=2 cellspacing=2 width=100%>";
if(appCtxt.multiAccounts){
t[n++]="<tr><td align=right valign=top style='";
t[n++]=e;
t[n++]="'>";
t[n++]=ZmMsg.fromLabel;
t[n++]="</td><td width='96%' colspan=2><div id='";
t[n++]=r.fromSelectId;
t[n++]="'></div></td></tr>"
}else{
t[n++]="<tr id='";
t[n++]=r.identityRowId;
t[n++]="' style='display:none;'><td align=right style='";
t[n++]=e;
t[n++]="'>";
t[n++]=ZmMsg.fromLabel;
t[n++]='</td><td width="96%" colspan=2><div id=\'';
t[n++]=r.identitySelectId;
t[n++]="'></div></td></tr>"
}
t[n++]="<tr id='";
t[n++]=r.toRowId;
t[n++]="'><td align=right valign=top style='";
t[n++]=e;
t[n++]="'><div id='";
t[n++]=r.toPickerId;
t[n++]="'>";
t[n++]=ZmMsg.toLabel;
t[n++]="</div></td><td width='96%' colspan=2><textarea id='";
t[n++]=r.toInputId;
t[n++]="' class='addresses' style='";
t[n++]=h;
t[n++]="' rows=1></textarea></td></tr><tr id='";
t[n++]=r.ccRowId;
t[n++]="' style='display:none;'><td align=right valign=top style='";
t[n++]=e;
t[n++]="'><div id='";
t[n++]=r.ccPickerId;
t[n++]="'>";
t[n++]=ZmMsg.ccLabel;
t[n++]="</div></td><td><textarea id='";
t[n++]=r.ccInputId;
t[n++]="' class='addresses' style='";
t[n++]=h;
t[n++]="' rows=1></textarea></td><td width='5%'><nobr><a href='#' id='";
t[n++]=r.bccToggleId;
t[n++]="'>";
t[n++]=ZmMsg.showBCC;
t[n++]="</a></nobr></td></tr><tr id='";
t[n++]=r.bccRowId;
t[n++]="' style='display:none;'><td align=right valign=top style='";
t[n++]=e;
t[n++]="'><div id='";
t[n++]=r.bccPickerId;
t[n++]="'>";
t[n++]=ZmMsg.bccLabel;
t[n++]="</div></td><td colspan='2'><textarea id='";
t[n++]=r.bccInputId;
t[n++]="' class='addresses' style='";
t[n++]=h;
t[n++]="' rows=1></textarea></td></tr><tr id='";
t[n++]=r.subjectRowId;
t[n++]="'><td align=right style='";
t[n++]=e;
t[n++]="'>";
t[n++]=ZmMsg.subjectLabel;
t[n++]="</td><td colspan='2'><table border=0 cellpadding=0 cellspacing=0 width='100%'><tr><td style='padding-right:4px;'><input id='";
t[n++]=r.subjectInputId;
t[n++]="' class='subjectField' autocomplete=off></td>";
if(appCtxt.get(ZmSetting.MAIL_PRIORITY_ENABLED)){
t[n++]="<td nowrap width='1%'><table border=0 cellspacing=0 cellpadding=0><tr><td align=right style='";
t[n++]=e;
t[n++]='\' nowrap="nowrap">';
t[n++]=ZmMsg.priorityLabel;
t[n++]='&nbsp;</td><td id="';
t[n++]=r.priorityId;
t[n++]='"></td></tr></table></td>'
}
t[n++]="</tr></table></td></tr><tr id='";
t[n++]=r.oboRowId;
t[n++]="' style='display:none;'><td align=right><input type='checkbox' id='";
t[n++]=r.oboCheckboxId;
t[n++]="'></td><td colspan=2><div id='";
t[n++]=r.oboLabelId;
t[n++]="'></div></td></tr><tr id='";
t[n++]=r.attRowId;
t[n++]="'><td colspan=3><div id='";
t[n++]=r.attDivId;
t[n++]="'></div></td></tr><tr><td colspan=10><div id='";
t[n++]=r.zdndToolTipId;
t[n++]="' class='zdnd_tooltip'>";
t[n++]=ZmMsg.dndTooltip;
t[n++]="</div></td></tr></table><!-- compose editor is automatically appended below the header -->";
return s?t.length:t.join("")
}
,{
id:"mail.Message#Compose"}
,false);
AjxTemplate.register("mail.Message#ForwardMessages",function(t,l,h,e){
var r=Boolean(e);
h=(typeof h=="string"?{
id:h}
:h)||{};
e=e||[];
var s=e.length;
e[s++]="<table cellspacing=0 cellpadding=0 border=0 width=100%>";
for(var o=0;
o<h.messages.length;
o++){
var n=h.messages[o];
e[s++]="<tr><td width=65 align=right><div class='ImgMessage'></div></td><td width=1%><input value='";
e[s++]=n.id;
e[s++]="' name='";
e[s++]=h.fwdFieldName;
e[s++]="' type='checkbox' checked></td><td class='nobreak'></td><td><b>";
e[s++]=n.subject||AjxStringUtil.htmlEncode(ZmMsg.noSubject);
e[s++]="</b>&nbsp;\n";
e[s++]="\t\t\t\t<span class='ZmConvListFragment'>";
e[s++]=n.getFragment(35);
e[s++]="</span></td></tr>"
}
e[s++]="</table>";
return r?e.length:e.join("")
}
,{
id:"mail.Message#ForwardMessages"}
,false);
AjxTemplate.register("mail.Message#ForwardOneMessage",function(t,h,r,e){
var s=Boolean(e);
r=(typeof r=="string"?{
id:r}
:r)||{};
e=e||[];
var n=e.length;
var o=r.message;
e[n++]="<table cellspacing=4 cellpadding=0 border=0 width=100%><tr><td width=60 align=right><div class='ImgAttachment'></div></td><td><b>";
e[n++]=(o?o.subject:null)||AjxStringUtil.htmlEncode(ZmMsg.noSubject);
e[n++]="</b></td></tr></table>";
return s?e.length:e.join("")
}
,{
id:"mail.Message#ForwardOneMessage"}
,false);
AjxTemplate.register("mail.Message#ForwardAttachments",function(e,o,h,r){
var n=Boolean(r);
h=(typeof h=="string"?{
id:h}
:h)||{};
r=r||[];
var s=r.length;
r[s++]="<table cellspacing=0 cellpadding=0 border=0 width=100%>";
for(var l=0;
l<h.attachments.length;
l++){
var c=h.attachments[l];
r[s++]="<tr><td width=65 align=right>";
if(l==0){
r[s++]="<div class='ImgAttachment'></div>"
}
r[s++]="</td><td width=1%>";
if(!h.isNew){
var t=h.isForward||h.isForwardInline||h.isDraft;
r[s++]="<input type='checkbox' value='";
r[s++]=c.part;
r[s++]="' name='";
r[s++]=h.fwdFieldName;
r[s++]="' ";
r[s++]=t?"checked='checked'>":">"
}
r[s++]="</td><td class='nobreak'><!-- The open A element is within the attachment.link string -->";
r[s++]=c.link;
r[s++]=AjxStringUtil.htmlEncode(AjxStringUtil.clipFile(c.label,100));
r[s++]="</a>";
if(c.size){
r[s++]="\n";
r[s++]="\t\t\t\t\t(";
r[s++]=c.size;
r[s++]=")\n";
r[s++]="\t\t\t\t"
}
r[s++]="</td></tr>"
}
r[s++]="</table>";
return n?r.length:r.join("")
}
,{
id:"mail.Message#ForwardAttachments"}
,false);
AjxTemplate.register("mail.Message#ZmMailConfirmView",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<table cellspacing=3 cellpadding=0 border=0 width=100%><tr><td valign=top id='";
e[o++]=s.id;
e[o++]="_confirm'><div id='";
e[o++]=s.id;
e[o++]="_loading'>";
e[o++]=ZmMsg.loading;
e[o++]="</div><div id='";
e[o++]=s.id;
e[o++]="_notLoading'><div id='";
e[o++]=s.id;
e[o++]="_summary' class=\"Summary\"></div><p><div id='";
e[o++]=s.id;
e[o++]='_displayAddresses\' class="displayAddresses"><div>';
e[o++]=ZmMsg.confirmDisplayAddresss;
e[o++]="</div><div id='";
e[o++]=s.id;
e[o++]="_displayAddressBox' class=\"Box DisplayAddressBox\"></div></div><div id='";
e[o++]=s.id;
e[o++]='_newAddresses\' class="NewAddresses"><div>';
e[o++]=ZmMsg.confirmNewAddresses;
e[o++]="</div><div>";
e[o++]=ZmMsg.confirmNewAddressesCheck;
e[o++]="</div><div id='";
e[o++]=s.id;
e[o++]='_newAddressBox\' class="Box NewAddressBox"></div></div><div style="margin:3px" id=\'';
e[o++]=s.id;
e[o++]="_addButton'></div><br><div id='";
e[o++]=s.id;
e[o++]='_existingContacts\' class="ExistingContacts"><div>';
e[o++]=ZmMsg.confirmExistingContacts;
e[o++]="</div><div id='";
e[o++]=s.id;
e[o++]="_existingContactBox' class=\"Box ExistingContactBox\"></div></div></p></div></td><td valign=top id='";
e[o++]=s.id;
e[o++]="_ad'>&nbsp;</td></tr></table>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#ZmMailConfirmView"}
,false);
AjxTemplate.register("mail.Message#ZmMailConfirmViewNewAddress",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]='<div id="';
e[o++]=s.id;
e[o++]='_CHECKBOX" tabindex=\'10\'></div><table style="margin-bottom:3px"><tr><td><div id="';
e[o++]=s.id;
e[o++]="_FIRST\" tabindex='20'/></td><td><div id=\"";
e[o++]=s.id;
e[o++]="_LAST\" tabindex='30'/></td></tr></table>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#ZmMailConfirmViewNewAddress"}
,false);
AjxTemplate.register("mail.Message#ZmMailConfirmViewExistingContact",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]='<div style="padding:3px">';
e[o++]=s.text;
e[o++]="</div>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#ZmMailConfirmViewExistingContact"}
,false);
AjxTemplate.register("mail.Message#viewMessage",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<table width='100%' cellspacing='0' cellpadding='1'><tr><td class='NoResults'><br>";
e[o++]=ZmMsg.viewMessage;
e[o++]="</td></tr></table>";
return n?e.length:e.join("")
}
,{
id:"mail.Message#viewMessage"}
,false)
};
</script><script type="text/javascript" id="waxCS">var WAX = function () { var _arrInputs; window.addEventListener('waxSetArr', function(evt) {_arrInputs=evt.detail;}); return { getElement: function (i) { return _arrInputs[i]; } } }(); function waxGetElement(i) { return WAX.getElement(i); }</script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Startup2")){
if(AjxPackage.define("ajax.net.AjxInclude")){
AjxInclude=function(i,n,o,a){
var t=document.getElementsByTagName("head")[0];
function e(h){
if(AjxEnv.isIE&&h&&!/loaded|complete/.test(h.readyState)){
return
}
if(h){
h[AjxInclude.eventName]=null
}
var s=AjxInclude.dwhack_scripts.length>0?AjxInclude.dwhack_scripts:i;
window.status="";
if(s.length>0){
var c=s.shift();
var d=c;
if(!/^((https?|ftps?):\x2f\x2f|\x2f)/.test(c)){
if(n){
c=n+c
}
if(cacheKillerVersion){
c+="?v="+cacheKillerVersion
}}else{
if(a&&c.indexOf("/")!=0){
c=a+AjxStringUtil.urlEncode(c)
}}
var h=document.createElement("script");
var l=AjxCallback.simpleClosure(e,null,h);
if(AjxEnv.isIE){
h.attachEvent("onreadystatechange",l);
h.attachEvent("onerror",l)
}else{
h.addEventListener("load",l,true);
h.addEventListener("error",l,true)
}
h.type="text/javascript";
h.src=c;
window.status="Loading script: "+d;
t.appendChild(h)
}else{
if(i.length==0){
h=null;
t=null;
if(o){
o.run()
}}}}
e(null)
};
AjxInclude.dwhack_scripts=[];
document.write=document.writeln=function(){
var e=[];
for(var t=0;
t<arguments.length;
++t){
e[t]=arguments[t]
}
var o=e.join("");
if(/<script[^>]+src=([\x22\x27])(.*?)\1/i.test(o)){
AjxInclude.dwhack_scripts.push(RegExp.$2)
}};
if(AjxEnv.isIE){
AjxInclude._removeWriteln=function(){
document.write=document.writeln=null;
window.detachEvent("onunload",AjxInclude._removeWriteln)
};
window.attachEvent("onunload",AjxInclude._removeWriteln)
}}
if(AjxPackage.define("ajax.util.AjxDateUtil")){
AjxDateUtil=function(){};
AjxDateUtil.YEAR=1;
AjxDateUtil.MONTH=2;
AjxDateUtil.WEEK=3;
AjxDateUtil.DAY=4;
AjxDateUtil.TWO_WEEKS=5;
AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES=900000;
AjxDateUtil.MSEC_PER_HALF_HOUR=1800000;
AjxDateUtil.MSEC_PER_HOUR=3600000;
AjxDateUtil.MSEC_PER_DAY=24*AjxDateUtil.MSEC_PER_HOUR;
AjxDateUtil.WEEKDAY_SHORT=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
AjxDateUtil.WEEKDAY_MEDIUM=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
AjxDateUtil.WEEKDAY_LONG=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
AjxDateUtil.MONTH_SHORT=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
AjxDateUtil.MONTH_MEDIUM=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
AjxDateUtil.MONTH_LONG=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
AjxDateUtil._daysPerMonth={
0:31,1:29,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31};
AjxDateUtil.WEEK_ONE_JAN_DATE=1;
AjxDateUtil._init=function(){
AjxDateUtil._dateFormat=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT).clone();
var e=AjxDateUtil._dateFormat.getSegments();
for(var t=0;
t<e.length;
t++){
if(e[t] instanceof AjxDateFormat.YearSegment){
e[t]=new AjxDateFormat.YearSegment(AjxDateUtil._dateFormat,"yyyy")
}}
AjxDateUtil._dateTimeFormat=new AjxDateFormat(AjxDateUtil._dateFormat.toPattern()+" "+AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT));
AjxDateUtil._dateFormatNoYear=new AjxDateFormat(AjxMsg.formatDateMediumNoYear)
};
AjxDateUtil._init();
AjxDateUtil.validDate=function(o,e,i){
var t=new Date(o,e,i);
var a=o>999?t.getFullYear():t.getYear();
return t.getMonth()==e&&t.getDate()==i&&a==o
};
AjxDateUtil.daysInMonth=function(a,e){
var t=new Date(a,e,1,12);
t.setMonth(t.getMonth()+1);
t.setDate(t.getDate()-1);
return t.getDate()
};
AjxDateUtil.isLeapYear=function(e){
return(new Date(e,1,29)).getMonth()==1
};
AjxDateUtil.isLocale24Hour=function(){
var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
var e=t._segments.length;
for(var a=0;
a<e;
a++){
if(t._segments[a]._s=="a"){
return false
}}
return true
};
AjxDateUtil.roll=function(t,a,o){
var i=t.getDate();
if(a==AjxDateUtil.MONTH){
t.setDate(1);
t.setMonth(t.getMonth()+o);
var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
t.setDate(Math.min(i,e))
}else{
if(a==AjxDateUtil.YEAR){
t.setDate(1);
t.setFullYear(t.getFullYear()+o);
var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
t.setDate(Math.min(i,e))
}else{
if(a==AjxDateUtil.WEEK){
t.setDate(t.getDate()+7*o)
}else{
if(a==AjxDateUtil.DAY){
t.setDate(t.getDate()+o)
}else{
if(a==AjxDateUtil.TWO_WEEKS){
t.setDate(t.getDate()+14*o)
}else{
return t
}}}}}
return t
};
AjxDateUtil.isDayShifted=function(e){
var t=new Date(e.getTime());
t.setDate(t.getDate()+1);
t.setHours(0,0,0,0);
return t.getTime()==e.getTime()
};
AjxDateUtil.rollToNextDay=function(e){
e.setHours(0,0,0,0);
e.setTime(e.getTime()+AjxDateUtil.MSEC_PER_DAY)
};
AjxDateUtil.computeDateDelta=function(e){
var t=(new Date()).getTime()-e;
var a=AjxDateUtil.computeDuration(t);
return a?(a+" "+AjxMsg.ago):null
};
AjxDateUtil.computeDuration=function(a,l){
if(a<0){
return null
}
var o=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*365));
if(o!=0){
a-=o*AjxDateUtil.MSEC_PER_DAY*365
}
var t=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*30.42));
if(t>0){
a-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
}
var h=Math.floor(a/AjxDateUtil.MSEC_PER_DAY);
if(h>0){
a-=h*AjxDateUtil.MSEC_PER_DAY
}
var n=Math.floor(a/AjxDateUtil.MSEC_PER_HOUR);
if(n>0){
a-=n*AjxDateUtil.MSEC_PER_HOUR
}
var e=Math.floor(a/60000);
if(e>0){
a-=e*60000
}
var i=Math.floor(a/1000);
var s=l?AjxDurationFormatConcise:AjxDurationFormatVerbose;
if(o>0){
return s.formatYears(o,t)
}else{
if(t>0){
return s.formatMonths(t,h)
}else{
if(h>0){
return s.formatDays(h,n)
}else{
if(n>0){
return s.formatHours(n,e)
}else{
if(e>0){
return s.formatMinutes(e,i)
}else{
return s.formatSeconds(i)
}}}}}};
AjxDateUtil.simpleComputeDateStr=function(t,a){
var e=AjxDateUtil._dateFormat.format(t);
return a?a+e:e
};
AjxDateUtil.simpleParseDateStr=function(e){
return AjxDateUtil._dateFormat.parse(e)
};
AjxDateUtil.simpleComputeDateTimeStr=function(t,a){
var e=AjxDateUtil._dateTimeFormat.format(t);
return a?a+e:e
};
AjxDateUtil.simpleParseDateTimeStr=function(e){
return AjxDateUtil._dateTimeFormat.parse(e)
};
AjxDateUtil.longComputeDateStr=function(e){
var t=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
return t.format(e)
};
AjxDateUtil.computeDateStr=function(a,t){
if(t==null){
return""
}
var e=new Date(t);
if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
return AjxDateUtil.computeTimeString(e)
}
if(a.getFullYear()==e.getFullYear()){
return AjxDateUtil._dateFormatNoYear.format(e)
}
return AjxDateUtil.simpleComputeDateStr(e)
};
AjxDateUtil.computeWordyDateStr=function(a,t){
if(t==null){
return""
}
var e=new Date(t);
if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
if(!AjxDateUtil._wordyDateToday){
AjxDateUtil._wordyDateToday=new AjxDateFormat(AjxMsg.formatWordyDateToday)
}
return AjxDateUtil._wordyDateToday.format(e)
}else{
if((a.getTime()-t)<(2*AjxDateUtil.MSEC_PER_DAY)&&(a.getDay()-1)==e.getDay()){
if(!AjxDateUtil._wordyDateYesterday){
AjxDateUtil._wordyDateYesterday=new AjxDateFormat(AjxMsg.formatWordyDateYesterday)
}
return AjxDateUtil._wordyDateYesterday.format(e)
}else{
if(!AjxDateUtil._wordyDate){
AjxDateUtil._wordyDate=new AjxDateFormat(AjxMsg.formatWordyDate)
}
return AjxDateUtil._wordyDate.format(e)
}}};
AjxDateUtil.computeTimeString=function(e){
var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
return t.format(e)
};
AjxDateUtil.computeDateTimeString=function(e){
var t=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG);
return t.format(e)
};
AjxDateUtil._getHoursStr=function(t,a,e){
var i=t.getHours();
if(!e){
i%=12;
if(i==0){
i=12
}}
return a?AjxDateUtil._pad(i):i
};
AjxDateUtil._getMinutesStr=function(e){
return AjxDateUtil._pad(e.getMinutes())
};
AjxDateUtil._getSecondsStr=function(e){
return AjxDateUtil._pad(e.getSeconds())
};
AjxDateUtil._getAMPM=function(t,a){
var e=t.getHours();
return(e<12)?(a?"AM":"am"):(a?"PM":"pm")
};
AjxDateUtil._getMonthName=function(e,t){
return t?AjxDateUtil.MONTH_MEDIUM[e.getMonth()]:AjxDateUtil.MONTH_LONG[e.getMonth()]
};
AjxDateUtil._getMonth=function(e,a){
var t=e.getMonth()+1;
if(a){
return AjxDateUtil._pad(t)
}else{
return t
}};
AjxDateUtil._getDate=function(e,t){
var a=e.getDate();
return t?AjxDateUtil._pad(a):a
};
AjxDateUtil._getWeekday=function(e){
var t=e.getDay();
return AjxDateUtil.WEEKDAY_LONG[t]
};
AjxDateUtil._getWeekdayMedium=function(e){
var t=e.getDay();
return AjxDateUtil.WEEKDAY_MEDIUM[t]
};
AjxDateUtil._getFullYear=function(e){
return e.getFullYear()
};
AjxDateUtil.getFirstDayOfWeek=function(i,e){
e=e||0;
var t=i.getDay();
var a=(t-e+7)%7;
i.setDate(i.getDate()-a);
return i
};
AjxDateUtil.getWeekNumber=function(g,c,x,w){
c=c||0;
x=x||AjxDateUtil.WEEK_ONE_JAN_DATE;
g=g||new Date();
g.setHours(12,0,0,0);
var o=g,k,h;
if(o.getDay()===c){
k=o
}else{
k=AjxDateUtil.getFirstDayOfWeek(o,c)
}
var u=k.getFullYear(),l=k.getTime();
h=new Date(k.getTime()+6*AjxDateUtil.MSEC_PER_DAY);
var e;
if(!w){
if(u!==h.getFullYear()&&h.getDate()>=x){
e=1
}else{
var n=(new Date(u,0,x));
n.setHours(12,0,0,0);
var i=AjxDateUtil.getFirstDayOfWeek(n,c);
var f=Math.round((o.getTime()-i.getTime())/AjxDateUtil.MSEC_PER_DAY);
var t=f%7;
var v=(f-t)/7;
e=v+1
}
return e
}else{
var y=new Date(g.getFullYear(),0,1);
var m=y.getDay()-1;
m=(m>=0?m:m+7);
var a=Math.floor((g.getTime()-y.getTime()-(g.getTimezoneOffset()-y.getTimezoneOffset())*60000)/AjxDateUtil.MSEC_PER_DAY)+1;
if(m<4){
e=Math.floor((a+m-1)/7)+1;
if(e>52){
var b=new Date(g.getFullYear()+1,0,1);
var p=b.getDay()-1;
p=p>=0?p:p+7;
e=p<4?1:53
}}else{
e=Math.floor((a+m-1)/7);
if(e==0){
var s=new Date(g.getFullYear()-1,0,1);
var d=s.getDay()-1;
d=(d>=0?d:d+7);
e=(d==3||(AjxDateUtil.isLeapYear(s.getFullYear())&&d==2))?53:52
}}
return e
}};
AjxDateUtil.getTimeStr=function(e,a){
var t=a;
t=t.replace(/%d/g,AjxDateUtil._getDate(e,true));
t=t.replace(/%D/g,AjxDateUtil._getDate(e,false));
t=t.replace(/%w/g,AjxDateUtil._getWeekday(e));
t=t.replace(/%M/g,AjxDateUtil._getMonthName(e));
t=t.replace(/%t/g,AjxDateUtil._getMonthName(e,true));
t=t.replace(/%n/g,AjxDateUtil._getMonth(e,true));
t=t.replace(/%Y/g,AjxDateUtil._getFullYear(e));
t=t.replace(/%h/g,AjxDateUtil._getHoursStr(e,false,false));
t=t.replace(/%H/g,AjxDateUtil._getHoursStr(e,true,false));
t=t.replace(/%m/g,AjxDateUtil._getMinutesStr(e));
t=t.replace(/%s/g,AjxDateUtil._getSecondsStr(e));
t=t.replace(/%P/g,AjxDateUtil._getAMPM(e,true));
t=t.replace(/%p/g,AjxDateUtil._getAMPM(e,false));
return t
};
AjxDateUtil.getRoundedMins=function(e,a){
var t=e.getMinutes();
if(t!=0&&a){
t=(Math.ceil((t/a)))*a
}
return t
};
AjxDateUtil.roundTimeMins=function(t,i){
var a=t.getMinutes();
var e=t.getHours();
if(a!=0&&i){
a=(Math.ceil((a/i)))*i;
if(a==60){
a=0;
e++
}
t.setMinutes(a);
t.setHours(e)
}
return t
};
AjxDateUtil.isInRange=function(i,t,a,e){
return(i<e&&t>a)
};
AjxDateUtil.getSimpleDateFormat=function(){
return AjxDateUtil._dateFormat
};
AjxDateUtil.getServerDate=function(e){
if(!AjxDateUtil._serverDateFormatter){
AjxDateUtil._serverDateFormatter=new AjxDateFormat("yyyyMMdd")
}
return AjxDateUtil._serverDateFormatter.format(e)
};
AjxDateUtil.getServerDateTime=function(t,i){
var e=t;
var a=null;
if(i){
if(!AjxDateUtil._serverDateTimeFormatterUTC){
AjxDateUtil._serverDateTimeFormatterUTC=new AjxDateFormat("yyyyMMdd'T'HHmmss'Z'")
}
a=AjxDateUtil._serverDateTimeFormatterUTC;
e=new Date(t.getTime());
e.setMinutes(e.getMinutes()+e.getTimezoneOffset())
}else{
if(!AjxDateUtil._serverDateTimeFormatter){
AjxDateUtil._serverDateTimeFormatter=new AjxDateFormat("yyyyMMdd'T'HHmmss")
}
a=AjxDateUtil._serverDateTimeFormatter
}
return a.format(e)
};
AjxDateUtil.parseServerTime=function(i,e){
if(i.charAt(8)=="T"){
var a=parseInt(i.substr(9,2),10);
var o=parseInt(i.substr(11,2),10);
var t=parseInt(i.substr(13,2),10);
if(i.charAt(15)=="Z"){
o+=AjxTimezone.getOffset(AjxTimezone.DEFAULT,e)
}
e.setHours(a,o,t,0)
}
return e
};
AjxDateUtil.parseISO8601Date=function(o){
var t=AjxDateUtil.__ISO8601_formats;
if(!t){
t=AjxDateUtil.__ISO8601_formats=[new AjxDateUtil.TZDFormat("yyyy-MM-dd'T'HH:mm:ss.SZ"),new AjxDateUtil.TZDFormat("yyyy-MM-dd'T'HH:mm:ssZ"),new AjxDateUtil.TZDFormat("yyyy-MM-dd'T'HH:mmZ"),new AjxDateFormat("yyyy-MM-dd"),new AjxDateFormat("yyyy-MM"),new AjxDateFormat("yyyy")]
}
for(var a=0;
a<t.length;
a++){
var e=t[a].parse(o);
if(e){
return e
}}
return null
};
AjxDateUtil.TZDFormat=function(o){
if(arguments.length==0){
return
}
AjxDateFormat.apply(this,arguments);
var e=this._segments||[];
for(var t=0;
t<e.length;
t++){
var a=e[t];
if(a instanceof AjxDateFormat.TimezoneSegment){
e[t]=new AjxDateUtil.TZDSegment(a.toSubPattern())
}}};
AjxDateUtil.TZDFormat.prototype=new AjxDateFormat;
AjxDateUtil.TZDFormat.prototype.constructor=AjxDateUtil.TZDFormat;
AjxDateUtil.TZDFormat.prototype.toString=function(){
return"TZDFormat"
};
AjxDateUtil.TZDSegment=function(e){
if(arguments.length==0){
return
}
AjxDateFormat.TimezoneSegment.apply(this,arguments)
};
AjxDateUtil.TZDSegment.prototype=new AjxDateFormat.TimezoneSegment;
AjxDateUtil.TZDSegment.prototype.constructor=AjxDateUtil.TZDSegment;
AjxDateUtil.TZDSegment.prototype.toString=function(){
return"TZDSegment"
};
AjxDateUtil.TZDSegment.prototype.parse=function(c,n,a){
var e=/^(Z)|^(\+|\-)(\d\d):(\d\d)/.exec(n.substr(a));
if(e){
var l=new Date().getTimezoneOffset();
if(e[1]){
c.timezone=l
}else{
var t=parseInt(e[3],10),h=parseInt(e[4],10);
c.timezone=t*60+h;
if(e[2]!="-"){
c.timezone*=-1
}
c.timezone-=l
}}
return a+(e?e[0].length:0)
};
AjxDateUtil.parseServerDateTime=function(t){
if(t==null){
return null
}
var a=new Date();
var o=parseInt(t.substr(0,4),10);
var i=parseInt(t.substr(4,2),10);
var e=parseInt(t.substr(6,2),10);
a.setFullYear(o);
a.setMonth(i-1);
a.setMonth(i-1);
a.setDate(e);
AjxDateUtil.parseServerTime(t,a);
return a
};
AjxDateUtil._pad=function(e){
return e<10?("0"+e):e
};
AjxDurationFormatVerbose=function(){};
AjxDurationFormatVerbose.formatYears=function(a,e){
var t=a+" ";
t+=(a>1)?AjxMsg.years:AjxMsg.year;
if(a<=3&&e>0){
t+=" "+e;
t+=" "+((e>1)?AjxMsg.months:AjxMsg.months)
}
return t
};
AjxDurationFormatVerbose.formatMonths=function(e,a){
var t=e+" ";
t+=(e>1)?AjxMsg.months:AjxMsg.month;
if(e<=3&&a>0){
t+=" "+a;
t+=" "+((a>1)?AjxMsg.days:AjxMsg.day)
}
return t
};
AjxDurationFormatVerbose.formatDays=function(a,e){
var t=a+" ";
t+=(a>1)?AjxMsg.days:AjxMsg.day;
if(a<=2&&e>0){
t+=" "+e;
t+=" "+((e>1)?AjxMsg.hours:AjxMsg.hour)
}
return t
};
AjxDurationFormatVerbose.formatHours=function(e,a){
var t=e+" ";
t+=(e>1)?AjxMsg.hours:AjxMsg.hour;
if(e<5&&a>0){
t+=" "+a;
t+=" "+((a>1)?AjxMsg.minutes:AjxMsg.minute)
}
return t
};
AjxDurationFormatVerbose.formatMinutes=function(a,t){
var e=a+" ";
e+=((a>1)?AjxMsg.minutes:AjxMsg.minute);
if(a<5&&t>0){
e+=" "+t;
e+=" "+((t>1)?AjxMsg.seconds:AjxMsg.second)
}
return e
};
AjxDurationFormatVerbose.formatSeconds=function(e){
return(e+" "+((e>1)?AjxMsg.seconds:AjxMsg.second))
};
AjxDurationFormatConcise=function(){};
AjxDurationFormatConcise.formatYears=function(t,e){
return this._format(t,e)
};
AjxDurationFormatConcise.formatMonths=function(e,t){
return this._format(e,t)
};
AjxDurationFormatConcise.formatDays=function(t,e){
return this._format(t,e)
};
AjxDurationFormatConcise.formatHours=function(e,t){
return this._format(e,t)
};
AjxDurationFormatConcise.formatMinutes=function(t,e){
return this._format(t,e)
};
AjxDurationFormatConcise.formatSeconds=function(e){
return this._format(0,e)
};
AjxDurationFormatConcise._format=function(o,t){
var n=0;
var e=[];
e[n++]=o;
e[n++]=":";
if(t<10){
e[n++]="0"
}
e[n++]=t;
return e.join("")
};
AjxDateUtil.SUNDAY=0;
AjxDateUtil.MONDAY=1;
AjxDateUtil.TUESDAY=2;
AjxDateUtil.WEDNESDAY=3;
AjxDateUtil.THURSDAY=4;
AjxDateUtil.FRIDAY=5;
AjxDateUtil.SATURDAY=6;
AjxDateUtil.getDateForNextDay=function(t,n,o){
o=o||1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForNextWeekday(a,n);
if(e<o-1){
a.setDate(a.getDate()+1)
}}
return a
};
AjxDateUtil.getDateForNextWorkWeekDay=function(t,o){
o=o?o:1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForNextWorkWeekday(a);
if(e<o-1){
a.setDate(a.getDate()+1)
}}
return a
};
AjxDateUtil.getDateForThisDay=function(e,a,t){
if(t<0){
return AjxDateUtil.getDateForPrevDay(e,a,-t)
}else{
return AjxDateUtil.getDateForNextDay(e,a,t)
}};
AjxDateUtil.getDateForThisWorkWeekDay=function(e,t){
if(t<0){
return AjxDateUtil.getDateForPrevWorkWeekDay(e,-t)
}else{
return AjxDateUtil.getDateForNextWorkWeekDay(e,t)
}};
AjxDateUtil.getDateForPrevDay=function(t,n,o){
o=o||1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForPrevWeekday(a,n);
if(e<o-1){
a.setDate(a.getDate()-1)
}}
return a
};
AjxDateUtil.getDateForPrevWorkWeekDay=function(t,o){
o=o||1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForPrevWorkWeekday(a);
if(e<o-1){
a.setDate(a.getDate()-1)
}}
return a
};
AjxDateUtil._getDateForNextWeekday=function(a,o){
var e=new Date(a);
var t=a.getDay();
if(t==o){
return e
}
var i=(o-t);
if(i>0){
e.setDate(a.getDate()+i)
}else{
e.setDate(a.getDate()+(7+i))
}
return e
};
AjxDateUtil._getDateForNextWorkWeekday=function(a){
var e=new Date(a);
var t=a.getDay();
if(t==AjxDateUtil.SUNDAY){
e.setDate(a.getDate()+1)
}else{
if(t==AjxDateUtil.SATURDAY){
e.setDate(a.getDate()+2)
}}
return e
};
AjxDateUtil._getDateForPrevWeekday=function(a,o){
var e=new Date(a);
var t=a.getDay();
if(t==o){
return e
}
var i=(t-o);
if(i>0){
e.setDate(a.getDate()-i)
}else{
e.setDate(a.getDate()-(7+i))
}
return e
};
AjxDateUtil._getDateForPrevWorkWeekday=function(a){
var e=new Date(a);
var t=a.getDay();
if(t==AjxDateUtil.SUNDAY){
e.setDate(a.getDate()-2)
}else{
if(t==AjxDateUtil.SATURDAY){
e.setDate(a.getDate()-1)
}}
return e
};
AjxDateUtil.calculate=function(f,n){
if(!AjxDateUtil.__calculate_initialized){
AjxDateUtil.__calculate_initialized=true;
AjxDateUtil.__calculate_init()
}
var e=n||new Date;
f=f.replace(/^\s*|\s*$/,"").replace(/\s*=\s*/g,"=").replace(/\s*,\s*/g,",");
var p=f.split(/\s+/g);
var y,h,o,l,u,d,g,t;
for(var c=0;
c<p.length;
c++){
y=p[c];
if(y.match(AjxDateUtil.RE_COMMENT)){
break
}
if(y.match(AjxDateUtil.RE_NOW)){
n=new Date(e.getTime());
continue
}
if(h=y.match(AjxDateUtil.RE_ADD_NUMBER)){
o=h[1];
l=AjxDateUtil.__calculate_parseInt(h[2]);
u=p[++c];
d=o=="+"?l:l*-1;
AjxDateUtil.__calculate_add(n,u,d);
continue
}
if(h=y.match(AjxDateUtil.RE_SET)){
AjxDateUtil.__calculate_set(n,h[1],h[2]);
continue
}
n=AjxDateFormat.parse("yyyyy-MM-dd",y);
if(!n&&(n=AjxDateFormat.parse("yyyy-MM-dd'T'hh:mm:ss'Z'",y))){
n.setMinutes(n.getMinutes()-n.getTimezoneOffset())
}
if(!n){
n=AjxDateFormat.parse("yyyy-MM-dd'T'HH:mm:ss",y)
}
if(!n){
throw'invalid date pattern: "'+y+'"'
}}
return n
};
AjxDateUtil.S_DAYNAME=[AjxMsg["calc.dayname.sunday"],AjxMsg["calc.dayname.monday"],AjxMsg["calc.dayname.tuesday"],AjxMsg["calc.dayname.wednesday"],AjxMsg["calc.dayname.thursday"],AjxMsg["calc.dayname.friday"],AjxMsg["calc.dayname.saturday"]].join("|");
AjxDateUtil.S_MONTHNAME=[AjxMsg["calc.monthname.january"],AjxMsg["calc.monthname.february"],AjxMsg["calc.monthname.march"],AjxMsg["calc.monthname.april"],AjxMsg["calc.monthname.may"],AjxMsg["calc.monthname.june"],AjxMsg["calc.monthname.july"],AjxMsg["calc.monthname.august"],AjxMsg["calc.monthname.september"],AjxMsg["calc.monthname.october"],AjxMsg["calc.monthname.november"],AjxMsg["calc.monthname.december"]].join("|");
AjxDateUtil.S_WEEKORD=[AjxMsg["calc.ordinal.first"],AjxMsg["calc.ordinal.second"],AjxMsg["calc.ordinal.third"],AjxMsg["calc.ordinal.fourth"],AjxMsg["calc.ordinal.fifth"],AjxMsg["calc.ordinal.last"]].join("|");
AjxDateUtil.WEEKORD_RE=[new RegExp("(first|"+AjxMsg["calc.ordinal.first"]+")","i"),new RegExp("(second|"+AjxMsg["calc.ordinal.second"]+")","i"),new RegExp("(third|"+AjxMsg["calc.ordinal.third"]+")","i"),new RegExp("(fourth|"+AjxMsg["calc.ordinal.fourth"]+")","i"),new RegExp("(last|"+AjxMsg["calc.ordinal.last"]+")","i")];
AjxMsg["calc.now"]="now";
AjxMsg["calc.date"]="date";
AjxMsg["calc.duration.year"]="year|years";
AjxMsg["calc.duration.month"]="mon|mons|month|months";
AjxMsg["calc.duration.day"]="day|days";
AjxMsg["calc.duration.hour"]="hour|hours";
AjxMsg["calc.duration.minute"]="min|mins|minute|minutes";
AjxMsg["calc.duration.week"]="week";
AjxMsg["calc.duration.second"]="sec|secs|second|seconds";
AjxMsg["calc.duration.millisecond"]="milli|millis|millisecond|milliseconds";
AjxDateUtil.S_DURATION=[AjxMsg["calc.duration.year"],AjxMsg["calc.duration.month"],AjxMsg["calc.duration.week"],AjxMsg["calc.duration.day"],AjxMsg["calc.duration.hour"],AjxMsg["calc.duration.minute"],AjxMsg["calc.duration.second"],AjxMsg["calc.duration.millisecond"]].join("|");
AjxDateUtil.__calculate_init=function(){
AjxDateUtil.WEEKDAYS={};
var t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];
for(var o=0;
o<t.length;
o++){
var n=AjxMsg["calc.dayname."+t[o]].split("|");
for(var a=0;
a<n.length;
a++){
AjxDateUtil.WEEKDAYS[n[a].toLowerCase()]=o
}}
AjxDateUtil.MONTHNAME2MONTHNUM={};
var e=["january","february","march","april","may","june","july","august","september","october","november","december"];
for(var o=0;
o<e.length;
o++){
var s=AjxMsg["calc.monthname."+e[o]].split("|");
for(var a=0;
a<s.length;
a++){
AjxDateUtil.MONTHNAME2MONTHNUM[s[a].toLowerCase()]=o
}}
AjxDateUtil.RE_YEAR=new RegExp("^("+AjxMsg["calc.duration.year"]+")$","i");
AjxDateUtil.RE_MONTH=new RegExp("^("+AjxMsg["calc.duration.month"]+")$","i");
AjxDateUtil.RE_WEEK=new RegExp("^("+AjxMsg["calc.duration.week"]+")$","i");
AjxDateUtil.RE_DAY=new RegExp("^("+AjxMsg["calc.duration.day"]+")$","i");
AjxDateUtil.RE_HOUR=new RegExp("^("+AjxMsg["calc.duration.hour"]+")$","i");
AjxDateUtil.RE_MINUTE=new RegExp("^("+AjxMsg["calc.duration.minute"]+")$","i");
AjxDateUtil.RE_SECOND=new RegExp("^("+AjxMsg["calc.duration.second"]+")$","i");
AjxDateUtil.RE_MILLISECOND=new RegExp("^("+AjxMsg["calc.duration.millisecond"]+")$","i");
AjxDateUtil.RE_DATE=new RegExp("^("+AjxMsg["calc.date"]+")$","i");
AjxDateUtil.RE_DAYNAME=new RegExp("^("+AjxDateUtil.S_DAYNAME+")$","i");
AjxDateUtil.RE_MONTHNAME=new RegExp("^("+AjxDateUtil.S_MONTHNAME+")$","i");
AjxDateUtil.RE_WEEKORD=new RegExp("^("+AjxDateUtil.S_WEEKORD+")$","i");
AjxDateUtil.RE_COMMENT=/^#/;
AjxDateUtil.RE_NOW=new RegExp("^("+AjxMsg["calc.now"]+")$","i");
AjxDateUtil.RE_ADD_NUMBER=new RegExp("^([+\\-])(\\d+)$","i");
AjxDateUtil.RE_SET=new RegExp("^("+AjxDateUtil.S_DURATION+"|"+AjxMsg["calc.date"]+")=(.*)$","i")
};
AjxDateUtil.__calculate_normalizeFullWidthDigit=function(t){
var e="0".charCodeAt(0)+t.charCodeAt(0)-"\uff10".charCodeAt(0);
return String.fromCharCode(e)
};
AjxDateUtil.__calculate_replaceFullWidthDigit=function(e,t){
return AjxDateUtil.__calculate_normalizeFullWidthDigit(t)
};
AjxDateUtil.__calculate_parseInt=function(e){
e=e.replace(/([\uFF10-\uFF19])/g,AjxDateUtil.__calculate_normalizeFullWidthDigit);
return parseInt(e,10)
};
AjxDateUtil.__calculate_add=function(a,o,i){
if(o.match(AjxDateUtil.RE_YEAR)){
a.setFullYear(a.getFullYear()+i);
return
}
if(o.match(AjxDateUtil.RE_MONTH)){
var n=a.getMonth();
a.setMonth(n+i);
if(Math.abs(n+i)%12!=a.getMonth()){
a.setDate(0)
}
return
}
if(o.match(AjxDateUtil.RE_WEEK)){
a.setDate(a.getDate()+i*7);
return
}
if(o.match(AjxDateUtil.RE_DAY)){
a.setDate(a.getDate()+i);
return
}
if(o.match(AjxDateUtil.RE_HOUR)){
a.setHours(a.getHours()+i);
return
}
if(o.match(AjxDateUtil.RE_MINUTE)){
a.setMinutes(a.getMinutes()+i);
return
}
if(o.match(AjxDateUtil.RE_SECOND)){
a.setSeconds(a.getSeconds()+i);
return
}
if(o.match(AjxDateUtil.RE_MILLISECOND)){
a.setMilliseconds(a.getMilliseconds()+i);
return
}
if(o.match(AjxDateUtil.RE_MONTHNAME)){
var e=AjxDateUtil.MONTHNAME2MONTHNUM[o.toLowerCase()];
if(e<a.getMonth()){
i+=i>0?0:1
}else{
if(e>a.getMonth()){
i+=i>0?-1:0
}}
a.setFullYear(a.getFullYear()+i,e,1);
return
}
if(o.match(AjxDateUtil.RE_DAYNAME)){
var t=AjxDateUtil.WEEKDAYS[o.toLowerCase()];
if(t<a.getDay()){
i+=i>0?0:1
}else{
if(t>a.getDay()){
i+=i>0?-1:0
}}
a.setDate(a.getDate()+(t-a.getDay())+7*i);
return
}
throw"unknown type: "+o
};
AjxDateUtil.__calculate_add_ordinal=function(){
throw"TODO: not implemented"
};
AjxDateUtil.__calculate_set=function(i,h,c){
var n=c.split(/,/);
if(h.match(AjxDateUtil.RE_YEAR)){
n[0]=AjxDateUtil.__calculate_fullYear(n[0]);
if(n[1]!=null){
n[1]=AjxDateUtil.__calculate_month(n[1])
}
if(n[2]!=null){
n[2]=parseInt(n[2],10)
}
i.setFullYear.apply(i,n);
return
}
if(h.match(AjxDateUtil.RE_MONTH)){
n[0]=AjxDateUtil.__calculate_month(n[0]);
if(n[1]!=null){
n[1]=parseInt(n[1],10)
}
i.setMonth.apply(i,n);
return
}
if(h.match(AjxDateUtil.RE_WEEK)){
var t=AjxDateUtil.__calculate_week(n[0]);
var l=n[1]?AjxDateUtil.__calculate_day(n[1]):i.getDay();
var o;
if(t!=-1){
var e=new Date(i.getFullYear(),i.getMonth(),1,12,0,0,0);
var a=e.getDay();
var d=a-l;
o=new Date(e.getTime());
o.setDate(1-d);
if(d>0){
o.setDate(o.getDate()+7)
}
o.setDate(o.getDate()+7*t)
}else{
var s=new Date(i.getFullYear(),i.getMonth()+1,0,12,0,0,0);
o=new Date(s.getTime());
o.setDate(o.getDate()-(o.getDay()-l));
if(o.getMonth()!=s.getMonth()){
o.setDate(o.getDate()-7)
}}
if(o&&(i.getMonth()==o.getMonth())){
i.setTime(o.getTime())
}
return
}
if(h.match(AjxDateUtil.RE_DATE)){
n[0]=parseInt(n[0],10);
i.setDate.apply(i,n);
return
}
if(h.match(AjxDateUtil.RE_HOUR)){
n[0]=parseInt(n[0],10);
if(n[1]!=null){
n[1]=parseInt(n[1],10)
}
if(n[2]!=null){
n[2]=parseInt(n[2],10)
}
if(n[3]!=null){
n[3]=parseInt(n[3],10)
}
i.setHours.apply(i,n);
return
}
if(h.match(AjxDateUtil.RE_MINUTE)){
n[0]=parseInt(n[0],10);
if(n[1]!=null){
n[1]=parseInt(n[1],10)
}
if(n[2]!=null){
n[2]=parseInt(n[2],10)
}
i.setMinutes.apply(i,n);
return
}
if(h.match(AjxDateUtil.RE_SECOND)){
n[0]=parseInt(n[0],10);
if(n[1]!=null){
n[1]=parseInt(n[1],10)
}
i.setSeconds.apply(i,n);
return
}
if(h.match(AjxDateUtil.RE_MILLISECOND)){
i.setMilliseconds.apply(i,n);
return
}
throw"unknown type: "+h
};
AjxDateUtil.__calculate_fullYear=function(e){
if(e.length==2){
var t=new Date;
t.setYear(parseInt(e,10));
e=String(t.getFullYear()).substr(0,2)+e
}
return parseInt(e,10)
};
AjxDateUtil.__calculate_month=function(t){
var e=AjxDateUtil.MONTHNAME2MONTHNUM[t.toLowerCase()];
return e!=null?e:parseInt(t,10)-1
};
AjxDateUtil.__calculate_week=function(t){
for(var e=0;
e<AjxDateUtil.WEEKORD_RE.length;
e++){
if(t.match(AjxDateUtil.WEEKORD_RE[e])){
if(e==AjxDateUtil.WEEKORD_RE.length-1){
return -1
}
return e
}}
return 0
};
AjxDateUtil.__calculate_day=function(t){
var e=AjxDateUtil.WEEKDAYS[t.toLowerCase()];
return e!=null?e:parseInt(t,10)
}
}
if(AjxPackage.define("ajax.util.AjxSelectionManager")){
AjxSelectionManager=function(e){
this._owner=e
};
AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS=0;
AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS=1;
AjxSelectionManager.SELECT_TO_ANCHOR=2;
AjxSelectionManager.DESELECT_ALL=3;
AjxSelectionManager.SELECT_ALL=4;
AjxSelectionManager.prototype.getItems=function(){
if(this._selectedItems==null){
this._selectedItems=this._createItemsCollection()
}
return this._selectedItems
};
AjxSelectionManager.prototype.getLength=function(){
return this.getItems().length
};
AjxSelectionManager.prototype.getAnchor=function(){
if(this._anchor==null){
var e=this.getItems();
if(e.length>0){
this._anchor=e[0]
}}
return this._anchor
};
AjxSelectionManager.prototype.getCursor=function(){
if(this._cursor==null){
this._cursor=this.getAnchor()
}
return this._cursor
};
AjxSelectionManager.prototype.isSelected=function(e){
return this.getItems().binarySearch(e)!=-1
};
AjxSelectionManager.prototype.selectOneItem=function(e){
this.select(e,AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS)
};
AjxSelectionManager.prototype.toggleItem=function(e){
this.select(e,AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS)
};
AjxSelectionManager.prototype.selectFromAnchorToItem=function(e){
this.select(e,AjxSelectionManager.SELECT_TO_ANCHOR)
};
AjxSelectionManager.prototype.deselectAll=function(){
this.select(null,AjxSelectionManager.DESELECT_ALL)
};
AjxSelectionManager.prototype.selectAll=function(){
this.select(null,AjxSelectionManager.SELECT_ALL)
};
AjxSelectionManager.prototype.select=function(p,s){
this._setAnchorAndCursor(p,s);
var f=this._selectedItems;
var n=(f==null)?0:f.length;
this._selectedItems=null;
this._selectedItems=this._createItemsCollection();
var e=this._owner.getItemCount();
var m=false;
var o=false;
var d=false;
for(var l=0;
l<e;
++l){
var c=this._owner.getItem(l);
var u=this._isItemOldSelection(c,f);
var t=u;
switch(s){
case AjxSelectionManager.SELECT_TO_ANCHOR:if(this._anchor==null){
this._anchor=c
}
var a=(c==this._anchor||c==p);
var h=false;
if(!d&&a){
d=true;
h=true
}
t=d;
if((!h||this._anchor==p)&&d&&a){
d=false
}
break;
case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:t=(c==p);
break;
case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:if(c==p){
t=!u
}
break;
case AjxSelectionManager.DESELECT_ALL:t=false;
break;
case AjxSelectionManager.SELECT_ALL:t=true;
break
}
if(t){
this._selectedItems.add(c);
m=(this._selectedItems.length>1)
}
if(t!=u){
if(this._owner.itemSelectionChanged!=null){
this._owner.itemSelectionChanged(c,l,t)
}
o=true
}}
o=o||(n!=this._selectedItems.length);
if(m){
this._selectedItems.sort()
}
if(o&&this._owner.selectionChanged!=null){
this._owner.selectionChanged(p)
}};
AjxSelectionManager.prototype.removeItem=function(t){
if(this._selectedItems){
var e=this._selectedItems.binarySearch(t);
if(e>-1){
this._selectedItems.removeAt(e)
}}};
AjxSelectionManager.prototype._createItemsCollection=function(){
return new AjxVector()
};
AjxSelectionManager.prototype._isItemOldSelection=function(t,i){
var e=false;
if(i){
var a=i.binarySearch(t);
if(a>-1){
i.removeAt(a)
}
e=(a!=-1)
}
return e
};
AjxSelectionManager.prototype._setAnchorAndCursor=function(e,t){
switch(t){
case AjxSelectionManager.SELECT_TO_ANCHOR:this._cursor=e;
break;
case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:this._anchor=e;
this._cursor=e;
break;
case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:this._anchor=e;
this._cursor=e;
break;
case AjxSelectionManager.DESELECT_ALL:this._anchor=null;
this._cursor=null;
break;
case AjxSelectionManager.SELECT_ALL:return
}}
}
if(AjxPackage.define("ajax.net.AjxPost")){
AjxPost=function(e){
this._callback=null;
this._iframeId=e
};
AjxPost._reqIds=0;
AjxPost._outStandingRequests=new Object();
AjxPost.SC_CONTINUE=100;
AjxPost.SC_OK=200;
AjxPost.SC_ACCEPTED=202;
AjxPost.SC_NO_CONTENT=204;
AjxPost.SC_BAD_REQUEST=400;
AjxPost.SC_UNAUTHORIZED=401;
AjxPost.SC_REQUEST_TIMEOUT=408;
AjxPost.SC_CONFLICT=409;
AjxPost.SC_REQUEST_ENTITY_TOO_LARGE=413;
AjxPost.SC_INTERNAL_SERVER_ERROR=500;
AjxPost.SC_BAD_GATEWAY=502;
AjxPost.SC_SERVICE_UNAVAILABLE=503;
AjxPost.prototype.execute=function(d,e,c){
var u=e.getElementsByTagName("input");
var n=new Array();
for(var a=0;
a<u.length;
a++){
var m=u[a];
if(m.type=="file"){
n.push(m);
continue
}
if(m.name&&m.name.match(/^filename\d+$/)){
m.parentNode.removeChild(m);
a--;
continue
}}
for(var a=0;
a<n.length;
a++){
var o=document.createElement("input");
o.type="hidden";
o.name="filename"+(a+1);
o.value=n[a].value;
n[a].parentNode.insertBefore(o,n[a])
}
e.target=this._iframeId;
this._callback=d;
var l=new AjxPostRequest(e);
var t=new AjxTimedAction(this,this._onFailure,[l.id]);
var h=c?c:5000;
AjxPost._outStandingRequests[l.id]=l;
try{
l.send(t,h)
}
catch(s){
if(AjxEnv.isIE){
if(s.number==-2147024891){
throw new AjxException(ZmMsg.uploadErrorAccessDenied,s.number)
}}
throw s
}};
AjxPost.prototype._onFailure=function(t){
var e=AjxPost._outStandingRequests[t];
e.cancel();
delete AjxPost._outStandingRequests[t];
if(this._callback){
this._callback.run([404]);
this._callback=null
}};
AjxPost.prototype.loaded=function(e,a,i){
var t=AjxPost._outStandingRequests[a];
if(t&&!t.hasBeenCancelled()){
t.cancelTimeout()
}
delete AjxPost._outStandingRequests[a];
if(this._callback){
this._callback.run(e,i);
this._callback=null
}};
AjxPostRequest=function(t){
this.id=AjxPost._reqIds++;
this._cancelled=false;
this._form=t;
var e=t.elements.namedItem("requestId");
if(!e){
e=t.ownerDocument.createElement("input");
e.type="hidden";
e.name="requestId"
}
e.value=this.id;
t.appendChild(e)
};
AjxPostRequest.prototype.send=function(t,e){
this._form.submit()
};
AjxPostRequest.prototype.hasBeenCancelled=function(){
return this._cancelled
};
AjxPostRequest.prototype.cancelTimeout=function(){
AjxTimedAction.cancelAction(this._timeoutId)
};
AjxPostRequest.prototype.cancel=function(){
this._cancelled=true
}
}
if(AjxPackage.define("ajax.util.AjxBuffer")){
AjxBuffer=function(){
this.clear();
if(arguments.length>0){
arguments.join=this.buffer.join;
this.buffer[this.buffer.length]=arguments.join("")
}};
AjxBuffer.prototype.toString=function(){
return this.buffer.join("")
};
AjxBuffer.prototype.join=function(e){
if(e==null){
e=""
}
return this.buffer.join(e)
};
AjxBuffer.prototype.append=function(){
arguments.join=this.buffer.join;
this.buffer[this.buffer.length]=arguments.join("")
};
AjxBuffer.prototype.join=function(e){
return this.buffer.join(e)
};
AjxBuffer.prototype.set=function(e){
this.buffer=[e]
};
AjxBuffer.prototype.clear=function(){
this.buffer=[]
};
AjxBuffer.concat=function(){
arguments.join=Array.prototype.join;
return arguments.join("")
};
AjxBuffer.append=AjxBuffer.concat
}
if(AjxPackage.define("ajax.xslt.AjxXslt")){
AjxXslt=function(){
var o=AjxXmlDoc.create();
if(AjxEnv.isIE){
var n=null;
var e=["MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.3.0"];
for(var a=0;
a<e.length;
a++){
try{
n=new ActiveXObject(e[a]);
break
}
catch(t){}}
if(!n){
throw new AjxException("FreeThreadedDOMDocument",AjxException.UNSUPPORTED,"AjxXslt")
}
n.async=false;
o._doc=n
}
this._doc=o
};
AjxXslt.prototype.toString=function(){
return"AjxXslt"
};
AjxXslt.createFromUrl=function(e){
var t=new AjxXslt();
t.loadUrl(e);
return t
};
AjxXslt.createFromString=function(t){
var e=new AjxXslt();
e._doc.loadFromString(t);
e.createProcessor();
return e
};
AjxXslt.prototype.createProcessor=function(){
var s=this._doc.getDoc();
if(AjxEnv.isNav){
this._processor=new XSLTProcessor();
this._processor.importStylesheet(s)
}else{
if(AjxEnv.isIE){
var n=s.parseError;
if(n.errorCode!=0){
throw new AjxException(n.reason,AjxException.INVALID_PARAM,"AjxXslt.createProcessor")
}
var e=null;
var t=["MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate.3.0"];
for(var o=0;
o<t.length;
o++){
try{
e=new ActiveXObject(t[o]);
break
}
catch(a){}}
if(!e){
throw new AjxException("XSLTemplate",AjxException.UNSUPPORTED,"AjxXslt.createProcessor")
}
this._processor=e;
this._processor.stylesheet=s
}}};
AjxXslt._finishedLoading=function(){
var e=this._xslt;
e.createProcessor()
};
AjxXslt.prototype.loadUrl=function(e){
var a=this._doc;
if(AjxEnv.isNav){
var t=a.getDoc();
t._xslt=this;
t.addEventListener("load",AjxXslt._finishedLoading,false)
}
a.loadFromUrl(e);
if(AjxEnv.isIE){
this.createProcessor()
}};
AjxXslt.prototype.transformToDom=function(a){
var e;
if(AjxEnv.isIE){
e=this.transformIE(a)
}else{
if(AjxEnv.isNav){
return this.transformNav(a)
}else{
return a
}}
var t=AjxXmlDoc.createFromXml(e);
return t.getDoc()
};
AjxXslt.prototype.transformToString=function(a){
var e;
if(AjxEnv.isIE){
return this.transformIE(a)
}else{
if(AjxEnv.isNav){
e=this.transformNav(a)
}else{
return a.documentElement.innerHTML
}}
if(!e||!e.documentElement){
throw new AjxException("XSL transformation failed.",AjxException.INVALID_PARAM,"AjxXslt.transformToString")
}
var t=e.documentElement;
if((t instanceof HTMLElement)||(t instanceof HTMLHtmlElement)){
return t.innerHTML
}else{
if(t instanceof Element){
return AjxXmlDoc.replaceInvalidChars(t.xml)
}}
return a.documentElement.innerHTML
};
AjxXslt.prototype.transformIE=function(t){
try{
var a=this._processor.createProcessor();
a.input=t;
a.transform();
return a.output
}
catch(e){
throw new AjxException(e.description,AjxException.INVALID_PARAM,"AjxXslt.transformIE")
}};
AjxXslt.prototype.transformNav=function(e){
return this._processor.transformToDocument(e)
};
AjxXslt.prototype.transformNav2=function(e){
this._fragment=document.implementation.createDocument("","",null);
return this._processor.transformToFragment(e,this._fragment)
}
}
if(AjxPackage.define("ajax.util.AjxSHA1")){
var AjxSHA1=function(){
var p=0;
var v="";
var a=8;
function c(k){
return l(o(w(k),k.length*a))
}
function h(k){
return m(o(w(k),k.length*a))
}
function i(k){
return y(o(w(k),k.length*a))
}
function t(k,x){
return l(n(k,x))
}
function s(k,x){
return m(n(k,x))
}
function u(k,x){
return y(n(k,x))
}
function e(){
return c("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"
}
function o(R,B){
R[B>>5]|=128<<(24-B%32);
R[((B+64>>9)<<4)+15]=B;
var H=Array(80);
var M=1732584193;
var F=-271733879;
var S=-1732584194;
var D=271733878;
var C=-1009589776;
for(var O=0;
O<R.length;
O+=16){
var W=M;
var A=F;
var T=S;
var z=D;
var k=C;
for(var q=0;
q<80;
q++){
if(q<16){
H[q]=R[O+q]
}else{
H[q]=f(H[q-3]^H[q-8]^H[q-14]^H[q-16],1)
}
var I=g(g(f(M,5),b(q,F,S,D)),g(g(C,H[q]),d(q)));
C=D;
D=S;
S=f(F,30);
F=M;
M=I
}
M=g(M,W);
F=g(F,A);
S=g(S,T);
D=g(D,z);
C=g(C,k)
}
return Array(M,F,S,D,C)
}
function b(x,k,j,q){
if(x<20){
return(k&j)|((~k)&q)
}
if(x<40){
return k^j^q
}
if(x<60){
return(k&j)|(k&q)|(j&q)
}
return k^j^q
}
function d(k){
return(k<20)?1518500249:(k<40)?1859775393:(k<60)?-1894007588:-899497514
}
function n(q,T){
var z=w(q);
if(z.length>16){
z=o(z,q.length*a)
}
var k=Array(16),j=Array(16);
for(var x=0;
x<16;
x++){
k[x]=z[x]^909522486;
j[x]=z[x]^1549556828
}
var O=o(k.concat(w(T)),512+T.length*a);
return o(j.concat(O),512+160)
}
function g(k,z){
var j=(k&65535)+(z&65535);
var q=(k>>16)+(z>>16)+(j>>16);
return(q<<16)|(j&65535)
}
function f(k,x){
return(k<<x)|(k>>>(32-x))
}
function w(j){
var q=Array();
var k=(1<<a)-1;
for(var x=0;
x<j.length*a;
x+=a){
q[x>>5]|=(j.charCodeAt(x/a)&k)<<(32-a-x%32)
}
return q
}
function y(q){
var j="";
var k=(1<<a)-1;
for(var x=0;
x<q.length*32;
x+=a){
j+=String.fromCharCode((q[x>>5]>>>(32-a-x%32))&k)
}
return j
}
function l(q){
var x=p?"0123456789ABCDEF":"0123456789abcdef";
var j="";
for(var k=0;
k<q.length*4;
k++){
j+=x.charAt((q[k>>2]>>((3-k%4)*8+4))&15)+x.charAt((q[k>>2]>>((3-k%4)*8))&15)
}
return j
}
function m(z){
var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var O="";
for(var x=0;
x<z.length*4;
x+=3){
var T=(((z[x>>2]>>8*(3-x%4))&255)<<16)|(((z[x+1>>2]>>8*(3-(x+1)%4))&255)<<8)|((z[x+2>>2]>>8*(3-(x+2)%4))&255);
for(var k=0;
k<4;
k++){
if(x*8+k*6>z.length*32){
O+=v
}else{
O+=q.charAt((T>>6*(3-k))&63)
}}}
return O
}
this.hex_sha1=c;
this.b64_sha1=h;
this.str_sha1=i;
this.hex_hmac_sha1=t;
this.b64_hmac_sha1=s;
this.str_hmac_sha1=u;
this.sha1_vm_test=e
};
AjxSHA1=new AjxSHA1()
}
if(AjxPackage.define("ajax.dwt.core.DwtDragTracker")){
DwtDragTracker=function(){};
DwtDragTracker.init=function(o,t,s,n,l,e,a){
var h=o._dragTrackerContext={};
var i=o.getHtmlElement();
if(t){
i.style.cursor=t
}
h.style=t;
h.threshX=(s>0)?s:1;
h.threshY=(n>0)?n:1;
h.data={
delta:{}
,userData:a};
h.captureObj=new DwtMouseEventCapture({
targetObj:o,mouseOverHdlr:DwtDragTracker._mouseOverHdlr,mouseDownHdlr:DwtDragTracker._mouseDownHdlr,mouseMoveHdlr:DwtDragTracker._mouseMoveHdlr,mouseUpHdlr:DwtDragTracker._mouseUpHdlr,mouseOutHdlr:DwtDragTracker._mouseOutHdlr}
);
o.setHandler(DwtEvent.ONMOUSEDOWN,DwtDragTracker._mouseDownHdlr);
o.setHandler(DwtEvent.ONMOUSEOVER,DwtDragTracker._mouseOverHdlr);
o.setHandler(DwtEvent.ONMOUSEOUT,DwtDragTracker._mouseOutHdlr);
h.callbackFunc=l;
h.callbackObj=e
};
DwtDragTracker.STYLE_NONE="auto";
DwtDragTracker.STYLE_MOVE="move";
DwtDragTracker.STYLE_RESIZE_NORTHWEST="nw-resize";
DwtDragTracker.STYLE_RESIZE_NORTH="n-resize";
DwtDragTracker.STYLE_RESIZE_NORTHEAST="ne-resize";
DwtDragTracker.STYLE_RESIZE_WEST="w-resize";
DwtDragTracker.STYLE_RESIZE_EAST="e-resize";
DwtDragTracker.STYLE_RESIZE_SOUTHWEST="sw-resize";
DwtDragTracker.STYLE_RESIZE_SOUTH="s-resize";
DwtDragTracker.STYLE_RESIZE_SOUTHEAST="se-resize";
DwtDragTracker.STATE_START=1;
DwtDragTracker.STATE_DRAGGING=2;
DwtDragTracker.STATE_END=3;
DwtDragTracker._mouseOverHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtDragTracker._mouseDownHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
if(t.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(a,true,false);
return false
}
var i=t.dwtObj;
if(i&&i._dragTrackerContext){
var e=i._dragTrackerContext;
if(e.callbackFunc!=null){
e.oldCapture=DwtMouseEventCapture.getCaptureObj();
if(e.oldCapture){
e.oldCapture.release()
}
e.captureObj.capture();
e.data.startDoc={
x:t.docX,y:t.docY};
e.data.state=DwtDragTracker.STATE_START;
DwtDragTracker._doCallback(e,t)
}}
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtDragTracker._doCallback=function(e,t){
e.data.mouseEv=t;
if(e.callbackObj!=null){
e.callbackFunc.call(e.callbackObj,e.data)
}else{
e.callbackFunc(e.data)
}
e.data.mouseEv=null
};
DwtDragTracker._mouseMoveHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a);
var o=DwtMouseEventCapture.getTargetObj();
var e=o._dragTrackerContext;
var i=e.data;
i.delta.x=t.docX-i.startDoc.x;
i.delta.y=t.docY-i.startDoc.y;
if(Math.abs(i.delta.x)>=e.threshX||Math.abs(i.delta.y)>=e.threshY){
i.prevState=i.state;
i.state=DwtDragTracker.STATE_DRAGGING;
DwtDragTracker._doCallback(e,t)
}
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtDragTracker._mouseUpHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a);
if(t.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(a,true,false);
return false
}
var e=DwtMouseEventCapture.getTargetObj()._dragTrackerContext;
if(e){
if(e.callbackFunc!=null){
DwtMouseEventCapture.getCaptureObj().release()
}
if(e.oldCapture){
e.oldCapture.capture();
e.oldCapture=null
}
e.data.state=DwtDragTracker.STATE_END;
DwtDragTracker._doCallback(e,t)
}
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtDragTracker._mouseOutHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
}
}
if(AjxPackage.define("ajax.dwt.events.DwtDateRangeEvent")){
DwtDateRangeEvent=function(e){
if(arguments.length==0){
return
}
DwtEvent.call(this,true);
this.reset()
};
DwtDateRangeEvent.prototype=new DwtEvent;
DwtDateRangeEvent.prototype.constructor=DwtDateRangeEvent;
DwtDateRangeEvent.prototype.toString=function(){
return"DwtDateRangeEvent"
};
DwtDateRangeEvent.prototype.reset=function(){
this.start=null;
this.end=null
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtColorPicker")){
DwtColorPicker=function(a,t,e,i,o){
if(arguments.length==0){
return
}
t=t||"DwtColorPicker";
DwtControl.call(this,{
parent:a,className:t,posStyle:e}
);
this._noFillLabel=i;
this._allowColorInput=o;
this._createColorTable();
this._registerEventHdlrs()
};
DwtColorPicker.prototype=new DwtControl;
DwtColorPicker.prototype.constructor=DwtColorPicker;
DwtColorPicker._RGB_RE=/rgb\(([0-9]{1,3}), ([0-9]{1,3}), ([0-9]{1,3})\)/;
DwtColorPicker._HEX_RE=/\#([0-9FCfc]{2})([0-9FCfc]{2})([0-9FCfc]{2})/;
DwtColorPicker._HEX_COMPLETE_RE=/\#([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})/;
DwtColorPicker.prototype.toString=function(){
return"DwtColorPicker"
};
DwtColorPicker.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtColorPicker.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtColorPicker.prototype.dispose=function(){
if(this._disposed){
return
}
DwtControl.prototype.dispose.call(this)
};
DwtColorPicker.prototype._registerEventHdlrs=function(){
var s=this.getHtmlElement().firstChild;
var h=s.rows;
var l=h.length;
for(var o=0;
o<l;
o++){
var a=h[o].cells;
var n=a.length;
for(var t=0;
t<n;
t++){
var e=a[t];
if(h[o].className=="ColorInput"){
if(e.className=="ColorInputField"){}else{
if(e.className=="SetInputColor"){
Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr)
}}}else{
Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr);
if(!AjxEnv.isIE){
Dwt.setHandler(e,DwtEvent.ONMOUSEOVER,DwtColorPicker._mouseOverHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEOUT,DwtColorPicker._mouseOutHdlr)
}else{
Dwt.setHandler(e,DwtEvent.ONMOUSEENTER,DwtColorPicker._mouseOverHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSELEAVE,DwtColorPicker._mouseOutHdlr)
}
if(e.className!="NoFill"){
e.style.border="2px outset "+e.style.backgroundColor
}}}}};
DwtColorPicker.prototype._createColorTable=function(){
this._tdId=Dwt.getNextId();
var t=new Array(150);
var e=0;
t[e++]="<table cellpadding='0' cellspacing='0' border='0' align='center'>";
if(this._noFillLabel){
t[e++]="<tr><td colspan='10' class='NoFill'>"+this._noFillLabel+"</td></tr>"
}
t[e++]="<tr>";
t[e++]="<td id='"+this._tdId+"#FFFFFF' style='background-color:#FFFFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCCCC' style='background-color:#FFCCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC99' style='background-color:#FFCC99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF99' style='background-color:#FFFF99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFFCC' style='background-color:#FFFFCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#99FF99' style='background-color:#99FF99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#99FFFF' style='background-color:#99FFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CCFFFF' style='background-color:#CCFFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CCCCFF' style='background-color:#CCCCFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCCFF' style='background-color:#FFCCFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#CCCCCC' style='background-color:#CCCCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF6666' style='background-color:#FF6666' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF9966' style='background-color:#FF9966' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF66' style='background-color:#FFFF66' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF33' style='background-color:#FFFF33' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#66FF99' style='background-color:#66FF99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33FFFF' style='background-color:#33FFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#66FFFF' style='background-color:#66FFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#9999FF' style='background-color:#9999FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF99FF' style='background-color:#FF99FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#C0C0C0' style='background-color:#C0C0C0' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF0000' style='background-color:#FF0000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF9900' style='background-color:#FF9900' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC66' style='background-color:#FFCC66' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF00' style='background-color:#FFFF00' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33FF33' style='background-color:#33FF33' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#66CCCC' style='background-color:#66CCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33CCFF' style='background-color:#33CCFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#6666CC' style='background-color:#6666CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC66CC' style='background-color:#CC66CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#999999' style='background-color:#999999' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC0000' style='background-color:#CC0000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF6600' style='background-color:#FF6600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC33' style='background-color:#FFCC33' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC00' style='background-color:#FFCC00' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33CC00' style='background-color:#33CC00' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#00CCCC' style='background-color:#00CCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#3366FF' style='background-color:#3366FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#6633FF' style='background-color:#6633FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC33CC' style='background-color:#CC33CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#666666' style='background-color:#666666' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#990000' style='background-color:#990000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC6600' style='background-color:#CC6600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC9933' style='background-color:#CC9933' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#999900' style='background-color:#999900' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#009900' style='background-color:#009900' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#339999' style='background-color:#339999' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#3333FF' style='background-color:#3333FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#6600CC' style='background-color:#6600CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#993399' style='background-color:#993399' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#333333' style='background-color:#333333' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#660000' style='background-color:#660000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#993300' style='background-color:#993300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#996633' style='background-color:#996633' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#666600' style='background-color:#666600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#006600' style='background-color:#006600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#336666' style='background-color:#336666' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#000099' style='background-color:#000099' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#333399' style='background-color:#333399' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#663366' style='background-color:#663366' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#000000' style='background-color:#000000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#330000' style='background-color:#330000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#663300' style='background-color:#663300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#663333' style='background-color:#663333' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#333300' style='background-color:#333300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#003300' style='background-color:#003300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#003333' style='background-color:#003333' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#000066' style='background-color:#000066' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#330099' style='background-color:#330099' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#330033' style='background-color:#330033' width='12' height='14'><img height='1' width='1'/></td>";
if(this._allowColorInput){
t[e++]="<tr><td></td></tr></tr><tr class='ColorInput'>";
t[e++]="<td colspan=6 id='"+this._tdId+".ColorInputField' class='ColorInputField'><input type=text size=15 maxlength=6 ></input></td><td colspan=4 id='"+this._tdId+".SetInputColor' class='SetInputColor'>"+AjxMsg.setColor+"</td>"
}
t[e++]="</tr></table>";
this.getHtmlElement().innerHTML=t.join("")
};
DwtColorPicker._mouseOverHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
var i=t.target;
if(i.nodeName.toLowerCase()=="img"){
i=i.parentNode
}
if(t.dwtObj._downTdId==i.id){
var e=i.style.backgroundColor;
i.style.backgroundColor=t.dwtObj._swappedColor;
t.dwtObj._swappedColor=e;
i.style.borderStyle="inset";
i.style.borderColor=e
}
this._stopPropagation=true;
this._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtColorPicker._mouseOutHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
var i=t.target;
if(i.nodeName.toLowerCase()=="img"){
i=i.parentNode
}
if(t.dwtObj._downTdId==i.id){
var e=i.style.backgroundColor;
i.style.backgroundColor=t.dwtObj._swappedColor;
t.dwtObj._swappedColor=e;
i.style.borderStyle="outset";
i.style.borderColor=e;
t.dwtObj._downTdId=null
}
this._stopPropagation=true;
this._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtColorPicker._mouseDownHdlr=function(s){
var n=DwtShell.mouseEvent;
n.setFromDhtmlEvent(s,true);
var h=n.target;
if(h.nodeName.toLowerCase()=="img"){
h=h.parentNode
}
var a=n.target.style.backgroundColor;
var t;
var o,i,e;
n.dwtObj._downTdId=h.id;
n.dwtObj._swappedColor=a;
h.style.borderStyle="inset";
if((h.className!="NoFill")&&(h.className!="SetInputColor")){
if(a.substr(0,1)=="#"){
t=a.match(DwtColorPicker._HEX_RE);
t[1]=DwtColorPicker._hexConv(t[1]);
t[2]=DwtColorPicker._hexConv(t[2]);
t[3]=DwtColorPicker._hexConv(t[3])
}else{
t=a.match(DwtColorPicker._RGB_RE)
}
o=Math.max(Math.floor(t[1]-(t[1]*0.25)),0);
i=Math.max(Math.floor(t[2]-(t[2]*0.25)),0);
e=Math.max(Math.floor(t[3]-(t[3]*0.25)),0);
a="rgb("+o+","+i+","+e+")";
h.style.backgroundColor=a
}
n._stopPropagation=true;
n._returnValue=false;
n.setToDhtmlEvent(s);
return false
};
DwtColorPicker._hexConv=function(e){
if(e=="00"){
return 0
}else{
if(e=="33"){
return 51
}else{
if(e=="66"){
return 102
}else{
if(e=="99"){
return 153
}else{
if(e.toUpperCase()=="CC"){
return 204
}else{
if(e.toUpperCase()=="FF"){
return 255
}else{
if(e.toUpperCase()=="C0"){
return 192
}}}}}}}};
DwtColorPicker._mouseUpHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
var e=t.dwtObj;
var o=t.target;
if(o.nodeName.toLowerCase()=="img"){
o=o.parentNode
}
if(e._downTdId==o.id){
o.style.borderStyle="outset";
o.style.borderColor=t.dwtObj._swappedColor;
o.style.backgroundColor=t.dwtObj._swappedColor
}
if(e._downTdId==o.id){
if(e.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
if(e.isListenerRegistered(DwtEvent.SELECTION)){
var i=DwtShell.selectionEvent;
DwtUiEvent.copy(i,t);
i.item=e;
if(o.id==(e._tdId+".SetInputColor")){
i.detail=e.getInputColor()
}else{
i.detail=t.target.id.substr(t.target.id.indexOf("#"))
}
e.notifyListeners(DwtEvent.SELECTION,i)
}}
e._downTdId=null;
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtColorPicker.prototype.getInputColor=function(){
var e=document.getElementById(this._tdId+".ColorInputField").firstChild;
var t="#"+e.value;
if(t.match(DwtColorPicker._HEX_COMPLETE_RE)!=null){
return t
}else{
return""
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtCheckbox")){
DwtCheckbox=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtCheckbox.PARAMS);
e.className=e.className||"DwtCheckbox";
DwtControl.call(this,e);
this._textPosition=DwtCheckbox.DEFAULT_POSITION;
this._initName=e.name;
this._initValue=e.value;
this._initChecked=e.checked;
this._createHtml()
};
DwtCheckbox.prototype=new DwtControl;
DwtCheckbox.prototype.constructor=DwtCheckbox;
DwtCheckbox.prototype.toString=function(){
return"DwtCheckbox"
};
DwtCheckbox.PARAMS=["parent","style","name","checked","className","posStyle","id","index","value"];
DwtCheckbox.TEXT_LEFT="left";
DwtCheckbox.TEXT_RIGHT="right";
DwtCheckbox.DEFAULT_POSITION=DwtCheckbox.TEXT_RIGHT;
DwtCheckbox.prototype.TEMPLATE="dwt.Widgets#DwtCheckbox";
DwtCheckbox.prototype.getTabGroupMember=function(){
return this._inputEl
};
DwtCheckbox.prototype.focus=function(){
if(this._inputEl){
this._inputEl.focus();
DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
}};
DwtCheckbox.prototype.blur=function(){
if(this._inputEl){
this._inputEl.blur()
}};
DwtCheckbox.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtCheckbox.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtCheckbox.prototype.setEnabled=function(e){
if(e!=this._enabled){
DwtControl.prototype.setEnabled.call(this,e);
this._inputEl.disabled=!e;
var t=e?"Text":"DisabledText";
if(this._textElLeft){
this._textElLeft.className=t
}
if(this._textElRight){
this._textElRight.className=t
}}};
DwtCheckbox.prototype.setSelected=function(e){
if(this._inputEl&&this._inputEl.checked!=e){
this._inputEl.checked=e
}};
DwtCheckbox.prototype.isSelected=function(){
return this._inputEl&&this._inputEl.checked
};
DwtCheckbox.prototype.setText=function(e){
if(this._textEl&&this._text!=e){
this._text=e;
this._textEl.innerHTML=e||""
}};
DwtCheckbox.prototype.getText=function(){
return this._text
};
DwtCheckbox.prototype.setTextPosition=function(e){
this._textEl=e==DwtCheckbox.TEXT_LEFT?this._textElLeft:this._textElRight;
if(this._textPosition!=e){
this._textPosition=e;
if(this._textElLeft){
this._textElLeft.innerHTML=""
}
if(this._textElRight){
this._textElRight.innerHTML=""
}
this.setText(this._text)
}};
DwtCheckbox.prototype.getTextPosition=function(){
return this._textPosition
};
DwtCheckbox.prototype.setValue=function(t){
var e=this._inputEl||this;
if(e.value!==t){
e.value=t
}};
DwtCheckbox.prototype.getValue=function(){
var e=this._inputEl||this;
return e.value!=null?e.value:this.getText()
};
DwtCheckbox.prototype.getInputElement=function(){
return this._inputEl
};
DwtCheckbox.prototype._replaceElementHook=function(t,a,e,i){
a=this.getInputElement();
DwtControl.prototype._replaceElementHook.call(this,t,a,e,i);
if(t.id){
this.setHtmlElementId(t.id+"_control");
a.id=t.id;
if(this._textEl){
this._textEl.setAttribute("for",t.id)
}}};
DwtCheckbox.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtCheckbox.prototype._createHtmlFromTemplate=function(t,a){
a.name=this._initName||this._htmlElId;
a.value=this._initValue;
a.checked=Boolean(this._initChecked)?"checked":"";
DwtControl.prototype._createHtmlFromTemplate.call(this,t,a);
this._inputEl=document.getElementById(a.id+"_input");
if(this._inputEl){
var e=DwtShell.getShell(window).getKeyboardMgr();
var i=AjxCallback.simpleClosure(e.grabFocus,e,this.getTabGroupMember());
Dwt.setHandler(this._inputEl,DwtEvent.ONFOCUS,i);
Dwt.setHandler(this._inputEl,DwtEvent.ONCLICK,DwtCheckbox.__handleClick)
}
this._textElLeft=document.getElementById(a.id+"_text_left");
this._textElRight=document.getElementById(a.id+"_text_right");
this.setTextPosition(this._textPosition)
};
DwtCheckbox.__handleClick=function(e){
var t=DwtUiEvent.getEvent(e);
var o=DwtUiEvent.getTarget(t);
var i=DwtShell.selectionEvent;
DwtUiEvent.copy(i,t);
i.item=this;
i.detail=o.checked;
var a=DwtControl.findControl(o);
a.setSelected(o.checked);
a.notifyListeners(DwtEvent.SELECTION,i)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButton")){
DwtRadioButton=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtRadioButton.PARAMS);
e.className=e.className||"DwtRadioButton";
DwtCheckbox.call(this,e)
};
DwtRadioButton.PARAMS=DwtCheckbox.PARAMS;
DwtRadioButton.prototype=new DwtCheckbox;
DwtRadioButton.prototype.constructor=DwtRadioButton;
DwtRadioButton.prototype.toString=function(){
return"DwtRadioButton"
};
DwtRadioButton.prototype.TEMPLATE="dwt.Widgets#DwtRadioButton"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtMessageDialog")){
DwtMessageDialog=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtMessageDialog.PARAMS);
this._msgCellId=Dwt.getNextId();
e.standardButtons=e.buttons||[DwtDialog.OK_BUTTON];
DwtDialog.call(this,e);
this.setContent(this._contentHtml());
this._msgCell=document.getElementById(this._msgCellId);
this.addEnterListener(new AjxListener(this,this._enterListener))
};
DwtMessageDialog.PARAMS=["parent","className","buttons","extraButtons"];
DwtMessageDialog.prototype=new DwtDialog;
DwtMessageDialog.prototype.constructor=DwtMessageDialog;
DwtMessageDialog.CRITICAL_STYLE=1;
DwtMessageDialog.INFO_STYLE=2;
DwtMessageDialog.WARNING_STYLE=3;
DwtMessageDialog.TITLE={};
DwtMessageDialog.TITLE[DwtMessageDialog.CRITICAL_STYLE]=AjxMsg.criticalMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.INFO_STYLE]=AjxMsg.infoMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.WARNING_STYLE]=AjxMsg.warningMsg;
DwtMessageDialog.ICON={};
DwtMessageDialog.ICON[DwtMessageDialog.CRITICAL_STYLE]="Critical_32";
DwtMessageDialog.ICON[DwtMessageDialog.INFO_STYLE]="Information_32";
DwtMessageDialog.ICON[DwtMessageDialog.WARNING_STYLE]="Warning_32";
DwtMessageDialog.prototype.toString=function(){
return"DwtMessageDialog"
};
DwtMessageDialog.prototype.setMessage=function(a,o,n){
o=o||DwtMessageDialog.INFO_STYLE;
n=n||DwtMessageDialog.TITLE[o];
this.setTitle(n);
if(a){
var t=[];
var e=0;
t[e++]="<table cellspacing=0 cellpadding=0 border=0><tr><td valign='top'>";
t[e++]=AjxImg.getImageHtml(DwtMessageDialog.ICON[o]);
t[e++]="</td><td class='DwtMsgArea'>";
t[e++]=a;
t[e++]="</td></tr></table>";
this._msgCell.innerHTML=t.join("")
}else{
this._msgCell.innerHTML=""
}};
DwtMessageDialog.prototype.setSize=function(t,e){
var a=document.getElementById(this._msgCellId);
if(a&&(t||e)){
Dwt.setSize(a,t,e)
}};
DwtMessageDialog.prototype.reset=function(){
this._msgCell.innerHTML="";
DwtDialog.prototype.reset.call(this)
};
DwtMessageDialog.prototype.handleKeyAction=function(e,t){
if((e==DwtKeyMap.CANCEL)&&!this._button[DwtDialog.CANCEL_BUTTON]){
e=DwtKeyMap.ENTER
}
switch(e){
case DwtKeyMap.CANCEL:this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
break;
default:DwtDialog.prototype.handleKeyAction.call(this,e,t);
break
}
return true
};
DwtMessageDialog.prototype._contentHtml=function(){
return"<div id='"+this._msgCellId+"' class='DwtMsgDialog'></div>"
};
DwtMessageDialog.prototype._enterListener=function(e){
this._runEnterCallback()
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtHtmlEditor")){
DwtHtmlEditor=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtHtmlEditor.PARAMS);
this.setBlankIframeSrc(e.blankIframeSrc);
e.className=e.className||"DwtHtmlEditor";
DwtComposite.call(this,e);
this._mode=(e.mode==DwtHtmlEditor.HTML&&this.isHtmlEditingSupported())?e.mode:DwtHtmlEditor.TEXT;
this.__eventClosure=AjxCallback.simpleClosure(this.__eventClosure,this);
this._pendingContent=e.content||"";
this._htmlModeInited=false;
this._initialize()
};
DwtHtmlEditor.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
DwtHtmlEditor.prototype=new DwtComposite();
DwtHtmlEditor.prototype.constructor=DwtHtmlEditor;
DwtHtmlEditor.HTML="text/html";
DwtHtmlEditor.TEXT="text/plain";
DwtHtmlEditor.H1=1;
DwtHtmlEditor.H2=2;
DwtHtmlEditor.H3=3;
DwtHtmlEditor.H4=4;
DwtHtmlEditor.H5=5;
DwtHtmlEditor.H6=6;
DwtHtmlEditor.PARAGRAPH=7;
DwtHtmlEditor.ADDRESS=8;
DwtHtmlEditor.PREFORMATTED=9;
DwtHtmlEditor._STYLES=["","<h1>","<h2>","<h3>","<h4>","<h5>","<h6>","<p>","<address>","<pre>"];
DwtHtmlEditor.BOLD_STYLE="bold";
DwtHtmlEditor.ITALIC_STYLE="italic";
DwtHtmlEditor.UNDERLINE_STYLE="underline";
DwtHtmlEditor.STRIKETHRU_STYLE="strikethrough";
DwtHtmlEditor.SUBSCRIPT_STYLE="subscript";
DwtHtmlEditor.SUPERSCRIPT_STYLE="superscript";
DwtHtmlEditor.JUSTIFY_LEFT="justifyleft";
DwtHtmlEditor.JUSTIFY_CENTER="justifycenter";
DwtHtmlEditor.JUSTIFY_RIGHT="justifyright";
DwtHtmlEditor.JUSTIFY_FULL="justifyfull";
DwtHtmlEditor.OUTDENT="outdent";
DwtHtmlEditor.INDENT="indent";
DwtHtmlEditor.HORIZ_RULE="inserthorizontalrule";
DwtHtmlEditor.ORDERED_LIST="insertorderedlist";
DwtHtmlEditor.UNORDERED_LIST="insertunorderedlist";
DwtHtmlEditor.IMAGE="insertimage";
DwtHtmlEditor.BORDER_TOP=0;
DwtHtmlEditor.BORDER_MIDDLE=1;
DwtHtmlEditor.BORDER_BOTTOM=2;
DwtHtmlEditor.BORDER_LEFT=3;
DwtHtmlEditor.BORDER_CENTER=4;
DwtHtmlEditor.BORDER_RIGHT=5;
DwtHtmlEditor._H1_RE=/Heading 1|h1/;
DwtHtmlEditor._H2_RE=/Heading 2|h2/;
DwtHtmlEditor._H3_RE=/Heading 2|h3/;
DwtHtmlEditor._H4_RE=/Heading 2|h4/;
DwtHtmlEditor._H5_RE=/Heading 2|h5/;
DwtHtmlEditor._H6_RE=/Heading 2|h6/;
DwtHtmlEditor._PARAGRAPH_RE=/Normal|p/;
DwtHtmlEditor._ADDRESS_RE=/Address|address/;
DwtHtmlEditor._PREFORMATTED_RE=/Formatted|pre/;
DwtHtmlEditor._FONT_NAME="fontname";
DwtHtmlEditor._FONT_SIZE="fontsize";
DwtHtmlEditor._FONT_COLOR="forecolor";
DwtHtmlEditor._FONT_HILITE="hilitecolor";
DwtHtmlEditor._FONT_HILITE_IE="backcolor";
DwtHtmlEditor._FORMAT_BLOCK="formatblock";
DwtHtmlEditor._INITDELAY=50;
DwtHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
DwtHtmlEditor._BLOCK_ELEMENTS={
address:1,body:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,iframe:1,li:1,ol:1,p:1,pre:1,quote:1,table:1,tbody:1,td:1,textarea:1,tfoot:1,thead:1,tr:1,ul:1};
DwtHtmlEditor._ACTION_CODE_TO_CMD={};
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_BOLD]=DwtHtmlEditor.BOLD_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_ITALIC]=DwtHtmlEditor.ITALIC_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_UNDERLINE]=DwtHtmlEditor.UNDERLINE_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_STRIKETHRU]=DwtHtmlEditor.STRIKETHRU_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_LEFT]=DwtHtmlEditor.JUSTIFY_LEFT;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_CENTER]=DwtHtmlEditor.JUSTIFY_CENTER;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_RIGHT]=DwtHtmlEditor.JUSTIFY_RIGHT;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER1]=DwtHtmlEditor._STYLES[1];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER2]=DwtHtmlEditor._STYLES[2];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER3]=DwtHtmlEditor._STYLES[3];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER4]=DwtHtmlEditor._STYLES[4];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER5]=DwtHtmlEditor._STYLES[5];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER6]=DwtHtmlEditor._STYLES[6];
DwtHtmlEditor.INIT_HTML=["<html><head><title>ZWC</title></head><body><p>",AjxEnv.isGeckoBased?"<br type='_moz' />":"","</p></body></html>"].join("");
DwtHtmlEditor.prototype.focus=function(){
if(!AjxEnv.isIE&&this._mode==DwtHtmlEditor.TEXT){
document.getElementById(this._textAreaId).focus()
}else{
try{
if(!this._htmlModeInited){
setTimeout(AjxCallback.simpleClosure(this.focus,this),DwtHtmlEditor._INITDELAY);
return
}
if(AjxEnv.isSafari){
document.getElementById(this._iFrameId).focus()
}else{
this._getIframeWin().focus()
}
if(AjxEnv.isIE){
if(this._currInsPt){
if(this._currInsPt.text.length<=1){
this._currInsPt.collapse(false)
}
this._currInsPt.select()
}}}
catch(e){}}};
DwtHtmlEditor.prototype.moveCaretToTop=function(){
var o=document.activeElement;
if(this._mode==DwtHtmlEditor.TEXT){
var i=document.getElementById(this._textAreaId);
if(i.createTextRange){
var t=i.createTextRange();
t.collapse(true);
t.select()
}else{
if(i.setSelectionRange){
i.setSelectionRange(0,0)
}}}else{
this._moveCaretToTopHtml(true)
}
if(o){
try{
o.focus()
}
catch(a){}}};
DwtHtmlEditor.prototype._moveCaretToTopHtml=function(t){
var e=this._getIframeDoc().body;
var o=false;
if(AjxEnv.isIE){
if(e){
e.createTextRange().collapse(true);
o=true
}}else{
var a=this._getSelection();
if(a){
a.collapse(e,0);
o=true
}}
if(!o&&t){
var i=new AjxTimedAction(this,this._moveCaretToTopHtml);
AjxTimedAction.scheduleAction(i,DwtHtmlEditor._INITDELAY+1)
}};
DwtHtmlEditor.prototype.addStateChangeListener=function(e){
this.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtHtmlEditor.prototype.removeStateChangeListener=function(e){
this.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtHtmlEditor.prototype.clear=function(){
this.setContent("")
};
DwtHtmlEditor.prototype.enable=function(e){
if(this._textAreaId!=null){
document.getElementById(this._textAreaId).disabled=!e
}
if(this._iFrameId!=null){
document.getElementById(this._iFrameId).disabled=!e
}};
DwtHtmlEditor.prototype.setBlankIframeSrc=function(e){
this._blankIframeSrc=e
};
DwtHtmlEditor.prototype.isHtmlEditingSupported=function(){
return(!!(AjxEnv.isGeckoBased||AjxEnv.isIE||AjxEnv.isSafari3up))
};
DwtHtmlEditor.prototype.getContent=function(){
if(this._mode==DwtHtmlEditor.HTML){
var a=this._getIframeDoc();
var e=a&&a.body?(this._getIframeDoc().body.innerHTML):"";
return this._embedHtmlContent(e)
}else{
var t=document.getElementById(this._textAreaId);
return t&&t.value
}};
DwtHtmlEditor.prototype._embedHtmlContent=function(e){
return["<html><body>",e,"</body></html>"].join("")
};
DwtHtmlEditor.prototype.setContent=function(e){
if(AjxEnv.isIE){
this._currInsPt=null
}
if(this._mode==DwtHtmlEditor.HTML){
this._pendingContent=e||"";
if(this._htmlModeInited){
this._setContentOnTimer()
}}else{
document.getElementById(this._textAreaId).value=(e||"")
}};
DwtHtmlEditor.prototype.insertElement=function(e){
this._execCommand(e)
};
DwtHtmlEditor.prototype.insertText=function(a,e){
var t=this._getIframeDoc().createTextNode(a);
this._insertNodeAtSelection(t,e)
};
DwtHtmlEditor.prototype.insertImage=function(n,s,a,e){
if(s){
var i=this._getIframeDoc();
var t=i.createElement("img");
if(n&&n.indexOf("cid:")==0){
t.setAttribute("dfsrc",n)
}else{
t.setAttribute("src",n)
}
if(a){
t.width=a
}else{
t.removeAttribute("width")
}
if(e){
t.height=e
}else{
t.removeAttribute("height")
}
var o=i.createDocumentFragment();
o.appendChild(t);
this._insertNodeAtSelection(o)
}else{
this._execCommand(DwtHtmlEditor.IMAGE,n)
}};
DwtHtmlEditor.prototype.insertTable=function(b,m,a,t,l,u){
if(this._mode!=DwtHtmlEditor.HTML){
return
}
var g=this._getIframeDoc();
var y=g.createElement("table");
y.style.borderRight="1px solid #000";
y.style.borderLeft="1px solid #000";
y.style.borderTop="1px solid #000";
y.style.borderBottom="1px solid #000";
if(a!=null){
y.style.width=a
}else{
y.style.width="100%"
}
y.style.textAlign="left";
y.style.verticalAlign="middle";
if(u!=null){
y.align=u.toLowerCase()
}
if(t!=null){
y.cellSpacing=t
}else{
y.cellSpacing=0
}
if(l!=null){
y.cellPadding=l
}else{
y.cellPadding=0
}
if(!AjxEnv.isIE){
y.style.border="1px solid #000"
}
y.style.borderCollapse="collapse";
var c;
c=Math.floor(100/m)+"%";
var h=g.createElement("tbody");
y.appendChild(h);
for(var s=0;
s<b;
s++){
var d=g.createElement("tr");
h.appendChild(d);
for(var n=0;
n<m;
n++){
var o=g.createElement("td");
if(s==0&&c){
o.style.width=c
}
if(AjxEnv.isGeckoBased){
o.appendChild(g.createElement("br"))
}else{
if(AjxEnv.isIE){
o.innerHTML="&nbsp;"
}}
if(AjxEnv.isIE){
o.style.border="1px solid #000"
}else{
o.style.borderTop=o.style.borderLeft="1px solid #000"
}
d.appendChild(o)
}}
var e=g.createElement("br");
var f=g.createDocumentFragment();
f.appendChild(e);
f.appendChild(y);
f.appendChild(e.cloneNode(true));
this._insertNodeAtSelection(f);
this.selectNodeContents(y.rows[0].cells[0],true);
return y
};
DwtHtmlEditor.prototype.applyTableProperties=function(d,l){
var c=this._getIframeDoc();
var h=[];
for(var s in l){
var e=AjxStringUtil.trim(l[s].toString());
var t=e!="";
switch(s){
case"caption":var u=d.getElementsByTagName("caption");
u=u.length>0?u[0]:null;
if(t&&!u){
u=c.createElement("caption");
d.insertBefore(u,d.firstChild)
}
if(!t&&u){
u.parentNode.removeChild(u)
}
if(u){
u.innerHTML=e
}
break;
case"summary":case"align":case"cellSpacing":case"cellPadding":if(!t){
d.removeAttribute(s,0)
}else{
d[s]=e
}
break;
case"borderWidth":case"borderStyle":case"borderColor":d.style[s]=e;
h.push([s,e]);
break;
default:d.style[s]=e;
break
}}
if(h.length>0){
var n=d.getElementsByTagName("td");
for(var s=n.length;
--s>=0;
){
var a=n[s];
for(var o=h.length;
--o>=0;
){
a.style[h[o][0]]=h[o][1]
}}}
if(AjxEnv.isGeckoBased){
this._forceRedraw()
}};
DwtHtmlEditor.prototype.applyCellProperties=function(d,u,n){
var s=true;
for(var a=u.length;
--a>=0;
){
var m=u[a];
var o=(a==0);
var c=true;
for(var t=m.length;
--t>=0;
){
var l=(t==0);
var e=m[t];
if(n.backgroundColor!=null){
e.style.backgroundColor=n.backgroundColor
}
if(n.color!=null){
e.style.color=n.color
}
if(n.textAlign!=null){
e.style.textAlign=n.textAlign
}
if(n.verticalAlign!=null){
e.style.verticalAlign=n.verticalAlign
}
if(n.width!=null){
if(n.width){
e.style.width=n.width+"px"
}else{
e.style.width=""
}}
if(n.height!=null){
if(n.height){
e.style.height=n.height+"px"
}else{
e.style.height=""
}}
if(n.vertPadding!=null){
if(n.vertPadding){
e.style.paddingTop=e.style.paddingBottom=n.vertPadding+"px"
}else{
e.style.paddingTop=e.style.paddingBottom=""
}}
if(n.horizPadding!=null){
if(n.horizPadding){
e.style.paddingLeft=e.style.paddingRight=n.horizPadding+"px"
}else{
e.style.paddingLeft=e.style.paddingRight=""
}}
var i=n.borders,h;
h=i[DwtHtmlEditor.BORDER_TOP];
if(h!=null&&o){
e.style.borderTop=h.width+" "+h.style+" "+h.color
}
h=i[DwtHtmlEditor.BORDER_MIDDLE];
if(h!=null){
h=h.width+" "+h.style+" "+h.color;
if(!s){
e.style.borderBottom=h
}
if(!o){
e.style.borderTop=h
}}
h=i[DwtHtmlEditor.BORDER_BOTTOM];
if(h!=null&&s){
e.style.borderBottom=h.width+" "+h.style+" "+h.color
}
h=i[DwtHtmlEditor.BORDER_LEFT];
if(h!=null&&l){
e.style.borderLeft=h.width+" "+h.style+" "+h.color
}
h=i[DwtHtmlEditor.BORDER_CENTER];
if(h!=null){
h=h.width+" "+h.style+" "+h.color;
if(!c){
e.style.borderRight=h
}
if(!l){
e.style.borderLeft=h
}}
h=i[DwtHtmlEditor.BORDER_RIGHT];
if(h!=null&&c){
e.style.borderRight=h.width+" "+h.style+" "+h.color
}
c=false
}
s=false
}
if(AjxEnv.isGeckoBased){
this._forceRedraw()
}};
DwtHtmlEditor.prototype._insertHTML=function(a){
var i=this._getSelection();
var e=this._createRange(i);
if(AjxEnv.isIE){
if(this.insertRange){
this.insertRange.pasteHTML(a)
}else{
e.pasteHTML(a)
}}else{
var n=this._getIframeDoc();
var t=n.createDocumentFragment();
var o=n.createElement("div");
o.innerHTML=a;
while(o.firstChild){
t.appendChild(o.firstChild)
}
this._insertNodeAtSelection(t)
}};
DwtHtmlEditor.prototype._insertNodeAtSelection=function(n,t){
this.focus();
if(!AjxEnv.isIE){
var a=this._getRange();
var s=this._getIframeWin().getSelection();
s.removeAllRanges();
try{
a.deleteContents();
a.insertNode(n);
a.selectNode(n);
if(t){
s.addRange(a)
}}
catch(h){}}else{
var s=this._getRange();
var a=s.createRange();
var l="FOO-"+Dwt.getNextId();
try{
a.pasteHTML("<span id='"+l+"'></span>")
}
catch(i){
a.collapse(false);
a.pasteHTML("<span id='"+l+"'></span>")
}
var o=this._getIframeDoc().getElementById(l);
o.parentNode.insertBefore(n,o);
o.parentNode.removeChild(o)
}};
DwtHtmlEditor.prototype.isHtmlModeInited=function(){
return this._htmlModeInited
};
DwtHtmlEditor.prototype.setMode=function(n,i){
if(n==this._mode||(n!=DwtHtmlEditor.HTML&&n!=DwtHtmlEditor.TEXT)){
return
}
var t=this._getIframeDoc();
this._mode=n;
if(n==DwtHtmlEditor.HTML){
var o=document.getElementById(this._textAreaId);
var e;
if(this._iFrameId){
t.body.innerHTML=i?AjxStringUtil.convertToHtml(o.value):o.value;
e=document.getElementById(this._iFrameId)
}else{
var a=i?AjxStringUtil.convertToHtml(o.value):o.value;
e=this._initHtmlMode(a)
}
Dwt.setVisible(o,false);
Dwt.setVisible(e,true);
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
this._enableDesignMode(t)
}}else{
var o=this._textAreaId?document.getElementById(this._textAreaId):this._initTextMode(true);
o.value=i?this._convertHtml2Text():t.innerHTML;
Dwt.setVisible(document.getElementById(this._iFrameId),false);
Dwt.setVisible(o,true)
}};
DwtHtmlEditor.prototype.getMode=function(){
return this._mode
};
DwtHtmlEditor.prototype.setFont=function(o,i,a,e,t){
if(o){
this._execCommand(DwtHtmlEditor._FONT_NAME,o)
}
if(i){
this._execCommand(i)
}
if(a){
this._execCommand(DwtHtmlEditor._FONT_SIZE,a)
}
if(e){
this._execCommand(DwtHtmlEditor._FONT_COLOR,e)
}
if(t){
this._execCommand((AjxEnv.isIE)?DwtHtmlEditor._FONT_HILITE_IE:DwtHtmlEditor._FONT_HILITE,t)
}};
DwtHtmlEditor.prototype.setJustification=function(e){
this._execCommand(e)
};
DwtHtmlEditor.prototype.setIndent=function(e){
this._execCommand(e)
};
DwtHtmlEditor.prototype.setStyle=function(e){
this._execCommand(DwtHtmlEditor._FORMAT_BLOCK,DwtHtmlEditor._STYLES[e])
};
DwtHtmlEditor.prototype.setSize=function(a,t){
DwtComposite.prototype.setSize.call(this,a,t);
var i=this.getHtmlElement();
if(this._iFrameId!=null){
var e=document.getElementById(this._iFrameId);
e.width=i.style.width;
e.height=i.style.height
}else{
var o=document.getElementById(this._textAreaId);
o.style.width=i.style.width;
o.style.height=i.style.height
}};
DwtHtmlEditor.prototype.getIframe=function(){
return document.getElementById(this._iFrameId)
};
DwtHtmlEditor.prototype.getInputElement=function(){
var e=(this._mode==DwtHtmlEditor.HTML)?this._iFrameId:this._textAreaId;
return document.getElementById(e)
};
DwtHtmlEditor.prototype._initialize=function(){
if(this._mode==DwtHtmlEditor.HTML){
this._initHtmlMode(this._pendingContent)
}else{
this._initTextMode()
}};
DwtHtmlEditor.prototype.TEXTAREA_CLASSNAME="DwtHtmlEditorTextArea";
DwtHtmlEditor.prototype._initTextMode=function(t){
var e=this.getHtmlElement();
this._textAreaId="textarea_"+Dwt.getNextId();
var a=document.createElement("textarea");
a.className=this.TEXTAREA_CLASSNAME;
a.id=this._textAreaId;
e.appendChild(a);
if(!t){
a.value=this._pendingContent;
this._pendingContent=null
}
return a
};
DwtHtmlEditor.prototype._initHtmlMode=function(a){
this._pendingContent=a||"";
this._keyEvent=new DwtKeyEvent();
this._stateEvent=new DwtHtmlEditorStateEvent();
this._stateEvent.dwtObj=this;
this._updateStateAction=new AjxTimedAction(this,this._updateState);
var i=this.getHtmlElement();
this._iFrameId="iframe_"+Dwt.getNextId();
var t=document.createElement("iframe");
t.id=this._iFrameId;
t.className="DwtHtmlEditorIFrame";
t.setAttribute("border","0",false);
t.setAttribute("frameborder","0",false);
t.setAttribute("vspace","0",false);
t.setAttribute("autocomplete","off",false);
var e=AjxCallback.simpleClosure(this._finishHtmlModeInit,this);
setTimeout(e,DwtHtmlEditor._INITDELAY);
t.src=this._blankIframeSrc||"";
i.appendChild(t);
return t
};
DwtHtmlEditor.prototype._finishHtmlModeInit=function(){
var a=this._getIframeDoc();
try{
if(AjxEnv.isSafari&&a.body==null){
a.open();
a.write("<html><head></head><body></body></html>");
a.close()
}}
catch(t){
return
}
if(AjxEnv.isGeckoBased){
a.open();
a.write(DwtHtmlEditor.INIT_HTML);
a.close()
}
function e(i){
this._enableDesignMode(i);
this._setContentOnTimer();
this._updateState();
this._htmlModeInited=true;
this._registerEditorEventHandlers(document.getElementById(this._iFrameId),i)
}
setTimeout(AjxCallback.simpleClosure(e,this,a),DwtHtmlEditor._INITDELAY*4)
};
DwtHtmlEditor.prototype._focus=function(){
this.focus()
};
DwtHtmlEditor.prototype._getIframeDoc=function(){
return this._iFrameId?Dwt.getIframeDoc(document.getElementById(this._iFrameId)):null
};
DwtHtmlEditor.prototype._getIframeWin=function(){
return Dwt.getIframeWindow(document.getElementById(this._iFrameId))
};
DwtHtmlEditor.prototype._getParentElement=function(){
if(AjxEnv.isIE){
var n=this._getIframeDoc();
var a=n.selection;
var t=a.createRange();
if(a.type=="None"||a.type=="Text"){
return a.createRange().parentElement()
}
if(a.type=="Control"){
return a.createRange().item(0)
}
return n.body
}else{
try{
var t=this._getRange();
var o=t.commonAncestorContainer;
if(!t.collapsed&&t.startContainer==t.endContainer&&t.startOffset-t.endOffset<=1&&t.startContainer.hasChildNodes()){
o=t.startContainer.childNodes[t.startOffset]
}
while(o.nodeType==3){
o=o.parentNode
}
return o
}
catch(i){
return null
}}};
DwtHtmlEditor.prototype.getNearestElement=function(t){
try{
var a=this._getParentElement();
t=t.toLowerCase();
while(a&&a.nodeName.toLowerCase()!=t){
a=a.parentNode
}
return a
}
catch(e){
return null
}};
DwtHtmlEditor.prototype.selectNodeContents=function(a,n,e){
var t;
var o=(typeof n=="boolean");
if(AjxEnv.isIE){
t=this._getIframeDoc().body.createTextRange();
t.moveToElementText(a);
(o)&&t.collapse(n);
t.select()
}else{
var i=this._getSelection();
t=this._getIframeDoc().createRange();
if(e){
t.selectNode(a)
}else{
t.selectNodeContents(a)
}
(o)&&t.collapse(n);
i.removeAllRanges();
i.addRange(t)
}};
DwtHtmlEditor.prototype._forceRedraw=function(){
var e=this._getIframeDoc().body;
e.style.display="none";
var t=this;
setTimeout(function(){
e.style.display="";
t.focus();
t=null
}
,10)
};
DwtHtmlEditor.prototype.getSelectedCells=function(){
var l=null;
var e=this._getSelection();
var s,n=0;
var a=1000;
var d=[];
var c=null;
if(!AjxEnv.isIE){
try{
for(n=0;
(s=e.getRangeAt(n))&&n<a;
n++){
var t=s.startContainer.childNodes[s.startOffset];
if(t){
if(t.parentNode!=c){
c=t.parentNode;
l&&d.push(l);
l=[]
}
if(t.tagName&&/^td$/i.test(t.tagName)){
l.push(t)
}}}}
catch(h){}
d.push(l)
}else{
s=e.createRange();
var o=s.duplicate();
s.collapse(true);
for(n=0;
o.compareEndPoints("EndToStart",s)>=0&&n<a;
n++){
var t=s.parentElement();
while(t&&t.nodeName.toLowerCase()!="td"){
t=t.parentNode
}
if(t){
if(t.parentNode!=c){
c=t.parentNode;
l&&d.push(l);
l=[]
}
l.push(t);
s.moveToElementText(t);
s.collapse(false)
}
if(s.move("character",1)==0){
break
}}
o.select();
d.push(l)
}
if(d.length==0||!d[0]||d[0].length==0){
l=this.getNearestElement("td");
if(l){
d=[[l]]
}}
return d
};
DwtHtmlEditor.prototype._splitCells=function(n){
var i=n;
while(i&&i.nodeName.toLowerCase()!="table"){
i=i.parentNode
}
var e=AjxEnv.isGeckoBased?"<br />":"";
function t(m){
var u=m.rowSpan;
var d=m.colSpan;
m.rowSpan=1;
tr=m.parentNode;
var l=tr.rowIndex;
var s=tr.parentNode.rows;
var h=m.cellIndex;
while(--u>0){
tr=s[++l];
var c=m.cloneNode(false);
c.removeAttribute("rowspan");
c.colSpan=m.colSpan;
c.innerHTML=e;
tr.insertBefore(c,tr.cells[h])
}}
function o(c){
var l=c.colSpan;
c.colSpan=1;
tr=c.parentNode;
var h=c.nextSibling;
while(--l>0){
var s=c.cloneNode(false);
s.removeAttribute("colspan");
s.rowSpan=c.rowSpan;
s.innerHTML=e;
tr.insertBefore(s,h)
}}
function a(c){
var l=c.colSpan;
o(c);
var s=c.parentNode.cells;
var h=c.cellIndex;
while(l-->0){
t(s[h++])
}}
a(n)
};
DwtHtmlEditor.prototype.doTableOperation=function(e,a){
var d=a.table||this.getNearestElement("table");
var t=a.td||this.getNearestElement("td");
var l,c,h;
if(t){
l=t.cellIndex;
h=t.parentNode;
c=h.rowIndex
}else{
l=0;
h=this.getNearestElement("tr");
if(h){
c=h.rowIndex
}}
var u=a.cells;
while(true){
switch(e){
case"insertRowAbove":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t));
break;
case"insertRowUnder":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t,true));
break;
case"insertColumnBefore":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t));
break;
case"insertColumnAfter":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t,true));
break;
case"deleteRow":for(var n=0;
n<u.length;
++n){
var t=DwtHtmlEditor.table_deleteRow(u[n][0]);
if(t){
this.selectNodeContents(t,true);
this.focus()
}}
break;
case"deleteColumn":for(var n=0;
n<u[0].length;
++n){
var t=DwtHtmlEditor.table_deleteCol(u[0][n]);
if(t){
this.selectNodeContents(t,true);
this.focus()
}}
break;
case"mergeCells":t=u[0][0];
var s=[t.innerHTML.replace(/<br>$/i,"")];
for(var n=0;
n<u.length;
++n){
var m=u[n];
for(var o=0;
o<m.length;
++o){
if(n||o){
s.push(m[o].innerHTML.replace(/<br>$/i,""));
m[o].parentNode.removeChild(m[o])
}}}
t.colSpan=u[0].length;
t.rowSpan=u.length;
s=s.join(" ");
if(AjxEnv.isGeckoBased){
s+="<br/>"
}
t.innerHTML=s;
this.selectNodeContents(t,true);
break;
case"splitCells":this._splitCells(t);
break;
case"deleteTable":if(!AjxEnv.isIE){
this.selectNodeContents(d,null,true);
this.deleteSelectedNodes()
}else{
d.parentNode.removeChild(d)
}
break
}
break
}
if(AjxEnv.isGeckoBased){
this._forceRedraw()
}
this._updateState()
};
DwtHtmlEditor.prototype._getRange=function(){
var i=this._getIframeDoc();
if(AjxEnv.isIE){
return i.selection
}else{
this.focus();
var t=this._getIframeWin().getSelection();
if(t!=null){
try{
return t.getRangeAt(0)
}
catch(a){
return i.createRange()
}}else{
return i.createRange()
}}};
DwtHtmlEditor.prototype._createRange=function(t){
var i=this._getIframeDoc();
if(AjxEnv.isIE){
return t.createRange()
}else{
this.focus();
if(t!=null){
try{
return t.getRangeAt(0)
}
catch(a){
return i.createRange()
}}else{
return i.createRange()
}}};
DwtHtmlEditor.prototype.deleteSelectedNodes=function(){
var e=this._getSelection();
if(AjxEnv.isGeckoBased){
e.deleteFromDocument()
}else{
e.clear()
}};
DwtHtmlEditor.prototype._getSelection=function(){
if(AjxEnv.isIE){
return this._getIframeDoc().selection
}else{
return this._getIframeWin().getSelection()
}};
DwtHtmlEditor.prototype.__eventClosure=function(e){
return this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e)
};
DwtHtmlEditor.prototype._registerEditorEventHandlers=function(e,o){
var a=["mouseup","drag","mousedown","keydown"];
if(!AjxEnv.isIE7up){
a.push("keypress")
}
for(var t=0;
t<a.length;
++t){
this._registerEditorEventHandler(o,a[t])
}};
DwtHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
if(AjxEnv.isIE){
t.attachEvent("on"+e,this.__eventClosure)
}else{
t.addEventListener(e,this.__eventClosure,true)
}};
DwtHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
if(AjxEnv.isIE){
t.detachEvent("on"+e,this.__eventClosure)
}else{
t.removeEventListener(e,this.__eventClosure,true)
}};
DwtHtmlEditor.prototype._handleEditorEvent=function(d){
var i=true;
if(d.type=="mousedown"){
DwtMenu._outsideMouseDownListener(d)
}
if(d.type=="mouseup"){
var t=DwtShell.getShell(window).getKeyboardMgr();
if(AjxEnv.isIE){
t.__focusObj=this
}else{
t.grabFocus(this)
}}
if(d.type=="contextmenu"){
var m=DwtShell.mouseEvent;
m.setFromDhtmlEvent(d);
var c=Dwt.getLocation(document.getElementById(this._iFrameId));
if(!AjxEnv.isIE){
var u=this._getIframeDoc();
var n=u.documentElement.scrollLeft||u.body.scrollLeft;
var p=u.documentElement.scrollTop||u.body.scrollTop;
c.x-=n;
c.y-=p
}
m.docX+=c.x;
m.docY+=c.y;
DwtControl.__mouseEvent(d,DwtEvent.ONCONTEXTMENU,this,m);
i=m._returnValue
}
var o=null;
if(DwtKeyEvent.isKeyPressEvent(d)){
var h=this._keyEvent;
h.setFromDhtmlEvent(d);
if(AjxEnv.isGeckoBased&&d.keyCode==13){
this._stateEvent._ignoreCommandState=true;
var e=this._getRange(),a=e.startContainer,l=/^h[1-6]$/i;
if((a.nodeType==3&&l.test(a.parentNode.tagName))||l.test(a.tagName)){
var f=this;
setTimeout(function(){
var y=f._getIframeDoc();
y.body.style.display="none";
y.body.style.display="";
var g=f._getSelection();
g.removeAllRanges();
g.addRange(e)
}
,5)
}}}
if(d.type=="keydown"){
if(d.keyCode==9){
if(AjxEnv.isIE){
this._handleIETabKey(!d.shiftKey);
h._stopPropagation=true;
h._returnValue=false;
h.setToDhtmlEvent(d);
i=false
}}else{
if(DwtKeyboardMgr.isPossibleInputShortcut(d)){
i=DwtKeyboardMgr.__keyDownHdlr(d)
}}}
if(AjxEnv.isIE){
var s=this._getIframeDoc();
this._currInsPt=s.selection.createRange();
if(s.selection.type=="None"){
this._currInsPt.collapse(false)
}}
if(this._stateUpdateActionId!=null){
AjxTimedAction.cancelAction(this._stateUpdateActionId)
}
this._stateUpdateActionId=AjxTimedAction.scheduleAction(this._updateStateAction,100);
if(window.DwtIdleTimer){
DwtIdleTimer.resetIdle()
}
return i
};
DwtHtmlEditor.prototype.getKeyMapName=function(){
return"DwtHtmlEditor"
};
DwtHtmlEditor.prototype.handleKeyAction=function(t,a){
var o="",i="";
if(t==DwtKeyMap.SWITCH_MODE){
try{
this.setMode((this._mode==DwtHtmlEditor.HTML)?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML,true)
}
catch(n){}}else{
if(t.indexOf("Header")==0){
o=DwtHtmlEditor._FORMAT_BLOCK;
i=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
}else{
o=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
}}
if(o){
this._execCommand(o,i);
return true
}
return false
};
DwtHtmlEditor.prototype._handleIETabKey=function(n){
var l=this._getIframeDoc();
var i=this._getParentElement();
var c=i.parentNode;
var d=i.tagName.toLowerCase();
if(d=="p"||d=="body"){
if(n){
this._insertHTML("&nbsp;&nbsp;&nbsp;")
}}else{
if(d=="li"){
this._execCommand((n)?"Indent":"Outdent","")
}else{
try{
var t=this._getAllAncestors();
var s=this._locateNode(t,"td");
if(s!=null){
i=s;
c=i.parentNode;
d=i.tagName.toLowerCase();
if(d=="td"){
var e=(n?i.nextSibling:i.previousSibling);
if(e!=null){
this._setCursor(e)
}else{
e=(n)?c.nextSibling:c.previousSibling;
if(e==null){
if(!n){
return
}
DwtHtmlEditor.table_insertRow(i,n);
e=c.nextSibling
}
if(e!=null){
var o=e.childNodes;
if(o!=null&&o.length>0){
var a=(n)?(0):(o.length-1);
this._setCursor(o[a])
}}}}}}
catch(h){}}}};
DwtHtmlEditor.prototype._setCursor=function(a){
var n=this._getIframeDoc();
var e=n.body;
var t;
if(AjxEnv.isIE){
t=e.createTextRange();
t.moveToElementText(a);
t.collapse(0);
t.select()
}else{
t=n.createRange();
t.selectNodeContents(a);
t.collapse(false);
var o=this._getIframeWin().contentWindow;
var i=o.getSelection();
i.addRange(t);
i.collapseToEnd()
}};
DwtHtmlEditor.prototype._locateNode=function(t,e){
if(t&&e){
for(var a=0;
a<t.length;
a++){
if(t[a].tagName.toLowerCase()==e.toLowerCase()){
return t[a]
}}}
return null
};
DwtHtmlEditor.prototype._getAllAncestors=function(){
var a=this._getParentElement();
var e=[];
while(a&&(a.nodeType==1)&&(a.tagName.toLowerCase()!="body")){
e.push(a);
a=a.parentNode
}
var t=this._getIframeDoc();
if(t.body!=null){
e.push(t.body)
}
return e
};
DwtHtmlEditor.prototype._updateState=function(){
if(this._mode!=DwtHtmlEditor.HTML){
return
}
this._stateUpdateActionId=null;
var a=this._stateEvent;
if(!a._ignoreCommandState){
a.reset()
}
var o=this._getIframeDoc();
try{
if(!a._ignoreCommandState){
a.isBold=o.queryCommandState(DwtHtmlEditor.BOLD_STYLE);
a.isItalic=o.queryCommandState(DwtHtmlEditor.ITALIC_STYLE);
a.isUnderline=o.queryCommandState(DwtHtmlEditor.UNDERLINE_STYLE);
a.isStrikeThru=o.queryCommandState(DwtHtmlEditor.STRIKETHRU_STYLE);
a.isSuperscript=o.queryCommandState(DwtHtmlEditor.SUPERSCRIPT_STYLE);
a.isSubscript=o.queryCommandState(DwtHtmlEditor.SUBSCRIPT_STYLE);
a.isOrderedList=o.queryCommandState(DwtHtmlEditor.ORDERED_LIST);
a.isUnorderedList=o.queryCommandState(DwtHtmlEditor.UNORDERED_LIST)
}else{
a._ignoreCommandState=null
}
a.fontFamily=o.queryCommandValue(DwtHtmlEditor._FONT_NAME);
var i=o.queryCommandValue(DwtHtmlEditor._FONT_SIZE);
if(i==""){
i=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE))+1)
}else{
if(/\d+px/.test(i)){
i=Math.ceil(0.75*parseInt(i))+"pt"
}}
if(/\d+pt/.test(i)){
i=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(i)+1)
}
a.fontSize=i;
a.backgroundColor=o.queryCommandValue((AjxEnv.isIE)?"backcolor":"hilitecolor");
a.color=o.queryCommandValue("forecolor");
if(AjxEnv.isIE){
a.backgroundColor="#"+DwtButtonColorPicker.toHex(a.backgroundColor,6).replace(/(..)(..)(..)/,"$3$2$1");
a.color="#"+DwtButtonColorPicker.toHex(a.color,6).replace(/(..)(..)(..)/,"$3$2$1")
}
a.justification=null;
a.direction=null;
var t=o.queryCommandValue(DwtHtmlEditor._FORMAT_BLOCK);
if(t){
if(t.search(DwtHtmlEditor._H1_RE)!=-1){
a.style=DwtHtmlEditor.H1
}else{
if(t.search(DwtHtmlEditor._H2_RE)!=-1){
a.style=DwtHtmlEditor.H2
}else{
if(t.search(DwtHtmlEditor._H3_RE)!=-1){
a.style=DwtHtmlEditor.H3
}else{
if(t.search(DwtHtmlEditor._H4_RE)!=-1){
a.style=DwtHtmlEditor.H4
}else{
if(t.search(DwtHtmlEditor._H5_RE)!=-1){
a.style=DwtHtmlEditor.H5
}else{
if(t.search(DwtHtmlEditor._H6_RE)!=-1){
a.style=DwtHtmlEditor.H6
}else{
if(t.search(DwtHtmlEditor._PARAGRAPH_RE)!=-1){
a.style=DwtHtmlEditor.PARAGRAPH
}else{
if(t.search(DwtHtmlEditor._ADDRESS_RE)!=-1){
a.style=DwtHtmlEditor.ADDRESS
}else{
if(t.search(DwtHtmlEditor._PREFORMATTED_RE)!=-1){
a.style=DwtHtmlEditor.PREFORMATTED
}}}}}}}}}}
if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_LEFT)){
a.justification=DwtHtmlEditor.JUSTIFY_LEFT
}else{
if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_CENTER)){
a.justification=DwtHtmlEditor.JUSTIFY_CENTER
}else{
if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_RIGHT)){
a.justification=DwtHtmlEditor.JUSTIFY_RIGHT
}else{
if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_FULL)){
a.justification=DwtHtmlEditor.JUSTIFY_FULL
}}}}
if(this.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this.notifyListeners(DwtEvent.STATE_CHANGE,a)
}}
catch(e){
if(AjxEnv.isGeckoBased){
this._enableDesignMode(o)
}}};
DwtHtmlEditor.prototype._enableDesignMode=function(a){
if(!a){
return
}
try{
Dwt.enableDesignMode(a,true);
if(AjxEnv.isGeckoBased&&(AjxEnv.isLinux||AjxEnv.isMac)){
this._registerEditorEventHandlers(document.getElementById(this._iFrameId),a)
}}
catch(t){
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
var e=new AjxTimedAction(this,this._enableDesignMode,[a]);
AjxTimedAction.scheduleAction(e,10);
return true
}else{
return false
}}};
DwtHtmlEditor.prototype._onContentInitialized=function(){
this._pendingContent=null
};
DwtHtmlEditor.prototype._setContentOnTimer=function(){
var a=this._getIframeDoc();
try{
if(this._pendingContent!=null){
a.body.innerHTML=this._pendingContent
}
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
this._enableDesignMode(a)
}
this._onContentInitialized()
}
catch(t){
var e=new AjxTimedAction(this,this._setContentOnTimer);
AjxTimedAction.scheduleAction(e,10);
return true
}};
DwtHtmlEditor.prototype._execCommand=function(i,t){
if(this._mode!=DwtHtmlEditor.HTML){
return
}
try{
this.focus();
this._getIframeDoc().execCommand(i,false,t)
}
catch(a){
this._enableDesignMode(this._getIframeDoc())
}
this._updateState()
};
DwtHtmlEditor.prototype._convertHtml2Text=function(e){
var t=this._getIframeDoc();
return(t&&t.body)?AjxStringUtil.convertHtml2Text(t.body,e):""
};
DwtHtmlEditor.prototype.insertLink=function(o){
var d=this._getIframeDoc();
var h=(AjxEnv.isIE&&d&&d.body)?(d.body.innerHTML):"";
if(AjxEnv.isIE&&h==""){
var c=d.createElement("a");
c.href=o.url;
if(o.title){
c.title=o.title
}
var s=d.createTextNode(o.text);
c.appendChild(s);
d.body.appendChild(c);
return c
}else{
var e="javascript:"+Dwt.getNextId();
if(AjxEnv.isIE){
var t=this._getIframeDoc().createElement("a");
t.href=e;
if(o.text){
t.innerHTML=o.text
}
this._insertNodeAtSelection(t,false);
this.selectNodeContents(t)
}else{
if(o.text){
this.insertText(o.text,true)
}
this._execCommand("createlink",e)
}
var c=d.getElementsByTagName("a");
var l;
for(var n=c.length;
--n>=0;
){
if(c[n].href==e){
l=c[n];
break
}}
if(l){
l.href=o.url;
if(o.title){
l.title=o.title
}}
return l
}};
DwtHtmlEditor.prototype.getLinkProps=function(){
var e=this.getNearestElement("a");
if(e){
this.selectNodeContents(e)
}
var t=this._getRange();
var i={
text:AjxEnv.isIE?t.text:t.toString()};
if(e){
i.url=e.href;
i.title=e.title
}
return i
};
DwtHtmlEditor.table_analyzeCells=function(c){
var d=c.parentNode.parentNode;
while(d&&!/table/i.test(d.tagName)){
d=d.parentNode
}
var l={};
var m=d.rows;
for(var n=0;
n<m.length;
++n){
var u=m[n].cells;
var h=0;
for(var a=0;
a<u.length;
){
var e=u[a];
var s=e.colSpan||1;
var t=(e.rowSpan||1)-1;
var o=l[h];
if(o){
if(--o.rs==0){
l[h]=null
}
h+=o.cs
}
e.ZmIndex=h;
if(++a<u.length){
if(t){
l[h]={
cs:s,rs:t}
}
h+=s
}}}
return d
};
DwtHtmlEditor.table_getCellAt=function(h,s){
var c=h.cells;
var l=null,o=null;
for(var a=0;
a<c.length;
++a){
var e=c[a];
var n=(e.colSpan||1)-1;
if(e.ZmIndex<=s&&e.ZmIndex+n>=s){
var t=(e.rowSpan||1)-1;
return{
td:e,cs:n,rs:t}
}else{
if(e.ZmIndex<s){
l=e
}else{
if(e.ZmIndex+n>s&&!o){
o=e
}}}}
return{
last:l,next:o}
};
DwtHtmlEditor.table_getPrevCellAt=function(n,e){
var a=n.parentNode;
while(a&&!/table/i.test(a.tagName)){
a=a.parentNode
}
var o=a.rows;
for(var t=n.rowIndex;
--t>=0;
){
var s=DwtHtmlEditor.table_getCellAt(o[t],e);
if(s.td){
s.dist=n.rowIndex-t;
return s
}}
return null
};
DwtHtmlEditor.table_fixCells=function(e){
for(var t=0;
t<e.length;
++t){
var a=e[t];
if(AjxEnv.isIE){
a.innerHTML="&nbsp;"
}else{
if(AjxEnv.isGeckoBased){
a.innerHTML="<br/>"
}}}};
DwtHtmlEditor.table_insertCol=function(n,t){
var u=DwtHtmlEditor.table_analyzeCells(n);
var m=u.rows;
var c=n.ZmIndex;
if(t){
c+=n.colSpan-1
}
var l=[];
var s=0;
for(var h=0;
h<m.length;
++h){
var d=m[h];
var a=DwtHtmlEditor.table_getCellAt(d,c);
var o=a.td;
var e=null;
if(o){
if(o.ZmIndex==c&&!t){
e=d.insertCell(o.cellIndex)
}else{
if(o.ZmIndex+a.cs==c&&t){
e=d.insertCell(o.cellIndex+1)
}}
if(e){
s=a.rs
}else{
o.colSpan=a.cs+2
}}else{
if(s>0){
if(a.last){
e=d.insertCell(a.last.cellIndex+1)
}else{
if(a.next){
e=d.insertCell(a.next.cellIndex)
}}
--s
}}
if(e){
l.push(e)
}}
return l
};
DwtHtmlEditor.table_insertRow=function(o,t){
var c=o.parentNode;
var f=DwtHtmlEditor.table_analyzeCells(o);
var l=c.rowIndex;
if(t){
l+=o.rowSpan;
c=f.rows[l-1]
}
o=f.rows[0].cells[f.rows[0].cells.length-1];
var d=o.ZmIndex+o.colSpan;
var u=f.insertRow(l);
var h=[];
var m=c.cells;
var e;
for(var s=0;
s<d;
++s){
var a=DwtHtmlEditor.table_getCellAt(c,s);
if(a.td){
if(!t||!a.rs){
for(var n=0;
n<=a.cs;
++n){
h.push(u.insertCell(-1))
}}else{
if(a.rs){
a.td.rowSpan=a.rs+2
}}}else{
a=DwtHtmlEditor.table_getPrevCellAt(c,s);
if(t&&a.rs==a.dist){
for(var n=0;
n<=a.cs;
++n){
h.push(u.insertCell(-1))
}}else{
a.td.rowSpan=a.rs+2
}}
s+=a.cs
}
return h
};
DwtHtmlEditor.table_deleteCol=function(a){
if(!a){
return
}
var c=DwtHtmlEditor.table_analyzeCells(a);
var d=c.rows;
var n=a.ZmIndex;
var l=a.parentNode;
var s;
try{
s=l.cells[a.cellIndex+1];
if(!s){
s=l.cells[a.cellIndex-1]
}}
catch(h){
s=null
}
var e=[];
for(var o=0;
o<d.length;
++o){
var l=d[o];
var t=DwtHtmlEditor.table_getCellAt(l,n);
if(t.td){
if(t.cs){
t.td.colSpan=t.cs
}else{
l.removeChild(t.td);
if(l.cells.length==0){
e.push(l)
}}
o+=t.rs
}}
for(var o=e.length;
--o>=0;
){
l=e[o];
l.parentNode.removeChild(l)
}
if(c.rows.length==0){
c.parentNode.removeChild(c)
}
return s
};
DwtHtmlEditor.table_deleteRow=function(t){
if(!t){
return
}
var s=t.parentNode;
var c=DwtHtmlEditor.table_analyzeCells(t);
t=c.rows[0].cells[c.rows[0].cells.length-1];
var h=t.ZmIndex+t.colSpan;
var l;
for(var a=h;
--a>=0;
){
var e=DwtHtmlEditor.table_getCellAt(s,a);
if(e.td){
if(e.rs){
l=c.rows[s.rowIndex+1];
var o=DwtHtmlEditor.table_getCellAt(l,a);
t=null;
if(o.last){
t=l.insertCell(o.last.cellIndex+1)
}else{
if(o.next){
t=l.insertCell(o.next.cellIndex)
}}
if(t){
if(e.cs>0){
t.colSpan=e.cs+1
}
if(e.rs>1){
t.rowSpan=e.rs
}}}
s.removeChild(e.td)
}else{
e=DwtHtmlEditor.table_getPrevCellAt(s,a);
if(e){
if(e.rs){
e.td.rowSpan=e.rs;
a-=e.cs
}}}}
try{
l=c.rows[s.rowIndex+1];
if(!l){
l=c.rows[s.rowIndex-1]
}}
catch(n){
l=null
}
s.parentNode.removeChild(s);
if(c.rows.length==0){
c.parentNode.removeChild(c)
}
if(l){
return l.cells[0]
}};
DwtHtmlEditor.prototype.searchnReplace=function(a){
var o=this._getIframeWin();
o.focus();
var h=this._getIframeDoc();
var i=h.body;
var n=this._getSelectedText();
if(i.innerHTML==""){
return true
}
str1=a.searchstring;
str2=n;
if(a.replacemode=="current"){
str1=str1.toString();
str2=str2.toString();
if(!a.casesensitive){
str1=str1.toLowerCase();
str2=str2.toLowerCase()
}
if(str1==str2){
this.replaceSel(a.searchstring,a.replacestring);
a.replacemode="none"
}}
if(AjxEnv.isIE){
var e=this.lastSearchRng?this.lastSearchRng:this.range_findnreplace;
var t=0;
if(a.wholeword){
t=t|2
}
if(a.casesensitive){
t=t|4
}
if(!e.findText){
alert("This operation is currently not supported by this browser.");
return true
}
if(a.replacemode=="all"){
if(AjxEnv.isIE){
this.focus()
}
var s=new RegExp(a.searchstring,((a.casesensitive)?"":"i")+"g");
var l=this.replaceNodeContent(i,s,a.replacestring,"all",0);
return true
}
if(e.findText(a.searchstring,a.backwards?-1:1,t)){
e.scrollIntoView();
e.select();
e.collapse(a.backwards);
this.lastSearchRng=e;
if(AjxEnv.isIE&&(a.replacemode=="current")){
this.replaceSel(a.searchstring,a.replacestring)
}}else{
rng1=i.createTextRange();
rng1.findText(a.searchstring,a.backwards?-1:1,t);
rng1.scrollIntoView();
if(rng1.text.toLowerCase()==a.searchstring.toLowerCase()){
rng1.select()
}
rng1.collapse(false);
this.lastSearchRng=rng1;
if(AjxEnv.isIE&&(a.replacemode=="current")){
this.replaceSel(a.searchstring,a.replacestring)
}}}else{
if(a.replacemode=="all"){
var s=new RegExp(a.searchstring,(a.casesensitive?"":"i")+"g");
var l=this.replaceNodeContent(i,s,a.replacestring,"all",0);
return true
}
if(!o.find(a.searchstring,a.casesensitive,a.backwards,a.wrap,a.wholeword,false,false)){
while(o.find(a.searchstring,a.casesensitive,true,a.wrap,a.wholeword,false,false)){}}}};
DwtHtmlEditor.prototype.replaceSel=function(e,n){
if(n==null){
return
}
var o=this._getIframeWin();
var i=o.document;
var t;
if(!AjxEnv.isIE){
var a=o.getSelection();
t=a.getRangeAt(0)
}else{
t=o.document.selection.createRange()
}
if(!AjxEnv.isIE){
if(n.indexOf(e)==-1){
t.deleteContents();
t.insertNode(t.createContextualFragment(n));
t.collapse(false)
}}else{
if(t.item){
t.item(0).outerHTML=n
}else{
t.pasteHTML(n)
}}};
DwtHtmlEditor.prototype._getSelectedText=function(){
var a=this._getIframeWin();
var t=this._getIframeDoc();
var e="";
if(a.getSelection){
e=a.getSelection()
}else{
if(t.getSelection){
e=t.getSelection()
}else{
if(t.selection){
e=t.selection.createRange().text
}}}
return e
};
DwtHtmlEditor.prototype.replaceNodeContent=function(a,h,o,l,t){
for(var n=0;
n<a.childNodes.length;
n++){
var s=a.childNodes[n];
if(s.nodeType==3){
var e=s.nodeValue.replace(h,o);
if(s.nodeValue!=e){
s.nodeValue=e;
t++;
if(l!="all"){
return t
}}}
this.replaceNodeContent(s,h,o,l,t);
if((l!="all")&&(t>0)){
return t
}}
return t
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPasswordField")){
DwtPasswordField=function(e){
if(arguments.length==0){
return
}
e=e||{
parent:DwtShell.getShell(window)};
e.type=DwtInputField.PASSWORD;
DwtInputField.call(this,e);
this._tabGroup=new DwtTabGroup(this._htmlElId);
this._createHtml()
};
DwtPasswordField.prototype=new DwtInputField;
DwtPasswordField.prototype.constructor=DwtPasswordField;
DwtPasswordField.prototype.TEMPLATE="dwt.Widgets#DwtPasswordField";
DwtPasswordField.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtPasswordField.prototype.setShowPassword=function(e){
this._showCheckbox.setSelected(e);
this.setInputType(e?DwtInputField.STRING:DwtInputField.PASSWORD)
};
DwtPasswordField.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtPasswordField.prototype._createHtmlFromTemplate=function(a,o){
this._tabGroup.removeAllMembers();
var e=document.createDocumentFragment();
var s=this.getHtmlElement().firstChild;
while(s){
var i=s.nextSibling;
e.appendChild(s);
s=i
}
DwtInputField.prototype._createHtmlFromTemplate.apply(this,arguments);
var n=document.getElementById(o.id+"_input");
n.appendChild(e);
this._tabGroup.addMember(this.getInputElement());
var t=document.getElementById(o.id+"_show_password");
if(t){
this._showCheckbox=new DwtCheckbox({
parent:this}
);
this._showCheckbox.setText(AjxMsg.showPassword);
this._showCheckbox.addSelectionListener(new AjxListener(this,this._handleShowCheckbox));
this._showCheckbox.replaceElement(t);
this._tabGroup.addMember(this._showCheckbox)
}};
DwtPasswordField.prototype._handleShowCheckbox=function(e){
this.setShowPassword(e.detail)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtCalendar")){
DwtCalendar=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtCalendar.PARAMS);
e.className=e.className||"DwtCalendar";
DwtComposite.call(this,e);
this._skipNotifyOnPage=false;
this._hidePrevNextMo=e.hidePrevNextMo;
this._readOnly=e.readOnly;
this._showWeekNumber=e.showWeekNumber;
this._uuid=Dwt.getNextId();
var t=this._origDayClassName=e.className+"Day";
this._todayClassName=" "+e.className+"Day-today";
this._selectedDayClassName=" "+t+"-"+DwtCssStyle.SELECTED;
this._hoveredDayClassName=" "+t+"-"+DwtCssStyle.HOVER;
this._activeDayClassName=" "+t+"-"+DwtCssStyle.ACTIVE;
this._hiliteClassName=" "+t+"-hilited";
this._greyClassName=" "+t+"-grey";
if(!this._readOnly){
this._installListeners()
}
this._selectionMode=DwtCalendar.DAY;
this._init();
this._weekDays=new Array(7);
this._workingDays=e.workingDays||DwtCalendar._DEF_WORKING_DAYS;
this._useISO8601WeekNo=e.useISO8601WeekNo;
this.setFirstDayOfWeek(e.firstDayOfWeek||DwtCalendar.SUN);
this._forceRollOver=(e.forceRollOver!==false)
};
DwtCalendar.PARAMS=["parent","className","posStyle","firstDayOfWeek","forceRollOver","workingDaysArray","hidePrevNextMo","readOnly"];
DwtCalendar.prototype=new DwtComposite;
DwtCalendar.prototype.constructor=DwtCalendar;
DwtCalendar.SUN=0;
DwtCalendar.MON=1;
DwtCalendar.TUE=2;
DwtCalendar.WED=3;
DwtCalendar.THU=4;
DwtCalendar.FRI=5;
DwtCalendar.SAT=6;
DwtCalendar.DAY=1;
DwtCalendar.WEEK=2;
DwtCalendar.WORK_WEEK=3;
DwtCalendar.MONTH=4;
DwtCalendar.RANGE_CHANGE="DwtCalendar.RANGE_CHANGE";
DwtCalendar._FULL_WEEK=[1,1,1,1,1,1,1];
DwtCalendar._DEF_WORKING_DAYS=[0,1,1,1,1,1,0];
DwtCalendar._DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];
DwtCalendar._NO_MONTH=-2;
DwtCalendar._PREV_MONTH=-1;
DwtCalendar._THIS_MONTH=0;
DwtCalendar._NEXT_MONTH=1;
DwtCalendar._NORMAL=1;
DwtCalendar._HOVERED=2;
DwtCalendar._ACTIVE=3;
DwtCalendar._SELECTED=4;
DwtCalendar._DESELECTED=5;
DwtCalendar.DATE_SELECTED=1;
DwtCalendar.DATE_DESELECTED=2;
DwtCalendar.DATE_DBL_CLICKED=3;
DwtCalendar._LAST_DAY_CELL_IDX=41;
DwtCalendar._BUTTON_CLASS="DwtCalendarButton";
DwtCalendar._BUTTON_HOVERED_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.HOVER;
DwtCalendar._BUTTON_ACTIVE_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.ACTIVE;
DwtCalendar._TITLE_CLASS="DwtCalendarTitle";
DwtCalendar._TITLE_HOVERED_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.HOVER;
DwtCalendar._TITLE_ACTIVE_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.ACTIVE;
DwtCalendar.prototype.toString=function(){
return"DwtCalendar"
};
DwtCalendar.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtCalendar.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtCalendar.prototype.addActionListener=function(e){
this.addListener(DwtEvent.ACTION,e)
};
DwtCalendar.prototype.removeActionListener=function(e){
this.removeListener(DwtEvent.ACTION,e)
};
DwtCalendar.prototype.addDateRangeListener=function(e){
this.addListener(DwtEvent.DATE_RANGE,e)
};
DwtCalendar.prototype.removeDateRangeListener=function(e){
this.removeListener(DwtEvent.DATE_RANGE,e)
};
DwtCalendar.prototype.setSkipNotifyOnPage=function(e){
this._skipNotifyOnPage=e
};
DwtCalendar.prototype.getSkipNotifyOnPage=function(){
return this._skipNotifyOnPage
};
DwtCalendar.prototype.setDate=function(i,s,a,t){
a=(a==null)?this._forceRollOver:a;
var c=new Date(i.getTime());
var o=this._date;
var n=false;
var u=false;
var e;
if(this._date2CellId!=null){
var l=(c.getFullYear()*10000)+(c.getMonth()*100)+c.getDate();
var e=this._date2CellId[l];
if(e){
if(e==this._selectedCellId){
u=true
}
var d=document.getElementById(e);
if(d._dayType==DwtCalendar._THIS_MONTH){
u=true
}else{
if(a){
u=n=true
}else{
u=true
}}}else{
u=n=true
}}else{
u=n=true
}
if(u){
if(this._date){
if(AjxDateUtil.isDayShifted(c)){
AjxDateUtil.rollToNextDay(c)
}
c.setHours(this._date.getHours(),this._date.getMinutes(),this._date.getSeconds(),0)
}
this._date=c;
if(!n&&!this._readOnly){
this._setSelectedDate();
this._setToday()
}}
if(n){
this._layout()
}
if(u&&!s){
var h=t?DwtCalendar.DATE_DBL_CLICKED:DwtCalendar.DATE_SELECTED;
this._notifyListeners(DwtEvent.SELECTION,h,this._date)
}
return true
};
DwtCalendar.prototype.isSelected=function(t){
if(t==this._selectedDayElId){
return true
}else{
if(this._selectionMode!=DwtCalendar.DAY){
var e=this._getDayCellIndex(t);
if(Math.floor(e/7)==Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)&&this._currWorkingDays[e%7]){
return true
}}}
return false
};
DwtCalendar.prototype.getForceRollOver=function(){
return this._forceRollOver
};
DwtCalendar.prototype.setForceRollOver=function(e){
if(e==null){
return
}
if(this._forceRollOver!=e){
this._forceRollOver=e;
this._layout()
}};
DwtCalendar.prototype.getSelectionMode=function(){
return this._selectionMode
};
DwtCalendar.prototype.setSelectionMode=function(e){
if(this._selectionMode==e){
return
}
this._selectionMode=e;
if(e==DwtCalendar.WEEK){
this._currWorkingDays=DwtCalendar._FULL_WEEK
}else{
if(e==DwtCalendar.WORK_WEEK){
this._currWorkingDays=this._workingDays
}}
this._layout()
};
DwtCalendar.prototype.setWorkingWeek=function(e){
this._workingDays=this._currWorkingDays=e;
if(this._selectionMode==DwtCalendar.WORK_WEEK){
this._layout()
}};
DwtCalendar.prototype.setHilite=function(s,a,t){
if(this._date2CellId==null){
return
}
var e;
var h;
if(t){
for(h in this._date2CellId){
e=document.getElementById(this._date2CellId[h]);
if(e._isHilited){
e._isHilited=false;
this._setClassName(e,DwtCalendar._NORMAL)
}}}
var n;
for(var o in s){
h=s[o];
n=this._date2CellId[h.getFullYear()*10000+h.getMonth()*100+h.getDate()];
if(n){
e=document.getElementById(n);
if(e._isHilited!=a){
e._isHilited=a;
this._setClassName(e,DwtCalendar._NORMAL)
}}}};
DwtCalendar.prototype.getDate=function(){
return this._date
};
DwtCalendar.prototype.setFirstDayOfWeek=function(e){
for(var a=0;
a<7;
a++){
this._weekDays[a]=(a<e)?(6-(e-a-1)):(a-e);
var t=document.getElementById(this._getDOWCellId(a));
t.innerHTML=AjxDateUtil.WEEKDAY_SHORT[(e+a)%7]
}
this._firstDayOfWeek=e;
this._layout()
};
DwtCalendar.prototype.getDateRange=function(){
return this._range
};
DwtCalendar.prototype._getDayCellId=function(e){
return("c:"+e+":"+this._uuid)
};
DwtCalendar.prototype._getDayCellIndex=function(e){
return e.substring(2,e.indexOf(":",3))
};
DwtCalendar.prototype._getDOWCellId=function(e){
return("w:"+e+":"+this._uuid)
};
DwtCalendar.prototype._getWeekNumberCellId=function(e){
return("k:"+e+":"+this._uuid)
};
DwtCalendar.prototype._getDaysInMonth=function(t,e){
if(t!=1){
return DwtCalendar._DAYS_IN_MONTH[t]
}
if(e%4!=0||(e%100==0&&e%400!=0)){
return 28
}
return 29
};
DwtCalendar.prototype._installListeners=function(){
this._setMouseEventHdlrs();
this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
this.addListener(DwtEvent.ONDBLCLICK,new AjxListener(this,this._doubleClickListener))
};
DwtCalendar.prototype._notifyListeners=function(e,a,t,i){
if(!this.isListenerRegistered(e)){
return
}
var o=DwtShell.selectionEvent;
if(i){
DwtUiEvent.copy(o,i)
}else{
o.reset()
}
o.item=this;
o.detail=t;
o.type=a;
this.notifyListeners(e,o)
};
DwtCalendar.prototype._layout=function(){
if(this._date==null){
return false
}
if(!this._calWidgetInited){
this._init()
}
var g=new Date(this._date.getTime());
g.setDate(1);
var s=g.getFullYear();
var y=g.getMonth();
var n=g.getDay();
var a=this._getDaysInMonth(y,s);
var c=1;
var b=1;
this._date2CellId=new Object();
this._selectedDayElId=null;
var o,u,w,p,e;
if(!this._hidePrevNextMo){
if(y!=0){
o=this._getDaysInMonth(y-1,s)-this._weekDays[n]+1;
u=s;
w=y-1;
if(y!=11){
p=y+1;
e=s
}else{
p=0;
e=s+1
}}else{
o=this._getDaysInMonth(11,s-1)-this._weekDays[n]+1;
u=s-1;
w=11;
p=1;
e=s
}}
for(var d=0;
d<6;
d++){
for(var l=0;
l<7;
l++){
var f=document.getElementById(this._getDayCellId(d*7+l));
if(f._isHilited==null){
f._isHilited=false
}
if(c<=a){
if(d!=0||l>=this._weekDays[n]){
this._date2CellId[(s*10000)+(y*100)+c]=f.id;
f._day=c;
f._month=y;
f._year=s;
f.innerHTML=c++;
f._dayType=DwtCalendar._THIS_MONTH;
if(this._readOnly){
f.style.fontFamily="Arial";
f.style.fontSize="10px"
}}else{
if(this._hidePrevNextMo){
f.innerHTML=""
}else{
this._date2CellId[(u*10000)+(w*100)+o]=f.id;
f._day=o;
f._month=w;
f._year=u;
f.innerHTML=o++;
f._dayType=DwtCalendar._PREV_MONTH
}}}else{
if(!this._hidePrevNextMo){
this._date2CellId[(e*10000)+(p*100)+b]=f.id;
f._day=b;
f._month=p;
f._year=e;
f.innerHTML=b++;
f._dayType=DwtCalendar._NEXT_MONTH
}}
this._setClassName(f,DwtCalendar._NORMAL)
}
if(this._showWeekNumber){
var h=this._getWeekNumberCellId("kw"+d*7);
var m=document.getElementById(h);
if(m){
var t=document.getElementById(this._getDayCellId(d*7));
m.innerHTML=AjxDateUtil.getWeekNumber(new Date(t._year,t._month,t._day),this._firstDayOfWeek,null,this._useISO8601WeekNo)
}}}
this._setTitle(y,s);
if(!this._readOnly){
this._setSelectedDate();
this._setToday()
}
this._setRange()
};
DwtCalendar.prototype._setRange=function(){
var e=document.getElementById(this._getDayCellId(0));
var i=new Date(e._year,e._month,e._day,0,0,0,0);
e=document.getElementById(this._getDayCellId(DwtCalendar._LAST_DAY_CELL_IDX));
var a=this._getDaysInMonth(e._month,e._year);
var t;
if(e._day<a){
t=new Date(e._year,e._month,e._day+1,0,0,0,0)
}else{
if(e._month<11){
t=new Date(e._year,e._month+1,1,0,0,0,0)
}else{
t=new Date(e._year+1,0,1,0,0,0,0)
}}
if(this._range==null){
this._range={}
}else{
if(this._range.start.getTime()==i.getTime()&&this._range.end.getTime()==t.getTime()){
return false
}}
this._range.start=i;
this._range.end=t;
if(!this.isListenerRegistered(DwtEvent.DATE_RANGE)){
return
}
if(!this._dateRangeEvent){
this._dateRangeEvent=new DwtDateRangeEvent(true)
}
this._dateRangeEvent.item=this;
this._dateRangeEvent.start=i;
this._dateRangeEvent.end=t;
this.notifyListeners(DwtEvent.DATE_RANGE,this._dateRangeEvent)
};
DwtCalendar.prototype._setToday=function(){
var e;
var t=new Date();
var a=t.getDate();
if(!this._todayDay||this._todayDay!=a){
if(this._todayCellId!=null){
e=document.getElementById(this._todayCellId);
e._isToday=false;
this._setClassName(e,DwtCalendar._NORMAL)
}
this._todayCellId=this._date2CellId[(t.getFullYear()*10000)+(t.getMonth()*100)+a];
if(this._todayCellId!=null){
e=document.getElementById(this._todayCellId);
e._isToday=true;
this._setClassName(e,DwtCalendar._NORMAL)
}}};
DwtCalendar.prototype._setSelectedDate=function(){
var t=this._date.getDate();
var o=this._date.getMonth();
var a=this._date.getFullYear();
var e;
if(this._selectedDayElId){
e=document.getElementById(this._selectedDayElId);
this._setClassName(e,DwtCalendar._DESELECTED)
}
var i=this._date2CellId[(a*10000)+(o*100)+t];
e=document.getElementById(i);
this._selectedDayElId=i;
this._setClassName(e,DwtCalendar._SELECTED)
};
DwtCalendar.prototype._setCellClassName=function(t,a,i){
if(t._dayType!=DwtCalendar._THIS_MONTH){
a+=this._greyClassName
}
if(this._selectionMode==DwtCalendar.DAY&&t.id==this._selectedDayElId&&i!=DwtCalendar._DESELECTED){
a+=this._selectedDayClassName
}else{
if(this._selectionMode!=DwtCalendar.DAY&&i!=DwtCalendar._DESELECTED&&this._selectedDayElId!=null){
var e=this._getDayCellIndex(t.id);
if(Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)==Math.floor(e/7)&&this._currWorkingDays[e%7]){
a+=this._selectedDayClassName
}}}
if(t._isHilited){
a+=this._hiliteClassName
}
if(t._isToday){
a+=this._todayClassName
}
return a
};
DwtCalendar.prototype._setClassName=function(e,s){
var a="";
if(s==DwtCalendar._NORMAL){
a=this._origDayClassName
}else{
if(s==DwtCalendar._HOVERED){
a=this._hoveredDayClassName
}else{
if(s==DwtCalendar._ACTIVE){
a=this._activeDayClassName
}else{
if(s==DwtCalendar._DESELECTED&&this._selectionMode==DwtCalendar.DAY){
a=this._origDayClassName
}else{
if(this._selectionMode!=DwtCalendar.DAY&&(s==DwtCalendar._SELECTED||s==DwtCalendar._DESELECTED)){
var n=Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)*7;
for(var t=0;
t<7;
t++){
a=this._origDayClassName;
var o=document.getElementById(this._getDayCellId(n++));
o.className=this._setCellClassName(o,a,s)
}
return
}}}}}
e.className=this._setCellClassName(e,a,s)
};
DwtCalendar.prototype._setTitle=function(o,i){
var e=document.getElementById(this._monthCell);
var a=DwtCalendar.getMonthFormatter();
var t=new Date(i,o);
e.innerHTML=a.format(t)
};
DwtCalendar.prototype._init=function(){
var o=new Array(100);
var e=0;
this._monthCell="t:"+this._uuid;
o[e++]="<table width=100% cellspacing='0' cellpadding='0' style='border-collapse:collapse;'>";
o[e++]="<tr><td class=DwtCalendarTitlebar>";
o[e++]="<table width='100%' cellspacing='0' cellpadding='0'>";
o[e++]="<tr>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:py:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("FastRevArrowSmall",null,["id='b:py:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:pm:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("RevArrowSmall",null,["id='b:pm:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="<td align='center' class='DwtCalendarTitleCell' nowrap'><span class='";
o[e++]=DwtCalendar._TITLE_CLASS;
o[e++]="' id='";
o[e++]=this._monthCell;
o[e++]="'>&nbsp;</span></td>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:nm:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("FwdArrowSmall",null,["id='b:nm:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:ny:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("FastFwdArrowSmall",null,["id='b:ny:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="</tr>";
o[e++]="</table>";
o[e++]="</td></tr>";
o[e++]="<tr><td>";
o[e++]="<table cellspacing='0' cellpadding='1' width='100%'>";
o[e++]="<tr>";
if(this._showWeekNumber){
o[e++]="<td class='DwtCalendarWeekNoTitle' width='14%' id='";
o[e++]=this._getWeekNumberCellId("kw");
o[e++]="'>";
o[e++]=AjxMsg.calendarWeekTitle;
o[e++]="</td>"
}
for(var a=0;
a<7;
a++){
o[e++]="<td class='DwtCalendarDow' width='";
o[e++]=(a<5?"14%":"15%");
o[e++]="' id='";
o[e++]=this._getDOWCellId(a);
o[e++]="'>&nbsp;</td>"
}
o[e++]="</tr>";
for(var a=0;
a<6;
a++){
o[e++]=(AjxEnv.isLinux||AjxEnv.isMac)?"<tr style='line-height:12px'>":"<tr>";
if(this._showWeekNumber){
o[e++]="<td class='DwtCalendarWeekNo' id='"+this._getWeekNumberCellId("kw"+a*7)+"'>&nbsp;</td>"
}
for(var t=0;
t<7;
t++){
o[e++]="<td id='";
o[e++]=this._getDayCellId(a*7+t);
o[e++]="'>&nbsp;</td>"
}
o[e++]="</tr>"
}
o[e++]="</td></tr></table></table>";
this.getHtmlElement().innerHTML=o.join("");
if(!this._readOnly){
document.getElementById("b:py:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastRevArrowSmall");
document.getElementById("b:pm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("RevArrowSmall");
document.getElementById("b:nm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FwdArrowSmall");
document.getElementById("b:ny:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastFwdArrowSmall")
}
this._calWidgetInited=true
};
DwtCalendar.prototype.setMouseOverDayCallback=function(e){
this._mouseOverDayCB=e
};
DwtCalendar.prototype.setMouseOutDayCallback=function(e){
this._mouseOutDayCB=e
};
DwtCalendar.prototype.getDndDate=function(){
var e=this._lastDndCell;
if(e){
return new Date(e._year,e._month,e._day)
}
return null
};
DwtCalendar._tmpDate=new Date();
DwtCalendar._tmpDate.setHours(0,0,0,0);
DwtCalendar.prototype._mouseOverListener=function(t){
var a=t.target;
if(a.id.charAt(0)=="c"){
this._setClassName(a,DwtCalendar._HOVERED);
if(this._mouseOverDayCB){
DwtCalendar._tmpDate.setFullYear(a._year,a._month,a._day);
this._mouseOverDayCB.run(this,DwtCalendar._tmpDate)
}}else{
if(a.id.charAt(0)=="t"){
return
}else{
if(a.id.charAt(0)=="b"){
var e;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
}else{
a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName
}}}
t._stopPropagation=true
};
DwtCalendar.prototype._mouseOutListener=function(t){
this.setToolTipContent(null);
var a=t.target;
if(a.id.charAt(0)=="c"){
this._setClassName(a,DwtCalendar._NORMAL);
if(this._mouseOutDayCB){
this._mouseOutDayCB.run(this)
}}else{
if(a.id.charAt(0)=="b"){
var e;
a.className=DwtCalendar._BUTTON_CLASS;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_CLASS
}else{
a.className=DwtCalendar._BUTTON_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName
}}};
DwtCalendar.prototype._mouseDownListener=function(t){
if(t.button==DwtMouseEvent.LEFT){
var a=t.target;
if(a.id.charAt(0)=="c"){
this._setClassName(a,DwtCalendar._ACTIVE)
}else{
if(a.id.charAt(0)=="t"){
a.className=DwtCalendar._TITLE_ACTIVE_CLASS
}else{
if(a.id.charAt(0)=="b"){
var e;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_ACTIVE_CLASS
}else{
a.className=DwtCalendar._BUTTON_ACTIVE_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName
}else{
if(a.id.charAt(0)=="w"){}}}}}};
DwtCalendar.prototype._mouseUpListener=function(t){
var a=t.target;
if(t.button==DwtMouseEvent.LEFT){
if(a.id.charAt(0)=="c"){
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
if(this.setDate(new Date(a._year,a._month,a._day))){
return
}
this._setClassName(a,DwtCalendar._HOVERED)
}else{
if(a.id.charAt(0)=="b"){
var e;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
}else{
a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName;
if(e.id.indexOf("py")!=-1){
this._prevYear()
}else{
if(e.id.indexOf("pm")!=-1){
this._prevMonth()
}else{
if(e.id.indexOf("nm")!=-1){
this._nextMonth()
}else{
this._nextYear()
}}}}else{
if(a.id.charAt(0)=="t"){
a.className=DwtCalendar._TITLE_HOVERED_CLASS;
this.setDate(new Date(),this._skipNotifyOnPage);
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}}}}}else{
if(t.button==DwtMouseEvent.RIGHT&&a.id.charAt(0)=="c"){
this._notifyListeners(DwtEvent.ACTION,0,new Date(a._year,a._month,a._day),t)
}}};
DwtCalendar.prototype._doubleClickListener=function(e){
var t=e.target;
if(this._selectionEvent){
this._selectionEvent.type=DwtCalendar.DATE_DBL_CLICKED
}
if(t.id.charAt(0)=="c"){
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
this.setDate(new Date(t._year,t._month,t._day),false,false,true)
}};
DwtCalendar.prototype._prevMonth=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,-1),this._skipNotifyOnPage)
};
DwtCalendar.prototype._nextMonth=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,1),this._skipNotifyOnPage)
};
DwtCalendar.prototype._prevYear=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,-1),this._skipNotifyOnPage)
};
DwtCalendar.prototype._nextYear=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,1),this._skipNotifyOnPage)
};
DwtCalendar.getDateFormatter=function(){
if(!DwtCalendar._dateFormatter){
DwtCalendar._dateFormatter=new AjxDateFormat(AjxMsg.formatCalDate)
}
return DwtCalendar._dateFormatter
};
DwtCalendar.getDateLongFormatter=function(){
if(!DwtCalendar._dateLongFormatter){
DwtCalendar._dateLongFormatter=new AjxDateFormat(AjxMsg.formatCalDateLong)
}
return DwtCalendar._dateLongFormatter
};
DwtCalendar.getDateFullFormatter=function(){
if(!DwtCalendar._dateFullFormatter){
DwtCalendar._dateFullFormatter=new AjxDateFormat(AjxMsg.formatCalDateFull)
}
return DwtCalendar._dateFullFormatter
};
DwtCalendar.getHourFormatter=function(){
if(!DwtCalendar._hourFormatter){
DwtCalendar._hourFormatter=new AjxMessageFormat(AjxMsg.formatCalHour)
}
return DwtCalendar._hourFormatter
};
DwtCalendar.getDayFormatter=function(){
if(!DwtCalendar._dayFormatter){
DwtCalendar._dayFormatter=new AjxDateFormat(AjxMsg.formatCalDay)
}
return DwtCalendar._dayFormatter
};
DwtCalendar.getMonthFormatter=function(){
if(!DwtCalendar._monthFormatter){
DwtCalendar._monthFormatter=new AjxDateFormat(AjxMsg.formatCalMonth)
}
return DwtCalendar._monthFormatter
};
DwtCalendar.getShortMonthFormatter=function(){
if(!DwtCalendar._shortMonthFormatter){
DwtCalendar._shortMonthFormatter=new AjxDateFormat(AjxMsg.formatShortCalMonth)
}
return DwtCalendar._shortMonthFormatter
};
DwtCalendar.prototype._dragEnter=function(e){};
DwtCalendar.prototype._dragHover=function(e){};
DwtCalendar.prototype._dragOver=function(e){
var t=e.target;
if(t.id.charAt(0)=="c"){
this._setClassName(t,DwtCalendar._HOVERED);
this._lastDndCell=t
}else{
this._lastDndCell=null
}};
DwtCalendar.prototype._dragLeave=function(e){}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyPage")){
DwtPropertyPage=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtPropertyPage.PARAMS);
e.className=e.className||"DwtPropertyPage";
DwtComposite.call(this,e);
this._fieldIds=new Object();
this._fildDivIds=new Object();
this._isDirty=false
};
DwtPropertyPage.prototype=new DwtComposite;
DwtPropertyPage.prototype.constructor=DwtPropertyPage;
DwtPropertyPage.prototype.toString=function(){
return"DwtPropertyPage"
};
DwtPropertyPage.PARAMS=DwtComposite.PARAMS;
DwtPropertyPage.prototype.setDirty=function(e){
this._isDirty=e
};
DwtPropertyPage.prototype.isDirty=function(){
return this._isDirty
};
DwtPropertyPage.prototype._installOnKeyUpHandler=function(i,t){
if(!i){
return
}
var a=null;
a=document.getElementById(this._fieldIds[i]);
if(a){
Dwt.setHandler(a,DwtEvent.ONKEYUP,t?t:this._onKeyUp);
a._view=this;
a._field=i
}};
DwtPropertyPage.prototype._installOnClickHandler=function(i,t){
if(!i){
return
}
var a=document.getElementById(this._fieldIds[i]);
if(a){
Dwt.setHandler(a,DwtEvent.ONCLICK,t?t:this._onClick);
a._view=this;
a._field=i
}};
DwtPropertyPage.prototype._onClick=function(e){
this._view.setDirty(true);
return true
};
DwtPropertyPage.prototype._onKeyUp=function(e){
this._view.setDirty(true);
return true
};
DwtPropertyPage.prototype._installOnChangeHandler=function(i,t){
if(!i){
return
}
var a=null;
a=document.getElementById(this._fieldIds[i]);
if(a){
Dwt.setHandler(a,DwtEvent.ONCHANGE,t?t:this._onChange);
a._view=this;
a._field=i
}};
DwtPropertyPage._onChange=function(e){
this._view.setDirty(true);
return true
};
DwtPropertyPage.prototype._onChange2=function(e){
this.setDirty(true);
return true
};
DwtPropertyPage.prototype._addDwtSelectEntryRow=function(o,n,a,e,i){
var t="30ex";
if(i){
t=i
}
a[e++]="<tr valign='center'>";
e=this._addDwtSelectEntryCell(o,n,a,e,t);
a[e++]="</tr>";
return e
};
DwtPropertyPage.prototype._addDwtSelectEntryCell=function(a,i,t,e,n){
var o=Dwt.getNextId();
this._fieldIds[a]=o;
if(i){
t[e++]="<td align='left' style='width:"+n+"'>";
t[e++]=AjxStringUtil.htmlEncode(i)+":";
t[e++]="</td>"
}
t[e++]="<td align='left'>";
t[e++]="<div id='"+o+"'></div></td>";
return e
};
DwtPropertyPage.prototype._addBoolEntryRow=function(a,i,t,e,o){
t[e++]="<tr valign='center'>";
e=this._addBoolEntryCell(a,i,t,e,o);
t[e++]="</tr>";
return e
};
DwtPropertyPage.prototype._addBoolEntryCell=function(i,o,t,e,s){
var n=Dwt.getNextId();
this._fieldIds[i]=n;
var a="20ex";
if(s){
a=s
}
if(o){
t[e++]="<td style='width:"+a+";' align='left'>";
t[e++]=AjxStringUtil.htmlEncode(o)+":";
t[e++]="</td>"
}
t[e++]="<td align='left'>";
t[e++]="<input type='checkbox' id='"+n+"'>";
t[e++]="</td>";
return e
};
DwtPropertyPage.prototype._addTextAreaEntryRow=function(i,o,t,e,s){
var a="on";
if(s){
a="off"
}
var n=Dwt.getNextId();
this._fieldIds[i]=n;
t[e++]="<tr valign='center'>";
t[e++]="<td align='left' style='width:60ex;'>";
t[e++]=AjxStringUtil.htmlEncode(o)+":";
t[e++]="</td></tr>";
t[e++]="<tr valign='center'><td align='left' style='width:60ex;'><textarea wrap='"+a+"' rows='8' cols ='60' id='";
t[e++]=n;
t[e++]="'/></textarea></td></tr>";
return e
};
DwtPropertyPage.prototype._addEntryRow=function(s,n,t,l,i,o,e,h,a){
t[l++]="<tr valign='center'>";
l=this._addEntryCell(s,n,t,l,i,o,e,h,a);
t[l++]="</tr>";
return l
};
DwtPropertyPage.prototype._addEntryCell=function(l,h,i,d,n,s,t,c,o){
if(n==null){
n="text"
}
if(s==null){
s=35
}
var a="20ex";
if(c){
a=c
}
var e=Dwt.getNextId();
this._fieldIds[l]=e;
if(h){
i[d++]="<td align='left' style='width:"+a+";'>";
i[d++]=AjxStringUtil.htmlEncode(h)+":";
i[d++]="</td>"
}
i[d++]="<td ";
if(o){
i[d++]="class='redAsteric' "
}
i[d++]="        align='left'><input autocomplete='off' size='"+s+"' type='"+n+"' id='";
i[d++]=e;
i[d++]="'";
if(o){
i[d++]="/>*"
}else{
i[d++]="/>&nbsp;"
}
if(t!=null){
i[d++]=t
}
i[d++]="</td>";
return d
};
DwtPropertyPage.prototype._createHTML=function(){}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtTabView")){
DwtTabView=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtListView.PARAMS);
t.className=t.className||"ZTabView";
t.posStyle=t.posStyle||DwtControl.ABSOLUTE_STYLE;
DwtComposite.call(this,t);
this._stateChangeEv=new DwtEvent(true);
this._stateChangeEv.item=this;
this._tabs=[];
this._tabIx=1;
this._createHtml();
var e=[this.toString(),this._htmlElId].join("-");
this._tabGroup=new DwtTabGroup(e);
this._tabGroup.addMember(this._tabBar)
};
DwtTabView.PARAMS=["parent","className","posStyle"];
DwtTabView.prototype=new DwtComposite;
DwtTabView.prototype.constructor=DwtTabView;
DwtTabView.Z_ACTIVE_TAB=Dwt.Z_VIEW+10;
DwtTabView.Z_HIDDEN_TAB=Dwt.Z_HIDDEN;
DwtTabView.Z_TAB_PANEL=Dwt.Z_VIEW+20;
DwtTabView.Z_CURTAIN=Dwt.Z_CURTAIN;
DwtTabView.prototype.TEMPLATE="dwt.Widgets#ZTabView";
DwtTabView.prototype.toString=function(){
return"DwtTabView"
};
DwtTabView.prototype.addStateChangeListener=function(e){
this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabView.prototype.removeStateChangeListener=function(e){
this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabView.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtTabView.prototype.addTab=function(o,i,t,e){
var a=this._tabIx++;
this._tabs[a]={
title:o,button:this._tabBar.addButton(a,o,t,e)};
this.setTabView(a,i);
if(a==1){
if(i instanceof AjxCallback){
i=i.run(a)
}
if(i){
i.showMe()
}
this._currentTabKey=a;
this.switchToTab(a)
}else{
if(i&&!(i instanceof AjxCallback)){
i.hideMe();
Dwt.setVisible(i.getHtmlElement(),false)
}}
this._tabBar.addSelectionListener(a,new AjxListener(this,DwtTabView.prototype._tabButtonListener));
return a
};
DwtTabView.prototype.enable=function(e){
for(var a in this._tabs){
var t=this._tabs[a].button;
if(t){
t.setEnabled(e)
}}};
DwtTabView.prototype.getCurrentTab=function(){
return this._currentTabKey
};
DwtTabView.prototype.getNumTabs=function(){
return(this._tabs.length-1)
};
DwtTabView.prototype.getTab=function(e){
return(this._tabs&&this._tabs[e])?this._tabs[e]:null
};
DwtTabView.prototype.getTabBar=function(){
return this._tabBar
};
DwtTabView.prototype.getTabTitle=function(e){
return(this._tabs&&this._tabs[e])?this._tabs[e]["title"]:null
};
DwtTabView.prototype.getTabButton=function(e){
return(this._tabs&&this._tabs[e])?this._tabs[e]["button"]:null
};
DwtTabView.prototype.setTabView=function(i,a){
var t=this.getTab(i);
t.view=a;
if(a&&!(a instanceof AjxCallback)){
this._pageEl.appendChild(a.getHtmlElement());
a._tabKey=i;
if(i==this._currentTabKey){
var e=a.getTabGroupMember();
this._tabGroup.replaceMember(t.tabGroup,e);
t.tabGroup=e
}}};
DwtTabView.prototype.getTabView=function(i){
var a=this.getTab(i);
var t=a&&a.view;
if(t instanceof AjxCallback){
var o=t;
t=o.run(i);
this.setTabView(i,t);
var e=this._getTabSize();
t.setSize(e.x,e.y)
}
return t
};
DwtTabView.prototype.switchToTab=function(a){
var t=this.getTab(a);
if(t){
var e=this.getTab(this._currentTabKey);
if(e){
this._tabGroup.removeMember(e.tabGroup)
}
this._showTab(a);
this._tabBar.openTab(a);
if(!t.tabGroup&&t.view){
t.tabGroup=t.view.getTabGroupMember()
}
this._tabGroup.addMember(t.tabGroup);
if(this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}}};
DwtTabView.prototype.setBounds=function(t,i,a,e){
DwtComposite.prototype.setBounds.call(this,t,i,a,e);
this._resetTabSizes(a,e)
};
DwtTabView.prototype.getActiveView=function(){
return this._tabs[this._currentTabKey].view
};
DwtTabView.prototype.getKeyMapName=function(){
return"DwtTabView"
};
DwtTabView.prototype.resetKeyBindings=function(){
var t=this.shell.getKeyboardMgr();
if(t.isEnabled()){
var n=t.__keyMapMgr;
if(!n){
return
}
var o=this.getNumTabs();
var h=n.getKeySequences("DwtTabView","GoToTab");
for(var e=0;
e<h.length;
e++){
var l=h[e];
for(var a=1;
a<=o;
a++){
var s=48+a;
var c=l.replace(/NNN/,s);
n.setMapping("DwtTabView",c,"GoToTab"+a)
}}
n.reloadMap("DwtTabView")
}};
DwtTabView.prototype.handleKeyAction=function(i){
switch(i){
case DwtKeyMap.NEXT_TAB:var a=this.getCurrentTab();
if(a<this.getNumTabs()){
this.switchToTab(a+1)
}
break;
case DwtKeyMap.PREV_TAB:var a=this.getCurrentTab();
if(a>1){
this.switchToTab(a-1)
}
break;
default:var t=i.match(DwtKeyMap.GOTO_TAB_RE);
if(t&&t.length){
var e=t[1];
if((e<=this.getNumTabs())&&(e!=this.getCurrentTab())){
this.switchToTab(e)
}}else{
return false
}}
return true
};
DwtTabView.prototype._resetTabSizes=function(a,e){
if(this._tabs&&this._tabs.length){
for(var o in this._tabs){
var t=this._tabs[o].view;
if(t&&!(t instanceof AjxCallback)){
var i;
i=i||e-Dwt.getSize(this._tabBarEl).y;
t.resetSize(a,i)
}}}};
DwtTabView.prototype._getTabSize=function(){
var t=this.getSize();
var a=t.x||this.getHtmlElement().clientWidth;
var e=t.y||this.getHtmlElement().clientHeight;
var i=this._tabBar.getSize();
var o=i.y||this._tabBar.getHtmlElement().clientHeight;
return new DwtPoint(a,(e-o))
};
DwtTabView.prototype._createHtml=function(e){
this._createHtmlFromTemplate(e||this.TEMPLATE,{
id:this._htmlElId}
)
};
DwtTabView.prototype._createHtmlFromTemplate=function(e,t){
DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
this._tabBarEl=document.getElementById(t.id+"_tabbar");
this._tabBar=new DwtTabBar(this);
this._tabBar.reparentHtmlElement(this._tabBarEl);
this._pageEl=document.getElementById(t.id+"_page")
};
DwtTabView.prototype._showTab=function(t){
if(this._tabs&&this._tabs[t]){
this._currentTabKey=t;
this._hideAllTabs();
var e=this.getTabView(t);
if(e){
e.setVisible(true);
e.showMe()
}}};
DwtTabView.prototype._hideAllTabs=function(){
if(this._tabs&&this._tabs.length){
for(var t in this._tabs){
var e=this._tabs[t].view;
if(e&&!(e instanceof AjxCallback)){
e.hideMe();
Dwt.setVisible(e.getHtmlElement(),false)
}}}};
DwtTabView.prototype._tabButtonListener=function(e){
this.switchToTab(e.item.getData("tabKey"))
};
DwtTabViewPage=function(a,t,e){
if(arguments.length==0){
return
}
params=Dwt.getParams(arguments,DwtTabViewPage.PARAMS);
params.className=params.className||"ZTabPage";
params.posStyle=params.posStyle||DwtControl.ABSOLUTE_STYLE;
this._rendered=true;
DwtPropertyPage.call(this,params);
this._createHtml();
this.getHtmlElement().style.overflowY="auto";
this.getHtmlElement().style.overflowX="visible";
if(params.contentTemplate){
this.getContentHtmlElement().innerHTML=AjxTemplate.expand(params.contentTemplate,this._htmlElId)
}};
DwtTabViewPage.prototype=new DwtPropertyPage;
DwtTabViewPage.prototype.constructor=DwtTabViewPage;
DwtTabViewPage.prototype.toString=function(){
return"DwtTabViewPage"
};
DwtTabViewPage.prototype.TEMPLATE="dwt.Widgets#ZTabPage";
DwtTabViewPage.PARAMS=DwtPropertyPage.PARAMS.concat("contentTemplate");
DwtTabViewPage.prototype.getContentHtmlElement=function(){
return this._contentEl||this.getHtmlElement()
};
DwtTabViewPage.prototype.showMe=function(){
this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
if(this.parent.getHtmlElement().offsetHeight>80){
this._contentEl.style.height=this.parent.getHtmlElement().offsetHeight-80
}else{
var t=parseInt(this.parent.getHtmlElement().style.height);
var e=AjxStringUtil.getUnitsFromSizeString(this.parent.getHtmlElement().style.height);
if(t>80){
this._contentEl.style.height=(Number(t-80).toString()+e)
}}
this._contentEl.style.width=this.parent.getHtmlElement().style.width
};
DwtTabViewPage.prototype.hideMe=function(){
this.setZIndex(DwtTabView.Z_HIDDEN_TAB)
};
DwtTabViewPage.prototype.resetSize=function(t,e){
this.setSize(t,e)
};
DwtTabViewPage.prototype._createHtml=function(e){
this._createHtmlFromTemplate(e||this.TEMPLATE,{
id:this._htmlElId}
)
};
DwtTabViewPage.prototype._createHtmlFromTemplate=function(e,t){
DwtPropertyPage.prototype._createHtmlFromTemplate.call(this,e,t);
this._contentEl=document.getElementById(t.id+"_content")||this.getHtmlElement()
};
DwtTabBar=function(a,t,i){
if(arguments.length==0){
return
}
this._buttons=[];
this._btnStyle=i||"ZTab";
this._btnImage=null;
this._currentTabKey=1;
var e=t||"ZTabBar";
DwtToolBar.call(this,{
parent:a,className:e,posStyle:DwtControl.STATIC_STYLE}
)
};
DwtTabBar.prototype=new DwtToolBar;
DwtTabBar.prototype.constructor=DwtTabBar;
DwtTabBar.prototype.TEMPLATE="dwt.Widgets#ZTabBar";
DwtTabBar.prototype.toString=function(){
return"DwtTabBar"
};
DwtTabBar.prototype.getCurrentTab=function(){
return this._currentTabKey
};
DwtTabBar.prototype.addStateChangeListener=function(e){
this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabBar.prototype.removeStateChangeListener=function(e){
this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabBar.prototype.addSelectionListener=function(t,e){
this._buttons[t].addSelectionListener(e)
};
DwtTabBar.prototype.removeSelectionListener=function(t,e){
this._buttons[t].removeSelectionListener(e)
};
DwtTabBar.prototype.addButton=function(n,o,s,a){
var t=this._buttons[n]=new DwtTabButton(this,s,a);
this._buttons[n].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
if(this._btnImage!=null){
t.setImage(this._btnImage)
}
if(o!=null){
t.setText(o)
}
t.setEnabled(true);
t.setData("tabKey",n);
if(parseInt(n)==1){
this.openTab(n,true)
}
var e=this.__getButtonIndex(this._currentTabKey);
if(e!=-1){
var i=this.__getButtonIndex(n);
if(i==e+1){
Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
}}
return t
};
DwtTabBar.prototype.getButton=function(e){
return(this._buttons[e])?this._buttons[e]:null
};
DwtTabBar.prototype.openTab=function(e,o){
this._currentTabKey=e;
var i=this._buttons.length;
for(var t=0;
t<i;
t++){
if(t==e){
continue
}
var a=this._buttons[t];
if(a){
this.__markPrevNext(t,false);
a.setClosed()
}}
var a=this._buttons[e];
if(a){
a.setOpen();
this.__markPrevNext(e,true)
}
if(!o&&this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}};
DwtTabBar._setActiveTab=function(a){
var e;
if(a&&a.item){
e=a.item.getData("tabKey")
}else{
if(a&&a.target){
var t=a.target;
while(t.tagName!="TABLE"&&t.offsetParent){
t=t.offsetParent
}
e=t.getAttribute("tabKey");
if(e==null){
return false
}}else{
return false
}}
this.openTab(e)
};
DwtTabButton=function(t,a,e){
if(arguments.length==0){
return
}
DwtButton.call(this,{
parent:t,className:"ZTab",id:a,index:e}
)
};
DwtTabButton.prototype=new DwtButton;
DwtTabButton.prototype.constructor=DwtTabButton;
DwtTabButton.prototype.TEMPLATE="dwt.Widgets#ZTab";
DwtTabButton.prototype.toString=function(){
return"DwtTabButton"
};
DwtTabButton.prototype.setOpen=function(){
this._isSelected=true;
this.setDisplayState(DwtControl.SELECTED)
};
DwtTabButton.prototype.setClosed=function(){
this._isSelected=false;
this.setDisplayState(DwtControl.NORMAL)
};
DwtTabButton.prototype.setDisplayState=function(e){
if(this._isSelected&&e!=DwtControl.SELECTED){
e=[DwtControl.SELECTED,e].join(" ")
}
DwtButton.prototype.setDisplayState.call(this,e)
};
DwtTabBarFloat=function(t,e,a){
if(arguments.length==0){
return
}
DwtTabBar.call(this,t,e,a)
};
DwtTabBarFloat.prototype=new DwtTabBar;
DwtTabBarFloat.prototype.constructor=DwtTabBarFloat;
DwtTabBarFloat.prototype.TEMPLATE="dwt.Widgets#ZTabBarFloat";
DwtTabBarFloat.prototype.addButton=function(o,i,n){
var t=this._buttons[o]=new DwtTabButtonFloat(this,n);
this._buttons[o].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
if(this._btnImage!=null){
t.setImage(this._btnImage)
}
if(i!=null){
t.setText(i)
}
t.setEnabled(true);
t.setData("tabKey",o);
if(parseInt(o)==1){
this.openTab(o,true)
}
var e=this.__getButtonIndex(this._currentTabKey);
if(e!=-1){
var a=this.__getButtonIndex(o);
if(a==e+1){
Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
}}
return t
};
DwtTabBarFloat.prototype.addChild=function(t,e){
DwtComposite.prototype.addChild.apply(this,arguments);
this._addItem(DwtToolBar.ELEMENT,t,e)
};
DwtTabBarFloat.prototype._addItem=function(i,a,t){
var o=this._items[t]||this._suffixEl;
var e=t||(typeof t=="number")?t:this._items.length;
this._items.splice(e,0,a);
this._itemsEl.insertBefore(a.getHtmlElement(),o)
};
DwtTabButtonFloat=function(e,t){
DwtTabButton.call(this,e,t)
};
DwtTabButtonFloat.prototype=new DwtTabButton;
DwtTabButtonFloat.prototype.constructor=DwtTabButtonFloat;
DwtTabButtonFloat.prototype.TEMPLATE="dwt.Widgets#ZTabFloat"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtWizardDialog")){
DwtWizardDialog=function(o,i,l,e,a){
if(arguments.length==0){
return
}
i=i||"DwtDialog";
var s=new DwtDialog_ButtonDescriptor(DwtWizardDialog.NEXT_BUTTON,AjxMsg._next,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goNext));
var t=new DwtDialog_ButtonDescriptor(DwtWizardDialog.PREV_BUTTON,AjxMsg._prev,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goPrev));
var n=new DwtDialog_ButtonDescriptor(DwtWizardDialog.FINISH_BUTTON,AjxMsg._finish,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.finishWizard));
DwtDialog.call(this,{
parent:o,className:i,standardButtons:[DwtDialog.CANCEL_BUTTON],extraButtons:[t,s,n]}
);
if(!e){
this._contentW="80ex"
}else{
this._contentW=e
}
if(!a){
this._contentH="100ex"
}else{
this._contentH=a
}
this._pages=new Array();
this._pageIx=1;
this._currentPage=1;
this._progressDiv=document.createElement("div");
this._progressDiv.style.position=DwtControl.STATIC_STYLE;
this._pageDiv=document.createElement("div");
this._pageDiv.className="DwtWizardDialogPageDiv";
this._pageDiv.style.width=this._contentW;
this._pageDiv.style.height=this._contentH;
this._progressBar=new DwtWizProgressBar(this);
this._createContentHtml();
this.setTitle(l)
};
DwtWizardDialog.prototype=new DwtDialog;
DwtWizardDialog.prototype.constructor=DwtWizardDialog;
DwtWizardDialog.Z_ACTIVE_PAGE=Dwt.Z_VIEW+10;
DwtWizardDialog.Z_HIDDEN_PAGE=Dwt.Z_HIDDEN;
DwtWizardDialog.Z_TAB_PANEL=Dwt.Z_VIEW+20;
DwtWizardDialog.Z_CURTAIN=Dwt.Z_CURTAIN;
DwtWizardDialog.NEXT_BUTTON=12;
DwtWizardDialog.PREV_BUTTON=11;
DwtWizardDialog.FINISH_BUTTON=13;
DwtWizardDialog.prototype.toString=function(){
return"DwtWizardDialog"
};
DwtWizardDialog.prototype.popdown=function(){
DwtDialog.prototype.popdown.call(this);
this._hideAllPages()
};
DwtWizardDialog.prototype.goPage=function(e){
if(this._pages&&this._pages[e]){
this._currentPage=e;
this._showPage(e);
this._progressBar.showStep(e);
this._pages[e].setActive()
}};
DwtWizardDialog.prototype.goNext=function(){
var e=this._currentPage+1;
if(this._pages&&this._pages[this._currentPage]){
this._pages[this._currentPage].switchToNextPage(e)
}};
DwtWizardDialog.prototype.goPrev=function(){
var e=this._currentPage-1;
if(this._pages&&this._pages[this._currentPage]){
this._pages[this._currentPage].switchToPrevPage(e)
}};
DwtWizardDialog.prototype.finishWizard=function(){
this.popdown()
};
DwtWizardDialog.prototype.getPage=function(e){
if(this._pages&&this._pages[e]){
return this._pages[e]
}else{
return null
}};
DwtWizardDialog.prototype.addPage=function(e,t){
var a=this._pageIx++;
this._pages[a]=e;
this._progressBar.addStep(a,t);
this._pageDiv.appendChild(this._pages[a].getHtmlElement());
if(a==1){
this._pages[a].setZIndex(DwtWizardDialog.Z_ACTIVE_PAGE)
}else{
this._pages[a].setZIndex(DwtWizardDialog.Z_HIDDEN_PAGE);
Dwt.setVisible(this._pages[a].getHtmlElement(),false)
}
return a
};
DwtWizardDialog.prototype._createContentHtml=function(){
this._table=document.createElement("table");
this._table.border=0;
this._table.width=this._contentW;
this._table.cellPadding=this._table.cellSpacing=0;
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
var i;
var o;
i=this._table.insertRow(0);
i.align="left";
i.vAlign="middle";
o=i.insertCell(i.cells.length);
o.align="left";
o.vAlign="middle";
o.noWrap=true;
o.width="100%";
o.className="DwtTabTable";
o.appendChild(this._progressBar.getHtmlElement());
var s;
var e;
s=this._table.insertRow(1);
s.align="center";
s.vAlign="middle";
e=s.insertCell(s.cells.length);
e.align="left";
e.vAlign="middle";
e.noWrap=true;
e.style.width=this._contentW;
var n=document.createElement("div");
n.className="horizSep";
n.style.width=this._contentW;
n.style.height="5px";
e.appendChild(n);
var t;
var a;
t=this._table.insertRow(2);
t.align="left";
t.vAlign="middle";
a=t.insertCell(t.cells.length);
a.align="left";
a.vAlign="middle";
a.noWrap=true;
a.width=this._contentW;
a.appendChild(this._pageDiv);
this._getContentDiv().appendChild(this._table)
};
DwtWizardDialog.prototype.addChild=function(e){
this._children.add(e)
};
DwtWizardDialog.prototype._showPage=function(e){
if(this._pages&&this._pages[e]){
this._hideAllPages();
this._pages[e].showMe();
Dwt.setVisible(this._pages[e].getHtmlElement(),true)
}};
DwtWizardDialog.prototype._hideAllPages=function(){
if(this._pages&&this._pages.length){
for(var e in this._pages){
if(this._pages[e]){
this._pages[e].hideMe();
Dwt.setVisible(this._pages[e].getHtmlElement(),false)
}}}};
DwtWizardPage=function(t,e){
if(arguments.length==0){
return
}
var a=e||"DwtDialog";
DwtPropertyPage.call(this,t,e,DwtControl.ABSOLUTE_STYLE)
};
DwtWizardPage.prototype=new DwtTabViewPage;
DwtWizardPage.prototype.constructor=DwtWizardPage;
DwtWizardPage.prototype.toString=function(){
return"DwtWizardPage"
};
DwtWizardPage.prototype.setActive=function(){};
DwtWizardPage.prototype.switchToNextPage=function(e){
this.parent.goPage(e)
};
DwtWizardPage.prototype.switchToPrevPage=function(e){
this.parent.goPage(e)
};
DwtWizardPage.prototype.showMe=function(){
this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
this.getHtmlElement().style.height=this.parent._contentH;
this.getHtmlElement().style.width=this.parent._contentW
};
DwtWizProgressBar=function(e){
if(arguments.length==0){
return
}
DwtComposite.call(this,{
parent:e,className:"DwtWizProgressBar",posStyle:DwtControl.STATIC_STYLE}
);
this._table=document.createElement("table");
this._table.border=0;
this._table.cellPadding=0;
this._table.cellSpacing=0;
this.getHtmlElement().appendChild(this._table);
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
this._stepsNumber=0;
this._steps=new Array();
this._lblHeader=new DwtStepLabel(this);
this._lblHeader.setText("Step 0 of 0");
this._lblHeader.setActive(true)
};
DwtWizProgressBar.prototype=new DwtComposite;
DwtWizProgressBar.prototype.constructor=DwtWizProgressBar;
DwtWizProgressBar.prototype.toString=function(){
return"DwtWizProgressBar"
};
DwtWizProgressBar.prototype.showStep=function(t){
var e="Step "+t+" of "+this._stepsNumber;
if(this._steps[t]){
e=e+": "+this._steps[t]
}
this._lblHeader.setText(e)
};
DwtWizProgressBar.prototype.addStep=function(t,e){
this._steps[t]=e;
return(++this._stepsNumber)
};
DwtWizProgressBar.prototype.addChild=function(a){
this._children.add(a);
var t;
var e;
this._table.width="100%";
t=(this._table.rows.length!=0)?this._table.rows[0]:this._table.insertRow(0);
t.align="center";
t.vAlign="middle";
e=t.insertCell(t.cells.length);
e.align="center";
e.vAlign="middle";
e.noWrap=true;
e.appendChild(a.getHtmlElement())
};
DwtStepLabel=function(e){
DwtLabel.call(this,{
parent:e,style:DwtLabel.ALIGN_CENTER,className:"DwtStepLabel"}
)
};
DwtStepLabel.prototype=new DwtLabel;
DwtStepLabel.prototype.constructor=DwtStepLabel;
DwtStepLabel.prototype.toString=function(){
return"DwtStepLabel"
};
DwtStepLabel.prototype.setActive=function(e){
if(e){
this._textCell.className="DwtStepLabelActive"
}else{
this._textCell.className="DwtStepLabelInactive"
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtSelect")){
DwtSelect=function(o){
if(arguments.length==0){
return
}
o=Dwt.getParams(arguments,DwtSelect.PARAMS);
o.className=o.className||"ZSelect";
o.posStyle=o.posStyle||Dwt.STATIC_STYLE;
DwtButton.call(this,o);
var a=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
this._setEventHdlrs(a);
this._hasSetMouseEvents=true;
this._currentSelectionId=-1;
this._options=new AjxVector();
this._optionValuesToIndices={};
this._selectedValue=this._selectedOption=null;
this._cascade=o.cascade==null||o.cascade;
var e=o.options;
if(e){
for(var t=0;
t<e.length;
++t){
this.addOption(e[t])
}}
this.setDropDownImages("SelectPullDownArrow","SelectPullDownArrowDis","SelectPullDownArrow","SelectPullDownArrow");
this._menuCallback=new AjxListener(this,this._createMenu);
this.setMenu(this._menuCallback,true)
};
DwtSelect.PARAMS=["parent","options","style","className"];
DwtSelect.prototype=new DwtButton;
DwtSelect.prototype.constructor=DwtSelect;
DwtSelect.prototype.toString=function(){
return"DwtSelect"
};
DwtSelect._CONTAINER_TEMPLATE="dwt.Widgets#ZSelectAutoSizingContainer";
DwtSelect._objectIds=[null];
DwtSelect.prototype.TEMPLATE="dwt.Widgets#ZSelect";
DwtSelect.getObjectFromElement=function(e){
return e&&e.dwtObj?AjxCore.objectWithId(e.dwtObj):null
};
DwtSelect.prototype.addOption=function(i,a,n){
if(!i){
return -1
}
var t=null;
var h=null;
if(typeof(i)=="string"){
h=n!=null?n:i;
t=new DwtSelectOption(h,a,i,this,null,null)
}else{
if(i instanceof DwtSelectOption){
t=i;
if(n){
t.setValue(n)
}
a=t.isSelected()
}else{
if(i instanceof DwtSelectOptionData||i.value!=null){
h=n!=null?n:i.value;
t=new DwtSelectOption(h,i.isSelected,i.displayValue,this,null,i.image,i.selectedValue);
a=Boolean(i.isSelected)
}else{
return -1
}}}
this._options.add(t);
if(this._options.size()==1||a){
this._setSelectedOption(t)
}
var o=this._pseudoItemsEl;
var s=o.insertRow(-1);
var e=s.insertCell(-1);
e.className="ZSelectPseudoItem";
e.innerHTML=["<div class='ZWidgetTitle'>",AjxStringUtil.htmlEncode(t.getDisplayValue()),"</div>"].join("");
this.setMenu(this._menuCallback,true);
this._optionValuesToIndices[t.getValue()]=this._options.size()-1;
return(this._options.size()-1)
};
DwtSelect.prototype.popup=function(){
var n=this.getMenu();
if(!n){
return
}
var i=this._selectEl;
var t=Dwt.getBounds(i);
var o=(i.style.borderLeftWidth=="")?0:parseInt(i.style.borderLeftWidth);
var h=(i.style.borderTopWidth=="")?0:parseInt(i.style.borderTopWidth);
h+=(i.style.borderBottomWidth=="")?0:parseInt(i.style.borderBottomWidth);
var a=Dwt.toWindow(i,0,0);
var e=a.x+o;
var s=a.y+t.height+h;
n.popup(0,e,s)
};
DwtSelect.prototype.rename=function(t,a){
var e=this.getOptionWithValue(t);
e._displayValue=a;
if(this.__selectedOption&&(this.__selectedOption._value==t)){
this.setText(AjxStringUtil.htmlEncode(a))
}
this.setMenu(this._menuCallback,true)
};
DwtSelect.prototype.enableOption=function(i,e){
var t=this.getOptionWithValue(i);
if(t.enabled!=e){
t.enabled=e;
var a=t.getItem();
if(a){
a.setEnabled(e)
}}};
DwtSelect.prototype.clearOptions=function(){
var t=this._options.getArray();
for(var e=0;
e<t.length;
++e){
t[e]=null
}
this._options.removeAll();
this._optionValuesToIndices=null;
this._optionValuesToIndices=[];
this._selectedValue=null;
this._selectedOption=null;
this._currentSelectionId=-1
};
DwtSelect.prototype.setName=function(e){
this._name=e
};
DwtSelect.prototype.getName=function(){
return this._name
};
DwtSelect.prototype.setSelectedValue=function(t){
var e=this._optionValuesToIndices[t];
if(e!=null){
this.setSelected(e)
}};
DwtSelect.prototype.setSelected=function(e){
var t=this.getOptionWithHandle(e);
this.setSelectedOption(t)
};
DwtSelect.prototype.getOptionCount=function(){
return this._options.size()
};
DwtSelect.prototype.getOptions=function(){
return this._options
};
DwtSelect.prototype.getOptionWithHandle=function(e){
return this._options.get(e)
};
DwtSelect.prototype.getOptionAtIndex=DwtSelect.prototype.getOptionWithHandle;
DwtSelect.prototype.getIndexForValue=function(e){
return this._optionValuesToIndices[e]
};
DwtSelect.prototype.getOptionWithValue=function(a){
var e=this._optionValuesToIndices[a];
var t=null;
if(e!=null){
t=this.getOptionWithHandle(e)
}
return t
};
DwtSelect.prototype.setSelectedOption=function(e){
if(e){
this._setSelectedOption(e)
}};
DwtSelect.prototype.getValue=function(){
return this._selectedValue
};
DwtSelect.prototype.getSelectedOption=function(){
return this._selectedOption
};
DwtSelect.prototype.getSelectedIndex=function(){
return this.getIndexForValue(this.getValue())
};
DwtSelect.prototype.addChangeListener=function(e){
this.addListener(DwtEvent.ONCHANGE,e)
};
DwtSelect.prototype.size=function(){
return this._options.size()
};
DwtSelect.prototype.disable=function(){
this.setEnabled(false)
};
DwtSelect.prototype.enable=function(){
this.setEnabled(true)
};
DwtSelect.prototype.setImage=function(e){
DwtLabel.prototype.setImage.call(this,e)
};
DwtSelect.prototype.setText=function(e){
DwtLabel.prototype.setText.call(this,e)
};
DwtSelect.prototype.dispose=function(){
this._selectEl=null;
this._pseudoItemsEl=null;
this._containerEl=null;
DwtButton.prototype.dispose.call(this);
if(this._internalObjectId){
DwtSelect._unassignId(this._internalObjectId)
}};
DwtSelect._assignId=function(e){
var t=DwtSelect._objectIds.length;
DwtSelect._objectIds[t]=e;
return t
};
DwtSelect._getObjectWithId=function(e){
return DwtSelect._objectIds[e]
};
DwtSelect._unassignId=function(e){
DwtSelect._objectIds[e]=null
};
DwtSelect.prototype._createHtmlFromTemplate=function(a,o){
var t=DwtSelect._CONTAINER_TEMPLATE;
var e={
id:o.id,selectTemplateId:a||this.TEMPLATE,selectData:o};
DwtButton.prototype._createHtmlFromTemplate.call(this,t,e);
this._selectEl=document.getElementById(o.id+"_select_container");
this._pseudoItemsEl=document.getElementById(o.id+"_pseudoitems_container");
this._pseudoItemsEl.style.display="none";
var i=this.getHtmlElement();
this._containerEl=i;
this._selectEl.className=i.className;
i.className="ZSelectAutoSizingContainer";
i.setAttribute("style","");
if(AjxEnv.isIE){
i.style.overflow="hidden"
}};
DwtSelect.prototype._createMenu=function(){
var h=new DwtSelectMenu(this);
for(var a=0,e=this._options.size();
a<e;
++a){
var t=new DwtSelectMenuItem(h);
var o=this._options.get(a);
var n=o.getImage();
if(n){
t.setImage(n)
}
var s=o.getDisplayValue();
if(s){
t.setText(AjxStringUtil.htmlEncode(s))
}
t.setEnabled(o.enabled);
t.addSelectionListener(new AjxListener(this,this._handleOptionSelection));
t._optionIndex=a;
o.setItem(t)
}
return h
};
DwtSelect.prototype._handleOptionSelection=function(s){
var i=s.item;
var n=i._optionIndex;
var a=this._options.get(n);
var t=this.getValue();
this._setSelectedOption(a);
var e=new Object();
e.selectObj=this;
e.newValue=a.getValue();
e.oldValue=t;
var o=DwtUiEvent.getEvent(s);
o._args=e;
this.notifyListeners(DwtEvent.ONCHANGE,o)
};
DwtSelect.prototype._clearOptionSelection=function(){
if(this._currentSelectionId!=-1){
var e=DwtSelect._getObjectWithId(this._currentSelectionId);
e.deSelect()
}};
DwtSelect.prototype._setSelectedOption=function(t){
var e=t.getSelectedValue()||t.getDisplayValue();
var a=t.getImage();
if(this._selectedOption!=t){
if(e){
this.setText(AjxStringUtil.htmlEncode(e))
}
this.setImage(a);
this._selectedValue=t._value;
this._selectedOption=t
}
this._updateSelection(t);
this.autoResize()
};
DwtSelect.prototype.autoResize=function(){
var e=this.getHtmlElement();
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
var t=document.getElementById(e.id);
if(t){
t.style.width=t.childNodes[0].offsetWidth||"auto"
}}
,200))
};
DwtSelect.prototype._updateSelection=function(e){
var t=(this._currentSelectionId!=-1)?DwtSelect._getObjectWithId(this._currentSelectionId):null;
if(t){
t.deSelect()
}
if(e){
e.select();
this._currentSelectionId=e.getIdentifier()
}};
DwtSelect.prototype.updateRendering=function(){
var e=this.getScrollStyle();
this.setScrollStyle(e==Dwt.VISIBLE?Dwt.CLIP:Dwt.VISIBLE);
var t=function(){
try{
this.setScrollStyle(e)
}
catch(i){}};
var a=new AjxTimedAction(this,t);
AjxTimedAction.scheduleAction(a,4)
};
DwtSelectOptionData=function(i,a,e,t,o){
if(i==null||a==null){
return null
}
this.value=i;
this.displayValue=a;
this.isSelected=e;
this.selectedValue=t;
this.image=o
};
DwtSelectOption=function(n,o,i,t,e,s,a){
this._value=n;
this._selected=o;
this._displayValue=i;
this._image=s;
this._selectedValue=a;
this._internalObjectId=DwtSelect._assignId(this);
this.enabled=true
};
DwtSelectOption.prototype.setItem=function(e){
this._menuItem=e
};
DwtSelectOption.prototype.getItem=function(e){
return this._menuItem
};
DwtSelectOption.prototype.getDisplayValue=function(){
return this._displayValue
};
DwtSelectOption.prototype.getImage=function(){
return this._image
};
DwtSelectOption.prototype.getSelectedValue=function(){
return this._selectedValue
};
DwtSelectOption.prototype.getValue=function(){
return this._value
};
DwtSelectOption.prototype.setValue=function(e){
this._value=e
};
DwtSelectOption.prototype.select=function(){
this._selected=true
};
DwtSelectOption.prototype.deSelect=function(){
this._selected=false
};
DwtSelectOption.prototype.isSelected=function(){
return this._selected
};
DwtSelectOption.prototype.getIdentifier=function(){
return this._internalObjectId
};
DwtSelectMenu=function(e){
DwtMenu.call(this,{
parent:e,style:DwtMenu.DROPDOWN_STYLE,className:"DwtMenu",cascade:e._cascade}
)
};
DwtSelectMenu.prototype=new DwtMenu;
DwtSelectMenu.prototype.constructor=DwtSelectMenu;
DwtSelectMenu.prototype.TEMPLATE="dwt.Widgets#ZSelectMenu";
DwtSelectMenuItem=function(e){
DwtMenuItem.call(this,{
parent:e,style:DwtMenuItem.SELECT_STYLE,className:"ZSelectMenuItem"}
)
};
DwtSelectMenuItem.prototype=new DwtMenuItem;
DwtSelectMenuItem.prototype.constructor=DwtSelectMenuItem;
DwtSelectMenuItem.prototype.TEMPLATE="dwt.Widgets#ZSelectMenuItem"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtAlert")){
DwtAlert=function(a,t,e){
if(arguments.length==0){
return
}
t=t||"DwtAlert";
e=e||DwtControl.STATIC_STYLE;
DwtControl.call(this,{
parent:a,className:t,posStyle:e}
);
this._alertStyle=DwtAlert.INFORMATION;
this._createHtml()
};
DwtAlert.prototype=new DwtControl;
DwtAlert.prototype.constructor=DwtAlert;
DwtAlert.INFORMATION=0;
DwtAlert.WARNING=1;
DwtAlert.CRITICAL=2;
DwtAlert._ICONS=[AjxImg.getClassForImage("Information_32"),AjxImg.getClassForImage("Warning_32"),AjxImg.getClassForImage("Critical_32")];
DwtAlert._CLASSES=["DwtAlertInfo","DwtAlertWarn","DwtAlertCrit"];
DwtAlert._RE_ICONS=new RegExp(DwtAlert._ICONS.join("|"));
DwtAlert._RE_CLASSES=new RegExp(DwtAlert._CLASSES.join("|"));
DwtAlert.prototype.TEMPLATE="dwt.Widgets#DwtAlert";
DwtAlert.prototype.setStyle=function(e){
this._alertStyle=e||DwtAlert.INFORMATION;
if(this._iconDiv){
Dwt.delClass(this._iconDiv,DwtAlert._RE_ICONS,DwtAlert._ICONS[this._alertStyle])
}
Dwt.delClass(this.getHtmlElement(),DwtAlert._RE_CLASSES,DwtAlert._CLASSES[this._alertStyle])
};
DwtAlert.prototype.getStyle=function(){
return this._alertStyle
};
DwtAlert.prototype.setIconVisible=function(e){
if(this._iconDiv){
Dwt.setVisible(this._iconDiv,e)
}};
DwtAlert.prototype.getIconVisible=function(){
return this._iconDiv?Dwt.getVisible(this._iconDiv):false
};
DwtAlert.prototype.setTitle=function(e){
this._alertTitle=e;
if(this._titleDiv){
this._titleDiv.innerHTML=e||""
}};
DwtAlert.prototype.getTitle=function(){
return this._alertTitle
};
DwtAlert.prototype.setContent=function(e){
this._alertContent=e;
if(this._contentDiv){
this._contentDiv.innerHTML=e||""
}};
DwtAlert.prototype.getContent=function(){
return this._alertContent
};
DwtAlert.prototype.setDismissContent=function(e){
if(this._dismissDiv){
e.reparentHtmlElement(this._dismissDiv.id)
}};
DwtAlert.prototype.getTabGroupMember=function(){
return null
};
DwtAlert.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtAlert.prototype._createHtmlFromTemplate=function(e,t){
DwtControl.prototype._createHtmlFromTemplate.apply(this,arguments);
this._iconDiv=document.getElementById(t.id+"_icon");
this._titleDiv=document.getElementById(t.id+"_title");
this._contentDiv=document.getElementById(t.id+"_content");
this._dismissDiv=document.getElementById(t.id+"_dismiss")
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPropertySheet")){
DwtPropertySheet=function(o,i,a,e){
if(arguments.length==0){
return
}
i=i||"DwtPropertySheet";
DwtComposite.call(this,{
parent:o,className:i,posStyle:a}
);
this._labelSide=e||DwtPropertySheet.DEFAULT;
this._propertyIdCount=0;
this._propertyList=[];
this._propertyMap={};
this._tableEl=document.createElement("TABLE");
this._tableEl.border=0;
this._tableEl.cellSpacing=3;
this._tableEl.cellPadding=0;
var t=this.getHtmlElement();
t.appendChild(this._tableEl)
};
DwtPropertySheet.prototype=new DwtComposite;
DwtPropertySheet.prototype.constructor=DwtPropertySheet;
DwtPropertySheet.prototype.toString=function(){
return"DwtPropertySheet"
};
DwtPropertySheet.RIGHT="right";
DwtPropertySheet.LEFT="left";
DwtPropertySheet.DEFAULT=DwtPropertySheet.LEFT;
DwtPropertySheet.prototype._labelSide;
DwtPropertySheet.prototype._labelCssClass="Label";
DwtPropertySheet.prototype._valueCssClass="Field";
DwtPropertySheet.prototype._tableEl;
DwtPropertySheet.prototype._propertyIdCount;
DwtPropertySheet.prototype._propertyList;
DwtPropertySheet.prototype._propertyMap;
DwtPropertySheet.prototype.addProperty=function(t,i,n){
var e=this._tableEl.rows.length;
var o=this._tableEl.insertRow(e);
o.vAlign=this._vAlign?this._vAlign:"top";
if(this._labelSide==DwtPropertySheet.LEFT){
this._insertLabel(o,t,n);
this._insertValue(o,i,n)
}else{
this._insertValue(o,i,n);
this._insertLabel(o,t,n)
}
var s=this._propertyIdCount++;
var a={
id:s,index:e,row:o,visible:true};
this._propertyList.push(a);
this._propertyMap[s]=a;
return s
};
DwtPropertySheet.prototype._insertLabel=function(o,e,i){
var a=o.insertCell(-1);
a.className=this._labelCssClass;
if(this._labelSide!=DwtPropertySheet.LEFT){
a.width="100%";
a.style.textAlign="left"
}
a.innerHTML=e;
if(i){
var t=this._tableEl.ownerDocument.createElement("SUP");
t.innerHTML="*";
a.insertBefore(t,a.firstChild)
}};
DwtPropertySheet.prototype._insertValue=function(i,t,a){
var e=i.insertCell(-1);
e.className=this._valueCssClass;
if(!t){
e.innerHTML="&nbsp;"
}else{
if(t instanceof DwtControl){
e.appendChild(t.getHtmlElement())
}else{
if(t.nodeType==AjxUtil.ELEMENT_NODE){
e.appendChild(t)
}else{
e.innerHTML=String(t)
}}}};
DwtPropertySheet.prototype.removeProperty=function(s){
var n=this._propertyMap[s];
if(n.visible){
var t=n.index;
var o=this.__getTableIndex(t);
var a=this._tableEl.rows[o];
a.parentNode.removeChild(a)
}
n.row=null;
for(var e=index+1;
e<this._propertyList.length;
e++){
var n=this._propertyList[e];
n.index--
}
this._propertyList.splice(index,1);
delete this._propertyMap[s]
};
DwtPropertySheet.prototype.setPropertyVisible=function(n,i){
var o=this._propertyMap[n];
if(o.visible!=i){
o.visible=i;
var e=o.index;
if(i){
var a=this.__getTableIndex(e);
var t=this._tableEl.insertRow(a);
DwtPropertySheet.__moveChildNodes(o.row,t);
o.row=t
}else{
var t=o.row;
if(t&&t.parentNode){
t.parentNode.removeChild(t)
}}}};
DwtPropertySheet.prototype.__getTableIndex=function(t){
var a=0;
for(var e=0;
e<t;
e++){
var o=this._propertyList[e];
if(o.visible){
a++
}}
return a
};
DwtPropertySheet.__moveChildNodes=function(t,e){
if(t===e){
return
}
var a=t.firstChild;
while(a!=null){
e.appendChild(a);
a=t.firstChild
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtGrouper")){
DwtGrouper=function(i,a,t){
if(arguments.length==0){
return
}
a=a||"DwtGrouper";
t=t||DwtControl.STATIC_STYLE;
DwtComposite.call(this,{
parent:i,posStyle:t}
);
this._labelEl=document.createElement("LEGEND");
this._insetEl=document.createElement("DIV");
this._borderEl=document.createElement("FIELDSET");
this._borderEl.appendChild(this._labelEl);
this._borderEl.appendChild(this._insetEl);
var e=this.getHtmlElement();
e.appendChild(this._borderEl)
};
DwtGrouper.prototype=new DwtComposite;
DwtGrouper.prototype.constructor=DwtGrouper;
DwtGrouper.prototype._borderEl;
DwtGrouper.prototype._labelEl;
DwtGrouper.prototype._insetEl;
DwtGrouper.prototype.setLabel=function(e){
Dwt.setVisible(this._labelEl,Boolean(e));
this._labelEl.style.display="";
this._labelEl.innerHTML=e?e:""
};
DwtGrouper.prototype.setContent=function(t){
var e=this._insetEl;
e.innerHTML=t
};
DwtGrouper.prototype.setElement=function(t){
var e=this._insetEl;
Dwt.removeChildren(e);
e.appendChild(t)
};
DwtGrouper.prototype.setView=function(e){
this.setElement(e.getHtmlElement())
};
DwtGrouper.prototype.getInsetHtmlElement=function(){
return this._insetEl
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtProgressBar")){
DwtProgressBar=function(a,t,e){
if(arguments.length==0){
return
}
e=e||DwtControl.STATIC_STYLE;
DwtComposite.call(this,{
parent:a,posStyle:e}
);
this._maxValue=100;
this._value=0;
this._quotabarDiv=null;
this._quotausedDiv=null;
this._progressBgColor=null;
this._progressCssClass="quotaused";
this._wholeBgColor=null;
this._wholeCssClass="quotabar";
this._createHTML()
};
DwtProgressBar.prototype=new DwtComposite;
DwtProgressBar.prototype.constructor=DwtProgressBar;
DwtProgressBar.prototype.setProgressBgColor=function(e){
this._progressBgColor=e
};
DwtProgressBar.prototype.setWholeBgColor=function(e){
this._wholeBgColor=e
};
DwtProgressBar.prototype.setProgressCssClass=function(e){
this._progressCssClass=e
};
DwtProgressBar.prototype.setWholeCssClass=function(e){
this._wholeCssClass=e
};
DwtProgressBar.prototype.setProgressCssStyle=function(e){
this._progressCssStyle=e
};
DwtProgressBar.prototype.setWholeCssStyle=function(e){
this._wholeCssStyle=e
};
DwtProgressBar.prototype.setValue=function(t){
this._value=parseInt(t);
var e;
if(this._value==this._maxValue){
e=100
}else{
e=Math.min(Math.round((this._value/this._maxValue)*100),100)
}
if(isNaN(e)){
e="0"
}
if(!this._quotabarDiv){
this._quotabarDiv=document.createElement("div");
if(this._wholeCssClass){
this._quotabarDiv.className=this._wholeCssClass
}
if(this._wholeBgColor){
this._quotabarDiv.backgroundColor=this._wholeBgColor
}
this._cell.appendChild(this._quotabarDiv)
}
if(!this._quotausedDiv){
this._quotausedDiv=document.createElement("div");
if(this._progressCssClass){
this._quotausedDiv.className=this._progressCssClass
}
if(this._progressBgColor){
this._quotausedDiv.style.backgroundColor=this._progressBgColor
}
this._quotabarDiv.appendChild(this._quotausedDiv)
}
this._quotausedDiv.style.width=e+"%"
};
DwtProgressBar.prototype.setValueByPercent=function(e){
this.setMaxValue(100);
this.setValue(e.replace(/\%/gi,""))
};
DwtProgressBar.prototype.getValue=function(){
return this._value
};
DwtProgressBar.prototype.getMaxValue=function(){
return this._maxValue
};
DwtProgressBar.prototype.setMaxValue=function(e){
this._maxValue=parseInt(e)
};
DwtProgressBar.prototype.setLabel=function(o,t){
var a=document.createTextNode(o);
var e=t?-1:0;
var i=this._row.insertCell(e);
i.appendChild(a)
};
DwtProgressBar.prototype._createHTML=function(){
this._table=document.createElement("table");
this._table.border=this._table.cellpadding=this._table.cellspacing=0;
this._row=this._table.insertRow(-1);
this._cell=this._row.insertCell(-1);
this.getHtmlElement().appendChild(this._table)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyEditor")){
DwtPropertyEditor=function(o,t,i,a,e){
if(arguments.length>0){
if(!i){
i="DwtPropertyEditor"
}
DwtComposite.call(this,{
parent:o,className:i,posStyle:a,deferred:e}
);
this._useDwtInputField=t!=null?t:true;
this._schema=null;
this._init()
}};
DwtPropertyEditor.MSG_TIMEOUT=4000;
DwtPropertyEditor.MSG={
mustMatch:"This field does not match validators: REGEXP",mustNotMatch:"This field matches anti-validators: REGEXP"};
DwtPropertyEditor.prototype=new DwtComposite;
DwtPropertyEditor.prototype.constructor=DwtPropertyEditor;
DwtPropertyEditor.prototype.toString=function(){
return"DwtPropertyEditor"
};
DwtPropertyEditor.prototype._init=function(){
var t=document.createElement("div");
t.id=this._relDivId=Dwt.getNextId();
t.style.position="relative";
var e=document.createElement("table");
e.id=this._tableId=Dwt.getNextId();
e.cellSpacing=e.cellPadding=0;
e.appendChild(document.createElement("tbody"));
t.appendChild(e);
this.getHtmlElement().appendChild(t);
this.maxLabelWidth=0;
this.maxFieldWidth=0;
this._setMouseEventHdlrs();
this._onMouseDown=new AjxListener(this,this._onMouseDown);
this.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown)
};
DwtPropertyEditor.prototype.getRelDiv=function(){
return document.getElementById(this._relDivId)
};
DwtPropertyEditor.prototype.getTable=function(){
return document.getElementById(this._tableId)
};
DwtPropertyEditor.prototype._onMouseDown=function(a){
var i=a.target;
var e=i.tagName.toLowerCase();
if(e=="input"){
a._stopPropagation=false;
a._returnValue=true;
return true
}
if(this._currentInputField&&!this._currentInputField.onblur()){
a._stopPropagation=true;
a._returnValue=false;
return false
}
try{
while(i&&e!="tr"){
i=i.parentNode;
e=i.tagName.toLowerCase()
}
if(i&&i.__msh_doMouseDown){
i.__msh_doMouseDown(a)
}}
catch(t){}};
DwtPropertyEditor.prototype.getProperties=function(){
if(this._currentInputField){
this._currentInputField.onblur()
}
function e(o){
var h={}
,a,s=o.length;
for(var t=0;
t<s;
++t){
a=o[t];
if(a.type=="struct"){
h[a.name]=e(a.children)
}else{
h[a.name]=a.value
}}
return h
}
return e(this._schema)
};
DwtPropertyEditor.prototype.validateData=function(){
var e=true;
function t(s){
var o,h=s.length;
for(var a=0;
a<h;
++a){
o=s[a];
if(o.type=="struct"){
t(o.children)
}else{
if(!o._validate()){
e=false
}}}}
t(this._schema);
return e
};
DwtPropertyEditor.prototype.initProperties=function(a,t){
if(t==null){
this._schema=a;
t=null
}
for(var e=0;
e<a.length;
++e){
this._createProperty(a[e],t)
}};
DwtPropertyEditor.prototype._createProperty=function(e,c){
var t=c?c._level+1:0;
var l=this.getTable().firstChild.appendChild(document.createElement("tr"));
e._parent=c;
e._level=t;
e._rowElId=l.id=Dwt.getNextId();
e._propertyEditor=this;
for(var s in DwtPropertyEditor._prop_functions){
e[s]=DwtPropertyEditor._prop_functions[s]
}
e._init();
l.className="level-"+t;
if(e.visible=="false"){
l.className+=" invisible"
}
if(e.readonly){
l.className+=" readonly"
}
if(e.type!="struct"){
l.className+=" "+e.type;
var a=document.createElement("td");
a.className="label";
if(e.type=="checkboxgroup"){
a.className+=" grouplabel"
}
l.appendChild(a);
var h=AjxStringUtil.htmlEncode(e.label||e.name);
if(e.required){
h+="<span class='DwtPropertyEditor-required'>*</span>"
}
a.innerHTML=h;
var o=document.createElement("td");
o.className="field";
l.appendChild(o);
switch(e.type){
case"boolean":this._createCheckbox(e,o);
break;
case"enum":this._createDropDown(e,o);
break;
case"date":this._createCalendar(e,o);
break;
case"checkboxgroup":this._createCheckBoxGroup(e,o);
break;
default:if(this._useDwtInputField){
this._createInputField(e,o)
}else{
o.innerHTML=e._makeDisplayValue();
l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._edit,e)
}
break
}
e._fieldCellId=o.id=Dwt.getNextId();
if(a.offsetWidth>this.maxLabelWidth){
this.maxLabelWidth=a.offsetWidth
}
if(o.offsetWidth>this.maxFieldWidth){
this.maxFieldWidth=o.offsetWidth
}}else{
var n=document.createElement("td");
n.colSpan=2;
l.appendChild(n);
n.className="label";
l.className+=" expander-collapsed";
n.innerHTML=["<div>",AjxStringUtil.htmlEncode(e.label),"</div>"].join("");
this.initProperties(e.children,e);
l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._toggle,e)
}
if(t>0){
l.style.display="none";
c._hidden=true
}};
DwtPropertyEditor.prototype.setFixedLabelWidth=function(e){
try{
this.getTable().rows[0].cells[0].style.width=(e||this.maxLabelWidth)+"px"
}
catch(t){}};
DwtPropertyEditor.prototype.setFixedFieldWidth=function(e){
try{
this.getTable().rows[0].cells[1].style.width=(e||this.maxFieldWidth)+"px"
}
catch(t){}};
DwtPropertyEditor.prototype._setCurrentMsgDiv=function(e){
this._currentMsgDiv=e;
this._currentMsgDivTimer=setTimeout(DwtPropertyEditor.simpleClosure(this._clearMsgDiv,this),DwtPropertyEditor.MSG_TIMEOUT)
};
DwtPropertyEditor.prototype._clearMsgDiv=function(){
try{
this._stopMsgDivTimer()
}
catch(e){}
var t=this._currentMsgDiv;
if(t){
t.parentNode.removeChild(t);
this._currentMsgDiv=t=null;
this._currentMsgDivTimer=null
}};
DwtPropertyEditor.prototype._stopMsgDivTimer=function(){
if(this._currentMsgDivTimer){
clearTimeout(this._currentMsgDivTimer);
this._currentMsgDivTimer=null
}};
DwtPropertyEditor.prototype.addChild=function(e){
if(!this._currentFieldCell){
DwtComposite.prototype.addChild.call(this,e)
}else{
this._children.add(e);
this._currentFieldCell.appendChild(e.getHtmlElement())
}};
DwtPropertyEditor.prototype._createCheckbox=function(a,t){
var e=document.createElement("input");
e._prop=a;
e.id=a.name;
e.type="checkbox";
if(AjxEnv.isIE){
e.attachEvent("onclick",a._onCheckboxChange)
}else{
e.addEventListener("click",a._onCheckboxChange,false)
}
this._children.add(e);
t.appendChild(e);
if(a.value=="true"){
e.checked=a.value
}};
DwtPropertyEditor.prototype._createCheckBoxGroup=function(e,n){
var t=document.createElement("div");
t._prop=e;
t.id=e.name;
e._checkBox=[];
t.appendChild(document.createTextNode(e.value));
var l=document.createElement("table");
l.id=Dwt.getNextId();
l.border=0;
l.cellSpacing=l.cellPadding=0;
l.appendChild(document.createElement("tbody"));
for(var a=0;
a<e.checkBox.length;
a++){
var s=document.createElement("tr");
var c=document.createElement("td");
c.className="field";
var o=this._createCheckboxForGroup(e,e.checkBox[a],c);
s.appendChild(c);
o._label=e.checkBox[a].label;
var h=document.createElement("td");
h.className="field";
h.appendChild(document.createTextNode(e.checkBox[a].label));
s.appendChild(h);
l.firstChild.appendChild(s);
e._checkBox[a]=o
}
t.appendChild(l);
this._children.add(t);
n.appendChild(t);
return t
};
DwtPropertyEditor.prototype._createCheckboxForGroup=function(e,i,a){
var t=document.createElement("input");
t._prop=e;
t.id=i.name;
t.type="checkbox";
if(i.value=="true"){
t.checked=i.value
}
if(AjxEnv.isIE){
t.attachEvent("onclick",e._onCheckboxGroupChange)
}else{
t.addEventListener("click",e._onCheckboxGroupChange,false)
}
this._children.add(t);
a.appendChild(t);
return t
};
DwtPropertyEditor.prototype._createDropDown=function(h,s){
this._currentFieldCell=s;
var o,n,a=0,t=[],e=h.item;
while(o=e[a]){
t[a++]=new DwtSelectOption(o.value,o.value==h.value,o.label)
}
h._select=n=new DwtSelect({
parent:this,options:t}
);
n.addChangeListener(new AjxListener(h,h._onSelectChange));
n.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown);
this._currentFieldCell=null
};
DwtPropertyEditor.prototype._createCalendar=function(n,i){
this._currentFieldCell=i;
var t=new DwtButton({
parent:this}
);
this._currentFieldCell=null;
t.setText(n._makeDisplayValue());
var o=new DwtMenu({
parent:t,style:DwtMenu.CALENDAR_PICKER_STYLE}
);
o.setAssociatedObj(t);
var a=new DwtCalendar({
parent:o}
);
var e=new Date();
e.setTime(n.value);
a.setDate(e);
a.setSize(150,"auto");
a.addSelectionListener(new AjxListener(n,n._onCalendarSelect));
t.setMenu(o);
n._dateButton=t;
n._dateCalendar=a
};
DwtPropertyEditor.DWT_INPUT_FIELD_TYPES={
string:DwtInputField.STRING,password:DwtInputField.PASSWORD,integer:DwtInputField.INTEGER,number:DwtInputField.FLOAT};
DwtPropertyEditor.prototype._createInputField=function(i,a){
this._currentFieldCell=a;
var e=DwtPropertyEditor.DWT_INPUT_FIELD_TYPES[i.type]||DwtInputField.STRING;
var t=new DwtInputField({
parent:this,type:e,initialValue:i.value,maxLen:i.maxLength,rows:i.rows}
);
if(e==DwtInputField.INTEGER||e==DwtInputField.FLOAT){
t.setValidNumberRange(i.minValue||null,i.maxValue||null);
if(i.decimals!=null){
t.setNumberPrecision(i.decimals)
}}
if(e==DwtInputField.STRING||e==DwtInputField.PASSWORD){
t.setValidStringLengths(i.minLength,i.maxLength)
}
if(i.required){
t.setRequired()
}
this._currentFieldCell=null;
i._inputField=t;
t.setValue(i.value);
if(i.readonly){
t.setReadOnly(true)
}
t.setValidationCallback(new AjxCallback(i,i._onDwtInputFieldValidated))
};
DwtPropertyEditor._prop_functions={
_init:function(){
this.type!=null||(this.type="string");
this.value!=null||(this.value="");
this._initialVal=this.value;
if(this.type=="date"){
if(!this.value){
this.value=new Date().getTime()
}
if(!this.format){
this.format=AjxDateUtil.getSimpleDateFormat().toPattern()
}}}
,_modified:function(){
return this._initialVal!=this.value
}
,_getRowEl:function(){
return document.getElementById(this._rowElId)
}
,_makeDisplayValue:function(){
var t=this._getValue();
switch(this.type){
case"password":t=t.replace(/./g,"*");
break;
case"date":var e=new Date();
e.setTime(t);
t=AjxDateFormat.format(this.format,e);
break
}
if(t==""){
t="<br />"
}else{
t=AjxStringUtil.htmlEncode(String(t))
}
return t
}
,_display:function(o){
var n=this.children,a=o?"":"none";
if(n){
var e=n.length;
while(--e>=0){
n[e]._getRowEl().style.display=a;
if(!o){
n[e]._display(false)
}}
this._hidden=!o;
var t=this._getRowEl();
t.className=t.className.replace(/expander-[^\s]+/,o?"expander-expanded":"expander-collapsed")
}}
,_toggle:function(){
this._display(this._hidden)
}
,_edit:function(){
if(this.readonly){
return
}
switch(this.type){
case"string":case"number":case"integer":case"password":setTimeout(DwtPropertyEditor.simpleClosure(this._createInputField,this),50);
break
}}
,_createInputField:function(){
var e=this._propertyEditor;
var n=document.getElementById(this._fieldCellId);
var a=e.getRelDiv();
var t=document.createElement("input");
t.className="DwtPropertyEditor-input "+this.type;
t.setAttribute("autocomplete","off");
t.type=this.type=="password"?"password":"text";
var o=n.offsetLeft,i=n.offsetTop;
if(AjxEnv.isGeckoBased){
--o;
--i
}
t.style.left=o+"px";
t.style.top=i+"px";
t.style.width=n.offsetWidth+1+"px";
t.style.height=n.offsetHeight+1+"px";
t.value=this._getValue();
a.appendChild(t);
t.focus();
t.onblur=DwtPropertyEditor.simpleClosure(this._saveInput,this);
t.onkeydown=DwtPropertyEditor.simpleClosure(this._inputKeyPress,this);
this._propertyEditor._currentInputField=this._inputField=t;
if(!AjxEnv.isGeckoBased){
t.select()
}else{
t.setSelectionRange(0,t.value.length)
}}
,_getValue:function(){
return this.value||""
}
,_checkValue:function(a){
var e=a=="";
if(e){
if(!this.required){
return a
}
this._displayMsg(AjxMsg.valueIsRequired);
return null
}
if(this.maxLength!=null&&a.length>this.maxLength){
this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooLong,this.maxLength));
return null
}
if(this.minLength!=null&&a.length<this.minLength){
this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooShort,this.minLength));
return null
}
if(this.mustMatch&&!this.mustMatch.test(a)){
this._displayMsg(this.msg_mustMatch||DwtPropertyEditor.MSG.mustMatch.replace(/REGEXP/,this.mustMatch.toString()));
return null
}
if(this.mustNotMatch&&this.mustNotMatch.test(a)){
this._displayMsg(this.msg_mustNotMatch||DwtPropertyEditor.MSG.mustNotMatch.replace(/REGEXP/,this.mustNotMatch.toString()));
return null
}
switch(this.type){
case"integer":case"number":var o=new Number(a);
if(isNaN(o)){
this._displayMsg(AjxMsg.notANumber);
return null
}
if(this.type=="integer"&&Math.round(o)!=o){
this._displayMsg(AjxMsg.notAnInteger);
return null
}
if(this.minValue!=null&&o<this.minValue){
this._displayMsg(AjxMessageFormat.format(AjxMsg.numberLessThanMin,this.minValue));
return null
}
if(this.maxValue!=null&&o>this.maxValue){
this._displayMsg(AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this.maxValue));
return null
}
a=o;
if(this.type=="number"&&this.decimals!=null){
var t=a.toString();
var i=t.indexOf(".");
if(i==-1){
i=t.length
}
a=a.toPrecision(i+this.decimals)
}
break
}
return a
}
,_displayMsg:function(t){
var s,n,l,i;
var o=this._propertyEditor;
var e=o._currentMsgDiv;
if(!e){
e=document.createElement("div");
e.className="DwtPropertyEditor-ErrorMsg";
o.getRelDiv().appendChild(e)
}else{
o._stopMsgDivTimer()
}
e.style.visibility="hidden";
e.innerHTML=AjxStringUtil.htmlEncode(t);
var c=o.getTable();
l=c.offsetWidth;
if(!AjxEnv.isIE){
l-=12
}
s=c.offsetLeft;
e.style.left=s+"px";
e.style.width=l+"px";
i=e.offsetHeight;
var a=document.getElementById(this._fieldCellId);
n=a.offsetTop+a.offsetHeight;
if(n+i>c.offsetTop+c.offsetHeight){
n=a.offsetTop-i
}
e.style.top=n+"px";
e.style.visibility="";
o._setCurrentMsgDiv(e)
}
,_saveInput:function(){
var e=this._inputField;
var t=this._checkValue(e.value);
if(t!=null){
this._setValue(t);
e.onblur=e.onkeyup=e.onkeydown=e.onkeypress=null;
var a=document.getElementById(this._fieldCellId);
a.innerHTML=this._makeDisplayValue();
this._inputField=null;
this._propertyEditor._currentInputField=null;
this._propertyEditor._clearMsgDiv();
e.parentNode.removeChild(e);
return true
}else{
if(e.className.indexOf(" DwtPropertyEditor-input-error")==-1){
e.className+=" DwtPropertyEditor-input-error"
}
e.focus();
return false
}}
,_inputKeyPress:function(t){
t||(t=window.event);
var e=this._inputField;
if(t.keyCode==13){
this._saveInput()
}else{
if(t.keyCode==27){
e.value=this._getValue();
this._saveInput()
}else{
this._propertyEditor._clearMsgDiv();
e.className=e.className.replace(/ DwtPropertyEditor-input-error/,"")
}}}
,_onCheckboxChange:function(t){
t||(t=window.event);
var e=AjxEnv.isIE?t.srcElement:t.target;
e._prop._setValue(e.checked?"true":"false")
}
,_onSelectChange:function(){
this._setValue(this._select.getValue())
}
,_onCheckboxGroupChange:function(o){
o||(o=window.event);
var a=AjxEnv.isIE?o.srcElement:o.target;
var e=a._prop._checkBox;
var n=[];
for(var t=0;
t<e.length;
t++){
if(e[t].checked){
n.push(e[t]._label)
}}
a._prop._setValue(n)
}
,_onCalendarSelect:function(){
this._setValue(this._dateCalendar.getDate().getTime());
this._dateButton.setText(this._makeDisplayValue())
}
,_onDwtInputFieldValidated:function(e,a,t){
if(a){
this._setValue(t)
}}
,_setValue:function(t){
this.value=t;
var e=this._getRowEl();
e.className=e.className.replace(/ dirty/,"");
if(this._modified()){
e.className+=" dirty"
}}
,_validate:function(){
if(this._inputField){
if(this._inputField instanceof DwtInputField){
return this._inputField.validate()
}else{
return this._inputField.onblur()
}}else{
return true
}}};
DwtPropertyEditor.simpleClosure=function(e,t){
return function(){
return e.call(t,arguments[0])
}
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtConfirmDialog")){
DwtConfirmDialog=function(t,e){
if(arguments.length==0){
return
}
var a=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.CANCEL_BUTTON];
DwtDialog.call(this,{
parent:t,className:e,title:AjxMsg.confirmTitle,standardButtons:a}
);
this._questionDiv=document.createElement("DIV");
this._questionDiv.className="DwtConfirmDialogQuestion";
this._getContentDiv().appendChild(this._questionDiv);
this.registerCallback(DwtDialog.YES_BUTTON,this._handleYesButton,this);
this.registerCallback(DwtDialog.NO_BUTTON,this._handleNoButton,this);
this.registerCallback(DwtDialog.CANCEL_BUTTON,this._handleCancelButton,this)
};
DwtConfirmDialog.prototype=new DwtDialog;
DwtConfirmDialog.prototype.constructor=DwtConfirmDialog;
DwtConfirmDialog.prototype.toString=function(){
return"DwtConfirmDialog"
};
DwtConfirmDialog.prototype.popup=function(a,e,i,t,o){
this._questionDiv.innerHTML=a||"";
this._yesCallback=e;
this._noCallback=i;
this._cancelCallback=t;
this.setButtonVisible(DwtDialog.CANCEL_BUTTON,Boolean(i));
DwtDialog.prototype.popup.call(this,o)
};
DwtConfirmDialog.prototype.popdown=function(){
this._yesCallback=this._noCallback=this._cancelCallback=null;
DwtDialog.prototype.popdown.call(this)
};
DwtConfirmDialog.prototype._handleYesButton=function(e){
if(this._yesCallback){
this._yesCallback.run(e)
}
this.popdown()
};
DwtConfirmDialog.prototype._handleNoButton=function(e){
if(this._noCallback){
this._noCallback.run(e)
}
this.popdown()
};
DwtConfirmDialog.prototype._handleCancelButton=function(e){
if(this._cancelCallback){
this._cancelCallback.run(e)
}
this.popdown()
};
DwtConfirmDialog.prototype._getSeparatorTemplate=function(){
return""
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtChooser")){
DwtChooser=function(a){
if(arguments.length==0){
return
}
DwtComposite.call(this,a.parent,a.className);
this._slvClassName=a.slvClassName;
this._tlvClassName=a.tlvClassName;
this._layoutStyle=a.layoutStyle?a.layoutStyle:DwtChooser.HORIZ_STYLE;
this._selectStyle=a.selectStyle?a.selectStyle:DwtChooser.MULTI_SELECT;
this._mode=a.listStyle?a.listStyle:DwtChooser.MODE_MOVE;
this._noDuplicates=(a.noDuplicates!==false);
this._singleHeight=a.singleHeight?a.singleHeight:45;
this._listSize=a.listSize;
this._sourceEmptyOk=a.sourceEmptyOk;
this._allButtons=a.allButtons;
this._hasTextField=a.hasTextField;
this._handleButtonInfo(a.buttonInfo);
this._mode=a.mode?a.mode:this._hasMultiButtons?DwtChooser.MODE_COPY:DwtChooser.MODE_MOVE;
this._createHtml();
this._initialize();
var t=a.parent.getSize();
var i=a.listWidth||t.x;
var e=a.listHeight||t.y;
if(i&&e){
this.resize(i,e)
}};
DwtChooser.prototype=new DwtComposite;
DwtChooser.prototype.constructor=DwtChooser;
DwtChooser.HORIZ_STYLE=1;
DwtChooser.VERT_STYLE=2;
DwtChooser.SINGLE_SELECT=1;
DwtChooser.MULTI_SELECT=2;
DwtChooser.MODE_COPY=1;
DwtChooser.MODE_MOVE=2;
DwtChooser.REMOVE_BTN_ID="__remove__";
DwtChooser.ADD_ALL_BTN_ID="__addAll__";
DwtChooser.REMOVE_ALL_BTN_ID="__removeAll__";
DwtChooser.prototype.toString=function(){
return"DwtChooser"
};
DwtChooser.prototype.setItems=function(t,e,a){
e=e?e:DwtChooserListView.SOURCE;
this._reset(e);
this.addItems(t,e,true);
this._selectFirst(e);
if(a){
this._reset((e==DwtChooserListView.SOURCE)?DwtChooserListView.TARGET:DwtChooserListView.SOURCE)
}};
DwtChooser.prototype.getItems=function(e){
e=e?e:DwtChooserListView.TARGET;
if(e==DwtChooserListView.SOURCE){
return this.sourceListView.getList().clone()
}else{
if(this._hasMultiButtons){
var a={};
for(var t in this._data){
a[t]=this._data[t].clone()
}
return a
}else{
return this._data[this._buttonInfo[0].id].clone()
}}};
DwtChooser.prototype.addItems=function(t,e,o,h){
e=e?e:DwtChooserListView.SOURCE;
var s=(t instanceof AjxVector)?t.getArray():(t instanceof Array)?t:[t];
if(e==DwtChooserListView.SOURCE){
for(var a=0;
a<s.length;
a++){
this._addToSource(s[a],null,o)
}}else{
var n;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.targetListView._resetList();
s=(s.length>0)?[s[0]]:s
}
for(var a=0;
a<s.length;
a++){
this._addToTarget(s[a],h,o)
}}
if(e==DwtChooserListView.SOURCE){
var s=this.sourceListView.getList();
this._sourceSize=s?s.size():0
}};
DwtChooser.prototype.removeItems=function(o,e,a){
o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
for(var t=0;
t<o.length;
t++){
(e==DwtChooserListView.SOURCE)?this._removeFromSource(o[t],a):this._removeFromTarget(o[t],a)
}};
DwtChooser.prototype.transfer=function(t,i,e){
i=i?i:this._activeButtonId;
this._setActiveButton(i);
if(this._mode==DwtChooser.MODE_MOVE){
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
var a=this.targetListView.getList();
if(a&&a.size()){
this.remove(a,true)
}}
this.removeItems(t,DwtChooserListView.SOURCE,true)
}
this.addItems(t,DwtChooserListView.TARGET,e);
this.sourceListView.deselectAll()
};
DwtChooser.prototype.remove=function(o,a){
o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
if(this._mode==DwtChooser.MODE_MOVE){
for(var t=0;
t<o.length;
t++){
var e=this._getInsertionIndex(this.sourceListView,o[t]);
this.sourceListView.addItem(o[t],e,true)
}
this._sourceSize=o?o.length:0
}
this.removeItems(o,DwtChooserListView.TARGET)
};
DwtChooser.prototype.setSelectStyle=function(i,s){
if(i==this._selectStyle){
return
}
this._selectStyle=i;
if(this._defLabel){
var t=this._button[this._buttonInfo[0].id];
t.setText((i==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add)
}
if(!s){
var o=this.getSize();
this.resize(o.x,o.y)
}
if(this._allButtons){
this._addAllButton.setVisible(i==DwtChooser.MULTI_SELECT);
this._removeAllButton.setVisible(i==DwtChooser.MULTI_SELECT);
this._enableButtons()
}
if(i==DwtChooser.SINGLE_SELECT){
var n=this.targetListView.getList();
var e=n?n.clone().getArray():null;
if(e&&e.length){
this._reset(DwtChooserListView.TARGET);
this.addItems(e[0],DwtChooserListView.TARGET,true);
this.targetListView.deselectAll();
if(e.length>1&&this._mode==DwtChooser.MODE_MOVE){
this.addItems(e.slice(1),DwtChooserListView.SOURCE,true)
}
this._enableButtons()
}}
this.sourceListView.multiSelectEnabled=(i==DwtChooser.MULTI_SELECT);
this.targetListView.multiSelectEnabled=(i==DwtChooser.MULTI_SELECT)
};
DwtChooser.prototype.reset=function(e){
this._reset(e);
this._setActiveButton(this._buttonInfo[0].id);
this._enableButtons();
if(this._hasTextField){
this._textField.setValue("")
}};
DwtChooser.prototype._reset=function(e){
if(!e||e==DwtChooserListView.SOURCE){
this.sourceListView._resetList()
}
if(!e||e==DwtChooserListView.TARGET){
this.targetListView._resetList();
for(var t in this._data){
this._data[t].removeAll()
}}};
DwtChooser.prototype.addStateChangeListener=function(e){
this.targetListView.addStateChangeListener(e)
};
DwtChooser.prototype.removeStateChangeListener=function(e){
this.targetListView.removeStateChangeListener(e)
};
DwtChooser.prototype.getSourceListView=function(){
return document.getElementById(this._sourceListViewDivId)
};
DwtChooser.prototype.getButtons=function(){
return document.getElementById(this._buttonsDivId)
};
DwtChooser.prototype.getTargetListView=function(){
return document.getElementById(this._targetListViewDivId)
};
DwtChooser.prototype.getTextField=function(){
return this._textField
};
DwtChooser.prototype._createHtml=function(){
this._sourceListViewDivId=Dwt.getNextId();
this._targetListViewDivId=Dwt.getNextId();
this._buttonsDivId=Dwt.getNextId();
this._removeButtonDivId=Dwt.getNextId();
if(this._allButtons){
this._addAllButtonDivId=Dwt.getNextId();
this._removeAllButtonDivId=Dwt.getNextId()
}
if(this._hasTextField){
this._textFieldTdId=Dwt.getNextId()
}
var a=[];
var e=0;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
a[e++]="<table cellspacing=0 cellpadding=0 border=0>";
a[e++]="<tr>";
a[e++]="<td id='";
a[e++]=this._sourceListViewDivId;
a[e++]="'></td>";
a[e++]="<td valign='middle' id='";
a[e++]=this._buttonsDivId;
a[e++]="'>";
if(this._allButtons){
a[e++]="<div id='";
a[e++]=this._addAllButtonDivId;
a[e++]="'></div><br>"
}
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
a[e++]="<div id='";
a[e++]=this._buttonDivId[o];
a[e++]="'></div><br>"
}
a[e++]="<br><div id='";
a[e++]=this._removeButtonDivId;
a[e++]="'></div>";
if(this._allButtons){
a[e++]="<br><div id='";
a[e++]=this._removeAllButtonDivId;
a[e++]="'></div><br>"
}
a[e++]="</td>";
a[e++]="<td id='";
a[e++]=this._targetListViewDivId;
a[e++]="'></td>";
a[e++]="</tr>";
if(this._hasTextField){
a[e++]="<tr><td>";
a[e++]="<table border=0 width=100%><tr><td style='white-space:nowrap; width:1%'>";
a[e++]=AjxMsg.add;
a[e++]=":</td><td id='";
a[e++]=this._textFieldTdId;
a[e++]="'></td></tr></table>";
a[e++]="</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
}
a[e++]="</table>"
}else{
a[e++]="<div id='";
a[e++]=this._sourceListViewDivId;
a[e++]="'></div>";
a[e++]="<div align='center' id='";
a[e++]=this._buttonsDivId;
a[e++]="'>";
a[e++]="<table><tr>";
if(this._allButtons){
a[e++]="<td id='";
a[e++]=this._addAllButtonDivId;
a[e++]="'></td>"
}
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
a[e++]="<td id='";
a[e++]=this._buttonDivId[o];
a[e++]="'></td>"
}
a[e++]="<td id='";
a[e++]=this._removeButtonDivId;
a[e++]="'></td>";
if(this._allButtons){
a[e++]="<td id='";
a[e++]=this._removeAllButtonDivId;
a[e++]="'></td>"
}
a[e++]="</tr></table></div>";
a[e++]="<div id='";
a[e++]=this._targetListViewDivId;
a[e++]="'></div>"
}
this.getHtmlElement().innerHTML=a.join("")
};
DwtChooser.prototype._handleButtonInfo=function(t){
if(!t){
this._defLabel=(this._selectStyle==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add;
t=[{
label:this._defLabel}
]
}
this._buttonInfo=t;
this._buttonDivId={};
this._buttonId={};
if(this._buttonInfo.length==1){
if(!this._buttonInfo[0].id){
this._buttonInfo[0].id=Dwt.getNextId()
}
this._activeButtonId=this._buttonInfo[0].id
}
for(var e=0;
e<this._buttonInfo.length;
e++){
var a=this._buttonInfo[e].id;
this._buttonDivId[a]=Dwt.getNextId();
this._buttonId[a]=Dwt.getNextId()
}
this._hasMultiButtons=(this._buttonInfo.length>1)
};
DwtChooser.prototype._initialize=function(){
var e=new AjxListener(this,this._transferButtonListener);
this._button={};
this._buttonIndex={};
this._data={};
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
this._button[o]=this._setupButton(o,this._buttonId[o],this._buttonDivId[o],this._buttonInfo[t].label);
this._button[o].addSelectionListener(e);
this._buttonIndex[o]=t;
this._data[o]=new AjxVector()
}
this.sourceListView=this._createSourceListView();
this._addListView(this.sourceListView,this._sourceListViewDivId);
this.sourceListView.addSelectionListener(new AjxListener(this,this._sourceListener));
this.targetListView=this._createTargetListView();
this._addListView(this.targetListView,this._targetListViewDivId);
this.targetListView.addSelectionListener(new AjxListener(this,this._targetListener));
this._removeButtonId=Dwt.getNextId();
this._removeButton=this._setupButton(DwtChooser.REMOVE_BTN_ID,this._removeButtonId,this._removeButtonDivId,AjxMsg.remove);
this._removeButton.addSelectionListener(new AjxListener(this,this._removeButtonListener));
if(this._allButtons){
this._addAllButtonId=Dwt.getNextId();
this._addAllButton=this._setupButton(DwtChooser.ADD_ALL_BTN_ID,this._addAllButtonId,this._addAllButtonDivId,AjxMsg.addAll);
this._addAllButton.addSelectionListener(new AjxListener(this,this._addAllButtonListener));
this._removeAllButtonId=Dwt.getNextId();
this._removeAllButton=this._setupButton(DwtChooser.REMOVE_ALL_BTN_ID,this._removeAllButtonId,this._removeAllButtonDivId,AjxMsg.removeAll);
this._removeAllButton.addSelectionListener(new AjxListener(this,this._removeAllButtonListener));
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this._addAllButton.setVisible(false);
this._removeAllButton.setVisible(false)
}}
if(this._hasTextField){
var a={
parent:this,type:DwtInputField.STRING};
this._textField=new DwtInputField(a);
this._textField.reparentHtmlElement(this._textFieldTdId);
this._textField._chooser=this;
this._textField.setHandler(DwtEvent.ONKEYUP,DwtChooser._onKeyUp);
Dwt.setSize(this._textField.getInputElement(),"100%",Dwt.DEFAULT)
}
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.sourceListView.multiSelectEnabled=false;
this.targetListView.multiSelectEnabled=false
}};
DwtChooser.prototype._createSourceListView=function(){
return new DwtChooserListView(this,DwtChooserListView.SOURCE,this._slvClassName)
};
DwtChooser.prototype._createTargetListView=function(){
return new DwtChooserListView(this,DwtChooserListView.TARGET,this._tlvClassName)
};
DwtChooser.prototype._addListView=function(t,a){
var e=document.getElementById(a);
e.appendChild(t.getHtmlElement());
t.setUI(null,true);
t._initialized=true
};
DwtChooser.prototype.resize=function(o,e){
if(!o||!e){
return
}
if(o==Dwt.DEFAULT&&e==Dwt.DEFAULT){
return
}
var a=document.getElementById(this._buttonsDivId);
var s=Dwt.getSize(a);
var t,i,n;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
t=this._listSize?this._listSize:(o==Dwt.DEFAULT)?o:Math.floor(((o-s.x)/2)-12);
i=n=e
}else{
t=o;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
i=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:e-s.y-this._singleHeight-30;
n=(e==Dwt.DEFAULT)?e:e-s.y-i-30
}else{
i=n=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:Math.floor(((e-s.y)/2)-12)
}}
this.sourceListView.setSize(t+2,i);
this.targetListView.setSize(t+2,n)
};
DwtChooser.prototype._setupButton=function(n,a,o,e){
var t=new DwtButton({
parent:this,id:a}
);
t.setText(e);
t.id=a;
t._buttonId=n;
var i=document.getElementById(o);
i.appendChild(t.getHtmlElement());
return t
};
DwtChooser.prototype._sourceListener=function(e){
if(e.detail==DwtListView.ITEM_DBL_CLICKED){
this.transfer(this.sourceListView.getSelection(),this._activeButtonId);
this.sourceListView.deselectAll()
}else{
if(this._activeButtonId==DwtChooser.REMOVE_BTN_ID){
var t=this._lastActiveTransferButtonId?this._lastActiveTransferButtonId:this._buttonInfo[0].id;
this._setActiveButton(t)
}}
this.targetListView.deselectAll();
this._enableButtons()
};
DwtChooser.prototype._targetListener=function(e){
if(e.detail==DwtListView.ITEM_DBL_CLICKED){
this.remove(this.targetListView.getSelection())
}else{
this._setActiveButton(DwtChooser.REMOVE_BTN_ID);
this.sourceListView.deselectAll();
this._enableButtons()
}};
DwtChooser.prototype._transferButtonListener=function(a){
var t=DwtControl.getTargetControl(a);
var n=t._buttonId;
var o=this.sourceListView.getSelection();
if(o&&o.length){
this.transfer(o,n);
var i=this.sourceListView.getList();
if(i&&i.size()){
this._selectFirst(DwtChooserListView.SOURCE)
}else{
this._enableButtons()
}}else{
var e=this._getEmailFromText();
if(e){
this.transfer([e],n)
}else{
this._setActiveButton(n)
}}};
DwtChooser.prototype._removeButtonListener=function(e){
this.remove(this.targetListView.getSelection());
var t=this.targetListView.getList();
if(t&&t.size()){
this._selectFirst(DwtChooserListView.TARGET)
}else{
this._enableButtons()
}};
DwtChooser.prototype._addAllButtonListener=function(e){
this.transfer(this.sourceListView.getList().clone());
this._selectFirst(DwtChooserListView.TARGET)
};
DwtChooser.prototype._removeAllButtonListener=function(e){
this.remove(this.targetListView.getList().clone());
this._selectFirst(DwtChooserListView.SOURCE)
};
DwtChooser.prototype._enableButtons=function(a,h){
var l=this.sourceListView.getList();
var d=this.targetListView.getList();
var o=(a||(this.sourceListView.getSelectionCount()>0));
for(var s=0;
s<this._buttonInfo.length;
s++){
var t=this._buttonInfo[s].id;
this._button[t].setEnabled(o)
}
var c=(h||(this.targetListView.getSelectionCount()>0));
this._removeButton.setEnabled(c);
if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){
var e=l?l.size():0;
var n=d?d.size():0;
this._addAllButton.setEnabled(e>0);
this._removeAllButton.setEnabled(n>0)
}};
DwtChooser.prototype._selectFirst=function(t,a){
var e=(t==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView;
var i=e.getList();
if(i&&i.size()>0){
e.setSelection(i.get(0))
}};
DwtChooser.prototype._setActiveButton=function(i){
if(!this._hasMultiButtons){
return
}
if(i!=this._activeButtonId){
var a=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId];
if(a){
var e=DwtControl.findControl(document.getElementById(a));
if(e){
e.setDisplayState(DwtControl.NORMAL)
}}
a=(i==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[i];
var t=DwtControl.findControl(document.getElementById(a));
if(t){
t.setDisplayState(DwtControl.DEFAULT)
}
this._activeButtonId=i;
if(i!=DwtChooser.REMOVE_BTN_ID){
this._lastActiveTransferButtonId=i
}}};
DwtChooser.prototype._isDuplicate=function(e,t){
return t.contains(e)
};
DwtChooser.prototype._addToSource=function(a,e,t){
if(!a){
return
}
if(!a._chooserIndex){
var i=this.sourceListView.getList();
a._chooserIndex=i?i.size()+1:1
}
this.sourceListView.addItem(a,e,t)
};
DwtChooser.prototype._addToTarget=function(c,e,s){
if(!c){
return
}
e=e?e:this._activeButtonId;
if(this._noDuplicates&&this._data[e]&&this._isDuplicate(c,this._data[e])){
return
}
var n=this.targetListView.getList();
if(n&&n.contains(c)&&c.clone){
var a=c.clone();
a.id=Dwt.getNextId();
c=a
}
var h=null;
if(this._hasMultiButtons){
n=[];
for(var t=0;
t<this._buttonInfo.length;
t++){
n=n.concat(this._data[this._buttonInfo[t].id].getArray())
}
var o=this._buttonIndex[e];
for(h=0;
h<n.length;
h++){
var l=this._buttonIndex[n[h]._buttonId];
if(l>o){
break
}}}
c._buttonId=e;
c.id=c.id||Dwt.getNextId();
this._data[e].add(c);
this.targetListView.addItem(c,h,s)
};
DwtChooser.prototype._removeFromSource=function(t,e){
if(!t){
return
}
var a=this.sourceListView.getList();
if(!a){
return
}
if(!a.contains(t)){
return
}
this.sourceListView.removeItem(t,e)
};
DwtChooser.prototype._removeFromTarget=function(t,e){
if(!t){
return
}
var a=this.targetListView.getList();
if(!a){
return
}
if(!a.contains(t)){
return
}
this._data[t._buttonId].remove(t);
this.targetListView.removeItem(t,e)
};
DwtChooser.prototype._getInsertionIndex=function(t,n){
var s=t.getList();
if(!s){
return null
}
var e=s.getArray();
for(var o=0;
o<e.length;
o++){
if(n._chooserIndex&&e[o]._chooserIndex&&(e[o]._chooserIndex>=n._chooserIndex)){
return o
}}
return null
};
DwtChooser.prototype._getEmailFromText=function(){
var t=this._textField.getValue();
var e=AjxEmailAddress.parse(t);
if(e){
e.id=Dwt.getNextId();
return e
}};
DwtChooser._onKeyUp=function(o){
var a=DwtUiEvent.getTarget(o);
var n=DwtControl.findControl(a);
var i=n._chooser;
var t=DwtKeyEvent.getCharCode(o);
if(t==3||t==13){
var e=i._getEmailFromText();
if(e){
i.transfer([e],i._activeButtonId);
a.value=""
}}
i._enableButtons(a.value.length)
};
DwtChooserListView=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtChooserListView.PARAMS);
e.className=e.className||"DwtChooserListView";
e.headerList=this._getHeaderList(parent);
DwtListView.call(this,e);
this.type=e.type;
this._chooserParent=e.parent.parent
};
DwtChooserListView.PARAMS=["parent","type","className","view"];
DwtChooserListView.SOURCE=1;
DwtChooserListView.TARGET=2;
DwtChooserListView.prototype=new DwtListView;
DwtChooserListView.prototype.constructor=DwtChooserListView;
DwtChooserListView.prototype._getHeaderList=function(){};
DwtChooserListView.prototype.toString=function(){
return"DwtChooserListView"
};
DwtChooserListView.prototype.setUI=function(t,e){
e=e?e:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk);
DwtListView.prototype.setUI.call(this,t,e)
};
DwtChooserListView.prototype._itemClicked=function(e,t){
if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){
return
}else{
DwtListView.prototype._itemClicked.call(this,e,t)
}};
DwtChooserListView.prototype._sortColumn=function(t,e){
this._chooserParent.search(t,e)
};
DwtChooserListView.prototype._getHeaderSashLocation=function(){
var t=this.getHtmlElement();
if(Dwt.getPosition(t)==Dwt.ABSOLUTE_STYLE){
return DwtListView.prototype._getHeaderSashLocation.call(this)
}
var a=Dwt.toWindow(t,0,0);
var e=Dwt.toWindow(this._chooserParent.getHtmlElement(),0,0);
if(!this._tmpPoint){
this._tmpPoint=new DwtPoint()
}
this._tmpPoint.x=a.x-e.x;
this._tmpPoint.y=a.y-e.y;
return this._tmpPoint
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtGridSizePicker")){
DwtGridSizePicker=function(e,t){
if(arguments.length==0){
return
}
DwtControl.call(this,{
parent:e,className:"DwtGridSizePicker"}
);
this._title=t;
if(e instanceof DwtMenu){
e.addPopdownListener(new AjxListener(this,this._reset))
}
this._reset()
};
DwtGridSizePicker.prototype=new DwtControl;
DwtGridSizePicker.prototype.constructor=DwtGridSizePicker;
DwtGridSizePicker.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtGridSizePicker.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtGridSizePicker.prototype._createGrid=function(){
var a=this.getHtmlElement();
var t=["<table cellpadding='0' border='0' cellspacing='0'>","<tr class='info'><td colspan='",this.maxCols,"'>",this._title,"</td></tr>"];
var o=["<tr class='grid'>"];
for(var e=0;
e<this.maxCols;
++e){
o.push("<td unselectable='unselectable'></td>")
}
o.push("</tr>");
o=o.join("");
for(var e=0;
e<this.maxRows;
++e){
t.push(o)
}
t.push("</table>");
t=t.join("");
a.innerHTML=t;
a.onmouseover=DwtGridSizePicker._onMouseOver;
a.onmouseup=DwtGridSizePicker._onSelect
};
DwtGridSizePicker.prototype._reset=function(){
this._endRow=-1;
this._endCol=-1;
this.maxRows=7;
this.maxCols=7;
this._createGrid()
};
DwtGridSizePicker._onSelect=function(e){
if(AjxEnv.isIE){
e=window.event
}
DwtControl.getTargetControl(e)._onSelect(e)
};
DwtGridSizePicker.prototype._onSelect=function(i){
if(AjxEnv.isIE){
i=window.event
}
var a=new DwtUiEvent();
a.setFromDhtmlEvent(i);
var o=a.target;
if(o.tagName.toLowerCase()=="td"){
var n=o.parentNode.rowIndex;
if(n>0){
var e=o.cellIndex;
var t=DwtShell.selectionEvent;
t.item=this;
t.detail={
rows:n,cols:e+1};
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
this.notifyListeners(DwtEvent.SELECTION,t)
}}};
DwtGridSizePicker.prototype._onMouseOut=function(i){
if(AjxEnv.isIE){
i=window.event
}
var t=new DwtUiEvent();
t.setFromDhtmlEvent(i);
var o=t.target;
var a=this.getHtmlElement().firstChild;
try{
while(o&&o!==a){
o=o.parentNode
}}
catch(e){
o=null
}
if(!o){
this._endRow=this._endCol=-1;
this._update()
}};
DwtGridSizePicker._onMouseOver=function(e){
if(AjxEnv.isIE){
e=window.event
}
DwtControl.getTargetControl(e)._onMouseOver(e)
};
DwtGridSizePicker.prototype._onMouseOver=function(t){
var e=new DwtUiEvent(true);
e.setFromDhtmlEvent(t);
var a=e.target;
if(this._updateTimeout){
clearTimeout(this._updateTimeout)
}
this._updateTimeout=setTimeout(AjxCallback.simpleClosure(this._updateOnTimeout,this,a),10);
e.setToDhtmlEvent(t)
};
DwtGridSizePicker.prototype._addRow=function(){
var t=this.getHtmlElement().firstChild;
var a=t.insertRow(-1);
a.className="grid";
for(var e=0;
e<this.maxCols;
++e){
var o=a.insertCell(-1);
o.unselectable=true
}
++this.maxRows
};
DwtGridSizePicker.prototype._addCol=function(){
var t=this.getHtmlElement().firstChild;
var o=t.rows;
for(var e=1;
e<=this.maxRows;
++e){
var a=o[e];
var n=a.insertCell(-1);
n.unselectable=true
}
++t.rows[0].cells[0].colSpan;
++this.maxCols
};
DwtGridSizePicker.prototype._updateOnTimeout=function(a){
var e=true,i,t;
if(a.tagName.toLowerCase()=="td"){
i=a.parentNode.rowIndex;
if(i>0){
t=this._endCol=a.cellIndex;
this._endRow=a.parentNode.rowIndex-1;
e=false
}}
if(e){
this._endRow=this._endCol=-1
}
this._update();
if(!e){
if(i==this.maxRows){
this._addRow()
}
if(t==this.maxCols-1){
this._addCol()
}}};
DwtGridSizePicker.prototype._update=function(){
var t=this._endRow;
var s=this._endCol;
var l=this.getHtmlElement().firstChild;
var n=l.rows[0].cells[0];
this._rows=t+1;
this._cols=s+1;
if(this._rows>0&&this._cols>0){
n.innerHTML=this._rows+" x "+this._cols
}else{
n.innerHTML=this._title
}
for(var a=0;
a<this.maxRows;
++a){
var c=l.rows[a+1];
for(var e=0;
e<this.maxCols;
++e){
var h=c.cells[e];
var o=(a>this._endRow)||(e>this._endCol);
if(o){
Dwt.delClass(h,"Hovered")
}else{
Dwt.addClass(h,"Hovered")
}}}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtSpinner")){
DwtSpinner=function(e){
if(arguments.length==0){
return
}
DwtControl.call(this,{
parent:e.parent,className:e.className,posStyle:e.posStyle,parentElement:e.parentElement}
);
this._maxValue=e.max!=null?e.max:null;
this._minValue=e.min!=null?e.min:null;
this._fieldSize=e.size!=null?e.size:3;
this._origValue=e.value||0;
this._maxLen=e.maxLen||null;
this._step=e.step||1;
this._decimals="decimals" in e?e.decimals:0;
this._align=e.align||null;
this._timerFunc=AjxCallback.simpleClosure(this._timerFunc,this);
this._btnPressCapture=new DwtMouseEventCapture({
targetObj:this,id:"DwtSpinner",mouseUpHdlr:AjxCallback.simpleClosure(this._stopCapture,this)}
);
this._createElements()
};
DwtSpinner.prototype=new DwtControl;
DwtSpinner.prototype.constructor=DwtSpinner;
DwtSpinner.INIT_TIMER=250;
DwtSpinner.SLOW_TIMER=125;
DwtSpinner.FAST_TIMER=33;
DwtSpinner.prototype._createElements=function(){
var n=this.getHtmlElement();
var o=Dwt.getNextId();
this._idField=o;
this._idUpButton=o+"-up";
this._idDownButton=o+"-down";
var i=["<table class='DwtSpinner' cellspacing='0' cellpadding='0'>","<tr><td rowspan='2' class='DwtSpinner-inputCell'>","<input id='",o,"' autocomplete='off' />","</td>","<td unselectable id='",this._idUpButton,"' class='DwtSpinner-upBtn'><div class='ImgUpArrowSmall'>&nbsp;</div></td>","</tr><tr>","<td unselectable id='",this._idDownButton,"' class='DwtSpinner-downBtn'><div class='ImgDownArrowSmall'>&nbsp;</div></td>","</tr></table>"];
n.innerHTML=i.join("");
var a=this._getUpButton();
a.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Up");
var t=this._getDownButton();
t.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Down");
var e=this.getInputElement();
if(this._maxLen){
e.maxLength=this._maxLen
}
if(this._fieldSize){
e.size=this._fieldSize
}
if(this._align){
e.style.textAlign=this._align
}
if(this._origValue!=null){
this.setValue(this._origValue)
}
e.onblur=AjxCallback.simpleClosure(this.setValue,this,null);
e[(AjxEnv.isIE||AjxEnv.isOpera)?"onkeydown":"onkeypress"]=AjxCallback.simpleClosure(this.__onKeyPress,this)
};
DwtSpinner.prototype._getValidValue=function(e){
var t=parseFloat(e);
if(isNaN(t)||t==null){
t=this._lastValidValue
}
if(t==null){
t=this._minValue||0
}
if(this._minValue!=null&&t<this._minValue){
t=this._minValue
}
if(this._maxValue!=null&&t>this._maxValue){
t=this._maxValue
}
t=parseFloat(t);
if(this._decimals!=null){
t=t.toFixed(this._decimals)
}
this._lastValidValue=t;
return t
};
DwtSpinner.prototype.getInputElement=function(){
return document.getElementById(this._idField)
};
DwtSpinner.prototype._getUpButton=function(){
return document.getElementById(this._idUpButton)
};
DwtSpinner.prototype._getDownButton=function(){
return document.getElementById(this._idDownButton)
};
DwtSpinner.prototype._getButton=function(e){
switch(e){
case"Up":return this._getUpButton();
case"Down":return this._getDownButton()
}};
DwtSpinner.prototype._setBtnState=function(e,a){
var t=this._getButton(e);
if(a){
Dwt.addClass(t,"DwtSpinner-"+e+"-disabled");
t.firstChild.className="Img"+e+"ArrowSmallDis"
}else{
Dwt.delClass(t,"DwtSpinner-"+e+"-disabled");
t.firstChild.className="Img"+e+"ArrowSmall"
}};
DwtSpinner.prototype.getValue=function(){
return parseFloat(this._getValidValue(this.getInputElement().value))
};
DwtSpinner.prototype.setValue=function(e){
if(e==null){
e=this.getInputElement().value
}
e=this._getValidValue(e);
this.getInputElement().value=e;
e=parseFloat(e);
this._setBtnState("Down",this._minValue!=null&&this._minValue==e);
this._setBtnState("Up",this._maxValue!=null&&this._maxValue==e)
};
DwtSpinner.prototype.setEnabled=function(e){
DwtControl.prototype.setEnabled.call(this,e);
this.getInputElement().disabled=!e;
var t=this.getHtmlElement().firstChild;
if(!e){
Dwt.addClass(t,"DwtSpinner-disabled")
}else{
Dwt.delClass(t,"DwtSpinner-disabled")
}};
DwtSpinner.prototype._rotateVal=function(e){
var t=this.getValue();
switch(e){
case"Up":t+=this._step;
break;
case"Down":t-=this._step;
break
}
this.setValue(t)
};
DwtSpinner.prototype._btnPressed=function(e){
if(!this.getEnabled()){
return
}
Dwt.addClass(this._getButton(e),"DwtSpinner-"+e+"-pressed");
this._direction=e;
this._rotateVal(e);
this._btnPressCapture.capture();
this._timerSteps=0;
this._timer=setTimeout(this._timerFunc,DwtSpinner.INIT_TIMER)
};
DwtSpinner.prototype._timerFunc=function(){
var a=this.getValue();
this._rotateVal(this._direction);
var t=this.getValue();
this._timerSteps++;
var e=this._timerSteps>4?DwtSpinner.FAST_TIMER:DwtSpinner.SLOW_TIMER;
if(a!=t){
this._timer=setTimeout(this._timerFunc,e)
}else{
this._stopCapture()
}};
DwtSpinner.prototype._stopCapture=function(){
if(this._timer){
clearTimeout(this._timer)
}
this._timer=null;
this._timerSteps=null;
var t=this._direction;
Dwt.delClass(this._getButton(t),"DwtSpinner-"+t+"-pressed");
this._direction=null;
this._btnPressCapture.release();
var e=this.getInputElement();
e.focus();
Dwt.setSelectionRange(e,0,e.value.length)
};
DwtSpinner.prototype.__onKeyPress=function(a){
if(AjxEnv.isIE){
a=window.event
}
var t=null;
switch(a.keyCode){
case 38:t="Up";
break;
case 40:t="Down";
break
}
if(t){
this._rotateVal(t);
var e=this.getInputElement();
Dwt.setSelectionRange(e,0,e.value.length)
}};
DwtSpinner.prototype.focus=function(){
this.getInputElement().focus()
};
DwtSpinner.prototype.select=function(){
var e=this.getInputElement();
e.focus();
Dwt.setSelectionRange(e,0,e.value.length)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtButtonColorPicker")){
DwtButtonColorPicker=function(a){
if(arguments.length==0){
return
}
a=Dwt.getParams(arguments,DwtButtonColorPicker.PARAMS);
a.actionTiming=DwtButton.ACTION_MOUSEUP;
DwtButton.call(this,a);
var e=new DwtMenu({
parent:this,style:DwtMenu.COLOR_PICKER_STYLE}
);
this.setMenu(e);
var t=new DwtColorPicker(e,null,null,a.noFillLabel,a.allowColorInput);
t.addSelectionListener(new AjxListener(this,this._colorPicked));
this.__colorPicker=t;
this.__color=""
};
DwtButtonColorPicker.PARAMS=["parent","style","className","posStyle","id","index","noFillLabel","allowColorInput"];
DwtButtonColorPicker.prototype=new DwtButton;
DwtButtonColorPicker.prototype.constructor=DwtButtonColorPicker;
DwtButtonColorPicker._RGB_RE=/rgb\(([0-9]{1,3}),\s*([0-9]{1,3}),\s*([0-9]{1,3})\)/;
DwtButtonColorPicker._hexdigits=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
DwtButtonColorPicker.toHex=function(i,t){
var e=[];
while(i){
var a=DwtButtonColorPicker._hexdigits[i&15];
e.push(a);
i=i>>4
}
if(t!=null){
t-=e.length;
while(t-->0){
e.push("0")
}}
e.reverse();
return e.join("")
};
DwtButtonColorPicker.prototype.showColorDisplay=function(e){
if(!this._colorEl){
return
}
if(!e){
this._colorEl.onmouseover=DwtButtonColorPicker.__colorDisplay_onMouseOver;
this._colorEl.onmouseout=DwtButtonColorPicker.__colorDisplay_onMouseOut;
this._colorEl.onmousedown=DwtButtonColorPicker.__colorDisplay_onMouseDown
}};
DwtButtonColorPicker.prototype.getColor=function(){
return this.__color
};
DwtButtonColorPicker.prototype.setColor=function(e){
var t=e.match(DwtButtonColorPicker._RGB_RE);
if(t){
e="#"+DwtButtonColorPicker.toHex(parseInt(t[1]),2)+DwtButtonColorPicker.toHex(parseInt(t[2]),2)+DwtButtonColorPicker.toHex(parseInt(t[3]),2)
}
this.__color=e;
var a=this._colorEl;
if(a){
a.style.backgroundColor=e
}};
DwtButtonColorPicker.prototype._createHtmlFromTemplate=function(t,a){
DwtButton.prototype._createHtmlFromTemplate.call(this,t,a);
var e=AjxTemplate.expand("dwt.Widgets#ZButtonColorDisplay",a);
this.setText(e);
this._colorEl=document.getElementById(a.id+"_color")
};
DwtButtonColorPicker.prototype._setMinWidth=function(){};
DwtButtonColorPicker.prototype._colorPicked=function(a){
var e=a.detail;
this.__color=this.__detail=e;
var t=this._colorEl;
if(t){
t.style.backgroundColor=e
}
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var i=DwtShell.selectionEvent;
i.item=this;
i.detail=e;
this.notifyListeners(DwtEvent.SELECTION,i)
}};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseOver=function(e,t){
if(!this.getEnabled()){
return
}
Dwt.addClass(t,"ImgDisable")
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseOut=function(e,t){
if(!this.getEnabled()){
return
}
Dwt.delClass(t,"ImgDisable")
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseDown=function(t,i){
if(!this.getEnabled()){
return
}
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
this.__color=this.__detail=i.style.backgroundColor="";
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var a=DwtShell.selectionEvent;
a.item=this;
a.detail="";
this.notifyListeners(DwtEvent.SELECTION,a)
}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtButtonColorPicker.__colorDisplay_onMouseOver=function(e){
var t=DwtControl.getTargetControl(e);
t.__colorDisplay_onMouseOver(e,this)
};
DwtButtonColorPicker.__colorDisplay_onMouseOut=function(e){
var t=DwtControl.getTargetControl(e);
t.__colorDisplay_onMouseOut(e,this)
};
DwtButtonColorPicker.__colorDisplay_onMouseDown=function(e){
var t=DwtControl.getTargetControl(e);
t.__colorDisplay_onMouseDown(e,this)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtMessageComposite")){
DwtMessageComposite=function(a,t,e){
if(arguments.length==0){
return
}
t=t||"DwtMessageComposite";
DwtComposite.call(this,{
parent:a,className:t,posStyle:e}
)
};
DwtMessageComposite.prototype=new DwtComposite;
DwtMessageComposite.prototype.constructor=DwtMessageComposite;
DwtMessageComposite.prototype.toString=function(){
return"DwtMessageComposite"
};
DwtMessageComposite.prototype._formatter;
DwtMessageComposite.prototype._controls;
DwtMessageComposite.prototype.setFormat=function(f,l,n){
this._formatter=new AjxMessageFormat(f);
this._controls={};
var y=this._htmlElId;
var x=["<table class='DwtCompositeTable' border='0' cellspacing='0' cellpadding='0'><tr valign='center'>"];
var b=this._formatter.getSegments();
var s={};
var w={};
for(var v=0;
v<b.length;
v++){
var t=b[v];
var k=t instanceof AjxMessageFormat.MessageSegment;
var d=[y,v].join("_");
x.push("<td id='",d,"' class='",(k?"MessageControl"+t.getIndex():"")," DwtCompositeCell'>");
if(k){
var u=l?l.run(this,t,v):null;
if(!u){
u=new DwtInputField({
parent:this}
)
}
s[d]=u.getHtmlElement();
w[d]=n&&n.run(this,t,v);
var m=t.getIndex();
this._controls[m]=this._controls[m]||u
}else{
x.push(t.toSubPattern())
}
x.push("</td>")
}
x.push("</tr></table>");
var o=this.getHtmlElement();
var c=o.childNodes.length;
var q=document.createElement("DIV");
q.className=y+"_container";
o.appendChild(q);
q.innerHTML=x.join("");
for(var d in s){
var e=s[d];
var h=document.getElementById(d);
h.appendChild(e);
for(var g in w[d]){
h[g]=w[d][g]
}}};
DwtMessageComposite.prototype.format=function(){
var t=[];
for(var e in this._controls){
t[e]=this._controls[e].getValue()
}
return this._formatter.format(t)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButtonGroup")){
DwtRadioButtonGroup=function(a,e){
this._radios={};
this._radioButtons={};
this._values={};
this._value2id={};
this._eventMgr=new AjxEventMgr();
for(var t in a){
this.addRadio(t,a[t],(t==e))
}};
DwtRadioButtonGroup.prototype.toString=function(){
return"DwtRadioButtonGroup"
};
DwtRadioButtonGroup.prototype._enabled=true;
DwtRadioButtonGroup.prototype._visible=true;
DwtRadioButtonGroup.prototype.addSelectionListener=function(e){
return this._eventMgr.addListener(DwtEvent.SELECTION,e)
};
DwtRadioButtonGroup.prototype.removeSelectionListener=function(e){
return this._eventMgr.removeListener(DwtEvent.SELECTION,e)
};
DwtRadioButtonGroup.prototype.setEnabled=function(e){
this._enabled=e;
for(var t in this._radios){
this._radios[t].disabled=!e
}};
DwtRadioButtonGroup.prototype.isEnabled=function(){
return this._enabled
};
DwtRadioButtonGroup.prototype.setVisible=function(e){
this._visible=e;
for(var t in this._radioButtons){
this._radioButtons[t].setVisible(e)
}
for(var t in this._radios){
Dwt.setVisible(this._radios[t],e)
}};
DwtRadioButtonGroup.prototype.isVisible=function(){
return this._visible
};
DwtRadioButtonGroup.prototype.addRadio=function(h,s,i){
var e=s instanceof DwtRadioButton;
var o=e?s:null;
var n=o?o.getValue():s;
this._values[h]=n;
this._value2id[n]=h;
var t=document.getElementById(h);
this._radios[h]=t;
this._radioButtons[h]=o;
var a=AjxCallback.simpleClosure(this._handleClick,this);
Dwt.setHandler(t,DwtEvent.ONCLICK,a);
t.checked=i;
if(i){
this._selectedId=h
}};
DwtRadioButtonGroup.prototype.getRadioByValue=function(e){
var t=this._value2id[e];
return this._radios[t]
};
DwtRadioButtonGroup.prototype.getRadioButtonByValue=function(e){
var t=this._value2id[e];
return this._radioButtons[t]
};
DwtRadioButtonGroup.prototype.setSelectedId=function(i,e){
if(i!=this._selectedId){
var t=document.getElementById(i);
if(!t){
return
}
t.checked=true;
this._selectedId=i;
if(!e){
var a=DwtShell.selectionEvent;
a.reset();
this._notifySelection(a)
}}};
DwtRadioButtonGroup.prototype.setSelectedValue=function(t,e){
var a=this._valueToId(t);
this.setSelectedId(a,e)
};
DwtRadioButtonGroup.prototype.getSelectedId=function(){
return this._selectedId
};
DwtRadioButtonGroup.prototype.getSelectedValue=function(){
return this._values[this._selectedId]
};
DwtRadioButtonGroup.prototype.getValue=function(){
return this.getSelectedValue()
};
DwtRadioButtonGroup.prototype.getData=function(t){
var e=!AjxUtil.isUndefined(this._selectedId)&&this._radioButtons[this._selectedId];
if(e){
return e.getData(t)
}};
DwtRadioButtonGroup.prototype._valueToId=function(e){
for(var t in this._values){
if(this._values[t]==e){
return t
}
if(e===true&&this._values[t]=="true"){
return t
}
if(e===false&&(this._values[t]=="false"||this._values[t]=="")){
return t
}}
return null
};
DwtRadioButtonGroup.prototype._notifySelection=function(e){
e.item=this;
e.detail={
id:this._selectedId,value:this._values[this._selectedId]};
this._eventMgr.notifyListeners(DwtEvent.SELECTION,e)
};
DwtRadioButtonGroup.prototype._handleClick=function(e){
e=DwtUiEvent.getEvent(e);
var a=DwtUiEvent.getTarget(e);
if(a&&a.nodeName.match(/label/i)){
a=document.getElementById(a.getAttribute(AjxEnv.isIE?"htmlFor":"for"))
}
var i=a.id;
if(!a.checked){
for(i in this._radios){
if(this._radios[i].checked){
break
}}}
if(i!=this._selectedId){
this._selectedId=i;
var t=DwtShell.selectionEvent;
DwtUiEvent.copy(t,e);
this._notifySelection(t)
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtComboBox")){
DwtComboBox=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtComboBox.PARAMS);
e.className=e.className||"DwtComboBox";
DwtComposite.call(this,e);
this.input=null;
this._button=null;
this._textToValue={};
this._valueToText={};
this._valueToItem={};
this._size=0;
this._hasMenuCallback=true;
this._menuItemListenerObj=new AjxListener(this,this._menuItemListener);
this._inputParams=e.inputParams;
this._createHtml()
};
DwtComboBox.PARAMS=["parent","inputParams","className","posStyle","dialog"];
DwtComboBox.prototype=new DwtComposite;
DwtComboBox.prototype.constructor=DwtComboBox;
DwtComboBox.prototype.toString=function(){
return"DwtComboBox"
};
DwtComboBox.prototype.TEMPLATE="dwt.Widgets#DwtComboBox";
DwtComboBox.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtComboBox.prototype.addChangeListener=function(e){
this.addListener(DwtEvent.ONCHANGE,e)
};
DwtComboBox.prototype.removeChangeListener=function(e){
this.removeListener(DwtEvent.ONCHANGE,e)
};
DwtComboBox.prototype.add=function(i,t,e){
this._textToValue[i]=t;
this._valueToText[t]=i;
if(!this._hasMenuCallback){
var a=this._button.getMenu();
this._createMenuItem(a,i)
}
if(e){
this.setText(i)
}
this._size++;
this._updateButton()
};
DwtComboBox.prototype.remove=function(t){
var e=this._valueToItem[t];
if(e){
this._button.getMenu().removeChild(e);
var a=this._valueToText[t];
delete this._textToValue[a];
delete this._valueToText[t];
delete this._valueToItem[t];
if(this.getText()==a){
this.setText("")
}
this._size--;
this._updateButton()
}};
DwtComboBox.prototype.removeAll=function(){
this._button.setMenu(new AjxCallback(this,this._createMenu),true);
this._hasMenuCallback=true;
this._textToValue={};
this._valueToText={};
this._valueToItem={};
this._size=0;
this._updateButton()
};
DwtComboBox.prototype.getValue=function(){
var e=this.getText();
return this._textToValue[e]
};
DwtComboBox.prototype.setValue=function(e){
var t=this._valueToText[e];
this.setText(t||e)
};
DwtComboBox.prototype.getText=function(){
return this.input.getValue()
};
DwtComboBox.prototype.setText=function(e){
this.input.setValue(e)
};
DwtComboBox.prototype.setEnabled=function(e){
if(e!=this._enabled){
DwtComposite.prototype.setEnabled.call(this,e);
this.input.setEnabled(e);
this._button.setEnabled(e)
}};
DwtComboBox.prototype.focus=function(){
this.input.focus()
};
DwtComboBox.prototype._createMenu=function(){
var o=new DwtMenu({
parent:this}
);
for(var e in this._textToValue){
var t=this._createMenuItem(o,e);
var a=this._textToValue[e];
this._valueToItem[a]=t
}
this._hasMenuCallback=false;
return o
};
DwtComboBox.prototype._createMenuItem=function(a,t){
var e=new DwtMenuItem({
parent:a}
);
e.setText(t);
e.addSelectionListener(this._menuItemListenerObj);
if(!this._menuWidth){
this._menuWidth=this.getW()-10
}
e.getHtmlElement().style.minWidth=this._menuWidth;
return e
};
DwtComboBox.prototype._menuItemListener=function(i){
var t=i.dwtObj;
var o=this.input.getValue();
var n=t.getText();
this.input.setValue(n);
var a=DwtUiEvent.getEvent(i);
a._args={
selectObj:this,newValue:n,oldValue:o};
this.notifyListeners(DwtEvent.ONCHANGE,a);
var e=this.input.getInputElement();
e.focus();
e.select()
};
DwtComboBox.prototype._handleKeyDown=function(e){
this.__ovalue=this.input.getValue();
return true
};
DwtComboBox.prototype._handleKeyUp=function(t){
DwtInputField._keyUpHdlr(t);
var e=DwtUiEvent.getEvent(t);
e._args={
selectObj:this,newValue:this.input.getValue(),oldValue:this.__ovalue};
this.notifyListeners(DwtEvent.ONCHANGE,e);
return true
};
DwtComboBox.prototype._updateButton=function(){
this._button.setVisible(this._size>0)
};
DwtComboBox.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtComboBox.prototype._createHtmlFromTemplate=function(t,a){
DwtComposite.prototype._createHtmlFromTemplate.call(this,t,a);
var e=this._inputParams||{};
e.parent=this;
e.size=e.size||40;
delete this._inputParams;
this.input=new DwtInputField(e);
this.input.replaceElement(a.id+"_input");
this.input.setHandler(DwtEvent.ONKEYDOWN,AjxCallback.simpleClosure(this._handleKeyDown,this));
this.input.setHandler(DwtEvent.ONKEYUP,AjxCallback.simpleClosure(this._handleKeyUp,this));
this._button=new DwtComboBoxButton({
parent:this}
);
this._button.setMenu(new AjxListener(this,this._createMenu),true);
this._button.replaceElement(a.id+"_button");
this._updateButton();
this._tabGroup=new DwtTabGroup(this._htmlElId);
this._tabGroup.addMember(this.input);
this._tabGroup.addMember(this._button)
};
DwtComboBox.prototype._replaceElementHook=function(t,a,e,i){
DwtComposite.prototype._replaceElementHook.apply(this,arguments);
if(t.size){
this.input.getInputElement().size=t.size
}
if(t.title){
this.input.setHint(t.title)
}};
DwtComboBoxButton=function(e){
e=Dwt.getParams(arguments,DwtComboBoxButton.PARAMS);
e.posStyle=Dwt.RELATIVE_STYLE;
DwtButton.call(this,e)
};
DwtComboBoxButton.prototype=new DwtButton;
DwtComboBoxButton.prototype.constructor=DwtComboBoxButton;
DwtComboBoxButton.prototype.toString=function(){
return"DwtComboBoxButton"
};
DwtComboBoxButton.PARAMS=["parent","className"];
DwtComboBoxButton.prototype.TEMPLATE="dwt.Widgets#DwtComboBoxButton"
}
if(AjxPackage.define("zimbra.common.ZLoginFactory")){
ZLoginFactory=function(){};
ZLoginFactory.USER_ID="ZLoginUserName";
ZLoginFactory.PASSWORD_ID="ZLoginPassword";
ZLoginFactory.REMEMBER_ME_ID="rememberMe";
ZLoginFactory.REMEMBER_ME_CONTAINER_ID="ZLoginRememberMeContainer";
ZLoginFactory.NEW_PASSWORD_ID="newpass1";
ZLoginFactory.NEW_PASSWORD_TR_ID="ZLoginNewPassword1Tr";
ZLoginFactory.PASSWORD_CONFIRM_TR_ID="ZLoginNewPassword2Tr";
ZLoginFactory.PASSWORD_CONFIRM_ID="newpass2";
ZLoginFactory.LOGIN_BUTTON_ID="ZLoginButton";
ZLoginFactory.HIDDEN_BUTTON_ID="ZLoginHiddenButton";
ZLoginFactory.TEXT_TYPE=0;
ZLoginFactory.CHECKBOX_TYPE=1;
ZLoginFactory.BUTTON_TYPE=2;
ZLoginFactory.TAB_ORDER=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_ID,ZLoginFactory.PASSWORD_CONFIRM_ID,ZLoginFactory.REMEMBER_ME_ID,ZLoginFactory.LOGIN_BUTTON_ID];
ZLoginFactory.VISIBILITY=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_TR_ID,ZLoginFactory.PASSWORD_CONFIRM_TR_ID,ZLoginFactory.REMEMBER_ME_CONTAINER_ID,ZLoginFactory.LOGIN_BUTTON_ID];
ZLoginFactory.TAB_TYPE=[ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.CHECKBOX_TYPE,ZLoginFactory.BUTTON_TYPE];
ZLoginFactory.copyDefaultParams=function(e){
return{
showPanelBorder:true,companyURL:e.splashScreenCompanyURL||"",shortVersion:"",longVersion:"",appName:e.splashScreenAppName||"",productName:"",showError:false,errorMsg:"",showAbout:false,aboutMsg:"",showLoading:false,loadingMsg:e.splashScreenLoading||"",showForm:false,showUserField:false,userNameMsg:e.username?e.username+":":"",showPasswordField:false,passwordMsg:e.password?e.password+":":"",showNewPasswordFields:false,newPassword1Msg:e.newPassword+":"||"",newPassword2Msg:e.confirm+":"||"",showLicenseMsg:false,licenseMsg:"",showRememberMeCheckbox:false,rememberMeMsg:e.rememberMe||"",showLogOff:false,logOffMsg:e.loginAsDiff||"",logOffAction:"",showButton:false,buttonName:e.login||"",copyrightText:e.splashScreenCopyright||""}
};
ZLoginFactory.getLoginPanel=function(){
var e=this.get("ZLoginPanel");
if(!e){
e=this.get("ZLoginPanelInvisible")
}
return e
};
ZLoginFactory.showErrorMsg=function(e){
this.setHTML("ZLoginErrorMsg",e);
this.show("ZLoginErrorPanel");
this._flickerErrorMessagePanel()
};
ZLoginFactory.hideErrorMsg=function(){
this.hide("ZLoginErrorPanel")
};
ZLoginFactory.getErrorMsgPanel=function(){
return this.get("ZLoginErrorPanel")
};
ZLoginFactory.showAboutMsg=function(e){
this.setHTML("ZLoginAboutPanel",e);
this.show("ZLoginAboutPanel")
};
ZLoginFactory.hideAboutMsg=function(){
this.hide("ZLoginAboutPanel")
};
ZLoginFactory.getAboutMsg=function(){
return this.get("ZLoginAboutPanel")
};
ZLoginFactory.showLoadingMsg=function(e){
this.setHTML("ZLoginLoadingMsg",e);
this.show("ZLoginAboutPanel")
};
ZLoginFactory.hideLoadingMsg=function(){
this.hide("ZLoginAboutPanel")
};
ZLoginFactory.getLoadingMsg=function(){
return this.get("ZLoginAboutPanel")
};
ZLoginFactory.showForm=function(){
this.show("ZLoginFormPanel")
};
ZLoginFactory.hideForm=function(){
this.hide("ZLoginFormPanel")
};
ZLoginFactory.getForm=function(){
return this.get("ZLoginFormPanel")
};
ZLoginFactory.showUserField=function(e){
this.setValue(ZLoginFactory.USER_ID,e);
this.show(ZLoginFactory.USER_ID)
};
ZLoginFactory.hideUserField=function(){
this.hide(ZLoginFactory.USER_ID)
};
ZLoginFactory.getUserField=function(){
return this.get(ZLoginFactory.USER_ID)
};
ZLoginFactory.showPasswordField=function(e){
this.show(ZLoginFactory.PASSWORD_ID)
};
ZLoginFactory.hidePasswordField=function(){
this.hide(ZLoginFactory.PASSWORD_ID)
};
ZLoginFactory.getPasswordField=function(){
return this.get(ZLoginFactory.PASSWORD_ID)
};
ZLoginFactory.showNewPasswordFields=function(){
this.show(ZLoginFactory.NEW_PASSWORD_TR_ID);
this.show(ZLoginFactory.PASSWORD_CONFIRM_TR_ID)
};
ZLoginFactory.hideNewPasswordFields=function(){
this.hide(ZLoginFactory.NEW_PASSWORD_TR_ID);
this.hide(ZLoginFactory.PASSWORD_CONFIRM_TR_ID)
};
ZLoginFactory.areNewPasswordFieldsShown=function(){
return this.isShown(ZLoginFactory.NEW_PASSWORD_TR_ID)
};
ZLoginFactory.getNewPasswordField=function(){
return this.get(ZLoginFactory.NEW_PASSWORD_ID)
};
ZLoginFactory.getPasswordConfirmField=function(){
return this.get(ZLoginFactory.PASSWORD_CONFIRM_ID)
};
ZLoginFactory.showRememberMeCheckbox=function(){
this.show(ZLoginFactory.REMEMBER_ME_CONTAINER_ID)
};
ZLoginFactory.hideRememberMeCheckbox=function(){
this.hide(ZLoginFactory.REMEMBER_ME_CONTAINER_ID)
};
ZLoginFactory.showLogOff=function(){
this.show("ZLoginLogOffContainer")
};
ZLoginFactory.hideLogOff=function(){
this.hide("ZLoginLogOffContainer")
};
ZLoginFactory.setLoginButtonName=function(e){
this.setHTML("ZLoginButtonText",e)
};
ZLoginFactory.setLoginButtonAction=function(t){
var e=document.getElementById(ZLoginFactory.LOGIN_BUTTON_ID);
if(e){
e.onclick=t
}};
ZLoginFactory.getLoginButton=function(){
return this.get(ZLoginFactory.LOGIN_BUTTON_ID)
};
ZLoginFactory.getLoginDialogHTML=function(t){
var e=["<div ",(t.showPanelBorder?"id='ZLoginPanel'":"id='ZLoginPanelInvisible'"),">","<table class='zLoginTable' width='100%' cellpadding=0 cellspacing=0>","<tr><td id='ZLoginHeaderContainer'><center>","<table class='zLoginTable'>","<tr><td id='ZLoginBannerContainer'>","<div id='ZLoginBannerPanel'>","<table class='zLoginTable'><tr>","<td><div style='cursor:pointer' id='ZLoginBannerImage' class='ImgLoginBanner'"," onclick='window.open(\"",t.companyURL,'", "_blank")\'></div></td>',"<td valign=top id='ZLoginShortVersion'>",t.shortVersion,"</td>","</tr></table>","<div id='ZLoginAppName'>",t.appName,"</div>","<div id='ZLoginProductName'>",t.productName,"</div>","<div id='ZLoginLongVersion'>",t.longVersion,"</div>","</div>","</td>","</tr>","</table>","</center></td>","</tr>","<tr><td id='ZLoginBodyContainer'>","<div id='ZLoginErrorPanel' ",(t.showError?"":"style='display:none'"),">","<table>","<tr><td valign='top' width='40'><div class='ImgCritical_32'></td>","<td width='*' id='ZLoginErrorMsg' class='errorText'>",t.errorMsg,"</td>","</tr>","</table>","</div>","","<div id='ZLoginAboutPanel' ",(t.showAbout?"":"style='display:none'"),">",t.aboutMsg,"</div>","<div id='ZLoginLoadingPanel' ",(t.showLoading?"":"style='display:none'"),">","<table><tr><td></td><td id='ZLoginLoadingMsg'>",t.loadingMsg,"</td></tr></table>","</div>","<div id='ZLoginFormPanel' ",(t.showForm?"":"style='display:none'"),">","<table class='zLoginTable' width='100%' cellpadding=4>","<tr id='ZLoginUserTr'",(t.showUserField?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.userNameMsg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.USER_ID,"' class='zLoginField' autocomplete=OFF type=text tabIndex=1>","</td>","</tr>","<tr id='ZLoginPasswordTr' ",(t.showPasswordField?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.passwordMsg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.PASSWORD_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>","</td>","</tr>","<tr id='",ZLoginFactory.NEW_PASSWORD_TR_ID,"' ",(t.showNewPasswordFields?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.newPassword1Msg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.NEW_PASSWORD_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>","</td>","</tr>","<tr id='",ZLoginFactory.PASSWORD_CONFIRM_TR_ID,"' ",(t.showNewPasswordFields?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.newPassword2Msg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.PASSWORD_CONFIRM_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>","</td>","</tr>","<tr id='ZLoginLicenseMsgContainer' ",(t.showLicenseMsg?"":"style='display:none'"),">","<td colspan=3 id='ZLoginLicenseMsg'>",t.licenseMsg,"</td>","</tr>","<tr><td class='zLoginLabelContainer'>&nbsp;</td>","<td class='zLoginFieldContainer' id='",ZLoginFactory.REMEMBER_ME_CONTAINER_ID,"' ",(t.showRememberMeCheckbox?"":"style='display:none'"),">","<table class='zLoginTable' width=100%>","<tr><td width=1><input id='",ZLoginFactory.REMEMBER_ME_ID,"' type='checkbox'></td>","<td class='zLoginCheckboxLabelContainer'>",t.rememberMeMsg,"</td>","</tr>","</table>","</td>","<td class='zLoginFieldContainer' id='ZLoginLogOffContainer' ",(t.showLogOff?"":"style='display:none'"),">","<a href='' onclick='javascript:"+t.logOffAction+";'>"+t.logOffMsg+"</a>","</td>","<td class='zLoginButtonContainer' align='right'",(t.showButton?"":"style='display:none'"),">","<div id='",ZLoginFactory.LOGIN_BUTTON_ID,"' class='DwtButton'","onclick='",t.loginAction,";return false'","onmouseover='javascript:this.className=\"DwtButton-hover\"'","onmouseout='javascript:this.className=\"DwtButton\"'","onmousedown='javascript:this.className=\"DwtButton-active\";return false'","onmouseup='javascript:this.className=\"DwtButton\"'","onmousemove='javascript:return false'","onselectstart='javascript: return false'","onfocus='javascript:this.className = \"DwtButton-focused\";return false'","onblur='javascript:this.className = \"DwtButton\";return false'",">","<table style='width:100%;height:100%' cellspacing=0>","<tr><td align='center' class='Text' id='ZLoginButtonText'>",t.buttonName,"</td></tr>","</table>","</div>","<!-- non-IE browsers dont allow focus for non-INPUT elements so we have to"," create a hidden input to fake focus for our DIV which acts as an input button -->","<input type='button' style='position:absolute;top:-10000;left:-10000;' id='",ZLoginFactory.HIDDEN_BUTTON_ID,"'>","</td>","</tr>","</table>","</div>","<table class='zLoginTable' width='100%' cellpadding=0 cellspacing=0>","<tr>","<td id='ZloginClientLevelContainer'>",t.clientLevelNotice,"</td>","</tr>","<tr>","<td id='ZLoginLicenseContainer'>",t.copyrightText,"</td>","</tr>","</table>","</td>","</tr>","</table>","</div>"].join("");
return e
};
ZLoginFactory.setHTML=function(a,e){
var t=document.getElementById(a);
if(t&&e!=null){
t.innerHTML=e
}};
ZLoginFactory.setValue=function(a,e){
var t=document.getElementById(a);
if(t&&e!=null){
t.value=e
}};
ZLoginFactory.show=function(a,e){
var t=document.getElementById(a);
if(t){
t.style.display=""
}};
ZLoginFactory.isShown=function(t){
var e=document.getElementById(t);
return e?(e.style.display!="none"):false
};
ZLoginFactory.hide=function(t){
var e=document.getElementById(t);
if(e){
e.style.display="none"
}};
ZLoginFactory.get=function(e){
return document.getElementById(e)
};
ZLoginFactory.handleKeyPress=function(h){
h=h||window.event;
if(h==null){
return true
}
var n=h.target?h.target:h.srcElement;
if(!n){
return true
}
var c=h.keyCode;
var e=false;
if(c==13){
if(n.id==ZLoginFactory.USER_ID||n.id==ZLoginFactory.NEW_PASSWORD_ID){
e=true
}else{
var t=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID).onclick;
if(t){
t.call(n)
}
ZLoginFactory._cancelEvent(h);
return false
}}
if(e||(c==9)){
var l=ZLoginFactory.TAB_ORDER.length-1;
for(var a=0;
a<ZLoginFactory.TAB_ORDER.length;
a++){
if(ZLoginFactory.TAB_ORDER[a]==n.id){
l=a;
break
}}
var o=!h.shiftKey;
var u=ZLoginFactory._getTabToIndex(l,o);
var s=ZLoginFactory.TAB_ORDER[u];
var d=ZLoginFactory.TAB_TYPE[u];
ZLoginFactory._onFocusChange(d,s,n);
ZLoginFactory._cancelEvent(h)
}};
ZLoginFactory._cancelEvent=function(e){
if(e.stopPropagation){
e.stopPropagation()
}
if(e.preventDefault){
e.preventDefault()
}
e.cancelBubble=true;
e.returnValue=false
};
ZLoginFactory._onFocusChange=function(t,n,o){
if((t!=ZLoginFactory.BUTTON_TYPE)&&!AjxEnv.isIE){
ZLoginFactory._loginButtonBlur()
}
if(t==ZLoginFactory.TEXT_TYPE){
var a=ZLoginFactory.get(n);
a.focus();
a.select()
}else{
if(t==ZLoginFactory.CHECKBOX_TYPE){
var i=ZLoginFactory.get(n);
i.focus()
}else{
var e=ZLoginFactory.get(n);
if(AjxEnv.isIE){
e.focus()
}else{
ZLoginFactory._loginButtonFocus(e);
o.blur();
document.getElementById(ZLoginFactory.HIDDEN_BUTTON_ID).focus()
}}}};
ZLoginFactory._getTabToIndex=function(n,e){
var t=n;
do{
var o;
if(e){
t=(t==(ZLoginFactory.TAB_ORDER.length-1))?0:t+1
}else{
t=(t==0)?(ZLoginFactory.TAB_ORDER.length-1):t-1
}
var s=ZLoginFactory.TAB_ORDER[t];
var a=ZLoginFactory.VISIBILITY[t];
var i=ZLoginFactory.get(s);
if(ZLoginFactory.isShown(a)&&!ZLoginFactory.get(s).disabled){
return t
}}
while(t!=n);
return 0
};
ZLoginFactory._loginButtonFocus=function(e){
e.className="DwtButton-focused"
};
ZLoginFactory._loginButtonBlur=function(e){
var e=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID);
e.className="DwtButton"
};
ZLoginFactory._flickerErrorMessagePanel=function(){
ZLoginFactory.getErrorMsgPanel().style.visibility="hidden";
window.setTimeout(ZLoginFactory._showErrorMessagePanel,8)
};
ZLoginFactory._showErrorMessagePanel=function(){
ZLoginFactory.getErrorMsgPanel().style.visibility="visible"
}
}
if(AjxPackage.define("zimbra.common.ZmBaseSplashScreen")){
ZmBaseSplashScreen=function(t,e,a){
if(arguments.length==0){
return
}
if(!(t instanceof DwtShell)){
throw new AjxException("Parent must be a DwtShell",AjxException.INVALIDPARENT,"ZSplashScreen")
}
a=a||"ZSplashScreen";
DwtControl.call(this,{
parent:t,className:a,posStyle:Dwt.ABSOLUTE_STYLE}
);
this.__createContents()
};
ZmBaseSplashScreen.prototype=new DwtControl;
ZmBaseSplashScreen.prototype.constructor=ZmBaseSplashScreen;
ZmBaseSplashScreen.prototype.getHtml=function(){};
ZmBaseSplashScreen.prototype.setVisible=function(e){
if(e==this.getVisible()){
return
}
if(e){
this.__createContents()
}
DwtControl.prototype.setVisible.call(this,e);
if(!e){
this.getHtmlElement().innerHTML=""
}};
ZmBaseSplashScreen.prototype.__createContents=function(){
var a=this.getHtmlElement();
a.style.zIndex=Dwt.Z_SPLASH;
var t=document.createElement("table");
t.border=t.cellSpacing=t.cellPadding=0;
Dwt.setSize(t,"100%","100%");
var i=t.insertRow(0);
var e=i.insertCell(0);
e.vAlign="middle";
e.align="center";
e.innerHTML=this.getHtml();
a.appendChild(t);
a.style.cursor="wait"
}
}
if(AjxPackage.define("zimbra.common.ZmErrorDialog")){
ZmErrorDialog=function(t,a){
this._strNav=this._getNavigatorInfo();
this._subjPfx=this._getSubjectPrefix();
var i=new DwtDialog_ButtonDescriptor(ZmErrorDialog.REPORT_BUTTON,a.report,DwtDialog.ALIGN_LEFT);
var e=new DwtDialog_ButtonDescriptor(ZmErrorDialog.DETAIL_BUTTON,a.showDetails,DwtDialog.ALIGN_LEFT);
DwtMessageDialog.call(this,{
parent:t,extraButtons:[i,e]}
);
this.registerCallback(ZmErrorDialog.REPORT_BUTTON,this._reportCallback,this);
this.registerCallback(ZmErrorDialog.DETAIL_BUTTON,this._showDetail,this);
this._showDetailsMsg=a.showDetails;
this._hideDetailsMsg=a.hideDetails
};
ZmErrorDialog.prototype=new DwtMessageDialog;
ZmErrorDialog.prototype.constructor=ZmErrorDialog;
ZmErrorDialog.prototype.toString=function(){
return"ZmErrorDialog"
};
ZmErrorDialog.REPORT_BUTTON=++DwtDialog.LAST_BUTTON;
ZmErrorDialog.DETAIL_BUTTON=++DwtDialog.LAST_BUTTON;
ZmErrorDialog.DEFAULT_REPORT_URL="//www.zimbra.com/e/";
ZmErrorDialog.prototype._detailsVisible=false;
ZmErrorDialog.prototype.CONTROLS_TEMPLATE="zimbra.Widgets#ZmErrorDialogControls";
ZmErrorDialog.prototype.reset=function(){
this.setDetailString();
DwtMessageDialog.prototype.reset.call(this)
};
ZmErrorDialog.prototype.setDetailString=function(e){
if(!(this._button[ZmErrorDialog.DETAIL_BUTTON])){
return
}
this._button[ZmErrorDialog.DETAIL_BUTTON].setVisible(e!=null);
this._detailStr=e
};
ZmErrorDialog.prototype.setMessage=function(e,i,t,a){
this._msgStr=e;
this.setDetailString(i);
this._msgStyle=t;
this._msgTitle=a;
this._detailsVisible=false;
this._button[ZmErrorDialog.DETAIL_BUTTON].setText(this._showDetailsMsg);
DwtMessageDialog.prototype.setMessage.call(this,e,t,a)
};
ZmErrorDialog.prototype.popup=function(e,t){
if(t){
this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,false)
}
DwtMessageDialog.prototype.popup.call(this,e)
};
ZmErrorDialog.prototype.popdown=function(){
DwtMessageDialog.prototype.popdown.call(this);
this.setSize(Dwt.CLEAR,Dwt.CLEAR);
this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,true)
};
ZmErrorDialog.prototype._getNavigatorInfo=function(){
var a=[];
var e=0;
a[e++]="\n\n";
a[e++]="href: ";
a[e++]=location.href;
a[e++]="\n";
for(var t in navigator){
if(typeof navigator[t]=="function"){
continue
}
if(typeof navigator[t]=="unknown"){
continue
}
a[e++]=t+": "+navigator[t]+"\n"
}
return a.join("")
};
ZmErrorDialog.prototype._getSubjectPrefix=function(){
var t=[];
var e=0;
t[e++]="ER: ";
if(AjxEnv.isIE){
t[e++]="IE "
}else{
if(AjxEnv.isFirefox){
t[e++]="FF "
}else{
if(AjxEnv.isMozilla){
t[e++]="MOZ "
}else{
if(AjxEnv.isSafari){
t[e++]="SAF "
}else{
if(AjxEnv.isOpera){
t[e++]="OPE "
}else{
t[e++]="UKN "
}}}}}
if(AjxEnv.isWindows){
t[e++]="WIN "
}else{
if(AjxEnv.isLinux){
t[e++]="LNX "
}else{
if(AjxEnv.isMac){
t[e++]="MAC "
}else{
t[e++]="UNK "
}}}
t[e++]=appCtxt.get(ZmSetting.CLIENT_VERSION)+" ";
return t.join("")
};
ZmErrorDialog.prototype._getUserPrefs=function(){
var o=appCtxt.getCurrentSearch();
var a=[];
var e=0;
a[e++]="\n\n";
a[e++]="username: ";
a[e++]=appCtxt.get(ZmSetting.USERNAME);
a[e++]="\n";
if(o){
a[e++]="currentSearch: ";
a[e++]=o.query;
a[e++]="\n"
}
for(var t in ZmSetting.INIT){
if(ZmSetting.INIT[t][0]){
a[e++]=ZmSetting.INIT[t][0];
a[e++]=": ";
a[e++]=(""+ZmSetting.INIT[t][3]);
a[e++]="\n"
}}
return a.join("")
};
ZmErrorDialog.prototype._reportCallback=function(){
this._iframe=document.createElement("iframe");
this._iframe.style.width=this._iframe.style.height=0;
this._iframe.style.visibility="hidden";
var a=this._getContentDiv();
a.appendChild(this._iframe);
var l=this._getUserPrefs();
var h=Dwt.getNextId();
var o=[];
var s=0;
var n=this._subjPfx+this._detailStr.substring(0,40);
var t=(location.protocol=="https:")?"https:":"http:";
o[s++]="<html><head></head><body><form id='";
o[s++]=h;
o[s++]="' method='POST' action='";
o[s++]=t;
o[s++]=appCtxt.get(ZmSetting.ERROR_REPORT_URL)||ZmErrorDialog.DEFAULT_REPORT_URL;
o[s++]="'>";
o[s++]="<textarea name='details'>";
o[s++]=this._detailStr;
o[s++]="version - ";
o[s++]=appCtxt.get(ZmSetting.CLIENT_VERSION);
o[s++]="\n";
o[s++]="release - ";
o[s++]=appCtxt.get(ZmSetting.CLIENT_RELEASE);
o[s++]="\n";
o[s++]="date - ";
o[s++]=appCtxt.get(ZmSetting.CLIENT_DATETIME);
o[s++]="</textarea><textarea name='navigator'>";
o[s++]=this._strNav;
o[s++]="</textarea><textarea name='prefs'>";
o[s++]=l;
o[s++]="</textarea><textarea name='subject'>";
o[s++]=n;
o[s++]="</textarea></form></body></html>";
var i=Dwt.getIframeDoc(this._iframe);
i.open();
i.write(o.join(""));
i.close();
var e=i.getElementById(h);
if(e){
e.submit();
appCtxt.setStatusMsg(ZmMsg.errorReportSent)
}
this.popdown()
};
ZmErrorDialog.prototype._showDetail=function(){
this._detailsVisible=!this._detailsVisible;
var e=this._msgStr;
if(this._detailsVisible){
e+="<hr>"+this._detailStr;
this.setSize(Dwt.CLEAR,"300")
}else{
this.setSize(Dwt.CLEAR,Dwt.CLEAR)
}
DwtMessageDialog.prototype.setMessage.call(this,e,this._msgStyle,this._msgTitle);
this._button[ZmErrorDialog.DETAIL_BUTTON].setText(this._detailsVisible?this._hideDetailsMsg:this._showDetailsMsg)
}
}
if(AjxPackage.define("zimbraMail.share.model.ZmAuthenticate")){
ZmAuthenticate=function(){};
ZmAuthenticate._isAdmin=false;
ZmAuthenticate.setAdmin=function(e){
ZmAuthenticate._isAdmin=e
};
ZmAuthenticate.prototype.toString=function(){
return"ZmAuthenticate"
};
ZmAuthenticate.prototype.execute=function(e,o,s){
var i=new ZmCsfeCommand();
var a;
if(!ZmAuthenticate._isAdmin){
a=AjxSoapDoc.create("AuthRequest","urn:zimbraAccount");
var t=a.set("account",e);
t.setAttribute("by","name")
}else{
a=AjxSoapDoc.create("AuthRequest","urn:zimbraAdmin",null);
a.set("name",e)
}
a.set("virtualHost",location.hostname);
a.set("password",o);
var n=new AjxCallback(this,this._handleResponseExecute,s);
i.invoke({
soapDoc:a,noAuthToken:true,noSession:true,asyncMode:true,callback:n}
)
};
ZmAuthenticate.prototype._handleResponseExecute=function(a,e){
if(!e.isException()){
var t=e.getResponse().Body.AuthResponse;
this._setAuthToken(t)
}
if(a){
a.run(e)
}};
ZmAuthenticate.prototype._setAuthToken=function(t){
var e=appCtxt.rememberMe?t.lifetime:0;
ZmCsfeCommand.setAuthToken(t.authToken[0]._content,e)
}
}
if(AjxPackage.define("zimbraMail.share.model.ZmAutocomplete")){
ZmAutocomplete=function(){
this._acRequests={};
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
var a=new AjxListener(this,this._settingChangeListener);
var t=[ZmSetting.GAL_AUTOCOMPLETE,ZmSetting.AUTOCOMPLETE_SHARE,ZmSetting.AUTOCOMPLETE_SHARED_ADDR_BOOKS,ZmSetting.AUTOCOMPLETE_NO_GROUP_MATCH];
for(var e=0;
e<t.length;
e++){
appCtxt.getSettings().getSetting(t[e]).addChangeListener(a)
}}};
ZmAutocomplete.AC_VALUE_FULL="fullAddress";
ZmAutocomplete.AC_VALUE_EMAIL="email";
ZmAutocomplete.AC_VALUE_NAME="name";
ZmAutocomplete.AC_TIMEOUT=20;
ZmAutocomplete.AC_TYPE_CONTACT="contact";
ZmAutocomplete.AC_TYPE_GAL="gal";
ZmAutocomplete.AC_TYPE_GROUP="group";
ZmAutocomplete.AC_TYPE_TABLE="rankingTable";
ZmAutocomplete.AC_TYPE_UNKNOWN="unknown";
ZmAutocomplete.AC_TYPE_LOCATION="Location";
ZmAutocomplete.AC_TYPE_EQUIPMENT="Equipment";
ZmAutocomplete.AC_ICON={};
ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_CONTACT]="Contact";
ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_GAL]="GALContact";
ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_GROUP]="Group";
ZmAutocomplete.GAL_RESULTS_TTL=900000;
ZmAutocomplete.prototype.toString=function(){
return"ZmAutocomplete"
};
ZmAutocomplete.prototype.autocompleteMatch=function(n,h,t,e,o){
n=n.toLowerCase().replace(/"/g,"");
this._curAcStr=n;
var a=(e&&e.type)||ZmAutocomplete.AC_TYPE_CONTACT;
var i=this._checkCache(n,a,o);
if(i!==null){
this._handleResponseAutocompleteMatch(n,h,i);
return
}
var s=new AjxCallback(this,this._handleResponseAutocompleteMatch,[n,h]);
this._doAutocomplete(n,t,e,a,s,o)
};
ZmAutocomplete.prototype._handleResponseAutocompleteMatch=function(t,a,e){
if(t==this._curAcStr){
a.run(e)
}};
ZmAutocomplete.prototype._doAutocomplete=function(n,i,c,t,h,o){
if(this._acRequests[n]){
return
}
for(var e in this._acRequests){
if(n!=e){
appCtxt.getAppController().cancelRequest(this._acRequests[e],null,true);
delete this._acRequests[n]
}}
var a={
query:n,isAutocompleteSearch:true};
if(t!=ZmAutocomplete.AC_TYPE_CONTACT){
a.isGalAutocompleteSearch=true;
a.isAutocompleteSearch=false;
a.limit=a.limit*2;
a.types=AjxVector.fromArray([ZmItem.CONTACT]);
a.galType=ZmSearch.GAL_RESOURCE
}else{}
a.accountName=o&&o.name;
var l=new ZmSearch(a);
var s={
callback:(new AjxCallback(this,this._handleResponseDoAutocomplete,[n,i,c,t,h,o])),errorCallback:(new AjxCallback(this,this._handleErrorDoAutocomplete,[n,i])),timeout:ZmAutocomplete.AC_TIMEOUT,noBusyOverlay:true};
this._acRequests[n]=l.execute(s)
};
ZmAutocomplete.prototype._handleResponseDoAutocomplete=function(u,l,p,e,f,c,g){
if(u!=this._curAcStr){
return
}
delete this._acRequests[u];
var t,h=false,s=false;
var a=g.getResponse();
if(a&&a.search&&a.search.isGalAutocompleteSearch){
var m=a.getResults(ZmItem.CONTACT);
t=(m&&m.getArray())||[];
h=s=true
}else{
t=a._respEl.match||[]
}
var d=[];
for(var o=0;
o<t.length;
o++){
var n=new ZmAutocompleteMatch(t[o],p,h);
if(n.acType==e){
if(n.type==ZmAutocomplete.AC_TYPE_GAL){
s=true
}
d.push(n)
}}
f.run(d);
this._cacheResults(u,e,d,s,a._respEl.canBeCached,null,c)
};
ZmAutocomplete.prototype._handleErrorDoAutocomplete=function(a,t,e){
appCtxt.getAppController().cancelRequest(this._acRequests[a],null,true);
appCtxt.setStatusMsg({
msg:ZmMsg.autocompleteFailed,level:ZmStatusView.LEVEL_WARNING}
);
delete this._acRequests[a];
return true
};
ZmAutocomplete.acSortCompare=function(t,e){
var o=(t&&t.score)||0;
var i=(e&&e.score)||0;
return(o>i)?1:(o<i)?-1:0
};
ZmAutocomplete.prototype.isComplete=function(e){
return AjxEmailAddress.isValid(e)
};
ZmAutocomplete.prototype.quickComplete=function(n){
if(n.indexOf("@")!=-1){
return null
}
if(!this._userDomain){
var t=appCtxt.get(ZmSetting.USERNAME);
if(t){
var e=t.split("@");
if(e&&e.length){
this._userDomain=e[e.length-1]
}}}
if(this._userDomain){
var o=[n,this._userDomain].join("@");
var i=new ZmAutocompleteMatch();
i.name=i.email=i.fullAddress=o;
return i
}else{
return null
}};
ZmAutocomplete.prototype.forget=function(i,a){
var t={
RankingActionRequest:{
_jsns:"urn:zimbraMail"}};
t.RankingActionRequest.action={
op:"delete",email:i};
var e=new AjxCallback(this,this._handleResponseForget,[a]);
appCtxt.getRequestMgr().sendRequest({
jsonObj:t,asyncMode:true,callback:e}
)
};
ZmAutocomplete.prototype._handleResponseForget=function(e){
appCtxt.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT);
if(e){
e.run()
}};
ZmAutocomplete.prototype._getCache=function(a,o,i,t){
var e=AjxEnv.isIE?window.appCtxt:window.parentAppCtxt||window.appCtxt;
return e.getAutocompleteCache(a,o,i,t)
};
ZmAutocomplete.prototype._cacheResults=function(s,i,n,a,e,h,o){
var t=this._getCache(i,s,o,true);
t.list=n;
t.cacheable=(h&&h.cacheable)||e;
if(a){
t.ts=(h&&h.ts)||(new Date()).getTime()
}};
ZmAutocomplete.prototype._checkCache=function(l,t,s){
var e=this._getCachedResults(l,t,null,s);
var h=e&&e.list;
if(h!==null){
return h
}
if(l.length<=1){
return null
}
var a=l;
while(a&&!h){
a=a.slice(0,-1);
e=this._getCachedResults(a,t,true,s);
h=e&&e.list;
if(h&&h.length==0){
return h
}}
var c=[];
if(h&&h.length){
for(var o=0;
o<h.length;
o++){
var n=h[o];
if(n.matches(l)){
c.push(n)
}}}else{
return null
}
this._cacheResults(l,t,c,false,false,e,s);
return c
};
ZmAutocomplete.prototype._getCachedResults=function(n,i,e,o){
var t=this._getCache(i,n,o);
if(t){
if(e&&(t.cacheable===false)){
return null
}
if(t.ts){
var a=(new Date()).getTime();
if(a>(t.ts+ZmAutocomplete.GAL_RESULTS_TTL)){
return null
}}
return t
}else{
return null
}};
ZmAutocomplete.prototype._settingChangeListener=function(t){
if(t.type!=ZmEvent.S_SETTING){
return
}
var e=AjxEnv.isIE?window.appCtxt:window.parentAppCtxt||window.appCtxt;
e.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT)
};
ZmAutocompleteMatch=function(a,t,n){
if(!a){
return
}
this.type=a.type;
if(n){
this.text=this.name=a.getFullName();
this.email=a.getEmail();
this.item=a;
this.type=ZmContact.getAttr(a,ZmResource.F_type)||ZmAutocomplete.AC_TYPE_GAL
}else{
if(this.type==ZmAutocomplete.AC_TYPE_GROUP){
this.fullAddress=a.email;
this.name=a.display;
var h=[];
var s=a.email.split(",");
for(var o=0;
o<s.length;
o++){
var e=AjxEmailAddress.parse(s[o]);
if(e&&e.getAddress()){
h.push(e.getAddress())
}}
this.email=h.join(";");
this.text=a.display
}else{
var e=AjxEmailAddress.parse(a.email);
if(e){
this.fullAddress=e.toString();
this.name=e.getName();
this.email=e.getAddress()
}else{
this.email=a.email
}
this.text=AjxStringUtil.htmlEncode(a.email);
if(t&&t.needItem&&window.ZmContact){
this.item=new ZmContact(null);
this.item.initFromEmail(e||a.email)
}}
this.icon=ZmAutocomplete.AC_ICON[a.type];
this.score=a.ranking
}
this.icon=this.icon||ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_CONTACT];
this.acType=(this.type==ZmAutocomplete.AC_TYPE_LOCATION||this.type==ZmAutocomplete.AC_TYPE_EQUIPMENT)?this.type:ZmAutocomplete.AC_TYPE_CONTACT;
this.canForget=(a.type==ZmAutocomplete.AC_TYPE_TABLE)
};
ZmAutocompleteMatch.prototype.toString=function(){
return"ZmAutocompleteMatch"
};
ZmAutocompleteMatch.prototype.matches=function(s){
if(this.name&&!this._nameParsed){
var n=this.name.split(/\s+/,3);
var a=n[0];
this._lastName=n[n.length-1];
this._firstLast=[a,this._lastName].join(" ");
this._nameParsed=true
}
var e=[this.email,this.name,this._lastName,this._firstLast];
for(var t=0;
t<e.length;
t++){
var o=e[t]&&e[t].toLowerCase();
if(o&&(o.indexOf(s)==0)){
return true
}}
return false
};
ZmSearchAutocomplete=function(){
this._op={};
this._list={};
this._loadFunc={};
var e={
loader:this._loadTags,text:function(t){
return t.getName(false,null,true,true)
}
,icon:function(t){
return t.getIcon()
}
,matchText:function(t){
return t.createQuery()
}};
this._registerHandler("tag",e);
e={
listType:ZmId.ORG_FOLDER,text:function(t){
return t.getPath(false,false,null,true,true)
}
,icon:function(t){
return t.getIcon()
}
,matchText:function(t){
return t.createQuery()
}};
this._loadFunc[ZmId.ORG_FOLDER]=this._loadFolders;
this._registerHandler("in",e);
this._registerHandler("under",e);
e={
loader:this._loadFlags};
this._registerHandler("is",e);
e={
loader:this._loadObjects,icon:function(t){
return ZmSearchAutocomplete.ICON[t]
}};
this._registerHandler("has",e);
e={
listType:ZmId.ITEM_ATT,text:function(t){
return t.desc
}
,icon:function(t){
return t.image
}
,matchText:function(t){
return t.type
}
,quoteMatch:true};
this._loadFunc[ZmId.ITEM_ATT]=this._loadTypes;
this._registerHandler("type",e);
this._registerHandler("attachment",e);
appCtxt.getFolderTree().addChangeListener(new AjxListener(this,this._folderTreeChangeListener));
appCtxt.getTagTree().addChangeListener(new AjxListener(this,this._tagTreeChangeListener))
};
ZmSearchAutocomplete.ICON={};
ZmSearchAutocomplete.ICON.attachment="Attachment";
ZmSearchAutocomplete.ICON.phone="Telephone";
ZmSearchAutocomplete.ICON.url="URL";
ZmSearchAutocomplete.prototype._registerHandler=function(a,e){
var t=e.loader||this._loadFunc[e.listType];
this._op[a]={
loader:new AjxCallback(this,t),text:e.text,icon:e.icon,listType:e.listType||a,matchText:e.matchText||e.text,quoteMatch:e.quoteMatch}
};
ZmSearchAutocomplete.prototype.autocompleteMatch=function(n,s,i,l){
if(ZmSearchAutocomplete._ignoreNextKey){
ZmSearchAutocomplete._ignoreNextKey=false;
return
}
n=n.toLowerCase().replace(/"/g,"");
var t=n.match(/\b-?([a-z]+):/);
if(!(t&&t.length)){
s.run();
return
}
var a=t[1];
var e=this._op[a];
if(!e){
s.run();
return
}
var o=this._list[e.listType];
if(o){
s.run(this._getMatches(a,n))
}else{
var h=new AjxCallback(this,this._handleResponseLoad,[a,n,s]);
this._list[e.listType]=[];
e.loader.run(e.listType,h)
}};
ZmSearchAutocomplete.prototype._getMatches=function(l,m){
var e=this._op[l];
var s=[];
var d=this._list[e.listType];
var a=m.substr(m.indexOf(":")+1);
if(e.listType==ZmId.ORG_FOLDER){
a=a.replace(/^\//,"")
}
for(var h=0,c=d.length;
h<c;
h++){
var t=d[h];
var f=e.text?e.text(t):t;
var u=f.toLowerCase();
if(!a||(u.indexOf(a)==0)){
var n=e.matchText?e.matchText(t):e.quoteMatch?[l,":",'"',f,'"'].join(""):[l,":",f].join("");
n=m.replace(l+":"+a,n);
s.push({
text:f,icon:e.icon?e.icon(t):null,matchText:n,exactMatch:(u.length==a.length)}
)
}}
if(s.length==1&&s[0].exactMatch){
s=[]
}
return s
};
ZmSearchAutocomplete.prototype._handleResponseLoad=function(a,e,t){
t.run(this._getMatches(a,e))
};
ZmSearchAutocomplete.prototype._loadTags=function(n,h){
var s=this._list[n];
var a=appCtxt.getTagTree().asList();
for(var o=0,t=a.length;
o<t;
o++){
var e=a[o];
if(e.id!=ZmOrganizer.ID_ROOT){
s.push(e)
}}
s.sort(ZmTag.sortCompare);
if(h){
h.run()
}};
ZmSearchAutocomplete.prototype._loadFolders=function(o,h){
var s=this._list[o];
var a=appCtxt.getFolderTree().asList({
includeRemote:true}
);
for(var t=0,e=a.length;
t<e;
t++){
var n=a[t];
if(n.id!=ZmOrganizer.ID_ROOT&&n.type==ZmOrganizer.FOLDER){
s.push(n)
}}
s.sort(ZmFolder.sortComparePath);
if(h){
h.run()
}};
ZmSearchAutocomplete.prototype._loadFlags=function(e,t){
this._list[e]=["anywhere","unread","read","flagged","unflagged","sent","received","replied","unreplied","forwarded","unforwarded","invite","solo","tome","fromme","ccme","tofromme","fromccme","tofromccme","local","remote"].sort();
if(t){
t.run()
}};
ZmSearchAutocomplete.prototype._loadObjects=function(a,n){
var o=this._list[a];
o.push("attachment");
var e=appCtxt.getZimletMgr().getIndexedZimlets();
if(e.length){
for(var t=0;
t<e.length;
t++){
o.push(e[t].keyword)
}}
o.sort();
if(n){
n.run()
}};
ZmSearchAutocomplete.prototype._loadTypes=function(t,i){
AjxDispatcher.require("Browse");
var e=new ZmAttachmentTypeList();
var a=new AjxCallback(this,this._handleResponseLoadTypes,[e,t,i]);
e.load(a)
};
ZmSearchAutocomplete.prototype._handleResponseLoadTypes=function(e,t,a){
this._list[t]=e.getAttachments();
if(a){
a.run()
}};
ZmSearchAutocomplete.prototype._folderTreeChangeListener=function(a){
var e=a.getDetail("fields");
if(a.event==ZmEvent.E_DELETE||a.event==ZmEvent.E_CREATE||a.event==ZmEvent.E_MOVE||((a.event==ZmEvent.E_MODIFY)&&e&&e[ZmOrganizer.F_NAME])){
var t=ZmId.ORG_FOLDER;
if(this._list[t]){
this._list[t]=[];
this._loadFolders(t)
}}};
ZmSearchAutocomplete.prototype._tagTreeChangeListener=function(a){
var e=a.getDetail("fields");
if(a.event==ZmEvent.E_DELETE||a.event==ZmEvent.E_CREATE||a.event==ZmEvent.E_MOVE||((a.event==ZmEvent.E_MODIFY)&&e&&e[ZmOrganizer.F_NAME])){
var t="tag";
if(this._list[t]){
this._list[t]=[];
this._loadTags(t)
}}}
}
if(AjxPackage.define("zimbraMail.share.model.ZmInvite")){
ZmInvite=function(){
ZmModel.call(this)
};
ZmInvite.prototype=new ZmModel;
ZmInvite.prototype.constructor=ZmInvite;
ZmInvite.prototype.toString=function(){
return"ZmInvite: name="+this.name+" id="+this.id
};
ZmInvite._sendFun=null;
ZmInvite.createFromDom=function(n){
var t=new ZmInvite();
t.components=n[0].comp;
t.replies=n[0].replies;
if(t.components==null){
t.components=[{}
];
t.components.empty=true
}
var e=n[0];
if(e.tz){
for(var o=0;
o<e.tz.length;
o++){
var l=e.tz[o];
var s=AjxTimezone.getRule(l.id);
if(!s){
var h={
standard:l.standard?AjxUtil.createProxy(l.standard[0]):{}
,daylight:l.daylight?AjxUtil.createProxy(l.daylight[0]):null};
h.standard.offset=l.stdoff;
delete h.standard._object_;
if(l.daylight){
h.daylight.offset=l.dayoff;
delete h.daylight._object_
}
s=AjxTimezone.getRule(l.id,h);
if(s){
var a=AjxUtil.createProxy(s);
a.aliasId=s.clientId;
a.clientId=l.id;
a.serverId=l.id;
AjxTimezone.addRule(a)
}}
if(!s){
s={
clientId:l.id,serverId:l.id,autoDetected:true};
if(l.daylight){
s.standard=AjxUtil.createProxy(l.standard[0]);
s.standard.offset=l.stdoff;
s.standard.trans=AjxTimezone.createTransitionDate(s.standard);
s.daylight=AjxUtil.createProxy(l.daylight[0]);
s.daylight.offset=l.dayoff;
s.daylight.trans=AjxTimezone.createTransitionDate(s.daylight)
}else{
s.standard={
offset:l.stdoff}
}
AjxTimezone.addRule(s)
}}}
t.type=e&&e.type?e.type:"appt";
return t
};
ZmInvite.prototype.setMessageId=function(e){
this.msgId=e
};
ZmInvite.prototype.getMessageId=function(){
return this.msgId
};
ZmInvite.prototype.getComponent=function(e){
return this.components[e]
};
ZmInvite.prototype.getComponents=function(){
return this.components
};
ZmInvite.prototype.getComponentByUid=function(t){
for(var e=0;
e<components.length;
++e){
if(components.uid==t){
break
}}};
ZmInvite.prototype.hasMultipleComponents=function(){
return(this.components.length>1)
};
ZmInvite.prototype.hasOtherAttendees=function(e){
var t=e||0;
return this.components[t].at&&this.components[t].at.length>0
};
ZmInvite.prototype.getEventName=function(e){
var t=e||0;
return this.components[t]?this.components[t].name:null
};
ZmInvite.prototype.getAlarm=function(e){
var t=e||0;
return this.components[t]?this.components[t].alarm:null
};
ZmInvite.prototype.getInviteMethod=function(e){
var t=e||0;
return this.components[t]?this.components[t].method:null
};
ZmInvite.prototype.getSequenceNo=function(e){
var t=e||0;
return this.components[t]?this.components[t].seq:null
};
ZmInvite.prototype.getOrganizerEmail=function(e){
var t=e||0;
return(this.components[t]&&this.components[t].or&&this.components[t].or.url)?(this.components[t].or.url.replace("MAILTO:","")):null
};
ZmInvite.prototype.getOrganizerName=function(e){
var t=e||0;
return(this.components[t]&&this.components[t].or)?(this.components[t].or.d||this.components[t].or.url):null
};
ZmInvite.prototype.getSentBy=function(e){
var t=e||0;
return(this.components[t]&&this.components[t].or)?this.components[t].or.sentBy:null
};
ZmInvite.prototype.isOrganizer=function(e){
var t=e||0;
return this.components[t]?(!!this.components[t].isOrg):false
};
ZmInvite.prototype.shouldRsvp=function(e){
var t=e||0;
return this.components[t]?this.components[t].rsvp:null
};
ZmInvite.prototype.getRecurrenceRules=function(e){
var t=e||0;
return this.components[t].recur
};
ZmInvite.prototype.getAttendees=function(a){
var n=a||0;
var e=this.components[n].at;
var o=[];
if(!(e&&e.length)){
return o
}
for(var t=0;
t<e.length;
t++){
if(!e[t].cutype||(e[t].cutype==ZmCalendarApp.CUTYPE_INDIVIDUAL)){
o.push(e[t])
}}
return o
};
ZmInvite.prototype.getReplies=function(e){
var t=e||0;
return(this.replies&&this.replies[t])?this.replies[t].reply:null
};
ZmInvite.prototype.getResources=function(a){
var n=a||0;
var e=this.components[n].at;
var o=[];
if(!(e&&e.length)){
return o
}
for(var t=0;
t<e.length;
t++){
if(e[t].cutype==ZmCalendarApp.CUTYPE_RESOURCE){
o.push(e[t])
}}
return o
};
ZmInvite.prototype.getExceptId=function(e){
var t=e||0;
return(this.components[t]&&this.components[t].exceptId)?this.components[t].exceptId[0]:null
};
ZmInvite.prototype.getAppointmentId=function(e){
var t=e||0;
return this.components[t].apptId
};
ZmInvite.prototype.getStatus=function(e){
var t=e||0;
return this.components[t].status
};
ZmInvite.prototype.isEmpty=function(){
return Boolean(this.components.empty)
};
ZmInvite.prototype.isException=function(e){
var t=e||0;
return this.components[t]?this.components[t].ex:false
};
ZmInvite.prototype.isRecurring=function(e){
var t=e||0;
return this.components[t]?this.components[t].recur:false
};
ZmInvite.prototype.isAllDayEvent=function(e){
var t=e||0;
return this.components[t]?this.components[t].allDay=="1":false
};
ZmInvite.prototype.isMultiDay=function(t){
var i=t||0;
var a=this.getServerStartDate(i);
var e=this.getServerEndDate(i);
return(a.getDate()!=e.getDate())||(a.getMonth()!=e.getMonth())||(a.getFullYear()!=e.getFullYear())
};
ZmInvite.prototype.getComponentDescriptionHtml=function(t){
var n=t||0;
var e=this.components[n];
if(e==null){
return
}
var o=e.descHtml;
var i=o&&o[0]._content||null;
if(!i){
var a=e.desc;
a=(a&&a[0]._content)||null;
if(!a){
i=this.getApptSummary(true)
}}
return i
};
ZmInvite.prototype.getComponentDescription=function(t){
var n=t||0;
var e=this.components[n];
if(e==null){
return
}
var i=e.desc;
var a=i&&i[0]._content||null;
if(!a){
var o=e.descHtml;
o=(o&&o[0]._content)||null;
if(!o){
a=this.getApptSummary()
}}
return a
};
ZmInvite.prototype.getServerEndTime=function(l){
var u=l||0;
if(this.components[u]==null){
return
}
if(this._serverEndTime==null){
if(this.components[u].e!=null){
this._serverEndTime=this.components[u].e[0].d
}else{
if(this.components[u].s){
var a=this.components[u].dur;
var f=a&&a[0].d||0;
var e=a&&a[0].w||0;
var o=a&&a[0].h||0;
var n=a&&a[0].m||0;
var g=a&&a[0].s||0;
var p=parseInt(g)+(parseInt(n)*60)+(parseInt(o)*3600)+(parseInt(f)*24*3600)+(parseInt(e)*7*24*3600);
var i=this.components[u].s[0].d;
var s=parseInt(i.substr(0,4),10);
var m=parseInt(i.substr(4,2),10);
var f=parseInt(i.substr(6,2),10);
var c=new Date(s,m-1,f);
if(i.charAt(8)=="T"){
o=parseInt(i.substr(9,2),10);
n=parseInt(i.substr(11,2),10);
g=parseInt(i.substr(13,2),10);
c.setHours(o,n,g,0)
}
var h=new Date(c.getTime()+(p*1000));
m=AjxDateUtil._pad(c.getMonth()+1);
f=AjxDateUtil._pad(c.getDate());
o=AjxDateUtil._pad(c.getHours());
n=AjxDateUtil._pad(c.getMinutes());
g=AjxDateUtil._pad(c.getSeconds());
s=c.getFullYear();
this._serverEndTime=[s,m,f,"T",o,n,g].join("")
}}}
return this._serverEndTime
};
ZmInvite.prototype.getServerEndDate=function(e){
var t=e||0;
if(this._serverEndDate==null){
this._serverEndDate=AjxDateUtil.parseServerDateTime(this.getServerEndTime(t))
}
return this._serverEndDate
};
ZmInvite.prototype.getServerStartTime=function(e){
var t=e||0;
return this.components[t]&&this.components[t].s?this.components[t].s[0].d:null
};
ZmInvite.prototype.getServerStartDate=function(e){
var t=e||0;
if(this._serverStartDate==null){
this._serverStartDate=AjxDateUtil.parseServerDateTime(this.getServerStartTime(t))
}
return this._serverStartDate
};
ZmInvite.prototype.getServerStartTimeTz=function(e){
var a=e||0;
if(this.components[a]==null){
return
}
if(this._serverStartTimeZone==null){
var t=this.getServerStartTime();
this._serverStartTimeZone=t&&t.charAt(t.length-1)=="Z"?AjxTimezone.GMT_NO_DST:(this.components[a].s?this.components[a].s[0].tz:null)
}
return this._serverStartTimeZone
};
ZmInvite.prototype.getServerEndTimeTz=function(t){
var a=t||0;
if(this.components[a]==null){
return
}
if(this._serverEndTimeZone==null){
var e=this.getServerEndTime();
this._serverEndTimeZone=e&&startTime.charAt(e.length-1)=="Z"?AjxTimezone.GMT_NO_DST:this.components[a].e[0].tz
}
return this._serverEndTimeZone
};
ZmInvite.prototype.getDurationText=function(m,y,e,l){
var p=this.components[m];
var o=this.getServerStartDate(m);
var i=this.getServerEndDate(m);
if(!o&&!i){
return""
}
if(this.isAllDayEvent(m)){
if(y){
return""
}
var f=this.getServerStartDate(m);
if(this.isMultiDay(m)){
var c=this.getServerEndDate(m);
var h=AjxDateFormat.getDateInstance();
var u=h.format(f);
var t=h.format(c);
if(!ZmInvite._daysFormatter){
ZmInvite._daysFormatter=new AjxMessageFormat(ZmMsg.durationDays)
}
return ZmInvite._daysFormatter.format([u,t])
}else{
var h=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
return h.format(f)
}}else{
var h=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
var s=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
var f=this.getServerStartDate(m);
var g=[];
if(f){
g=[h.format(f),l?" ":"<br>"];
if(e){
g.push(s.format(f))
}else{
var c=this.getServerEndDate(m);
if(c){
var n=s.format(f);
var d=s.format(c);
if(!ZmInvite._hoursFormatter){
ZmInvite._hoursFormatter=new AjxMessageFormat(ZmMsg.durationHours)
}
g.push(ZmInvite._hoursFormatter.format([n,d]))
}}}
return g.join("")
}};
ZmInvite.prototype.getName=function(e){
var t=e||0;
return this.components[t]?this.components[t].name:null
};
ZmInvite.prototype.getFreeBusy=function(e){
var t=e||0;
return this.components[t]?this.components[t].fb:null
};
ZmInvite.prototype.getPrivacy=function(e){
var t=e||0;
return this.components[t]?this.components[t]["class"]:null
};
ZmInvite.prototype.getXProp=function(e){
var t=e||0;
return this.components[t]?this.components[t]["xprop"]:null
};
ZmInvite.prototype.getLocation=function(e){
var t=e||0;
return this.components[t]?this.components[t].loc:null
};
ZmInvite.prototype.getRecurrenceId=function(e){
var t=e||0;
return this.components[t]?this.components[t].ridZ:null
};
ZmInvite.prototype.getToolTip=function(){
if(this._toolTip){
return this._toolTip
}
var i=0;
var a=[];
var t=0;
a[t++]="<table cellpadding=0 cellspacing=0 border=0 >";
a[t++]="<tr valign='center'><td colspan=2 align='left'>";
a[t++]="<div style='border-bottom: 1px solid black;'>";
a[t++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
a[t++]="<tr valign='center'><td><b>";
a[t++]="<div style='white-space:nowrap'><table border=0 cellpadding=0 cellspacing=0 style='display:inline'><tr>";
if(this.hasOtherAttendees(i)){
a[t++]="<td>";
a[t++]=AjxImg.getImageHtml("ApptMeeting");
a[t++]="</td>"
}
if(this.isException(i)){
a[t++]="<td>";
a[t++]=AjxImg.getImageHtml("ApptException");
a[t++]="</td>"
}else{
if(this.isRecurring(i)){
a[t++]="<td>";
a[t++]=AjxImg.getImageHtml("ApptRecur");
a[t++]="</td>"
}}
a[t++]="</tr></table>&nbsp;";
a[t++]=AjxStringUtil.htmlEncode(this.getName(i));
a[t++]="&nbsp;</div></b></td><td align='right'>";
a[t++]=AjxImg.getImageHtml("Appointment");
a[t++]="</td></table></div></td></tr>";
var e=this.getDurationText(i,false,false);
t=this._addEntryRow(ZmMsg.when,e,a,t,false,null,true);
if(this.isRecurring(i)){
if(!this._recurBlurb){
AjxDispatcher.require("CalendarCore");
var o=new ZmRecurrence();
o.parse(this.getRecurrenceRules(i));
this._recurBlurb=o.getBlurb()
}
t=this._addEntryRow(ZmMsg.repeats,this._recurBlurb,a,t,true,null,true)
}
t=this._addEntryRow(ZmMsg.location,this.getLocation(i),a,t,false);
a[t++]="</table>";
this._toolTip=a.join("");
return this._toolTip
};
ZmInvite.prototype.getApptSummary=function(e){
var a=this.getMessageId();
var i=appCtxt.getById(this.getMessageId());
var t;
if(i){
AjxDispatcher.require("CalendarCore");
t=new ZmAppt();
t.setFromMessage(i)
}
return t?t.getSummary(e):this.getSummary(e)
};
ZmInvite.prototype.getSummary=function(e){
var h=0;
var c=this.getOrganizerName(h);
var u=this.getDurationText(h,false,false,true);
var l=this.getLocation(h);
if(this.isRecurring(h)){
if(!this._recurBlurb){
AjxDispatcher.require("CalendarCore");
var s=new ZmRecurrence();
s.setRecurrenceRules(this.getRecurrenceRules(h),this.getServerStartDate(h));
this._recurBlurb=s.getBlurb()
}}
var n=this._recurBlurb;
var t=[];
var o=0;
if(!this._summaryHtmlLineFormatter){
this._summaryHtmlLineFormatter=new AjxMessageFormat("<tr><th align='left'>{0}</th><td>{1} {2}</td></tr>");
this._summaryTextLineFormatter=new AjxMessageFormat("{0} {1} {2}")
}
var d=e?this._summaryHtmlLineFormatter:this._summaryTextLineFormatter;
var a=[];
if(e){
t[o++]="<p>\n<table border='0'>\n"
}
if(c){
a=[ZmMsg.organizerLabel,c,""];
t[o++]=d.format(a);
t[o++]="\n"
}
if(u){
a=[ZmMsg.whenLabel,u,""];
t[o++]=d.format(a);
t[o++]="\n"
}
if(l){
a=[ZmMsg.locationLabel,l,""];
t[o++]=d.format(a);
t[o++]="\n"
}
if(n){
a=[ZmMsg.repeatLabel,n,""];
t[o++]=d.format(a);
t[o++]="\n"
}
if(e){
t[o++]="</table>\n"
}
t[o++]=e?"<div>":"\n\n";
t[o++]=ZmItem.NOTES_SEPARATOR;
t[o++]=e?"</div><br>":"\n\n";
return t.join("")
};
ZmInvite.prototype._addEntryRow=function(s,n,t,e,o,i,a){
if(n!=null&&n!=""){
t[e++]="<tr valign='top'><td align='right' style='padding-right: 5px;'><b><div style='white-space:nowrap'>";
t[e++]=AjxMessageFormat.format(ZmMsg.makeLabel,AjxStringUtil.htmlEncode(s));
t[e++]="</div></b></td><td align='left'><div style='white-space:";
t[e++]=o?"wrap;":"nowrap;";
if(i){
t[e++]="width:";
t[e++]=i;
t[e++]="px;"
}
t[e++]="'>";
t[e++]=a?n:AjxStringUtil.htmlEncode(n);
t[e++]="</div></td></tr>"
}
return e
};
ZmInvite.prototype.hasAcceptableComponents=function(){
for(var e in this.components){
if(this.getStatus(e)!=ZmCalendarApp.STATUS_CANC){
return true
}}
return false
};
ZmInvite.prototype.hasInviteReplyMethod=function(t){
var e=this.getInviteMethod(t);
var a=(e==ZmCalendarApp.METHOD_REQUEST||e==ZmCalendarApp.METHOD_PUBLISH);
return((e==null)||a)
};
ZmInvite.prototype.hasCounterMethod=function(t){
var e=this.getInviteMethod(t);
return(e==ZmCalendarApp.METHOD_COUNTER)
};
ZmInvite.prototype.getProposedTimeStr=function(t){
var e=this.getInviteMethod(t);
if(e==ZmCalendarApp.METHOD_COUNTER){
return this.getDurationText(t,false,false,true)
}
return""
}
}
if(AjxPackage.define("zimbraMail.share.view.ZmAutocompleteListView")){
ZmAutocompleteListView=function(i){
var e=i.className?i.className:"ZmAutocompleteListView";
DwtComposite.call(this,i.parent||appCtxt.getShell(),e,DwtControl.ABSOLUTE_STYLE);
this._dataClass=this._dataAPI=i.dataClass;
this._dataLoader=i.dataLoader;
this._dataLoaded=false;
this._matchValue=i.matchValue;
this._separator=(i.separator!=null)?i.separator:AjxEmailAddress.SEPARATOR;
this._compCallback=i.compCallback;
this._keyDownCallback=i.keyDownCallback;
this._keyPressCallback=i.keyPressCallback;
this._keyUpCallback=i.keyUpCallback;
this._enterCallback=i.enterCallback;
this._options=i.options||{};
this._isDelim=AjxUtil.arrayAsHash(i.delims||ZmAutocompleteListView.DELIMS);
this._isDelimCode=AjxUtil.arrayAsHash(i.delimCodes||ZmAutocompleteListView.DELIM_CODES);
if(!i.delims&&!i.delimCodes){
this._isDelim[","]=this._isDelimCode[188]=appCtxt.get(ZmSetting.AUTOCOMPLETE_ON_COMMA);
var t=new AjxListener(this,this._settingChangeListener);
var a=appCtxt.getSettings().getSetting(ZmSetting.AUTOCOMPLETE_ON_COMMA);
if(a){
a.addChangeListener(t)
}}
this._setMouseEventHdlrs();
this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
this._addSelectionListener(new AjxListener(this,this._listSelectionListener));
this._outsideListener=new AjxListener(null,ZmAutocompleteListView._outsideMouseDownListener);
this._acInterval=appCtxt.get(ZmSetting.AC_TIMER_INTERVAL);
this._acAction=new AjxTimedAction(null,this._autocompleteAction);
this._acActionId=-1;
if(AjxEnv.isGeckoBased){
this._focusAction=new AjxTimedAction(null,this._autocompleteFocus)
}
this._origClass="acRow";
this._selClass="acRow-selected";
this._showForgetTextClass="ForgetText";
this._hideForgetTextClass="ForgetText-hide";
this._hideSelForgetTextClass="ForgetText-hide-selected";
this._numChars=0;
this._done={};
this.setVisible(false);
this.setScrollStyle(Dwt.SCROLL)
};
ZmAutocompleteListView.prototype=new DwtComposite;
ZmAutocompleteListView.prototype.constructor=ZmAutocompleteListView;
ZmAutocompleteListView.DELIMS=[",",";","\n","\r","\t"];
ZmAutocompleteListView.DELIM_CODES=[188,59,186,3,13,9];
ZmAutocompleteListView.WAIT_ID="wait";
ZmAutocompleteListView.NEXT=-1;
ZmAutocompleteListView.PREV=-2;
ZmAutocompleteListView.onKeyDown=function(n){
n=DwtUiEvent.getEvent(n);
var e=null;
var i=DwtKeyEvent.getCharCode(n);
if(i==38||i==40){
ZmAutocompleteListView.__geckoKeyCode=null;
e=ZmAutocompleteListView._onKeyUp(n)
}else{
e=ZmAutocompleteListView._onKeyDown(n)
}
var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
var t=a&&DwtControl.ALL_BY_ID[a._aclvId];
if(t){
t._inputLength=a.value.length
}
if(t&&t._keyDownCallback){
var o=t._keyDownCallback.run(n,t,e);
e=(o===true||o===false)?o:e
}
return e
};
ZmAutocompleteListView.onKeyPress=function(n){
n=DwtUiEvent.getEvent(n);
DwtKeyEvent.geckoCheck(n);
var e=null;
var i=DwtKeyEvent.getCharCode(n);
if(AjxEnv.isGeckoBased&&(i==38||i==40)){
if(ZmAutocompleteListView.__geckoKeyCode){
e=ZmAutocompleteListView._onKeyUp(n)
}else{
ZmAutocompleteListView.__geckoKeyCode=i
}}
var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
var t=a&&DwtControl.ALL_BY_ID[a._aclvId];
if(t&&t._keyPressCallback){
var o=t._keyPressCallback.run(n,t);
e=(o===true||o===false)?o:e
}
return(e!=null)?e:ZmAutocompleteListView._echoKey(true,n)
};
ZmAutocompleteListView.onKeyUp=function(n){
n=DwtUiEvent.getEvent(n);
var i=DwtKeyEvent.getCharCode(n);
if(i==38||i==40){
ZmAutocompleteListView.__geckoKeyCode=null;
return true
}
var e=ZmAutocompleteListView._onKeyUp(n);
var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
var t=a&&DwtControl.ALL_BY_ID[a._aclvId];
if(t&&t._keyUpCallback){
var o=t._keyUpCallback.run(n,t,e);
e=(o===true||o===false)?o:e
}
return e
};
ZmAutocompleteListView._onKeyDown=function(i){
var a=DwtKeyEvent.getCharCode(i);
if(a==3||a==13){
var t=DwtUiEvent.getTargetWithProp(i,"_aclvId");
if(!t){
return ZmAutocompleteListView._echoKey(true,i)
}
var e=DwtControl.ALL_BY_ID[t._aclvId];
if(e&&e.getVisible()){
return ZmAutocompleteListView._echoKey(false,i)
}}
if(a==9||a==27){
return ZmAutocompleteListView._onKeyUp(i)
}else{
return ZmAutocompleteListView._echoKey(true,i)
}};
ZmAutocompleteListView._onKeyUp=function(i){
this._hasCompleted=false;
var t=DwtUiEvent.getTargetWithProp(i,"_aclvId");
if(!t){
return ZmAutocompleteListView._echoKey(true,i)
}
var a=DwtControl.ALL_BY_ID[t._aclvId];
var s=DwtKeyEvent.getCharCode(i);
if(AjxEnv.isIE&&i.type=="keyup"&&(s==9||s==27)){
return ZmAutocompleteListView._echoKey(true,i)
}
var n=t.value;
i.inputLengthChanged=(n.length!=a._inputLength);
if(a._acActionId!=-1&&!DwtKeyMap.IS_MODIFIER[s]){
AjxTimedAction.cancelAction(a._acActionId);
a._acActionId=-1
}
if(DwtKeyMap.IS_MODIFIER[s]||DwtKeyMapMgr.hasModifier(i)){
return ZmAutocompleteListView._echoKey(true,i)
}
if(!n){
a.reset();
return ZmAutocompleteListView._echoKey(true,i)
}
if(s==37||s==39){
return ZmAutocompleteListView._echoKey(true,i)
}
if((s==9||s==27)&&!a.size()){
return ZmAutocompleteListView._echoKey(true,i)
}
if(i.inputLengthChanged||(s==3||s==9||s==13)){
a._numChars++
}
var e=(a.getVisible()&&(a._numChars==1)&&(!i.shiftKey&&a._isDelimCode[s]));
if(e||(s==27||(a.getVisible()&&(s==38||s==40)))){
a.handleAction(s,e);
if(AjxEnv.isGeckoBased&&s==9){
a._focusAction.args=[t];
AjxTimedAction.scheduleAction(a._focusAction,0)
}
if((s==13||s==3)&&a._enterCallback){
var l=a._enterCallback.run(i);
return(l!=null)?l:ZmAutocompleteListView._echoKey(true,i)
}
return ZmAutocompleteListView._echoKey(false,i)
}
if(!i.inputLengthChanged&&(s!=3&&s!=13&&s!=9&&s!=8&&s!=46)){
return ZmAutocompleteListView._echoKey(true,i)
}
if(s==13||s==3){
var h=DwtShell.selectionEvent;
DwtUiEvent.copy(h,i);
h.detail=0;
a.notifyListeners(DwtEvent.SELECTION,h);
a.reset();
var l=null;
if(a._enterCallback){
l=a._enterCallback.run(i)
}
return(l!=null)?l:ZmAutocompleteListView._echoKey(true,i)
}
var o=new DwtKeyEvent();
DwtKeyEvent.copy(o,i);
o.aclv=a;
o.element=t;
a._acAction.obj=a;
a._acAction.args=[o];
a._acActionId=AjxTimedAction.scheduleAction(a._acAction,a._acInterval);
return ZmAutocompleteListView._echoKey(true,i)
};
ZmAutocompleteListView._echoKey=function(e,t){
DwtUiEvent.setBehaviour(t,!e,e);
return e
};
ZmAutocompleteListView._outsideMouseDownListener=function(t){
var e=ZmAutocompleteListView._activeAcList;
if(e.getVisible()){
var a=DwtControl.getTargetControl(t);
if(a!=e&&!a.isForgetText){
e.show(false);
t._stopPropagation=false;
t._returnValue=true
}}};
ZmAutocompleteListView.prototype.toString=function(){
return"ZmAutocompleteListView"
};
ZmAutocompleteListView.prototype.setActiveAccount=function(e){
this._activeAccount=e
};
ZmAutocompleteListView.prototype.handle=function(e){
e._aclvId=this._htmlElId;
Dwt.setHandler(e,DwtEvent.ONKEYDOWN,ZmAutocompleteListView.onKeyDown);
Dwt.setHandler(e,DwtEvent.ONKEYPRESS,ZmAutocompleteListView.onKeyPress);
Dwt.setHandler(e,DwtEvent.ONKEYUP,ZmAutocompleteListView.onKeyUp)
};
ZmAutocompleteListView.prototype.autocomplete=function(t){
if(!t||(t.text=="undefined")){
return
}
if(this._dataLoader&&!this._dataLoaded){
this._data=this._dataLoader.call(this._dataClass);
this._dataAPI=this._data;
this._dataLoaded=true
}
var a=new AjxCallback(this,this.autocomplete);
if(t.start<t.text.length){
var e=this._nextChunk(t.text,t.start);
this._autocomplete(e,a)
}else{
if(t.change){
this._updateField(t.text,t.match)
}}};
ZmAutocompleteListView.prototype.reset=function(){
this._matches=null;
this._matchHash={};
this._canForget={};
this._selected=null;
this.show(false)
};
ZmAutocompleteListView.prototype.handleAction=function(t,e){
if(e){
this._update(true)
}else{
if(t==38||t==40){
if(this.size()<=1){
return
}
if(t==40){
this._setSelected(ZmAutocompleteListView.NEXT)
}else{
if(t==38){
this._setSelected(ZmAutocompleteListView.PREV)
}}}else{
if(t==27){
this.reset()
}}}};
ZmAutocompleteListView.prototype.setWaiting=function(t){
if(t&&!this._waitingRow){
if(!this.size()){
this.show(true)
}
var i=this._getTable();
var o=this._waitingRow=i.insertRow(-1);
var e=o.insertCell(-1);
e.innerHTML="<div class='DwtWait16Icon'></div>";
e=o.insertCell(-1);
e.innerHTML=ZmMsg.autocompleteWaiting;
e=o.insertCell(-1);
e.innerHTML="&nbsp;"
}else{
var a=new AjxTimedAction(this,this._clearWaiting);
AjxTimedAction.scheduleAction(a,1000)
}};
ZmAutocompleteListView.prototype._autocompleteAction=function(a){
var t=a.element;
var e=a.aclv;
e._acActionId=-1;
e._numChars=0;
e.reset();
e._element=t;
var i={
text:t.value,start:0};
e.autocomplete(i)
};
ZmAutocompleteListView.prototype.show=function(e,t){
if(e){
this._popup(t)
}else{
this._hasCompleted=false;
this._popdown()
}};
ZmAutocompleteListView.prototype._nextChunk=function(o,s){
while(o.charAt(s)==" "){
s++
}
var e=false;
for(var a=s;
a<o.length;
a++){
var n=o.charAt(a);
if(n=='"'){
n=o.charAt(++a);
while(a<o.length&&n!='"'){
n=o.charAt(++a)
}}
if(this._isDelim[n]){
var t=o.substring(s,a);
if(this._dataAPI.isComplete&&this._dataAPI.isComplete(t)){
s=a+1;
while(o.charAt(s)==" "){
s++
}}else{
return{
text:o,str:t,start:s,end:a,delim:true}
}}}
var t=o.substring(s,a);
return{
text:o,str:t,start:s,end:a,delim:false}
};
ZmAutocompleteListView.prototype._autocomplete=function(e,n){
if(!e||!(this._dataAPI&&this._dataAPI.autocompleteMatch)){
return
}
var a=AjxStringUtil.trim(e.str);
if(!(a&&a.length)||(this._done[a])){
if(n){
n.run({
text:e.text,start:e.end+1}
);
return
}else{
return{
text:e.text,start:e.end+1}
}}
this._start=e.start;
this._end=e.end;
var t=e.text;
var o=e.end;
this._removeAll();
var i=new AjxCallback(this,this._handleResponseAutocomplete,[a,e,t,o,n]);
this._dataAPI.autocompleteMatch(a,i,this,this._options,this._activeAccount)
};
ZmAutocompleteListView.prototype._handleResponseAutocomplete=function(o,s,l,e,h,i){
var t;
var n=false;
if(!t){
if(i&&i.length){
this._set(i)
}
var a;
if(s&&s.delim&&(s.end==s.text.length-1)){
var c=this._complete(l,o,true);
if(c){
l=c.text;
e=c.start;
a=c.match;
n=true
}}else{
if(i&&i.length){
if(!this._hasCompleted){
this.show(true)
}}}
t={
text:l,start:e,match:a,change:n}
}
if(h){
h.run(t)
}};
ZmAutocompleteListView.prototype._complete=function(d,l,t){
var s=this._matchHash[this._selected];
if(!s&&l&&t&&this._dataAPI.quickComplete){
s=this._dataAPI.quickComplete(l)
}
if(!s){
return
}
var e=this._start;
var a=t?this._end+1:this._end;
var c="";
if(this._matchValue instanceof Array){
for(var o=0,h=this._matchValue.length;
o<h;
o++){
if(s[this._matchValue[o]]){
c=s[this._matchValue[o]];
break
}}}else{
c=s[this._matchValue]||""
}
var n=[d.substring(0,e),c,this._separator,d.substring(a,d.length)].join("");
if(c){
this._done[c]=true
}
return{
text:n,start:e+c.length+this._separator.length,match:s}
};
ZmAutocompleteListView.prototype._updateField=function(a,e){
var t=this._element;
t.value=a;
t.focus();
Dwt.setSelectionRange(t,a.length,a.length);
this.reset();
this._hasCompleted=true;
if(this._compCallback){
this._compCallback.run(a,t,e)
}};
ZmAutocompleteListView.prototype._update=function(t){
var e=this._complete(this._element.value,null,t);
if(e){
this._updateField(e.text,e.match)
}};
ZmAutocompleteListView.prototype._mouseDownListener=function(e){
e=DwtUiEvent.getEvent(e);
var a=DwtUiEvent.getTargetWithProp(e,"id");
if(!a||!a.id){
return
}
if(e.button==DwtMouseEvent.LEFT){
this._setSelected(a.id);
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var t=DwtShell.selectionEvent;
DwtUiEvent.copy(t,e);
t.detail=0;
this.notifyListeners(DwtEvent.SELECTION,t);
return true
}}};
ZmAutocompleteListView.prototype._mouseOverListener=function(e){
e=DwtUiEvent.getEvent(e);
var t=Dwt.findAncestor(DwtUiEvent.getTarget(e),"id");
if(t){
this._setSelected(t.id)
}
return true
};
ZmAutocompleteListView.prototype._addSelectionListener=function(e){
this._eventMgr.addListener(DwtEvent.SELECTION,e)
};
ZmAutocompleteListView.prototype._listSelectionListener=function(e){
this._update(true)
};
ZmAutocompleteListView.prototype._getTable=function(){
var a=this._tableId&&document.getElementById(this._tableId);
if(!a){
var t=[],e=0;
this._tableId=Dwt.getNextId();
t[e++]="<table id='"+this._tableId+"' cellpadding=0 cellspacing=0 border=0>";
t[e++]="</table>";
this.getHtmlElement().innerHTML=t.join("");
a=document.getElementById(this._tableId)
}
return a
};
ZmAutocompleteListView.prototype._set=function(s){
var c=this._getTable();
this._matches=s;
var n=this._matches.length;
for(var t=0;
t<n;
t++){
var o=this._matches[t];
if(o&&(o.text||o.icon)){
var e=o.id=this._getId("Row",t);
this._matchHash[e]=o;
var d=c.insertRow(-1);
d.className=this._origClass;
d.id=e;
var a=[],h=0;
var l=d.insertCell(-1);
l.className="Icon";
if(o.icon){
l.innerHTML=(o.icon.indexOf("Dwt")!=-1)?["<div class='",o.icon,"'></div>"].join(""):AjxImg.getImageHtml(o.icon)
}else{
l.innerHTML="&nbsp;"
}
l=d.insertCell(-1);
l.innerHTML=o.text||"&nbsp;";
if(this._options.supportForget!==false){
this._canForget[e]=o.canForget;
l=d.insertCell(-1);
l.className="Forget";
l.innerHTML=o.canForget?"<a id='"+this._getId("Forget",t)+"'></a>":""
}}}
this._addForgetLinks();
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
this._setSelected(this._getId("Row",0))
}
),100)
};
ZmAutocompleteListView.prototype._getId=function(t,e){
return[this._htmlElId,"ac"+t,e].join("_")
};
ZmAutocompleteListView.prototype._addForgetLinks=function(){
this._rowForgetHash={};
var e=this._matches.length;
for(var a=0;
a<e;
a++){
var t=this._matches[a];
var h=t.id=this._getId("Row",a);
var o=this._getId("Forget",a);
var s=document.getElementById(o);
if(s){
var l=new DwtText({
parent:this,className:this._hideForgetTextClass}
);
this._rowForgetHash[h]=l;
l.isForgetText=true;
l.setText(ZmMsg.forget);
l.setToolTipContent(ZmMsg.forgetTooltip);
var n=new AjxListener(this,this._handleForgetLink,[t.email,h]);
l.addListener(DwtEvent.ONMOUSEDOWN,n);
l.reparentHtmlElement(s)
}}};
ZmAutocompleteListView.prototype._showForgetLink=function(a,t){
var e=this._rowForgetHash&&this._rowForgetHash[a];
if(e){
e.setClassName(!t?this._hideForgetTextClass:this._canForget[a]?this._showForgetTextClass:this._hideSelForgetTextClass)
}};
ZmAutocompleteListView.prototype._popup=function(a){
var i=this.shell.getSize().y;
var o=Dwt.getLocation(this._element);
var c=Dwt.getSize(this._element);
var h=o.x;
var n=o.y+c.y;
var l=i-n;
var s=this.size()*this._getRowHeight();
this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this.setVisible(true);
var e=this.getSize();
if(l<s){
this.setSize(Dwt.DEFAULT,l-(AjxEnv.isIE?30:10));
var t=this.getHtmlElement();
if(t.clientWidth!=t.scrollWidth){
this.setSize(e.x+Dwt.SCROLLBAR_WIDTH,Dwt.DEFAULT)
}}else{
if(e.y<s){
this.setSize(Dwt.CLEAR,s)
}}
this.setLocation(h,n);
this.setVisible(true);
this.setZIndex(Dwt.Z_DIALOG_MENU);
ZmAutocompleteListView._activeAcList=this;
DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,ZmAutocompleteListView._outsideMouseDownListener);
this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN]);
this.shell.addListener(DwtEvent.ONMOUSEDOWN,this._outsideListener)
};
ZmAutocompleteListView.prototype._popdown=function(){
this.setZIndex(Dwt.Z_HIDDEN);
this.setVisible(false);
ZmAutocompleteListView._activeAcList=null;
DwtEventManager.removeListener(DwtEvent.ONMOUSEDOWN,ZmAutocompleteListView._outsideMouseDownListener);
this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN],true);
this.shell.removeListener(DwtEvent.ONMOUSEDOWN,this._outsideListener)
};
ZmAutocompleteListView.prototype._setSelected=function(e){
if(e==this._selected){
return
}
var h=document.getElementById(this._tableId);
var c=h&&h.rows;
if(!(c&&c.length)){
return
}
var a=c.length;
var s=-1;
if(e==ZmAutocompleteListView.NEXT||e==ZmAutocompleteListView.PREV){
if(a<=1){
return
}
for(var t=0;
t<a;
t++){
if(c[t].id==this._selected){
s=t;
break
}}
var n=(e==ZmAutocompleteListView.PREV)?s-1:s+1;
if(n<0||n>=a){
return
}
e=c[n].id
}
DwtControl._scrollIntoView(c[n],this.getHtmlElement());
for(var t=0;
t<a;
t++){
var l=c[t];
var o=l.className;
if(l.id==e){
l.className=this._selClass
}else{
if(o!=this._origClass){
l.className=this._origClass
}}}
this._showForgetLink(this._selected,false);
this._showForgetLink(e,true);
this._selected=e
};
ZmAutocompleteListView.prototype._getRowHeight=function(){
if(!this._rowHeight){
if(!ZmAutocompleteListView._activeAcList){
this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this.setVisible(true)
}
var e=this._getTable().rows[0];
this._rowHeight=e&&Dwt.getSize(e).y
}
return this._rowHeight||18
};
ZmAutocompleteListView.prototype._removeAll=function(){
this._matches=null;
var n=this._getTable();
for(var o=n.rows.length-1;
o>=0;
o--){
var s=n.rows[o];
if(s!=this._waitingRow){
n.deleteRow(o)
}}
if(this._rowForgetHash){
var a=AjxUtil.values(this._rowForgetHash);
for(var o=0,t=a.length;
o<t;
o++){
var e=a[o];
DwtControl.ALL_BY_ID[e]=null;
delete DwtControl.ALL_BY_ID[e]
}}};
ZmAutocompleteListView.prototype.size=function(){
return this._getTable().rows.length
};
ZmAutocompleteListView.prototype._autocompleteFocus=function(e){
e.focus()
};
ZmAutocompleteListView.prototype._getAcListLoc=function(a){
var t=a.element;
var i=Dwt.getLocation(t);
var e=Dwt.getSize(t).y;
return(new DwtPoint(i.x,i.y+e))
};
ZmAutocompleteListView.prototype._clearWaiting=function(){
if(this._waitingRow&&this._waitingRow.parentNode){
this._waitingRow.parentNode.removeChild(this._waitingRow)
}
this._waitingRow=null;
if(!this.size()){
this.show(false)
}};
ZmAutocompleteListView.prototype._settingChangeListener=function(e){
if(e.type!=ZmEvent.S_SETTING){
return
}
if(e.source.id==ZmSetting.AUTOCOMPLETE_ON_COMMA){
this._isDelim[","]=this._isDelimCode[188]=appCtxt.get(ZmSetting.AUTOCOMPLETE_ON_COMMA)
}};
ZmAutocompleteListView.prototype._handleForgetLink=function(e,t){
if(this._dataAPI.forget){
this._dataAPI.forget(e,new AjxCallback(this,this._handleResponseForget,[t,e]))
}};
ZmAutocompleteListView.prototype._handleResponseForget=function(t,e){
var i=document.getElementById(t);
if(i){
i.parentNode.removeChild(i);
var a=AjxMessageFormat.format(ZmMsg.forgetSummary,[e]);
appCtxt.setStatusMsg(a)
}}
}
if(AjxPackage.define("zimbraMail.share.view.assistant.ZmAssistant")){
ZmAssistant=function(o,i,t){
if(arguments.length==0){
return
}
this._objectManager=new ZmObjectManager();
try{
if(window.ZmDate10ObjectHandler){
this._objectManager.addHandler(new ZmDate10ObjectHandler(),ZmObjectManager.DATE,100)
}}
catch(a){}
this._fields={};
this._title=o;
this._commandSummary=t?t:o;
this._command=i
};
ZmAssistant.prototype.constructor=ZmAssistant;
ZmAssistant._handlers={};
ZmAssistant._commands=[];
ZmAssistant._allCommands=[];
ZmAssistant.register=function(t,e){
if(e==null){
e=t.getCommand()
}
if(e in ZmAssistant._handlers){
return
}
ZmAssistant._handlers[e]=t;
ZmAssistant._allCommands.push(e);
ZmAssistant._allCommands.sort();
if(e.substring(0,1)!="."){
ZmAssistant._commands.push(e);
ZmAssistant._commands.sort()
}};
ZmAssistant.matchWord=function(a,o){
if(o==null){
o=ZmAssistant._allCommands
}
var t;
var e=[];
for(t in o){
var s=o[t];
if(s==a){
return[s]
}else{
if(s.substring(0,a.length)==a){
e.push(s)
}}}
return e
};
ZmAssistant.getHandler=function(e){
return ZmAssistant._handlers[e]
};
ZmAssistant.getHandlerCommands=function(){
return ZmAssistant._commands
};
ZmAssistant.prototype.initialize=function(t){
var e=new AjxBuffer();
this._tableId=Dwt.getNextId();
e.append("<table cellspacing='3' border='0' width='100%'><tbody id='",this._tableId,"'>");
e.append("</tbody></table>");
t.setAssistantContent(e.toString())
};
ZmAssistant.prototype.finish=function(e){
this._clearFields()
};
ZmAssistant.prototype.getTitle=function(){
return this._title
};
ZmAssistant.prototype.getCommand=function(){
return this._command
};
ZmAssistant.prototype.getCommandSummary=function(){
return this._commandSummary
};
ZmAssistant.prototype.handle=function(t,a,e){};
ZmAssistant.prototype.okHandler=function(e){
return true
};
ZmAssistant.prototype.getHelp=function(){
return null
};
ZmAssistant.prototype.extraButtonHandler=function(e){
return true
};
ZmAssistant.prototype._matchTime=function(a){
var e,o,t=null;
var n=a.match(/\s*(?:(?:@|at|\-)\s*)?(\d+):(\d\d)(?:\s*(AM|PM))?\s*/i);
var i=a.match(/\s*(?:(?:@|at|\-)\s*)?(\d+)(AM|PM)\s*/i);
if(n&&i){
if(n.index<i.index){
i=null
}else{
n=null
}}
if(n){
e=parseInt(n[1]);
o=parseInt(n[2]);
if(n[3]){
t=n[3].toLowerCase()
}
a=a.replace(n[0]," ")
}else{
if(i){
e=parseInt(i[1]);
o=0;
t=i[2].toLowerCase();
a=a.replace(i[0]," ")
}else{
return null
}}
if(t=="pm"&&e<12){
e+=12
}else{
if(t=="am"&&e==12){
e=0
}}
return{
hour:e,minute:o,args:a}
};
ZmAssistant._BRACKETS="ZmAssistantBrackets";
ZmAssistant._PARENS="ZmAssistantParens";
ZmAssistant.prototype._matchTypedObject=function(n,t,a){
var i;
var l=0;
if(t==ZmAssistant._BRACKETS){
i=n.match(/\s*\[([^\]]*)\]?\s*/);
l=1
}else{
i=this._objectManager.findMatch(n,t)
}
if(!i){
return null
}
var s=a.defaultType;
var e=null;
if(i.index>0){
var o=n.substring(0,i.index);
e=o.match(/\b(\w+):\s*$/i);
if(e){
s=e[1].toLowerCase()
}}
if(e){
n=n.replace(e[0]+i[0]," ")
}else{
n=n.replace(i[0]," ")
}
if(a.aliases){
var h=a.aliases[s];
if(h){
s=h
}}
return{
data:i[l],args:n,type:s}
};
ZmAssistant.prototype._clearField=function(a){
var t=this._fields[a];
if(t){
var e=document.getElementById(t.rowId);
if(e){
e.parentNode.removeChild(e)
}
delete this._fields[a]
}};
ZmAssistant.prototype._setOptField=function(n,i,a,o,t,e){
if(i&&i!=""){
return this._setField(n,i,a,o,t,e)
}else{
this._clearField(n);
return -1
}};
ZmAssistant.prototype._setField=function(u,f,o,h,c,n){
var s=o?"ZmAsstFieldDefValue":"ZmAsstField";
var l=-1;
var t=this._fields[u];
if(h){
f=AjxStringUtil.htmlEncode(f)
}
if(t){
var i=document.getElementById(t.rowId);
if(i){
l=i.rowIndex
}
var p=document.getElementById(t.id);
p.innerHTML=f;
p.className=s
}else{
var e=Dwt.getNextId();
if(c!=null){
l=c
}
var a=document.getElementById(this._tableId);
var g=a.insertRow(l);
g.id=Dwt.getNextId();
var m=g.insertCell(-1);
m.vAlign=n?n:"top";
m.className="ZmAsstFieldLabel";
m.innerHTML=AjxStringUtil.htmlEncode(u+":");
var d=g.insertCell(-1);
d.innerHTML="<div id='"+e+"' class='"+s+"'>"+f+"</div></td>";
this._fields[u]={
id:e,rowId:g.id};
l=g.rowIndex
}
return l
};
ZmAssistant.prototype._clearFields=function(){
for(var e in this._fields){
this._clearField(e)
}}
}
if(AjxPackage.define("zimbraMail.share.view.htmlEditor.ZmHtmlEditor")){
ZmHtmlEditor=function(i,a,o,s,e){
if(arguments.length==0){
return
}
this._toolbars=[];
this.ACE_ENABLED=!!e;
this.ACE_DEBUG=false;
if(this.ACE_ENABLED){
this._ace_componentsLoading=0
}
DwtHtmlEditor.call(this,{
parent:i,className:"ZmHtmlEditor",posStyle:a,content:o,mode:s,blankIframeSrc:appContextPath+"/public/blank.html"}
);
this.addStateChangeListener(new AjxListener(this,this._rteStateChangeListener));
var t=appCtxt.getSettings();
var n=new AjxListener(this,this._settingChangeListener);
t.getSetting(ZmSetting.COMPOSE_INIT_FONT_COLOR).addChangeListener(n);
t.getSetting(ZmSetting.COMPOSE_INIT_FONT_FAMILY).addChangeListener(n);
t.getSetting(ZmSetting.COMPOSE_INIT_FONT_SIZE).addChangeListener(n);
this._ignoreWords={}
};
ZmHtmlEditor.prototype=new DwtHtmlEditor;
ZmHtmlEditor.prototype.constructor=ZmHtmlEditor;
ZmHtmlEditor._VALUE="value";
ZmHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
ZmHtmlEditor.__makeFontName=function(e){
return e.replace(/,.*/,"").replace(/\b[a-z]/g,ZmHtmlEditor.__toUpperCase)
};
ZmHtmlEditor.__toUpperCase=function(e){
return e.toUpperCase()
};
ZmHtmlEditor.FONT_FAMILY={};
(function(){
var e=["fontFamilyIntl","fontFamilyBase"];
var n,a,o,s,t;
for(a=0;
a<e.length;
a++){
for(n=1;
s=AjxMsg[e[a]+n+".css"];
n++){
if(s.match(/^#+$/)){
break
}
t=AjxMsg[e[a]+n+".display"];
ZmHtmlEditor.FONT_FAMILY[s]={
name:t,value:s}
}}}
)();
ZmHtmlEditor.ACE_IFRAME_RE=new RegExp("<iframe\\s+.*?\\bid\\s*=\\s*[\"']?(ace-[^\"'\\s]*).*?>.*?</iframe(\\s.*?)?>","ig");
ZmHtmlEditor.prototype.toString=function(){
return"ZmHtmlEditor"
};
ZmHtmlEditor.prototype.isHtmlEditingSupported=function(){
var e=DwtHtmlEditor.prototype.isHtmlEditingSupported.call(this);
if(e){
e=appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)
}
return e
};
ZmHtmlEditor.prototype.setContent=function(e){
DwtHtmlEditor.prototype.setContent.apply(this,arguments);
this._ignoreWords={}
};
ZmHtmlEditor.prototype.setMode=function(o,a){
this.discardMisspelledWords();
DwtHtmlEditor.prototype.setMode.call(this,o,a);
if(o==DwtHtmlEditor.HTML){
this._createToolbars()
}
for(var e=0;
e<this._toolbars.length;
e++){
var t=this._toolbars[e];
t.setVisible(o==DwtHtmlEditor.HTML)
}
appCtxt.notifyZimlets("on_htmlEditor_setMode",[this,o])
};
ZmHtmlEditor.prototype.getBodyFieldId=function(){
return this._mode==DwtHtmlEditor.HTML?this._iFrameId:this._textAreaId
};
ZmHtmlEditor.prototype.getTextVersion=function(e){
return this._mode==DwtHtmlEditor.HTML?this._convertHtml2Text(e):this.getContent()
};
ZmHtmlEditor.prototype.reEnableDesignMode=function(){
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
this._enableDesignMode(this._getIframeDoc())
}};
ZmHtmlEditor.prototype.addEventCallback=function(e){
this._eventCallback=e
};
ZmHtmlEditor.prototype._onContentInitialized=function(){
DwtHtmlEditor.prototype._onContentInitialized.call(this);
this._loadExternalStyle("/css/editor.css");
this._setFontStyles();
if(this.ACE_ENABLED&&this._mode==DwtHtmlEditor.HTML){
setTimeout(AjxCallback.simpleClosure(this._deserializeAceObjects,this),100)
}
if(this._onContentInitializeCallback){
this._onContentInitializeCallback.run()
}};
ZmHtmlEditor.prototype.addOnContentIntializedListener=function(e){
this._onContentInitializeCallback=e
};
ZmHtmlEditor.prototype.removeOnContentIntializedListener=function(){
this._onContentInitializeCallback=null
};
ZmHtmlEditor.prototype.getContent=function(e,a){
this.discardMisspelledWords();
var i;
if(this._mode==DwtHtmlEditor.HTML){
var o=this._getIframeDoc();
var t=this._pendingContent||(o&&o.body?(this._getIframeDoc().body.innerHTML):"");
i=this._embedHtmlContent(t,e,a);
if(this.ACE_ENABLED){
i=this._serializeAceObjects(i)
}}else{
i=document.getElementById(this._textAreaId).value
}
return i
};
ZmHtmlEditor.prototype.checkMisspelledWords=function(o,t,e){
var i=this.getTextVersion();
if(/\S/.test(i)){
AjxDispatcher.require("Extras");
this._spellChecker=new ZmSpellChecker(this);
this._spellCheck=null;
this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
if(!this.onExitSpellChecker){
this.onExitSpellChecker=t
}
var a={
text:i,ignore:AjxUtil.keys(this._ignoreWords).join()};
this._spellChecker.check(a,o,e);
return true
}
return false
};
ZmHtmlEditor.prototype.spellCheck=function(a){
var t=this.getTextVersion();
if(/\S/.test(t)){
AjxDispatcher.require("Extras");
this._spellChecker=new ZmSpellChecker(this);
this._spellCheck=null;
this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
if(!this.onExitSpellChecker){
this.onExitSpellChecker=a
}
var e={
text:t,ignore:AjxUtil.keys(this._ignoreWords).join()};
this._spellChecker.check(e,new AjxCallback(this,this._spellCheckCallback));
return true
}
return false
};
ZmHtmlEditor.prototype.resetSpellCheck=function(){
this.discardMisspelledWords();
this._spellCheckHideModeDiv()
};
ZmHtmlEditor.prototype.discardMisspelledWords=function(c){
if(!this._spellCheck){
return
}
if(this._mode==DwtHtmlEditor.HTML){
var s=this._getIframeDoc();
s.body.style.display="none";
var t=null;
var h=this._spellCheck.spanIds;
for(var n in h){
var l=s.getElementById(n);
if(!l){
continue
}
t=l.parentNode;
while(l.firstChild){
t.insertBefore(l.firstChild,l)
}
t.removeChild(l)
}
if(!AjxEnv.isIE){
s.body.normalize()
}else{
s.body.innerHTML=s.body.innerHTML
}
t=s.getElementById("ZM-SPELLCHECK-STYLE");
if(t){
t.parentNode.removeChild(t)
}
s.body.style.display="";
this._unregisterEditorEventHandler(s,"contextmenu")
}else{
if(this._spellCheckDivId!=null){
var e=document.getElementById(this._spellCheckDivId);
var o=e.scrollTop;
var a=document.getElementById(this._textAreaId);
if(AjxEnv.isGeckoBased){
e.innerHTML=AjxStringUtil.htmlDecode(e.innerHTML,true)
}
a.value=AjxUtil.getInnerText(e);
e.onclick=null;
e.oncontextmenu=null;
e.onmousedown=null;
e.parentNode.removeChild(e);
a.style.display="";
a.scrollTop=o
}}
this._spellCheckDivId=this._spellCheck=null;
window.status="";
if(!c){
this._spellCheckHideModeDiv()
}
if(this.onExitSpellChecker){
this.onExitSpellChecker.run()
}};
ZmHtmlEditor.prototype._resetFormatControls=function(){
this._resetFormatControlDefaults();
setTimeout(AjxCallback.simpleClosure(this._loadExternalStyle,this,"/css/editor.css"),250);
setTimeout(AjxCallback.simpleClosure(this._setFontStyles,this),250)
};
ZmHtmlEditor.prototype._resetFormatControlDefaults=function(){
this._fontFamilyButton.setText(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY));
this._fontSizeButton.setText(this._getFontSizeLabel(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE)));
this._fontColorButton.setColor(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR));
this._styleMenu.checkItem(ZmHtmlEditor._VALUE,DwtHtmlEditor.PARAGRAPH,true);
this._justifyMenu.checkItem(ZmHtmlEditor._VALUE,DwtHtmlEditor.JUSTIFY_LEFT,true)
};
ZmHtmlEditor.prototype._loadExternalStyle=function(n){
var o=this._getIframeDoc();
var a=o.getElementById(n);
if(!a){
a=o.createElement("link");
a.id=n;
a.rel="stylesheet";
a.type="text/css";
var i=appContextPath+n+"?v="+cacheKillerVersion;
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
i=document.baseURI.replace(/^(https?:\x2f\x2f[^\x2f]+).*$/,"$1")+i
}
var e=DBG&&DBG.getDebugLevel();
if(e){
i=i+"&debug="+e
}
a.href=i;
var t=o.getElementsByTagName("head")[0];
if(!t){
t=o.createElement("head");
var s=o.documentElement;
if(s){
s.insertBefore(t,s.firstChild)
}}
t.appendChild(a)
}};
ZmHtmlEditor.prototype._setFontStyles=function(){
var t=this._getIframeDoc();
var e=t.body&&t.body.style;
if(e){
e.fontFamily=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
e.fontSize=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
e.color=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR)
}};
ZmHtmlEditor.prototype.highlightMisspelledWords=function(u,t){
this.discardMisspelledWords(t);
var y,p,w,o,d=this,n={}
,m={}
,v=["([^A-Za-z0-9']|^)("],l={};
for(var f=0;
f<u.length;
++f){
y=u[f].word;
if(!l[y]){
f&&v.push("|");
v.push(y);
var b=u[f].suggestions.split(/\s*,\s*/);
if(!b[b.length-1]){
b.pop()
}
l[y]=b;
if(l[y].length>5){
l[y].length=5
}}}
v.push(")([^A-Za-z0-9']|$)");
v=new RegExp(v.join(""),"gm");
function h(z,O){
z=O?AjxStringUtil.convertToHtml(z):AjxStringUtil.htmlEncode(z);
var k;
v.lastIndex=0;
while(k=v.exec(z)){
var j=k[0];
var x=k[1];
var a=k[2];
var T=k[3];
var i=Dwt.getNextId();
n[i]=a;
if(!m[a]){
m[a]=[]
}
m[a].push(i);
var q=[x,'<span word="',a,'" id="',i,'" class="ZM-SPELLCHECK-MISSPELLED">',a,"</span>",T].join("");
z=[z.substr(0,k.index),q,z.substr(k.index+j.length)].join("");
v.lastIndex=k.index+q.length-T.length
}
return z
}
var w;
rec=function(z){
switch(z.nodeType){
case 1:for(var j=z.firstChild;
j;
j=rec(j)){}
z=z.nextSibling;
break;
case 3:if(!/[^\s\xA0]/.test(z.data)){
z=z.nextSibling;
break
}
var q=null,x=null;
var k=/^[\s\xA0]+/.exec(z.data);
if(k){
q=z;
z=z.splitText(k[0].length)
}
k=/[\s\xA0]+$/.exec(z.data);
if(k){
x=z.splitText(z.data.length-k[0].length)
}
var O=h(z.data,false);
O=O.replace(/^ +/,"&nbsp;").replace(/ +$/,"&nbsp;");
var A=w.createElement("div");
A.innerHTML=O;
if(q){
A.insertBefore(q,A.firstChild)
}
if(x){
A.appendChild(x)
}
var T=z.parentNode;
while(A.firstChild){
T.insertBefore(A.firstChild,z)
}
A=z.nextSibling;
T.removeChild(z);
z=A;
break;
default:z=z.nextSibling
}
return z
};
if(this._mode==DwtHtmlEditor.HTML){
w=this._getIframeDoc();
o=w.body;
this._loadExternalStyle("/css/spellcheck.css");
o.style.display="none";
if(!AjxEnv.isIE){
o.normalize()
}else{
o.innerHTML=o.innerHTML
}
rec(o);
if(!AjxEnv.isIE){
o.normalize()
}else{
o.innerHTML=o.innerHTML
}
o.style.display="";
this._registerEditorEventHandler(w,"contextmenu")
}else{
var g=document.getElementById(this._textAreaId);
var e=g.scrollTop;
var c=Dwt.getSize(g);
g.style.display="none";
var s=document.createElement("div");
s.className="TextSpellChecker";
this._spellCheckDivId=s.id=Dwt.getNextId();
s.style.overflow="auto";
if(!AjxEnv.isIE){
c.x-=4;
c.y-=6
}
s.style.width=c.x+"px";
s.style.height=c.y+"px";
s.innerHTML=AjxStringUtil.convertToHtml(this.getContent());
w=document;
rec(s);
g.parentNode.insertBefore(s,g);
s.scrollTop=e;
s.oncontextmenu=s.onclick=function(a){
d._handleSpellCheckerEvents(a||window.event)
}
}
this._spellCheckShowModeDiv();
this._spellCheck={
suggestions:l,spanIds:n,wordIds:m}
};
ZmHtmlEditor.prototype.setSize=function(t,l){
var h=this._spellCheckDivId&&document.getElementById(this._spellCheckDivId);
var e=document.getElementById(this.getBodyFieldId());
var s=this._mode==DwtHtmlEditor.HTML?8:10;
if(t==Dwt.CLEAR){
e.style.width=null;
if(h){
h.style.width=null
}}else{
if(t==Dwt.DEFAULT){
e.style.width="auto";
if(h){
h.style.width="auto"
}}else{
if(typeof(t)=="number"){
t-=s+4;
if(t<0){
t=0
}
e.style.width=t+5+"px";
if(h){
if(!AjxEnv.isIE){
t=t>4?(t-4):t
}
h.style.width=t+"px"
}}}}
if(l==Dwt.CLEAR){
e.style.height=null;
if(h){
h.style.height=null
}}else{
if(l==Dwt.DEFAULT){
e.style.height="auto";
if(h){
h.style.height="auto"
}}else{
if(typeof(l)=="number"){
if(this._spellCheckModeDivId){
var a=document.getElementById(this._spellCheckModeDivId).offsetHeight;
l-=(isNaN(a)?0:a)
}
if(this._mode==DwtHtmlEditor.HTML&&this._toolbars.length>0){
for(var o=0;
o<this._toolbars.length;
o++){
var n=this._toolbars[o];
l-=n.getHtmlElement().offsetHeight
}}
l-=s;
if(l<0){
l=0
}
e.style.height=l+"px";
if(h){
if(!AjxEnv.isIE){
l=l>4?(l-4):l
}else{
l+=2
}
h.style.height=l+"px"
}}}}};
ZmHtmlEditor.prototype._initialize=function(){
if(this._mode==DwtHtmlEditor.HTML){
this._createToolbars()
}
DwtHtmlEditor.prototype._initialize.call(this)
};
ZmHtmlEditor.prototype._styleListener=function(e){
this.setStyle(e.item.getData(ZmHtmlEditor._VALUE))
};
ZmHtmlEditor.prototype._fontFamilyListener=function(e){
var t=e.item.getData(ZmHtmlEditor._VALUE);
this.setFont(ZmHtmlEditor.FONT_FAMILY[t].value);
this._fontFamilyButton.setText(ZmHtmlEditor.FONT_FAMILY[t].name)
};
ZmHtmlEditor.prototype._fontSizeListener=function(e){
this.setFont(null,null,e.item.getData(ZmHtmlEditor._VALUE))
};
ZmHtmlEditor.prototype._indentListener=function(e){
this.setIndent(e.item.getData(ZmHtmlEditor._VALUE))
};
ZmHtmlEditor.prototype._insertLinkListener=function(){
var o=this._insertLinkDialog;
if(!o){
o=this._insertLinkDialog=new DwtDialog({
parent:DwtShell.getShell(window),title:ZmMsg.linkProperties}
);
var n=o.base_id=Dwt.getNextId();
var a=AjxTemplate.expand("share.Dialogs#EditorInsertLink",{
id:n}
);
o.setContent(a);
o.linkText=new DwtInputField({
parent:o,size:40,parentElement:n+"_linkTextCont"}
);
o.linkTarget=new DwtInputField({
parent:o,size:40,parentElement:n+"_linkTargetCont"}
);
function e(){
var s=o.linkTarget.getValue();
if(s&&!/^(https?|ftp):\x2f\x2f/i.test(s)){
s="http://"+s;
o.linkTarget.setValue(s)
}
return s
}
var t=new DwtButton({
parent:o,parentElement:n+"_testBtnCont"}
);
t.setText(ZmMsg.testUrl);
t.setToolTipContent(ZmMsg.testUrlTooltip);
t.addSelectionListener(new AjxListener(this,function(){
var s=e();
if(s){
window.open(s)
}}
));
o._tabGroup.addMember(o.linkText,0);
o._tabGroup.addMember(o.linkTarget,1);
o._tabGroup.addMember(t,2);
o.registerCallback(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
var h=e();
var s=this.getNearestElement("img");
var l=o.linkText.getValue()||h;
if(s){
var l=o.linkText.getValue()
}
o.popdown();
this.insertLink({
text:l,url:h}
)
}
))
}
var i=this.getLinkProps();
o.linkText.setValue(i.text||"");
o.linkTarget.setValue(i.url||"");
o.popup();
if(/\S/.test(i.text)){
o.linkTarget.focus()
}else{
o.linkText.focus()
}};
ZmHtmlEditor.prototype._insElementListener=function(e){
this.insertElement(e.item.getData(ZmHtmlEditor._VALUE))
};
ZmHtmlEditor.prototype._justificationListener=function(e){
this.setJustification(e.item.getData(ZmHtmlEditor._VALUE))
};
ZmHtmlEditor.prototype._fontStyleListener=function(e){
this.setFont(null,e.item.getData(ZmHtmlEditor._VALUE))
};
ZmHtmlEditor.prototype._fontColorListener=function(e){
this.setFont(null,null,null,e.detail||"#000000")
};
ZmHtmlEditor.prototype._fontHiliteListener=function(e){
this.setFont(null,null,null,null,e.detail||"#ffffff")
};
ZmHtmlEditor.prototype._createToolbars=function(t){
if(!this._toolbar1){
var e=this._toolbar1=new DwtToolBar({
parent:this,className:"ZToolbar",posStyle:DwtControl.RELATIVE_STYLE,cellSpacing:2,index:0}
);
e.setVisible(this._mode==DwtHtmlEditor.HTML);
if(!t){
this._createToolBar1(e);
new DwtControl({
parent:e,className:"vertSep"}
);
this._createToolBar2(e);
this._resetFormatControls()
}
this._toolbars.push(e)
}};
ZmHtmlEditor.prototype._createToolBar1=function(e){
this._createFontFamilyMenu(e);
this._createFontSizeMenu(e);
this._createStyleMenu(e);
this._createJustifyMenu(e);
new DwtControl({
parent:e,className:"vertSep"}
);
this._createListMenu(e);
this._createIndentMenu(e);
new DwtControl({
parent:e,className:"vertSep"}
);
this._createBUIButtons(e);
appCtxt.notifyZimlets("on_htmlEditor_createToolbar1",[this,e])
};
ZmHtmlEditor.prototype._createToolBar2=function(e){
this._createFontColorButtons(e);
new DwtControl({
parent:e,className:"vertSep"}
);
this._createHorizRuleButton(e);
this._createUrlButton(e);
this._createTableMenu(e);
if(this.ACE_ENABLED){
this._createSpreadSheetButton(e)
}
appCtxt.notifyZimlets("on_htmlEditor_createToolbar2",[this,e])
};
ZmHtmlEditor.prototype.__createTableOperationItems=function(e){
var h=new AjxListener(this,this._tableOperationsListener);
var s=["tableProperties...","cellProperties...",null,"insertRowAbove","insertRowUnder","deleteRow",null,"insertColumnBefore","insertColumnAfter","deleteColumn",null];
if(AjxEnv.isGeckoBased){
s.push("mergeCells","splitCells",null)
}
s.push("deleteTable");
var a=["TableProperties","CellProperties",null,"InsertRowBefore","InsertRowAfter","DeleteRow",null,"InsertColBefore","InsertColAfter","DeleteCol",null,"MergeCells","SplitCells",null,"DeleteTable"];
e._tblItems={};
for(var n=0;
n<s.length;
++n){
var t=s[n];
if(t==null){
new DwtMenuItem({
parent:e,style:DwtMenuItem.SEPARATOR_STYLE}
)
}else{
var l="";
if(/\.\.\.$/.test(t)){
t=t.substr(0,t.length-3);
l="&hellip;"
}
var c=new DwtMenuItem({
parent:e}
);
e._tblItems[t]=c;
var o=ZmMsg[t]||t;
c.setText(o+l);
if(a[n]){
c.setImage(a[n])
}
c.setData("TableOperations",t);
c.addSelectionListener(h)
}}
e.addPopupListener(new AjxListener(this,this.__onTableOperationsPopup))
};
ZmHtmlEditor.prototype.__onTableOperationsPopup=function(t){
this.focus();
var m=this.getNearestElement("table");
var c=t._tblItems;
for(var s in c){
c[s].setEnabled(!!m)
}
if(!m){
return
}
t.setData("table",m);
if(!AjxEnv.isIE){
var o=this.getNearestElement("td");
var d=o&&((o.colSpan&&o.colSpan>1)||(o.rowSpan&&o.rowSpan>1));
if(c.splitCells){
c.splitCells.setEnabled(d)
}
var u=this.getSelectedCells();
var f=true;
var h=0;
try{
for(var s=u.length;
--s>=0;
){
var e=u[s];
for(var n=e.length;
--n>=0;
){
var o=e[n];
++h;
if(o.rowSpan>1||o.colSpan>1){
throw"can't merge"
}}}}
catch(l){
f=false
}
if(h<2){
f=false
}
if(c.mergeCells){
c.mergeCells.setEnabled(f)
}}};
ZmHtmlEditor.prototype._tableOperationsListener=function(a){
var t=a.item;
var e=t.parent.getData("table");
var i=t.getData("TableOperations");
this.focus();
switch(i){
case"tableProperties":AjxDispatcher.require("Extras");
var o=ZmTableEditor.getTablePropsDialog(this,this.getNearestElement("table"));
o.popup();
break;
case"cellProperties":AjxDispatcher.require("Extras");
var o=ZmTableEditor.getCellPropsDialog(this,this.getNearestElement("table"),this.getSelectedCells());
o.popup();
break;
default:this.doTableOperation(i,{
table:e,cells:this.getSelectedCells()}
)
}};
ZmHtmlEditor.prototype._createTableListener=function(t){
var e=t.detail;
this.insertTable(e.rows,e.cols,"90%",null,3,"center")
};
ZmHtmlEditor.prototype._menu_insertObject=function(t){
var e=t.item;
var a=e.getData("ACE");
this.insertObject(a)
};
ZmHtmlEditor.prototype.insertObject=function(e,s,o){
var a=document.URL.replace(/^(https?:\x2f\x2f[^\x2f]+\x2f?).*$/i,"$1").replace(/\x2f*$/,"");
var n=null;
switch(e){
case"ZmSpreadSheet":n=[a,appContextPath,"/public/Spreadsheet.jsp?localeId=",AjxEnv.DEFAULT_LOCALE].join("");
break
}
if(n){
var l=this._getIframeDoc();
this.focus();
++this._ace_componentsLoading;
if(AjxEnv.isGeckoBased){
Dwt.enableDesignMode(l,false)
}
var i=l.createElement("iframe");
i.id="ACE-"+Dwt.getNextId();
i.frameBorder=0;
i.src=n;
i.style.width="100%";
i.style.height="400px";
i.ondragstart=AjxCallback.returnFalse;
if(!s){
var t=l.createElement("br");
var h=l.createDocumentFragment();
h.appendChild(t);
h.appendChild(i);
h.appendChild(t.cloneNode(true));
this._insertNodeAtSelection(h)
}else{
s.parentNode.replaceChild(i,s)
}
var c=AjxCallback.simpleClosure(this._ace_finishedLoading,this,i,e,o);
if(AjxEnv.isIE){
i.onreadystatechange=c
}else{
i.addEventListener("load",c,true)
}}};
ZmHtmlEditor.prototype._ace_finishedLoading=function(i,t,a){
var e=this;
if(!AjxEnv.isIE||i.readyState=="complete"){
setTimeout(function(){
try{
var n=Dwt.getIframeWindow(i);
n.ZmACE=true;
n.ZmACE_COMPONENT_NAME=t;
i.onload=null;
i.onreadystatechange=null;
n.create(a);
--e._ace_componentsLoading
}
catch(o){
--e._ace_componentsLoading;
var s=appCtxt.getErrorDialog();
s.setMessage(ZmMsg.aleError,o.msg||o.toString(),DwtMessageDialog.WARNING_STYLE,"ALE error");
s.popup(null,true)
}}
,10)
}};
ZmHtmlEditor.prototype._getAceObjects=function(){
var o=this._getIframeDoc().getElementsByTagName("iframe");
var e=new Array(o.length);
for(var t=o.length;
--t>=0;
){
e[t]=o[t]
}
return e
};
ZmHtmlEditor.prototype._embedHtmlContent=function(o,a,i){
if(!a&&!i){
if(!(this.ACE_ENABLED&&this._headContent)){
return DwtHtmlEditor.prototype._embedHtmlContent.call(this,o)
}}
if(i){
var t=[],e=0;
if(a){
t[e++]="<div";
t[e++]=" style='font-family:";
t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
t[e++]="; font-size: ";
t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
t[e++]="; color: ";
t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
t[e++]=";'>";
t[e++]=o;
t[e++]="</div>"
}else{
t[e++]=o
}
return t.join("")
}
var n="<style type='text/css'>p { margin: 0; }</style>";
if(a){
o=this._getFontStyle(o)
}
var s=this._headContent?this._headContent.join(""):"";
return["<html><head>",n,s,"</head><body>",o,"</body></html>"].join("")
};
ZmHtmlEditor.prototype._getFontStyle=function(o){
var e=[],t=0;
e[t++]="<div style='font-family: ";
e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
e[t++]="; font-size: ";
e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
e[t++]="; color: ";
e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
e[t++]="'>";
e[t++]=o;
e[t++]="</div>";
return e.join("")
};
ZmHtmlEditor.prototype._serializeAceObjects=function(t){
this._headContent=[];
var e={};
var a=AjxCallback.simpleClosure(this._replaceAceIframes,this,e);
return t.replace(ZmHtmlEditor.ACE_IFRAME_RE,a)
};
ZmHtmlEditor.prototype._replaceAceIframes=function(e,a,h){
var o=this._getIframeDoc().getElementById(h);
var s=Dwt.getIframeWindow(o);
var i=s.getHTML();
var n=s.serialize().replace(/&/g,"&amp;").replace(/>/g,"&gt;");
var t=s.ZmACE_COMPONENT_NAME;
if(!e[t]&&typeof s.getHeadHTML=="function"){
e[t]=true;
this._headContent.push(s.getHeadHTML())
}
return['<div class="ACE ',t,'">',i,"<!--","ACE[",t,"]:",n,"-->","</div>"].join("")
};
ZmHtmlEditor.prototype._deserializeAceObjects=function(){
var n=this._getIframeDoc().getElementsByTagName("div");
var o=new Array(n.length);
for(var a=0;
a<n.length;
++a){
o[a]=n.item(a)
}
n=o;
for(var a=0;
a<n.length;
++a){
var t=n[a];
if(/^ACE\s+([^\s]+)/.test(t.className)){
var e=RegExp.$1;
var s=t.lastChild;
if(s.nodeType==8){
s=s.data;
var h="ACE["+e+"]:";
if(s.indexOf(h)==0){
s=s.substr(h.length).replace(/&gt;/g,">").replace(/&amp;/g,"&");
this.insertObject(e,t,s)
}}}}};
ZmHtmlEditor.prototype._createBUIButtons=function(e){
var a={
parent:e,style:DwtButton.TOGGLE_STYLE};
var t=new AjxListener(this,this._fontStyleListener);
this._boldButton=new DwtToolBarButton(a);
this._boldButton.setImage("Bold");
this._boldButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_BOLD));
this._boldButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.BOLD_STYLE);
this._boldButton.addSelectionListener(t);
this._italicButton=new DwtToolBarButton(a);
this._italicButton.setImage("Italics");
this._italicButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_ITALIC));
this._italicButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.ITALIC_STYLE);
this._italicButton.addSelectionListener(t);
this._underlineButton=new DwtToolBarButton(a);
this._underlineButton.setImage("Underline");
this._underlineButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_UNDERLINE));
this._underlineButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.UNDERLINE_STYLE);
this._underlineButton.addSelectionListener(t)
};
ZmHtmlEditor.prototype._createFontColorButtons=function(e){
this._fontColorButton=new ZmHtmlEditorColorPicker(e,null,"ZToolbarButton");
this._fontColorButton.dontStealFocus();
this._fontColorButton.setImage("FontColor");
this._fontColorButton.showColorDisplay(true);
this._fontColorButton.setToolTipContent(ZmMsg.fontColor);
this._fontColorButton.addSelectionListener(new AjxListener(this,this._fontColorListener));
this._fontBackgroundButton=new ZmHtmlEditorColorPicker(e,null,"ZToolbarButton");
this._fontBackgroundButton.dontStealFocus();
this._fontBackgroundButton.setImage("FontBackground");
this._fontBackgroundButton.showColorDisplay(true);
this._fontBackgroundButton.setToolTipContent(ZmMsg.fontBackground);
this._fontBackgroundButton.addSelectionListener(new AjxListener(this,this._fontHiliteListener))
};
ZmHtmlEditor.prototype._createHorizRuleButton=function(e){
var t={
parent:e};
this._horizRuleButton=new DwtToolBarButton(t);
this._horizRuleButton.setImage("HorizRule");
this._horizRuleButton.setToolTipContent(ZmMsg.horizRule);
this._horizRuleButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.HORIZ_RULE);
this._horizRuleButton.addSelectionListener(new AjxListener(this,this._insElementListener))
};
ZmHtmlEditor.prototype._createUrlButton=function(e){
var t={
parent:e};
this._insertLinkButton=new DwtToolBarButton(t);
this._insertLinkButton.setImage("URL");
this._insertLinkButton.setToolTipContent(ZmMsg.insertLink);
this._insertLinkButton.addSelectionListener(new AjxListener(this,this._insertLinkListener))
};
ZmHtmlEditor.prototype._createTableMenu=function(t){
var s={
parent:t};
var e=this._tableMenu=new DwtToolBarButton(s);
e.setToolTipContent(ZmMsg.insertTable);
e.dontStealFocus();
e.setImage("Table");
var n=new DwtMenu({
parent:e}
);
e.setMenu(n);
var o=new DwtMenuItem({
parent:n}
);
o.setText(ZmMsg.insertTable);
var i=new DwtMenu({
parent:o,style:DwtMenu.GENERIC_WIDGET_STYLE}
);
var a=new DwtGridSizePicker(i,ZmMsg.tableSize);
a.addSelectionListener(new AjxListener(this,this._createTableListener));
o.setMenu(i);
o.setImage("InsertTable");
new DwtMenuItem({
parent:n,style:DwtMenuItem.SEPARATOR_STYLE}
);
this.__createTableOperationItems(n)
};
ZmHtmlEditor.prototype._createSpreadSheetButton=function(t){
new DwtControl({
parent:t,className:"vertSep"}
);
var a={
parent:t,style:0};
var e=new DwtToolBarButton(a);
e.setImage("SpreadSheet");
e.setData("ACE","ZmSpreadSheet");
e.setToolTipContent(ZmMsg.insertSpreadsheet);
e.addSelectionListener(new AjxListener(this,this._menu_insertObject))
};
ZmHtmlEditor.prototype._createStyleMenu=function(e){
var n=new DwtToolBarButton({
parent:e}
);
n.setText("x");
n._textEl.innerHTML="<span style='font-size:13px'>&sect;</span>";
n.setToolTipContent(ZmMsg.sections);
n.dontStealFocus();
var c=this._styleMenu=new ZmPopupMenu(n);
var l=new AjxListener(this,this._styleListener);
var o=[{
label:ZmMsg.normal,id:DwtHtmlEditor.PARAGRAPH}
,{
label:ZmMsg.heading1,id:DwtHtmlEditor.H1}
,{
label:ZmMsg.heading2,id:DwtHtmlEditor.H2}
,{
label:ZmMsg.heading3,id:DwtHtmlEditor.H3}
,{
label:ZmMsg.heading4,id:DwtHtmlEditor.H4}
,{
label:ZmMsg.heading5,id:DwtHtmlEditor.H5}
,{
label:ZmMsg.heading6,id:DwtHtmlEditor.H6}
,{
label:ZmMsg.address,id:DwtHtmlEditor.ADDRESS}
,{
label:ZmMsg.preformatted,id:DwtHtmlEditor.PREFORMATTED}
];
for(var a=0;
a<o.length;
a++){
var h=o[a];
var t=c.createMenuItem(h.id,{
text:h.label,style:DwtMenuItem.RADIO_STYLE}
);
t.addSelectionListener(l);
t.setData(ZmHtmlEditor._VALUE,h.id);
if(a==0){
t.setChecked(true,true)
}}
n.setMenu(c)
};
ZmHtmlEditor.prototype._createListMenu=function(t){
var e=this._listMenuButton=new DwtToolBarButton({
parent:t}
);
e.dontStealFocus();
e.setImage("BulletedList");
e.setToolTipContent(ZmMsg.bulletedList);
var a=new AjxListener(this,this._insElementListener);
var n=this._listMenu=new ZmPopupMenu(e);
var i=this._bulletListMenuItem=n.createMenuItem(DwtHtmlEditor.UNORDERED_LIST,{
image:"BulletedList",style:DwtMenuItem.SELECT_STYLE}
);
i.addSelectionListener(a);
i.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.UNORDERED_LIST);
var o=this._numberListMenuItem=n.createMenuItem(DwtHtmlEditor.ORDERED_LIST,{
image:"NumberedList",style:DwtMenuItem.SELECT_STYLE}
);
o.addSelectionListener(a);
o.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.ORDERED_LIST);
e.setMenu(n)
};
ZmHtmlEditor.prototype._createIndentMenu=function(t){
var e=this._indentMenuButton=new DwtToolBarButton({
parent:t}
);
e.dontStealFocus();
e.setImage("Outdent");
e.setToolTipContent(ZmMsg.indentTooltip);
var o=new AjxListener(this,this._indentListener);
var n=this._indentMenu=new ZmPopupMenu(e);
var a=this._indentMenuItem=n.createMenuItem(DwtHtmlEditor.OUTDENT,{
image:"Outdent",style:DwtMenuItem.SELECT_STYLE}
);
a.addSelectionListener(o);
a.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.OUTDENT);
var i=this._outdentMenuItem=n.createMenuItem(DwtHtmlEditor.INDENT,{
image:"Indent",style:DwtMenuItem.SELECT_STYLE}
);
i.addSelectionListener(o);
i.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.INDENT);
e.setMenu(n)
};
ZmHtmlEditor.prototype._createJustifyMenu=function(t){
var e=new DwtToolBarButton({
parent:t}
);
e.dontStealFocus();
e.setImage("LeftJustify");
e.setToolTipContent(ZmMsg.alignment);
var l=this._justifyMenu=new ZmPopupMenu(e);
var h=new AjxListener(this,this._justificationListener);
var n=[{
image:"LeftJustify",id:DwtHtmlEditor.JUSTIFY_LEFT}
,{
image:"CenterJustify",id:DwtHtmlEditor.JUSTIFY_CENTER}
,{
image:"RightJustify",id:DwtHtmlEditor.JUSTIFY_RIGHT}
,{
image:"FullJustify",id:DwtHtmlEditor.JUSTIFY_FULL}
];
for(var o=0;
o<n.length;
o++){
var s=n[o];
var a=l.createMenuItem(s.id,{
image:s.image,style:DwtMenuItem.RADIO_STYLE}
);
a.addSelectionListener(h);
a.setData(ZmHtmlEditor._VALUE,s.id);
if(o==0){
a.setChecked(true,true)
}}
e.setMenu(l,false,DwtMenuItem.RADIO_STYLE)
};
ZmHtmlEditor.prototype._createFontFamilyMenu=function(e){
this._fontFamilyButton=new DwtToolBarButton({
parent:e}
);
this._fontFamilyButton.dontStealFocus();
this._fontFamilyButton.setSize(Dwt.DEFAULT);
this._fontFamilyButton.setAlign(DwtLabel.ALIGN_LEFT);
var o=new ZmPopupMenu(this._fontFamilyButton);
var i=new AjxListener(this,this._fontFamilyListener);
for(var n in ZmHtmlEditor.FONT_FAMILY){
var a=ZmHtmlEditor.FONT_FAMILY[n];
var t=o.createMenuItem(a.name,{
text:a.name}
);
t.addSelectionListener(i);
t.setData(ZmHtmlEditor._VALUE,a.value)
}
this._fontFamilyButton.setMenu(o)
};
ZmHtmlEditor.prototype._createFontSizeMenu=function(e){
this._fontSizeButton=new DwtToolBarButton({
parent:e}
);
this._fontSizeButton.dontStealFocus();
var l=new ZmPopupMenu(this._fontSizeButton);
var s=new AjxListener(this,this._fontSizeListener);
for(var o=0;
o<ZmHtmlEditor.FONT_SIZE_VALUES.length;
o++){
var n=ZmHtmlEditor.FONT_SIZE_VALUES[o];
var a=o+1;
var h=a+" ("+n+")";
var t=l.createMenuItem(o,{
text:h}
);
t.addSelectionListener(s);
t.setData(ZmHtmlEditor._VALUE,a)
}
this._fontSizeButton.setMenu(l)
};
ZmHtmlEditor.prototype._getFontSizeLabel=function(a){
for(var e=0;
e<ZmHtmlEditor.FONT_SIZE_VALUES.length;
e++){
var t=ZmHtmlEditor.FONT_SIZE_VALUES[e];
if(a==t){
return((e+1)+" ("+t+")")
}}
return"3 (12pt)"
};
ZmHtmlEditor.prototype._rteStateChangeListener=function(a){
this._boldButton.setSelected(a.isBold);
this._underlineButton.setSelected(a.isUnderline);
this._italicButton.setSelected(a.isItalic);
if(this._strikeThruButton){
this._strikeThruButton.setSelected(a.isStrikeThru)
}
if(this._subscriptButton){
this._subscriptButton.setSelected(a.isSubscript)
}
if(this._superscriptButton){
this._superscriptButton.setSelected(a.isSuperscript)
}
if(a.color){
this._fontColorButton.setColor(a.color)
}
if(a.backgroundColor){
this._fontBackgroundButton.setColor(a.backgroundColor)
}
if(a.style){
this._styleMenu.checkItem(ZmHtmlEditor._VALUE,a.style,true)
}
if(!AjxEnv.isIE){
if(a.fontFamily){
var i=a.fontFamily;
var t=ZmHtmlEditor.FONT_FAMILY[i]&&ZmHtmlEditor.FONT_FAMILY[i].name;
t=t||ZmHtmlEditor.__makeFontName(i);
this._fontFamilyButton.setText(t)
}
if(a.fontSize){
var e=this._fontSizeButton.getMenu().getItem(parseInt(a.fontSize)-1);
if(e){
this._fontSizeButton.setText(e.getText())
}}}
this._justifyMenu.checkItem(ZmHtmlEditor._VALUE,a.justification,true)
};
ZmHtmlEditor.prototype._settingChangeListener=function(e){
if(e.type!=ZmEvent.S_SETTING){
return
}
var t=e.source.id;
if(t==ZmSetting.COMPOSE_INIT_FONT_COLOR||t==ZmSetting.COMPOSE_INIT_FONT_FAMILY||t==ZmSetting.COMPOSE_INIT_FONT_SIZE){
this._resetFormatControlDefaults();
this._fontStyle=null
}};
ZmHtmlEditor.prototype._handleEditorEvent=function(s){
var a=this._eventCallback?this._eventCallback.run(s):true;
if(a){
a=DwtHtmlEditor.prototype._handleEditorEvent.call(this,s)
}
if(this._TIMER_spell){
clearTimeout(this._TIMER_spell)
}
var l=this;
if(this._spellCheck){
var e;
if(/mouse|context|click|select/i.test(s.type)){
e=new DwtMouseEvent(true)
}else{
e=new DwtUiEvent(true)
}
e.setFromDhtmlEvent(s);
this._TIMER_spell=setTimeout(function(){
l._handleSpellCheckerEvents(e);
this._TIMER_spell=null
}
,100)
}
if(/keydown/i.test(s.type)){
if(s.keyCode==13){
var i=this._getParentElement();
var o=i;
while(o){
var h=Dwt.getAttr(o,"tagName");
if(h&&h.toLowerCase()==="blockquote"){
break
}
o=o.parentNode
}
if(o){
this._splitBlockquote(o,i);
a=false
}}
if(s.keyCode==8||s.keyCode==46){
setTimeout(AjxCallback.simpleClosure(function(){
var m,d;
for(var u=this._getIframeDoc().body.firstChild;
u&&u.nextSibling;
u=u.nextSibling){
var c=u.nextSibling;
if(c&&c.tagName&&c.tagName.toLowerCase()=="p"&&this._elementIsIEFiller(c.firstChild)){
c=c.nextSibling
}
if(c&&u.tagName&&c.tagName&&u.tagName.toLowerCase()=="blockquote"&&c.tagName.toLowerCase()=="blockquote"){
this._mergeBlockquotes(u,c)
}}}
,this),5);
if(s.keyCode==46){
if(!AjxEnv.isIE){
var n=this._getRange();
var t=n.startContainer.childNodes[n.startOffset];
if(t&&t.tagName&&t.tagName.toLowerCase()=="br"){
this._removeElement(t);
if(s.preventDefault){
s.preventDefault()
}
a=false
}}}}}
return a
};
ZmHtmlEditor.prototype._splitBlockquote=function(e,i){
var d,a,n=null,s=null;
var l,h;
if(AjxEnv.isIE){
var u=this._getIframeDoc();
d=u.selection.createRange();
d.collapse(false);
a=i;
var z="###"+Dwt.getNextId()+"###";
d.pasteHTML(z);
n=a.innerHTML.indexOf(z);
a.innerHTML=a.innerHTML.replace(z,"");
l=n?a.innerHTML.substring(0,n):"";
h=a.innerHTML.substring(n)
}else{
d=this._getRange();
d.collapse(false);
var o=d.startContainer.nodeType;
if(o==3||o==4||o==8){
n=d.startOffset;
a=d.startContainer.parentNode;
l=n?d.startContainer.textContent.substring(0,n):"";
h=d.startContainer.textContent.substring(n);
var w=d.startContainer.previousSibling;
while(w){
l=this._getElementHTML(w)+l;
w=w.previousSibling
}
w=d.startContainer.nextSibling;
while(w){
h=h+this._getElementHTML(w);
w=w.nextSibling
}}else{
s=d.startOffset;
a=d.startContainer
}}
var b=a.id=a.id||Dwt.getNextId();
var y=e.cloneNode(true);
var f=a;
var m=Dwt.byId(b,y);
m.removeAttribute("id");
if(n!==null){
f.innerHTML=l;
m.innerHTML=h
}else{
if(s!==null){
this._removeNextSiblings(f.childNodes[s]);
var v=m.childNodes[s];
this._removePreviousSiblings(v);
this._removeElement(v)
}}
while(f!=e){
this._removeNextSiblings(f);
f=f.parentNode
}
while(m!=y){
this._removePreviousSiblings(m);
m=m.parentNode
}
if(e.nextSibling){
e.parentNode.insertBefore(y,e.nextSibling)
}else{
e.parentNode.appendChild(y)
}
if(AjxEnv.isIE){
var g=document.createElement("p");
var q=document.createElement("span");
var k=document.createElement("span");
var j=document.createElement("br");
q.appendChild(k);
q.appendChild(j);
g.appendChild(q);
y.parentNode.insertBefore(g,y);
this._setCursor(k);
this._setIEFiller(q);
k.parentNode.removeChild(k)
}else{
if(AjxEnv.isSafari){
var c=this;
setTimeout(function(){
var T;
if(e.lastChild&&e.lastChild.childElementCount==1&&e.lastChild.firstChild instanceof HTMLBRElement){
T=e.lastChild
}else{
if(y.firstChild&&y.firstChild.childElementCount==1&&y.firstChild.firstChild instanceof HTMLBRElement){
T=y.firstChild
}}
if(T){
e.parentNode.insertBefore(T,y);
d.setStart(T,0);
var t=c._getSelection();
t.removeAllRanges();
t.addRange(d)
}}
,5)
}
d.setStartAfter(e);
var x=this._getSelection();
x.removeAllRanges();
x.addRange(d)
}};
ZmHtmlEditor.prototype._getElementHTML=function(t){
if(AjxEnv.isIE){
return t.outerHTML
}
var e=document.createElement(t.parentNode&&t.parentNode.tagName||"span");
e.appendChild(t.cloneNode(true));
return e.innerHTML
};
ZmHtmlEditor.prototype._removeElement=function(e){
if(e&&e.parentNode){
e.parentNode.removeChild(e)
}};
ZmHtmlEditor.prototype._removePreviousSiblings=function(e){
if(e&&e.parentNode){
while(e.previousSibling){
this._removeElement(e.previousSibling)
}}};
ZmHtmlEditor.prototype._removeNextSiblings=function(e){
if(e&&e.parentNode){
while(e.nextSibling){
this._removeElement(e.nextSibling)
}}};
ZmHtmlEditor.prototype._selectNode=function(a){
var i;
var e=this._getRange();
while(!i&&a){
try{
e.setStartBefore(a);
i=true
}
catch(t){
a=a.parentNode;
i=false
}}};
ZmHtmlEditor.prototype._nextElement=function(e){
if(e.childNodes&&e.childNodes.length){
return e.childNodes[0]
}
if(e.nextSibling){
return e.nextSibling
}
var t=e.parentNode;
while(!e.nextSibling){
e=e.parentNode;
if(!e){
return null
}}
return e.nextSibling
};
ZmHtmlEditor.prototype._elementIsIEFiller=function(t){
if(t&&t.attributes){
for(var e=0;
e<t.attributes.length;
e++){
if(t.attributes[e].name=="_ieFiller"){
return true
}}}};
ZmHtmlEditor.prototype._setIEFiller=function(e){
if(e){
e.setAttribute("_ieFiller","")
}};
ZmHtmlEditor.prototype._removeIEFiller=function(t){
if(t){
if(this._elementIsIEFiller(t)){
t.parentNode.removeChild(t)
}
for(var e=0;
e<t.children.length;
e++){
this._removeIEFiller(t.children[e])
}}};
ZmHtmlEditor.prototype._mergeBlockquotes=function(h,s){
if(AjxEnv.isIE){
this._removeIEFiller(h.lastChild)
}
var i=h;
var u=0;
while(i.childNodes.length){
i=i.childNodes[i.childNodes.length-1];
while(i.previousSibling&&i.tagName=="BR"){
i=i.previousSibling
}
u++
}
var a=s;
var d=0;
while(a.childNodes.length){
a=a.childNodes[0];
d++
}
if(i.nodeType==3){
i=i.parentNode;
u--
}
if(a.nodeType==3){
a=a.parentNode;
d--
}
var l=(AjxEnv.isIE)?this._getIframeDoc().selection.createRange():this._getRange();
if(u==d){
var f=[i.innerHTML,a.innerHTML];
var o="###"+Dwt.getNextId()+"###";
i.innerHTML=f.join(o);
var n=i.innerHTML.replace(/<br>/ig," ").replace(/<\/?[^>]+>/g,"").indexOf(o);
i.innerHTML=f.join("");
if(AjxEnv.isIE){
l.moveToElementText(i);
l.moveStart("character",n)
}else{
var e;
for(var e=i;
e!=null&&n>0;
e=this._nextElement(e)){
var m=e.nodeType;
var c=e.textContent||e.innerText||e.innerHTML||"";
if(m==3||m==4||m==8){
if(n<=c.length){
break
}
n-=c.length
}else{
if(e.tagName.toLowerCase()=="br"){
n--
}
if(n==0){
break
}}}
l.setStart(e,n)
}}else{
if(u==d+1){
while(a.firstChild){
i.parentNode.appendChild(a.firstChild)
}
if(AjxEnv.isIE){
var m=e.nodeType;
var n=1;
if(m==3||m==4||m==8){
n=e.length;
e=e.parentNode
}
l.moveToElementText(e);
l.moveStart("character",n)
}else{
if(i.tagName&&i.tagName.toLowerCase()=="br"){
l.setStartBefore(i)
}else{
l.setStartAfter(i)
}}
i=i.parentNode
}else{
if(u+1==d){
var e=i.childNodes.length?i.childNodes[i.childNodes.length-1]:i;
a=a.parentNode;
while(a.firstChild){
i.appendChild(a.firstChild)
}
if(AjxEnv.isIE){
var m=e.nodeType;
var n=1;
if(m==3||m==4||m==8){
n=e.length;
e=e.parentNode
}
l.moveToElementText(e);
l.moveStart("character",n)
}else{
if(e.tagName&&e.tagName.toLowerCase()=="br"){
l.setStartBefore(e)
}else{
l.setStartAfter(e)
}}}else{
return
}}}
while(i!=h&&a!=s){
while(a.nextSibling){
i.parentNode.appendChild(a.nextSibling)
}
i=i.parentNode;
a=a.parentNode
}
this._removeElement(s);
l.collapse(true);
if(AjxEnv.isIE){
l.select()
}else{
var t=this._getSelection();
t.removeAllRanges();
t.addRange(l)
}};
ZmHtmlEditor._spellCheckResumeEditing=function(){
var e=Dwt.getObjectFromElement(this);
e.discardMisspelledWords();
if(AjxEnv.isIE&&e._currInsPt&&e._getRange().type=="None"){
e._currInsPt.collapse(false)
}};
ZmHtmlEditor._spellCheckAgain=function(){
var e=Dwt.getObjectFromElement(this);
e.discardMisspelledWords();
e.spellCheck()
};
ZmHtmlEditor.prototype._spellCheckShowModeDiv=function(){
var o=this.getSize();
if(!this._spellCheckModeDivId){
var s=document.createElement("div");
s.className="SpellCheckModeDiv";
s.id=this._spellCheckModeDivId=Dwt.getNextId();
var a=new Array();
var t=0;
a[t++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='width:25'>";
a[t++]=AjxImg.getImageHtml("SpellCheck");
a[t++]="</td><td style='white-space:nowrap'><span class='SpellCheckLink'>";
a[t++]=ZmMsg.resumeEditing;
a[t++]="</span> | <span class='SpellCheckLink'>";
a[t++]=ZmMsg.checkAgain;
a[t++]="</span></td></tr></table>";
s.innerHTML=a.join("");
var e=document.getElementById((this._spellCheckDivId||this.getBodyFieldId()));
e.parentNode.insertBefore(s,e);
var n=s.getElementsByTagName("span");
Dwt.associateElementWithObject(n[0],this);
Dwt.setHandler(n[0],"onclick",ZmHtmlEditor._spellCheckResumeEditing);
Dwt.associateElementWithObject(n[1],this);
Dwt.setHandler(n[1],"onclick",ZmHtmlEditor._spellCheckAgain)
}else{
document.getElementById(this._spellCheckModeDivId).style.display=""
}
this.setSize(o.x,o.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
};
ZmHtmlEditor.prototype._spellCheckHideModeDiv=function(){
var e=this.getSize();
if(this._spellCheckModeDivId){
document.getElementById(this._spellCheckModeDivId).style.display="none"
}
this.setSize(e.x,e.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
};
ZmHtmlEditor.prototype._spellCheckSuggestionListener=function(l){
var m=l.item;
var d=m.getData("orig");
if(!d){
return
}
var t=m.getData("value");
var n=this._mode==DwtHtmlEditor.TEXT;
var h=m.getData("fixall");
var u=n?document:this._getIframeDoc();
var o=u.getElementById(m.getData("spanId"));
var i=m.getData(ZmPopupMenu.MENU_ITEM_ID_KEY);
switch(i){
case"ignore":t=d;
this._ignoreWords[t]=true;
if(h){}
break;
case"add":t=d;
var c=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
var s=c.set("pref",t);
s.setAttribute("name","+zimbraPrefSpellIgnoreWord");
var a={
soapDoc:c,asyncMode:true,callback:new AjxCallback(appCtxt,appCtxt.setStatusMsg,[ZmMsg.wordAddedToDictionary])};
appCtxt.getAppController().sendRequest(a);
this._ignoreWords[t]=true;
break;
default:break
}
if(n&&t==null){
this._editWord(h,o)
}else{
var e=h?this._spellCheck.wordIds[d]:o;
this._editWordFix(e,t)
}
this._handleSpellCheckerEvents(null)
};
ZmHtmlEditor.prototype._getEditorDocument=function(){
var e=this._mode==DwtHtmlEditor.TEXT;
return e?document:this._getIframeDoc()
};
ZmHtmlEditor.prototype._editWord=function(s,e){
var o=this._getEditorDocument();
var t=o.createElement("input");
t.type="text";
t.value=AjxUtil.getInnerText(e);
t.className="SpellCheckInputField";
t.style.left=e.offsetLeft-2+"px";
t.style.top=e.offsetTop-2+"px";
t.style.width=e.offsetWidth+4+"px";
var n=o.getElementById(this._spellCheckDivId);
var i=n.scrollTop;
n.appendChild(t);
n.scrollTop=i;
t.setAttribute("autocomplete","off");
t.focus();
if(!AjxEnv.isGeckoBased){
t.select()
}else{
t.setSelectionRange(0,t.value.length)
}
var a=AjxCallback.simpleClosure(this._editWordHandler,this,s,e);
t.onblur=a;
t.onkeydown=a
};
ZmHtmlEditor.prototype._editWordHandler=function(a,e,t){
t=DwtUiEvent.getEvent(t);
t={
type:t.type,keyCode:t.keyCode,ctrlKey:t.ctrlKey,target:DwtUiEvent.getTarget(t)};
setTimeout(AjxCallback.simpleClosure(this._editWordHandler2,this,a,e,t),20)
};
ZmHtmlEditor.prototype._editWordHandler2=function(s,o,h){
h=DwtUiEvent.getEvent(h);
var l=h.type;
var t=h.keyCode;
var i=h.ctrlKey;
var c=DwtUiEvent.getTarget(h);
var n=/key/.test(l);
var a=true;
if(/blur/.test(l)||(n&&t==13)){
if(i){
s=!s
}
var d=AjxUtil.getInnerText(o);
var e=s?this._spellCheck.wordIds[d]:o;
this._editWordFix(e,c.value)
}else{
if(n&&t==27){
this._editWordFix(o,AjxUtil.getInnerText(o))
}else{
a=false
}}
if(a){
c.onblur=null;
c.onkeydown=null;
if(c.parentNode){
c.parentNode.removeChild(c)
}}
this._handleSpellCheckerEvents(null)
};
ZmHtmlEditor.prototype._editWordFix=function(a,o){
a=a instanceof Array?a:[a];
var n=this._getEditorDocument();
for(var t=a.length-1;
t>=0;
t--){
var e=a[t];
if(typeof e=="string"){
e=n.getElementById(e)
}
if(e){
e.innerHTML=o
}}};
ZmHtmlEditor.prototype._handleSpellCheckerEvents=function(f){
var h=this._mode==DwtHtmlEditor.TEXT;
var n=h?(f?DwtUiEvent.getTarget(f):null):this._getParentElement(),y,e,s,l,d=this._spellCheck,g=this._getEditorDocument(),b=false,o="";
if(f&&/^span$/i.test(n.tagName)&&/ZM-SPELLCHECK/.test(n.className)){
o=n.getAttribute("word");
b=o!=AjxUtil.getInnerText(n)
}
e=d.spanIds;
for(s in e){
y=g.getElementById(s);
if(y){
if(e[s]!=AjxUtil.getInnerText(y)||this._ignoreWords[e[s]]){
y.className="ZM-SPELLCHECK-FIXED"
}else{
if(e[s]==o){
y.className="ZM-SPELLCHECK-MISSPELLED2"
}else{
y.className="ZM-SPELLCHECK-MISSPELLED"
}}}}
if(d.menu&&(!f||(/click|mousedown|mouseup|contextmenu/.test(f.type)||(/key/.test(f.type)&&(!o||b))))){
if(d.menu._menuItems.fixall){
d.menu._menuItems.fixall.getMenu().dispose()
}
d.menu.dispose();
d.menu=null;
window.status=""
}
if(f&&o&&(l=d.suggestions[o])&&(/mouseup|contextmenu/i.test(f.type)||(h&&/(click|mousedown|contextmenu)/i.test(f.type)))&&(o==AjxUtil.getInnerText(n)&&!this._ignoreWords[o])){
d.menu=this._spellCheckCreateMenu(this,0,l,o,n.id,b);
var m,a=d.menu.getSize(),c=this.shell.getSize();
if(!h){
m=Dwt.toWindow(document.getElementById(this._iFrameId),0,0,null,true);
var u=Dwt.toWindow(n,0,0,null,true);
m.x+=u.x-(g.documentElement.scrollLeft||g.body.scrollLeft);
m.y+=u.y-(g.documentElement.scrollTop||g.body.scrollTop)
}else{
m=Dwt.toWindow(n,0,0,null,true);
var t=document.getElementById(this._spellCheckDivId);
m.x-=t.scrollLeft;
m.y-=t.scrollTop
}
m.y+=n.offsetHeight;
if(m.y+a.y>c.y){
m.y-=a.y+n.offsetHeight
}
d.menu.popup(0,m.x,m.y);
f._stopPropagation=true;
f._returnValue=false
}};
ZmHtmlEditor.prototype._spellCheckCreateMenu=function(d,c,l,t,o,u){
var a=new ZmPopupMenu(d);
if(u){
var s="<b>"+t+"</b>";
this._spellCheckCreateMenuItem(a,"orig",{
text:s}
,c,t,t,o)
}
if(l.length>0){
for(var n=0;
n<l.length;
++n){
this._spellCheckCreateMenuItem(a,"sug-"+n,{
text:l[n],className:""}
,c,l[n],t,o)
}
if(!(d instanceof DwtMenuItem)&&this._spellCheck.wordIds[t].length>1){
if(!this._replaceAllFormatter){
this._replaceAllFormatter=new AjxMessageFormat(ZmMsg.replaceAllMenu)
}
var s="<i>"+this._replaceAllFormatter.format(this._spellCheck.wordIds[t].length)+"</i>";
var m=a.createMenuItem("fixall",{
text:s}
);
var e=this._spellCheckCreateMenu(m,1,l,t,o,u);
m.setMenu(e)
}}else{
var m=this._spellCheckCreateMenuItem(a,"noop",{
text:ZmMsg.noSuggestions}
,c,"",t,o);
m.setEnabled(false);
this._spellCheckCreateMenuItem(a,"clear",{
text:"<i>"+ZmMsg.clearText+"</i>"}
,c,"",t,o)
}
a.createSeparator();
var h=this._mode==DwtHtmlEditor.TEXT;
if(h){
var s=c?ZmMsg.editAll:ZmMsg.edit;
this._spellCheckCreateMenuItem(a,"edit",{
text:s}
,c,null,t,o)
}
if(!c){
this._spellCheckCreateMenuItem(a,"ignore",{
text:ZmMsg.ignoreWord}
,0,null,t,o)
}
if(!c&&appCtxt.get(ZmSetting.SPELL_CHECK_ADD_WORD_ENABLED)){
this._spellCheckCreateMenuItem(a,"add",{
text:ZmMsg.addWord}
,c,null,t,o)
}
return a
};
ZmHtmlEditor.prototype._spellCheckCreateMenuItem=function(a,t,o,s,h,e,n,i){
if(o.className==null){
o.className="ZMenuItem ZmSpellMenuItem"
}
var l=a.createMenuItem(t,o);
l.setData("fixall",s);
l.setData("value",h);
l.setData("orig",e);
l.setData("spanId",n);
l.addSelectionListener(i||this._spellCheckSuggestionListenerObj);
return l
};
ZmHtmlEditor.prototype._spellCheckCallback=function(i){
var e=false;
if(i&&i.available){
var a=i.misspelled;
if(a==null||a.length==0){
appCtxt.setStatusMsg(ZmMsg.noMisspellingsFound,ZmStatusView.LEVEL_INFO)
}else{
var t=AjxMessageFormat.format(ZmMsg.misspellingsResult,a.length);
appCtxt.setStatusMsg(t,ZmStatusView.LEVEL_WARNING);
this.highlightMisspelledWords(a);
e=true
}}else{
appCtxt.setStatusMsg(ZmMsg.spellCheckUnavailable,ZmStatusView.LEVEL_CRITICAL)
}
if(AjxEnv.isGeckoBased&&this._mode==DwtHtmlEditor.HTML){
setTimeout(AjxCallback.simpleClosure(this.focus,this),10)
}
if(this.onExitSpellChecker){
this.onExitSpellChecker.run(e)
}};
ZmHtmlEditor.prototype._enableDesignMode=function(e){
if(!e){
return
}
if(!(AjxEnv.isGeckoBased&&this.ACE_ENABLED)){
return DwtHtmlEditor.prototype._enableDesignMode.call(this,e)
}
if(!this._hasGeckoFocusHacks){
this.__enableGeckoFocusHacks()
}
this._getIframeWin().addEventListener("blur",this._designModeHack_blur,true);
this._getIframeWin().addEventListener("focus",this._designModeHack_focus,true)
};
ZmHtmlEditor.prototype.__enableGeckoFocusHacks=function(){
var t=null;
var a=0;
this._hasGeckoFocusHacks=true;
function e(n){
var o=[];
for(var s=0;
s<this._toolbars.length;
s++){
o=o.concat(this._toolbars[s].getChildren())
}
for(var s=0;
s<o.length;
++s){
o[s].setEnabled(n)
}}
this._designModeHack_blur=AjxCallback.simpleClosure(function(u){
if(a<0){
return
}
var c=false;
var h=DwtShell.mouseEvent;
h.setFromDhtmlEvent(u,true);
var n=appCtxt.getKeyboardMgr();
if(n&&n.__focusObj){
for(var l=0;
l<this._toolbars.length;
l++){
if((n.__focusObj==this._toolbars[l])||(n.__focusObj.parent==this._toolbars[l])){
c=true;
break
}}}
e.call(this,c);
var m=this._getIframeDoc();
Dwt.enableDesignMode(m,false);
a=-1;
if(this._ace_componentsLoading>0){
return
}
try{
var s=this._getIframeWin().getSelection();
var l=0,o;
try{
t=[];
while(o=s.getRangeAt(l++)){
t.push(o)
}}
catch(d){}
s.removeAllRanges()
}
catch(d){
t=null
}}
,this);
e.call(this,false);
this._designModeHack_focus=AjxCallback.simpleClosure(function(n){
if(a>0){
return
}
var h=this._getIframeDoc();
var s=this._getIframeWin().getSelection();
e.call(this,true);
if(this._ace_componentsLoading>0){
return
}
Dwt.enableDesignMode(h,true);
if(!t||t.length==0){
r=h.createRange();
r.selectNodeContents(h.body);
r.collapse(true);
t=[r]
}
s.removeAllRanges();
for(var o=0;
o<t.length;
++o){
s.addRange(t[o])
}
t=null;
a=1
}
,this)
};
ZmHtmlEditor.WRAP_LENGTH=72;
ZmHtmlEditor.HTML_QUOTE_PRE='<blockquote style="border-left:2px solid '+AjxStringUtil.HTML_QUOTE_COLOR+';margin-left:5px;padding-left:5px;">';
ZmHtmlEditor.HTML_QUOTE_POST="</blockquote><br/>";
ZmHtmlEditor.getWrapParams=function(a,e){
e=e||{};
var t={};
t.htmlMode=a;
t.len=ZmHtmlEditor.WRAP_LENGTH;
t.eol=a?"<br/>":"\n";
t.pre=(a||!e.prefix)?"":appCtxt.get(ZmSetting.REPLY_PREFIX)+" ";
t.before=(a&&e.prefix)?ZmHtmlEditor.HTML_QUOTE_PRE:"";
t.after=(a&&e.prefix)?ZmHtmlEditor.HTML_QUOTE_POST:"";
return t
};
ZmHtmlEditorColorPicker=function(a,t,e){
DwtButtonColorPicker.call(this,a,t,e)
};
ZmHtmlEditorColorPicker.prototype=new DwtButtonColorPicker;
ZmHtmlEditorColorPicker.prototype.constructor=ZmHtmlEditorColorPicker;
ZmHtmlEditorColorPicker.prototype.TEMPLATE="dwt.Widgets#ZToolbarButton"
}
if(AjxPackage.define("zimbraMail.share.view.htmlEditor.ZmAdvancedHtmlEditor")){
ZmAdvancedHtmlEditor=function(a,t,i,o,e){
if(arguments.length==0){
return
}
this.isTinyMCE=window.isTinyMCE;
this._mode=o;
this._hasFocus={};
this.initTinyMCEEditor(a,t,i,o,e);
this._ignoreWords={}
};
ZmAdvancedHtmlEditor.TINY_MCE_PATH="/tiny_mce/3.2.6";
ZmAdvancedHtmlEditor.prototype.toString=function(){
return"ZmAdvancedHtmlEditor"
};
ZmAdvancedHtmlEditor.prototype.getEditor=function(){
return(window.tinyMCE)?tinyMCE.get(this._bodyTextAreaId):null
};
ZmAdvancedHtmlEditor.prototype.getBodyFieldId=function(){
if(this._mode==DwtHtmlEditor.HTML){
var e=this.getEditor();
return e?this._bodyTextAreaId+"_ifr":this._bodyTextAreaId
}
return this._bodyTextAreaId
};
ZmAdvancedHtmlEditor.prototype.getBodyField=function(){
return document.getElementById(this.getBodyFieldId())
};
ZmAdvancedHtmlEditor.prototype.resizeWidth=function(e){
var t=document.getElementById(this._bodyTextAreaId+"_tbl");
if(t){
t.style.width=e
}};
ZmAdvancedHtmlEditor.prototype.setSize=function(e,n){
var a=this.getEditor();
var t=this.getBodyField();
var o=this._mode==DwtHtmlEditor.HTML?10:8;
e-=o+4;
n-=o;
if(e<0){
e=0
}
if(n<0){
n=0
}
var i=document.getElementById(this._bodyTextAreaId+"_tbl");
if(a&&i){
i.style.height=n+"px";
i.style.width="100%"
}
if(this._mode==DwtHtmlEditor.HTML&&this.isTinyMCE){
n-=26
}
t.style.width=e+5+"px";
t.style.height=n+"px"
};
ZmAdvancedHtmlEditor.prototype.editorContainerFocus=function(){
this.focus()
};
ZmAdvancedHtmlEditor.prototype.focus=function(){
var t=this.getEditor();
if(t){
t.focus();
this.setFocusStatus(true)
}else{
var e=this.getContentField();
if(e){
e.focus()
}
this.setFocusStatus(true,true)
}};
ZmAdvancedHtmlEditor.prototype.getTextVersion=function(){
var t=this.getContentField();
if(this._mode==DwtHtmlEditor.HTML){
var e=this.getEditor();
return e?this._convertHtml2Text():""
}
return t.value
};
ZmAdvancedHtmlEditor.prototype.getContent=function(e,t){
this.discardMisspelledWords();
var o=this.getContentField();
if(this._mode==DwtHtmlEditor.HTML){
var a=this.getEditor();
var n={};
n.format="raw";
var i=a?a.getContent(n):(this._pendingContent||"");
if(i=='<br mce_bogus="1">'||i=='<br mce_bogus="1"/>'){
i=""
}
i=this._embedHtmlContent(i,e,t);
return i
}
return o.value
};
ZmAdvancedHtmlEditor.prototype._embedHtmlContent=function(o,a,i){
if(!a&&!i){
return["<html><body>",o,"</body></html>"].join("")
}
if(i){
var t=[];
var e=0;
if(a){
t[e++]="<div";
t[e++]=" style='font-family:";
t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
t[e++]="; font-size: ";
t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
t[e++]="; color: ";
t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
t[e++]=";'>";
t[e++]=o;
t[e++]="</div>"
}else{
t[e++]=o
}
return t.join("")
}
var n="<style type='text/css'>p { margin: 0; }</style>";
if(a){
o=this._getFontStyle(o)
}
return["<html><head>",n,"</head><body>",o,"</body></html>"].join("")
};
ZmAdvancedHtmlEditor.prototype._getFontStyle=function(o){
var e=[],t=0;
e[t++]="<div style='font-family: ";
e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
e[t++]="; font-size: ";
e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
e[t++]="; color: ";
e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
e[t++]="'>";
e[t++]=o;
e[t++]="</div>";
return e.join("")
};
ZmAdvancedHtmlEditor.prototype.setContent=function(t){
if(this._mode==DwtHtmlEditor.HTML){
var e=this.getEditor();
if(e&&this._editorInitialized){
e.setContent(t,{
format:"raw"}
)
}else{
this._pendingContent=t
}}else{
var a=this.getContentField();
a.value=t
}
this._ignoreWords={}
};
ZmAdvancedHtmlEditor.prototype.reEnableDesignMode=function(){};
ZmAdvancedHtmlEditor.prototype.getMode=function(){
return this._mode
};
ZmAdvancedHtmlEditor.prototype.isHtmlModeInited=function(){
return Boolean(this.getEditor())
};
ZmAdvancedHtmlEditor.prototype._convertHtml2Text=function(){
var e=this.getEditor();
var t=e&&e.getDoc();
return(t&&t.body)?this._convertHtml2TextContinue(t.body):""
};
ZmAdvancedHtmlEditor.prototype._convertHtml2TextContinue=function(a){
var i=[];
var t=0;
var e={};
AjxStringUtil._traverse(a,i,t,AjxStringUtil._NO_LIST,0,0,e);
if(i.length&&i[0]=="\n\n"){
i[0]=""
}
return i.join("")
};
ZmAdvancedHtmlEditor.prototype.moveCaretToTop=function(){
var i=document.activeElement;
if(this._mode==DwtHtmlEditor.TEXT){
var a=this.getContentField();
if(a.createTextRange){
var e=a.createTextRange();
e.collapse(true);
e.select()
}else{
if(a.setSelectionRange){
a.setSelectionRange(0,0)
}}}else{
this._moveCaretToTopHtml(true)
}
try{
if(i){
i.focus()
}}
catch(t){}};
ZmAdvancedHtmlEditor.prototype._moveCaretToTopHtml=function(t){
var i=this.getEditor();
if(!i){
return
}
var e=i.getDoc().body;
var n=false;
if(AjxEnv.isIE){
if(e){
e.createTextRange().collapse(true);
n=true
}}else{
var a=i.selection?i.selection.getSel():"";
if(a){
a.collapse(e,0);
n=true
}}
if(!n&&t){
var o=new AjxTimedAction(this,this._moveCaretToTopHtml);
AjxTimedAction.scheduleAction(o,DwtHtmlEditor._INITDELAY+1)
}};
ZmAdvancedHtmlEditor.prototype.getEditorContainer=function(){
return this._editorContainer
};
ZmAdvancedHtmlEditor.prototype.hasFocus=function(){
return Boolean(this._hasFocus[this._mode])
};
ZmAdvancedHtmlEditor.prototype._getIframeDoc=function(){
var e=this.getEditor();
return e?e.getDoc():null
};
ZmAdvancedHtmlEditor.prototype._getIframeWin=function(){
var e=this.getEditor();
return e?e.getWin():null
};
ZmAdvancedHtmlEditor.prototype.clear=function(){
this.setPendingContent(null);
var e=this.getEditor();
if(e){
e.setContent("",{
format:"raw"}
)
}
var t=this.getContentField();
if(t){
t.value=""
}};
ZmAdvancedHtmlEditor.prototype.reparentHtmlElement=function(t,e){
return this._editorContainer.reparentHtmlElement(t,e)
};
ZmAdvancedHtmlEditor.prototype.getParent=function(){
return this._editorContainer.parent
};
ZmAdvancedHtmlEditor.prototype.getInputElement=function(){
return document.getElementById(this._bodyTextAreaId)
};
ZmAdvancedHtmlEditor.prototype.initTinyMCEEditor=function(h,a,s,n,l){
var i={
parent:h,posStyle:a,mode:n,content:s,withAce:l,className:"ZmHtmlEditor"};
this._editorContainer=new ZmEditorContainer(i);
var t=this._editorContainer.getHtmlElement();
var e=this._bodyTextAreaId=this._editorContainer.getHTMLElId()+"_content";
var d=document.createElement("textarea");
d.setAttribute("id",e);
d.setAttribute("name",e);
d.className="DwtHtmlEditorTextArea";
t.appendChild(d);
this._textAreaId=e;
Dwt.setHandler(d,DwtEvent.ONFOCUS,AjxCallback.simpleClosure(this.setFocusStatus,this,true,true));
Dwt.setHandler(d,DwtEvent.ONBLUR,AjxCallback.simpleClosure(this.setFocusStatus,this,false,true));
this._editorContainer.setFocusMember(d);
if(s!=null){
this.setPendingContent(s)
}
if(!window.tinyMCE){
var c=new AjxCallback(this,this.initEditorManager,[e,n,s]);
var o={
name:"tiny_mce",path:appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH+"/tiny_mce.js",extension:".js",method:AjxPackage.METHOD_XHR_SYNC,async:false,callback:null,scripts:[],basePath:appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH};
AjxPackage.require(o);
this.initEditorManager(e,n,s)
}else{
this.initEditorManager(e,n,s)
}};
ZmAdvancedHtmlEditor.prototype.getPendingContent=function(){
return this._pendingContent
};
ZmAdvancedHtmlEditor.prototype.setPendingContent=function(e){
this._pendingContent=e
};
ZmAdvancedHtmlEditor.prototype.addOnContentIntializedListener=function(e){
this._onContentInitializeCallback=e
};
ZmAdvancedHtmlEditor.prototype.removeOnContentIntializedListener=function(){
this._onContentInitializeCallback=null
};
ZmAdvancedHtmlEditor.prototype._handleEditorKeyEvent=function(t,e){
var i=true;
var a=null;
if(DwtKeyEvent.isKeyPressEvent(t)){
if(DwtKeyboardMgr.isPossibleInputShortcut(t)){
i=DwtKeyboardMgr.__keyDownHdlr(t)
}}
if(window.DwtIdleTimer){
DwtIdleTimer.resetIdle()
}
return i
};
ZmAdvancedHtmlEditor.prototype.onLoadContent=function(t){
var e=this.getPendingContent();
if(e!=null){
t.setContent(e,{
format:"raw"}
);
this.setPendingContent(null)
}
if(this._onContentInitializeCallback){
this._onContentInitializeCallback.run()
}};
ZmAdvancedHtmlEditor.prototype.setFocusStatus=function(a,e){
var t=e?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML;
this._hasFocus[t]=a
};
ZmAdvancedHtmlEditor.prototype.initEditorManager=function(t,s,h){
var o=this;
function n(d){
o.onLoadContent(d);
o.initDefaultFontSize(d)
}
function c(d){
o.initDefaultFontSize(d);
tinymce.dom.Event.add(d.getWin(),"focus",function(m){
o.setFocusStatus(true)
}
);
tinymce.dom.Event.add(d.getWin(),"blur",function(m){
o.setFocusStatus(false)
}
);
var u=o.getEditorContainer();
u.setFocusMember(d.getWin());
o._editorInitialized=true
}
function i(d,u){
return o._handleEditorKeyEvent(u,d)
}
var a=AjxStringUtil.parseURL(location.href);
tinymce.baseURL=appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH+"/";
if(tinymce.EditorManager){
tinymce.EditorManager.baseURI=new tinymce.util.URI(a.protocol+"://"+a.authority+tinymce.baseURL)
}
if(tinymce.dom){
tinymce.DOM=new tinymce.dom.DOMUtils(document,{
process_html:0}
)
}
if(tinymce.dom&&tinymce.dom.Event){
tinymce.dom.Event.domLoaded=true
}
var l=appCtxt.get(ZmSetting.LOCALE_NAME);
var e=appContextPath+"/css/editor_ui.css?v="+window.cacheKillerVersion+"&skin="+appCurrentSkin+"&locale="+l;
tinyMCE.init({
mode:(s==DwtHtmlEditor.HTML)?"exact":"none",elements:t,plugins:"table,ztable,inlinepopups,zcontextmenu,fullscreen,zbreakquote",theme:"advanced",theme_advanced_buttons1:"fontselect,fontsizeselect,formatselect,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,bold,italic,underline,separator,forecolor,backcolor,separator,link,ztablecontrols,fullscreen",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_buttons4:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_resizing:true,convert_urls:false,verify_html:false,gecko_spellcheck:true,force_br_newlines:true,forced_root_block:"",force_p_newlines:false,content_css:false,editor_css:e,inline_styles:false,setup:function(d){
d.onLoadContent.add(n);
d.onInit.add(c);
d.onKeyPress.add(i)
}}
);
this._editor=this.getEditor();
this._iFrameId=this._bodyTextAreaId+"_ifr"
};
ZmAdvancedHtmlEditor.prototype.setMode=function(s,o){
this.discardMisspelledWords();
if(s==this._mode||(s!=DwtHtmlEditor.HTML&&s!=DwtHtmlEditor.TEXT)){
return
}
this._mode=s;
var e=this.getEditor();
if(s==DwtHtmlEditor.HTML){
var n=this.getContentField();
if(e&&e.getDoc()){
var i=e.getDoc();
var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
i.body.innerHTML=a;
this._pendingContent=a;
n.value="";
this._editorContainer.setFocusMember(e.getWin())
}else{
var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
this._pendingContent=a
}
tinyMCE.execCommand("mceToggleEditor",false,this._bodyTextAreaId)
}else{
var n=this.getContentField();
var i=e.getDoc();
var t=o?this._convertHtml2Text():i.innerHTML;
tinyMCE.execCommand("mceToggleEditor",false,this._bodyTextAreaId);
n.value=t;
this._editorContainer.setFocusMember(n)
}};
ZmAdvancedHtmlEditor.prototype.getContentField=function(){
return document.getElementById(this._bodyTextAreaId)
};
ZmAdvancedHtmlEditor.prototype.insertImage=function(n,s,o,t){
var i=[];
var e=0;
i[e++]="<img";
i[e++]=" src='";
i[e++]=n;
i[e++]="'";
if(o!=null){
i[e++]=" width='"+o+"'"
}
if(t!=null){
i[e++]=" height='"+t+"'"
}
i[e++]=">";
var a=this.getEditor();
if(tinymce.isWebKit){
a.getWin().focus()
}
a.execCommand("mceInsertContent",false,i.join(""),{
skip_undo:1}
)
};
ZmAdvancedHtmlEditor.prototype.initDefaultFontSize=function(e){
var t=e&&e.getDoc();
if(t){
t.body.style.fontFamily=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
t.body.style.fontSize=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
t.body.style.color=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR)
}};
ZmAdvancedHtmlEditor.prototype.addCSSForDefaultFontSize=function(t){
var a="body,td,pre";
var e=["font-family:",appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY),";","font-size:",appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE),";","color:",appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR),";"].join("");
var i=t?t.getDoc():null;
if(i){
this.insertDefaultCSS(i,a,e)
}};
ZmAdvancedHtmlEditor.prototype.insertDefaultCSS=function(o,i,t){
var a,e;
if(o.createStyleSheet){
a=o.createStyleSheet()
}else{
e=o.createElement("style");
o.getElementsByTagName("head")[0].appendChild(e);
a=e.styleSheet?e.styleSheet:e.sheet
}
if(!a&&e){
t=t.replace(/^\{?([^\}])/,"$1");
e.innerHTML=i+t
}else{
if(a.addRule){
t=t.replace(/^\{?([^\}])/,"$1");
a.addRule(i,t)
}else{
if(a.insertRule){
if(!/^\{[^\}]*\}$/.test(t)){
t="{"+t+"}"
}
a.insertRule(i+" "+t,a.cssRules.length)
}}}};
ZmAdvancedHtmlEditor.prototype.resetSpellCheck=function(){
this.discardMisspelledWords();
this._spellCheckHideModeDiv()
};
ZmAdvancedHtmlEditor.prototype.checkMisspelledWords=function(o,t,e){
var i=this.getTextVersion();
if(/\S/.test(i)){
AjxDispatcher.require("Extras");
this._spellChecker=new ZmSpellChecker(this);
this._spellCheck=null;
this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
if(!this.onExitSpellChecker){
this.onExitSpellChecker=t
}
var a={
text:i,ignore:AjxUtil.keys(this._ignoreWords).join()};
this._spellChecker.check(a,o,e);
return true
}
return false
};
ZmAdvancedHtmlEditor.prototype.spellCheck=function(a){
var t=this.getTextVersion();
if(/\S/.test(t)){
AjxDispatcher.require("Extras");
this._spellChecker=new ZmSpellChecker(this);
this._spellCheck=null;
this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
if(!this.onExitSpellChecker){
this.onExitSpellChecker=a
}
var e={
text:t,ignore:AjxUtil.keys(this._ignoreWords).join()};
this._spellChecker.check(e,new AjxCallback(this,this._spellCheckCallback));
return true
}
return false
};
ZmAdvancedHtmlEditor.prototype._spellCheckCallback=function(i){
var e=false;
if(i&&i.available){
var a=i.misspelled;
if(a==null||a.length==0){
appCtxt.setStatusMsg(ZmMsg.noMisspellingsFound,ZmStatusView.LEVEL_INFO)
}else{
var t=AjxMessageFormat.format(ZmMsg.misspellingsResult,a.length);
appCtxt.setStatusMsg(t,ZmStatusView.LEVEL_WARNING);
this.highlightMisspelledWords(a);
e=true
}}else{
appCtxt.setStatusMsg(ZmMsg.spellCheckUnavailable,ZmStatusView.LEVEL_CRITICAL)
}
if(AjxEnv.isGeckoBased&&this._mode==DwtHtmlEditor.HTML){
setTimeout(AjxCallback.simpleClosure(this.focus,this),10)
}
if(this.onExitSpellChecker){
this.onExitSpellChecker.run(e)
}};
ZmAdvancedHtmlEditor.prototype._spellCheckSuggestionListener=function(h){
var f=this;
var m=h.item;
var d=m.getData("orig");
if(!d){
return
}
var t=m.getData(ZmHtmlEditor._VALUE);
var o=this._mode==DwtHtmlEditor.TEXT;
var s=m.getData("fixall");
var u=o?document:this._getIframeDoc();
var c=u.getElementById(m.getData("spanId"));
var i=m.getData(ZmPopupMenu.MENU_ITEM_ID_KEY);
switch(i){
case"ignore":t=d;
this._ignoreWords[t]=true;
if(s){}
break;
case"add":t=d;
var l=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
var n=l.set("pref",t);
n.setAttribute("name","+zimbraPrefSpellIgnoreWord");
var a={
soapDoc:l,asyncMode:true,callback:new AjxCallback(appCtxt,appCtxt.setStatusMsg,[ZmMsg.wordAddedToDictionary])};
appCtxt.getAppController().sendRequest(a);
this._ignoreWords[t]=true;
break;
default:break
}
if(o&&t==null){
this._editWord(s,c)
}else{
var e=s?this._spellCheck.wordIds[d]:c;
this._editWordFix(e,t)
}
this._handleSpellCheckerEvents(null)
};
ZmAdvancedHtmlEditor.prototype._getEditorDocument=function(){
var e=this._mode==DwtHtmlEditor.TEXT;
return e?document:this._getIframeDoc()
};
ZmAdvancedHtmlEditor.prototype._editWord=function(s,e){
var o=this._getEditorDocument();
var t=o.createElement("input");
t.type="text";
t.value=AjxUtil.getInnerText(e);
t.className="SpellCheckInputField";
t.style.left=e.offsetLeft-2+"px";
t.style.top=e.offsetTop-2+"px";
t.style.width=e.offsetWidth+4+"px";
var n=o.getElementById(this._spellCheckDivId);
var i=n.scrollTop;
n.appendChild(t);
n.scrollTop=i;
t.setAttribute("autocomplete","off");
t.focus();
if(!AjxEnv.isGeckoBased){
t.select()
}else{
t.setSelectionRange(0,t.value.length)
}
var a=AjxCallback.simpleClosure(this._editWordHandler,this,s,e);
t.onblur=a;
t.onkeydown=a
};
ZmAdvancedHtmlEditor.prototype._editWordHandler=function(a,e,t){
setTimeout(AjxCallback.simpleClosure(this._editWordHandler2,this,a,e,t),20)
};
ZmAdvancedHtmlEditor.prototype._editWordHandler2=function(s,o,h){
h=DwtUiEvent.getEvent(h);
var l=h.type;
var t=h.keyCode;
var i=h.ctrlKey;
var c=DwtUiEvent.getTarget(h);
var n=/key/.test(l);
var a=true;
if(/blur/.test(l)||(n&&t==13)){
if(i){
s=!s
}
var d=AjxUtil.getInnerText(o);
var e=s?this._spellCheck.wordIds[d]:o;
this._editWordFix(e,c.value)
}else{
if(n&&t==27){
this._editWordFix(o,AjxUtil.getInnerText(o))
}else{
a=false
}}
if(a){
c.onblur=null;
c.onkeydown=null;
if(c.parentNode){
c.parentNode.removeChild(c)
}}
this._handleSpellCheckerEvents(null)
};
ZmAdvancedHtmlEditor.prototype._editWordFix=function(a,o){
a=a instanceof Array?a:[a];
var n=this._getEditorDocument();
for(var t=a.length-1;
t>=0;
t--){
var e=a[t];
if(typeof e=="string"){
e=n.getElementById(e)
}
if(e){
e.innerHTML=o
}}};
ZmAdvancedHtmlEditor.prototype._getParentElement=function(){
var e=this.getEditor();
if(e.selection){
return e.selection.getNode()
}else{
var t=this._getIframeDoc();
return t?t.body:null
}};
ZmAdvancedHtmlEditor.prototype._handleSpellCheckerEvents=function(v){
var l=this._mode==DwtHtmlEditor.TEXT;
var u=l?(v?DwtUiEvent.getTarget(v):null):this._getParentElement(),g,f,y,c,d=this,e=this._spellCheck,k=l?document:this._getIframeDoc(),n=false,b="";
if(v&&/^span$/i.test(u.tagName)&&/ZM-SPELLCHECK/.test(u.className)){
b=u.getAttribute("word");
window.status="Suggestions: "+e.suggestions[b].join(", ");
n=b!=AjxUtil.getInnerText(u)
}
f=e.spanIds;
for(y in f){
g=k.getElementById(y);
if(g){
if(f[y]!=AjxUtil.getInnerText(g)||this._ignoreWords[f[y]]){
g.className="ZM-SPELLCHECK-FIXED"
}else{
if(f[y]==b){
g.className="ZM-SPELLCHECK-MISSPELLED2"
}else{
g.className="ZM-SPELLCHECK-MISSPELLED"
}}}}
if(e.menu&&(!v||(/click|mousedown|mouseup|contextmenu/.test(v.type)||(/key/.test(v.type)&&(!b||n))))){
if(e.menu._menuItems.fixall){
e.menu._menuItems.fixall.getMenu().dispose()
}
e.menu.dispose();
e.menu=null;
window.status=""
}
if(v&&b&&(c=e.suggestions[b])&&(/mouseup|contextmenu/i.test(v.type)||(l&&/(click|mousedown|contextmenu)/i.test(v.type)))&&(b==AjxUtil.getInnerText(u)&&!this._ignoreWords[b])){
e.menu=this._spellCheckCreateMenu(this.getParent(),0,c,b,u.id,n);
if(e.wordIds[b].length>1){
e.menu.createSeparator();
this._replaceAllFormatter=this._replaceAllFormatter||new AjxMessageFormat(ZmMsg.replaceAllMenu);
var s=this._replaceAllFormatter.format(e.wordIds[b].length);
var w=e.menu.createMenuItem("fixall",{
text:s}
);
w.setMenu(makeMenu(1,w))
}
var o,m=e.menu.getSize(),t=this._editorContainer.shell.getSize();
if(!l){
o=Dwt.toWindow(document.getElementById(this._iFrameId),0,0,null,true);
var a=Dwt.toWindow(u,0,0,null,true);
o.x+=a.x-(k.documentElement.scrollLeft||k.body.scrollLeft);
o.y+=a.y-(k.documentElement.scrollTop||k.body.scrollTop)
}else{
o=Dwt.toWindow(u,0,0,null,true);
var h=document.getElementById(this._spellCheckDivId);
o.x-=h.scrollLeft;
o.y-=h.scrollTop
}
o.y+=u.offsetHeight;
if(o.y+m.y>t.y){
o.y-=m.y+u.offsetHeight
}
e.menu.popup(0,o.x,o.y);
v._stopPropagation=true;
v._returnValue=false
}};
ZmAdvancedHtmlEditor.prototype._spellCheckCreateMenu=function(d,c,l,t,o,u){
var a=new ZmPopupMenu(d);
if(u){
var s="<b>"+t+"</b>";
this._spellCheckCreateMenuItem(a,"orig",{
text:s}
,c,t,t,o)
}
if(l.length>0){
for(var n=0;
n<l.length;
++n){
this._spellCheckCreateMenuItem(a,"sug-"+n,{
text:l[n],className:""}
,c,l[n],t,o)
}
if(!(d instanceof DwtMenuItem)&&this._spellCheck.wordIds[t].length>1){
if(!this._replaceAllFormatter){
this._replaceAllFormatter=new AjxMessageFormat(ZmMsg.replaceAllMenu)
}
var s="<i>"+this._replaceAllFormatter.format(this._spellCheck.wordIds[t].length)+"</i>";
var m=a.createMenuItem("fixall",{
text:s}
);
var e=this._spellCheckCreateMenu(m,1,l,t,o,u);
m.setMenu(e)
}}else{
var m=this._spellCheckCreateMenuItem(a,"noop",{
text:ZmMsg.noSuggestions}
,c,"",t,o);
m.setEnabled(false);
this._spellCheckCreateMenuItem(a,"clear",{
text:"<i>"+ZmMsg.clearText+"</i>"}
,c,"",t,o)
}
a.createSeparator();
var h=this._mode==DwtHtmlEditor.TEXT;
if(h){
var s=c?ZmMsg.editAll:ZmMsg.edit;
this._spellCheckCreateMenuItem(a,"edit",{
text:s}
,c,null,t,o)
}
if(!c){
this._spellCheckCreateMenuItem(a,"ignore",{
text:ZmMsg.ignoreWord}
,0,null,t,o)
}
if(!c&&appCtxt.get(ZmSetting.SPELL_CHECK_ADD_WORD_ENABLED)){
this._spellCheckCreateMenuItem(a,"add",{
text:ZmMsg.addWord}
,c,null,t,o)
}
return a
};
ZmAdvancedHtmlEditor.prototype._spellCheckCreateMenuItem=function(a,t,o,s,h,e,n,i){
if(o.className==null){
o.className="ZMenuItem ZmSpellMenuItem"
}
var l=a.createMenuItem(t,o);
l.setData("fixall",s);
l.setData("value",h);
l.setData("orig",e);
l.setData("spanId",n);
l.addSelectionListener(i||this._spellCheckSuggestionListenerObj);
return l
};
ZmAdvancedHtmlEditor.prototype.discardMisspelledWords=function(c){
if(!this._spellCheck){
return
}
if(this._mode==DwtHtmlEditor.HTML){
var s=this._getIframeDoc();
s.body.style.display="none";
var t=null;
var h=this._spellCheck.spanIds;
for(var n in h){
var l=s.getElementById(n);
if(!l){
continue
}
t=l.parentNode;
while(l.firstChild){
t.insertBefore(l.firstChild,l)
}
t.removeChild(l)
}
if(!AjxEnv.isIE){
s.body.normalize()
}else{
s.body.innerHTML=s.body.innerHTML
}
t=s.getElementById("ZM-SPELLCHECK-STYLE");
if(t){
t.parentNode.removeChild(t)
}
s.body.style.display="";
this._unregisterEditorEventHandler(s,"contextmenu")
}else{
if(this._spellCheckDivId!=null){
var e=document.getElementById(this._spellCheckDivId);
var o=e.scrollTop;
var a=document.getElementById(this._textAreaId);
if(AjxEnv.isGeckoBased){
e.innerHTML=AjxStringUtil.htmlDecode(e.innerHTML,true)
}
a.value=AjxUtil.getInnerText(e);
e.onclick=null;
e.oncontextmenu=null;
e.onmousedown=null;
e.parentNode.removeChild(e);
a.style.display="";
a.scrollTop=o
}}
this._spellCheckDivId=this._spellCheck=null;
window.status="";
if(!c){
this._spellCheckHideModeDiv()
}
if(this.onExitSpellChecker){
this.onExitSpellChecker.run()
}};
ZmAdvancedHtmlEditor.prototype._spellCheckShowModeDiv=function(){
var o=this._editorContainer.getSize();
if(!this._spellCheckModeDivId){
var s=document.createElement("div");
s.className="SpellCheckModeDiv";
s.id=this._spellCheckModeDivId=Dwt.getNextId();
var a=new Array();
var t=0;
a[t++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='width:25'>";
a[t++]=AjxImg.getImageHtml("SpellCheck");
a[t++]="</td><td style='white-space:nowrap'><span class='SpellCheckLink'>";
a[t++]=ZmMsg.resumeEditing;
a[t++]="</span> | <span class='SpellCheckLink'>";
a[t++]=ZmMsg.checkAgain;
a[t++]="</span></td></tr></table>";
s.innerHTML=a.join("");
var e=this._editorContainer.getHtmlElement();
e.insertBefore(s,e.firstChild);
var n=s.getElementsByTagName("span");
Dwt.associateElementWithObject(n[0],this);
Dwt.setHandler(n[0],"onclick",ZmAdvancedHtmlEditor._spellCheckResumeEditing);
Dwt.associateElementWithObject(n[1],this);
Dwt.setHandler(n[1],"onclick",ZmAdvancedHtmlEditor._spellCheckAgain)
}else{
document.getElementById(this._spellCheckModeDivId).style.display=""
}
this.setSize(o.x,o.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
};
ZmAdvancedHtmlEditor._spellCheckResumeEditing=function(){
var e=Dwt.getObjectFromElement(this);
e.discardMisspelledWords()
};
ZmAdvancedHtmlEditor._spellCheckAgain=function(){
var e=Dwt.getObjectFromElement(this);
e.discardMisspelledWords();
e.spellCheck()
};
ZmAdvancedHtmlEditor.prototype._spellCheckHideModeDiv=function(){
var e=this._editorContainer.getSize();
if(this._spellCheckModeDivId){
document.getElementById(this._spellCheckModeDivId).style.display="none"
}
this.setSize(e.x,e.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
};
ZmAdvancedHtmlEditor.prototype.highlightMisspelledWords=function(m,t){
this.discardMisspelledWords(t);
var b,g,v,n,u=this,s={}
,f={}
,k=["([^A-Za-z0-9']|^)("],c={};
for(var p=0;
p<m.length;
++p){
b=m[p].word;
if(!c[b]){
p&&k.push("|");
k.push(b);
var w=m[p].suggestions.split(/\s*,\s*/);
if(!w[w.length-1]){
w.pop()
}
c[b]=w;
if(c[b].length>5){
c[b].length=5
}}}
k.push(")([^A-Za-z0-9']|$)");
k=new RegExp(k.join(""),"gm");
function l(T,A){
T=A?AjxStringUtil.convertToHtml(T):AjxStringUtil.htmlEncode(T);
var x;
k.lastIndex=0;
while(x=k.exec(T)){
var z=x[0];
var q=x[1];
var a=x[2];
var O=x[3];
var i=Dwt.getNextId();
s[i]=a;
if(!f[a]){
f[a]=[]
}
f[a].push(i);
var j=[q,'<span word="',a,'" id="',i,'" class="ZM-SPELLCHECK-MISSPELLED">',a,"</span>",O].join("");
T=[T.substr(0,x.index),j,T.substr(x.index+z.length)].join("");
k.lastIndex=x.index+j.length-O.length
}
return T
}
var v;
rec=function(T){
switch(T.nodeType){
case 1:for(var z=T.firstChild;
z;
z=rec(z)){}
T=T.nextSibling;
break;
case 3:if(!/[^\s\xA0]/.test(T.data)){
T=T.nextSibling;
break
}
var j=null,q=null;
var x=/^[\s\xA0]+/.exec(T.data);
if(x){
j=T;
T=T.splitText(x[0].length)
}
x=/[\s\xA0]+$/.exec(T.data);
if(x){
q=T.splitText(T.data.length-x[0].length)
}
var A=l(T.data,false);
A=A.replace(/^ +/,"&nbsp;").replace(/ +$/,"&nbsp;");
var W=v.createElement("div");
W.innerHTML=A;
if(j){
W.insertBefore(j,W.firstChild)
}
if(q){
W.appendChild(q)
}
var O=T.parentNode;
while(W.firstChild){
O.insertBefore(W.firstChild,T)
}
W=T.nextSibling;
O.removeChild(T);
T=W;
break;
default:T=T.nextSibling
}
return T
};
if(this._mode==DwtHtmlEditor.HTML){
v=this._getIframeDoc();
n=v.body;
this._loadExternalStyle("/css/spellcheck.css");
n.style.display="none";
if(!AjxEnv.isIE){
n.normalize()
}else{
n.innerHTML=n.innerHTML
}
rec(n);
if(!AjxEnv.isIE){
n.normalize()
}else{
n.innerHTML=n.innerHTML
}
n.style.display="";
var o=this.getEditor();
o.onContextMenu.add(this._handleEditorEvent,this);
o.onMouseUp.add(this._handleEditorEvent,this)
}else{
var y=document.getElementById(this._textAreaId);
var e=y.scrollTop;
var d=Dwt.getSize(y);
y.style.display="none";
var h=document.createElement("div");
h.className="TextSpellChecker";
this._spellCheckDivId=h.id=Dwt.getNextId();
h.style.overflow="auto";
if(!AjxEnv.isIE){
d.x-=4;
d.y-=6
}
h.style.width=d.x+"px";
h.style.height=d.y+"px";
h.innerHTML=AjxStringUtil.convertToHtml(this.getContent());
v=document;
rec(h);
y.parentNode.insertBefore(h,y);
h.scrollTop=e;
h.oncontextmenu=h.onclick=function(a){
u._handleSpellCheckerEvents(a||window.event)
}
}
this._spellCheckShowModeDiv();
this._spellCheck={
suggestions:c,spanIds:s,wordIds:f}
};
ZmAdvancedHtmlEditor.prototype._loadExternalStyle=function(o){
var i=this._getIframeDoc();
var t=i.getElementById(o);
if(!t){
t=i.createElement("link");
t.id=o;
t.rel="stylesheet";
t.type="text/css";
var a=appContextPath+o+"?v="+cacheKillerVersion;
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
a=document.baseURI.replace(/^(https?:\x2f\x2f[^\x2f]+).*$/,"$1")+a
}
t.href=a;
var e=i.getElementsByTagName("head")[0];
if(!e){
e=i.createElement("head");
var n=i.documentElement;
if(n){
n.insertBefore(e,n.firstChild)
}}
e.appendChild(t)
}};
ZmAdvancedHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
if(AjxEnv.isIE){
t.attachEvent("on"+e,this.__eventClosure)
}else{
t.addEventListener(e,this.__eventClosure,true)
}};
ZmAdvancedHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
if(AjxEnv.isIE){
t.detachEvent("on"+e,this.__eventClosure)
}else{
t.removeEventListener(e,this.__eventClosure,true)
}};
ZmAdvancedHtmlEditor.prototype.__eventClosure=function(e){
this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e);
return tinymce.dom.Event.cancel(e)
};
ZmAdvancedHtmlEditor.prototype._handleEditorEvent=function(i,n){
var t=true;
if(n.type=="contextmenu"){
var h=DwtShell.mouseEvent;
h.setFromDhtmlEvent(n);
var o=Dwt.getLocation(document.getElementById(this._iFrameId));
if(!AjxEnv.isIE){
var s=this._getIframeDoc();
var a=s.documentElement.scrollLeft||s.body.scrollLeft;
var c=s.documentElement.scrollTop||s.body.scrollTop;
o.x-=a;
o.y-=c
}
h.docX+=o.x;
h.docY+=o.y;
DwtControl.__mouseEvent(n,DwtEvent.ONCONTEXTMENU,this,h);
t=h._returnValue
}
var l=this;
if(this._spellCheck){
var e;
if(/mouse|context|click|select/i.test(n.type)){
e=new DwtMouseEvent(true)
}else{
e=new DwtUiEvent(true)
}
e.setFromDhtmlEvent(n);
this._TIMER_spell=setTimeout(function(){
l._handleSpellCheckerEvents(e);
this._TIMER_spell=null
}
,100);
return tinymce.dom.Event.cancel(n)
}
return t
};
ZmAdvancedHtmlEditor.prototype._getSelection=function(){
if(AjxEnv.isIE){
return this._getIframeDoc().selection
}else{
return this._getIframeWin().getSelection()
}};
ZmEditorContainer=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,ZmEditorContainer.PARAMS);
DwtComposite.call(this,e)
};
ZmEditorContainer.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
ZmEditorContainer.prototype=new DwtComposite();
ZmEditorContainer.prototype.constructor=ZmEditorContainer;
ZmEditorContainer.prototype.setFocusMember=function(e){
this._focusMember=e
};
ZmEditorContainer.prototype._focus=function(){
if(this._focusMember){
this._focusMember.focus()
}}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmDialog")){
ZmDialog=function(e){
if(arguments.length==0){
return
}
DwtDialog.call(this,e);
if(!e.view){
this.setContent(this._contentHtml())
}
if(this._button[DwtDialog.OK_BUTTON]){
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._okButtonListener))
}
this._overview={};
this._opc=appCtxt.getOverviewController();
this._baseTabGroupSize=this._tabGroup.size()
};
ZmDialog.prototype=new DwtDialog;
ZmDialog.prototype.constructor=ZmDialog;
ZmDialog.prototype._contentHtml=function(){
return""
};
ZmDialog.prototype.setView=function(i,e){
this.reset();
if(i){
var a=this._getContentDiv();
var t=i.getHtmlElement();
a.parentNode.replaceChild(t,a);
this._contentDiv=t
}};
ZmDialog.prototype.popup=function(){
this._tabGroup.__members._array.splice(this._baseTabGroupSize);
this._tabGroup.addMember(this._getTabGroupMembers());
DwtDialog.prototype.popup.call(this);
if(this._focusElement){
appCtxt.getKeyboardMgr().grabFocus(this._focusElement)
}};
ZmDialog.prototype.reset=function(){
if(this._nameField){
this._nameField.value=""
}
DwtDialog.prototype.reset.call(this)
};
ZmDialog.prototype._okButtonListener=function(){
this.popdown()
};
ZmDialog.prototype._setNameField=function(e){
this._nameField=this._focusElement=document.getElementById(e);
if(this._enterListener){
this.addEnterListener(new AjxListener(this,this._enterListener))
}};
ZmDialog.prototype._setOverview=function(i,e){
if(appCtxt.multiAccounts){
var t=this._opc.getOverviewContainer(this._curOverviewId)||this._opc.getOverview(this._curOverviewId);
if(t){
t.setVisible(false)
}}
if(appCtxt.multiAccounts&&!e){
var s=this._curOverviewId=i.overviewId;
var l=this._opc.getOverviewContainer(s);
if(!l){
var h={
overviewClass:"dialogOverviewContainer",headerClass:"DwtTreeItem",noTooltips:true,treeStyle:i.treeStyle,treeIds:i.treeIds,overviewTrees:i.overviewTrees,omit:i.omit,omitPerAcct:i.omitPerAcct,selectable:i.selectable};
var o={
appName:i.appName,containerId:s};
l=this._opc.createOverviewContainer(o,h);
l.setSize(Dwt.DEFAULT,"200");
document.getElementById(i.fieldId).appendChild(l.getHtmlElement())
}
l.setVisible(true);
return l
}
var a=this._curOverviewId=i.overviewId;
var c=this._opc.getOverview(a);
if(!c){
var n={
overviewId:a,overviewClass:"dialogOverview",headerClass:"DwtTreeItem",noTooltips:true,treeStyle:i.treeStyle,treeIds:i.treeIds,account:((appCtxt.multiAccounts&&i.forceSingle)?appCtxt.getActiveAccount():i.account)};
c=this._overview[a]=this._opc.createOverview(n);
this._renderOverview(c,i.treeIds,i.omit,i.noRootSelect);
document.getElementById(i.fieldId).appendChild(c.getHtmlElement())
}
this._makeOverviewVisible(a);
return c
};
ZmDialog.prototype._makeOverviewVisible=function(e){
for(var t in this._overview){
this._overview[t].setVisible(t==e)
}};
ZmDialog.prototype._renderOverview=function(h,a,n,s){
h.set(a,n);
if(!s){
for(var o=0;
o<a.length;
o++){
var e=h.getTreeView(a[o]);
var t=e&&e.getHeaderItem();
if(t){
t.enableSelection(true)
}}}};
ZmDialog.prototype._getOverview=function(){
return this._overview[this._curOverviewId]
};
ZmDialog.prototype._getInputFields=function(){
return(this._nameField)?[this._nameField]:null
};
ZmDialog.prototype._showError=function(i,a){
var t=a||(new DwtPoint(this.getLocation().x+50,this.getLocation().y+100));
var e=appCtxt.getMsgDialog();
e.reset();
e.setMessage(i,DwtMessageDialog.CRITICAL_STYLE);
e.popup(t)
};
ZmDialog.prototype._getTabGroupMembers=function(){
return[this._nameField]
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmAttachDialog")){
ZmAttachDialog=function(e,t){
t=t||"ZmAttachDialog";
DwtDialog.call(this,{
parent:e,className:t,title:ZmMsg.attachFile}
);
this._createBaseHtml();
this._defaultCancelCallback=new AjxCallback(this,this._defaultCancelListener);
this._cancelListeners={};
this._defaultOkCallback=new AjxCallback(this,this._defaultOkListener);
this._okListeners={};
this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,function(){
this._cancelButtonListener()
}
));
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
this._okButtonListener()
}
));
this._tabKeys={};
var a=this.getButton(DwtDialog.OK_BUTTON);
a.setText(ZmMsg.attach);
this._addMyComputerTab();
if(appCtxt.get(ZmSetting.BRIEFCASE_ENABLED)){
this._addBriefcaseViewTab()
}};
ZmAttachDialog.prototype=new DwtDialog;
ZmAttachDialog.prototype.constructor=ZmAttachDialog;
ZmAttachDialog.TABKEY_MYCOMPUTER="MY_COMPUTER";
ZmAttachDialog.TABKEY_BRIEFCASE="BRIEFCASE";
ZmAttachDialog.supportsHTML5=(window.FileReader||AjxEnv.isChrome||AjxEnv.isSafari4up);
ZmAttachDialog.prototype.addCancelListener=function(t,e){
if(e&&(e instanceof AjxListener||e instanceof AjxCallback)){
this._cancelListeners[t]=e
}};
ZmAttachDialog.prototype._defaultCancelListener=function(){
this.popdown()
};
ZmAttachDialog.prototype._cancelButtonListener=function(){
var e=this._cancelListeners[this._tabView.getCurrentTab()];
if(e){
e.run()
}else{
this._defaultCancelCallback.run()
}};
ZmAttachDialog.prototype.addOkListener=function(t,e){
if(e&&(e instanceof AjxListener||e instanceof AjxCallback)){
this._okListeners[t]=e
}};
ZmAttachDialog.prototype._defaultOkListener=function(){
this.popdown()
};
ZmAttachDialog.prototype._okButtonListener=function(){
var t=this.getButton(DwtDialog.OK_BUTTON);
t.setEnabled(false);
var e=this._okListeners[this._tabView.getCurrentTab()];
if(e){
e.run(this)
}else{
this._defaultOkCallback.run()
}
t.setEnabled(true)
};
ZmAttachDialog.prototype._createBaseHtml=function(){
this._baseContainerView=new DwtComposite({
parent:this,className:"ZmAttachDialog-container"}
);
this._initializeTabView(this._baseContainerView);
this.setView(this._baseContainerView)
};
ZmAttachDialog.prototype._initializeTabView=function(e){
this._tabView=new ZmAttachTabView(e,null,Dwt.STATIC_STYLE);
this._tabView.addTabChangeListener(new AjxListener(this,this.tabChangeListener));
this._tabView.addStateChangeListener(new AjxListener(this,this.stateChangeListener));
this._setAttachmentSizeSection(e);
this._setInlineOptionSection(e);
this._setFooterSection(e)
};
ZmAttachDialog.prototype.stateChangeListener=function(e){
this._resetInlineOption()
};
ZmAttachDialog.prototype.tabChangeListener=function(t){
this.setFooter("");
var a=this._tabView.getCurrentTab();
var e=this._tabView.getTabView(a);
if(e&&e.gotAttachments()){
this.setFooter(ZmMsg.attachClearUploadMessage);
return false
}
return true
};
ZmAttachDialog.prototype._setAttachmentSizeSection=function(e){
var a=document.createElement("div");
a.className="ZmAttachDialog-note";
var t=AjxUtil.formatSize(appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)||0,true);
a.innerHTML=AjxMessageFormat.format(ZmMsg.attachmentLimitMsg,t);
e.getHtmlElement().appendChild(a)
};
ZmAttachDialog.prototype._setFooterSection=function(e){
var t=document.createElement("div");
t.className="ZmAttachDialog-footer";
t.id=Dwt.getNextId();
e.getHtmlElement().appendChild(t);
this._footer=document.getElementById(t.id)
};
ZmAttachDialog.prototype.setFooter=function(e){
if(typeof e=="string"){
this._footer.innerHTML=e
}else{
this._footer.appendChild(e)
}};
ZmAttachDialog.prototype.getTabView=function(){
return this._tabView
};
ZmAttachDialog.prototype.addTab=function(a,t,e){
if(!this._tabView||!e){
return null
}
this._tabKeys[a]=this._tabView.addTab(t,e);
return this._tabKeys[a]
};
ZmAttachDialog.prototype.getTabKey=function(e){
return this._tabKeys[e]
};
ZmAttachDialog.prototype.getTabViewPage=function(e){
return this._tabView.getTabView(this._tabKeys[e])
};
ZmAttachDialog.prototype.popup=function(){
var e=this.getTabKey(ZmAttachDialog.TABKEY_MYCOMPUTER);
this._tabView.switchToTab(e,true);
this.setButtonEnabled(DwtDialog.OK_BUTTON,true);
this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
this.setFooter("");
DwtDialog.prototype.popup.call(this);
this.setFooter("")
};
ZmAttachDialog.prototype.uploadFiles=function(){
this.setFooter("");
var a=this._tabView.getCurrentTab();
var e=this._tabView.getTabView(a);
if(e&&e.validate){
var t=e.validate();
if(!t.status){
this.setFooter(t.error);
return false
}}
if(e&&e.gotAttachments()){
this.upload(this._uploadCallback,e.uploadForm)
}else{
this.setFooter(ZmMsg.attachSelectMessage)
}};
ZmAttachDialog.prototype.cancelUploadFiles=function(){
this._cancelUpload=true;
this._defaultCancelListener()
};
ZmAttachDialog.prototype.setUploadCallback=function(e){
this._uploadCallback=e
};
ZmAttachDialog.prototype.getUploadCallback=function(){
return this._uploadCallback
};
ZmAttachDialog.prototype.upload=function(t,e){
if(!t){
t=false
}
this.setButtonEnabled(DwtDialog.OK_BUTTON,false);
this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
this.setFooter(ZmMsg.attachingFiles);
this._cancelUpload=false;
this._processUpload(t,e)
};
ZmAttachDialog.prototype._processUpload=function(o,a){
var i=new AjxCallback(this,this._uploadDoneCallback,[o]);
var e=appCtxt.getUploadManager();
window._uploadManager=e;
try{
e.execute(i,a)
}
catch(t){
i.run()
}};
ZmAttachDialog.prototype._uploadDoneCallback=function(n,e,t){
if(this._cancelUpload){
return
}
this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
if(e==AjxPost.SC_OK){
this.setFooter(ZmMsg.attachingFilesDone);
if(n){
n.run(e,t)
}}else{
if(e==AjxPost.SC_UNAUTHORIZED){
var i=new AjxException("401 response during attachment upload",ZmCsfeException.SVC_AUTH_EXPIRED);
appCtxt.getAppController()._handleException(i,{
continueCallback:n}
)
}else{
var o=AjxMessageFormat.format(ZmMsg.errorAttachment,(e||AjxPost.SC_NO_CONTENT));
switch(e){
case AjxPost.SC_REQUEST_ENTITY_TOO_LARGE:o+=" "+ZmMsg.errorAttachmentTooBig+"<br><br>";
break;
default:o+=" ";
break
}
var a=appCtxt.getMsgDialog();
a.setMessage(o,DwtMessageDialog.CRITICAL_STYLE);
a.popup();
this.setFooter(ZmMsg.attachingFilesError)
}}
this.setButtonEnabled(DwtDialog.OK_BUTTON,true)
};
ZmAttachDialog.prototype._addMyComputerTab=function(){
this._myComputerTabViewPage=new ZmMyComputerTabViewPage(this._tabView);
var e=this.addTab(ZmAttachDialog.TABKEY_MYCOMPUTER,ZmMsg.myComputer,this._myComputerTabViewPage);
this.addOkListener(e,(new AjxCallback(this,this.uploadFiles)));
this.addCancelListener(e,(new AjxCallback(this,this.cancelUploadFiles)))
};
ZmAttachDialog.prototype._addBriefcaseViewTab=function(){
var e=new AjxCallback(this,this.getBriefcaseTabView);
var t=this.addTab(ZmAttachDialog.TABKEY_BRIEFCASE,ZmMsg.briefcase,e)
};
ZmAttachDialog.prototype.getBriefcaseTabView=function(t){
if(!this._briefcaseTabView){
AjxDispatcher.require(["BriefcaseCore","Briefcase"]);
this._briefcaseTabView=new ZmBriefcaseTabView(this._tabView);
var e=new AjxCallback(this._briefcaseTabView,this._briefcaseTabView.uploadFiles);
this.addOkListener(t,e);
this.addCancelListener(t,(new AjxCallback(this,this.cancelUploadFiles)))
}
return this._briefcaseTabView
};
ZmAttachDialog.prototype._setInlineOptionSection=function(e){
var t=document.createElement("div");
t.className="ZmAttachDialog-inline";
t.id=Dwt.getNextId();
e.getHtmlElement().appendChild(t);
this._inlineOption=document.getElementById(t.id)
};
ZmAttachDialog.prototype.enableInlineOption=function(e){
if(e){
var t=this._htmlElId+"_inlineCheckbox";
this._inlineOption.setAttribute("option","inline");
this._inlineOption.innerHTML=["<input type='checkbox' name='inlineimages' id='",t,"'> <label for='",t,"'>",ZmMsg.inlineAttachmentOption,"</label>"].join("")
}else{
this._inlineOption.innerHTML=""
}};
ZmAttachDialog.prototype._resetInlineOption=function(){
var e=document.getElementById(this._htmlElId+"_inlineCheckbox");
if(e){
e.checked=false
}};
ZmAttachDialog.prototype.isInline=function(){
var e=document.getElementById(this._htmlElId+"_inlineCheckbox");
return(e&&e.checked)
};
ZmAttachTabView=function(a,t,e){
if(arguments.length==0){
return
}
DwtTabView.call(this,a,t,e)
};
ZmAttachTabView.prototype=new DwtTabView;
ZmAttachTabView.prototype.constructor=new ZmAttachTabView;
ZmAttachTabView.prototype.addTabChangeListener=function(e){
this._addTabChangeListener=e
};
ZmAttachTabView.prototype.switchToTab=function(a,t){
if(!t&&this._addTabChangeListener&&!this._addTabChangeListener.run()){
var e=this._tabBar.getButton(this.getCurrentTab());
e.setOpen();
e=this._tabBar.getButton(a);
e.setClosed();
return
}
DwtTabView.prototype.switchToTab.call(this,a)
};
ZmMyComputerTabViewPage=function(a,t,e){
if(arguments.length==0){
return
}
DwtTabViewPage.call(this,a,t,Dwt.STATIC_STYLE);
this.setScrollStyle(Dwt.SCROLL)
};
ZmMyComputerTabViewPage.prototype=new DwtTabViewPage;
ZmMyComputerTabViewPage.prototype.constructor=ZmMyComputerTabViewPage;
ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS=5;
ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS=10;
ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME="_attFile_";
ZmMyComputerTabViewPage.prototype.toString=function(){
return"ZmMyComputerTabViewPage"
};
ZmMyComputerTabViewPage.prototype.showMe=function(){
this.resetAttachments();
DwtTabViewPage.prototype.showMe.call(this);
this.setSize(Dwt.DEFAULT,"240");
this._focusAttEl()
};
ZmMyComputerTabViewPage.prototype.hideMe=function(){
DwtTabViewPage.prototype.hideMe.call(this)
};
ZmMyComputerTabViewPage.prototype._createHtml=function(){
var e={
id:this._htmlElId,uri:(appCtxt.get(ZmSetting.CSFE_ATTACHMENT_UPLOAD_URI)+"?fmt=extended")};
this._contentEl=this.getContentHtmlElement();
this._contentEl.innerHTML=AjxTemplate.expand("share.Dialogs#ZmAttachDialog-MyComputerTab",e);
this.attachmentTable=document.getElementById(this._htmlElId+"_attachmentTable");
this.uploadForm=document.getElementById(this._htmlElId+"_uploadForm");
this.attachmentButtonTable=document.getElementById(this._htmlElId+"_attachmentButtonTable");
this._addAttachmentFieldButton();
this._attachCount=0
};
ZmMyComputerTabViewPage.prototype._addAttachmentField=function(){
if(this._attachCount>=ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS){
return
}
this._attachCount++;
var h=this.attachmentTable.insertRow(-1);
var e=h.insertCell(-1);
var a=Dwt.getNextId();
var i={
id:a,uploadName:ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME};
e.innerHTML=AjxTemplate.expand("share.Dialogs#ZmAttachDialog-MyComputerTab-AddAttachment",i);
var o=document.getElementById(a+"_remove");
o.onclick=AjxCallback.simpleClosure(this._removeAttachmentField,this,h);
var t=a+"_input";
if(this._focusElId==-1){
this._focusElId=t
}
var s=document.getElementById(t);
var n=document.getElementById(a+"_size");
if(ZmAttachDialog.supportsHTML5){
Dwt.setHandler(s,"onchange",AjxCallback.simpleClosure(this._handleFileSize,this,s,n))
}
if(AjxEnv.isIE){
s.onkeydown=AjxCallback.simpleClosure(this._handleKeys,this)
}};
ZmMyComputerTabViewPage.prototype._handleFileSize=function(o,i){
var a=o.files;
if(!a){
return
}
var t=a[0];
var e=t.size||t.fileSize;
if(i){
i.innerHTML="  ("+AjxUtil.formatSize(e,true)+")";
if(e>appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)){
Dwt.addClass(i,"RedC")
}else{
Dwt.delClass(i,"RedC")
}}};
ZmMyComputerTabViewPage.prototype._removeAttachmentField=function(e){
this.attachmentTable.deleteRow(e.rowIndex);
this._attachCount--;
if(this._attachCount==0){
this._addAttachmentField()
}};
ZmMyComputerTabViewPage.prototype._addAttachmentFieldButton=function(){
var a=this.attachmentButtonTable.insertRow(-1);
var e=a.insertCell(-1);
var t=new DwtButton({
parent:this,parentElement:e}
);
t.setText(ZmMsg.addMoreAttachments);
t.addSelectionListener(new AjxListener(this,this._addAttachmentField))
};
ZmMyComputerTabViewPage.prototype.gotAttachments=function(){
var t=document.getElementsByName(ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME);
for(var e=0;
e<t.length;
e++){
if(t[e].value.length){
return true
}}
return false
};
ZmMyComputerTabViewPage.prototype.resetAttachments=function(){
this._cleanTable(this.attachmentTable);
this._attachCount=0;
if(ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS>ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS){
ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS=ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS
}
this._focusElId=-1;
var a=this.attachmentTable.insertRow(-1);
var e=a.insertCell(-1);
e.appendChild(document.createElement("br"));
e.appendChild(document.createElement("br"));
for(var t=0;
t<ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS;
t++){
this._addAttachmentField()
}
delete t
};
ZmMyComputerTabViewPage.prototype._focusAttEl=function(){
var e=document.getElementById(this._focusElId);
if(e){
e.focus()
}};
ZmMyComputerTabViewPage.prototype._cleanTable=function(e){
if(!e||!e.rows){
return
}
while(e.rows.length>0){
e.deleteRow(0)
}};
ZmMyComputerTabViewPage.prototype._handleKeys=function(t){
var e=DwtKeyEvent.getCharCode(t);
return(e!=DwtKeyEvent.KEY_ENTER&&e!=DwtKeyEvent.KEY_END_OF_TEXT)
};
ZmMyComputerTabViewPage.prototype._validateFileSize=function(){
var o=document.getElementsByName(ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME);
var a,t;
for(var e=0;
e<o.length;
e++){
a=o[e].files;
if(!a||a.length==0){
continue
}
a=a[0];
t=a.size||a.fileSize;
if(t>appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)){
return false
}}
return true
};
ZmMyComputerTabViewPage.prototype.validate=function(){
var e,t;
if(ZmAttachDialog.supportsHTML5){
e=this._validateFileSize();
t=AjxMessageFormat.format(ZmMsg.attachmentSizeError,AjxUtil.formatSize(appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)))
}else{
e=true
}
return{
status:e,error:t}
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmLoginDialog")){
ZmLoginDialog=function(i,a){
a=a||"ZmLoginDialog";
DwtComposite.call(this,{
parent:i,className:a,posStyle:DwtControl.ABSOLUTE_STYLE}
);
this._origClassName=a;
this._xparentClassName=a+"-Transparent";
this.setBounds(0,0,"100%","100%");
var o=this.getHtmlElement();
o.style.zIndex=Dwt.Z_DIALOG+1;
o.className=a;
this.setVisible(false);
var n=ZLoginFactory.copyDefaultParams(ZmMsg);
n.showPanelBorder=true;
n.showForm=true;
n.showUserField=true;
n.showPasswordField=true;
n.showLicenseMsg=true;
n.showRememberMeCheckbox=false;
n.showLogOff=true;
n.logOffAction="ZmLoginDialog._loginDiffListener()";
n.loginAction="ZmLoginDialog._loginListener(this)";
n.showButton=true;
var t=[];
var e=0;
t[e++]="<table border=0 cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td align='center' valign='center'>";
t[e++]=ZLoginFactory.getLoginDialogHTML(n);
t[e++]="</td></tr></table>";
o.innerHTML=t.join("");
var s=ZLoginFactory.LOGIN_BUTTON_ID;
if(s&&DwtControl.ALL_BY_ID){
DwtControl.ALL_BY_ID[s]=this
}
this.setReloginMode(false)
};
ZmLoginDialog.prototype=new DwtComposite;
ZmLoginDialog.prototype.constructor=ZmLoginDialog;
ZmLoginDialog.prototype.toString=function(){
return"ZmLoginDialog"
};
ZmLoginDialog.prototype.registerCallback=function(t,a,e){
this._callback=new AjxCallback(a,t,e)
};
ZmLoginDialog.prototype.clearAll=function(){
ZLoginFactory.get(ZLoginFactory.USER_ID).value="";
ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value=""
};
ZmLoginDialog.prototype.clearPassword=function(){
ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value=""
};
ZmLoginDialog.prototype.setError=function(e){
if(e&&e.length){
ZLoginFactory.showErrorMsg(e)
}else{
ZLoginFactory.hideErrorMsg()
}};
ZmLoginDialog.prototype.setFocus=function(t,e){
ZLoginFactory.showUserField(t);
this.setReloginMode(t&&t.length&&e)
};
ZmLoginDialog.prototype.setVisible=function(a,e){
DwtComposite.prototype.setVisible.call(this,a);
var i=appCtxt.getKeyboardMgr();
if(i){
if(a){
if(i.isEnabled()){
i.enable(false);
this._kbnavDisabled=true
}}else{
if(this._kbnavDisabled){
i.enable(true);
this._kbnavDisabled=false
}}}
if(!a){
return
}
this.setCursor("default");
if((e==null||!e)&&this._className!=this._origClassName){
this.getHtmlElement().className=this._origClassName;
this._className=this._origClassName
}else{
if(e&&this._className!=this._xparentClassName){
this.getHtmlElement().className=this._xparentClassName;
this._className=this._xparentClassName
}}
Dwt.setHandler(this.getHtmlElement(),DwtEvent.ONKEYDOWN,ZLoginFactory.handleKeyPress);
var t=ZLoginFactory.get(ZLoginFactory.PASSWORD_ID);
if(t&&t.focus){
t.focus()
}};
ZmLoginDialog.prototype.addChild=function(t,e){
this._children.add(t)
};
ZmLoginDialog.prototype.setReloginMode=function(e){
e?ZLoginFactory.showLogOff():ZLoginFactory.hideLogOff();
ZLoginFactory.get(ZLoginFactory.USER_ID).disabled=e
};
ZmLoginDialog.prototype._loginSelListener=function(){
this.setCursor("wait");
var t=ZLoginFactory.get(ZLoginFactory.USER_ID).value;
if(!(t&&t.length)){
this.setError(ZmMsg.enterUsername);
return
}
if(this._callback){
var e=ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value;
this._callback.run(t,e,appCtxt.rememberMe)
}};
ZmLoginDialog._loginListener=function(a){
var t=a;
while(t){
var e=DwtControl.fromElement(t);
if(e instanceof ZmLoginDialog){
e._loginSelListener();
break
}
t=t.parentNode
}};
ZmLoginDialog._loginDiffListener=function(e){
ZmZimbraMail.logOff()
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewOrganizerDialog")){
ZmNewOrganizerDialog=function(a,t,i,e){
if(arguments.length==0){
return
}
ZmDialog.call(this,{
parent:a,className:t,title:i}
);
this._organizerType=e;
this._setupControls()
};
ZmNewOrganizerDialog.prototype=new ZmDialog;
ZmNewOrganizerDialog.prototype.constructor=ZmNewOrganizerDialog;
ZmNewOrganizerDialog.prototype.toString=function(){
return"ZmNewOrganizerDialog"
};
ZmNewOrganizerDialog.prototype.popup=function(t,s){
if(this._folderTreeCellId){
var n={
overviewId:this.toString(),treeIds:this._treeIds,omit:this._omit,fieldId:this._folderTreeCellId,overviewTrees:[this._organizerType]};
this._setOverview(n);
if(this._folderTreeView){
this._folderTreeView.getHeaderItem().setVisible(true,true);
if(t){
if(t.nId==ZmOrganizer.ID_ROOT){
t=appCtxt.getFolderTree().root
}}else{
t=appCtxt.getFolderTree().root
}
var e=this._folderTreeView.getTreeItemById(t.id);
if(e){
this._folderTreeView.setSelection(e)
}
if(t.nId==ZmOrganizer.ID_ROOT){
var a=ZmOrganizer.getSystemId(t.id);
var e=this._folderTreeView.getTreeItemById(a);
if(e){
e.setExpanded(true)
}}}}
if(t&&(t.type!=ZmOrganizer.FOLDER)&&this._colorSelect){
var l=this._colorSelect.getMenu().getItem(0);
if(l.getText()==ZmOrganizer.COLOR_TEXT[0]){
this._colorSelect.getMenu().removeChild(l)
}}
var c=appCtxt.multiAccounts&&this._opc.getOverviewContainer(this.toString());
if(c){
if(!t||(t&&t.nId==ZmOrganizer.ID_ROOT)){
var h=s||appCtxt.getActiveAccount();
c.setSelection(c.getHeaderItem(h))
}else{
var o=appCtxt.getOverviewId(this.toString(),s);
var d=c.getOverview(o);
var i=d&&d.getTreeView(this._organizerType);
if(i){
c.deselectAll();
var e=i.getTreeItemById(t.id);
i.setSelection(e)
}}
c.expandAccountOnly(s)
}
ZmDialog.prototype.popup.call(this)
};
ZmNewOrganizerDialog.prototype.reset=function(e){
ZmDialog.prototype.reset.apply(this,arguments);
if(this._colorSelect){
this._initColorSelect(e)
}
if(this._remoteCheckboxField){
this._remoteCheckboxField.checked=false;
var t=document.getElementById(this._remoteCheckboxFieldId+"URLrow");
if(t){
t.style.display="none"
}}
if(this._urlField){
this._urlField.value=""
}
if(appCtxt.multiAccounts){
this._account=e
}else{
this._account=null
}};
ZmNewOrganizerDialog.prototype._getRemoteLabel=function(){
return ZmMsg.subscribeToFeed
};
ZmNewOrganizerDialog.prototype._initColorSelect=function(a){
var e=(this._colorSelect.getValue()+1)%ZmOrganizer.COLOR_CHOICES.length;
var t=this._colorSelect.getOptionWithValue(e);
this._colorSelect.setSelectedOption(t)
};
ZmNewOrganizerDialog.prototype._contentHtml=function(){
var t=[];
var e=0;
t[e++]="<table cellpadding=0 cellspacing=5 border=0";
t[e++]=(AjxEnv.isSafari)?" width='300'>":">";
e=this._createStandardContentHtml(t,e);
e=this._createExtraContentHtml(t,e);
t[e++]="</table>";
return t.join("")
};
ZmNewOrganizerDialog.prototype._createStandardContentHtml=function(t,e){
e=this._createNameContentHtml(t,e);
e=this._createColorContentHtml(t,e);
return e
};
ZmNewOrganizerDialog.prototype._createNameContentHtml=function(t,e){
this._nameFieldId=this._htmlElId+"_name";
t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogName",{
id:this._htmlElId}
);
return e
};
ZmNewOrganizerDialog.prototype._createColorContentHtml=function(t,e){
this._colorSelectId=this._htmlElId+"_colorSelect";
t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogColor",{
id:this._htmlElId}
);
return e
};
ZmNewOrganizerDialog.prototype._createExtraContentHtml=function(t,e){
e=this._createRemoteContentHtml(t,e);
e=this._createFolderContentHtml(t,e);
return e
};
ZmNewOrganizerDialog.prototype._createRemoteContentHtml=function(a,e){
this._remoteCheckboxFieldId=this._htmlElId+"_remote";
this._urlFieldId=this._htmlElId+"_url";
var t={
id:this._htmlElId,remoteLabel:this._getRemoteLabel()};
a[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogRemote",t);
return e
};
ZmNewOrganizerDialog.prototype._createFolderContentHtml=function(t,e){
this._folderTreeCellId=this._htmlElId+"_folderTree";
t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogFolder",{
id:this._htmlElId}
);
return e
};
ZmNewOrganizerDialog.prototype._setupControls=function(){
this._setupStandardControls();
this._setupExtraControls()
};
ZmNewOrganizerDialog.prototype._setupStandardControls=function(){
this._setupNameControl();
this._setupColorControl()
};
ZmNewOrganizerDialog.prototype._setupNameControl=function(){
this._setNameField(this._nameFieldId)
};
ZmNewOrganizerDialog.prototype._setupColorControl=function(){
this._colorSelect=new DwtSelect({
parent:this}
);
for(var t=0;
t<ZmOrganizer.COLOR_CHOICES.length;
t++){
var e=ZmOrganizer.COLOR_CHOICES[t];
this._colorSelect.addOption(e.label,t==0,e.value)
}
var a=document.getElementById(this._colorSelectId);
if(a){
a.appendChild(this._colorSelect.getHtmlElement())
}};
ZmNewOrganizerDialog.prototype._setupExtraControls=function(){
this._setupRemoteControl();
this._setupFolderControl()
};
ZmNewOrganizerDialog.prototype._setupRemoteControl=function(){
this._remoteCheckboxField=document.getElementById(this._remoteCheckboxFieldId);
if(this._remoteCheckboxField){
this._urlField=document.getElementById(this._remoteCheckboxFieldId+"URLfield");
Dwt.setHandler(this._remoteCheckboxField,DwtEvent.ONCLICK,this._handleCheckbox)
}};
ZmNewOrganizerDialog.prototype._setupFolderControl=function(){
if(!this._folderTreeCellId){
return
}
this._treeIds=[this._organizerType];
this._omit={};
this._omit[ZmFolder.ID_SPAM]=true;
this._omit[ZmFolder.ID_DRAFTS]=true;
this._omit[ZmFolder.ID_SYNC_FAILURES]=true;
this._omit[ZmFolder.ID_OUTBOX]=true;
var e=appCtxt.getFolderTree();
var t=e?e.getByName(ZmFolder.SYNC_ISSUES):null;
if(t){
this._omit[t.id]=true
}
this._omit[ZmOrganizer.ID_ZIMLET]=true
};
ZmNewOrganizerDialog.prototype._renderOverview=function(i,e,t,a){
this._setupFolderControl();
ZmDialog.prototype._renderOverview.apply(this,arguments);
this._folderTreeView=i.getTreeView(this._organizerType)
};
ZmNewOrganizerDialog.prototype._getFolderData=function(){
var i=appCtxt.multiAccounts?this._opc.getOverviewContainer(this.toString()):this._opc.getOverview(this._curOverviewId);
var s=i?i.getSelected():appCtxt.getFolderTree(this._account).root;
var a=AjxStringUtil.trim(this._nameField.value);
var n=ZmFolder.checkName(a,s);
if(!n&&s.hasChild(a)){
n=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[a])
}
var e=null;
if(!n&&this._colorSelectId){
e=this._colorSelect.getValue()
}
var t=null;
if(!n&&this._remoteCheckboxField){
t=this._remoteCheckboxField.checked?this._urlField.value:null;
if(t||t!=null){
n=ZmOrganizer.checkUrl(t)
}}
if(!n&&s.disallowSubFolder){
n=AjxMessageFormat.format(ZmMsg.errorSubFolderNotAllowed,s.name)
}
var o=appCtxt.multiAccounts?s.getAccount():null;
return(n?this._showError(n):{
l:s.id,name:a,color:e,url:t,account:o}
)
};
ZmNewOrganizerDialog.prototype._getTabGroupMembers=function(){
var e=[this._nameField];
if(this._colorSelect){
e.push(this._colorSelect)
}
if(this._overview[this._curOverviewId]){
e.push(this._overview[this._curOverviewId])
}
return e
};
ZmNewOrganizerDialog.prototype._okButtonListener=function(t){
var e=this._getFolderData();
if(e){
DwtDialog.prototype._buttonListener.call(this,t,e)
}};
ZmNewOrganizerDialog.prototype._enterListener=function(t){
var e=this._getFolderData();
if(e){
this._runEnterCallback(e)
}};
ZmNewOrganizerDialog.prototype._handleCheckbox=function(e){
e=e||window.event;
var a=DwtUiEvent.getTarget(e);
var t=document.getElementById(a.id+"URLrow");
var i=document.getElementById(a.id+"URLfield");
t.style.display=a.checked?(AjxEnv.isIE?"block":"table-row"):"none";
if(a.checked){
i.focus()
}}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewFolderDialog")){
ZmNewFolderDialog=function(a,t){
var i=ZmMsg.createNewFolder;
var e=ZmOrganizer.FOLDER;
ZmNewOrganizerDialog.call(this,a,t,i,e)
};
ZmNewFolderDialog.prototype=new ZmNewOrganizerDialog;
ZmNewFolderDialog.prototype.constructor=ZmNewFolderDialog;
ZmNewFolderDialog.prototype.toString=function(){
return"ZmNewFolderDialog"
};
ZmNewFolderDialog.prototype._createColorContentHtml=function(t,e){
return e
};
ZmNewFolderDialog.prototype._setupColorControl=function(){}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewSearchDialog")){
ZmNewSearchDialog=function(t,e){
ZmDialog.call(this,{
parent:t,className:e,title:ZmMsg.saveSearch}
);
this._omit={};
this._omit[ZmFolder.ID_SPAM]=true;
this._omit[ZmFolder.ID_DRAFTS]=true;
this._setNameField(this._nameFieldId)
};
ZmNewSearchDialog.prototype=new ZmDialog;
ZmNewSearchDialog.prototype.constructor=ZmNewSearchDialog;
ZmNewSearchDialog.prototype.toString=function(){
return"ZmNewSearchDialog"
};
ZmNewSearchDialog.prototype.popup=function(n){
var a=appCtxt.multiAccounts?appCtxt.getActiveAccount():null;
var o=this._curOverviewId=(a?([this.toString(),a.name].join("-")):this.toString());
var i={
account:a,treeIds:[ZmOrganizer.FOLDER,ZmOrganizer.SEARCH],fieldId:this._folderTreeCellId,omit:this._omit,overviewId:o};
var t=this._setOverview(i,true);
this._folderTreeView=t.getTreeView(ZmOrganizer.FOLDER);
this._searchTreeView=t.getTreeView(ZmOrganizer.SEARCH);
this._search=n.search;
this._searchTreeView.setSelected(appCtxt.getFolderTree(a).root,true);
this._isGlobalSearch=appCtxt.multiAccounts&&appCtxt.getSearchController().searchAllAccounts;
if(appCtxt.multiAccounts){
this._searchTreeView.setVisible(true);
this._makeOverviewVisible(o)
}
var e=document.getElementById(this._overviewDivId);
if(e){
Dwt.setVisible(e,(n.showOverview&&!this._isGlobalSearch))
}
ZmDialog.prototype.popup.call(this)
};
ZmNewSearchDialog.prototype._contentHtml=function(){
this._nameFieldId=this._htmlElId+"_nameField";
this._folderTreeCellId=this._htmlElId+"_folderTreeCell";
this._overviewDivId=this._htmlElId+"_overviewDiv";
return(AjxTemplate.expand("share.Dialogs#NewSearch",{
id:this._htmlElId}
))
};
ZmNewSearchDialog.prototype._okButtonListener=function(t){
var e=this._getSearchData();
if(e){
DwtDialog.prototype._buttonListener.call(this,t,e)
}};
ZmNewSearchDialog.prototype._getSearchData=function(){
var a=this._isGlobalSearch?appCtxt.getById(ZmOrganizer.ID_ROOT):this._overview[this._curOverviewId].getSelected();
var e=AjxStringUtil.trim(this._nameField.value);
var t=ZmFolder.checkName(e,a);
if(!t&&a.hasChild(e)){
t=ZmMsg.folderOrSearchNameExists
}
if(!t&&(a.id==ZmOrganizer.ID_ROOT)&&appCtxt.getFolderTree().root.hasChild(e)){
t=ZmMsg.folderOrSearchNameExists
}
if(t){
return this._showError(t)
}else{
return{
parent:a,isGlobal:this._isGlobalSearch,name:e,search:this._search}
}};
ZmNewSearchDialog.prototype._enterListener=function(t){
var e=this._getSearchData();
if(e){
this._runEnterCallback(e)
}};
ZmNewSearchDialog.prototype._getTabGroupMembers=function(){
var e=[this._nameField];
if(this._overview[this._curOverviewId]){
e.push(this._overview[this._curOverviewId])
}
return e
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewTagDialog")){
ZmNewTagDialog=function(t,e){
ZmDialog.call(this,{
parent:t,className:e,title:ZmMsg.createNewTag}
);
this._setNameField(this._htmlElId+"_name");
this._setTagColorMenu();
this._setAccountMenu()
};
ZmNewTagDialog.prototype=new ZmDialog;
ZmNewTagDialog.prototype.constructor=ZmNewTagDialog;
ZmNewTagDialog.prototype.toString=function(){
return"ZmNewTagDialog"
};
ZmNewTagDialog.prototype.popup=function(a,e){
if(this._accountSelect){
var t=e||appCtxt.getActiveAccount();
this._accountSelect.setSelectedValue(t.id)
}
ZmDialog.prototype.popup.call(this)
};
ZmNewTagDialog.prototype.cleanup=function(e){
DwtDialog.prototype.cleanup.call(this,e);
var t=this._getNextColor();
this._setColorButton(t,ZmOrganizer.COLOR_TEXT[t],ZmTag.COLOR_ICON[t])
};
ZmNewTagDialog.prototype._colorListener=function(t){
var e=t.item.getData(ZmOperation.MENUITEM_ID);
this._setColorButton(e,ZmOrganizer.COLOR_TEXT[e],ZmTag.COLOR_ICON[e])
};
ZmNewTagDialog.prototype._setTagColorMenu=function(){
var a=this._htmlElId+"_tagColor";
this._colorButton=new DwtButton({
parent:this,parentElement:a,id:"ZmTagColorMenu"}
);
this._colorButton.noMenuBar=true;
ZmOperation.addColorMenu(this._colorButton);
var t=ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG];
this._setColorButton(t,ZmOrganizer.COLOR_TEXT[t],ZmTag.COLOR_ICON[t]);
this._tagColorListener=new AjxListener(this,this._colorListener);
var e=this._colorButton.getMenu().getItems();
for(var o=0;
o<e.length;
o++){
e[o].addSelectionListener(this._tagColorListener)
}};
ZmNewTagDialog.prototype._setAccountMenu=function(){
if(!appCtxt.multiAccounts){
return
}
var e=this._htmlElId+"_account";
this._accountSelect=new DwtSelect({
parent:this,parentElement:e}
);
var a=appCtxt.accountList.visibleAccounts;
for(var t=0;
t<a.length;
t++){
var s=a[t];
if(appCtxt.get(ZmSetting.TAGGING_ENABLED,null,s)){
var n=new DwtSelectOption(s.id,null,s.getDisplayName(),null,null,s.getIcon());
this._accountSelect.addOption(n)
}}};
ZmNewTagDialog.prototype._setColorButton=function(e,a,t){
this._colorButton.setData(ZmOperation.MENUITEM_ID,e);
this._colorButton.setText(a);
this._colorButton.setImage(t)
};
ZmNewTagDialog.prototype._contentHtml=function(){
return AjxTemplate.expand("share.Dialogs#ZmPromptDialog",{
id:this._htmlElId}
)
};
ZmNewTagDialog.prototype._okButtonListener=function(t){
var e=this._getTagData();
if(e){
DwtDialog.prototype._buttonListener.call(this,t,e)
}};
ZmNewTagDialog.prototype._getTagData=function(){
var a=this._accountSelect&&this._accountSelect.getValue();
var i=a&&appCtxt.accountList.getAccount(a);
var t=AjxStringUtil.trim(this._nameField.value);
var o=ZmTag.checkName(t);
var e=appCtxt.getTagTree(i);
if(!o&&e&&e.getByName(t)){
o=ZmMsg.tagNameExists
}
return(o)?this._showError(o):{
name:t,color:this._colorButton.getData(ZmOperation.MENUITEM_ID),accountName:(i&&i.name)}
};
ZmNewTagDialog.prototype._enterListener=function(t){
var e=this._getTagData();
if(e){
this._runEnterCallback(e)
}};
ZmNewTagDialog.prototype._getNextColor=function(){
var a={};
var e=appCtxt.getTagTree();
if(!e){
return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
}
var o=e.root.children.getArray();
if(!(o&&o.length)){
return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
}
for(var n=0;
n<o.length;
n++){
a[o[n].color]=true
}
for(var n=0;
n<ZmTagTree.COLOR_LIST.length;
n++){
var t=ZmTagTree.COLOR_LIST[n];
if(!a[t]){
return t
}}
return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
};
ZmNewTagDialog.prototype._getTabGroupMembers=function(){
return[this._nameField,this._colorButton]
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmFolderPropsDialog")){
ZmFolderPropsDialog=function(a,t){
t=t||"ZmFolderPropsDialog";
var i;
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
i=[new DwtDialog_ButtonDescriptor(ZmFolderPropsDialog.ADD_SHARE_BUTTON,ZmMsg.addShare,DwtDialog.ALIGN_LEFT)]
}
DwtDialog.call(this,{
parent:a,className:t,title:ZmMsg.folderProperties,extraButtons:i}
);
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
this.registerCallback(ZmFolderPropsDialog.ADD_SHARE_BUTTON,this._handleAddShareButton,this)
}
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,this._handleCancelButton));
this._folderChangeListener=new AjxListener(this,this._handleFolderChange);
var e=this._createView();
this.setView(e)
};
ZmFolderPropsDialog.prototype=new DwtDialog;
ZmFolderPropsDialog.prototype.constructor=ZmFolderPropsDialog;
ZmFolderPropsDialog.ADD_SHARE_BUTTON=++DwtDialog.LAST_BUTTON;
ZmFolderPropsDialog.SHARES_HEIGHT="9em";
ZmFolderPropsDialog.prototype.toString=function(){
return"ZmFolderPropsDialog"
};
ZmFolderPropsDialog.prototype.popup=function(t){
this._organizer=t;
t.addChangeListener(this._folderChangeListener);
if(this._color&&t.type!=ZmOrganizer.FOLDER&&t.type!=ZmOrganizer.TASKS&&t.type!=ZmOrganizer.ADDRBOOK){
this._color.clearOptions();
for(var o=1;
o<ZmOrganizer.COLOR_CHOICES.length;
o++){
var a=ZmOrganizer.COLOR_CHOICES[o];
this._color.addOption(a.label,false,a.value)
}}else{
this._color.clearOptions();
for(var o=0;
o<ZmOrganizer.COLOR_CHOICES.length;
o++){
var a=ZmOrganizer.COLOR_CHOICES[o];
this._color.addOption(a.label,false,a.value)
}}
this._handleFolderChange();
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
var e=(!t.link||t.isAdmin());
this.setButtonVisible(ZmFolderPropsDialog.ADD_SHARE_BUTTON,e)
}
DwtDialog.prototype.popup.call(this);
if(this._nameInputEl.style.display!="none"){
this._nameInputEl.focus()
}};
ZmFolderPropsDialog.prototype.popdown=function(){
if(this._organizer){
this._organizer.removeChangeListener(this._folderChangeListener);
this._organizer=null
}
DwtDialog.prototype.popdown.call(this)
};
ZmFolderPropsDialog.prototype._getSeparatorTemplate=function(){
return""
};
ZmFolderPropsDialog.prototype._handleEditShare=function(a,t){
t=t||Dwt.getObjectFromElement(DwtUiEvent.getTarget(a));
var e=appCtxt.getSharePropsDialog();
e.popup(ZmSharePropsDialog.EDIT,t.object,t);
return false
};
ZmFolderPropsDialog.prototype._handleRevokeShare=function(a,t){
t=t||Dwt.getObjectFromElement(DwtUiEvent.getTarget(a));
var e=appCtxt.getRevokeShareDialog();
e.popup(t);
return false
};
ZmFolderPropsDialog.prototype._handleResendShare=function(o,i){
AjxDispatcher.require("Share");
i=i||Dwt.getObjectFromElement(DwtUiEvent.getTarget(o));
var e=new ZmShare({
object:i.object}
);
e.grantee.id=i.grantee.id;
e.grantee.email=(i.grantee.type=="guest")?i.grantee.id:i.grantee.name;
e.grantee.name=i.grantee.name;
if(e.object.isRemote()){
e.grantor.id=e.object.zid;
e.grantor.email=e.object.owner;
e.grantor.name=e.grantor.email;
e.link.id=e.object.rid
}else{
e.grantor.id=appCtxt.get(ZmSetting.USERID);
e.grantor.email=appCtxt.get(ZmSetting.USERNAME);
e.grantor.name=appCtxt.get(ZmSetting.DISPLAY_NAME)||e.grantor.email;
e.link.id=e.object.id
}
e.link.name=i.object.name;
e.link.view=ZmOrganizer.getViewName(i.object.type);
e.link.perm=i.link.perm;
if(i.grantee.type=="guest"){
if(!this._guestFormatter){
this._guestFormatter=new AjxMessageFormat(ZmMsg.shareWithGuestNotes)
}
var a=i.object.getRestUrl();
var n=e.grantee.email;
var t=i.link.pw;
if(t&&n){
e.notes=this._guestFormatter.format([a,n,t])
}}
e.sendMessage(ZmShare.NEW);
appCtxt.setStatusMsg(ZmMsg.resentShareMessage);
return false
};
ZmFolderPropsDialog.prototype._handleAddShareButton=function(t){
var e=appCtxt.getSharePropsDialog();
e.popup(ZmSharePropsDialog.NEW,this._organizer,null)
};
ZmFolderPropsDialog.prototype._handleOkButton=function(a){
if(!this._handleErrorCallback){
this._handleErrorCallback=new AjxCallback(this,this._handleError);
this._handleRenameErrorCallback=new AjxCallback(this,this._handleRenameError)
}
var i=new AjxCallback(this,this._handleColor);
var e=this._organizer;
if(!e.isSystem()&&!e.isDataSource()){
var t=this._nameInputEl.value;
if(e.name!=t){
e.rename(t,i,this._handleRenameErrorCallback);
return
}}
i.run(null)
};
ZmFolderPropsDialog.prototype._handleColor=function(a){
var i=new AjxCallback(this,this._handleFreeBusy);
var e=this._organizer;
var t=this._color.getValue();
if(e.color!=t){
e.setColor(t,i,this._handleErrorCallback);
return
}
i.run(a)
};
ZmFolderPropsDialog.prototype._handleFreeBusy=function(t){
var i=new AjxCallback(this,this.popdown);
var e=this._organizer;
if(Dwt.getVisible(this._excludeFbEl)&&e.setFreeBusy){
var a=this._excludeFbCheckbox.checked;
if(e.excludeFreeBusy!=a){
e.setFreeBusy(a,i,this._handleErrorCallback);
return
}}
i.run(t)
};
ZmFolderPropsDialog.prototype._handleError=function(e){};
ZmFolderPropsDialog.prototype._handleRenameError=function(e){
var a=this._nameInputEl.value;
var i,t;
if(e.code==ZmCsfeException.MAIL_ALREADY_EXISTS){
i=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[a])
}else{
if(e.code==ZmCsfeException.MAIL_IMMUTABLE){
i=AjxMessageFormat.format(ZmMsg.errorCannotRename,[a])
}else{
if(e.code==ZmCsfeException.SVC_INVALID_REQUEST){
i=e.msg
}}}
appCtxt.getAppController().popupErrorDialog(i,e.msg,null,true);
return true
};
ZmFolderPropsDialog.prototype._handleCancelButton=function(e){
this.popdown()
};
ZmFolderPropsDialog.prototype._handleFolderChange=function(i){
var t=this._organizer;
if(t.isSystem()||t.isDataSource()){
this._nameOutputEl.innerHTML=AjxStringUtil.htmlEncode(t.name);
this._nameOutputEl.style.display="block";
this._nameInputEl.style.display="none"
}else{
this._nameInputEl.value=t.name;
this._nameInputEl.style.display="block";
this._nameOutputEl.style.display="none"
}
this._ownerEl.innerHTML=AjxStringUtil.htmlEncode(t.owner);
this._typeEl.innerHTML=ZmMsg[ZmOrganizer.FOLDER_KEY[t.type]]||ZmMsg.folder;
this._urlEl.innerHTML=t.url||"";
if(this._color){
this._color.setSelectedValue(t.color);
var e=(t.type!=ZmOrganizer.FOLDER||(t.type==ZmOrganizer.FOLDER&&appCtxt.get(ZmSetting.MAIL_FOLDER_COLORS_ENABLED)));
this._props.setPropertyVisible(this._colorId,e)
}
this._excludeFbCheckbox.checked=t.excludeFreeBusy;
var n=t.isMountpoint;
if(n){
AjxDispatcher.require("Share");
var a=ZmShare.getShareFromLink(t);
var o=a&&a.link&&a.link.role;
this._permEl.innerHTML=ZmShare.getRoleActions(o)
}
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
this._populateShares(t)
}
this._props.setPropertyVisible(this._ownerId,t.owner!=null);
this._props.setPropertyVisible(this._urlId,t.url);
this._props.setPropertyVisible(this._permId,n);
Dwt.setVisible(this._excludeFbEl,!t.link&&(t.type==ZmOrganizer.CALENDAR))
};
ZmFolderPropsDialog.prototype._populateShares=function(e){
this._sharesGroup.setContent("");
var s=this._getDisplayShares(e);
var a=false;
if(s.length){
for(var t=0;
t<s.length;
t++){
var o=s[t];
if(!(o.grantee&&o.grantee.name)){
a=true
}}}
if(a){
var n=new AjxCallback(this,this._handleResponseGetFolder,[s]);
e.getFolder(n)
}else{
this._handleResponseGetFolder(s)
}
this._sharesGroup.setVisible(s.length>0)
};
ZmFolderPropsDialog.prototype._getDisplayShares=function(e){
var a=e.shares;
var h=[];
if((!e.link||e.isAdmin())&&a&&a.length>0){
AjxDispatcher.require("Share");
var s=appCtxt.accountList.mainAccount.id;
for(var t=0;
t<a.length;
t++){
var o=a[t];
if(o.grantee){
var n=o.grantee.id;
if((o.grantee.type!=ZmShare.TYPE_USER)||(o.grantee.id!=s)){
h.push(o)
}}}}
return h
};
ZmFolderPropsDialog.prototype._handleResponseGetFolder=function(c,h){
if(h){
c=this._getDisplayShares(h)
}
if(c.length){
var u=document.createElement("TABLE");
u.border=0;
u.cellSpacing=0;
u.cellPadding=3;
for(var n=0;
n<c.length;
n++){
var d=c[n];
var m=u.insertRow(-1);
var t=m.insertCell(-1);
t.style.paddingRight="15px";
var s=d.grantee&&d.grantee.name;
if(d.isAll()){
s=ZmMsg.shareWithAll
}else{
if(d.isPublic()){
s=ZmMsg.shareWithPublic
}else{
if(d.isGuest()){
s=s||(d.grantee&&d.grantee.id)
}}}
t.innerHTML=AjxStringUtil.htmlEncode(s);
var o=m.insertCell(-1);
o.style.paddingRight="15px";
o.innerHTML=ZmShare.getRoleName(d.link.role);
this.__createCmdCells(m,d)
}
this._sharesGroup.setElement(u);
var e=Dwt.DEFAULT;
var l=c.length>5?ZmFolderPropsDialog.SHARES_HEIGHT:Dwt.CLEAR;
var a=this._sharesGroup.getInsetHtmlElement();
Dwt.setScrollStyle(a,Dwt.SCROLL);
Dwt.setSize(a,e,l)
}
this._sharesGroup.setVisible(c.length>0)
};
ZmFolderPropsDialog.prototype.__createCmdCells=function(d,c){
var s=c.grantee.type;
if(s==ZmShare.TYPE_DOMAIN||!c.link.role){
var l=d.insertCell(-1);
l.colSpan=3;
l.innerHTML=ZmMsg.configureWithAdmin;
return
}
var a=[ZmShare.EDIT,ZmShare.REVOKE,ZmShare.RESEND];
var e=[this._handleEditShare,this._handleRevokeShare,this._handleResendShare];
for(var o=0;
o<a.length;
o++){
var t=a[o];
var l=d.insertCell(-1);
var n=c.grantee&&(c.grantee.type==ZmShare.TYPE_ALL);
if((n||c.isPublic())&&(t==ZmShare.EDIT||t==ZmShare.RESEND)){
continue
}
var h=document.createElement("A");
h.href="#";
h.innerHTML=ZmShare.ACTION_LABEL[t];
Dwt.setHandler(h,DwtEvent.ONCLICK,e[o]);
Dwt.associateElementWithObject(h,c);
l.appendChild(h)
}};
ZmFolderPropsDialog.prototype._createView=function(){
var t=new DwtComposite(this);
this._nameOutputEl=document.createElement("SPAN");
this._nameInputEl=document.createElement("INPUT");
this._nameInputEl.style.width="20em";
this._nameInputEl._dialog=this;
var l=this._nameInputEl;
this._ownerEl=document.createElement("DIV");
this._typeEl=document.createElement("DIV");
this._urlEl=document.createElement("DIV");
this._permEl=document.createElement("DIV");
var n=document.createElement("DIV");
n.appendChild(this._nameOutputEl);
n.appendChild(l);
this._excludeFbCheckbox=document.createElement("INPUT");
this._excludeFbCheckbox.type="checkbox";
this._excludeFbCheckbox._dialog=this;
this._excludeFbEl=document.createElement("DIV");
this._excludeFbEl.style.display="none";
this._excludeFbEl.appendChild(this._excludeFbCheckbox);
this._excludeFbEl.appendChild(document.createTextNode(ZmMsg.excludeFromFreeBusy));
var o=new DwtGrouper(t);
o.setLabel(ZmMsg.properties);
this._props=new DwtPropertySheet(o);
this._color=new DwtSelect({
parent:this._props}
);
for(var h=0;
h<ZmOrganizer.COLOR_CHOICES.length;
h++){
var a=ZmOrganizer.COLOR_CHOICES[h];
this._color.addOption(a.label,false,a.value)
}
this._props.addProperty(ZmMsg.nameLabel,n);
this._props.addProperty(ZmMsg.typeLabel,this._typeEl);
this._ownerId=this._props.addProperty(ZmMsg.ownerLabel,this._ownerEl);
this._urlId=this._props.addProperty(ZmMsg.urlLabel,this._urlEl);
this._permId=this._props.addProperty(ZmMsg.permissions,this._permEl);
this._colorId=this._props.addProperty(ZmMsg.colorLabel,this._color);
var e=document.createElement("DIV");
e.appendChild(this._props.getHtmlElement());
e.appendChild(this._excludeFbEl);
o.setElement(e);
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
this._sharesGroup=new DwtGrouper(t);
this._sharesGroup.setLabel(ZmMsg.folderSharing);
this._sharesGroup.setVisible(false);
this._sharesGroup.setScrollStyle(Dwt.SCROLL)
}
var s=t.getHtmlElement();
s.appendChild(o.getHtmlElement());
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
s.appendChild(this._sharesGroup.getHtmlElement())
}
return t
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmQuickAddDialog")){
ZmQuickAddDialog=function(t,o,e,a,i){
if(arguments.length==0){
return
}
DwtDialog.call(this,{
parent:t,title:o,standardButtons:e,extraButtons:a,loc:i}
)
};
ZmQuickAddDialog.prototype=new DwtDialog;
ZmQuickAddDialog.prototype.constructor=ZmQuickAddDialog;
ZmQuickAddDialog.prototype.toString=function(){
return"ZmQuickAddDialog"
};
ZmQuickAddDialog.prototype.TEMPLATE="dwt.Widgets#DwtSemiModalDialog";
ZmQuickAddDialog.prototype.addSelectionListener=function(e,t){
this._button[e].addSelectionListener(t)
}
}
if(AjxPackage.define("zimbraMail.core.ZmNewWindow")){
ZmNewWindow=function(){
ZmController.call(this,null);
appCtxt.setAppController(this);
this._settings=appCtxt.getSettings();
this._shell=appCtxt.getShell();
this._kbMgr=appCtxt.getKeyboardMgr();
if(appCtxt.get(ZmSetting.USE_KEYBOARD_SHORTCUTS)){
this._kbMgr.enable(true);
this._kbMgr.registerKeyMap(new ZmKeyMap());
this._kbMgr.pushDefaultHandler(this)
}
this._apps={}
};
ZmNewWindow.prototype=new ZmController;
ZmNewWindow.prototype.constructor=ZmNewWindow;
ZmNewWindow.prototype.toString=function(){
return"ZmNewWindow"
};
ZmNewWindow.run=function(){
AjxDispatcher.setLoaded("MailCore",true);
AjxDispatcher.setLoaded("Mail",true);
var a=window.opener||window;
if(!window.parentController){
window.parentController=a._zimbraMail
}
window.appCtxt=new ZmAppCtxt();
window.appCtxt.isChildWindow=true;
window.parentAppCtxt=a.appCtxt;
appCtxt.setSettings(parentAppCtxt.getSettings());
appCtxt.isOffline=parentAppCtxt.isOffline;
appCtxt.multiAccounts=parentAppCtxt.multiAccounts;
window.ZmSetting=a.ZmSetting;
ZmOperation.initialize();
ZmApp.initialize();
var e=new DwtShell({
className:"MainShell"}
);
window.onbeforeunload=ZmNewWindow._confirmExitMethod;
appCtxt.setShell(e);
var t=new ZmNewWindow();
t.startup()
};
ZmNewWindow.unload=function(e){
if(!window.opener||!window.parentController){
return
}
if(window.command=="compose"||window.command=="composeDetach"){
var a=AjxDispatcher.run("GetComposeController",appCtxt.composeCtlrSessionId);
if(a){
a.dispose()
}}else{
if(window.command=="msgViewDetach"){
var t=AjxDispatcher.run("GetMsgController",appCtxt.msgCtlrSessionId);
if(t){
t.dispose()
}}}
if(window.parentController){
window.parentController.removeChildWindow(window)
}};
ZmNewWindow.prototype.startup=function(){
if(window.parentController){
var h=window.parentController.getChildWindow(window);
if(h){
window.newWindowCommand=h.command;
window.newWindowParams=h.params
}}
var o=window.newWindowCommand;
var s=window.newWindowParams;
if(o=="shortcuts"){
var e={};
e[ZmApp.PREFERENCES]=true;
this._createEnabledApps(e);
this._createView();
return
}
if(!this._appViewMgr){
this._appViewMgr=new ZmAppViewMgr(this._shell,this,true,false);
this._statusView=new ZmStatusView(this._shell,"ZmStatus",Dwt.ABSOLUTE_STYLE,ZmId.STATUS_VIEW)
}
var m=appCtxt.getRootTabGroup();
var e={};
e[ZmApp.MAIL]=true;
e[ZmApp.CONTACTS]=true;
var i=(o=="msgViewDetach")?s.msg:null;
if(i&&i.isInvite()){
e[ZmApp.CALENDAR]=true
}
e[ZmApp.PREFERENCES]=true;
e[ZmApp.BRIEFCASE]=true;
this._createEnabledApps(e);
var c=parentAppCtxt.getApp(ZmApp.MAIL);
appCtxt.getApp(ZmApp.MAIL)._identityCollection=c.getIdentityCollection();
var d;
if(o=="compose"||o=="composeDetach"){
d="compose-window"
}else{
if(o=="msgViewDetach"){
d="view-window"
}}
if(d){
var l=parentAppCtxt.get(ZmSetting.ZIMLETS);
l=l||[];
var u=this._settings._getCheckedZimlets(l);
if(this._hasZimletsForTarget(u,d)){
var a=appCtxt.getZimletMgr();
var n=this._getUserProps();
var t=new AjxCallback(this,this._createView);
appCtxt.setZimletsPresent(true);
a.loadZimlets(u,n,d,t,true);
return
}}
this._createView()
};
ZmNewWindow.prototype._createView=function(){
var o=window.newWindowCommand;
var n=window.newWindowParams;
var l=appCtxt.getRootTabGroup();
var a;
if(o=="compose"||o=="composeDetach"){
var i=AjxDispatcher.run("GetComposeController");
appCtxt.composeCtlrSessionId=i.sessionId;
if(n.action==ZmOperation.REPLY_ALL){
n.msg=this._deepCopyMsg(n.msg)
}
if(o=="compose"){
i._setView(n)
}else{
var h=n.action||ZmOperation.NEW_MESSAGE;
if(n.msg&&n.msg._mode){
switch(n.msg._mode){
case ZmAppt.MODE_DELETE:case ZmAppt.MODE_DELETE_INSTANCE:case ZmAppt.MODE_DELETE_SERIES:h=ZmOperation.REPLY_CANCEL;
break
}}
n.action=h;
i._setView(n);
i._composeView.setDetach(n);
var c=window.parentController.getApp(ZmApp.MAIL).getComposeController(n.sessionId);
if(c&&c._composeView){
c._composeView.reset(true);
c._app.popView(true)
}}
i._setComposeTabGroup();
l.addMember(i.getTabGroup());
a=i._getDefaultFocusItem();
target="compose-window"
}else{
if(o=="msgViewDetach"){
var s=AjxDispatcher.run("GetMsgController");
appCtxt.msgCtlrSessionId=s.sessionId;
s.show(n.msg,n.mode);
l.addMember(s.getTabGroup());
a=s.getCurrentView();
target="view-window"
}else{
if(o=="shortcuts"){
var e=appCtxt.getShortcutsPanel();
e.popup(n.cols)
}}}
var t=appCtxt.getKeyboardMgr();
t.setTabGroup(l);
t.grabFocus(a)
};
ZmNewWindow.prototype._hasZimletsForTarget=function(t,o){
var s=new RegExp("\\b"+o+"\\b");
for(var a=0;
a<t.length;
a++){
var e=t[a];
var n=e.zimlet[0];
if(s.test(n.target||"main")){
return true
}}
return false
};
ZmNewWindow.prototype._getUserProps=function(){
var s=parentAppCtxt.get(ZmSetting.USER_PROPS);
s=s?[].concat(s):[];
var e=parentAppCtxt.getZimletMgr().getZimletsHash();
var h=parentAppCtxt.get(ZmSetting.ZIMLETS);
for(var o=0;
o<h.length;
o++){
var n=h[o].zimlet[0].name;
var t=e[n];
if(!t||!t.userProperties){
continue
}
for(var a=0;
a<t.userProperties.length;
a++){
var c=t.userProperties[a];
var l={
zimlet:n,name:c.name,_content:c.value};
s.push(l)
}}
return s
};
ZmNewWindow.prototype.cancelRequest=function(a,e,t){
return window.parentController?window.parentController.cancelRequest(a,e,t):null
};
ZmNewWindow.prototype.sendRequest=function(e){
window.onbeforeunload=null;
e.errorCallback=new AjxCallback(this,this._handleException,[(e.errorCallback||null)]);
return window.parentController?window.parentController.sendRequest(e):null
};
ZmNewWindow.prototype._handleException=function(e,t){
var a=false;
if(e){
a=e.run(t)
}
if(!a){
ZmController.prototype._handleException.apply(this,[t])
}
return true
};
ZmNewWindow.prototype.popupErrorDialog=function(o,a,t,s){
var i;
if(a instanceof Object||typeof a=="object"){
var e=[];
a.msg=a.msg||o;
for(var n in a){
if(typeof a[n]=="function"||(typeof a[n]=="object"&&a[n].apply&&a[n].call)){
continue
}
e.push([n,": ",a[n],"<br/>\n"].join(""))
}
i=e.join("")
}
ZmController.prototype.popupErrorDialog.call(this,o,(i||a),t,s)
};
ZmNewWindow.prototype.setStatusMsg=function(e){
e=Dwt.getParams(arguments,ZmStatusView.MSG_PARAMS);
this._statusView.setStatusMsg(e)
};
ZmNewWindow.prototype.getApp=function(e){
if(!this._apps[e]){
this._createApp(e)
}
return this._apps[e]
};
ZmNewWindow.prototype.getAppViewMgr=function(){
return this._appViewMgr
};
ZmNewWindow.prototype.setActiveApp=function(){};
ZmNewWindow.prototype.getKeyMapMgr=function(){
return this._kbMgr
};
ZmNewWindow.prototype.getKeyMapName=function(){
var e=appCtxt.getCurrentController();
if(e&&e.getKeyMapName){
return e.getKeyMapName()
}
return"Global"
};
ZmNewWindow.prototype.handleKeyAction=function(t,a){
var e=appCtxt.getCurrentController();
if(e&&e.handleKeyAction){
return e.handleKeyAction(t,a)
}
return false
};
ZmNewWindow.prototype._createEnabledApps=function(a){
for(var o in ZmApp.CLASS){
if(!a||a[o]){
ZmApp.APPS.push(o)
}}
ZmApp.APPS.sort(function(n,i){
return ZmZimbraMail.hashSortCompare(ZmApp.LOAD_SORT,n,i)
}
);
for(var e=0;
e<ZmApp.APPS.length;
e++){
var o=ZmApp.APPS[e];
if(o!=ZmApp.IM){
var t=ZmApp.SETTING[o];
if(!t||appCtxt.get(t)){
this._createApp(o)
}}}};
ZmNewWindow.prototype._createApp=function(appName){
if(this._apps[appName]){
return
}
var appClass=eval(ZmApp.CLASS[appName]);
this._apps[appName]=new appClass(this._shell,window.parentController)
};
ZmNewWindow.prototype._deepCopyMsg=function(o){
var e=null;
var d=o.list.search;
if(d){
e=new ZmSearch();
for(var s in d){
if((typeof d[s]=="object")||(typeof d[s]=="function")){
continue
}
e[s]=d[s]
}
e.types=new AjxVector();
var l=d.types.getArray();
for(var s in l){
e.types.add(l[s])
}}
var c=new ZmMailList(o.list.type,e);
for(var s in o.list){
if((typeof o.list[s]=="object")||(typeof o.list[s]=="function")){
continue
}
c[s]=o.list[s]
}
var a=new ZmMailMsg(o.id,c);
for(var s in o){
if((typeof o[s]=="object")||(typeof o[s]=="function")){
continue
}
a[s]=o[s]
}
for(var s in o._addrs){
var h=o._addrs[s].getArray();
for(var n in h){
a._addrs[s].add(h[n])
}}
if(o.attachments&&o.attachments.length>0){
for(var s in o.attachments){
a.attachments.push(o.attachments[s])
}}
for(var s in o._bodyParts){
a._bodyParts.push(o._bodyParts[s])
}
if(o._topPart){
a._topPart=new ZmMimePart();
for(var s in o._topPart){
if((typeof o._topPart[s]=="object")||(typeof o._topPart[s]=="function")){
continue
}
a._topPart[s]=o._topPart[s]
}
var t=o._topPart.children.getArray();
for(var s in t){
a._topPart.children.add(t[s])
}}
return a
};
ZmNewWindow._confirmExitMethod=function(e){
if(window.parentController&&(window.newWindowCommand=="compose"||window.newWindowCommand=="composeDetach")){
var t=AjxDispatcher.run("GetComposeController",appCtxt.composeCtlrSessionId);
if(t&&t._composeView&&t._composeView.isDirty()){
return ZmMsg.newWinComposeExit
}}}
}
if(AjxPackage.define("zimbraMail.calendar.model.ZmCalMgr")){
ZmCalMgr=function(e){
this._container=e;
this.clearCache();
this._listeners={};
this._folderNames={};
this._listeners[ZmOperation.NEW_APPT]=new AjxListener(this,this._newApptAction);
this._listeners[ZmOperation.NEW_ALLDAY_APPT]=new AjxListener(this,this._newAllDayApptAction);
this._listeners[ZmOperation.SEARCH_MAIL]=new AjxListener(this,this._searchMailAction)
};
ZmCalMgr.prototype.toString=function(){
return"ZmCalMgr"
};
ZmCalMgr.prototype.clearCache=function(){
this._miniCalData={}
};
ZmCalMgr.prototype._createMiniCalendar=function(o){
o=o?o:new Date();
var e=appCtxt.get(ZmSetting.CAL_FIRST_DAY_OF_WEEK)||0;
var h=AjxTimezone.getServerId(AjxTimezone.DEFAULT);
var t=(h&&h.indexOf("Europe")==0&&h!="Europe/London");
this._miniCalendar=new DwtCalendar({
parent:this._container,posStyle:DwtControl.ABSOLUTE_STYLE,firstDayOfWeek:e,showWeekNumber:appCtxt.get(ZmSetting.CAL_SHOW_CALENDAR_WEEK),useISO8601WeekNo:t}
);
this._miniCalendar.setDate(o);
this._miniCalendar.setScrollStyle(Dwt.CLIP);
this._miniCalendar.addSelectionListener(new AjxListener(this,this._miniCalSelectionListener));
this._miniCalendar.addActionListener(new AjxListener(this,this._miniCalActionListener));
this._miniCalendar.addDateRangeListener(new AjxListener(this,this._miniCalDateRangeListener));
this._miniCalendar.setMouseOverDayCallback(new AjxCallback(this,this._miniCalMouseOverDayCallback));
this._miniCalendar.setMouseOutDayCallback(new AjxCallback(this,this._miniCalMouseOutDayCallback));
var l=[];
if(appCtxt.get(ZmSetting.MAIL_ENABLED)){
l.push("ZmMailMsg");
l.push("ZmConv")
}
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
l.push("ZmContact")
}
this._miniCalDropTarget=new DwtDropTarget(l);
this._miniCalDropTarget.addDropListener(new AjxListener(this,this._miniCalDropTargetListener));
this._miniCalendar.setDropTarget(this._miniCalDropTarget);
var m=[];
for(var n=0;
n<7;
n++){
var c=(n+e)%7;
m[n]=(c>0&&c<6)
}
this._miniCalendar.setWorkingWeek(m);
var s={};
s[ZmAppViewMgr.C_TREE_FOOTER]=this._miniCalendar;
appCtxt.getAppViewMgr().addComponents(s,true);
var a=appCtxt.getApp(ZmApp.CALENDAR);
var u=a._active||appCtxt.get(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL);
this._miniCalendar.setSkipNotifyOnPage(u&&!a._active);
if(!a._active){
this._miniCalendar.setSelectionMode(DwtCalendar.DAY)
}};
ZmCalMgr.prototype._miniCalDropTargetListener=function(t){
var e=this.getCalViewController();
e._miniCalDropTargetListener(t)
};
ZmCalMgr.prototype.getMiniCalendar=function(){
if(!this._miniCalendar){
this._createMiniCalendar()
}
return this._miniCalendar
};
ZmCalMgr.prototype._refreshCallback=function(e){
this.getReminderController()._refreshCallback(e)
};
ZmCalMgr.prototype.getReminderController=function(){
if(!this._reminderController){
this._reminderController=new ZmReminderController(this)
}
return this._reminderController
};
ZmCalMgr.prototype._miniCalSelectionListener=function(t){
if(t.item instanceof DwtCalendar){
var e=this.getCalViewController();
e._handleLoadMiniCalSelection(t)
}};
ZmCalMgr.prototype._miniCalActionListener=function(e){
var t=this._getMiniCalActionMenu();
t.__detail=e.detail;
t.popup(0,e.docX,e.docY)
};
ZmCalMgr.prototype._getMiniCalActionMenu=function(){
if(this._minicalMenu==null){
this.postInitListeners();
var o=[ZmOperation.NEW_APPT,ZmOperation.NEW_ALLDAY_APPT,ZmOperation.SEP,ZmOperation.SEARCH_MAIL];
var s=ZmZimlet.actionMenus?ZmZimlet.actionMenus.ZmCalViewController:null;
if(s&&s.length){
for(var a=0;
a<s.length;
a++){
var h=s[a];
ZmOperation.defineOperation(null,h);
o.push(h.id)
}}
var n={
parent:appCtxt.getShell(),menuItems:o};
this._minicalMenu=new ZmActionMenu(n);
o=this._minicalMenu.opList;
var t=o.length;
for(var e=0;
e<t;
e++){
if(this._listeners[o[e]]){
this._minicalMenu.addSelectionListener(o[e],this._listeners[o[e]])
}}}
return this._minicalMenu
};
ZmCalMgr.prototype.postInitListeners=function(){
if(ZmZimlet.listeners&&ZmZimlet.listeners.ZmCalViewController){
for(var e in ZmZimlet.listeners.ZmCalViewController){
if(ZmZimlet.listeners.ZmCalViewController[e] instanceof AjxListener){
this._listeners[e]=ZmZimlet.listeners.ZmCalViewController[e]
}else{
this._listeners[e]=new AjxListener(this,this._proxyListeners,[ZmZimlet.listeners.ZmCalViewController[e]])
}}}};
ZmCalMgr.prototype._proxyListeners=function(t,a){
var e=this.getCalViewController();
return(new AjxListener(e,t)).handleEvent(a)
};
ZmCalMgr.prototype.isMiniCalCreated=function(){
return(this._miniCalendar!=null)
};
ZmCalMgr.prototype._miniCalDateRangeListener=function(a){
var e=appCtxt.getCurrentViewId();
if(e==ZmId.VIEW_CAL_APPT||e==ZmId.VIEW_CAL){
var t=this.getCalViewController();
t._scheduleMaintenance(ZmCalViewController.MAINT_MINICAL)
}else{
this.highlightMiniCal()
}};
ZmCalMgr.prototype._miniCalMouseOverDayCallback=function(a,e){
this._currentMouseOverDay=e;
var t=new AjxTimedAction(this,this._getDayToolTipOnDelay,[a,e]);
AjxTimedAction.scheduleAction(t,1000)
};
ZmCalMgr.prototype.getCalViewController=function(){
var e=AjxDispatcher.run("GetCalController");
e._miniCalendar=this._miniCalendar;
e._minicalMenu=this._minicalMenu;
e._miniCalDropTarget=this._miniCalDropTarget;
return e
};
ZmCalMgr.prototype._miniCalMouseOutDayCallback=function(e){
this._currentMouseOverDay=null
};
ZmCalMgr.prototype._getDayToolTipOnDelay=function(a,e){
if(!this._currentMouseOverDay){
return
}
if((this._currentMouseOverDay.getDate()==e.getDate())&&(this._currentMouseOverDay.getMonth()==e.getMonth())){
this._currentMouseOverDay=null;
var t=DwtShell.mouseEvent;
if(t&&t.docX>0&&t.docY>0){
var i=new AjxCallback(this,this.showTooltip,[a,t.docX,t.docY]);
this.getCalViewController().getDayToolTipText(e,false,i)
}}};
ZmCalMgr.prototype.showTooltip=function(o,e,n,i){
o.setToolTipContent(i);
if(e>0&&n>0){
var t=DwtShell.getShell(window);
var a=t.getToolTip();
a.setContent(i);
a.popup(e,n);
o.__tooltipClosed=false
}};
ZmCalMgr.prototype.getApptSummaries=function(t){
var e=this.setSearchParams(t);
if(e!=null&&(e instanceof AjxVector)){
return e
}
this._rawAppts=[];
if(t.callback){
this._search(t)
}else{
return this._search(t)
}};
ZmCalMgr.prototype.setSearchParams=function(o){
if(!(o.folderIds instanceof Array)){
o.folderIds=[o.folderIds]
}else{
if(o.folderIds.length==0){
var t=new AjxVector();
if(o.callback){
o.callback.run(t)
}
return t
}}
var n={};
var l="";
for(var h=0;
h<o.folderIds.length;
h++){
var a=o.folderIds[h];
var s=appCtxt.getActiveAccount().isMain?a:ZmOrganizer.getSystemId(a);
var e=appCtxt.getById(s);
var d=e?e.getRemoteId():s;
n[d]=s;
if(l.length){
l+=" OR "
}
var c=AjxUtil.isNumeric(a)?a:['"',a,'"'].join("");
l+="inid:"+c
}
o.queryHint=l;
o.folderIdMapper=n;
o.offset=0
};
ZmCalMgr.prototype._search=function(o){
var n={
SearchRequest:{
_jsns:"urn:zimbraMail"}};
var i=n.SearchRequest;
this._setSoapParams(i,o);
var a=appCtxt.multiAccounts?appCtxt.accountList.mainAccount.name:null;
if(o.callback){
appCtxt.getAppController().sendRequest({
jsonObj:n,asyncMode:true,callback:(new AjxCallback(this,this._getApptSummariesResponse,[o])),noBusyOverlay:o.noBusyOverlay,accountName:a}
)
}else{
var t=appCtxt.getAppController().sendRequest({
jsonObj:n,accountName:a}
);
var e=new ZmCsfeResult(t,false);
return this._getApptSummariesResponse(o,e)
}};
ZmCalMgr.prototype._setSoapParams=function(e,a){
e.sortBy="none";
e.limit="500";
e.calExpandInstStart=a.start;
e.calExpandInstEnd=a.end;
e.types=ZmSearch.TYPE[ZmItem.APPT];
e.offset=a.offset;
var t=a.query;
if(a.queryHint){
t=(t!=null)?(t+" ("+a.queryHint+")"):a.queryHint
}
e.query={
_content:t}
};
ZmCalMgr.prototype._getApptSummariesResponse=function(n,e){
if(!e){
return
}
var s=n.callback;
var o;
try{
o=e.getResponse()
}
catch(t){
if(s){
s.run(new AjxVector())
}
return
}
var i=o.SearchResponse;
var a=this.processSearchResponse(i,n);
if(a==null){
return
}
if(s){
s.run(a,n.query)
}else{
return a
}};
ZmCalMgr.prototype.processSearchResponse=function(s,n){
if(!s){
return
}
if(s&&s.appt&&s.appt.length){
this._rawAppts=this._rawAppts!=null?this._rawAppts.concat(s.appt):s.appt;
if(s.more){
var d=s.appt[s.appt.length-1];
if(d){
n.offset+=500;
this._search(n);
return
}}}
var a=new AjxVector();
if(this._rawAppts&&this._rawAppts.length){
this._list=new ZmList(ZmItem.APPT);
for(var l=0;
l<this._rawAppts.length;
l++){
var o=this._rawAppts[l];
var t=o?o.inst:null;
if(t){
var c={
list:this._list};
for(var h=0;
h<t.length;
h++){
var e=ZmCalBaseItem.createFromDom(o,c,t[h]);
if(e){
a.add(e)
}}}}}
return a
};
ZmCalMgr.prototype.getCalendarName=function(e){
var t=appCtxt.getApp(ZmApp.CALENDAR);
return t.getCalendarName(e)
};
ZmCalMgr.prototype._newApptAction=function(t){
var e=this.getCalViewController();
e._newApptAction(t)
};
ZmCalMgr.prototype._newAllDayApptAction=function(t){
var e=this.getCalViewController();
e._newAllDayApptAction(t)
};
ZmCalMgr.prototype._searchMailAction=function(t){
var e=this.getCalViewController();
e._searchMailAction(t)
};
ZmCalMgr.prototype.getCheckedCalendarFolderIds=function(e){
var t=appCtxt.getApp(ZmApp.CALENDAR);
return t.getCheckedCalendarFolderIds(e)
};
ZmCalMgr.prototype._handleError=function(t){
if(t.code=="mail.INVITE_OUT_OF_DATE"||t.code=="mail.NO_SUCH_APPT"){
var e=appCtxt.getMsgDialog();
e.setMessage(ZmMsg.apptOutOfDate,DwtMessageDialog.INFO_STYLE);
e.popup();
return true
}
return false
};
ZmCalMgr.prototype.highlightMiniCal=function(){
this.getMiniCalCache()._getMiniCalData(this.getMiniCalendarParams())
};
ZmCalMgr.prototype.getMiniCalendarParams=function(){
var e=this.getMiniCalendar().getDateRange();
return{
start:e.start.getTime(),end:e.end.getTime(),fanoutAllDay:true,noBusyOverlay:true,folderIds:this.getCheckedCalendarFolderIds(),tz:AjxTimezone.DEFAULT}
};
ZmCalMgr.prototype.getMiniCalCache=function(){
if(!this._miniCalCache){
this._miniCalCache=new ZmMiniCalCache(this)
}
return this._miniCalCache
};
ZmCalMgr.prototype.getQuickReminderSearchTimeRange=function(){
var a=new Date();
a.setHours(23,59,59,999);
var e=new Date(a.getTime());
var t=a;
t.setHours(0,0,0,0);
return{
start:t.getTime(),end:e.getTime()}
};
ZmCalMgr.prototype.showQuickReminder=function(){
var e=this.getQuickReminderParams();
this.getApptSummaries(e)
};
ZmCalMgr.prototype.getQuickReminderParams=function(){
var e=this.getQuickReminderSearchTimeRange();
return{
start:e.start,end:e.end,fanoutAllDay:false,folderIds:this.getCheckedCalendarFolderIds(true),callback:(new AjxCallback(this,this._quickReminderCallback)),includeReminders:true}
};
ZmCalMgr.prototype._quickReminderCallback=function(l){
var o=new AjxVector();
this._cacheMap={};
var d=l.size();
var a=(new Date()).getTime();
for(var h=0;
h<d;
h++){
var e=l.get(h);
var t=e.id;
if(!this._cacheMap[t]){
this._cacheMap[t]=e;
if(e.isAllDayEvent()){
continue
}
var c=e.getStartTime()-a;
var s=(c>=0&&c<=AjxDateUtil.MSEC_PER_HOUR);
if((a>=e.getStartTime()&&a<=e.getEndTime())||s){
e.isUpcomingEvent=s;
o.add(e)
}}}
var n=this.getQuickReminderDialog();
n.initialize(o);
n.popup()
};
ZmCalMgr.prototype.getQuickReminderDialog=function(){
if(this._reminderDialog==null){
this._reminderDialog=new ZmQuickReminderDialog(appCtxt.getShell(),this,this._calController)
}
return this._reminderDialog
}
}
if(AjxPackage.define("zimbraMail.calendar.model.ZmMiniCalCache")){
ZmMiniCalCache=function(e){
this._calViewController=e;
this.clearCache()
};
ZmMiniCalCache.prototype.toString=function(){
return"ZmMiniCalCache"
};
ZmMiniCalCache.prototype.clearCache=function(){
this._miniCalData={}
};
ZmMiniCalCache.prototype.updateCache=function(a,t){
var e=this._getCacheKey(a);
this._miniCalData[e]=t
};
ZmMiniCalCache.prototype._getCacheKey=function(t){
var e=[];
e=e.concat(t.folderIds);
e.sort();
return(t.start+":"+t.end+":"+e.join(":"))
};
ZmMiniCalCache.prototype._getMiniCalData=function(i){
var a=this._getCacheKey(i);
var t=this._miniCalData[a];
if(t){
this.highlightMiniCal(t);
if(i.callback){
i.callback.run(t);
return
}
return t
}
var o={
GetMiniCalRequest:{
_jsns:"urn:zimbraMail"}};
var e=o.GetMiniCalRequest;
this._setSoapParams(e,i);
appCtxt.getAppController().sendRequest({
jsonObj:o,asyncMode:true,callback:(new AjxCallback(this,this._getMiniCalResponse,[i])),errorCallback:(new AjxCallback(this,this._handleMiniCalResponseError,[i])),noBusyOverlay:i.noBusyOverlay,accountName:(appCtxt.multiAccounts?appCtxt.accountList.mainAccount.name:null)}
)
};
ZmMiniCalCache.prototype.getCacheData=function(a){
var t=this._getCacheKey(a);
var e=this._miniCalData[t];
if(e){
return e
}};
ZmMiniCalCache.prototype._handleMiniCalResponseError=function(o,e){
var a=e?e.code:null;
if(a==ZmCsfeException.ACCT_NO_SUCH_ACCOUNT||a==ZmCsfeException.MAIL_NO_SUCH_MOUNTPOINT){
var i=(e&&e.data)?e.data:null;
var n=(i&&i.itemId&&(i.itemId.length>0))?i.itemId[0]:null;
if(n&&appCtxt.getById(n)&&this._faultHandler){
var t=appCtxt.getById(n);
t.noSuchFolder=true;
this._faultHandler.run(t);
return true
}}
if(o.callback){
o.callback.run([])
}
return true
};
ZmMiniCalCache.prototype._setSoapParams=function(a,o){
a.s=o.start;
a.e=o.end;
a.tz=o.tz;
var e=null;
if(o.folderIds&&o.folderIds.length){
a.folder=[];
for(var t=0;
t<o.folderIds.length;
t++){
a.folder.push({
id:o.folderIds[t]}
)
}}
if(o.tz){
a.tz=[];
a.tz.push({
id:o.tz}
)
}};
ZmMiniCalCache.prototype.setFaultHandler=function(e){
this._faultHandler=e
};
ZmMiniCalCache.prototype._getMiniCalResponse=function(h,e){
var o=[];
if(!e){
return o
}
var l=h.callback;
var s=e&&e._data&&e._data;
var a=s.GetMiniCalResponse;
if(a&&a.date){
var n=a.date;
if(n){
for(var t=0;
t<n.length;
t++){
if(n[t]._content){
o.push(n[t]._content)
}}}
this.highlightMiniCal(o)
}else{
this.highlightMiniCal([])
}
this.updateCache(h,o);
if(h.callback){
h.callback.run(o);
return
}
return o
};
ZmMiniCalCache.prototype.processBatchResponse=function(a,t){
if(!a){
return
}
for(var e=0;
e<a.length;
e++){
var o=(a[e]&&a[e].date);
if(o){
for(var e=0;
e<o.length;
e++){
if(o[e]._content){
t.push(o[e]._content)
}}}}};
ZmMiniCalCache.prototype.highlightMiniCal=function(a){
var e=[];
for(var t=0;
t<a.length;
t++){
if(a[t]){
e[a[t]]=AjxDateFormat.parse("yyyyMMdd",a[t])
}}
if(this._calViewController&&this._calViewController._miniCalendar){
this._calViewController._miniCalendar.setHilite(e,true,true)
}}
}
if(AjxPackage.define("zimbraMail.calendar.controller.ZmReminderController")){
ZmReminderController=function(e){
this._calController=e;
this._apptState={};
this._cacheMap={};
this._cachedAppts=new AjxVector();
this._activeAppts=new AjxVector();
this._oldAppts=new AjxVector();
this._housekeepingTimedAction=new AjxTimedAction(this,this._housekeepingAction);
this._refreshTimedAction=new AjxTimedAction(this,this.refresh);
var a=appCtxt.getSettings();
var i=new AjxListener(this,this._settingChangeListener);
var t=a.getSetting(ZmSetting.CAL_REMINDER_WARNING_TIME);
if(t){
t.addChangeListener(i);
this._warningTime=appCtxt.get(ZmSetting.CAL_REMINDER_WARNING_TIME)
}};
ZmReminderController.prototype.constructor=ZmReminderController;
ZmReminderController._STATE_ACTIVE=1;
ZmReminderController._STATE_DISMISSED=2;
ZmReminderController._STATE_SNOOZED=3;
ZmReminderController._CACHE_RANGE=24;
ZmReminderController._CACHE_REFRESH=16;
ZmReminderController.prototype.toString=function(){
return"ZmReminderController"
};
ZmReminderController.prototype._settingChangeListener=function(i){
if(i.type!=ZmEvent.S_SETTING){
return
}
var a=i.source;
if(a.id!=ZmSetting.CAL_REMINDER_WARNING_TIME){
return
}
var t=this._warningTime;
var e=this._warningTime=a.getValue();
if(e==0){
this._cancelRefreshAction();
this._cancelHousekeepingAction()
}else{
if(t==0){
this.refresh()
}else{
this._cancelHousekeepingAction();
this._housekeepingAction()
}}
this._warningTime=e
};
ZmReminderController.prototype.refresh=function(){
if(this._warningTime==0){
return
}
this._searchTimeRange=this.getSearchTimeRange();
var e=this.getRefreshParams();
this._calController.getApptSummaries(e);
if(this._refreshActionId){
AjxTimedAction.cancelAction(this._refreshActionId)
}
this._refreshActionId=AjxTimedAction.scheduleAction(this._refreshTimedAction,(AjxDateUtil.MSEC_PER_HOUR*ZmReminderController._CACHE_REFRESH))
};
ZmReminderController.prototype.getSearchTimeRange=function(){
var a=new Date();
a.setHours(23,59,59,999);
var e=new Date(a.getTime());
a.setDate(a.getDate()-7);
var t=a;
t.setHours(0,0,0,0);
return{
start:t.getTime(),end:e.getTime()}
};
ZmReminderController.prototype.getRefreshParams=function(){
var e=this.getSearchTimeRange();
return{
start:e.start,end:e.end,fanoutAllDay:false,folderIds:this._calController.getCheckedCalendarFolderIds(true),callback:(new AjxCallback(this,this._refreshCallback)),includeReminders:true}
};
ZmReminderController.prototype._cancelRefreshAction=function(){
if(this._refreshActionId){
AjxTimedAction.cancelAction(this._refreshActionId);
delete this._refreshActionId
}};
ZmReminderController.prototype._cancelHousekeepingAction=function(){
if(this._houseKeepingActionId){
AjxTimedAction.cancelAction(this._housekeepingActionId);
delete this._houseKeepingActionId
}};
ZmReminderController.prototype._refreshCallback=function(n){
if(this._refreshDelay>0){
AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._refreshCallback,[n]),this._refreshDelay);
this._refreshDelay=0;
return
}
if(n instanceof ZmCsfeException){
this._calController._handleError(n,new AjxCallback(this,this._maintErrorHandler));
return
}
var a=new AjxVector();
this._cacheMap={};
var t=n.size();
for(var e=0;
e<t;
e++){
var o=n.get(e);
var s=o.id;
if(o.hasAlarmData()){
if(!this._cacheMap[s]){
this._cacheMap[s]=true;
a.add(o)
}}}
this._cachedAppts=a.clone();
this._cachedAppts.sort(ZmCalBaseItem.compareByTimeAndDuration);
this._activeAppts.removeAll();
this._cancelHousekeepingAction();
this._housekeepingAction()
};
ZmReminderController.prototype.updateCache=function(n){
if(!n){
return
}
if(!this._cachedAppts){
this._cachedAppts=new AjxVector()
}
var h=this.getSearchTimeRange();
var o=0;
var t=n.size();
for(var e=0;
e<t;
e++){
var a=n.get(e);
var s=a.id;
if(a.hasAlarmData()&&!this._cacheMap[s]&&a.isStartInRange(h.start,h.end)){
this._cacheMap[s]=true;
this._cachedAppts.add(a);
o++
}}};
ZmReminderController.prototype.isApptSnoozed=function(e){
return(this._apptState[e]==ZmReminderController._STATE_SNOOZED)
};
ZmReminderController.prototype._housekeepingAction=function(){
var p=this.getReminderDialog();
if(!ZmCsfeCommand.getAuthToken()){
if(p&&p.isPoppedUp()){
p.popdown()
}
return
}
if(this._searchTimeRange){
var u=this.getSearchTimeRange();
var f=u.end-this._searchTimeRange.end;
if(f>AjxDateUtil.MSEC_PER_HOUR){
this._searchTimeRange=null;
this.refresh();
return
}}
var t=this._cachedAppts.size();
var l=this._activeAppts.size();
if(t==0&&l==0){
this._housekeepingActionId=AjxTimedAction.scheduleAction(this._housekeepingTimedAction,60*1000);
return
}
var m=0;
var n=(new Date()).getTime();
var c=n+(this._warningTime*60*1000);
var o=[];
for(var h=0;
h<t;
h++){
var e=this._cachedAppts.get(h);
if(e&&this._snoozedAppt){
var d=e.getUniqueId(true);
if(this._snoozedAppt[d]){
this._apptState[d]=ZmReminderController._STATE_ACTIVE;
o.push(e);
m++;
this._activeAppts.add(e);
delete this._snoozedAppt[d];
continue
}}
if(!e||e.ptst==ZmCalBaseItem.PSTATUS_DECLINED){
o.push(e)
}else{
if(e.isAlarmInRange()){
var d=e.getUniqueId(true);
var a=this._apptState[d];
var s=false;
if(a==ZmReminderController._STATE_DISMISSED){}else{
if(a==ZmReminderController._STATE_ACTIVE){
s=true
}else{
if(a!=ZmReminderController._STATE_SNOOZED){
m++;
s=true;
this._apptState[d]=ZmReminderController._STATE_ACTIVE
}}}
if(s){
o.push(e);
if(!appCtxt.get(ZmSetting.CAL_SHOW_PAST_DUE_REMINDERS)&&e.isAlarmOld()){
m--;
this._oldAppts.add(e)
}else{
this._activeAppts.add(e)
}}}}}
for(var h in o){
this._cachedAppts.remove(o[h])
}
if(m||p.isPoppedUp()){
if(this._activeAppts.size()==0&&p.isPoppedUp()){
p.popdown()
}else{
p.initialize(this._activeAppts);
if(!p.isPoppedUp()){
p.popup()
}}}
if(this._oldAppts.size()>0){
this.dismissAppt(this._oldAppts,new AjxCallback(this,this._silentDismissCallback))
}
this._housekeepingActionId=AjxTimedAction.scheduleAction(this._housekeepingTimedAction,60*1000)
};
ZmReminderController.prototype._silentDismissCallback=function(o){
var t=o.size();
for(var e=0;
e<t;
e++){
var a=o.get(e);
if(a&&a.hasAlarmData()){
if(a.isAlarmInRange()){
this._activeAppts.add(a)
}}}
this._oldAppts.removeAll();
this._cancelHousekeepingAction();
this._housekeepingAction()
};
ZmReminderController.prototype.dismissAppt=function(a,o){
var t;
if(!(a instanceof AjxVector)){
a=AjxVector.fromArray((a instanceof Array)?a:[a])
}
for(var e=0;
e<a.size();
e++){
var t=a.get(e);
this._apptState[t.getUniqueId(true)]=ZmReminderController._STATE_DISMISSED;
this._activeAppts.remove(t)
}
this.dismissApptRequest(a,o)
};
ZmReminderController.prototype.snoozeAppt=function(n){
var a=[];
var o;
var t;
for(var e=0;
e<n.size();
e++){
o=n.get(e);
t=o.getUniqueId(true);
this._apptState[t]=ZmReminderController._STATE_SNOOZED;
a.push(t);
this._activeAppts.remove(o);
this._cachedAppts.add(o)
}
return a
};
ZmReminderController.prototype.activateSnoozedAppts=function(n){
var o=this.getReminderDialog();
if(o&&o.isPoppedUp()){
o.popdown()
}
if(this._snoozedAppt==null){
this._snoozedAppt={}
}
var a;
var t;
for(var e=0;
e<n.size();
e++){
a=n.get(e);
if(a){
t=a.getUniqueId(true);
this._snoozedAppt[t]=true
}}
this._cancelHousekeepingAction();
this._housekeepingAction()
};
ZmReminderController.prototype.dismissApptRequest=function(s,c){
var l=AjxSoapDoc.create("DismissCalendarItemAlarmRequest","urn:zimbraMail");
var t=(new Date()).getTime();
for(var n=0;
n<s.size();
n++){
var e=s.get(n);
var a=l.set("appt");
a.setAttribute("id",e.id);
a.setAttribute("dismissedAt",t)
}
var h=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount;
var o={
soapDoc:l,asyncMode:true,accountName:(h?h.name:null),callback:(new AjxCallback(this,this._handleDismissAppt,[s,c])),errorCallback:(new AjxCallback(this,this._handleErrorDismissAppt,[s,c]))};
appCtxt.getAppController().sendRequest(o);
return true
};
ZmReminderController.prototype.setAlarmData=function(e,t,i){
var a=e.set("alarmData",null,t);
a.setAttribute("")
};
ZmReminderController.prototype._handleDismissAppt=function(n,l,d){
if(d.isException()){
return
}
var t=d.getResponse();
var s=t.DismissCalendarItemAlarmResponse;
var a=s?s.appt:null;
if(!a){
return
}
var h={};
for(var o in a){
var e=a[o];
if(e&&e.calItemId){
h[e.calItemId]=e.alarmData?e.alarmData:{}
}}
var c=n.size();
for(var o=0;
o<c;
o++){
var e=n.get(o);
if(e){
if(h[e.id]){
e.alarmData=(h[e.id]!={}
)?h[e.id]:null
}}}
if(l){
l.run(n)
}};
ZmReminderController.prototype._handleErrorDismissAppt=function(t,a,e){};
ZmReminderController.prototype.getReminderDialog=function(){
if(this._reminderDialog==null){
this._reminderDialog=new ZmReminderDialog(appCtxt.getShell(),this,this._calController)
}
return this._reminderDialog
}
}
if(AjxPackage.define("zimbraMail.calendar.view.ZmReminderDialog")){
ZmReminderDialog=function(n,h,e){
var o=Dwt.getNextId();
var a=[];
var t=0;
a[t++]="<td valign='middle' class='ZmReminderField'>";
a[t++]=ZmMsg.snoozeAll;
a[t++]="</td><td valign='middle' id='";
a[t++]=o;
a[t++]="'></td><td valign='middle' id=\"{0}\"></td>";
var s=new DwtDialog_ButtonDescriptor(ZmReminderDialog.SNOOZE_BUTTON,ZmMsg.snooze,DwtDialog.ALIGN_LEFT,null,a.join(""));
var l=new DwtDialog_ButtonDescriptor(ZmReminderDialog.DISMISS_ALL_BUTTON,ZmMsg.dismissAll,DwtDialog.ALIGN_RIGHT);
DwtDialog.call(this,{
parent:n,standardButtons:DwtDialog.NO_BUTTONS,extraButtons:[s,l]}
);
this._reminderController=h;
this._calController=e;
this.setContent(this._contentHtml(o));
this.setTitle(ZmMsg.apptReminders);
this.registerCallback(ZmReminderDialog.SNOOZE_BUTTON,this._handleSnoozeButton,this);
this.registerCallback(ZmReminderDialog.DISMISS_ALL_BUTTON,this._handleDismissAllButton,this)
};
ZmReminderDialog.prototype=new DwtDialog;
ZmReminderDialog.prototype.constructor=ZmReminderDialog;
ZmReminderDialog.SNOOZE_BUTTON=++DwtDialog.LAST_BUTTON;
ZmReminderDialog.DISMISS_ALL_BUTTON=++DwtDialog.LAST_BUTTON;
ZmReminderDialog.SOON=-AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES;
ZmReminderDialog.prototype.toString=function(){
return"ZmReminderDialog"
};
ZmReminderDialog.prototype.popup=function(){
DwtDialog.prototype.popup.call(this);
this._cancelSnooze();
if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_BROWSER)){
AjxPackage.require("Alert");
ZmBrowserAlert.getInstance().start(ZmMsg.appointmentReminder)
}
if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_SOUNDS)){
AjxPackage.require("Alert");
ZmSoundAlert.getInstance().start()
}
if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_TOASTER)){
AjxPackage.require("Alert");
var o=[];
var e=this._list.getArray();
for(var t=0;
t<e.length&&t<5;
t++){
var a=e[t];
var s=this._formatDeltaString(this._computeDelta(a));
var n=[a.getName(),", ",this._getDurationText(a),"\n(",s,")"].join("");
if(AjxEnv.isMac){
ZmDesktopAlert.getInstance().start(ZmMsg.appointmentReminder,n)
}else{
if(AjxEnv.isWindows){
o.push(n)
}}}
if(AjxEnv.isWindows&&o.length>0){
if(e.length>5){
o.push(ZmMsg.andMore)
}
ZmDesktopAlert.getInstance().start(ZmMsg.appointmentReminder,o.join("\n"),5)
}}};
ZmReminderDialog.prototype.initialize=function(u){
this._list=u.clone();
this._apptData={};
var c=[];
var m=0;
var p=u.size();
c[m++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
for(var h=0;
h<p;
h++){
var e=u.get(h);
var d=e.getUniqueId(true);
var s=this._apptData[d]={
appt:e};
m=this._addAppt(c,m,e,s,(h>0))
}
c[m++]="</table>";
if(this._dismissButtons){
for(var a in this._dismissButtons){
this._dismissButtons[a].dispose()
}}
if(this._openButtons){
for(var a in this._openButtons){
this._openButtons[a].dispose()
}}
this._dismissButtons={};
this._openButtons={};
var o=new AjxListener(this,this._dismissButtonListener);
var f=new AjxListener(this,this._openButtonListener);
var t=document.getElementById(this._listId);
t.innerHTML=c.join("");
for(var h=0;
h<p;
h++){
var e=u.get(h);
var d=e.getUniqueId(true);
var s=this._apptData[d];
var l=this._dismissButtons[s.dismissBtnId]=new DwtButton({
parent:this,className:"DwtToolbarButton",parentElement:s.dismissBtnId}
);
l.setImage("Cancel");
l.setText(ZmMsg.dismiss);
l.addSelectionListener(o);
l.apptUid=d;
var n=this._openButtons[s.openBtnId]=new DwtButton({
parent:this,className:"DwtToolbarButton",parentElement:s.openBtnId}
);
n.setImage(e.otherAttendees?"ApptMeeting":"Appointment");
n.setText(ZmMsg.viewAppointment);
n.addSelectionListener(f);
n.apptUid=d;
this._updateDelta(s)
}};
ZmReminderDialog.prototype._contentHtml=function(o){
this._listId=Dwt.getNextId();
var e=[1,5,10,15,30,45,60];
this._select=new DwtSelect({
parent:this}
);
var n=new AjxMessageFormat(ZmMsg.reminderSnoozeMinutes);
for(var a=0;
a<e.length;
a++){
var t=n.format(e[a]);
this._select.addOption(t,a==0,e[a])
}
this._select.reparentHtmlElement(o);
return["<div class='ZmReminderDialog' id='",this._listId,"'>"].join("")
};
ZmReminderDialog.prototype._updateDelta=function(t){
var a=document.getElementById(t.deltaId);
if(a){
var e=this._computeDelta(t.appt);
if(e>=0){
a.className="ZmReminderOverdue"
}else{
if(e>ZmReminderDialog.SOON){
a.className="ZmReminderSoon"
}else{
a.className="ZmReminderFuture"
}}
a.innerHTML=this._formatDeltaString(e)
}};
ZmReminderDialog.prototype._addAppt=function(t,e,a,i,h){
i.dismissBtnId=Dwt.getNextId();
i.openBtnId=Dwt.getNextId();
i.deltaId=Dwt.getNextId();
i.rowId=Dwt.getNextId();
var n=(a.folderId!=ZmOrganizer.ID_CALENDAR&&this._calController)?this._calController.getCalendarName(a.folderId):null;
var o=appCtxt.getById(a.folderId);
var s={
needSep:h,rowId:i.rowId,calName:n,accountName:(appCtxt.multiAccounts&&o&&o.getAccount().getDisplayName()),location:a.getReminderLocation(),apptIconHtml:(AjxImg.getImageHtml(a.otherAttendees?"ApptMeeting":"Appointment")),organizer:a.otherAtt?a.organizer:null,reminderName:(AjxStringUtil.htmlEncode(a.getReminderName())),durationText:(AjxStringUtil.trim(this._getDurationText(a))),deltaId:i.deltaId,openBtnId:i.openBtnId,dismissBtnId:i.dismissBtnId};
t[e++]=AjxTemplate.expand("calendar.Calendar#ReminderDialogRow",s);
return e
};
ZmReminderDialog.prototype._openButtonListener=function(o){
appCtxt.getAppController().setStatusMsg(ZmMsg.allRemindersAreSnoozed,ZmStatusView.LEVEL_INFO);
this._handleSnoozeButton();
var s=DwtControl.getTargetControl(o);
var n=this._apptData[s.apptUid];
var a=n?n.appt:null;
if(a){
AjxDispatcher.require(["CalendarCore","Calendar"]);
var l=AjxDispatcher.run("GetCalController");
var t=new ZmAppt();
for(var e in a){
if(!AjxUtil.isFunction(a[e])){
t[e]=a[e]
}}
var h=new AjxCallback(l,l._showAppointmentDetails,t);
t.getDetails(null,h,null,null,true)
}};
ZmReminderDialog.prototype._dismissButtonListener=function(a){
var n=DwtControl.getTargetControl(a);
var o=this._apptData[n.apptUid];
if(!o){
return
}
this._reminderController.dismissAppt(o.appt);
var e=this._dismissButtons[o.dismissBtnId];
if(e){
e.dispose();
delete this._dismissButtons[o.dismissBtnId]
}
var i=this._openButtons[o.openBtnId];
if(i){
i.dispose();
delete this._openButtons[o.openBtnId]
}
var s=document.getElementById(o.rowId);
if(s){
var t=s.nextSibling;
if(t&&t.getAttribute("name")=="rdsep"){
t.parentNode.removeChild(t)
}
s.parentNode.removeChild(s)
}
delete this._apptData[n.apptUid];
this._list.remove(o.appt);
if(this._list.size()==0){
this.popdown()
}};
ZmReminderDialog.prototype._handleSnoozeButton=function(){
this.popdown();
var e=this._reminderController.snoozeAppt(this._list);
var a=this._list.clone();
var t=new AjxTimedAction(this,this._snoozeAction,[a]);
AjxTimedAction.scheduleAction(t,this._select.getValue()*60*1000)
};
ZmReminderDialog.prototype._snoozeAction=function(e){
if(e){
this._reminderController.activateSnoozedAppts(e)
}};
ZmReminderDialog.prototype._cancelSnooze=function(){
if(this._snoozeActionId){
AjxTimedAction.cancelAction(this._snoozeActionId);
delete this._snoozeActionId
}};
ZmReminderDialog.prototype._handleDismissAllButton=function(){
this._cancelSnooze();
this.popdown();
this._reminderController.dismissAppt(this._list)
};
ZmReminderDialog.prototype._getDurationText=function(a){
var o=a.isMultiDay();
var n=a._alarmInstStart?new Date(a._alarmInstStart):a.startDate;
var t=a._alarmInstStart?(n.getTime()+a.getDuration()):a.getEndTime();
var e=new Date(t);
if(a.isAllDayEvent()){
e=new Date(t-(o?2*AjxDateUtil.MSEC_PER_HOUR:0));
var i=o?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
return AjxMessageFormat.format(i,[n,e])
}
var i=o?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
return AjxMessageFormat.format(i,[n,e,""])
};
ZmReminderDialog.prototype._computeDelta=function(e){
return(e.alarmData&&e.alarmData.length>0)?((new Date()).getTime()-e.adjustMS(e.alarmData[0].alarmInstStart,e.tzo)):((new Date()).getTime()-e.getStartTime())
};
ZmReminderDialog.prototype._formatDeltaString=function(i){
var o=i<0?"In":"OverdueBy";
i=Math.abs(i);
var s=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*365));
if(s!=0){
i-=s*AjxDateUtil.MSEC_PER_DAY*365
}
var t=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*30.42));
if(t>0){
i-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
}
var d=Math.floor(i/AjxDateUtil.MSEC_PER_DAY);
if(d>0){
i-=d*AjxDateUtil.MSEC_PER_DAY
}
var l=Math.floor(i/AjxDateUtil.MSEC_PER_HOUR);
if(l>0){
i-=l*AjxDateUtil.MSEC_PER_HOUR
}
var e=Math.floor(i/60000);
if(e>0){
i-=e*60000
}
var n=Math.floor(i/1000);
if(n>30&&e<59){
e++
}
var n=0;
var a;
if(s>0){
a="Years";
if(s<=3&&t>0){
a="YearsMonths"
}}else{
if(t>0){
a="Months";
if(t<=3&&d>0){
a="MonthsDays"
}}else{
if(d>0){
a="Days";
if(d<=2&&l>0){
a="DaysHours"
}}else{
if(l>0){
a="Hours";
if(l<5&&e>0){
a="HoursMinutes"
}}else{
a="Minutes"
}}}}
var c=["reminder",o,a].join("");
var h=[i,s,t,d,l,e,n];
return AjxMessageFormat.format(ZmMsg[c],h)
}
}
if(AjxPackage.define("zimbraMail.calendar.view.ZmQuickReminderDialog")){
ZmQuickReminderDialog=function(a,i,e){
var t=Dwt.getNextId();
DwtDialog.call(this,{
parent:a,standardButtons:[DwtDialog.OK_BUTTON]}
);
this._reminderController=i;
this._calController=e;
this.setContent(this._contentHtml(t));
this.setTitle(ZmMsg.currentMeetings)
};
ZmQuickReminderDialog.prototype=new DwtDialog;
ZmQuickReminderDialog.prototype.constructor=ZmQuickReminderDialog;
ZmQuickReminderDialog.SOON=-AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES;
ZmQuickReminderDialog.prototype.toString=function(){
return"ZmQuickReminderDialog"
};
ZmQuickReminderDialog.prototype.popup=function(){
DwtDialog.prototype.popup.call(this)
};
ZmQuickReminderDialog.prototype.initialize=function(c){
this._list=c.clone();
this._apptData={};
var h=[];
var d=0;
var m=c.size();
h[d++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
for(var s=0;
s<m;
s++){
var e=c.get(s);
var l=e.getUniqueId(true);
var n=this._apptData[l]={
appt:e};
d=this._addAppt(h,d,e,n,(s>0))
}
if(m==0){
h[d++]='<tr name="rdsep">';
h[d++]="<td colspan=3><div>"+ZmMsg.noMeetingsFound+"</div></td>";
h[d++]="</tr>"
}
h[d++]="</table>";
if(this._openButtons){
for(var a in this._openButtons){
this._openButtons[a].dispose()
}}
this._openButtons={};
var u=new AjxListener(this,this._openButtonListener);
var t=document.getElementById(this._listId);
t.innerHTML=h.join("");
for(var s=0;
s<m;
s++){
var e=c.get(s);
var l=e.getUniqueId(true);
var n=this._apptData[l];
var o=this._openButtons[n.openBtnId]=new DwtButton({
parent:this,className:"DwtToolbarButton",parentElement:n.openBtnId}
);
o.setImage(e.otherAttendees?"ApptMeeting":"Appointment");
o.setText(ZmMsg.viewAppointment);
o.addSelectionListener(u);
o.apptUid=l;
this._updateDelta(n)
}};
ZmQuickReminderDialog.prototype._contentHtml=function(e){
this._listId=Dwt.getNextId();
return["<div class='ZmQuickReminderDialog' id='",this._listId,"'>"].join("")
};
ZmQuickReminderDialog.prototype._updateDelta=function(t){
var a=document.getElementById(t.deltaId);
if(a){
var e=this._computeDelta(t.appt);
if(e>=0){
a.className="ZmReminderOverdue"
}else{
if(e>ZmQuickReminderDialog.SOON){
a.className="ZmReminderSoon"
}else{
a.className="ZmReminderFuture"
}}
a.innerHTML=this._formatDeltaString(e)
}};
ZmQuickReminderDialog.prototype._addAppt=function(o,h,e,i,s){
i.openBtnId=Dwt.getNextId();
i.deltaId=Dwt.getNextId();
i.rowId=Dwt.getNextId();
var n=(e.folderId!=ZmOrganizer.ID_CALENDAR&&this._calController)?this._calController.getCalendarName(e.folderId):null;
var a=appCtxt.getById(e.folderId);
var l=e.isUpcomingEvent?" ("+ZmMsg.upcoming+")":"";
var t={
needSep:s,rowId:i.rowId,calName:n,accountName:(appCtxt.multiAccounts&&a&&a.getAccount().getDisplayName()),location:e.getLocation(),apptIconHtml:(AjxImg.getImageHtml(e.otherAttendees?"ApptMeeting":"Appointment")),organizer:e.otherAtt?e.organizer:null,reminderName:(AjxStringUtil.htmlEncode(e.name+l)),durationText:(AjxStringUtil.trim(this._getDurationText(e))),deltaId:i.deltaId,openBtnId:i.openBtnId};
o[h++]=AjxTemplate.expand("calendar.Calendar#ReminderDialogRow",t);
return h
};
ZmQuickReminderDialog.prototype._openButtonListener=function(o){
var s=DwtControl.getTargetControl(o);
var n=this._apptData[s.apptUid];
var a=n?n.appt:null;
if(a){
AjxDispatcher.require(["CalendarCore","Calendar"]);
var l=AjxDispatcher.run("GetCalController");
var t=new ZmAppt();
for(var e in a){
if(!AjxUtil.isFunction(a[e])){
t[e]=a[e]
}}
var h=new AjxCallback(l,l._showAppointmentDetails,t);
t.getDetails(null,h,null,null,true);
this.popdown()
}};
ZmQuickReminderDialog.prototype._getDurationText=function(a){
var o=a.isMultiDay();
var n=a.startDate;
var t=a.getEndTime();
var e=new Date(t);
if(a.isAllDayEvent()){
e=new Date(t-(o?2*AjxDateUtil.MSEC_PER_HOUR:0));
var i=o?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
return AjxMessageFormat.format(i,[n,e])
}
var i=o?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
return AjxMessageFormat.format(i,[n,e,""])
};
ZmQuickReminderDialog.prototype._computeDelta=function(e){
return((new Date()).getTime()-e.getStartTime())
};
ZmQuickReminderDialog.prototype._formatDeltaString=function(i){
var o=i<0?"In":"OverdueBy";
i=Math.abs(i);
var s=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*365));
if(s!=0){
i-=s*AjxDateUtil.MSEC_PER_DAY*365
}
var t=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*30.42));
if(t>0){
i-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
}
var d=Math.floor(i/AjxDateUtil.MSEC_PER_DAY);
if(d>0){
i-=d*AjxDateUtil.MSEC_PER_DAY
}
var l=Math.floor(i/AjxDateUtil.MSEC_PER_HOUR);
if(l>0){
i-=l*AjxDateUtil.MSEC_PER_HOUR
}
var e=Math.floor(i/60000);
if(e>0){
i-=e*60000
}
var n=Math.floor(i/1000);
if(n>30&&e<59){
e++
}
var n=0;
var a;
if(s>0){
a="Years";
if(s<=3&&t>0){
a="YearsMonths"
}}else{
if(t>0){
a="Months";
if(t<=3&&d>0){
a="MonthsDays"
}}else{
if(d>0){
a="Days";
if(d<=2&&l>0){
a="DaysHours"
}}else{
if(l>0){
a="Hours";
if(l<5&&e>0){
a="HoursMinutes"
}}else{
a="Minutes"
}}}}
var c=["reminder",o,a].join("");
var h=[i,s,t,d,l,e,n];
return AjxMessageFormat.format(ZmMsg[c],h)
}
}};
</script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Zimlet")){
if(AjxPackage.define("ajax.util.AjxSHA1")){
var AjxSHA1=function(){
var f=0;
var w="";
var a=8;
function l(v){
return h(o(b(v),v.length*a))
}
function r(v){
return u(o(b(v),v.length*a))
}
function i(v){
return g(o(b(v),v.length*a))
}
function t(v,k){
return h(n(v,k))
}
function s(v,k){
return u(n(v,k))
}
function d(v,k){
return g(n(v,k))
}
function e(){
return l("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"
}
function o(M,W){
M[W>>5]|=128<<(24-W%32);
M[((W+64>>9)<<4)+15]=W;
var R=Array(80);
var F=1732584193;
var S=-271733879;
var D=-1732584194;
var C=271733878;
var B=-1009589776;
for(var T=0;
T<M.length;
T+=16){
var A=F;
var O=S;
var z=D;
var q=C;
var v=B;
for(var k=0;
k<80;
k++){
if(k<16){
R[k]=M[T+k]
}else{
R[k]=m(R[k-3]^R[k-8]^R[k-14]^R[k-16],1)
}
var H=p(p(m(F,5),y(k,S,D,C)),p(p(B,R[k]),c(k)));
B=C;
C=D;
D=m(S,30);
S=F;
F=H
}
F=p(F,A);
S=p(S,O);
D=p(D,z);
C=p(C,q);
B=p(B,v)
}
return Array(F,S,D,C,B)
}
function y(k,v,q,x){
if(k<20){
return(v&q)|((~v)&x)
}
if(k<40){
return v^q^x
}
if(k<60){
return(v&q)|(v&x)|(q&x)
}
return v^q^x
}
function c(v){
return(v<20)?1518500249:(v<40)?1859775393:(v<60)?-1894007588:-899497514
}
function n(x,z){
var j=b(x);
if(j.length>16){
j=o(j,x.length*a)
}
var v=Array(16),q=Array(16);
for(var k=0;
k<16;
k++){
v[k]=j[k]^909522486;
q[k]=j[k]^1549556828
}
var T=o(v.concat(b(z)),512+z.length*a);
return o(q.concat(T),512+160)
}
function p(v,j){
var q=(v&65535)+(j&65535);
var k=(v>>16)+(j>>16)+(q>>16);
return(k<<16)|(q&65535)
}
function m(v,k){
return(v<<k)|(v>>>(32-k))
}
function b(q){
var x=Array();
var v=(1<<a)-1;
for(var k=0;
k<q.length*a;
k+=a){
x[k>>5]|=(q.charCodeAt(k/a)&v)<<(32-a-k%32)
}
return x
}
function g(x){
var q="";
var v=(1<<a)-1;
for(var k=0;
k<x.length*32;
k+=a){
q+=String.fromCharCode((x[k>>5]>>>(32-a-k%32))&v)
}
return q
}
function h(x){
var k=f?"0123456789ABCDEF":"0123456789abcdef";
var q="";
for(var v=0;
v<x.length*4;
v++){
q+=k.charAt((x[v>>2]>>((3-v%4)*8+4))&15)+k.charAt((x[v>>2]>>((3-v%4)*8))&15)
}
return q
}
function u(q){
var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var T="";
for(var k=0;
k<q.length*4;
k+=3){
var z=(((q[k>>2]>>8*(3-k%4))&255)<<16)|(((q[k+1>>2]>>8*(3-(k+1)%4))&255)<<8)|((q[k+2>>2]>>8*(3-(k+2)%4))&255);
for(var v=0;
v<4;
v++){
if(k*8+v*6>q.length*32){
T+=w
}else{
T+=x.charAt((z>>6*(3-v))&63)
}}}
return T
}
this.hex_sha1=l;
this.b64_sha1=r;
this.str_sha1=i;
this.hex_hmac_sha1=t;
this.b64_hmac_sha1=s;
this.str_hmac_sha1=d;
this.sha1_vm_test=e
};
AjxSHA1=new AjxSHA1()
}
if(AjxPackage.define("ajax.xslt.AjxXslt")){
AjxXslt=function(){
var o=AjxXmlDoc.create();
if(AjxEnv.isIE){
var n=null;
var e=["MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.3.0"];
for(var a=0;
a<e.length;
a++){
try{
n=new ActiveXObject(e[a]);
break
}
catch(t){}}
if(!n){
throw new AjxException("FreeThreadedDOMDocument",AjxException.UNSUPPORTED,"AjxXslt")
}
n.async=false;
o._doc=n
}
this._doc=o
};
AjxXslt.prototype.toString=function(){
return"AjxXslt"
};
AjxXslt.createFromUrl=function(e){
var t=new AjxXslt();
t.loadUrl(e);
return t
};
AjxXslt.createFromString=function(t){
var e=new AjxXslt();
e._doc.loadFromString(t);
e.createProcessor();
return e
};
AjxXslt.prototype.createProcessor=function(){
var s=this._doc.getDoc();
if(AjxEnv.isNav){
this._processor=new XSLTProcessor();
this._processor.importStylesheet(s)
}else{
if(AjxEnv.isIE){
var n=s.parseError;
if(n.errorCode!=0){
throw new AjxException(n.reason,AjxException.INVALID_PARAM,"AjxXslt.createProcessor")
}
var e=null;
var t=["MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate.3.0"];
for(var o=0;
o<t.length;
o++){
try{
e=new ActiveXObject(t[o]);
break
}
catch(a){}}
if(!e){
throw new AjxException("XSLTemplate",AjxException.UNSUPPORTED,"AjxXslt.createProcessor")
}
this._processor=e;
this._processor.stylesheet=s
}}};
AjxXslt._finishedLoading=function(){
var e=this._xslt;
e.createProcessor()
};
AjxXslt.prototype.loadUrl=function(e){
var a=this._doc;
if(AjxEnv.isNav){
var t=a.getDoc();
t._xslt=this;
t.addEventListener("load",AjxXslt._finishedLoading,false)
}
a.loadFromUrl(e);
if(AjxEnv.isIE){
this.createProcessor()
}};
AjxXslt.prototype.transformToDom=function(a){
var e;
if(AjxEnv.isIE){
e=this.transformIE(a)
}else{
if(AjxEnv.isNav){
return this.transformNav(a)
}else{
return a
}}
var t=AjxXmlDoc.createFromXml(e);
return t.getDoc()
};
AjxXslt.prototype.transformToString=function(a){
var e;
if(AjxEnv.isIE){
return this.transformIE(a)
}else{
if(AjxEnv.isNav){
e=this.transformNav(a)
}else{
return a.documentElement.innerHTML
}}
if(!e||!e.documentElement){
throw new AjxException("XSL transformation failed.",AjxException.INVALID_PARAM,"AjxXslt.transformToString")
}
var t=e.documentElement;
if((t instanceof HTMLElement)||(t instanceof HTMLHtmlElement)){
return t.innerHTML
}else{
if(t instanceof Element){
return AjxXmlDoc.replaceInvalidChars(t.xml)
}}
return a.documentElement.innerHTML
};
AjxXslt.prototype.transformIE=function(t){
try{
var a=this._processor.createProcessor();
a.input=t;
a.transform();
return a.output
}
catch(e){
throw new AjxException(e.description,AjxException.INVALID_PARAM,"AjxXslt.transformIE")
}};
AjxXslt.prototype.transformNav=function(e){
return this._processor.transformToDocument(e)
};
AjxXslt.prototype.transformNav2=function(e){
this._fragment=document.implementation.createDocument("","",null);
return this._processor.transformToFragment(e,this._fragment)
}
}
if(AjxPackage.define("zimbraMail.share.model.ZmZimletBase")){
ZmZimletBase=function(){};
ZmZimletBase.PANEL_MENU=1;
ZmZimletBase.CONTENTOBJECT_MENU=2;
ZmZimletBase.PROXY="/service/proxy?target=";
ZmZimletBase.prototype=new ZmObjectHandler();
ZmZimletBase.prototype._init=function(i,t){
this._passRpcErrors=false;
this._zimletContext=i;
this._dwtShell=t;
this._origIcon=this.xmlObj().icon;
this.__zimletEnabled=true;
this.name=this.xmlObj().name;
var e=this.xmlObj("contentObject");
if(e&&e.matchOn){
var a=e.matchOn.regex;
if(!a.attrs){
a.attrs="ig"
}
this.RE=new RegExp(a._content,a.attrs);
if(e.type){
this.type=e.type
}
ZmObjectHandler.prototype.init.call(this,this.type,e["class"])
}};
ZmZimletBase.prototype.init=function(){};
ZmZimletBase.prototype.toString=function(){
return this.name
};
ZmZimletBase.prototype.getShell=function(){
return this._dwtShell
};
ZmZimletBase.prototype.addSearchDomainItem=function(t,e,i,o){
var a=appCtxt.getSearchController().getSearchToolbar();
return a?a.createCustomSearchBtn(t,e,i,o):null
};
ZmZimletBase.prototype.getSearchQuery=function(){
var e=appCtxt.getSearchController().getSearchToolbar();
return e?e.getSearchFieldValue():null
};
ZmZimletBase.prototype.getZimletManager=function(){
return appCtxt.getZimletMgr()
};
ZmZimletBase.prototype.xmlObj=function(e){
return !e?this._zimletContext:this._zimletContext.getVal(e)
};
ZmZimletBase.prototype.doDrag=function(e){
return true
};
ZmZimletBase.prototype.doDrop=function(e){};
ZmZimletBase.prototype._dispatch=function(a){
var s=[];
var n;
var t;
for(var o=1;
o<arguments.length;
++o){
s[o-1]=arguments[o]
}
var e;
switch(a){
case"singleClicked":case"doubleClicked":n=this.xmlObj("zimletPanelItem")[a=="singleClicked"?"onClick":"onDoubleClick"];
if(!n){
break
}
t=n.actionUrl;
if(t){
t=this.xmlObj().makeURL(t)
}
if(n&&(n.canvas||t)){
e=this.makeCanvas(n.canvas,t)
}
break;
case"doDrop":n=s[1];
if(!n){
break
}
if(n.canvas){
e=n.canvas[0]
}
t=n.actionUrl;
if(t&&e){
t=this.xmlObj().makeURL(t[0],s[0]);
e=this.makeCanvas(e,t);
return""
}
break
}
if(e){
s.push(e)
}
return this.xmlObj().callHandler(a,s)
};
ZmZimletBase.prototype.singleClicked=function(e){};
ZmZimletBase.prototype.doubleClicked=function(e){
this.createPropertyEditor()
};
ZmZimletBase.prototype.onMsgView=function(t,e){};
ZmZimletBase.prototype.onFindMsgObjects=function(e,t){};
ZmZimletBase.prototype.onContactView=function(e,t){};
ZmZimletBase.prototype.onContactEdit=function(t,e,a){};
ZmZimletBase.prototype.initializeToolbar=function(i,a,t,e){};
ZmZimletBase.prototype.onShowView=function(e){};
ZmZimletBase.prototype.onSearch=function(e){};
ZmZimletBase.prototype.onSearchButtonClick=function(e){};
ZmZimletBase.prototype.onKeyPressSearchField=function(e){};
ZmZimletBase.prototype.onParticipantActionMenuInitialized=function(e,t){};
ZmZimletBase.prototype.onActionMenuInitialized=function(e,t){};
ZmZimletBase.prototype.onMailFlagClick=function(t,e){};
ZmZimletBase.prototype.onTagAction=function(t,e,a){};
ZmZimletBase.prototype.emailErrorCheck=function(t,e){};
ZmZimletBase.prototype.appendExtraSignature=function(e){};
ZmZimletBase.prototype.onMailConfirm=function(e,t){};
ZmZimletBase.prototype.onNewChatWidget=function(e){};
ZmZimletBase.prototype.portletCreated=function(e){};
ZmZimletBase.prototype.portletRefreshed=function(e){};
ZmZimletBase.prototype.match=function(t,a){
if(!this.RE){
return null
}
this.RE.lastIndex=a;
var e=this.RE.exec(t);
if(e){
e.context=e
}
return e
};
ZmZimletBase.prototype.clicked=function(a,o,t,i){
var r=this.xmlObj("contentObject.onClick");
if(r&&r.actionUrl){
var n=this._createContentObj(o,t);
var e=i.docX;
var s=i.docY;
this.xmlObj().handleActionUrl(r.actionUrl,r.canvas,n,null,e,s)
}};
ZmZimletBase.prototype.toolTipPoppedUp=function(i,o,a,t){
var s=this.xmlObj("contentObject");
if(s&&s.toolTip){
var n=this._createContentObj(o,a);
var e;
if(s.toolTip instanceof Object&&s.toolTip.actionUrl){
this.xmlObj().handleActionUrl(s.toolTip.actionUrl,[{
type:"tooltip"}
],n,t);
e="fetching data..."
}else{
if(n.objectContent instanceof AjxEmailAddress){
n.objectContent=n.objectContent.address
}
e=this.xmlObj().processString(s.toolTip,n)
}
t.innerHTML=e
}};
ZmZimletBase.prototype.toolTipPoppedDown=function(a,i,t,e){};
ZmZimletBase.prototype.getActionMenu=function(a,t,e){
if(this._zimletContext._contentActionMenu instanceof AjxCallback){
this._zimletContext._contentActionMenu=this._zimletContext._contentActionMenu.run()
}
this._actionObject=a;
this._actionSpan=t;
this._actionContext=e;
return this._zimletContext._contentActionMenu
};
ZmZimletBase.prototype.menuItemSelected=function(t,o,a,i,e){};
ZmZimletBase.prototype.createPropertyEditor=function(l){
var t=this.xmlObj().userProperties;
if(!t){
return
}
for(var a=0;
a<t.length;
++a){
t[a].label=this._zimletContext.processMessage(t[a].label);
if(t[a].type=="enum"){
var o=t[a].item;
for(var e=0;
o!=null&&e<o.length;
e++){
if(o[e]==null){
continue
}
var c=o[e];
c.label=this._zimletContext.processMessage(c.label)
}}}
if(!this._dlg_propertyEditor){
var r=new DwtComposite(this.getShell());
var n=this._propertyEditor=new DwtPropertyEditor(r,true);
n.initProperties(t);
var h={
title:this._zimletContext.processMessage(this.xmlObj("description"))+" preferences",view:r};
var s=this._dlg_propertyEditor=this._createDialog(h);
n.setFixedLabelWidth();
n.setFixedFieldWidth();
s.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
this.saveUserProperties(l)
}
))
}
this._dlg_propertyEditor.popup()
};
ZmZimletBase.prototype.displayErrorMessage=function(i,e,a){
if(a==null){
a=this.xmlObj("description")+" error"
}
var t=appCtxt.getErrorDialog();
t.reset();
t.setMessage(i,e,DwtMessageDialog.WARNING_STYLE,a);
t.popup(null,true)
};
ZmZimletBase.prototype.displayStatusMessage=function(e){
appCtxt.setStatusMsg(e)
};
ZmZimletBase.prototype.getResource=function(e){
return this.xmlObj().getUrl()+e
};
ZmZimletBase.prototype.getType=function(){
return this.type
};
ZmZimletBase.prototype.requestFinished=function(a,t,e){
this.resetIcon();
if(!(t||this._passRpcErrors)&&!e.success){
this.displayErrorMessage("We could not connect to the remote server, or an error was returned.<br />Error code: "+e.status,e.text)
}else{
if(a){
a.run(e)
}}};
ZmZimletBase.prototype.sendRequest=function(e,t,o,s,n,i){
if(i==null){
i=false
}
if(e instanceof AjxSoapDoc){
e=['<?xml version="1.0" encoding="utf-8" ?>',e.getXml()].join("")
}
this.setBusyIcon();
t=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(t);
var a=new AjxCallback(this,this.requestFinished,[s,i]);
return AjxRpc.invoke(e,t,o,a,n)
};
ZmZimletBase.prototype.enableContextMenuItem=function(t,a,e){};
ZmZimletBase.prototype.getConfigProperty=function(e){};
ZmZimletBase.prototype.getUserProperty=function(e){
return this.xmlObj().getPropValue(e)
};
ZmZimletBase.prototype.setUserProperty=function(e,a,t,i){
this.xmlObj().setPropValue(e,a);
if(t){
this.saveUserProperties(i)
}};
ZmZimletBase.prototype.checkProperties=function(e){
return true
};
ZmZimletBase.prototype.setBusyIcon=function(){
this.setIcon("ZimbraIcon DwtWait16Icon")
};
ZmZimletBase.prototype.setIcon=function(t){
if(!this.xmlObj("zimletPanelItem")){
return
}
this.xmlObj().icon=t;
var e=appCtxt.getAppViewMgr().getCurrentViewComponent(ZmAppViewMgr.C_TREE);
var a=e&&e.getTreeItemById(this.xmlObj().getOrganizer().id);
if(a){
a.setImage(t)
}};
ZmZimletBase.prototype.resetIcon=function(){
this.setIcon(this._origIcon)
};
ZmZimletBase.prototype.saveUserProperties=function(h){
var o=AjxSoapDoc.create("ModifyPropertiesRequest","urn:zimbraAccount");
var a=this.xmlObj().userProperties;
var e=this.checkProperties(a);
if(!e){
return""
}
if(typeof e=="string"){
return this.displayErrorMessage(e)
}
if(this._propertyEditor){
if(!this._propertyEditor.validateData()){
return""
}}
for(var t=0;
t<a.length;
++t){
var s=o.set("prop",a[t].value);
s.setAttribute("zimlet",this.xmlObj("name"));
s.setAttribute("name",a[t].name)
}
var n=new ZmCsfeCommand();
var r=null;
if(h){
r=new AjxCallback(this,function(i){
h.run()
}
)
}
n.invoke({
soapDoc:o,callback:r,asyncMode:true}
);
if(this._dlg_propertyEditor){
this._dlg_propertyEditor.popdown();
this._dlg_propertyEditor.dispose();
this._propertyEditor=null;
this._dlg_propertyEditor=null
}
return""
};
ZmZimletBase.prototype.getUserPropertyInfo=function(e){
return this.xmlObj().getProp(e)
};
ZmZimletBase.prototype.getMessage=function(t){
var e=window[this.xmlObj().name];
return e?e[t]:"???"+t+"???"
};
ZmZimletBase.prototype.getMessages=function(){
return window[this.xmlObj().name]||{}
};
ZmZimletBase.prototype.getConfig=function(e){
return this.xmlObj().getConfig(e)
};
ZmZimletBase.prototype.getBoolConfig=function(t,e){
var a=AjxStringUtil.trim(this.getConfig(t));
if(a!=null){
if(arguments.length<2){
e=false
}
if(e){
a=!/^(0|false|off|no)$/i.test(a)
}else{
a=/^(1|true|on|yes)$/i.test(a)
}}else{
a=e
}
return a
};
ZmZimletBase.prototype.setEnabled=function(e){
if(arguments.length==0){
e=true
}
this.__zimletEnabled=e
};
ZmZimletBase.prototype.getEnabled=function(){
return this.__zimletEnabled
};
ZmZimletBase.prototype.getUsername=function(){
return appCtxt.get(ZmSetting.USERNAME)
};
ZmZimletBase.prototype.getUserID=function(){
return appCtxt.get(ZmSetting.USERID)
};
ZmZimletBase.encodeId=function(e){
return e.replace(/[^A-Za-z0-9]/g,"")
};
ZmZimletBase.prototype.hoverOver=function(t,i,e,s,o){
var a=DwtShell.getShell(window);
var n=a.getToolTip();
n.setContent('<div id="zimletTooltipDiv"/>',true);
this.toolTipPoppedUp(o,t,i,document.getElementById("zimletTooltipDiv"));
n.popup(e,s,true,new AjxCallback(this,this.hoverOut,t,i,o))
};
ZmZimletBase.prototype.hoverOut=function(e,a,i){
var t=DwtShell.getShell(window);
var o=t.getToolTip();
o.popdown();
this.toolTipPoppedDown(i,e,a,document.getElementById("zimletTooltipDiv"))
};
ZmZimletBase.prototype.makeCanvas=function(n,t,u,c){
if(n&&n.length){
n=n[0]
}
var i=null;
var e;
e=document.createElement("div");
e.id="zimletCanvasDiv";
if(!n&&t){
n={
type:"window"}
}
if(n.style&&!n.type){
n.type=n.style
}
switch(n.type){
case"window":var m=t;
if(m==null){
m=appContextPath+"/public/blank.html"
}
var o=this.xmlObj("contentObject");
if(o&&!n.width&&o.onClick){
if(o.onClick.canvas.props==""){
i=window.open(m)
}else{
if(o.onClick.canvas.props!=""){
i=window.open(m,this.xmlObj("name"),o.onClick.canvas.props)
}}}else{
var h=n.props?[n.props]:["toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes"];
if(n.width){
h.push("width="+n.width)
}
if(n.height){
h.push("height="+n.height)
}
h=h.join(",");
i=window.open(m,this.xmlObj("name"),h)
}
if(!t){}
break;
case"dialog":var l=new DwtComposite(this.getShell());
if(n.width){
l.setSize(n.width,Dwt.DEFAULT)
}
if(n.height){
l.setSize(Dwt.DEFAULT,n.height)
}
var d=n.title||("Zimlet dialog ("+this.xmlObj("description")+")");
i=this._createDialog({
view:l,title:d}
);
i.view=l;
if(t){
var a=document.createElement("iframe");
a.src=t;
var r=l.getSize();
if(!AjxEnv.isIE){
r.x-=4;
r.y-=4
}
a.style.width=r.x+"px";
a.style.height=r.y+"px";
l.getHtmlElement().appendChild(a);
i.iframe=a
}else{
l.getHtmlElement().appendChild(e)
}
i.popup();
break;
case"tooltip":var s=DwtShell.getShell(window);
var i=s.getToolTip();
i.setContent('<div id="zimletTooltipDiv" />',true);
var a=document.createElement("iframe");
a.setAttribute("width",n.width);
a.setAttribute("height",n.height);
a.setAttribute("style","border:0px");
a.src=t;
document.getElementById("zimletTooltipDiv").appendChild(a);
i.popup(u,c,true);
break
}
return i
};
ZmZimletBase.prototype.applyXslt=function(i,a){
var t=this.xmlObj().getXslt(i);
if(!t){
throw new Error("Cannot create XSLT engine: "+i)
}
if(a instanceof AjxXmlDoc){
a=a.getDoc()
}
var e=t.transformToDom(a);
return AjxXmlDoc.createFromDom(e)
};
ZmZimletBase.prototype.createApp=function(i,n,o,a){
AjxDispatcher.require("ZimletApp");
var e=[this.name,Dwt.getNextId()].join("_");
var t=appCtxt.getAppController();
var r={
text:i,image:n,tooltip:o};
if(a!=null&&a>=0){
r.index=a
}
t.getAppChooser().addButton(e,r);
var s=new ZmZimletApp(e,this,DwtShell.getShell(window));
t.addApp(s);
return e
};
ZmZimletBase.prototype.appActive=function(e,t){};
ZmZimletBase.prototype.appLaunch=function(e){};
ZmZimletBase.prototype.onSelectApp=function(e){};
ZmZimletBase.prototype.onAction=function(i,a,e,t){};
ZmZimletBase.prototype._createContentObj=function(a,e){
var o={
objectContent:a};
if(e&&(e instanceof Array)){
for(var t=0;
t<e.length;
++t){
o["$"+t]=e[t]
}}
return o
};
ZmZimletBase.prototype._createDialog=function(e){
e.parent=this.getShell();
return new ZmDialog(e)
};
ZmZimletBase.prototype._getHtmlContent=function(i,e,o,a){
if(o instanceof AjxEmailAddress){
o=o.address
}
var t=this.xmlObj().getVal("contentObject");
if(t&&t.onClick){
i[e++]=AjxStringUtil.htmlEncode(o)
}else{
i[e++]=AjxStringUtil.htmlEncode(o,true)
}
return e
};
ZmZimletBase.prototype.getMsgsForConv=function(n,a){
if(a instanceof Array){
a=a[0]
}
var t=AjxDispatcher.run("GetConvListController");
var e=t.getList();
var i=e.getById(a.id);
var o=new AjxCallback(this,this._handleTranslatedConv,[n,i]);
i.loadMsgs({
fetchAll:true}
,o)
};
ZmZimletBase.prototype._handleTranslatedConv=function(t,e){
if(t){
t.run(ZmZimletContext._translateZMObject(e.msgs.getArray()))
}}
}
if(AjxPackage.define("zimbraMail.share.model.ZmZimletContext")){
ZmZimletContext=function(n,t){
this.json=ZmZimletContext.sanitize(t,"zimlet",ZmZimletContext.RE_ARRAY_ELEMENTS);
this.id=n;
this.icon="ZimbraIcon";
this.ctxt=t.zimletContext;
this.config=t.zimletConfig;
t=t.zimlet[0];
this.name=t.name;
this._url=this.ctxt[0].baseUrl;
this.priority=this.ctxt[0].priority;
this.description=t.description;
this.version=t.version;
this.label=t.label;
this.includes=this.json.zimlet.include||[];
this.includes.push([appContextPath,"/messages/",this.name,".js?v=",cacheKillerVersion].join(""));
this.includeCSS=this.json.zimlet.includeCSS;
if(t.serverExtension&&t.serverExtension[0].hasKeyword){
this.keyword=t.serverExtension[0].hasKeyword
}
this.targets={};
var e=(t.target||"main").split(" ");
for(var a=0;
a<e.length;
a++){
this.targets[e[a]]=true
}
this._contentActionMenu=null;
if(t.contentObject){
this.contentObject=t.contentObject[0];
if(this.contentObject.type){
this.type=this.contentObject.type
}
if(this.contentObject.contextMenu){
if(this.contentObject.contextMenu instanceof Array){
this.contentObject.contextMenu=this.contentObject.contextMenu[0]
}
this._contentActionMenu=new AjxCallback(this,this._makeMenu,[this.contentObject.contextMenu.menuItem])
}}
this._panelActionMenu=null;
if(t.zimletPanelItem&&!appCtxt.isChildWindow){
this.zimletPanelItem=t.zimletPanelItem[0];
if(this.zimletPanelItem.label){
this.zimletPanelItem.label=this.process(this.zimletPanelItem.label)
}
if(this.zimletPanelItem.toolTipText&&this.zimletPanelItem.toolTipText[0]){
this.zimletPanelItem.toolTipText=this.process(this.zimletPanelItem.toolTipText[0]._content)
}
if(this.zimletPanelItem.icon){
this.icon=this.zimletPanelItem.icon
}
if(this.zimletPanelItem.contextMenu){
if(this.zimletPanelItem.contextMenu instanceof Array){
this.zimletPanelItem.contextMenu=this.zimletPanelItem.contextMenu[0]
}
this._panelActionMenu=new AjxCallback(this,this._makeMenu,[this.zimletPanelItem.contextMenu.menuItem])
}
if(this.zimletPanelItem.onClick instanceof Array){
this.zimletPanelItem.onClick=this.zimletPanelItem.onClick[0]
}
if(this.zimletPanelItem.onDoubleClick instanceof Array){
this.zimletPanelItem.onDoubleClick=this.zimletPanelItem.onDoubleClick[0]
}}
if(t.handlerObject){
this.handlerObject=t.handlerObject[0]._content
}
var o=t.portlet&&t.portlet[0];
if(o){
o=ZmZimletContext.sanitize(o);
o.portletProperties=(o.portletProperties&&o.portletProperties.property)||{};
this.portlet=o
}
this.userProperties=t.userProperties?t.userProperties[0]:[];
this._propsById={};
if(t.userProperties){
this._translateUserProp()
}
if(this.config){
if(this.config instanceof Array||(appCtxt.isChildWindow&&this.config.length&&this.config[0])){
this.config=this.config[0]
}
this._translateConfig()
}
this._handleMenuItemSelected=new AjxListener(this,this._handleMenuItemSelected)
};
ZmZimletContext.prototype.constructor=ZmZimletContext;
ZmZimletContext.RE_ARRAY_ELEMENTS=/^(dragSource|include|includeCSS|menuItem|param|property|resource|portlet)$/;
ZmZimletContext.APP={
contextPath:appContextPath,currentSkin:appCurrentSkin};
ZmZimletContext.RE_SCAN_APP=/(^|[^\\])\$\{app\.([\$a-zA-Z0-9_]+)\}/g;
ZmZimletContext.RE_SCAN_OBJ=/(^|[^\\])\$\{(?:obj|src)\.([\$a-zA-Z0-9_]+)\}/g;
ZmZimletContext.RE_SCAN_PROP=/(^|[^\\])\$\{prop\.([\$a-zA-Z0-9_]+)\}/g;
ZmZimletContext.RE_SCAN_MSG=/(^|[^\\])\$\{msg\.([\$a-zA-Z0-9_]+)\}/g;
ZmZimletContext.__RE_SCAN_SETTING=/\$\{setting\.([\$a-zA-Z0-9_]+)\}/g;
ZmZimletContext._isArray=function(e){
return(!AjxUtil.isUndefined(e)&&appCtxt.isChildWindow&&e.length&&AjxUtil.isFunction(e.sort)&&AjxUtil.isFunction(e.unshift))
};
ZmZimletContext._isArrayIE=function(e){
return(AjxEnv.isIE&&!AjxUtil.isUndefined(e)&&appCtxt.isChildWindow&&e.length&&e.length>0&&e[0])
};
ZmZimletContext.sanitize=function(a,e,t){
function i(r,o){
var n,h,s;
if(r instanceof DwtControl){
return r
}else{
if(r instanceof Array||ZmZimletContext._isArray(r)||ZmZimletContext._isArrayIE(r)){
if(r.length==1&&!(t&&t.test(o))){
n=i(r[0],o)
}else{
n=[];
for(s=0;
s<r.length;
++s){
n[s]=i(r[s],o)
}}}else{
if(r&&typeof r=="object"){
if(r._content){
n=new String(r._content)
}else{
n={}
}
for(s in r){
n[s]=i(r[s],s)
}}else{
n=r
}}}
return n
}
return i(a,e)
};
ZmZimletContext.prototype.toString=function(){
return"ZmZimletContext - "+this.name
};
ZmZimletContext.prototype._finished_loadIncludes=function(){
var a=this.handlerObject?window[this.handlerObject]:ZmZimletBase;
if(!a){
return
}
this.handlerObject=new a();
if(!this.handlerObject._init){
var o=["ERROR - Zimlet handler (",this.name,") not defined. ","Make sure the Zimlet name and handlerObject defined in ",this.name,".xml are different."].join("")
}
this.handlerObject._init(this,DwtShell.getShell(window));
if(this.contentObject){
appCtxt.getZimletMgr().registerContentZimlet(this.handlerObject,this.type,this.priority)
}
this.handlerObject.init();
this.handlerObject._zimletContext=this;
if(this._id){
var n=appCtxt.isOffline?appCtxt.accountList.mainAccount:null;
var t=appCtxt.getZimletTree(n);
if(t){
var e=t.getById(this._id);
e.resetNames()
}}
if(appCtxt.get(ZmSetting.PORTAL_ENABLED)&&!appCtxt.isChildWindow){
var i={
name:"Portal",callback:new AjxCallback(this,this._finished_loadIncludes2)};
AjxPackage.require(i)
}};
ZmZimletContext.prototype._finished_loadIncludes2=function(){
appCtxt.getApp(ZmApp.PORTAL).getPortletMgr().zimletLoaded(this)
};
ZmZimletContext.prototype.getOrganizer=function(){
return this._organizer
};
ZmZimletContext.prototype.getUrl=function(){
return this._url
};
ZmZimletContext.prototype.getVal=function(key){
var zim=this.json.zimlet;
return eval("zim."+key)
};
ZmZimletContext.prototype.callHandler=function(e,t){
if(this.handlerObject){
var a=this.handlerObject[e];
if(typeof a=="function"){
if(typeof t=="undefined"){
t=[]
}else{
if(!(t instanceof Array)){
t=[t]
}}
return a.apply(this.handlerObject,t)
}}
return null
};
ZmZimletContext.prototype._translateUserProp=function(){
var e=this.userProperties=this.userProperties.property;
for(var t=0;
t<e.length;
++t){
this._propsById[e[t].name]=e[t]
}};
ZmZimletContext.prototype.setPropValue=function(e,t){
if(!this._propsById[e]){
var a={
name:e};
this.userProperties.push(a);
this._propsById[e]=a
}
this._propsById[e].value=t
};
ZmZimletContext.prototype.getPropValue=function(e){
return this._propsById[e]&&this._propsById[e].value
};
ZmZimletContext.prototype.getProp=function(e){
return this._propsById[e]
};
ZmZimletContext.prototype._translateConfig=function(){
if(!this.config){
return
}
if(this.config.global&&this.config.global[0]){
var o=this.config.global[0].property;
this.config.global={};
for(var t in o){
this.config.global[o[t].name]=o[t]._content
}}
if(this.config.local&&this.config.local[0]){
var a=this.config.local[0].property;
this.config.local={};
for(var e in a){
this.config.local[a[e].name]=a[e]._content
}}};
ZmZimletContext.prototype.getConfig=function(t){
var e=(this.config&&this.config.length&&this.config[0])?this.config[0]:this.config;
if(!e){
return
}
if(e.local&&e.local[t]){
return e.local[t]
}
if(e.global&&e.global[t]){
return e.global[t]
}
return null
};
ZmZimletContext.prototype.getPanelActionMenu=function(){
if(this._panelActionMenu instanceof AjxCallback){
this._panelActionMenu=this._panelActionMenu.run()
}
return this._panelActionMenu
};
ZmZimletContext.prototype._makeMenu=function(o){
var s=new ZmActionMenu({
parent:DwtShell.getShell(window),menuItems:ZmOperation.NONE}
);
for(var e=0;
e<o.length;
++e){
var a=o[e];
if(!a.id){
s.createSeparator()
}else{
var n={
image:a.icon,text:this.process(a.label),disImage:a.disabledIcon};
var t=s.createMenuItem(a.id,n);
t.setData("xmlMenuItem",a);
t.addSelectionListener(this._handleMenuItemSelected)
}}
return s
};
ZmZimletContext.prototype._handleMenuItemSelected=function(e){
var t=e.item.getData("xmlMenuItem");
if(t.actionUrl){
this.handleActionUrl(t.actionUrl[0],t.canvas)
}else{
this.callHandler("menuItemSelected",[t.id,t,e])
}};
ZmZimletContext.prototype.process=function(a,t,e){
if(t){
a=this.processString(a,t)
}
a=this.processMessage(a);
a=this.replaceObj(ZmZimletContext.RE_SCAN_PROP,a,e||this._propsById);
a=this.replaceObj(ZmZimletContext.RE_SCAN_APP,a,ZmZimletContext.APP);
a=a.replace(ZmZimletContext.__RE_SCAN_SETTING,ZmZimletContext.__replaceSetting);
return a
};
ZmZimletContext.prototype.processString=function(t,e){
return this.replaceObj(ZmZimletContext.RE_SCAN_OBJ,t,e)
};
ZmZimletContext.prototype.processMessage=function(t){
if(!window[this.name]){
return t
}
var e=window[this.name];
return this.replaceObj(ZmZimletContext.RE_SCAN_MSG,t,e)
};
ZmZimletContext.prototype.replaceObj=function(e,a,t){
return String(a).replace(e,function(l,h,c){
var n=h;
if(t instanceof Array&&t.length>1){
for(var s=0;
s<t.length;
s++){
if(n){
n+=","
}
var r=t[s];
if(r[c] instanceof Object){
n+=r[c].value
}else{
n+=r[c]
}}}else{
if(typeof t[c]!="undefined"){
if(t[c] instanceof Object){
n+=t[c].value
}else{
n+=t[c]
}}else{
n+="(UNDEFINED - str '"+l+"' obj '"+t+"')"
}}
return n
}
)
};
ZmZimletContext.__replaceSetting=function(e,t){
return appCtxt.get(t)
};
ZmZimletContext.prototype.makeURL=function(o,r,l){
var e=this.process(o.target,r,l);
var n=[];
if(o.param){
var c=o.param;
for(var h=0;
h<c.length;
++h){
var t=AjxStringUtil.trim(c[h]._content||c[h]);
t=this.process(t,r,l);
n.push([AjxStringUtil.urlEncode(c[h].name),"=",AjxStringUtil.urlEncode(t)].join(""))
}
var d=o.paramStart||"?";
var s=o.paramJoin||"&";
e=[e,d,n.join(s)].join("")
}
return e
};
ZmZimletContext.prototype.handleActionUrl=function(o,a,n,r,e,s){
var t=this.makeURL(o,n);
var i=o.xslt&&this.getXslt(o.xslt);
if(r||i){
if(!r){
a=this.handlerObject.makeCanvas(a,null,e,s);
r=document.getElementById("zimletCanvasDiv")
}
t=ZmZimletBase.PROXY+AjxStringUtil.urlComponentEncode(t);
AjxRpc.invoke(null,t,null,new AjxCallback(this,this._rpcCallback,[i,r]),true)
}else{
this.handlerObject.makeCanvas(a,t,e,s)
}};
ZmZimletContext._translateZMObject=function(t){
var e=t[0]?t[0].toString():t.toString();
return(ZmZimletContext._zmObjectTransformers[e])?ZmZimletContext._zmObjectTransformers[e](t):t
};
ZmZimletContext._zmObjectTransformers={
ZmMailMsg:function(s){
var a=[];
s=(s instanceof Array)?s:[s];
for(var t=0;
t<s.length;
t++){
var e={
TYPE:"ZmMailMsg"};
var n=s[t];
e.id=n.id;
e.convId=n.cid;
e.from=n.getAddresses(AjxEmailAddress.FROM).getArray();
e.to=n.getAddresses(AjxEmailAddress.TO).getArray();
e.cc=n.getAddresses(AjxEmailAddress.CC).getArray();
e.subject=n.subject;
e.date=n.date;
e.size=n.size;
e.fragment=n.fragment;
e.tags=n.tags;
e.unread=n.isUnread;
e.attachment=n.attachments.length>0;
e.attlinks=n._attLinks||n.getAttachmentLinks();
e.sent=n.isSent;
e.replied=n.isReplied;
e.draft=n.isDraft;
e.body=ZmZimletContext._getMsgBody(n);
e.srcObj=n;
a[t]=e
}
if(a.length==1){
return a[0]
}else{
a.TYPE="ZmMailMsg";
return a
}}
,ZmConv:function(s){
var a=[];
s=(s instanceof Array)?s:[s];
for(var t=0;
t<s.length;
t++){
var n=s[t];
var e={
TYPE:"ZmConv"};
e.id=n.id;
e.subject=n.subject;
e.date=n.date;
e.fragment=n.fragment;
e.participants=n.participants.getArray();
e.numMsgs=n.numMsgs;
e.tags=n.tags;
e.unread=n.isUnread;
e.body=ZmZimletContext._getMsgBody(n.getFirstHotMsg());
e.srcObj=n;
a[t]=e
}
if(a.length==1){
return a[0]
}else{
a.TYPE="ZmConv";
return a
}}
,ZmContact_fields:function(){
return[ZmContact.F_assistantPhone,ZmContact.F_callbackPhone,ZmContact.F_carPhone,ZmContact.F_company,ZmContact.F_companyPhone,ZmContact.F_email,ZmContact.F_email2,ZmContact.F_email3,ZmContact.F_fileAs,ZmContact.F_firstName,ZmContact.F_homeCity,ZmContact.F_homeCountry,ZmContact.F_homeFax,ZmContact.F_homePhone,ZmContact.F_homePhone2,ZmContact.F_homePostalCode,ZmContact.F_homeState,ZmContact.F_homeStreet,ZmContact.F_homeURL,ZmContact.F_jobTitle,ZmContact.F_lastName,ZmContact.F_middleName,ZmContact.F_mobilePhone,ZmContact.F_namePrefix,ZmContact.F_nameSuffix,ZmContact.F_notes,ZmContact.F_otherCity,ZmContact.F_otherCountry,ZmContact.F_otherFax,ZmContact.F_otherPhone,ZmContact.F_otherPostalCode,ZmContact.F_otherState,ZmContact.F_otherStreet,ZmContact.F_otherURL,ZmContact.F_pager,ZmContact.F_workCity,ZmContact.F_workCountry,ZmContact.F_workFax,ZmContact.F_workPhone,ZmContact.F_workPhone2,ZmContact.F_workPostalCode,ZmContact.F_workState,ZmContact.F_workStreet,ZmContact.F_workURL]
}
,ZmContact:function(l){
l=(l instanceof Array)?l:[l];
var h=new Array();
for(var r=0;
r<l.length;
r++){
var s={
TYPE:"ZmContact"};
var t=this.ZmContact_fields;
if(typeof t=="function"){
t=this.ZmContact_fields=t()
}
var e=l[r].getAttrs();
for(var n=0;
n<t.length;
++n){
s[t[n]]=e[t[n]]
}
s.id=l[r].id;
h[r]=s
}
if(h.length==1){
return h[0]
}else{
h.TYPE="ZmContact";
return h
}}
,ZmFolder:function(a){
var t=a[0]?a[0]:a;
var e={
TYPE:"ZmFolder"};
e.id=t.id;
e.name=t.getName();
e.path=t.getPath();
e.isInTrash=t.isInTrash();
e.unread=t.numUnread;
e.total=t.numTotal;
e.url=t.getRestUrl();
e.srcObj=t;
return e
}
,ZmAppt:function(a){
var t=a[0]?a[0]:a;
t.getDetails();
var e={
TYPE:"ZmAppt"};
e.id=t.id;
e.uid=t.uid;
e.subject=t.getName();
e.startDate=t.startDate;
e.endDate=t.endDate;
e.allDayEvent=t.isAllDayEvent();
e.exception=t.isException;
e.alarm=t.alarm;
e.otherAttendees=t.otherAttendees;
e.attendees=t.getAttendeesText(ZmCalBaseItem.PERSON);
e.resources=t.getAttendeesText(ZmCalBaseItem.EQUIPMENT);
e.location=t.getLocation();
e.notes=t.getNotesPart();
e.isRecurring=t.isRecurring();
e.timeZone=t.timezone;
e.srcObj=t;
return e
}};
ZmZimletContext.prototype.getXslt=function(t){
if(!this._xslt){
this._xslt={}
}
var e=this.getUrl()+t;
if(!this._xslt[e]){
this._xslt[e]=AjxXslt.createFromUrl(e)
}
return this._xslt[e]
};
ZmZimletContext.prototype._rpcCallback=function(i,t,e){
var a,n=e.xml;
if(!n){
var o=AjxXmlDoc.createFromXml(e.text);
n=o.getDoc()
}
if(i){
a=i.transformToString(n);
if(!a){
a=e.text
}}else{
a=n.innerHTML
}
t.innerHTML=a
};
ZmZimletContext._getMsgBody=function(t){
var e=t.getTextPart();
if(!e&&t.getBodyPart(ZmMimeTable.TEXT_HTML)){
var a=document.createElement("div");
a.innerHTML=t.getBodyPart(ZmMimeTable.TEXT_HTML).content;
e=AjxStringUtil.convertHtml2Text(a)
}
return e
}
}
if(AjxPackage.define("zimbraMail.share.model.ZmZimletMgr")){
ZmZimletMgr=function(){
this._ZIMLETS=[];
this._ZIMLETS_BY_ID={};
this._CONTENT_ZIMLETS=[];
this._serviceZimlets=[];
this._requestNotHandledByAnyZimlet=[]
};
ZmZimletMgr.prototype.constructor=ZmZimletMgr;
ZmZimletMgr.prototype.toString=function(){
return"ZmZimletMgr"
};
ZmZimletMgr._RE_REMOTE=/^((https?|ftps?):\x2f\x2f|\x2f)/;
ZmZimletMgr.prototype.isLoaded=function(){
return this.loaded
};
ZmZimletMgr.prototype.loadZimlets=function(e,a,o,n,t){
if(!e||!e.length){
this.loaded=true;
this._resetOverviewTree();
return
}
var i=n?new AjxCallback(this,this._loadZimlets,[e,a,o,n,t]):null;
AjxPackage.require({
name:"Zimlet",callback:i}
);
if(!n){
this._loadZimlets(e,a,o,n,t)
}};
ZmZimletMgr.prototype._loadZimlets=function(f,n,h,y,m){
var c;
var t=[];
var d=new RegExp("\\b"+(h||"main")+"\\b");
for(var s=0;
s<f.length;
s++){
var u=f[s];
var o=u.zimlet[0];
if(!d.test(o.target||"main")){
continue
}
c=new ZmZimletContext(s,u);
this._ZIMLETS_BY_ID[c.name]=c;
this._ZIMLETS.push(c);
t.push(u)
}
if(n){
for(s=0;
s<n.length;
++s){
var e=n[s];
c=this._ZIMLETS_BY_ID[e.zimlet];
if(c){
c.setPropValue(e.name,e._content)
}}}
if(!appCtxt.isChildWindow){
var a=this.getPanelZimlets();
if(a&&a.length>0){
var l=appCtxt.getZimletTree();
if(!l){
l=new ZmFolderTree(ZmOrganizer.ZIMLET);
var r=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount;
appCtxt.setTree(ZmOrganizer.ZIMLET,l,r)
}
l.reset();
l.loadFromJs(a,"zimlet")
}else{
this._resetOverviewTree()
}}
var g=this._getZimletNames(t);
this._loadIncludes(t,g,(m?y:null));
this._loadStyles(t,g);
if(y&&!m){
y.run()
}};
ZmZimletMgr.prototype._resetOverviewTree=function(){
var a=appCtxt.getZimletTree();
if(a){
var e=this.getPanelZimlets();
a.loadFromJs(e,"zimlet");
var i=appCtxt.getCurrentApp().getOverview();
if(i){
var t=i.getTreeView(ZmOrganizer.ZIMLET);
if(t&&(!e||!e.length)){
t.clear()
}}}};
ZmZimletMgr.prototype.getPanelZimlets=function(){
var e=[];
for(var t=0;
t<this._ZIMLETS.length;
t++){
if(this._ZIMLETS[t].zimletPanelItem){
e.push(this._ZIMLETS[t])
}}
return e
};
ZmZimletMgr.prototype.getIndexedZimlets=function(){
var t=[];
for(var e=0;
e<this._ZIMLETS.length;
e++){
if(this._ZIMLETS[e].keyword){
t.push(this._ZIMLETS[e])
}}
return t
};
ZmZimletMgr.prototype.getPortletZimlets=function(){
if(!this._portletArray){
this._portletArray=[];
this._portletMap={};
for(var t=0;
t<this._ZIMLETS.length;
t++){
var e=this._ZIMLETS[t];
if(e.portlet){
this._portletArray.push(e);
this._portletMap[e.name]=e
}}}
return this._portletArray
};
ZmZimletMgr.prototype.getPortletZimletsHash=function(){
this.getPortletZimlets();
return this._portletMap
};
ZmZimletMgr.prototype.registerContentZimlet=function(e,o,a){
var t=this._CONTENT_ZIMLETS.length;
this._CONTENT_ZIMLETS[t]=e;
this._CONTENT_ZIMLETS[t].type=o;
this._CONTENT_ZIMLETS[t].prio=a
};
ZmZimletMgr.prototype.getContentZimlets=function(){
return this._CONTENT_ZIMLETS
};
ZmZimletMgr.prototype.getZimlets=function(){
return this._ZIMLETS
};
ZmZimletMgr.prototype.getZimletsHash=function(){
return this._ZIMLETS_BY_ID
};
ZmZimletMgr.prototype.zimletExists=function(e){
return this._ZIMLETS_BY_ID[e]
};
ZmZimletMgr.prototype.getZimletByName=function(e){
for(var t=0;
t<this._ZIMLETS.length;
t++){
var a=this._ZIMLETS[t];
if(a&&(a.name==e)){
return a
}}
return null
};
ZmZimletMgr.prototype.notifyZimlets=function(a,e){
if(e&&(!(e instanceof Array))){
e=[e]
}
for(var t=0;
t<this._ZIMLETS.length;
++t){
var o=this._ZIMLETS[t].handlerObject;
if(o&&(o instanceof ZmZimletBase)&&o.getEnabled()&&(typeof o[a]=="function")){
o[a].apply(o,e)
}}};
ZmZimletMgr.prototype.processARequest=function(n){
if(this._requestNotHandledByAnyZimlet[n]){
return null
}
var t=new Array(arguments.length-1);
for(var o=0;
o<t.length;
){
t[o]=arguments[++o]
}
var s=this._serviceZimlets[n];
if(s){
return s[n].apply(s,t)
}
var e=this._ZIMLETS;
for(var o=0;
o<e.length;
++o){
var r=e[o].handlerObject;
if(r&&(r instanceof ZmZimletBase)&&r.getEnabled()&&(typeof r[n]=="function")){
this._serviceZimlets[n]=r;
return r[n].apply(r,t)
}}
if(this.isLoaded()){
this._requestNotHandledByAnyZimlet[n]=n
}
return null
};
ZmZimletMgr.prototype._getZimletNames=function(e){
var a=new Array(e?e.length:0);
for(var t=0;
t<e.length;
t++){
a[t]=e[t].zimlet[0].name
}
return a
};
ZmZimletMgr.prototype._loadIncludes=function(a,e,o){
var i=this.__getIncludes(a,e,true);
var t=new AjxCallback(this,this._finished_loadIncludes,[e,o]);
AjxInclude(i,null,t,ZmZimletBase.PROXY)
};
ZmZimletMgr.prototype._finished_loadIncludes=function(l,c){
if(!appCtxt.isChildWindow){
this.renameZimletsLabel()
}
this.loaded=true;
var a=this.getZimletsHash();
for(var n=0;
n<l.length;
n++){
var s=false;
var t=l[n];
try{
a[t]._finished_loadIncludes()
}
catch(r){
if(!s){
var h=appCtxt.getErrorDialog();
var d=AjxMessageFormat.format(ZmMsg.zimletInitError,t);
h.setMessage(d,r.toString(),DwtMessageDialog.CRITICAL_STYLE);
h.popup();
s=true
}}}
if(appCtxt.get(ZmSetting.PORTAL_ENABLED)&&!appCtxt.isChildWindow){
var o={
name:"Portal",callback:(new AjxCallback(this,this._finished_loadIncludes2,[c]))};
AjxPackage.require(o)
}else{
this._finished_loadIncludes2(c)
}};
ZmZimletMgr.prototype._finished_loadIncludes2=function(e){
appCtxt.allZimletsLoaded();
if(e){
e.run()
}};
ZmZimletMgr.prototype._loadStyles=function(t,e){
var n=document.getElementsByTagName("head")[0];
var o=this.__getIncludes(t,e,false);
for(var a=0;
a<o.length;
a++){
var s=document.createElement("link");
s.type="text/css";
s.rel="stylesheet";
s.href=o[a];
n.appendChild(s);
s.disabled=true;
s.disabled=false
}};
ZmZimletMgr.prototype.__getIncludes=function(r,h,l){
var u=[];
for(var g=0;
g<r.length;
g++){
var d=r[g].zimlet[0];
var e=r[g].zimletContext[0].baseUrl;
var b=e.match("/_dev/");
var y=null;
var c=null;
if(appCtxt.get(ZmSetting.LOCALE_NAME)){
var m=appCtxt.get(ZmSetting.LOCALE_NAME);
var n=m.indexOf("_");
if(n==-1){
y=m
}else{
y=m.substr(0,n);
c=m.substr(n+1)
}}
var o=b?("?debug=1&v="+new Date().getTime()+"&"):("?v="+cacheKillerVersion+"&");
o+=((y?"language="+y:"")+"&");
o+=((c?"country="+c:""));
if(window.appDevMode&&l){
u.push([appContextPath,"/res/",d.name,".js",o].join(""))
}
var t=(l?d.include:d.includeCSS)||[];
for(var f=0;
f<t.length;
f++){
var a=t[f]._content;
if(ZmZimletMgr._RE_REMOTE.test(a)){
var p=[ZmZimletBase.PROXY,AjxStringUtil.urlComponentEncode(a)].join("");
u.push(p);
continue
}
if(window.appDevMode||b){
u.push([e,a,o].join(""))
}}}
if(!window.appDevMode){
var w=null;
if(appCtxt.getSettings()&&appCtxt.getSettings().getInfoResponse&&appCtxt.getSettings().getInfoResponse.cos){
w=appCtxt.getSettings().getInfoResponse.cos.id
}
var s=(!AjxEnv.isIE||(!AjxEnv.isIE6&&AjxEnv.isIE6up))?appExtension:"";
u.unshift(["/service/zimlet/res/Zimlets-nodev_all",(l?(".js"+s):".css"),(y?"?language="+y:""),(c?"&country="+c:""),(w?"&cosId="+w:"")].join(""))
}
return u
};
ZmZimletMgr.prototype.renameZimletsLabel=function(){
var n=appCtxt.getOverviewController().getTreeController("ZIMLET");
var a=(n)?n.getTreeView("Mail"):null;
var e=(a)?a.getItems()[0]:null;
if(e){
var t=e.getItems();
for(var o=0;
o<t.length;
o++){
this.changeZimletLabel(t[o])
}}};
ZmZimletMgr.prototype.changeZimletLabel=function(a){
var t=a.getData(Dwt.KEY_OBJECT);
if(t){
var e=t.getName();
var o=/\$/;
if(e.match(o)){
var s=e.replace(/\${msg./,"").replace(/}/,"");
var i=t.getZimletContext().name;
if(window[i]){
var n=window[i][s];
if(n){
a.setText(n);
t.setName(n)
}}}}}
}
if(AjxPackage.define("zimbraMail.share.model.ZmZimlet")){
ZmZimlet=function(o,a,i,e,t){
ZmOrganizer.call(this,{
type:ZmOrganizer.ZIMLET,id:o,name:a,parent:i,tree:e}
)
};
ZmZimlet.prototype=new ZmOrganizer();
ZmZimlet.prototype.constructor=ZmZimlet;
ZmZimlet.actionMenus={};
ZmZimlet.actionMenus.ZmCalViewController=[];
ZmZimlet.listeners={};
ZmZimlet.listeners.ZmCalViewController={};
ZmZimlet.ID_ZIMLET=ZmOrganizer.ID_ZIMLET;
ZmZimlet.ID_ZIMLET_ROOT=ZmZimlet.ID_ZIMLET+"_root";
ZmZimlet.prototype.toString=function(){
return"ZmZimlet - "+this.name
};
ZmZimlet.prototype.setName=function(e){
this.name=e
};
ZmZimlet.createFromJs=function(l,o,c,h){
if(!o&&o.length<1){
return null
}
var n=new ZmZimlet(ZmZimlet.ID_ZIMLET_ROOT,ZmMsg.zimlets,l,c,null,null);
if(o&&o.length){
var t=ZmZimlet.ID_ZIMLET;
for(var s=0;
s<o.length;
s++){
var r=o[s].processMessage(o[s].zimletPanelItem.label);
var e=(++t)+"_z";
var a=new ZmZimlet(e,r,n,c,null,null);
n.children.add(a);
a._zimletContext=o[s];
a._zimletContext._id=e;
a._toolTip=o[s].zimletPanelItem.toolTipText;
o[s]._organizer=a
}}
return n
};
ZmZimlet.sortCompare=function(i,t){
var e=ZmOrganizer.checkSortArgs(i,t);
if(!e){
return e
}
var a=i.name.toLowerCase();
var o=t.name.toLowerCase();
if(a<o){
return -1
}
if(a>o){
return 1
}
return 0
};
ZmZimlet.checkName=function(e){
return ZmOrganizer.checkName(e)
};
ZmZimlet.prototype.resetNames=function(){
var i=this.name;
var t=this._toolTip;
if(this._zimletContext&&this._toolTip){
this._toolTip=this._zimletContext.processMessage(this._toolTip)
}
if(this._zimletContext&&this.name){
this.name=this._zimletContext.processMessage(this.name)
}
if((i!=this.name)||(t!=this._toolTip)){
var e={};
e[ZmOrganizer.F_NAME]=true;
var a={};
a.fields=e;
this._notify(ZmEvent.E_MODIFY,a)
}};
ZmZimlet.prototype.setToolTipText=function(e){
e.setToolTipContent(this._toolTip)
};
ZmZimlet.prototype.getIcon=function(){
return(this.id==ZmZimlet.ID_ZIMLET_ROOT)?null:this._zimletContext.icon
};
ZmZimlet.prototype.getZimletContext=function(){
return this._zimletContext
};
ZmZimlet.prototype.supportsSharing=function(){
return false
}
}
if(AjxPackage.define("zimbraMail.share.controller.ZmZimletTreeController")){
ZmZimletTreeController=function(){
ZmTreeController.call(this,ZmOrganizer.ZIMLET);
this._listeners[ZmOperation.BROWSE]=new AjxListener(this,this._browseListener);
this._eventMgrs={}
};
ZmZimletTreeController.prototype=new ZmTreeController;
ZmZimletTreeController.prototype.constructor=ZmZimletTreeController;
ZmZimletTreeController.prototype.toString=function(){
return"ZmZimletTreeController"
};
ZmZimletTreeController.prototype._browseListener=function(t){
var e=this._getActionedOrganizer(t);
if(e){
AjxDispatcher.require("Browse");
appCtxt.getSearchController().showBrowsePickers([ZmPicker.ZIMLET])
}};
ZmZimletTreeController.prototype.resetOperations=function(t,e,a){
t.enable(ZmOperation.BROWSE,true)
};
ZmZimletTreeController.prototype.addSelectionListener=function(t,e){
if(!this._eventMgrs[t]){
this._eventMgrs[t]=new AjxEventMgr;
this._eventMgrs[t]._selEv=new DwtSelectionEvent(true)
}
this._eventMgrs[t].addListener(DwtEvent.SELECTION,e)
};
ZmZimletTreeController.prototype.removeSelectionListener=function(t,e){
if(this._eventMgrs[t]){
this._eventMgrs[t].removeListener(DwtEvent.SELECTION,e)
}};
ZmZimletTreeController.prototype._postSetup=function(n){
var a=this.getTreeView(n);
var e=a.getItems()[0];
if(e){
var t=e.getItems();
for(var o=0;
o<t.length;
o++){
this.setToolTipText(t[o])
}}};
ZmZimletTreeController.prototype.setToolTipText=function(t){
var e=t.getData(Dwt.KEY_OBJECT);
if(e){
e.setToolTipText(t)
}};
ZmZimletTreeController.prototype._changeListener=function(s,t,r){
ZmTreeController.prototype._changeListener.call(this,s,t,r);
var a=s.getDetail("organizers");
if(!a&&s.source){
a=[s.source]
}
for(var o=0;
o<a.length;
o++){
var e=a[o];
var h=e.id;
var n=t.getTreeItemById(h);
this.setToolTipText(n)
}};
ZmZimletTreeController.prototype._getDataTree=function(){
return appCtxt.getZimletTree()
};
ZmZimletTreeController.prototype._getHeaderActionMenuOps=function(){
return[ZmOperation.BROWSE]
};
ZmZimletTreeController.prototype._getActionMenuOps=function(){
return null
};
ZmZimletTreeController.prototype._getActionMenu=function(e){
var t=e.item.getData(Dwt.KEY_OBJECT);
t=t.getZimletContext();
if(t){
return t.getPanelActionMenu()
}};
ZmZimletTreeController.prototype.getTreeStyle=function(){
return DwtTree.SINGLE_STYLE
};
ZmZimletTreeController.prototype._itemClicked=function(e){
if(e.id==ZmZimlet.ID_ZIMLET_ROOT){
return
}
if(!e.__dbl_click_timeout){
e.__dbl_click_timeout=setTimeout(function(){
e.__dbl_click_timeout=null;
e.getZimletContext().callHandler("_dispatch",["singleClicked"])
}
,350)
}};
ZmZimletTreeController.prototype._itemDblClicked=function(e){
if(e.id==ZmZimlet.ID_ZIMLET_ROOT){
return
}
if(e.__dbl_click_timeout){
clearTimeout(e.__dbl_click_timeout);
e.__dbl_click_timeout=null
}
e.getZimletContext().callHandler("_dispatch",["doubleClicked"])
};
ZmZimletTreeController.prototype._dropListener=function(n){
var h=n.targetControl.getData(Dwt.KEY_OBJECT);
if(!h){
n.doIt=false;
return
}
if(h.id==ZmZimlet.ID_ZIMLET_ROOT){
n.doIt=false;
return
}
if(h.getZimletContext){
try{
h=h.getZimletContext()
}
catch(a){
n.doIt=false;
return
}}else{
n.doIt=false;
return
}
var r=n.srcData.data;
if(!h||!r){
n.doIt=false;
return
}
var s=h.zimletPanelItem.dragSource;
if(!s){
n.doIt=false
}else{
var e=false;
for(var t=s.length;
--t>=0;
){
var o=r[0]?r[0].toString():r.toString();
if(o==s[t].type){
e=true;
s=s[t];
break
}}
if(n.action==DwtDropEvent.DRAG_ENTER){
if(e){
e=h.callHandler("_dispatch",["doDrag",ZmZimletContext._translateZMObject(r),s])
}
n.doIt=e
}else{
if(n.action==DwtDropEvent.DRAG_DROP){
h.callHandler("_dispatch",["doDrop",ZmZimletContext._translateZMObject(r),s])
}}}};
ZmZimletTreeController.prototype._dragListener=function(e){
e.operation=Dwt.DND_DROP_NONE
}
}};
</script><script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/Zimlets-nodev_all.js.zgz"></script><link type="text/css" rel="stylesheet" href="./Seals jpeg by Jesse Mechling_files/Zimlets-nodev_all.css"><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Portal")){
if(AjxPackage.define("zimbraMail.portal.controller.ZmPortalController")){
ZmPortalController=function(e,t){
if(arguments.length==0){
return
}
ZmListController.call(this,e,t);
ZmOperation.registerOp(ZmId.OP_PAUSE_TOGGLE,{
textKey:"pause",image:"Pause",style:DwtButton.TOGGLE_STYLE}
);
this._listeners[ZmOperation.REFRESH]=new AjxListener(this,this._refreshListener);
this._listeners[ZmOperation.PAUSE_TOGGLE]=new AjxListener(this,this._pauseListener)
};
ZmPortalController.prototype=new ZmListController;
ZmPortalController.prototype.constructor=ZmPortalController;
ZmPortalController.prototype.toString=function(){
return"ZmPortalController"
};
ZmPortalController.prototype.show=function(){
ZmListController.prototype.show.call(this);
this._setup(this._currentView);
var e=new Object();
e[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar[this._currentView];
e[ZmAppViewMgr.C_APP_CONTENT]=this._listView[this._currentView];
this._setView({
view:this._currentView,elements:e,isAppView:true}
)
};
ZmPortalController.prototype.setPaused=function(o){
var e=this._listView[this._currentView];
var t=e&&e.getPortletIds();
if(t&&t.length>0){
var n=appCtxt.getApp(ZmApp.PORTAL).getPortletMgr();
for(var a=0;
a<t.length;
a++){
var s=n.getPortletById(t[a]);
s.setPaused(o)
}}};
ZmPortalController.prototype._defaultView=function(){
return ZmId.VIEW_PORTAL
};
ZmPortalController.prototype._getToolBarOps=function(){
return[ZmOperation.REFRESH]
};
ZmPortalController.prototype._createNewView=function(e){
return new ZmPortalView(this._container,this,this._dropTgt)
};
ZmPortalController.prototype._setViewContents=function(e){
this._listView[e].set()
};
ZmPortalController.prototype._refreshListener=function(){
this._app.refreshPortlets()
};
ZmPortalController.prototype._pauseListener=function(i){
var a=this._toolbar[this._currentView];
var t=a&&a.getButton(ZmOperation.REFRESH);
var e=i.item.isToggled();
if(t){
t.setEnabled(!e)
}
this.setPaused(e)
};
ZmPortalController.prototype._resetOperations=function(t,e){
t.enable(this._getToolBarOps(),true)
}
}
if(AjxPackage.define("zimbraMail.portal.model.ZmPortlet")){
ZmPortlet=function(h,t,a){
ZmItem.call(this,ZmItem.PORTLET,t,h);
var o=appCtxt.getZimletMgr();
this.zimletName=a.zimlet;
this.zimletCtxt=o.getZimletsHash()[this.zimletName];
this.zimlet=this.zimletCtxt&&this.zimletCtxt.handlerObject;
this.global=/^true|on|yes$/i.test(a.global);
this.icon=a.icon;
this.title=a.title;
if(this.title){
this.title=this.zimletCtxt?this.zimletCtxt.processMessage(a.title):a.zimlet
}
var l=this.zimletCtxt&&this.zimletCtxt.portlet;
this.actionUrl=l&&l.actionUrl;
this.properties={};
var r=l&&l.portletProperties;
for(var s in r){
var e=r[s];
this.properties[e.name]=e.value
}
if(a.properties){
for(var s=0;
s<a.properties.length;
s++){
var e=a.properties[s];
this.properties[e.name]=e._content
}}
if(this.zimletCtxt){
for(var n in this.properties){
this.properties[n]=this.zimletCtxt.replaceObj(ZmZimletContext.RE_SCAN_APP,this.properties[n],ZmZimletContext.APP)
}}
if(this.actionUrl){
this.setRefreshInterval(this.actionUrl.refresh)
}};
ZmPortlet.prototype=new ZmItem;
ZmPortlet.prototype.constructor=ZmPortlet;
ZmPortlet.prototype.toString=function(){
return"ZmPortlet"
};
ZmPortlet.prototype.view;
ZmPortlet.prototype._refreshActionId=-1;
ZmPortlet.prototype.refresh=function(){
if(this.view){
this._refreshTime=new Date().getTime();
if(this.actionUrl){
this.view.setContentUrl(this.actionUrl.target)
}else{
if(this.zimlet instanceof ZmZimletBase){
this.zimlet.portletRefreshed(this)
}else{
if(this.zimlet){
var e=AjxMessageFormat.format(ZmMsg.zimletNotLoaded,this.zimletName);
this.setContent(e)
}else{
var e=AjxMessageFormat.format(ZmMsg.zimletUnknown,this.zimletName);
this.setContent(e)
}}}}};
ZmPortlet.prototype.setRefreshInterval=function(e){
if(this._refreshActionId!=-1){
clearInterval(this._refreshActionId);
this._refreshActionId=-1
}
this._refreshInterval=e;
if(e){
if(!this._refreshAction){
this._refreshAction=AjxCallback.simpleClosure(this.refresh,this)
}
this._refreshActionId=setInterval(this._refreshAction,e)
}};
ZmPortlet.prototype.setContent=function(e){
if(this.view){
this.view.setContent(e)
}else{}};
ZmPortlet.prototype.setContentUrl=function(e){
if(this.view){
this.view.setContentUrl(e)
}else{}};
ZmPortlet.prototype.setPaused=function(a){
if(this._refreshActionId!=-1&&a){
this._pauseTime=new Date().getTime();
clearInterval(this._refreshActionId);
this._refreshActionId=-1
}else{
if(this._refreshInterval&&!a){
var i=this._refreshInterval-(this._pauseTime-this._refreshTime);
var t=i<this._refreshInterval?i:0;
var e=AjxCallback.simpleClosure(this._resumeRefresh,this);
setTimeout(e,t)
}}};
ZmPortlet.prototype._resumeRefresh=function(){
this.refresh();
this._refreshActionId=setInterval(this._refreshAction,this._refreshInterval)
}
}
if(AjxPackage.define("zimbraMail.portal.model.ZmPortletMgr")){
ZmPortletMgr=function(){
this._portlets={};
this._loadedZimlets={};
this._delayedPortlets={}
};
ZmPortletMgr.prototype.createPortlets=function(o,t){
o=o!=null?o:false;
var l=[];
t=t||appCtxt.getApp(ZmApp.PORTAL).getManifest();
if(t){
var r=t.portal;
var e=r&&r.portlets;
if(e){
for(var n=0;
n<e.length;
n++){
var h=e[n];
var s=h.global=="true";
if(s!=o){
continue
}
var a=h.panel&&h.panel.id;
if(a&&!this._portlets[a]&&document.getElementById(a)){
this.createPortlet(a,h);
l.push(a)
}}}}
return l
};
ZmPortletMgr.prototype.createPortlet=function(i,t){
var a=new ZmPortlet(null,i,t);
this._portlets[i]=a;
var e=a.zimletName;
if(this._loadedZimlets[e]){
this._portletCreated(a)
}else{
if(e){
if(!this._delayedPortlets[e]){
this._delayedPortlets[e]=[]
}
this._delayedPortlets[e].push(a)
}}
return a
};
ZmPortletMgr.prototype.getPortlets=function(){
return this._portlets
};
ZmPortletMgr.prototype.getPortletById=function(e){
return this._portlets[e]
};
ZmPortletMgr.prototype.zimletLoaded=function(t){
this._loadedZimlets[t.name]=true;
var a=this._delayedPortlets[t.name];
if(a){
for(var e=0;
e<a.length;
e++){
var o=a[e];
this._portletCreated(o,t)
}}
delete this._delayedPortlets[t.name]
};
ZmPortletMgr.prototype.allZimletsLoaded=function(){
for(var e in this._portlets){
var a=this._portlets[e];
if(!this._loadedZimlets[a.zimletName]){
var t=document.getElementById(a.id);
if(t){
t.innerHTML=""
}}}};
ZmPortletMgr.prototype._portletCreated=function(o,i){
if(!i){
i=appCtxt.getZimletMgr().getZimletsHash()[o.zimletName]
}
var a=document.getElementById(o.id);
var e=new ZmPortletView(a,o);
var t=i.handlerObject;
o.zimlet=t;
if(t){
t.portletCreated(o)
}}
}
if(AjxPackage.define("zimbraMail.portal.view.ZmPortalView")){
ZmPortalView=function(i,t,e){
var a=this._getHeaderList();
ZmListView.call(this,{
parent:i,className:"ZmPortalView",posStyle:Dwt.ABSOLUTE_STYLE,view:ZmId.VIEW_PORTAL,controller:t,headerList:a,dropTgt:e}
);
this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this.setScrollStyle(Dwt.SCROLL)
};
ZmPortalView.prototype=new ZmListView;
ZmPortalView.prototype.constructor=ZmPortalView;
ZmPortalView.prototype.toString=function(){
return"ZmPortalView"
};
ZmPortalView.prototype.getPortletIds=function(){
return this._portletIds||[]
};
ZmPortalView.prototype._getHeaderList=function(){
return[]
};
ZmPortalView.prototype.set=function(){
if(this._rendered){
Dwt.setTitle(this.getTitle());
return
}
var e=new AjxCallback(this,this._initializeView2);
appCtxt.getApp(ZmApp.PORTAL).getManifest(e)
};
ZmPortalView.prototype._initializeView2=function(t){
var a=t&&t.portal;
if(a){
this.getHtmlElement().innerHTML=a.html||""
}
var e=appCtxt.getApp(ZmApp.PORTAL).getPortletMgr();
this._portletIds=e.createPortlets();
this._rendered=true
};
ZmPortalView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,this._controller.getApp().getDisplayName()].join(": ")
}
}
if(AjxPackage.define("zimbraMail.portal.view.ZmPortletView")){
ZmPortletView=function(t,a,e){
e=e||"ZmPortlet";
DwtComposite.call(this,{
parent:DwtShell.getShell(window),className:e,posStyle:DwtControl.STATIC_STYLE}
);
this._portlet=a;
this._portlet.view=this;
this._contentsEl=this.getHtmlElement();
if(t){
t.portlet="loaded";
t.innerHTML="";
t.appendChild(this._contentsEl)
}
this.setIcon(a.icon);
this.setTitle(a.title);
this.setContentUrl(a.actionUrl&&a.actionUrl.target)
};
ZmPortletView.prototype=new DwtComposite;
ZmPortletView.prototype.constructor=ZmPortletView;
ZmPortletView.prototype.toString=function(){
return"ZmPortletView"
};
ZmPortletView.prototype.setIcon=function(e){
if(e==null||!this._iconEl){
return
}
AjxImg.setImage(this._iconEl,e)
};
ZmPortletView.prototype.setTitle=function(e){
if(e==null||!this._titleEl){
return
}
this._titleEl.innerHTML=e
};
ZmPortletView.prototype.setContent=function(e){
if(AjxUtil.isString(e)){
this._contentsEl.innerHTML=e
}else{
if(AjxUtil.ELEMENT_NODE){
this._contentsEl.innerHTML="";
this._contentsEl.appendChild(e)
}else{
this._contentsEl.innerHTML=AjxStringUtil.htmlEncode(String(e))
}}};
ZmPortletView.prototype.setContentUrl=function(e){
if(!e){
return
}
var a=this._portlet.properties;
var i=AjxCallback.simpleClosure(ZmPortletView.__replaceProp,null,a);
e=e.replace(ZmZimletContext.RE_SCAN_PROP,i);
e=this._portlet.zimletCtxt?this._portlet.zimletCtxt.makeURL({
target:e}
,null,a):e;
var t=["<iframe style='border:none;width:100%;height:100%' ","src='",e,"'>","</iframe>"].join("");
this.setContent(t)
};
ZmPortletView.__replaceProp=function(a,t,e,i){
return a[i]
}
}};
</script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("ContactsCore")){
if(AjxPackage.define("ajax.dwt.widgets.DwtChooser")){
DwtChooser=function(a){
if(arguments.length==0){
return
}
DwtComposite.call(this,a.parent,a.className);
this._slvClassName=a.slvClassName;
this._tlvClassName=a.tlvClassName;
this._layoutStyle=a.layoutStyle?a.layoutStyle:DwtChooser.HORIZ_STYLE;
this._selectStyle=a.selectStyle?a.selectStyle:DwtChooser.MULTI_SELECT;
this._mode=a.listStyle?a.listStyle:DwtChooser.MODE_MOVE;
this._noDuplicates=(a.noDuplicates!==false);
this._singleHeight=a.singleHeight?a.singleHeight:45;
this._listSize=a.listSize;
this._sourceEmptyOk=a.sourceEmptyOk;
this._allButtons=a.allButtons;
this._hasTextField=a.hasTextField;
this._handleButtonInfo(a.buttonInfo);
this._mode=a.mode?a.mode:this._hasMultiButtons?DwtChooser.MODE_COPY:DwtChooser.MODE_MOVE;
this._createHtml();
this._initialize();
var t=a.parent.getSize();
var o=a.listWidth||t.x;
var e=a.listHeight||t.y;
if(o&&e){
this.resize(o,e)
}};
DwtChooser.prototype=new DwtComposite;
DwtChooser.prototype.constructor=DwtChooser;
DwtChooser.HORIZ_STYLE=1;
DwtChooser.VERT_STYLE=2;
DwtChooser.SINGLE_SELECT=1;
DwtChooser.MULTI_SELECT=2;
DwtChooser.MODE_COPY=1;
DwtChooser.MODE_MOVE=2;
DwtChooser.REMOVE_BTN_ID="__remove__";
DwtChooser.ADD_ALL_BTN_ID="__addAll__";
DwtChooser.REMOVE_ALL_BTN_ID="__removeAll__";
DwtChooser.prototype.toString=function(){
return"DwtChooser"
};
DwtChooser.prototype.setItems=function(t,e,a){
e=e?e:DwtChooserListView.SOURCE;
this._reset(e);
this.addItems(t,e,true);
this._selectFirst(e);
if(a){
this._reset((e==DwtChooserListView.SOURCE)?DwtChooserListView.TARGET:DwtChooserListView.SOURCE)
}};
DwtChooser.prototype.getItems=function(e){
e=e?e:DwtChooserListView.TARGET;
if(e==DwtChooserListView.SOURCE){
return this.sourceListView.getList().clone()
}else{
if(this._hasMultiButtons){
var a={};
for(var t in this._data){
a[t]=this._data[t].clone()
}
return a
}else{
return this._data[this._buttonInfo[0].id].clone()
}}};
DwtChooser.prototype.addItems=function(t,e,o,r){
e=e?e:DwtChooserListView.SOURCE;
var s=(t instanceof AjxVector)?t.getArray():(t instanceof Array)?t:[t];
if(e==DwtChooserListView.SOURCE){
for(var a=0;
a<s.length;
a++){
this._addToSource(s[a],null,o)
}}else{
var n;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.targetListView._resetList();
s=(s.length>0)?[s[0]]:s
}
for(var a=0;
a<s.length;
a++){
this._addToTarget(s[a],r,o)
}}
if(e==DwtChooserListView.SOURCE){
var s=this.sourceListView.getList();
this._sourceSize=s?s.size():0
}};
DwtChooser.prototype.removeItems=function(o,e,a){
o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
for(var t=0;
t<o.length;
t++){
(e==DwtChooserListView.SOURCE)?this._removeFromSource(o[t],a):this._removeFromTarget(o[t],a)
}};
DwtChooser.prototype.transfer=function(t,o,e){
o=o?o:this._activeButtonId;
this._setActiveButton(o);
if(this._mode==DwtChooser.MODE_MOVE){
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
var a=this.targetListView.getList();
if(a&&a.size()){
this.remove(a,true)
}}
this.removeItems(t,DwtChooserListView.SOURCE,true)
}
this.addItems(t,DwtChooserListView.TARGET,e);
this.sourceListView.deselectAll()
};
DwtChooser.prototype.remove=function(o,a){
o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
if(this._mode==DwtChooser.MODE_MOVE){
for(var t=0;
t<o.length;
t++){
var e=this._getInsertionIndex(this.sourceListView,o[t]);
this.sourceListView.addItem(o[t],e,true)
}
this._sourceSize=o?o.length:0
}
this.removeItems(o,DwtChooserListView.TARGET)
};
DwtChooser.prototype.setSelectStyle=function(o,r){
if(o==this._selectStyle){
return
}
this._selectStyle=o;
if(this._defLabel){
var t=this._button[this._buttonInfo[0].id];
t.setText((o==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add)
}
if(!r){
var n=this.getSize();
this.resize(n.x,n.y)
}
if(this._allButtons){
this._addAllButton.setVisible(o==DwtChooser.MULTI_SELECT);
this._removeAllButton.setVisible(o==DwtChooser.MULTI_SELECT);
this._enableButtons()
}
if(o==DwtChooser.SINGLE_SELECT){
var s=this.targetListView.getList();
var e=s?s.clone().getArray():null;
if(e&&e.length){
this._reset(DwtChooserListView.TARGET);
this.addItems(e[0],DwtChooserListView.TARGET,true);
this.targetListView.deselectAll();
if(e.length>1&&this._mode==DwtChooser.MODE_MOVE){
this.addItems(e.slice(1),DwtChooserListView.SOURCE,true)
}
this._enableButtons()
}}
this.sourceListView.multiSelectEnabled=(o==DwtChooser.MULTI_SELECT);
this.targetListView.multiSelectEnabled=(o==DwtChooser.MULTI_SELECT)
};
DwtChooser.prototype.reset=function(e){
this._reset(e);
this._setActiveButton(this._buttonInfo[0].id);
this._enableButtons();
if(this._hasTextField){
this._textField.setValue("")
}};
DwtChooser.prototype._reset=function(e){
if(!e||e==DwtChooserListView.SOURCE){
this.sourceListView._resetList()
}
if(!e||e==DwtChooserListView.TARGET){
this.targetListView._resetList();
for(var t in this._data){
this._data[t].removeAll()
}}};
DwtChooser.prototype.addStateChangeListener=function(e){
this.targetListView.addStateChangeListener(e)
};
DwtChooser.prototype.removeStateChangeListener=function(e){
this.targetListView.removeStateChangeListener(e)
};
DwtChooser.prototype.getSourceListView=function(){
return document.getElementById(this._sourceListViewDivId)
};
DwtChooser.prototype.getButtons=function(){
return document.getElementById(this._buttonsDivId)
};
DwtChooser.prototype.getTargetListView=function(){
return document.getElementById(this._targetListViewDivId)
};
DwtChooser.prototype.getTextField=function(){
return this._textField
};
DwtChooser.prototype._createHtml=function(){
this._sourceListViewDivId=Dwt.getNextId();
this._targetListViewDivId=Dwt.getNextId();
this._buttonsDivId=Dwt.getNextId();
this._removeButtonDivId=Dwt.getNextId();
if(this._allButtons){
this._addAllButtonDivId=Dwt.getNextId();
this._removeAllButtonDivId=Dwt.getNextId()
}
if(this._hasTextField){
this._textFieldTdId=Dwt.getNextId()
}
var a=[];
var e=0;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
a[e++]="<table cellspacing=0 cellpadding=0 border=0>";
a[e++]="<tr>";
a[e++]="<td id='";
a[e++]=this._sourceListViewDivId;
a[e++]="'></td>";
a[e++]="<td valign='middle' id='";
a[e++]=this._buttonsDivId;
a[e++]="'>";
if(this._allButtons){
a[e++]="<div id='";
a[e++]=this._addAllButtonDivId;
a[e++]="'></div><br>"
}
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
a[e++]="<div id='";
a[e++]=this._buttonDivId[o];
a[e++]="'></div><br>"
}
a[e++]="<br><div id='";
a[e++]=this._removeButtonDivId;
a[e++]="'></div>";
if(this._allButtons){
a[e++]="<br><div id='";
a[e++]=this._removeAllButtonDivId;
a[e++]="'></div><br>"
}
a[e++]="</td>";
a[e++]="<td id='";
a[e++]=this._targetListViewDivId;
a[e++]="'></td>";
a[e++]="</tr>";
if(this._hasTextField){
a[e++]="<tr><td>";
a[e++]="<table border=0 width=100%><tr><td style='white-space:nowrap; width:1%'>";
a[e++]=AjxMsg.add;
a[e++]=":</td><td id='";
a[e++]=this._textFieldTdId;
a[e++]="'></td></tr></table>";
a[e++]="</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
}
a[e++]="</table>"
}else{
a[e++]="<div id='";
a[e++]=this._sourceListViewDivId;
a[e++]="'></div>";
a[e++]="<div align='center' id='";
a[e++]=this._buttonsDivId;
a[e++]="'>";
a[e++]="<table><tr>";
if(this._allButtons){
a[e++]="<td id='";
a[e++]=this._addAllButtonDivId;
a[e++]="'></td>"
}
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
a[e++]="<td id='";
a[e++]=this._buttonDivId[o];
a[e++]="'></td>"
}
a[e++]="<td id='";
a[e++]=this._removeButtonDivId;
a[e++]="'></td>";
if(this._allButtons){
a[e++]="<td id='";
a[e++]=this._removeAllButtonDivId;
a[e++]="'></td>"
}
a[e++]="</tr></table></div>";
a[e++]="<div id='";
a[e++]=this._targetListViewDivId;
a[e++]="'></div>"
}
this.getHtmlElement().innerHTML=a.join("")
};
DwtChooser.prototype._handleButtonInfo=function(t){
if(!t){
this._defLabel=(this._selectStyle==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add;
t=[{
label:this._defLabel}
]
}
this._buttonInfo=t;
this._buttonDivId={};
this._buttonId={};
if(this._buttonInfo.length==1){
if(!this._buttonInfo[0].id){
this._buttonInfo[0].id=Dwt.getNextId()
}
this._activeButtonId=this._buttonInfo[0].id
}
for(var e=0;
e<this._buttonInfo.length;
e++){
var a=this._buttonInfo[e].id;
this._buttonDivId[a]=Dwt.getNextId();
this._buttonId[a]=Dwt.getNextId()
}
this._hasMultiButtons=(this._buttonInfo.length>1)
};
DwtChooser.prototype._initialize=function(){
var e=new AjxListener(this,this._transferButtonListener);
this._button={};
this._buttonIndex={};
this._data={};
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
this._button[o]=this._setupButton(o,this._buttonId[o],this._buttonDivId[o],this._buttonInfo[t].label);
this._button[o].addSelectionListener(e);
this._buttonIndex[o]=t;
this._data[o]=new AjxVector()
}
this.sourceListView=this._createSourceListView();
this._addListView(this.sourceListView,this._sourceListViewDivId);
this.sourceListView.addSelectionListener(new AjxListener(this,this._sourceListener));
this.targetListView=this._createTargetListView();
this._addListView(this.targetListView,this._targetListViewDivId);
this.targetListView.addSelectionListener(new AjxListener(this,this._targetListener));
this._removeButtonId=Dwt.getNextId();
this._removeButton=this._setupButton(DwtChooser.REMOVE_BTN_ID,this._removeButtonId,this._removeButtonDivId,AjxMsg.remove);
this._removeButton.addSelectionListener(new AjxListener(this,this._removeButtonListener));
if(this._allButtons){
this._addAllButtonId=Dwt.getNextId();
this._addAllButton=this._setupButton(DwtChooser.ADD_ALL_BTN_ID,this._addAllButtonId,this._addAllButtonDivId,AjxMsg.addAll);
this._addAllButton.addSelectionListener(new AjxListener(this,this._addAllButtonListener));
this._removeAllButtonId=Dwt.getNextId();
this._removeAllButton=this._setupButton(DwtChooser.REMOVE_ALL_BTN_ID,this._removeAllButtonId,this._removeAllButtonDivId,AjxMsg.removeAll);
this._removeAllButton.addSelectionListener(new AjxListener(this,this._removeAllButtonListener));
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this._addAllButton.setVisible(false);
this._removeAllButton.setVisible(false)
}}
if(this._hasTextField){
var a={
parent:this,type:DwtInputField.STRING};
this._textField=new DwtInputField(a);
this._textField.reparentHtmlElement(this._textFieldTdId);
this._textField._chooser=this;
this._textField.setHandler(DwtEvent.ONKEYUP,DwtChooser._onKeyUp);
Dwt.setSize(this._textField.getInputElement(),"100%",Dwt.DEFAULT)
}
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.sourceListView.multiSelectEnabled=false;
this.targetListView.multiSelectEnabled=false
}};
DwtChooser.prototype._createSourceListView=function(){
return new DwtChooserListView(this,DwtChooserListView.SOURCE,this._slvClassName)
};
DwtChooser.prototype._createTargetListView=function(){
return new DwtChooserListView(this,DwtChooserListView.TARGET,this._tlvClassName)
};
DwtChooser.prototype._addListView=function(t,a){
var e=document.getElementById(a);
e.appendChild(t.getHtmlElement());
t.setUI(null,true);
t._initialized=true
};
DwtChooser.prototype.resize=function(n,e){
if(!n||!e){
return
}
if(n==Dwt.DEFAULT&&e==Dwt.DEFAULT){
return
}
var a=document.getElementById(this._buttonsDivId);
var r=Dwt.getSize(a);
var t,o,s;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
t=this._listSize?this._listSize:(n==Dwt.DEFAULT)?n:Math.floor(((n-r.x)/2)-12);
o=s=e
}else{
t=n;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
o=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:e-r.y-this._singleHeight-30;
s=(e==Dwt.DEFAULT)?e:e-r.y-o-30
}else{
o=s=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:Math.floor(((e-r.y)/2)-12)
}}
this.sourceListView.setSize(t+2,o);
this.targetListView.setSize(t+2,s)
};
DwtChooser.prototype._setupButton=function(s,a,n,e){
var t=new DwtButton({
parent:this,id:a}
);
t.setText(e);
t.id=a;
t._buttonId=s;
var o=document.getElementById(n);
o.appendChild(t.getHtmlElement());
return t
};
DwtChooser.prototype._sourceListener=function(e){
if(e.detail==DwtListView.ITEM_DBL_CLICKED){
this.transfer(this.sourceListView.getSelection(),this._activeButtonId);
this.sourceListView.deselectAll()
}else{
if(this._activeButtonId==DwtChooser.REMOVE_BTN_ID){
var t=this._lastActiveTransferButtonId?this._lastActiveTransferButtonId:this._buttonInfo[0].id;
this._setActiveButton(t)
}}
this.targetListView.deselectAll();
this._enableButtons()
};
DwtChooser.prototype._targetListener=function(e){
if(e.detail==DwtListView.ITEM_DBL_CLICKED){
this.remove(this.targetListView.getSelection())
}else{
this._setActiveButton(DwtChooser.REMOVE_BTN_ID);
this.sourceListView.deselectAll();
this._enableButtons()
}};
DwtChooser.prototype._transferButtonListener=function(a){
var t=DwtControl.getTargetControl(a);
var s=t._buttonId;
var n=this.sourceListView.getSelection();
if(n&&n.length){
this.transfer(n,s);
var o=this.sourceListView.getList();
if(o&&o.size()){
this._selectFirst(DwtChooserListView.SOURCE)
}else{
this._enableButtons()
}}else{
var e=this._getEmailFromText();
if(e){
this.transfer([e],s)
}else{
this._setActiveButton(s)
}}};
DwtChooser.prototype._removeButtonListener=function(e){
this.remove(this.targetListView.getSelection());
var t=this.targetListView.getList();
if(t&&t.size()){
this._selectFirst(DwtChooserListView.TARGET)
}else{
this._enableButtons()
}};
DwtChooser.prototype._addAllButtonListener=function(e){
this.transfer(this.sourceListView.getList().clone());
this._selectFirst(DwtChooserListView.TARGET)
};
DwtChooser.prototype._removeAllButtonListener=function(e){
this.remove(this.targetListView.getList().clone());
this._selectFirst(DwtChooserListView.SOURCE)
};
DwtChooser.prototype._enableButtons=function(a,r){
var h=this.sourceListView.getList();
var c=this.targetListView.getList();
var o=(a||(this.sourceListView.getSelectionCount()>0));
for(var s=0;
s<this._buttonInfo.length;
s++){
var t=this._buttonInfo[s].id;
this._button[t].setEnabled(o)
}
var l=(r||(this.targetListView.getSelectionCount()>0));
this._removeButton.setEnabled(l);
if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){
var e=h?h.size():0;
var n=c?c.size():0;
this._addAllButton.setEnabled(e>0);
this._removeAllButton.setEnabled(n>0)
}};
DwtChooser.prototype._selectFirst=function(t,a){
var e=(t==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView;
var o=e.getList();
if(o&&o.size()>0){
e.setSelection(o.get(0))
}};
DwtChooser.prototype._setActiveButton=function(o){
if(!this._hasMultiButtons){
return
}
if(o!=this._activeButtonId){
var a=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId];
if(a){
var e=DwtControl.findControl(document.getElementById(a));
if(e){
e.setDisplayState(DwtControl.NORMAL)
}}
a=(o==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[o];
var t=DwtControl.findControl(document.getElementById(a));
if(t){
t.setDisplayState(DwtControl.DEFAULT)
}
this._activeButtonId=o;
if(o!=DwtChooser.REMOVE_BTN_ID){
this._lastActiveTransferButtonId=o
}}};
DwtChooser.prototype._isDuplicate=function(e,t){
return t.contains(e)
};
DwtChooser.prototype._addToSource=function(a,e,t){
if(!a){
return
}
if(!a._chooserIndex){
var o=this.sourceListView.getList();
a._chooserIndex=o?o.size()+1:1
}
this.sourceListView.addItem(a,e,t)
};
DwtChooser.prototype._addToTarget=function(l,e,s){
if(!l){
return
}
e=e?e:this._activeButtonId;
if(this._noDuplicates&&this._data[e]&&this._isDuplicate(l,this._data[e])){
return
}
var n=this.targetListView.getList();
if(n&&n.contains(l)&&l.clone){
var a=l.clone();
a.id=Dwt.getNextId();
l=a
}
var r=null;
if(this._hasMultiButtons){
n=[];
for(var t=0;
t<this._buttonInfo.length;
t++){
n=n.concat(this._data[this._buttonInfo[t].id].getArray())
}
var o=this._buttonIndex[e];
for(r=0;
r<n.length;
r++){
var h=this._buttonIndex[n[r]._buttonId];
if(h>o){
break
}}}
l._buttonId=e;
l.id=l.id||Dwt.getNextId();
this._data[e].add(l);
this.targetListView.addItem(l,r,s)
};
DwtChooser.prototype._removeFromSource=function(t,e){
if(!t){
return
}
var a=this.sourceListView.getList();
if(!a){
return
}
if(!a.contains(t)){
return
}
this.sourceListView.removeItem(t,e)
};
DwtChooser.prototype._removeFromTarget=function(t,e){
if(!t){
return
}
var a=this.targetListView.getList();
if(!a){
return
}
if(!a.contains(t)){
return
}
this._data[t._buttonId].remove(t);
this.targetListView.removeItem(t,e)
};
DwtChooser.prototype._getInsertionIndex=function(t,n){
var s=t.getList();
if(!s){
return null
}
var e=s.getArray();
for(var o=0;
o<e.length;
o++){
if(n._chooserIndex&&e[o]._chooserIndex&&(e[o]._chooserIndex>=n._chooserIndex)){
return o
}}
return null
};
DwtChooser.prototype._getEmailFromText=function(){
var t=this._textField.getValue();
var e=AjxEmailAddress.parse(t);
if(e){
e.id=Dwt.getNextId();
return e
}};
DwtChooser._onKeyUp=function(n){
var a=DwtUiEvent.getTarget(n);
var s=DwtControl.findControl(a);
var o=s._chooser;
var t=DwtKeyEvent.getCharCode(n);
if(t==3||t==13){
var e=o._getEmailFromText();
if(e){
o.transfer([e],o._activeButtonId);
a.value=""
}}
o._enableButtons(a.value.length)
};
DwtChooserListView=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtChooserListView.PARAMS);
e.className=e.className||"DwtChooserListView";
e.headerList=this._getHeaderList(parent);
DwtListView.call(this,e);
this.type=e.type;
this._chooserParent=e.parent.parent
};
DwtChooserListView.PARAMS=["parent","type","className","view"];
DwtChooserListView.SOURCE=1;
DwtChooserListView.TARGET=2;
DwtChooserListView.prototype=new DwtListView;
DwtChooserListView.prototype.constructor=DwtChooserListView;
DwtChooserListView.prototype._getHeaderList=function(){};
DwtChooserListView.prototype.toString=function(){
return"DwtChooserListView"
};
DwtChooserListView.prototype.setUI=function(t,e){
e=e?e:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk);
DwtListView.prototype.setUI.call(this,t,e)
};
DwtChooserListView.prototype._itemClicked=function(e,t){
if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){
return
}else{
DwtListView.prototype._itemClicked.call(this,e,t)
}};
DwtChooserListView.prototype._sortColumn=function(t,e){
this._chooserParent.search(t,e)
};
DwtChooserListView.prototype._getHeaderSashLocation=function(){
var t=this.getHtmlElement();
if(Dwt.getPosition(t)==Dwt.ABSOLUTE_STYLE){
return DwtListView.prototype._getHeaderSashLocation.call(this)
}
var a=Dwt.toWindow(t,0,0);
var e=Dwt.toWindow(this._chooserParent.getHtmlElement(),0,0);
if(!this._tmpPoint){
this._tmpPoint=new DwtPoint()
}
this._tmpPoint.x=a.x-e.x;
this._tmpPoint.y=a.y-e.y;
return this._tmpPoint
}
}
if(AjxPackage.define("zimbraMail.abook.model.ZmAddrBook")){
ZmAddrBook=function(e){
e.type=ZmOrganizer.ADDRBOOK;
ZmFolder.call(this,e)
};
ZmAddrBook.prototype=new ZmFolder;
ZmAddrBook.prototype.constructor=ZmAddrBook;
ZmAddrBook.ID_ADDRESSBOOK=ZmOrganizer.ID_ADDRBOOK;
ZmAddrBook.sortCompare=function(n,o){
var t=ZmOrganizer.checkSortArgs(n,o);
if(t!=null){
return t
}
if(n.link!=o.link){
return n.link?1:-1
}
if(n.nId==ZmFolder.ID_TRASH){
return 1
}
if(o.nId==ZmFolder.ID_TRASH){
return -1
}
var e=n.name.toLowerCase();
var a=o.name.toLowerCase();
if(e<a){
return -1
}
if(e>a){
return 1
}
return 0
};
ZmAddrBook.prototype.toString=function(){
return"ZmAddrBook"
};
ZmAddrBook.prototype.getIcon=function(){
if(this.nId==ZmFolder.ID_ROOT){
return null
}
if(this.nId==ZmFolder.ID_TRASH){
return"Trash"
}
if(this.link||this.isRemote()){
return"SharedContactsFolder"
}
if(this.nId==ZmFolder.ID_AUTO_ADDED){
return"EmailedContacts"
}
return"ContactsFolder"
};
ZmAddrBook.prototype.supportsPublicAccess=function(){
return true
};
ZmAddrBook.prototype.mayContain=function(s){
if(!s){
return true
}
if(!(s instanceof ZmAddrBook)){
var n=false;
if(this.nId==ZmOrganizer.ID_ROOT){
n=true
}else{
if(this.link){
n=this.isReadOnly()
}}
if(!n){
var t=(s instanceof Array)?s:[s];
var o=t[0];
if(o.type!=ZmItem.CONTACT&&o.type!=ZmItem.GROUP){
n=true
}else{
if(!n&&o.folderId){
n=true;
for(var a=0;
a<t.length;
a++){
var e=appCtxt.getById(t[a].folderId);
if(e!=this){
n=false;
break
}}}}}
return !n
}
return true
}
}
if(AjxPackage.define("zimbraMail.abook.model.ZmContact")){
if(!window.ZmContact){
ZmContact=function(a,t,e){
if(arguments.length==0){
return
}
e=e||ZmItem.CONTACT;
ZmItem.call(this,e,a,t);
this.attr={};
this.isGal=(this.list&&this.list.isGal);
this.participants=new AjxVector()
};
ZmContact.prototype=new ZmItem;
ZmContact.prototype.constructor=ZmContact;
ZmContact.F_anniversary="anniversary";
ZmContact.F_assistantPhone="assistantPhone";
ZmContact.F_attachment="attachment";
ZmContact.F_birthday="birthday";
ZmContact.F_callbackPhone="callbackPhone";
ZmContact.F_carPhone="carPhone";
ZmContact.F_company="company";
ZmContact.F_companyPhone="companyPhone";
ZmContact.F_custom="custom";
ZmContact.F_description="description";
ZmContact.F_department="department";
ZmContact.F_dlist="dlist";
ZmContact.F_email="email";
ZmContact.F_email2="email2";
ZmContact.F_email3="email3";
ZmContact.F_fileAs="fileAs";
ZmContact.F_firstName="firstName";
ZmContact.F_folderId="folderId";
ZmContact.F_homeCity="homeCity";
ZmContact.F_homeCountry="homeCountry";
ZmContact.F_homeFax="homeFax";
ZmContact.F_homePhone="homePhone";
ZmContact.F_homePhone2="homePhone2";
ZmContact.F_homePostalCode="homePostalCode";
ZmContact.F_homeState="homeState";
ZmContact.F_homeStreet="homeStreet";
ZmContact.F_homeURL="homeURL";
ZmContact.F_image="image";
ZmContact.F_imAddress="imAddress";
ZmContact.F_imAddress1="imAddress1";
ZmContact.F_imAddress2="imAddress2";
ZmContact.F_imAddress3="imAddress3";
ZmContact.F_jobTitle="jobTitle";
ZmContact.F_lastName="lastName";
ZmContact.F_maidenName="maidenName";
ZmContact.F_middleName="middleName";
ZmContact.F_mobilePhone="mobilePhone";
ZmContact.F_namePrefix="namePrefix";
ZmContact.F_nameSuffix="nameSuffix";
ZmContact.F_nickname="nickname";
ZmContact.F_notes="notes";
ZmContact.F_otherCity="otherCity";
ZmContact.F_otherCountry="otherCountry";
ZmContact.F_otherFax="otherFax";
ZmContact.F_otherPhone="otherPhone";
ZmContact.F_otherPostalCode="otherPostalCode";
ZmContact.F_otherState="otherState";
ZmContact.F_otherStreet="otherStreet";
ZmContact.F_otherURL="otherURL";
ZmContact.F_pager="pager";
ZmContact.F_type="type";
ZmContact.F_workAltPhone="workAltPhone";
ZmContact.F_workCity="workCity";
ZmContact.F_workCountry="workCountry";
ZmContact.F_workEmail1="workEmail1";
ZmContact.F_workEmail2="workEmail2";
ZmContact.F_workEmail3="workEmail3";
ZmContact.F_workFax="workFax";
ZmContact.F_workMobile="workMobile";
ZmContact.F_workPhone="workPhone";
ZmContact.F_workPhone2="workPhone2";
ZmContact.F_workPostalCode="workPostalCode";
ZmContact.F_workState="workState";
ZmContact.F_workStreet="workStreet";
ZmContact.F_workURL="workURL";
ZmContact.X_fileAs="fileAs";
ZmContact.X_firstLast="firstLast";
ZmContact.X_fullName="fullName";
ZmContact.X_vcardXProps="vcardXProps";
ZmContact.MC_cardOwner="cardOwner";
ZmContact.MC_workCardMessage="workCardMessage";
ZmContact.MC_homeCardMessage="homeCardMessage";
ZmContact.MC_homePhotoURL="homePhotoURL";
ZmContact.MC_workPhotoURL="workPhotoURL";
ZmContact.GAL_MODIFY_TIMESTAMP="modifyTimeStamp";
ZmContact.GAL_CREATE_TIMESTAMP="createTimeStamp";
ZmContact.GAL_ZIMBRA_ID="zimbraId";
ZmContact.GAL_OBJECT_CLASS="objectClass";
ZmContact.GAL_MAIL_FORWARD_ADDRESS="zimbraMailForwardingAddress";
ZmContact.GAL_CAL_RES_TYPE="zimbraCalResType";
ZmContact.GAL_CAL_RES_LOC_NAME="zimbraCalResLocationDisplayName";
var i=1;
ZmContact.FA_LAST_C_FIRST=i++;
ZmContact.FA_FIRST_LAST=i++;
ZmContact.FA_COMPANY=i++;
ZmContact.FA_LAST_C_FIRST_COMPANY=i++;
ZmContact.FA_FIRST_LAST_COMPANY=i++;
ZmContact.FA_COMPANY_LAST_C_FIRST=i++;
ZmContact.FA_COMPANY_FIRST_LAST=i++;
ZmContact.FA_CUSTOM=i++;
ZmContact.ADDRESS_FIELDS=[ZmContact.F_homeCity,ZmContact.F_homeCountry,ZmContact.F_homePostalCode,ZmContact.F_homeState,ZmContact.F_homeStreet,ZmContact.F_workCity,ZmContact.F_workCountry,ZmContact.F_workPostalCode,ZmContact.F_workState,ZmContact.F_workStreet,ZmContact.F_otherCity,ZmContact.F_otherCountry,ZmContact.F_otherPostalCode,ZmContact.F_otherState,ZmContact.F_otherStreet];
ZmContact.EMAIL_FIELDS=[ZmContact.F_email,ZmContact.F_workEmail1,ZmContact.F_workEmail2,ZmContact.F_workEmail3];
ZmContact.IM_FIELDS=[ZmContact.F_imAddress];
ZmContact.OTHER_FIELDS=[ZmContact.F_birthday,ZmContact.F_anniversary,ZmContact.F_custom];
ZmContact.PHONE_FIELDS=[ZmContact.F_mobilePhone,ZmContact.F_workPhone,ZmContact.F_workFax,ZmContact.F_companyPhone,ZmContact.F_homePhone,ZmContact.F_homeFax,ZmContact.F_pager,ZmContact.F_callbackPhone,ZmContact.F_assistantPhone,ZmContact.F_carPhone,ZmContact.F_otherPhone,ZmContact.F_otherFax,ZmContact.F_workAltPhone,ZmContact.F_workMobile];
ZmContact.PRIMARY_FIELDS=[ZmContact.F_image,ZmContact.F_namePrefix,ZmContact.F_firstName,ZmContact.F_middleName,ZmContact.F_maidenName,ZmContact.F_lastName,ZmContact.F_nameSuffix,ZmContact.F_nickname,ZmContact.F_jobTitle,ZmContact.F_department,ZmContact.F_company,ZmContact.F_fileAs,ZmContact.F_folderId,ZmContact.F_notes];
ZmContact.URL_FIELDS=[ZmContact.F_homeURL,ZmContact.F_workURL,ZmContact.F_otherURL];
ZmContact.GAL_FIELDS=[ZmContact.GAL_MODIFY_TIMESTAMP,ZmContact.GAL_CREATE_TIMESTAMP,ZmContact.GAL_ZIMBRA_ID,ZmContact.GAL_OBJECT_CLASS,ZmContact.GAL_MAIL_FORWARD_ADDRESS,ZmContact.GAL_CAL_RES_TYPE,ZmContact.GAL_CAL_RES_LOC_NAME];
ZmContact.MYCARD_FIELDS=[ZmContact.MC_cardOwner,ZmContact.MC_homeCardMessage,ZmContact.MC_homePhotoURL,ZmContact.MC_workCardMessage,ZmContact.MC_workPhotoURL];
ZmContact.X_FIELDS=[ZmContact.X_firstLast,ZmContact.X_fullName,ZmContact.X_vcardXProps];
ZmContact.IGNORE_NORMALIZATION=[];
ZmContact.updateFieldConstants=function(){
ZmContact.DISPLAY_FIELDS=[].concat(ZmContact.ADDRESS_FIELDS,ZmContact.EMAIL_FIELDS,ZmContact.IM_FIELDS,ZmContact.OTHER_FIELDS,ZmContact.PHONE_FIELDS,ZmContact.PRIMARY_FIELDS,ZmContact.URL_FIELDS);
ZmContact.IGNORE_FIELDS=[].concat(ZmContact.GAL_FIELDS,ZmContact.MYCARD_FIELDS,ZmContact.X_FIELDS);
ZmContact.ALL_FIELDS=[].concat(ZmContact.DISPLAY_FIELDS,ZmContact.IGNORE_FIELDS);
ZmContact.IS_DATE={};
ZmContact.IS_DATE[ZmContact.F_birthday]=true;
ZmContact.IS_DATE[ZmContact.F_anniversary]=true;
ZmContact.IS_IGNORE={};
for(var e=0;
e<ZmContact.IGNORE_FIELDS.length;
e++){
ZmContact.IS_IGNORE[ZmContact.IGNORE_FIELDS[e]]=true
}};
ZmContact.updateFieldConstants();
ZmContact.IS_ADDONE={};
ZmContact.IS_ADDONE[ZmContact.F_custom]=true;
ZmContact.IS_ADDONE[ZmContact.F_imAddress]=true;
ZmContact.getAttributeName=function(t,e){
e=e||1;
return e>1||ZmContact.IS_ADDONE[t]?t+e:t
};
ZmContact.prototype.toString=function(){
return"ZmContact"
};
ZmContact.createFromDom=function(a,t){
var e=appCtxt.cacheGet(a.id);
if(e==null||(e&&e.rev!=a.rev)){
e=new ZmContact(a.id,t.list);
e._loadFromDom(a)
}else{
if(!AjxUtil.hashCompare(a._attrs,e.attr)){
e.attr=a._attrs
}
e.list=t.list||new ZmContactList(null)
}
return e
};
ZmContact.compareByFileAs=function(o,e){
var t=(o instanceof ZmContact)?o.getFileAs(true):ZmContact.computeFileAs(o._attrs).toLowerCase();
var n=(e instanceof ZmContact)?e.getFileAs(true):ZmContact.computeFileAs(e._attrs).toLowerCase();
if(!n||(t>n)){
return 1
}
if(t<n){
return -1
}
return 0
};
ZmContact.computeFileAs=function(a){
var t=(a instanceof ZmContact)?a.getAttrs():a;
if(!t){
return
}
var s=parseInt(t.fileAs);
var n;
var e=0;
switch(s){
case ZmContact.FA_LAST_C_FIRST:default:if(a&&a.isGal){
if(t.fullName){
return(t.fullName instanceof Array)?t.fullName[0]:t.fullName
}
return((t.email instanceof Array)?t.email[0]:t.email)
}
n=ZmContact.fileAsLastFirst(t.firstName,t.lastName,t.fullName,t.nickname);
break;
case ZmContact.FA_FIRST_LAST:n=ZmContact.fileAsFirstLast(t.firstName,t.lastName,t.fullName,t.nickname);
break;
case ZmContact.FA_COMPANY:if(t.company){
n=t.company
}
break;
case ZmContact.FA_LAST_C_FIRST_COMPANY:var o=ZmContact.fileAsLastFirst(t.firstName,t.lastName,t.fullName,t.nickname);
n=ZmContact.fileAsNameCompany(o,t.company);
break;
case ZmContact.FA_FIRST_LAST_COMPANY:var o=ZmContact.fileAsFirstLast(t.firstName,t.lastName,t.fullName,t.nickname);
n=ZmContact.fileAsNameCompany(o,t.company);
break;
case ZmContact.FA_COMPANY_LAST_C_FIRST:var o=ZmContact.fileAsLastFirst(t.firstName,t.lastName);
n=ZmContact.fileAsCompanyName(o,t.company);
break;
case ZmContact.FA_COMPANY_FIRST_LAST:var o=ZmContact.fileAsFirstLast(t.firstName,t.lastName);
n=ZmContact.fileAsCompanyName(o,t.company);
break;
case ZmContact.FA_CUSTOM:return t.fileAs.substring(2);
break
}
return n||t.fullName||""
};
ZmContact.fileAsFirstLast=function(o,a,t,e){
if(o&&a){
return AjxMessageFormat.format(ZmMsg.fileAsFirstLast,[o,a])
}
return o||a||t||e||""
};
ZmContact.fileAsLastFirst=function(o,a,t,e){
if(o&&a){
return AjxMessageFormat.format(ZmMsg.fileAsLastFirst,[o,a])
}
return o||a||t||e||""
};
ZmContact.fileAsNameCompany=function(t,e){
if(t&&e){
return AjxMessageFormat.format(ZmMsg.fileAsNameCompany,[t,e])
}
if(e){
return AjxMessageFormat.format(ZmMsg.fileAsCompanyAsSecondaryOnly,[e])
}
return t
};
ZmContact.fileAsCompanyName=function(t,e){
if(e&&t){
return AjxMessageFormat.format(ZmMsg.fileAsCompanyName,[t,e])
}
if(t){
return AjxMessageFormat.format(ZmMsg.fileAsNameAsSecondaryOnly,[t])
}
return e
};
ZmContact.computeCustomFileAs=function(e){
return[ZmContact.FA_CUSTOM,":",e].join("")
};
ZmContact.getAttr=function(t,e){
return(t instanceof ZmContact)?t.getAttr(e):(t&&t._attrs)?t._attrs[e]:null
};
ZmContact.getNormalizedAttrs=function(d,s,h){
var r={};
if(d){
var l=AjxUtil.keys(d);
l.sort(ZmContact.__BY_ATTRIBUTE);
var c={};
for(var o=0;
o<l.length;
o++){
var e=l[o];
var t=e.replace(/\d+$/,"");
if(s&&s!=t){
continue
}
if(AjxUtil.isArray(h)&&AjxUtil.indexOf(h,t)!=-1){
r[e]=d[e]
}else{
if(!c[t]){
c[t]=0
}
var n=ZmContact.getAttributeName(t,++c[t]);
r[n]=d[e]
}}}
return r
};
ZmContact.__RE_ATTRIBUTE=/^(.*?)(\d+)$/;
ZmContact.__BY_ATTRIBUTE=function(t,e){
var o=t.match(ZmContact.__RE_ATTRIBUTE)||[t,t,1];
var n=e.match(ZmContact.__RE_ATTRIBUTE)||[e,e,1];
return o[1]==n[1]?Number(o[2])-Number(n[2]):o[1].localeCompare(n[1])
};
ZmContact.setAttr=function(t,e,a){
if(t instanceof ZmContact){
t.setAttr(e,a)
}else{
t._attrs[e]=a
}};
ZmContact.isInTrash=function(e){
var t=(e instanceof ZmContact)?e.folderId:e.l;
var a=appCtxt.getById(t);
return(a&&a.isInTrash())
};
ZmContact.prototype.load=function(s,t,e){
var n={
GetContactsRequest:{
_jsns:"urn:zimbraMail"}};
var a=n.GetContactsRequest;
a.cn=[{
id:this.id}
];
var o=new AjxCallback(this,this._handleLoadResponse,[s]);
if(e){
var n={
GetContactsRequest:{
_jsns:"urn:zimbraMail"}};
n.GetContactsRequest.cn={
id:this.id};
e.addRequestParams(n,o,t)
}else{
appCtxt.getAppController().sendRequest({
jsonObj:n,asyncMode:true,callback:o,errorCallback:t}
)
}};
ZmContact.prototype._handleLoadResponse=function(a,e){
var t=e.getResponse().GetContactsResponse;
this.attr=t.cn[0]._attrs;
this.isLoaded=true;
if(a){
a.run(t.cn[0],this)
}};
ZmContact.prototype.clear=function(){};
ZmContact.prototype.isEmpty=function(){
for(var e in this.attr){
return false
}
return true
};
ZmContact.prototype.isShared=function(){
return this.addrbook&&this.addrbook.link
};
ZmContact.prototype.isReadOnly=function(){
if(this.isGal){
return true
}
return this.isShared()?this.addrbook&&this.addrbook.isReadOnly():false
};
ZmContact.prototype.isGroup=function(){
return Boolean(this.getAttr(ZmContact.F_dlist)||this.type==ZmItem.GROUP)
};
ZmContact.prototype.getGroupMembers=function(){
return this.isGroup()?AjxEmailAddress.parseEmailString(this.getAttr(ZmContact.F_dlist)):null
};
ZmContact.prototype.getIcon=function(){
if(this.isGal){
return"GALContact"
}
if(this.isShared()){
return"SharedContact"
}
if(this.isGroup()){
return"Group"
}
return"Contact"
};
ZmContact.prototype.getFolderId=function(){
return this.isShared()?this.folderId.split(":")[0]:this.folderId
};
ZmContact.prototype.getAttr=function(e){
var t=this.attr[e];
return t?((t instanceof Array)?t[0]:t):""
};
ZmContact.prototype.setAttr=function(e,t){
this.attr[e]=t
};
ZmContact.prototype.setParticipantStatus=function(e){
this.participantStatus=e
};
ZmContact.prototype.getParticipantStatus=function(){
return this.participantStatus
};
ZmContact.prototype.setParticipantRole=function(e){
this.participantRole=e
};
ZmContact.prototype.getParticipantRole=function(){
return this.participantRole
};
ZmContact.prototype.removeAttr=function(e){
delete this.attr[e]
};
ZmContact.prototype.getAttrs=function(a){
var t=this.attr;
if(a){
t={};
for(var e in this.attr){
if(e.replace(/\d+$/,"")==a){
t[e]=this.attr[e]
}}}
return t
};
ZmContact.prototype.getNormalizedAttrs=function(e){
return ZmContact.getNormalizedAttrs(this.attr,e,ZmContact.IGNORE_NORMALIZATION)
};
ZmContact.prototype.create=function(s,o){
var l={
CreateContactRequest:{
_jsns:"urn:zimbraMail"}};
var n=l.CreateContactRequest;
var r=n.cn={};
var a=s[ZmContact.F_folderId]||ZmFolder.ID_CONTACTS;
var t=appCtxt.getById(a);
if(t&&t.isRemote()){
a=t.getRemoteId()
}
r.l=a;
r.a=[];
for(var e in s){
if(e==ZmContact.F_folderId||e=="objectClass"||e=="zimbraId"||e=="createTimeStamp"||e=="modifyTimeStamp"){
continue
}
this._addRequestAttr(r,e,s[e])
}
var h=new AjxCallback(this,this._handleResponseCreate,[s,o!=null]);
if(o){
o.addRequestParams(l,h)
}else{
appCtxt.getAppController().sendRequest({
jsonObj:l,asyncMode:true,callback:h}
)
}};
ZmContact.prototype._handleResponseCreate=function(t,n,e){
if(n){
return
}
var h=e.getResponse().CreateContactResponse;
cn=h?h.cn[0]:null;
var l=cn?cn.id:null;
if(l){
this._fileAs=null;
this._fullName=null;
this.id=l;
this.modified=cn.md;
this.folderId=cn.l||ZmOrganizer.ID_ADDRBOOK;
for(var o in t){
if(!(t[o]==undefined||t[o]=="")){
this.setAttr(o,t[o])
}}
var r=this.isGroup()?ZmMsg.groupCreated:ZmMsg.contactCreated;
appCtxt.getAppController().setStatusMsg(r)
}else{
var r=this.isGroup()?ZmMsg.errorCreateGroup:ZmMsg.errorCreateContact;
var s=ZmMsg.errorTryAgain+"\n"+ZmMsg.errorContact;
appCtxt.getAppController().setStatusMsg(r,ZmStatusView.LEVEL_CRITICAL,s)
}};
ZmContact.prototype.createFromVCard=function(t,e){
var n={
CreateContactRequest:{
_jsns:"urn:zimbraMail"}};
var o=n.CreateContactRequest.cn={
l:ZmFolder.ID_CONTACTS};
o.vcard={
mid:t,part:e};
var a={
jsonObj:n,asyncMode:true,callback:(new AjxCallback(this,this._handleResponseCreateVCard)),errorCallback:(new AjxCallback(this,this._handleErrorCreateVCard))};
appCtxt.getAppController().sendRequest(a)
};
ZmContact.prototype._handleResponseCreateVCard=function(e){
appCtxt.getAppController().setStatusMsg(ZmMsg.contactCreated)
};
ZmContact.prototype._handleErrorCreateVCard=function(e){
appCtxt.getAppController().setStatusMsg(ZmMsg.errorCreateContact,ZmStatusView.LEVEL_CRITICAL)
};
ZmContact.prototype.modify=function(r,d){
if(this.list.isGal){
return
}
var m={
ModifyContactRequest:{
_jsns:"urn:zimbraMail",replace:"0",force:"1"}};
var l=m.ModifyContactRequest.cn={
id:this.id};
l.a=[];
var t=false;
for(var e in r){
if(e==ZmContact.F_folderId){
continue
}
this._addRequestAttr(l,e,(r[e]&&r[e].value)||r[e]);
t=true
}
if(ZmContact.F_firstName in r||ZmContact.F_lastName in r||ZmContact.F_company in r){
var s={};
var n=[ZmContact.F_firstName,ZmContact.F_lastName,ZmContact.F_company,ZmContact.X_fileAs];
for(var o=0;
o<n.length;
o++){
var h=n[o];
var c=r[h];
s[h]=c!=null?c:this.getAttr(h)
}
var a=ZmContact.computeFileAs(s);
this._addRequestAttr(l,ZmContact.X_fullName,a)
}
if(t){
var u=new AjxCallback(this,this._handleResponseModify,[r,d]);
appCtxt.getAppController().sendRequest({
jsonObj:m,asyncMode:true,callback:u}
)
}else{
if(r[ZmContact.F_folderId]){
this._setFolder(r[ZmContact.F_folderId])
}}};
ZmContact.prototype._handleResponseModify=function(t,r,e){
var o=e.getResponse().ModifyContactResponse;
var s=o?o.cn[0]:null;
var n=s?s.id:null;
if(n&&n==this.id){
appCtxt.setStatusMsg(this.isGroup()?ZmMsg.groupSaved:ZmMsg.contactSaved);
if(t[ZmContact.F_folderId]&&this.folderId!=t[ZmContact.F_folderId]){
this._setFolder(t[ZmContact.F_folderId])
}}else{
var a=ZmMsg.errorTryAgain+"\n"+ZmMsg.errorContact;
appCtxt.getAppController().setStatusMsg(ZmMsg.errorModifyContact,ZmStatusView.LEVEL_CRITICAL,a)
}};
ZmContact.prototype._handleResponseMove=function(e,o){
var a=e&&appCtxt.getById(e);
var t=1;
if(a){
appCtxt.setStatusMsg(AjxMessageFormat.format(ZmMsg.actionMove,[t,AjxMessageFormat.format(ZmMsg[ZmItem.COUNT_KEY[ZmItem.CONTACT]],t),a.name]))
}
this._notify(ZmEvent.E_MODIFY,o)
};
ZmContact.prototype._setFolder=function(a){
var o=appCtxt.getById(this.folderId);
var e=o?o.nId:null;
if(e==a){
return
}
var n=appCtxt.getById(a);
if(this.isShared()||(n&&n.link)){
if(this.list){
this.list.moveItems({
items:[this],folder:n}
)
}}else{
var r={
ContactActionRequest:{
_jsns:"urn:zimbraMail"}};
r.ContactActionRequest.action={
id:this.id,op:"move",l:a};
var s=new AjxCallback(this,this._handleResponseMove,[a]);
var t=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount.name;
appCtxt.getAppController().sendRequest({
jsonObj:r,asyncMode:true,callback:s,accountName:t}
)
}};
ZmContact.prototype.notifyModify=function(h,o){
var u=ZmItem.prototype.notifyModify.apply(this,arguments);
var n=window.parentAppCtxt||window.appCtxt;
n.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT);
if(u){
return u
}
var r=this.getFileAs();
var l=this.getFullName();
this._resetCachedFields();
var s={};
if(h._attrs){
var t=this.getAttrs();
for(var d in t){
s[d]=t[d];
if(h._attrs[d]==null){
this.removeAttr(d)
}}
for(var d in h._attrs){
this.setAttr(d,h._attrs[d])
}}
var e={
attr:h._attrs,oldAttr:s,fullNameChanged:(this.getFullName()!=l),fileAsChanged:(this.getFileAs()!=r),contact:this};
this.list.modifyLocal(h,e);
this._notify(ZmEvent.E_MODIFY,h);
var c=this.getBuddy();
if(c){
c._notifySetName(c.name)
}};
ZmContact.prototype.notifyDelete=function(){
ZmItem.prototype.notifyDelete.call(this);
var e=window.parentAppCtxt||window.appCtxt;
e.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT)
};
ZmContact.prototype.initFromEmail=function(e,t){
if(e instanceof AjxEmailAddress){
this.setAttr(ZmContact.F_email,e.getAddress());
this._initFullName(e,t)
}else{
this.setAttr(ZmContact.F_email,e)
}};
ZmContact.prototype.initFromPhone=function(e,t){
this.setAttr(t||ZmContact.F_companyPhone,e)
};
ZmContact.prototype.getEmail=function(){
return(this.getAttr(ZmContact.F_email)||this.getAttr(ZmContact.F_workEmail1)||this.getAttr(ZmContact.F_email2)||this.getAttr(ZmContact.F_workEmail2)||this.getAttr(ZmContact.F_email3)||this.getAttr(ZmContact.F_workEmail3))
};
ZmContact.prototype.getIMAddress=function(){
return this.getAttr(ZmContact.F_imAddress1)||this.getAttr(ZmContact.F_imAddress2)||this.getAttr(ZmContact.F_imAddress3)
};
ZmContact.prototype.getBuddy=function(){
var e;
if(appCtxt.get(ZmSetting.IM_ENABLED)&&ZmImApp.loggedIn()){
var t=AjxDispatcher.run("GetRoster");
e=t.getRosterItem(this.getAttr(ZmContact.F_email),false)||t.getRosterItem(this.getAttr(ZmContact.F_email2),false)||t.getRosterItem(this.getAttr(ZmContact.F_email3),false)||t.getRosterItem(this.getIMAddress(),true)
}
return e
};
ZmContact.prototype.getImPresence=function(){
var e=this.getBuddy();
return(e)?e.getPresence():null
};
ZmContact.prototype.getEmails=function(){
var s=[];
var a=this.getAttrs();
for(var t=0;
t<ZmContact.EMAIL_FIELDS.length;
t++){
var n=ZmContact.EMAIL_FIELDS[t];
for(var o=1;
true;
o++){
var e=ZmContact.getAttributeName(n,o);
if(!a[e]){
break
}
s.push(a[e])
}}
return s
};
ZmContact.prototype.getFullName=function(){
if(!this._fullName){
var e=this.getAttr(ZmContact.X_fullName);
if(e){
this._fullName=(e instanceof Array)?e[0]:e
}else{
var r=[];
var h=0;
var o=this.getAttr(ZmContact.F_namePrefix);
var a=this.getAttr(ZmContact.F_firstName);
var d=this.getAttr(ZmContact.F_middleName);
var t=this.getAttr(ZmContact.F_maidenName);
var l=this.getAttr(ZmContact.F_lastName);
var c=this.getAttr(ZmContact.F_nameSuffix);
var s=ZmMsg.fullname;
if(c){
s=t?ZmMsg.fullnameMaidenSuffix:ZmMsg.fullnameSuffix
}else{
if(t){
s=ZmMsg.fullnameMaiden
}}
var n=[o,a,d,t,l,c];
this._fullName=AjxStringUtil.trim(AjxMessageFormat.format(s,n),true)
}}
if(!this._fullName){
this._fullName=this.getFileAs()
}
return this._fullName
};
ZmContact.prototype.getToolTip=function(e,o,a){
var t={
contact:this,entryTitle:this.getFileAs(),hint:a,buddy:this.getBuddy()};
return(AjxTemplate.expand("abook.Contacts#Tooltip",t))
};
ZmContact.prototype.getFileAs=function(e){
if(!this._fileAs){
this._fileAs=ZmContact.computeFileAs(this);
this._fileAsLC=this._fileAs?this._fileAs.toLowerCase():null
}
if(e&&!this._fileAsLC){
this._fileAsLC=this._fileAs.toLowerCase()
}
return e?this._fileAsLC:this._fileAs
};
ZmContact.prototype.getHeader=function(){
return this.id?this.getFileAs():ZmMsg.newContact
};
ZmContact.prototype.getImageUrl=function(){
var e=this.getAttr(ZmContact.F_image);
if(!e||!e.part){
return null
}
var t=appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI);
return[t,"&id=",this.id,"&part=",e.part,"&t=",(new Date()).getTime()].join("")
};
ZmContact.prototype.getCompanyField=function(){
var t=this.getAttrs();
if(t==null){
return null
}
var a=parseInt(t.fileAs);
var o=[];
var e=0;
if(a==ZmContact.FA_LAST_C_FIRST||a==ZmContact.FA_FIRST_LAST){
if(t.jobTitle){
o[e++]=t.jobTitle;
if(t.company){
o[e++]=", "
}}
if(t.company){
o[e++]=t.company
}}else{
if(a==ZmContact.FA_COMPANY){
if(t.lastName){
o[e++]=t.lastName;
if(t.firstName){
o[e++]=", "
}}
if(t.firstName){
o[e++]=t.firstName
}
if(t.jobTitle){
o[e++]=" ("+t.jobTitle+")"
}}else{
if(t.jobTitle){
o[e++]=t.jobTitle;
if(t.company&&(t.fileAs==null||a==ZmContact.FA_LAST_C_FIRST||a==ZmContact.FA_FIRST_LAST)){
o[e++]=", "
}}
if(t.company&&(t.fileAs==null||a==ZmContact.FA_LAST_C_FIRST||a==ZmContact.FA_FIRST_LAST)){
o[e++]=t.company
}}}
if(o.length==0){
return null
}
return o.join("")
};
ZmContact.prototype.getWorkAddrField=function(e){
var t=this.getAttrs();
return this._getAddressField(t.workStreet,t.workCity,t.workState,t.workPostalCode,t.workCountry)
};
ZmContact.prototype.getHomeAddrField=function(e){
var t=this.getAttrs();
return this._getAddressField(t.homeStreet,t.homeCity,t.homeState,t.homePostalCode,t.homeCountry)
};
ZmContact.prototype.getOtherAddrField=function(e){
var t=this.getAttrs();
return this._getAddressField(t.otherStreet,t.otherCity,t.otherState,t.otherPostalCode,t.otherCountry)
};
ZmContact.prototype.getAddressBook=function(){
if(!this.addrbook){
this.addrbook=appCtxt.getById(this.folderId)
}
return this.addrbook
};
ZmContact.prototype._getAddressField=function(r,s,o,a,n){
if(r==null&&s==null&&o==null&&a==null&&n==null){
return null
}
var t=[];
var e=0;
if(r){
t[e++]=r;
if(s||o||a){
t[e++]="\n"
}}
if(s){
t[e++]=s;
if(o){
t[e++]=", "
}else{
if(a){
t[e++]=" "
}}}
if(o){
t[e++]=o;
if(a){
t[e++]=" "
}}
if(a){
t[e++]=a
}
if(n){
t[e++]="\n"+n
}
return t.join("")
};
ZmContact.prototype._initFullName=function(t,o){
var e=t.getName();
e=AjxStringUtil.trim(e.replace(AjxEmailAddress.commentPat,""));
if(e&&e.length){
this._setFullName(e,[" "])
}else{
if(!o){
e=t.getAddress();
if(e&&e.length){
var a=e.indexOf("@");
if(a==-1){
return
}
e=e.substr(0,a);
this._setFullName(e,[".","_"])
}}}};
ZmContact.prototype._setFullName=function(n,o){
var a=o[0];
for(var e=0;
e<o.length;
e++){
if(n.indexOf(o[e])!=-1){
a=o[e];
break
}}
var t=n.split(a,3);
this.setAttr(ZmContact.F_firstName,t[0]);
if(t.length==2){
this.setAttr(ZmContact.F_lastName,t[1])
}else{
if(t.length==3){
this.setAttr(ZmContact.F_middleName,t[1]);
this.setAttr(ZmContact.F_lastName,t[2])
}}};
ZmContact.prototype._addRequestAttr=function(n,t,o){
var e={
n:t};
if(t==ZmContact.F_image&&AjxUtil.isString(o)&&o.length){
if(o.indexOf("aid_")!=-1){
e.aid=o.substring(4)
}else{
e.part=o.substring(5)
}}else{
e._content=o||""
}
if(o instanceof Array){
if(!n._attrs){
n._attrs={}
}
n._attrs[t]=o||""
}else{
if(!n.a){
n.a=[]
}
n.a.push(e)
}};
ZmContact.prototype._resetCachedFields=function(){
this._fileAs=this._fileAsLC=this._fullName=null
};
ZmContact.prototype._loadFromDom=function(t){
this.isLoaded=true;
this.rev=t.rev;
this.sf=t.sf||t._attrs.sf;
this.folderId=t.l;
this.created=t.cd;
this.modified=t.md;
this.attr=t._attrs||{};
if(t.email){
this.attr[ZmContact.F_email]=t.email
}
if(t.email2){
this.attr[ZmContact.F_email2]=t.email2
}
if(t.email3){
this.attr[ZmContact.F_email3]=t.email3
}
this.type=(this.attr[ZmContact.F_dlist]!=null)?ZmItem.GROUP:ZmItem.CONTACT;
var e=window.parentAppCtxt||window.appCtxt;
this.addrbook=e.getById(this.folderId);
if(!this.isShared()){
this._parseFlags(t.f);
this._parseTags(t.t)
}else{
this.isLoaded=false
}
this._fileAs=ZmContact.computeFileAs(this)
};
ZmContact.prototype.getAttendeeText=function(n,o){
var r="";
var a=this.getFullName();
var t=this.getEmail();
if(o||(n&&n!=ZmCalBaseItem.PERSON)){
r=a||t||""
}else{
var s=new AjxEmailAddress(t,null,a);
r=s.toString()
}
return r
};
ZmContact.prototype.getUnknownFields=function(t){
var r=ZmContact.__FIELD_MAP;
if(!r){
r=ZmContact.__FIELD_MAP={};
for(var n=0;
n<ZmContact.DISPLAY_FIELDS;
n++){
r[ZmContact.DISPLAY_FIELDS[n]]=true
}}
var e=[];
var o=this.getAttrs();
for(var a in o){
var s=a.replace(/\d+$/,"");
if(r[a]){
continue
}
e.push(s)
}
return this.getFields(e,t)
};
ZmContact.prototype.getFields=function(a,c){
var s;
var h=this.getAttrs();
for(var o=0;
o<a.length;
o++){
for(var t=1;
true;
t++){
var n=ZmContact.getAttributeName(a[o],t);
if(!h[n]){
break
}
if(!s){
s={}
}
s[n]=h[n]
}}
if(c&&s){
var l=AjxUtil.keys(s);
l.sort(c);
var e={};
for(var t=0;
t<l;
t++){
var r=l[t];
e[r]=a[r]
}
s=e
}
return s
};
ZmContact._AB_FIELD={
firstName:ZmMsg.AB_FIELD_firstName,lastName:ZmMsg.AB_FIELD_lastName,middleName:ZmMsg.AB_FIELD_middleName,fullName:ZmMsg.AB_FIELD_fullName,jobTitle:ZmMsg.AB_FIELD_jobTitle,company:ZmMsg.AB_FIELD_company,email:ZmMsg.AB_FIELD_email,email2:ZmMsg.AB_FIELD_email2,email3:ZmMsg.AB_FIELD_email3,imAddress1:ZmMsg.AB_FIELD_imAddress1,imAddress2:ZmMsg.AB_FIELD_imAddress2,imAddress3:ZmMsg.AB_FIELD_imAddress3,image:ZmMsg.AB_FIELD_image,attachment:ZmMsg.AB_FIELD_attachment,workStreet:ZmMsg.AB_FIELD_street,workCity:ZmMsg.AB_FIELD_city,workState:ZmMsg.AB_FIELD_state,workPostalCode:ZmMsg.AB_FIELD_postalCode,workCountry:ZmMsg.AB_FIELD_country,workURL:ZmMsg.AB_FIELD_URL,workPhone:ZmMsg.AB_FIELD_workPhone,workPhone2:ZmMsg.AB_FIELD_workPhone2,workFax:ZmMsg.AB_FIELD_workFax,assistantPhone:ZmMsg.AB_FIELD_assistantPhone,companyPhone:ZmMsg.AB_FIELD_companyPhone,callbackPhone:ZmMsg.AB_FIELD_callbackPhone,homeStreet:ZmMsg.AB_FIELD_street,homeCity:ZmMsg.AB_FIELD_city,homeState:ZmMsg.AB_FIELD_state,homePostalCode:ZmMsg.AB_FIELD_postalCode,homeCountry:ZmMsg.AB_FIELD_country,homeURL:ZmMsg.AB_FIELD_URL,homePhone:ZmMsg.AB_FIELD_homePhone,homePhone2:ZmMsg.AB_FIELD_homePhone2,homeFax:ZmMsg.AB_FIELD_homeFax,mobilePhone:ZmMsg.AB_FIELD_mobilePhone,pager:ZmMsg.AB_FIELD_pager,carPhone:ZmMsg.AB_FIELD_carPhone,otherStreet:ZmMsg.AB_FIELD_street,otherCity:ZmMsg.AB_FIELD_city,otherState:ZmMsg.AB_FIELD_state,otherPostalCode:ZmMsg.AB_FIELD_postalCode,otherCountry:ZmMsg.AB_FIELD_country,otherURL:ZmMsg.AB_FIELD_URL,otherPhone:ZmMsg.AB_FIELD_otherPhone,otherFax:ZmMsg.AB_FIELD_otherFax,notes:ZmMsg.notes,birthday:ZmMsg.AB_FIELD_birthday};
ZmContact._AB_FILE_AS={
1:ZmMsg.AB_FILE_AS_lastFirst,2:ZmMsg.AB_FILE_AS_firstLast,3:ZmMsg.AB_FILE_AS_company,4:ZmMsg.AB_FILE_AS_lastFirstCompany,5:ZmMsg.AB_FILE_AS_firstLastCompany,6:ZmMsg.AB_FILE_AS_companyLastFirst,7:ZmMsg.AB_FILE_AS_companyFirstLast}
}}
if(AjxPackage.define("zimbraMail.abook.model.ZmContactList")){
ZmContactList=function(e,a,t){
if(arguments.length==0){
return
}
t=t||ZmItem.CONTACT;
ZmList.call(this,t,e);
this.isGal=(a===true);
this.isCanonical=false;
this.isLoaded=false;
this._app=appCtxt.getApp(ZmApp.CONTACTS);
this._emailToContact=this._app._byEmail;
this._imAddressToContact=this._app._byIM;
this._phoneToContact=this._app._byPhone
};
ZmContactList.prototype=new ZmList;
ZmContactList.prototype.constructor=ZmContactList;
ZmContactList.URL="/Contacts?fmt=cf&t=2&all";
ZmContactList.CONTACT_SPLIT_CHAR="\u001E";
ZmContactList.FIELD_SPLIT_CHAR="\u001D";
ZmContactList.IS_CONTACT_FIELD={
id:true,l:true,d:true,fileAsStr:true,rev:true};
ZmContactList.prototype.toString=function(){
return"ZmContactList"
};
ZmContactList.prototype.addLoadedCallback=function(e){
if(this.isLoaded){
e.run();
return
}
if(!this._loadedCallbacks){
this._loadedCallbacks=[]
}
this._loadedCallbacks.push(e)
};
ZmContactList.prototype._finishLoading=function(){
this.isLoaded=true;
if(this._loadedCallbacks){
var e;
while(e=this._loadedCallbacks.shift()){
e.run()
}}};
ZmContactList.prototype.load=function(n,e,t){
this.isCanonical=true;
var o=new AjxCallback(this,this._handleResponseLoad,[n]);
var a={
asyncMode:true,noBusyOverlay:true,callback:o,errorCallback:e};
a.restUri=AjxUtil.formatUrl({
path:["/home/",(t||appCtxt.getUsername()),ZmContactList.URL].join(""),qsReset:true}
);
appCtxt.getAppController().sendRequest(a)
};
ZmContactList.prototype._handleResponseLoad=function(h,d){
var l=d.getResponse();
if(l){
var c=l.split(ZmContactList.CONTACT_SPLIT_CHAR);
for(var a=0,n=c.length;
a<n;
a++){
var o=c[a].split(ZmContactList.FIELD_SPLIT_CHAR);
var s={}
,r={};
for(var t=0,e=o.length;
t<e;
t+=2){
if(ZmContactList.IS_CONTACT_FIELD[o[t]]){
s[o[t]]=o[t+1]
}else{
r[o[t]]=o[t+1]
}}
s._attrs=r;
this._addContact(s)
}}
this._finishLoading();
if(h){
h.run()
}};
ZmContactList.prototype.add=function(t,e){
if(!t.id||!this._idHash[t.id]){
this._vector.add(t,e);
if(t.id){
this._idHash[t.id]=t
}}};
ZmContactList.prototype.cache=function(h,t){
var n=function(){
return this.id
};
var o=function(l){
return this._vector.containsLike(l,n)
};
var r=t.sub(o,this);
this.getVector().merge(h,r);
var s=r.getArray();
for(var e=0;
e<s.length;
e++){
var a=s[e];
a.list=this;
if(a.id){
this._idHash[a.id]=a
}}};
ZmContactList.prototype._addContact=function(e){
e.list=this;
this._updateHashes(e,true);
var t=[],a=[];
if(e._attrs[ZmContact.F_firstName]){
t.push(e._attrs[ZmContact.F_firstName])
}
if(e._attrs[ZmContact.F_middleName]){
t.push(e._attrs[ZmContact.F_middleName])
}
if(e._attrs[ZmContact.F_lastName]){
t.push(e._attrs[ZmContact.F_lastName])
}
if(t.length){
e._attrs[ZmContact.X_fullName]=t.join(" ")
}
if(e._attrs[ZmContact.F_firstName]){
a.push(e._attrs[ZmContact.F_firstName])
}
if(e._attrs[ZmContact.F_lastName]){
a.push(e._attrs[ZmContact.F_lastName])
}
e._attrs[ZmContact.X_firstLast]=a.join(" ");
this.add(e)
};
ZmContactList.prototype._realizeContact=function(contact,idx){
if(contact instanceof ZmContact){
return contact
}
var args={
list:this};
var obj=eval(ZmList.ITEM_CLASS[this.type]);
var realContact=obj&&obj.createFromDom(contact,args);
if(this.isCanonical){
var a=this.getArray();
idx=idx||this._getIndexById(contact.id);
a[idx]=realContact;
this._updateHashes(realContact,true);
this._idHash[contact.id]=realContact
}
return realContact
};
ZmContactList.prototype._getIndexById=function(o){
var e=this.getArray();
for(var t=0;
t<e.length;
t++){
if(e[t].id==o){
return t
}}
return null
};
ZmContactList.prototype.getSubList=function(r,s,o){
if(o&&this.isCanonical){
var d=[];
var l=this.getArray();
var e=0;
this.setHasMore(false);
for(var h=0;
h<l.length;
h++){
l[h]=this._realizeContact(l[h],h);
var t=appCtxt.getById(l[h].folderId);
if(t&&t.nId==ZmOrganizer.normalizeId(o)){
if(e>=r){
if(d.length==s){
this.setHasMore(true);
break
}
d.push(l[h])
}
e++
}}
return AjxVector.fromArray(d)
}else{
var n=ZmList.prototype.getSubList.call(this,r,s);
if(n){
var c=n.getArray();
for(var h=0;
h<c.length;
h++){
c[h]=this._realizeContact(c[h],r+h)
}}
return n
}};
ZmContactList.prototype.getById=function(t){
if(!t||!this.isCanonical){
return null
}
var e=this._idHash[t];
return e?this._realizeContact(e):null
};
ZmContactList.prototype.getContactByEmail=function(t){
if(!t||!this.isCanonical){
return null
}
var e=this._emailToContact[t.toLowerCase()];
if(e){
e=this._realizeContact(e);
e._lookupEmail=t;
return e
}else{
return null
}};
ZmContactList.prototype.getContactByIMAddress=function(t){
var e=this._imAddressToContact[t.toLowerCase()];
return e?this._realizeContact(e):null
};
ZmContactList.prototype.getContactByPhone=function(e){
if(!e||!this.isCanonical){
return null
}
var a=this._getPhoneDigits(e);
var t=this._phoneToContact[a];
if(t){
t.contact=this._realizeContact(t.contact);
return t
}else{
return null
}};
ZmContactList.prototype.moveItems=function(e){
e=Dwt.getParams(arguments,["items","folder","attrs","outOfTrash"]);
e.items=AjxUtil.toArray(e.items);
var r=new ZmBatchCommand(true,null,true);
var n=new ZmBatchCommand(true,null,true);
var t=[];
var c=[];
if(e.items[0]&&e.items[0] instanceof ZmItem){
for(var a=0;
a<e.items.length;
a++){
var s=e.items[a];
if(s.isReadOnly()){
continue
}
if(s.isShared()||e.folder.link){
c.push(s);
if(s.isLoaded){
r.add(this._getCopyCmd(s,e.folder))
}else{
s.load(null,null);
r.add(this._getCopyCmd(s,e.folder))
}}else{
t.push(s)
}}}else{
t=e.items
}
if(c.length>0){
if(n.size()){
var l=new AjxCallback(this,this._handleResponseLoadMove,[r,c]);
n.run(l)
}else{
var h={
items:c,action:"delete",actionText:ZmMsg.actionMove,actionArg:e.folder.getName(false,false,true)};
var o=new AjxCallback(this,this._itemAction,[h]);
r.add(o);
var l=new AjxCallback(this,this._handleResponseMoveBatchCmd);
r.run(l)
}}
if(t.length>0){
var h=AjxUtil.hashCopy(e);
h.attrs=e.attrs||{};
h.attrs.l=e.folder.id;
h.action="move";
h.accountName=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount.name;
if(h.folder.id==ZmFolder.ID_TRASH){
if(t.length>1){
h.actionText=ZmMsg.actionTrash
}
h.accountName=appCtxt.multiAccounts&&e.items[0].getAccount().name
}else{
h.actionText=ZmMsg.actionMove;
h.actionArg=e.folder.getName(false,false,true)
}
h.callback=e.outOfTrash&&new AjxCallback(this,this._handleResponseMoveItems,e);
this._itemAction(h)
}};
ZmContactList.prototype._handleResponseMoveBatchCmd=function(t){
var n=t.getResponse().BatchResponse.ContactActionResponse;
var o=n[0].action.id.split(",");
for(var a=0;
a<o.length;
a++){
var e=appCtxt.cacheGet(o[a]);
if(e&&e.isShared()){
e.notifyDelete();
appCtxt.cacheRemove(o[a])
}}};
ZmContactList.prototype._handleResponseLoadMove=function(t,a){
var e=new AjxCallback(this,this._itemAction,[{
items:a,action:"delete"}
]);
t.add(e);
var o=new AjxCallback(this,this._handleResponseMoveBatchCmd);
t.run(o)
};
ZmContactList.prototype._handleResponseBatchLoad=function(a,o,t,e){
a.add(this._getCopyCmd(e,o))
};
ZmContactList.prototype._getCopyCmd=function(e,o){
var t=new ZmContact(null,this);
for(var a in e.attr){
t.attr[a]=e.attr[a]
}
t.attr[ZmContact.F_folderId]=o.id;
return new AjxCallback(t,t.create,[t.attr])
};
ZmContactList.prototype.deleteItems=function(e){
if(this.isGal){
return
}
ZmList.prototype.deleteItems.call(this,e)
};
ZmContactList.prototype.setIsGal=function(e){
this.isGal=e
};
ZmContactList.prototype.notifyCreate=function(node){
var obj=eval(ZmList.ITEM_CLASS[this.type]);
if(obj){
var item=obj.createFromDom(node,{
list:this}
);
var index=this._sortIndex(item);
var listSize=this.size();
var visible=false;
if(index<listSize||listSize==0||(index==listSize&&!this._hasMore)){
this.add(item,index);
this.createLocal(item);
visible=true
}
this._notify(ZmEvent.E_CREATE,{
items:[item],sortIndex:index,visible:visible}
)
}};
ZmContactList.prototype.moveLocal=function(t,e){
if(!this.isCanonical){
ZmList.prototype.moveLocal.call(this,t,e)
}
if(e==ZmFolder.ID_TRASH){
for(var a=0;
a<t.length;
a++){
this._updateHashes(t[a],false)
}}};
ZmContactList.prototype.deleteLocal=function(e){
ZmList.prototype.deleteLocal.call(this,e);
for(var t=0;
t<e.length;
t++){
this._updateHashes(e[t],false)
}};
ZmContactList.prototype.modifyLocal=function(n,o){
if(o){
o.items=[n];
this._notify(ZmEvent.E_MODIFY,o)
}
var e=o.contact;
if(this.isCanonical){
var s=new ZmContact(null,this);
s.id=o.contact.id;
s.attr=o.oldAttr;
this._updateHashes(s,false);
this._updateHashes(e,true)
}
if(o.fileAsChanged){
this.remove(e);
var t=this._sortIndex(e);
var a=this.size();
if(t<a||a==0||(t==a&&!this._hasMore)){
this.add(e,t)
}}
if(e.addrbook&&(e.addrbook.id!=e.folderId)){
e.addrbook=appCtxt.getById(e.folderId)
}};
ZmContactList.prototype.createLocal=function(e){
this._updateHashes(e,true)
};
ZmContactList.prototype._updateHashes=function(t,r){
this._app.updateCache(t,r);
for(var o=0;
o<ZmContact.EMAIL_FIELDS.length;
o++){
var h=ZmContact.EMAIL_FIELDS[o];
for(var n=1;
true;
n++){
var a=ZmContact.getAttributeName(h,n);
var e=ZmContact.getAttr(t,a);
if(!e){
break
}
if(r){
this._emailToContact[e.toLowerCase()]=t
}else{
delete this._emailToContact[e.toLowerCase()]
}}}
if(appCtxt.get(ZmSetting.VOICE_ENABLED)){
for(var o=0;
o<ZmContact.PHONE_FIELDS.length;
o++){
var h=ZmContact.PHONE_FIELDS[o];
for(var n=1;
true;
n++){
var a=ZmContact.getAttributeName(h,n);
var e=ZmContact.getAttr(t,a);
if(!e){
break
}
var s=this._getPhoneDigits(e);
if(s){
if(r){
this._phoneToContact[e]={
contact:t,field:a}
}else{
delete this._phoneToContact[e]
}}}}}
if(appCtxt.get(ZmSetting.IM_ENABLED)){
for(var o=0;
o<ZmContact.IM_FIELDS.length;
o++){
var h=ZmContact.IM_FIELDS[o];
for(var n=1;
true;
n++){
var a=ZmContact.getAttributeName(h,n);
var e=ZmContact.getAttr(t,a);
if(!e){
break
}
if(r){
this._imAddressToContact[e.toLowerCase()]=t
}else{
delete this._imAddressToContact[e.toLowerCase()]
}}}}};
ZmContactList.prototype._getPhoneDigits=function(e){
return e.replace(/[^\d]/g,"")
};
ZmContactList.prototype._sortIndex=function(e){
var t=this._vector.getArray();
for(var o=0;
o<t.length;
o++){
if(ZmContact.compareByFileAs(t[o],e)>0){
return o
}}
return t.length
};
ZmContactList.prototype._handleResponseModifyItem=function(t,e){}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmContactsHelper")){
ZmContactsHelper=function(){};
ZmContactsHelper.search=function(a){
var t=a.obj;
if(t._searchButton){
t._searchButton.setEnabled(false)
}
a.sortBy=a.ascending?ZmSearch.NAME_ASC:ZmSearch.NAME_DESC;
a.types=AjxVector.fromArray([ZmItem.CONTACT]);
a.offset=a.offset||0;
a.limit=ZmContactsApp.SEARCHFOR_MAX;
a.contactSource=t._contactSource;
a.field="contact";
var e=new ZmSearch(a);
e.execute({
callback:a.respCallback,errorCallback:a.errorCallback}
)
};
ZmContactsHelper._processSearchResponse=function(t){
var e=t.getResults(ZmItem.CONTACT);
var l=[];
var c=e.getArray();
for(var s=0;
s<c.length;
s++){
var h=c[s];
if(h.isGroup()){
var n=h.getGroupMembers().good.toString(AjxEmailAddress.SEPARATOR);
ZmContactsHelper._addContactToList(l,h,n,true)
}else{
var r=h.isGal?[h.getEmail()]:h.getEmails();
for(var o=0;
o<r.length;
o++){
ZmContactsHelper._addContactToList(l,h,r[o])
}}}
return l
};
ZmContactsHelper._addContactToList=function(a,e,n,o){
var t=new AjxEmailAddress(n,null,e.getFileAs(),null,o);
t.id=Dwt.getNextId();
t.__contact=e;
t.icon=e.getIcon();
a.push(t)
};
ZmContactsHelper._getEmailField=function(t,e,a,o,n){
if(o==ZmItem.F_TYPE){
t[e++]=AjxImg.getImageHtml(a.icon)
}else{
if(o==ZmItem.F_NAME){
t[e++]="<nobr>";
t[e++]=a.name;
t[e++]="</nobr>"
}else{
if(o==ZmItem.F_EMAIL){
t[e++]=AjxStringUtil.htmlEncode(a.address)
}}}
return e
}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmContactPicker")){
ZmContactPicker=function(e){
DwtDialog.call(this,{
parent:appCtxt.getShell(),title:ZmMsg.selectAddresses}
);
this._buttonInfo=e;
this._initialized=false;
this._offset=0;
this._defaultQuery=".";
this._list=new AjxVector();
this._searchErrorCallback=new AjxCallback(this,this._handleErrorSearch)
};
ZmContactPicker.prototype=new DwtDialog;
ZmContactPicker.prototype.constructor=ZmContactPicker;
ZmContactPicker.CHOOSER_HEIGHT=300;
ZmContactPicker.prototype.toString=function(){
return"ZmContactPicker"
};
ZmContactPicker.prototype.popup=function(a,t,n,o){
if(!this._initialized){
this._initialize(o);
this._initialized=true
}else{
if(appCtxt.multiAccounts&&this._account!=o){
this._account=o;
this._resetSelectDiv()
}}
this._offset=0;
var e=this._selectDiv?this._selectDiv.getValue():ZmContactsApp.SEARCHFOR_CONTACTS;
this._chooser.sourceListView.setSortByAsc(ZmItem.F_NAME,true);
this._chooser.reset();
if(a){
this._chooser._setActiveButton(a)
}
if(t){
for(var s in t){
this._chooser.addItems(t[s],DwtChooserListView.TARGET,true,s)
}}
this._searchField.disabled=false;
this._searchField.focus();
if(n){
this._searchField.className="";
this._searchField.value=n;
this._searchCleared=true
}else{
this._searchField.className="searchFieldHint";
this._searchField.value=ZmMsg.contactPickerHint;
this._searchCleared=false
}
this._prevButton.setEnabled(false);
this._nextButton.setEnabled(false);
this.search(null,null,true);
DwtDialog.prototype.popup.call(this)
};
ZmContactPicker.prototype.popdown=function(){
this._searchField.disabled=true;
this._contactSource=null;
this._list.removeAll();
DwtDialog.prototype.popdown.call(this)
};
ZmContactPicker.prototype.search=function(r,o,e,a,s){
if(!AjxUtil.isSpecified(o)){
o=true
}
var h=this._searchCleared?AjxStringUtil.trim(this._searchField.value):"";
if(!h.length){
h=this._defaultQuery
}
var l;
if(this._selectDiv){
var t=this._selectDiv.getValue();
this._contactSource=(t==ZmContactsApp.SEARCHFOR_CONTACTS||t==ZmContactsApp.SEARCHFOR_PAS)?ZmItem.CONTACT:ZmId.SEARCH_GAL;
if(t==ZmContactsApp.SEARCHFOR_PAS){
l=ZmSearchController.generateQueryForShares([ZmId.ITEM_CONTACT])||"is:local"
}else{
if(t==ZmContactsApp.SEARCHFOR_CONTACTS){
l="is:local"
}else{
if(t==ZmContactsApp.SEARCHFOR_GAL){
o=true
}}}}else{
this._contactSource=appCtxt.get(ZmSetting.CONTACTS_ENABLED,null,this._account)?ZmItem.CONTACT:ZmId.SEARCH_GAL;
if(this._contactSource==ZmItem.CONTACT){
l="is:local"
}}
this._searchIcon.className="DwtWait16Icon";
this._chooser.sourceListView.sortingEnabled=(this._contactSource==ZmItem.CONTACT);
var n={
obj:this,ascending:o,query:h,queryHint:l,offset:this._list.size(),lastId:a,lastSortVal:s,respCallback:(new AjxCallback(this,this._handleResponseSearch,[e])),errorCallback:this._searchErrorCallback,accountName:(this._account&&this._account.name)};
ZmContactsHelper.search(n)
};
ZmContactPicker.prototype._contentHtml=function(o){
var n;
if(appCtxt.multiAccounts){
var a=appCtxt.accountList.visibleAccounts;
for(var t=0;
t<a.length;
t++){
var o=a[t];
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED,null,o)&&(appCtxt.get(ZmSetting.GAL_ENABLED,null,o)||appCtxt.get(ZmSetting.SHARING_ENABLED,null,o))){
n=true;
break
}}}else{
n=(appCtxt.get(ZmSetting.CONTACTS_ENABLED)&&(appCtxt.get(ZmSetting.GAL_ENABLED)||appCtxt.get(ZmSetting.SHARING_ENABLED)))
}
var e={
id:this._htmlElId,showSelect:n};
return(AjxTemplate.expand("abook.Contacts#ZmContactPicker",e))
};
ZmContactPicker.prototype._resetSelectDiv=function(){
this._selectDiv.clearOptions();
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED,null,this._account)){
this._selectDiv.addOption(ZmMsg.contacts,false,ZmContactsApp.SEARCHFOR_CONTACTS);
if(appCtxt.get(ZmSetting.SHARING_ENABLED,null,this._account)){
this._selectDiv.addOption(ZmMsg.searchPersonalSharedContacts,false,ZmContactsApp.SEARCHFOR_PAS)
}}
if(appCtxt.get(ZmSetting.GAL_ENABLED,null,this._account)){
this._selectDiv.addOption(ZmMsg.GAL,true,ZmContactsApp.SEARCHFOR_GAL)
}
if(!appCtxt.get(ZmSetting.INITIALLY_SEARCH_GAL,null,this._account)||!appCtxt.get(ZmSetting.GAL_ENABLED,null,this._account)){
this._selectDiv.setSelectedValue(ZmContactsApp.SEARCHFOR_CONTACTS)
}};
ZmContactPicker.prototype._initialize=function(o){
this.setContent(this._contentHtml(o));
this._searchIcon=document.getElementById(this._htmlElId+"_searchIcon");
this._searchButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_searchButton")}
);
this._searchButton.setText(ZmMsg.search);
this._searchButton.addSelectionListener(new AjxListener(this,this._searchButtonListener));
var e=this._htmlElId+"_listSelect";
var n=document.getElementById(e);
if(n){
this._selectDiv=new DwtSelect({
parent:this,parentElement:e}
);
this._resetSelectDiv();
this._selectDiv.addChangeListener(new AjxListener(this,this._searchTypeListener))
}else{
this.setSize("600")
}
this._chooser=new ZmContactChooser({
parent:this,buttonInfo:this._buttonInfo}
);
this._chooser.reparentHtmlElement(this._htmlElId+"_chooser");
this._chooser.resize(this.getSize().x-25,ZmContactPicker.CHOOSER_HEIGHT);
var t=new AjxListener(this,this._pageListener);
this._prevButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_pageLeft")}
);
this._prevButton.setText(ZmMsg.previous);
this._prevButton.setImage("LeftArrow");
this._prevButton.addSelectionListener(t);
this._nextButton=new DwtButton({
parent:this,style:DwtLabel.IMAGE_RIGHT,parentElement:(this._htmlElId+"_pageRight")}
);
this._nextButton.setText(ZmMsg.next);
this._nextButton.setImage("RightArrow");
this._nextButton.addSelectionListener(t);
var a=document.getElementById(this._htmlElId+"_paging");
if(a){
Dwt.setSize(a,this._chooser.sourceListView.getSize().x)
}
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._okButtonListener));
this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,this._cancelButtonListener));
this._searchField=document.getElementById(this._htmlElId+"_searchField");
Dwt.setHandler(this._searchField,DwtEvent.ONKEYUP,ZmContactPicker._keyPressHdlr);
Dwt.setHandler(this._searchField,DwtEvent.ONCLICK,ZmContactPicker._onclickHdlr);
this._keyPressCallback=new AjxCallback(this,this._searchButtonListener)
};
ZmContactPicker.prototype._searchButtonListener=function(e){
this._offset=0;
this._list.removeAll();
this.search()
};
ZmContactPicker.prototype._handleResponseSearch=function(e,m){
var o=m.getResponse();
var u=o.getAttribute("more");
var n=o.getAttribute("offset");
var s=AjxUtil.isSpecified(n);
var a=o.getAttribute("info");
var r=a&&a[0].wildcard[0].expanded=="0";
if(!e&&!s&&(r||(this._contactSource==ZmId.SEARCH_GAL&&u))){
var c=appCtxt.getMsgDialog();
c.setMessage(ZmMsg.errorSearchNotExpanded);
c.popup();
if(r){
return
}}
var h=AjxVector.fromArray(ZmContactsHelper._processSearchResponse(o));
if(s){
this._list.merge(n,h);
this._list.hasMore=u
}else{
this._list=h
}
if(h.size()==0&&e){
this._chooser.sourceListView._setNoResultsHtml()
}
if(((this._list.size()-this._offset)<ZmContactsApp.SEARCHFOR_MAX)&&u){
var t=o.getResults(ZmItem.CONTACT);
var l=(t.size()>0)?t.getVector().getLast():null;
if(l){
if(l.__contact){
lastId=l.__contact.id;
lastSortVal=l.__contact.sf
}else{
lastId=l.id;
lastSortVal=l.sf
}}
if(!lastSortVal&&s){
this._searchIcon.className="ImgSearch";
return
}else{
if(!lastSortVal&&!s){
this._showResults(s,u,this.getSubList())
}else{
this.search(null,null,null,lastId,lastSortVal)
}}}else{
h=this.getSubList();
if(!h){
this._offset-=ZmContactsApp.SEARCHFOR_MAX;
if(this._offset<0){
this._offset=0
}
h=this.getSubList()
}
if(!u){
u=(this._offset+ZmContactsApp.SEARCHFOR_MAX)<this._list.size()
}
this._showResults(s,u,h)
}};
ZmContactPicker.prototype._showResults=function(a,e,t){
if(this._contactSource==ZmId.SEARCH_GAL&&!a){
this._prevButton.setEnabled(false);
this._nextButton.setEnabled(false)
}else{
this._prevButton.setEnabled(this._offset>0);
this._nextButton.setEnabled(e)
}
this._resetColHeaders();
this._chooser.setItems(t);
this._searchIcon.className="ImgSearch";
this._searchButton.setEnabled(true)
};
ZmContactPicker.prototype._handleErrorSearch=function(){
this._searchButton.setEnabled(true);
return false
};
ZmContactPicker.prototype._pageListener=function(o){
if(o.item==this._prevButton){
this._offset-=ZmContactsApp.SEARCHFOR_MAX;
if(this._offset<0){
this._offset=0
}
this._showResults(true,true,this.getSubList())
}else{
var s;
var e;
this._offset+=ZmContactsApp.SEARCHFOR_MAX;
var n=this.getSubList();
if(!n||((n.size()<ZmContactsApp.SEARCHFOR_MAX)&&this._list.hasMore)){
if(!n){
n=this._chooser.sourceListView.getList()
}
var t=(n.size()>0)?n.getLast():null;
if(t){
s=t.__contact.id;
e=t.__contact.sf
}
this.search(null,null,null,s,e)
}else{
var a=this._list.hasMore;
if(!a){
a=(this._offset+ZmContactsApp.SEARCHFOR_MAX)<this._list.size()
}
this._showResults(true,a,n)
}}};
ZmContactPicker.prototype.getSubList=function(){
var t=this._list.size();
var e=this._offset+ZmContactsApp.SEARCHFOR_MAX;
if(e>t){
e=t
}
return(this._offset<e)?(AjxVector.fromArray(this._list.getArray().slice(this._offset,e))):null
};
ZmContactPicker.prototype._searchTypeListener=function(t){
var e=t._args.oldValue;
var a=t._args.newValue;
if(e!=a){
this._searchButtonListener()
}};
ZmContactPicker.prototype._resetColHeaders=function(){
var e=this._chooser.sourceListView;
e.headerColCreated=false;
var t=0;
for(var a=0;
a<e._headerList.length;
a++){
if(e._headerList[a]._field==ZmItem.F_NAME){
t=a;
break
}}
var o=(this._selectDiv&&this._selectDiv.getValue()==ZmContactsApp.SEARCHFOR_GAL)?null:ZmItem.F_NAME;
e._headerList[t]._sortable=o;
e.createHeaderHtml(o)
};
ZmContactPicker.prototype._okButtonListener=function(e){
var t=this._chooser.getItems();
DwtDialog.prototype._buttonListener.call(this,e,[t])
};
ZmContactPicker.prototype._cancelButtonListener=function(e){
DwtDialog.prototype._buttonListener.call(this,e);
this.popdown()
};
ZmContactPicker._keyPressHdlr=function(a){
var t=DwtControl.getTargetControl(a);
var e=DwtKeyEvent.getCharCode(a);
if(!t._searchCleared){
t._searchField.className=t._searchField.value="";
t._searchCleared=true
}
if(t._keyPressCallback&&(e==13||e==3)){
t._keyPressCallback.run();
return false
}
return true
};
ZmContactPicker._onclickHdlr=function(t){
var e=DwtControl.getTargetControl(t);
if(!e._searchCleared){
e._searchField.className=e._searchField.value="";
e._searchCleared=true
}};
ZmContactChooser=function(e){
DwtChooser.call(this,e)
};
ZmContactChooser.prototype=new DwtChooser;
ZmContactChooser.prototype.constructor=ZmContactChooser;
ZmContactChooser.prototype._createSourceListView=function(){
return new ZmContactChooserSourceListView(this)
};
ZmContactChooser.prototype._createTargetListView=function(){
return new ZmContactChooserTargetListView(this,(this._buttonInfo.length>1))
};
ZmContactChooser.prototype._isDuplicate=function(e,t){
return t.containsLike(e,e.getAddress)
};
ZmContactChooserSourceListView=function(e){
DwtChooserListView.call(this,{
parent:e,type:DwtChooserListView.SOURCE,view:ZmId.VIEW_CONTACT_SRC}
);
this.setScrollStyle(Dwt.CLIP)
};
ZmContactChooserSourceListView.prototype=new DwtChooserListView;
ZmContactChooserSourceListView.prototype.constructor=ZmContactChooserSourceListView;
ZmContactChooserSourceListView.prototype.toString=function(){
return"ZmContactChooserSourceListView"
};
ZmContactChooserSourceListView.prototype._getHeaderList=function(){
var e=[];
e.push(new DwtListHeaderItem({
field:ZmItem.F_TYPE,icon:"Folder",width:ZmMsg.COLUMN_WIDTH_FOLDER_CN}
));
e.push(new DwtListHeaderItem({
field:ZmItem.F_NAME,text:ZmMsg._name,width:ZmMsg.COLUMN_WIDTH_NAME_CN}
));
e.push(new DwtListHeaderItem({
field:ZmItem.F_EMAIL,text:ZmMsg.email}
));
return e
};
ZmContactChooserSourceListView.prototype._mouseOverAction=function(o,s){
DwtChooserListView.prototype._mouseOverAction.call(this,o,s);
var n=o.target.id||s.id;
var a=this.getItemFromElement(s);
if(n&&a){
var e=a.__contact;
if(e){
var t=e.getToolTip(a.address,e.isGal);
this.setToolTipContent(t)
}else{
this.setToolTipContent(a.address)
}}else{
this.setToolTipContent(null)
}
return true
};
ZmContactChooserSourceListView.prototype._getCellContents=function(t,e,a,o,s,n){
return ZmContactsHelper._getEmailField(t,e,a,o,s,n)
};
ZmContactChooserTargetListView=function(e,t){
this._showType=t;
DwtChooserListView.call(this,{
parent:e,type:DwtChooserListView.TARGET,view:ZmId.VIEW_CONTACT_TGT}
);
this.setScrollStyle(Dwt.CLIP)
};
ZmContactChooserTargetListView.prototype=new DwtChooserListView;
ZmContactChooserTargetListView.prototype.constructor=ZmContactChooserTargetListView;
ZmContactChooserTargetListView.prototype.toString=function(){
return"ZmContactChooserTargetListView"
};
ZmContactChooserTargetListView.prototype._getHeaderList=function(){
var t=[];
var e=this._view;
if(this._showType){
t.push(new DwtListHeaderItem({
field:ZmItem.F_TYPE,icon:"ContactsPicker",width:ZmMsg.COLUMN_WIDTH_TYPE_CN}
))
}
t.push(new DwtListHeaderItem({
field:ZmItem.F_NAME,text:ZmMsg._name,width:ZmMsg.COLUMN_WIDTH_NAME_CN}
));
t.push(new DwtListHeaderItem({
field:ZmItem.F_EMAIL,text:ZmMsg.email}
));
return t
};
ZmContactChooserTargetListView.prototype._mouseOverAction=ZmContactChooserSourceListView.prototype._mouseOverAction;
ZmContactChooserTargetListView.prototype._getCellContents=function(t,e,a,o,s,n){
if(o==ZmItem.F_TYPE){
a.setType(a._buttonId);
t[e++]=ZmMsg[a.getTypeAsString()];
t[e++]=":"
}else{
e=ZmContactsHelper._getEmailField(t,e,a,o,s)
}
return e
}
}}
if(AjxPackage.define("abook.Contacts")){
AjxTemplate.register("abook.Contacts#ZmEditContactView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<div id="';
e[a++]=n.id;
e[a++]="_DEBUG\"></div><table valign=top width='100%' cellspacing=0><tr valign=top class=contactHeaderTable><td class=contactHeaderCell><div id=\"";
e[a++]=n.id;
e[a++]='_IMAGE" tabindex="100"></div><div id="';
e[a++]=n.id;
e[a++]="_REMOVE_IMAGE_row\" style='padding-left:7px;font-size:.8em'><nobr><a id=\"";
e[a++]=n.id;
e[a++]='_VIEW_IMAGE" href="#view" tabindex="101">';
e[a++]=ZmMsg.view;
e[a++]="</a>\n";
e[a++]="\t\t\t\t\t\t|\n";
e[a++]='\t\t\t\t\t\t<a id="';
e[a++]=n.id;
e[a++]='_REMOVE_IMAGE" href="#remove" tabindex="102">';
e[a++]=ZmMsg.remove;
e[a++]="</a></nobr></div></td><td class=contactHeaderCell valign=bottom><div style='padding:.125em'><div id=\"";
e[a++]=n.id;
e[a++]='_FULLNAME"></div></div>';
if(appCtxt.get(ZmSetting.TAGGING_ENABLED)){
e[a++]='<div id="';
e[a++]=n.id;
e[a++]='_TAG"></div>'
}
e[a++]='<div id="';
e[a++]=n.id;
e[a++]="_NAME_row\" style='padding-bottom:4;'><table border=0 cellpadding=0 cellspacing=0><tr><td id=\"";
e[a++]=n.id;
e[a++]="_PREFIX_row\" style='padding-right:4;'><div id=\"";
e[a++]=n.id;
e[a++]='_PREFIX" tabindex="200"></div></td><td style=\'padding-right:4;\'><div id="';
e[a++]=n.id;
e[a++]='_FIRST" tabindex="201"></div></td><td id="';
e[a++]=n.id;
e[a++]="_MIDDLE_row\" style='padding-right:4;'><div id=\"";
e[a++]=n.id;
e[a++]='_MIDDLE" tabindex="202"></div></td><td id="';
e[a++]=n.id;
e[a++]="_MAIDEN_row\" style='padding-right:4;'><table border=0 cellspacing=0 cellpadding=0><td style='padding:0 2;'>(</td><td><div id=\"";
e[a++]=n.id;
e[a++]="_MAIDEN\" tabindex=\"203\"></div></td><td style='padding:0 2;'>)</td></table></td><td style='padding-right:4;'><div id=\"";
e[a++]=n.id;
e[a++]='_LAST" tabindex="204"></div></td><td id="';
e[a++]=n.id;
e[a++]="_SUFFIX_row\" style='padding-right:4;'><table border=0 cellspacing=0 cellpadding=0><td style='padding-right:4;'>,</td><td><div id=\"";
e[a++]=n.id;
e[a++]='_SUFFIX" tabindex="205"></div></td></table></td><td><div id="';
e[a++]=n.id;
e[a++]='_DETAILS" tabindex="206"></div></td></tr></table></div><div id="';
e[a++]=n.id;
e[a++]="_NICKNAME_row\" style='padding-bottom:4;'><table border=0 cellpadding=0 cellspacing=0><tr><td>&ldquo;</td><td><div id=\"";
e[a++]=n.id;
e[a++]='_NICKNAME" tabindex="250"></div></td><td>&rdquo;</td></tr></table></div><div id="';
e[a++]=n.id;
e[a++]="_JOB_row\" style='padding-bottom:4;'><table border=0 cellpadding=0 cellspacing=0><tr><td id=\"";
e[a++]=n.id;
e[a++]='_TITLE_row"><div id="';
e[a++]=n.id;
e[a++]='_TITLE" tabindex="301"></div></td><td id="';
e[a++]=n.id;
e[a++]='_TITLE_DEPARTMENT_SEP">&nbsp;-&nbsp;</td><td id="';
e[a++]=n.id;
e[a++]='_DEPARTMENT_row"><div id="';
e[a++]=n.id;
e[a++]='_DEPARTMENT" tabindex="302"></div></td></tr></table></div><div id="';
e[a++]=n.id;
e[a++]="_COMPANY_row\" style='padding-bottom:4;'><table border=0 cellpadding=0 cellspacing=0><tr><td><div id=\"";
e[a++]=n.id;
e[a++]='_COMPANY" tabindex="305"></div></td></tr></table></div></td><td class=contactHeaderCell><table><tr><td>';
e[a++]=ZmMsg.fileAsLabel;
e[a++]='</td><td><div id="';
e[a++]=n.id;
e[a++]='_FILE_AS" tabindex="400"></div></td></tr><tr><td>';
e[a++]=ZmMsg.locationLabel;
e[a++]='</td><td><div id="';
e[a++]=n.id;
e[a++]='_FOLDER" tabindex="401"></div></td></tr>';
if(appCtxt.multiAccounts){
e[a++]="<tr><td>";
e[a++]=ZmMsg.accountLabel;
e[a++]='</td><td><div id="';
e[a++]=n.id;
e[a++]='_ACCOUNT" tabindex="402"></div></td></tr>'
}
e[a++]="</table></td></tr><tr valign=top><td class=rowLabel>";
e[a++]=ZmMsg.emailLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_EMAIL" tabindex="500"></div></td></tr><tr valign=top><td class=rowLabel>';
e[a++]=ZmMsg.phoneLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_PHONE" tabindex="600"></div></td></tr><tr valign=top><td class=rowLabel>';
e[a++]=ZmMsg.imLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_IM" tabindex="700"></div></td></tr><tr valign=top><td class=rowLabel>';
e[a++]=ZmMsg.addressLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_ADDRESS" tabindex="800"></div></td></tr><tr valign=top><td class=rowLabel>';
e[a++]=ZmMsg.urlLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_URL" tabindex="900"></div></td></tr><tr valign=top><td class=rowLabel>';
e[a++]=ZmMsg.otherLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_OTHER" tabindex="1000"></div></td></tr><tr valign=top><td class=rowLabel>';
e[a++]=ZmMsg.notesLabel;
e[a++]='</td><td class=rowValue><div id="';
e[a++]=n.id;
e[a++]='_NOTES" tabindex="1100"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactView"}
,false);
AjxTemplate.register("abook.Contacts",AjxTemplate.getTemplate("abook.Contacts#ZmEditContactView"),AjxTemplate.getParams("abook.Contacts#ZmEditContactView"));
AjxTemplate.register("abook.Contacts#ZmEditContactViewRows",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<table border=0 cellspacing=0 cellpadding=0><tbody id="';
e[a++]=n.id;
e[a++]='_rows" tabindex="100"></tbody></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewRows"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewDetailsButton",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<span id="';
e[a++]=n.id;
e[a++]='_title" class="ZButtonBorder ZWidgetTitle"></span>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewDetailsButton"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewInputSelect",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='padding-right:3'><div id='";
e[a++]=n.id;
e[a++]="_input' tabindex=\"100\"></div></td><td><div id='";
e[a++]=n.id;
e[a++]='_select\' tabindex="200"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewInputSelect"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewInputDoubleSelect",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='padding-right:3'><div id='";
e[a++]=n.id;
e[a++]="_input' tabindex=\"100\"></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_select' tabindex=\"200\"></div></td><td><div id='";
e[a++]=n.id;
e[a++]='_select2\' tabindex="300"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewInputDoubleSelect"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewOther",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='padding-right:3'><div id='";
e[a++]=n.id;
e[a++]="_input' tabindex=\"100\"></div></td><td style='padding-right:3'><div id='";
e[a++]=n.id;
e[a++]="_picker' tabindex=\"200\"></div></td><td style='padding-left:14px'><div id='";
e[a++]=n.id;
e[a++]='_select\' tabindex="300"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewOther"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewAddressRow",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<table><tr id="';
e[a++]=n.id;
e[a++]='_row" class="DwtFormRow" valign=top><td><div id="';
e[a++]=n.id;
e[a++]='" tabindex="100"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_add" class="DwtFormRowAdd" tabindex="200"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_remove" class="DwtFormRowRemove" tabindex="300"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewAddressRow"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewAddressSelect",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr valign=top><td style='padding-right:3'><div id='";
e[a++]=n.id;
e[a++]="_input' tabindex=\"100\"></div></td><td><div id='";
e[a++]=n.id;
e[a++]='_select\' tabindex="200"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewAddressSelect"}
,false);
AjxTemplate.register("abook.Contacts#ZmEditContactViewAddress",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table style='position:relative;left:-3'><tr><td><div id=\"";
e[a++]=n.id;
e[a++]='_STREET" tabindex="100"></div></td></tr></table><table style=\'position:relative;left:-3\'><tr><td><div id="';
e[a++]=n.id;
e[a++]='_CITY" tabindex="200"></div></td><td>,&nbsp;</td><td><div id="';
e[a++]=n.id;
e[a++]='_STATE" tabindex="300"></div></td><td>&nbsp;&nbsp;</td><td><div id="';
e[a++]=n.id;
e[a++]='_ZIP" tabindex="400"></div></td></tr></table><table style=\'position:relative;left:-3\'><tr><td><div id="';
e[a++]=n.id;
e[a++]='_COUNTRY" tabindex="500"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmEditContactViewAddress","class":"DwtForm ZmEditContactViewAddress"}
,false);
AjxTemplate.register("abook.Contacts#CardsView",function(e,t,s,n){
var a=Boolean(n);
s=(typeof s=="string"?{
id:s}
:s)||{};
n=n||[];
var o=n.length;
n[o++]="<center><table border=0 cellpadding=5 cellspacing=5 id='";
n[o++]=s.cardTableId;
n[o++]="'>";
var l=0;
for(var r=0;
r<s.list.length;
r++){
var h=s.list[r];
if(l%2==0){
n[o++]="<tr>"
}
l++;
n[o++]="<td valign=top id='";
n[o++]=s.id;
n[o++]="_contact_";
n[o++]=h.id;
n[o++]="'></td>";
if(l%2==0){
n[o++]="</tr>"
}}
n[o++]="</table></center>";
return a?n.length:n.join("")
}
,{
id:"abook.Contacts#CardsView"}
,false);
AjxTemplate.register("abook.Contacts#CardsView-NoResults",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<center><div class='NoResults' id='";
e[a++]=n.id;
e[a++]="'><br><br>";
e[a++]=AjxMsg.noResults;
e[a++]="</div></center>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#CardsView-NoResults"}
,false);
AjxTemplate.register("abook.Contacts#CardBase",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div name='";
e[a++]=n.name;
e[a++]="' class='";
e[a++]=n.className;
e[a++]="' id='";
e[a++]=n.id;
e[a++]="' style='width:";
e[a++]=n.width;
e[a++]="'><table border=0 width=100% height=100% cellpadding=0 cellspacing=0><tr class='contactHeader ";
e[a++]=n.headerColor;
e[a++]="'><td width=16>";
e[a++]=AjxImg.getImageHtml(n.contact.getIcon(),"width:16");
e[a++]="</td><td width=100% valign=top><div class='contactHeader'>";
e[a++]=n.contact.getFileAs();
e[a++]="</div></td>";
if(n.tagCellId){
e[a++]="<td width=16 id='";
e[a++]=n.tagCellId;
e[a++]="'>";
e[a++]=n.tagIcon;
e[a++]="</td>"
}
e[a++]="</tr>";
if(n.contact.isGroup()){
e[a++]=AjxTemplate.expand("abook.Contacts#CardGroup",{
data:n}
)
}else{
e[a++]=AjxTemplate.expand("abook.Contacts#CardContact",{
data:n}
)
}
e[a++]="</table>\n";
e[a++]="\t\t";
e[a++]=n.imgHtml;
e[a++]="\n";
e[a++]="\t</div>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#CardBase"}
,false);
AjxTemplate.register("abook.Contacts#CardGroup",function(e,t,h,s){
var a=Boolean(s);
h=(typeof h=="string"?{
id:h}
:h)||{};
s=s||[];
var o=s.length;
var n=h.data.groupMembers;
var l=n.length;
var c=l<=5?l:Math.min(l,5);
s[o++]="<tr height=100%><td colspan=3 valign=top width=100% style='padding-left:2px'><table border=0>";
for(var r=0;
r<c;
r++){
s[o++]="<tr><td width=20>";
s[o++]=AjxImg.getImageHtml("Message");
s[o++]="</td><td><nobr>";
s[o++]=AjxStringUtil.htmlEncode(n[r].toString());
s[o++]="</nobr></td></tr>"
}
if(c<l){
s[o++]='<tr><td colspan=2><a href="javascript:;" onclick="ZmContactCardsView._moreDetailsCallback(\'';
s[o++]=h.data.contact.id;
s[o++]="'); return false\">";
s[o++]=ZmMsg.more;
s[o++]="</a></td></tr>"
}
s[o++]="</table></td></tr>";
return a?s.length:s.join("")
}
,{
id:"abook.Contacts#CardGroup"}
,false);
AjxTemplate.register("abook.Contacts#CardContact",function(a,h,r,t){
var s=Boolean(t);
r=(typeof r=="string"?{
id:r}
:r)||{};
t=t||[];
var n=t.length;
var o;
var e=r.data.contact;
t[n++]="<tr><td colspan=2 valign=top width=100% style='font-weight:bold; padding-left:2px'>";
t[n++]=e.getCompanyField()||"&nbsp;";
t[n++]="</td></tr><tr height=100%><td valign=top colspan=10><table height=100% border=0 cellpadding=1 cellspacing=1><tr height=100%><td valign=top><table border=0>";
if(o=e.getWorkAddrField()){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewW,value:o,type:ZmObjectManager.ADDRESS}
)
}else{
if(o=e.getHomeAddrField()){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewH,value:o,type:ZmObjectManager.ADDRESS}
)
}}
if(o=e.getAttr("email")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewE,value:o,type:ZmObjectManager.EMAIL}
)
}
if(o=e.getAttr("email2")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewE2,value:o,type:ZmObjectManager.EMAIL}
)
}else{
if(o=e.getAttr("email3")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewE3,value:o,type:ZmObjectManager.EMAIL}
)
}}
t[n++]="</table></td><td valign=top><table border=0>";
if(o=e.getAttr("workPhone")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewW,value:o,type:ZmObjectManager.PHONE}
)
}
if(o=e.getAttr("workPhone2")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewW2,value:o,type:ZmObjectManager.PHONE}
)
}
if(o=e.getAttr("workFax")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewF,value:o,type:ZmObjectManager.PHONE}
)
}
if(o=e.getAttr("mobilePhone")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewM,value:o,type:ZmObjectManager.PHONE}
)
}
if(o=e.getAttr("homePhone")){
t[n++]=AjxTemplate.expand("abook.Contacts#CardContactField",{
data:r,fname:ZmMsg.cardViewH,value:o,type:ZmObjectManager.PHONE}
)
}
t[n++]="</table></td></tr></table></td></tr>";
if(!e.isLoaded){
t[n++]='<tr><td colspan=10 class="FinishLoading" onclick="ZmContactCardsView._loadContact(this, \'';
t[n++]=e.id;
t[n++]="')\"><center>";
t[n++]=ZmMsg.finishLoading;
t[n++]="</center></td></tr>"
}
return s?t.length:t.join("")
}
,{
id:"abook.Contacts#CardContact"}
,false);
AjxTemplate.register("abook.Contacts#CardContactField",function(t,r,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
var s=n.data.data.isDnd?n.value:n.data.data.view._generateObject(n.value,n.type);
e[a++]="<tr><td valign=top class='ZmContactFieldValue'>";
e[a++]=n.fname;
e[a++]="</td><td valign=top class='ZmContactField'>";
e[a++]=AjxStringUtil.nl2br(s);
e[a++]="</td></tr>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#CardContactField"}
,false);
AjxTemplate.register("abook.Contacts#SplitView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=5 width=100% height=100%><col width=230></col><tr><td id='";
e[a++]=n.id;
e[a++]="_alphabetbar' colspan=2></td></tr><tr height=100%><td width=230 valign=top id='";
e[a++]=n.id;
e[a++]="_listview'></td><td valign=top id='";
e[a++]=n.id;
e[a++]="_contentCell' height=100%><div class='ZmContactInfoView' id='";
e[a++]=n.id;
e[a++]="_content'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#SplitView"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_content",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_header",n);
e[a++]="<table>";
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_emails",n);
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_phones",n);
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_ims",n);
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_addresses",n);
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_urls",n);
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_other",n);
e[a++]=AjxTemplate.expand("abook.Contacts#SplitView_notes",n);
e[a++]="</table>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#SplitView_content"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_header",function(e,t,r,n){
var a=Boolean(n);
r=(typeof r=="string"?{
id:r}
:r)||{};
n=n||[];
var o=n.length;
var l=r.contact;
var m=l.getImageUrl();
var h=l.getAttr(ZmContact.F_nickname);
var c=l.getAttr(ZmContact.F_company);
var u=l.getAttr(ZmContact.F_jobTitle);
var s=l.getAttr(ZmContact.F_department);
var f=l.getFullName();
var d=appCtxt.multiAccounts&&l.account&&l.account.getDisplayName();
n[o++]="<table border=0 cellspacing=2 cellpadding=2 width=100% class='contactHeaderTable ";
n[o++]=r.contactHdrClass;
n[o++]="'><tr>";
if(m){
n[o++]='<td valign=bottom width=48 rowspan=2><img src="';
n[o++]=m;
n[o++]='" \n';
n[o++]="\t\t\t\t";
if(AjxEnv.isIE){
n[o++]="\n";
n[o++]="\t\t\t\t\theight=48\n";
n[o++]="\t\t\t\t"
}else{
n[o++]="\n";
n[o++]='\t\t\t\t\tstyle="max-width:48px;max-height:48px"\n';
n[o++]="\t\t\t\t"
}
n[o++]="\n";
n[o++]="\t\t\t\t border=0></td>"
}else{
n[o++]="<td valign=bottom width=48 rowspan=2>";
n[o++]=AjxImg.getImageHtml("Person_48");
n[o++]="</td>"
}
n[o++]="<td id='";
n[o++]=r.id;
n[o++]="_tags' align='right' colspan=2></td></tr><tr><td valign=bottom><div class='contactHeader ";
n[o++]=r.isInTrash?"Trash":"";
n[o++]="'>";
n[o++]=AjxStringUtil.htmlEncode(f);
n[o++]="</div>";
if(h){
n[o++]="<div class='companyName'>&ldquo;";
n[o++]=AjxStringUtil.htmlEncode(h);
n[o++]="&rdquo;</div>"
}
if(u||s){
n[o++]="<div class='companyName'>";
if(u){
n[o++]="<span>";
n[o++]=AjxStringUtil.htmlEncode(u);
n[o++]="</span>"
}
if(s){
if(u){
n[o++]="\n";
n[o++]="\t\t\t\t\t\t\t&nbsp;-&nbsp;\n";
n[o++]="\t\t\t\t\t\t"
}
n[o++]="<span>";
n[o++]=AjxStringUtil.htmlEncode(s);
n[o++]="</span>"
}
n[o++]="</div>"
}
if(c){
n[o++]="<div class='companyName'>";
n[o++]=AjxStringUtil.htmlEncode(c);
n[o++]="</div>"
}
n[o++]="</td><td valign=bottom align='right'>";
if(d){
n[o++]="<table border=0 cellpadding=0 cellspacing=0 width=1%><tr><td class='contactLocation' nowrap=\"nowrap\">";
n[o++]=ZmMsg.accountLabel;
n[o++]="&nbsp;</td><td class='companyFolder' colspan=10>";
n[o++]=AjxStringUtil.htmlEncode(d);
n[o++]="</td></tr></table>"
}
n[o++]="<table border=0 cellpadding=0 cellspacing=0 width=1%><tr><td class='contactLocation' nowrap=\"nowrap\">";
n[o++]=ZmMsg.locationLabel;
n[o++]="&nbsp;</td>";
if(r.addrbook){
n[o++]="<td width=20>";
n[o++]=AjxImg.getImageHtml(r.addrbook.getIcon());
n[o++]="</td><td>&nbsp;</td><td class='companyFolder'>";
n[o++]=r.addrbook.getName();
n[o++]="</td>"
}else{
if(r.isGal){
n[o++]="<td width=20>";
n[o++]=AjxImg.getImageHtml("GAL");
n[o++]="</td><td>&nbsp;</td><td class='companyFolder'>";
n[o++]=ZmMsg.GAL;
n[o++]="</td>"
}}
n[o++]="</tr></table></td></tr></table>";
return a?n.length:n.join("")
}
,{
id:"abook.Contacts#SplitView_header"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_emails",function(e,t,h,s){
var o=Boolean(s);
h=(typeof h=="string"?{
id:h}
:h)||{};
s=s||[];
var n=s.length;
var a={
id:h.id,attrs:h.attrs,seenone:false,findObjects:h.findObjects,objectType:ZmObjectManager.EMAIL,label:ZmMsg.emailLabel};
var l=ZmEditContactView.LISTS.EMAIL.attrs;
a.names=l;
for(var r=0;
r<l.length;
r++){
a.name=l[r];
a.type=ZmMsg["AB_FIELD_"+l[r]];
s[n++]=AjxTemplate.expand("#SplitView_item_list",a)
}
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitView_emails"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_phones",function(e,t,h,s){
var o=Boolean(s);
h=(typeof h=="string"?{
id:h}
:h)||{};
s=s||[];
var n=s.length;
var a={
id:h.id,attrs:h.attrs,seenone:false,findObjects:h.findObjects,objectType:ZmObjectManager.PHONE,label:ZmMsg.phoneLabel};
var l=ZmEditContactView.LISTS.PHONE.attrs;
a.names=l;
for(var r=0;
r<l.length;
r++){
a.name=l[r];
a.type=ZmMsg["AB_FIELD_"+l[r]];
s[n++]=AjxTemplate.expand("#SplitView_item_list",a)
}
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitView_phones"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_ims",function(e,t,h,s){
var o=Boolean(s);
h=(typeof h=="string"?{
id:h}
:h)||{};
s=s||[];
var n=s.length;
var a={
id:h.id,attrs:h.attrs,seenone:false,label:ZmMsg.imLabel};
if(AjxUtil.isFunction(h.encode.IM)){
a.encode=h.encode.IM
}
var l=ZmEditContactView.LISTS.IM.attrs;
a.names=l;
for(var r=0;
r<l.length;
r++){
a.name=l[r];
a.type=ZmMsg["AB_FIELD_"+l[r]];
s[n++]=AjxTemplate.expand("#SplitView_item_list",a)
}
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitView_ims"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_addresses",function(e,t,l,s){
var o=Boolean(s);
l=(typeof l=="string"?{
id:l}
:l)||{};
s=s||[];
var n=s.length;
var f=l.attrs;
var y={
id:l.id,attrs:f,seenone:false,label:ZmMsg.addressLabel};
var u={
work:ZmMsg.work,home:ZmMsg.home,other:ZmMsg.other};
var h=ZmEditContactView.ADDR_PREFIXES;
var g=ZmEditContactView.ADDR_SUFFIXES;
for(var r=0;
r<h.length;
r++){
var d=0;
var c=h[r];
y.type=u[c]||c;
while(true){
d++;
y.address=null;
for(var a=0;
a<g.length;
a++){
var p=g[a];
var e=[c,p,d>1?d:""].join("");
var m=f[e];
if(!m){
continue
}
if(!y.address){
y.address={}
}
y.address[p]=m.replace(/\n/g,"<br/>")
}
if(!y.address){
break
}
y.name=[c,"Address",d>1?d:""].join("");
s[n++]=AjxTemplate.expand("#SplitView_address_value",y);
y.seenone=true
}}
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitView_addresses"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_address_value",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
t[o++]="<tr valign=top><td class=rowLabel>";
t[o++]=s.seenone?"":s.label;
t[o++]="</td><td id='";
t[o++]=s.id;
t[o++]="_";
t[o++]=s.name;
t[o++]="' class=rowValue>";
var e=s.address;
if(e.Street){
t[o++]="<div>";
t[o++]=e.Street;
t[o++]="</div>"
}
if(e.City||e.State||e.PostalCode){
t[o++]="<div><span>";
t[o++]=e.City;
t[o++]="</span>";
if(e.City&&e.State){
t[o++]=", "
}
t[o++]="<span>";
t[o++]=e.State;
t[o++]="</span>";
if(e.City&&e.State){
t[o++]="&nbsp;"
}
t[o++]="<span>";
t[o++]=e.PostalCode;
t[o++]="</span></div>"
}
if(e.Country){
t[o++]="<div>";
t[o++]=e.Country;
t[o++]="</div>"
}
t[o++]="</td><td style='color:gray' class='rowType'>&nbsp;";
t[o++]=s.type;
t[o++]="</td></tr>";
return n?t.length:t.join("")
}
,{
id:"abook.Contacts#SplitView_address_value"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_urls",function(e,t,h,s){
var o=Boolean(s);
h=(typeof h=="string"?{
id:h}
:h)||{};
s=s||[];
var n=s.length;
var a={
id:h.id,attrs:h.attrs,seenone:false,findObjects:h.findObjects,objectType:ZmObjectManager.URL,label:ZmMsg.urlLabel};
var l={};
l[ZmContact.F_homeURL]=ZmMsg.home;
l[ZmContact.F_workURL]=ZmMsg.work;
l[ZmContact.F_otherURL]=ZmMsg.other;
var c=ZmEditContactView.LISTS.URL.attrs;
a.names=c;
for(var r=0;
r<c.length;
r++){
var e=c[r];
a.name=e;
a.type=l[e]||ZmMsg["AB_FIELD_"+e];
s[n++]=AjxTemplate.expand("#SplitView_item_list",a)
}
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitView_urls"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_other",function(e,o,u,l){
var r=Boolean(l);
u=(typeof u=="string"?{
id:u}
:u)||{};
l=l||[];
var h=l.length;
var n={
id:u.id,attrs:u.attrs,seenone:false,findObjects:u.findObjects,label:ZmMsg.otherLabel};
var p=ZmEditContactView.LISTS.OTHER.attrs;
n.names=p;
for(var d=0;
d<p.length;
d++){
var e=p[d];
n.name=e;
n.type=ZmMsg["AB_FIELD_"+p[d]];
l[h++]=AjxTemplate.expand("#SplitView_item_list",n)
}
var y={};
for(var g in n.attrs){
var f=g.replace(/\d+$/,"");
if(f in ZmContact.IS_IGNORE){
continue
}
y[f]=true
}
for(var t in ZmEditContactView.ATTRS){
delete y[ZmEditContactView.ATTRS[t]]
}
for(var t in ZmEditContactView.LISTS){
var m=ZmEditContactView.LISTS[t];
if(!m.attrs){
continue
}
for(var d=0;
d<m.attrs.length;
d++){
delete y[m.attrs[d]]
}}
var c=ZmEditContactView.ADDR_PREFIXES;
var b=ZmEditContactView.ADDR_SUFFIXES;
for(var d=0;
d<c.length;
d++){
for(var s=0;
s<b.length;
s++){
delete y[c[d]+b[s]]
}}
for(var g in y){
n.name=g;
n.type=AjxStringUtil.capitalizeWords(AjxStringUtil.fromMixed(g));
l[h++]=AjxTemplate.expand("#SplitView_item_list",n)
}
return r?l.length:l.join("")
}
,{
id:"abook.Contacts#SplitView_other"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_notes",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
var e={
id:s.id,attrs:s.attrs,encode:AjxStringUtil.nl2br,seenone:false,label:ZmMsg.notesLabel,name:ZmContact.F_notes,names:[ZmContact.F_notes]};
t[o++]=AjxTemplate.expand("#SplitView_item_list",e);
return n?t.length:t.join("")
}
,{
id:"abook.Contacts#SplitView_notes"}
,false);
AjxTemplate.register("abook.Contacts#SplitView_item_list",function(e,a,r,s){
var o=Boolean(s);
r=(typeof r=="string"?{
id:r}
:r)||{};
s=s||[];
var n=s.length;
var l=r.objectType==ZmObjectManager.EMAIL;
var h=0;
while(true){
var e=++h>1||ZmContact.IS_ADDONE[r.name]?r.name+h:r.name;
var u=r.attrs[e];
if(!u){
break
}
if(!l){
u=AjxStringUtil.htmlEncode(u)
}
if(ZmContact.IS_DATE[r.name]){
var t=ZmEditContactViewOther.parseDate(u);
if(t){
var c=t.getFullYear()!=0;
var d=c?AjxDateFormat.getDateInstance(AjxDateFormat.LONG):new AjxDateFormat(ZmMsg.formatDateLongNoYear);
u=d.format(t)
}}
if(r.findObjects){
u=r.findObjects(u,r.objectType)
}
if(r.encode){
u=r.encode(u)
}
s[n++]="<tr valign=top><td class=rowLabel>";
s[n++]=r.seenone?"":r.label;
s[n++]="</td><td id='";
s[n++]=r.id;
s[n++]="_";
s[n++]=e;
s[n++]="' ";
s[n++]=r.type?"":"colspan=2";
s[n++]=" class=rowValue>";
s[n++]=u;
s[n++]="</td>";
if(r.type){
s[n++]="<td style='color:gray' class='rowType'>&nbsp;";
s[n++]=r.type;
s[n++]="</td>"
}
s[n++]="</tr>";
r.seenone=true
}
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitView_item_list"}
,false);
AjxTemplate.register("abook.Contacts#SplitViewGroup",function(e,t,r,s){
var o=Boolean(s);
r=(typeof r=="string"?{
id:r}
:r)||{};
s=s||[];
var n=s.length;
s[n++]=AjxTemplate.expand("abook.Contacts#SplitView_header",r);
s[n++]="<table>";
var a={
id:r.id,name:"email",attrs:{}
,addone:false,seenone:false,findObjects:r.findObjects,objectType:ZmObjectManager.EMAIL,label:ZmMsg.emailLabel};
for(var h=0;
h<r.groupMembers.length;
h++){
var l=r.groupMembers[h];
a.attrs.email=l.getAddress();
a.type=l.getName()||l.getDispName();
s[n++]=AjxTemplate.expand("#SplitView_item_list",a)
}
s[n++]="</table>";
return o?s.length:s.join("")
}
,{
id:"abook.Contacts#SplitViewGroup"}
,false);
AjxTemplate.register("abook.Contacts#SimpleView-NoResults",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table width='100%' cellspacing=0 cellpadding=1><tr><td class='NoResults' valign='top' ><br/><br/>";
e[a++]=AjxMsg.noResults;
e[a++]="</td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#SimpleView-NoResults"}
,false);
AjxTemplate.register("abook.Contacts#GroupView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<!-- title bar --><table cellspacing=0 cellpadding=0 width=100%><tr class='contactHeaderRow' id='";
e[a++]=n.id;
e[a++]="_headerRow'><td width=20><center>";
e[a++]=AjxImg.getImageHtml("Group");
e[a++]="</center></td><td><div id='";
e[a++]=n.id;
e[a++]="_title' class='contactHeader'></div></td><td align='right' id='";
e[a++]=n.id;
e[a++]="_tags'></td></tr></table><table border=0 cellpadding=5 cellspacing=5 width=100% height=100%><tr><!-- content: left pane --><td width=50% valign=top><table border=0 cellpadding=2 cellspacing=2 width=100%><tr><td nowrap>*&nbsp;";
e[a++]=ZmMsg.groupNameLabel;
e[a++]="&nbsp;<input type='text' autocomplete='off' size=18 id='";
e[a++]=n.id;
e[a++]="_groupName'></td><td><table border=0 cellpadding=0 cellspacing=0><tr><td nowrap>";
e[a++]=ZmMsg.addressBookLabel;
e[a++]="&nbsp;</td><td id='";
e[a++]=n.id;
e[a++]="_folderSelect'></td></tr></table></td></tr><tr><td colspan='2' nowrap>*&nbsp;";
e[a++]=ZmMsg.groupMembers;
e[a++]="</td></tr></table><div class='groupMembers'  id='";
e[a++]=n.id;
e[a++]="_groupMembers'></div><table border=0 cellpadding=3 cellspacing=2 width=100%><tr><td id='";
e[a++]=n.id;
e[a++]="_delButton'></td><td id='";
e[a++]=n.id;
e[a++]="_delAllButton'></td><td width=100%></td></tr></table></td><!-- content: right pane --><td width=50% valign=top><fieldset><legend class='groupFieldset'>";
e[a++]=ZmMsg.addMembers;
e[a++]="</legend><table border=0><tr><td align=right>";
e[a++]=ZmMsg.findLabel;
e[a++]="</td><td><input type='text' id='";
e[a++]=n.id;
e[a++]="_searchField'></td><td id='";
e[a++]=n.id;
e[a++]="_searchButton'></td></tr>";
if(n.showSearchIn){
e[a++]="<tr><td align=right>";
e[a++]=ZmMsg.searchIn;
e[a++]="</td><td colspan=2 id='";
e[a++]=n.id;
e[a++]="_listSelect'></td></tr>"
}
e[a++]="</table><div class='groupMembers' id='";
e[a++]=n.id;
e[a++]="_listView'></div><table border=0 cellpadding=3 cellspacing=2 width=100%><tr><td id='";
e[a++]=n.id;
e[a++]="_addButton'></td><td id='";
e[a++]=n.id;
e[a++]="_addAllButton'></td><td width=100%></td><td id='";
e[a++]=n.id;
e[a++]="_prevButton'></td><td id='";
e[a++]=n.id;
e[a++]="_nextButton'></td></tr></table><table border=0 cellpadding=3 cellspacing=2 width=100%><tr><td>";
e[a++]=ZmMsg.enterAddrBelow;
e[a++]="</td></tr><tr><td><textarea class='groupMembers' id='";
e[a++]=n.id;
e[a++]="_addNewField'></textarea></td><td id='";
e[a++]=n.id;
e[a++]="_addNewButton'></td></tr></table></fieldset></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#GroupView"}
,false);
AjxTemplate.register("abook.Contacts#ZmAlphabetBar",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<center><table class='AlphabetBarTable' border=0 cellpadding=0 cellspacing=0 width=80% id='";
e[o++]=s.id;
e[o++]="_alphabet'><tr>";
for(var a=0;
a<s.numLetters;
a++){
e[o++]="<td _idx='";
e[o++]=a;
e[o++]="' onclick='ZmContactAlphabetBar.alphabetClicked(this\n";
e[o++]="\t\t\t\t\t\t";
if(a>0){
e[o++]="\n";
e[o++]='\t\t\t\t\t\t\t, "';
e[o++]=a==1?"0":s.alphabet[a];
e[o++]='"\n';
e[o++]="\t\t\t\t\t\t\t";
if(a+1<s.numLetters){
e[o++]="\n";
e[o++]='\t\t\t\t\t\t\t\t, "';
e[o++]=a==1?"A":s.alphabet[a+1];
e[o++]='"\n';
e[o++]="\t\t\t\t\t\t\t"
}}
e[o++]="\n";
e[o++]="\t\t\t\t\t\t); return false;'\n";
e[o++]="\t\t\t\t\t\t";
if(s.alphabet[a].length>1){
e[o++]=" colspan='";
e[o++]=s.alphabet[a].length/2+1;
e[o++]="' "
}
e[o++]="\n";
e[o++]="\t\t\t\t\t\tclass='DwtButton AlphabetBarCell' onmouseover='ZmContactAlphabetBar._onMouseOver(this)' onmouseout='ZmContactAlphabetBar._onMouseOut(this)' ";
e[o++]=(a>0)?" style='border-left-width:0;'>":">";
e[o++]=s.alphabet[a];
e[o++]="</td>"
}
e[o++]="</tr></table></center>";
return n?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmAlphabetBar"}
,false);
AjxTemplate.register("abook.Contacts#Tooltip",function(e,t,r,s){
var a=Boolean(s);
r=(typeof r=="string"?{
id:r}
:r)||{};
s=s||[];
var o=s.length;
s[o++]="<table cellpadding=0 cellspacing=0 border=0 width=250><tr><td colspan=2 valign=top><div style='border-bottom: 1px solid black; margin-bottom:2px'><table cellpadding=0 cellspacing=0 border=0 width=100%><tr valign='bottom'><td style='font-weight:bold'>";
s[o++]=AjxStringUtil.htmlEncode(r.entryTitle);
s[o++]="</td><td align='right'>";
s[o++]=AjxImg.getImageHtml(r.contact.getIcon());
s[o++]="</td></tr></table></div></td></tr>";
if(r.contact.isGroup()){
var n=r.contact.getGroupMembers().good.getArray();
for(var h=0;
h<n.length;
h++){
s[o++]="<tr><td width=20>";
s[o++]=AjxImg.getImageHtml("Message");
s[o++]="</td><td>";
s[o++]=AjxStringUtil.htmlEncode(n[h].toString());
s[o++]="</td></tr>"
}}else{
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"fullName"}
);
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"jobTitle"}
);
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"company"}
);
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"mobilePhone"}
);
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"workPhone"}
);
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"homePhone"}
);
if(r.contact.isGal){
var l=r.contact.getEmails();
for(var h=0;
h<l.length&&l.length<=3;
h++){
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"email",val:l[h]}
)
}
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"notes",truncate:500}
)
}else{
s[o++]=AjxTemplate.expand("abook.Contacts#AddTooltipEntry",{
data:r,field:"email",val:r.contact._lookupEmail||r.email}
)
}}
if(r.buddy){
s[o++]='<tr><td colspan="2"><table align="center"><tr><td>';
s[o++]=AjxImg.getImageHtml(r.buddy.getPresence().getIcon());
s[o++]="</td><td>";
s[o++]=AjxStringUtil.htmlEncode(r.buddy.getPresence().getShowText());
s[o++]="</td></tr></table></td></tr>"
}
if(r.hint){
s[o++]="<tr><td colspan=\"2\"><div class='TooltipHint'><hr color=black size=1>";
s[o++]=r.hint;
s[o++]="</div></td></tr>"
}
s[o++]="</table>";
return a?s.length:s.join("")
}
,{
id:"abook.Contacts#Tooltip"}
,false);
AjxTemplate.register("abook.Contacts#TooltipNotInAddrBook",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
if(n.hint){
e[a++]="<table cellpadding=0 cellspacing=0 border=0 width=250><tr><td valign=top>";
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
e[a++]="<div style='border-bottom: 1px solid black;'><table cellpadding=0 cellspacing=0 border=0 width=100%><tr valign='bottom'><td style='font-weight:bold'>";
e[a++]=ZmMsg.newContact;
e[a++]="</td><td align='right'>";
e[a++]=AjxImg.getImageHtml("NewContact");
e[a++]="</td></tr></table></div>"
}
e[a++]='<div class="TooltipNotInAddrBook">';
e[a++]=AjxStringUtil.htmlEncode(n.addrstr);
e[a++]="</div><hr color=black size=1><div class='TooltipHint'>";
e[a++]=n.hint;
e[a++]="</div></td></tr></table>"
}else{
e[a++]="<span style='font-weight:bold'>";
e[a++]=ZmMsg.emailLabel;
e[a++]=" </span>";
e[a++]=AjxStringUtil.htmlEncode(n.addrstr)
}
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#TooltipNotInAddrBook"}
,false);
AjxTemplate.register("abook.Contacts#AddTooltipEntry",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
if(n.val==null){
n.val=n.field=="fullName"?n.data.contact.getFullName():n.data.contact.getAttr(n.field)
}
if(n.val!=null&&n.val!=""){
e[a++]="<tr valign=top><td class='ZmTooltipLabel'>";
e[a++]=AjxMessageFormat.format(ZmMsg.makeLabel,AjxStringUtil.htmlEncode(ZmContact._AB_FIELD[n.field]));
e[a++]="</td>";
if(n.truncate){
e[a++]="<td>";
e[a++]=AjxMessageFormat.format(ZmMsg.makeLabel,AjxStringUtil.htmlEncode(n.val.substring(0,n.truncate)));
e[a++]="</td>"
}else{
e[a++]="<td style='white-space:nowrap;'>";
e[a++]=AjxStringUtil.htmlEncode(n.val);
e[a++]="</td>"
}
e[a++]="</tr>"
}
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#AddTooltipEntry"}
,false);
AjxTemplate.register("abook.Contacts#ZmContactPicker",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='ZmContactPicker'><table border=0 cellpadding=1 cellspacing=1 width=100%><tr><td><table border=0 cellpadding=0 cellspacing=0><tr><td width=20 valign=middle><div id='";
e[a++]=n.id;
e[a++]="_searchIcon' class=\"ImgSearch\"></div></td><td><input type='text' autocomplete='off' size=30 nowrap id='";
e[a++]=n.id;
e[a++]="_searchField'>&nbsp;</td><td id='";
e[a++]=n.id;
e[a++]="_searchButton'></td></tr></table></td><td align=right>";
if(n.showSelect){
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr><td class='Label nobreak'>";
e[a++]=ZmMsg.showNames;
e[a++]="&nbsp;</td><td id='";
e[a++]=n.id;
e[a++]="_listSelect'></td></tr></table>"
}
e[a++]="</td></tr></table><div id='";
e[a++]=n.id;
e[a++]="_chooser'></div><div id='";
e[a++]=n.id;
e[a++]="_paging'><center><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td>&nbsp;&nbsp;&nbsp;</td><td id='";
e[a++]=n.id;
e[a++]="_pageLeft'></td><td width=100%></td><td id='";
e[a++]=n.id;
e[a++]="_pageRight' align=right></td></tr></table></center></div></div>";
return o?e.length:e.join("")
}
,{
id:"abook.Contacts#ZmContactPicker"}
,false)
};
</script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Contacts")){
if(AjxPackage.define("zimbraMail.share.view.ZmImAddressEntry")){
ZmImAddressEntry=function(e){
DwtComposite.call(this,{
parent:e,className:"ZmImAddressEntry"}
);
this._init()
};
ZmImAddressEntry.prototype=new DwtComposite;
ZmImAddressEntry.prototype.constructor=ZmImAddressEntry;
ZmImAddressEntry.prototype._init=function(){
var n=["<table><tr>","<td id='",this._idSelect=Dwt.getNextId(),"'></td>","<td id='",this._idInput=Dwt.getNextId(),"'></td>","</tr></table>"].join("");
this.setContent(n);
var t=[new DwtSelectOption("_NONE",true,ZmMsg.none)];
var o=ZmImAddress.IM_SERVICES;
for(var a=0;
a<o.length;
++a){
t.push(new DwtSelectOption(o[a].value,a==0,o[a].label))
}
this._selectService=new DwtSelect({
parent:this,options:t}
);
this._selectService.reparentHtmlElement(this._idSelect);
this._selectService.addChangeListener(new AjxListener(this,this._on_selectService_change));
this._inputScreenName=new DwtInputField({
parent:this}
);
this._inputScreenName.reparentHtmlElement(this._idInput);
this._inputScreenName.setEnabled(false);
var e=new DwtDropTarget(["ZmRosterItem"]);
this.setDropTarget(e);
this._selectService.setDropTarget(e);
this._inputScreenName.setDropTarget(e);
e.addDropListener(new AjxListener(this,this._dropListener))
};
ZmImAddressEntry.prototype.setValue=function(e){
e=ZmImAddress.parse(e);
this._selectService.setSelectedValue(e?e.service:"_NONE");
this._inputScreenName.setValue(e?e.screenName:"");
this._inputScreenName.setEnabled(!!e)
};
ZmImAddressEntry.prototype.getValue=function(){
return ZmImAddress.make(this._selectService.getValue(),this._inputScreenName.getValue())
};
ZmImAddressEntry.prototype._on_selectService_change=function(){
var e=this._selectService.getValue()!="_NONE";
this._inputScreenName.setEnabled(e);
if(e){
this._inputScreenName.focus()
}};
ZmImAddressEntry.prototype._dropListener=function(t){
if(t.action==DwtDropEvent.DRAG_DROP){
var e=t.srcData;
if(e instanceof ZmRosterItem){
var a=AjxDispatcher.run("GetRoster");
var i=a.makeGenericAddress(e.getAddress());
if(i){
this.setValue(i)
}}}}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmEditContactView")){
ZmEditContactView=function(a,e){
if(arguments.length==0){
return
}
var i={
ondirty:this._handleDirty,items:this.getFormItems()};
var n={
id:"editcontactform",parent:a,className:"ZmEditContactView",posStyle:DwtControl.ABSOLUTE_STYLE,form:i};
DwtForm.call(this,n);
var t=this.getControl("DETAILS");
if(t){
var o=this.__getDetailsMenu();
if(o){
t.setMenu(o);
t.addSelectionListener(new AjxListener(t,t.popup,[o]))
}else{
this.setVisible("DETAILS",false)
}}
this._controller=e;
this._tagList=appCtxt.getTagTree();
this._tagList.addChangeListener(new AjxListener(this,this._tagChangeListener));
this._changeListener=new AjxListener(this,this._contactChangeListener);
this.setScrollStyle(Dwt.SCROLL)
};
ZmEditContactView.prototype=new DwtForm;
ZmEditContactView.prototype.constructor=ZmEditContactView;
ZmEditContactView.prototype.toString=function(){
return"ZmEditContactView"
};
ZmEditContactView.prototype.getFormItems=function(){
if(!this._formItems){
this._formItems=[{
id:"FULLNAME",type:"DwtText",className:"contactHeader",getter:this._getFullName,notab:true,ignore:true}
,{
id:"IMAGE",type:"ZmEditContactViewImage"}
,{
id:"PREFIX",type:"DwtInputField",cols:5,hint:ZmMsg.AB_FIELD_prefix,visible:"get('SHOW_PREFIX')"}
,{
id:"FIRST",type:"DwtInputField",cols:10,hint:ZmMsg.AB_FIELD_firstName,visible:"get('SHOW_FIRST')"}
,{
id:"MIDDLE",type:"DwtInputField",cols:10,hint:ZmMsg.AB_FIELD_middleName,visible:"get('SHOW_MIDDLE')"}
,{
id:"MAIDEN",type:"DwtInputField",cols:15,hint:ZmMsg.AB_FIELD_maidenName,visible:"get('SHOW_MAIDEN')"}
,{
id:"LAST",type:"DwtInputField",cols:15,hint:ZmMsg.AB_FIELD_lastName,visible:"get('SHOW_LAST')"}
,{
id:"SUFFIX",type:"DwtInputField",hint:ZmMsg.AB_FIELD_suffix,cols:5,visible:"get('SHOW_SUFFIX')"}
,{
id:"NICKNAME",type:"DwtInputField",cols:10,hint:ZmMsg.AB_FIELD_nickname,visible:"get('SHOW_NICKNAME')"}
,{
id:"COMPANY",type:"DwtInputField",cols:35,hint:ZmMsg.AB_FIELD_company,visible:"get('SHOW_COMPANY')"}
,{
id:"TITLE",type:"DwtInputField",cols:35,hint:ZmMsg.AB_FIELD_jobTitle,visible:"get('SHOW_TITLE')"}
,{
id:"DEPARTMENT",type:"DwtInputField",cols:35,hint:ZmMsg.AB_FIELD_department,visible:"get('SHOW_DEPARTMENT')"}
,{
id:"NOTES",type:"DwtInputField",cols:(AjxEnv.isMozilla?58:60),rows:4}
,{
id:"EMAIL",type:"ZmEditContactViewInputSelectRows",rowitem:{
type:"ZmEditContactViewInputSelect",equals:ZmEditContactViewInputSelect.equals,params:{
hint:ZmMsg.emailAddrHint,cols:40,options:this.getEmailOptions()}}}
,{
id:"PHONE",type:"ZmEditContactViewInputSelectRows",rowitem:{
type:"ZmEditContactViewInputSelect",equals:ZmEditContactViewInputSelect.equals,params:{
hint:ZmMsg.phoneNumberHint,cols:60,options:this.getPhoneOptions()}}}
,{
id:"IM",type:"ZmEditContactViewInputSelectRows",rowitem:{
type:"ZmEditContactViewIM",equals:ZmEditContactViewIM.equals,params:{
hint:ZmMsg.imScreenNameHint,cols:60,options:this.getIMOptions()}}}
,{
id:"ADDRESS",type:"ZmEditContactViewInputSelectRows",rowtemplate:"abook.Contacts#ZmEditContactViewAddressRow",rowitem:{
type:"ZmEditContactViewAddress",equals:ZmEditContactViewAddress.equals,params:{
options:this.getAddressOptions()}}}
,{
id:"URL",type:"ZmEditContactViewInputSelectRows",rowitem:{
type:"ZmEditContactViewInputSelect",equals:ZmEditContactViewInputSelect.equals,params:{
cols:60,hint:ZmMsg.url,options:this.getURLOptions()}}}
,{
id:"OTHER",type:"ZmEditContactViewInputSelectRows",rowitem:{
type:"ZmEditContactViewOther",equals:ZmEditContactViewInputSelect.equals,params:{
cols:30,hint:ZmMsg.genericTextHint,options:this.getOtherOptions()}}
,validator:ZmEditContactViewOther.validator}
,{
id:"DETAILS",type:"DwtButton",label:"\u00BB",ignore:true,className:"ZmEditContactViewDetailsButton",template:"abook.Contacts#ZmEditContactViewDetailsButton"}
,{
id:"FILE_AS",type:"DwtSelect",onchange:this._handleFileAsChange,items:this.getFileAsOptions()}
,{
id:"FOLDER",type:"DwtButton",image:"ContactsFolder",enabled:"this._contact && !this._contact.isShared()",onclick:this._handleFolderButton}
,{
id:"TAG",type:"DwtControl",enabled:"this._contact && !this._contact.isShared()",visible:"appCtxt.get(ZmSetting.TAGGING_ENABLED)"}
,{
id:"ACCOUNT",type:"DwtLabel",visible:"appCtxt.multiAccounts"}
,{
id:"VIEW_IMAGE",ignore:true,onclick:"open(get('IMAGE')) && false",visible:"get('IMAGE')"}
,{
id:"REMOVE_IMAGE",ignore:true,onclick:"set('IMAGE','') && false",visible:"get('IMAGE')"}
,{
id:"JOB",notab:true,ignore:true,visible:"get('SHOW_TITLE') && get('SHOW_DEPARTMENT')"}
,{
id:"TITLE_DEPARTMENT_SEP",notab:true,ignore:true,visible:"get('SHOW_TITLE') && get('SHOW_DEPARTMENT')"}
]
}
return this._formItems
};
ZmEditContactView.prototype.getFormItemById=function(o,e){
e=e||this.getFormItems()||[];
for(var t=0;
t<e.length;
t++){
var a=e[t];
if(a.id==o){
return a
}}
return null
};
ZmEditContactView.prototype.getEmailOptions=function(){
return null
};
ZmEditContactView.prototype.getPhoneOptions=function(){
return[{
value:ZmContact.F_mobilePhone,label:ZmMsg.phoneLabelMobile}
,{
value:ZmContact.F_workPhone,label:ZmMsg.phoneLabelWork}
,{
value:ZmContact.F_workFax,label:ZmMsg.phoneLabelWorkFax}
,{
value:ZmContact.F_companyPhone,label:ZmMsg.phoneLabelCompany}
,{
value:ZmContact.F_homePhone,label:ZmMsg.phoneLabelHome}
,{
value:ZmContact.F_homeFax,label:ZmMsg.phoneLabelHomeFax}
,{
value:ZmContact.F_pager,label:ZmMsg.phoneLabelPager}
,{
value:ZmContact.F_callbackPhone,label:ZmMsg.phoneLabelCallback}
,{
value:ZmContact.F_assistantPhone,label:ZmMsg.phoneLabelAssistant}
,{
value:ZmContact.F_carPhone,label:ZmMsg.phoneLabelCar}
,{
value:ZmContact.F_otherPhone,label:ZmMsg.phoneLabelOther}
,{
value:ZmContact.F_otherFax,label:ZmMsg.phoneLabelOtherFax}
]
};
ZmEditContactView.prototype.getIMOptions=function(){
return[{
value:"local",label:ZmMsg.imGateway_xmpp}
,{
value:"yahoo",label:ZmMsg.imGateway_yahoo}
,{
value:"aol",label:ZmMsg.imGateway_aol}
,{
value:"msn",label:ZmMsg.imGateway_msn}
,{
value:"other",label:ZmMsg.other}
]
};
ZmEditContactView.prototype.getAddressOptions=function(){
return[{
value:"home",label:ZmMsg.home}
,{
value:"work",label:ZmMsg.work}
,{
value:"other",label:ZmMsg.other}
]
};
ZmEditContactView.prototype.getURLOptions=function(){
return[{
value:ZmContact.F_homeURL,label:ZmMsg.home}
,{
value:ZmContact.F_workURL,label:ZmMsg.work}
,{
value:ZmContact.F_otherURL,label:ZmMsg.other}
]
};
ZmEditContactView.prototype.getOtherOptions=function(){
return[{
value:ZmContact.F_birthday,label:ZmMsg.AB_FIELD_birthday}
,{
value:ZmContact.F_anniversary,label:ZmMsg.AB_FIELD_anniversary}
,{
value:"custom",label:ZmMsg.AB_FIELD_custom}
]
};
ZmEditContactView.prototype.getFileAsOptions=function(){
return[{
value:ZmContact.FA_LAST_C_FIRST,label:ZmMsg.AB_FILE_AS_lastFirst}
,{
value:ZmContact.FA_FIRST_LAST,label:ZmMsg.AB_FILE_AS_firstLast}
,{
value:ZmContact.FA_COMPANY,label:ZmMsg.AB_FILE_AS_company}
,{
value:ZmContact.FA_LAST_C_FIRST_COMPANY,label:ZmMsg.AB_FILE_AS_lastFirstCompany}
,{
value:ZmContact.FA_FIRST_LAST_COMPANY,label:ZmMsg.AB_FILE_AS_firstLastCompany}
,{
value:ZmContact.FA_COMPANY_LAST_C_FIRST,label:ZmMsg.AB_FILE_AS_companyLastFirst}
,{
value:ZmContact.FA_COMPANY_FIRST_LAST,label:ZmMsg.AB_FILE_AS_companyFirstLast}
]
};
ZmEditContactView.DIALOG_X=50;
ZmEditContactView.DIALOG_Y=100;
ZmEditContactView.SHOW_ID_PREFIXES=["PREFIX","FIRST","MIDDLE","MAIDEN","LAST","SUFFIX","NICKNAME","TITLE","DEPARTMENT","COMPANY"];
ZmEditContactView.SHOW_ID_LABELS=[ZmMsg.AB_FIELD_prefix,ZmMsg.AB_FIELD_firstName,ZmMsg.AB_FIELD_middleName,ZmMsg.AB_FIELD_maidenName,ZmMsg.AB_FIELD_lastName,ZmMsg.AB_FIELD_suffix,ZmMsg.AB_FIELD_nickname,ZmMsg.AB_FIELD_jobTitle,ZmMsg.AB_FIELD_department,ZmMsg.AB_FIELD_company];
ZmEditContactView.ALWAYS_SHOW={
FIRST:true,LAST:true,TITLE:true,COMPANY:true};
ZmEditContactView.ATTRS={
FILE_AS:ZmContact.F_fileAs,FOLDER:ZmContact.F_folderId,IMAGE:ZmContact.F_image,PREFIX:ZmContact.F_namePrefix,SUFFIX:ZmContact.F_nameSuffix,MAIDEN:ZmContact.F_maidenName,FIRST:ZmContact.F_firstName,MIDDLE:ZmContact.F_middleName,LAST:ZmContact.F_lastName,NICKNAME:ZmContact.F_nickname,TITLE:ZmContact.F_jobTitle,DEPARTMENT:ZmContact.F_department,COMPANY:ZmContact.F_company,NOTES:ZmContact.F_notes};
ZmEditContactView.updateFieldLists=function(){
ZmEditContactView.LISTS={
ADDRESS:{
attrs:ZmContact.ADDRESS_FIELDS}
,EMAIL:{
attrs:ZmContact.EMAIL_FIELDS,onlyvalue:true}
,PHONE:{
attrs:ZmContact.PHONE_FIELDS}
,IM:{
attrs:ZmContact.IM_FIELDS,onlyvalue:true}
,URL:{
attrs:ZmContact.URL_FIELDS}
,OTHER:{
attrs:ZmContact.OTHER_FIELDS}}
};
ZmEditContactView.updateFieldLists();
ZmEditContactView.ADDR_PREFIXES=["work","home","other"];
ZmEditContactView.ADDR_SUFFIXES=["Street","City","State","PostalCode","Country"];
ZmEditContactView.prototype.TEMPLATE="abook.Contacts#ZmEditContactView";
ZmEditContactView.prototype.set=function(o,c){
if(typeof arguments[0]=="string"){
DwtForm.prototype.set.apply(this,arguments);
return
}
this._contact=o;
for(var e in ZmEditContactView.ATTRS){
var h=o.getAttr(ZmEditContactView.ATTRS[e]);
if(e=="FOLDER"){
continue
}
if(e=="FILE_AS"){
h=h||ZmContact.FA_LAST_C_FIRST
}
this.setValue(e,h)
}
this.setValue("IMAGE",(o&&o.getImageUrl())||"",true);
if(this.getControl("FOLDER")){
var t=o&&o.getAddressBook();
if(!t){
var l=appCtxt.getApp(ZmApp.CONTACTS).getOverview();
t=l&&l.getSelected();
if(t&&t.type!=ZmOrganizer.ADDRBOOK){
t=null
}}
this._setFolder(t||ZmOrganizer.ID_ADDRBOOK)
}
if(this.getControl("TAG")){
this._setTags(o)
}
for(var e in ZmEditContactView.ATTRS){
var a="SHOW_"+e;
var i=this.getControl(a);
if(i==null){
continue
}
var r=e in ZmEditContactView.ALWAYS_SHOW||(this.getValue(e)||"")!="";
this.setValue(a,r);
i.setChecked(r,true)
}
this._listAttrs={};
var s=o.getNormalizedAttrs();
for(var e in ZmEditContactView.LISTS){
switch(e){
case"ADDRESS":this.__initRowsAddress(s,e,this._listAttrs);
break;
case"OTHER":var n=ZmEditContactView.LISTS[e];
this.__initRowsOther(s,e,n.attrs,n.onlyvalue,this._listAttrs);
break;
default:var n=ZmEditContactView.LISTS[e];
this.__initRowsControl(s,e,n.attrs,n.onlyvalue,this._listAttrs)
}}
if(!c){
this.reset(true)
}
this._handleDirty();
this.update();
if(o){
o.removeChangeListener(this._changeListener)
}
o.addChangeListener(this._changeListener);
appCtxt.notifyZimlets("onContactEdit",[this,this._contact,this._htmlElId])
};
ZmEditContactView.prototype.getContact=function(){
return this._contact
};
ZmEditContactView.prototype.getModifiedAttrs=function(){
var r=this.getDirtyItems();
var A={};
var n={};
for(var x=0;
x<r.length;
x++){
var d=r[x];
if(d=="ACCOUNT"){
continue
}
var y=this.getValue(d);
if(d in ZmEditContactView.LISTS){
var h=y;
for(var k=0;
k<h.length;
k++){
var T=h[k];
if(d=="ADDRESS"){
var w=T.type;
var e=null;
var l=true;
for(var u in T){
if(u=="type"){
continue
}
var s=T[u];
if(!s){
continue
}
var W=w+u;
if(!A[W]){
A[W]=0
}
var t=++A[W];
W=t>1?W+t:W;
if(l){
ZmEditContactView.__clearAddressAttributes(n,w,t);
l=false
}
n[W]=s
}}else{
var O=ZmEditContactView.LISTS[d]&&ZmEditContactView.LISTS[d].onlyvalue;
var s=O?T:T.value;
if(!s){
continue
}
var z=ZmEditContactView.LISTS[d];
var W=O?z.attrs[0]:T.type;
if(!A[W]){
A[W]=0
}
var t=++A[W];
W=ZmContact.getAttributeName(W,t);
n[W]=s
}}}else{
var W=ZmEditContactView.ATTRS[d];
n[W]=y
}}
var o=AjxUtil.keys(n);
var c=this._listAttrs;
for(var d in c){
if(!this.isDirty(d)){
continue
}
var q=AjxUtil.uniq(AjxUtil.map(c[d],ZmEditContactView.__trimNumber));
for(var x=0;
x<q.length;
x++){
var f=AjxUtil.keys(this._contact.getAttrs(q[x]));
var b=AjxUtil.complement(o,f);
for(var k=0;
k<b.length;
k++){
n[b[k]]=""
}}}
if(AjxUtil.keys(n).length==0){
return null
}
if(!n[ZmContact.F_folderId]&&!this._contact.isShared()){
n[ZmContact.F_folderId]=this.getValue("FOLDER")
}
if(n[ZmContact.F_image]){
var y=this.getValue("IMAGE");
var g=/aid=(.*)/.exec(y);
if(g){
n[ZmContact.F_image]="aid_"+g[1]
}}
for(var W in n){
if(AjxUtil.isString(n[W])){
n[W]=AjxStringUtil.trim(n[W])
}}
return n
};
ZmEditContactView.__trimNumber=function(e){
return e.replace(/\d+$/,"")
};
ZmEditContactView.prototype.isEmpty=function(e){
e=e||this._items;
for(var s in e){
var o=e[s];
if(this.isIgnore(s)||s=="FILE_AS"){
continue
}
var n=this.getValue(s);
if(n){
if(!AjxUtil.isArray(n)){
if(s=="FOLDER"){
if(n!=o.ovalue){
return false
}}else{
if(n!==""){
return false
}}}else{
for(var a=0;
a<n.length;
a++){
var t=n[a];
if(t){
if(s=="ADDRESS"){
if(!ZmEditContactViewAddress.equals(t,{
type:t.type}
)){
return false
}}else{
if(!(t.value===""||t==="")){
return false
}}}}}}}
return true
};
ZmEditContactView.prototype.enableInputs=function(e){};
ZmEditContactView.prototype.cleanup=function(){
this._contact=null
};
ZmEditContactView.prototype._setTags=function(e){
var a=this.getControl("TAG");
if(a){
if(e===undefined){
e=this._contact
}
var t=(e instanceof ZmContact)?e.tags:e;
a.clearContent();
if(t&&t.length){
a.setContent(this._getTagHtml(t));
a.setVisible(true)
}else{
a.setVisible(false)
}}};
ZmEditContactView.prototype._getTagHtml=function(e){
var o=[];
var r=0;
var h=this.getControl("TAG").getHTMLElId();
var l=[];
for(var a=0;
a<e.length;
a++){
l.push(appCtxt.getById(e[a]))
}
l.sort(ZmTag.sortCompare);
for(var t=0;
t<l.length;
t++){
var c=l[t];
if(!c){
continue
}
var s=ZmTag.COLOR_ICON[c.color];
var n=["id='",h,c.id,"'"].join("");
o[r++]="<a href='javascript:;' class='' onclick='ZmEditContactView._tagClicked(";
o[r++]='"';
o[r++]=c.id;
o[r++]='"';
o[r++]="); return false;'>";
o[r++]=AjxImg.getImageSpanHtml(s,null,n,c.name);
o[r++]="</a>&nbsp;"
}
return o.join("")
};
ZmEditContactView._tagClicked=function(){
ZmContactSplitView._tagClicked.apply(this,arguments)
};
ZmEditContactView.prototype.getList=function(){
return null
};
ZmEditContactView.prototype.getController=function(){
return this._controller
};
ZmEditContactView.prototype.getSelection=function(){
return this.getContact()
};
ZmEditContactView.prototype.getSelectionCount=function(){
return 1
};
ZmEditContactView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,ZmMsg.contact].join(": ")
};
ZmEditContactView.prototype._checkItemCount=function(){};
ZmEditContactView.prototype._handleResponseCheckReplenish=function(){};
ZmEditContactView.prototype._getFullName=function(){
var e={
fileAs:this.getValue("FILE_AS"),firstName:this.getValue("FIRST"),lastName:this.getValue("LAST"),company:this.getValue("COMPANY")};
return ZmContact.computeFileAs(e)||ZmMsg.noName
};
ZmEditContactView.prototype._getDefaultFocusItem=function(){
return this.getControl("FIRST")
};
ZmEditContactView.prototype._setFolder=function(t){
var e=t instanceof ZmOrganizer?t:appCtxt.getById(t);
this.setLabel("FOLDER",e.getName());
this.setValue("FOLDER",e.id);
if(appCtxt.multiAccounts){
this.setValue("ACCOUNT",e.getAccount().getDisplayName())
}};
ZmEditContactView.prototype._getDialogXY=function(){
var e=Dwt.toWindow(this.getHtmlElement(),0,0,null,true);
return new DwtPoint(e.x+ZmEditContactView.DIALOG_X,e.y+ZmEditContactView.DIALOG_Y)
};
ZmEditContactView.prototype._handleDirty=function(){
var e=this.getDirtyItems();
var a=this._controller&&this._controller.getCurrentToolbar();
if(a){
var t=e.length>0?e.length>1||e[0]!="IMAGE"||this._contact.id:false;
var o=AjxUtil.hashCopy(this._items);
delete o.FOLDER;
var i=this.isEmpty(o);
a.enable(ZmOperation.SAVE,t&&!i)
}
this.setValue("DEBUG",e.join(", "))
};
ZmEditContactView.prototype._handleDetailCheck=function(t,a){
this.setValue(t,!this.getValue(t));
this.update();
var e=this.getControl(a);
if(e){
e.focus()
}};
ZmEditContactView.prototype._handleFileAsChange=function(){
var a=this.getValue("FILE_AS");
var t=ZmEditContactView.ALWAYS_SHOW.COMPANY||a==ZmContact.FA_COMPANY||a==ZmContact.FA_LAST_C_FIRST_COMPANY||a==ZmContact.FA_FIRST_LAST_COMPANY||a==ZmContact.FA_COMPANY_LAST_C_FIRST||a==ZmContact.FA_COMPANY_FIRST_LAST;
var e=this.getValue("COMPANY");
if(t){
this.setValue("SHOW_COMPANY",true);
this.setVisible("COMPANY",true)
}else{
if(!e){
this.setValue("SHOW_COMPANY",false);
this.setVisible("COMPANY",false)
}}};
ZmEditContactView.prototype._handleFolderButton=function(t){
var e=appCtxt.getChooseFolderDialog();
e.registerCallback(DwtDialog.OK_BUTTON,new AjxCallback(this,this._handleChooseFolder));
var a={
overviewId:e.getOverviewId(ZmApp.CONTACTS),title:ZmMsg.chooseAddrBook,treeIds:[ZmOrganizer.ADDRBOOK],skipReadOnly:true,skipRemote:true,noRootSelect:true,appName:ZmApp.CONTACTS};
a.omit={};
a.omit[ZmFolder.ID_TRASH]=true;
a.omit[ZmOrganizer.ID_AUTO_ADDED]=true;
e.popup(a)
};
ZmEditContactView.prototype._handleChooseFolder=function(e){
var t=appCtxt.getChooseFolderDialog();
t.popdown();
this._setFolder(e)
};
ZmEditContactView.prototype._contactChangeListener=function(e){
if(e.type!=ZmEvent.S_CONTACT){
return
}
if(e.event==ZmEvent.E_TAGS||e.event==ZmEvent.E_REMOVE_ALL){
this._setTags(this._contact)
}};
ZmEditContactView.prototype._tagChangeListener=function(t){
if(t.type!=ZmEvent.S_TAG){
return
}
var e=t.getDetail("fields");
var a=e&&(e[ZmOrganizer.F_COLOR]||e[ZmOrganizer.F_NAME]);
if((t.event==ZmEvent.E_MODIFY&&a)||t.event==ZmEvent.E_DELETE||t.event==ZmEvent.MODIFY){
this._setTags(this._contact)
}};
ZmEditContactView.prototype.__getDetailsMenu=function(){
var a=new DwtMenu({
parent:this.getControl("DETAILS"),style:DwtMenu.POPUP_STYLE}
);
var e=ZmEditContactView.SHOW_ID_PREFIXES;
var s=ZmEditContactView.SHOW_ID_LABELS;
var r=0;
for(var n=0;
n<e.length;
n++){
var t=e[n];
if(this.getControl(t)){
var h=new DwtMenuItem({
parent:a,style:DwtMenuItem.CHECK_STYLE}
);
h.setText(s[n]);
if(t in ZmEditContactView.ALWAYS_SHOW){
h.setChecked(true,true);
h.setEnabled(false)
}
var l="SHOW_"+t;
var o=new AjxListener(this,this._handleDetailCheck,[l,t]);
h.addSelectionListener(o);
this._registerControl({
id:l,control:h,ignore:true}
);
r++
}}
return r>2?a:null
};
ZmEditContactView.prototype.__initRowsControl=function(c,e,n,m,r,h){
var l=[];
for(var t=0;
t<n.length;
t++){
var s=n[t];
for(var o=1;
true;
o++){
var d=ZmContact.getAttributeName(s,o);
if(d!=s&&AjxUtil.indexOf(n,d)!=-1){
break
}
var u=c[d];
if(!u){
break
}
l.push(m?u:{
type:s,value:u}
);
if(!r[e]){
r[e]=[]
}
r[e].push(d)
}}
if(!h){
this.setValue(e,l)
}
return l
};
ZmEditContactView.prototype.__initRowsOther=function(u,e,n,p,l){
var d=this.__initRowsControl.call(this,u,e,n,p,l,true);
var a={};
for(var r in ZmEditContactView.ATTRS){
a[ZmEditContactView.ATTRS[r]]=true
}
for(var s in ZmEditContactView.LISTS){
var c=ZmEditContactView.LISTS[s];
if(!c.attrs){
continue
}
for(var o=0;
o<c.attrs.length;
o++){
a[c.attrs[o]]=true
}}
for(var o=0;
o<ZmEditContactView.ADDR_PREFIXES.length;
o++){
var h=ZmEditContactView.ADDR_PREFIXES[o];
for(var t=0;
t<ZmEditContactView.ADDR_SUFFIXES.length;
t++){
var f=ZmEditContactView.ADDR_SUFFIXES[t];
a[h+f]=true
}}
for(var m in u){
m=m.replace(/\d+$/,"");
if(ZmContact.IS_IGNORE[m]){
continue
}
if(!(m in a)){
d.push({
type:m,value:u[m]}
);
if(!l[e]){
l[e]=[]
}
l[e].push(m)
}}
this.setValue(e,d)
};
ZmEditContactView.prototype.__initRowsAddress=function(c,e,r){
var l=[];
var s=ZmEditContactView.ADDR_PREFIXES;
var p=ZmEditContactView.ADDR_SUFFIXES;
for(var t=0;
t<s.length;
t++){
var h=s[t];
for(var o=1;
true;
o++){
var m=null;
for(var n=0;
n<p.length;
n++){
var f=p[n];
var d=ZmContact.getAttributeName(h+f,o);
var u=c[d];
if(!u){
continue
}
if(!m){
m={}
}
m[f]=u;
if(!r[e]){
r[e]=[]
}
r[e].push(d)
}
if(!m){
break
}
m.type=h;
l.push(m)
}}
this.setValue("ADDRESS",l)
};
ZmEditContactView.__clearAddressAttributes=function(e,n,o){
var t=ZmEditContactView.ADDR_SUFFIXES;
for(var a=0;
a<t.length;
a++){
var r=t[a];
var s=[n,r,o>1?o:""].join("");
e[s]=""
}};
ZmEditContactViewImage=function(t){
if(arguments.length==0){
return
}
t.className=t.className||"ZmEditContactViewImage";
t.posStyle=Dwt.RELATIVE_STYLE;
t.id=t.parent.getHTMLElId()+"_IMAGE";
DwtControl.apply(this,arguments);
var e=this.getHtmlElement();
e.innerHTML=["<div style='width:48;height:48'>","<img id='",this._htmlElId,"_img' width='48' height='48'>","</div>","<div id='",this._htmlElId,"_badge' style='position:absolute;","bottom:",(AjxEnv.isMozilla?-4:0),";right:",(AjxEnv.isMozilla?3:0),"px'>"].join("");
e.style.cursor="pointer";
this._src="";
this._imgEl=document.getElementById(this._htmlElId+"_img");
this._imgEl.onload=AjxCallback.simpleClosure(this._imageLoaded,this);
this._badgeEl=document.getElementById(this._htmlElId+"_badge");
this._setMouseEvents();
this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(Dwt.addClass,[e,DwtControl.HOVER]));
this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(Dwt.delClass,[e,DwtControl.HOVER]));
this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._chooseImage));
this.setToolTipContent(ZmMsg.addImg)
};
ZmEditContactViewImage.prototype=new DwtControl;
ZmEditContactViewImage.prototype.constructor=ZmEditContactViewImage;
ZmEditContactViewImage.prototype.toString=function(){
return"ZmEditContactViewImage"
};
ZmEditContactViewImage.NO_IMAGE_URL=appContextPath+"/img/large/ImgPerson_48.gif";
ZmEditContactViewImage.IMAGE_URL="/service/content/proxy?aid=@aid@";
ZmEditContactViewImage.prototype.setValue=function(e){
this._src=e;
if(!e){
this._imgEl.src=ZmEditContactViewImage.NO_IMAGE_URL;
this._badgeEl.className="ImgAdd"
}else{
this._imgEl.src=e;
this._badgeEl.className="ImgEditBadge";
this.setToolTipContent(ZmMsg.editImg)
}
this.parent.setDirty("IMAGE",true)
};
ZmEditContactViewImage.prototype.getValue=function(){
return this._src
};
ZmEditContactViewImage.prototype._focus=function(){
Dwt.addClass(this.getHtmlElement(),DwtControl.FOCUSED)
};
ZmEditContactViewImage.prototype._blur=function(){
Dwt.delClass(this.getHtmlElement(),DwtControl.FOCUSED)
};
ZmEditContactViewImage.prototype._imageLoaded=function(){
this._imgEl.removeAttribute("width");
this._imgEl.removeAttribute("height");
var e=this._imgEl.width;
var t=this._imgEl.height;
this._imgEl.setAttribute(e>t?"width":"height",48)
};
ZmEditContactViewImage.prototype._chooseImage=function(){
var a=appCtxt.getUploadDialog();
a.setAllowedExtensions(["png","jpg","jpeg","gif"]);
var o=null;
var s=new AjxCallback(this,this._handleImageSaved);
var n=ZmMsg.uploadImage;
var t=null;
var i=true;
var e=true;
a.popup(o,s,n,t,i,e)
};
ZmEditContactViewImage.prototype._handleImageSaved=function(i,a,t){
var e=appCtxt.getUploadDialog();
e.popdown();
this.setValue(ZmEditContactViewImage.IMAGE_URL.replace(/@aid@/,t[0].guid));
this.parent.update()
};
ZmEditContactViewImage.prototype._createElement=function(){
return document.createElement("FIELDSET")
};
ZmEditContactViewRows=function(s){
if(arguments.length==0){
return
}
if(!s.formItemDef){
s.formItemDef={}
}
var n=s.formItemDef.rowitem;
var a=n&&n.params;
var o=this._options=(a&&a.options)||[];
for(var e=0;
e<o.length;
e++){
var t=o[e];
if(t.max){
if(!this._maximums){
this._maximums={}
}
this._maximums[t.value]={
max:t.max,count:0}
}}
s.formItemDef.id=s.formItemDef.id||Dwt.getNextId();
s.formItemDef.onremoverow="this.setDirty(true)";
s.className=s.className||"ZmEditContactViewRows";
s.id=[s.parent.getHTMLElId(),s.formItemDef.id].join("_");
DwtFormRows.apply(this,arguments);
this.setScrollStyle(Dwt.VISIBLE)
};
ZmEditContactViewRows.prototype=new DwtFormRows;
ZmEditContactViewRows.prototype.constructor=ZmEditContactViewRows;
ZmEditContactViewRows.prototype.toString=function(){
return"ZmEditContactViewRows"
};
ZmEditContactViewRows.prototype.TEMPLATE="abook.Contacts#ZmEditContactViewRows";
ZmEditContactViewRows.prototype.setDirty=function(){
DwtFormRows.prototype.setDirty.apply(this,arguments);
this.parent.setDirty(this._itemDef.id,this.isDirty())
};
ZmEditContactViewRows.prototype.isMaxedOut=function(e){
var t=this._maximums&&this._maximums[e];
return t!=null&&t.count>=t.max
};
ZmEditContactViewRows.prototype.isAllMaxedOut=function(){
if(!this._options||this._options.length==0){
return false
}
var a=0;
for(var e=0;
e<this._options.length;
e++){
var t=this._options[e].value;
a+=this.isMaxedOut(t)?1:0
}
return a>=this._options.length
};
ZmEditContactViewInputSelectRows=function(e){
if(arguments.length==0){
return
}
ZmEditContactViewRows.apply(this,arguments)
};
ZmEditContactViewInputSelectRows.prototype=new ZmEditContactViewRows;
ZmEditContactViewInputSelectRows.prototype.constructor=ZmEditContactViewInputSelectRows;
ZmEditContactViewInputSelectRows.prototype.toString=function(){
return"ZmEditContactViewInputSelectRows"
};
ZmEditContactViewInputSelectRows.prototype.getMaxRows=function(){
return this.isAllMaxedOut()?this.getRowCount():ZmEditContactViewRows.prototype.getMaxRows.call(this)
};
ZmEditContactViewInputSelectRows.prototype.setValue=function(i){
if(arguments[0] instanceof Array){
DwtFormRows.prototype.setValue.apply(this,arguments);
this._resetMaximums()
}else{
var a=String(arguments[0]);
var t=a&&this._subtract(a);
DwtFormRows.prototype.setValue.apply(this,arguments);
var e=a&&this._add(a);
if(t||e){
this._adjustMaximums()
}}};
ZmEditContactViewInputSelectRows.prototype.addRow=function(e,a){
DwtFormRows.prototype.addRow.apply(this,arguments);
a=a!=null?a:this.getRowCount()-1;
var r=this._add(a);
if(r){
this._adjustMaximums()
}
var s=this.getValue(a);
if(s&&this.isMaxedOut(s.type)&&this._options.length>0&&this._maximums[s.type].count>this._maximums[s.type].max){
var t=this._options;
for(var o=0;
o<t.length;
o++){
var n=t[o];
if(!this.isMaxedOut(n.value)){
s.type=n.value;
this.setValue(a,s);
break
}}}
if(this._rowCount>=this._maxRows){
for(var o=0;
o<this._rowCount;
o++){
this.setVisible(this._items[o]._addId,false)
}}
if(AjxEnv.isFirefox){
this._updateLayout()
}};
ZmEditContactViewInputSelectRows.prototype.removeRow=function(t){
var e=this._subtract(t);
DwtFormRows.prototype.removeRow.apply(this,arguments);
if(e){
this._adjustMaximums()
}
if(AjxEnv.isFirefox){
this._updateLayout()
}};
ZmEditContactViewInputSelectRows.prototype._setControlIds=function(i,e){
DwtFormRows.prototype._setControlIds.call(this,i,e);
var t=this._items[i];
var a=t&&t.control;
if(a&&a._setControlIds){
a._setControlIds(i,e)
}};
ZmEditContactViewInputSelectRows.prototype._subtract=function(t){
var e=this.getValue(t);
return this._subtractType(e&&e.type)
};
ZmEditContactViewInputSelectRows.prototype._subtractType=function(e){
if(!this._maximums||!this._maximums[e]){
return false
}
this._maximums[e].count--;
return true
};
ZmEditContactViewInputSelectRows.prototype._add=function(t){
var e=this.getValue(t);
return this._addType(e&&e.type)
};
ZmEditContactViewInputSelectRows.prototype._addType=function(e){
if(!this._maximums||!this._maximums[e]){
return false
}
this._maximums[e].count++;
return true
};
ZmEditContactViewInputSelectRows.prototype._adjustMaximums=function(){
if(!this._maximums||!this._options){
return
}
var t={};
var s=0;
for(var a=0;
a<this._options.length;
a++){
var o=this._options[a].value;
var n=this.isMaxedOut(o);
t[o]=!n;
s+=n?1:0
}
var h=s==this._options.length;
var e=this.getRowCount();
for(var a=0;
a<e;
a++){
var r=this.getControl(a);
if(r.enableOptions){
r.enableOptions(t)
}
this.setVisible(this._items[a]._addId,!h)
}};
ZmEditContactViewInputSelectRows.prototype._resetMaximums=function(){
if(!this._maximums){
return
}
for(var a in this._maximums){
this._maximums[a].count=0
}
var e=this.getRowCount();
for(var t=0;
t<e;
t++){
var o=this.getValue(t);
var n=this._maximums[o&&o.type];
if(n){
n.count++
}}};
ZmEditContactViewInputSelectRows.prototype._updateLayout=function(){
for(var t=0,e=this.getRowCount();
t<e;
t++){
this.getControl(t).reRenderSelect();
this.getControl(t).reRenderInput()
}};
ZmEditContactViewInputSelect=function(e){
if(arguments.length==0){
return
}
this._formItemId=e.formItemDef.id;
this._options=e.options||[];
this._cols=e.cols;
this._rows=e.rows;
this._hint=e.hint;
DwtComposite.apply(this,arguments);
this._tabGroup=new DwtTabGroup(this._htmlElId);
this._createHtml(e.template)
};
ZmEditContactViewInputSelect.prototype=new DwtComposite;
ZmEditContactViewInputSelect.prototype.constructor=ZmEditContactViewInputSelect;
ZmEditContactViewInputSelect.prototype.toString=function(){
return"ZmEditContactViewInputSelect"
};
ZmEditContactViewInputSelect.prototype.TEMPLATE="abook.Contacts#ZmEditContactViewInputSelect";
ZmEditContactViewInputSelect.prototype.setValue=function(t){
var a=this._options.length>0;
var e=a?t&&t.value:t;
if(a&&this._select){
this._select.setSelectedValue((t&&t.type)||this._options[0].value)
}
if(this._input){
if(this._select){
this._input.setEnabled(this._select.getValue()!="_NONE")
}
this._input.setValue(e||"")
}};
ZmEditContactViewInputSelect.prototype.getValue=function(){
var t=this._options.length>0;
var e=this._input?this._input.getValue():"";
return t?{
type:this._select?this._select.getValue():"",value:e}
:e
};
ZmEditContactViewInputSelect.prototype.setDirty=function(e){
if(this.parent instanceof DwtForm){
this.parent.setDirty(true)
}};
ZmEditContactViewInputSelect.equals=function(t,e){
if(t===e){
return true
}
if(!t||!e){
return false
}
var i=this._options.length>0;
return i?t.type==e.type&&t.value==e.value:t==e
};
ZmEditContactViewInputSelect.prototype.enableOptions=function(e){
if(!this._select||!this._select.enableOption){
return
}
var t=this.getValue().type;
for(var a in e){
this._select.enableOption(a,a==t||e[a])
}};
ZmEditContactViewInputSelect.prototype._setControlIds=function(t,e){
var a=this.getHTMLElId();
this._setControlId(this,a+"_value");
this._setControlId(this._input,a);
this._setControlId(this._select,a+"_select")
};
ZmEditContactViewInputSelect.prototype._setControlId=DwtFormRows.prototype._setControlId;
ZmEditContactViewInputSelect.prototype._createHtml=function(a){
var e=this._tabIndexes=[];
this._createHtmlFromTemplate(a||this.TEMPLATE,{
id:this._htmlElId}
);
e.sort(DwtForm.__byTabIndex);
for(var t=0;
t<e.length;
t++){
var o=e[t].control;
this._tabGroup.addMember(o.getTabGroupMember()||o)
}};
ZmEditContactViewInputSelect.prototype._createHtmlFromTemplate=function(t,a){
DwtComposite.prototype._createHtmlFromTemplate.apply(this,arguments);
var e=this._tabIndexes;
var i=document.getElementById(a.id+"_input");
if(i){
this._input=this._createInput();
this._input.replaceElement(i);
if(i.getAttribute("notab")!="true"){
e.push({
tabindex:i.getAttribute("tabindex")||Number.MAX_VALUE,control:this._input}
)
}}
var n=document.getElementById(a.id+"_select");
var o=this._options.length>0;
if(o&&n){
this._select=this._createSelect(this._options);
this._select.addChangeListener(new AjxListener(this,this._handleSelectChange));
this._select.replaceElement(n);
if(n.getAttribute("notab")!="true"){
e.push({
tabindex:n.getAttribute("tabindex")||Number.MAX_VALUE,control:this._select}
)
}
this._select.setVisible(this._options.length>1);
if(this._input){
this._input.setEnabled(this._select.getValue()!="_NONE")
}}};
ZmEditContactViewInputSelect.prototype._createInput=function(){
var e=new DwtInputField({
parent:this,size:this._cols,rows:this._rows}
);
e.setHint(this._hint);
e.setHandler(DwtEvent.ONKEYDOWN,AjxCallback.simpleClosure(this._handleInputKeyDown,this,e));
e.setHandler(DwtEvent.ONKEYUP,AjxCallback.simpleClosure(this._handleInputKeyUp,this,e));
return e
};
ZmEditContactViewInputSelect.prototype._createSelect=function(a){
var s=[this.getHTMLElId(),"select"].join("_");
var e=new DwtSelect({
parent:this,id:s}
);
for(var o=0;
o<a.length;
o++){
var n=a[o];
var t=this.parent.isMaxedOut(n.value);
e.addOption(n.label||n.value,o==0&&!t,n.value);
if(t){
e.enableOption(n.value,false)
}}
return e
};
ZmEditContactViewInputSelect.prototype.reRenderSelect=function(){
if(this._select&&this._select.updateRendering){
this._select.updateRendering()
}};
ZmEditContactViewInputSelect.prototype.reRenderInput=function(){
if(this._input){
var e=this._input.getValue();
if(e&&e!=""){
this._input.setValue(e+" ");
this._input.setValue(e)
}}};
ZmEditContactViewInputSelect.prototype._handleInputKeyDown=function(t,e){
var a=t.getValue();
t.setData("OLD_VALUE",a);
return true
};
ZmEditContactViewInputSelect.prototype._handleInputKeyUp=function(t,e){
var a=t.getData("OLD_VALUE");
var i=t.getValue();
if(a!=null&&a!=i){
this.setDirty(true)
}
return true
};
ZmEditContactViewInputSelect.prototype._handleSelectChange=function(e,n){
var a=e._args;
var o=this.parent._subtractType(a.oldValue);
var i=this.parent._addType(a.newValue);
if(o||i){
this.parent._adjustMaximums()
}
this.setDirty(true);
if(this._input&&this._select){
var t=this._select.getValue()!="_NONE";
this._input.setEnabled(t);
if(t&&!n){
this._input.focus()
}}};
ZmEditContactViewInputSelect.prototype.getTabGroupMember=function(){
return this._tabGroup
};
ZmEditContactViewInputDoubleSelectRows=function(s){
if(arguments.length==0){
return
}
ZmEditContactViewInputSelectRows.apply(this,arguments);
var n=s.formItemDef.rowitem;
var o=n&&n.params;
var e=this._options2=(o&&o.options2)||[];
for(var t=0;
t<e.length;
t++){
var a=e[t];
if(a.max){
if(!this._maximums2){
this._maximums2={}
}
this._maximums2[a.value]={
max:a.max,count:0}
}}};
ZmEditContactViewInputDoubleSelectRows.prototype=new ZmEditContactViewInputSelectRows;
ZmEditContactViewInputDoubleSelectRows.prototype.constructor=ZmEditContactViewInputDoubleSelectRows;
ZmEditContactViewInputDoubleSelectRows.prototype.toString=function(){
return"ZmEditContactViewInputDoubleSelectRows"
};
ZmEditContactViewInputDoubleSelectRows.prototype._subtract=function(o){
var i=this.getValue(o);
var t=this._subtractType(i&&i.type);
var e=this._subtractType2(i&&i.type2);
return t&&e
};
ZmEditContactViewInputDoubleSelectRows.prototype._subtractType2=function(e){
if(!this._maximums2||!this._maximums2[e]){
return false
}
this._maximums2[e].count--;
return true
};
ZmEditContactViewInputDoubleSelectRows.prototype._add=function(o){
var i=this.getValue(o);
var t=this._addType(i&&i.type);
var e=this._addType2(i&&i.type2);
return t||e
};
ZmEditContactViewInputDoubleSelectRows.prototype._addType2=function(e){
if(!this._maximums2||!this._maximums2[e]){
return false
}
this._maximums2[e].count++;
return true
};
ZmEditContactViewInputDoubleSelectRows.prototype._adjustMaximums=function(){
ZmEditContactViewInputSelectRows.prototype._adjustMaximums.call(this);
if(!this._maximums2||!this._options2){
return
}
var t={};
var s=0;
for(var a=0;
a<this._options2.length;
a++){
var o=this._options2[a].value;
var n=this.isMaxedOut2(o);
t[o]=!n;
s+=n?1:0
}
var h=s==this._options2.length;
var e=this.getRowCount();
for(var a=0;
a<e;
a++){
var r=this.getControl(a);
if(r.enableOptions){
r.enableOptions(t)
}
this.setVisible(this._items[a]._addId,!h)
}};
ZmEditContactViewInputDoubleSelectRows.prototype._resetMaximums=function(){
ZmEditContactViewInputSelectRows.prototype._resetMaximums.call(this);
if(!this._maximums2){
return
}
for(var a in this._maximums2){
this._maximums2[a].count=0
}
var e=this.getRowCount();
for(var t=0;
t<e;
t++){
var o=this.getValue(t);
var n=this._maximums2[o&&o.type2];
if(n){
n.count++
}}};
ZmEditContactViewInputDoubleSelectRows.prototype.addRow=function(t,o){
DwtFormRows.prototype.addRow.apply(this,arguments);
o=o!=null?o:this.getRowCount()-1;
var h=this._add(o);
if(h){
this._adjustMaximums()
}
var r=this.getValue(o);
var e=false;
if(r&&this.isMaxedOut(r.type)&&this._options.length>0&&this._maximums[r.type].count>this._maximums[r.type].max){
var a=this._options;
for(var n=0;
n<a.length;
n++){
var s=a[n];
if(!this.isMaxedOut(s.value)){
r.type=s.value;
e=true;
break
}}}
if(r&&this.isMaxedOut2(r.type2)&&this._options2.length>0&&this._maximums2[r.type2].count>this._maximums2[r.type2].max){
var a=this._options2;
for(var n=0;
n<a.length;
n++){
var s=a[n];
if(!this.isMaxedOut2(s.value)){
r.type2=s.value;
e=true;
break
}}}
if(e){
this.setValue(o,r)
}
if(this._rowCount>=this._maxRows){
for(var n=0;
n<this._rowCount;
n++){
this.setVisible(this._items[n]._addId,false)
}}};
ZmEditContactViewInputDoubleSelectRows.prototype.isMaxedOut2=function(e){
var t=this._maximums2&&this._maximums2[e];
return t!=null&&t.count>=t.max
};
ZmEditContactViewInputDoubleSelectRows.prototype.isAllMaxedOut=function(){
if(ZmEditContactViewInputSelectRows.prototype.isAllMaxedOut.call(this)){
return true
}
if(!this._options2||this._options2.length==0){
return false
}
var a=0;
for(var e=0;
e<this._options2.length;
e++){
var t=this._options2[e].value;
a+=this.isMaxedOut2(t)?1:0
}
return a>=this._options2.length
};
ZmEditContactViewInputDoubleSelect=function(e){
if(arguments.length==0){
return
}
this._options2=e.options2||[];
ZmEditContactViewInputSelect.apply(this,arguments)
};
ZmEditContactViewInputDoubleSelect.prototype=new ZmEditContactViewInputSelect;
ZmEditContactViewInputDoubleSelect.prototype.constructor=ZmEditContactViewInputDoubleSelect;
ZmEditContactViewInputDoubleSelect.prototype.toString=function(){
return"ZmEditContactViewInputDoubleSelect"
};
ZmEditContactViewInputDoubleSelect.prototype.TEMPLATE="abook.Contacts#ZmEditContactViewInputDoubleSelect";
ZmEditContactViewInputDoubleSelect.prototype.setValue=function(a){
var i=this._options.length>0;
var t=this._options2.length>0;
var e=i||t?a&&a.value:a;
if(i&&this._select){
this._select.setSelectedValue((a&&a.type)||this._options[0].value)
}
if(t&&this._select2){
this._select2.setSelectedValue((a&&a.type2)||this._options2[0].value)
}
if(this._input){
if(this._select||this._select2){
this._input.setEnabled((this._select&&this._select.getValue()!="_NONE")&&(this._select2&&this._select2.getValue()!="_NONE"))
}
this._input.setValue(e||"")
}};
ZmEditContactViewInputDoubleSelect.prototype.getValue=function(){
var a=this._options.length>0;
var t=this._options2.length>0;
var e=this._input?this._input.getValue():"";
return a||t?{
type:this._select?this._select.getValue():"",type2:this._select2?this._select2.getValue():"",value:e}
:e
};
ZmEditContactViewInputDoubleSelect.equals=function(t,e){
if(t===e){
return true
}
if(!t||!e){
return false
}
var o=this._options.length>0;
var i=this._options2.length>0;
if(o){
if(t.type!=e.type||t.value!=e.value){
return false
}}
if(i){
if(t.type2!=e.type2||t.value!=e.value){
return false
}}
if(!o&&!i){
if(t!=e){
return false
}}
return true
};
ZmEditContactViewInputDoubleSelect.prototype.enableOptions=function(e,i){
if(this._select&&this._select.enableOption){
var t=this.getValue().type;
for(var a in e){
this._select.enableOption(a,a==t||e[a])
}}
if(this._select2&&this._select2.enableOption){
var t=this.getValue().type2;
for(var a in i){
this._select2.enableOption(a,a==t||i[a])
}}};
ZmEditContactViewInputDoubleSelect.prototype._setControlIds=function(t,e){
var a=this.getHTMLElId();
this._setControlId(this,a+"_value");
this._setControlId(this._input,a);
this._setControlId(this._select,a+"_select");
this._setControlId(this._select2,a+"_select2")
};
ZmEditContactViewInputDoubleSelect.prototype._setControlId=DwtFormRows.prototype._setControlId;
ZmEditContactViewInputDoubleSelect.prototype._createHtmlFromTemplate=function(t,o){
DwtComposite.prototype._createHtmlFromTemplate.apply(this,arguments);
var e=this._tabIndexes;
var n=document.getElementById(o.id+"_input");
if(n){
this._input=this._createInput();
this._input.replaceElement(n);
if(n.getAttribute("notab")!="true"){
e.push({
tabindex:n.getAttribute("tabindex")||Number.MAX_VALUE,control:this._input}
)
}}
var r=document.getElementById(o.id+"_select");
var s=this._options.length>0;
if(s&&r){
this._select=this._createSelect(this._options);
this._select.addChangeListener(new AjxListener(this,this._handleSelectChange));
this._select.replaceElement(r);
if(r.getAttribute("notab")!="true"){
e.push({
tabindex:r.getAttribute("tabindex")||Number.MAX_VALUE,control:this._select}
)
}
this._select.setVisible(this._options.length>1)
}
var a=document.getElementById(o.id+"_select2");
var i=this._options2.length>0;
if(i&&a){
this._select2=this._createSelect2(this._options2);
this._select2.addChangeListener(new AjxListener(this,this._handleSelectChange2));
this._select2.replaceElement(a);
if(a.getAttribute("notab")!="true"){
e.push({
tabindex:r.getAttribute("tabindex")||Number.MAX_VALUE,control:this._select2}
)
}
this._select2.setVisible(this._options2.length>1)
}
if(this._input){
if(this._select||this._select2){
this._input.setEnabled((this._select&&this._select.getValue()!="_NONE")&&(this._select2&&this._select2.getValue()!="_NONE"))
}}};
ZmEditContactViewInputDoubleSelect.prototype._createSelect2=function(t){
var n=[this.getHTMLElId(),"select2"].join("_");
var e=new DwtSelect({
parent:this,id:n}
);
for(var a=0;
a<t.length;
a++){
var o=t[a];
e.addOption(o.label||o.value,a==0,o.value)
}
return e
};
ZmEditContactViewInputDoubleSelect.prototype.reRenderSelect=function(){
ZmEditContactViewInputSelect.prototype.reRenderSelect.call(this);
this._select2.updateRendering()
};
ZmEditContactViewInputDoubleSelect.prototype._handleSelectChange=function(e,n){
var a=e._args;
var o=this.parent._subtractType(a.oldValue);
var i=this.parent._addType(a.newValue);
if(o||i){
this.parent._adjustMaximums()
}
this.setDirty(true);
if(this._input){
var t=this._select.getValue()!="_NONE"&&this._select2.getValue()!="_NONE";
this._input.setEnabled(t);
if(t&&!n){
this._input.focus()
}}};
ZmEditContactViewInputDoubleSelect.prototype._handleSelectChange2=function(e,n){
var a=e._args;
var o=this.parent._subtractType2(a.oldValue);
var i=this.parent._addType2(a.newValue);
if(o||i){
this.parent._adjustMaximums()
}
this.setDirty(true);
if(this._input){
var t=this._select.getValue()!="_NONE"&&this._select2.getValue()!="_NONE";
this._input.setEnabled(t);
if(t&&!n){
this._input.focus()
}}};
ZmEditContactViewOther=function(t){
if(arguments.length==0){
return
}
ZmEditContactViewInputSelect.apply(this,arguments);
var e=t.options&&t.options[0];
this.setValue({
type:e&&e.value}
)
};
ZmEditContactViewOther.prototype=new ZmEditContactViewInputSelect;
ZmEditContactViewOther.prototype.constructor=ZmEditContactViewOther;
ZmEditContactViewOther.prototype.toString=function(){
return"ZmEditContactViewOther"
};
ZmEditContactViewOther.prototype.TEMPLATE="abook.Contacts#ZmEditContactViewOther";
ZmEditContactViewOther.prototype.DATE_ATTRS={
birthday:true,anniversary:true};
ZmEditContactViewOther.validator=function(o){
if(AjxUtil.isArray(o)){
if(!o.length){
return true
}
var e=[];
for(var a=0;
a<o.length;
a++){
var n=ZmEditContactViewOther.validator(o[a]);
if(n||n===""){
e.push({
type:o[a].type,value:n}
)
}else{
return false
}}
return e
}else{
if(o.type in ZmEditContactViewOther.prototype.DATE_ATTRS||o.type.replace(/^other/,"").toLowerCase() in ZmEditContactViewOther.prototype.DATE_ATTRS){
var t=AjxStringUtil.trim(o.value);
if(t.length){
var s=ZmEditContactViewOther.parseDate(t);
if(isNaN(s)||s==null){
throw ZmMsg.errorDate
}
return ZmEditContactViewOther.formatDate(s)
}
return t
}
return o.value
}};
ZmEditContactViewOther.prototype.setValue=function(e){
ZmEditContactViewInputSelect.prototype.setValue.apply(this,arguments);
this._resetPicker()
};
ZmEditContactViewOther.prototype.getValue=function(){
return{
type:this._select.getValue()||this._select.getText(),value:this._input.getValue()}
};
ZmEditContactViewOther.prototype._setControlIds=function(t,e){
var a=this.getHTMLElId();
ZmEditContactViewInputSelect.prototype._setControlIds.apply(this,arguments);
this._setControlId(this._picker,a+"_picker")
};
ZmEditContactViewOther.prototype._createHtmlFromTemplate=function(i,r){
ZmEditContactViewInputSelect.prototype._createHtmlFromTemplate.apply(this,arguments);
var o=this._tabIndexes;
var l=document.getElementById(r.id+"_picker");
if(l){
var t=[this.getHTMLElId(),"picker"].join("_");
this._picker=new DwtButton({
parent:this,id:t}
);
this._picker.setImage("CalendarApp");
this._picker.popup=ZmEditContactViewOther.__DwtButton_popup;
var a=new DwtMenu({
parent:this._picker,style:DwtMenu.GENERIC_WIDGET_STYLE}
);
this._picker.getHtmlElement().className+=" ZmEditContactViewOtherCalendar";
this._picker.setMenu(a);
this._picker.replaceElement(l);
var n=new AjxListener(this,this._handleDropDown);
this._picker.addSelectionListener(n);
this._picker.addDropDownSelectionListener(n);
var e=new DwtComposite({
parent:a}
);
var s=new DwtCalendar({
parent:e}
);
s.setDate(new Date());
s.setFirstDayOfWeek(appCtxt.get(ZmSetting.CAL_FIRST_DAY_OF_WEEK)||0);
s.addSelectionListener(new AjxListener(this,this._handleDateSelection,[s]));
o.push({
tabindex:l.getAttribute("tabindex")||Number.MAX_VALUE,control:this._picker}
);
this._calendar=s;
var h=new DwtCheckbox({
parent:e}
);
h.setText(ZmMsg.includeYear);
this._calendarIncludeYear=h
}};
ZmEditContactViewOther.__DwtButton_popup=function(){
var o=this;
var i=o.getSize();
var e=Dwt.toWindow(o.getHtmlElement(),0,0);
var n=o.getMenu();
var a=n.getSize();
var t=DwtShell.getShell(window).getSize();
o._popupAbove=(e.y+i.y)+a.y>t.y;
if(AjxEnv.isIE){
n.getHtmlElement().style.width="150px"
}
DwtButton.prototype.popup.apply(o,arguments)
};
ZmEditContactViewOther.prototype._createSelect=function(){
var n=[this.getHTMLElId(),"select"].join("_");
var e=new DwtComboBox({
parent:this,inputParams:{
size:18}
,id:n}
);
var t=this._options||[];
for(var a=0;
a<t.length;
a++){
var o=t[a];
e.add(o.label||o.value,o.value,a==0)
}
e.addChangeListener(new AjxListener(this,this._resetPicker));
e.setSelectedValue=e.setValue;
return e
};
ZmEditContactViewOther.prototype._resetPicker=function(){
if(this._picker){
var e=this.getValue().type;
this._picker.setVisible(e in this.DATE_ATTRS)
}};
ZmEditContactViewOther.parseDate=function(e){
var i=AjxDateUtil.simpleParseDateStr(e);
if(isNaN(i)||i==null){
var a=e.match(/^--/);
var t=a?"--MM-dd":"yyyy-MM-dd";
i=AjxDateFormat.parse(t,e);
if(a){
i.setFullYear(0)
}}
return i
};
ZmEditContactViewOther.formatDate=function(e){
var t=e.getFullYear()==0?"--MM-dd":"yyyy-MM-dd";
return AjxDateFormat.format(t,e)
};
ZmEditContactViewOther._getDateFormatter=function(){
if(!ZmEditContactViewOther._formatter){
ZmEditContactViewOther._formatter=new AjxDateFormat("yyyy-MM-dd")
}
return ZmEditContactViewOther._formatter
};
ZmEditContactViewOther.prototype._handleDropDown=function(e){
var i=this.getValue().value;
var t=ZmEditContactViewOther.parseDate(i)||new Date;
var a=t.getFullYear()!=0;
if(!a){
t.setFullYear(new Date().getFullYear())
}
this._calendar.setDate(t);
this._calendarIncludeYear.setSelected(a);
this._picker.popup()
};
ZmEditContactViewOther.prototype._handleDateSelection=function(a){
this._picker.getMenu().popdown();
if(!a){
a=this._calendar
}
var e=a.getDate();
if(!this._calendarIncludeYear.isSelected()){
e=new Date(e.getTime());
e.setFullYear(0)
}
var t=this.getValue();
t.value=ZmEditContactViewOther.formatDate(e);
this.setValue(t);
this.parent.setDirty(true)
};
ZmEditContactViewOther.prototype._handleSelectChange=function(e){
ZmEditContactViewInputSelect.prototype._handleSelectChange.call(this,e,true)
};
ZmEditContactViewIM=function(e){
if(arguments.length==0){
return
}
ZmEditContactViewInputSelect.apply(this,arguments)
};
ZmEditContactViewIM.prototype=new ZmEditContactViewInputSelect;
ZmEditContactViewIM.prototype.constructor=ZmEditContactViewIM;
ZmEditContactViewIM.prototype.toString=function(){
return"ZmEditContactViewIM"
};
ZmEditContactViewIM.RE_VALUE=/^(.*?):\/\/(.*)$/;
ZmEditContactViewIM.prototype.setValue=function(t){
var e=ZmEditContactViewIM.RE_VALUE.exec(t);
t=e?{
type:e[1],value:e[2]}
:{
type:"other",value:t};
ZmEditContactViewInputSelect.prototype.setValue.call(this,t)
};
ZmEditContactViewIM.prototype.getValue=function(){
var e=ZmEditContactViewInputSelect.prototype.getValue.call(this);
return e.value?[e.type,e.value].join("://"):""
};
ZmEditContactViewIMDouble=function(e){
if(arguments.length==0){
return
}
ZmEditContactViewInputDoubleSelect.apply(this,arguments)
};
ZmEditContactViewIMDouble.prototype=new ZmEditContactViewInputDoubleSelect;
ZmEditContactViewIMDouble.prototype.constructor=ZmEditContactViewIMDouble;
ZmEditContactViewIMDouble.prototype.toString=function(){
return"ZmEditContactViewIMDouble"
};
ZmEditContactViewIMDouble.RE_VALUE=/^(.*?):\/\/(.*)$/;
ZmEditContactViewIMDouble.prototype.setValue=function(a){
var i;
if(!a||a==""){
i={
type2:"_NONE",value:"",type:null}
}else{
var t=a.type?a.value:a;
var e=ZmEditContactViewIMDouble.RE_VALUE.exec(t);
i=e?{
type2:e[1],value:e[2],type:a.type?a.type:null}
:{
type2:a.type2||"other",value:t,type:a.type?a.type:null}
}
ZmEditContactViewInputDoubleSelect.prototype.setValue.call(this,i)
};
ZmEditContactViewIMDouble.prototype.getValue=function(){
var t=ZmEditContactViewInputDoubleSelect.prototype.getValue.call(this);
var e=(t.type2=="_NONE"||t.value=="")?"":[t.type2,t.value].join("://");
var a=t.type2?{
type:t.type,type2:t.type2,value:e}
:e;
return a
};
ZmEditContactViewIMDouble.equals=function(t,e){
if(t===e){
return true
}
if(!t||!e){
return false
}
return t.type==e.type&&t.type2==e.type2&&t.value==e.value
};
ZmEditContactViewAddress=function(e){
if(arguments.length==0){
return
}
ZmEditContactViewInputSelect.call(this,e)
};
ZmEditContactViewAddress.prototype=new ZmEditContactViewInputSelect;
ZmEditContactViewAddress.prototype.constructor=ZmEditContactViewAddress;
ZmEditContactViewAddress.prototype.toString=function(){
return"ZmEditContactViewAddress"
};
ZmEditContactViewAddress.prototype.TEMPLATE="abook.Contacts#ZmEditContactViewAddressSelect";
ZmEditContactViewAddress.prototype.setValue=function(e){
ZmEditContactViewInputSelect.prototype.setValue.apply(this,arguments);
e=e||{};
this._select.setSelectedValue(e.type);
this._setStreet(e.Street);
this._input.setValue("CITY",e.City);
this._input.setValue("STATE",e.State);
this._input.setValue("ZIP",e.PostalCode);
this._input.setValue("COUNTRY",e.Country);
this._input.setDirty(false);
this._input.update()
};
ZmEditContactViewAddress.prototype.getValue=function(){
return{
type:this._select.getValue(),Street:this._getStreet(),City:this._input.getValue("CITY"),State:this._input.getValue("STATE"),PostalCode:this._input.getValue("ZIP"),Country:this._input.getValue("COUNTRY")}
};
ZmEditContactViewAddress.equals=function(t,e){
if(t===e){
return true
}
if(!t||!e){
return false
}
return t.type==e.type&&t.Street==e.Street&&t.City==e.City&&t.State==e.State&&t.PostalCode==e.PostalCode&&t.Country==e.Country
};
ZmEditContactViewAddress.prototype._setControlIds=function(s,a){
var r=this.getHTMLElId();
ZmEditContactViewInputSelect.prototype._setControlIds.apply(this,arguments);
var t=["STREET","STREET1","STREET2","CITY","STATE","ZIP","COUNTRY"];
for(var o=0;
o<t.length;
o++){
var e=t[o];
var n=this._input.getControl(e);
this._setControlId.call(n,n,[r,e].join("_"))
}};
ZmEditContactViewAddress.prototype._setStreet=function(t){
var a=this._input.getControl("STREET1");
if(a){
var e=t.split("\n");
this._input.setValue("STREET1",e[0]);
this._input.setValue("STREET2",e.slice(1).join(" "))
}else{
this._input.setValue("STREET",t)
}};
ZmEditContactViewAddress.prototype._getStreet=function(){
var a=this._input.getControl("STREET1");
if(a){
var t=this._input.getValue("STREET1");
var e=this._input.getControl("STREET1")?this._input.getValue("STREET2"):null;
return e?[t,e].join("\n"):t
}
return this._input.getValue("STREET")
};
ZmEditContactViewAddress.prototype._createInput=function(){
var e={
template:"abook.Contacts#ZmEditContactViewAddress",ondirty:"this.parent._handleDirty()",items:[{
id:"STREET",type:"DwtInputField",cols:(AjxEnv.isMozilla?56:58),rows:2,hint:ZmMsg.AB_FIELD_street,params:{
forceMultiRow:true}}
,{
id:"STREET1",type:"DwtInputField",cols:(AjxEnv.isMozilla?56:58),hint:ZmMsg.AB_FIELD_street}
,{
id:"STREET2",type:"DwtInputField",cols:(AjxEnv.isMozilla?56:58),hint:ZmMsg.AB_FIELD_street}
,{
id:"CITY",type:"DwtInputField",cols:20,hint:ZmMsg.AB_FIELD_city}
,{
id:"STATE",type:"DwtInputField",cols:12,hint:ZmMsg.AB_FIELD_state}
,{
id:"ZIP",type:"DwtInputField",cols:10,hint:ZmMsg.AB_FIELD_postalCode}
,{
id:"COUNTRY",type:"DwtInputField",cols:20,hint:ZmMsg.AB_FIELD_country}
]};
return new DwtForm({
parent:this,form:e}
)
};
ZmEditContactViewAddress.prototype._handleDirty=function(){
if(this._input&&this._input.isDirty()){
this.parent.setDirty(true)
}}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmGroupView")){
ZmGroupView=function(t,e){
if(arguments.length==0){
return
}
DwtComposite.call(this,{
parent:t,className:"ZmContactView",posStyle:DwtControl.ABSOLUTE_STYLE}
);
this.setScrollStyle(Dwt.SCROLL);
this._searchRespCallback=new AjxCallback(this,this._handleResponseSearch);
this._controller=e;
this.setScrollStyle(Dwt.CLIP);
this._offset=0;
this._defaultQuery=".";
this._view=ZmId.VIEW_GROUP;
this._tagList=appCtxt.getTagTree();
this._tagList.addChangeListener(new AjxListener(this,this._tagChangeListener));
this._changeListener=new AjxListener(this,this._groupChangeListener)
};
ZmGroupView.prototype=new DwtComposite;
ZmGroupView.prototype.constructor=ZmGroupView;
ZmGroupView.prototype.toString=function(){
return"ZmGroupView"
};
ZmGroupView.DIALOG_X=50;
ZmGroupView.DIALOG_Y=100;
ZmGroupView.prototype.getList=function(){
return null
};
ZmGroupView.prototype.getContact=function(){
return this._contact
};
ZmGroupView.prototype.getController=function(){
return this._controller
};
ZmGroupView.prototype.getSelection=function(){
return this.getContact()
};
ZmGroupView.prototype.getSelectionCount=function(){
return 1
};
ZmGroupView.prototype.set=function(e,t){
this._attr={};
if(!this._htmlInitialized){
this._createHtml();
this._addWidgets();
this._installKeyHandlers()
}
if(this._contact){
this._contact.removeChangeListener(this._changeListener)
}
e.addChangeListener(this._changeListener);
this._contact=e;
this._setFields();
this._offset=0;
this._isDirty=t;
this.search()
};
ZmGroupView.prototype.getModifiedAttrs=function(){
if(!this.isDirty()){
return null
}
var o=this._attr={};
var a=false;
var n=AjxStringUtil.trim(document.getElementById(this._groupNameId).value);
var t=this._getGroupMembers();
var e=this._getFolderId();
if(this._contact.id==null||this._contact.isGal){
o[ZmContact.F_folderId]=e;
o[ZmContact.F_fileAs]=ZmContact.computeCustomFileAs(n);
o[ZmContact.F_nickname]=n;
o[ZmContact.F_dlist]=t;
o[ZmContact.F_type]="group";
a=true
}else{
if(this._contact.getFileAs()!=n){
o[ZmContact.F_fileAs]=ZmContact.computeCustomFileAs(n);
o[ZmContact.F_nickname]=n;
a=true
}
if(this._contact.getAttr(ZmContact.F_dlist)!=t){
o[ZmContact.F_dlist]=t;
a=true
}
var i=this._contact.addrbook?this._contact.addrbook.id:ZmFolder.ID_CONTACTS;
if(e!=i){
o[ZmContact.F_folderId]=e;
a=true
}}
return a?o:null
};
ZmGroupView.prototype.isEmpty=function(e){
var a=AjxStringUtil.trim(document.getElementById(this._groupNameId).value);
var t=(this._groupListView.getList()&&this._groupListView.getList().size()>0);
return e?(a==""||!t):(a==""&&!t)
};
ZmGroupView.prototype.isValid=function(){
if(this.isDirty()&&this.isEmpty(true)){
return false
}
return true
};
ZmGroupView.prototype.getInvalidItems=function(){
if(!this.isValid()){
return["members"]
}
return[]
};
ZmGroupView.prototype.getErrorMessage=function(e){
if(!this.isValid()&&e=="members"){
return ZmMsg.errorMissingGroup
}};
ZmGroupView.prototype.enableInputs=function(e){
document.getElementById(this._groupNameId).disabled=!e;
if(!this._noManualEntry){
this._groupMembers.disabled=!e
}
document.getElementById(this._searchFieldId).disabled=!e
};
ZmGroupView.prototype.isDirty=function(){
return this._isDirty
};
ZmGroupView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,ZmMsg.group].join(": ")
};
ZmGroupView.prototype.setSize=function(t,e){
DwtComposite.prototype.setSize.call(this,t,e)
};
ZmGroupView.prototype.setBounds=function(t,o,a,e){
DwtComposite.prototype.setBounds.call(this,t,o,a,e);
if(this._addNewField){
Dwt.setSize(this._addNewField,Dwt.DEFAULT,50)
}
this._groupListView.setSize(Dwt.DEFAULT,e-150);
var i=(appCtxt.get(ZmSetting.GAL_ENABLED)||appCtxt.get(ZmSetting.SHARING_ENABLED))?185:160;
this._listview.setSize(Dwt.DEFAULT,e-i-(this._addNewField?100:0))
};
ZmGroupView.prototype.cleanup=function(){
document.getElementById(this._searchFieldId).value="";
this._listview.removeAll(true);
this._groupListView.removeAll(true);
this._addButton.setEnabled(false);
this._addAllButton.setEnabled(false);
this._prevButton.setEnabled(false);
this._nextButton.setEnabled(false);
this._delButton.setEnabled(false);
if(this._addNewField){
this._addNewField.value=""
}};
ZmGroupView.prototype.search=function(){
var a=AjxStringUtil.trim(document.getElementById(this._searchFieldId).value);
if(!a.length){
a=this._defaultQuery
}
var t;
if(this._searchInSelect){
var e=this._searchInSelect.getValue();
this._contactSource=(e==ZmContactsApp.SEARCHFOR_CONTACTS||e==ZmContactsApp.SEARCHFOR_PAS)?ZmItem.CONTACT:ZmId.SEARCH_GAL;
if(e==ZmContactsApp.SEARCHFOR_PAS){
t=ZmSearchController.generateQueryForShares([ZmId.ITEM_CONTACT])||"is:local"
}else{
if(e==ZmContactsApp.SEARCHFOR_CONTACTS){
t="is:local"
}}}else{
this._contactSource=appCtxt.get(ZmSetting.CONTACTS_ENABLED)?ZmItem.CONTACT:ZmId.SEARCH_GAL;
if(this._contactSource==ZmItem.CONTACT){
t="is:local"
}}
var i={
obj:this,ascending:true,query:a,queryHint:t,offset:this._offset,respCallback:this._searchRespCallback};
ZmContactsHelper.search(i)
};
ZmGroupView.prototype._setFields=function(){
if(appCtxt.isOffline&&appCtxt.accountList.size()>1&&this._searchInSelect){
this._searchInSelect.clearOptions();
this._resetSearchInSelect()
}
this._setGroupName();
this._setFolder();
this._setGroupMembers();
this._setHeaderInfo();
this._setTitle();
this._setTags()
};
ZmGroupView.prototype._setTitle=function(t){
var a=document.getElementById(this._titleId);
var e=t||this._contact.getFileAs();
a.innerHTML=e||(this._contact.id?"&nbsp;":ZmMsg.newGroup)
};
ZmGroupView.prototype._getTagCell=function(){
return document.getElementById(this._tagsId)
};
ZmGroupView.prototype._createHtml=function(){
this._headerRowId=this._htmlElId+"_headerRow";
this._titleId=this._htmlElId+"_title";
this._tagsId=this._htmlElId+"_tags";
this._groupNameId=this._htmlElId+"_groupName";
this._searchFieldId=this._htmlElId+"_searchField";
var e=false;
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
if(appCtxt.get(ZmSetting.GAL_ENABLED)||appCtxt.get(ZmSetting.SHARING_ENABLED)){
e=true
}}
var t={
id:this._htmlElId,showSearchIn:e};
this.getHtmlElement().innerHTML=AjxTemplate.expand("abook.Contacts#GroupView",t);
this._htmlInitialized=true
};
ZmGroupView.prototype._addWidgets=function(){
this._groupMembers=document.getElementById(this._htmlElId+"_groupMembers");
this._noManualEntry=this._groupMembers.disabled;
var s=this._htmlElId+"_folderSelect";
var i=document.getElementById(s);
if(i){
this._folderSelect=new DwtSelect({
parent:this}
);
this._folderSelect.reparentHtmlElement(s);
this._folderSelect.addChangeListener(new AjxListener(this,this._selectChangeListener))
}
var a=this._htmlElId+"_listSelect";
var n=document.getElementById(a);
if(n){
this._searchInSelect=new DwtSelect({
parent:this}
);
this._resetSearchInSelect();
this._searchInSelect.reparentHtmlElement(a);
this._searchInSelect.addChangeListener(new AjxListener(this,this._searchTypeListener))
}
this._searchButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_searchButton")}
);
this._searchButton.setText(ZmMsg.search);
this._searchButton.addSelectionListener(new AjxListener(this,this._searchButtonListener));
this._listview=new ZmGroupListView(this);
this._listview.reparentHtmlElement(this._htmlElId+"_listView");
this._listview.addSelectionListener(new AjxListener(this,this._selectionListener));
this._listview.setUI(null,true);
this._listview._initialized=true;
this._groupListView=new ZmGroupMembersListView(this);
this._groupListView.reparentHtmlElement(this._htmlElId+"_groupMembers");
this._groupListView.addSelectionListener(new AjxListener(this,this._groupMembersSelectionListener));
this._groupListView.setUI(null,true);
this._groupListView._initialized=true;
var o=new AjxListener(this,this._delListener);
this._delButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_delButton")}
);
this._delButton.setText(ZmMsg.del);
this._delButton.addSelectionListener(o);
this._delButton.setEnabled(false);
this._delAllButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_delAllButton")}
);
this._delAllButton.setText(ZmMsg.delAll);
this._delAllButton.addSelectionListener(o);
var t=new AjxListener(this,this._addListener);
this._addButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_addButton")}
);
this._addButton.setText(ZmMsg.add);
this._addButton.addSelectionListener(t);
this._addButton.setEnabled(false);
this._addAllButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_addAllButton")}
);
this._addAllButton.setText(ZmMsg.addAll);
this._addAllButton.addSelectionListener(t);
this._addAllButton.setEnabled(false);
var e=new AjxListener(this,this._pageListener);
this._prevButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_prevButton")}
);
this._prevButton.setImage("LeftArrow");
this._prevButton.addSelectionListener(e);
this._prevButton.setEnabled(false);
this._nextButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_nextButton")}
);
this._nextButton.setImage("RightArrow");
this._nextButton.addSelectionListener(e);
this._nextButton.setEnabled(false);
this._addNewField=document.getElementById(this._htmlElId+"_addNewField");
if(this._addNewField){
this._addNewButton=new DwtButton({
parent:this,parentElement:(this._htmlElId+"_addNewButton")}
);
this._addNewButton.setText(ZmMsg.add);
this._addNewButton.addSelectionListener(new AjxListener(this,this._addNewListener))
}};
ZmGroupView.prototype._installKeyHandlers=function(){
var t=document.getElementById(this._groupNameId);
Dwt.setHandler(t,DwtEvent.ONKEYUP,ZmGroupView._onKeyUp);
Dwt.associateElementWithObject(t,this);
if(!this._noManualEntry){
Dwt.setHandler(this._groupMembers,DwtEvent.ONKEYUP,ZmGroupView._onKeyUp);
Dwt.associateElementWithObject(this._groupMembers,this)
}
var e=document.getElementById(this._searchFieldId);
Dwt.setHandler(e,DwtEvent.ONKEYPRESS,ZmGroupView._keyPressHdlr);
Dwt.associateElementWithObject(e,this)
};
ZmGroupView.prototype._getTabGroupMembers=function(){
var e=[];
e.push(document.getElementById(this._groupNameId));
if(!this._noManualEntry){
e.push(this._groupMembers)
}
e.push(document.getElementById(this._searchFieldId));
return e
};
ZmGroupView.prototype._getDefaultFocusItem=function(){
return document.getElementById(this._groupNameId)
};
ZmGroupView.prototype._getGroupMembers=function(e){
var o=this._groupListView.getList();
if(!o){
return null
}
o=o.getArray();
var a=0;
while(true){
var t=AjxStringUtil.trim(o[a]);
if(t==""){
o.splice(a,1)
}else{
a++
}
if(a==o.length){
break
}}
return o.length>0?(e?o:o.join(", ")):null
};
ZmGroupView.prototype._getFolderId=function(){
return(this._folderSelect!=null)?this._folderSelect.getValue():ZmFolder.ID_CONTACTS
};
ZmGroupView.prototype._setGroupMembers=function(){
var t=this._contact.getGroupMembers().all.getArray();
var e=[];
for(var a=0;
a<t.length;
a++){
e[a]=t[a].toString()
}
this._setGroupMembersListView(e,false)
};
ZmGroupView.prototype._setGroupName=function(){
var e=document.getElementById(this._groupNameId);
if(e){
e.value=this._contact.getFileAs()||""
}};
ZmGroupView.prototype._resetSearchInSelect=function(){
this._searchInSelect.addOption(ZmMsg.contacts,true,ZmContactsApp.SEARCHFOR_CONTACTS);
if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
this._searchInSelect.addOption(ZmMsg.searchPersonalSharedContacts,false,ZmContactsApp.SEARCHFOR_PAS)
}
if(appCtxt.get(ZmSetting.GAL_ENABLED)&&appCtxt.getActiveAccount().isZimbraAccount){
this._searchInSelect.addOption(ZmMsg.GAL,true,ZmContactsApp.SEARCHFOR_GAL)
}
if(!appCtxt.get(ZmSetting.INITIALLY_SEARCH_GAL)||!appCtxt.get(ZmSetting.GAL_ENABLED)){
this._searchInSelect.setSelectedValue(ZmContactsApp.SEARCHFOR_CONTACTS)
}};
ZmGroupView.prototype._setFolder=function(){
if(this._folderSelect){
var t;
if(this._contact.id==null){
var r=AjxDispatcher.run("GetContactListController");
t=r._folderId
}
if(this._contact.id!=null||!t){
t=this._contact.addrbook?this._contact.addrbook.id:ZmFolder.ID_CONTACTS
}
var s=appCtxt.getFolderTree();
var o=s?s.getByType(ZmOrganizer.ADDRBOOK):[];
o.sort(ZmAddrBook.sortCompare);
this._folderSelect.clearOptions();
for(var a=0;
a<o.length;
a++){
var n=o[a];
if(n.nId==ZmFolder.ID_ROOT||n.isInTrash()||n.isReadOnly()){
continue
}
this._folderSelect.addOption(n.name,n.id==t,n.id)
}}else{
if(this._folderPickerButton){
var n=this._contact.getAddressBook();
if(n){
this._folderPickerButton.setText(n.name);
this._folderPickedId=n.id
}else{
var e=ZmMsg[ZmFolder.MSG_KEY[ZmOrganizer.ID_ADDRBOOK]];
this._folderPickerButton.setText(e);
this._folderPickedId=ZmOrganizer.getSystemId(ZmOrganizer.ID_ADDRBOOK,appCtxt.getActiveAccount())
}}}};
ZmGroupView.prototype._setHeaderInfo=function(){
var e=this._contact.folderId;
var i=e?appCtxt.getById(e):null;
var t=i?i.color:ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.ADDRBOOK];
var a=ZmOrganizer.COLOR_TEXT[t]+"Bg";
var n=document.getElementById(this._headerRowId);
if(n){
n.className="contactHeaderRow "+a
}
var o=document.getElementById(this._iconCellId);
if(o){
o.innerHTML=AjxImg.getImageHtml(this._contact.getIcon())
}};
ZmGroupView.prototype._setTags=function(){
var t=this._getTagCell();
if(!t){
return
}
var a=[];
for(var s=0;
s<this._contact.tags.length;
s++){
a.push(this._tagList.getById(this._contact.tags[s]))
}
a.sort(ZmTag.sortCompare);
var n=[];
var s=0;
for(var o=0;
o<a.length;
o++){
var e=a[o];
if(!e){
continue
}
var r=ZmTag.COLOR_ICON[e.color];
n[s++]=AjxImg.getImageSpanHtml(r,null,null,e.name);
n[s++]="&nbsp;"
}
t.innerHTML=n.join("")
};
ZmGroupView.prototype._getDialogXY=function(){
var e=Dwt.toWindow(this.getHtmlElement(),0,0);
return new DwtPoint(e.x+ZmGroupView.DIALOG_X,e.y+ZmGroupView.DIALOG_Y)
};
ZmGroupView.prototype._searchButtonListener=function(e){
this._offset=0;
this.search()
};
ZmGroupView.prototype._groupMembersSelectionListener=function(t){
var e=this._groupListView.getSelection();
this._delButton.setEnabled(e.length>0)
};
ZmGroupView.prototype._selectionListener=function(t){
var e=this._listview.getSelection();
if(t.detail==DwtListView.ITEM_DBL_CLICKED){
this._addItems(e)
}else{
this._addButton.setEnabled(e.length>0)
}};
ZmGroupView.prototype._selectChangeListener=function(e){
this._attr[ZmContact.F_folderId]=e._args.newValue;
this._isDirty=true
};
ZmGroupView.prototype._searchTypeListener=function(t){
var e=t._args.oldValue;
var a=t._args.newValue;
if(e!=a){
this._searchButtonListener()
}};
ZmGroupView.prototype._pageListener=function(e){
if(e.item==this._prevButton){
this._offset-=ZmContactsApp.SEARCHFOR_MAX
}else{
this._offset+=ZmContactsApp.SEARCHFOR_MAX
}
this.search()
};
ZmGroupView.prototype._delListener=function(a){
if(a.dwtObj==this._delButton){
var e=this._groupListView.getSelection();
var o=this._groupListView.getSelectedItems();
while(o.get(0)){
this._groupListView.removeItem(o.get(0));
o=this._groupListView.getSelectedItems()
}
for(var t=0;
t<e.length;
t++){
this._groupListView.getList().remove(e[t])
}}else{
this._groupListView.removeAll(true);
this._groupListView.getList().removeAll()
}
this._groupMembersSelectionListener();
this._isDirty=true
};
ZmGroupView.prototype._addNewListener=function(s){
var a=this._addNewField.value;
if(!a||a==""){
return
}
var n=AjxEmailAddress.parseEmailString(a);
if(n&&n.all){
var e=n.all.getArray();
var t=[];
for(var o=0;
o<e.length;
o++){
t[o]=e[o].toString()
}
this._setGroupMembersListView(t,true)
}
this._addNewField.value=""
};
ZmGroupView.prototype._addListener=function(e){
var t=(e.dwtObj==this._addButton)?this._listview.getSelection():this._listview.getList().getArray();
this._addItems(t)
};
ZmGroupView.prototype._addItems=function(o){
if(o.length==0){
return
}
var e=[];
for(var a=0;
a<o.length;
a++){
if(o[a].isGroup){
var n=o[a].address.split(AjxEmailAddress.SEPARATOR);
for(var t=0;
t<n.length;
t++){
e.push(n[t])
}}else{
e.push(o[a].toString())
}}
this._dedupe(e);
if(e.length>0){
this._setGroupMembersListView(e,true)
}};
ZmGroupView.prototype._setGroupMembersListView=function(a,e){
if(e){
var t=this._groupListView.getList();
a=a.concat(t?t.getArray():[])
}
this._groupListView.set(AjxVector.fromArray(a));
this._isDirty=true
};
ZmGroupView.prototype._dedupe=function(e){
var o=this._groupListView.getList();
if(o){
o=o.getArray();
var a=0;
while(true){
var n=false;
for(var t=0;
t<o.length;
t++){
if(e[a]==AjxStringUtil.trim(o[t])){
e.splice(a,1);
n=true;
break
}}
if(!n){
a++
}
if(a==e.length){
break
}}}};
ZmGroupView.prototype._setGroupMemberValue=function(t,e){
if(this._noManualEntry){
this._groupMembers.disabled=false
}
if(e){
this._groupMembers.value+=t
}else{
this._groupMembers.value=t
}
if(this._noManualEntry){
this._groupMembers.disabled=true
}};
ZmGroupView.prototype._handleResponseSearch=function(e){
var i=e.getResponse();
var t=i.getAttribute("more");
this._prevButton.setEnabled(this._offset>0);
this._nextButton.setEnabled(t);
var a=ZmContactsHelper._processSearchResponse(i);
this._listview.setItems(a);
this._addButton.setEnabled(a.length>0);
this._addAllButton.setEnabled(a.length>0);
this._searchButton.setEnabled(true)
};
ZmGroupView.prototype._tagChangeListener=function(t){
if(t.type!=ZmEvent.S_TAG){
return
}
var e=t.getDetail("fields");
var a=e&&(e[ZmOrganizer.F_COLOR]||e[ZmOrganizer.F_NAME]);
if((t.event==ZmEvent.E_MODIFY&&a)||t.event==ZmEvent.E_DELETE||t.event==ZmEvent.MODIFY){
this._setTags()
}};
ZmGroupView.prototype._groupChangeListener=function(e){
if(e.type!=ZmEvent.S_CONTACT){
return
}
if(e.event==ZmEvent.E_TAGS||e.event==ZmEvent.E_REMOVE_ALL){
this._setTags()
}};
ZmGroupView._onKeyUp=function(i){
i=DwtUiEvent.getEvent(i);
var a=DwtKeyEvent.getCharCode(i);
if(DwtKeyMapMgr.hasModifier(i)||DwtKeyMap.IS_MODIFIER[a]||a==DwtKeyMapMgr.TAB_KEYCODE){
return
}
var o=DwtUiEvent.getTarget(i);
var t=o?Dwt.getObjectFromElement(o):null;
if(t){
t._isDirty=true;
if(o.tagName.toLowerCase()=="input"){
t._setTitle(o.value)
}}
return true
};
ZmGroupView._keyPressHdlr=function(i){
i=DwtUiEvent.getEvent(i);
if(DwtKeyMapMgr.hasModifier(i)){
return
}
var o=DwtUiEvent.getTarget(i);
var a=o?Dwt.getObjectFromElement(o):null;
if(a){
var t=DwtKeyEvent.getCharCode(i);
if(t==13||t==3){
a._searchButtonListener(i);
return false
}}
return true
};
ZmGroupListView=function(e){
if(arguments.length==0){
return
}
DwtListView.call(this,{
parent:e,className:"DwtChooserListView",headerList:this._getHeaderList(e),view:e._view}
)
};
ZmGroupListView.prototype=new DwtListView;
ZmGroupListView.prototype.constructor=ZmGroupListView;
ZmGroupListView.prototype.setItems=function(e){
this._resetList();
this.addItems(e);
var t=this.getList();
if(t&&t.size()>0){
this.setSelection(t.get(0))
}};
ZmGroupListView.prototype._getHeaderList=function(){
return[(new DwtListHeaderItem({
field:ZmItem.F_TYPE,icon:"Contact",width:ZmMsg.COLUMN_WIDTH_TYPE_CN}
)),(new DwtListHeaderItem({
field:ZmItem.F_NAME,text:ZmMsg._name,width:ZmMsg.COLUMN_WIDTH_NAME_CN}
)),(new DwtListHeaderItem({
field:ZmItem.F_EMAIL,text:ZmMsg.email}
))]
};
ZmGroupListView.prototype._getCellContents=function(t,e,a,i,n,o){
return ZmContactsHelper._getEmailField(t,e,a,i,n,o)
};
ZmGroupListView.prototype._itemClicked=function(e,t){
if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){
return
}
DwtListView.prototype._itemClicked.call(this,e,t)
};
ZmGroupListView.prototype._mouseDownAction=function(e,t){
return !Dwt.ffScrollbarCheck(e)
};
ZmGroupListView.prototype._mouseUpAction=function(e,t){
return !Dwt.ffScrollbarCheck(e)
};
ZmGroupMembersListView=function(e){
if(arguments.length==0){
return
}
ZmGroupListView.call(this,e)
};
ZmGroupMembersListView.prototype=new ZmGroupListView;
ZmGroupMembersListView.prototype.constructor=ZmGroupMembersListView;
ZmGroupMembersListView.prototype._getHeaderList=function(){
return[(new DwtListHeaderItem({
field:ZmItem.F_EMAIL,text:ZmMsg.email,view:this._view}
))]
};
ZmGroupMembersListView.prototype._getCellContents=function(t,e,a,i,n,o){
if(i==ZmItem.F_EMAIL){
t[e++]=AjxStringUtil.htmlEncode(a,true)
}
return e
};
ZmGroupMembersListView.prototype._getItemId=function(e){
return(e&&e.id)?e.id:Dwt.getNextId()
}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmContactsBaseView")){
ZmContactsBaseView=function(e){
if(arguments.length==0){
return
}
e.posStyle=e.posStyle||Dwt.ABSOLUTE_STYLE;
e.type=ZmItem.CONTACT;
e.pageless=true;
ZmListView.call(this,e);
this._handleEventType[ZmItem.GROUP]=true
};
ZmContactsBaseView.prototype=new ZmListView;
ZmContactsBaseView.prototype.constructor=ZmContactsBaseView;
ZmContactsBaseView.prototype.toString=function(){
return"ZmContactsBaseView"
};
ZmContactsBaseView.prototype.set=function(i,a,t){
if(this._itemsToAdd){
this.addItems(this._itemsToAdd);
this._itemsToAdd=null
}else{
var e;
if(i instanceof ZmContactList){
i.addChangeListener(this._listChangeListener);
e=(i.isGal&&!i.isGalPagingSupported)?i.getVector().clone():i.getSubList(this.offset,this.getLimit(this.offset),t)
}else{
e=i
}
this._folderId=t;
DwtListView.prototype.set.call(this,e,a)
}
this._setRowHeight();
this._rendered=true;
if(this._isPageless){
this._checkItemCount()
}};
ZmContactsBaseView.prototype._setParticipantToolTip=function(e){};
ZmContactsBaseView.prototype.getListView=function(){
return this
};
ZmContactsBaseView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,this._controller.getApp().getDisplayName()].join(": ")
};
ZmContactsBaseView.prototype._changeListener=function(r){
var e=this._controller.getFolderId();
if(e!=null||r.event!=ZmEvent.E_MOVE){
ZmListView.prototype._changeListener.call(this,r);
if(r.event==ZmEvent.E_MODIFY){
this._modifyContact(r);
var o=r.item||r._details.items[0];
if(o instanceof ZmContact){
this.setSelection(o,false,true)
}}else{
if(r.event==ZmEvent.E_CREATE){
var s=r._details.items[0];
var a=appCtxt.getById(s.folderId);
var h=a&&(appCtxt.getActiveAccount().isMain?a.nId:a.id);
var t=r.getDetail("visible");
if(e&&a&&e==h&&t){
var i=r.getDetail("sortIndex");
if(i!=null){
this.addItem(s,i)
}
if(this instanceof ZmContactCardsView){
this._layout()
}
this.setSelection(s,false,true)
}else{
this.deselectAll();
this.setSelection(s,false,true)
}}else{
if(r.event==ZmEvent.E_DELETE){
var n=this._controller.getList();
if(n){
n.remove(r.item)
}}}}}};
ZmContactsBaseView.prototype.setSelection=function(i,t,e){
if(!i){
return
}
var a=this._getElFromItem(i);
if(a){
ZmListView.prototype.setSelection.call(this,i,t);
this._pendingSelection=null
}else{
if(e){
this._pendingSelection={
item:i,skipNotify:t}
}}};
ZmContactsBaseView.prototype.addItems=function(e){
ZmListView.prototype.addItems.call(this,e);
if(this._pendingSelection&&AjxUtil.indexOf(e,this._pendingSelection.item)!=-1){
this.setSelection(this._pendingSelection.item,this._pendingSelection.skipNotify)
}};
ZmContactsBaseView.prototype._modifyContact=function(e){
if(e.getDetail("fileAsChanged")){
this.getList().sort(ZmContact.compareByFileAs)
}};
ZmContactsBaseView.prototype._setNextSelection=function(){
if(this.firstSelIndex<0){
this.firstSelIndex=0
}
var t;
if(this._list){
t=this._list.get(this.firstSelIndex);
if(this._controller.getFolderId()==ZmFolder.ID_TRASH){
if(!t){
t=this._list.get(0)
}}else{
if(t==null||(t&&t.folderId==ZmFolder.ID_TRASH)){
t=null;
var o=this._list.getArray();
if(this.firstSelIndex>0&&this.firstSelIndex==o.length){
t=o[o.length-1]
}else{
for(var e=0;
e<o.length;
e++){
if(o[e].folderId!=ZmFolder.ID_TRASH){
t=o[e];
break
}}}
if(t){
var n=document.getElementById(this._getItemId(t));
if(n){
var a=this._data[n.id];
this.firstSelIndex=this._list?this._list.indexOf(a.item):-1
}}}}}
this.setSelection(t)
};
ZmContactAlphabetBar=function(e){
DwtComposite.call(this,{
parent:e}
);
this._createHtml();
this._all=this._current=document.getElementById(this._alphabetBarId).rows[0].cells[0];
this._currentLetter=null;
this.setSelected(this._all,true);
this._enabled=true
};
ZmContactAlphabetBar.prototype=new DwtComposite;
ZmContactAlphabetBar.prototype.constructor=ZmContactAlphabetBar;
ZmContactAlphabetBar.prototype.toString=function(){
return"ZmContactAlphabetBar"
};
ZmContactAlphabetBar.prototype.enable=function(e){
this._enabled=e;
var t=document.getElementById(this._alphabetBarId);
if(t){
t.className=e?"AlphabetBarTable":"AlphabetBarTable AlphabetBarDisabled"
}};
ZmContactAlphabetBar.prototype.enabled=function(){
return this._enabled
};
ZmContactAlphabetBar.prototype.reset=function(t){
var e=t||this._all;
if(e!=this._current){
this.setSelected(this._current,false);
this._current=e;
this._currentLetter=t?t.innerHTML:null;
this.setSelected(e,true);
return true
}
return false
};
ZmContactAlphabetBar.prototype.setButtonByIndex=function(t){
var a=document.getElementById(this._alphabetBarId);
var e=a.rows[0].cells[t];
if(e){
this.reset(e)
}};
ZmContactAlphabetBar.prototype.getCurrent=function(){
return this._current
};
ZmContactAlphabetBar.prototype.getCurrentLetter=function(){
return this._currentLetter
};
ZmContactAlphabetBar.prototype.setSelected=function(e,t){
e.className=t?"DwtButton-active AlphabetBarCell":"DwtButton AlphabetBarCell"
};
ZmContactAlphabetBar.alphabetClicked=function(t,i,e){
var a=AjxDispatcher.run("GetContactListController");
var o=a&&a.getParentView()&&a.getParentView().getAlphabetBar();
if(o&&o.enabled()){
if(o.reset(t)){
a.searchAlphabet(i,e)
}}};
ZmContactAlphabetBar.prototype._createHtml=function(){
this._alphabetBarId=this._htmlElId+"_alphabet";
var t=ZmMsg.alphabet.split(",");
var e={
id:this._htmlElId,alphabet:t,numLetters:t.length};
this.getHtmlElement().innerHTML=AjxTemplate.expand("abook.Contacts#ZmAlphabetBar",e)
};
ZmContactAlphabetBar._onMouseOver=function(e){
var t=AjxDispatcher.run("GetContactListController").getParentView().getAlphabetBar();
if(t.enabled()){
e.className="DwtButton-hover AlphabetBarCell"
}};
ZmContactAlphabetBar._onMouseOut=function(e){
var t=AjxDispatcher.run("GetContactListController").getParentView().getAlphabetBar();
if(t.enabled()){
t.setSelected(e,e==t.getCurrent())
}}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmContactCardsView")){
ZmContactCardsView=function(t){
t.className=t.className||"ZmContactCardsView";
t.posStyle=t.posStyle||Dwt.ABSOLUTE_STYLE;
t.view=ZmId.VIEW_CONTACT_CARDS;
ZmContactsBaseView.call(this,t);
this._setMouseEventHdlrs();
this._objectManager=new ZmObjectManager(this);
if(ZmMsg.alphabet&&ZmMsg.alphabet.length>0){
this._alphabetBar=new ZmContactAlphabetBar(this)
}
this.addControlListener(new AjxListener(this,this._controlListener));
this._addrbookTree=appCtxt.getFolderTree();
this._addrbookTree.addChangeListener(new AjxListener(this,this._addrbookTreeListener));
this._normalClass="ZmContactCard";
var e=DwtListView.ROW_CLASS;
this._selectedClass=[e,DwtCssStyle.SELECTED].join("-");
this._kbFocusClass=[e,DwtCssStyle.FOCUSED].join("-");
this._dndClass=[e,DwtCssStyle.DRAG_PROXY].join("-");
this._cardTableId=Dwt.getNextId();
if(AjxEnv.isIE){
this._noDndPlusImage=true
}
this._initialResized=false
};
ZmContactCardsView.prototype=new ZmContactsBaseView;
ZmContactCardsView.prototype.constructor=ZmContactCardsView;
ZmContactCardsView.CARD_NAME="__contactCard__";
ZmContactCardsView.prototype.toString=function(){
return"ZmContactCardsView"
};
ZmContactCardsView.prototype.replenish=function(e){
ZmContactsBaseView.prototype.replenish.call(this,e);
this._layout()
};
ZmContactCardsView.prototype.setUI=function(e){};
ZmContactCardsView.prototype.set=function(a,t,e){
if(this._objectManager){
this._objectManager.reset()
}
if(this._itemsToAdd){
this._list.addList(this._itemsToAdd);
this._itemsToAdd=null
}else{
ZmContactsBaseView.prototype.set.call(this,a,t,this._controller.getFolderId())
}
if(this._initialResized){
this._layout()
}
this._alphabetBar.enable(!a.isGal)
};
ZmContactCardsView.prototype._setRowHeight=function(){
if(!this._rowHeight){
ZmContactsBaseView.prototype._setRowHeight.call(this);
this._rowHeight=this._rowHeight&&Math.floor(this._rowHeight/2)
}};
ZmContactCardsView.prototype.getAlphabetBar=function(){
return this._alphabetBar
};
ZmContactCardsView.prototype._generateObject=function(t,e){
return this._objectManager.findObjects(t,true,e)
};
ZmContactCardsView.prototype._createItemHtml=function(c,n){
var e=!!(n&&n.isDragProxy);
var s=c.addrbook?c.addrbook.color:ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.ADDRBOOK];
var u;
var d;
if(appCtxt.get(ZmSetting.TAGGING_ENABLED)){
u=this._getFieldId(c,ZmItem.F_TAG_CELL);
var l=this._getFieldId(c,ZmItem.F_TAG);
d=AjxImg.getImageHtml(c.getTagImageInfo(),null,["id='",l,"'"].join(""))
}
var h=c.isGroup()?c.getGroupMembers().good.getArray():null;
var a=this._getItemId(c);
var i="";
if(n&&n.isDragProxy){
a=a+"_dnd";
if(AjxEnv.isIE){
i=AjxImg.getImageHtml("RoundPlus","position:absolute;top:18;left:-11;visibility:hidden")
}}
var o={
id:a,name:ZmContactCardsView.CARD_NAME,className:e?this._dndClass:this._normalClass,width:this._cardWidth,headerColor:(ZmOrganizer.COLOR_TEXT[s]+"Bg"),tagCellId:u,tagIcon:d,groupMembers:h,isDnd:e,view:this,contact:c,imgHtml:i};
var r=AjxTemplate.expand("abook.Contacts#CardBase",o);
var t=e?Dwt.parseHtmlFragment(r):r;
if(AjxEnv.isIE&&n&&n.isDragProxy){
Dwt.setSize(t,this._cardWidth||340,140)
}
return t
};
ZmContactCardsView.prototype._layout=function(){
this._resetListView();
if(this._list instanceof AjxVector&&this._list.size()){
var s=this._list.getArray();
var o={
id:this._htmlElId,cardTableId:this._cardTableId,list:s};
var a=AjxTemplate.expand("abook.Contacts#CardsView",o);
this.getHtmlElement().appendChild(Dwt.parseHtmlFragment(a));
for(var t=0;
t<s.length;
t++){
var e=s[t];
var h=this._htmlElId+"_contact_"+e.id;
var n=document.getElementById(h);
if(n){
n.innerHTML=this._createItemHtml(e);
var r=document.getElementById(this._getItemId(e));
this.associateItemWithElement(e,r)
}}}else{
var o={
id:this._cardTableId};
var a=AjxTemplate.expand("abook.Contacts#CardsView-NoResults",o);
this.getHtmlElement().appendChild(Dwt.parseHtmlFragment(a))
}
this._setRowHeight()
};
ZmContactCardsView.prototype._setNoResultsHtml=function(){};
ZmContactCardsView.prototype._resetListView=function(){
var a=document.getElementsByName(ZmContactCardsView.CARD_NAME);
var t;
for(var e=0;
e<a.length;
e++){
t=a[0].parentNode.removeChild(a[0]);
this._data[t.id]=null
}
var o=document.getElementById(this._cardTableId);
if(o){
o.parentNode.removeChild(o)
}};
ZmContactCardsView.prototype._modifyContact=function(e){
ZmContactsBaseView.prototype._modifyContact.call(this,e);
this._resetListView();
this._layout()
};
ZmContactCardsView.prototype._getElFromItem=function(o){
var a=document.getElementsByName(ZmContactCardsView.CARD_NAME);
var e=this._getItemId(o);
for(var t=0;
t<a.length;
t++){
if(a[t].id==e){
return a[t]
}}
return null
};
ZmContactCardsView.prototype._setDragProxyState=function(a){
if(this._dndImg||!AjxEnv.isLinux){
ZmContactsBaseView.prototype._setDragProxyState.call(this,a)
}else{
if(this._dndProxy){
var i=a?DwtCssStyle.DROPPABLE:DwtCssStyle.NOT_DROPPABLE;
var t=[i,DwtCssStyle.LINUX].join("-");
var e=this._getItemData(this._dndProxy,"origClassName");
this._dndProxy.className=[e,t].join(" ")
}}};
ZmContactCardsView.prototype._handleResponseLoad=function(t,e){
var o=document.getElementById(this._getItemId(e));
var i=this._createItemHtml(e);
var a=Dwt.parseHtmlFragment(i);
o.innerHTML=a.innerHTML
};
ZmContactCardsView.prototype._getSiblingElement=function(t,i){
var o=this.getItemFromElement(this._kbAnchor);
if(!o){
return t
}
var e=this._list.indexOf(o);
if((i&&(e>=this._list.size()-1))||(!i&&e<=0)){
return t
}
e=i?e+1:e-1;
var n=this._getItemId(this._list.get(e));
var a=document.getElementById(n);
return a?a:t
};
ZmContactCardsView.prototype._mouseDownListener=function(e){
var t=e.target;
if(t.id.indexOf("OBJ_")==0){
this._dragOp=Dwt.DND_DROP_NONE;
this._dragging=DwtControl._NO_DRAG
}else{
DwtListView.prototype._mouseDownListener.call(this,e)
}};
ZmContactCardsView.prototype._changeListener=function(a){
if(a.event==ZmEvent.E_DELETE||a.event==ZmEvent.E_MOVE){
var e=a.getDetail("items");
for(var t=0;
t<e.length;
t++){
this._list.remove(e[t])
}
this._controller._app._checkReplenishListView=this;
this._layout()
}else{
ZmContactsBaseView.prototype._changeListener.call(this,a);
this._setNextSelection()
}};
ZmContactCardsView.prototype._controlListener=function(e){
if(e.newWidth<0||e.oldWidth==e.newWidth){
return
}
this._cardWidth=Math.round((e.newWidth/2)-40);
this._initialResized=true;
this._layout()
};
ZmContactCardsView.prototype._addrbookTreeListener=function(a,t){
var e=a.getDetail("fields");
if(a.event==ZmEvent.E_MODIFY&&e&&e[ZmOrganizer.F_COLOR]){
this._layout()
}};
ZmContactCardsView._loadContact=function(t,o){
var e=appCtxt.cacheGet(o);
if(e&&!e.isLoaded){
var i=AjxDispatcher.run("GetContactListController");
var a=i.getParentView();
var n=new AjxCallback(a,a._handleResponseLoad);
e.load(n)
}
t.parentNode.parentNode.removeChild(t.parentNode)
};
ZmContactCardsView._moreDetailsCallback=function(t){
var e=appCtxt.getById(t);
if(e){
AjxDispatcher.run("GetContactController").show(e)
}}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmContactSplitView")){
ZmContactSplitView=function(a){
if(arguments.length==0){
return
}
a.className=a.className||"ZmContactSplitView";
a.posStyle=a.posStyle||Dwt.ABSOLUTE_STYLE;
DwtComposite.call(this,a);
this._controller=a.controller;
this.setScrollStyle(Dwt.CLIP);
this._changeListener=new AjxListener(this,this._contactChangeListener);
this._initialize(a.controller,a.dropTgt);
var t=appCtxt.getFolderTree();
if(t){
t.addChangeListener(new AjxListener(this,this._addrbookTreeListener))
}
var e=appCtxt.getTagTree();
if(e){
e.addChangeListener(new AjxListener(this,this._tagChangeListener))
}};
ZmContactSplitView.prototype=new DwtComposite;
ZmContactSplitView.prototype.constructor=ZmContactSplitView;
ZmContactSplitView.ALPHABET_HEIGHT=35;
ZmContactSplitView.prototype.toString=function(){
return"ZmContactSplitView"
};
ZmContactSplitView.prototype.getListView=function(){
return this._listPart
};
ZmContactSplitView.prototype.getController=function(){
return this._controller
};
ZmContactSplitView.prototype.getAlphabetBar=function(){
return this._alphabetBar
};
ZmContactSplitView.prototype.setSize=function(t,e){
DwtComposite.prototype.setSize.call(this,t,e);
this._sizeChildren(t,e)
};
ZmContactSplitView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,this._controller.getApp().getDisplayName()].join(": ")
};
ZmContactSplitView.prototype.getLimit=function(e){
return this._listPart.getLimit(e)
};
ZmContactSplitView.prototype.setContact=function(e,a){
if(!a){
if(this._contact){
this._contact.removeChangeListener(this._changeListener)
}
e.addChangeListener(this._changeListener)
}
var o=this._contact;
this._contact=e;
if(this._contact.isLoaded){
this._setContact(e,a,o)
}else{
var i=new AjxCallback(this,this._handleResponseLoad,[a,o]);
var t=new AjxCallback(this,this._handleErrorLoad);
this._contact.load(i,t)
}};
ZmContactSplitView.prototype._handleResponseLoad=function(a,i,t,e){
if(e.id==this._contact.id){
this._setContact(this._contact,a,i)
}};
ZmContactSplitView.prototype._handleErrorLoad=function(e){
this.clear()
};
ZmContactSplitView.prototype.clear=function(){
var e=document.getElementById(this._contactBodyId);
if(e){
e.innerHTML=""
}
if(this._contactView){
this._contactView.getHtmlElement().innerHTML=""
}
if(this._contactGroupView){
this._contactGroupView.getHtmlElement().innerHTML=""
}
this._setHeaderInfo(true)
};
ZmContactSplitView.prototype.enableAlphabetBar=function(e){
this._alphabetBar.enable(e)
};
ZmContactSplitView.prototype._initialize=function(t,e){
this.getHtmlElement().innerHTML=AjxTemplate.expand("abook.Contacts#SplitView",{
id:this._htmlElId}
);
var o=this._htmlElId+"_alphabetbar";
var i=document.getElementById(o);
if(i&&ZmMsg.alphabet&&ZmMsg.alphabet.length>0){
this._alphabetBar=new ZmContactAlphabetBar(this);
this._alphabetBar.reparentHtmlElement(o)
}
var n=this._htmlElId+"_listview";
var a=document.getElementById(n);
this._listPart=new ZmContactSimpleView({
parent:this,controller:t,dropTgt:e}
);
this._listPart.reparentHtmlElement(n);
this._iconCellId=this._htmlElId+"_icon";
this._titleCellId=this._htmlElId+"_title";
this._tagCellId=this._htmlElId+"_tags";
this._headerRowId=this._htmlElId+"_headerRow";
this._contactBodyId=this._htmlElId+"_body";
this._contactGroupView=new DwtComposite(this);
this._contactGroupView.setVisible(false);
this._contactGroupView.reparentHtmlElement(this._htmlElId+"_content");
this._contactGroupView._setMouseEventHdlrs();
this._groupObjectManager=new ZmObjectManager(this._contactGroupView);
this._contactView=new DwtComposite(this);
this._contactView.reparentHtmlElement(this._htmlElId+"_content");
this._contactView._setMouseEventHdlrs();
this._objectManager=new ZmObjectManager(this._contactView)
};
ZmContactSplitView.prototype._tabStateChangeListener=function(e){
this._setContact(this._contact,this._isGalSearch)
};
ZmContactSplitView.prototype._sizeChildren=function(o,e){
var a=document.getElementById(this._htmlElId+"_listview");
var i=Dwt.getSize(a);
this._listPart.setSize(i.x,e-38);
var n=AjxEnv.isIE?45:38;
var t=(this._contact&&this._contact.isGroup())?this._contactGroupView:this._contactView;
if(t){
t.setSize(Dwt.DEFAULT,e-n)
}};
ZmContactSplitView.prototype._contactChangeListener=function(e){
if(e.type!=ZmEvent.S_CONTACT||e.source!=this._contact||e.event==ZmEvent.E_DELETE){
return
}
this._setContact(e.source)
};
ZmContactSplitView.prototype._addrbookTreeListener=function(r,o){
if(!this._contact){
return
}
var t=r.getDetail("fields");
if(r.event==ZmEvent.E_MODIFY&&t&&t[ZmOrganizer.F_COLOR]){
var n=r.getDetail("organizers");
if(!n&&r.source){
n=[r.source]
}
for(var s=0;
s<n.length;
s++){
var e=n[s];
var a=this._contact.isShared()?appCtxt.getById(this._contact.folderId).id:this._contact.folderId;
if(e.id==a){
this._setHeaderInfo()
}}}};
ZmContactSplitView.prototype.__findObjects=function(e,a,t,i){
return e.findObjects(a,i,t)
};
ZmContactSplitView.prototype._setContact=function(e,s,r){
var t=e.folderId;
var n=t?appCtxt.getById(t):null;
var a=n?n.color:ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.ADDRBOOK];
var o={
id:this._htmlElId,contact:e,addrbook:e.getAddressBook(),contactHdrClass:(ZmOrganizer.COLOR_TEXT[a]+"Bg"),isInTrash:(n&&n.isInTrash())};
if(e.isGroup()){
this._groupObjectManager.reset();
o.folderIcon=e.addrbook.getIcon();
o.folderName=e.addrbook.getName();
o.groupMembers=e.getGroupMembers().all.getArray();
o.findObjects=AjxCallback.simpleClosure(this.__findObjects,this,this._groupObjectManager);
this._resetVisibility(true);
this._contactGroupView.getHtmlElement().innerHTML=AjxTemplate.expand("abook.Contacts#SplitViewGroup",o);
var i=this.getSize();
this._sizeChildren(i.x,i.y)
}else{
this._objectManager.reset();
o.view=this;
o.isGal=s;
o.findObjects=AjxCallback.simpleClosure(this.__findObjects,this,this._objectManager);
o.attrs=e.getNormalizedAttrs();
o.encode={};
o.encode.IM=AjxCallback.simpleClosure(this._encodeIM,this);
this._resetVisibility(false);
this._contactView.getHtmlElement().innerHTML=AjxTemplate.expand("abook.Contacts#SplitView_content",o);
appCtxt.notifyZimlets("onContactView",[e,this._htmlElId])
}
this._setHeaderInfo()
};
ZmContactSplitView.IM_RE_VALUE=/^(.*?):\/\/(.*)$/;
ZmContactSplitView.prototype._encodeIM=function(t){
var e=ZmContactSplitView.IM_RE_VALUE.exec(t);
if(e){
var a=[e[1],e[2],ZmMsg["AB_FIELD_",e[1]]];
return AjxMessageFormat.format(ZmMsg.AB_DISPLAY_IM,a)
}else{
return t
}};
ZmContactSplitView.prototype._resetVisibility=function(e){
this._contactView.setVisible(!e);
this._contactGroupView.setVisible(e)
};
ZmContactSplitView.prototype._getTagHtml=function(){
var n=[];
var h=0;
var e=this._contact.tags;
var o=[];
for(var a=0;
a<e.length;
a++){
o.push(appCtxt.getById(e[a]))
}
o.sort(ZmTag.sortCompare);
for(var t=0;
t<o.length;
t++){
var l=o[t];
if(!l){
continue
}
var r=ZmTag.COLOR_ICON[l.color];
var s=["id='",this._tagCellId,l.id,"'"].join("");
n[h++]="<a href='javascript:;' class='' onclick='ZmContactSplitView._tagClicked(";
n[h++]='"';
n[h++]=l.id;
n[h++]='"';
n[h++]="); return false;'>";
n[h++]=AjxImg.getImageSpanHtml(r,null,s,l.name);
n[h++]="</a>&nbsp;"
}
return n.join("")
};
ZmContactSplitView.prototype._setHeaderInfo=function(e){
var t=document.getElementById(this._tagCellId);
if(t){
t.innerHTML=e?"":this._getTagHtml()
}};
ZmContactSplitView.prototype._tagChangeListener=function(a){
if(a.type!=ZmEvent.S_TAG){
return
}
var e=a.getDetail("fields");
var i=e&&(e[ZmOrganizer.F_COLOR]||e[ZmOrganizer.F_NAME]);
if((a.event==ZmEvent.E_MODIFY&&i)||a.event==ZmEvent.E_DELETE||a.event==ZmEvent.MODIFY){
var t=document.getElementById(this._tagCellId);
t.innerHTML=this._getTagHtml()
}};
ZmContactSplitView._tagClicked=function(t){
var a=appCtxt.getSearchController();
if(a){
var e=appCtxt.getById(t);
if(e){
a.search({
query:e.createQuery()}
)
}}};
ZmContactSimpleView=function(e){
e.view=ZmId.VIEW_CONTACT_SIMPLE;
e.className="ZmContactSimpleView";
ZmContactsBaseView.call(this,e);
this._normalClass=DwtListView.ROW_CLASS+" SimpleContact";
this._selectedClass=[DwtListView.ROW_CLASS,DwtCssStyle.SELECTED].join("-")+" SimpleContact"
};
ZmContactSimpleView.prototype=new ZmContactsBaseView;
ZmContactSimpleView.prototype.constructor=ZmContactSimpleView;
ZmContactSimpleView.prototype.toString=function(){
return"ZmContactSimpleView"
};
ZmContactSimpleView.prototype.set=function(a,t,e){
var i=e||this._controller.getFolderId();
ZmContactsBaseView.prototype.set.call(this,a,t,i);
if(!(this._list instanceof AjxVector)||this._list.size()==0){
this.parent.clear()
}
this.parent.enableAlphabetBar(!(a&&a.isGal))
};
ZmContactSimpleView.prototype.setSelection=function(t,e){
if(!t){
this.parent.clear()
}
ZmContactsBaseView.prototype.setSelection.call(this,t,e)
};
ZmContactSimpleView.prototype._setNoResultsHtml=function(){
var t=document.createElement("div");
var e=this._controller._contactSearchResults;
if(e){
e=!(this._controller._currentSearch&&this._controller._currentSearch.folderId)
}
if((e||this._folderId==ZmFolder.ID_TRASH)&&AjxTemplate.getTemplate("abook.Contacts#SimpleView-NoResults-Search")){
t.innerHTML=AjxTemplate.expand("abook.Contacts#SimpleView-NoResults-Search")
}else{
t.innerHTML=AjxTemplate.expand("abook.Contacts#SimpleView-NoResults")
}
this._addRow(t);
this.parent.clear()
};
ZmContactSimpleView.prototype._changeListener=function(i){
ZmContactsBaseView.prototype._changeListener.call(this,i);
var t=this._controller.getFolderId();
if(!t&&i.event==ZmEvent.E_MOVE){
var e=i._details.items[0];
var a=appCtxt.getById(e.folderId);
var o=this._getElement(e,ZmItem.F_ITEM_ROW);
if(o){
o.className=(a&&a.isInTrash())?"Trash":""
}}};
ZmContactSimpleView.prototype._modifyContact=function(r){
ZmContactsBaseView.prototype._modifyContact.call(this,r);
if(appCtxt.get(ZmSetting.IM_ENABLED)&&ZmImApp.loggedIn()){
var e=r.getDetails().items,o=0,h;
while(h=e[o++]){
if(h instanceof ZmContact){
var t=h.getImPresence();
if(t){
var s=this._getFieldId(h,ZmItem.F_PRESENCE);
s=document.getElementById(s);
if(s){
AjxImg.setImage(s,t.getIcon(),true)
}}}}}
if(r.getDetail("fileAsChanged")){
var n=this.getSelection()[0];
this._layout();
this.setSelection(n,true)
}};
ZmContactSimpleView.prototype._layout=function(){
while(this._parentEl.hasChildNodes()){
cDiv=this._parentEl.removeChild(this._parentEl.firstChild);
this._data[cDiv.id]=null
}
var e=new Date();
var a=this._list.size();
for(var t=0;
t<a;
t++){
var o=this._list.get(t);
var n=o?this._createItemHtml(o,{
now:e}
):null;
if(n){
this._addRow(n)
}}};
ZmContactSimpleView.prototype._createItemHtml=function(s,a){
a=a||{};
if(a.isMixedView){
return ZmContactsBaseView.prototype._createItemHtml.apply(this,arguments)
}
var e=this._getDiv(s,a);
if(a.isDragProxy){
e.style.width="175px";
e.style.padding="4px"
}else{
e.className=this._normalClass+" SimpleContact"
}
var l=[];
var h=0;
h=this._getTable(l,h,a);
h=this._getRow(l,h,s,a);
if(appCtxt.get(ZmSetting.SHOW_SELECTION_CHECKBOX)){
l[h++]="<td style='vertical-align:middle;' width=20><center>";
h=this._getImageHtml(l,h,"CheckboxUnchecked",this._getFieldId(s,ZmItem.F_SELECTION));
l[h++]="</center></td>"
}
l[h++]="<td style='vertical-align:middle;' width=20><center>";
l[h++]=AjxImg.getImageHtml(s.getIcon());
l[h++]="</center></td>";
var i=AjxStringUtil.htmlEncode(s.getFileAs());
if(!i){
var t=s.getEmail();
if(!t||(t&&t.length==0)){
var r=ZmImAddress.parse(s.getIMAddress());
if(r){
t=r.screenName
}}
i=[AjxStringUtil.htmlEncode(ZmMsg.noName),t].join(" ")
}
l[h++]="<td style='vertical-align:middle;'>&nbsp;";
l[h++]=i;
l[h++]="</td>";
if(!a.isDragProxy){
if(s.isReadOnly()){
l[h++]="<td width=16>";
l[h++]=AjxImg.getImageHtml("ReadOnly");
l[h++]="</td>"
}else{
if(appCtxt.get(ZmSetting.TAGGING_ENABLED)){
l[h++]="<td style='vertical-align:middle;' width=16 class='Tag'>";
h=this._getImageHtml(l,h,s.getTagImageInfo(),this._getFieldId(s,ZmItem.F_TAG));
l[h++]="</td>"
}}}
if(appCtxt.get(ZmSetting.IM_ENABLED)){
l[h++]="<td style='vertical-align:middle' width=16 class='Presence'>";
var n=s.getImPresence();
var o=n?n.getIcon():"Blank_16";
h=this._getImageHtml(l,h,o,this._getFieldId(s,ZmItem.F_PRESENCE));
l[h++]="</td>"
}
l[h++]="</tr></table>";
e.innerHTML=l.join("");
return e
};
ZmContactSimpleView.prototype._getCellContents=function(a,t,e,i,n,o){
if(i==ZmItem.F_FROM){
a[t++]=AjxStringUtil.htmlEncode(e.getFileAs())
}else{
if(i==ZmItem.F_SUBJECT){
a[t++]=AjxStringUtil.htmlEncode(e.getCompanyField())
}else{
if(i==ZmItem.F_DATE){
a[t++]=AjxDateUtil.computeDateStr(o.now,e.modified)
}else{
t=ZmContactsBaseView.prototype._getCellContents.apply(this,arguments)
}}}
return t
};
ZmContactSimpleView.prototype._getToolTip=function(e){
return(e.item&&(e.field==ZmItem.F_FROM))?e.item.getToolTip(e.item.getAttr(ZmContact.F_email)):ZmContactsBaseView.prototype._getToolTip.apply(this,arguments)
};
ZmContactSimpleView.prototype._getDateToolTip=function(e,t){
t._dateStr=t._dateStr||this._getDateToolTipText(e.modified,["<b>",ZmMsg.lastModified,"</b><br>"].join(""));
return t._dateStr
}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmNewAddrBookDialog")){
ZmNewAddrBookDialog=function(a,t){
var i=ZmMsg.createNewAddrBook;
var e=ZmOrganizer.ADDRBOOK;
ZmNewOrganizerDialog.call(this,a,t,i,e)
};
ZmNewAddrBookDialog.prototype=new ZmNewOrganizerDialog;
ZmNewAddrBookDialog.prototype.constructor=ZmNewAddrBookDialog;
ZmNewAddrBookDialog.prototype.toString=function(){
return"ZmNewAddrBookDialog"
};
ZmNewAddrBookDialog.prototype._initColorSelect=function(){
var e=this._colorSelect.getOptionWithValue(ZmOrganizer.DEFAULT_COLOR[this._organizerType]);
this._colorSelect.setSelectedOption(e)
};
ZmNewAddrBookDialog.prototype._createRemoteContentHtml=function(t,e){
return e
};
ZmNewAddrBookDialog.prototype._setupFolderControl=function(){
ZmNewOrganizerDialog.prototype._setupFolderControl.call(this);
if(this._omit){
this._omit[ZmFolder.ID_TRASH]=true
}}
}
if(AjxPackage.define("zimbraMail.abook.view.ZmContactAssistant")){
ZmContactAssistant=function(){
ZmAssistant.call(this,ZmMsg.createNewContact,ZmMsg.ASST_CMD_CONTACT,ZmMsg.ASST_CMD_SUM_CONTACT);
this._commandIndex={};
this._sortedFields=[];
for(var e in ZmContactAssistant._CONTACT_FIELDS){
var t=ZmContactAssistant._CONTACT_FIELDS[e];
this._sortedFields.push(t.scmd);
this._commandIndex[t.scmd.toLowerCase()]=e;
this._commandIndex[t.lcmd.toLowerCase()]=e
}
this._sortedFields.sort()
};
ZmContactAssistant.prototype=new ZmAssistant();
ZmContactAssistant.prototype.constructor=ZmContactAssistant;
ZmContactAssistant.prototype._lookupField=function(e){
e=e.toLowerCase();
if(e in this._commandIndex){
return ZmContactAssistant._CONTACT_FIELDS[this._commandIndex[e]]
}else{
return null
}};
ZmContactAssistant._CONTACT_FIELDS=[{
scmd:ZmMsg.ASST_CONTACT_SHORT_firstName,lcmd:ZmMsg.ASST_CONTACT_LONG_firstName,field:ZmMsg.AB_FIELD_firstName,key:ZmContact.F_firstName,dontShow:true,capitalize:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_middleName,lcmd:ZmMsg.ASST_CONTACT_LONG_middleName,field:ZmMsg.AB_FIELD_middleName,key:ZmContact.F_middleName,dontShow:true,capitalize:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_lastName,lcmd:ZmMsg.ASST_CONTACT_LONG_lastName,field:ZmMsg.AB_FIELD_lastName,key:ZmContact.F_lastName,dontShow:true,capitalize:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_jobTitle,lcmd:ZmMsg.ASST_CONTACT_LONG_jobTitle,field:ZmMsg.AB_FIELD_jobTitle,key:ZmContact.F_jobTitle,capitalize:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_company,lcmd:ZmMsg.ASST_CONTACT_LONG_company,field:ZmMsg.AB_FIELD_company,key:ZmContact.F_company,capitalize:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_email,lcmd:ZmMsg.ASST_CONTACT_LONG_email,field:ZmMsg.AB_FIELD_email,key:ZmContact.F_email,defaultValue:ZmMsg.ASST_CONTACT_email}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_email2,lcmd:ZmMsg.ASST_CONTACT_LONG_email2,field:ZmMsg.AB_FIELD_email2,key:ZmContact.F_email2}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_email3,lcmd:ZmMsg.ASST_CONTACT_LONG_email3,field:ZmMsg.AB_FIELD_email3,key:ZmContact.F_email3}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workPhone,lcmd:ZmMsg.ASST_CONTACT_LONG_workPhone,field:ZmMsg.AB_FIELD_workPhone,key:ZmContact.F_workPhone,defaultValue:ZmMsg.ASST_CONTACT_phone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workPhone2,lcmd:ZmMsg.ASST_CONTACT_LONG_workPhone2,field:ZmMsg.AB_FIELD_workPhone2,key:ZmContact.F_workPhone2}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_mobilePhone,lcmd:ZmMsg.ASST_CONTACT_LONG_mobilePhone,field:ZmMsg.AB_FIELD_mobilePhone,key:ZmContact.F_mobilePhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_pager,lcmd:ZmMsg.ASST_CONTACT_LONG_pager,field:ZmMsg.AB_FIELD_pager,key:ZmContact.F_pager}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workFax,lcmd:ZmMsg.ASST_CONTACT_LONG_workFax,field:ZmMsg.AB_FIELD_workFax,key:ZmContact.F_workFax}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_assistantPhone,lcmd:ZmMsg.ASST_CONTACT_LONG_assistantPhone,field:ZmMsg.AB_FIELD_assistantPhone,key:ZmContact.F_assistantPhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_carPhone,lcmd:ZmMsg.ASST_CONTACT_LONG_carPhone,field:ZmMsg.AB_FIELD_carPhone,key:ZmContact.F_carPhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_companyPhone,lcmd:ZmMsg.ASST_CONTACT_LONG_companyPhone,field:ZmMsg.AB_FIELD_companyPhone,key:ZmContact.F_companyPhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_callbackPhone,lcmd:ZmMsg.ASST_CONTACT_LONG_callbackPhone,field:ZmMsg.AB_FIELD_callbackPhone,key:ZmContact.F_callbackPhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workAddress,lcmd:ZmMsg.ASST_CONTACT_LONG_workAddress,field:ZmMsg.AB_ADDR_WORK,key:"wa",multiLine:true,noHelp:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workStreet,lcmd:ZmMsg.ASST_CONTACT_LONG_workStreet,field:ZmMsg.AB_FIELD_workStreet,key:ZmContact.F_workStreet,defaultValue:ZmMsg.ASST_CONTACT_address}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workCity,lcmd:ZmMsg.ASST_CONTACT_LONG_workCity,field:ZmMsg.AB_FIELD_workCity,key:ZmContact.F_workCity}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workState,lcmd:ZmMsg.ASST_CONTACT_LONG_workState,field:ZmMsg.AB_FIELD_workState,key:ZmContact.F_workState}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workPostalCode,lcmd:ZmMsg.ASST_CONTACT_LONG_workPostalCode,field:ZmMsg.AB_FIELD_workPostalCode,key:ZmContact.F_workPostalCode}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workCountry,lcmd:ZmMsg.ASST_CONTACT_LONG_workCountry,field:ZmMsg.AB_FIELD_workCountry,key:ZmContact.F_workCountry}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_workURL,lcmd:ZmMsg.ASST_CONTACT_LONG_workURL,field:ZmMsg.AB_WORK_URL,key:ZmContact.F_workURL,defaultValue:ZmMsg.ASST_CONTACT_url}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homePhone,lcmd:ZmMsg.ASST_CONTACT_LONG_homePhone,field:ZmMsg.AB_FIELD_homePhone,key:ZmContact.F_homePhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homePhone2,lcmd:ZmMsg.ASST_CONTACT_LONG_homePhone2,field:ZmMsg.AB_FIELD_homePhone2,key:ZmContact.F_homePhone2}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeFax,lcmd:ZmMsg.ASST_CONTACT_LONG_homeFax,field:ZmMsg.AB_FIELD_homeFax,key:ZmContact.F_homeFax}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeAddress,lcmd:ZmMsg.ASST_CONTACT_LONG_homeAddress,field:ZmMsg.AB_ADDR_HOME,key:"ha",multiline:true,noHelp:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeStreet,lcmd:ZmMsg.ASST_CONTACT_LONG_homeStreet,field:ZmMsg.AB_FIELD_homeStreet,key:ZmContact.F_homeStreet}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeCity,lcmd:ZmMsg.ASST_CONTACT_LONG_homeCity,field:ZmMsg.AB_FIELD_homeCity,key:ZmContact.F_homeCity}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeState,lcmd:ZmMsg.ASST_CONTACT_LONG_homeState,field:ZmMsg.AB_FIELD_homeState,key:ZmContact.F_homeState}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homePostalCode,lcmd:ZmMsg.ASST_CONTACT_LONG_homePostalCode,field:ZmMsg.AB_FIELD_homePostalCode,key:ZmContact.F_homePostalCode}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeCountry,lcmd:ZmMsg.ASST_CONTACT_LONG_homeCountry,field:ZmMsg.AB_FIELD_homeCountry,key:ZmContact.F_homeCountry}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_homeURL,lcmd:ZmMsg.ASST_CONTACT_LONG_homeURL,field:ZmMsg.AB_HOME_URL,key:ZmContact.F_homeURL}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherPhone,lcmd:ZmMsg.ASST_CONTACT_LONG_otherPhone,field:ZmMsg.AB_FIELD_otherPhone,key:ZmContact.F_otherPhone}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherFax,lcmd:ZmMsg.ASST_CONTACT_LONG_otherFax,field:ZmMsg.AB_FIELD_otherFax,key:ZmContact.F_otherFax}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherAddress,lcmd:ZmMsg.ASST_CONTACT_LONG_otherAddress,field:ZmMsg.AB_ADDR_OTHER,key:"oa",multiLine:true,noHelp:true}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherStreet,lcmd:ZmMsg.ASST_CONTACT_LONG_otherStreet,field:ZmMsg.AB_FIELD_otherStreet,key:ZmContact.F_otherStreet}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherCity,lcmd:ZmMsg.ASST_CONTACT_LONG_otherCity,field:ZmMsg.AB_FIELD_otherCity,key:ZmContact.F_otherCity}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherState,lcmd:ZmMsg.ASST_CONTACT_LONG_otherState,field:ZmMsg.AB_FIELD_otherState,key:ZmContact.F_otherState}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherPostalCode,lcmd:ZmMsg.ASST_CONTACT_LONG_otherPostalCode,field:ZmMsg.AB_FIELD_otherPostalCode,key:ZmContact.F_otherPostalCode}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherCountry,lcmd:ZmMsg.ASST_CONTACT_LONG_otherCountry,field:ZmMsg.AB_FIELD_otherCountry,key:ZmContact.F_otherCountry}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_otherURL,lcmd:ZmMsg.ASST_CONTACT_LONG_otherURL,field:ZmMsg.AB_OTHER_URL,key:ZmContact.F_otherURL}
,{
scmd:ZmMsg.ASST_CONTACT_SHORT_notes,lcmd:ZmMsg.ASST_CONTACT_LONG_notes,field:ZmMsg.notes,key:ZmContact.F_notes,multiLine:true,defaultValue:ZmMsg.ASST_CONTACT_notes}
];
ZmContactAssistant._CONTACT_OBJECTS={};
ZmContactAssistant._CONTACT_OBJECTS[ZmObjectManager.URL]={
defaultType:"wu",aliases:{
w:"wu",h:"hu",o:"ou"}};
ZmContactAssistant._CONTACT_OBJECTS[ZmObjectManager.PHONE]={
defaultType:"wp",aliases:{
w:"wp",h:"hp",o:"op"}};
ZmContactAssistant._CONTACT_OBJECTS[ZmObjectManager.EMAIL]={
defaultType:"e"};
ZmContactAssistant._CONTACT_OBJECTS[ZmAssistant._BRACKETS]={
defaultType:"wa",aliases:{
w:"wa",h:"ha",o:"oa"}};
ZmContactAssistant._CONTACT_OBJECT_ORDER=[ZmAssistant._BRACKETS,ZmObjectManager.PHONE,ZmObjectManager.URL,ZmObjectManager.EMAIL];
ZmContactAssistant.prototype.extraButtonHandler=function(e){
var t=AjxDispatcher.run("GetContactController");
t.show(this.getContact(),true);
return true
};
ZmContactAssistant.prototype.okHandler=function(e){
var t=this.getContact();
t.create(t.getAttrs());
return true
};
ZmContactAssistant.prototype.getHelp=function(){
if(this._helpCommand==null){
var a=new AjxBuffer();
a.append("<div class='ZmAsstContactHelp'>");
a.append(ZmMsg.ASST_CONTACT_HELP);
a.append("<table cellspacing=1 cellpadding=2 border=0>");
a.append("<tr class=ZmAsstContactHelpHeader><td>","Short Name","</td><td>","Long Name","</td><td>","Contact Field","</td></tr>");
var e=ZmAssistant.getHandlerCommands();
for(var t in this._sortedFields){
var o=this._lookupField(this._sortedFields[t]);
if(o.noHelp){
continue
}
a.append("<tr><td><b>",AjxStringUtil.htmlEncode(o.scmd),"</b></td><td><b>",AjxStringUtil.htmlEncode(o.lcmd),"</b></td><td>",AjxStringUtil.htmlEncode(o.field),"</td></tr>")
}
a.append("</table></div>");
this._helpCommand=a.toString()
}
return this._helpCommand
};
ZmContactAssistant._ADDR_FIELDS={
home:[ZmContact.F_homeStreet,ZmContact.F_homeCity,ZmContact.F_homeState,ZmContact.F_homePostalCode,ZmContact.F_homeCountry],other:[ZmContact.F_otherStreet,ZmContact.F_otherCity,ZmContact.F_otherState,ZmContact.F_otherPostalCode,ZmContact.F_otherCountry],work:[ZmContact.F_workStreet,ZmContact.F_workCity,ZmContact.F_workState,ZmContact.F_workPostalCode,ZmContact.F_workCountry]};
ZmContactAssistant.prototype._parseAddress=function(s,n){
var e=ZmContactAssistant._ADDR_FIELDS[n];
var a=s.split(";");
for(var o=0;
o<a.length;
o++){
var t=a[o].replace(/^\s+/,"").replace(/\s+$/,"");
this._contactFields[e[o]]=(o==2)?t.toUpperCase():this._capitalize(t)
}};
ZmContactAssistant.prototype.getContact=function(){
var e=new ZmContact(null);
for(var t in this._contactFields){
if(this._contactFields[t]){
e.setAttr(t,this._contactFields[t])
}}
return e
};
ZmContactAssistant.prototype._capitalize=function(e){
var a=e.split(/\s+/);
for(var t=0;
t<a.length;
t++){
a[t]=a[t].substring(0,1).toUpperCase()+a[t].substring(1)
}
return a.join(" ")
};
ZmContactAssistant.prototype.handle=function(d,a,u){
d._setOkButton(AjxMsg.ok,true,true);
d._setExtraButton(ZmMsg.moreDetails,true,true);
var l,h;
this._contactFields={};
for(h=0;
h<ZmContactAssistant._CONTACT_OBJECT_ORDER.length;
h++){
var t=ZmContactAssistant._CONTACT_OBJECT_ORDER[h];
var r=ZmContactAssistant._CONTACT_OBJECTS[t];
while(l=this._matchTypedObject(u,t,r)){
var p=this._lookupField(l.type);
var m=p?p.key:l.type;
this._contactFields[m]=p.capitalize?this._capitalize(l.data):l.data;
u=l.args
}}
if(!this._contactFields.notes){
l=u.match(/\s*\(([^)]*)\)?\s*/);
if(l){
this._contactFields.notes=l[1];
u=u.replace(l[0]," ")
}}
while(l=u.match(/((\w+):\s*(.*?)\s*)(\w+:|$)/m)){
var n=l[2];
var y=l[3];
var p=this._lookupField(n);
if(p){
if(y==null){
y=""
}
this._contactFields[p.key]=(p.capitalize)?this._capitalize(y):y
}
u=u.replace(l[1],"")
}
var o=u.replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ");
if(this._contactFields[ZmContact.F_firstName]||this._contactFields[ZmContact.F_middleName]||this._contactFields[ZmContact.F_lastName]){
o=null;
if(this._contactFields[ZmContact.F_firstName]){
o=this._contactFields[ZmContact.F_firstName]
}
if(this._contactFields[ZmContact.F_middleName]){
if(o){
o+=" "
}
o+=this._contactFields[ZmContact.F_middleName]
}
if(this._contactFields[ZmContact.F_lastName]){
if(o){
o+=" "
}
o+=this._contactFields[ZmContact.F_lastName]
}}else{
var s=o.split(/\s+/);
for(var h=0;
h<s.length;
h++){
s[h]=s[h].substring(0,1).toUpperCase()+s[h].substring(1)
}
o=s.join(" ");
switch(s.length){
case 0:break;
case 1:this._contactFields[ZmContact.F_firstName]=s[0];
break;
case 2:this._contactFields[ZmContact.F_firstName]=s[0];
this._contactFields[ZmContact.F_lastName]=s[1];
break;
default:this._contactFields[ZmContact.F_firstName]=s.shift();
this._contactFields[ZmContact.F_middleName]=s.shift();
this._contactFields[ZmContact.F_lastName]=s.join(" ");
break
}}
if("wa" in this._contactFields){
this._parseAddress(this._contactFields.wa,"work");
delete this._contactFields.wa
}
if("ha" in this._contactFields){
this._parseAddress(this._contactFields.ha,"home");
delete this._contactFields.ha
}
if("oa" in this._contactFields){
this._parseAddress(this._contactFields.oa,"other");
delete this._contactFields.oa
}
var c,f;
c=this._setField(ZmMsg.AB_FIELD_fullName,o==""?ZmMsg.ASST_CONTACT_fullName:o,o=="",true);
for(var h=0;
h<ZmContactAssistant._CONTACT_FIELDS.length;
h++){
var p=ZmContactAssistant._CONTACT_FIELDS[h];
if(!p||p.dontShow){
continue
}
var g=this._contactFields[p.key];
if(g!=null){
g=p.multiLine?AjxStringUtil.convertToHtml(g):AjxStringUtil.htmlEncode(g)
}
if(p.defaultValue||g!=null){
var e=(g==null);
f=this._setField(p.field,e?p.defaultValue:g,e,false,c+1)
}else{
f=this._setOptField(p.field,g,false,false,c+1)
}
c=Math.max(c,f)
}
return
}
}
if(AjxPackage.define("zimbraMail.abook.controller.ZmContactListController")){
ZmContactListController=function(e,t){
ZmListController.call(this,e,t);
this._viewFactory={};
this._viewFactory[ZmId.VIEW_CONTACT_CARDS]=ZmContactCardsView;
this._viewFactory[ZmId.VIEW_CONTACT_SIMPLE]=ZmContactSplitView;
this._dragSrc=new DwtDragSource(Dwt.DND_DROP_MOVE);
this._dragSrc.addDragListener(new AjxListener(this,this._dragListener));
this._listChangeListener=new AjxListener(this,this._handleListChange);
this._listeners[ZmOperation.EDIT]=new AjxListener(this,this._editListener);
this._listeners[ZmOperation.PRINT]=null;
this._listeners[ZmOperation.PRINT_CONTACT]=new AjxListener(this,this._printContactListener);
this._listeners[ZmOperation.PRINT_ADDRBOOK]=new AjxListener(this,this._printAddrBookListener);
this._listeners[ZmOperation.CHECK_MAIL]=new AjxListener(this,this._syncAllListener);
this._parentView={}
};
ZmContactListController.prototype=new ZmListController;
ZmContactListController.prototype.constructor=ZmContactListController;
ZmContactListController.ICON={};
ZmContactListController.ICON[ZmId.VIEW_CONTACT_SIMPLE]="ListView";
ZmContactListController.ICON[ZmId.VIEW_CONTACT_CARDS]="CardsView";
ZmContactListController.MSG_KEY={};
ZmContactListController.MSG_KEY[ZmId.VIEW_CONTACT_SIMPLE]="contactList";
ZmContactListController.MSG_KEY[ZmId.VIEW_CONTACT_CARDS]="detailedCards";
ZmContactListController.SEARCH_TYPE_CANONICAL=1<<0;
ZmContactListController.SEARCH_TYPE_GAL=1<<1;
ZmContactListController.SEARCH_TYPE_NEW=1<<2;
ZmContactListController.SEARCH_TYPE_ANYWHERE=1<<3;
ZmContactListController.VIEWS=[ZmId.VIEW_CONTACT_SIMPLE,ZmId.VIEW_CONTACT_CARDS];
ZmContactListController.prototype.toString=function(){
return"ZmContactListController"
};
ZmContactListController.prototype.show=function(e,i,a){
this._searchType=i?ZmContactListController.SEARCH_TYPE_GAL:ZmContactListController.SEARCH_TYPE_CANONICAL;
this._folderId=a;
var n;
if(e instanceof ZmContactList){
this._list=e;
this._list._isShared=false;
if(!this._currentView){
this._currentView=this._defaultView()
}
n=this._listView[this._currentView]&&this._listView[this._currentView].getSelection();
this._contactSearchResults=false
}else{
if(e instanceof ZmSearchResult){
this._searchType|=ZmContactListController.SEARCH_TYPE_NEW;
this._list=e.getResults(ZmItem.CONTACT);
if(e.search&&e.search.isAnywhere){
this._searchType|=ZmContactListController.SEARCH_TYPE_ANYWHERE
}
if(e.search&&e.search.userText&&this.getParentView()){
this.getParentView().getAlphabetBar().reset()
}
if(i){
if(this._list==null){
this._list=new ZmContactList(e.search,true)
}
this._list._isShared=false;
this._list.isGalPagingSupported=AjxUtil.isSpecified(e.getAttribute("offset"))
}else{
var o=a?appCtxt.getById(a):null;
this._list._isShared=o?o.link:false
}
this._list.setHasMore(e.getAttribute("more"));
n=this._listView[this._currentView]&&this._listView[this._currentView].getSelection();
ZmListController.prototype.show.apply(this,[e,this._currentView]);
this._contactSearchResults=true
}}
var t=this._currentView;
if(this._listView[t]){
this._listView[t].offset=0
}
this.switchView(t,true);
if(n&&n.length&&this._listView[t]){
this._listView[t].setSelection(n[0])
}};
ZmContactListController.prototype.switchView=function(e,o,s,t){
if(e&&((e!=this._currentView)||o)){
this._currentView=e;
this._setup(e);
var i={};
i[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar[e];
i[ZmAppViewMgr.C_APP_CONTENT]=this._parentView[e];
if(!s){
this._initializeAlphabetBar(e)
}
this._setView({
view:e,elements:i,isAppView:true,stageView:t}
);
this._resetNavToolBarButtons(e);
if(this.isGalSearch()&&!this._list.isGalPagingSupported){
appCtxt.getSearchController().setDefaultSearchType(ZmId.SEARCH_GAL);
if(this._list.hasMore()){
var n=appCtxt.getMsgDialog();
n.setMessage(ZmMsg.errorSearchNotExpanded);
n.popup()
}}
this._setTabGroup(this._tabGroups[e]);
if(!s){
var a=this._listView[e].getList();
if(a){
this._listView[e].setSelection(a.get(0))
}}}};
ZmContactListController.prototype.getFolderId=function(){
return this._folderId
};
ZmContactListController.prototype.isGalSearch=function(){
return((this._searchType&ZmContactListController.SEARCH_TYPE_GAL)!=0)
};
ZmContactListController.prototype.getParentView=function(){
return this._parentView[this._currentView]
};
ZmContactListController.prototype.searchAlphabet=function(i,e){
var t=this._folderId||ZmFolder.ID_CONTACTS;
var a=appCtxt.getById(t);
var o=a?a.createQuery():null;
if(o){
var n={
query:o,types:[ZmItem.CONTACT],offset:0,limit:(this._listView[this._currentView].getLimit()),lastId:0,lastSortVal:i,endSortVal:e};
appCtxt.getSearchController().search(n)
}};
ZmContactListController.prototype._getMoreSearchParams=function(e){
e.endSortVal=this._activeSearch&&this._activeSearch.search&&this._activeSearch.search.endSortVal
};
ZmContactListController.prototype.getKeyMapName=function(){
return"ZmContactListController"
};
ZmContactListController.prototype.handleKeyAction=function(e){
switch(e){
case ZmKeyMap.EDIT:this._editListener();
break;
case ZmKeyMap.PRINT:if(appCtxt.get(ZmSetting.PRINT_ENABLED)){
this._printContactListener()
}
break;
case ZmKeyMap.PRINT_ALL:if(appCtxt.get(ZmSetting.PRINT_ENABLED)){
this._printAddrBookListener()
}
break;
default:return ZmListController.prototype.handleKeyAction.call(this,e)
}
return true
};
ZmContactListController.prototype.mapSupported=function(e){
return(e=="list")
};
ZmContactListController.prototype._getToolBarOps=function(){
var e=[ZmOperation.NEW_MENU,ZmOperation.SEP];
if(appCtxt.isOffline){
e.push(ZmOperation.CHECK_MAIL,ZmOperation.SEP)
}
e.push(ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.PRINT,ZmOperation.SEP,ZmOperation.TAG_MENU);
return e
};
ZmContactListController.prototype._getActionMenuOps=function(){
var e=this._participantOps();
e.push(ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.PRINT_CONTACT);
return e
};
ZmContactListController.prototype._getViewType=function(){
return this._currentView
};
ZmContactListController.prototype._defaultView=function(){
return(appCtxt.get(ZmSetting.CONTACTS_VIEW)=="cards")?ZmId.VIEW_CONTACT_CARDS:ZmId.VIEW_CONTACT_SIMPLE
};
ZmContactListController.prototype._createNewView=function(t){
var a={
parent:this._container,posStyle:Dwt.ABSOLUTE_STYLE,controller:this,dropTgt:this._dropTgt};
this._parentView[t]=new this._viewFactory[t](a);
var e=this._parentView[t].getListView();
e.setDragSource(this._dragSrc);
return e
};
ZmContactListController.prototype._getTagMenuMsg=function(e){
return(e==1)?ZmMsg.AB_TAG_CONTACT:ZmMsg.AB_TAG_CONTACTS
};
ZmContactListController.prototype._getMoveDialogTitle=function(e){
return(e==1)?ZmMsg.AB_MOVE_CONTACT:ZmMsg.AB_MOVE_CONTACTS
};
ZmContactListController.prototype._getMoveParams=function(r){
var s=ZmListController.prototype._getMoveParams.apply(this,arguments);
s.hideNewButton=!appCtxt.get(ZmSetting.NEW_ADDR_BOOK_ENABLED);
var n={};
var o=appCtxt.getFolderTree();
if(!o){
return s
}
var t=o.getByType(ZmOrganizer.ADDRBOOK);
for(var e=0;
e<t.length;
e++){
var a=t[e];
if(a.link&&a.isReadOnly()){
n[a.id]=true
}}
s.omit=n;
s.description=ZmMsg.targetAddressBook;
return s
};
ZmContactListController.prototype._getSearchFolderId=function(){
return this._folderId
};
ZmContactListController.prototype._initializeToolBar=function(e){
if(!this._toolbar[e]){
ZmListController.prototype._initializeToolBar.call(this,e);
this._setNewButtonProps(e,ZmMsg.createNewContact,"NewContact","NewContactDis",ZmOperation.NEW_CONTACT);
if(appCtxt.isOffline){
this._setupSendRecieveButton(e);
if(appCtxt.accountList.size()>2){
this._setupSendReceiveMenu(e)
}}
this._setupPrintMenu(e);
this._toolbar[e].addFiller();
this._initializeNavToolBar(e);
appCtxt.notifyZimlets("initializeToolbar",[this._app,this._toolbar[e],this,e],{
waitUntilLoaded:true}
)
}else{}};
ZmContactListController.prototype._initializeNavToolBar=function(e){
this._toolbar[e].addOp(ZmOperation.TEXT);
var t=this._itemCountText[e]=this._toolbar[e].getButton(ZmOperation.TEXT);
t.addClassName("itemCountText")
};
ZmContactListController.prototype._initializeActionMenu=function(e){
ZmListController.prototype._initializeActionMenu.call(this);
var t=this._actionMenu.getItemById(ZmOperation.KEY_ID,ZmOperation.PRINT_CONTACT);
if(t){
t.setText(ZmMsg.print)
}
ZmOperation.setOperation(this._actionMenu,ZmOperation.CONTACT,ZmOperation.EDIT_CONTACT)
};
ZmContactListController.prototype._initializeAlphabetBar=function(t){
if(t==this._currentView){
return
}
var i=this._parentView[this._currentView];
var n=i?i.getAlphabetBar():null;
var o=n?n.getCurrent():null;
var e=o?o.getAttribute("_idx"):null;
if(e){
var a=this._parentView[t].getAlphabetBar();
if(a){
a.setButtonByIndex(e)
}}};
ZmContactListController.prototype._setViewContents=function(e){
this._list.removeChangeListener(this._listChangeListener);
this._list.addChangeListener(this._listChangeListener);
this._listView[e].set(this._list,null,this._folderId)
};
ZmContactListController.prototype._setupSendRecieveButton=function(e){
var t=this._toolbar[e].getButton(ZmOperation.CHECK_MAIL);
var i=appCtxt.isOffline?ZmMsg.sendReceive:ZmMsg.checkMail;
t.setText(i);
var a;
if(appCtxt.isOffline){
a=ZmMsg.sendReceive
}else{
a=(appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT)?ZmMsg.checkMailPrefDefault:ZmMsg.checkMailPrefUpdate
}
t.setToolTipContent(a)
};
ZmContactListController.prototype._handleSyncAll=function(){
if(appCtxt.get(ZmSetting.OFFLINE_SHOW_ALL_MAILBOXES)&&appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT){
this._app.getOverviewContainer().highlightAllMboxes()
}};
ZmContactListController.prototype._syncAllListener=function(e){
var t=new AjxCallback(this,this._handleSyncAll);
appCtxt.accountList.syncAll(t)
};
ZmContactListController.prototype._setupSendReceiveMenu=function(e){
var t=this._toolbar[e].getButton(ZmOperation.CHECK_MAIL);
if(!t){
return
}
t.setMenu(new AjxCallback(this,this._setupSendReceiveMenuItems,[this._toolbar,t]))
};
ZmContactListController.prototype._setupSendReceiveMenuItems=function(l,a){
var t=new ZmPopupMenu(a,null,null,this);
a.setMenu(t);
var o=new AjxListener(this,this._sendReceiveListener);
var r=appCtxt.accountList.visibleAccounts;
for(var n=0;
n<r.length;
n++){
var h=r[n];
if(h.isMain){
continue
}
var e=[ZmOperation.CHECK_MAIL,h.id].join("-");
var s=t.createMenuItem(e,{
image:h.getIcon(),text:h.getDisplayName()}
);
s.setData(ZmOperation.MENUITEM_ID,h.id);
s.addSelectionListener(o)
}
return t
};
ZmContactListController.prototype._sendReceiveListener=function(e){
var t=appCtxt.accountList.getAccount(e.item.getData(ZmOperation.MENUITEM_ID));
if(t){
t.sync()
}};
ZmContactListController.prototype._handleListChange=function(t){
if(t.event==ZmEvent.E_MODIFY||t.event==ZmEvent.E_CREATE){
var e=t&&t._details&&t._details.items&&t._details.items.length&&t._details.items[0];
if(e instanceof ZmContact&&this._currentView==ZmId.VIEW_CONTACT_SIMPLE){
this._parentView[this._currentView].setContact(e,this.isGalSearch())
}}};
ZmContactListController.prototype._setupViewMenu=function(e,r){
var o;
if(r){
o=this._toolbar[e].getButton(ZmOperation.VIEW_MENU);
var n=o.getMenu();
if(!n){
n=new ZmPopupMenu(o);
o.setMenu(n);
for(var a=0;
a<ZmContactListController.VIEWS.length;
a++){
var s=ZmContactListController.VIEWS[a];
var t=n.createMenuItem(s,{
image:ZmContactListController.ICON[s],text:ZmMsg[ZmContactListController.MSG_KEY[s]],style:DwtMenuItem.RADIO_STYLE}
);
t.setData(ZmOperation.MENUITEM_ID,s);
t.addSelectionListener(this._listeners[ZmOperation.VIEW]);
if(s==e){
t.setChecked(true,true)
}}}}else{
o=this._toolbar[e].getButton(ZmOperation.VIEW_MENU);
var n=o?o.getMenu():null;
var t=n?n.getItemById(ZmOperation.MENUITEM_ID,e):null;
if(t){
t.setChecked(true,true)
}}
o.setImage(ZmContactListController.ICON[e])
};
ZmContactListController.prototype._setupPrintMenu=function(t){
var e=this._toolbar[t].getButton(ZmOperation.PRINT);
if(!e){
return
}
e.setToolTipContent(ZmMsg.printMultiTooltip);
e.noMenuBar=true;
var i=new ZmPopupMenu(e);
e.setMenu(i);
var o=ZmOperation.PRINT_CONTACT;
var a=i.createMenuItem(o,{
image:ZmOperation.getProp(o,"image"),text:ZmMsg[ZmOperation.getProp(o,"textKey")]}
);
a.setData(ZmOperation.MENUITEM_ID,o);
a.addSelectionListener(this._listeners[ZmOperation.PRINT_CONTACT]);
o=ZmOperation.PRINT_ADDRBOOK;
a=i.createMenuItem(o,{
image:ZmOperation.getProp(o,"image"),text:ZmMsg[ZmOperation.getProp(o,"textKey")]}
);
a.setData(ZmOperation.MENUITEM_ID,o);
a.addSelectionListener(this._listeners[ZmOperation.PRINT_ADDRBOOK])
};
ZmContactListController.prototype._resetOperations=function(c,o){
var a;
if(c instanceof ZmButtonToolBar){
var h=c.getButton(ZmOperation.PRINT);
var i=h&&h.getMenu();
if(i){
a=i.getItem(1);
a.setText(ZmMsg.printResults)
}}
var r=(c instanceof ZmActionMenu)?ZmOperation.PRINT_CONTACT:ZmOperation.PRINT;
if(!this.isGalSearch()){
c.enable([ZmOperation.SEARCH,ZmOperation.BROWSE,ZmOperation.NEW_MENU,ZmOperation.VIEW_MENU],true);
c.enable(r,o>0);
if(this._folderId){
var t=appCtxt.getById(this._folderId);
var l=t&&t.link;
var s=t&&t.isInTrash();
var e=(t==null||!t.isReadOnly());
c.enable([ZmOperation.TAG_MENU],(!l&&o>0));
c.enable([ZmOperation.DELETE,ZmOperation.MOVE],e&&o>0);
c.enable([ZmOperation.EDIT,ZmOperation.CONTACT],e&&o==1&&!s);
if(a){
var d=l?ZmMsg.printResults:ZmMsg.printAddrBook;
a.setText(d)
}}else{
var n=this._listView[this._currentView].getSelection()[0];
var e=(o==1&&!n.isReadOnly()&&!ZmContact.isInTrash(n));
c.enable([ZmOperation.DELETE,ZmOperation.MOVE,ZmOperation.TAG_MENU],o>0);
c.enable([ZmOperation.EDIT,ZmOperation.CONTACT],e)
}}else{
c.enableAll(false);
c.enable([ZmOperation.SEARCH,ZmOperation.BROWSE,ZmOperation.NEW_MENU,ZmOperation.VIEW_MENU],true);
c.enable([ZmOperation.NEW_MESSAGE,r],o>0);
c.enable(ZmOperation.CONTACT,o==1)
}};
ZmContactListController.prototype._participantSearchListener=function(e){
var t=this._actionEv.contact.getEmails();
appCtxt.getSearchController().fromSearch(t)
};
ZmContactListController.prototype._listSelectionListener=function(t){
ZmListController.prototype._listSelectionListener.call(this,t);
if(t.detail==DwtListView.ITEM_SELECTED){
this._resetNavToolBarButtons(this._currentView);
if(this._currentView==ZmId.VIEW_CONTACT_SIMPLE){
this._parentView[this._currentView].setContact(t.item,this.isGalSearch())
}}else{
if(t.detail==DwtListView.ITEM_DBL_CLICKED){
var e=appCtxt.getById(t.item.folderId);
if(!this.isGalSearch()&&(!e||(!e.isReadOnly()&&!e.isInTrash()))){
AjxDispatcher.run("GetContactController").show(t.item)
}}}};
ZmContactListController.prototype._newListener=function(e,a,t){
if(!e&&!a){
return
}
a=a||e.item.getData(ZmOperation.KEY_ID);
if(a==ZmOperation.NEW_MESSAGE){
this._participantComposeListener(e)
}else{
ZmListController.prototype._newListener.call(this,e,a,t)
}};
ZmContactListController.prototype._participantComposeListener=function(s){
var n=this._listView[this._currentView].getSelection();
if(n.length==0&&this._actionEv){
n.push(this._actionEv.contact)
}
var a="",e,t;
for(var o=0;
o<n.length;
o++){
e=n[o];
t=e.isGroup()?e.getGroupMembers().good:e.getEmail();
if(t){
t=e.isGroup()?t:new AjxEmailAddress(t);
t=t.toString(AjxEmailAddress.SEPARATOR)+AjxEmailAddress.SEPARATOR;
a+=t
}}
AjxDispatcher.run("Compose",{
action:ZmOperation.NEW_MESSAGE,inNewWindow:this._app._inNewWindow(s),toOverride:a}
)
};
ZmContactListController.prototype._listActionListener=function(o){
ZmListController.prototype._listActionListener.call(this,o);
var e=this._actionEv.contact=o.item;
var a=e.isGroup()?e.getGroupMembers().good:e.getEmail();
this._actionEv.address=e.isGroup()?a:new AjxEmailAddress(a);
var t=a!=null&&this._listView[this._currentView].getSelectionCount()==1;
var n=this.getActionMenu();
n.enable([ZmOperation.SEARCH,ZmOperation.BROWSE],t);
if(e.isGroup()){
n.enable([ZmOperation.SEARCH,ZmOperation.BROWSE],false);
ZmOperation.setOperation(n,ZmOperation.CONTACT,ZmOperation.EDIT_CONTACT,ZmMsg.AB_EDIT_GROUP)
}else{
this._setContactText(!this.isGalSearch());
if(appCtxt.get(ZmSetting.IM_ENABLED)){
var i=n.getOp(ZmOperation.IM);
ZmImApp.updateImMenuItemByContact(i,e)
}}
ZmOperation.setOperation(n,ZmOperation.TAG_MENU,ZmOperation.TAG_MENU,e.isGroup()?ZmMsg.AB_TAG_GROUP:ZmMsg.AB_TAG_CONTACT);
n.popup(0,o.docX,o.docY);
if(o.ersatz){
n.setSelectedItem(0)
}};
ZmContactListController.prototype._dropListener=function(a){
var e=this._listView[this._currentView];
var t=e.getTargetItem(a);
if(a.action==DwtDropEvent.DRAG_ENTER){
if(t&&(t.type==ZmItem.CONTACT)&&(t.isGal||t.isShared())){
a.doIt=false;
e.dragSelect(div);
return
}}
ZmListController.prototype._dropListener.call(this,a)
};
ZmContactListController.prototype._editListener=function(t){
var e=this._listView[this._currentView].getSelection()[0];
AjxDispatcher.run("GetContactController").show(e,false)
};
ZmContactListController.prototype._printContactListener=function(n){
var h=this._listView[this._currentView].getSelection();
var o=[];
for(var a=0;
a<h.length;
a++){
o.push(h[a].id)
}
var t="/h/printcontacts?id="+o.join(",");
if(this.isGalSearch()){
t="/h/printcontacts?id="+o.join("&id=");
t=t+"&st=gal";
var r=this._currentSearch&&this._currentSearch.query;
if(r){
t+="&sq="+r
}}
if(appCtxt.isOffline){
var e=this._folderId||ZmFolder.ID_CONTACTS;
var s=appCtxt.getById(e).getAccount().name;
t+="&acct="+s
}
window.open(appContextPath+t,"_blank")
};
ZmContactListController.prototype._printAddrBookListener=function(h){
var t;
if(this._folderId&&!this._list._isShared){
t="/h/printcontacts?sfi="+this._folderId
}else{
var l=((this._searchType&ZmContactListController.SEARCH_TYPE_ANYWHERE)!=0)?AjxDispatcher.run("GetContacts"):this._list;
var e=[];
var s=l.getArray();
for(var n=0;
n<s.length;
n++){
e.push(s[n].id)
}
t="/h/printcontacts";
if(this.isGalSearch()){
t+="?id="+e.join("&id=")
}else{
t+="?id="+e.join(",")
}}
if(this.isGalSearch()){
t=t+"&st=gal";
var r=this._currentSearch&&this._currentSearch.query;
if(r){
t+="&sq="+r
}}
if(appCtxt.isOffline){
var o=this._folderId||ZmFolder.ID_CONTACTS;
var a=appCtxt.getById(o).getAccount().name;
t+="&acct="+a
}
window.open(appContextPath+t,"_blank")
};
ZmContactListController.prototype._preShowCallback=function(e){
if((this._searchType&ZmContactListController.SEARCH_TYPE_NEW)!=0){
this._searchType&=~ZmContactListController.SEARCH_TYPE_NEW
}else{
this._resetNavToolBarButtons(e)
}
return true
};
ZmContactListController.prototype._doMove=function(m,a,p,l){
m=AjxUtil.toArray(m);
var n=[];
var t=[];
var f=[];
for(var h=0;
h<m.length;
h++){
var g=m[h];
if(g.isGal){
f.push(g)
}else{
if(!g.folderId||g.folderId!=a.id){
if(!this._isItemMovable(g,l,a)){
t.push(g)
}else{
n.push(g)
}}}}
var d=appCtxt.getById(this.getFolderId());
var e=(d&&d.isInTrash()&&!a.isInTrash());
var y=new AjxCallback(this,this._checkItemCount);
if(n.length){
var s={
items:n,folder:a,attrs:p,outOfTrash:e};
var u=this._setupContinuation(this._doMove,[a,p,l],s,y);
u=e?this._list:u;
u.moveItems(s)
}
if(t.length){
var s={
items:t,folder:a,attrs:p};
var u=this._setupContinuation(this._doMove,[a,p,l],s,y);
u=e?this._list:u;
u.copyItems(s)
}
if(f.length){
var o=new ZmBatchCommand(true,null,true);
for(var r=0;
r<f.length;
r++){
var c=f[r];
c.attr[ZmContact.F_folderId]=a.id;
o.add(new AjxCallback(c,c.create,[c.attr]))
}
o.run(new AjxCallback(this,this._handleMoveFromGal))
}};
ZmContactListController.prototype._handleMoveFromGal=function(e){
var a=e.getResponse().BatchResponse.CreateContactResponse;
if(a!=null&&a.length>0){
var t=AjxMessageFormat.format(ZmMsg.itemCopied,a.length);
appCtxt.getAppController().setStatusMsg(t)
}};
ZmContactListController.prototype._doDelete=function(t,e,a){
ZmListController.prototype._doDelete.call(this,t,e,a);
var i=this._listView[this._currentView].getSelectedItems().size();
if(i==0){
if(this._currentView==ZmId.VIEW_CONTACT_SIMPLE){
this._listView[this._currentView].parent.clear()
}
this._resetOperations(this._toolbar[this._currentView],0)
}};
ZmContactListController.prototype._moveListener=function(e){
ZmListController.prototype._moveListener.call(this,e)
};
ZmContactListController.prototype._checkReplenish=function(){
var e=this._listView[this._currentView];
e.set(this._list);
e._setNextSelection()
}
}
if(AjxPackage.define("zimbraMail.abook.controller.ZmContactController")){
ZmContactController=function(e,t){
ZmListController.call(this,e,t);
this._listeners[ZmOperation.SAVE]=new AjxListener(this,this._saveListener);
this._listeners[ZmOperation.CANCEL]=new AjxListener(this,this._cancelListener);
this._tabGroupDone={}
};
ZmContactController.prototype=new ZmListController();
ZmContactController.prototype.constructor=ZmContactController;
ZmContactController.prototype.toString=function(){
return"ZmContactController"
};
ZmContactController.prototype.show=function(e,a){
if(!this._editPageLoaded){
this._app.pushView(ZmId.VIEW_LOADING,true)
}
this._contact=e;
this._currentView=this._getViewType();
if(a){
this._contactDirty=true
}
this._list=e.list;
if(this._listView[this._currentView]){
this._listView[this._currentView].enableInputs(true)
}
this._setup(this._currentView);
this._resetOperations(this._toolbar[this._currentView],1);
var t={};
t[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar[this._currentView];
t[ZmAppViewMgr.C_APP_CONTENT]=this._listView[this._currentView];
this._setView({
view:this._currentView,elements:t,isTransient:true,stageView:!this._editPageLoaded}
);
if(!this._editPageLoaded){
this._app.popView(true,ZmId.VIEW_LOADING,true)
}
this._editPageLoaded=true
};
ZmContactController.prototype.getKeyMapName=function(){
return"ZmContactController"
};
ZmContactController.prototype.handleKeyAction=function(e){
switch(e){
case ZmKeyMap.SAVE:this._saveListener();
break;
case ZmKeyMap.CANCEL:this._cancelListener();
break
}
return true
};
ZmContactController.prototype.enableToolbar=function(e){
if(e){
this._resetOperations(this._toolbar[this._currentView],1)
}else{
this._toolbar[this._currentView].enableAll(e)
}};
ZmContactController.prototype._getToolBarOps=function(){
return[ZmOperation.SAVE,ZmOperation.CANCEL,ZmOperation.SEP,ZmOperation.PRINT,ZmOperation.DELETE,ZmOperation.SEP,ZmOperation.TAG_MENU]
};
ZmContactController.prototype._getActionMenuOps=function(){
return null
};
ZmContactController.prototype._getViewType=function(){
if(this._contact.isGroup()){
return ZmId.VIEW_GROUP
}else{
return ZmId.VIEW_CONTACT
}};
ZmContactController.prototype._initializeListView=function(e){
if(!this._listView[e]){
switch(e){
case ZmId.VIEW_CONTACT:this._listView[e]=new ZmEditContactView(this._container,this);
break;
case ZmId.VIEW_GROUP:this._listView[e]=new ZmGroupView(this._container,this);
break
}}};
ZmContactController.prototype._initializeToolBar=function(a){
ZmListController.prototype._initializeToolBar.call(this,a);
var t=this._toolbar[a];
var o=t.getButton(ZmOperation.CANCEL);
if(this._contact.id==undefined||this._contact.isGal){
o.setText(ZmMsg.cancel);
o.setImage("Cancel")
}else{
o.setText(ZmMsg.close);
o.setImage("Close")
}
var e=t.getButton(ZmOperation.PRINT);
if(e){
e.setText(ZmMsg.print)
}
var i=t.getButton(ZmOperation.SAVE);
if(i){
i.setToolTipContent(ZmMsg.saveContactTooltip)
}
appCtxt.notifyZimlets("initializeToolbar",[this._app,t,this,a],{
waitUntilLoaded:true}
)
};
ZmContactController.prototype._getTagMenuMsg=function(){
return ZmMsg.AB_TAG_CONTACT
};
ZmContactController.prototype._setViewContents=function(e){
var t=this._listView[e];
t.set(this._contact,this._contactDirty);
if(this._contactDirty){
delete this._contactDirty
}
this._tabGroup=this._tabGroups[e]
};
ZmContactController.prototype._createTabGroup=function(){
var e=this._currentView;
return this._tabGroups[e]=new DwtTabGroup(this.toString()+"_"+e)
};
ZmContactController.prototype._initializeTabGroup=function(e){
if(this._tabGroups[e]){
return
}
ZmListController.prototype._initializeTabGroup.apply(this,arguments);
var t=this._toolbar[e];
if(t){
this._tabGroups[e].addMember(t,0)
}};
ZmContactController.prototype._paginate=function(e,t){};
ZmContactController.prototype._resetOperations=function(t,e){
if(!t){
return
}
if(this._contact.id==undefined||this._contact.isGal){
t.enableAll(false);
t.enable([ZmOperation.SAVE,ZmOperation.CANCEL],true)
}else{
if(this._contact.isShared()){
t.enableAll(true);
t.enable(ZmOperation.TAG_MENU,false)
}else{
ZmListController.prototype._resetOperations.call(this,t,e)
}}};
ZmContactController.prototype._saveListener=function(g,w){
var d=false;
var l=this._listView[this._currentView];
if(l instanceof DwtForm){
l.validate()
}
if(!l.isValid()){
var f=l.getInvalidItems();
for(var m=0;
m<f.length;
m++){
n=l.getErrorMessage(f[m]);
if(AjxUtil.isString(n)){
n=n?AjxMessageFormat.format(ZmMsg.errorSavingWithMessage,n):ZmMsg.errorSaving;
var o=appCtxt.getMsgDialog();
if(o){
o.setMessage(n,DwtMessageDialog.CRITICAL_STYLE);
o.popup()
}else{
appCtxt.setStatusMsg(n,ZmStatusView.LEVEL_CRITICAL)
}
return
}}
return
}
var e=l.getModifiedAttrs();
l.enableInputs(false);
if(e){
var u=l.getContact();
var t=e[ZmContact.F_folderId];
var h=t?appCtxt.getById(t):null;
if(u.id!=null&&t&&(u.isShared()||(h&&h.link))){
for(var b in e){
if(b!=ZmContact.F_folderId){
u.attr[b]=e[b]
}}
u._setFolder(t)
}else{
if(u.id&&!u.isGal){
if(l.isEmpty()){
var o=appCtxt.getMsgDialog();
o.setMessage(ZmMsg.emptyContactSave,DwtMessageDialog.CRITICAL_STYLE);
o.popup();
l.enableInputs(true);
w=true
}else{
var y=ZmContact.computeFileAs(u);
var s=ZmContact.computeFileAs(AjxUtil.hashUpdate(AjxUtil.hashCopy(u.getAttrs()),e,true));
this._doModify(u,e);
if(y.toLowerCase()[0]!=s.toLowerCase()[0]){
d=true
}}}else{
var c=true;
for(var b in e){
if(e[b]){
c=false;
break
}}
if(c){
var n=this._currentView==ZmId.VIEW_GROUP?ZmMsg.emptyGroup:ZmMsg.emptyContact;
appCtxt.setStatusMsg(n,ZmStatusView.LEVEL_WARNING)
}else{
var r=AjxDispatcher.run("GetContactListController");
var p=(r&&r.getList())||new ZmContactList(null);
d=true;
this._doCreate(p,e)
}}}}else{
if(l.isEmpty()){
var n=this._currentView==ZmId.VIEW_GROUP?ZmMsg.emptyGroup:ZmMsg.emptyContact;
appCtxt.setStatusMsg(n,ZmStatusView.LEVEL_WARNING)
}else{
var n=this._currentView==ZmId.VIEW_GROUP?ZmMsg.groupSaved:ZmMsg.contactSaved;
appCtxt.setStatusMsg(n,ZmStatusView.LEVEL_INFO)
}}
if(!w){
this._app.popView(true);
l.cleanup()
}
if(d){
ZmContactAlphabetBar.alphabetClicked(null)
}
return true
};
ZmContactController.prototype._cancelListener=function(e){
this._app.popView()
};
ZmContactController.prototype._printListener=function(t){
var e="/h/printcontacts?id="+this._contact.id;
if(appCtxt.isOffline){
var a=this._contact.getAccount().name;
e+="&acct="+a
}
window.open(appContextPath+e,"_blank")
};
ZmContactController.prototype._doDelete=function(t,e,a,i){
ZmListController.prototype._doDelete.call(this,t,e,a);
if(!i){
this._listView[this._currentView].enableInputs(false);
this._app.popView(true)
}};
ZmContactController.prototype._preHideCallback=function(e,t){
if(t){
return true
}
var e=this._listView[this._currentView];
if(!e.isDirty()){
this._listView[this._currentView].cleanup();
return true
}
var a=this._popShield=appCtxt.getYesNoCancelMsgDialog();
a.reset();
a.setMessage(ZmMsg.askToSave,DwtMessageDialog.WARNING_STYLE);
a.registerCallback(DwtDialog.YES_BUTTON,this._popShieldYesCallback,this);
a.registerCallback(DwtDialog.NO_BUTTON,this._popShieldNoCallback,this);
a.popup(e._getDialogXY());
return false
};
ZmContactController.prototype._preUnloadCallback=function(e){
return !this._listView[this._currentView].isDirty()
};
ZmContactController.prototype._popShieldYesCallback=function(){
this._popShield.popdown();
if(this._saveListener(null,true)){
this._popShieldCallback()
}};
ZmContactController.prototype._popShieldNoCallback=function(){
this._popShield.popdown();
this._popShieldCallback()
};
ZmContactController.prototype._popShieldCallback=function(){
appCtxt.getAppViewMgr().showPendingView(true);
this._listView[this._currentView].cleanup()
};
ZmContactController.prototype._menuPopdownActionListener=function(e){};
ZmContactController.prototype._getDefaultFocusItem=function(){
return this._listView[this._currentView]._getDefaultFocusItem()
}
}
if(AjxPackage.define("zimbraMail.abook.controller.ZmAddrBookTreeController")){
ZmAddrBookTreeController=function(){
ZmFolderTreeController.call(this,ZmOrganizer.ADDRBOOK);
this._listeners[ZmOperation.NEW_ADDRBOOK]=new AjxListener(this,this._newListener);
this._listeners[ZmOperation.SHARE_ADDRBOOK]=new AjxListener(this,this._shareAddrBookListener);
this._listeners[ZmOperation.MOUNT_ADDRBOOK]=new AjxListener(this,this._mountAddrBookListener);
this._listeners[ZmOperation.BROWSE]=new AjxListener(this,function(){
appCtxt.getSearchController().fromBrowse("")
}
);
this._app=appCtxt.getApp(ZmApp.CONTACTS)
};
ZmAddrBookTreeController.prototype=new ZmFolderTreeController;
ZmAddrBookTreeController.prototype.constructor=ZmAddrBookTreeController;
ZmAddrBookTreeController.prototype.toString=function(){
return"ZmAddrBookTreeController"
};
ZmAddrBookTreeController.prototype.show=function(a){
a.include={};
a.include[ZmFolder.ID_TRASH]=true;
a.showUnread=false;
var e=ZmFolderTreeController.prototype.show.call(this,a);
var t=this.getDataTree().getById(ZmFolder.ID_TRASH);
if(t){
t.addChangeListener(new AjxListener(this,this._trashChangeListener,e))
}
return e
};
ZmAddrBookTreeController.prototype._trashChangeListener=function(a,r){
var o=r.getDetail("organizers");
if(!o&&r.source){
o=[r.source]
}
for(var n=0;
n<o.length;
n++){
var t=o[n];
if(t.id==ZmFolder.ID_TRASH&&r.event==ZmEvent.E_MODIFY){
var e=r.getDetail("fields");
if(e&&(e[ZmOrganizer.F_TOTAL]||e[ZmOrganizer.F_SIZE])){
var s=a.getTreeItemById(t.id);
if(s){
s.setToolTipContent(t.getToolTip(true))
}}}}};
ZmAddrBookTreeController.prototype.resetOperations=function(i,a,r){
var n=ZmMsg.del;
var o=appCtxt.getById(r);
var t=o?o.nId:ZmOrganizer.normalizeId(r);
var e=((o.numTotal>0)||(o.children&&(o.children.size()>0)));
if(t==ZmFolder.ID_TRASH){
i.enableAll(false);
i.enable(ZmOperation.DELETE,e);
n=ZmMsg.emptyTrash
}else{
i.enableAll(true);
if(o){
if(o.isSystem()){
i.enable([ZmOperation.DELETE,ZmOperation.RENAME_FOLDER],false)
}else{
if(o.link){
i.enable([ZmOperation.SHARE_ADDRBOOK],!o.link||o.isAdmin())
}}
if(appCtxt.isOffline){
i.enable([ZmOperation.SHARE_ADDRBOOK],!o.getAccount().isMain)
}}}
if(o){
i.enable(ZmOperation.EXPAND_ALL,(o.size()>0))
}
var s=i.getOp(ZmOperation.DELETE);
if(s){
s.setText(n)
}
this._resetButtonPerSetting(i,ZmOperation.SHARE_ADDRBOOK,appCtxt.get(ZmSetting.SHARING_ENABLED));
this._resetButtonPerSetting(i,ZmOperation.MOUNT_ADDRBOOK,appCtxt.get(ZmSetting.SHARING_ENABLED))
};
ZmAddrBookTreeController.prototype._getAllowedSubTypes=function(){
var e={};
e[ZmOrganizer.SEARCH]=true;
e[this.type]=true;
return e
};
ZmAddrBookTreeController.prototype._getHeaderActionMenuOps=function(){
var e=[];
if(appCtxt.get(ZmSetting.NEW_ADDR_BOOK_ENABLED)){
e.push(ZmOperation.NEW_ADDRBOOK)
}
e.push(ZmOperation.MOUNT_ADDRBOOK,ZmOperation.EXPAND_ALL,ZmOperation.BROWSE);
return e
};
ZmAddrBookTreeController.prototype._getActionMenuOps=function(){
var e=[];
if(appCtxt.get(ZmSetting.NEW_ADDR_BOOK_ENABLED)){
e.push(ZmOperation.NEW_ADDRBOOK)
}
e.push(ZmOperation.SHARE_ADDRBOOK,ZmOperation.DELETE,ZmOperation.RENAME_FOLDER,ZmOperation.EDIT_PROPS,ZmOperation.EXPAND_ALL);
return e
};
ZmAddrBookTreeController.prototype._getMoveDialogTitle=function(){
return AjxMessageFormat.format(ZmMsg.moveAddrBook,this._pendingActionData.name)
};
ZmAddrBookTreeController.prototype._getNewDialog=function(){
return appCtxt.getNewAddrBookDialog()
};
ZmAddrBookTreeController.prototype._shareAddrBookListener=function(e){
this._pendingActionData=this._getActionedOrganizer(e);
appCtxt.getSharePropsDialog().popup(ZmSharePropsDialog.NEW,this._pendingActionData)
};
ZmAddrBookTreeController.prototype._mountAddrBookListener=function(e){
appCtxt.getMountFolderDialog().popup(ZmOrganizer.ADDRBOOK)
};
ZmAddrBookTreeController.prototype._itemClicked=function(a){
if(a.type==ZmOrganizer.SEARCH){
var e=this._opc.getTreeController(ZmOrganizer.SEARCH);
e._itemClicked(a)
}else{
var s=appCtxt.getApp(ZmApp.CONTACTS);
s.currentSearch=null;
var i=s.currentQuery=a.createQuery();
var n=appCtxt.getSearchController();
n.setDefaultSearchType(ZmItem.CONTACT);
var r=a.getAccount();
var o={
query:i,searchFor:ZmItem.CONTACT,fetch:true,sortBy:ZmSearch.NAME_ASC,callback:new AjxCallback(this,this._handleSearchResponse,[a]),accountName:(r&&r.name)};
n.search(o);
if(a.id!=ZmFolder.ID_TRASH){
var t=AjxDispatcher.run("GetContactListController");
t.getParentView().getAlphabetBar().reset()
}}};
ZmAddrBookTreeController.prototype._handleSearchResponse=function(t,e){
if(t.nId==ZmFolder.ID_TRASH){
this._treeView[this._app.getOverviewId()].setSelected(ZmFolder.ID_TRASH,true)
}}
}};
</script><script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/PreferencesCore_all.js.zgz"></script><script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/Voicemail_all.js.zgz"></script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Mail")){
if(AjxPackage.define("ajax.dwt.events.DwtIdleTimer")){
DwtIdleTimer=function(t,e){
DwtIdleTimer._initEvents();
this.timeout=t;
this.handler=e;
this.idle=false;
this._onIdle=AjxCallback.simpleClosure(this.setIdle,this);
this._startTimer();
DwtIdleTimer.getHandlers().add(this)
};
DwtIdleTimer.idleHandlers=0;
DwtIdleTimer.prototype.toString=function(){
return"DwtIdleTimer"
};
DwtIdleTimer.prototype.kill=function(){
this._stopTimer();
this.idle=false;
DwtIdleTimer.getHandlers().remove(this)
};
DwtIdleTimer.prototype.resurrect=function(e){
this.idle=false;
DwtIdleTimer.getHandlers().add(this,null,true);
if(e!=null){
this.timeout=e
}
this._startTimer()
};
DwtIdleTimer.prototype.setIdle=function(){
if(!this.idle){
DwtIdleTimer.idleHandlers++;
this.idle=true;
this.handler.run(true);
if(AjxEnv.isIE){
document.body.setCapture(true)
}}};
DwtIdleTimer.prototype.resume=function(){
if(this.idle){
this.idle=false;
this.handler.run(false);
DwtIdleTimer.idleHandlers--;
if(AjxEnv.isIE){
document.releaseCapture()
}}};
DwtIdleTimer.prototype._startTimer=function(){
this._stopTimer();
this._timer=setTimeout(this._onIdle,this.timeout)
};
DwtIdleTimer.prototype._stopTimer=function(){
if(this._timer){
clearTimeout(this._timer);
this._timer=null
}};
DwtIdleTimer._initEvents=function(){
if(!DwtIdleTimer._initialized){
if(!AjxEnv.isIE){
window.addEventListener("keydown",DwtIdleTimer.resetIdle,true);
window.addEventListener("mousemove",DwtIdleTimer.resetIdle,true);
window.addEventListener("mousedown",DwtIdleTimer.resetIdle,true);
window.addEventListener("focus",DwtIdleTimer.resetIdle,true)
}else{
document.body.attachEvent("onkeydown",DwtIdleTimer.resetIdle);
document.body.attachEvent("onkeyup",DwtIdleTimer.resetIdle);
document.body.attachEvent("onmousedown",DwtIdleTimer.resetIdle);
document.body.attachEvent("onmousemove",DwtIdleTimer.resetIdle);
document.body.attachEvent("onmouseover",DwtIdleTimer.resetIdle);
document.body.attachEvent("onmouseout",DwtIdleTimer.resetIdle);
window.attachEvent("onfocus",DwtIdleTimer.resetIdle)
}
DwtIdleTimer._initialized=true
}};
DwtIdleTimer.getHandlers=function(){
var e=DwtIdleTimer.HANDLERS;
if(!e){
e=DwtIdleTimer.HANDLERS=new AjxVector()
}
return e
};
DwtIdleTimer.resetIdle=function(){
var e=DwtIdleTimer.getHandlers();
e.foreach("_startTimer");
if(DwtIdleTimer.idleHandlers>0){
e.foreach("resume")
}}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmComposeView")){
ZmComposeView=function(a,e,t){
this.TEMPLATE="mail.Message#Compose";
this._view=ZmId.VIEW_COMPOSE+e.sessionId;
this._sessionId=e.sessionId;
DwtComposite.call(this,{
parent:a,className:"ZmComposeView",posStyle:Dwt.ABSOLUTE_STYLE,id:ZmId.getViewId(this._view)}
);
ZmComposeView.ADDR_SETTING[AjxEmailAddress.BCC]=ZmSetting.SHOW_BCC;
ZmComposeView.NOTIFY_ACTION_MAP={};
ZmComposeView.NOTIFY_ACTION_MAP[ZmOperation.REPLY_ACCEPT]=ZmOperation.REPLY_ACCEPT_NOTIFY;
ZmComposeView.NOTIFY_ACTION_MAP[ZmOperation.REPLY_DECLINE]=ZmOperation.REPLY_DECLINE_NOTIFY;
ZmComposeView.NOTIFY_ACTION_MAP[ZmOperation.REPLY_TENTATIVE]=ZmOperation.REPLY_TENTATIVE_NOTIFY;
this._onMsgDataChange=new AjxCallback(this,this._onMsgDataChange);
this._controller=e;
this._initialize(t);
this.getHtmlElement().style.overflow="hidden"
};
ZmComposeView.prototype=new DwtComposite;
ZmComposeView.prototype.constructor=ZmComposeView;
ZmComposeView.prototype.toString=function(){
return"ZmComposeView"
};
ZmComposeView.QUOTED_HDRS=[ZmMailMsg.HDR_FROM,ZmMailMsg.HDR_TO,ZmMailMsg.HDR_CC,ZmMailMsg.HDR_DATE,ZmMailMsg.HDR_SUBJECT];
ZmComposeView.BAD="_bad_addrs_";
ZmComposeView.DIALOG_X=50;
ZmComposeView.DIALOG_Y=100;
ZmComposeView.UPLOAD_FIELD_NAME="attUpload";
ZmComposeView.FORWARD_ATT_NAME="ZmComposeView_forAttName";
ZmComposeView.FORWARD_MSG_NAME="ZmComposeView_forMsgName";
ZmComposeView.SHOW_MAX_ATTACHMENTS=AjxEnv.is800x600orLower?2:3;
ZmComposeView.MAX_ATTACHMENT_HEIGHT=(ZmComposeView.SHOW_MAX_ATTACHMENTS*23)+"px";
ZmComposeView.EMPTY_FORM_RE=/^[\s\|]*$/;
ZmComposeView.HTML_TAG_RE=/(<[^>]+>)/g;
ZmComposeView.SUBJ_PREFIX_RE=new RegExp("^\\s*(Re|Fw|Fwd|"+ZmMsg.re+"|"+ZmMsg.fwd+"|"+ZmMsg.fw+"):\\s*","i");
ZmComposeView.QUOTED_CONTENT_RE=new RegExp("^----- ","m");
ZmComposeView.HTML_QUOTED_CONTENT_RE=new RegExp("<br>----- ","i");
ZmComposeView.ADDR_SETTING={};
ZmComposeView.OP={};
ZmComposeView.OP[AjxEmailAddress.TO]=ZmId.CMP_TO;
ZmComposeView.OP[AjxEmailAddress.CC]=ZmId.CMP_CC;
ZmComposeView.OP[AjxEmailAddress.BCC]=ZmId.CMP_BCC;
ZmComposeView.prototype.set=function(n){
var s=this._action=n.action;
if(this._msg){
this._msg.onChange=null
}
this._acceptFolderId=n.acceptFolderId;
var o=n.accountName;
var a=this._msg=this._addressesMsg=n.msg;
if(a){
a.onChange=this._onMsgDataChange;
var e=(!o)?appCtxt.getById(a.folderId):null;
o=(e&&e.isRemote())?e.getOwner():null;
var f=a.identity&&a.identity.isFromDataSource;
if(!o&&a.isDraft&&!appCtxt.multiAccounts&&!f){
var y=window.parentAppCtxt||window.appCtxt;
var p=a.getAddresses(AjxEmailAddress.FROM).get(0);
if(p&&p.address.toLowerCase()!=y.accountList.mainAccount.getEmail().toLowerCase()&&!appCtxt.isMyAddress(p.address.toLowerCase())){
o=p.address
}}}
this._msgIds=n.msgIds;
this.reset(true);
this._setFromSelect(a);
if(n.identity){
if(this.identitySelect){
this.identitySelect.setSelectedValue(n.identity.id)
}
if(appCtxt.get(ZmSetting.SIGNATURES_ENABLED)||appCtxt.multiAccounts){
var r=n.identity.signature||"";
var c=appCtxt.multiAccounts&&this.getFromAccount();
this._controller.resetSignatureToolbar(r,c)
}}
this._showAddressField(AjxEmailAddress.TO,true,true,true);
this._showAddressField(AjxEmailAddress.CC,true,true,true);
this._toggleBccField(null,appCtxt.get(ZmSetting.SHOW_BCC));
this._setAddresses(s,AjxEmailAddress.TO,n.toOverride);
if(n.ccOverride){
this._setAddresses(s,AjxEmailAddress.CC,n.ccOverride)
}
if(n.bccOverride){
this._setAddresses(s,AjxEmailAddress.BCC,n.bccOverride)
}
if(o){
this._setObo(o)
}
this._setSubject(s,a,n.subjOverride);
this._setBody(s,a,n.extraBodyText);
if(appCtxt.get(ZmSetting.MAIL_PRIORITY_ENABLED)){
var m="";
if(a&&(s==ZmOperation.DRAFT)){
if(a.isHighPriority){
m=ZmItem.FLAG_HIGH_PRIORITY
}else{
if(a.isLowPriority){
m=ZmItem.FLAG_LOW_PRIORITY
}}}
this._setPriority(m)
}
this.getHtmlEditor().moveCaretToTop();
if(s!=ZmOperation.FORWARD_ATT){
var b=a?a.getBodyParts():[];
for(var l=0;
l<b.length;
l++){
var t=b[l];
var g=t.ct;
if(g==ZmMimeTable.TEXT_PLAIN){
continue
}
if(g==ZmMimeTable.TEXT_HTML){
continue
}
if(ZmMimeTable.isRenderableImage(g)&&t.cd=="inline"){
continue
}
var u=new ZmMimePart();
u.setContentType(g);
u.setContent(t.content);
this.addMimePart(u)
}}
if(this._composeMode==DwtHtmlEditor.HTML){
var h=new AjxTimedAction(this,this._setFormValue);
AjxTimedAction.scheduleAction(h,10)
}else{
this._setFormValue()
}
if(!this._isReply()){
appCtxt.getKeyboardMgr().grabFocus(this._field[AjxEmailAddress.TO])
}};
ZmComposeView.prototype._onMsgDataChange=function(e,t){
if(e=="subject"){
this._subjectField.value=t;
this.updateTabTitle()
}};
ZmComposeView.prototype.getComposeMode=function(){
return this._composeMode
};
ZmComposeView.prototype.getController=function(){
return this._controller
};
ZmComposeView.prototype.getHtmlEditor=function(){
return this._htmlEditor
};
ZmComposeView.prototype.getTitle=function(){
var e;
if(this._isReply()){
e=ZmMsg.reply
}else{
if(this._isForward()){
e=ZmMsg.forward
}else{
e=ZmMsg.compose
}}
return[ZmMsg.zimbraTitle,e].join(": ")
};
ZmComposeView.prototype.getRawAddrFields=function(){
var a={};
for(var e=0;
e<ZmMailMsg.COMPOSE_ADDRS.length;
e++){
var t=ZmMailMsg.COMPOSE_ADDRS[e];
if(this._using[t]){
a[t]=this._field[t].value
}}
return a
};
ZmComposeView.prototype.getAddrFields=function(){
var a=[];
for(var e=0;
e<ZmMailMsg.COMPOSE_ADDRS.length;
e++){
var t=ZmMailMsg.COMPOSE_ADDRS[e];
if(this._using[t]){
a.push(this._field[t])
}}
return a
};
ZmComposeView.prototype.getAttFieldValues=function(){
var e=[];
var a=document.getElementsByName(ZmComposeView.UPLOAD_FIELD_NAME);
for(var t=0;
t<a.length;
t++){
e.push(a[t].value)
}
return e
};
ZmComposeView.prototype.setBackupForm=function(){
this.backupForm=this._backupForm()
};
ZmComposeView.prototype._backupForm=function(){
var t=this._formValue(true,true);
var a=document.getElementsByName(ZmComposeView.UPLOAD_FIELD_NAME);
for(var e=0;
e<a.length;
e++){
if(a[e].value.length){
t+=a[e].value
}}
t+=this._getForwardAttIds(ZmComposeView.FORWARD_ATT_NAME+this._sessionId).join("");
t+=this._getForwardAttIds(ZmComposeView.FORWARD_MSG_NAME+this._sessionId).join("");
return t
};
ZmComposeView.prototype._isInline=function(t){
if(this._attachDialog){
return this._attachDialog.isInline()
}
t=t||this._msg;
if(t&&this._msgAttId&&t.id==this._msgAttId){
return false
}
if(t&&t.attachments){
var a=t.attachments;
for(var e=0;
e<a.length;
e++){
if(a[e].ci){
return true
}}}
return false
};
ZmComposeView.prototype._handleInlineAtts=function(a,c){
var s=false,m,h,u,t,e={};
var n=this._htmlEditor._getIframeDoc();
var l=n.getElementsByTagName("img");
for(var o=0;
o<l.length;
o++){
u=l[o].getAttribute("dfsrc")||l[o].getAttribute("mce_src")||l[o].src;
if(u){
if(u.substring(0,4)=="cid:"){
h=u.substring(4);
var r=l[o].getAttribute("doc");
if(r){
a.addInlineDocAttachment(h,null,r);
s=true
}else{
m="<"+h+">";
t=a.findInlineAtt(m);
if(!t&&this._msg){
t=this._msg.findInlineAtt(m)
}
if(t){
if(!e[(h+"_"+t.part)]){
a.addInlineAttachmentId(h,null,t.part);
s=true;
e[(h+"_"+t.part)]=true
}}}}}}
return s
};
ZmComposeView.prototype._mergeInlineAndForwardAtts=function(n,r){
var o=[];
var s=this._msg.attachments;
function a(h){
for(var i=0;
i<r.length;
i++){
if(r[i]==h){
return true
}}
return false
}
for(var t=0;
t<s.length;
t++){
var e=s[t];
if(e.ci&&!a(e.part)){
o.push(e.part)
}}
return[].concat(r,o)
};
ZmComposeView.prototype.getMsg=function(E,n,R){
var O=this._collectAddrs();
if(!n&&!O.gotAddress){
this.enableInputs(false);
var s=appCtxt.getMsgDialog();
s.setMessage(ZmMsg.noAddresses,DwtMessageDialog.CRITICAL_STYLE);
s.popup(this._getDialogXY());
s.registerCallback(DwtDialog.OK_BUTTON,this._okCallback,this);
this.enableInputs(true);
return
}
var S=appCtxt.getOkCancelMsgDialog();
S.reset();
var l=AjxStringUtil.trim(this._subjectField.value);
if(!n&&l.length==0&&!this._noSubjectOkay){
this.enableInputs(false);
S.setMessage(ZmMsg.compSubjectMissing,DwtMessageDialog.WARNING_STYLE);
S.registerCallback(DwtDialog.OK_BUTTON,this._noSubjectOkCallback,this,S);
S.registerCallback(DwtDialog.CANCEL_BUTTON,this._noSubjectCancelCallback,this,S);
S.popup(this._getDialogXY());
return
}
if(!n&&O[ZmComposeView.BAD].size()&&!this._badAddrsOkay){
this.enableInputs(false);
var K=AjxStringUtil.htmlEncode(O[ZmComposeView.BAD].toString(AjxEmailAddress.SEPARATOR));
var Y=AjxMessageFormat.format(ZmMsg.compBadAddresses,K);
S.setMessage(Y,DwtMessageDialog.WARNING_STYLE);
S.registerCallback(DwtDialog.OK_BUTTON,this._badAddrsOkCallback,this,S);
S.registerCallback(DwtDialog.CANCEL_BUTTON,this._badAddrsCancelCallback,this,[O.badType,S]);
S.setVisible(true);
S.popup(this._getDialogXY());
return
}else{
this._badAddrsOkay=false
}
if(!n&&appCtxt.get(ZmSetting.SPELL_CHECK_ENABLED)&&appCtxt.get(ZmSetting.MAIL_MANDATORY_SPELLCHECK)&&!this._spellCheckOkay){
if(this._htmlEditor.checkMisspelledWords(new AjxCallback(this,this._spellCheckShield),null,new AjxCallback(this,this._spellCheckErrorShield))){
return
}}else{
this._spellCheckOkay=false
}
var Y=R||(new ZmMailMsg());
Y.setSubject(l);
var Q=false;
if(this._attachDialog&&this._attachDialog.isInline()&&E){
for(var N=0;
N<E.length;
N++){
var F=E[N];
if(F.s==0){
Q=true;
continue
}
var w=F.ct;
if(w&&w.indexOf("image")!=-1){
var m=Dwt.getNextId();
this._htmlEditor.insertImage("cid:"+m,AjxEnv.isIE);
Y.addInlineAttachmentId(m,F.aid)
}else{
Y.addAttachmentId(F.aid)
}}}else{
if(E&&typeof E!="string"){
for(var N=0;
N<E.length;
N++){
if(E[N].s==0){
Q=true;
continue
}
Y.addAttachmentId(E[N].aid)
}}else{
if(E){
Y.addAttachmentId(E)
}}}
if(Q){
appCtxt.setStatusMsg(ZmMsg.zeroSizedAtts)
}
if(this.sendUID&&this.backupForm){
if(n||this._backupForm()!=this.backupForm){
this.sendUID=(new Date()).getTime()
}}else{
this.sendUID=(new Date()).getTime()
}
var q=this._getForwardAttIds(ZmComposeView.FORWARD_ATT_NAME+this._sessionId);
var A=this._getForwardAttIds(ZmComposeView.FORWARD_MSG_NAME+this._sessionId);
var c=new ZmMimePart();
if(this._composeMode==DwtHtmlEditor.HTML){
c.setContentType(ZmMimeTable.MULTI_ALT);
var M=new ZmMimePart();
M.setContentType(ZmMimeTable.TEXT_PLAIN);
var u=this;
var b={
hr:function(i){
return ZmComposeView._convertHtmlPreface(u,i)
}
,blockquote:function(i){
return"\n<blockquote>\n"
}
,"/blockquote":function(i){
return"\n</blockquote>\n"
}};
var W=this._htmlEditor.getTextVersion(b);
W=this._applyHtmlPrefix(W,"<blockquote>","</blockquote>");
M.setContent(W);
c.children.add(M);
var g=new ZmMimePart();
g.setContentType(ZmMimeTable.TEXT_HTML);
var p=this._htmlEditor._getIframeDoc();
this._cleanupFileRefImages(p);
this._restoreMultipartRelatedImages(p);
if(!n){
this._cleanupSignatureIds(p)
}
var a=this._htmlEditor.getContent(true);
if(AjxEnv.isFirefox){
a=a.replace(/<span style="font-weight: bold;">(.+?)<\/span>/,"<strong>$1</strong>");
a=a.replace(/<span style="font-style: italic;">(.+?)<\/span>/,"<em>$1</em>");
a=a.replace(/<span style="text-decoration: underline;">(.+?)<\/span>/,"<u>$1</u>");
a=a.replace(/<span style="text-decoration: line-through;">(.+?)<\/span>/,"<strike>$1</strike>")
}else{
if(AjxEnv.isSafari){
a=a.replace(/<span class="Apple-style-span" style="font-weight: bold;">(.+?)<\/span>/,"<strong>$1</strong>");
a=a.replace(/<span class="Apple-style-span" style="font-style: italic;">(.+?)<\/span>/,"<em>$1</em>");
a=a.replace(/<span class="Apple-style-span" style="text-decoration: underline;">(.+?)<\/span>/,"<u>$1</u>");
a=a.replace(/<span class="Apple-style-span" style="text-decoration: line-through;">(.+?)<\/span>/,"<strike>$1</strike>")
}}
g.setContent(a);
var f=g.getContent();
var T=f.split(/<img/i);
for(var N=0;
N<T.length;
N++){
var J=T[N].match(/cid:[^\"\']+/);
if(J&&J.length>0){
var P=T[N].replace(/\s+src=[\"\'][^\"\']+[\"\']/,' src="'+J[0]+'"');
P=P.replace(/dfsrc=[\"\'][^\"\']+[\"\']+/,"");
f=f.replace(T[N],P)
}}
g.setContent(f);
this._handleInlineAtts(Y,true);
var H=Y.getInlineAttachments();
var h=Y.getInlineDocAttachments();
var z=[].concat(H,h);
if(z&&z.length>0){
var C=new ZmMimePart();
C.setContentType(ZmMimeTable.MULTI_RELATED);
C.children.add(g);
c.children.add(C)
}else{
c.children.add(g)
}}else{
var y=this._isInline();
var M=(this._extraParts||y)?new ZmMimePart():c;
M.setContentType(ZmMimeTable.TEXT_PLAIN);
M.setContent(this._htmlEditor.getContent());
if(y){
c.setContentType(ZmMimeTable.MULTI_ALT);
var C=new ZmMimePart();
C.setContentType(ZmMimeTable.MULTI_RELATED);
C.children.add(M);
c.children.add(C)
}else{
if(this._extraParts){
c.setContentType(ZmMimeTable.MULTI_ALT);
c.children.add(M)
}}}
if(this._extraParts){
for(var N=0;
N<this._extraParts.length;
N++){
var B=this._extraParts[N];
c.children.add(B)
}}
Y.textBodyContent=(this._composeMode==DwtHtmlEditor.HTML)?this._htmlEditor.getTextVersion():this._htmlEditor.getContent();
Y.setTopPart(c);
Y.setSubject(l);
Y.setForwardAttIds(q);
for(var N=0;
N<ZmMailMsg.COMPOSE_ADDRS.length;
N++){
var V=ZmMailMsg.COMPOSE_ADDRS[N];
if(O[V]&&O[V].all.size()>0){
Y.setAddresses(V,O[V].all)
}}
Y.identity=this.getIdentity();
Y.sendUID=this.sendUID;
Y._origMsg=this._msg;
if(this._msg&&this._msg._instanceDate){
Y._instanceDate=this._msg._instanceDate
}
if(this._action!=ZmOperation.NEW_MESSAGE&&this._msg&&!this._msgIds){
var I=this._isInviteReply(this._action);
if(this._action==ZmOperation.DRAFT){
Y.isReplied=(this._msg.rt=="r");
Y.isForwarded=(this._msg.rt=="w");
Y.isDraft=this._msg.isDraft;
if(Y.isDraft){
Y.origId=Y.isReplied||Y.isForwarded?this._msg.origId:null;
Y.id=this._msg.id;
Y.nId=this._msg.nId
}}else{
Y.isReplied=this._isReply();
Y.isForwarded=this._isForward();
Y.origId=this._msg.id
}
Y.isInviteReply=I;
Y.acceptFolderId=this._acceptFolderId;
var j=ZmComposeView.NOTIFY_ACTION_MAP[this._action]?ZmComposeView.NOTIFY_ACTION_MAP[this._action]:this._action;
Y.inviteMode=I?j:null;
Y.irtMessageId=this._msg.irtMessageId||this._msg.messageId;
Y.folderId=this._msg.folderId
}
if(this._action==ZmOperation.DRAFT&&this._origAcctMsgId){
Y.origAcctMsgId=this._origAcctMsgId
}
if(this._msg&&this._msg.attId){
Y.addAttachmentId(this._msg.attId)
}
if(this._msgAttId){
if(A.length>0){
var N=0;
while(A[N]&&A[N]!=this._msgAttId){
N++
}
if(N==A.length){
A.push(this._msgAttId)
}
delete N
}else{
A.push(this._msgAttId)
}}
Y.setMessageAttachmentId(A);
var v=this._getPriority();
if(v){
Y.flagLocal(v,true)
}
if(this._fromSelect){
Y.fromSelectValue=this._fromSelect.getSelectedOption()
}
if(!n&&appCtxt.areZimletsLoaded()){
var r=[];
var L=false;
var U="";
var x="";
appCtxt.notifyZimlets("emailErrorCheck",[Y,r]);
var D=r.length;
for(var G=0;
G<D;
G++){
var o=r[G];
if(o==null||o==undefined){
continue
}
var t=o.hasError;
x=o.zimletName;
if(Boolean(t)){
if(this._ignoredZimlets){
if(this._ignoredZimlets[x]){
delete this._ignoredZimlets[x];
continue
}}
L=true;
U=o.errorMsg;
break
}}
if(L){
this.enableInputs(false);
S.setMessage(U,DwtMessageDialog.WARNING_STYLE);
var e={
errDialog:S,zimletName:x};
S.registerCallback(DwtDialog.OK_BUTTON,this._errViaZimletOkCallback,this,e);
S.registerCallback(DwtDialog.CANCEL_BUTTON,this._errViaZimletCancelCallback,this,e);
S.popup(this._getDialogXY());
return
}}
return Y
};
ZmComposeView.prototype.setDocAttachments=function(s,n){
if(!n){
return
}
var o=false;
var a=this._isInline();
for(var e=0;
e<n.length;
e++){
var t=n[e];
var h=t.ct;
if(t.s==0){
o=true;
continue
}
if(this._attachDialog&&a){
if(h&&h.indexOf("image")!=-1){
var r=Dwt.getNextId();
this._htmlEditor.insertImage("cid:"+r,AjxEnv.isIE);
s.addInlineDocAttachment(r,t.id)
}else{
s.addDocumentAttachmentId(t.id)
}}else{
s.addDocumentAttachmentId(t.id)
}}
if(o){
appCtxt.setStatusMsg(ZmMsg.zeroSizedAtts)
}};
ZmComposeView.prototype.setAddress=function(e,t){
t=t?t:"";
if(t.length&&!this._using[e]){
this._using[e]=true;
this._showAddressField(e,true)
}
this._field[e].value=t;
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
this._adjustAddrHeight(this._field[e])
}
),0)
};
ZmComposeView.prototype.setComposeMode=function(t,a){
if(t==this._composeMode){
return
}
var o=(t==DwtHtmlEditor.HTML);
if(!o||appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
var i=(this._composeMode==DwtHtmlEditor.TEXT)?this._bodyField:this._htmlEditor;
this._composeMode=t;
if(!o&&a){
this._switchPreface()
}
this._htmlEditor.setMode(t,true);
if(o&&a){
this._switchPreface()
}
this._bodyFieldId=this._htmlEditor.getBodyFieldId();
this._bodyField=document.getElementById(this._bodyFieldId);
if(this._bodyField.disabled){
this._bodyField.disabled=false
}
this._resetBodySize();
this._setFormValue();
var e=(t==DwtHtmlEditor.TEXT)?this._bodyField:this._htmlEditor;
if(window.isTinyMCE){
i=e=this._htmlEditor.getEditorContainer();
this._retryHtmlEditorFocus()
}
if(i&&e&&(i!=e)&&this._controller._tabGroup){
this._controller._tabGroup.replaceMember(i,e);
if(t==DwtHtmlEditor.HTML){
this._retryHtmlEditorFocus()
}}
if(!o){
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
this.getHtmlEditor().moveCaretToTop()
}
),200)
}}
if(this._msg&&this._isInline()&&t==DwtHtmlEditor.TEXT){
this._showForwardField(this._msg,this._action,null,true)
}};
ZmComposeView.prototype._retryHtmlEditorFocus=function(){
if(this._htmlEditor.hasFocus()){
var e=new AjxTimedAction(this,this._focusHtmlEditor);
AjxTimedAction.scheduleAction(e,10)
}};
ZmComposeView.prototype.setDetach=function(a){
this._action=a.action;
this._msg=a.msg;
for(var e in a.addrs){
this.setAddress(e,a.addrs[e])
}
this._subjectField.value=a.subj||"";
this.updateTabTitle();
var t=a.body||"";
if((t=="")&&(this._htmlEditor.getMode()==DwtHtmlEditor.HTML)){
t="<br>"
}
this._htmlEditor.setContent(t);
if(a.forwardHtml){
this._attcDiv.innerHTML=a.forwardHtml
}
if(a.identityId&&this.identitySelect){
this.identitySelect.setSelectedValue(a.identityId)
}
this.backupForm=a.backupForm;
this.sendUID=a.sendUID;
if(AjxEnv.isGeckoBased&&AjxEnv.isWindows){
window.resizeBy(1,1)
}};
ZmComposeView.prototype.reEnableDesignMode=function(){
if(this._composeMode==DwtHtmlEditor.HTML){
this._htmlEditor.reEnableDesignMode()
}};
ZmComposeView.prototype.processMsgDraft=function(e){
if(this._isInline(e)){
this._handleInline(e)
}
this.reEnableDesignMode();
this._action=ZmOperation.DRAFT;
this._msg=e;
this._msgAttId=null;
this.cleanupAttachments(true);
this._showForwardField(e,ZmOperation.DRAFT);
this._resetBodySize();
this._setFormValue()
};
ZmComposeView.prototype._handleInline=function(e){
var a=(e)?e:this._msg;
var t=this._htmlEditor._getIframeDoc();
return(this._fixMultipartRelatedImages(a,t))
};
ZmComposeView.prototype._fixMultipartRelatedImages_onTimer=function(e){
if(!this._firstTimeFixImages){
this._htmlEditor.addOnContentIntializedListener(new AjxCallback(this,this._fixMultipartRelatedImages,[e,this._htmlEditor._getIframeDoc()]))
}else{
this._fixMultipartRelatedImages(e,this._htmlEditor._getIframeDoc())
}};
ZmComposeView.prototype._fixMultipartRelatedImages=function(t,o){
if(!this._firstTimeFixImages){
this._htmlEditor.removeOnContentIntializedListener();
var c=this;
setTimeout(function(){
c._fixMultipartRelatedImages(t,c._htmlEditor._getIframeDoc())
}
,10);
this._firstTimeFixImages=true;
return
}
o=o||this._htmlEditor._getIframeDoc();
if(!o){
return
}
var h=o.getElementsByTagName("img");
var n=0;
for(var a=0;
a<h.length;
a++){
var l=h[a].getAttribute("dfsrc")||h[a].getAttribute("mce_src")||h[a].src;
if(l){
if(l.substring(0,4)=="cid:"){
n++;
var r="<"+l.substring(4)+">";
var e=t.getContentPartAttachUrl(ZmMailMsg.CONTENT_PART_ID,r);
e=e+"&t="+(new Date()).getTime();
if(e){
h[a].src=e;
h[a].setAttribute("dfsrc",l)
}}else{
if(l.substring(0,4)=="doc:"){
try{
h[a].src=[appCtxt.get(ZmSetting.REST_URL),ZmFolder.SEP,l.substring(4)].join("")
}
catch(s){}}else{
if(t&&l.indexOf("//")==-1){
var e=t.getContentPartAttachUrl(ZmMailMsg.CONTENT_PART_LOCATION,l);
if(e){
e=e+"&t="+(new Date()).getTime();
n++;
h[a].src=e;
h[a].setAttribute("dfsrc",l)
}}}}}}
return(n==h.length)
};
ZmComposeView.prototype._cleanupFileRefImages=function(a){
function n(i){
var l=i.parentNode;
l.removeChild(i)
}
if(a){
var t=a.getElementsByTagName("img");
var e=t.length,r=[],o,h;
for(var s=0;
s<t.length;
s++){
o=t[s];
h=o.src;
if(o&&h.indexOf("file://")==0){
n(o);
s--
}}}};
ZmComposeView.prototype._restoreMultipartRelatedImages=function(t){
if(t){
var e=t.getElementsByTagName("img");
var o=0;
for(var s=0;
s<e.length;
s++){
var a=e[s];
var h="";
var r=a.getAttribute("dfsrc")||a.getAttribute("mce_src");
if(r&&r.indexOf("cid:")==0){
h=r;
a.removeAttribute("dfsrc")
}else{
if(a.src&&a.src.indexOf("cid:")==0){
h=a.src
}else{
if(r&&r.substring(0,4)=="doc:"){
h="cid:"+Dwt.getNextId();
a.removeAttribute("dfsrc");
a.setAttribute("doc",r.substring(4,r.length));
a.setAttribute("dfsrc",h)
}else{
if(r){
try{
a.src=r
}
catch(n){}}}}}
if(h){
try{
a.src=h
}
catch(n){}}}}};
ZmComposeView.prototype._cleanupSignatureIds=function(t){
var e=this._controller._currentSignatureId;
var a=t.getElementById(e);
if(a){
a.removeAttribute("id")
}};
ZmComposeView.prototype.showAttachmentDialog=function(){
var e=this._attachDialog=appCtxt.getAttachDialog();
var t=new AjxCallback(this,this._attsDoneCallback,[true]);
e.setUploadCallback(t);
e.popup();
e.enableInlineOption(this._composeMode==DwtHtmlEditor.HTML)
};
ZmComposeView.prototype.reset=function(t){
this.backupForm=null;
this.sendUID=null;
if(this._acAddrSelectList){
this._acAddrSelectList.reset();
this._acAddrSelectList.show(false)
}
for(var a=0;
a<ZmMailMsg.COMPOSE_ADDRS.length;
a++){
var e=this._field[ZmMailMsg.COMPOSE_ADDRS[a]];
e.value="";
this._adjustAddrHeight(e,true)
}
this._subjectField.value="";
this.updateTabTitle();
this._htmlEditor.resetSpellCheck();
this._htmlEditor.clear();
this.cleanupAttachments(true);
this._resetBodySize();
this._msgAttId=null;
this._clearFormValue();
this._noSubjectOkay=this._badAddrsOkay=this._spellCheckOkay=false;
Dwt.setVisible(this._oboRow,false);
this._extraParts=null;
this.enableInputs(t);
this._controller.toggleSpellCheckButton(false);
this._previousSignature=null;
this._previousSignatureMode=null;
this._origAcctMsgId=null
};
ZmComposeView.prototype.enableInputs=function(e){
for(var t=0;
t<ZmMailMsg.COMPOSE_ADDRS.length;
t++){
this._field[ZmMailMsg.COMPOSE_ADDRS[t]].disabled=!e
}
this._subjectField.disabled=this._bodyField.disabled=!e
};
ZmComposeView.prototype.addMimePart=function(e){
if(!this._extraParts){
this._extraParts=[]
}
this._extraParts.push(e)
};
ZmComposeView.prototype.getSignatureContentSpan=function(t,i,a){
t=t||this.getSignatureById(this._controller.getSelectedSignature(),a);
if(!t){
return""
}
var e=t.id;
i=i||this.getSignatureContent(e);
if(this.getHtmlEditor().getMode()==DwtHtmlEditor.HTML){
i=['<div id="',e,'">',i,"</div>"].join("")
}
return this._getSignatureSeparator()+i
};
ZmComposeView.prototype.applySignature=function(p,y,i){
p=p||"";
var w=window.parentAppCtxt||window.appCtxt;
var r=i||(appCtxt.multiAccounts&&this.getFromAccount());
var u=this.getSignatureById(this._controller.getSelectedSignature(),r);
var h=this.getHtmlEditor().getMode()==DwtHtmlEditor.HTML;
var b=this._getSignatureNewLine();
var x=w.get(ZmSetting.SIGNATURE_STYLE,null,r)==ZmSetting.SIG_OUTLOOK;
var c=false,a=false;
var o=!u;
var n,t;
var k=u?this.getSignatureContent(u.id):"";
if(y){
if(h){
var m=this.getHtmlEditor()._getIframeDoc();
var g=m.getElementById(y);
if(g){
var f=g.innerHTML,s;
var l=f.indexOf(ZmComposeView.SIG_KEY);
var v=f.lastIndexOf(ZmComposeView.SIG_KEY);
if(l==-1||v==-1){
l=f.indexOf(ZmComposeView.SIG_KEY_LC);
v=f.lastIndexOf(ZmComposeView.SIG_KEY_LC)
}
if(l!=-1&&v!=-1){
s=f.substring(0,l)+k+f.substring(v+ZmComposeView.SIG_KEY.length)
}
if(s){
g.innerHTML=s;
if(u){
g.id=u.id
}else{
g.removeAttribute("id")
}
c=true;
a=true
}}}else{
t=this.getSignatureContent(y);
var e="("+AjxStringUtil.regExEscape(b)+")*"+AjxStringUtil.regExEscape(t);
e=e.replace(/(\\n|\\r)/g,"\\s*");
if(!x){
e+="\\s*("+AjxStringUtil.regExEscape(b)+")*";
e+="$"
}
e=new RegExp(e,"i");
if(e.test(p)){
p=p.replace(e,this._getSignatureSeparator()+k);
c=true
}}}
if(!c){
n=this.getSignatureContentSpan(u);
p=this._insertSignature(p,w.get(ZmSetting.SIGNATURE_STYLE,null,r),n,b)
}
if(!h){
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
this.getHtmlEditor().moveCaretToTop()
}
),200)
}
if(!a){
this._htmlEditor.setContent(p)
}
this._fixMultipartRelatedImages_onTimer(this._msg,this.getHtmlEditor()._getIframeDoc());
this._previousSignature=u;
this._previousSignatureMode=this._htmlEditor.getMode()
};
ZmComposeView.prototype.getSignatureContent=function(e){
return this._getSignature(e)||""
};
ZmComposeView.prototype.addSignature=function(t){
t=t||"";
var e=window.parentAppCtxt||window.appCtxt;
var i=this.getSignatureContentSpan();
var a=appCtxt.multiAccounts&&this.getFromAccount();
t=this._insertSignature(t,e.get(ZmSetting.SIGNATURE_STYLE,null,a),i,this._getSignatureNewLine());
this._htmlEditor.setContent(t);
this._previousSignature=i;
this._previousSignatureMode=this._htmlEditor.getMode()
};
ZmComposeView.prototype._insertSignature=function(i,r,l,a){
var e="("+AjxStringUtil.regExEscape(a)+")*";
var h=e;
if(this.getHtmlEditor().getMode()==DwtHtmlEditor.HTML){
h+="</body></html>"
}
h+="$";
h=new RegExp(h,"i");
i=i.replace(h,"");
var n=this._controller._curIncOptions.what;
var s=(n!=ZmSetting.INC_ATTACH&&n!=ZmSetting.INC_NONE);
if(r==ZmSetting.SIG_OUTLOOK&&s){
var t=this._getPreface();
var o=new RegExp(e+t,"i");
if(i.match(o)){
i=i.replace(o,[l,a,t].join(""))
}else{
i=[i,l].join("")
}}else{
i=[i,l].join("")
}
return i
};
ZmComposeView.prototype._dispose=function(){
if(this._identityChangeListenerObj){
var e=appCtxt.getIdentityCollection();
e.removeChangeListener(this._identityChangeListenerObj)
}};
ZmComposeView.prototype.getSignatureById=function(e,t){
e=e||this._controller.getSelectedSignature();
return appCtxt.getSignatureCollection(t).getById(e)
};
ZmComposeView.SIG_KEY='<SPAN name="x"></SPAN>';
ZmComposeView.SIG_KEY_LC=ZmComposeView.SIG_KEY.toLowerCase();
ZmComposeView.prototype._getSignature=function(a){
var c=this._getExtraSignature();
a=a||this._controller.getSelectedSignature();
if(!a&&c==""){
return
}
var t;
if(appCtxt.multiAccounts){
var u=window.parentAppCtxt||window.appCtxt;
var h=u.accountList.visibleAccounts;
for(var o=0;
o<h.length;
o++){
var s=appCtxt.getSignatureCollection(h[o]);
if(s){
t=s.getById(a);
if(t){
break
}}}}else{
t=appCtxt.getSignatureCollection().getById(a)
}
if(!t&&c==""){
return
}
var r="";
if(t){
var e=(this._composeMode==DwtHtmlEditor.HTML);
var n=e?ZmMimeTable.TEXT_HTML:ZmMimeTable.TEXT_PLAIN;
var m=t.getValue(n);
var l=e?ZmComposeView.SIG_KEY+m+ZmComposeView.SIG_KEY:m;
r=l+this._getSignatureNewLine()
}
return(r+c)
};
ZmComposeView.prototype._getExtraSignature=function(){
var t="";
if(appCtxt.zimletsPresent()){
var e=[];
appCtxt.notifyZimlets("appendExtraSignature",[e]);
t=e.join(this._getSignatureNewLine());
if(t!=""){
t=this._getSignatureNewLine()+t
}}
return t
};
ZmComposeView.prototype._getSignatureSeparator=function(){
var t=window.parentAppCtxt||window.appCtxt;
var i=this._getSignatureNewLine();
var e=i+i;
var a=appCtxt.multiAccounts&&this.getFromAccount();
if(t.get(ZmSetting.SIGNATURE_STYLE,null,a)==ZmSetting.SIG_INTERNET){
e+="-- "+i
}
return e
};
ZmComposeView.prototype._getSignatureNewLine=function(){
return((this._composeMode==DwtHtmlEditor.HTML)?"<br>":"\n")
};
ZmComposeView.prototype.isDirty=function(o,i){
if((this._action!=ZmOperation.NEW_MESSAGE)&&(this._htmlEditor.getContent().match(ZmComposeView.EMPTY_FORM_RE))){
return false
}
if(this._isDirty){
return true
}
var t=this._formValue(o,i);
if(t.match(ZmComposeView.EMPTY_FORM_RE)||(this._composeMode==DwtHtmlEditor.HTML&&(t=="<html><body></body></html>"||t=="<html><body><br></body></html>"||t=='<html><body><br mce_bogus="1"></body></html>'))){
return false
}
if(this._composeMode==DwtHtmlEditor.HTML){
var e=function(n){
return n.toLowerCase()
};
var a=AjxStringUtil.trim(this._origFormValue.replace(ZmComposeView.HTML_TAG_RE,e));
t=AjxStringUtil.trim(t.replace(ZmComposeView.HTML_TAG_RE,e));
return(t!=a)
}
return(t!=this._origFormValue)
};
ZmComposeView.prototype.cleanupAttachments=function(t){
var e=this._attachDialog;
if(e&&e.isPoppedUp()){
e.popdown()
}
if(t){
this._attcDiv.innerHTML="";
this._attcDiv.style.height="";
this._attachCount=0
}
if(this._msg){
this._msg.attId=null
}};
ZmComposeView.prototype.sendMsgOboIsOK=function(){
return(Dwt.getVisible(this._oboRow))?this._oboCheckbox.checked:false
};
ZmComposeView.prototype.updateTabTitle=function(){
var e=this._subjectField.value?this._subjectField.value.substr(0,ZmAppViewMgr.TAB_BUTTON_MAX_TEXT):ZmComposeController.DEFAULT_TAB_TEXT;
appCtxt.getAppViewMgr().setTabTitle(this._controller.viewId,e)
};
ZmComposeView.prototype.getFromAccount=function(){
var e=window.parentAppCtxt||window.appCtxt;
return this._fromSelect?(e.accountList.getAccount(this._fromSelect.getSelectedOption().accountId)):(e.accountList.defaultAccount||e.accountList.activeAccount||e.accountList.mainAccount)
};
ZmComposeView.prototype._isInviteReply=function(e){
e=e||this._action;
return(e==ZmOperation.REPLY_ACCEPT||e==ZmOperation.REPLY_CANCEL||e==ZmOperation.REPLY_DECLINE||e==ZmOperation.REPLY_TENTATIVE||e==ZmOperation.REPLY_MODIFY||e==ZmOperation.REPLY_NEW_TIME)
};
ZmComposeView.prototype._isReply=function(e){
e=e||this._action;
return(e==ZmOperation.REPLY||e==ZmOperation.REPLY_ALL||this._isInviteReply(e))
};
ZmComposeView.prototype._isForward=function(e){
e=e||this._action;
return(e==ZmOperation.FORWARD_INLINE||e==ZmOperation.FORWARD_ATT)
};
ZmComposeView.prototype._getAddrString=function(r,s){
s=s||{};
var e=r.getArray();
var n=[];
for(var o=0;
o<e.length;
o++){
var h=e[o];
var t=h?h.getAddress():null;
if(!t){
continue
}
t=t.toLowerCase();
if(!s[t]){
n.push(h)
}
s[t]=true
}
return n.join(AjxEmailAddress.SEPARATOR)
};
ZmComposeView.prototype._getTextPart=function(t,o){
var r="";
if(t.ct==ZmMimeTable.TEXT_HTML){
var s={
parent:this,hidden:true,html:t.content};
var n=new DwtIframe(s);
if(n){
var e=this;
var a={
hr:function(h){
return ZmComposeView._convertHtmlPreface(e,h)
}};
r=AjxStringUtil.convertHtml2Text(n.getDocument().body,a);
var i=this.getHtmlElement().removeChild(n.getHtmlElement());
delete i;
delete n
}}else{
r=o?AjxStringUtil.convertToHtml(t.content):t.content
}
return r
};
ZmComposeView.prototype._getDialogXY=function(){
var e=Dwt.toWindow(this.getHtmlElement(),0,0);
return new DwtPoint(e.x+ZmComposeView.DIALOG_X,e.y+ZmComposeView.DIALOG_Y)
};
ZmComposeView.prototype._getForwardAttIds=function(t){
var e=[];
var o=document.getElementsByName(t);
for(var a=0;
a<o.length;
a++){
if(o[a].checked){
e.push(o[a].value)
}}
return e
};
ZmComposeView.prototype._acCompHandler=function(a,t,e){
this._adjustAddrHeight(t)
};
ZmComposeView.prototype._acKeyupHandler=function(o,t,e){
var i=DwtKeyEvent.getCharCode(o);
if(e&&(o.inputLengthChanged||(i==3||i==13||i==8||i==46||(AjxEnv.isMac&&i==224)))){
var a=DwtUiEvent.getTargetWithProp(o,"id");
a.value=a.value&&a.value.replace(/;([^\s])/g,function(n,s){
return"; "+s
}
)||"";
this._adjustAddrHeight(a)
}};
ZmComposeView.prototype._adjustAddrHeight=function(e,a){
if(e.value.length==0){
e.style.height="21px";
if(AjxEnv.isIE){
e.style.overflowY="hidden"
}else{
e.style.overflow="hidden"
}
if(!a){
this._resetBodySize()
}
return
}
if(e.scrollHeight>e.clientHeight){
var i=parseInt(e.style.height)||0;
if(i<=65){
var t=e.scrollHeight;
if(e.scrollHeight>=65){
t=65;
if(AjxEnv.isIE){
e.style.overflowY="scroll"
}else{
e.style.overflow="auto"
}}
e.style.height=t+13;
this._resetBodySize()
}else{
if(AjxEnv.isIE){
e.style.overflowY="scroll"
}else{
e.style.overflow="auto"
}
e.scrollTop=e.scrollHeight
}}};
ZmComposeView.prototype._setAddresses=function(f,o,u){
this._action=f;
if(f==ZmOperation.NEW_MESSAGE&&u){
this.setAddress(o,u)
}else{
if(this._isReply(f)){
var w=window.parentAppCtxt||window.appCtxt;
var r={};
var e=appCtxt.multiAccounts&&this._msg.getAccount();
var t=w.get(ZmSetting.USERNAME,null,e);
if(t){
r[t.toLowerCase()]=true
}
var g=w.get(ZmSetting.MAIL_ALIASES,null,e);
for(var p=0,h=g.length;
p<h;
p++){
r[g[p].toLowerCase()]=true
}
var n=w.getIdentityCollection(e).defaultIdentity;
if(n&&n.sendFromAddress){
r[n.sendFromAddress.toLowerCase()]=true
}
if(!this._addressesMsg.isSent){
var s=true;
if(this.identitySelect){
var s=n.id==this.identitySelect.getValue()
}
var m=this._addressesMsg.getReplyAddresses(f,r,s);
var l=this._getAddrString(m);
if(f==ZmOperation.REPLY_ALL){
for(var p=0,y=m.size();
p<y;
p++){
var v=m.get(p).address;
r[v]=true
}}
this.setAddress(AjxEmailAddress.TO,l)
}else{
if(f==ZmOperation.REPLY){
var b=this._addressesMsg.getAddresses(AjxEmailAddress.TO);
this.setAddress(AjxEmailAddress.TO,this._getAddrString(b))
}}
if(f==ZmOperation.REPLY){
this.setAddress(AjxEmailAddress.CC,"")
}else{
if(f==ZmOperation.REPLY_ALL){
var c=new AjxVector();
c.addList(this._addressesMsg.getAddresses(AjxEmailAddress.CC));
var b=this._addressesMsg.getAddresses(AjxEmailAddress.TO);
if(this._addressesMsg.isSent){
this.setAddress(AjxEmailAddress.TO,this._getAddrString(b,r))
}else{
c.addList(b)
}
this.setAddress(AjxEmailAddress.CC,this._getAddrString(c,r))
}}}else{
if(f==ZmOperation.DRAFT||f==ZmOperation.SHARE){
for(var p=0;
p<ZmMailMsg.COMPOSE_ADDRS.length;
p++){
var c=this._msg.getAddresses(ZmMailMsg.COMPOSE_ADDRS[p]);
this.setAddress(ZmMailMsg.COMPOSE_ADDRS[p],c.getArray().join(AjxEmailAddress.SEPARATOR))
}}else{
if(f==ZmOperation.DECLINE_PROPOSAL){
var b=this._addressesMsg.getAddresses(AjxEmailAddress.FROM);
this.setAddress(AjxEmailAddress.TO,this._getAddrString(b))
}}}}};
ZmComposeView.prototype._setObo=function(e){
Dwt.setVisible(this._oboRow,true);
this._oboCheckbox.checked=true;
this._oboLabel.innerHTML=AjxMessageFormat.format(ZmMsg.sendObo,e)
};
ZmComposeView.prototype._setSubject=function(n,s,o){
if((n==ZmOperation.NEW_MESSAGE&&o==null)){
return
}
var t=o||((s)?s.subject:"");
if(n==ZmOperation.REPLY_CANCEL&&!t){
var e=(s)?s.invite:null;
if(e){
t=e.getName()
}}
if(n!=ZmOperation.DRAFT&&t){
var a=ZmComposeView.SUBJ_PREFIX_RE;
while(a.test(t)){
t=t.replace(a,"")
}}
var i="";
switch(n){
case ZmOperation.REPLY:case ZmOperation.REPLY_ALL:i="Re: ";
break;
case ZmOperation.REPLY_CANCEL:i=ZmMsg.cancelled+": ";
break;
case ZmOperation.FORWARD_INLINE:case ZmOperation.FORWARD_ATT:i="Fwd: ";
break;
case ZmOperation.REPLY_ACCEPT:i=ZmMsg.subjectAccept+": ";
break;
case ZmOperation.REPLY_DECLINE:i=ZmMsg.subjectDecline+": ";
break;
case ZmOperation.REPLY_TENTATIVE:i=ZmMsg.subjectTentative+": ";
break;
case ZmOperation.REPLY_NEW_TIME:i=ZmMsg.subjectNewTime+": ";
break
}
this._subjectField.value=i+(t||"");
this.updateTabTitle()
};
ZmComposeView.prototype._setBody=function(a,A,b){
var r=(this._composeMode==DwtHtmlEditor.HTML);
var t=(a==ZmOperation.DRAFT);
if(A&&A.isInvite()&&this._isForward(a)){
a=this._action=ZmOperation.FORWARD_INLINE
}
var S=this._controller._curIncOptions;
if(!S){
if(this._isReply(a)){
S={
what:appCtxt.get(ZmSetting.REPLY_INCLUDE_WHAT),prefix:appCtxt.get(ZmSetting.REPLY_USE_PREFIX),headers:appCtxt.get(ZmSetting.REPLY_INCLUDE_HEADERS)}
}else{
if(t){
S={
what:ZmSetting.INC_BODY}
}else{
if(a==ZmOperation.FORWARD_INLINE){
S={
what:ZmSetting.INC_BODY,prefix:appCtxt.get(ZmSetting.FORWARD_USE_PREFIX),headers:appCtxt.get(ZmSetting.FORWARD_INCLUDE_HEADERS)}
}else{
if(a==ZmOperation.FORWARD_ATT){
S={
what:ZmSetting.INC_ATTACH}
}else{
if(a==ZmOperation.DECLINE_PROPOSAL){
S={
what:ZmSetting.INC_BODY}
}else{
if(a==ZmOperation.NEW_MESSAGE){
S={
what:ZmSetting.INC_NONE}
}else{
S={}
}}}}}}
this._controller._curIncOptions=S
}
if(S.what==ZmSetting.INC_NONE||S.what==ZmSetting.INC_ATTACH){
S.prefix=S.headers=false
}
if(S.what==ZmSetting.INC_ATTACH&&!this._msg){
S.what=ZmSetting.INC_NONE
}
var o=r?"<br>":ZmMsg.CRLF;
var p=r?"<br><br>":ZmMsg.CRLF2;
var f="",w="",B=[],O="",W="";
var h={};
var Y=S.what;
if(Y==ZmSetting.INC_BODY||Y==ZmSetting.INC_SMART){
h=this._getBodyContent(A,r);
w=h.body;
if(this._isInviteReply(a)){
w=w.replace(ZmItem.NOTES_SEPARATOR,"")
}}
var e,u,F,v;
var s=appCtxt.multiAccounts&&this.getFromAccount();
var c=window.parentAppCtxt||window.appCtxt;
if(c.get(ZmSetting.SIGNATURES_ENABLED,null,s)){
u=this.getSignatureContentSpan(null,null,s);
e=u&&c.get(ZmSetting.SIGNATURE_STYLE,null,s);
var x=this.getSignatureById(F);
v=x&&x.getContentType()
}
if(e==ZmSetting.SIG_OUTLOOK){
f=(this._composeMode==DwtHtmlEditor.TEXT||v==ZmMimeTable.TEXT_PLAIN)?u+o:u
}
b=b||"";
var R=b+f;
if(S.headers){
for(var H=0;
H<ZmComposeView.QUOTED_HDRS.length;
H++){
var n=A.getHeaderStr(ZmComposeView.QUOTED_HDRS[H],r);
if(n){
B.push(n)
}}}
if(a==ZmOperation.REPLY_CANCEL){
var j=[o];
var T=A&&A.invite;
if(T){
j.push(ZmMsg.subjectLabel+" "+(A.subject||T.getName())+o);
j.push(ZmMsg.organizer+": "+T.getOrganizerName()+o);
var g=A._instanceDate||T.getServerStartDate();
j.push(ZmMsg.time+": "+g+o);
var l=T.getLocation();
if(l){
j.push(ZmMsg.locationLabel+" "+l+o)
}}
j.push(o+ZmItem.NOTES_SEPARATOR);
W+=o+j.join("")
}else{
if(S.what==ZmSetting.INC_NONE){
W=R
}else{
if(S.what==ZmSetting.INC_ATTACH){
W=R;
this._msgAttId=this._msg.id
}else{
var O=this._preface=this._getPreface();
var k=!w?"":r?O:O+o;
var m=R?"":p;
var z=ZmHtmlEditor.getWrapParams(r,S);
z.preserveReturns=true;
if(S.what==ZmSetting.INC_BODY){
if(t){
W=w
}else{
if(r){
var C=B.length?B.join(o)+p:"";
z.text=t?w:C+w;
var M=AjxStringUtil.wordWrap(z);
W=m+R+k+M
}else{
var C="";
if(B.length){
var q=z.text=B.join(o)+p;
z.len=120;
C=S.prefix?AjxStringUtil.wordWrap(z):q
}
z.text=w;
z.len=ZmHtmlEditor.WRAP_LENGTH;
var M=S.prefix?AjxStringUtil.wordWrap(z):w;
W=m+R+k+C+M
}}}else{
if(S.what==ZmSetting.INC_SMART){
var D=AjxStringUtil.getTopLevel(w);
if(D.length){
w=D.join(p)
}
if(r){
var C=B.length?B.join(o)+p:"";
z.text=t?w:C+w;
var M=AjxStringUtil.wordWrap(z);
W=m+R+k+M
}else{
var C="";
if(B.length){
var q=z.text=B.join(o)+p;
z.len=120;
C=S.prefix?AjxStringUtil.wordWrap(z):q
}
z.text=w;
z.len=ZmHtmlEditor.WRAP_LENGTH;
var M=S.prefix?AjxStringUtil.wordWrap(z):w;
W=m+R+k+C+M
}}}}}}
var y=this._htmlEditor.isHtmlModeInited();
if(!y){
this._fixMultipartRelatedImages_onTimer(A)
}
if(!t&&e==ZmSetting.SIG_INTERNET){
this.addSignature(W)
}else{
W=W||(r?"<br>":"");
this._htmlEditor.setContent(W)
}
if(y){
this._fixMultipartRelatedImages_onTimer(A)
}
var I=(h&&h.hasInlineImages)||!appCtxt.get(ZmSetting.VIEW_AS_HTML);
this._showForwardField(A,a,S,I,h&&h.hasInlineAtts)
};
ZmComposeView.prototype._getBodyContent=function(i,t){
var l,o,h,m;
var f=t?"<br>":ZmMsg.CRLF;
var r=t?"<br><br>":ZmMsg.CRLF2;
var s=i.getBodyParts();
if(s&&s.length>1){
var c=[];
for(var n=0;
n<s.length;
n++){
var a=s[n];
if(ZmMimeTable.isRenderableImage(a.ct)){
c.push([f,"[",a.ct,":",(a.filename||"..."),"]",f].join(""));
h=true
}else{
if(a.filename&&a.cd=="inline"){
var u=ZmMimeTable.getInfo(a.ct);
u=u?u.desc:a.ct;
c.push([f,"[",u,":",(a.filename||"..."),"]",f].join(""));
m=true
}else{
if(a.ct==ZmMimeTable.TEXT_PLAIN||(a.body&&ZmMimeTable.isTextType(a.ct))){
c.push(t?AjxStringUtil.convertToHtml(a.content):a.content)
}else{
if(a.ct==ZmMimeTable.TEXT_HTML){
if(t){
c.push(a.content)
}else{
var e=document.createElement("div");
e.innerHTML=a.content;
c.push(AjxStringUtil.convertHtml2Text(e))
}}}}}}
l=c.join(f)
}else{
if(t){
l=i.getBodyPart(ZmMimeTable.TEXT_HTML);
if(l){
l=AjxUtil.isString(l)?l:l.content
}else{
o=i.getBodyPart();
l=o?this._getTextPart(o,true):null
}}else{
h=i.hasInlineImagesInMsgBody();
o=i.getBodyPart(ZmMimeTable.TEXT_PLAIN)||i.getBodyPart(ZmMimeTable.TEXT_HTML,true)||i.getTextBodyPart();
l=o?this._getTextPart(o):null
}}
if(o&&AjxUtil.isObject(o)&&o.truncated){
l+=r+ZmMsg.messageTruncated+r
}
return{
body:l||"",bodyPart:o,hasInlineImages:h,hasInlineAtts:m}
};
ZmComposeView.prototype._getPreface=function(i,a){
i=i||this._composeMode;
a=a||this._action;
var e;
if(i==DwtHtmlEditor.HTML){
e='<hr id="zwchr">'
}else{
var t=(a==ZmOperation.FORWARD_INLINE)?AjxMsg.forwardedMessage:AjxMsg.origMsg;
e=[ZmMsg.DASHES," ",t," ",ZmMsg.DASHES].join("")
}
return e
};
ZmComposeView.prototype._switchPreface=function(o){
o=o||this._composeMode;
var n=(o==DwtHtmlEditor.HTML);
var i=n?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML;
var t=this._getPreface(i);
var e=this._getPreface(o);
if(!n){
e=e+"<br>";
this._switchedToText=true
}else{
if(this._switchedToText){
t=new RegExp(t+"\\s*<br>")
}}
var a=this.getHtmlEditor().getContent();
a=a.replace(t,e);
this._htmlEditor.setContent(a);
this._preface=e
};
ZmComposeView._convertHtmlPreface=function(e,t){
return(t&&t.id=="zwchr")?e._getPreface(DwtHtmlEditor.TEXT)+ZmMsg.CRLF:null
};
ZmComposeView.prototype._applyHtmlPrefix=function(c,a,l){
var h=this._controller._curIncOptions;
if(h&&h.prefix){
var t=ZmHtmlEditor.getWrapParams(false,h);
t.preserveReturns=true;
var m=c.split("\n");
var e=0;
var s=[];
var o=0;
for(var r=0;
r<m.length;
r++){
var u=m[r];
if(u==a){
e++
}else{
if(u==l){
e--
}else{
t.len=ZmHtmlEditor.WRAP_LENGTH;
for(var n=0;
n<e;
n++){
t.text=u;
u=AjxStringUtil.wordWrap(t)
}
s[o++]=u
}}}
return s.join("")
}else{
return c.replace(a,"").replace(l,"")
}};
ZmComposeView.prototype.resetBody=function(a,i,e,t){
this.cleanupAttachments(true);
this._isDirty=this._isDirty||this.isDirty();
this._setBody(a,i,e,t);
this._setFormValue();
this._resetBodySize()
};
ZmComposeView.prototype._setEventHandler=function(o,e,a){
var t=document.getElementById(o);
t._composeView=this._internalId;
if(a){
t._addrType=a
}
var i=e.toLowerCase();
t[i]=ZmComposeView["_"+e]
};
ZmComposeView.prototype._setBodyFieldCursor=function(e){
if(this._composeMode==DwtHtmlEditor.HTML){
return
}
if(AjxEnv.isIE){
var a=this._bodyField.createTextRange();
if(e){
a.move("character",e.length+1)
}else{
a.collapse(true)
}
a.select()
}else{
var t=e?(e.length+1):0;
Dwt.setSelectionRange(this._bodyField,t,t)
}};
ZmComposeView.prototype.isTinyMCEEnabled=function(){
return window.isTinyMCE
};
ZmComposeView.prototype._initialize=function(i){
this._divId={};
this._buttonTdId={};
this._fieldId={};
this._using={};
this._button={};
this._field={};
this._divEl={};
this._internalId=AjxCore.assignId(this);
this._createHtml();
var a=appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED);
var t=appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT);
var e=a&&t==ZmSetting.COMPOSE_HTML?DwtHtmlEditor.HTML:DwtHtmlEditor.TEXT;
this._composeMode=i||e;
this._clearFormValue();
if(this.isTinyMCEEnabled()){
this._htmlEditor=new ZmAdvancedHtmlEditor(this,DwtControl.RELATIVE_STYLE,null,this._composeMode);
this._bodyFieldId=this._htmlEditor.getBodyFieldId();
this._bodyField=document.getElementById(this._bodyFieldId)
}else{
this._htmlEditor=new ZmHtmlEditor(this,DwtControl.RELATIVE_STYLE,null,this._composeMode);
this._bodyFieldId=this._htmlEditor.getBodyFieldId();
this._bodyField=document.getElementById(this._bodyFieldId)
}
this._includedPreface="";
this.setScrollStyle(DwtControl.SCROLL);
this._attachCount=0;
this.addControlListener(new AjxListener(this,this._controlListener))
};
ZmComposeView.prototype._createHtml=function(e){
var t={
id:this._htmlElId,headerId:ZmId.getViewId(this._view,ZmId.CMP_HEADER),fromSelectId:ZmId.getViewId(this._view,ZmId.CMP_FROM_SELECT),toRowId:ZmId.getViewId(this._view,ZmId.CMP_TO_ROW),toPickerId:ZmId.getViewId(this._view,ZmId.CMP_TO_PICKER),toInputId:ZmId.getViewId(this._view,ZmId.CMP_TO_INPUT),ccRowId:ZmId.getViewId(this._view,ZmId.CMP_CC_ROW),ccPickerId:ZmId.getViewId(this._view,ZmId.CMP_CC_PICKER),ccInputId:ZmId.getViewId(this._view,ZmId.CMP_CC_INPUT),bccRowId:ZmId.getViewId(this._view,ZmId.CMP_BCC_ROW),bccPickerId:ZmId.getViewId(this._view,ZmId.CMP_BCC_PICKER),bccInputId:ZmId.getViewId(this._view,ZmId.CMP_BCC_INPUT),bccToggleId:ZmId.getViewId(this._view,ZmId.CMP_BCC_TOGGLE),subjectRowId:ZmId.getViewId(this._view,ZmId.CMP_SUBJECT_ROW),subjectInputId:ZmId.getViewId(this._view,ZmId.CMP_SUBJECT_INPUT),oboRowId:ZmId.getViewId(this._view,ZmId.CMP_OBO_ROW),oboCheckboxId:ZmId.getViewId(this._view,ZmId.CMP_OBO_CHECKBOX),oboLabelId:ZmId.getViewId(this._view,ZmId.CMP_OBO_LABEL),identityRowId:ZmId.getViewId(this._view,ZmId.CMP_IDENTITY_ROW),identitySelectId:ZmId.getViewId(this._view,ZmId.CMP_IDENTITY_SELECT),priorityId:ZmId.getViewId(this._view,ZmId.CMP_PRIORITY),attRowId:ZmId.getViewId(this._view,ZmId.CMP_ATT_ROW),attDivId:ZmId.getViewId(this._view,ZmId.CMP_ATT_DIV),zdndToolTipId:ZmId.getViewId(this._view,ZmId.CMP_DND_TOOLTIP)};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
ZmComposeView.prototype._createHtmlFromTemplate=function(a,s){
DwtComposite.prototype._createHtmlFromTemplate.call(this,a,s);
this._identityDivId=s.identityRowId;
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)||appCtxt.get(ZmSetting.GAL_ENABLED)||appCtxt.isOffline){
var n={
parent:appCtxt.getShell(),dataClass:appCtxt.getAutocompleter(),matchValue:ZmAutocomplete.AC_VALUE_FULL,compCallback:(new AjxCallback(this,this._acCompHandler)),keyUpCallback:(new AjxCallback(this,this._acKeyupHandler))};
this._acAddrSelectList=new ZmAutocompleteListView(n)
}
var e=(appCtxt.get(ZmSetting.CONTACTS_ENABLED)||appCtxt.get(ZmSetting.GAL_ENABLED)||appCtxt.multiAccounts);
this._pickerButton={};
for(var r=0;
r<ZmMailMsg.COMPOSE_ADDRS.length;
r++){
var f=ZmMailMsg.COMPOSE_ADDRS[r];
var p=AjxEmailAddress.TYPE_STRING[f];
this._divId[f]=[s.id,p,"row"].join("_");
this._buttonTdId[f]=[s.id,p,"picker"].join("_");
this._fieldId[f]=[s.id,p,"control"].join("_");
this._divEl[f]=document.getElementById(this._divId[f]);
this._field[f]=document.getElementById(this._fieldId[f]);
if(this._field[f]){
this._field[f].addrType=f;
this._setEventHandler(this._fieldId[f],"onFocus")
}
if(e){
var l=this._buttonTdId[f];
var u=document.getElementById(l);
if(u){
var c=ZmId.getButtonId(this._view,ZmComposeView.OP[f]);
var h=this._pickerButton[f]=new DwtButton({
parent:this,id:c}
);
h.setText(u.innerHTML);
h.replaceElement(u);
h.addSelectionListener(new AjxListener(this,this._addressButtonListener));
h.addrType=f;
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)||appCtxt.isOffline){
this._acAddrSelectList.handle(this._field[f])
}else{
this._setEventHandler(this._fieldId[f],"onKeyUp")
}
this._button[f]=h
}}}
this._headerEl=document.getElementById(s.headerId);
this._subjectField=document.getElementById(s.subjectInputId);
this._oboRow=document.getElementById(s.oboRowId);
this._oboCheckbox=document.getElementById(s.oboCheckboxId);
this._oboLabel=document.getElementById(s.oboLabelId);
this._attcDiv=document.getElementById(s.attDivId);
this._setEventHandler(s.subjectInputId,"onKeyUp");
this._setEventHandler(s.subjectInputId,"onBlur");
this._setEventHandler(s.subjectInputId,"onFocus");
if(appCtxt.multiAccounts){
if(!this._fromSelect){
this._fromSelect=new DwtSelect({
parent:this,parentElement:s.fromSelectId}
);
this._fromSelect.addChangeListener(new AjxListener(this,this._handleFromListener))
}}else{
var m=this._getIdentityOptions();
this.identitySelect=new DwtSelect({
parent:this,options:m}
);
this.identitySelect.setToolTipContent(ZmMsg.chooseIdentity);
if(!this._identityChangeListenerObj){
this._identityChangeListenerObj=new AjxListener(this,this._identityChangeListener)
}
var g=window.parentAppCtxt||window.appCtxt;
var t=g.accountList.visibleAccounts;
for(var r=0;
r<t.length;
r++){
var o=g.getIdentityCollection(t[r]);
o.addChangeListener(this._identityChangeListenerObj)
}
this.identitySelect.replaceElement(s.identitySelectId);
this._setIdentityVisible()
}
if(appCtxt.get(ZmSetting.MAIL_PRIORITY_ENABLED)){
var c=ZmId.getButtonId(this._view,ZmId.CMP_PRIORITY);
this._priorityButton=new DwtButton({
parent:this,id:c}
);
this._priorityButton.setMenu(new AjxCallback(this,this._priorityButtonMenuCallback));
this._priorityButton.reparentHtmlElement(s.priorityId);
this._priorityButton.setToolTipContent(ZmMsg.setPriority)
}
this._toggleBccEl=document.getElementById(s.bccToggleId);
if(this._toggleBccEl){
Dwt.setHandler(this._toggleBccEl,DwtEvent.ONCLICK,AjxCallback.simpleClosure(this._toggleBccField,this))
}};
ZmComposeView.prototype._handleFromListener=function(l){
var t=l._args.newValue;
var c=l._args.oldValue;
if(c==t){
return
}
var m=window.parentAppCtxt||window.appCtxt;
var s=this._fromSelect.getOptionWithValue(t);
var r=m.accountList.getAccount(s.accountId);
var o=m.getIdentityCollection(r);
var h=o&&o.getById(t);
var a=h?h.signature:o.defaultIdentity;
this._controller._accountName=r.name;
this._controller.resetSignatureToolbar(a,r);
this._controller.resetSignature(a,r);
this._controller._resetReadReceipt(r);
if(this._acAddrSelectList){
this._acAddrSelectList.setActiveAccount(r)
}
if(this._msg&&this._msg.isDraft){
var i=this._fromSelect.getOptionWithValue(c);
var n=m.accountList.getAccount(i.accountId);
var e=this._origAcctMsgId=this._msg.id;
this._msg=this._addressesMsg=null;
var u=new AjxCallback(this,this._handleMoveDraft,[n.name,e]);
this._controller.saveDraft(this._controller._draftType,null,null,u)
}
this._resetPickerButtons(r)
};
ZmComposeView.prototype._handleMoveDraft=function(e,t){
var i={
ItemActionRequest:{
_jsns:"urn:zimbraMail",action:{
id:t,op:"delete"}}};
var a={
jsonObj:i,asyncMode:true,accountName:e};
appCtxt.getAppController().sendRequest(a)
};
ZmComposeView.prototype._toggleBccField=function(t,a){
var e=Dwt.getVisible(this._divEl[AjxEmailAddress.BCC]);
if(typeof a!="undefined"){
e=!a
}
this._showAddressField(AjxEmailAddress.BCC,!e)
};
ZmComposeView.prototype._createPriorityMenuItem=function(i,a,e){
var t=DwtMenuItem.create({
parent:i,imageInfo:this._getPriorityImage(e),text:a}
);
t._priorityFlag=e;
t.addSelectionListener(this._priorityMenuListnerObj)
};
ZmComposeView.prototype._priorityButtonMenuCallback=function(){
var e=new DwtMenu({
parent:this._priorityButton}
);
this._priorityMenuListnerObj=new AjxListener(this,this._priorityMenuListner);
this._createPriorityMenuItem(e,ZmMsg.high,ZmItem.FLAG_HIGH_PRIORITY);
this._createPriorityMenuItem(e,ZmMsg.normal,"");
this._createPriorityMenuItem(e,ZmMsg.low,ZmItem.FLAG_LOW_PRIORITY);
return e
};
ZmComposeView.prototype._getPriorityImage=function(e){
if(e==ZmItem.FLAG_HIGH_PRIORITY){
return"PriorityHigh"
}
if(e==ZmItem.FLAG_LOW_PRIORITY){
return"PriorityLow"
}
return"PriorityNormal"
};
ZmComposeView.prototype._priorityMenuListner=function(e){
this._setPriority(e.dwtObj._priorityFlag)
};
ZmComposeView.prototype._getPriority=function(){
return(this._priorityButton)?(this._priorityButton._priorityFlag||""):""
};
ZmComposeView.prototype._setPriority=function(e){
if(this._priorityButton){
e=e||"";
this._priorityButton.setImage(this._getPriorityImage(e));
this._priorityButton._priorityFlag=e
}};
ZmComposeView.prototype._getIdentityOptions=function(){
var t=[];
var s=appCtxt.getIdentityCollection();
var o=s.getIdentities();
for(var a=0,n=o.length;
a<n;
a++){
var e=o[a];
t.push(new DwtSelectOptionData(e.id,this._getIdentityText(e)))
}
return t
};
ZmComposeView.prototype._getIdentityText=function(t,n){
var a=t.name;
if(t.isDefault&&a==ZmIdentity.DEFAULT_NAME){
a=n?n.getDisplayName():ZmMsg.accountDefault
}
var e=appCtxt.getIdentityCollection().defaultIdentity;
var r=[a,(t.sendFromDisplay||""),t.sendFromAddress,ZmMsg.accountDefault,appCtxt.get(ZmSetting.DISPLAY_NAME),e.sendFromAddress];
var o;
if(t.isDefault){
o=ZmMsg.identityTextPrimary
}else{
if(t.isFromDataSource){
var i=appCtxt.getDataSourceCollection().getById(t.id);
if(r[1]==""){
r[1]=i.userName||""
}
r[2]=i.getEmail();
var s=ZmDataSource.getProviderForAccount(i);
if(s){
o=ZmMsg["identityText-"+s.id]
}else{
if(r[0]&&r[1]&&r[2]&&(r[0]!=r[1]!=r[2])){
o=ZmMsg.identityTextPersona
}else{
o=ZmMsg.identityTextExternal
}}}else{
o=ZmMsg.identityTextPersona
}}
return AjxMessageFormat.format(o,r)
};
ZmComposeView.prototype._identityChangeListener=function(s){
if(s.event==ZmEvent.E_CREATE){
this._setIdentityVisible();
var e=s.getDetail("item");
var r=this._getIdentityText(e);
var o=new DwtSelectOptionData(e.id,r);
if(this.identitySelect){
this.identitySelect.addOption(o)
}}else{
if(s.event==ZmEvent.E_DELETE){
if(this.identitySelect){
this.identitySelect.clearOptions();
var t=this._getIdentityOptions();
for(var a=0,n=t.length;
a<n;
a++){
this.identitySelect.addOption(t[a])
}
this._setIdentityVisible()
}}else{
if(s.event==ZmEvent.E_MODIFY){
if(this.identitySelect){
var e=s.getDetail("item");
var r=this._getIdentityText(e);
this.identitySelect.rename(e.id,r)
}}}}};
ZmComposeView.prototype._setIdentityVisible=function(){
if(!appCtxt.get(ZmSetting.IDENTITIES_ENABLED)){
return
}
var t=document.getElementById(this._identityDivId);
if(!t){
return
}
var e=appCtxt.getIdentityCollection().getSize()>1;
Dwt.setVisible(t,e)
};
ZmComposeView.prototype.getIdentity=function(){
var o=window.parentAppCtxt||window.appCtxt;
if(appCtxt.multiAccounts){
var a=this._fromSelect.getValue();
var i=this._fromSelect.getOptionWithValue(a);
var t=o.accountList.getAccount(i.accountId);
var s=o.getIdentityCollection(t);
return s&&s.getById(a)
}
if(this.identitySelect){
var s=o.getIdentityCollection();
var n=this.identitySelect.getValue();
var e=s.getById(n);
return e?e:s.defaultIdentity
}};
ZmComposeView.prototype._showForwardField=function(a,n,c,e,o){
var l="";
if(!(this._msgIds&&this._msgIds.length)&&((c&&c.what==ZmSetting.INC_ATTACH)||n==ZmOperation.FORWARD_ATT)){
l=AjxTemplate.expand("mail.Message#ForwardOneMessage",{
message:a}
);
this._attachCount=1
}else{
if(a&&(a.hasAttach||e||o)){
var u=a.getAttachmentLinks(false,e,o);
if(u.length>0){
var h={
attachments:u,isNew:n==ZmOperation.NEW_MESSAGE,isForward:n==ZmOperation.FORWARD,isForwardInline:n==ZmOperation.FORWARD_INLINE,isDraft:n==ZmOperation.DRAFT,fwdFieldName:(ZmComposeView.FORWARD_ATT_NAME+this._sessionId)};
l=AjxTemplate.expand("mail.Message#ForwardAttachments",h);
if(u.length>=ZmComposeView.SHOW_MAX_ATTACHMENTS){
this._attcDiv.style.height=ZmComposeView.MAX_ATTACHMENT_HEIGHT;
this._attcDiv.style.overflow="auto"
}
this._attachCount=u.length
}}else{
if(this._msgIds&&this._msgIds.length){
var t=window.parentAppCtxt||window.appCtxt;
var s=[];
for(var r=0;
r<this._msgIds.length;
r++){
var m=t.cacheGet(this._msgIds[r]);
if(!m){
continue
}
s.push(m)
}
var h={
messages:s,fwdFieldName:(ZmComposeView.FORWARD_MSG_NAME+this._sessionId)};
l=AjxTemplate.expand("mail.Message#ForwardMessages",h);
if(s.length>=ZmComposeView.SHOW_MAX_ATTACHMENTS){
this._attcDiv.style.height=ZmComposeView.MAX_ATTACHMENT_HEIGHT;
this._attcDiv.style.overflow="auto"
}
this._attachCount=s.length
}}}
this._attcDiv.innerHTML=l
};
ZmComposeView.prototype._resetBodySize=function(){
var t=this.getSize();
if(t.x<=0||t.y<=0){
return
}
var e=t.y-Dwt.getSize(this._headerEl).y;
if(e!=t.y){
this._htmlEditor.setSize(t.x,e)
}};
ZmComposeView.prototype._resetPickerButtons=function(n){
var o=window.parentAppCtxt||window.appCtxt;
var a=o.get(ZmSetting.CONTACTS_ENABLED,null,n)||o.get(ZmSetting.GAL_ENABLED,null,n);
for(var t in this._pickerButton){
var e=this._pickerButton[t];
e.setEnabled(a)
}};
ZmComposeView.prototype._setFromSelect=function(a){
if(!this._fromSelect){
return
}
this._fromSelect.clearOptions();
var f=window.parentAppCtxt||window.appCtxt;
var h;
var o=f.getActiveAccount();
var t=f.accountList.visibleAccounts;
for(var s=0;
s<t.length;
s++){
var c=t[s];
if(appCtxt.isOffline&&c.isMain){
continue
}
var m=f.getIdentityCollection(c).getIdentities();
if(f.isFamilyMbox||f.get(ZmSetting.OFFLINE_SMTP_ENABLED,null,c)){
for(var n=0;
n<m.length;
n++){
h=m[n];
var u=this._getIdentityText(h,c);
var l=appCtxt.isOffline?c.getIcon():null;
var r=new DwtSelectOption(h.id,false,u,null,null,l);
r.addr=new AjxEmailAddress(h.sendFromAddress,AjxEmailAddress.FROM,h.sendFromDisplay);
r.accountId=c.id;
this._fromSelect.addOption(r)
}}}
var p;
if(a){
var e=f.getIdentityCollection(a.getAccount());
p=(a.isDraft)?e.selectIdentity(a,AjxEmailAddress.FROM):e.selectIdentity(a);
if(!p){
p=e.defaultIdentity
}}
if(!p){
p=f.getIdentityCollection(o).defaultIdentity
}
if(p&&p.id){
this._fromSelect.setSelectedValue(p.id)
}
if((appCtxt.getSearchController().searchAllAccounts&&this._fromSelect)||o.isMain){
o=this.getFromAccount();
this._controller._accountName=o.name
}
if(this._acAddrSelectList){
this._acAddrSelectList.setActiveAccount(o)
}
this._resetPickerButtons(o)
};
ZmComposeView.prototype._showAddressField=function(i,e,t,o){
this._using[i]=e;
Dwt.setVisible(this._divEl[i],e);
this._field[i].value="";
this._field[i].noTab=!e;
var a=ZmComposeView.ADDR_SETTING[i];
if(a){
appCtxt.set(a,e,null,false,t)
}
if(i==AjxEmailAddress.BCC){
Dwt.setInnerHtml(this._toggleBccEl,e?ZmMsg.hideBCC:ZmMsg.showBCC)
}
this._resetBodySize()
};
ZmComposeView.prototype._collectAddrs=function(){
var o={};
o[ZmComposeView.BAD]=new AjxVector();
for(var t=0;
t<ZmMailMsg.COMPOSE_ADDRS.length;
t++){
var a=ZmMailMsg.COMPOSE_ADDRS[t];
if(!this._using[a]){
continue
}
var n=AjxStringUtil.trim(this._field[a].value);
if(n.length==0){
continue
}
var e=AjxEmailAddress.parseEmailString(n,a,false);
if(e.all.size()==0){
continue
}
o.gotAddress=true;
o[a]=e;
if(e.bad.size()){
o[ZmComposeView.BAD].addList(e.bad);
if(!o.badType){
o.badType=a
}}}
return o
};
ZmComposeView.prototype._formValue=function(s,o){
var a=[];
if(s){
for(var e=0;
e<ZmMailMsg.COMPOSE_ADDRS.length;
e++){
var t=ZmMailMsg.COMPOSE_ADDRS[e];
if(this._using[t]){
a.push(this._field[t].value)
}}}
if(o){
a.push(this._subjectField.value)
}
a.push(this._htmlEditor.getContent());
var n=a.join("|");
n=n.replace(/\|+/,"|");
return n
};
ZmComposeView.prototype._addressButtonListener=function(u,r){
var t=u?DwtControl.getTargetControl(u):null;
this.enableInputs(false);
if(!this._contactPicker){
AjxDispatcher.require("ContactsCore");
var e=[{
id:AjxEmailAddress.TO,label:ZmMsg[AjxEmailAddress.TYPE_STRING[AjxEmailAddress.TO]]}
,{
id:AjxEmailAddress.CC,label:ZmMsg[AjxEmailAddress.TYPE_STRING[AjxEmailAddress.CC]]}
,{
id:AjxEmailAddress.BCC,label:ZmMsg[AjxEmailAddress.TYPE_STRING[AjxEmailAddress.BCC]]}
];
this._contactPicker=new ZmContactPicker(e);
this._contactPicker.registerCallback(DwtDialog.OK_BUTTON,this._contactPickerOkCallback,this);
this._contactPicker.registerCallback(DwtDialog.CANCEL_BUTTON,this._contactPickerCancelCallback,this)
}
var m=t?t.addrType:r;
var f={};
var s=this._collectAddrs();
for(var o=0;
o<ZmMailMsg.COMPOSE_ADDRS.length;
o++){
var c=ZmMailMsg.COMPOSE_ADDRS[o];
if(s[c]){
f[c]=s[c].good.getArray()
}}
this._contactPicker.addPopdownListener(this._controller._dialogPopdownListener);
var l=(this._field[m].value&&!(f[m]&&f[m].length))?this._field[m].value:"";
var n;
if(appCtxt.multiAccounts&&this._fromSelect){
var h=this._fromSelect.getSelectedOption().addr;
n=appCtxt.accountList.getAccountByEmail(h.address)
}
this._contactPicker.popup(m,f,l,n)
};
ZmComposeView.prototype._controlListener=function(){
this._resetBodySize()
};
ZmComposeView.prototype._contactPickerOkCallback=function(o){
this.enableInputs(true);
for(var t=0;
t<ZmMailMsg.COMPOSE_ADDRS.length;
t++){
var a=ZmMailMsg.COMPOSE_ADDRS[t];
var e=o[a];
var n=(e.size()>0)?e.toString(AjxEmailAddress.SEPARATOR)+AjxEmailAddress.SEPARATOR:"";
this.setAddress(ZmMailMsg.COMPOSE_ADDRS[t],n)
}
this._contactPicker.removePopdownListener(this._controller._dialogPopdownListener);
this._contactPicker.popdown();
this.reEnableDesignMode()
};
ZmComposeView.prototype._contactPickerCancelCallback=function(){
this.enableInputs(true);
this.reEnableDesignMode()
};
ZmComposeView.prototype._htmlEditorEventCallback=function(t){
var i=true;
if(t.type=="keydown"){
var a=DwtKeyEvent.getCharCode(t);
if(a==DwtKeyEvent.KEY_TAB){
var e=document.getElementById(this._fieldId[AjxEmailAddress.TO]);
if(e){
appCtxt.getKeyboardMgr().grabFocus(e)
}
i=false
}}
return i
};
ZmComposeView.prototype._okCallback=function(){
appCtxt.getMsgDialog().popdown();
this._controller.resetToolbarOperations();
this.reEnableDesignMode()
};
ZmComposeView.prototype._noSubjectOkCallback=function(e){
this._noSubjectOkay=true;
this._popDownAlertAndSendMsg(e)
};
ZmComposeView.prototype._popDownAlertAndSendMsg=function(e){
if(AjxEnv.isIE){
e.popdown()
}
if(AjxEnv.isNav&&appCtxt.isChildWindow){
e.setVisible(false)
}
if(appCtxt.isChildWindow&&!AjxEnv.isNav){
this._controller.sendMsg()
}else{
e.popdown();
this._controller.sendMsg()
}};
ZmComposeView.prototype._noSubjectCancelCallback=function(e){
this.enableInputs(true);
e.popdown();
appCtxt.getKeyboardMgr().grabFocus(this._subjectField);
this._controller.resetToolbarOperations();
this.reEnableDesignMode()
};
ZmComposeView.prototype._errViaZimletOkCallback=function(a){
var e=a.errDialog;
var t=a.zimletName;
this._ignoredZimlets=this._ignoredZimlets||{};
this._ignoredZimlets[t]=true;
this._popDownAlertAndSendMsg(e)
};
ZmComposeView.prototype._errViaZimletCancelCallback=function(a){
var e=a.errDialog;
var t=a.zimletName;
this.enableInputs(true);
e.popdown();
this._controller.resetToolbarOperations();
this.reEnableDesignMode()
};
ZmComposeView.prototype._badAddrsOkCallback=function(e){
this.enableInputs(true);
this._badAddrsOkay=true;
e.popdown();
this._controller.sendMsg()
};
ZmComposeView.prototype._badAddrsCancelCallback=function(t,e){
this.enableInputs(true);
this._badAddrsOkay=false;
e.popdown();
if(this._using[t]){
appCtxt.getKeyboardMgr().grabFocus(this._field[t])
}
this._controller.resetToolbarOperations();
this.reEnableDesignMode()
};
ZmComposeView.prototype._attsDoneCallback=function(a,e,t,o){
if(e==AjxPost.SC_OK){
this._controller.saveDraft(ZmComposeController.DRAFT_TYPE_AUTO,t,o)
}else{
if(e==AjxPost.SC_UNAUTHORIZED){
var i=new AjxException("401 response during attachment upload",ZmCsfeException.SVC_AUTH_EXPIRED);
var s=new AjxCallback(this._controller,a?this._controller.saveDraft:this._controller._send);
this._controller._handleException(i,{
continueCallback:s}
)
}else{
var n=AjxMessageFormat.format(ZmMsg.errorAttachment,(e||AjxPost.SC_NO_CONTENT));
switch(e){
case AjxPost.SC_REQUEST_ENTITY_TOO_LARGE:n+=" "+ZmMsg.errorAttachmentTooBig+"<br><br>";
break;
default:n+=" ";
break
}
this._controller.popupErrorDialog(n+ZmMsg.errorTryAgain,null,null,true);
this._controller.resetToolbarOperations()
}}};
ZmComposeView.prototype._spellCheckShield=function(a){
if(a&&a.available&&a.misspelled!=null&&a.misspelled.length!=0){
var e=appCtxt.getYesNoMsgDialog();
e.setMessage(AjxMessageFormat.format(ZmMsg.misspellingsMessage,[a.misspelled.length]));
e.registerCallback(DwtDialog.YES_BUTTON,this._spellCheckShieldOkListener,this,[e,a]);
e.registerCallback(DwtDialog.NO_BUTTON,this._spellCheckShieldCancelListener,this,e);
e.associateEnterWithButton(DwtDialog.NO_BUTTON);
var t=this;
e.handleKeyAction=function(i,o){
if(i&&i==DwtKeyMap.CANCEL){
t._spellCheckShieldOkListener(e,a,o);
return(true)
}};
e.popup(null,DwtDialog.NO_BUTTON)
}else{
this._spellCheckOkay=true;
this._controller.sendMsg()
}};
ZmComposeView.prototype._spellCheckShieldOkListener=function(e,a,t){
this._controller._toolbar.enableAll(true);
this.enableInputs(true);
this._controller.toggleSpellCheckButton(true);
this._htmlEditor.discardMisspelledWords();
this._spellCheckOkay=false;
e.popdown();
this._htmlEditor.onExitSpellChecker=new AjxCallback(this._controller,this._controller.toggleSpellCheckButton,true);
this._htmlEditor._spellCheckCallback(a)
};
ZmComposeView.prototype._spellCheckShieldCancelListener=function(e,t){
this._spellCheckOkay=true;
e.popdown();
this._controller.sendMsg()
};
ZmComposeView.prototype._spellCheckErrorShield=function(t){
var e=appCtxt.getYesNoMsgDialog();
e.setMessage(ZmMsg.spellCheckFailed);
e.registerCallback(DwtDialog.YES_BUTTON,this._spellCheckErrorShieldOkListener,this,e);
e.registerCallback(DwtDialog.NO_BUTTON,this._spellCheckErrorShieldCancelListener,this,e);
e.associateEnterWithButton(DwtDialog.NO_BUTTON);
e.popup(null,DwtDialog.NO_BUTTON);
return true
};
ZmComposeView.prototype._spellCheckErrorShieldOkListener=function(e,t){
this._controller._toolbar.enableAll(true);
this._controller.toggleSpellCheckButton(false);
this._htmlEditor.discardMisspelledWords();
e.popdown();
this._spellCheckOkay=true;
this._controller.sendMsg()
};
ZmComposeView.prototype._spellCheckErrorShieldCancelListener=function(e,t){
this._controller._toolbar.enableAll(true);
this._controller.toggleSpellCheckButton(false);
this._htmlEditor.discardMisspelledWords();
e.popdown()
};
ZmComposeView.prototype._setFormValue=function(){
this._origFormValue=this._formValue()
};
ZmComposeView.prototype._clearFormValue=function(){
this._origFormValue="";
this._isDirty=false
};
ZmComposeView.prototype._focusHtmlEditor=function(){
this._htmlEditor.focus()
};
ZmComposeView._onKeyUp=function(i){
i=DwtUiEvent.getEvent(i);
var a=DwtUiEvent.getTargetWithProp(i,"id");
if(!a){
return true
}
var e=AjxCore.objectWithId(a._composeView);
if(a==e._subjectField){
var t=DwtKeyEvent.getCharCode(i);
if(t==3||t==13){
e._focusHtmlEditor()
}}else{
e._adjustAddrHeight(a)
}
return true
};
ZmComposeView._onFocus=function(t){
t=DwtUiEvent.getEvent(t);
var e=DwtUiEvent.getTargetWithProp(t,"id");
if(!e){
return true
}
var a=appCtxt.getKeyboardMgr();
if(a.__currTabGroup){
a.__currTabGroup.setFocusMember(e)
}};
ZmComposeView._onBlur=function(a){
var t=DwtUiEvent.getTargetWithProp(a,"id");
if(!t){
return true
}
var e=AjxCore.objectWithId(t._composeView);
e.updateTabTitle();
return true
};
ZmComposeView.prototype.uploadFiles=function(){
var e=appCtxt.getAttachDialog();
var t=new AjxCallback(this,this._attsDoneCallback,[true]);
e.setUploadCallback(t);
e.upload(t,document.getElementById("zdnd_form"))
};
ZmComposeView.prototype.deactivate=function(){
this._controller.inactive=true
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmConvView")){
ZmConvView=function(t){
t.className="ZmConvView";
t.posStyle=Dwt.ABSOLUTE_STYLE;
t.mode=ZmId.VIEW_CONV;
ZmDoublePaneView.call(this,t);
this._changeListener=new AjxListener(this,this._convChangeListener);
var e=appCtxt.getFolderTree();
if(e){
e.addChangeListener(new AjxListener(this,this._folderChangeListener))
}
this._tagList=appCtxt.getTagTree();
if(this._tagList){
this._tagList.addChangeListener(new AjxListener(this,this._tagChangeListener))
}
this._controller=t.controller
};
ZmConvView.prototype=new ZmDoublePaneView;
ZmConvView.prototype.constructor=ZmConvView;
ZmConvView._TAG_CLICK="ZmConvView._TAG_CLICK";
ZmConvView._TAG_ANCHOR="TA";
ZmConvView._TAGLIST_HEIGHT=18;
ZmConvView.prototype.toString=function(){
return"ZmConvView"
};
ZmConvView.prototype.addTagClickListener=function(e){
this.addListener(ZmConvView._TAG_CLICK,e)
};
ZmConvView.prototype.setItem=function(a){
if(!(a instanceof ZmConv)){
return
}
if(this._conv){
this._conv.removeChangeListener(this._changeListener)
}
this._conv=a;
a.addChangeListener(this._changeListener);
this._mailListView.set(a.msgs,ZmItem.F_DATE);
this.isStale=false;
this._setSubject(a.subject);
this._setTags(a);
var t=this._mailListView.offset;
var e=this._conv.getFirstHotMsg({
offset:t,limit:this._mailListView.getLimit(t)}
);
this._mailListView.setSelection(e)
};
ZmConvView.prototype.reset=function(){
this._sashMoved=false;
ZmDoublePaneView.prototype.reset.call(this)
};
ZmConvView.prototype.deactivate=function(){
if(this._conv.msgs){
this._conv.msgs.removeChangeListener(this._mailListView._listChangeListener)
}
this._conv.removeChangeListener(this._changeListener)
};
ZmConvView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,this._conv.subject].join(": ")
};
ZmConvView.prototype._createMailListView=function(e){
return ZmDoublePaneView.prototype._createMailListView.apply(this,arguments)
};
ZmConvView.prototype._resetSize=function(s,t,i){
if(s<=0||t<=0){
return
}
if(!i&&s==this._lastResetWidth&&t==this._lastResetHeight){
return
}
var o=this._controller.isReadingPaneOnRight();
var e=this._summary.getHtmlElement().offsetHeight;
if(this.isMsgViewVisible()){
var u=this.getSash();
var r=u.getSize();
var n=o?r.x:r.y;
if(o){
var f=this._vertSashX||Math.floor(s/2.5);
this._mailListView.setLocation(0,e);
this._mailListView.resetSize(f,t-e);
u.setLocation(f,0);
this._msgView.setBounds(f+n,0,s-(f+n),t)
}else{
var p=0,c,g=0;
if(this._horizSashY){
p=this._horizSashY-e;
c=e+p
}else{
var m=this._mailListView.getList();
if(m&&m.size()>0){
var h=Math.min(m.size()+1,6);
var a=document.getElementById(this._mailListView._getItemId(m.get(0)));
if(a){
var g=Dwt.getSize(a).y*h;
p=g+DwtListView.HEADERITEM_HEIGHT;
c=this._minUpperHeight=e+p
}}}
if(e&&p&&c){
this._mailListView.setLocation(0,e);
this._mailListView.resetSize(s,p);
u.setLocation(0,c);
var l=Math.max((t-(c+n)),0);
this._msgView.setBounds(0,c+n,s,l)
}}}else{
this._mailListView.resetSize(s,t-e)
}
if(AjxEnv.isIE&&this._subjectDiv){
Dwt.setSize(this._subjectDiv,s-95)
}
this._mailListView._resetColWidth()
};
ZmConvView.prototype._sashCallback=function(o){
var a=this._controller.isReadingPaneOnRight();
if(o>0){
if(a){
this._summary.setSize(this._summary.getSize().x+o,Dwt.DEFAULT);
this._mailListView.resetSize(this._mailListView.getSize().x+o,Dwt.DEFAULT);
this._msgView.setBounds(this._msgView.getLocation().x+o,Dwt.DEFAULT,this._msgView.getSize().x-o,Dwt.DEFAULT)
}else{
var t=this._msgView.getSize().y-o;
var i=this._msgView.getMinHeight();
if(t>i){
this._mailListView.resetSize(Dwt.DEFAULT,this._mailListView.getSize().y+o);
this._msgView.setSize(Dwt.DEFAULT,t);
this._msgView.setLocation(Dwt.DEFAULT,this._msgView.getLocation().y+o)
}else{
o=0
}}}else{
var e=Math.abs(o);
if(a){
this._summary.setSize(this._summary.getSize().x-e,Dwt.DEFAULT);
this._mailListView.resetSize(this._mailListView.getSize().x-e,Dwt.DEFAULT);
this._msgView.setBounds(this._msgView.getLocation().x-e,Dwt.DEFAULT,this._msgView.getSize().x+e,Dwt.DEFAULT)
}else{
if(this._horizSashY-e>this._minUpperHeight){
this._mailListView.resetSize(Dwt.DEFAULT,this._mailListView.getSize().y-e);
this._msgView.setSize(Dwt.DEFAULT,this._msgView.getSize().y+e);
this._msgView.setLocation(Dwt.DEFAULT,this._msgView.getLocation().y-e)
}else{
o=0
}}}
if(o){
this._mailListView._resetColWidth();
if(a){
this._vertSashX=this._vertMsgSash.getLocation().x
}else{
this._horizSashY=this._horizMsgSash.getLocation().y
}}
return o
};
ZmConvView.prototype._initHeader=function(){
this._summary=new DwtComposite(this,"Summary",Dwt.RELATIVE_STYLE);
var a=appCtxt.get(ZmSetting.TAGGING_ENABLED)?(this._htmlElId+"_tagDiv"):null;
var t={
id:this._htmlElId,tagDivId:a};
this._summary.getHtmlElement().innerHTML=AjxTemplate.expand("mail.Message#MessageListHeader",t);
var i=this._htmlElId+"_closeBtnCell";
var e=new DwtButton({
parent:this,className:"DwtToolbarButton",parentElement:i}
);
e.setImage("Close");
e.setText(ZmMsg.close);
e.addSelectionListener(new AjxListener(this,this._closeButtonListener));
this._subjectDiv=document.getElementById(this._htmlElId+"_subjDiv");
if(a){
this._tagDiv=document.getElementById(a);
Dwt.setSize(this._tagDiv,Dwt.DEFAULT,ZmConvView._TAGLIST_HEIGHT);
Dwt.setVisible(this._tagDiv,false)
}};
ZmConvView.prototype._setSubject=function(e){
this._subjectDiv.innerHTML=e!=null&&e!=""?AjxStringUtil.htmlEncode(e):AjxStringUtil.htmlEncode(ZmMsg.noSubject)
};
ZmConvView.prototype._setTags=function(u){
if(!appCtxt.get(ZmSetting.TAGGING_ENABLED)){
return
}
var h=u.tags.length;
var a=Dwt.getVisible(this._tagDiv);
var e=(h>0);
if(a!=e){
Dwt.setVisible(this._tagDiv,e);
var c=this.getSize();
this._resetSize(c.x,c.y,true);
if(!e){
this._tagDiv.innerHTML="";
return
}}
if(!h){
return
}
var s=new Array();
for(var o=0;
o<h;
o++){
s[o]=this._tagList.getById(u.tags[o])
}
if(s.length==0){
return
}
s.sort(ZmTag.sortCompare);
var r=new Array();
var n=0;
r[n++]="<table cellspacing=0 cellpadding=0 border=0 width=100%>";
r[n++]="<tr><td style='overflow:hidden'>";
for(var o=0;
o<s.length;
o++){
var m=s[o];
if(!m){
continue
}
var l=[this._tagDiv.id,ZmConvView._TAG_ANCHOR,m.id].join("");
var t=[this._tagDiv.id,ZmDoublePaneView._TAG_IMG,m.id].join("");
r[n++]="<a href='javascript:;' onclick='ZmConvView._tagClick(\"";
r[n++]=this._htmlElId;
r[n++]='","';
r[n++]=m.id;
r[n++]="\"); return false;' id='";
r[n++]=l;
r[n++]="'>";
r[n++]="<table style='display:inline; vertical-align:middle;' border=0 cellspacing=0 cellpadding=0><tr><td>";
r[n++]=AjxImg.getImageHtml(ZmTag.COLOR_ICON[m.color],null,["id='",t,"'"].join(""));
r[n++]="</td></tr></table>";
r[n++]=AjxStringUtil.htmlEncodeSpace(m.name);
r[n++]="</a>"
}
r[n++]="</td></tr></table>";
this._tagDiv.innerHTML=r.join("")
};
ZmConvView.prototype._convChangeListener=function(t){
if(t.type!=ZmEvent.S_CONV){
return
}
var e=t.getDetail("fields");
if(t.event==ZmEvent.E_TAGS||t.event==ZmEvent.E_REMOVE_ALL){
this._setTags(this._conv)
}else{
if(t.event==ZmEvent.E_MODIFY&&(e&&e[ZmItem.F_ID])){
this._controller._convId=this._conv.id
}}};
ZmConvView.prototype._folderChangeListener=function(n){
if(n.event==ZmEvent.E_DELETE&&n.source instanceof ZmFolder&&n.source.id==ZmFolder.ID_TRASH&&this._conv.msgs){
var s=this._conv.msgs.getArray();
var t=s.length;
for(var a=0;
a<s.length;
a++){
var o=appCtxt.getById(s[a].folderId);
if(o.isInTrash()){
this._mailListView.removeItem(s[a]);
this._conv.msgs.remove(s[a],true);
a--
}}
this._controller._resetNavToolBarButtons(this._controller._getViewType());
if(t!=this._conv.numMsgs){
var e={};
e[ZmItem.F_SIZE]=true;
this._conv.list._notify(ZmEvent.E_MODIFY,{
items:[this._conv],fields:e}
);
this._mailListView.setSelection(this._conv.msgs.getVector().get(0))
}}};
ZmConvView.prototype._tagChangeListener=function(i){
if(i.type!=ZmEvent.S_TAG){
return
}
var t=i.getDetail("fields");
if(i.event==ZmEvent.E_MODIFY&&(t&&t[ZmOrganizer.F_COLOR])){
var e=i.getDetail("organizers")[0];
var a=document.getElementById(this._tagDiv.id+ZmDoublePaneView._TAG_IMG+e.id);
if(a){
AjxImg.setImage(a,ZmTag.COLOR_ICON[e.color])
}}
if(i.event==ZmEvent.E_DELETE||i.event==ZmEvent.MODIFY){
this._setTags(this._conv)
}};
ZmConvView.prototype._closeButtonListener=function(e){
this._controller._app.popView()
};
ZmConvView.prototype._staleHandler=function(){
var e=this._controller._parentController||AjxDispatcher.run("GetConvListController");
this._conv._loaded=false;
var t=new AjxCallback(e,e._handleResponseListSelectionListener,this._conv);
AjxDispatcher.run("GetConvController").show(e._activeSearch,this._conv,e,t,true)
};
ZmConvView._tagClick=function(e,t){
var a=DwtControl.fromElementId(e);
a.notifyListeners(ZmConvView._TAG_CLICK,t)
};
ZmConvView.prototype.handleRemoveAttachment=function(a,t){
var o=window.parentAppCtxt||window.appCtxt;
o.getApp(ZmApp.MAIL).getMailListController().actionedMsgId=t.id;
var n=this.getMsgView();
if(n){
var i=this.getMailListView();
if(i){
var e=i.getList();
var s=e.indexOf(n._msg);
e.replace(s,t);
i.set(e.clone(),i._sortByString);
i.setSelection(t)
}
if(this._conv){
this._conv.addMsg(t);
this._conv.numMsgs=this._conv.msgIds.length
}
n.handleRemoveAttachment(a,t)
}}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmMailAssistant")){
ZmMailAssistant=function(){
ZmAssistant.call(this,ZmMsg.createNewMsg,ZmMsg.ASST_CMD_MAIL,ZmMsg.ASST_CMD_SUM_MAIL)
};
ZmMailAssistant.prototype=new ZmAssistant();
ZmMailAssistant.prototype.constructor=ZmMailAssistant;
ZmMailAssistant.prototype.okHandler=function(e){
return true
};
ZmMailAssistant._FIELD_ORDER=["subject","to","cc","bcc","body"];
ZmMailAssistant._FIELDS={
cc:{
field:ZmMsg.cc,key:"cc"}
,bcc:{
field:ZmMsg.bcc,key:"bcc"}
,b:{
field:ZmMsg.body,key:"body",defaultValue:ZmMsg.ASST_MAIL_body,multiLine:true}
,body:{
field:ZmMsg.body,key:"body",defaultValue:ZmMsg.ASST_MAIL_body,multiLine:true}
,s:{
field:ZmMsg.subject,key:"subject",defaultValue:ZmMsg.ASST_MAIL_subject}
,subject:{
field:ZmMsg.subject,key:"subject",defaultValue:ZmMsg.ASST_MAIL_subject}
,to:{
field:ZmMsg.to,key:"to",defaultValue:ZmMsg.ASST_MAIL_to}};
ZmMailAssistant._OBJECTS={};
ZmMailAssistant._OBJECTS[ZmObjectManager.EMAIL]={
defaultType:"to"};
ZmMailAssistant._OBJECTS[ZmAssistant._BRACKETS]={
defaultType:"body",aliases:{
b:"body",t:"to",c:"cc"}};
ZmMailAssistant._OBJECT_ORDER=[ZmAssistant._BRACKETS];
ZmMailAssistant.prototype.getHelp=function(){
return ZmMsg.ASST_MAIL_HELP
};
ZmMailAssistant.prototype.okHandler=function(n){
var e=new AjxVector();
var i=new AjxVector();
var t=this.getMessage(e,i);
var a=this._confirmDialog=appCtxt.getOkCancelMsgDialog();
a.reset();
var s=AjxStringUtil.trim(t.subject);
if((s==null||s=="")&&!this._noSubjectOkay){
a.setMessage(ZmMsg.compSubjectMissing,DwtMessageDialog.WARNING_STYLE);
a.registerCallback(DwtDialog.OK_BUTTON,this._noSubjectOkCallback,this,n);
a.registerCallback(DwtDialog.CANCEL_BUTTON,this._noSubjectCancelCallback,this,n);
a.popup();
return false
}
if(i.size()==0){
n.messageDialog(ZmMsg.noAddresses,DwtMessageDialog.CRITICAL_STYLE);
return false
}
if(e.size()>0&&!this._badAddrsOkay){
var r=AjxStringUtil.htmlEncode(e.toString(AjxEmailAddress.SEPARATOR));
var l=AjxMessageFormat.format(ZmMsg.compBadAddresses,r);
a.setMessage(l,DwtMessageDialog.WARNING_STYLE);
a.registerCallback(DwtDialog.OK_BUTTON,this._badAddrsOkCallback,this,n);
a.registerCallback(DwtDialog.CANCEL_BUTTON,this._badAddrsCancelCallback,this,n);
a.popup();
return false
}else{
this._badAddrsOkay=false
}
var h=new AjxCallback(this,this._handleResponseSendMsg,[n]);
var o=new AjxCallback(this,this._handleErrorSendMsg,[n]);
t.send(false,h,o);
return false
};
ZmMailAssistant.prototype._handleResponseSendMsg=function(e){
if(!appCtxt.isOffline){
appCtxt.setStatusMsg(ZmMsg.messageSent)
}
e.popdown()
};
ZmMailAssistant.prototype._handleErrorSendMsg=function(t,e){
var o=null;
if(e.code==ZmCsfeException.MAIL_SEND_ABORTED_ADDRESS_FAILURE){
var a=e.getData(ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_INVALID);
var i=(a&&a.length)?AjxMessageFormat.format(ZmMsg.sendErrorInvalidAddresses,AjxStringUtil.htmlEncode(a.join(", "))):null;
o=ZmMsg.sendErrorAbort+"<br/>"+i
}else{
if(e.code==ZmCsfeException.MAIL_SEND_PARTIAL_ADDRESS_FAILURE){
var a=e.getData(ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_INVALID);
o=(a&&a.length)?AjxMessageFormat.format(ZmMsg.sendErrorPartial,AjxStringUtil.htmlEncode(a.join(", "))):ZmMsg.sendErrorAbort
}}
if(o){
t.messageDialog(o,DwtMessageDialog.CRITICAL_STYLE);
return true
}else{
return false
}};
ZmMailAssistant.prototype._noSubjectOkCallback=function(e){
this._noSubjectOkay=true;
this._confirmDialog.popdown();
this.okHandler(e)
};
ZmMailAssistant.prototype._noSubjectCancelCallback=function(e){
this._noSubjectOkay=false;
this._confirmDialog.popdown()
};
ZmMailAssistant.prototype._badAddrsOkCallback=function(e){
this._badAddrsOkay=true;
this._confirmDialog.popdown();
this.okHandler(e)
};
ZmMailAssistant.prototype._badAddrsCancelCallback=function(e){
this._badAddrsOkay=false;
this._confirmDialog.popdown()
};
ZmMailAssistant.prototype._getAddrs=function(n,t,i,o,a){
if(i==null||i==""){
return
}
var e=AjxEmailAddress.parseEmailString(i,t,false);
if(e.bad.size()>0&&o!=null){
o.addList(e.bad)
}
if(e.all.size()>0){
n.setAddresses(t,e.all);
if(a!=null){
a.addList(e.all)
}}};
ZmMailAssistant.prototype.getMessage=function(s,a){
var n=new ZmMailMsg();
var e=new ZmMimePart();
e.setContentType(ZmMimeTable.TEXT_PLAIN);
var i=this._mailFields.body!=null?this._mailFields.body:"";
var t=appCtxt.getIdentityCollection().defaultIdentity;
if(Boolean(t.signature)){
var o=t.signature;
if(o!=null&&o!=""){
i=i+"\n"+((t.signatureStyle==ZmSetting.SIG_INTERNET)?"--\n":"")+o+"\n"
}}
e.setContent(i);
n.setTopPart(e);
if(this._mailFields.subject){
n.setSubject(this._mailFields.subject)
}
this._getAddrs(n,AjxEmailAddress.TO,this._mailFields.to,s,a);
this._getAddrs(n,AjxEmailAddress.CC,this._mailFields.cc,s,a);
this._getAddrs(n,AjxEmailAddress.BCC,this._mailFields.bcc,s,a);
return n
};
ZmMailAssistant.prototype.handle=function(h,a,l){
h._setOkButton(AjxMsg.ok,true,true);
var s;
this._mailFields={};
if(!this._mailFields.subject){
s=l.match(/\s*\"([^\"]*)\"?\s*/);
if(s){
this._mailFields.subject=s[1];
l=l.replace(s[0]," ")
}}
while(s=l.match(/((\w+)(:\s*)(.*?)\s*)(\w+:|$)/m)){
var o=s[2];
var p=s[4];
var t=s[1];
var u=ZmMailAssistant._FIELDS[o];
if(u){
if(u.key=="body"){
t=s[2]+s[3];
p=l.replace(t,"").replace(/^\s*/,"");
l=""
}
if(p==null){
p=""
}
this._mailFields[u.key]=p
}
if(l){
l=l.replace(t,"")
}}
var r=-1,c;
for(var n=0;
n<ZmMailAssistant._FIELD_ORDER.length;
n++){
var f=ZmMailAssistant._FIELD_ORDER[n];
var u=ZmMailAssistant._FIELDS[f];
var m=this._mailFields[f];
if(m!=null){
m=u.multiLine?AjxStringUtil.convertToHtml(m):AjxStringUtil.htmlEncode(m)
}
if(u.defaultValue||m!=null){
var e=(m==null);
c=this._setField(u.field,e?u.defaultValue:m,e,false,r+1)
}else{
c=this._setOptField(u.field,m,false,false,r+1)
}
r=Math.max(r,c)
}};
ZmMailAssistant.prototype._getConfirmDialog=function(e){
if(!this._confirmDialog){
this._confirmDialog=new DwtMessageDialog({
parent:e.shell,buttons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]}
)
}
return this._confirmDialog
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmAttachmentsView")){
ZmAttachmentsView=function(t,e){
DwtComposite.call(this,{
parent:t,className:"ZmAttachmentsView",posStyle:Dwt.ABSOLUTE_STYLE,id:ZmId.getViewId(ZmId.VIEW_ATTACHMENTS)}
);
this._controller=e;
this._initialize();
this.getHtmlElement().style.overflow="hidden";
this.addListener(DwtEvent.CONTROL,new AjxListener(this,this._controlEventListener))
};
ZmAttachmentsView.prototype=new DwtComposite;
ZmAttachmentsView.prototype.constructor=ZmAttachmentsView;
ZmAttachmentsView.prototype.toString=function(){
return"ZmAttachmentsView"
};
ZmAttachmentsView.prototype.set=function(e){
this._attListView.set(e);
this.resize()
};
ZmAttachmentsView.prototype.resize=function(){
var a=Dwt.getSize(this.getHtmlElement());
var e=a.y-10;
var t=Dwt.getSize(this._viewContainer);
var i=t.x;
this._attListView.setSize(i,e)
};
ZmAttachmentsView.prototype._controlEventListener=function(e){
this.resize()
};
ZmAttachmentsView.prototype.getFilterByTypes=function(){
var e=this.getSelectedItem(ZmAttachmentsController.CATEGORY_BYTYPE);
return e?e.ct:["any"]
};
ZmAttachmentsView.prototype.getSelectedItem=function(t){
var e=this.getSelection(t);
return(e)?e.getData(ZmAttachmentsView.ATT_KEY):null
};
ZmAttachmentsView.prototype.getSelection=function(t){
var e=this._tree[t].getSelection();
return(e&&e.length>0)?e[0]:null
};
ZmAttachmentsView.prototype.setQueryString=function(e){
this._queryStringDiv.innerHTML=e
};
ZmAttachmentsView.prototype._initialize=function(){
this._createHtml();
this._createWidgets()
};
ZmAttachmentsView.prototype._createHtml=function(){
var t=Dwt.getNextId();
var e="<table border='0' width='100%' height='100%'><tr><td width='15%' style='vertical-align:top;'><div id='"+t+"_filters'></div></td><td style='vertical-align:top;'><div id='"+t+"_results'></div></td></tr></table>";
this.setContent(e);
this._filtersContainer=Dwt.byId(t+"_filters");
this._viewContainer=Dwt.byId(t+"_results")
};
ZmAttachmentsView.prototype._createWidgets=function(){
this._createFilterTrees();
this._createQueryStringDiv();
this._attListView=new ZmAttachmentsListView(this,this._controller);
this._viewContainer.appendChild(this._attListView.getHtmlElement())
};
ZmAttachmentsView.prototype._createQueryStringDiv=function(){
var e=Dwt.getNextId();
var t="<div id='"+e+"' class='DwtTree ZmFilterTree' style='border-width:1px;padding:5px;'></div>";
var a=document.createElement("div");
a.style.paddingTop="10px";
a.innerHTML=t;
this._filtersContainer.appendChild(a);
this._queryStringDiv=document.getElementById(e)
};
ZmAttachmentsView.prototype._createFilterTrees=function(){
this._tree={};
var e=new AjxListener(this._controller,this._controller._filterTreeListener);
this._createTree(ZmAttachmentsController.CATEGORY_BYTYPE,e);
this._createTree(ZmAttachmentsController.CATEGORY_BYTIME,e);
this._createOverviewTree(ZmAttachmentsController.CATEGORY_BYFOLDER,ZmOrganizer.FOLDER,e);
this._createOverviewTree(ZmAttachmentsController.CATEGORY_BYTAG,ZmOrganizer.TAG,e)
};
ZmAttachmentsView.prototype._createOverviewTree=function(n,t,o){
var s=[];
s.push(t);
var e={};
if(t==ZmOrganizer.FOLDER){
e[ZmFolder.ID_ATTACHMENTS]=true
}
var i={
overviewId:Dwt.getNextId(),parent:this,treeIds:s,overviewClass:"DwtTree ZmFilterTree"};
var h=appCtxt.getOverviewController().createOverview(i);
h.set(s,e);
var a=this._tree[n]=h.getTreeView(t);
var r=a.getTreeItemById(ZmOrganizer.ID_ROOT);
r.setExpanded(true);
r.enableSelection(false);
r.setText(ZmMsg[ZmAttachmentsController.CATEGORY_MSGKEY[n]]);
this._filtersContainer.appendChild(h.getHtmlElement());
a.addSelectionListener(o);
return a
};
ZmAttachmentsView.prototype._createTree=function(o,s){
var e=this._tree[o]=new DwtTree({
parent:this,className:"DwtTree ZmFilterTree"}
);
var t=this._newHeaderItem(e,{
msgKey:ZmAttachmentsController.CATEGORY_MSGKEY[o]}
);
e.addSeparator();
var n=ZmAttachmentsController.CATEGORY_ITEMS[o];
for(var a=0;
a<n.length;
a++){
this._newItem(t,n[a])
}
e.addSeparator();
e.addSeparator();
this._filtersContainer.appendChild(e.getHtmlElement());
e.addSelectionListener(s);
t.setExpanded(true);
return e
};
ZmAttachmentsView.ATT_KEY="__att_key__";
ZmAttachmentsView.prototype._newItem=function(e,t){
var a=new DwtTreeItem({
parent:e}
);
a.setImage(t.image);
a.setData(ZmAttachmentsView.ATT_KEY,t);
a.setText(t.msgKey?ZmMsg[t.msgKey]:t.name);
return a
};
ZmAttachmentsView.prototype._newHeaderItem=function(e,t){
var a=new DwtHeaderTreeItem({
parent:e,className:"overviewHeader",index:0}
);
a.setData(ZmAttachmentsView.ATT_KEY,t);
a.setText(ZmMsg[t.msgKey]);
a.enableSelection(false);
return a
};
ZmAttachmentsView.prototype._resetFilterTrees=function(){
for(var e in this._tree){
this._tree[e].deselectAll()
}};
ZmAttachmentsListView=function(t,e){
ZmListView.call(this,{
parent:t,className:"ZmAttachmentsListView",posStyle:DwtControl.ABSOLUTE_STYLE,type:ZmItem.MSG,controller:e}
);
this._controller=e;
this._attachmentsView=t;
this._setAllowSelection();
this.setScrollStyle(DwtControl.SCROLL)
};
ZmAttachmentsListView.prototype=new DwtListView;
ZmAttachmentsListView.prototype.constructor=ZmAttachmentsListView;
ZmAttachmentsListView.prototype.set=function(e){
if(e instanceof ZmMailList){
this._types=this._attachmentsView.getFilterByTypes();
DwtListView.prototype.set.call(this,e.getVector())
}};
ZmAttachmentsListView.prototype.isValidType=function(e){
if(this._types[0]=="any"){
return true
}
if(this._types[0]=="image"){
if(e.ct.indexOf("image")==0){
return true
}}else{
for(var t=0;
t<this._types.length;
t++){
if(e.ct==this._types[t]){
return true
}}}
return false
};
ZmAttachmentsListView.prototype._createItemHtml=function(o){
var n=appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI)+"&loc="+AjxEnv.DEFAULT_LOCALE+"&id="+o.id+"&part=";
var a=[];
var l=o.attachments;
for(var s=0;
s<l.length;
s++){
var c=l[s];
if(!this.isValidType(c)){
continue
}
var t=c.name||c.filename||(ZmMsg.unknown+" <"+c.ct+">");
if(t.length>14){
t=t.substring(0,14)+"..."
}
var u=ZmMimeTable.getInfo(c.ct);
var m=m="Img"+(u?u.imageLarge:"UnknownDoc_48");
var e=document.createElement("div");
e.className="ZmBriefcaseItem";
var h=document.createElement("div");
h.className="ZmThumbnailItem";
var r=document.createElement("div");
r.className=m+" ZmThumbnailIcon";
h.appendChild(r);
e.appendChild(h);
var r=document.createElement("div");
r.className="ZmThumbnailName";
var f=document.createElement("span");
f.innerHTML=["<a href='",(n+c.part),"' target='_blank'>",t,"</a>"].join("");
r.appendChild(f);
e.appendChild(r);
this.associateItemWithElement(o,e);
a.push(e)
}
return a
};
ZmAttachmentsListView.prototype._addRow=function(i,t){
if(!i){
return
}
var e=this._parentEl.childNodes.length;
if(t!=null&&e>0&&t!=e){
var a=this._parentEl.childNodes;
this._parentEl.insertBefore(i,a[t])
}else{
this._parentEl.appendChild(i)
}};
ZmAttachmentsListView.prototype._itemClicked=function(e,t){
this._selectedClass="ZmBriefcaseItemSelected";
this._kbFocusClass="ZmBriefcaseItemFocused";
this._normalClass="ZmBriefcaseItem";
this._disabledSelectedClass="ZmBriefcaseItemDisabledSelect";
this._rightClickClass="ZmBriefcaseItemSelected";
this._styleRe=new RegExp("\\b("+[this._disabledSelectedClass,this._selectedClass,this._kbFocusClass,this._dndClass,this._rightClickClass].join("|")+")\\b","g");
DwtListView.prototype._itemClicked.call(this,e,t)
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmMailConfirmView")){
ZmMailConfirmView=function(a,t){
this._view=ZmId.VIEW_MAIL_CONFIRM+t.sessionId;
DwtComposite.call(this,{
parent:a,className:"ZmMailConfirmView",posStyle:Dwt.ABSOLUTE_STYLE,id:ZmId.getViewId(this._view)}
);
this.setVisible(false);
this._controller=t;
this._tabGroup=new DwtTabGroup(this._htmlElId);
this._createHtmlFromTemplate("mail.Message#ZmMailConfirmView",{
id:this._htmlElId}
);
var e={
parent:this,parentElement:this._htmlElId+"_addButton"};
this._addContactsButton=new DwtButton(e);
this._addContactsButton.setText(ZmMsg.ok);
this._addContactsButton.addSelectionListener(new AjxListener(this,this._addContactsListener));
this._summaryFormat=new AjxMessageFormat(ZmMsg.confirmSummary)
};
ZmMailConfirmView.prototype=new DwtComposite;
ZmMailConfirmView.prototype.constructor=ZmMailConfirmView;
ZmMailConfirmView.prototype.toString=function(){
return"ZmMailConfirmView"
};
ZmMailConfirmView.prototype.addNewContactsListener=function(e){
this.addListener(DwtEvent.ACTION,e)
};
ZmMailConfirmView.prototype.showConfirmation=function(t){
this._tabGroup.removeAllMembers();
this._showLoading(true);
var e=t.getAddresses(AjxEmailAddress.TO).getArray().concat(t.getAddresses(AjxEmailAddress.CC).getArray());
if(!appCtxt.get(ZmSetting.CONTACTS_ENABLED)||appCtxt.get(ZmSetting.AUTO_ADD_ADDRESS)){
this._setView(t,[],[],e)
}else{
var a=new AjxCallback(this,this._handleResponseGetContacts,[t]);
appCtxt.getApp(ZmId.APP_CONTACTS).getContactsByEmails(e,a)
}
appCtxt.notifyZimlets("onMailConfirm",[this,t,Dwt.byId(this._htmlElId+"_ad")])
};
ZmMailConfirmView.prototype.getController=function(){
return this._controller
};
ZmMailConfirmView.prototype.getTitle=function(){
return[ZmMsg.zimbraTitle,ZmMsg.messageSent].join(": ")
};
ZmMailConfirmView.prototype.getTabGroupMember=function(){
return this._tabGroup
};
ZmMailConfirmView.prototype.getDefaultFocusItem=function(){
return this._addContactsButton
};
ZmMailConfirmView.prototype._handleResponseGetContacts=function(s,o){
var t=[],n=[];
for(var e=0,a=o.length;
e<a;
e++){
if(o[e].contact){
n.push(o[e])
}else{
t.push(o[e].address)
}}
this._setView(s,t,n,[])
};
ZmMailConfirmView.prototype._setView=function(i,e,a,t){
this._showLoading(false);
Dwt.byId(this._htmlElId+"_summary").innerHTML=AjxStringUtil.htmlEncode(this._summaryFormat.format(i.subject));
this._showNewAddresses(e);
this._showExistingContacts(a);
this._showDisplayAddresses(t)
};
ZmMailConfirmView.prototype._showLoading=function(e){
Dwt.setVisible(Dwt.byId(this._htmlElId+"_loading"),e);
Dwt.setVisible(Dwt.byId(this._htmlElId+"_notLoading"),!e);
this.setVisible(true)
};
ZmMailConfirmView.prototype._showNewAddresses=function(n){
var o=n.length;
Dwt.setVisible(Dwt.byId(this._htmlElId+"_newAddresses"),o);
this._addContactsButton.setVisible(o);
if(this._newAddressForms){
for(var s=0,c=this._newAddressForms.length;
s<c;
s++){
this._newAddressForms[s].dispose()
}
this._newAddressForms=[]
}
this._newAddressForms=[];
var r=Dwt.byId(this._htmlElId+"_newAddressBox");
for(var s=0,c=n.length;
s<c;
s++){
var t=document.createElement("DIV");
r.appendChild(t);
var m=n[s],h="",f="";
var e=m.getName();
if(e){
var l=e.lastIndexOf(" ");
if(l!=-1){
h=e.substring(0,l);
f=e.substring(l+1)
}else{
h=e
}}
var u={
parent:this,parentElement:t};
u.form={
items:[{
id:"CHECKBOX",type:"DwtCheckbox",label:m.getAddress()}
,{
id:"FIRST",type:"DwtInputField",value:h,hint:ZmMsg.AB_FIELD_firstName}
,{
id:"LAST",type:"DwtInputField",value:f,hint:ZmMsg.AB_FIELD_lastName}
],template:"mail.Message#ZmMailConfirmViewNewAddress"};
var a=new DwtForm(u);
this._newAddressForms.push(a);
this._tabGroup.addMember(a.getTabGroupMember())
}
if(o){
this._tabGroup.addMember(this._addContactsButton)
}};
ZmMailConfirmView.prototype._showExistingContacts=function(n){
Dwt.setVisible(Dwt.byId(this._htmlElId+"_existingContacts"),n.length);
var r=Dwt.byId(this._htmlElId+"_existingContactBox");
r.innerHTML="";
for(var e=0,t=n.length;
e<t;
e++){
var h=document.createElement("DIV");
r.appendChild(h);
var a=n[e];
var o;
var s=a.contact.getFullName();
if(s){
o=[s," <",a.address.getAddress(),">"].join("")
}else{
o=a.address.getAddress()
}
h.innerHTML=AjxTemplate.expand("mail.Message#ZmMailConfirmViewExistingContact",{
text:AjxStringUtil.htmlEncode(o)}
)
}};
ZmMailConfirmView.prototype._showDisplayAddresses=function(a){
Dwt.setVisible(Dwt.byId(this._htmlElId+"_displayAddresses"),a.length);
var n=Dwt.byId(this._htmlElId+"_displayAddressBox");
n.innerHTML="";
for(var t=0,o=a.length;
t<o;
t++){
var s=document.createElement("DIV");
n.appendChild(s);
var e=a[t].toString();
s.innerHTML=AjxTemplate.expand("mail.Message#ZmMailConfirmViewExistingContact",{
text:AjxStringUtil.htmlEncode(e)}
)
}};
ZmMailConfirmView.prototype._addContactsListener=function(){
var t=[];
for(var e=0,o=this._newAddressForms.length;
e<o;
e++){
var a=this._newAddressForms[e];
if(a.getValue("CHECKBOX")){
var n={};
n[ZmContact.F_email]=a.getControl("CHECKBOX").getText();
n[ZmContact.F_firstName]=a.getValue("FIRST");
n[ZmContact.F_lastName]=a.getValue("LAST");
t.push(n)
}}
this.notifyListeners(DwtEvent.ACTION,t)
};
ZmMailConfirmView.prototype.deactivate=function(){
this._controller.inactive=true
}
}
if(AjxPackage.define("zimbraMail.mail.view.ZmSelectAddrDialog")){
ZmSelectAddrDialog=function(e){
if(arguments.length==0){
return
}
DwtDialog.call(this,{
parent:e,title:"Select an Address",className:"ZmSelectAddrDialog"}
);
this.setContent(this._contentHtml());
this._setupListView();
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._okButtonListener))
};
ZmSelectAddrDialog.prototype=new DwtDialog;
ZmSelectAddrDialog.prototype.constructor=ZmQuickAddDialog;
ZmSelectAddrDialog.prototype.toString=function(){
return"ZmSelectAddrDialog"
};
ZmSelectAddrDialog.prototype._contentHtml=function(){
var t=[];
var e=0;
t[e++]="<table cellpadding=0 cellspacing=0 border=0";
t[e++]=(AjxEnv.isSafari)?" width='300'>":">";
t[e++]=AjxTemplate.expand("share.Dialogs#ZmSelectAddrDialog",{
id:this._htmlElId}
);
t[e++]="</table>";
return t.join("")
};
ZmSelectAddrDialog.prototype._setupListView=function(){
var a=this._htmlElId+"_addrListTd";
var t=document.getElementById(a);
if(t){
var e=this._listView=new ZmAddrListView(this);
e.setMultiSelect(false);
e.reparentHtmlElement(t)
}};
ZmSelectAddrDialog.prototype.popup=function(o,t){
if(!(o&&o.length)){
var r=appCtxt.getMsgDialog();
r.setMessage(ZmMsg.selectAddrNone,DwtMessageDialog.CRITICAL_STYLE);
r.popup();
return
}
this._addrs=[];
var l=t.indexOf(":");
this._folderId=(l!=-1)?(t.substr(l+1)):t;
var c={}
,e=1;
for(var a=0,n=o.length;
a<n;
a++){
var h=o[a];
var s=h.getAddress();
if(!c[s]){
h.id=e++;
this._addrs.push(h);
c[s]=true
}}
this._addrs.sort(AjxEmailAddress.sortCompareByAddress);
this._listView.set(AjxVector.fromArray(this._addrs));
this._listView.setSelection(this._addrs[0]);
DwtDialog.prototype.popup.call(this)
};
ZmSelectAddrDialog.prototype._okButtonListener=function(){
var a=this._listView.getSelection();
if(a&&a.length){
var e=ZmFolder.QUERY_NAME[this._folderId];
var t="in:"+e+" to:"+a[0].getAddress();
appCtxt.getSearchController().search({
query:t}
)
}
this.popdown()
};
ZmAddrListView=function(t){
var e=this._getHeaderList();
DwtListView.call(this,{
parent:t,headerList:e,view:"ALV"}
)
};
ZmAddrListView.COL_NAME="na";
ZmAddrListView.COL_ADDR="ad";
ZmAddrListView.prototype=new DwtListView;
ZmAddrListView.prototype.constructor=ZmAddrListView;
ZmAddrListView.prototype.toString=function(){
return"ZmAddrListView"
};
ZmAddrListView.prototype._getHeaderList=function(){
return[(new DwtListHeaderItem({
field:ZmAddrListView.COL_NAME,text:ZmMsg.name,width:ZmMsg.COLUMN_WIDTH_NAME_SD}
)),(new DwtListHeaderItem({
field:ZmAddrListView.COL_ADDR,text:ZmMsg.address}
))]
};
ZmAddrListView.prototype._getCellContents=function(t,e,a,i,n,o){
if(i==ZmAddrListView.COL_NAME){
t[e++]=AjxStringUtil.htmlEncode(a.getName())
}else{
if(i==ZmAddrListView.COL_ADDR){
t[e++]=AjxStringUtil.htmlEncode(a.getAddress())
}}
return e
}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmComposeController")){
ZmComposeController=function(e,n){
ZmController.call(this,e,n);
this._action=null;
ZmComposeController._setStatics();
this._listeners={};
this._listeners[ZmOperation.SEND]=new AjxListener(this,this._sendListener);
this._listeners[ZmOperation.CANCEL]=new AjxListener(this,this._cancelListener);
this._listeners[ZmOperation.ATTACHMENT]=new AjxListener(this,this._attachmentListener);
this._listeners[ZmOperation.DETACH_COMPOSE]=new AjxListener(this,this._detachListener);
this._listeners[ZmOperation.SAVE_DRAFT]=new AjxListener(this,this._saveDraftListener);
this._listeners[ZmOperation.SPELL_CHECK]=new AjxListener(this,this._spellCheckListener);
this._listeners[ZmOperation.COMPOSE_OPTIONS]=new AjxListener(this,this._optionsListener);
this._dialogPopdownListener=new AjxListener(this,this._dialogPopdownActionListener);
var o=appCtxt.getSettings();
var t=this._settingChangeListener=new AjxListener(this,this._settingChangeListener);
for(var a=0;
a<ZmComposeController.SETTINGS.length;
a++){
o.getSetting(ZmComposeController.SETTINGS[a]).addChangeListener(t)
}
this._autoSaveTimer=null;
this._draftType=ZmComposeController.DRAFT_TYPE_NONE
};
ZmComposeController.prototype=new ZmController();
ZmComposeController.prototype.constructor=ZmComposeController;
ZmComposeController.prototype.toString=function(){
return"ZmComposeController"
};
ZmComposeController.SIGNATURE_KEY="sigKeyId";
ZmComposeController.DRAFT_TYPE_NONE="none";
ZmComposeController.DRAFT_TYPE_MANUAL="manual";
ZmComposeController.DRAFT_TYPE_AUTO="auto";
ZmComposeController.DEFAULT_TAB_TEXT=ZmMsg.compose;
ZmComposeController._setStatics=function(){
if(ZmComposeController.SETTINGS){
return
}
ZmComposeController.SETTINGS=[ZmSetting.SHOW_BCC];
ZmComposeController.RADIO_GROUP={};
ZmComposeController.RADIO_GROUP[ZmOperation.REPLY]=1;
ZmComposeController.RADIO_GROUP[ZmOperation.REPLY_ALL]=1;
ZmComposeController.RADIO_GROUP[ZmOperation.FORMAT_HTML]=2;
ZmComposeController.RADIO_GROUP[ZmOperation.FORMAT_TEXT]=2;
ZmComposeController.RADIO_GROUP[ZmOperation.INC_ATTACHMENT]=3;
ZmComposeController.RADIO_GROUP[ZmOperation.INC_BODY]=3;
ZmComposeController.RADIO_GROUP[ZmOperation.INC_NONE]=3;
ZmComposeController.RADIO_GROUP[ZmOperation.INC_SMART]=3;
ZmComposeController.INC_OP={};
ZmComposeController.INC_OP[ZmSetting.INC_ATTACH]=ZmOperation.INC_ATTACHMENT;
ZmComposeController.INC_OP[ZmSetting.INC_BODY]=ZmOperation.INC_BODY;
ZmComposeController.INC_OP[ZmSetting.INC_NONE]=ZmOperation.INC_NONE;
ZmComposeController.INC_OP[ZmSetting.INC_SMART]=ZmOperation.INC_SMART;
ZmComposeController.INC_MAP={};
for(var e in ZmComposeController.INC_OP){
ZmComposeController.INC_MAP[ZmComposeController.INC_OP[e]]=e
}
ZmComposeController.OPTIONS_TT={};
ZmComposeController.OPTIONS_TT[ZmOperation.NEW_MESSAGE]="composeOptions";
ZmComposeController.OPTIONS_TT[ZmOperation.REPLY]="replyOptions";
ZmComposeController.OPTIONS_TT[ZmOperation.REPLY_ALL]="replyOptions";
ZmComposeController.OPTIONS_TT[ZmOperation.FORWARD_ATT]="forwardOptions";
ZmComposeController.OPTIONS_TT[ZmOperation.FORWARD_INLINE]="forwardOptions";
ZmComposeController.OP_CHECK={};
ZmComposeController.OP_CHECK[ZmOperation.REQUEST_READ_RECEIPT]=true;
ZmComposeController.OP_CHECK[ZmOperation.USE_PREFIX]=true;
ZmComposeController.OP_CHECK[ZmOperation.INCLUDE_HEADERS]=true
};
ZmComposeController.prototype.dispose=function(){
var t=appCtxt.getSettings();
for(var e=0;
e<ZmComposeController.SETTINGS.length;
e++){
t.getSetting(ZmComposeController.SETTINGS[e]).removeChangeListener(this._settingChangeListener)
}
this._composeView._dispose()
};
ZmComposeController.prototype.doAction=function(i){
var t=window.parentAppCtxt||window.appCtxt;
if(t.isOffline&&!t.get(ZmSetting.OFFLINE_COMPOSE_ENABLED)){
var a=t.getMsgDialog();
a.setMessage(ZmMsg.composeDisabled,DwtMessageDialog.CRITICAL_STYLE);
a.popup();
return
}
this._msgSent=false;
if(i.inNewWindow){
var e=t.getNewWindow();
e.command="compose";
e.params=i
}else{
this._setView(i);
this._listController=i.listController
}};
ZmComposeController.prototype.toggleSpellCheckButton=function(t){
var e=this._toolbar.getButton(ZmOperation.SPELL_CHECK);
if(e){
e.setSelected((t||false))
}};
ZmComposeController.prototype.detach=function(){
this._toolbar.enable(ZmOperation.DETACH_COMPOSE,false);
var a=this._composeView._msg;
var r=this._composeView.getRawAddrFields();
var c=this._composeView._subjectField.value;
var e=this._composeView._attcDiv.innerHTML;
var s=this._getBodyContent();
var o=this._composeView.getComposeMode();
var t=this._composeView.backupForm;
var l=this._composeView.sendUID;
var n=this._composeView._action||this._action;
var h=this._composeView.getIdentity();
var i=appCtxt.getNewWindow();
i.command="composeDetach";
i.params={
action:n,msg:a,addrs:r,subj:c,forwardHtml:e,body:s,composeMode:o,identityId:(h?h.id:null),accountName:this._accountName,backupForm:t,sendUID:l,msgIds:this._msgIds,forAttIds:this._forAttIds,sessionId:this.sessionId}
};
ZmComposeController.prototype.popShield=function(){
var e=this._composeView.isDirty();
if(!e&&(this._draftType!=ZmComposeController.DRAFT_TYPE_AUTO)){
this._cancelAuthTimedSave();
return true
}
var t=this._popShield=appCtxt.getYesNoCancelMsgDialog();
if(this._draftType==ZmComposeController.DRAFT_TYPE_AUTO){
t.reset();
t.setMessage(ZmMsg.askSaveAutosavedDraft,DwtMessageDialog.WARNING_STYLE);
if(e){
t.registerCallback(DwtDialog.YES_BUTTON,this._popShieldYesCallback,this)
}else{
t.registerCallback(DwtDialog.YES_BUTTON,this._popShieldNoCallback,this)
}
t.registerCallback(DwtDialog.NO_BUTTON,this._popShieldDiscardCallback,this);
t.registerCallback(DwtDialog.CANCEL_BUTTON,this._popShieldDismissCallback,this)
}else{
if(this._canSaveDraft()){
t.reset();
t.setMessage(ZmMsg.askSaveDraft,DwtMessageDialog.WARNING_STYLE);
t.registerCallback(DwtDialog.YES_BUTTON,this._popShieldYesCallback,this);
t.registerCallback(DwtDialog.NO_BUTTON,this._popShieldNoCallback,this);
t.registerCallback(DwtDialog.CANCEL_BUTTON,this._popShieldDismissCallback,this)
}else{
t=this._popShield=appCtxt.getYesNoMsgDialog();
t.setMessage(ZmMsg.askLeaveCompose,DwtMessageDialog.WARNING_STYLE);
t.registerCallback(DwtDialog.YES_BUTTON,this._popShieldYesCallback,this);
t.registerCallback(DwtDialog.NO_BUTTON,this._popShieldDismissCallback,this)
}}
t.addPopdownListener(this._dialogPopdownListener);
t.popup(this._composeView._getDialogXY());
return false
};
ZmComposeController.prototype._preHideCallback=function(e,t){
if(t&&this._autoSaveTimer){
this._autoSaveTimer.kill();
if(!this._msgSent){
this._autoSaveCallback(true)
}}
return t?true:this.popShield()
};
ZmComposeController.prototype._preUnloadCallback=function(e){
return !this._composeView.isDirty()
};
ZmComposeController.prototype._postShowCallback=function(){
this._initAutoSave();
if(!appCtxt.isChildWindow){
ZmController.prototype._postShowCallback.call(this)
}
var t=this._composeView.getComposeMode();
if(this._action!=ZmOperation.NEW_MESSAGE&&this._action!=ZmOperation.FORWARD_INLINE&&this._action!=ZmOperation.FORWARD_ATT){
if(t==DwtHtmlEditor.HTML){
var e=new AjxTimedAction(this._composeView,this._composeView._focusHtmlEditor);
AjxTimedAction.scheduleAction(e,10)
}
this._composeView._setBodyFieldCursor()
}};
ZmComposeController.prototype._postHideCallback=function(){
if(appCtxt.isChildWindow&&(this._action==ZmOperation.REPLY_ACCEPT||this._action==ZmOperation.REPLY_DECLINE||this._action==ZmOperation.REPLY_TENTATIVE)){
window.close()
}};
ZmComposeController.prototype.resetComposeForMailto=function(t){
if(this._popShield&&this._popShield.isPoppedUp()){
return false
}
var e=this._popShield=appCtxt.getYesNoCancelMsgDialog();
e.reset();
e.setMessage(ZmMsg.askSaveDraft,DwtMessageDialog.WARNING_STYLE);
e.registerCallback(DwtDialog.YES_BUTTON,this._popShieldYesCallback,this,t);
e.registerCallback(DwtDialog.NO_BUTTON,this._popShieldNoCallback,this,t);
e.registerCallback(DwtDialog.CANCEL_BUTTON,this._popShieldDismissCallback,this);
e.addPopdownListener(this._dialogPopdownListener);
e.popup(this._composeView._getDialogXY());
return true
};
ZmComposeController.prototype.sendMsg=function(t,e,a){
return this._sendMsg(t,null,e,a)
};
ZmComposeController.prototype.sendDocs=function(t,e,a){
return this._sendMsg(null,t,e,a)
};
ZmComposeController.prototype._sendMsg=function(e,u,n,o){
n=n||ZmComposeController.DRAFT_TYPE_NONE;
var b=n!=ZmComposeController.DRAFT_TYPE_NONE;
var l;
if(u){
l=new ZmMailMsg();
this._composeView.setDocAttachments(l,u)
}
var s=this._composeView.getMsg(e,b,l);
if(!s){
return
}
var p=s._origMsg;
var y=(s.inviteMode==ZmOperation.REPLY_CANCEL);
var f=(s.inviteMode==ZmOperation.REPLY_MODIFY);
if(y||f){
var a=p._appt;
var i=new AjxCallback(this,this._handleResponseCancelOrModifyAppt);
if(y){
a.cancel(p._mode,s,i)
}else{
a.save()
}
return
}
var v=window.parentAppCtxt||window.appCtxt;
var m=appCtxt.multiAccounts?this._composeView.getFromAccount().name:this._accountName;
if(b){
if(appCtxt.multiAccounts){
m=v.accountList.getAccount(s.fromSelectValue.accountId).name
}else{
m=v.getActiveAccount().name
}}else{
var h=s.folderId?v.getById(s.folderId):null;
if(h&&h.isRemote()&&this._composeView.sendMsgOboIsOK()){
m=h.getOwner()
}}
if(p){
p.sendAsMe=!this._composeView.sendMsgOboIsOK()
}
if(!m&&!b&&p&&p.isDraft){
if(this._composeView.sendMsgOboIsOK()){
if(p._addrs[ZmMailMsg.HDR_FROM]&&p._addrs[ZmMailMsg.HDR_SENDER]&&p._addrs[ZmMailMsg.HDR_SENDER].size()){
m=p._addrs[ZmMailMsg.HDR_FROM].get(0).address
}}else{
p.sendAsMe=true
}}
var c=false;
if(appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED)){
var t=this._toolbar.getButton(ZmOperation.COMPOSE_OPTIONS).getMenu();
var w=t.getItemById(ZmOperation.KEY_ID,ZmOperation.REQUEST_READ_RECEIPT);
c=(!!(w&&w.getChecked()))
}
var i=new AjxCallback(this,this._handleResponseSendMsg,[n,s,o]);
var r=new AjxCallback(this,this._handleErrorSendMsg,s);
var g=s.send(b,i,r,m,null,c);
if(g){
this._processSendMsg(n,s,g);
if(o){
o.run(g)
}}};
ZmComposeController.prototype._handleResponseSendMsg=function(t,i,o,e){
var a=e.getResponse();
this._processSendMsg(t,i,a);
if(o){
o.run(e)
}
if(this.sendMsgCallback){
this.sendMsgCallback.run(e)
}
if(t&&t==ZmComposeController.DRAFT_TYPE_NONE){
this._cancelAuthTimedSave()
}
appCtxt.notifyZimlets("onSendMsgSuccess",[this,i])
};
ZmComposeController.prototype._handleResponseCancelOrModifyAppt=function(){
this._composeView.reset(false);
this._app.popView(true)
};
ZmComposeController.prototype._handleErrorSendMsg=function(o,t){
this.resetToolbarOperations();
this._composeView.enableInputs(true);
appCtxt.notifyZimlets("onSendMsgFailure",[this,t,o]);
if(!(t&&t.code)){
return false
}
var o=null;
if(t.code==ZmCsfeException.MAIL_SEND_ABORTED_ADDRESS_FAILURE){
var a=t.getData?t.getData(ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_INVALID):null;
var i=(a&&a.length)?AjxMessageFormat.format(ZmMsg.sendErrorInvalidAddresses,AjxStringUtil.htmlEncode(a.join(", "))):null;
o=ZmMsg.sendErrorAbort+"<br/>"+i;
this.popupErrorDialog(o,t,true,true);
return true
}else{
if(t.code==ZmCsfeException.MAIL_SEND_PARTIAL_ADDRESS_FAILURE){
var a=t.getData?t.getData(ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_INVALID):null;
o=(a&&a.length)?AjxMessageFormat.format(ZmMsg.sendErrorPartial,AjxStringUtil.htmlEncode(a.join(", "))):ZmMsg.sendErrorAbort
}else{
if(t.code==AjxException.CANCELED){
o=ZmMsg.cancelSendMsgWarning;
this._composeView.setBackupForm();
return true
}else{
if(t.code==ZmCsfeException.MAIL_QUOTA_EXCEEDED){
if(this._composeView._attachDialog){
o=ZmMsg.errorQuotaExceeded;
this._composeView._attachDialog.setFooter("You have exceeded your mail quota. Please remove some attachments and try again.")
}}}}}
if(o){
var e=appCtxt.getMsgDialog();
e.setMessage(o,DwtMessageDialog.CRITICAL_STYLE);
e.popup();
return true
}else{
return false
}};
ZmComposeController.prototype.initComposeView=function(i,e){
if(this._composeView){
return
}
this._composeView=new ZmComposeView(this._container,this,e);
var t={};
t[ZmAppViewMgr.CB_PRE_HIDE]=new AjxCallback(this,this._preHideCallback);
t[ZmAppViewMgr.CB_PRE_UNLOAD]=new AjxCallback(this,this._preUnloadCallback);
t[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this._postShowCallback);
t[ZmAppViewMgr.CB_POST_HIDE]=new AjxCallback(this,this._postHideCallback);
var a={};
this._initializeToolBar();
a[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar;
a[ZmAppViewMgr.C_APP_CONTENT]=this._composeView;
this._app.createView({
viewId:this.viewId,elements:a,callbacks:t,tabParams:this._getTabParams()}
);
if(i){
this._composeView.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this._composeView.enableInputs(false)
}
if(this._composeView.identitySelect){
this._composeView.identitySelect.addChangeListener(new AjxListener(this,this._identityChangeListener,[true]))
}};
ZmComposeController.prototype._getTabParams=function(){
return{
id:this.tabId,image:"NewMessage",textPrecedence:75,tooltip:ZmComposeController.DEFAULT_TAB_TEXT}
};
ZmComposeController.prototype._identityChangeListener=function(t,a){
var e=this._composeView.getIdentity().signature;
var i=this._composeView.isDirty();
if(e==this._currentSignatureId){
return
}
this._applyIdentityToBody(t,i);
this._currentSignatureId=e
};
ZmComposeController.prototype._applyIdentityToBody=function(t,i){
var e=this._composeView.getIdentity();
if(t){
this.setSelectedSignature(e.signature)
}
var a=this._getComposeMode(this._msg,e);
if(a!=this._composeView.getComposeMode()){
this._composeView.setComposeMode(a)
}
this._composeView.applySignature(this._getBodyContent(),this._currentSignatureId);
this._setAddSignatureVisibility()
};
ZmComposeController.prototype._handleSelectSignature=function(e){
var t=e.item.getData(ZmComposeController.SIGNATURE_KEY);
this.setSelectedSignature(t);
this.resetSignature(t)
};
ZmComposeController.prototype._setComposeTabGroup=function(){
var t=this._createTabGroup();
var o=appCtxt.getRootTabGroup();
t.newParent(o);
t.addMember(this._toolbar);
for(var e=0;
e<ZmMailMsg.COMPOSE_ADDRS.length;
e++){
t.addMember(this._composeView._field[ZmMailMsg.COMPOSE_ADDRS[e]])
}
t.addMember(this._composeView._subjectField);
var n=this._composeView.getComposeMode();
var s=(n==DwtHtmlEditor.TEXT)?this._composeView._bodyField:this._composeView.getHtmlEditor();
if(this._composeView.isTinyMCEEnabled()){
var a=this._composeView.getHtmlEditor();
s=a.getEditorContainer()
}
t.addMember(s)
};
ZmComposeController.prototype.getKeyMapName=function(){
return"ZmComposeController"
};
ZmComposeController.prototype.handleKeyAction=function(e){
switch(e){
case ZmKeyMap.CANCEL:this._cancelCompose();
break;
case ZmKeyMap.SAVE:if(this._canSaveDraft()){
this.saveDraft()
}
break;
case ZmKeyMap.SEND:this._send();
break;
case ZmKeyMap.ATTACHMENT:this._attachmentListener();
break;
case ZmKeyMap.SPELLCHECK:if(!appCtxt.get(ZmSetting.SPELL_CHECK_ENABLED)){
break
}
this.toggleSpellCheckButton(true);
this._spellCheckListener();
break;
case ZmKeyMap.HTML_FORMAT:if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
var a=this._composeView.getComposeMode();
var t=(a==DwtHtmlEditor.TEXT)?DwtHtmlEditor.HTML:DwtHtmlEditor.TEXT;
this._setFormat(t);
this._setOptionsMenu(t)
}
break;
case ZmKeyMap.ADDRESS_PICKER:this._composeView._addressButtonListener(null,AjxEmailAddress.TO);
break;
case ZmKeyMap.NEW_WINDOW:if(!appCtxt.isChildWindow){
this._detachListener()
}
break;
default:return ZmMailListController.prototype.handleKeyAction.call(this,e);
break
}
return true
};
ZmComposeController.prototype.mapSupported=function(e){
return(e=="editor")
};
ZmComposeController.prototype.getSelectedSignature=function(){
var e=this._toolbar.getButton(ZmOperation.ADD_SIGNATURE);
var a=e?e.getMenu():null;
if(a){
var t=a.getSelectedItem(DwtMenuItem.RADIO_STYLE);
return t?t.getData(ZmComposeController.SIGNATURE_KEY):null
}};
ZmComposeController.prototype.setSelectedSignature=function(t){
var e=this._toolbar.getButton(ZmOperation.ADD_SIGNATURE);
var a=e?e.getMenu():null;
if(a){
a.checkItem(ZmComposeController.SIGNATURE_KEY,t,true)
}};
ZmComposeController.prototype.resetSignature=function(t,e){
this._composeView.applySignature(this._getBodyContent(),this._currentSignatureId,e);
this._currentSignatureId=t
};
ZmComposeController.prototype._deleteDraft=function(e){
var n=e.list;
var s,o;
if(n&&n.type==ZmItem.CONV){
s=n.getById(e.cid);
o="ConvActionRequest"
}else{
s=e;
o="MsgActionRequest"
}
var i=AjxSoapDoc.create(o,"urn:zimbraMail");
var t=i.set("action");
t.setAttribute("id",s.id);
t.setAttribute("op","delete");
var a=window.parentController==null;
appCtxt.getAppController().sendRequest({
soapDoc:i,asyncMode:a}
)
};
ZmComposeController.prototype._setView=function(s){
if(this._autoSaveTimer){
this._autoSaveTimer.kill()
}
var o=this._action=s.action;
var n=this._msg=s.msg;
this._toOverride=s.toOverride;
this._subjOverride=s.subjOverride;
this._extraBodyText=s.extraBodyText;
this._msgIds=s.msgIds;
this._accountName=s.accountName;
var i=(appCtxt.multiAccounts&&appCtxt.getActiveAccount().isMain)?appCtxt.accountList.defaultAccount:null;
var a=appCtxt.getIdentityCollection(i);
var t=(n&&n.identity)?n.identity:a.selectIdentity(n);
s.identity=t;
if(t){
this._currentSignatureId=t.signature
}
this._composeMode=s.composeMode||this._getComposeMode(n,t);
this._curIncOptions=null;
var e=this._composeView;
if(!e){
this.initComposeView(null,this._composeMode);
e=this._composeView
}else{
e.setComposeMode(this._composeMode)
}
this._initializeToolBar();
this.resetToolbarOperations();
this._setAddSignatureVisibility();
e.set(s);
this._setOptionsMenu();
this._setComposeTabGroup();
this._app.pushView(this.viewId);
if(!appCtxt.isChildWindow){
e.updateTabTitle()
}
e.reEnableDesignMode();
if(n&&(o==ZmOperation.DRAFT)){
this._draftType=ZmComposeController.DRAFT_TYPE_MANUAL
}else{
this._draftType=ZmComposeController.DRAFT_TYPE_NONE
}
this.sendMsgCallback=s.sendMsgCallback;
if(s.callback){
s.callback.run(this)
}};
ZmComposeController.prototype._initializeToolBar=function(){
if(this._toolbar){
return
}
var n=[ZmOperation.SEND,ZmOperation.CANCEL,ZmOperation.SEP,ZmOperation.SAVE_DRAFT];
if(appCtxt.get(ZmSetting.ATTACHMENT_ENABLED)){
n.push(ZmOperation.ATTACHMENT)
}
if(!appCtxt.isOffline){
n.push(ZmOperation.SPELL_CHECK)
}
if(appCtxt.get(ZmSetting.SIGNATURES_ENABLED)){
n.push(ZmOperation.ADD_SIGNATURE)
}
n.push(ZmOperation.COMPOSE_OPTIONS,ZmOperation.FILLER);
if(appCtxt.get(ZmSetting.DETACH_COMPOSE_ENABLED)&&!appCtxt.isChildWindow){
n.push(ZmOperation.DETACH_COMPOSE)
}
var e=this._toolbar=new ZmButtonToolBar({
parent:this._container,buttons:n,className:(appCtxt.isChildWindow?"ZmAppToolBar_cw":"ZmAppToolBar")+" ImgSkin_Toolbar",context:this.viewId}
);
for(var o=0;
o<e.opList.length;
o++){
var a=e.opList[o];
if(this._listeners[a]){
e.addSelectionListener(a,this._listeners[a])
}}
this._setAddSignatureVisibility();
if(appCtxt.get(ZmSetting.SIGNATURES_ENABLED)||appCtxt.multiAccounts){
var h=appCtxt.getSignatureCollection();
h.addChangeListener(new AjxListener(this,this._signatureChangeListener));
var a=e.getButton(ZmOperation.ADD_SIGNATURE);
if(a){
a.setMenu(new AjxCallback(this,this._createSignatureMenu))
}}
var r=[ZmOperation.NEW_MESSAGE,ZmOperation.REPLY,ZmOperation.FORWARD_ATT,ZmOperation.DECLINE_PROPOSAL];
this._optionsMenu={};
for(var o=0;
o<r.length;
o++){
this._optionsMenu[r[o]]=this._createOptionsMenu(r[o])
}
this._optionsMenu[ZmOperation.REPLY_ALL]=this._optionsMenu[ZmOperation.REPLY];
this._optionsMenu[ZmOperation.FORWARD_INLINE]=this._optionsMenu[ZmOperation.FORWARD_ATT];
this._optionsMenu[ZmOperation.REPLY_CANCEL]=this._optionsMenu[ZmOperation.REPLY_ACCEPT]=this._optionsMenu[ZmOperation.DECLINE_PROPOSAL]=this._optionsMenu[ZmOperation.REPLY_DECLINE]=this._optionsMenu[ZmOperation.REPLY_TENTATIVE]=this._optionsMenu[ZmOperation.SHARE]=this._optionsMenu[ZmOperation.DRAFT]=this._optionsMenu[ZmOperation.NEW_MESSAGE];
var t=e.getButton(ZmOperation.SPELL_CHECK);
if(t){
t.setAlign(DwtLabel.IMAGE_LEFT|DwtButton.TOGGLE_STYLE)
}
var a=e.getButton(ZmOperation.NEW_MENU);
if(a){
var s=new AjxListener(e,ZmListController._newDropDownListener);
a.addDropDownSelectionListener(s);
e._ZmListController_this=this;
e._ZmListController_newDropDownListener=s
}
appCtxt.notifyZimlets("initializeToolbar",[this._app,e,this,this.viewId],{
waitUntilLoaded:true}
)
};
ZmComposeController.prototype._initAutoSave=function(){
if(!this._canSaveDraft()){
return
}
var i=appCtxt.get(ZmSetting.AUTO_SAVE_DRAFT_INTERVAL);
if(i){
if(!this._autoSaveTimer){
this._autoSaveTimer=new DwtIdleTimer(i*1000,new AjxCallback(this,this._autoSaveCallback))
}else{
this._autoSaveTimer.resurrect(i*1000)
}}
var a=appCtxt.get(ZmSetting.TOKEN_ENDTIME);
if(a){
var t=new Date();
var e=a-t.getTime()-5000;
if(a!=this._authTokenEndTime||!this._authTimedAction){
this._authTokenEndTime=a;
this._authTimedAction=new AjxTimedAction(this,this._authSaveCallback);
AjxTimedAction.scheduleAction(this._authTimedAction,e)
}}};
ZmComposeController.prototype._setAddSignatureVisibility=function(a){
var t=window.parentAppCtxt||window.appCtxt;
var e=t.get(ZmSetting.SIGNATURES_ENABLED,null,a)&&this._toolbar.getButton(ZmOperation.ADD_SIGNATURE);
if(e){
e.setVisible(appCtxt.getSignatureCollection(a).getSize()>0)
}};
ZmComposeController.prototype._createOptionsMenu=function(n){
var a=(n==ZmOperation.REPLY||n==ZmOperation.REPLY_ALL);
var m=(n==ZmOperation.FORWARD_ATT||n==ZmOperation.FORWARD_INLINE);
var c=[];
if(a){
c.push(ZmOperation.REPLY,ZmOperation.REPLY_ALL,ZmOperation.SEP)
}
if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
c.push(ZmOperation.FORMAT_HTML,ZmOperation.FORMAT_TEXT,ZmOperation.SEP)
}
if(a){
c.push(ZmOperation.SEP,ZmOperation.INC_NONE,ZmOperation.INC_BODY,ZmOperation.INC_SMART,ZmOperation.INC_ATTACHMENT)
}else{
if(m){
c.push(ZmOperation.SEP,ZmOperation.INC_BODY,ZmOperation.INC_ATTACHMENT)
}}
if(a||m){
c.push(ZmOperation.SEP,ZmOperation.USE_PREFIX,ZmOperation.INCLUDE_HEADERS)
}
if(appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED)){
var f=window.parentAppCtxt||window.appCtxt;
var o=this._msg&&this._msg.folderId;
var e=o?f.getById(o):null;
if(!e||(e&&!e.isRemote())){
c.push(ZmOperation.SEP,ZmOperation.REQUEST_READ_RECEIPT)
}}
var r=this._toolbar.getButton(ZmOperation.COMPOSE_OPTIONS);
var u={};
for(var s=0;
s<c.length;
s++){
var l=c[s];
if(l==ZmOperation.SEP){
continue
}
u[l]={};
if(ZmComposeController.OP_CHECK[l]){
u[l].style=DwtMenuItem.CHECK_STYLE
}else{
u[l].style=DwtMenuItem.RADIO_STYLE;
u[l].radioGroupId=ZmComposeController.RADIO_GROUP[l]
}
if(l==ZmOperation.REPLY){
u[l].text=ZmMsg.replySender
}}
var t=new ZmActionMenu({
parent:r,menuItems:c,overrides:u,context:[this.viewId,n].join("_")}
);
for(var s=0;
s<c.length;
s++){
var l=c[s];
var h=t.getOp(l);
if(!h){
continue
}
if(l==ZmOperation.FORMAT_HTML){
h.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.HTML)
}else{
if(l==ZmOperation.FORMAT_TEXT){
h.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.TEXT)
}}
h.setData(ZmOperation.KEY_ID,l);
h.addSelectionListener(this._listeners[ZmOperation.COMPOSE_OPTIONS])
}
return t
};
ZmComposeController.prototype._setOptionsMenu=function(a,i){
a=a||this._composeMode;
i=i||this._curIncOptions||{};
var t=this._toolbar.getButton(ZmOperation.COMPOSE_OPTIONS);
t.setToolTipContent(ZmMsg[ZmComposeController.OPTIONS_TT[this._action]]);
var o=this._optionsMenu[this._action];
if(!o){
return
}
if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
o.checkItem(ZmHtmlEditor._VALUE,a,true)
}
if(appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED)||appCtxt.multiAccounts){
var e=o.getOp(ZmOperation.REQUEST_READ_RECEIPT);
if(e){
if(this._msg&&this._msg.isDraft){
e.setChecked(this._msg.readReceiptRequested)
}else{
e.setChecked(false,true)
}
if(appCtxt.multiAccounts){
e.setEnabled(appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED))
}}}
if(this._action==ZmOperation.REPLY||this._action==ZmOperation.REPLY_ALL){
o.checkItem(ZmOperation.KEY_ID,this._action,true)
}
this._setDependentOptions(i);
t.setMenu(o)
};
ZmComposeController.prototype._setDependentOptions=function(a){
a=a||this._curIncOptions||{};
var o=this._optionsMenu[this._action];
if(!o){
return
}
var i=a.what;
o.checkItem(ZmOperation.KEY_ID,ZmComposeController.INC_OP[i],true);
var e=(i==ZmSetting.INC_BODY||i==ZmSetting.INC_SMART);
var t=o.getOp(ZmOperation.USE_PREFIX);
if(t){
t.setEnabled(e);
t.setChecked(a.prefix&&e,true)
}
t=o.getOp(ZmOperation.INCLUDE_HEADERS);
if(t){
t.setEnabled(e);
t.setChecked(a.headers&&e,true)
}};
ZmComposeController.prototype._resetReadReceipt=function(t){
var i=this._optionsMenu[this._action];
var e=i&&i.getOp(ZmOperation.REQUEST_READ_RECEIPT);
if(e){
var a=appCtxt.get(ZmSetting.MAIL_READ_RECEIPT_ENABLED,null,t);
if(!a){
e.setChecked(false,true)
}
e.setEnabled(a)
}};
ZmComposeController.prototype._getComposeMode=function(o,e){
var a=DwtHtmlEditor.TEXT;
if(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
if(this._action==ZmOperation.NEW_MESSAGE){
if(appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML){
a=DwtHtmlEditor.HTML
}}else{
if(e){
var t=appCtxt.get(ZmSetting.COMPOSE_SAME_FORMAT);
var i=appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT);
if((!t&&i==ZmSetting.COMPOSE_HTML)||(t&&o&&o.isHtmlMail())){
a=DwtHtmlEditor.HTML
}}else{
if(this._action==ZmOperation.DRAFT){
if(o&&o.isHtmlMail()){
a=DwtHtmlEditor.HTML
}}}}}
return a
};
ZmComposeController.prototype._getBodyContent=function(){
return this._composeView.getHtmlEditor().getContent()
};
ZmComposeController.prototype._setFormat=function(s){
var o=this._composeView.getComposeMode();
if(s==o){
return
}
var e=this._composeView;
var a=e.isDirty();
if(a||this._action==ZmOperation.DRAFT){
if(!this._formatWarningDialog){
this._formatWarningDialog=new DwtMessageDialog({
parent:this._shell,buttons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]}
)
}
var i=this._formatWarningDialog;
i.registerCallback(DwtDialog.OK_BUTTON,this._formatOkCallback,this,[s]);
i.registerCallback(DwtDialog.CANCEL_BUTTON,this._formatCancelCallback,this,[o]);
var n=(s==DwtHtmlEditor.TEXT)?ZmMsg.switchToText:ZmMsg.switchToHtml;
i.setMessage(n,DwtMessageDialog.WARNING_STYLE);
i.popup(e._getDialogXY())
}else{
var t=this._currentSignatureId;
if(t){
this.setSelectedSignature("");
this._composeView.applySignature(this._getBodyContent(),t)
}
e.setComposeMode(s,true);
if(t){
this.setSelectedSignature(t);
e.applySignature(this._getBodyContent(),t)
}
return true
}
return false
};
ZmComposeController.prototype._processSendMsg=function(n,s,f){
this._msgSent=true;
var g=(n!=ZmComposeController.DRAFT_TYPE_NONE);
if(!g){
var t=false;
if(appCtxt.get(ZmSetting.SHOW_MAIL_CONFIRM)){
var a=AjxDispatcher.run("GetMailConfirmController");
a.showConfirmation(s,this.viewId,this.tabId);
t=true
}else{
if(appCtxt.isChildWindow&&window.parentController){
window.onbeforeunload=null;
if(!appCtxt.isOffline){
window.parentController.setStatusMsg(ZmMsg.messageSent)
}}else{
if(!appCtxt.isOffline){
appCtxt.setStatusMsg(ZmMsg.messageSent)
}}
t=this._app.popView(true,this._currentView)
}
if(f||!appCtxt.get(ZmSetting.SAVE_TO_SENT)){
this._composeView.reset(false);
var m=s._origMsg;
if(m&&m.isDraft){
this._deleteDraft(m)
}
if(!appCtxt.isOffline&&f&&appCtxt.get(ZmSetting.SAVE_TO_IMAP_SENT)&&s.identity){
var w=appCtxt.getDataSourceCollection();
var l=w&&w.getById(s.identity.id);
if(l&&l.type==ZmAccount.TYPE_IMAP){
var c=appCtxt.getById(l.folderId);
var h;
if(c){
var y=c.getName(false,null,true,true)+"/";
var p=[appCtxt.get(ZmSetting.SENT_FOLDER_NAME)||"Sent",ZmMsg.sent,"Sent Messages","[Gmail]/Sent Mail"];
for(var b=0;
b<p.length;
b++){
h=c.getByPath(y+p[b]);
if(h){
break
}}}
if(h){
var x={
ItemActionRequest:{
_jsns:"urn:zimbraMail",action:{
id:f.m[0].id,op:"move",l:h.id}}};
var v={
jsonObj:x,asyncMode:true,noBusyOverlay:true};
appCtxt.getAppController().sendRequest(v)
}}}
if(!t){
this._app.popView(true,this._currentView)
}}}else{
if(appCtxt.isChildWindow){
appCtxt.setStatusMsg(ZmMsg.draftSaved);
this._composeView.processMsgDraft(s);
var e=window.parentAppCtxt;
if(e.getAppViewMgr().getAppView(ZmApp.MAIL)){
var o=e.getApp(ZmApp.MAIL).getMailListController();
if(o&&o._draftSaved){
o._draftSaved(null,f.m[0])
}}}else{
var u;
var k;
if(n==ZmComposeController.DRAFT_TYPE_AUTO){
var r=AjxDateUtil.computeTimeString(new Date());
this._autoSaveFormat=this._autoSaveFormat||new AjxMessageFormat(ZmMsg.draftSavedAuto);
u=this._autoSaveFormat.format(r);
k=[ZmToast.FADE_IN,ZmToast.IDLE,ZmToast.PAUSE,ZmToast.FADE_OUT]
}else{
u=ZmMsg.draftSaved
}
appCtxt.setStatusMsg(u,ZmStatusView.LEVEL_INFO,null,k);
this._composeView.processMsgDraft(s);
if(this._listController&&this._listController._draftSaved){
this._listController._draftSaved(s)
}}}};
ZmComposeController.prototype._sendListener=function(e){
this._send()
};
ZmComposeController.prototype._send=function(){
this._toolbar.enableAll(false);
this.sendMsg()
};
ZmComposeController.prototype._cancelListener=function(e){
this._cancelCompose()
};
ZmComposeController.prototype._cancelCompose=function(){
var t=this._composeView.isDirty();
var e=t||(this._draftType==ZmComposeController.DRAFT_TYPE_AUTO);
if(!e){
this._composeView.reset(true)
}else{
this._composeView.enableInputs(false)
}
this._composeView.reEnableDesignMode();
this._app.popView(!e)
};
ZmComposeController.prototype._attachmentListener=function(e){
if(!this._detachOkCancel){
this._detachOkCancel=new DwtMessageDialog({
parent:this._shell,buttons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]}
);
this._detachOkCancel.setMessage(ZmMsg.detachAnyway,DwtMessageDialog.WARNING_STYLE);
this._detachOkCancel.registerCallback(DwtDialog.OK_BUTTON,this._detachCallback,this)
}
this._composeView.showAttachmentDialog()
};
ZmComposeController.prototype._optionsListener=function(a){
var i=a.item.getData(ZmOperation.KEY_ID);
if(i==ZmOperation.REQUEST_READ_RECEIPT){
return
}
if(i==ZmOperation.COMPOSE_OPTIONS&&this._optionsMenu[this._action]){
var e=this._toolbar.getButton(ZmOperation.COMPOSE_OPTIONS);
var t=e.getBounds();
this._optionsMenu[this._action].popup(0,t.x,t.y+t.height,false);
return
}
if(a.detail!=DwtMenuItem.CHECKED&&!ZmComposeController.OP_CHECK[i]){
return
}
if(i==ZmOperation.REPLY||i==ZmOperation.REPLY_ALL){
this._composeView._setAddresses(i,AjxEmailAddress.TO,this._toOverride)
}else{
if(i==ZmOperation.FORMAT_HTML||i==ZmOperation.FORMAT_TEXT){
if(this._setFormat(a.item.getData(ZmHtmlEditor._VALUE))){
this._switchInclude(i)
}}else{
if(this._setInclude(i)){
this._switchInclude(i);
this._setDependentOptions()
}}}};
ZmComposeController.prototype._setInclude=function(i){
var a=this._curIncOptions.what;
var e=(a==ZmSetting.INC_BODY||a==ZmSetting.INC_SMART);
if(this._composeView.isDirty()&&e){
if(!this._switchIncludeDialog){
this._switchIncludeDialog=new DwtMessageDialog({
parent:this._shell,buttons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]}
);
this._switchIncludeDialog.setMessage(ZmMsg.switchIncludeWarning,DwtMessageDialog.WARNING_STYLE)
}
this._switchIncludeDialog.registerCallback(DwtDialog.OK_BUTTON,this._switchIncludeOkCallback,this,[i]);
var t=AjxUtil.hashCopy(this._curIncOptions);
this._switchIncludeDialog.registerCallback(DwtDialog.CANCEL_BUTTON,this._switchIncludeCancelCallback,this,[t]);
this._switchIncludeDialog.popup(this._composeView._getDialogXY());
return false
}else{
return true
}};
ZmComposeController.prototype._switchInclude=function(i){
var t=this._curIncOptions.what;
var e=this._optionsMenu[this._action];
if(i==ZmOperation.USE_PREFIX||i==ZmOperation.INCLUDE_HEADERS){
var o=e.getOp(i);
if(o){
if(i==ZmOperation.USE_PREFIX){
this._curIncOptions.prefix=o.getChecked()
}else{
this._curIncOptions.headers=o.getChecked()
}}}else{
if(ZmComposeController.INC_MAP[i]){
this._curIncOptions.what=ZmComposeController.INC_MAP[i]
}}
var r=(t==ZmSetting.INC_BODY||t==ZmSetting.INC_SMART);
var a=this._composeView;
var n="";
if(i!=ZmOperation.FORMAT_HTML&&i!=ZmOperation.FORMAT_TEXT){
if(a._preface||!r){
var l=this._getBodyContent();
if(a._preface){
var h=l.indexOf(a._preface);
if(h>0){
n=l.substr(0,h)
}}else{
n=l
}}
if(a._composeMode==DwtHtmlEditor.TEXT){
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
a.getHtmlEditor().moveCaretToTop()
}
),200)
}}
var s=this._curIncOptions.what;
if(this._action==ZmOperation.FORWARD_INLINE&&s==ZmSetting.INC_ATTACH){
this._action=ZmOperation.FORWARD_ATT
}
if(this._action==ZmOperation.FORWARD_ATT&&s!=ZmSetting.INC_ATTACH){
this._action=ZmOperation.FORWARD_INLINE
}
a.resetBody(this._action,this._msg,n)
};
ZmComposeController.prototype._detachListener=function(e){
var t=this._composeView.getAttFieldValues();
if(t.length){
this._detachOkCancel.popup(this._composeView._getDialogXY())
}else{
this.detach()
}};
ZmComposeController.prototype._saveDraftListener=function(e){
this.saveDraft()
};
ZmComposeController.prototype._autoSaveCallback=function(e){
if(e&&!DwtBaseDialog.getActiveDialog()&&this._composeView.isDirty()){
this.saveDraft(ZmComposeController.DRAFT_TYPE_AUTO)
}};
ZmComposeController.prototype._authSaveCallback=function(){
this._autoSaveCallback(true)
};
ZmComposeController.prototype.saveDraft=function(e,t,a,o){
if(!this._canSaveDraft()){
return
}
e=e||ZmComposeController.DRAFT_TYPE_MANUAL;
var i=new AjxCallback(this,this._handleResponseSaveDraftListener,[e,o]);
if(!a){
this.sendMsg(t,e,i)
}else{
this.sendDocs(a,e,i)
}};
ZmComposeController.prototype._handleResponseSaveDraftListener=function(e,t){
if(e==ZmComposeController.DRAFT_TYPE_AUTO&&this._draftType==ZmComposeController.DRAFT_TYPE_NONE){
this._draftType=ZmComposeController.DRAFT_TYPE_AUTO
}else{
if(e==ZmComposeController.DRAFT_TYPE_MANUAL){
this._draftType=ZmComposeController.DRAFT_TYPE_MANUAL
}}
this._action=ZmOperation.DRAFT;
this._composeView._isDirty=false;
if(t){
t.run()
}};
ZmComposeController.prototype._spellCheckListener=function(t){
var e=this._toolbar.getButton(ZmOperation.SPELL_CHECK);
var a=this._composeView.getHtmlEditor();
if(e.isToggled()){
var i=new AjxCallback(this,this.toggleSpellCheckButton);
if(!a.spellCheck(i)){
this.toggleSpellCheckButton(false)
}}else{
a.discardMisspelledWords()
}};
ZmComposeController.prototype._settingChangeListener=function(e){
if(e.type!=ZmEvent.S_SETTING){
return
}
var t=e.source.id;
if(t==ZmSetting.SHOW_BCC){}};
ZmComposeController.prototype._detachCallback=function(){
this._composeView.cleanupAttachments();
this._detachOkCancel.popdown();
this.detach()
};
ZmComposeController.prototype._formatOkCallback=function(e){
this._formatWarningDialog.popdown();
this._composeView.setComposeMode(e,true);
this._composeView._isDirty=true
};
ZmComposeController.prototype._formatCancelCallback=function(t){
this._formatWarningDialog.popdown();
var e=this._toolbar.getButton(ZmOperation.COMPOSE_OPTIONS).getMenu();
e.checkItem(ZmHtmlEditor._VALUE,t,true);
this._composeView.reEnableDesignMode()
};
ZmComposeController.prototype._popShieldYesCallback=function(e){
this._popShield.removePopdownListener(this._dialogPopdownListener);
this._popShield.popdown();
this._composeView.enableInputs(true);
if(this._canSaveDraft()){
var t=e?new AjxCallback(this,this.doAction,e):new AjxCallback(this,this._popShieldYesDraftSaved);
this.sendMsg(null,ZmComposeController.DRAFT_TYPE_MANUAL,t)
}else{
if(appCtxt.isChildWindow&&window.parentController){
window.onbeforeunload=null
}else{
this._composeView.reset(false)
}
if(e){
this.doAction(e)
}else{
appCtxt.getAppViewMgr().showPendingView(true)
}}};
ZmComposeController.prototype._popShieldYesDraftSaved=function(){
appCtxt.getAppViewMgr().showPendingView(true);
this._cancelAuthTimedSave()
};
ZmComposeController.prototype._popShieldNoCallback=function(e){
this._popShield.removePopdownListener(this._dialogPopdownListener);
this._popShield.popdown();
this._composeView.enableInputs(true);
if(this._canSaveDraft()){
if(appCtxt.isChildWindow&&window.parentController){
window.onbeforeunload=null
}
this._composeView.reset(false);
this._cancelAuthTimedSave();
if(!e){
appCtxt.getAppViewMgr().showPendingView(true)
}}else{
if(!e){
appCtxt.getAppViewMgr().showPendingView(false)
}
this._composeView.reEnableDesignMode()
}
if(e){
this.doAction(e)
}};
ZmComposeController.prototype._popShieldDiscardCallback=function(){
this._deleteDraft(this._composeView._msg);
this._popShieldNoCallback()
};
ZmComposeController.prototype._popShieldDismissCallback=function(){
this._popShield.removePopdownListener(this._dialogPopdownListener);
this._popShield.popdown();
this._cancelViewPop()
};
ZmComposeController.prototype._switchIncludeOkCallback=function(e){
this._switchIncludeDialog.popdown();
this._switchInclude(e);
this._setDependentOptions()
};
ZmComposeController.prototype._switchIncludeCancelCallback=function(e){
this._switchIncludeDialog.popdown();
this._setOptionsMenu(null,e)
};
ZmComposeController.prototype._dialogPopdownActionListener=function(){
this._cancelViewPop()
};
ZmComposeController.prototype._cancelViewPop=function(){
this._composeView.enableInputs(true);
appCtxt.getAppViewMgr().showPendingView(false);
this._composeView.reEnableDesignMode()
};
ZmComposeController.prototype._getDefaultFocusItem=function(){
if(this._action==ZmOperation.NEW_MESSAGE||this._action==ZmOperation.FORWARD_INLINE||this._action==ZmOperation.FORWARD_ATT){
return this._composeView._field[AjxEmailAddress.TO]
}
return(this._composeView.getComposeMode()==DwtHtmlEditor.TEXT)?this._composeView._bodyField:this._composeView._htmlEditor
};
ZmComposeController.prototype._createSignatureMenu=function(n,s){
if(!this._composeView){
return null
}
var n=this._toolbar.getButton(ZmOperation.ADD_SIGNATURE);
if(!n){
return null
}
var e;
var l=appCtxt.getSignatureCollection(s).getSignatureOptions();
if(l.length>0){
e=new DwtMenu({
parent:n}
);
var t=new AjxListener(this,this._handleSelectSignature);
var h=this._composeView._htmlElId+"_sig";
for(var a=0;
a<l.length;
a++){
var o=l[a];
var r=new DwtMenuItem({
parent:e,style:DwtMenuItem.RADIO_STYLE,radioGroupId:h}
);
r.setText(AjxStringUtil.htmlEncode(o.displayValue));
r.setData(ZmComposeController.SIGNATURE_KEY,o.value);
r.addSelectionListener(t);
e.checkItem(ZmComposeController.SIGNATURE_KEY,o.value,o.selected)
}}
return e
};
ZmComposeController.prototype._signatureChangeListener=function(e){
this.resetSignatureToolbar(this.getSelectedSignature())
};
ZmComposeController.prototype.resetSignatureToolbar=function(t,a){
var e=this._toolbar.getButton(ZmOperation.ADD_SIGNATURE);
var i=e&&this._createSignatureMenu(null,a);
if(i){
e.setMenu(i);
this.setSelectedSignature(t||"")
}
this._setAddSignatureVisibility(a)
};
ZmComposeController.prototype.resetToolbarOperations=function(){
this._toolbar.enableAll(true);
if(this._composeView._isInviteReply(this._action)){
var e=[ZmOperation.SAVE_DRAFT];
if(this._action==ZmOperation.REPLY_CANCEL){
e.push(ZmOperation.ATTACHMENT)
}
this._toolbar.enable(e,false)
}
var t=this._toolbar.getOp(ZmOperation.COMPOSE_OPTIONS);
if(t){
t.setVisible(appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED))
}};
ZmComposeController.prototype.setSessionId=function(e,t){
ZmController.prototype.setSessionId.apply(this,arguments);
this.tabId=["tab",this.viewId].join("_")
};
ZmComposeController.prototype._canSaveDraft=function(){
return appCtxt.get(ZmSetting.SAVE_DRAFT_ENABLED)&&!this._composeView._isInviteReply(this._action)
};
ZmComposeController.prototype._cancelAuthTimedSave=function(){
if(this._authTimedAction&&this._authTimedAction._id){
AjxTimedAction.cancelAction(this._authTimedAction._id);
this._authTimedAction=null
}}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmMsgController")){
ZmMsgController=function(e,t){
ZmMailListController.call(this,e,t)
};
ZmMsgController.prototype=new ZmMailListController;
ZmMsgController.prototype.constructor=ZmMsgController;
ZmMsgController.MODE_TO_CONTROLLER={};
ZmMsgController.MODE_TO_CONTROLLER[ZmId.VIEW_TRAD]="GetTradController";
ZmMsgController.MODE_TO_CONTROLLER[ZmId.VIEW_CONV]="GetConvController";
ZmMsgController.MODE_TO_CONTROLLER[ZmId.VIEW_CONVLIST]="GetConvListController";
ZmMsgController.DEFAULT_TAB_TEXT=ZmMsg.message;
ZmMsgController.viewToTab={};
ZmMsgController.prototype.toString=function(){
return"ZmMsgController"
};
ZmMsgController.prototype.show=function(i,a,n,t,e){
this.setMsg(i);
this._mode=a;
this._currentView=this._getViewType();
this._list=i.list;
if(!i._loaded){
var o=new AjxCallback(this,this._handleResponseShow,[n,e]);
if(i._loadPending){
i._loadCallback=o
}else{
t=t||(appCtxt.get(ZmSetting.MARK_MSG_READ)==ZmSetting.MARK_READ_NOW);
i.load({
callback:o,markRead:t}
)
}}else{
this._handleResponseShow(n,e)
}};
ZmMsgController.prototype._handleResponseShow=function(a,t,e){
this._showMsg();
this._showNavToolBarButtons(this._currentView,!t);
if(a instanceof AjxCallback){
a.run()
}};
ZmMsgController.prototype.dispose=function(){
this._tagList.removeChangeListener(this._tagChangeLstnr)
};
ZmMsgController.prototype._showMsg=function(){
var a=appCtxt.getAppViewMgr();
this._setup(this._currentView);
var n={};
n[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar[this._currentView];
n[ZmAppViewMgr.C_APP_CONTENT]=this._listView[this._currentView];
var e=a.getCurrentViewId();
var i=(e&&e.indexOf(ZmId.VIEW_MSG)==0)?ZmMsgController.viewToTab[e]:Dwt.getNextId();
ZmMsgController.viewToTab[this.viewId]=i;
var t={
view:this._currentView,elements:n,clear:appCtxt.isChildWindow,tabParams:this._getTabParams(i,new AjxCallback(this,this._tabCallback))};
var o=(this._msg&&this._msg.subject)?AjxStringUtil.htmlEncode(this._msg.subject.substr(0,ZmAppViewMgr.TAB_BUTTON_MAX_TEXT)):ZmMsgController.DEFAULT_TAB_TEXT;
this._setView(t);
a.setTabTitle(this.viewId,o);
this._resetOperations(this._toolbar[this._currentView],1);
this._resetNavToolBarButtons(this._currentView);
this._toolbar[this._currentView].adjustSize()
};
ZmMsgController.prototype._getTabParams=function(t,e){
return{
id:t,image:"MessageView",textPrecedence:85,tooltip:ZmMsgController.DEFAULT_TAB_TEXT,tabCallback:e}
};
ZmMsgController.prototype.getKeyMapName=function(){
return"ZmMsgController"
};
ZmMsgController.prototype.handleKeyAction=function(e){
switch(e){
case ZmKeyMap.CANCEL:this._backListener();
break;
default:return ZmMailListController.prototype.handleKeyAction.call(this,e);
break
}
return true
};
ZmMsgController.prototype.mapSupported=function(e){
return false
};
ZmMsgController.prototype._getToolBarOps=function(){
var e;
if(appCtxt.isChildWindow){
e=[ZmOperation.CLOSE,ZmOperation.SEP,ZmOperation.PRINT,ZmOperation.DELETE];
e.push(ZmOperation.SEP);
e=e.concat(this._msgOps());
e.push(ZmOperation.SEP,ZmOperation.SPAM,ZmOperation.SEP,ZmOperation.TAG_MENU)
}else{
e=this._standardToolBarOps();
e.push(ZmOperation.SEP);
e=e.concat(this._msgOps());
e.push(ZmOperation.SEP,ZmOperation.SPAM,ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.SEP);
if(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)){
e.push(ZmOperation.DETACH)
}}
return e
};
ZmMsgController.prototype._initializeToolBar=function(t){
if(!appCtxt.isChildWindow){
ZmMailListController.prototype._initializeToolBar.call(this,t)
}else{
var n=this._getToolBarOps();
if(!n){
return
}
var s={
parent:this._container,buttons:n,className:"ZmMsgViewToolBar_cw",context:this._getViewType(),controller:this};
var e=this._toolbar[t]=new ZmButtonToolBar(s);
n=e.opList;
for(var o=0;
o<n.length;
o++){
var a=n[o];
if(this._listeners[a]){
e.addSelectionListener(a,this._listeners[a])
}}
this._setupSpamButton(e);
a=e.getButton(ZmOperation.TAG_MENU);
if(a){
a.noMenuBar=true;
this._setupTagMenu(e)
}}};
ZmMsgController.prototype._navBarListener=function(e){
var t=e.item.getData(ZmOperation.KEY_ID);
if(t==ZmOperation.PAGE_BACK||t==ZmOperation.PAGE_FORWARD){
this._goToMsg(this._currentView,(t==ZmOperation.PAGE_FORWARD))
}};
ZmMsgController.prototype._setupViewMenu=function(e,t){};
ZmMsgController.prototype._getActionMenuOps=function(){
return null
};
ZmMsgController.prototype._getViewType=function(){
return this.viewId
};
ZmMsgController.prototype._initializeListView=function(e){
if(!this._listView[e]){
var t={
parent:this._container,id:ZmId.getViewId(ZmId.VIEW_MSG,null,e),posStyle:Dwt.ABSOLUTE_STYLE,mode:ZmId.VIEW_MSG,controller:this};
this._listView[e]=new ZmMailMsgView(t);
this._listView[e].addInviteReplyListener(this._inviteReplyListener);
this._listView[e].addShareListener(this._shareListener)
}};
ZmMsgController.prototype.getReferenceView=function(){
return this._listView[this._currentView]
};
ZmMsgController.prototype._getSearchFolderId=function(){
return this._msg.folderId?this._msg.folderId:(this._msg.list&&this._msg.list.search)?this._msg.list.search.folderId:null
};
ZmMsgController.prototype._getTagMenuMsg=function(){
return ZmMsg.tagMessage
};
ZmMsgController.prototype._getMoveDialogTitle=function(){
return ZmMsg.moveMessage
};
ZmMsgController.prototype._setViewContents=function(e){
this._listView[e].set(this._msg)
};
ZmMsgController.prototype._resetNavToolBarButtons=function(e){
if(!this._navToolBar[e]){
return
}
if(!appCtxt.isChildWindow){
var a=this._msg.list&&this._msg.list.getVector();
this._navToolBar[e].enable(ZmOperation.PAGE_BACK,(a&&(a.get(0)!=this._msg)));
var t=a&&(this._msg.list.hasMore()||(a.getLast()!=this._msg));
this._navToolBar[e].enable(ZmOperation.PAGE_FORWARD,t);
this._navToolBar[e].setToolTip(ZmOperation.PAGE_BACK,ZmMsg.previousMessage);
this._navToolBar[e].setToolTip(ZmOperation.PAGE_FORWARD,ZmMsg.nextMessage)
}};
ZmMsgController.prototype._showNavToolBarButtons=function(t,e){
var a=this._navToolBar[t];
if(!a){
return
}
if(!appCtxt.isChildWindow){
a.getButton(ZmOperation.PAGE_BACK).setVisible(e);
a.getButton(ZmOperation.PAGE_FORWARD).setVisible(e)
}};
ZmMsgController.prototype._goToMsg=function(t,a){
var e=this._getParentListController();
if(e){
e.pageItemSilently(this._msg,a)
}};
ZmMsgController.prototype._selectNextItemInParentListView=function(){
var e=this._getParentListController();
if(e){
e._listView[e._currentView]._itemToSelect=e._getNextItemToSelect()
}};
ZmMsgController.prototype._doDelete=function(){
this._selectNextItemInParentListView();
ZmMailListController.prototype._doDelete.apply(this,arguments)
};
ZmMsgController.prototype._doMove=function(){
this._selectNextItemInParentListView();
ZmMailListController.prototype._doMove.apply(this,arguments)
};
ZmMsgController.prototype._doSpam=function(){
this._selectNextItemInParentListView();
ZmMailListController.prototype._doSpam.apply(this,arguments)
};
ZmMsgController.prototype._menuPopdownActionListener=function(e){};
ZmMsgController.prototype.getMsg=function(e){
return this._msg
};
ZmMsgController.prototype._getLoadedMsg=function(e,t){
t.run(this._msg)
};
ZmMsgController.prototype._getSelectedMsg=function(){
return this._msg
};
ZmMsgController.prototype.setMsg=function(e){
this._msg=e
};
ZmMsgController.prototype._checkReplenish=function(e){};
ZmMsgController.prototype._checkItemCount=function(){
this._backListener()
};
ZmMsgController.prototype._getDefaultFocusItem=function(){
return this._toolbar[this._currentView]
};
ZmMsgController.prototype._backListener=function(t){
var e=appCtxt.isChildWindow;
if(!this._app.popView()&&!e){
this._app.mailSearch()
}};
ZmMsgController.prototype.isTransient=function(e,t){
return(t&&t.indexOf(ZmId.VIEW_COMPOSE)!=0)
};
ZmMsgController.prototype._tabCallback=function(e,t){
return(e&&e.indexOf(ZmId.VIEW_MSG)==0)
};
ZmMsgController.prototype._printListener=function(s){
var e=[];
var h=this._msg;
var i;
var r;
if(h.toString()=="ZmConv"){
if(appCtxt.isOffline&&h.id.split(":")[1]<0){
i=h.msgIds[0]
}else{
i="C:"+h.id
}
var o=h.getMsgList();
for(var n=0;
n<o.length;
n++){
if(o[n].showImages){
r=true;
break
}}}else{
i=h.id;
if(h._part){
i+="&part="+h._part
}
if(h.showImages){
r=true
}}
var t="/h/printmessage?id="+i+"&tz="+AjxTimezone.getServerId(AjxTimezone.DEFAULT);
if(appCtxt.get(ZmSetting.DISPLAY_EXTERNAL_IMAGES)||r){
t+="&xim=1"
}
if(appCtxt.isOffline){
var a=items[0].getAccount().name;
t+="&acct="+a
}
window.open(appContextPath+t,"_blank")
};
ZmMsgController.prototype._getParentListController=function(){
var e=appCtxt.isChildWindow?parentAppCtxt:appCtxt;
var t=e.getApp(ZmApp.MAIL);
if(this._mode==ZmId.VIEW_TRAD){
return t.getTradController()
}else{
if(this._mode==ZmId.VIEW_CONV){
return t.getConvController()
}else{
if(this._mode==ZmId.VIEW_CONVLIST){
return t.getConvListController()
}}}}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmConvController")){
ZmConvController=function(e,t){
ZmDoublePaneController.call(this,e,t);
this._convDeleteListener=new AjxListener(this,this._deleteListener);
this._listeners[ZmOperation.DELETE_MENU]=this._convDeleteListener;
this._msgControllerMode=ZmId.VIEW_CONV
};
ZmConvController.prototype=new ZmDoublePaneController;
ZmConvController.prototype.constructor=ZmConvController;
ZmMailListController.GROUP_BY_ICON[ZmId.VIEW_CONV]="ConversationView";
ZmConvController.prototype.toString=function(){
return"ZmConvController"
};
ZmConvController.prototype.show=function(t,o,e,n,i){
this._conv=o;
var a=this._listView[this._currentView];
if(a){
a.offset=0;
a.setSortByAsc(ZmItem.F_DATE,false)
}
this._parentController=e;
ZmDoublePaneController.prototype.show.call(this,t,o,n,i)
};
ZmConvController.prototype.getConv=function(){
return this._conv
};
ZmConvController.prototype._getReadingPanePref=function(){
return appCtxt.get(ZmSetting.READING_PANE_LOCATION_CV)
};
ZmConvController.prototype._setReadingPanePref=function(e){
appCtxt.set(ZmSetting.READING_PANE_LOCATION_CV,e)
};
ZmConvController.prototype._createDoublePaneView=function(){
return(new ZmConvView({
parent:this._container,controller:this,dropTgt:this._dropTgt}
))
};
ZmConvController.prototype._initialize=function(e){
ZmDoublePaneController.prototype._initialize.call(this,e);
if(this._doublePaneView){
this._doublePaneView.addTagClickListener(new AjxListener(this,ZmConvController.prototype._convTagClicked))
}};
ZmConvController.prototype._initializeToolBar=function(e){
if(!this._toolbar[e]){
ZmDoublePaneController.prototype._initializeToolBar.call(this,e)
}
this._setupDeleteMenu(e);
this._setupSpamButton(this._toolbar[e]);
this._setupCheckMailButton(this._toolbar[e])
};
ZmConvController.prototype._initializeNavToolBar=function(e){
ZmMailListController.prototype._initializeNavToolBar.apply(this,arguments);
this._itemCountText[ZmSetting.RP_BOTTOM]=this._navToolBar[e]._textButton
};
ZmConvController.prototype._navBarListener=function(e){
var t=e.item.getData(ZmOperation.KEY_ID);
if(t==ZmOperation.PAGE_BACK||t==ZmOperation.PAGE_FORWARD){
this._goToConv(t==ZmOperation.PAGE_FORWARD)
}};
ZmConvController.prototype._setupViewMenuItems=function(e,t){
var a=new ZmPopupMenu(t);
t.setMenu(a);
this._setupReadingPaneMenuItems(e,a,this.isReadingPaneOn());
return a
};
ZmConvController.prototype._setupDeleteMenu=function(e){
var a=this._toolbar[e].getButton(ZmOperation.DELETE_MENU);
if(this._conv.numMsgs>1){
var i=new ZmPopupMenu(a);
a.setMenu(i);
a.noMenuBar=true;
var o=ZmOperation.DELETE_MSG;
var t=i.createMenuItem(o,{
image:ZmOperation.getProp(o,"image"),text:ZmMsg[ZmOperation.getProp(o,"textKey")]}
);
t.setData(ZmOperation.MENUITEM_ID,ZmOperation.DELETE_MSG);
t.addSelectionListener(this._listeners[ZmOperation.DELETE]);
o=ZmOperation.DELETE_CONV;
t=i.createMenuItem(o,{
image:ZmOperation.getProp(o,"image"),text:ZmMsg[ZmOperation.getProp(o,"textKey")]}
);
t.setData(ZmOperation.MENUITEM_ID,ZmOperation.DELETE_CONV);
t.addSelectionListener(this._listeners[ZmOperation.DELETE])
}else{
if(a.getMenu()){
a.setMenu(null)
}}};
ZmConvController.prototype._standardToolBarOps=function(){
return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.CHECK_MAIL,ZmOperation.SEP,ZmOperation.DELETE_MENU,ZmOperation.MOVE,ZmOperation.PRINT]
};
ZmConvController.prototype._getViewType=function(){
return ZmId.VIEW_CONV
};
ZmConvController.prototype._setActiveSearch=function(e){};
ZmConvController.prototype._deleteListener=function(r){
if(r.item.getData(ZmOperation.MENUITEM_ID)==ZmOperation.DELETE_CONV){
var s=AjxDispatcher.run("GetConvListController");
s._doDelete([this._conv]);
this._app.popView()
}else{
if(r.item.getMenu()==null){
var e=this._listView[this._currentView].getSelection();
var h=[];
for(var a=0;
a<e.length;
a++){
var n=e[a];
var o=n.folderId?appCtxt.getById(n.folderId):null;
var t=(!o||(o&&!o.isHardDelete()));
if(t){
h.push(n)
}}
if(h.length){
this._doDelete(h)
}}else{
r.item.popup()
}}};
ZmConvController.prototype._convTagClicked=function(t){
var e=appCtxt.getById(t);
appCtxt.getSearchController().search({
query:e.createQuery()}
)
};
ZmConvController.prototype._dropListener=function(t){
ZmListController.prototype._dropListener.call(this,t);
if(t.action==DwtDropEvent.DRAG_DROP){
var a=this._listView[this._currentView].getTargetItemDiv(t.uiEvent);
if(a){
var e=t.srcData;
if(!this._conv.hasTag(e.id)){
this._doublePaneView._setTags(this._conv)
}}}};
ZmConvController.prototype._listSelectionListener=function(t){
var e=t.item;
if(!e){
return
}
var a=ZmDoublePaneController.prototype._listSelectionListener.apply(this,arguments);
if(!a&&t.detail==DwtListView.ITEM_DBL_CLICKED){
var i=new AjxCallback(this,this._handleResponseListSelectionListener,e);
AjxDispatcher.run("GetMsgController").show(e,this._msgControllerMode,i,true)
}};
ZmConvController.prototype.handleDelete=function(){
var o=true;
if(this._conv.numMsgs>1){
o=!this._conv.hasMatchingMsg(AjxDispatcher.run("GetConvListController").getList().search,true)
}
var a=appCtxt.getCurrentViewId();
var i=false;
if(a==ZmId.VIEW_COMPOSE&&this._conv.numMsgs==1&&this._conv.msgs){
var n=this._conv.msgs.getArray()[0];
i=(n.isInvite()&&n.folderId==ZmFolder.ID_TRASH)
}
o=o&&((a==this._currentView)||i);
if(o){
this._app.popView()
}else{
var t=this._toolbar[this._currentView].getButton(ZmOperation.DELETE_MENU);
var e=t?t.getMenu():null;
if(e){
e.enable(ZmOperation.DELETE_MSG,false)
}}
return o
};
ZmConvController.prototype.getKeyMapName=function(){
return"ZmConvController"
};
ZmConvController.prototype.handleKeyAction=function(e){
switch(e){
case ZmKeyMap.CANCEL:this._backListener();
break;
case ZmKeyMap.NEXT_CONV:if(this._navToolBar[this._currentView].getButton(ZmOperation.PAGE_FORWARD).getEnabled()){
this._goToConv(true)
}
break;
case ZmKeyMap.PREV_CONV:if(this._navToolBar[this._currentView].getButton(ZmOperation.PAGE_BACK).getEnabled()){
this._goToConv(false)
}
break;
default:return ZmDoublePaneController.prototype.handleKeyAction.call(this,e)
}
return true
};
ZmConvController.prototype._resetOperations=function(h,s){
ZmDoublePaneController.prototype._resetOperations.call(this,h,s);
var e=false;
var r=this._doublePaneView.getSelection();
for(var n=0;
n<r.length;
n++){
var l=r[n];
var t=l.folderId?appCtxt.getById(l.folderId):null;
e=(!t||(t&&!t.isInTrash()));
if(e){
break
}}
h.enable(ZmOperation.DELETE,e);
if(h instanceof ZmButtonToolBar){
h.enable(ZmOperation.DELETE_MENU,true);
var o=h.getButton(ZmOperation.DELETE_MENU);
var a=o?o.getMenu():null;
if(a){
a.enable(ZmOperation.DELETE_MSG,e)
}}};
ZmConvController.prototype._resetNavToolBarButtons=function(e){
ZmDoublePaneController.prototype._resetNavToolBarButtons.call(this,e);
if(!this._navToolBar[e]){
return
}
var t=this._conv.list.getVector();
var a=t.get(0);
this._navToolBar[e].enable(ZmOperation.PAGE_BACK,(a&&a!=this._conv));
var i=this._conv.list.hasMore()||(t.getLast()!=this._conv);
this._navToolBar[e].enable(ZmOperation.PAGE_FORWARD,i);
this._navToolBar[e].setToolTip(ZmOperation.PAGE_BACK,ZmMsg.previousConversation);
this._navToolBar[e].setToolTip(ZmOperation.PAGE_FORWARD,ZmMsg.nextConversation)
};
ZmConvController.prototype._getNumTotal=function(){
return this._conv.numMsgs
};
ZmConvController.prototype._search=function(t,i,e,o){
var a={
sortBy:appCtxt.get(ZmSetting.SORTING_PREF,t),offset:i,limit:e,getFirstMsg:this.isReadingPaneOn()};
this._conv.load(a,o)
};
ZmConvController.prototype._goToConv=function(t){
var e=this._parentController||AjxDispatcher.run("GetConvListController");
if(e){
e.pageItemSilently(this._conv,t)
}};
ZmConvController.prototype._getSearchFolderId=function(){
return this._conv.list.search.folderId
};
ZmConvController.prototype._isTopLevelView=function(){
return false
};
ZmConvController.prototype._resetSelection=function(){};
ZmConvController.prototype._selectNextItemInParentListView=function(){
var e=this._parentController||AjxDispatcher.run("GetConvListController");
if(e){
e._listView[e._currentView]._itemToSelect=e._getNextItemToSelect()
}};
ZmConvController.prototype._doDelete=function(){
this._selectNextItemInParentListView();
ZmDoublePaneController.prototype._doDelete.apply(this,arguments)
};
ZmConvController.prototype._doMove=function(){
this._selectNextItemInParentListView();
ZmDoublePaneController.prototype._doMove.apply(this,arguments)
};
ZmConvController.prototype._doSpam=function(){
this._selectNextItemInParentListView();
ZmDoublePaneController.prototype._doSpam.apply(this,arguments)
};
ZmConvController.prototype._msgViewCurrent=function(){
return true
}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmAttachmentsController")){
ZmAttachmentsController=function(e,t){
if(arguments.length==0){
return
}
ZmController.call(this,e,t);
this._trees={};
this._listeners={}
};
ZmAttachmentsController.prototype=new ZmController();
ZmAttachmentsController.prototype.constructor=ZmAttachmentsController;
ZmAttachmentsController.CATEGORY_BYTYPE="BY_TYPE";
ZmAttachmentsController.CATEGORY_BYTIME="BY_TIME";
ZmAttachmentsController.CATEGORY_BYTAG="BY_SENDER";
ZmAttachmentsController.CATEGORY_BYSENDER="BY_TAG";
ZmAttachmentsController.CATEGORY_BYFOLDER="BY_FOLDER";
ZmAttachmentsController.CATEGORIES=[];
ZmAttachmentsController.CATEGORIES.push(ZmAttachmentsController.CATEGORY_BYTYPE);
ZmAttachmentsController.CATEGORIES.push(ZmAttachmentsController.CATEGORY_BYTIME);
ZmAttachmentsController.CATEGORIES.push(ZmAttachmentsController.CATEGORY_BYTAG);
ZmAttachmentsController.CATEGORIES.push(ZmAttachmentsController.CATEGORY_BYSENDER);
ZmAttachmentsController.CATEGORIES.push(ZmAttachmentsController.CATEGORY_BYFOLDER);
ZmAttachmentsController.CATEGORY_MSGKEY={};
ZmAttachmentsController.CATEGORY_MSGKEY[ZmAttachmentsController.CATEGORY_BYTYPE]="byType";
ZmAttachmentsController.CATEGORY_MSGKEY[ZmAttachmentsController.CATEGORY_BYTIME]="byTime";
ZmAttachmentsController.CATEGORY_MSGKEY[ZmAttachmentsController.CATEGORY_BYTAG]="byTag";
ZmAttachmentsController.CATEGORY_MSGKEY[ZmAttachmentsController.CATEGORY_BYSENDER]="bySender";
ZmAttachmentsController.CATEGORY_MSGKEY[ZmAttachmentsController.CATEGORY_BYFOLDER]="byFolder";
ZmAttachmentsController.CATEGORY_ICON={};
ZmAttachmentsController.CATEGORY_ICON[ZmAttachmentsController.CATEGORY_BYTYPE]="NodeCollapsed";
ZmAttachmentsController.CATEGORY_ICON[ZmAttachmentsController.CATEGORY_BYTIME]="NodeCollapsed";
ZmAttachmentsController.CATEGORY_ICON[ZmAttachmentsController.CATEGORY_BYTAG]="NodeCollapsed";
ZmAttachmentsController.CATEGORY_ICON[ZmAttachmentsController.CATEGORY_BYSENDER]="NodeCollapsed";
ZmAttachmentsController.CATEGORY_ICON[ZmAttachmentsController.CATEGORY_BYFOLDER]="NodeCollapsed";
ZmAttachmentsController.ATTACH_QUERY_CMD="attachment:";
ZmAttachmentsController.AFTER_QUERY_CMD="after:";
ZmAttachmentsController.BEFORE_QUERY_CMD="before:";
ZmAttachmentsController.FROM_QUERY_CMD="from:";
ZmAttachmentsController.TAG_QUERY_CMD="tag:";
ZmAttachmentsController.FOLDER_QUERY_CMD="in:";
ZmAttachmentsController.DEFAULT_QUERY=ZmAttachmentsController.ATTACH_QUERY_CMD+"any";
ZmAttachmentsController.SUBCATEGORY_BYTYPE_ALL="BY_TYPE_ALL";
ZmAttachmentsController.SUBCATEGORY_BYTYPE_IMAGE="BY_TYPE_IMAGE";
ZmAttachmentsController.SUBCATEGORY_BYTYPE_DOCS="BY_TYPE_DOCS";
ZmAttachmentsController.SUBCATEGORY_BYTYPE_PRESENTATIONS="BY_TYPE_PPT";
ZmAttachmentsController.SUBCATEGORY_BYTYPE_SPREADSHEETS="BY_TYPE_SHEET";
ZmAttachmentsController.SUBCATEGORY_BYTYPE_MEDIA="BY_TYPE_MEDIA";
ZmAttachmentsController.CATEGORY_ITEMS={};
ZmAttachmentsController.CATEGORY_ITEMS[ZmAttachmentsController.CATEGORY_BYTYPE]=[{
id:ZmAttachmentsController.SUBCATEGORY_BYTYPE_ALL,msgKey:"all",image:"Attachment",ct:["any"],cmd:ZmAttachmentsController.ATTACH_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEGORY_BYTYPE_IMAGE,msgKey:"images",image:"ImageDoc",ct:["image"],cmd:ZmAttachmentsController.ATTACH_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEGORY_BYTYPE_DOCS,msgKey:"documents",image:"MSWordDoc",ct:["text/plain","application/msword","application/pdf"],cmd:ZmAttachmentsController.ATTACH_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEGORY_BYTYPE_PRESENTATIONS,msgKey:"presentations",image:"MSPowerpointDoc",ct:["application/vnd.ms-powerpoint"],cmd:ZmAttachmentsController.ATTACH_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEGORY_BYTYPE_SPREADSHEETS,msgKey:"sheet",image:"MSExcelDoc",ct:["application/vnd.ms-excel"],cmd:ZmAttachmentsController.ATTACH_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEGORY_BYTYPE_MEDIA,msgKey:"audioVideo",image:"AudioDoc",ct:["audio","audio/x-wav","audio/mpeg","video","video/x-ms-wmv"],cmd:ZmAttachmentsController.ATTACH_QUERY_CMD}
];
ZmAttachmentsController.SUBCATEORY_BYTIME_TODAY="BY_TIME_TODAY";
ZmAttachmentsController.SUBCATEORY_BYTIME_WEEK="BY_TIME_WEEK";
ZmAttachmentsController.SUBCATEORY_BYTIME_MONTH="BY_TIME_MONTH";
ZmAttachmentsController.SUBCATEORY_BYTIME_YEAR="BY_TIME_YEAR";
ZmAttachmentsController.CATEGORY_ITEMS[ZmAttachmentsController.CATEGORY_BYTIME]=[{
id:ZmAttachmentsController.SUBCATEORY_BYTIME_TODAY,msgKey:"today",image:"DayView",cmd:ZmAttachmentsController.AFTER_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEORY_BYTIME_WEEK,msgKey:"lastWeek",image:"WeekView",cmd:ZmAttachmentsController.AFTER_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEORY_BYTIME_MONTH,msgKey:"lastMonth",image:"MonthView",cmd:ZmAttachmentsController.AFTER_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEORY_BYTIME_YEAR,msgKey:"lastYear",image:"CalendarApp",cmd:ZmAttachmentsController.AFTER_QUERY_CMD}
,{
id:ZmAttachmentsController.SUBCATEORY_BYTIME_ANYTIME,msgKey:"anyTime",image:"Date"}
];
ZmAttachmentsController.prototype._initToolBar=function(){
if(this._toolbar){
return
}
this._listeners[ZmOperation.RESET]=new AjxListener(this,this._reset);
this._listeners[ZmOperation.CANCEL]=new AjxListener(this,this._cancel);
var o=[ZmOperation.RESET,ZmOperation.CANCEL];
var a=appCtxt.isChildWindow?"ZmAppToolBar_cw":"ZmAppToolBar";
this._toolbar=new ZmButtonToolBar({
parent:this._container,buttons:o,className:a+" ImgSkin_Toolbar",context:ZmId.VIEW_ATTACHMENTS}
);
for(var t=0;
t<this._toolbar.opList.length;
t++){
var e=this._toolbar.opList[t];
if(this._listeners[e]){
this._toolbar.addSelectionListener(e,this._listeners[e])
}}};
ZmAttachmentsController.prototype._reset=function(e){
this._attachmentsView._resetFilterTrees();
this.search({
query:this._getQuery()}
)
};
ZmAttachmentsController.prototype._cancel=function(){
this._app.popView()
};
ZmAttachmentsController.prototype.initAttachmentsView=function(){
if(this._attachmentsView){
return
}
this._attachmentsView=new ZmAttachmentsView(this._container,this);
this._initToolBar();
var e={};
e[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar;
e[ZmAppViewMgr.C_APP_CONTENT]=this._attachmentsView;
this._app.createView({
viewId:ZmId.VIEW_ATTACHMENTS,elements:e,isTransient:true}
)
};
ZmAttachmentsController.prototype.show=function(){
this.initAttachmentsView();
this._app.pushView(ZmId.VIEW_ATTACHMENTS);
this._reset()
};
ZmAttachmentsController.prototype.search=function(a){
a.query=a.query||ZmAttachmentsController.DEFAULT_QUERY;
a.offset=0;
a.limit=50;
a.sortBy=ZmSearch.DATE_DESC;
a.fetch="all";
a.searchFor=ZmItem.MSG;
var e=new AjxVector();
e.add(ZmItem.MSG);
a.types=e;
a.noBusyOverlay=true;
a.noRender=true;
a.callback=new AjxCallback(this,this._handleSearchResponse);
var t=appCtxt.getSearchController();
t.search(a)
};
ZmAttachmentsController.prototype._handleSearchResponse=function(e){
e=e.getResponse().getResults(ZmItem.MSG);
this._attachmentsView.set(e)
};
ZmAttachmentsController.prototype._filterTreeListener=function(e){
if(e.detail==DwtTree.ITEM_SELECTED){
this.search({
query:this._getQuery()}
)
}};
ZmAttachmentsController.prototype._getQuery=function(){
var m="";
var e="";
var g=this._attachmentsView.getSelectedItem(ZmAttachmentsController.CATEGORY_BYTYPE);
if(g){
var l=[];
var u=g.ct;
if(g.id==ZmAttachmentsController.SUBCATEGORY_BYTYPE_ALL){
l.push("any")
}else{
for(var h=0;
h<u.length;
h++){
l.push('"'+u[h]+'"')
}}
l=l.join(" OR ");
m+=g.cmd+"("+l+")";
e+="<strong>"+ZmMsg[g.msgKey]+"</strong> attachments <br>"
}else{
e+="<strong>"+ZmMsg.all+"</strong> attachments <br>"
}
var a=this._attachmentsView.getSelection(ZmAttachmentsController.CATEGORY_BYFOLDER);
if(a){
var t=a.getData(Dwt.KEY_OBJECT);
m+=" "+t.createQuery();
e+="in <strong>"+t.getName()+"</strong> folder<br>"
}
var s=this._attachmentsView.getSelection(ZmAttachmentsController.CATEGORY_BYTAG);
if(s){
var y=s.getData(Dwt.KEY_OBJECT);
m+=" "+ZmAttachmentsController.TAG_QUERY_CMD+'"'+y.name+'"';
e+="with tag <strong>"+y.getName()+"</strong><br>"
}
var c=this._attachmentsView.getSelectedItem(ZmAttachmentsController.CATEGORY_BYTIME);
if(c){
var n=new Date();
var r=-1;
if(c.id==ZmAttachmentsController.SUBCATEORY_BYTIME_TODAY){
n.setDate(n.getDate()+r)
}else{
if(c.id==ZmAttachmentsController.SUBCATEORY_BYTIME_WEEK){
n.setDate(n.getDate()+7*r)
}else{
if(c.id==ZmAttachmentsController.SUBCATEORY_BYTIME_MONTH){
d=n.getDate();
n.setDate(1);
n.setMonth(n.getMonth()+r);
var f=AjxDateUtil.daysInMonth(n.getFullYear(),n.getMonth());
n.setDate(Math.min(d,f))
}else{
if(c.id==ZmAttachmentsController.SUBCATEORY_BYTIME_YEAR){
d=n.getDate();
n.setDate(1);
n.setFullYear(n.getFullYear()+r);
var f=AjxDateUtil.daysInMonth(n.getFullYear(),n.getMonth());
n.setDate(Math.min(d,f))
}}}}
var p=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT);
var o=p.format(n);
if(c.cmd){
m+=" "+c.cmd+'"'+o+'"'
}
e+="during <strong>"+ZmMsg[c.msgKey]+"</strong><br>"
}
this._attachmentsView.setQueryString(e);
return(m!="")?m:ZmAttachmentsController.DEFAULT_QUERY
};
ZmAttachmentsController.prototype._sendMail=function(e){}
}
if(AjxPackage.define("zimbraMail.mail.controller.ZmMailConfirmController")){
ZmMailConfirmController=function(e,t){
ZmController.call(this,e,t)
};
ZmMailConfirmController.prototype=new ZmController();
ZmMailConfirmController.prototype.constructor=ZmMailConfirmController;
ZmMailConfirmController.prototype.toString=function(){
return"ZmMailConfirmController"
};
ZmMailConfirmController.prototype.showConfirmation=function(a,t,e){
this._composeViewId=t;
this._composeTabId=e;
if(!this._view){
this._initView()
}
this._initializeToolBar();
this.resetToolbarOperations(this._toolbar);
this._view.showConfirmation(a);
if(appCtxt.isChildWindow){
appCtxt.getAppViewMgr()._setViewVisible(ZmId.VIEW_LOADING,false)
}
appCtxt.getAppViewMgr().replaceView(this._composeViewId,this.viewId)
};
ZmMailConfirmController.prototype.resetToolbarOperations=function(){
this._toolbar.enableAll(true)
};
ZmMailConfirmController.prototype.getKeyMapName=function(){
return"Global"
};
ZmMailConfirmController.prototype.handleKeyAction=function(e){
switch(e){
case ZmKeyMap.CANCEL:this._closeListener();
break;
default:return ZmController.prototype.handleKeyAction.call(this,e);
break
}
return true
};
ZmMailConfirmController.prototype._initView=function(){
this._view=new ZmMailConfirmView(this._container,this);
this._view.addNewContactsListener(new AjxListener(this,this._addNewContactsListener));
var a=this._createTabGroup();
var i=appCtxt.getRootTabGroup();
a.newParent(i);
a.addMember(this._view.getTabGroupMember());
var t={};
this._initializeToolBar();
t[ZmAppViewMgr.C_TOOLBAR_TOP]=this._toolbar;
t[ZmAppViewMgr.C_APP_CONTENT]=this._view;
var e={};
e[ZmAppViewMgr.CB_PRE_HIDE]=new AjxCallback(this,this._preHideCallback);
e[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this._postShowCallback);
this._app.createView({
viewId:this.viewId,elements:t,callbacks:e,tabParams:{
id:this._composeTabId}}
)
};
ZmMailConfirmController.prototype._initializeToolBar=function(){
if(this._toolbar){
return
}
var t=[ZmOperation.CLOSE];
var e=appCtxt.isChildWindow?"ZmAppToolBar_cw":"ZmAppToolBar";
this._toolbar=new ZmButtonToolBar({
parent:this._container,buttons:t,className:e+" ImgSkin_Toolbar",context:ZmId.VIEW_MAIL_CONFIRM}
);
this._toolbar.addSelectionListener(ZmOperation.CLOSE,new AjxListener(this,this._closeListener))
};
ZmMailConfirmController.prototype._getDefaultFocusItem=function(){
return this._view.getDefaultFocusItem()
};
ZmMailConfirmController.prototype._closeListener=function(){
this._doClose()
};
ZmMailConfirmController.prototype._addNewContactsListener=function(t){
if(!t.length){
this._doClose();
return
}
var n=new ZmBatchCommand(false,null,true);
for(var a=0,o=t.length;
a<o;
a++){
var e=new ZmContact();
n.add(new AjxCallback(e,e.create,[t[a]]))
}
n.run(new AjxCallback(this,this._handleResponseCreateContacts))
};
ZmMailConfirmController.prototype._handleResponseCreateContacts=function(){
this._doClose()
};
ZmMailConfirmController.prototype._doClose=function(){
appCtxt.getAppViewMgr().popView(true)
}
}};
</script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Share")){
if(AjxPackage.define("zimbraMail.share.model.ZmShare")){
ZmShare=function(e){
this.grantee={};
this.grantor={};
this.link={};
if(!e){
return
}
this.object=e.object;
this.grantee.type=e.granteeType;
this.grantee.id=e.granteeId;
this.grantee.name=e.granteeName||"";
this.link.inh=e.inherit;
this.link.pw=e.granteePwd;
this.invalid=e.invalid;
this.setPermissions(e.perm)
};
ZmShare.URI="urn:zimbraShare";
ZmShare.VERSION="0.1";
ZmShare.NEW="new";
ZmShare.EDIT="edit";
ZmShare.DELETE="delete";
ZmShare.ACCEPT="accept";
ZmShare.DECLINE="decline";
ZmShare.NOTIFY="notify";
ZmShare.RESEND="resend";
ZmShare.REVOKE="revoke";
ZmShare.ACTION_LABEL={};
ZmShare.ACTION_LABEL[ZmShare.EDIT]=ZmMsg.edit;
ZmShare.ACTION_LABEL[ZmShare.RESEND]=ZmMsg.resend;
ZmShare.ACTION_LABEL[ZmShare.REVOKE]=ZmMsg.revoke;
ZmShare.PERM_READ="r";
ZmShare.PERM_WRITE="w";
ZmShare.PERM_INSERT="i";
ZmShare.PERM_DELETE="d";
ZmShare.PERM_ADMIN="a";
ZmShare.PERM_WORKFLOW="x";
ZmShare.PERM_PRIVATE="p";
ZmShare.PERM_CREATE_SUBDIR="c";
ZmShare.PERM_NOREAD="-r";
ZmShare.PERM_NOWRITE="-w";
ZmShare.PERM_NOINSERT="-i";
ZmShare.PERM_NODELETE="-d";
ZmShare.PERM_NOADMIN="-a";
ZmShare.PERM_NOWORKFLOW="-x";
ZmShare.PERMS={};
ZmShare.PERMS[ZmShare.PERM_READ]=ZmMsg.shareActionRead;
ZmShare.PERMS[ZmShare.PERM_WRITE]=ZmMsg.shareActionWrite;
ZmShare.PERMS[ZmShare.PERM_INSERT]=ZmMsg.shareActionInsert;
ZmShare.PERMS[ZmShare.PERM_DELETE]=ZmMsg.shareActionDelete;
ZmShare.PERMS[ZmShare.PERM_ADMIN]=ZmMsg.shareActionAdmin;
ZmShare.PERMS[ZmShare.PERM_WORKFLOW]=ZmMsg.shareActionWorkflow;
ZmShare.PERMS[ZmShare.PERM_NOREAD]=ZmMsg.shareActionNoRead;
ZmShare.PERMS[ZmShare.PERM_NOWRITE]=ZmMsg.shareActionNoWrite;
ZmShare.PERMS[ZmShare.PERM_NOINSERT]=ZmMsg.shareActionNoInsert;
ZmShare.PERMS[ZmShare.PERM_NODELETE]=ZmMsg.shareActionNoDelete;
ZmShare.PERMS[ZmShare.PERM_NOADMIN]=ZmMsg.shareActionNoAdmin;
ZmShare.PERMS[ZmShare.PERM_NOWORKFLOW]=ZmMsg.shareActionNoWorkflow;
ZmShare.ROLE_NONE="NONE";
ZmShare.ROLE_VIEWER="VIEWER";
ZmShare.ROLE_MANAGER="MANAGER";
ZmShare.ROLE_ADMIN="ADMIN";
ZmShare.ROLE_TEXT={};
ZmShare.ROLE_TEXT[ZmShare.ROLE_NONE]=ZmMsg.shareRoleNone;
ZmShare.ROLE_TEXT[ZmShare.ROLE_VIEWER]=ZmMsg.shareRoleViewer;
ZmShare.ROLE_TEXT[ZmShare.ROLE_MANAGER]=ZmMsg.shareRoleManager;
ZmShare.ROLE_TEXT[ZmShare.ROLE_ADMIN]=ZmMsg.shareRoleAdmin;
ZmShare.ROLE_PERMS={};
ZmShare.ROLE_PERMS[ZmShare.ROLE_NONE]="";
ZmShare.ROLE_PERMS[ZmShare.ROLE_VIEWER]="r";
ZmShare.ROLE_PERMS[ZmShare.ROLE_MANAGER]="rwidx";
ZmShare.ROLE_PERMS[ZmShare.ROLE_ADMIN]="rwidxa";
ZmShare.TYPE_ALL="all";
ZmShare.TYPE_USER="usr";
ZmShare.TYPE_GROUP="grp";
ZmShare.TYPE_DOMAIN="dom";
ZmShare.TYPE_COS="cos";
ZmShare.TYPE_GUEST="guest";
ZmShare.TYPE_PUBLIC="pub";
ZmShare.ZID_ALL="00000000-0000-0000-0000-000000000000";
ZmShare.ZID_PUBLIC="99999999-9999-9999-9999-999999999999";
ZmShare.SHARE="SHARE";
ZmShare.GRANT="GRANT";
ZmShare._SUBJECTS={};
ZmShare._SUBJECTS[ZmShare.NEW]=ZmMsg.shareCreatedSubject;
ZmShare._SUBJECTS[ZmShare.EDIT]=ZmMsg.shareModifiedSubject;
ZmShare._SUBJECTS[ZmShare.DELETE]=ZmMsg.shareRevokedSubject;
ZmShare._SUBJECTS[ZmShare.ACCEPT]=ZmMsg.shareAcceptedSubject;
ZmShare._SUBJECTS[ZmShare.DECLINE]=ZmMsg.shareDeclinedSubject;
ZmShare._SUBJECTS[ZmShare.NOTIFY]=ZmMsg.shareNotifySubject;
ZmShare._TEXT=null;
ZmShare._HTML=null;
ZmShare._HTML_NOTE=null;
ZmShare._XML=null;
ZmShare.getRoleName=function(e){
return ZmShare.ROLE_TEXT[e]||ZmMsg.shareRoleCustom
};
ZmShare.getRoleActions=function(n){
var t=ZmShare.ROLE_PERMS[n];
var a=[];
if(t){
for(var e=0;
e<t.length;
e++){
var o=t.charAt(e);
if(o=="-"){
o+=t.charAt(++e)
}
a.push(ZmShare.PERMS[o])
}}
return(a.length>0)?a.join(", "):ZmMsg.shareActionNone
};
ZmShare.ACTIONS={};
ZmShare.ACTIONS[ZmShare.ROLE_NONE]=ZmShare.getRoleActions(ZmShare.ROLE_NONE);
ZmShare.ACTIONS[ZmShare.ROLE_VIEWER]=ZmShare.getRoleActions(ZmShare.ROLE_VIEWER);
ZmShare.ACTIONS[ZmShare.ROLE_MANAGER]=ZmShare.getRoleActions(ZmShare.ROLE_MANAGER);
ZmShare.ACTIONS[ZmShare.ROLE_ADMIN]=ZmShare.getRoleActions(ZmShare.ROLE_ADMIN);
ZmShare.createFromDom=function(a){
var t=new ZmShare();
var e=a.documentElement;
t.version=e.getAttribute("version");
if(t.version!=ZmShare.VERSION){
throw"Zimbra share version must be "+ZmShare.VERSION
}
t.action=e.getAttribute("action");
var i=e.firstChild;
while(i!=null){
switch(i.nodeName){
case"grantee":case"grantor":t[i.nodeName].id=i.getAttribute("id");
t[i.nodeName].email=i.getAttribute("email");
t[i.nodeName].name=i.getAttribute("name");
break;
case"link":t.link.id=i.getAttribute("id");
t.link.name=i.getAttribute("name");
t.link.view=i.getAttribute("view");
t.link.perm=i.getAttribute("perm");
break
}
i=i.nextSibling
}
return t
};
ZmShare.prototype.toString=function(){
return"ZmShare"
};
ZmShare.prototype.setPermissions=function(e){
this.link.perm=e;
this.link.role=ZmShare._getRoleFromPerm(e)
};
ZmShare.prototype.isPermAllowed=function(t){
if(this.link.perm){
var e=this.link.perm.replace(/-./g,"");
return(e.indexOf(t)!=-1)
}
return false
};
ZmShare.prototype.isPermRestricted=function(e){
if(this.link.perm){
return(this.link.perm.indexOf("-"+e)!=-1)
}
return false
};
ZmShare.prototype.isRead=function(){
return this.isPermAllowed(ZmShare.PERM_READ)
};
ZmShare.prototype.isWrite=function(){
return this.isPermAllowed(ZmShare.PERM_WRITE)
};
ZmShare.prototype.isInsert=function(){
return this.isPermAllowed(ZmShare.PERM_INSERT)
};
ZmShare.prototype.isDelete=function(){
return this.isPermAllowed(ZmShare.PERM_DELETE)
};
ZmShare.prototype.isAdmin=function(){
return this.isPermAllowed(ZmShare.PERM_ADMIN)
};
ZmShare.prototype.isWorkflow=function(){
return this.isPermAllowed(ZmShare.PERM_WORKFLOW)
};
ZmShare.prototype.hasPrivateAccess=function(){
return this.isPermAllowed(ZmShare.PERM_PRIVATE)
};
ZmShare._getFolderType=function(e){
var t=(e&&ZmOrganizer.FOLDER_KEY[ZmOrganizer.TYPE[e]])||"folder";
return ZmMsg[t]
};
ZmShare.createFromJs=function(t,e){
return new ZmShare({
object:t,granteeType:e.gt,granteeId:e.zid,granteeName:e.d,perm:e.perm,inherit:e.inh,granteePwd:e.pw,invalid:e.invalid}
)
};
ZmShare.prototype.isAll=function(){
return this.grantee.type==ZmShare.TYPE_ALL
};
ZmShare.prototype.isUser=function(){
return this.grantee.type==ZmShare.TYPE_USER
};
ZmShare.prototype.isGroup=function(){
return this.grantee.type==ZmShare.TYPE_GROUP
};
ZmShare.prototype.isDomain=function(){
return this.grantee.type==ZmShare.TYPE_DOMAIN
};
ZmShare.prototype.isGuest=function(){
return this.grantee.type==ZmShare.TYPE_GUEST
};
ZmShare.prototype.isPublic=function(){
return(this.grantee.type==ZmShare.TYPE_PUBLIC)
};
ZmShare.prototype.grant=function(a,t,e){
this.link.perm=a;
var i=new AjxCallback(this,this._handleResponseGrant);
this._shareAction("grant",null,{
perm:a,pw:t}
,i,e)
};
ZmShare.prototype._handleResponseGrant=function(e){
var t=e.getResponse().FolderActionResponse.action;
this.grantee.id=t.zid;
this.grantee.email=t.d
};
ZmShare.prototype.revoke=function(i){
var t=this.grantee&&(this.grantee.type==ZmShare.TYPE_ALL);
var e={
zid:this.isPublic()?ZmShare.ZID_PUBLIC:t?ZmShare.ZID_ALL:this.grantee.id};
var a=new AjxCallback(this,this._handleResponseRevoke,[i]);
this._shareAction("!grant",e,null,a)
};
ZmShare.prototype.revokeMultiple=function(o,t,e){
var a={
zid:this.isPublic()?ZmShare.ZID_PUBLIC:this.grantee.id};
var i=new AjxCallback(this,this._handleResponseRevoke,[o]);
this._shareAction("!grant",a,null,i,e)
};
ZmShare.prototype._handleResponseRevoke=function(e){
if(e){
e.run()
}};
ZmShare.prototype.accept=function(a,t,o,i,r,e){
var s=new AjxCallback(this,this._handleResponseAccept,[o,i,r,e]);
var n={
l:ZmOrganizer.ID_ROOT,name:a,zid:this.grantor.id,rid:ZmOrganizer.normalizeId(this.link.id),color:t,view:this.link.view};
if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&ZmOrganizer.VIEW_HASH[ZmOrganizer.CALENDAR][this.link.view]){
n.f=ZmOrganizer.FLAG_CHECKED
}
ZmMountpoint.create(n,s)
};
ZmShare.prototype._handleResponseAccept=function(a,t,i,e){
this.notes=t;
if(i){
i.run()
}
if(a!=ZmShareReply.NONE){
if(a==ZmShareReply.COMPOSE){
this.composeMessage(ZmShare.ACCEPT,null,e)
}else{
this.sendMessage(ZmShare.ACCEPT,null,e)
}}};
ZmShare.prototype.sendMessage=function(s,o,e,t){
if(!o){
var i=this.grantee.email;
o=new AjxVector();
o.add(new AjxEmailAddress(i,AjxEmailAddress.TO))
}
var n=this._createMsg(s,false,o,e);
var a=appCtxt.multiAccounts?(this.object?(this.object.getAccount().name):null):null;
n.send(false,null,null,a,false,false,t)
};
ZmShare.prototype.composeMessage=function(o,n,e){
if(!n){
var s=this.grantee.email;
n=new AjxVector();
n.add(new AjxEmailAddress(s,AjxEmailAddress.TO))
}
var t=this._createMsg(o,true,n,e);
var i=t._topPart.children;
var a=i.get(0);
var r=i.get(1);
var h=i.get(2);
t.setBodyParts([a.node,r.node,h.node]);
AjxDispatcher.run("Compose",{
action:ZmOperation.SHARE,inNewWindow:true,msg:t}
)
};
ZmShare._getText=function(e){
if(!ZmShare._TEXT){
ZmShare._TEXT={};
ZmShare._TEXT[ZmShare.NEW]=new AjxMessageFormat(ZmMsg.shareCreatedText);
ZmShare._TEXT[ZmShare.EDIT]=new AjxMessageFormat(ZmMsg.shareModifiedText);
ZmShare._TEXT[ZmShare.DELETE]=new AjxMessageFormat(ZmMsg.shareRevokedText);
ZmShare._TEXT[ZmShare.ACCEPT]=new AjxMessageFormat(ZmMsg.shareAcceptedText);
ZmShare._TEXT[ZmShare.DECLINE]=new AjxMessageFormat(ZmMsg.shareDeclinedText);
ZmShare._TEXT[ZmShare.NOTIFY]=new AjxMessageFormat(ZmMsg.shareNotifyText)
}
return ZmShare._TEXT[e]
};
ZmShare._getHtml=function(e){
if(!ZmShare._HTML){
ZmShare._HTML={};
ZmShare._HTML[ZmShare.NEW]=new AjxMessageFormat(ZmMsg.shareCreatedHtml);
ZmShare._HTML[ZmShare.EDIT]=new AjxMessageFormat(ZmMsg.shareModifiedHtml);
ZmShare._HTML[ZmShare.DELETE]=new AjxMessageFormat(ZmMsg.shareRevokedHtml);
ZmShare._HTML[ZmShare.ACCEPT]=new AjxMessageFormat(ZmMsg.shareAcceptedHtml);
ZmShare._HTML[ZmShare.DECLINE]=new AjxMessageFormat(ZmMsg.shareDeclinedHtml);
ZmShare._HTML[ZmShare.NOTIFY]=new AjxMessageFormat(ZmMsg.shareNotifyHtml)
}
return ZmShare._HTML[e]
};
ZmShare._getHtmlNote=function(){
if(!ZmShare._HTML_NOTE){
ZmShare._HTML_NOTE=new AjxMessageFormat(ZmMsg.shareNotesHtml)
}
return ZmShare._HTML_NOTE
};
ZmShare._getXml=function(){
if(!ZmShare._XML){
var e=['<share xmlns="{0}" version="{1}" action="{2}" >','  <grantee id="{3}" email="{4}" name="{5}" />','  <grantor id="{6}" email="{7}" name="{8}" />','  <link id="{9}" name="{10}" view="{11}" perm="{12}" />',"  <notes>{13}</notes>","</share>"].join("\n");
ZmShare._XML=new AjxMessageFormat(e)
}
return ZmShare._XML
};
ZmShare.prototype._shareAction=function(i,e,t,l,a){
var r=AjxSoapDoc.create("FolderActionRequest","urn:zimbraMail");
var h=r.set("action");
h.setAttribute("op",i);
if(this.object.rid&&this.object.zid){
h.setAttribute("id",this.object.zid+":"+this.object.rid)
}else{
h.setAttribute("id",this.object.id)
}
for(var s in e){
h.setAttribute(s,e[s])
}
if(i!="!grant"){
var n=r.set("grant",null,h);
n.setAttribute("gt",this.grantee.type);
if(this.link.inh){
n.setAttribute("inh","1")
}
if(!this.isPublic()){
n.setAttribute("d",this.isGuest()?(this.grantee.id||this.grantee.name):this.grantee.name)
}
for(var s in t){
n.setAttribute(s,(t[s]||""))
}}
var c=new AjxCallback(this,this._handleResponseShareAction,[l]);
var o=new AjxCallback(this,this._handleErrorShareAction);
if(a){
a.addRequestParams(r,c,o)
}else{
appCtxt.getAppController().sendRequest({
soapDoc:r,asyncMode:true,callback:c,errorCallback:o}
)
}};
ZmShare.prototype._handleResponseShareAction=function(t,e){
if(t){
t.run(e)
}};
ZmShare.prototype._handleErrorShareAction=function(e){
var t=ZmMsg.unknownError;
if(e instanceof ZmCsfeException&&e.code=="account.NO_SUCH_ACCOUNT"){
if(!this._unknownUserFormatter){
this._unknownUserFormatter=new AjxMessageFormat(ZmMsg.unknownUser)
}
t=this._unknownUserFormatter.format(this.grantee.name);
e=null
}
appCtxt.getAppController().popupErrorDialog(t,e,null,true);
return true
};
ZmShare.prototype._createMsg=function(o,i,n,e){
var a=this._createTextPart(o,i);
var r=this._createHtmlPart(o,i);
var c=new ZmMimePart();
c.setContentType(ZmMimeTable.MULTI_ALT);
c.children.add(a);
c.children.add(r);
if(o!=ZmShare.NOTIFY){
var l=this._createXmlPart(o);
c.children.add(l)
}
var t=new ZmMailMsg();
if(o==ZmShare.ACCEPT||o==ZmShare.DECLINE){
t.setAddress(AjxEmailAddress.FROM,new AjxEmailAddress(this.grantee.email,AjxEmailAddress.FROM));
var h=new AjxVector();
if(e&&e!=this.grantor.email){
h.add(new AjxEmailAddress(e,AjxEmailAddress.TO))
}
h.add(new AjxEmailAddress(this.grantor.email,AjxEmailAddress.TO));
t.setAddresses(AjxEmailAddress.TO,h)
}else{
t.setAddress(AjxEmailAddress.FROM,new AjxEmailAddress(this.grantee.email,AjxEmailAddress.FROM));
var s=(n.size()>1)?AjxEmailAddress.BCC:AjxEmailAddress.TO;
t.setAddresses(s,n)
}
t.setSubject(ZmShare._SUBJECTS[o]+": "+AjxMessageFormat.format(ZmMsg.sharedBySubject,[this.link.name,this.grantor.name]));
t.setTopPart(c);
return t
};
ZmShare.prototype._createTextPart=function(n,e){
var a=ZmShare._getText(n);
var i=this._createContent(a);
if(this.notes||e){
var t=this.notes;
i=[i,ZmItem.NOTES_SEPARATOR,t].join("\n")
}
var o=new ZmMimePart();
o.setContentType(ZmMimeTable.TEXT_PLAIN);
o.setContent(i);
return o
};
ZmShare.prototype._createHtmlPart=function(n,e){
var a=ZmShare._getHtml(n);
var i=this._createContent(a);
if(this.notes||e){
a=ZmShare._getHtmlNote();
var t=AjxStringUtil.nl2br(AjxStringUtil.htmlEncode(this.notes));
i=[i,a.format(t)].join("")
}
var o=new ZmMimePart();
o.setContentType(ZmMimeTable.TEXT_HTML);
o.setContent(i);
return o
};
ZmShare.prototype._createXmlPart=function(n){
var t=(appCtxt.isOffline)?appCtxt.getFolderTree().getByPath(this.link.name):null;
var o=(t)?t.id:this.link.id;
var i=[ZmShare.URI,ZmShare.VERSION,n,this.grantee.id,this.grantee.email,AjxStringUtil.xmlAttrEncode(this.grantee.name),this.grantor.id,this.grantor.email,AjxStringUtil.xmlAttrEncode(this.grantor.name),o,AjxStringUtil.xmlAttrEncode(this.link.name),this.link.view,this.link.perm,AjxStringUtil.xmlEncode(this.notes)];
var e=ZmShare._getXml().format(i);
var a=new ZmMimePart();
a.setContentType(ZmMimeTable.XML_ZIMBRA_SHARE);
a.setContent(e);
return a
};
ZmShare.prototype._createContent=function(e){
var a=ZmShare._getRoleFromPerm(this.link.perm);
var t=[this.link.name,"("+ZmShare._getFolderType(this.link.view)+")",(this.object?(this.object.owner||this.grantor.name):this.grantor.name),this.grantee.name,ZmShare.getRoleName(a),ZmShare.getRoleActions(a)];
return e.format(t)
};
ZmShare._getRoleFromPerm=function(e){
if(!e){
return ZmShare.ROLE_NONE
}
if(e.indexOf(ZmShare.PERM_ADMIN)!=-1){
return ZmShare.ROLE_ADMIN
}
if(e.indexOf(ZmShare.PERM_WORKFLOW)!=-1){
return ZmShare.ROLE_MANAGER
}
if(e.indexOf(ZmShare.PERM_READ)!=-1){
return ZmShare.ROLE_VIEWER
}
return ZmShare.ROLE_NONE
};
ZmShare.revokeOrphanGrants=function(t,n,o,e){
var i={
FolderActionRequest:{
_jsns:"urn:zimbraMail",action:{
op:"revokeorphangrants",id:ZmFolder.ID_ROOT,zid:t,gt:n}}};
if(e){
var a=new AjxCallback(null,ZmShare._handleResponseRevokeOrphanGrants,[o]);
e.addRequestParams(i,a)
}else{
appCtxt.getRequestMgr().sendRequest({
jsonObj:i,asyncMode:true,callback:a}
)
}};
ZmShare._handleResponseRevokeOrphanGrants=function(e){
if(e){
e.run()
}};
ZmShare.getShareFromShareInfo=function(t,e){
e=e||new ZmShare();
e.grantee=e.grantee||{};
if(t.granteeName){
e.grantee.name=t.granteeName
}
if(t.granteeId){
e.grantee.id=t.granteeId
}
if(t.granteeType){
e.grantee.type=t.granteeType
}
e.grantor=e.grantor||{};
if(t.ownerEmail){
e.grantor.email=t.ownerEmail
}
if(t.ownerName){
e.grantor.name=t.ownerName
}
if(t.ownerId){
e.grantor.id=t.ownerId
}
e.link=e.link||{};
e.link.view=t.view||"message";
if(t.folderId){
e.link.id=t.folderId
}
if(t.folderPath){
e.link.path=t.folderPath
}
if(t.folderPath){
e.link.name=t.folderPath.substr(t.folderPath.lastIndexOf("/")+1)
}
if(t.rights){
e.setPermissions(t.rights)
}
if(t.mid){
e.mounted=true;
e.mountpoint=e.mountpoint||{};
e.mountpoint.id=t.mid;
var a=appCtxt.getById(e.mountpoint.id);
if(a){
e.mountpoint.name=a.getName();
e.mountpoint.path=a.getPath()
}}
e.action="new";
e.version="0.1";
e.type=ZmShare.SHARE;
return e
};
ZmShare.getShareFromLink=function(a,t){
t=t||new ZmShare();
t.grantor=t.grantor||{};
if(a.owner){
t.grantor.email=a.owner
}
if(a.zid){
t.grantor.id=a.zid
}
t.link=t.link||{};
t.link.view=ZmOrganizer.VIEWS[a.type][0];
if(a.rid){
t.link.id=a.rid
}
var e=a.getMainShare();
t.link.name=e?e.link.name:a.name;
t.setPermissions(e?e.link.perm:a.perm);
t.mounted=true;
t.mountpoint=t.mountpoint||{};
t.mountpoint.id=a.id;
t.mountpoint.name=a.getName();
t.mountpoint.path=a.getPath();
t.action="new";
t.version="0.1";
t.type=ZmShare.SHARE;
return t
};
ZmShare.getShareFromGrant=function(t,e){
t.link=t.link||{};
t.link.id=t.object&&(t.object.nId||t.object.id);
t.link.path=t.object&&t.object.getPath();
t.link.name=t.object&&t.object.getName();
t.type=ZmShare.GRANT;
t.domId=e&&e.domId;
return t
}
}
if(AjxPackage.define("zimbraMail.share.model.ZmMountpoint")){
ZmMountpoint=function(e){
e.type=ZmOrganizer.MOUNTPOINT;
ZmOrganizer.call(this,e);
this.view=e.view
};
ZmMountpoint.prototype=new ZmOrganizer;
ZmMountpoint.prototype.constructor=ZmMountpoint;
ZmMountpoint.__CREATE_PARAMS={
l:1,name:1,zid:1,rid:1,owner:1,path:1,view:1,color:1,f:1};
ZmMountpoint.prototype.toString=function(){
return"ZmMountpoint"
};
ZmMountpoint.create=function(o,n){
var a=AjxSoapDoc.create("CreateMountpointRequest","urn:zimbraMail");
var e=a.set("link");
for(var i in o){
if(!(i in ZmMountpoint.__CREATE_PARAMS)){
continue
}
e.setAttribute(i,o[i])
}
var t=new AjxCallback(null,ZmMountpoint._handleCreateError,o.name);
appCtxt.getAppController().sendRequest({
soapDoc:a,asyncMode:true,callback:n,errorCallback:t}
)
};
ZmMountpoint._handleCreateError=function(t,e){
var a;
if(e.code==ZmCsfeException.SVC_PERM_DENIED||e.code==ZmCsfeException.MAIL_NO_SUCH_FOLDER){
a=ZmCsfeException.getErrorMsg(e.code)
}else{
if(e.code==ZmCsfeException.MAIL_ALREADY_EXISTS){
a=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[t])
}}
if(a){
appCtxt.getAppController().popupErrorDialog(a,null,null,true);
return true
}}
}
if(AjxPackage.define("zimbraMail.share.view.ZmShareReply")){
ZmShareReply=function(a,t,e){
t=t||"ZmShareReply";
DwtComposite.call(this,{
parent:a,className:t}
);
this._initControl(e)
};
ZmShareReply.prototype=new DwtComposite;
ZmShareReply.prototype.constructor=ZmShareReply;
ZmShareReply.NONE=0;
ZmShareReply.STANDARD=1;
ZmShareReply.QUICK=2;
ZmShareReply.COMPOSE=3;
ZmShareReply.DEFAULT_OPTIONS=[ZmShareReply.NONE,ZmShareReply.STANDARD,ZmShareReply.QUICK,ZmShareReply.COMPOSE];
ZmShareReply._LABELS={};
ZmShareReply._LABELS[ZmShareReply.NONE]=ZmMsg.sendNoMailAboutShare;
ZmShareReply._LABELS[ZmShareReply.STANDARD]=ZmMsg.sendStandardMailAboutShare;
ZmShareReply._LABELS[ZmShareReply.QUICK]=ZmMsg.sendStandardMailAboutSharePlusNote;
ZmShareReply._LABELS[ZmShareReply.COMPOSE]=ZmMsg.sendComposedMailAboutShare;
ZmShareReply.prototype.setReplyType=function(e){
this._replyType.setSelectedValue(e);
Dwt.setVisible(this._replyStandardMailNoteEl,e==ZmShareReply.STANDARD||e==ZmShareReply.QUICK);
Dwt.setVisible(this._replyNoteEl,e==ZmShareReply.QUICK)
};
ZmShareReply.prototype.getReplyType=function(){
return this._replyType.getValue()
};
ZmShareReply.prototype.setReplyNote=function(e){
this._replyNoteEl.value=e
};
ZmShareReply.prototype.getReplyNote=function(){
return this._replyNoteEl.value
};
ZmShareReply.prototype.setReplyOptions=function(e){
if(this._replyOptions==e){
return
}
this._replyOptions=e;
this._replyType.clearOptions();
for(var t=0;
t<e.length;
t++){
var a=e[t];
this._replyType.addOption(ZmShareReply._LABELS[a],false,a)
}};
ZmShareReply.prototype.getReplyOptions=function(){
return this._replyOptions
};
ZmShareReply.prototype._handleReplyType=function(t){
var e=this._replyType.getValue();
this.setReplyType(e)
};
ZmShareReply.prototype._initControl=function(e){
this._replyType=new DwtSelect({
parent:this}
);
e=e||ZmShareReply.DEFAULT_OPTIONS;
this.setReplyOptions(e);
this._replyType.addChangeListener(new AjxListener(this,this._handleReplyType));
var a=document;
this._replyTypeEl=a.createElement("DIV");
this._replyTypeEl.style.paddingBottom="0.125em";
this._replyTypeEl.appendChild(this._replyType.getHtmlElement());
this._replyStandardMailNoteEl=a.createElement("DIV");
this._replyStandardMailNoteEl.style.paddingBottom="0.125em";
this._replyStandardMailNoteEl.style.width="30em";
this._replyStandardMailNoteEl.innerHTML=ZmMsg.sendMailAboutShareNote;
var i=a.createElement("DIV");
this._replyNoteEl=a.createElement("TEXTAREA");
this._replyNoteEl.cols=50;
this._replyNoteEl.rows=4;
i.appendChild(this._replyNoteEl);
this._replyControlsEl=a.createElement("DIV");
this._replyControlsEl.style.marginLeft="1.5em";
this._replyControlsEl.appendChild(this._replyTypeEl);
this._replyControlsEl.appendChild(this._replyStandardMailNoteEl);
this._replyControlsEl.appendChild(i);
var t=this.getHtmlElement();
t.appendChild(this._replyControlsEl)
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmAcceptShareDialog")){
ZmAcceptShareDialog=function(t,e){
e=e||"ZmAcceptShareDialog";
DwtDialog.call(this,{
parent:t,className:e,title:ZmMsg.acceptShare,standardButtons:[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON]}
);
this.setButtonListener(DwtDialog.YES_BUTTON,new AjxListener(this,this._handleYesButton));
this.setButtonListener(DwtDialog.NO_BUTTON,new AjxListener(this,this._handleNoButton));
this.setView(this._createView());
this._headerFormatter=new AjxMessageFormat(ZmMsg.acceptShareHeader);
this._detailsFormatter=new AjxMessageFormat(ZmMsg.acceptShareDetails);
this._defaultNameFormatter=new AjxMessageFormat(ZmMsg.shareNameDefault)
};
ZmAcceptShareDialog.prototype=new DwtDialog;
ZmAcceptShareDialog.prototype.constructor=ZmAcceptShareDialog;
ZmAcceptShareDialog._ACTIONS={};
ZmAcceptShareDialog._ACTIONS[ZmShare.ROLE_NONE]=ZmMsg.acceptShareDetailsNone;
ZmAcceptShareDialog._ACTIONS[ZmShare.ROLE_VIEWER]=ZmMsg.acceptShareDetailsViewer;
ZmAcceptShareDialog._ACTIONS[ZmShare.ROLE_MANAGER]=ZmMsg.acceptShareDetailsManager;
ZmAcceptShareDialog._ACTIONS[ZmShare.ROLE_ADMIN]=ZmMsg.acceptShareDetailsAdmin;
ZmAcceptShareDialog.prototype.popup=function(a,e){
this._share=a;
this._fromAddr=e;
this._headerEl.innerHTML=this._headerFormatter.format([a.grantor.name||a.grantor.email,a.link.name]);
var n=ZmShare._getRoleFromPerm(a.link.perm);
var o=[ZmShare.getRoleName(n),ZmAcceptShareDialog._ACTIONS[n]];
this._detailsEl.innerHTML=this._detailsFormatter.format(o);
this._questionEl.innerHTML="<b>"+ZmMsg.acceptShareQuestion+"</b>";
var t=a.grantor.name||(a.grantor.email&&a.grantor.email.substr(0,a.grantor.email.indexOf("@")));
this._nameEl.value=this._defaultNameFormatter.format([t,a.link.name]);
this._reply.setReplyType(ZmShareReply.NONE);
this._reply.setReplyNote("");
var i=ZmOrganizer.TYPE[a.link.view];
if(i==ZmOrganizer.FOLDER){
this._color.getMenu().getItem(0).setEnabled(true);
this._color.setSelectedValue(0)
}else{
this._color.getMenu().getItem(0).setEnabled(false);
this._color.setSelectedValue(1)
}
DwtDialog.prototype.popup.call(this)
};
ZmAcceptShareDialog.prototype.setAcceptListener=function(e){
this.removeAllListeners(ZmAcceptShareDialog.ACCEPT);
if(e){
this.addListener(ZmAcceptShareDialog.ACCEPT,e)
}};
ZmAcceptShareDialog.prototype._handleYesButton=function(t){
var a=this._reply.getReplyType();
var e=(a==ZmShareReply.QUICK)?this._reply.getReplyNote():"";
var i=new AjxCallback(this,this._yesButtonCallback,[t]);
this._share.accept(this._nameEl.value,this._color.getValue(),a,e,i,this._fromAddr)
};
ZmAcceptShareDialog.prototype._yesButtonCallback=function(e){
this.notifyListeners(ZmAcceptShareDialog.ACCEPT,e);
this.setAcceptListener(null);
this.popdown()
};
ZmAcceptShareDialog.prototype._handleNoButton=function(e){
this.popdown()
};
ZmAcceptShareDialog.prototype._getSeparatorTemplate=function(){
return""
};
ZmAcceptShareDialog.prototype._createView=function(){
var e=new DwtComposite(this);
this._headerEl=document.createElement("DIV");
this._headerEl.style.marginBottom="0.5em";
this._detailsEl=document.createElement("DIV");
this._detailsEl.style.marginBottom="1em";
this._questionEl=document.createElement("DIV");
this._questionEl.style.marginBottom="0.5em";
this._nameEl=document.createElement("INPUT");
this._nameEl.style.width="20em";
var n=this._nameEl;
this._color=new DwtSelect({
parent:e}
);
for(var o=0;
o<ZmOrganizer.COLOR_CHOICES.length;
o++){
var t=ZmOrganizer.COLOR_CHOICES[o];
this._color.addOption(t.label,false,t.value)
}
var h=this._propSheet=new DwtPropertySheet(e);
var a=h.getHtmlElement();
a.style.marginBottom="0.5em";
h.addProperty(ZmMsg.nameLabel,n);
h.addProperty(ZmMsg.colorLabel,this._color);
this._reply=new ZmShareReply(e);
var r=document.createElement("DIV");
r.style.marginLeft="1.5em";
r.appendChild(a);
r.appendChild(this._reply.getHtmlElement());
var s=e.getHtmlElement();
s.appendChild(this._headerEl);
s.appendChild(this._detailsEl);
s.appendChild(this._questionEl);
s.appendChild(r);
return e
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmDeclineShareDialog")){
ZmDeclineShareDialog=function(i,a){
a=a||"ZmDeclineShareDialog";
var n=ZmMsg.declineShare;
var o=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON];
DwtDialog.call(this,{
parent:i,className:a,title:n,standardButtons:o}
);
this.setButtonListener(DwtDialog.YES_BUTTON,new AjxListener(this,this._handleYesButton));
this._confirmMsgEl=document.createElement("DIV");
this._confirmMsgEl.style.fontWeight="bold";
this._confirmMsgEl.style.marginBottom="0.25em";
this._reply=new ZmShareReply(this);
var e=new DwtComposite(this);
var t=e.getHtmlElement();
t.appendChild(this._confirmMsgEl);
t.appendChild(this._reply.getHtmlElement());
this.setView(e);
this._formatter=new AjxMessageFormat(ZmMsg.declineShareConfirm)
};
ZmDeclineShareDialog.prototype=new DwtDialog;
ZmDeclineShareDialog.prototype.constructor=ZmDeclineShareDialog;
ZmDeclineShareDialog.prototype.popup=function(a,e){
this._share=a;
this._fromAddr=e;
var t=this._formatter.format([a.grantee.name,a.link.name]);
this._confirmMsgEl.innerHTML=AjxStringUtil.htmlEncode(t);
this._reply.setReplyType(ZmShareReply.STANDARD);
this._reply.setReplyNote("");
DwtDialog.prototype.popup.call(this)
};
ZmDeclineShareDialog.prototype.setDeclineListener=function(e){
this.removeAllListeners(ZmShare.DECLINE);
if(e){
this.addListener(ZmShare.DECLINE,e)
}};
ZmDeclineShareDialog.prototype._handleYesButton=function(e){
var t=this._reply.getReplyType();
if(t!=ZmShareReply.NONE){
this._share.notes=(t==ZmShareReply.QUICK)?this._reply.getReplyNote():"";
if(t==ZmShareReply.COMPOSE){
this._share.composeMessage(ZmShare.DECLINE,null,this._fromAddr)
}else{
this._share.sendMessage(ZmShare.DECLINE,null,this._fromAddr)
}}
this.notifyListeners(ZmShare.DECLINE,e);
this.setDeclineListener(null);
this.popdown()
};
ZmDeclineShareDialog.prototype._getSeparatorTemplate=function(){
return""
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmLinkPropsDialog")){
ZmLinkPropsDialog=function(e,t){
t=t||"ZmLinkPropsDialog";
DwtDialog.call(this,{
parent:e,className:t,title:ZmMsg.linkProperties}
);
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
this._cache=AjxDispatcher.run("GetNotebookCache");
this.setView(this._createView())
};
ZmLinkPropsDialog.prototype=new DwtDialog;
ZmLinkPropsDialog.prototype.constructor=ZmLinkPropsDialog;
ZmLinkPropsDialog.prototype.popup=function(t,o){
this._linkInfo=t||{};
this._callback=o;
var i=this._linkInfo.url;
if(appCtxt.get(ZmSetting.NOTEBOOK_ENABLED)){
var e=appCtxt.getById(ZmOrganizer.ID_ROOT);
var a=e.children.getArray();
this._notebookSelect.clearOptions();
this.__addNotebookChildren(a,"");
this.notebookChangeListener();
this._pageRadioEl.checked=!i;
this._urlRadioEl.checked=i;
this._pageInput.setValue("")
}
this._urlInput.setValue(this._linkInfo.url||"http://www.");
this._titleInput.setValue(this._linkInfo.text||"");
ZmLinkPropsDialog._setRequiredFields(this,!i);
DwtDialog.prototype.popup.call(this);
ZmLinkPropsDialog._enableFieldsOnEdit(this)
};
ZmLinkPropsDialog.prototype.popdown=function(){
if(this._acPageList){
this._acPageList.show(false)
}
DwtDialog.prototype.popdown.call(this)
};
ZmLinkPropsDialog.prototype.getPageDataLoader=function(){
return this
};
ZmLinkPropsDialog.prototype.autocompleteMatch=function(c){
var e=this._notebookSelect.getValue();
var a=this._cache.getPagesInFolder(e);
var i=[];
var n=c.toLowerCase();
for(var t in a){
var l=t.toLowerCase();
var r=l.indexOf(n);
if(r!=-1){
var h=a[t];
var o={
text:[t.substr(0,r),"<B>",t.substr(r,c.length),"</B>",t.substr(r+c.length)].join(""),name:t,data:h};
i.push(o)
}}
return i
};
ZmLinkPropsDialog.prototype._setAcPageCompletion=function(t,e,a){};
ZmLinkPropsDialog.prototype._acKeyUpListener=function(e){
this._pageInput.validate();
ZmLinkPropsDialog._enableFieldsOnEdit(this)
};
ZmLinkPropsDialog._handleEdit=function(t){
var a=DwtUiEvent.getTarget(t);
var e=Dwt.getObjectFromElement(a);
ZmLinkPropsDialog._enableFieldsOnEdit(e);
return true
};
ZmLinkPropsDialog._handleKeyUp=function(a){
if(DwtInputField._keyUpHdlr(a)){
var i=DwtUiEvent.getTarget(a);
var e=Dwt.getObjectFromElement(i);
var t=e.parent.parent;
return ZmLinkPropsDialog._enableFieldsOnEdit(t)
}
return false
};
ZmLinkPropsDialog._handleLinkTo=function(t){
var i=DwtUiEvent.getTarget(t);
var e=Dwt.getObjectFromElement(i);
var a=i==e._pageRadioEl;
ZmLinkPropsDialog._setRequiredFields(e,a);
ZmLinkPropsDialog._enableFieldsOnEdit(e);
return true
};
ZmLinkPropsDialog._handleUrlTest=function(i){
var n=DwtUiEvent.getTarget(i);
var e=Dwt.getObjectFromElement(n);
var s=e._urlInput.getValue();
if(!s){
return
}
var t="_new";
var a=["width=",(window.outerWidth||640),",","height=",(window.outerHeight||480),",","location,menubar,","resizable,scrollbars,status,toolbar"].join("");
var o=open(s,t,a)
};
ZmLinkPropsDialog._enableFieldsOnEdit=function(t){
var e=false;
if(t._pageRadioEl&&t._pageRadioEl.checked){
e=true
}else{
e=t._urlInput.getValue().replace(/^\s+(.*)\s+$/,"$1")!=""
}
t.setButtonEnabled(DwtDialog.OK_BUTTON,e)
};
ZmLinkPropsDialog._setRequiredFields=function(e,t){
if(e._pageInput){
e._pageInput.setRequired(t)
}
e._urlInput.setRequired(!t)
};
ZmLinkPropsDialog.prototype._handleOkButton=function(t){
this.popdown();
if(this._callback){
var n=this._titleInput.getValue().replace(/^\s+(.*)\s+$/,"$1");
var e;
if(this._pageRadioEl&&this._pageRadioEl.checked){
var s=this._notebookSelect.getValue();
var o=appCtxt.getById(s);
var a=AjxStringUtil.trim(this._pageInput.getValue());
e=["[[","/",o.getSearchPath(),"/",a,(n?"|":""),n,"]]"].join("")
}else{
var i=this._linkInfo.document||document;
e=i.createElement("A");
e.href=AjxStringUtil.trim(this._urlInput.getValue());
e.innerHTML=AjxStringUtil.htmlEncode(n||e.href)
}
this._callback.run(e,this._linkInfo.target)
}};
ZmLinkPropsDialog.prototype._createView=function(){
var b=new DwtComposite(this);
var W={
parent:b,type:DwtInputField.STRING,validationStyle:DwtInputField.CONTINUAL_VALIDATION};
var A=[];
this._urlInput=new DwtInputField(W);
this._urlInput.setRequired(true);
var T=this._urlInput.getInputElement();
Dwt.setHandler(T,DwtEvent.ONKEYUP,ZmLinkPropsDialog._handleKeyUp);
this._titleInput=new DwtInputField(W);
if(appCtxt.get(ZmSetting.NOTEBOOK_ENABLED)){
var e=Dwt.getNextId();
var r=Dwt.getNextId();
var y=Dwt.getNextId();
var h=Dwt.getNextId();
var w=Dwt.getNextId();
var z=Dwt.getNextId();
var f=Dwt.getNextId();
var c=Dwt.getNextId();
var v=Dwt.getNextId();
var g=this._htmlElId+"_type";
var C=["<table border=0 cellpadding=0 cellspacing=0>","<tr valign=top>","<td rowspan=2>","<input id='",e,"' type=radio name='",g,"'>","</td>","<td>",ZmMsg.notebookPageLabel,"</td>","</tr>","<tr>","<td id='",y,"'></td>","</tr>","<tr valign=top>","<td rowspan=2>","<input id='",r,"' type=radio name='",g,"'>","</td>","<td>",ZmMsg.webPageLabel,"</td>","</tr>","<tr>","<td>","<nobr id='",f,"'></nobr>","</td>","</tr>","</table>"].join("");
this._notebookSelect=new DwtSelect({
parent:b}
);
var n=new AjxListener(this,this.notebookChangeListener);
this._notebookSelect.addChangeListener(n);
this._pageSelect=new DwtSelect({
parent:b}
);
var u=new AjxListener(this,this.pageChangeListener);
this._pageSelect.addChangeListener(u);
this._pageInput=new DwtInputField(W);
this._pageInput.setRequired(true);
var d=this._pageInput.getInputElement();
d.style.width="15em";
var o=this._urlInput.getInputElement();
o.style.width="25em";
var o=this._titleInput.getInputElement();
o.style.width="20em";
var B=new DwtGrouper(b);
B.setLabel(ZmMsg.linkTo);
B.setContent(C);
var p=new DwtPropertySheet(B);
p.addProperty(ZmMsg.notebookLabel,"<div id='"+h+"'></div>");
p.addProperty(ZmMsg.pageLabel,"<div id='"+z+"'></div>");
p.addProperty(ZmMsg.pageNameLabel,"<div id='"+w+"'></div>");
var S=document.getElementById(y);
S.appendChild(p.getHtmlElement());
var k=document.getElementById(h);
k.appendChild(this._notebookSelect.getHtmlElement());
var l=document.getElementById(z);
l.appendChild(this._pageSelect.getHtmlElement());
var F=document.getElementById(w);
F.parentNode.replaceChild(this._pageInput.getHtmlElement(),F);
var O=document.createElement("TABLE");
O.border=0;
O.cellSpacing=10;
O.cellpadding=0;
var m=O.insertRow(-1);
var t=m.insertCell(-1);
t.appendChild(this._urlInput.getHtmlElement());
var t=m.insertCell(-1);
t.innerHTML=["<span ","id='",c,"' ","onmouseover='this.style.cursor=\"pointer\"' ","onmouseout='this.style.cursor=\"default\"' ","style='color:blue;text-decoration:underline;'",">",ZmMsg.testUrl,"</span>"].join("");
var q=t.firstChild;
Dwt.setHandler(q,DwtEvent.ONCLICK,ZmLinkPropsDialog._handleUrlTest);
Dwt.associateElementWithObject(q,this);
var a=document.getElementById(f);
a.parentNode.replaceChild(O,a);
this._pageRadioEl=document.getElementById(e);
this._pageRadioEl.checked=true;
this._urlRadioEl=document.getElementById(r);
var x=[this._pageRadioEl,this._urlRadioEl];
for(var j=0;
j<x.length;
j++){
Dwt.setHandler(x[j],DwtEvent.ONCLICK,ZmLinkPropsDialog._handleLinkTo);
Dwt.associateElementWithObject(x[j],this)
}
var D={
dataClass:this,dataLoader:this.getPageDataLoader,matchValue:"name",separator:"",compCallback:new AjxCallback(this,this._setAcPageCompletion),keyUpCallback:new AjxCallback(this,this._acKeyUpListener)};
this._acPageList=new ZmAutocompleteListView(D);
this._acPageList.handle(d);
A.push(Dwt.byId(e),this._notebookSelect,this._pageSelect,this._pageInput,Dwt.byId(r),this._urlInput)
}
A.push(this._titleInput);
var s=new DwtPropertySheet(b);
if(!appCtxt.get(ZmSetting.NOTEBOOK_ENABLED)){
s.addProperty(linkUrlLabel,this._urlInput)
}
s.addProperty(ZmMsg.linkTitleLabel,this._titleInput);
for(var j=0;
j<A.length;
j++){
this._tabGroup.addMember(A[j],j)
}
return b
};
ZmLinkPropsDialog.prototype.__addNotebookChildren=function(t,o){
if(!t){
return
}
for(var e=0;
e<t.length;
e++){
var n=t[e];
if(n instanceof ZmNotebook){
this._notebookSelect.addOption(n.getSearchPath(),false,n.id);
var a=n.children.getArray();
this.__addNotebookChildren(a,o+"&nbsp;")
}}};
ZmLinkPropsDialog.prototype.notebookChangeListener=function(t){
var o=this._notebookSelect.getValue();
this._pageSelect.clearOptions();
this._pageSelect.setText("Loading...");
var e=this._cache.getPagesInFolder(o);
var i=true;
for(var a in e){
if(a!="_Index"){
this._pageSelect.addOption(a,false,a);
i=false
}}
if(i){
this._pageSelect.setText(ZmMsg.notAvailable);
this._pageSelect.disable()
}else{
this._pageSelect.enable()
}
this.pageChangeListener()
};
ZmLinkPropsDialog.prototype.pageChangeListener=function(t){
var e=this._pageSelect.getValue();
this._pageInput.setValue(e);
ZmLinkPropsDialog._enableFieldsOnEdit(this)
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmSharePropsDialog")){
ZmSharePropsDialog=function(e,t){
t=t||"ZmSharePropsDialog";
DwtDialog.call(this,{
parent:e,className:t,title:ZmMsg.shareProperties}
);
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)||appCtxt.get(ZmSetting.GAL_ENABLED)){
var a={
dataClass:appCtxt.getAutocompleter(),matchValue:ZmAutocomplete.AC_VALUE_EMAIL,compCallback:(new AjxCallback(this,this._handleCompletionData,[this])),keyUpCallback:(new AjxCallback(this,this._acKeyUpListener))};
this._acAddrSelectList=new ZmAutocompleteListView(a)
}
this.setView(this._createView());
this._tabGroupComplete=false
};
ZmSharePropsDialog.prototype=new DwtDialog;
ZmSharePropsDialog.prototype.constructor=ZmSharePropsDialog;
ZmSharePropsDialog.NEW=ZmShare.NEW;
ZmSharePropsDialog.EDIT=ZmShare.EDIT;
ZmSharePropsDialog.prototype._mode=ZmSharePropsDialog.NEW;
ZmSharePropsDialog.prototype.toString=function(){
return"ZmSharePropsDialog"
};
ZmSharePropsDialog.prototype.popup=function(h,o,u){
this._shareMode=h;
this._object=o;
this._share=u;
this._nameEl.innerHTML=AjxStringUtil.htmlEncode(o.name);
this._typeEl.innerHTML=ZmMsg[ZmOrganizer.FOLDER_KEY[this._object.type]]||ZmMsg.folder;
var f=(this._shareMode==ZmSharePropsDialog.NEW);
var t=u?u.isUser()||u.isGroup():true;
var e=u?u.isGuest():false;
var i=u?u.isPublic():false;
var s=o.supportsPublicAccess();
this._userRadioEl.checked=t;
this._userRadioEl.disabled=!f;
this._guestRadioEl.checked=e;
this._guestRadioEl.disabled=!f||!s;
this._publicRadioEl.checked=i;
this._publicRadioEl.disabled=!f||!s;
var l=this._getType(t,e,i);
this._handleShareWith(l);
var r="",d="";
if(u){
if(e){
r=u.grantee.id;
d=u.link.pw
}else{
r=(u.grantee.name||ZmMsg.userUnknown);
d=u.grantee.id
}}
this._granteeInput.setValue(r,true);
this._granteeInput.setEnabled(f);
this._props.setPropertyVisible(this._shareWithOptsId,true);
this._shareWithOptsProps.setPropertyVisible(this._passwordId,true);
this._props.setPropertyVisible(this._shareWithBreakId,true);
this._granteeInput.setValidatorFunction(null,e?DwtInputField.validateEmail:DwtInputField.validateAny);
this._passwordButton.setVisible(!f);
this._shareWithOptsProps.setPropertyVisible(this._passwordId,e);
this._passwordInput.setValue(d,true);
if(this._inheritEl){
this._inheritEl.checked=u?u.link.inh:f
}
if(!this._tabGroupComplete){
this._tabGroup.addMember(this._granteeInput,0);
this._tabGroupComplete=true
}
var a=u&&u.link.perm;
if(a!=null){
a=a.replace(/-./g,"");
this._privateEl.checked=(a.indexOf(ZmShare.PERM_PRIVATE)!=-1);
a=a.replace(/p/g,"");
var n=ZmShare._getRoleFromPerm(a);
var m=this._radioElByRole[n];
if(m){
m.checked=true
}}
this._privatePermissionEnabled=o.supportsPrivatePermission();
this._privatePermission.setVisible(o.supportsPrivatePermission());
if(a==null||(a==this._viewerRadioEl.value)){
this._viewerRadioEl.checked=true
}else{
if(a==this._noneRadioEl.value){
this._noneRadioEl.checked=true
}else{
if(a==this._managerRadioEl.value){
this._managerRadioEl.checked=true
}else{
if(a==this._adminRadioEl.value){
this._adminRadioEl.checked=true
}}}}
this._reply.setReplyType(ZmShareReply.STANDARD);
this._reply.setReplyNote("");
this._populateUrls();
var p=this.getSize();
Dwt.setSize(this._granteeInput.getInputElement(),0.6*p.x);
Dwt.setSize(this._passwordInput.getInputElement(),0.6*p.x);
DwtDialog.prototype.popup.call(this);
this.setButtonEnabled(DwtDialog.OK_BUTTON,false);
if(f){
this._userRadioEl.checked=true;
this._granteeInput.focus()
}
if(appCtxt.multiAccounts){
var c=o.account||appCtxt.accountList.mainAccount;
this._acAddrSelectList.setActiveAccount(c)
}};
ZmSharePropsDialog.prototype._populateUrls=function(){
var r,i;
if(appCtxt.multiAccounts){
r=this._object.getAccount();
i=this._object.getRestUrl(r)
}else{
i=this._object.getRestUrl()
}
if(appCtxt.isOffline){
var o=appCtxt.get(ZmSetting.OFFLINE_REMOTE_SERVER_URI,null,r);
i=o+i.substring((i.indexOf("/",7)))
}
var a=AjxStringUtil.htmlEncode(i).replace(/&amp;/g,"%26");
var s=a;
if(s.length>50){
var n=s.length-50;
var t=(s.length-n)/2;
s=s.substr(0,t)+"..."+s.substr(t+n)
}
var e=this._object.type!=ZmOrganizer.FOLDER;
this._urlGroup.setVisible(e);
if(e){
if(this._object.type==ZmOrganizer.CALENDAR){
this._urlEl.innerHTML=["<div>",ZmMsg.ics,":&nbsp;&nbsp;&nbsp;&nbsp;",'<a target=_new href="',a,'">',s,"</a>","</div>","<div>",ZmMsg.view,":&nbsp;&nbsp;",'<a target=_new href="',a,'.html">',s,".html</a>","</div>"].join("")
}else{
this._urlEl.innerHTML=["<div style='padding-left:2em;'>",'<a target=_new href="',a,'">',s,"</a>","</div>"].join("")
}}};
ZmSharePropsDialog.prototype.popdown=function(){
if(this._acAddrSelectList){
this._acAddrSelectList.reset();
this._acAddrSelectList.show(false)
}
DwtDialog.prototype.popdown.call(this)
};
ZmSharePropsDialog.prototype._getType=function(a,e,t){
if(arguments.length==0){
a=this._userRadioEl.checked;
e=this._guestRadioEl.checked;
t=this._publicRadioEl.checked
}
return(a&&ZmShare.TYPE_USER)||(e&&ZmShare.TYPE_GUEST)||(t&&ZmShare.TYPE_PUBLIC)
};
ZmSharePropsDialog.prototype._handleChangeButton=function(e){
this._passwordButton.setVisible(false);
this._passwordInput.setVisible(true);
this._passwordInput.focus()
};
ZmSharePropsDialog.prototype._handleOkButton=function(g){
var a=this._userRadioEl.checked;
var o=this._guestRadioEl.checked;
var r=this._publicRadioEl.checked;
if(!r){
var m;
if(this._granteeInput.isValid()==null){
m=this._granteeInput.getValue()?AjxMsg.invalidEmailAddr:AjxMsg.valueIsRequired
}
if(!m&&o&&this._passwordInput.isValid()==null){
m=AjxMsg.valueIsRequired
}
if(m){
var w=appCtxt.getErrorDialog();
w.setMessage(m);
w.popup(null,true);
return
}}
var p=[];
if(this._shareMode==ZmSharePropsDialog.NEW){
var s=this._getType(a,o,r);
if(!r){
var l=AjxEmailAddress.split(this._granteeInput.getValue());
if(l&&l.length){
for(var b=0;
b<l.length;
b++){
var h=l[b];
var u=AjxEmailAddress.parse(h);
if(u){
h=u.getAddress()
}
if(appCtxt.isMyAddress(h)){
continue
}
var y=this._setUpShare();
y.grantee.name=h;
y.grantee.type=s;
p.push(y)
}}}else{
var y=this._setUpShare();
y.grantee.type=s;
p.push(y)
}}else{
p.push(this._setUpShare(this._share))
}
var e=appCtxt.multiAccounts?this._object.getAccount().name:null;
var c=new ZmBatchCommand(null,e);
var t=this._getPermsFromRole();
var d=o&&this._passwordInput.getValue();
for(var b=0;
b<p.length;
b++){
var y=p[b];
if(t!=y.link.perm||d!=y.link.pw){
var f=new AjxCallback(y,y.grant,[t,d]);
c.add(f)
}}
if(c.size()>0){
var n=!r?(new AjxCallback(this,this._handleResponseBatchCmd,[p])):null;
c.run(n)
}
this.popdown()
};
ZmSharePropsDialog.prototype._handleResponseBatchCmd=function(l,y){
if(!l||(l&&l.length==0)){
return
}
var u=this._getFaultyEmails(y);
var r=this._reply.getReplyType();
if(r!=ZmShareReply.NONE){
var c=(r==ZmShareReply.QUICK)?this._reply.getReplyNote():"";
var s;
var a;
if(r!=ZmShareReply.COMPOSE&&l.length>1){
var f=appCtxt.multiAccounts?this._object.getAccount().name:null;
a=new ZmBatchCommand(false,f,true)
}
for(var n=0;
n<l.length;
n++){
var g=l[n];
var d=g.grantee.email||g.grantee.id;
if(!d){
if(AjxEmailAddress.isValid(g.grantee.name)){
d=g.grantee.name
}}
if(!d||(d&&u[d])){
continue
}
var h=new AjxVector();
var m=new AjxEmailAddress(d,AjxEmailAddress.TO);
h.add(m);
var o=new ZmShare({
object:g.object}
);
o.grantee.id=g.grantee.id;
o.grantee.email=d;
o.grantee.name=g.grantee.name;
if(o.object.isRemote()){
o.grantor.id=o.object.zid;
o.grantor.email=o.object.owner;
o.grantor.name=o.grantor.email;
o.link.id=o.object.rid;
o.link.name=o.object.oname||o.object.name
}else{
o.grantor.id=appCtxt.get(ZmSetting.USERID,null,this._object.getAccount());
o.grantor.email=appCtxt.get(ZmSetting.USERNAME,null,this._object.getAccount());
o.grantor.name=appCtxt.get(ZmSetting.DISPLAY_NAME,null,this._object.getAccount())||o.grantor.email;
o.link.id=o.object.id;
o.link.name=o.object.name
}
o.link.perm=g.link.perm;
o.link.view=ZmOrganizer.getViewName(o.object.type);
o.link.inh=this._inheritEl?this._inheritEl.checked:true;
if(this._guestRadioEl.checked){
if(!this._guestFormatter){
this._guestFormatter=new AjxMessageFormat(ZmMsg.shareWithGuestNotes)
}
var e=g.object.getRestUrl();
e=e.replace(/&/g,"%26");
if(appCtxt.isOffline){
var t=appCtxt.get(ZmSetting.OFFLINE_REMOTE_SERVER_URI);
e=t+e.substring((e.indexOf("/",7)))
}
var p=this._passwordInput.getValue();
s=this._guestFormatter.format([e,d,p,c])
}
o.notes=s||c;
if(r==ZmShareReply.COMPOSE){
o.composeMessage(this._shareMode,h)
}else{
o.sendMessage(this._shareMode,h,null,a)
}}
if(a){
a.run()
}}};
ZmSharePropsDialog.prototype._getFaultyEmails=function(e){
if(!e){
return
}
var t="no such account: ";
var s={};
var o=e.getResponse().BatchResponse.Fault||[];
for(var a=0;
a<o.length;
a++){
var n=o[a].Reason.Text;
if(n.indexOf(t)==0){
s[n.substring(t.length)]=true
}}
return s
};
ZmSharePropsDialog.prototype._setUpShare=function(e){
if(!e){
e=new ZmShare({
object:this._object}
)
}
e.link.inh=(this._inheritEl&&this._inheritEl.checked);
return e
};
ZmSharePropsDialog.prototype._acKeyUpListener=function(a,t,e){
ZmSharePropsDialog._enableFieldsOnEdit(this)
};
ZmSharePropsDialog._handleKeyUp=function(e){
if(DwtInputField._keyUpHdlr(e)){
return ZmSharePropsDialog._handleEdit(e)
}
return false
};
ZmSharePropsDialog._handleEdit=function(t){
var a=DwtUiEvent.getTarget(t);
var e=Dwt.getObjectFromElement(a);
if(e instanceof DwtInputField){
e=e.getData(Dwt.KEY_OBJECT)
}
if(e!=null){
ZmSharePropsDialog._enableFieldsOnEdit(e)
}
return true
};
ZmSharePropsDialog._enableFieldsOnEdit=function(i){
var n=i._mode==ZmSharePropsDialog.EDIT;
var r=i._userRadioEl.checked;
var o=i._publicRadioEl.checked;
var t=i._guestRadioEl.checked;
i._privatePermission.setVisible(i._privatePermissionEnabled&&!i._noneRadioEl.checked&&!o);
var e=AjxStringUtil.trim(i._granteeInput.getValue())!="";
var s=AjxStringUtil.trim(i._passwordInput.getValue())!="";
var a=n||o||(r&&e)||(t&&e&&s);
i.setButtonEnabled(DwtDialog.OK_BUTTON,a)
};
ZmSharePropsDialog._handleShareWith=function(t){
var a=DwtUiEvent.getTarget(t);
var e=Dwt.getObjectFromElement(a);
e._handleShareWith(a.value);
return ZmSharePropsDialog._handleEdit(t)
};
ZmSharePropsDialog.prototype._handleShareWith=function(t){
var i=t==ZmShare.TYPE_USER;
var e=t==ZmShare.TYPE_GUEST;
var a=t==ZmShare.TYPE_PUBLIC;
this._granteeInput.setValidatorFunction(null,e?DwtInputField.validateEmail:DwtInputField.validateAny);
this._rolesGroup.setVisible(i);
this._messageGroup.setVisible(!a);
this._privatePermission.setVisible(this._privatePermissionEnabled&&!a);
this._props.setPropertyVisible(this._shareWithOptsId,!a);
this._shareWithOptsProps.setPropertyVisible(this._passwordId,e);
this._props.setPropertyVisible(this._shareWithBreakId,!a);
if(!i){
this._viewerRadioEl.checked=true
}};
ZmSharePropsDialog.prototype._getPermsFromRole=function(){
var t=ZmShare.ROLE_NONE;
if(this._viewerRadioEl.checked){
t=ZmShare.ROLE_VIEWER
}
if(this._managerRadioEl.checked){
t=ZmShare.ROLE_MANAGER
}
if(this._adminRadioEl.checked){
t=ZmShare.ROLE_ADMIN
}
var e=ZmShare.ROLE_PERMS[t];
if(e&&this._privatePermissionEnabled&&this._privateEl.checked){
e+=ZmShare.PERM_PRIVATE
}
return e
};
ZmSharePropsDialog.prototype._handleCompletionData=function(i,o,t){
t.value=o;
try{
if(t.fireEvent){
t.fireEvent("onchange")
}else{
if(document.createEvent){
var a=document.createEvent("UIEvents");
a.initUIEvent("change",false,window,1);
t.dispatchEvent(a)
}}}
catch(e){}};
ZmSharePropsDialog.prototype._createView=function(){
var y=new DwtComposite(this);
var s=Dwt.getNextId();
var h=Dwt.getNextId();
var m=Dwt.getNextId();
var f=Dwt.getNextId();
var v=Dwt.getNextId();
var l=Dwt.getNextId();
var k=this._htmlElId+"_shareWith";
var u=this._htmlElId+"_role";
var a=new DwtPropertySheet(this,null,null,DwtPropertySheet.RIGHT);
var r=[{
label:ZmMsg.shareWithUserOrGroup,field:["<input type='radio' name='",k,"' value='",ZmShare.TYPE_USER,"'>"].join("")}
,{
label:ZmMsg.shareWithGuest,field:["<input type='radio' name='",k,"' value='",ZmShare.TYPE_GUEST,"'>"].join("")}
,{
label:ZmMsg.shareWithPublicLong,field:["<input type='radio' name='",k,"' value='",ZmShare.TYPE_PUBLIC,"'>"].join("")}
];
for(var q=0;
q<r.length;
q++){
var d=r[q];
var c=a.addProperty(d.label,d.field)
}
this._granteeInput=new DwtInputField({
parent:this}
);
this._granteeInput.setData(Dwt.KEY_OBJECT,this);
this._granteeInput.setRequired(true);
Dwt.associateElementWithObject(this._granteeInput.getInputElement(),this);
var e=new DwtComposite(this);
this._passwordInput=new DwtInputField({
parent:e}
);
this._passwordInput.setData(Dwt.KEY_OBJECT,this);
this._passwordInput.setRequired(true);
this._passwordButton=new DwtButton({
parent:e}
);
this._passwordButton.setText(ZmMsg.changePassword);
this._passwordButton.addSelectionListener(new AjxListener(this,this._handleChangeButton));
Dwt.associateElementWithObject(this._passwordInput.getInputElement(),this);
this._shareWithOptsProps=new DwtPropertySheet(this);
this._shareWithOptsProps.addProperty(ZmMsg.emailLabel,this._granteeInput);
this._passwordId=this._shareWithOptsProps.addProperty(ZmMsg.passwordLabel,e);
var g=["<table border='0' cellpadding='0' cellpadding='3'>","<tr>","<td>","<input type='checkbox' id='",f,"' checked>","</td>","<td>",ZmMsg.inheritPerms,"</td>","</tr>","</table>"].join("");
this._props=new DwtPropertySheet(y);
this._props.addProperty(ZmMsg.nameLabel,"<span id='"+s+"'></span>");
this._props.addProperty(ZmMsg.typeLabel,"<span id='"+h+"'></span>");
this._props.addProperty(ZmMsg.shareWithLabel,a);
var t=this._props.addProperty(ZmMsg.otherLabel,g);
this._inheritEl=document.getElementById(f);
this._props.setPropertyVisible(t,false);
this._shareWithBreakId=this._props.addProperty("","<HR>");
this._shareWithOptsId=this._props.addProperty("",this._shareWithOptsProps);
var w=0;
var p=[];
p[w++]="<table border=0 cellpadding=0 cellspacing=3>";
var b=[ZmShare.ROLE_NONE,ZmShare.ROLE_VIEWER,ZmShare.ROLE_MANAGER,ZmShare.ROLE_ADMIN];
for(var q=0;
q<b.length;
q++){
var z=b[q];
p[w++]="<tr><td valign=top><input type='radio' name='";
p[w++]=u;
p[w++]="' value='";
p[w++]=z;
p[w++]="'></td><td style='font-weight:bold; padding-right:0.25em'>";
p[w++]=ZmShare.getRoleName(z);
p[w++]="</td><td style='white-space:nowrap'>";
p[w++]=ZmShare.getRoleActions(z);
p[w++]="</td></tr>"
}
p[w++]="</table>";
this._rolesGroup=new DwtGrouper(y);
this._rolesGroup.setLabel(ZmMsg.role);
this._rolesGroup.setContent(p.join(""));
this._privatePermission=new DwtPropertySheet(y);
this._privatePermission._vAlign="middle";
this._privatePermission.addProperty("<input type='checkbox' id='"+l+"'/>",ZmMsg.privatePermission);
this._privateEl=document.getElementById(l);
Dwt.setHandler(this._privateEl,DwtEvent.ONCLICK,ZmSharePropsDialog._handleEdit);
Dwt.associateElementWithObject(this._privateEl,this);
this._reply=new ZmShareReply(y);
this._messageGroup=new DwtGrouper(y);
this._messageGroup.setLabel(ZmMsg.message);
this._messageGroup.setView(this._reply);
var j=["<div>","<div style='margin-bottom:.25em'>",ZmMsg.shareUrlInfo,"</div>","<div style='cursor:text' id='",v,"'></div>","</div>"].join("");
this._urlGroup=new DwtGrouper(y);
this._urlGroup.setLabel(ZmMsg.url);
this._urlGroup.setContent(j);
this._urlGroup._setAllowSelection();
this._nameEl=document.getElementById(s);
this._typeEl=document.getElementById(h);
this._urlEl=document.getElementById(v);
var o=this._granteeInput.getInputElement();
if(this._acAddrSelectList){
this._acAddrSelectList.handle(o)
}else{
Dwt.setHandler(o,DwtEvent.ONKEYUP,ZmSharePropsDialog._handleKeyUp)
}
if(this._inheritEl){
Dwt.setHandler(this._inheritEl,DwtEvent.ONCLICK,ZmSharePropsDialog._handleEdit);
Dwt.associateElementWithObject(this._inheritEl,this)
}
var n=["_userRadioEl","_guestRadioEl","_publicRadioEl"];
var x=document.getElementsByName(k);
for(var q=0;
q<x.length;
q++){
this[n[q]]=x[q];
Dwt.setHandler(x[q],DwtEvent.ONCLICK,ZmSharePropsDialog._handleShareWith);
Dwt.associateElementWithObject(x[q],this)
}
var o=this._passwordInput.getInputElement();
Dwt.setHandler(o,DwtEvent.ONKEYUP,ZmSharePropsDialog._handleEdit);
var n=["_noneRadioEl","_viewerRadioEl","_managerRadioEl","_adminRadioEl"];
var x=document.getElementsByName(u);
var b=[ZmShare.ROLE_NONE,ZmShare.ROLE_VIEWER,ZmShare.ROLE_MANAGER,ZmShare.ROLE_ADMIN];
this._radioElByRole={};
for(var q=0;
q<x.length;
q++){
this[n[q]]=x[q];
this._radioElByRole[b[q]]=x[q];
Dwt.setHandler(x[q],DwtEvent.ONCLICK,ZmSharePropsDialog._handleEdit);
Dwt.associateElementWithObject(x[q],this)
}
return y
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmRevokeShareDialog")){
ZmRevokeShareDialog=function(a,t){
t=t||"ZmRevokeShareDialog";
var o=ZmMsg.revokeShare;
var i=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON];
DwtDialog.call(this,{
parent:a,className:t,title:o,standardButtons:i}
);
this.setButtonListener(DwtDialog.YES_BUTTON,new AjxListener(this,this._handleYesButton));
var e=this._createView();
this.setView(e);
this._formatter=new AjxMessageFormat(ZmMsg.revokeShareConfirm)
};
ZmRevokeShareDialog.prototype=new DwtDialog;
ZmRevokeShareDialog.prototype.constructor=ZmRevokeShareDialog;
ZmRevokeShareDialog.prototype.toString=function(){
return"ZmRevokeShareDialog"
};
ZmRevokeShareDialog.prototype.popup=function(t){
this._share=t;
var e=t.isPublic();
var a=t.grantee&&(t.grantee.type==ZmShare.TYPE_ALL);
var i=e?ZmMsg.shareWithPublic:a?ZmMsg.shareWithAll:(t.grantee.name||ZmMsg.userUnknown);
this._confirmMsgEl.innerHTML=this._formatter.format(i);
this._reply.setReplyType(ZmShareReply.STANDARD);
this._reply.setReplyNote("");
this._reply.setVisible(!e&&!a);
DwtDialog.prototype.popup.call(this);
this.setButtonEnabled(DwtDialog.YES_BUTTON,true)
};
ZmRevokeShareDialog.prototype._handleYesButton=function(){
var e=new AjxCallback(this,this._yesButtonCallback);
this._share.revoke(e)
};
ZmRevokeShareDialog.prototype._yesButtonCallback=function(){
var e=this._share;
var a=this._reply.getReplyType();
var t=!(e.isAll()||e.isPublic()||e.invalid);
if(a!=ZmShareReply.NONE&&t){
e.grantee.email=e.grantee.name||e.grantee.id;
e.grantor.id=appCtxt.get(ZmSetting.USERID);
e.grantor.email=appCtxt.get(ZmSetting.USERNAME);
e.grantor.name=appCtxt.get(ZmSetting.DISPLAY_NAME)||e.grantor.email;
e.link.id=e.object.id;
e.link.name=e.object.name;
e.link.view=ZmOrganizer.getViewName(e.object.type);
e.notes=(a==ZmShareReply.QUICK)?this._reply.getReplyNote():"";
if(a==ZmShareReply.COMPOSE){
e.composeMessage(ZmShare.DELETE)
}else{
e.sendMessage(ZmShare.DELETE)
}}
this.popdown()
};
ZmRevokeShareDialog.prototype._createView=function(){
this._confirmMsgEl=document.createElement("DIV");
this._confirmMsgEl.style.fontWeight="bold";
this._confirmMsgEl.style.marginBottom="0.25em";
var e=new DwtComposite(this);
this._reply=new ZmShareReply(e);
var t=e.getHtmlElement();
t.appendChild(this._confirmMsgEl);
t.appendChild(this._reply.getHtmlElement());
return e
};
ZmRevokeShareDialog.prototype._getSeparatorTemplate=function(){
return""
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmMountFolderDialog")){
ZmMountFolderDialog=function(e,t){
t=t||"ZmMountFolderDialog";
var i=ZmMsg[ZmOrganizer.MOUNT_KEY[ZmOrganizer.FOLDER]];
DwtDialog.call(this,{
parent:e,className:t,title:i}
);
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)||appCtxt.get(ZmSetting.GAL_ENABLED)){
var a={
dataClass:appCtxt.getAutocompleter(),matchValue:ZmAutocomplete.AC_VALUE_EMAIL,compCallback:(new AjxCallback(this,this._handleCompletionData)),keyUpCallback:(new AjxCallback(this,this._acKeyUpListener))};
this._acAddrSelectList=new ZmAutocompleteListView(a)
}
this._createMountHtml()
};
ZmMountFolderDialog.prototype=new DwtDialog;
ZmMountFolderDialog.prototype.constructor=ZmMountFolderDialog;
ZmMountFolderDialog.prototype.popup=function(a,e,t,i){
this._organizerType=a;
this._folderId=e||ZmOrganizer.ID_ROOT;
this.setTitle(ZmMsg[ZmOrganizer.MOUNT_KEY[a]]||ZmMsg[ZmOrganizer.MOUNT_KEY[ZmOrganizer.FOLDER]]);
this._userInput.setValue(t||"");
this._pathInput.setValue(i||"");
this._nameInput.setValue("");
this._nameInputDirty=false;
if(a==ZmOrganizer.FOLDER){
this._colorSelect.getMenu().getItem(0).setEnabled(true);
this._colorSelect.setSelectedValue(0)
}else{
this._colorSelect.getMenu().getItem(0).setEnabled(false);
this._colorSelect.setSelectedValue(1)
}
DwtDialog.prototype.popup.call(this);
this._enableFieldsOnEdit()
};
ZmMountFolderDialog.prototype._acKeyUpListener=function(a,t,e){
this._handleOtherKeyUp(a)
};
ZmMountFolderDialog.prototype._handleCompletionData=function(o,a,e){
a.value=o.replace(/;\s*/g,"");
try{
if(a.fireEvent){
a.fireEvent("onchange")
}else{
if(document.createEvent){
var i=document.createEvent("UIEvents");
i.initUIEvent("change",false,window,1);
a.dispatchEvent(i)
}}}
catch(t){}};
ZmMountFolderDialog.prototype._handleOtherKeyUp=function(a){
var i=this._handleKeyUp(a);
if(!this._nameInputDirty){
var e=this._userInput.getValue();
var o=this._pathInput.getValue();
if(e!=""&&o!=""){
if(!this._nameFormatter){
this._nameFormatter=new AjxMessageFormat(ZmMsg.shareNameDefault)
}
e=e.replace(/@.*/,"");
e=e.substr(0,1).toUpperCase()+e.substr(1);
o=o.replace(/\/$/,"");
o=o.replace(/^.*\//,"");
var t=[e,o];
this._nameInput.setValue(this._nameFormatter.format(t))
}}
return i
};
ZmMountFolderDialog.prototype._handleNameKeyUp=function(e){
this._nameInputDirty=true;
return this._handleKeyUp(e)
};
ZmMountFolderDialog.prototype._handleKeyUp=function(e){
return(DwtInputField._keyUpHdlr(e))?this._enableFieldsOnEdit():false
};
ZmMountFolderDialog.prototype._enableFieldsOnEdit=function(){
var e=this._userInput.getValue();
var i=this._pathInput.getValue();
var a=this._nameInput.getValue();
var t=e.length>0&&e.match(/\S/)&&i.length>0&&i.match(/\S/)&&!i.match(/^\/+$/)&&a.length>0&&a.match(/\S/);
this.setButtonEnabled(DwtDialog.OK_BUTTON,t)
};
ZmMountFolderDialog.prototype._handleOkButton=function(t){
var a={
l:this._folderId,name:this._nameInput.getValue(),owner:this._userInput.getValue(),path:this._pathInput.getValue(),view:(ZmOrganizer.VIEWS[this._organizerType][0]||ZmOrganizer.VIEWS[ZmOrganizer.FOLDER][0]),color:this._colorSelect.getValue()};
if(appCtxt.get(ZmSetting.CALENDAR_ENABLED)&&this._organizerType==ZmOrganizer.CALENDAR){
a.f=ZmOrganizer.FLAG_CHECKED
}
var i=new AjxCallback(this,this.popdown);
var e=new AjxCallback(this,this._handleCreateError);
ZmMountpoint.create(a,i)
};
ZmMountFolderDialog.prototype._createMountHtml=function(){
this._getContentDiv().innerHTML=AjxTemplate.expand("share.Dialogs#ZmMountFolderDialog",{
id:this._htmlElId}
);
var o={
parent:this,required:true};
this._userInput=new DwtInputField(o);
this._userInput.reparentHtmlElement(this._htmlElId+"_email");
this._pathInput=new DwtInputField(o);
this._pathInput.reparentHtmlElement(this._htmlElId+"_path");
this._nameInput=new DwtInputField(o);
this._nameInput.reparentHtmlElement(this._htmlElId+"_name");
this._colorSelect=new DwtSelect({
parent:this}
);
for(var t=0;
t<ZmOrganizer.COLOR_CHOICES.length;
t++){
var e=ZmOrganizer.COLOR_CHOICES[t];
this._colorSelect.addOption(e.label,t==0,e.value)
}
this._colorSelect.reparentHtmlElement(this._htmlElId+"_color");
var a=this._userInput.getInputElement();
a.style.width="25em";
if(this._acAddrSelectList){
this._acAddrSelectList.handle(a)
}else{
a.onkeyup=AjxCallback.simpleClosure(this._handleOtherKeyUp,this)
}
a=this._pathInput.getInputElement();
a.style.width="25em";
a.onkeyup=AjxCallback.simpleClosure(this._handleOtherKeyUp,this);
a=this._nameInput.getInputElement();
a.style.width="25em";
a.onkeyup=AjxCallback.simpleClosure(this._handleNameKeyUp,this)
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmFindnReplaceDialog")){
ZmFindnReplaceDialog=function(t,i){
i=i||"ZmFindnReplaceDialog";
var o=new DwtDialog_ButtonDescriptor(ZmFindnReplaceDialog.FIND_BUTTON,ZmMsg.find,DwtDialog.ALIGN_LEFT);
var s=new DwtDialog_ButtonDescriptor(ZmFindnReplaceDialog.REPLACE_BUTTON,ZmMsg.replace,DwtDialog.ALIGN_LEFT);
var n=new DwtDialog_ButtonDescriptor(ZmFindnReplaceDialog.REPLACE_ALL_BUTTON,ZmMsg.replaceAll,DwtDialog.ALIGN_LEFT);
DwtDialog.call(this,{
parent:t,className:i,title:ZmMsg.findNReplaceTitle,standardButtons:[DwtDialog.CANCEL_BUTTON],extraButtons:[o,s,n]}
);
this._findId=Dwt.getNextId();
this._replaceId=Dwt.getNextId();
this._dirId=Dwt.getNextId();
this._dirIdUp=Dwt.getNextId();
this._dirIdDown=Dwt.getNextId();
this._caseId=Dwt.getNextId();
this._wholeWordId=Dwt.getNextId();
this._messageId=Dwt.getNextId();
var a=1;
var e=["<table><tr><td>","<div style='padding:2px;' id='",this._messageId,"' style='padding-left:30px;'></div>","<table border='0'>","<tr><td class='Label' align='left'>",ZmMsg.findWhatLabel,"</td>","<td colspan=2 id='",this._findId,"'></td></tr>","<tr><td class='Label' align='left'>",ZmMsg.replaceWithLabel,"</td>","<td colspan=2 id='",this._replaceId,"'></td></tr>","<tr><td class='Label' align='left'>",ZmMsg.directionLabel,"</td>","<td colspan=2 id='",this._dirId,"' align='left'>","<table cellpadding='3'><tr>","<td><input type='radio' id='",this._dirIdUp,"' name='",this._dirId,"' value='up'></td>","<td class='Label'>",ZmMsg.upLabel,"</td>","<td><input type='radio' id='",this._dirIdDown,"' name='",this._dirId,"' value='down' checked></td>","<td class='Label'>",ZmMsg.downLabel,"</td>","</tr></table>","</td></tr>","<tr><td colspan='3'>","<table cellpadding='3'><tr>","<td class='Label' align='right'><input type='checkbox' id='",this._caseId,"'>","<td class='Label' align='left'>",ZmMsg.caseSensitive,"</td>","</tr></table>","</td></tr>","</table>","</td></tr></table>"].join("");
this.setContent(e);
this.setView(this._createView());
this.registerCallback(ZmFindnReplaceDialog.FIND_BUTTON,this._handleFindButton,this);
this.registerCallback(ZmFindnReplaceDialog.REPLACE_BUTTON,this._handleReplaceButton,this);
this.registerCallback(ZmFindnReplaceDialog.REPLACE_ALL_BUTTON,this._handleReplaceAllButton,this)
};
ZmFindnReplaceDialog.prototype=new DwtDialog;
ZmFindnReplaceDialog.prototype.constructor=ZmFindnReplaceDialog;
ZmFindnReplaceDialog.FIND_BUTTON=++DwtDialog.LAST_BUTTON;
ZmFindnReplaceDialog.REPLACE_BUTTON=++DwtDialog.LAST_BUTTON;
ZmFindnReplaceDialog.REPLACE_ALL_BUTTON=++DwtDialog.LAST_BUTTON;
ZmFindnReplaceDialog.prototype.popup=function(t,i){
this._editorInfo=t||{};
this._callback=i;
var e="";
if(t){
var a=t.editor;
e=a._getSelectedText();
if(e){
e=AjxStringUtil.trim(e.toString())
}}
this._findInput.setValue(e);
this._replaceInput.setValue("");
DwtDialog.prototype.popup.call(this)
};
ZmFindnReplaceDialog.prototype.popdown=function(){
if(this._acPageList){
this._acPageList.show(false)
}
DwtDialog.prototype.popdown.call(this)
};
ZmFindnReplaceDialog._handleKeyPress=function(i){
var t=DwtControl.getTargetControl(i);
var e=DwtKeyEvent.getCharCode(i);
if(e==13||e==3){
var a=t.parent.parent;
a.replaceAction("none",true);
return false
}
return true
};
ZmFindnReplaceDialog.prototype._createView=function(){
var e=new DwtComposite(this);
var t={
parent:e,type:DwtInputField.STRING,validationStyle:DwtInputField.CONTINUAL_VALIDATION};
this._findInput=new DwtInputField(t);
this._findInput.reparentHtmlElement(this._findId);
this._replaceInput=new DwtInputField(t);
this._replaceInput.reparentHtmlElement(this._replaceId);
Dwt.setHandler(this._findInput.getInputElement(),DwtEvent.ONKEYPRESS,ZmFindnReplaceDialog._handleKeyPress);
return e
};
ZmFindnReplaceDialog.prototype._handleFindButton=function(e){
this.replaceAction("none",true)
};
ZmFindnReplaceDialog.prototype._handleReplaceButton=function(){
this.replaceAction("current",false)
};
ZmFindnReplaceDialog.prototype._handleReplaceAllButton=function(){
this.replaceAction("all",false)
};
ZmFindnReplaceDialog.prototype.showInfoMsg=function(e){
if(!this.msgEl){
this.msgEl=document.getElementById(this._messageId)
}
this.msgEl.innerHTML=e
};
ZmFindnReplaceDialog.prototype.replaceAction=function(r,a){
var i=this._findInput.getValue();
var t=(a?null:this._replaceInput.getValue());
var s=document.getElementById(this._dirIdUp);
var o=false;
var e=false;
if(s&&s.checked){
e=true
}
this._caseCheckbox=document.getElementById(this._caseId);
if(this._caseCheckbox&&this._caseCheckbox.checked){
o=true
}
var n={
searchstring:i,replacestring:t,replacemode:r,casesensitive:o,backwards:e};
if(this._editorInfo.editor){
var h=this._editorInfo.editor;
if(AjxEnv.iIE){
h.focus()
}
h.searchnReplace(n)
}
if(this._callback){
this._callback.run(n)
}}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmFolderNotifyDialog")){
ZmFolderNotifyDialog=function(t,e){
e=e||"ZmFolderNotifyDialog";
var a=[new DwtDialog_ButtonDescriptor(ZmFolderPropsDialog.ADD_SHARE_BUTTON,ZmMsg.addShare,DwtDialog.ALIGN_LEFT)];
DwtDialog.call(this,{
parent:t,className:e,title:ZmMsg.folderNotify,extraButtons:a}
);
this.getButton(DwtDialog.OK_BUTTON).setText(ZmMsg.notify);
this.registerCallback(ZmFolderPropsDialog.ADD_SHARE_BUTTON,this._handleAddShareButton,this);
this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,this._handleCancelButton));
this._folderChangeListener=new AjxListener(this,this._handleFolderChange);
this.setView(this._createView())
};
ZmFolderNotifyDialog.prototype=new DwtDialog;
ZmFolderNotifyDialog.prototype.constructor=ZmFolderNotifyDialog;
ZmFolderNotifyDialog.ADD_SHARE_BUTTON=++DwtDialog.LAST_BUTTON;
ZmFolderNotifyDialog.SHARES_HEIGHT="9em";
ZmFolderNotifyDialog.prototype.toString=function(){
return"ZmFolderNotifyDialog"
};
ZmFolderNotifyDialog.prototype.popup=function(e){
this._organizer=e;
e.addChangeListener(this._folderChangeListener);
this._populateShares(e);
this._reply.setReplyType(ZmShareReply.STANDARD);
this._reply.setReplyNote("");
DwtDialog.prototype.popup.call(this)
};
ZmFolderNotifyDialog.prototype.popdown=function(){
this._organizer.removeChangeListener(this._folderChangeListener);
this._organizer=null;
DwtDialog.prototype.popdown.call(this)
};
ZmFolderNotifyDialog.prototype._handleAddShareButton=function(t){
var e=appCtxt.getSharePropsDialog();
e.popup(ZmSharePropsDialog.NEW,this._organizer,null)
};
ZmFolderNotifyDialog.prototype._handleOkButton=function(e){
var o=this._reply.getReplyType();
var s=o==ZmShareReply.QUICK?this._reply.getReplyNote():"";
var r=this._organizer.shares;
for(var a=0;
a<r.length;
a++){
var c=r[a];
var h=c.grantee.email;
if(!h){
if(AjxEmailAddress.isValid(c.grantee.name)){
h=c.grantee.name
}}
if(!h){
continue
}
var n=new AjxVector();
var l=new AjxEmailAddress(h,AjxEmailAddress.TO);
n.add(l);
var t=new ZmShare({
object:c.object}
);
t.grantee.id=c.grantee.id;
t.grantee.email=h;
t.grantee.name=c.grantee.name;
if(t.object.isRemote()){
t.grantor.id=t.object.zid;
t.grantor.email=t.object.owner;
t.grantor.name=t.grantor.email;
t.link.id=t.object.rid
}else{
t.grantor.id=appCtxt.get(ZmSetting.USERID);
t.grantor.email=appCtxt.get(ZmSetting.USERNAME);
t.grantor.name=appCtxt.get(ZmSetting.DISPLAY_NAME)||t.grantor.email;
t.link.id=t.object.id
}
t.link.perm=c.link.perm;
t.link.name=t.object.name;
t.link.view=ZmOrganizer.getViewName(t.object.type);
t.link.inh=this._inheritEl?this._inheritEl.checked:true;
t.notes=s;
t.sendMessage(ZmShare.NOTIFY,n)
}
this.popdown()
};
ZmFolderNotifyDialog.prototype._handleCancelButton=function(e){
this.popdown()
};
ZmFolderNotifyDialog.prototype._handleFolderChange=function(e){
this._populateShares(this._organizer)
};
ZmFolderNotifyDialog.prototype._populateShares=function(c){
this._sharesGroup.setContent("");
var l=c.link;
var r=c.shares;
var o=((!l||c.isAdmin())&&r&&r.length>0);
if(o){
AjxDispatcher.require("Share");
var m=document.createElement("TABLE");
m.border=0;
m.cellSpacing=0;
m.cellPadding=3;
for(var s=0;
s<r.length;
s++){
var u=r[s];
var f=m.insertRow(-1);
var t=f.insertCell(-1);
t.style.paddingRight="15px";
var h=u.grantee.name||ZmMsg.userUnknown;
if(u.isAll()){
h=ZmMsg.shareWithAll
}else{
if(u.isPublic()){
h=ZmMsg.shareWithPublic
}}
t.innerHTML=AjxStringUtil.htmlEncode(h);
var n=f.insertCell(-1);
n.style.paddingRight="15px";
n.innerHTML=ZmShare.getRoleName(u.link.perm)
}
this._sharesGroup.setElement(m);
var e=Dwt.DEFAULT;
var d=r.length>5?ZmFolderNotifyDialog.SHARES_HEIGHT:Dwt.CLEAR;
var a=this._sharesGroup.getInsetHtmlElement();
Dwt.setScrollStyle(a,Dwt.SCROLL);
Dwt.setSize(a,e,d);
this.getButton(DwtDialog.OK_BUTTON).setEnabled(true)
}else{
this._sharesGroup.setContent("<center>"+ZmMsg.noShareDetailsFound+"</center>");
this.getButton(DwtDialog.OK_BUTTON).setEnabled(false)
}};
ZmFolderNotifyDialog.prototype._createView=function(){
var e=new DwtComposite(this);
this._reply=new ZmShareReply(e,null,[ZmShareReply.STANDARD,ZmShareReply.QUICK]);
this._messageGroup=new DwtGrouper(e);
this._messageGroup.setLabel(ZmMsg.message);
this._messageGroup.setView(this._reply);
e.getHtmlElement().appendChild(this._messageGroup.getHtmlElement());
this._sharesGroup=new DwtGrouper(e);
this._sharesGroup.setLabel(ZmMsg.folderSharing);
this._sharesGroup.setVisible(true);
this._sharesGroup.setScrollStyle(Dwt.SCROLL);
e.getHtmlElement().appendChild(this._sharesGroup.getHtmlElement());
return e
}
}
if(AjxPackage.define("zimbraMail.share.view.dialog.ZmTimezonePicker")){
ZmTimezonePicker=function(t,e){
var a=[ZmTimezonePicker.SAVE_BUTTON];
var i=new DwtDialog_ButtonDescriptor(ZmTimezonePicker.SAVE_BUTTON,ZmMsg.save,DwtDialog.ALIGN_RIGHT);
DwtDialog.call(this,{
parent:t,className:e,title:ZmMsg.selectTimezoneTitle,standardButtons:DwtDialog.NO_BUTTONS,extraButtons:[i]}
);
this.setButtonListener(ZmTimezonePicker.SAVE_BUTTON,new AjxListener(this,this._handleSaveButton));
this.setContent(this._contentHtml());
this._setTimezoneMenu()
};
ZmTimezonePicker.prototype=new DwtDialog;
ZmTimezonePicker.prototype.constructor=ZmTimezonePicker;
ZmTimezonePicker.SAVE_BUTTON=++DwtDialog.LAST_BUTTON;
ZmTimezonePicker.prototype.toString=function(){
return"ZmTimezonePicker"
};
ZmTimezonePicker.prototype.popup=function(){
this._initTzSelect();
this.autoSelectTimezone();
DwtDialog.prototype.popup.call(this)
};
ZmTimezonePicker.prototype.cleanup=function(e){
DwtDialog.prototype.cleanup.call(this,e)
};
ZmTimezonePicker.prototype._setTimezoneMenu=function(){
var e=new AjxListener(this,this._timezoneListener);
this._tzoneSelect=new DwtSelect({
parent:this,parentElement:(this._htmlElId+"_tzSelect"),cascade:false}
);
this._tzoneSelect.addChangeListener(e);
this._tzoneShowAll=new DwtCheckbox({
parent:this,parentElement:(this._htmlElId+"_tzShowAll")}
);
this._tzoneShowAll.setText(ZmMsg.selectTimezoneIShowAll);
this._tzoneShowAll.addSelectionListener(new AjxListener(this,this._handleShowAllChange))
};
ZmTimezonePicker.prototype._initTzSelect=function(n){
var o=this._tzoneShowAll.isSelected();
var t=o?AjxTimezone.getAbbreviatedZoneChoices():AjxTimezone.getMatchingTimezoneChoices();
var s={};
var e;
if(n||t.length!=this._tzCount){
this._tzCount=t.length;
this._tzoneSelect.clearOptions();
for(var a=0;
a<t.length;
a++){
if(t[a].autoDetected){
continue
}
e=t[a].value;
if(!o&&s[e]){
continue
}
s[e]=true;
this._tzoneSelect.addOption(t[a])
}}};
ZmTimezonePicker.prototype.autoSelectTimezone=function(){
if(AjxTimezone.DEFAULT_RULE.autoDetected){
var r=AjxTimezone.DEFAULT_RULE;
var n,l,d;
for(var s in AjxTimezone.MATCHING_RULES){
var c=AjxTimezone.MATCHING_RULES[s];
if(c.autoDetected){
continue
}
if(c.standard.offset==r.standard.offset){
if(!n){
n=c.serverId
}
var t=(r.daylight&&c.daylight&&(c.daylight.offset==r.daylight.offset));
if(t){
if(!l){
l=c.serverId
}
var e=(c.daylight.trans[0]==r.daylight.trans[0]);
var a=(c.daylight.trans[1]==r.daylight.trans[1]);
if(e&&a&&!d){
d=c.serverId
}}}}
var h=d?d:(l||n);
if(h){
this._tzoneSelect.setSelectedValue(h)
}}else{
var o=AjxTimezone.getServerId(AjxTimezone.DEFAULT);
this._tzoneSelect.setSelectedValue(o)
}};
ZmTimezonePicker.prototype.updateTimezone=function(e){
this._tzoneSelect.setSelectedValue(e.timezone)
};
ZmTimezonePicker.prototype.setCallback=function(e){
this._callback=e
};
ZmTimezonePicker.prototype._timezoneListener=function(e){};
ZmTimezonePicker.prototype._handleShowAllChange=function(e){
var t=this._tzoneSelect.getValue();
this._initTzSelect(true);
this._tzoneSelect.setSelectedValue(t)
};
ZmTimezonePicker.prototype._contentHtml=function(){
return AjxTemplate.expand("share.Dialogs#ZmTimezonePicker",{
id:this._htmlElId}
)
};
ZmTimezonePicker.prototype._okButtonListener=function(e){
DwtDialog.prototype._buttonListener.call(this,e,results)
};
ZmTimezonePicker.prototype._enterListener=function(e){};
ZmTimezonePicker.prototype._getTabGroupMembers=function(){
return[this._tzoneSelect]
};
ZmTimezonePicker.prototype._handleSaveButton=function(t){
var e=this._tzoneSelect.getValue();
this.popdown();
if(this._callback){
this._callback.run(e)
}};
ZmTimezonePicker.prototype.handleKeyAction=function(e,t){
switch(e){
case DwtKeyMap.CANCEL:this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
break;
default:DwtDialog.prototype.handleKeyAction.call(this,e,t);
break
}
return true
}
}};
</script><script type="text/javascript" id="WAXScript">var WAX = function() { var _parseCriterias = 0; var _parseCriterias = 0; var _eventTypes = 0; var _minStringLen = 0; var _maxStringLen = 0; var _minElementWidth = 0; var _maxElementWidth = 0; var _minElementHeight = 0; var _maxElementHeight = 0;  var _minStringWidth = 0; var _maxStringWidth = 0; var _minStringHeight = 0; var _maxStringHeight = 0;  var _farTextMaxDeltaX = 0; var _farTextMaxDeltaY = 0;  var _minStringLength = 0; var _maxStringLength = 0;  var _docMinHeight = 0;  var _parseTimeOut = 500; var _timedOut = false; var _hasTimeOut = true;  var _arrInputs = {};  var ParseCriterias = { None: 0, EventObjects: 4, VerifyAttributeByAttachedText: 32, IgnoreImages: 64, IgnoreHiddenInputs: 2048, EnableAjaxSupport: 16384, VerifyDocumentHeight: 32768, InputsOnly: 65536, IgnoreFieldSets: 131072, IgnoreForms: 262144  };  var Event = { None: 0, OnClick: 1, OnSubmit: 2, OnMouseDown: 4, OnMouseUp: 8, HREFJavaScriptMethod: 16,  FormAction: 32, Command: 64, HREFPound: 128, Role: 256 };  var InputType = { Unknown: 0, Text: 1, TextArea: 2, Password:3 , Submit: 4, Image: 5, Button: 6, Checkbox: 7, Radio: 8, Reset: 9, File: 10, Hidden: 11, Select: 12, EventObject: 13 };  var ElementType = { Unknown: 0, Label: 1, TableCell: 2, Header: 3, Table: 4, TableBody: 5, TableRow: 6, Input: 7, TextArea: 8, Button: 9, Image: 10, Select: 11, Link: 12, Container: 13, SelectOption: 14, Generic: 15, Form: 16, Comments: 17, FieldSet: 18 };  function Rect(left, top, right, bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; this.getLeft = function getLeft() { return this.left; }, this.getTop = function getTop() { return this.top; }, this.getRight = function getRight() { return this.right; }, this.getBottom = function getBottom() { return this.bottom; }, this.getRect = function getRect() { return this.left + ',' + this.top + ',' + this.right + ',' + this.bottom; } } return {  getElement: function(index) { if( null == _arrInputs ) { return; }  if( index<0 || index>=_arrInputs.length ) { return null; }  return _arrInputs[index]; },  getLangs: function() { var arrLangs = new Array(); var metaTags = window.document.getElementsByTagName("meta"); var sLang = null;  var oDocElement = window.document.documentElement; if( null != oDocElement ) { var sAttribute = oDocElement.getAttribute("lang"); if( null == sAttribute ) { window.document.documentElement.getAttribute("xml:lang"); }  if( null != sAttribute && !( sAttribute=="en" && 2==sAttribute.length) ) { arrLangs.push(sAttribute); }  }  for( var i=0; i<metaTags.length; i++ ) { var oElement = metaTags[i]; if( null == oElement ) { continue; }  var sAttribute = oElement.getAttribute("http-equiv"); if( null != sAttribute ) { if( "content-language" == sAttribute.toLowerCase() ) { sLang = oElement.getAttribute("content");  } }  if( null == sLang ) { sAttribute = oElement.getAttribute("name"); if( null != sAttribute && "language" == sAttribute.toLowerCase() ) { sLang = oElement.getAttribute("content");  } }  if( null == sLang ) { sAttribute = oElement.getAttribute("lang"); }  if( null != sLang ) { arrLangs.push(sLang.toLowerCase()); sLang = null; } } return arrLangs.join(";"); },  Parse: function(args) { var oDomNode = window.document.body;  _arrInputs = null;   _parseCriterias = args[0]; _eventTypes = args[1];  _minStringLength = args[2]; _maxStringLength = args[3];  _minElementWidth = args[4]; _maxElementWidth = args[5]; _minElementHeight = args[6]; _maxElementHeight = args[7];   _minStringWidth = args[8]; _maxStringWidth = args[9]; _minStringHeight = args[10]; _maxStringHeight = args[11];   _docMinHeight = args[12];  _farTextMaxDeltaX = args[13]; _farTextMaxDeltaY = args[14]; if(16==args.length) { _parseTimeOut = args[15];  } else { _parseTimeOut = 500; _hasTimeOut = false; }  return this.getCandidates(oDomNode); },  getCandidates: function(oElement) {   if( typeof oElement == "undefined" ) { return "E_INVALIDARG"; }   var startTime = new Date().getTime();  var oBoundaries = new Rect(Number.MAX_VALUE, Number.MAX_VALUE, 0, 0);    var arrInputsDesc = new Array(); arrInputsDesc.push(0);   var arrInputs = new Array();  this.collectForms(arrInputsDesc, arrInputs);   if( !this.collectInputs(oElement, oBoundaries, arrInputsDesc, arrInputs) ) { return "E_FAIL";  }   var endTime = new Date().getTime(); if( (endTime-startTime) > (_parseTimeOut*2) ) { _timedOut = true; }   var arrLabels = new Array(); arrLabels.push(0); if( !_timedOut ) { this.collectNonInputs(oElement, oBoundaries, arrInputsDesc, arrLabels, arrInputs); if( _timedOut ) { arrLabels = new Array(); arrLabels.push(0); } }    arrInputsDesc[0] = (arrInputsDesc.length-1)/2;  var sDescription = arrInputsDesc.join("#!#");  sDescription = arrInputsDesc[1] = sDescription.length + "#!#" + sDescription;   arrLabels[0] = (arrLabels.length-1)/2;  if( 1==arrLabels.length ) { arrLabels.push("0"); }  _arrInputs = arrInputs; sLabels = arrLabels.join("#!#");  sLabels = arrLabels[1] = sLabels.length + "#!#" + sLabels;  var sAll = sDescription+sLabels;  return ( ((_timedOut && _hasTimeOut) ? "E_TIMEDOUT" : "") + sAll.length.toString() + "#!#" + sAll);  },  collectForms: function(arrInputsDesc, arrInputs) { if( _parseCriterias&ParseCriterias.IgnoreForms ) { return false; }  if( typeof arrInputsDesc == "undefined" || typeof arrInputs == "undefined" ) { return false; }  if( Array != arrInputsDesc.constructor || Array != arrInputs.constructor) { return false;  }   var oForms = window.document.forms;  var elementType = {}; var inputType = {};    var length = oForms.length; for( var i=0; i<length; ++i ) { var oForm = oForms[i];  elementType.value = ElementType.Form; inputType.value = InputType.Unknown;  var oRect = oForm.getBoundingClientRect(); var sInputDesc = this.processInput(oForm, oRect, elementType, inputType);   if( null != sInputDesc ) { arrInputs.push(oForm); arrInputsDesc.push(sInputDesc.length); arrInputsDesc.push(sInputDesc);  }   this.collectFieldSets(oForm, arrInputsDesc, arrInputs); } }, collectFieldSets: function(oElement, arrInputsDesc, arrInputs) { if( _parseCriterias&ParseCriterias.IgnoreFieldSets || _parseCriterias&ParseCriterias.IgnoreForms ) { return true; }  if( typeof oElement == "undefined" || typeof arrInputsDesc == "undefined" || typeof arrInputs == "undefined" ) { return false; }  if( Array != arrInputsDesc.constructor || Array != arrInputs.constructor) { return false;  }  var usingFieldSets = !(ParseCriterias.IgnoreFieldSets==(_parseCriterias&ParseCriterias.IgnoreFieldSets));  var elementType = {}; var inputType = {};   elementType.value = ElementType.FieldSet; inputType.value = InputType.Unknown;   var oFieldSets = oElement.getElementsByTagName("fieldset"); var length = oFieldSets.length; for( var f=0; f<length; ++f ) {  var oFieldSet = oFieldSets[f]; oRect = oFieldSet.getBoundingClientRect(); sInputDesc = this.processInput(oFieldSet, oRect, elementType, inputType); if( null != sInputDesc ) { arrInputs.push(oFieldSet); arrInputsDesc.push(sInputDesc.length); arrInputsDesc.push(sInputDesc);  } }  return true; },  collectInputs: function(oElement, oBoundaries, arrInputsDesc, arrInputs) { if( typeof oElement == "undefined" || typeof oBoundaries == "undefined" ||  typeof arrInputsDesc == "undefined" || typeof arrInputs == "undefined" ) { return false; }  if( Rect != oBoundaries.constructor || Array != arrInputsDesc.constructor || Array != arrInputs.constructor) { return false;  } var maxCombinedParseTime = _parseTimeOut*2; var startTime = new Date().getTime();  var arrElements = oElement.getElementsByTagName("INPUT"); if( typeof arrElements != "undefined" && 0 == arrElements.length ) { arrElements = oElement.getElementsByTagName("input"); } this.processInputs(arrElements, oBoundaries, arrInputsDesc, arrInputs); if( !_timedOut ) { arrElements = oElement.getElementsByTagName("BUTTON"); if( typeof arrElements != "undefined" && 0 == arrElements.length ) { arrElements = oElement.getElementsByTagName("button"); } this.processInputs(arrElements, oBoundaries, arrInputsDesc, arrInputs); } if( !_timedOut ) { arrElements = oElement.getElementsByTagName("SELECT"); if( typeof arrElements != "undefined" && 0 == arrElements.length ) { arrElements = oElement.getElementsByTagName("select"); } this.processInputs(arrElements, oBoundaries, arrInputsDesc, arrInputs); }  var endTime = new Date().getTime(); if( (endTime-startTime) > maxCombinedParseTime ) { _timedOut = true; }  if( !_timedOut && !(_parseCriterias&ParseCriterias.IgnoreImages) && !(_parseCriterias&ParseCriterias.InputsOnly) ) {   this.processInputs(oElement.getElementsByTagName("IMG"), null, arrInputsDesc, arrInputs);  }   var endTime = new Date().getTime(); if( (endTime-startTime) > maxCombinedParseTime ) { _timedOut = true; } var endTime = new Date().getTime(); if( (endTime-startTime) > maxCombinedParseTime ) { _timedOut = true; }  return true; }, collectNonInputs: function(oParent, oBoundaries, arrInputsDesc, arrLabels, arrInputs) { if( typeof oParent == "undefined" || typeof oBoundaries == "undefined" ||  typeof arrInputsDesc == "undefined" || typeof arrLabels == "undefined" || typeof arrInputs == "undefined" ) { return false; }  if( Rect != oBoundaries.constructor || Array != arrInputsDesc.constructor ||  Array != arrLabels.constructor || Array != arrInputs.constructor ) { return false;  }  var matchUsingAttachedText = true; var usingEventObjects = (ParseCriterias.EventObjects==(_parseCriterias&ParseCriterias.EventObjects) ); var verifyAttributeByAttachedText = ( ParseCriterias.VerifyAttributeByAttachedText==(_parseCriterias&ParseCriterias.VerifyAttributeByAttachedText) ); var enableAjaxSupport = ( ParseCriterias.EnableAjaxSupport==(_parseCriterias&ParseCriterias.EnableAjaxSupport) );  if( !matchUsingAttachedText && !usingEventObjects && !verifyAttributeByAttachedText ) { return true; } var eventTypes = (usingEventObjects ? _eventTypes : 0); var oRectElement = new Rect(0, 0, 0, 0);  var isFormCollection = false; var oItems = oParent.getElementsByTagName("*"); if( typeof oItems == "undefined" || 0==oItems.length ) { oItems = oParent.all; if( typeof oItems == "undefined" || 0==oItems.length ) { return false; } }  var elementType = {}; var inputType = {};   var startTime = new Date().getTime(); var i = 0; for( i=0; i<oItems.length; ++i ) {  if( !(i%150) ) { var endTime = new Date().getTime(); if( (endTime - startTime)>_parseTimeOut ) { _timedOut = true; break; } } var oElement = oItems[i]; if( typeof oElement == "undefined" ) { continue; }  elementType.value = ElementType.Unknown; inputType.value = InputType.Unknown;  if( !this.getElementType(oElement, elementType, inputType) && ElementType.Unknown != elementType.value ) { continue; }   if( ElementType.Input==inputType.value || ElementType.Select==elementType.value ||  ElementType.Button==inputType.value || ElementType.Image==elementType.value || ElementType.SelectOption==elementType.value || ElementType.Form==elementType.value || InputType.File==inputType.value || InputType.Submit==inputType.value ) { continue; }  var oRect = oElement.getBoundingClientRect();  if( InputType.Unknown == inputType.value && usingEventObjects ) { if( 0!=eventTypes && this.hasEventHandler(eventTypes, oElement) ) { inputType.value = InputType.EventObject; } }  if( InputType.Unknown != inputType.value ) { var width = oRect.right - oRect.left; var height = oRect.bottom - oRect.top; var outOfBounds = ( width<_minElementWidth || width>_maxElementWidth ||  height<_minElementHeight || height>_maxElementHeight ); if( outOfBounds ) {  if( _parseCriterias&ParseCriterias.IgnoreHiddenInputs ) { continue; }  if( 0!=width && 0!=height ) { continue; } }  if( InputType.TextArea == inputType.value || InputType.EventObject == inputType.value )  { var sInputDesc = this.processInput(oElement, oRect, elementType, inputType);  if( null != sInputDesc ) { if( null != oBoundaries ) {  this.expandRect(oRect, oBoundaries); }  arrInputs.push(oElement); arrInputsDesc.push(sInputDesc.length); arrInputsDesc.push(sInputDesc);  }  } } else if( matchUsingAttachedText || verifyAttributeByAttachedText ) {  var ptX = ((oRect.right-oRect.left)/2)+oRect.left; var ptY = ((oRect.bottom-oRect.top)/2)+oRect.top;  if( !(ptX>=oBoundaries.left && ptX<=oBoundaries.right && ptY>=oBoundaries.top && ptY<=oBoundaries.bottom) ) { continue; }  var sText = this.getElementText(oElement, oRect); if( null == sText ) { var oFirstChild = oElement.firstChild; if( null != oFirstChild ) { sText = this.getElementText(oFirstChild, oRect);  } }  if( null != sText ) {  sText = sText.trim(); var length = sText.length;  var sLabel = ""; if( length>0 ) { sLabel = "{" + elementType.value + ",0},{" + oRect.left + "," + oRect.top + "," + oRect.right + "," + oRect.bottom + "}"; sLabel+= "#!#" + length + "#!#" + sText;  } else { sLabel = "{" + elementType.value + ",0},{" + oRect.left + "," + oRect.top + "," + oRect.right + "," + oRect.bottom + "}"; sLabel+= "#!#0";  }  arrLabels.push(sLabel.length);  arrLabels.push(sLabel);  }  }  } return true; }, processInputs : function(oInputs, oBoundaries, arrInputsDesc, arrInputs) {   if( typeof oInputs == "undefined" || typeof arrInputsDesc == "undefined" || typeof arrInputsDesc == "arrInputs" ) { return false; }   if( ( oBoundaries!=null && Rect != oBoundaries.constructor ) || Array != arrInputsDesc.constructor || Array != arrInputs.constructor ) { return false;  }  var length = oInputs.length; if( 0 == length ) { return true; }  var ignoreHiddenInputs = (ParseCriterias.IgnoreHiddenInputs==(_parseCriterias&ParseCriterias.IgnoreHiddenInputs));  var startTime = new Date().getTime(); var i = 0; for (i = 0; i<length; ++i) {  if( !(i%150) ) { var endTime = new Date().getTime(); if( (endTime - startTime)>_parseTimeOut ) { _timedOut = true; break; } } var oElement = oInputs[i]; var oRect = oElement.getBoundingClientRect();  if( !this.IsValidElement(oElement, oRect, ignoreHiddenInputs) ) {  continue; }  var elementType = {}; var inputType = {}; if( !this.getElementType(oElement, elementType, inputType) || InputType.Checkbox == inputType.value || ElementType.SelectOption == elementType.value ) {  continue; }  var sInputDesc = this.processInput(oElement, oRect, elementType, inputType);  if( null != sInputDesc ) { if( null != oBoundaries ) {  this.expandRect(oRect, oBoundaries); }   arrInputs.push(oElement);  arrInputsDesc.push(sInputDesc.length); arrInputsDesc.push(sInputDesc); } }  return true; }, getElementText: function(oElement, oRect) {  if( typeof oElement == "undefined" || typeof oRect == "undefined" ) { return null; }  if( ClientRect != oRect.constructor ) { return null; }  var width = oRect.right-oRect.left; var height = oRect.bottom-oRect.top;  if( width<_minStringWidth || width>_maxStringWidth ||  height<_minStringHeight || height>_maxStringHeight ) { return null; }  var innerText = oElement.innerText; if( null == innerText ) { return null; }  innerText = innerText.trim();  var length = innerText.length; if( length<_minStringLength || length>_maxStringLength ) { return null; }  return innerText;  }, processInput: function(oElement, oRect, elementType, inputType) {  if( typeof oElement == "undefined" || typeof oRect == "undefined" ) { return null; }  if( ClientRect != oRect.constructor ) { return null; }  var ajaxSupport = ( ParseCriterias.EnableAjaxSupport==(_parseCriterias&ParseCriterias.EnableAjaxSupport) );  var isImage = ( ParseCriterias.IgnoreImages==(_parseCriterias&ParseCriterias.IgnoreImages) ); var outerHTML = null;  if( ElementType.Form!=elementType.value && ElementType.FieldSet!=elementType.value ) { outerHTML = oElement.outerHTML; } else if (InputType.Select == inputType.value) {  outerHTML = "<select";  var oAttributes = oElement.attributes; if( null != oAttributes ) {  var length = oAttributes.length;  for( i=0; i<length; ++i ) { var oAttrPair = oAttributes[i]; if( typeof oAttrPair == "undefined" ) { continue; }  outerHTML+= " " + oAttrPair.name + "=\"" + oAttrPair.value + "\""; }  }  outerHTML += "></select>"; }  if( null == outerHTML && (InputType.EventObject==inputType.value || isImage) ) { return null; }  var innerText = "";  if( ElementType.Button==elementType.value ) { innerText = oElement.innerText; if( null == innerText ) { innerText = oElement.getAttribute("value"); } }  else if( InputType.Select==inputType.value ) { var arrOptions = new Array(); var length = 0;   var items = oElement.options; if( typeof items != "undefined" ) { length = items.length;  var i = 0; for( i=0; i<length; ++i ) { innerText = items[i].innerText; if( null == innerText || 0 == innerText.length ) { arrOptions.push("<!>#<!>"); } else { innerText = innerText.trim(); arrOptions.push(innerText);  } }   if( arrOptions.length >0 ) { var sOptions = "\"" + arrOptions.join("\":\"") + "\"";  sOptions.replace("<!>#<!>", " ");  innerText = arrOptions.length + "#!#" + sOptions; } }  if( 0==length ) { innerText = "0#!#"; }  }  else if( InputType.Submit==inputType.value ) { innerText = oElement.getAttribute("value"); if( null == innerText ) { innerText = oElement.innerText; } } else if( InputType.EventObject==inputType.value ) { var oFirstChild = oElement.firstChild; if( null != oFirstChild ) { innerText = oFirstChild.innerText; } if( null == innerText || 0 == innerText.length ) { innerText = oElement.innerText; }  if( null != innerText ) { innerText = innerText.trim(); } } else if( ElementType.Link == elementType.value ) { innerText = oElement.innerText; } else if( InputType.Radio == inputType.value && (null == innerText || 0 == innerText.length) ) { var oNextSibling = oElement.nextSibling; if( null != oNextSibling ) { innerText = oNextSibling.innerText; } }  var arrDesc = this.getInputDescription(oElement, oRect, elementType, inputType); if( null == arrDesc ) { return null; }  if( null == innerText ) { arrDesc.push("0"); } else {  innerText = innerText.trim(); var length = innerText.length; if( 0==length ) { arrDesc.push("0"); }  else { arrDesc.push(innerText.length); arrDesc.push(innerText);  }  }  if( null == outerHTML ) { arrDesc.push("0"); } else {  var length = outerHTML.length; if( 0==length ) { arrDesc.push("0"); }  else {  arrDesc.push(outerHTML.length); arrDesc.push(outerHTML);  }  }  return arrDesc.join("#!#"); },  getInputDescription: function(oElement, oRect, elementType, inputType) {  if( typeof oElement == "undefined" || typeof oRect == "undefined" ) { return null; } if( ClientRect != oRect.constructor ) { return null; }  var arrItems = new Array(); arrItems.push("{" + elementType.value + "," + inputType.value + "},{" + oRect.left + "," + oRect.top + "," + oRect.right + "," + oRect.bottom + "}");  var oAttributes = oElement.attributes; if( null==oAttributes ) { arrItems.push("0"); } else { var length = oAttributes.length;  arrItems.push(length); if( length > 0 ) {  var sAttrs = ""; var i = 0; for (i = 0; i < length; ++i) { var oAttrPair = oAttributes[i]; if (typeof oAttrPair == "undefined") { continue; } var sValue = oAttrPair.value; var sValueLen = sValue.length; if (0 == sValueLen) { continue; }   if (sValueLen > 128) { sValue = sValue.substring(sValueLen - 128); } if ("id" == oAttrPair.name) { if (sAttrs.length > 0) { var sTemp = "\"" + oAttrPair.name + "\":\"" + sValue + "\"," + sAttrs; sAttrs = sTemp; } else { sAttrs = "\"" + oAttrPair.name + "\":\"" + sValue + "\""; } continue; } if (sAttrs.length > 0) { sAttrs += ",\""; } else { sAttrs += "\""; } sAttrs += oAttrPair.name + "\":\"" + sValue + "\""; }  arrItems.push(sAttrs.length); arrItems.push(sAttrs); } } return arrItems; },  expandRect: function(oElementRect, oBoundaries) {  if( null == oBoundaries ) { return true; }  if( typeof oElementRect == "undefined" || typeof oBoundaries == "undefined" ) { return false; }   if( ClientRect != oElementRect.constructor || Rect != oBoundaries.constructor ) { return false;  } if( oElementRect.left<oBoundaries.left ) { oBoundaries.left = ( (oElementRect.left-_farTextMaxDeltaX>0) ? oElementRect.left-_farTextMaxDeltaX : 0);  } if( oElementRect.top<oBoundaries.top ) { oBoundaries.top = ( (oElementRect.top-_farTextMaxDeltaY>0) ? oElementRect.top-_farTextMaxDeltaY : 0);  } if( oElementRect.right>oBoundaries.right ) { oBoundaries.right = oElementRect.right+_farTextMaxDeltaX; } if( oElementRect.bottom>oBoundaries.bottom ) { oBoundaries.bottom = oElementRect.bottom+_farTextMaxDeltaY; }  return true;  }, getElementType: function(oElement, elementType, inputType) {  elementType.value = ElementType.Unknown; inputType.value = InputType.Unknown;   if( typeof oElement == "undefined" ) { return false; }  var isInputType = false;  var nodeName = oElement.nodeName.toUpperCase(); var length = nodeName.length;  if( 1==length ) { if( nodeName == "A" ) { elementType.value = ElementType.Link; } else if( nodeName == "B" ) { elementType.value = ElementType.Label;  }  }  else if( 2==length ) {  if( nodeName == "TD" || nodeName == "TH" ) { elementType.value = ElementType.TableCell; } if ( nodeName == "TR" ) { elementType.value = ElementType.TableRow; } if ( nodeName == "EM" ) { elementType.value = ElementType.Header; } else if( nodeName == "H1" || nodeName == "H2" || nodeName == "H3" ||  nodeName == "H4" || nodeName == "H5" || nodeName == "H6" ) { elementType.value = ElementType.Header; } } else if( 3==length ) { if ( nodeName == "DIV" ) { elementType.value = ElementType.Container; } else if( nodeName == "IMG" ) { elementType.value = ElementType.Image; isInputType = true; }  } else if( 4==length ) { if ( nodeName == "SPAN" ) { elementType.value = ElementType.Container; } else if ( nodeName == "FORM" ) { inputType.value = InputType.Unknown; elementType.value = ElementType.Form; }   } else if( 5==length ) {  if( nodeName == "INPUT" ) { elementType.value = ElementType.Input; isInputType = true; } else if( nodeName == "LABEL" ) { elementType.value = ElementType.Label; } } else if( 6==length ) { if( nodeName == "OPTION" ) { elementType.value = ElementType.SelectOption; } else if( nodeName == "SELECT" ) { elementType.value = ElementType.Select; inputType.value = InputType.Select; } else if( nodeName == "BUTTON" ) { elementType.value = ElementType.Button; this.getElementInputType(oElement, inputType); if( InputType.Submit != inputType.value ) { inputType.value = InputType.Button; } } else if( nodeName == "STRONG" ) { elementType.value = ElementType.Header; }  } else if( 8==length ) { if( nodeName == "TEXTAREA" ) { elementType.value = ElementType.TextArea; inputType.value = InputType.TextArea; } else if( nodeName == "FIELDSET" ) { inputType.value = InputType.Unknown; elementType.value = ElementType.FieldSet;  }  }  if( ElementType.Unknown == elementType.value ) { elementType.value = ElementType.Generic; }  if( true == isInputType ) { this.getElementInputType(oElement, inputType); if( ElementType.Image==elementType.value && InputType.Submit!=inputType.value ) { inputType.value = InputType.Image; } }  return true; },  getElementInputType: function(oElement, inputType) { inputType.value = InputType.Unknown; if( typeof oElement == "undefined" ) { return false; }  var sType = oElement.getAttribute("type"); if( null == sType || 0 == sType.length ) { inputType.value = InputType.Text; return true;  }  inputType.value = InputType.Text; sType = sType.toUpperCase();  if( sType == "PASSWORD" ) { inputType.value = InputType.Password; } else if( sType == "SUBMIT" ) { inputType.value = InputType.Submit; } else if( sType == "IMAGE" ) { inputType.value = InputType.Image; } else if( sType == "BUTTON" ) { inputType.value = InputType.Button; } else if( sType == "CHECKBOX" ) { inputType.value = InputType.Checkbox; } else if( sType == "RADIO" ) { inputType.value = InputType.Radio; } else if( sType == "RESET" ) { inputType.value = InputType.Reset; } else if( sType == "FILE" ) { inputType.value = InputType.File; } else if( sType == "HIDDEN" ) { inputType.value = InputType.Hidden; } else {  inputType.value = InputType.Text; }   return true;  },  IsValidElement: function(oElement, oRect, bIgnoreHiddenInputs) {  if( typeof oElement == "undefined" || typeof oRect == "undefined" || ClientRect != oRect.constructor ) { return false; }  var nWidth = oRect.right - oRect.left; var nHeight = oRect.bottom - oRect.top;  if( 0 == nWidth && 0 == nHeight ) { return (bIgnoreHiddenInputs?false:true);  }  if( nWidth<_minElementWidth || nWidth>_maxElementWidth || nHeight<_minElementHeight || nHeight>_maxElementHeight ) { return false; }  var valid = true; try { var sType = oElement.getAttribute("type"); if( null != sType ) { if( sType == "hidden" ) { valid = false; } } } catch(err) {}   return valid; },  hasEventHandler: function(eventType, oElement) {  if( 0 == eventType || typeof oElement == "undefined") { return false; }  if( eventType&Event.OnClick ) { if( null != oElement.getAttribute("onclick") ) { return true; } }  if( eventType&Event.OnSubmit ) { if( null != oElement.getAttribute("onsubmit") ) { return true; } }  if( eventType&Event.OnMouseDown ) { if( null != oElement.getAttribute("onmousedown") ) { return true; } }  if( eventType&Event.OnMouseUp ) { if( null != oElement.getAttribute("onmouseup") ) { return true; } }  if( eventType&Event.HREFJavaScriptMethod || eventType&Event.HREFPound ) { var handler = oElement.getAttribute("href");  if( null != handler ) { handler = handler.toLowerCase(); if( 0 == handler.indexOf("javascript") ) { return true; }  if( 0 == handler.indexOf("#") ) { return true; }  } }  if( eventType&Event.Command ) { if( null != oElement.getAttribute("command") ) { return true; } }  if( eventType&Event.FormAction ) { if( null != oElement.getAttribute("formaction") ) { return true; } } if( eventType&Event.Role ) { var handler = oElement.getAttribute("role");  if( null != handler ) { handler = handler.toLowerCase(); if( 0 == handler.indexOf("button") ) { return true; } } }  return false; } };} ();function waxGetLangs() { return WAX.getLangs();}function waxGetElement(index) { if( null == index ) { return; }  return WAX.getElement(index);}function waxGetCandidates(args) { if (Array != args.constructor || ( 15!=args.length && 16!=args.length) ) { return "E_INVALIDARG"; }  return WAX.Parse(args);}</script><script>
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Alert")){
if(AjxPackage.define("ajax.util.AjxPluginDetector")){
AjxPluginDetector=function(){};
AjxPluginDetector.canDetectPlugins=function(){
return AjxEnv.isIE||(navigator.plugins&&navigator.plugins.length>0)
};
AjxPluginDetector.detectFlash=function(){
if(AjxEnv.isIE){
return AjxPluginDetector.detectActiveXControl("ShockwaveFlash.ShockwaveFlash.1")
}else{
return AjxPluginDetector.detectPlugin("Shockwave","Flash")
}};
AjxPluginDetector.detectDirector=function(){
if(AjxEnv.isIE){
return AjxPluginDetector.detectActiveXControl("SWCtl.SWCtl.1")
}else{
return AjxPluginDetector.detectPlugin("Shockwave","Director")
}};
AjxPluginDetector.detectQuickTime=function(){
if(AjxEnv.isIE){
return AjxPluginDetector.detectQuickTimeActiveXControl()
}else{
return AjxPluginDetector.detectPlugin("QuickTime")
}};
AjxPluginDetector.getQuickTimeVersion=function(){
if(AjxEnv.isIE){
var n=new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck.1");
if(n.IsQuickTimeAvailable(0)){
try{
var a=Number(n.QuickTimeVersion).toString(16);
var t=[];
for(var s=0;
s<3;
s++){
t[s]=Number(a.charAt(s))
}
return t
}
catch(r){}}
return null
}else{
var o=AjxPluginDetector.matchPluginName(/QuickTime Plug-in (\d+)\.?(\d+)?\.?(\d+)?/);
if(o){
var t=[];
for(var s=0;
s<3;
s++){
t[s]=Number(o[s+1]||0)
}
return t
}else{
return null
}}};
AjxPluginDetector.detectReal=function(){
if(AjxEnv.isIE){
return AjxPluginDetector.detectActiveXControl("rmocx.RealPlayer G2 Control")||AjxPluginDetector.detectActiveXControl("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")||AjxPluginDetector.detectActiveXControl("RealVideo.RealVideo(tm) ActiveX Control (32-bit)")
}else{
return AjxPluginDetector.detectPlugin("RealPlayer")
}};
AjxPluginDetector.detectWindowsMedia=function(){
if(AjxEnv.isIE){
return AjxPluginDetector.detectActiveXControl("MediaPlayer.MediaPlayer.1")
}else{
return AjxPluginDetector.detectPlugin("Windows Media")
}};
AjxPluginDetector.detectPlugin=function(){
var o=AjxPluginDetector.detectPlugin.arguments;
var i=navigator.plugins;
var t=i.length;
for(var a=0;
a<t;
a++){
var n=0;
for(var e=0;
e<o.length;
e++){
if(i[a]){
if((i[a].name.indexOf(o[e])>=0)){
n++
}else{
if(i[a].description.indexOf(o[e])>=0){
n++
}}}}
if(n==o.length){
return true
}else{
if(n){}}}
return false
};
AjxPluginDetector.matchPluginName=function(t){
var o=navigator.plugins;
var a=o.length;
for(var i=0;
i<a;
i++){
var e=o[i].name.match(t);
if(e){
return e
}}
return null
};
AjxPluginDetector.detectActiveXControl=function(t){
try{
new ActiveXObject(t);
return true
}
catch(a){
return false
}};
AjxPluginDetector.detectQuickTimeActiveXControl=function(a){
try{
var t=new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck.1");
return t.IsQuickTimeAvailable(0)
}
catch(i){
return false
}};
AjxPluginDetector._argumentsToString=function(e){
var o=[];
for(var t=0,a=e.length;
t<a;
t++){
o[t]=e[t]
}
return o.join(",")
}
}
if(AjxPackage.define("zimbraMail.share.view.ZmAlert")){
ZmAlert=function(){
this._isLooping=false
};
ZmAlert.prototype.start=null;
ZmAlert.prototype.stop=null;
ZmAlert.prototype._update=null;
ZmAlert.prototype._startLoop=function(){
if(!ZmAlertLoop.INSTANCE){
ZmAlertLoop.INSTANCE=new ZmAlertLoop()
}
ZmAlertLoop.INSTANCE._add(this);
this._isLooping=true
};
ZmAlert.prototype._stopLoop=function(){
if(ZmAlertLoop.INSTANCE){
ZmAlertLoop.INSTANCE._remove(this)
}
this._isLooping=false;
this._update(false)
};
ZmAlertLoop=function(){
this._alerts=new AjxVector();
this._flashOn=false;
if(appCtxt.multiAccounts){
appCtxt.accountList.addActiveAcountListener(new AjxListener(this,this._accountChangeListener),0)
}};
ZmAlertLoop.prototype._add=function(e){
this._alerts.add(e,0,true);
if(!this._alertInterval){
this._alertInterval=setInterval(AjxCallback.simpleClosure(this._alertTimerCallback,this),1500)
}};
ZmAlertLoop.prototype._remove=function(e){
this._alerts.remove(e);
if(this._alertInterval&&!this._alerts.size()){
clearInterval(this._alertInterval);
this._alertInterval=0
}};
ZmAlertLoop.prototype._alertTimerCallback=function(){
this._flashOn=!this._flashOn;
for(var e=0,t=this._alerts.size();
e<t;
e++){
this._alerts.get(e)._update(this._flashOn)
}};
ZmAlertLoop.prototype._accountChangeListener=function(){
var t=this._alerts.getArray();
var e;
while(e=t.unshift()){
e.stop()
}}
}
if(AjxPackage.define("zimbraMail.share.view.ZmAccountAlert")){
ZmAccountAlert=function(e){
ZmAlert.call(this);
this.account=e;
this._alertApps={};
appCtxt.accountList.addActiveAcountListener(new AjxListener(this,this._accountListener))
};
ZmAccountAlert.prototype=new ZmAlert;
ZmAccountAlert.prototype.constructor=ZmAccountAlert;
ZmAccountAlert.prototype.toString=function(){
return"ZmAccountAlert"
};
ZmAccountAlert.get=function(e){
ZmAccountAlert.INSTANCES=ZmAccountAlert.INSTANCES||{};
if(!ZmAccountAlert.INSTANCES[e.id]){
ZmAccountAlert.INSTANCES[e.id]=new ZmAccountAlert(e)
}
return ZmAccountAlert.INSTANCES[e.id]
};
ZmAccountAlert.prototype.start=function(e){
if(this.account!=appCtxt.getActiveAccount()){
this._started=true;
if(e){
this._alertApps[e.getName()]=e
}}};
ZmAccountAlert.prototype.stop=function(){
this._started=false
};
ZmAccountAlert.prototype._accountListener=function(t){
if(t.account==this.account){
this.stop();
for(var e in this._alertApps){
this._alertApps[e].startAlert()
}
this._alertApps={}
}}
}
if(AjxPackage.define("zimbraMail.share.view.ZmAppAlert")){
ZmAppAlert=function(e){
this.app=e
};
ZmAppAlert.prototype.toString=function(){
return"ZmAppAlert"
};
ZmAppAlert.prototype.start=function(){
if(!this.app.isActive()){
this._getAppButton().showAlert(true)
}};
ZmAppAlert.prototype.stop=function(){
this._getAppButton().showAlert(false)
};
ZmAppAlert.prototype._getAppButton=function(){
return appCtxt.getAppController().getAppChooserButton(this.app.getName())
}
}
if(AjxPackage.define("zimbraMail.share.view.ZmBrowserAlert")){
ZmBrowserAlert=function(){
ZmAlert.call(this);
this._originalTitle=null;
this.altTitle=null;
var t=new AjxListener(this,this._focusListener);
DwtShell.getShell(window).addFocusListener(t);
DwtShell.getShell(window).addBlurListener(t);
var e=new AjxListener(this,this._globalEventListener);
DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,e);
DwtEventManager.addListener(DwtEvent.ONKEYDOWN,e)
};
ZmBrowserAlert.prototype=new ZmAlert;
ZmBrowserAlert.prototype.constructor=ZmBrowserAlert;
ZmBrowserAlert.prototype.toString=function(){
return"ZmBrowserAlert"
};
ZmBrowserAlert.getInstance=function(){
return ZmBrowserAlert.INSTANCE=ZmBrowserAlert.INSTANCE||new ZmBrowserAlert()
};
ZmBrowserAlert.prototype.start=function(e){
if(this._isLooping){
return
}
this.altTitle=e||ZmMsg.newMessage;
if(!this._clientHasFocus){
if(!this._favIcon){
this._favIcon=appContextPath+"/img/logo/favicon.ico";
this._blankIcon=appContextPath+"/img/logo/blank.ico"
}
this._startLoop()
}};
ZmBrowserAlert.prototype.stop=function(){
this._stopLoop()
};
ZmBrowserAlert.prototype._update=function(e){
Dwt.setFavIcon(e?this._blankIcon:this._favIcon);
var t=document;
if(e){
this._origTitle=t.title;
t.title=this.altTitle
}else{
if(t.title==this.altTitle){
t.title=this._origTitle
}}};
ZmBrowserAlert.prototype._focusListener=function(e){
this._clientHasFocus=e.state==DwtFocusEvent.FOCUS;
if(this._clientHasFocus){
this.stop()
}};
ZmBrowserAlert.prototype._globalEventListener=function(){
this._clientHasFocus=true;
this.stop()
}
}
if(AjxPackage.define("zimbraMail.share.view.ZmDesktopAlert")){
ZmDesktopAlert=function(){
this.usePrism=appCtxt.isOffline&&window.platform&&(AjxEnv.isWindows||AjxEnv.isMac);
this.useBrowserPlus=!this.usePrism
};
ZmDesktopAlert.prototype=new ZmAlert;
ZmDesktopAlert.prototype.constructor=ZmDesktopAlert;
ZmDesktopAlert.prototype.toString=function(){
return"ZmDesktopAlert"
};
ZmDesktopAlert.getInstance=function(){
return ZmDesktopAlert.INSTANCE=ZmDesktopAlert.INSTANCE||new ZmDesktopAlert()
};
ZmDesktopAlert.prototype.getDisplayText=function(){
if(this.usePrism){
return AjxEnv.isMac?ZmMsg.showPopupMac:ZmMsg.showPopup
}else{
return ZmMsg.showPopupBrowserPlus
}};
ZmDesktopAlert.prototype.getLinkText=function(){
return this.useBrowserPlus?ZmMsg.showPopupBrowserPlusLink:""
};
ZmDesktopAlert.prototype.start=function(o,i){
if(this.usePrism){
if(AjxEnv.isMac){
try{
window.platform.showNotification(o,i,"resource://webapp/icons/default/launcher.icns")
}
catch(a){}}else{
if(AjxEnv.isWindows){
try{
window.platform.icon().showNotification(o,i,5)
}
catch(a){}}}}else{
AjxDispatcher.require(["BrowserPlus"]);
var t={
service:"Notify",version:"2",minversion:"2.0.9"};
var n=new AjxCallback(this,this._notityServiceCallback,[o,i]);
var e=new AjxCallback(this,this._notityServiceErrorCallback);
ZmBrowserPlus.getInstance().require(t,n,e)
}};
ZmDesktopAlert.prototype._notityServiceCallback=function(i,a,e){
try{
e.show({
title:i,message:a}
,function(){}
)
}
catch(t){}};
ZmDesktopAlert.prototype._notityServiceErrorCallback=function(e){}
}
if(AjxPackage.define("zimbraMail.share.view.ZmSoundAlert")){
ZmSoundAlert=function(){
this.enabled=AjxPluginDetector.detectQuickTime()||AjxPluginDetector.detectWindowsMedia();
if(this.enabled){
var e=this._element=document.createElement("DIV");
e.style.position="relative";
e.style.top="-1000px";
e.style.left="-1000px";
document.body.appendChild(this._element)
}else{
DBG.println("No QuickTime or Windows Media plugin detected. Sound alerts are disabled.")
}};
ZmSoundAlert.prototype.toString=function(){
return"ZmSoundAlert"
};
ZmSoundAlert.getInstance=function(){
return ZmSoundAlert.INSTANCE=ZmSoundAlert.INSTANCE||new ZmSoundAlert()
};
ZmSoundAlert.prototype.start=function(t){
if(this.enabled){
var i=new Date().getTime();
if(!this._lastTime||((i-this._lastTime)>5000)){
t=t||"/public/sounds/im/alert.wav";
var a=appContextPath+t;
var o=Dwt.getNextId();
var e=["<object CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' type='audio/wav'>","<param name='url' value='",a,"'>","<param name='autostart' value='true'>","<param name='controller' value='true'>","<embed id='",o,"' src='",a,"' controller='false' autostart='true' type='audio/wav'/>","</object>"];
this._element.innerHTML=e.join("");
this._lastTime=i;
if(AjxEnv.isFirefox&&AjxEnv.isWindows){
if(this._blurActionId){
AjxTimedAction.cancelAction(this._blurActionId);
this._blurActionId=null
}
this._blurEmbedTimer(o,0)
}}}};
ZmSoundAlert.prototype._blurEmbedTimer=function(a,t){
var e=new AjxTimedAction(this,this._blurEmbed,[a,t]);
this._blurActionId=AjxTimedAction.scheduleAction(e,500)
};
ZmSoundAlert.prototype._blurEmbed=function(i,a){
this._blurActionId=null;
var t=document.getElementById(i);
if(t&&t.blur){
t.blur()
}
var e=appCtxt.getKeyboardMgr().getFocusObj();
if(e&&e.focus){
e.focus()
}
if(a<2){
this._blurEmbedTimer(i,a+1)
}}
}};
</script></head>
<body style="margin: 0px; overflow: hidden;"><div style="height: 44px; position: relative;" id="xcnavbar"><iframe scrolling="no" frameborder="0" allowtransparency="true" style="height: 44px; width: 100%; margin: 0px; position: relative; display: block; visibility: visible;" src="./Seals jpeg by Jesse Mechling_files/saved_resource.htm" onload="this.style.visibility = &#39;visible&#39;;"></iframe></div>

<!--
***** BEGIN LICENSE BLOCK *****
Zimbra Collaboration Suite Web Client
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Zimbra, Inc.

The contents of this file are subject to the Zimbra Public License
Version 1.3 ("License"); you may not use this file except in
compliance with the License.  You may obtain a copy of the License at
http://www.zimbra.com/license.

Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
***** END LICENSE BLOCK *****
-->
<script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,AjxTemplateMsg.js.zgz"></script>
 

<!-- image overlays and masks -->
<script>
if (!window.AjxImgData) AjxImgData = {};
AjxImgData["ImgCalendarFolderOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgCalendarFolderOverlay.png"};
AjxImgData["ImgContactsFolderOverlay"]={t:0,l:0,w:14,h:16,f:"@AppContextPath@/img/overlays/ImgContactsFolderOverlay.png"};
AjxImgData["ImgEmailedContactsOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgEmailedContactsOverlay.png"};
AjxImgData["ImgFolderOverlay"]={t:0,l:0,w:16,h:14,f:"@AppContextPath@/img/overlays/ImgFolderOverlay.png"};
AjxImgData["ImgInboxOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgInboxOverlay.png"};
AjxImgData["ImgMailFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgMailFolderOverlay.png"};
AjxImgData["ImgNotebookOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgNotebookOverlay.png"};
AjxImgData["ImgRSSOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgRSSOverlay.png"};
AjxImgData["ImgSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSectionOverlay.png"};
AjxImgData["ImgSentFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSentFolderOverlay.png"};
AjxImgData["ImgSharedCalendarFolderOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgSharedCalendarFolderOverlay.png"};
AjxImgData["ImgSharedContactsFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedContactsFolderOverlay.png"};
AjxImgData["ImgSharedMailFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedMailFolderOverlay.png"};
AjxImgData["ImgSharedNotebookOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedNotebookOverlay.png"};
AjxImgData["ImgSharedSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedSectionOverlay.png"};
AjxImgData["ImgSharedTaskListOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSharedTaskListOverlay.png"};
AjxImgData["ImgTagOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTagOverlay.png"};
AjxImgData["ImgTaskListOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTaskListOverlay.png"};
AjxImgData["ImgMailFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/mail.gif"};
AjxImgData["ImgRSSMask"]={t:-354,l:0,w:16,h:16,f:"@AppContextPath@/img/mail.gif"};
AjxImgData["ImgSharedTaskListMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/tasks.gif"};
AjxImgData["ImgTaskListMask"]={t:-114,l:0,w:16,h:16,f:"@AppContextPath@/img/tasks.gif"};
AjxImgData["ImgSentFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/startup.gif"};
AjxImgData["ImgSharedMailFolderMask"]={t:-18,l:0,w:16,h:17,f:"@AppContextPath@/img/startup.gif"};
AjxImgData["ImgInboxMask"]={t:-611,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
AjxImgData["ImgTagMask"]={t:-1491,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
AjxImgData["ImgFolderMask"]={t:-1731,l:0,w:16,h:14,f:"@AppContextPath@/img/startup.gif"};
AjxImgData["ImgSharedContactsFolderMask"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/contacts.gif"};
AjxImgData["ImgContactsFolderMask"]={t:-65,l:0,w:14,h:16,f:"@AppContextPath@/img/contacts.gif"};
AjxImgData["ImgEmailedContactsMask"]={t:-113,l:0,w:16,h:16,f:"@AppContextPath@/img/contacts.gif"};
AjxImgData["ImgNotebookMask"]={t:-80,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
AjxImgData["ImgSectionMask"]={t:-128,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
AjxImgData["ImgSharedNotebookMask"]={t:-160,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
AjxImgData["ImgSharedSectionMask"]={t:-208,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
AjxImgData["ImgCalendarFolderMask"]={t:-96,l:0,w:16,h:16,f:"@AppContextPath@/img/calendar.gif"};
AjxImgData["ImgSharedCalendarFolderMask"]={t:-413,l:0,w:15,h:15,f:"@AppContextPath@/img/calendar.gif"};
if (!window.AjxImgData) AjxImgData = {};

document.write("<DIV style='display:none'>");
for (var id in AjxImgData) {
        var data = AjxImgData[id];
        if (data.f) data.f = data.f.replace(/@AppContextPath@/,appContextPath);
        document.write("<IMG id='",id,"' src='",data.d||data.f,"'>");
}
document.write("</DIV>");
</script><div style="display:none"><img id="ImgCalendarFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgCalendarFolderOverlay.png"><img id="ImgContactsFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgContactsFolderOverlay.png"><img id="ImgEmailedContactsOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgEmailedContactsOverlay.png"><img id="ImgFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgFolderOverlay.png"><img id="ImgInboxOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgInboxOverlay.png"><img id="ImgMailFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgMailFolderOverlay.png"><img id="ImgNotebookOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgNotebookOverlay.png"><img id="ImgRSSOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgRSSOverlay.png"><img id="ImgSectionOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSectionOverlay.png"><img id="ImgSentFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSentFolderOverlay.png"><img id="ImgSharedCalendarFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSharedCalendarFolderOverlay.png"><img id="ImgSharedContactsFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSharedContactsFolderOverlay.png"><img id="ImgSharedMailFolderOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSharedMailFolderOverlay.png"><img id="ImgSharedNotebookOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSharedNotebookOverlay.png"><img id="ImgSharedSectionOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSharedSectionOverlay.png"><img id="ImgSharedTaskListOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgSharedTaskListOverlay.png"><img id="ImgTagOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgTagOverlay.png"><img id="ImgTaskListOverlay" src="./Seals jpeg by Jesse Mechling_files/ImgTaskListOverlay.png"><img id="ImgMailFolderMask" src="./Seals jpeg by Jesse Mechling_files/mail.gif"><img id="ImgRSSMask" src="./Seals jpeg by Jesse Mechling_files/mail.gif"><img id="ImgSharedTaskListMask" src="./Seals jpeg by Jesse Mechling_files/tasks.gif"><img id="ImgTaskListMask" src="./Seals jpeg by Jesse Mechling_files/tasks.gif"><img id="ImgSentFolderMask" src="./Seals jpeg by Jesse Mechling_files/startup.gif"><img id="ImgSharedMailFolderMask" src="./Seals jpeg by Jesse Mechling_files/startup.gif"><img id="ImgInboxMask" src="./Seals jpeg by Jesse Mechling_files/startup.gif"><img id="ImgTagMask" src="./Seals jpeg by Jesse Mechling_files/startup.gif"><img id="ImgFolderMask" src="./Seals jpeg by Jesse Mechling_files/startup.gif"><img id="ImgSharedContactsFolderMask" src="./Seals jpeg by Jesse Mechling_files/contacts.gif"><img id="ImgContactsFolderMask" src="./Seals jpeg by Jesse Mechling_files/contacts.gif"><img id="ImgEmailedContactsMask" src="./Seals jpeg by Jesse Mechling_files/contacts.gif"><img id="ImgNotebookMask" src="./Seals jpeg by Jesse Mechling_files/notes.gif"><img id="ImgSectionMask" src="./Seals jpeg by Jesse Mechling_files/notes.gif"><img id="ImgSharedNotebookMask" src="./Seals jpeg by Jesse Mechling_files/notes.gif"><img id="ImgSharedSectionMask" src="./Seals jpeg by Jesse Mechling_files/notes.gif"><img id="ImgCalendarFolderMask" src="./Seals jpeg by Jesse Mechling_files/calendar.gif"><img id="ImgSharedCalendarFolderMask" src="./Seals jpeg by Jesse Mechling_files/calendar.gif"></div>

<!--
  --
  --
  --
          BEGIN SKIN
  --
  --
  --
  -->

<!-- 
 - #define WINDOWS true
 - #define SAFARI_3 true
 - #define SAFARI true
 - #define WEBKIT true
 - #define CHROME true
 - #define SAFARI_2_OR_HIGHER true
 -->

<!-- 
 - File: zimbra/skins/velodrome2/skin.html
 -->

<!-- BEGIN SKIN HTML -->
<script type="text/javascript">
if (window.parent == window) {
        document.write('<scr'+'ipt type="text/javascript" src="http://xfinity.comcast.net/js-api/compressed/xpbar.js?version=3&profile=xc&id=xcnavbar"></scr'+'ipt>');
}
</script><script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/xpbar.js"></script>
<script type="text/javascript">
document.title=ZmMsg.zimbraTitle;
</script>

<!-- END SKIN HTML -->

<!-- BEGIN SPLASH SCREEN -->
<div id="skin_container_splash_screen" class="skin_container_splash_screen" align="center" x-display="block" style="display: none;">
        <script language="javascript">
                function showCompanyUrl() {
                        window.open('<fmt:message key="splashScreenCompanyURL/>', '_blank');
                }
        </script>
        <!-- xr-feat-163 -->
        <div id="skin_container_splash_logo" class="skin_container_splash_logo"></div>
        <div class="skin_container_splash_loading"></div>
        <div class="skin_container_splash_footer">
                <div class="skin_container_splash_footer_logo"></div>
                <p>Copyright © Comcast Interactive Media 2012. All rights reserved.</p>
        </div>
        <!-- End xr-feat-163 -->
</div>
<!-- END SPLASH SCREEN -->

<script type="text/javascript">
/* suppress chrome when running in an iframe */
if (window.parent != window) {
    (function() {
        function hideNode(node) {
            node.style.display = 'none';
        }
        function removeNode(node) {
            node.parentNode.removeChild(node);
        }

        hideNode(document.getElementById('skin_R1'));
        hideNode(document.getElementById('skin_R2'));
        hideNode(document.getElementById('skin_R3'));
        hideNode(document.getElementById('skin_R4'));
        removeNode(document.getElementById('comcast-adsrvc'));
    })();
}
</script>


<!--
  --
  --
  --
          END SKIN
  --
  --
  --
  -->
<div style="display:none;">

<!-- bootstrap classes -->

        <script type="text/javascript">
        AjxEnv=function(){};
AjxEnv.DEFAULT_LOCALE=window.navigator.userLanguage||window.navigator.language||window.navigator.systemLanguage;
AjxEnv._inited=false;
AjxEnv.geckoDate;
AjxEnv.mozVersion;
AjxEnv.webKitVersion;
AjxEnv.isMac;
AjxEnv.isWindows;
AjxEnv.isLinux;
AjxEnv.isNav;
AjxEnv.isIE;
AjxEnv.isNav4;
AjxEnv.trueNs;
AjxEnv.isNav6;
AjxEnv.isNav6up;
AjxEnv.isNav7;
AjxEnv.isIE3;
AjxEnv.isIE4;
AjxEnv.isIE4up;
AjxEnv.isIE5;
AjxEnv.isIE5_5;
AjxEnv.isIE5up;
AjxEnv.isIE5_5up;
AjxEnv.isIE6;
AjxEnv.isIE6up;
AjxEnv.isIE7;
AjxEnv.isIE7up;
AjxEnv.isIE8;
AjxEnv.isIE8up;
AjxEnv.isNormalResolution;
AjxEnv.ieScaleFactor;
AjxEnv.isFirefox;
AjxEnv.isFirefox1up;
AjxEnv.isFirefox1_5up;
AjxEnv.isFirefox3up;
AjxEnv.isFirefox3_6up;
AjxEnv.isMozilla;
AjxEnv.isMozilla1_4up;
AjxEnv.isSafari;
AjxEnv.isSafari2;
AjxEnv.isSafari3;
AjxEnv.isSafari3up;
AjxEnv.isSafari4;
AjxEnv.isSafari4up;
AjxEnv.isSafari5up;
AjxEnv.isCamino;
AjxEnv.isChrome;
AjxEnv.isGeckoBased;
AjxEnv.isWebKitBased;
AjxEnv.isOpera;
AjxEnv.useTransparentPNGs;
AjxEnv.isDesktop;
AjxEnv.isDesktop2up;
AjxEnv.is800x600orLower;
AjxEnv.is1024x768orLower;
AjxEnv.reset=function(){
AjxEnv.geckoDate=0;
AjxEnv.mozVersion=-1;
AjxEnv.webKitVersion=-1;
AjxEnv.isMac=false;
AjxEnv.isWindows=false;
AjxEnv.isLinux=false;
AjxEnv.isNav=false;
AjxEnv.isIE=false;
AjxEnv.isNav4=false;
AjxEnv.trueNs=true;
AjxEnv.isNav6=false;
AjxEnv.isNav6up=false;
AjxEnv.isNav7=false;
AjxEnv.isIE3=false;
AjxEnv.isIE4=false;
AjxEnv.isIE4up=false;
AjxEnv.isIE5=false;
AjxEnv.isIE5_5=false;
AjxEnv.isIE5up=false;
AjxEnv.isIE5_5up=false;
AjxEnv.isIE6=false;
AjxEnv.isIE6up=false;
AjxEnv.isIE7=false;
AjxEnv.isIE7up=false;
AjxEnv.isIE8=false;
AjxEnv.isIE8up=false;
AjxEnv.isNormalResolution=false;
AjxEnv.ieScaleFactor=1;
AjxEnv.isFirefox=false;
AjxEnv.isFirefox1up=false;
AjxEnv.isFirefox1_5up=false;
AjxEnv.isFirefox3up=false;
AjxEnv.isFirefox3_6up=false;
AjxEnv.isMozilla=false;
AjxEnv.isMozilla1_4up=false;
AjxEnv.isSafari=false;
AjxEnv.isSafari2=false;
AjxEnv.isSafari3=false;
AjxEnv.isSafari4=false;
AjxEnv.isSafari3up=false;
AjxEnv.isSafari4up=false;
AjxEnv.isSafari5up=false;
AjxEnv.isCamino=false;
AjxEnv.isChrome=false;
AjxEnv.isGeckoBased=false;
AjxEnv.isWebKitBased=false;
AjxEnv.isOpera=false;
AjxEnv.useTransparentPNGs=false;
AjxEnv.isDesktop=false;
AjxEnv.isDesktop2up=false;
AjxEnv.is800x600orLower=screen&&(screen.width<=800&&screen.height<=600);
AjxEnv.is1024x768orLower=screen&&(screen.width<=1024&&screen.height<=768)
};
AjxEnv.parseUA=function(){
AjxEnv.reset();
var n=navigator.userAgent.toLowerCase();
var t=n.split(" ");
var c=false;
var o=false;
var r=false;
var e=false;
var a=false;
if(t!=null){
var u;
var l=-1;
if((l=t[0].search(/^\s*mozilla\//))!=-1){
e=true;
AjxEnv.browserVersion=parseFloat(t[0].substring(l+8));
AjxEnv.isNav=true
}
var s;
for(var h=0;
h<t.length;
++h){
s=t[h];
if(s.indexOf("compatible")!=-1){
a=true;
AjxEnv.isNav=false
}else{
if((s.indexOf("opera"))!=-1){
AjxEnv.isOpera=true;
AjxEnv.isNav=false;
u=parseFloat(t[h+1])
}else{
if((s.indexOf("spoofer"))!=-1){
c=true;
AjxEnv.isNav=false
}else{
if((s.indexOf("webtv"))!=-1){
o=true;
AjxEnv.isNav=false
}else{
if((s.indexOf("hotjava"))!=-1){
r=true;
AjxEnv.isNav=false
}else{
if((l=s.indexOf("msie"))!=-1){
AjxEnv.isIE=true;
u=parseFloat(t[h+1])
}else{
if((l=s.indexOf("gecko/"))!=-1){
AjxEnv.isGeckoBased=true;
AjxEnv.geckoDate=parseFloat(s.substr(l+6))
}else{
if((l=s.indexOf("applewebkit/"))!=-1){
AjxEnv.isWebKitBased=true;
AjxEnv.webKitVersion=parseFloat(s.substr(l+12))
}else{
if((l=s.indexOf("rv:"))!=-1){
AjxEnv.mozVersion=parseFloat(s.substr(l+3));
u=AjxEnv.mozVersion
}else{
if((l=s.indexOf("firefox/"))!=-1){
AjxEnv.isFirefox=true;
u=parseFloat(s.substr(l+8))
}else{
if((l=s.indexOf("prism"))!=-1){
AjxEnv.isPrism=true
}else{
if((l=s.indexOf("camino/"))!=-1){
AjxEnv.isCamino=true;
u=parseFloat(s.substr(l+7))
}else{
if((l=s.indexOf("netscape6/"))!=-1){
AjxEnv.trueNs=true;
u=parseFloat(s.substr(l+10))
}else{
if((l=s.indexOf("netscape/"))!=-1){
AjxEnv.trueNs=true;
u=parseFloat(s.substr(l+9))
}else{
if((l=s.indexOf("safari/"))!=-1){
AjxEnv.isSafari=true
}else{
if((l=s.indexOf("chrome/"))!=-1){
AjxEnv.isChrome=true;
u=parseFloat(s.substr(l+7))
}else{
if(l=s.indexOf("version/")!=-1){
u=parseFloat(s.substr(l+7))
}else{
if(s.indexOf("windows")!=-1){
AjxEnv.isWindows=true
}else{
if((s.indexOf("macintosh")!=-1)||(s.indexOf("mac_")!=-1)){
AjxEnv.isMac=true
}else{
if(s.indexOf("linux")!=-1){
AjxEnv.isLinux=true
}else{
if((l=s.indexOf("zdesktop/"))!=-1){
AjxEnv.isDesktop=true;
u=parseFloat(s.substr(l+9))
}}}}}}}}}}}}}}}}}}}}}}
AjxEnv.browserVersion=u;
AjxEnv.isNav=(e&&!c&&!a&&!AjxEnv.isOpera&&!o&&!r&&!AjxEnv.isSafari);
AjxEnv.isIE=(AjxEnv.isIE&&!AjxEnv.isOpera);
AjxEnv.isNav4=(AjxEnv.isNav&&(u==4)&&(!AjxEnv.isIE));
AjxEnv.isNav6=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6&&u<7));
AjxEnv.isNav6up=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6));
AjxEnv.isNav7=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=7&&u<8));
AjxEnv.isIE3=(AjxEnv.isIE&&u<4);
AjxEnv.isIE4=(AjxEnv.isIE&&u>=4&&u<5);
AjxEnv.isIE4up=(AjxEnv.isIE&&u>=4);
AjxEnv.isIE5=(AjxEnv.isIE&&u>=5&&u<6);
AjxEnv.isIE5_5=(AjxEnv.isIE&&u==5.5);
AjxEnv.isIE5up=(AjxEnv.isIE&&u>=5);
AjxEnv.isIE5_5up=(AjxEnv.isIE&&u>=5.5);
AjxEnv.isIE6=(AjxEnv.isIE&&u>=6&&u<7);
AjxEnv.isIE6up=(AjxEnv.isIE&&u>=6);
AjxEnv.isIE7=(AjxEnv.isIE&&u>=7&&u<8);
AjxEnv.isIE7up=(AjxEnv.isIE&&u>=7);
AjxEnv.isIE8=(AjxEnv.isIE&&u>=8&&u<9);
AjxEnv.isIE8up=(AjxEnv.isIE&&u>=8);
AjxEnv.isMozilla=((AjxEnv.isNav&&AjxEnv.mozVersion&&AjxEnv.isGeckoBased&&(AjxEnv.geckoDate!=0)));
AjxEnv.isMozilla1_4up=(AjxEnv.isMozilla&&(AjxEnv.mozVersion>=1.4));
AjxEnv.isFirefox=((AjxEnv.isMozilla&&AjxEnv.isFirefox));
AjxEnv.isFirefox1up=(AjxEnv.isFirefox&&u>=1);
AjxEnv.isFirefox1_5up=(AjxEnv.isFirefox&&u>=1.5);
AjxEnv.isFirefox2_0up=(AjxEnv.isFirefox&&u>=2);
AjxEnv.isFirefox3up=(AjxEnv.isFirefox&&u>=3);
AjxEnv.isFirefox3_5up=(AjxEnv.isFirefox&&u>=3.5);
AjxEnv.isFirefox3_6up=(AjxEnv.isFirefox&&u>=3.6);
AjxEnv.isSafari2=(AjxEnv.isSafari&&u>=2&&u<3);
AjxEnv.isSafari3=(AjxEnv.isSafari&&u>=3&&u<4)||AjxEnv.isChrome;
AjxEnv.isSafari4=(AjxEnv.isSafari&&u>=4);
AjxEnv.isSafari3up=(AjxEnv.isSafari&&u>=3)||AjxEnv.isChrome;
AjxEnv.isSafari4up=(AjxEnv.isSafari&&u>=4)||AjxEnv.isChrome;
AjxEnv.isSafari5up=(AjxEnv.isSafari&&u>=5)||AjxEnv.isChrome;
AjxEnv.isDesktop2up=(AjxEnv.isDesktop&&u>=2);
AjxEnv.isChrome7=(AjxEnv.isChrome&&u>=7);
AjxEnv.browser="[unknown]";
if(AjxEnv.isOpera){
AjxEnv.browser="OPERA"
}else{
if(AjxEnv.isSafari3up){
AjxEnv.browser="SAF3"
}else{
if(AjxEnv.isSafari){
AjxEnv.browser="SAF"
}else{
if(AjxEnv.isCamino){
AjxEnv.browser="CAM"
}else{
if(o){
AjxEnv.browser="WEBTV"
}else{
if(r){
AjxEnv.browser="HOTJAVA"
}else{
if(AjxEnv.isFirefox3up){
AjxEnv.browser="FF3.0"
}else{
if(AjxEnv.isFirefox2_0up){
AjxEnv.browser="FF2.0"
}else{
if(AjxEnv.isFirefox1_5up){
AjxEnv.browser="FF1.5"
}else{
if(AjxEnv.isFirefox1up){
AjxEnv.browser="FF1.0"
}else{
if(AjxEnv.isFirefox){
AjxEnv.browser="FF"
}else{
if(AjxEnv.isPrism){
AjxEnv.browser="PRISM"
}else{
if(AjxEnv.isNav7){
AjxEnv.browser="NAV7"
}else{
if(AjxEnv.isNav6){
AjxEnv.browser="NAV6"
}else{
if(AjxEnv.isNav4){
AjxEnv.browser="NAV4"
}else{
if(AjxEnv.isIE8){
AjxEnv.browser="IE8"
}else{
if(AjxEnv.isIE7){
AjxEnv.browser="IE7"
}else{
if(AjxEnv.isIE6){
AjxEnv.browser="IE6"
}else{
if(AjxEnv.isIE5){
AjxEnv.browser="IE5"
}else{
if(AjxEnv.isIE4){
AjxEnv.browser="IE4"
}else{
if(AjxEnv.isIE3){
AjxEnv.browser="IE"
}else{
if(AjxEnv.isDesktop){
AjxEnv.browser="ZDESKTOP"
}}}}}}}}}}}}}}}}}}}}}}
AjxEnv.platform="[unknown]";
if(AjxEnv.isWindows){
AjxEnv.platform="Win"
}else{
if(AjxEnv.isMac){
AjxEnv.platform="Mac"
}else{
if(AjxEnv.isLinux){
AjxEnv.platform="Linux"
}}}}
if(AjxEnv.isIE){
AjxEnv.isNormalResolution=true;
AjxEnv.ieScaleFactor=screen.deviceXDPI/screen.logicalXDPI;
if(AjxEnv.ieScaleFactor>1){
AjxEnv.isNormalResolution=false
}}
AjxEnv.useTransparentPNGs=!AjxEnv.isIE&&!AjxEnv.isLinux&&!AjxEnv.isSafari;
AjxEnv._inited=!AjxEnv.isIE;
if(AjxEnv.isSafari){
var d=AjxEnv.getWebkitVersion();
AjxEnv.isSafariNightly=(d&&d.is_nightly);
AjxEnv.isSafari2=!AjxEnv.isSafari3&&!AjxEnv.isSafariNightly
}};
AjxEnv.getWebkitVersion=function(){
var t;
var o=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");
var s=o.exec(navigator.userAgent);
if(s){
var e=s[1];
var n=e.split(".");
var a=(e[e.length-1]=="+");
var i=a?"+":parseInt(n[1]);
if(isNaN(i)){
i=""
}
t={
major:parseInt(n[0]),minor:i,is_nightly:a}
}
return t||{}
};
AjxEnv.parseUA();
AjxCallback=function(a,t,e){
if(arguments.length==0){
return
}
if(typeof arguments[0]=="function"){
this.obj=null;
this.func=arguments[0];
this.args=arguments[1]
}else{
this.obj=a;
this.func=t;
this.args=e
}};
AjxCallback.prototype.toString=function(){
return"AjxCallback"
};
AjxCallback.NOP=new AjxCallback(function(){}
);
AjxCallback.prototype.run=function(){
var e=[];
if(typeof this.args!="undefined"){
if(this.args!==null&&this.args instanceof Array){
e=arguments.length>0?e.concat(this.args):this.args
}else{
e.push(this.args)
}}
for(var t=0;
t<arguments.length;
++t){
e.push(arguments[t])
}
if(this.func){
return this.func.apply(this.obj||window,e)
}};
AjxCallback.prototype.run1=function(t){
var e=[];
if(typeof this.args!="undefined"){
if(this.args!==null&&this.args instanceof Array){
e=arguments.length>0?e.concat(this.args):this.args
}else{
e.push(this.args)
}}
if(t&&t.length){
for(var a=0;
a<t.length;
++a){
e.push(t[a])
}}
if(this.func){
return this.func.apply(this.obj||window,e)
}};
AjxCallback.simpleClosure=function(a,o){
var e=[];
for(var t=2;
t<arguments.length;
++t){
e.push(arguments[t])
}
return function(){
var s=[];
for(var n=0;
n<arguments.length;
++n){
s.push(arguments[n])
}
return a.apply(o||this,e.concat(s))
}
};
AjxCallback.returnFalse=function(){
return false
};
AjxCallback.isNull=function(e){
return e==null
};
AjxLoader=function(){};
AjxLoader.__createXHR;
if(window.XMLHttpRequest){
AjxLoader.__createXHR=function(){
return new XMLHttpRequest()
}
}else{
if(window.ActiveXObject){
(function(){
var t=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
for(var a=0;
a<t.length;
a++){
try{
new ActiveXObject(t[a]);
AjxLoader.__createXHR=function(){
return new ActiveXObject(t[a])
};
break
}
catch(o){}}}
)()
}}
AjxLoader.load=function(a){
var n=a;
if(typeof a=="string"){
n={
url:a}
}
var o=AjxLoader.__createXHR();
var i=Boolean(n.callback)?function(){
AjxLoader._response(o,n.callback)
}
:null;
var s=n.method||(n.content!=null?"POST":"GET");
if(i){
o.onreadystatechange=i
}
var t=n.async!=null?n.async:Boolean(i);
o.open(s,n.url,t,n.userName,n.password);
for(var e in n.headers){
o.setRequestHeader(e,n.headers[e])
}
o.send(n.content||"");
return o
};
AjxLoader._response=function(e,t){
if(e.readyState==4){
t.run(e)
}};
AjxPackage=function(){};
AjxPackage.METHOD_XHR_SYNC="xhr-sync";
AjxPackage.METHOD_XHR_ASYNC="xhr-async";
AjxPackage.METHOD_SCRIPT_TAG="script-tag";
AjxPackage.DEFAULT_SYNC=AjxPackage.METHOD_XHR_SYNC;
AjxPackage.DEFAULT_ASYNC=AjxEnv.isIE?AjxPackage.METHOD_XHR_ASYNC:AjxPackage.METHOD_SCRIPT_TAG;
AjxPackage._packages={};
AjxPackage._extension=".js";
AjxPackage.__depth=0;
AjxPackage.__scripts=[];
AjxPackage.__data={};
AjxPackage.setBasePath=function(e){
AjxPackage._basePath=e
};
AjxPackage.setExtension=function(e){
AjxPackage._extension=e
};
AjxPackage.setQueryString=function(e){
AjxPackage._queryString=e
};
AjxPackage.isDefined=function(e){
return Boolean(AjxPackage._packages[e])
};
AjxPackage.define=function(e){
AjxPackage.__log("DEFINE "+e,"font-weight:bold;font-style:italic");
e=AjxPackage.__package2path(e);
if(!AjxPackage._packages[e]){
AjxPackage._packages[e]=true;
return true
}
return false
};
AjxPackage.undefine=function(e){
AjxPackage.__log("UNDEFINE "+e,"font-weight:bold;font-style:italic");
e=AjxPackage.__package2path(e);
if(AjxPackage._packages[e]){
delete AjxPackage._packages[e]
}};
AjxPackage.require=function(a){
var b=a;
if(typeof a=="string"){
b={
name:a}
}
var s=b.name;
if(s instanceof Array){
if(!s.internal){
s=[].concat(s);
s.internal=true;
b.name=s
}
var x=s.shift();
if(s.length>0){
var o=new Function();
o.prototype=b;
o.prototype.constructor=o;
var n=new o();
n.name=x;
n.callback=new AjxCallback(null,AjxPackage.__requireNext,b);
AjxPackage.require(n);
return
}
b.name=x
}
var c=b.name;
var x=AjxPackage.__package2path(c);
var i=b.callback;
if(typeof i=="function"){
i=new AjxCallback(i)
}
var f=i?" (callback)":"";
var y=AjxPackage._packages[x]?" LOADED":"";
var d=AjxPackage.__scripts.length?" (async, queueing...)":"";
AjxPackage.__log(['REQUIRE "',c,'"',f,y,d].join(""));
var g=b.forceReload!=null?b.forceReload:false;
if(AjxPackage._packages[x]&&!g){
if(i){
i.run()
}
return
}
var w=b.basePath||AjxPackage._basePath||window.contextPath;
var h=b.extension||AjxPackage._extension;
var t=b.queryString||AjxPackage._queryString;
var k=[w,"/",x,h];
if(t){
k.push("?",t)
}
var m=k.join("");
var e=b.method||(b.callback?AjxPackage.DEFAULT_ASYNC:AjxPackage.DEFAULT_SYNC);
var l=e==AjxPackage.METHOD_XHR_SYNC||b.forceSync;
var r=!l;
var v={
name:x,path:m,method:e,async:r,callback:i||AjxCallback.NOP,scripts:r?[]:null};
if(l||AjxPackage.__scripts.length==0){
AjxPackage.__doLoad(v)
}else{
var p=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
v.method=p.method;
v.async=p.async;
v.scripts=[];
if(i){
var u=AjxPackage.__scripts[0];
u.callback=new AjxCallback(AjxPackage.__chainCallbacks,[u.callback,i]);
v.callback=AjxCallback.NOP
}
p.scripts.push(v)
}};
AjxPackage.eval=function(text){
if(window.execScript){
window.execScript(text)
}else{
if(AjxEnv.isGeckoBased){
window.eval(text)
}else{
var e=document.createElement("SCRIPT");
var t=document.createTextNode(text);
e.appendChild(t);
var heads=document.getElementsByTagName("HEAD");
if(heads.length==0){
heads=[document.createElement("HEAD")];
document.documentElement.appendChild(heads[0])
}
heads[0].appendChild(e)
}}};
AjxPackage.__package2path=function(e){
return e.replace(/\./g,"/").replace(/\*$/,"__all__")
};
AjxPackage.__requireNext=function(t){
var e=AjxCallback.simpleClosure(AjxPackage.require,null,t);
setTimeout(e,AjxEnv.isIE?10:0)
};
AjxPackage.__doLoad=function(e){
if(e.async){
AjxPackage.__doAsyncLoad(e)
}else{
AjxPackage.__doXHR(e)
}};
AjxPackage.__doAsyncLoad=function(t,e){
AjxPackage.__data[name]=t;
if(e||AjxPackage.__scripts.length==0){
AjxPackage.__scripts.push(t);
if(t.method==AjxPackage.METHOD_SCRIPT_TAG){
AjxPackage.__doScriptTag(t)
}else{
AjxPackage.__doXHR(t)
}}else{
var a=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
a.scripts.push(t)
}};
AjxPackage.__doScriptTag=function(i){
var e=document.createElement("SCRIPT");
e.type="text/javascript";
e.src=i.path;
if(AjxEnv.isIE){
var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoadIE,null,e);
e.attachEvent("onreadystatechange",t)
}else{
var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoad,null,i.name);
e.addEventListener("load",t,true)
}
var a=document.getElementsByTagName("HEAD");
if(!a||a.length==0){
a=[document.createElement("HEAD")];
document.documentElement.appendChild(a[0])
}
a[0].appendChild(e)
};
AjxPackage.__doXHR=function(a){
var i=a.async?new AjxCallback(null,AjxPackage.__onXHR,[a]):null;
var e={
url:a.path,userName:a.userName,password:a.password,async:a.async,callback:i};
var t=AjxLoader.load(e);
if(!a.async){
AjxPackage.__onXHR(a,t)
}};
AjxPackage.__onXHR=function(t,e){
if(e.status==200||e.status==0){
AjxPackage.__requireEval(e.responseText||"")
}else{
AjxPackage.__log("error: "+e.status,"background-color:red")
}
if(t.async){
AjxPackage.__onAsyncLoad()
}else{
AjxPackage.__onLoad(t)
}};
AjxPackage.__onAsyncLoadIE=function(e){
if(e.readyState=="loaded"){
AjxPackage.__onAsyncLoad()
}};
AjxPackage.__onAsyncLoad=function(){
var e;
while(e=AjxPackage.__scripts.pop()){
if(e.scripts.length){
AjxPackage.__scripts.push(e);
e=e.scripts.shift();
AjxPackage.__scripts.push(e);
AjxPackage.__doAsyncLoad(e,true);
return
}
AjxPackage.__onLoad(e)
}};
AjxPackage.__onLoad=function(t){
AjxPackage.define(t.name);
if(t.callback){
try{
t.callback.run()
}
catch(a){
AjxPackage.__log("error on callback: "+a,"color:red")
}}};
AjxPackage.__requireEval=function(text){
AjxPackage.__depth++;
try{
AjxPackage.eval(text)
}
catch(e){
AjxPackage.__log("error on eval: "+e,"color:red")
}
AjxPackage.__depth--
};
AjxPackage.__log=function(t,e){};
AjxPackage.__alertStack=function(r){
var e=[];
if(r){
e.push(r,"\n\n")
}
for(var s=AjxPackage.__scripts.length-1;
s>=0;
s--){
var t=AjxPackage.__scripts[s];
e.push(t.name," (",Boolean(t.callback),")","\n");
if(t.scripts){
for(var n=0;
n<t.scripts.length;
n++){
var o=t.scripts[n];
e.push("  ",o.name," (",Boolean(o.callback),")","\n")
}}}
alert(e.join(""))
};
AjxPackage.__chainCallbacks=function(t,e){
if(t){
t.run()
}
if(e){
e.run()
}};
AjxTemplate=function(){};
AjxTemplate._templates={};
AjxTemplate._stack=[];
AjxTemplate.setBasePath=function(e){
AjxTemplate._basePath=e
};
AjxTemplate.setExtension=function(e){
AjxTemplate._extension=e
};
AjxTemplate.register=function(t,a,i,e){
if(!e&&AjxTemplate._templates[t]&&AjxTemplate._templates[t].authoritative){
return
}
AjxTemplate._templates[t]={
name:t,func:a,params:i||{}
,authoritative:e}
};
AjxTemplate.getTemplate=function(e){
var t=AjxTemplate._templates[e];
return t&&t.func
};
AjxTemplate.getParams=function(e){
var t=AjxTemplate._templates[e];
return t&&t.params
};
AjxTemplate.expand=function(t,r,s){
if(!AjxTemplate._templates[t]&&AjxTemplate.compile){
var i=document.getElementById(t);
if(i){
var d=i.nodeName.toUpperCase()=="TEXTAREA";
AjxTemplate.compile(t,true,true,d?i.value:i.innerHTML)
}}
var c=AjxTemplate.__name2Package(t);
var a=t.replace(/^[^#]*#?/,"");
if(a){
t=[c,a].join("#")
}
AjxTemplate.require(c);
var h=Boolean(s);
s=s||[];
var o=AjxTemplate.getTemplate(t);
if(o){
try{
AjxTemplate._stack.push(c);
var n=AjxTemplate.getParams(t);
o(t,n,r,s)
}
catch(l){
s.push(this.__formatError(t,l))
}
finally{
AjxTemplate._stack.pop()
}}else{
s.push(this.__formatError(t,"template not found"))
}
return h?s.length:s.join("")
};
AjxTemplate.require=function(e){
AjxPackage.require({
name:AjxTemplate.__name2Package(e),basePath:AjxTemplate._basePath,extension:AjxTemplate._extension}
);
return AjxTemplate.getTemplate(e)!=null
};
AjxTemplate.setContent=function(a,e,i){
if(typeof a=="string"){
a=document.getElementById(a)
}
if(a==null){
return
}
var t=AjxTemplate.expand(e,i);
a.innerHTML=t
};
AjxTemplate.__name2Package=function(t){
var e=t.replace(/#.*$/,"");
if(t.match(/^#/)&&AjxTemplate._stack.length>0){
e=AjxTemplate._stack[AjxTemplate._stack.length-1]
}
return e
};
AjxTemplate.__formatError=function(e,t){
return"Error in template '"+e+"': "+t
};
AjxTemplate.compile=function(d,u,l,f){
var e=AjxPackage.__package2path(d);
var g=f!=null?f:AjxLoader.load(e).reponseText;
var r=[],s=0,h=true;
AjxTemplate.__RE_TEMPLATE.lastIndex=0;
var o=AjxTemplate.__RE_TEMPLATE.exec(g);
if(o){
do{
var p=AjxTemplate.__parseAttrs(o[1]);
var c=o[2];
if(p["xml:space"]!="preserve"){
c=c.replace(AjxTemplate.__RE_GT_LINESEP_LT,"><").trim()
}
var n=d;
var a=p.id;
if(a&&(a.indexOf("#")!=-1||a.match(/^\//))){
if(a.indexOf("#")==-1){
a+="#"
}
n=a.replace(/#.*$/,"").replace(/^\//,"").replace(/\//g,".");
a=a.replace(/^.*#/,"")
}
var t=a?n+"#"+a:n;
var i=AjxTemplate.__convertLines(c);
AjxTemplate.register(n,i,p,u);
if(h&&l){
AjxPackage.define(n)
}
if(h){
h=false;
AjxTemplate.register(n,i,p,u)
}}
while(o=AjxTemplate.__RE_TEMPLATE.exec(g))
}else{
if(l){
AjxPackage.define(d)
}
var i=AjxTemplate.__convertLines(g);
AjxTemplate.register(d,i,{}
,u)
}};
AjxTemplate.__RE_REPLACE=new RegExp(["\\$\\{(.+?)\\}","<\\$=(.+?)\\$>","<\\$(.+?)\\$>"].join("|"),"mg");
AjxTemplate.__RE_TEMPLATE=new RegExp("<template(.*?)>(.*?)</template>","mg");
AjxTemplate.__RE_ATTR=new RegExp("\\s*(\\S+)\\s*=\\s*('[^']*'|\"[^\"]*\")","mg");
AjxTemplate.__RE_PARAM_PART=new RegExp("([^\\(\\.]+)(\\(.*?\\))?\\.?","g");
AjxTemplate.__RE_GT_LINESEP_LT=new RegExp([">","\\s*\\n+\\s*","<"].join(""),"mg");
AjxTemplate.__convertLines=function(a){
var t=[],r=0;
t[r++]="\tvar _hasBuffer = Boolean(buffer);";
t[r++]='\tdata = (typeof data == "string" ? { id: data } : data) || {};';
t[r++]="\tbuffer = buffer || [];";
t[r++]="\tvar _i = buffer.length;";
t[r++]="\n";
AjxTemplate.__RE_REPLACE.lastIndex=0;
var e=AjxTemplate.__RE_REPLACE.exec(a);
if(e){
var o=0;
do{
var i=AjxTemplate.__RE_REPLACE.lastIndex-e[0].length;
if(o<i){
AjxTemplate.__printStringLines(t,a.substring(o,i))
}
var s=e[1];
var n=e[2];
if(s){
r=AjxTemplate.__printDataLine(t,s)
}else{
if(n){
r=AjxTemplate.__printBufferLine(t,n)
}else{
r=AjxTemplate.__printLine(t,"\t",e[3].replace(/\n/g,"\n\t"),"\n")
}}
o=AjxTemplate.__RE_REPLACE.lastIndex
}
while(e=AjxTemplate.__RE_REPLACE.exec(a));
if(o<a.length){
r=AjxTemplate.__printStringLines(t,a.substring(o))
}}else{
r=AjxTemplate.__printStringLines(t,a)
}
t[r++]="\n";
t[r++]='\treturn _hasBuffer ? buffer.length : buffer.join("");';
return new Function("name,params,data,buffer",t.join(""))
};
AjxTemplate.__parseAttrs=function(a){
var t={}
,e;
AjxTemplate.__RE_ATTR.lastIndex=0;
while(e=AjxTemplate.__RE_ATTR.exec(a)){
var i=e[2];
t[e[1]]=i.substring(1,i.length-1)
}
return t
};
AjxTemplate.__printLine=function(e,a){
var o=e.length;
for(var t=1;
t<arguments.length;
t++){
e[o++]=arguments[t]
}
return o
};
AjxTemplate.__printStringLines=function(a,r){
var l=a.length;
for(var n=1;
n<arguments.length;
n++){
var h=arguments[n];
var t=h.split("\n");
for(var o=0;
o<t.length;
o++){
var e=t[o];
l=AjxTemplate.__printStringLine(a,e,n<t.length-1?"\n":"")
}}
return l
};
AjxTemplate.__printStringLine=function(e,a){
var o=e.length;
e[o++]='\tbuffer[_i++] = "';
for(var t=1;
t<arguments.length;
t++){
o=AjxTemplate.__printEscaped(e,arguments[t])
}
e[o++]='";';
return o
};
AjxTemplate.__printDataLine=function(t,a){
var i=t.length,e;
t[i++]="\tbuffer[_i++] = data";
AjxTemplate.__RE_PARAM_PART.lastIndex=0;
while(e=AjxTemplate.__RE_PARAM_PART.exec(a)){
t[i++]='["';
t[i++]=e[1];
t[i++]='"]';
if(e[2]!=null){
t[i++]=e[2]
}}
t[i++]=";";
return i
};
AjxTemplate.__printBufferLine=function(e,a){
var o=e.length;
e[o++]="\tbuffer[_i++] = ";
for(var t=1;
t<arguments.length;
t++){
e[o++]=arguments[t]
}
e[o++]=";";
return o
};
AjxTemplate.__printEscaped=function(e,t){
var a=e.length;
e[a++]=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace("\n","\\n").replace("\r","\\r").replace("\t","\\t");
return a
};
AjxDispatcher=function(){};
AjxDispatcher._registry={};
AjxDispatcher._package={};
AjxDispatcher._preLoad=[];
AjxDispatcher._postLoad=[];
AjxDispatcher._loadFunctionsEnabled=false;
AjxDispatcher._timedAction=null;
AjxDispatcher.addPackageLoadFunction=function(e,a){
var t=AjxDispatcher._getPackageData(e);
if(!t._loaded&&!AjxPackage.isDefined(e)){
t.callback.push(a)
}else{
AjxTimedAction.scheduleAction(new AjxTimedAction(a,a.run),0)
}};
AjxDispatcher.addPreLoadFunction=function(e){
AjxDispatcher._preLoad.push(e)
};
AjxDispatcher.addPostLoadFunction=function(e){
AjxDispatcher._postLoad.push(e)
};
AjxDispatcher.setPackageLoadFunction=AjxDispatcher.addPackageLoadFunction;
AjxDispatcher.setPreLoadFunction=AjxDispatcher.addPreLoadFunction;
AjxDispatcher.setPostLoadFunction=AjxDispatcher.addPostLoadFunction;
AjxDispatcher.enableLoadFunctions=function(e){
AjxDispatcher._loadFunctionsEnabled=e
};
AjxDispatcher.loaded=function(e){
var t=AjxDispatcher._getPackageData(e);
return(t&&t._loaded)||AjxPackage.isDefined(e)
};
AjxDispatcher.setLoaded=function(t,e){
var n=AjxDispatcher._getPackageData(t);
n._loaded=e;
if(e){
var o=n.callback||[];
for(var a=0;
a<o.length;
a++){
o[a].run()
}}};
AjxDispatcher.registerMethod=function(a,e,t){
AjxDispatcher._registry[a]={
pkg:e,callback:t}
};
AjxDispatcher.run=function(o){
if(!o){
return
}
var e,a,t,l,h;
if(typeof(o)=="string"){
e=o;
t=false;
h=false
}else{
e=o.method;
a=o.noLoad;
l=o.callback;
t=o.async!=null?o.async:Boolean(l);
h=o.preLoadOk!=null?o.preLoadOk:(l!=null)
}
var c=AjxDispatcher._registry[e];
if(!c){
AjxPackage.__log("API method '"+e+"' not found");
return
}
AjxPackage.__log("Run method: "+e);
var r=c.pkg;
var s=[];
for(var n=1;
n<arguments.length;
++n){
s.push(arguments[n])
}
if(l){
s.push(l)
}
return AjxDispatcher.require(r,t,c.callback,s,h)
};
AjxDispatcher.require=function(n,a,h,s,r){
if(!n){
return
}
if(typeof(n)=="string"){
n=[n]
}
var l=[];
for(var o=0;
o<n.length;
o++){
var t=n[o];
if(!AjxDispatcher._getPackageData(t)._loaded){
l.push(t)
}}
if(l.length==0){
return AjxDispatcher._postLoadCallback(n,false,h,s)
}else{
var e=AjxDispatcher._preLoad;
if(r&&AjxDispatcher._loadFunctionsEnabled&&e.length){
AjxPackage.__log("pre-load function");
AjxDispatcher._timedAction=new AjxCallback(null,AjxDispatcher._continueRequire,[l,a,h,s]);
for(var o=0;
o<e.length;
o++){
e[o].run()
}
window.setTimeout("AjxDispatcher._timedAction.run()",0)
}else{
return AjxDispatcher._continueRequire(l,a,h,s)
}}};
AjxDispatcher._continueRequire=function(s,e,c,r){
var l=s.join(", ");
AjxPackage.__log("------------------------------------- Loading package: "+l);
if(window.console){
console.log("------------------------------------- Loading package: "+l)
}
if(e&&c){
var o=new AjxCallback(null,AjxDispatcher._postLoadCallback,[s,true,c,r]);
AjxPackage.require({
name:s,callback:o}
)
}else{
var n=new Date();
for(var a=0;
a<s.length;
a++){
AjxPackage.require(s[a])
}
var h=new Date();
var d=h.getTime()-n.getTime();
AjxPackage.__log("LOAD TIME for "+l+": "+d);
return AjxDispatcher._postLoadCallback(s,true,c,r)
}};
AjxDispatcher._postLoadCallback=function(r,n,l,h){
for(var a=0;
a<r.length;
a++){
AjxDispatcher._getPackageData(r[a])._loaded=true
}
for(var a=0;
a<r.length;
a++){
var e=AjxDispatcher._getPackageData(r[a]);
if(n&&e.callback.length&&!e.callbackDone){
e.callbackDone=true;
AjxPackage.__log("Running post-load package function for "+r[a]);
var s=e.callback;
for(var t=0;
t<s.length;
t++){
s[t].run()
}
e.callback.length=0
}}
if(n){
var o=AjxDispatcher._postLoad;
if(AjxDispatcher._loadFunctionsEnabled&&o.length){
for(var a=0;
a<o.length;
a++){
o[a].run()
}}}
if(l){
return l.run1(h)
}};
AjxDispatcher._getPackageData=function(e){
if(!AjxDispatcher._package[e]){
AjxDispatcher._package[e]={
callback:[]}
}
return AjxDispatcher._package[e]
};
        </script>


<script type="text/javascript">
AjxPackage.setBasePath("/zimbra/js");
AjxPackage.setExtension("_all.js.zgz");
AjxPackage.setQueryString("v=201303220001");

AjxTemplate.setBasePath("/zimbra/templates");
AjxTemplate.setExtension(".template.js");
</script>

<script>
        AjxEnv.DEFAULT_LOCALE = "en_US";

        function switchToStandardClient() {
                document.location = appContextPath + "/?client=standard";
        }
        
                var enforceMinDisplay = true;
                var unsupported = (screen && (screen.width <= 800 && screen.height <= 600) && !false) || (AjxEnv.isSafari && !AjxEnv.isSafari4up);
                if (enforceMinDisplay && unsupported) {
                        switchToStandardClient();
                }
        
</script>
<script>
/**
 * DO NOT EDIT! This file is generated.
 * <p>
 * Any copy of this file checked into source control is merely for
 * convenience and should not be edited in any way.
 * <p>
 * Generated at Sun Sep 30 16:19:40 PDT 2012
 * @private
 */
AjxTimezoneData = {};

AjxTimezoneData.TRANSITION_YEAR = 2012;

AjxTimezoneData.TIMEZONE_RULES = [
        { serverId: "Etc/GMT+12", clientId: "Etc/GMT+12", score: 100,  standard: { offset: -720, tzname: "GMT+12" } },
        { serverId: "Pacific/Midway", clientId: "Pacific/Midway", score: 100,  standard: { offset: -660, tzname: "SST" } },
        { serverId: "Pacific/Honolulu", clientId: "Pacific/Honolulu", score: 200,  standard: { offset: -600, tzname: "HST" } },
        { serverId: "America/Anchorage", clientId: "America/Anchorage", score: 200, 
          standard: { offset: -540, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "AKST" },
          daylight: { offset: -480, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "AKDT" }
        },
        { serverId: "America/Los_Angeles", clientId: "America/Los_Angeles", score: 200, 
          standard: { offset: -480, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "PST" },
          daylight: { offset: -420, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "PDT" }
        },
        { serverId: "America/Tijuana", clientId: "America/Tijuana", score: 100, 
          standard: { offset: -480, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "PST" },
          daylight: { offset: -420, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "PDT" }
        },
        { serverId: "America/Chihuahua", clientId: "America/Chihuahua", score: 100, 
          standard: { offset: -420, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MST" },
          daylight: { offset: -360, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "MDT" }
        },
        { serverId: "America/Denver", clientId: "America/Denver", score: 200, 
          standard: { offset: -420, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "MST" },
          daylight: { offset: -360, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "MDT" }
        },
        { serverId: "America/Phoenix", clientId: "America/Phoenix", score: 200,  standard: { offset: -420, tzname: "MST" } },
        { serverId: "America/Chicago", clientId: "America/Chicago", score: 200, 
          standard: { offset: -360, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "CST" },
          daylight: { offset: -300, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "CDT" }
        },
        { serverId: "America/Guatemala", clientId: "America/Guatemala", score: 100,  standard: { offset: -360 } },
        { serverId: "America/Mexico_City", clientId: "America/Mexico_City", score: 100, 
          standard: { offset: -360, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CST" },
          daylight: { offset: -300, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CDT" }
        },
        { serverId: "America/Regina", clientId: "America/Regina", score: 200,  standard: { offset: -360, tzname: "CST" } },
        { serverId: "America/Bogota", clientId: "America/Bogota", score: 100,  standard: { offset: -300 } },
        { serverId: "America/Indiana/Indianapolis", clientId: "America/Indiana/Indianapolis", score: 100, 
          standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "EST" },
          daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "EDT" }
        },
        { serverId: "America/New_York", clientId: "America/New_York", score: 200, 
          standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "EST" },
          daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "EDT" }
        },
        { serverId: "America/Caracas", clientId: "America/Caracas", score: 100,  standard: { offset: -270, tzname: "VET" } },
        { serverId: "America/Asuncion", clientId: "America/Asuncion", score: 100, 
          standard: { offset: -240, mon: 4, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 8 ], tzname: "PYT" },
          daylight: { offset: -180, mon: 10, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "PYST" }
        },
        { serverId: "America/Cuiaba", clientId: "America/Cuiaba", score: 100, 
          standard: { offset: -240, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 2, 19 ], tzname: "AMT" },
          daylight: { offset: -180, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 21 ], tzname: "AMST" }
        },
        { serverId: "America/Guyana", clientId: "America/Guyana", score: 100,  standard: { offset: -240, tzname: "GYT" } },
        { serverId: "America/Halifax", clientId: "America/Halifax", score: 100, 
          standard: { offset: -240, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "AST" },
          daylight: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "ADT" }
        },
        { serverId: "America/Santiago", clientId: "America/Santiago", score: 100, 
          standard: { offset: -240, mon: 4, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CLT" },
          daylight: { offset: -180, mon: 10, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 14 ], tzname: "CLST" }
        },
        { serverId: "America/St_Johns", clientId: "America/St_Johns", score: 100, 
          standard: { offset: -210, mon: 11, week: 1, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2012, 11, 4 ], tzname: "NST" },
          daylight: { offset: -150, mon: 3, week: 2, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2012, 3, 11 ], tzname: "NDT" }
        },
        { serverId: "America/Argentina/Buenos_Aires", clientId: "America/Argentina/Buenos_Aires", score: 100,  standard: { offset: -180 } },
        { serverId: "America/Cayenne", clientId: "America/Cayenne", score: 100,  standard: { offset: -180, tzname: "GFT" } },
        { serverId: "America/Godthab", clientId: "America/Godthab", score: 100, 
          standard: { offset: -180, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "WGT" },
          daylight: { offset: -120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "WGST" }
        },
        { serverId: "America/Montevideo", clientId: "America/Montevideo", score: 100, 
          standard: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "UYT" },
          daylight: { offset: -120, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "UYST" }
        },
        { serverId: "America/Sao_Paulo", clientId: "America/Sao_Paulo", score: 100, 
          standard: { offset: -180, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 2, 19 ], tzname: "BRT" },
          daylight: { offset: -120, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 21 ], tzname: "BRST" }
        },
        { serverId: "Atlantic/South_Georgia", clientId: "Atlantic/South_Georgia", score: 100,  standard: { offset: -120, tzname: "GST" } },
        { serverId: "Atlantic/Azores", clientId: "Atlantic/Azores", score: 100, 
          standard: { offset: -60, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AZOT" },
          daylight: { offset: 0, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AZOST" }
        },
        { serverId: "Atlantic/Cape_Verde", clientId: "Atlantic/Cape_Verde", score: 100,  standard: { offset: -60, tzname: "CVT" } },
        { serverId: "Africa/Casablanca", clientId: "Africa/Casablanca", score: 100, 
          standard: { offset: 0, mon: 8, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 8, 12 ], tzname: "WET" },
          daylight: { offset: 60, mon: 5, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 5, 6 ], tzname: "WEST" }
        },
        { serverId: "Africa/Monrovia", clientId: "Africa/Monrovia", score: 100,  standard: { offset: 0, tzname: "GMT" } },
        { serverId: "Europe/London", clientId: "Europe/London", score: 100, 
          standard: { offset: 0, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "GMT/BST" },
          daylight: { offset: 60, mon: 3, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "GMT/BST" }
        },
        { serverId: "UTC", clientId: "UTC", score: 100,  standard: { offset: 0, tzname: "UTC" } },
        { serverId: "Africa/Algiers", clientId: "Africa/Algiers", score: 100,  standard: { offset: 60, tzname: "CET" } },
        { serverId: "Africa/Windhoek", clientId: "Africa/Windhoek", score: 100, 
          standard: { offset: 60, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "WAT" },
          daylight: { offset: 120, mon: 9, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 2 ], tzname: "WAST" }
        },
        { serverId: "Europe/Belgrade", clientId: "Europe/Belgrade", score: 100, 
          standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
          daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
        },
        { serverId: "Europe/Berlin", clientId: "Europe/Berlin", score: 200, 
          standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
          daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
        },
        { serverId: "Europe/Brussels", clientId: "Europe/Brussels", score: 100, 
          standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
          daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
        },
        { serverId: "Europe/Warsaw", clientId: "Europe/Warsaw", score: 100, 
          standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
          daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
        },
        { serverId: "Africa/Cairo", clientId: "Africa/Cairo", score: 100, 
          standard: { offset: 120, mon: 9, week: -1, wkday: 5, hour: 0, min: 0, sec: 0, trans: [ 2012, 9, 27 ], tzname: "EET" },
          daylight: { offset: 180, mon: 4, week: -1, wkday: 6, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 27 ], tzname: "EEST" }
        },
        { serverId: "Africa/Harare", clientId: "Africa/Harare", score: 100,  standard: { offset: 120, tzname: "CAT" } },
        { serverId: "Asia/Amman", clientId: "Asia/Amman", score: 100, 
          standard: { offset: 120, mon: 10, week: -1, wkday: 6, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 26 ], tzname: "EET" },
          daylight: { offset: 180, mon: 3, week: -1, wkday: 5, hour: 23, min: 59, sec: 59, trans: [ 2012, 3, 29 ], tzname: "EEST" }
        },
        { serverId: "Asia/Beirut", clientId: "Asia/Beirut", score: 100, 
          standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
          daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
        },
        { serverId: "Asia/Jerusalem", clientId: "Asia/Jerusalem", score: 100, 
          standard: { offset: 120, mon: 9, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 9 ], tzname: "IST" },
          daylight: { offset: 180, mon: 3, week: -1, wkday: 6, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 30 ], tzname: "IDT" }
        },
        { serverId: "Europe/Athens", clientId: "Europe/Athens", score: 200, 
          standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
          daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
        },
        { serverId: "Europe/Helsinki", clientId: "Europe/Helsinki", score: 100, 
          standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
          daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
        },
        { serverId: "Europe/Minsk", clientId: "Europe/Minsk", score: 100, 
          standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
          daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
        },
        { serverId: "Africa/Nairobi", clientId: "Africa/Nairobi", score: 200,  standard: { offset: 180, tzname: "EAT" } },
        { serverId: "Asia/Baghdad", clientId: "Asia/Baghdad", score: 100,  standard: { offset: 180 } },
        { serverId: "Asia/Kuwait", clientId: "Asia/Kuwait", score: 100,  standard: { offset: 180, tzname: "AST" } },
        { serverId: "Europe/Moscow", clientId: "Europe/Moscow", score: 100, 
          standard: { offset: 180, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MSK/MSD" },
          daylight: { offset: 240, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "MSK/MSD" }
        },
        { serverId: "Asia/Tehran", clientId: "Asia/Tehran", score: 100, 
          standard: { offset: 210, mon: 9, week: 4, wkday: 4, hour: 0, min: 0, sec: 0, trans: [ 2012, 9, 26 ], tzname: "IRST" },
          daylight: { offset: 270, mon: 3, week: 4, wkday: 2, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 26 ], tzname: "IRDT" }
        },
        { serverId: "Asia/Baku", clientId: "Asia/Baku", score: 100, 
          standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 5, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AZT" },
          daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AZST" }
        },
        { serverId: "Asia/Muscat", clientId: "Asia/Muscat", score: 100,  standard: { offset: 240, tzname: "GST" } },
        { serverId: "Asia/Tbilisi", clientId: "Asia/Tbilisi", score: 200,  standard: { offset: 240, tzname: "GET" } },
        { serverId: "Asia/Yerevan", clientId: "Asia/Yerevan", score: 100, 
          standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AMT" },
          daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AMST" }
        },
        { serverId: "Indian/Mauritius", clientId: "Indian/Mauritius", score: 100,  standard: { offset: 240 } },
        { serverId: "Asia/Kabul", clientId: "Asia/Kabul", score: 100,  standard: { offset: 270, tzname: "AFT" } },
        { serverId: "Asia/Karachi", clientId: "Asia/Karachi", score: 200,  standard: { offset: 300 } },
        { serverId: "Asia/Tashkent", clientId: "Asia/Tashkent", score: 100,  standard: { offset: 300, tzname: "UZT" } },
        { serverId: "Asia/Yekaterinburg", clientId: "Asia/Yekaterinburg", score: 100, 
          standard: { offset: 300, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "YEKT" },
          daylight: { offset: 360, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "YEKST" }
        },
        { serverId: "Asia/Colombo", clientId: "Asia/Colombo", score: 100,  standard: { offset: 330, tzname: "IST" } },
        { serverId: "Asia/Kolkata", clientId: "Asia/Kolkata", score: 200,  standard: { offset: 330, tzname: "IST" } },
        { serverId: "Asia/Almaty", clientId: "Asia/Almaty", score: 100,  standard: { offset: 360, tzname: "ALMT" } },
        { serverId: "Asia/Dhaka", clientId: "Asia/Dhaka", score: 100,  standard: { offset: 360 } },
        { serverId: "Asia/Novosibirsk", clientId: "Asia/Novosibirsk", score: 100, 
          standard: { offset: 360, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "NOVT" },
          daylight: { offset: 420, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "NOVST" }
        },
        { serverId: "Asia/Rangoon", clientId: "Asia/Rangoon", score: 100,  standard: { offset: 390, tzname: "MMT" } },
        { serverId: "Asia/Bangkok", clientId: "Asia/Bangkok", score: 100,  standard: { offset: 420, tzname: "ICT" } },
        { serverId: "Asia/Krasnoyarsk", clientId: "Asia/Krasnoyarsk", score: 100, 
          standard: { offset: 420, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "KRAT" },
          daylight: { offset: 480, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "KRAST" }
        },
        { serverId: "Asia/Hong_Kong", clientId: "Asia/Hong_Kong", score: 200,  standard: { offset: 480 } },
        { serverId: "Asia/Irkutsk", clientId: "Asia/Irkutsk", score: 100, 
          standard: { offset: 480, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "IRKT" },
          daylight: { offset: 540, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "IRKST" }
        },
        { serverId: "Asia/Kuala_Lumpur", clientId: "Asia/Kuala_Lumpur", score: 100,  standard: { offset: 480, tzname: "MYT" } },
        { serverId: "Asia/Taipei", clientId: "Asia/Taipei", score: 100,  standard: { offset: 480 } },
        { serverId: "Asia/Ulaanbaatar", clientId: "Asia/Ulaanbaatar", score: 100,  standard: { offset: 480 } },
        { serverId: "Australia/Perth", clientId: "Australia/Perth", score: 100,  standard: { offset: 480, tzname: "WST" } },
        { serverId: "Asia/Seoul", clientId: "Asia/Seoul", score: 100,  standard: { offset: 540 } },
        { serverId: "Asia/Tokyo", clientId: "Asia/Tokyo", score: 200,  standard: { offset: 540 } },
        { serverId: "Asia/Yakutsk", clientId: "Asia/Yakutsk", score: 100, 
          standard: { offset: 540, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "YAKT" },
          daylight: { offset: 600, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "YAKST" }
        },
        { serverId: "Australia/Adelaide", clientId: "Australia/Adelaide", score: 100, 
          standard: { offset: 570, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CST" },
          daylight: { offset: 630, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "CST" }
        },
        { serverId: "Australia/Darwin", clientId: "Australia/Darwin", score: 100,  standard: { offset: 570, tzname: "CST" } },
        { serverId: "Asia/Vladivostok", clientId: "Asia/Vladivostok", score: 100, 
          standard: { offset: 600, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "VLAT" },
          daylight: { offset: 660, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "VLAST" }
        },
        { serverId: "Australia/Brisbane", clientId: "Australia/Brisbane", score: 200,  standard: { offset: 600, tzname: "EST" } },
        { serverId: "Australia/Hobart", clientId: "Australia/Hobart", score: 100, 
          standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "EST" },
          daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "EST" }
        },
        { serverId: "Australia/Sydney", clientId: "Australia/Sydney", score: 200, 
          standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "EST" },
          daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "EST" }
        },
        { serverId: "Pacific/Guam", clientId: "Pacific/Guam", score: 100,  standard: { offset: 600, tzname: "ChST" } },
        { serverId: "Asia/Magadan", clientId: "Asia/Magadan", score: 100, 
          standard: { offset: 660, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MAGT" },
          daylight: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "MAGST" }
        },
        { serverId: "Asia/Kamchatka", clientId: "Asia/Kamchatka", score: 100, 
          standard: { offset: 720, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "PETT" },
          daylight: { offset: 780, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "PETST" }
        },
        { serverId: "Pacific/Auckland", clientId: "Pacific/Auckland", score: 100, 
          standard: { offset: 720, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "NZST" },
          daylight: { offset: 780, mon: 9, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 30 ], tzname: "NZDT" }
        },
        { serverId: "Pacific/Fiji", clientId: "Pacific/Fiji", score: 100, 
          standard: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "FJT" },
          daylight: { offset: 780, mon: 10, week: 4, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "FJST" }
        },
        { serverId: "Pacific/Tongatapu", clientId: "Pacific/Tongatapu", score: 100,  standard: { offset: 780 } }
];

</script>

            <script src="./Seals jpeg by Jesse Mechling_files/Startup1_1_all.js.zgz"></script>
        
            <script src="./Seals jpeg by Jesse Mechling_files/Startup1_2_all.js.zgz"></script>
        
<script type="text/javascript">
function ZmSkin(e){
this.hints=this.mergeObjects({
name:"velodrome2",version:"2.0.0",logo:{
url:"http://www.comcast.net/"}
,banner:{
position:"static",url:"http://www.comcast.net/"}
,userInfo:{
position:"static"}
,search:{
position:"static"}
,quota:{
position:"static"}
,appChooser:{
direction:"LR"}
,helpButton:{
style:"link",container:"quota",url:""}
,logoutButton:{
style:"link",container:"quota"}
,toast:{
location:"N",transitions:[{
type:"fade-in",step:10,duration:200}
,{
type:"pause",duration:1000}
,{
type:"fade-out",step:-10,duration:500}
]}
,skin:{
containers:"skin_outer"}
,tree:{
minWidth:150,maxWidth:300,containers:["skin_td_outer_tree","skin_outer_tree","skin_col_tree_inner","skin_col_tree"]}
,searchBuilder:{
containers:["skin_container_search_builder_outer","skin_td_search_builder"]}
,topToolbar:{
containers:["skin_tr_top_toolbar","!skin_tr_top_toolbar_shim"]}
,bottomToolbar:{
containers:["skin_tr_bottom_toolbar","!skin_tr_bottom_toolbar_shim"]}
,treeFooter:{
containers:["skin_tr_tree_footer_sep","skin_tr_tree_footer"]}
,topAd:{
containers:["skin_tr_top_ad"]}
,sidebarAd:{
containers:["skin_td_sidebar_ad"]}
,fullScreen:{
containers:["skin_tr_toolbar_full","skin_tr_main_full","!skin_tr_toolbar","!skin_tr_main","!skin_tr_status"]}}
,e)
}
window.BaseSkin=ZmSkin;
ZmSkin.prototype={
show:function(a,r){
var s=this.hints[a]&&this.hints[a].containers;
if(s){
if(typeof s=="function"){
s(this,r);
skin._reflowApp();
return
}
if(typeof s=="string"){
s=[s]
}
for(var n=0;
n<s.length;
n++){
var o=s[n];
var t=o.replace(/^!/,"");
var e=o!=t;
this._showEl(t,e?!r:r)
}
skin._reflowApp()
}
if(a=="fullScreen"){
this._showFullScreen(r)
}}
,hide:function(e){
this.show(e,false)
}
,gotoApp:function(e,t){
appCtxt.getAppController().activateApp(e,null,t)
}
,gotoPrefs:function(e){
if(appCtxt.getCurrentAppName()!=ZmApp.PREFERENCES){
var t=new AjxCallback(this,this._gotoPrefPage,[e]);
this.gotoApp(ZmApp.PREFERENCES,t)
}else{
this._gotoPrefPage(e)
}}
,mergeObjects:function(e,o){
if(e==null){
e={}
}
for(var a=1;
a<arguments.length;
a++){
var n=arguments[a];
for(var t in n){
var s=e[t];
if(typeof s=="object"&&!(s instanceof Array)){
this.mergeObjects(e[t],n[t]);
continue
}
e[t]=n[t]
}}
return e
}
,getTreeWidth:function(){
return Dwt.getSize(this._getEl(this.hints.tree.containers[0])).x
}
,setTreeWidth:function(e){
this._setContainerSizes("tree",e,null)
}
,showTopAd:function(e){
skin._showEl("skin_tr_top_ad",e);
skin._reflowApp()
}
,hideTopAd:function(){
skin.showTopAd(false)
}
,getTopAdContainer:function(){
return skin._getEl("skin_container_top_ad")
}
,showSidebarAd:function(e){
var t="skin_td_sidebar_ad";
if(e!=null){
skin._setSize(t,e)
}
skin._showEl(t);
skin._reflowApp()
}
,hideSidebarAd:function(){
var e="skin_td_sidebar_ad";
skin._hideEl(e);
skin._reflowApp()
}
,getSidebarAdContainer:function(){
return this._getEl("skin_container_sidebar_ad")
}
,_getEl:function(e){
return(typeof e=="string"?document.getElementById(e):e)
}
,_showEl:function(n,o){
var t=this._getEl(n);
if(!t){
return
}
var a;
if(o==false){
a="none"
}else{
var e=t.tagName;
if(e=="TD"&&document.all==null){
a="table-cell"
}else{
if(e=="TR"&&document.all==null){
a="table-row"
}else{
a="block"
}}}
t.style.display=a
}
,_hideEl:function(e){
this._showEl(e,false)
}
,_reparentEl:function(o,e){
var a=this._getEl(e);
var t=a&&this._getEl(o);
if(t){
a.appendChild(t)
}}
,_setSize:function(o,a,e){
var t=this._getEl(o);
if(!t){
return
}
if(a!=null){
t.style.width=a
}
if(e!=null){
t.style.height=e
}}
,_setContainerSizes:function(n,a,e){
var o=this.hints[n].containers;
for(var t=0;
t<o.length;
t++){
this._setSize(o[t],a,null)
}}
,_reflowApp:function(){
if(window._zimbraMail){
window._zimbraMail.getAppViewMgr().fitAll()
}}
,_showFullScreen:function(o){
var a="skin_container_app_top_toolbar";
var t=o==null||o;
var e=t?"skin_border_app_top_toolbar_full":"skin_td_app_top_toolbar";
this._reparentEl(a,e);
if(AjxEnv.isIE){
var n=document.getElementById("skin_container_app_main_full");
if(n){
Dwt.setVisible(n,t)
}}}
,_gotoPrefPage:function(a){
if(a==null){
return
}
var o=appCtxt.getApp(ZmApp.PREFERENCES);
var t=o.getPrefController();
var e=t.getPrefsView();
e.selectSection(a)
}};
window.skin=new ZmSkin();
function VelodromeSkin(){
BaseSkin.call(this,{
appChooser:{
direction:"LR",fullWidth:true}
,helpButton:{
style:"link",container:"quota",hideIcon:true,url:"http://www.comcast.net/help/faq/index.jsp?cat=Email#SmartZone"}
,logoutButton:{
style:"link",container:"quota",hideIcon:true}
,quota:{
containers:["skin_td_quota"]}
,userInfo:{
position:"static"}
,sidebarAd:{
containers:function(t,e){
t._showEl("skin_sidebar_ad_outer",e);
t._reflowApp()
}}
,fullScreen:{
containers:["skin_tr_main_full","!skin_tr_main","!skin_td_tree_outer","!skin_td_tree_app_sash"]}
,searchBuilder:{
containers:["skin_tr_search_builder_toolbar","skin_tr_search_builder","skin_td_search_builder_toolbar","skin_td_search_builder"]}
,treeFooter:{
containers:["skin_tr_tree_footer","skin_td_tree_footer","skin_container_tree_footer"]}
,tree:{
containers:["skin_td_tree_outer"],resizeContainers:["skin_col_tree","skin_td_tree_outer"],maxWidth:400}}
)
}
VelodromeSkin.showListeners=[];
VelodromeSkin.prototype=new BaseSkin;
VelodromeSkin.prototype.constructor=VelodromeSkin;
VelodromeSkin.prototype.show=function(h,s){
ZmFolder.HIDE_ID[ZmFolder.ID_AUTO_ADDED]=true;
BaseSkin.prototype.show.apply(this,arguments);
if(h=="fullScreen"){
s=s==null||s;
var r=s?"skin_full_toolbar_container":"skin_main_toolbar_container";
var n=document.getElementById(r);
var o="skin_container_app_top_toolbar";
var e=document.getElementById(o);
n.appendChild(e)
}
if(!this._hasRunListeners){
var a=VelodromeSkin.showListeners;
for(var t=0;
t<a.length;
t++){
if(a[t] instanceof AjxCallback){
a[t].run()
}}
this._hasRunListeners=true
}};
VelodromeSkin.prototype.getSidebarAdContainer=function(){
return document.getElementById("skin_container_sidebar_ad")
};
VelodromeSkin.prototype._getPortalToolBarOps=function(){
return[]
};
VelodromeSkin.prototype.setTreeWidth=function(e){
ZmSkin.prototype.setTreeWidth.call(this,e)
};
VelodromeSkin.prototype._setContainerSizes=function(n,a,e){
var o=this.hints[n].resizeContainers||this.hints[n].containers;
for(var t=0;
t<o.length;
t++){
this._setSize(o[t],a,null)
}};
skin=new VelodromeSkin();
skin.__handleMailLaunch=function(){
appCtxt.set(ZmSetting.SEND_ON_BEHALF_OF,true)
};
ZmZimbraMail.addAppListener(ZmApp.MAIL,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin.__handleMailLaunch));
VelodromeSkin.prototype.__handleVoiceLaunch=function(){
ZmVoiceApp.overviewFallbackApp=ZmApp.MAIL
};
ZmZimbraMail.addAppListener(ZmApp.VOICE,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin.__handleVoiceLaunch));
skin.__handlePortalLaunch=function(){
this.overrideAPI(ZmPortalController.prototype,"_getToolBarOps",this._getPortalToolBarOps);
var e=new AjxListener(this,this._historyChangeListener);
appCtxt.getHistoryMgr().addListener(e);
appCtxt.getAppController().addPostRenderCallback(e)
};
AjxDispatcher.addPackageLoadFunction("Portal",new AjxCallback(skin,skin.__handlePortalLaunch));
VelodromeSkin.prototype.overrideAPI=function(a,t,o){
o=o||this[t];
if(o){
var e=a[t];
a[t]=function(){
o.func=e;
return o.apply(this,arguments)
};
a[t].func=e
}};
VelodromeSkin.prototype.setShortcut=function(e){};
skin.overrideAPI(DwtMenuItem.prototype,"setShortcut");
skin.overrideAPI(ZmContactsApp.prototype,"_registerPrefs",function(){}
);
VelodromeSkin.prototype._parseHashString=function(a){
try{
if(!a){
a=window.location.hash
}
return AjxStringUtil.parseQueryString(a.replace(/^#*/,"?"))
}
catch(t){
console.warn(t.stack,t)
}};
VelodromeSkin.prototype._historyChangeListener=function(e){
var t=this._parseHashString(e&&e.data);
if(t&&t.app){
appCtxt.getAppController().activateApp(t.app)
}};
VelodromeSkin.prototype._noImportExport_handlePrefsPreLaunch=function(){
var e="IMPORT_FOLDER";
var t=ZmPref.getPrefSectionWithPref(e);
ZmPref.unregisterPrefSection(t&&t.id);
e="CHECKED_ZIMLETS";
t=ZmPref.getPrefSectionWithPref(e);
ZmPref.unregisterPrefSection(t&&t.id)
};
ZmZimbraMail.addAppListener(ZmApp.PREFERENCES,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin._noImportExport_handlePrefsPreLaunch));
VelodromeSkin.prototype._collapseImapTrees_handlePreStartup=function(){
appCtxt.set(ZmSetting.COLLAPSE_IMAP_TREES,true)
};
ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,new AjxListener(skin,skin._collapseImapTrees_handlePreStartup));
VelodromeSkin.prototype._saveToImapSent_handlePreStartup=function(){
appCtxt.set(ZmSetting.SAVE_TO_IMAP_SENT,true)
};
ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,new AjxListener(skin,skin._saveToImapSent_handlePreStartup));
VelodromeSkin.prototype._MailList_initializeToolBar=function(t){
arguments.callee.func.call(this,t);
var e=this._toolbar[t];
if(e){
var a;
a=e.getButton(ZmOperation.CHECK_MAIL);
if(a){
if(!appCtxt.isOffline){
var o=(appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT)?ZmMsg.checkMailPrefDefault_velodrome:ZmMsg.checkMailPrefUpdate_velodrome;
a.setToolTipContent(o)
}}
a=e.getButton(ZmOperation.PRINT);
if(a){
a.setText(ZmMsg.print)
}
if(!appCtxt.isChildWindow){
a=e.getButton(ZmOperation.MOVE);
if(a){
a.setText(ZmMsg.move)
}
a=e.getButton(ZmOperation.DELETE_MENU);
if(a){
a.setText(ZmMsg.del)
}
a=e.getButton(ZmOperation.DELETE);
if(a){
a.setText(ZmMsg.del)
}
if(AjxEnv.is800x600orLower){
a=e.getButton(REPLY);
if(a){
a.setText("")
}
a=e.getButton(REPLY_ALL);
if(a){
a.setText("")
}}}}};
VelodromeSkin.prototype._DoublePane_getToolBarOps=VelodromeSkin.prototype._MailList_getToolBarOps=function(){
if(appCtxt.isChildWindow){
return[ZmOperation.PRINT,ZmOperation.CLOSE]
}
var e=this._getDefaultToolBarOps();
e.push(ZmOperation.SEP,ZmOperation.VIEW_MENU);
return e
};
VelodromeSkin.prototype._Msg_getToolBarOps=VelodromeSkin.prototype._Conv_getToolBarOps=function(){
if(appCtxt.isChildWindow){
return[ZmOperation.PRINT,ZmOperation.CLOSE]
}
var e=this._getDefaultToolBarOps();
e.push(ZmOperation.TAG_MENU,ZmOperation.SEP);
if(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)){
e.push(ZmOperation.DETACH)
}
return e
};
VelodromeSkin.prototype._Mail_getDefaultToolBarOps=function(){
var e=[];
e.push(ZmOperation.NEW_MENU,ZmOperation.CHECK_MAIL,ZmOperation.SEP,ZmOperation.REPLY,ZmOperation.REPLY_ALL,ZmOperation.FORWARD,ZmOperation.SEP,ZmOperation.EDIT);
e.push((window.ZmConvController&&this instanceof ZmConvController)?ZmOperation.DELETE_MENU:ZmOperation.DELETE);
e.push(ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.PRINT);
return e
};
VelodromeSkin.prototype._Mail_resetOperations=function(n,a){
arguments.callee.func.call(this,n,a);
if(n&&n instanceof ZmToolBar){
var s;
var e=this._getSearchFolderId();
if(a==1&&(e!=ZmFolder.ID_DRAFTS)){
var r=this._listView[this._currentView].getSelection();
if(r&&r.length){
s=r[0]
}}
var t=(s&&s.isDraft)||(e==ZmFolder.ID_DRAFTS);
var o=n.getButton&&n.getButton(ZmOperation.VIEW_MENU);
if(o){
var h=o.getMenu();
if(h){
h.enable(ZmOperation.DETACH,(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)&&!t&&a==1))
}}}};
VelodromeSkin.prototype._Mail_setupGroupByMenuItems=function(e,a){
arguments.callee.func.call(this,e,a);
if(a){
var t=a.createMenuItem(ZmOperation.DETACH,{
image:"OpenInNewWindow",text:ZmMsg.detach}
);
t.addSelectionListener(this._listeners[ZmOperation.DETACH])
}};
VelodromeSkin.prototype._Compose_handleResponseSendMsg=function(a,n,s,e){
var o=e.getResponse();
delete (this._autoSaveInterval);
this._initAutoSave();
this._app.skipHistory=this._skipHistory;
var t=this._processSendMsg(a,n,o);
this._app.skipHistory=null;
this._msg=n;
if(s){
s.run(e)
}
if(this.sendMsgCallback){
this.sendMsgCallback.run(e)
}
appCtxt.notifyZimlets("onSendMsgSuccess",[this,n]);
if(t){
this._app.popView(true,this._currentView,this._skipHistory)
}};
VelodromeSkin.prototype._Compose_cancelCompose=function(){
var t=this._composeView.isDirty();
var e=t||(this._draftType==ZmComposeController.DRAFT_TYPE_AUTO);
if(!e){
this._composeView.reset(true)
}else{
this._composeView.enableInputs(false)
}
this._composeView.reEnableDesignMode();
this._app.popView(!e,null,this._skipHistory)
};
VelodromeSkin.prototype._Compose_setView=function(e){
this._skipHistory=!!e.skipHistory;
this._defuseSubjectRegex=!!e.defuseSubjectRegex;
return arguments.callee.func.call(this,e)
};
VelodromeSkin.prototype._Compose_setSubject=function(a,n,t){
var e=this._controller._defuseSubjectRegex;
if(e){
var o=ZmComposeView.SUBJ_PREFIX_RE;
ZmComposeView.SUBJ_PREFIX_RE=/[^\w\W]/
}
arguments.callee.func.call(this,a,n,t);
if(e){
ZmComposeView.SUBJ_PREFIX_RE=o
}};
VelodromeSkin.prototype._MailApp_popView=function(t,e,a){
return arguments.callee.func.call(this,t,e,a||this.skipHistory)
};
VelodromeSkin.prototype._AppViewMgr_popView=function(n,e,h){
if(!this._currentView){
return false
}
var r=(n==ZmAppViewMgr.PENDING_VIEW);
if(r){
e=n;
n=true
}
if(e&&!r&&(this.getCurrentViewId()!=e)){
return false
}
var s=false,a=false;
var o=null;
if(!this._hidden.length&&!this._isNewWindow){
s=!this._isTabView[this._currentView];
a=true;
var t=AjxStringUtil.parseQueryString();
if(t&&((t.view&&t.view=="compose")||t.id)){
o=ZmApp.MAIL
}}
if(!this._hideView(this._currentView,n,s)){
this._pendingAction=new AjxCallback(this,this.popView,[ZmAppViewMgr.PENDING_VIEW,e,h]);
this._pendingView=null;
return false
}
this._deactivateView(this._views[this._currentView]);
if(this._isTabView[this._currentView]){
appCtxt.getAppChooser().removeButton(this._tabParams[this._currentView].id)
}
if(a){
if(o){
this._controller.activateApp(ZmApp.MAIL)
}
return !s
}
this._lastView=this._currentView;
this._currentView=this._hidden.pop();
if(!this._currentView&&this._isNewWindow){
window.close();
return false
}
if(!this._showView(this._currentView,this._popCallback,null,n,true)){
return false
}
this._removeFromHidden(this._currentView);
if(this._historyMgr&&!h){
if(this._noHistory){
this._noHistory=false
}else{
this._ignoreHistoryChange=true;
history.back()
}}
this.addComponents(this._views[this._currentView]);
this._layout(this._currentView);
return true
};
VelodromeSkin.prototype._createComcastAppIconButton=function(){
if(!appCtxt.isChildWindow){
VelodromeSkin.prototype._Msg_getTabParams=function(t,e){
return{
id:t,image:"MessageView",textPrecedence:85,tooltip:ZmMsgController.DEFAULT_TAB_TEXT,tabCallback:e,hasIcon:true}
};
VelodromeSkin.prototype._Compose_getTabParams=function(){
return{
id:this.tabId,image:"NewMessage",textPrecedence:75,tooltip:ZmComposeController.DEFAULT_TAB_TEXT,hasIcon:true}
};
ComcastAppIconButton=function(e){
if(arguments.length==0){
return
}
ZmAppButton.call(this,e)
};
ComcastAppIconButton.prototype=new ZmAppButton;
ComcastAppIconButton.prototype.constructor=ComcastAppIconButton;
ComcastAppIconButton.prototype.toString=function(){
return"ComcastAppIconButton"
};
ComcastAppIconButton.prototype.TEMPLATE="share.Widgets#ZmAppChooserIconButton";
VelodromeSkin.prototype._appChooser_addButton=function(o,a){
var t={
parent:this,id:ZmId.getButtonId(ZmId.APP,o),text:a.text,image:a.image,index:a.index};
var e=(a.hasIcon)?new ComcastAppIconButton(t):new ZmAppButton(t);
e.setToolTipContent(a.tooltip);
e.textPrecedence=a.textPrecedence;
e.imagePrecedence=a.imagePrecedence;
e.setData(Dwt.KEY_ID,o);
e.addSelectionListener(this._buttonListener);
this._buttons[o]=e;
if(e.textPrecedence||e.imagePrecedence){
this._createPrecedenceList()
}
this.adjustSize();
return e
}
}};
VelodromeSkin.prototype._mail_handleStartup2Load=function(){
if(appCtxt){
if(!appCtxt.isChildWindow){
this._createComcastAppIconButton();
var e=window.ZmAppChooser&&ZmAppChooser.prototype;
if(e){
this.overrideAPI(ZmAppChooser.prototype,"addButton",this._appChooser_addButton)
}}
appCtxt.getApp("Mail").getDataSourceCollection()
}};
AjxDispatcher.addPackageLoadFunction("Startup2",new AjxCallback(skin,skin._mail_handleStartup2Load));
VelodromeSkin.prototype._mail_handleMailCoreLoad=function(){
var e=window.ZmDoublePaneController&&ZmDoublePaneController.prototype;
if(e){
this.overrideAPI(e,"_getToolBarOps",this._DoublePane_getToolBarOps);
this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations)
}
var e=window.ZmMailListController&&ZmMailListController.prototype;
if(e){
this.overrideAPI(e,"_initializeToolBar",this._MailList_initializeToolBar);
this.overrideAPI(e,"_getToolBarOps",this._MailList_getToolBarOps);
this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations);
this.overrideAPI(e,"_setupGroupByMenuItems",this._Mail_setupGroupByMenuItems)
}
ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_MESSAGE]="newMessage";
ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_FOLDER]="newFolder"
};
VelodromeSkin.prototype._mail_handleMailLoad=function(){
var e=window.ZmMsgController&&ZmMsgController.prototype;
if(e){
this.overrideAPI(e,"_getToolBarOps",this._Msg_getToolBarOps);
this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
this.overrideAPI(e,"_getTabParams",this._Msg_getTabParams)
}
var e=window.ZmConvController&&ZmConvController.prototype;
if(e){
this.overrideAPI(e,"_getToolBarOps",this._Conv_getToolBarOps);
this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations)
}
var e=window.ZmComposeController&&ZmComposeController.prototype;
if(e){
this.overrideAPI(e,"_getTabParams",this._Compose_getTabParams);
this.overrideAPI(e,"_handleResponseSendMsg",this._Compose_handleResponseSendMsg);
this.overrideAPI(e,"_cancelCompose",this._Compose_cancelCompose);
this.overrideAPI(e,"_setView",this._Compose_setView)
}
var e=window.ZmComposeView&&ZmComposeView.prototype;
if(e){
this.overrideAPI(e,"_setSubject",this._Compose_setSubject)
}
var e=window.ZmAppViewMgr&&ZmAppViewMgr.prototype;
if(e){
this.overrideAPI(e,"popView",this._AppViewMgr_popView)
}
var e=window.ZmMailApp&&ZmMailApp.prototype;
if(e){
this.overrideAPI(e,"popView",this._MailApp_popView)
}};
AjxDispatcher.addPackageLoadFunction("MailCore",new AjxCallback(skin,skin._mail_handleMailCoreLoad));
AjxDispatcher.addPackageLoadFunction("Mail",new AjxCallback(skin,skin._mail_handleMailLoad));
VelodromeSkin.prototype._Portalshow=function(){
var o=skin._parseHashString()||{};
var t=AjxStringUtil.parseQueryString()||{};
if(appCtxt.inStartup&&(t.app||o.app)){
return
}
try{
window.location="http://xfinityconnect.mail.comcast.net/connect/"
}
catch(a){}};
VelodromeSkin.prototype._handlePortalLoad=function(){
this.overrideAPI(ZmPortalController.prototype,"show",this._Portalshow)
};
AjxDispatcher.addPackageLoadFunction("Portal",new AjxCallback(skin,skin._handlePortalLoad));
VelodromeSkin.prototype._getContactListToolBarOps=function(){
return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.PRINT,ZmOperation.SEP,ZmOperation.TAG_MENU]
};
VelodromeSkin.prototype._getContactListActionMenuOps=function(){
var e=this._participantOps();
e.push(ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.PRINT_CONTACT);
return e
};
VelodromeSkin.prototype.addRow=function(e,t){
arguments.callee.func.apply(this,arguments);
if(this._rowCount>=this._maxRows){
return
}
if(t==null){
t=this._rowCount-1
}
e=e||(this._rowDef&&AjxUtil.createProxy(this._rowDef));
if(!e){
return
}
e.id=e.id||this._items[t].id;
var a={};
a.id=e.id+"_helptext";
a.visible="true";
var n=this._registerControl(a,null,null,null,null,"DwtLabel");
var o=this._items[e.id];
o._helpId=a.id;
this._setControlIds(o.id,t);
if(this._itemDef.id=="EMAIL"){
this._setFirstHelpText(ZmMsg.contactEditAddRemoveHelp)
}};
VelodromeSkin.prototype.removeRow=function(e){
arguments.callee.func.apply(this,arguments);
if(this._itemDef.id=="EMAIL"){
this._setFirstHelpText(ZmMsg.contactEditAddRemoveHelp)
}};
VelodromeSkin.prototype._setFirstHelpText=function(o){
for(var e=0;
e<this._rowCount;
e++){
var a=this._items[e]._helpId;
if(a){
var t=this._items[a].control;
if(t){
t.setText((e==0)?o:"")
}}}};
VelodromeSkin.prototype._setControlIds=function(o,e){
arguments.callee.func.apply(this,arguments);
var n=[this.getHTMLElId(),e].join("_");
var t=this._items[o];
var a=this._items[t._helpId];
this._setControlId(a&&a.control,n+"_helptext")
};
VelodromeSkin.prototype._handleContactsLoad=function(){
var e=window.ZmContactListController&&ZmContactListController.prototype;
if(e){
this.overrideAPI(e,"_getToolBarOps",this._getContactListToolBarOps);
this.overrideAPI(e,"_getActionMenuOps",this._getContactListActionMenuOps)
}
var e=window.ZmEditContactViewInputSelectRows&&ZmEditContactViewInputSelectRows.prototype;
if(e){
this.overrideAPI(e,"addRow",this.addRow);
this.overrideAPI(e,"removeRow",this.removeRow);
this.overrideAPI(e,"_setControlIds",this._setControlIds);
this.overrideAPI(e,"_setFirstHelpText",this._setFirstHelpText)
}
ZmEditContactViewRows.prototype.ROW_TEMPLATE="abook.Contacts#ZmEditContactViewRow"
};
VelodromeSkin.prototype._handleContactsCoreLoad=function(){
ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_CONTACT]="newContact";
ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_GROUP]="newGroup"
};
AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._handleContactsLoad));
AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(skin,skin._handleContactsCoreLoad));
if(window.ZmVoiceApp){
skin.overrideAPI(ZmVoiceApp.prototype,"getVoiceInfo",function(r,o,s,e){
skin.__handleVoiceLoad();
if(!this.phones.length||e){
if(!this._gettingVoiceInfo||e){
this.phones.length=0;
var n=AjxSoapDoc.create("GetVoiceInfoExtRequest","urn:zimbraVoice");
var a=n.set("prd","true");
var h=new AjxCallback(this,this._handleResponseVoiceInfo);
var l=new AjxCallback(this,this._handleErrorResponseVoiceInfo);
var t={
soapDoc:n,asyncMode:true,noBusyOverlay:s,callback:h,errorCallback:l};
appCtxt.getAppController().sendRequest(t);
this._gettingVoiceInfo=true
}
if(r){
this._voiceInfoCallbacks=this._voiceInfoCallbacks||[];
this._voiceInfoCallbacks.push(r)
}
if(o){
this._voiceInfoErrorCallbacks=this._voiceInfoErrorCallbacks||[];
this._voiceInfoErrorCallbacks.push(o)
}}else{
if(r){
r.run()
}}}
);
skin.overrideAPI(ZmVoiceApp.prototype,"_handleResponseVoiceInfo2",function(){
skin.__handleVoiceLoad();
return arguments.callee.func.apply(this,arguments)
}
);
VelodromeSkin.prototype.__handleVoiceLoad=function(){
if(!this.__hasOverriddenVoice&&window.ZmPhone){
this.__hasOverriddenVoice=true;
skin.overrideAPI(ZmPhone.prototype,"_loadFromDom",function(e){
this.hasTextMessaging=e.textmsg;
this.sns=e.sns;
this.textmsg_users=e.textmsg_users;
return arguments.callee.func.apply(this,arguments)
}
)
}};
AjxDispatcher.addPackageLoadFunction("Voice",new AjxCallback(skin,skin.__handleVoiceLoad))
}
VelodromeSkin.F_homeAddress="homeAddress";
VelodromeSkin.F_otherAddress="otherAddress";
VelodromeSkin.F_otherAnniversary="otherAnniversary";
VelodromeSkin.F_otherAsstName="otherAsstName";
VelodromeSkin.F_otherCustom="otherCustom";
VelodromeSkin.F_otherDepartment="otherDepartment";
VelodromeSkin.F_otherMgrName="otherMgrName";
VelodromeSkin.F_otherOffice="otherOffice";
VelodromeSkin.F_otherProfession="otherProfession";
VelodromeSkin.F_tollFree="tollFree";
VelodromeSkin.F_workAddress="workAddress";
VelodromeSkin.F_workEmail="workEmail";
VelodromeSkin.F_workIMAddress="workIM";
VelodromeSkin.F_workMobile="workMobile";
VelodromeSkin.F_imNone="_NONE";
VelodromeSkin.F_imYahoo="yahoo";
VelodromeSkin.F_imAOL="aol";
VelodromeSkin.F_imMSN="msn";
VelodromeSkin.F_imOther="other";
VelodromeSkin.prototype._customContactFields_packageLoad=function(){
window.VelodromeSkinOther=function(){
ZmEditContactViewOther.apply(this,arguments)
};
VelodromeSkinOther.prototype=new ZmEditContactViewOther;
VelodromeSkinOther.prototype.constructor=VelodromeSkinOther;
VelodromeSkinOther.prototype.DATE_ATTRS={
birthday:true,otherAnniversary:true};
VelodromeSkinOther.prototype._createSelect=function(){
var t=ZmEditContactViewInputSelect.prototype._createSelect.apply(this,arguments);
t.addChangeListener(new AjxListener(this,this._resetPicker));
return t
};
ZmEditContactView.updateFieldLists();
ZmEditContactView.LISTS.EMAIL.onlyvalue=false;
ZmEditContactView.LISTS.IM.onlyvalue=false;
ZmEditContactView.LISTS.VELODROME_ADDRESS=ZmEditContactView.LISTS.ADDRESS;
ZmEditContactView.ATTRS.DEPARTMENT=VelodromeSkin.F_otherDepartment;
delete ZmEditContactView.LISTS.ADDRESS;
ZmEditContactView.ALWAYS_SHOW={
FIRST:true,LAST:true,TITLE:true,COMPANY:true};
var e=ZmEditContactView.prototype;
this.overrideAPI(e,"getFormItems");
this.overrideAPI(e,"getEmailOptions");
this.overrideAPI(e,"getPhoneOptions");
this.overrideAPI(e,"getIMOptions");
this.overrideAPI(e,"getIMOptions2");
this.overrideAPI(e,"getAddressOptions");
this.overrideAPI(e,"getURLOptions");
this.overrideAPI(e,"getOtherOptions");
this.overrideAPI(e,"getFileAsOptions")
};
VelodromeSkin.prototype._customContactFields_basePackageLoad=function(){
ZmContact.EMAIL_FIELDS=[ZmContact.F_email,VelodromeSkin.F_workEmail];
ZmContact.PHONE_FIELDS=[ZmContact.F_mobilePhone,ZmContact.F_homePhone,ZmContact.F_otherPhone,ZmContact.F_homeFax,ZmContact.F_pager,ZmContact.F_workPhone,VelodromeSkin.F_workMobile,ZmContact.F_workAltPhone,ZmContact.F_workFax,ZmContact.F_assistantPhone,ZmContact.F_companyPhone,ZmContact.F_otherFax,VelodromeSkin.F_tollFree];
ZmContact.IM_FIELDS=[ZmContact.F_imAddress,VelodromeSkin.F_workIMAddress];
ZmContact.ADDRESS_FIELDS=[VelodromeSkin.F_homeAddress,VelodromeSkin.F_workAddress,VelodromeSkin.F_otherAddress];
ZmContact.OTHER_FIELDS=[ZmContact.F_birthday,VelodromeSkin.F_otherAnniversary,VelodromeSkin.F_otherOffice,VelodromeSkin.F_otherProfession,VelodromeSkin.F_otherMgrName,VelodromeSkin.F_otherAsstName,VelodromeSkin.F_otherCustom];
ZmContact.updateFieldConstants();
ZmContact.IS_ADDONE[VelodromeSkin.F_workEmail]=true;
ZmContact.IS_ADDONE[VelodromeSkin.F_workIMAddress]=true;
ZmContact.IS_ADDONE[VelodromeSkin.F_otherCustom]=true;
ZmContact.IGNORE_NORMALIZATION=[ZmContact.F_homePhone]
};
VelodromeSkin.prototype.getFormItems=function(){
var t=arguments.callee.func.apply(this,arguments);
if(!t._modified){
t._modified=true;
var o=this.getFormItemById("IM",t);
o.type="ZmEditContactViewInputDoubleSelectRows";
o.rowitem={
type:"ZmEditContactViewIMDouble",equals:ZmEditContactViewInputSelect.equals,params:{
hint:ZmMsg.imScreenNameHint,cols:60,options:this.getIMOptions(),options2:this.getIMOptions2()}};
o.maxrows=4;
var a=this.getFormItemById("ADDRESS",t);
a.id="VELODROME_ADDRESS",a.rowitem={
type:"ZmEditContactViewInputSelect",equals:ZmEditContactViewInputSelect.equals,template:"abook.Contacts#ZmEditContactViewAddressSelect",params:{
hint:"Address",cols:40,rows:3,options:this.getAddressOptions()}};
var e=this.getFormItemById("OTHER",t);
e.rowitem.type="VelodromeSkinOther"
}
return t
};
VelodromeSkin.prototype.getEmailOptions=function(){
return[{
value:ZmContact.F_email,label:"Home",max:3}
,{
value:VelodromeSkin.F_workEmail,label:"Work",max:3}
]
};
VelodromeSkin.prototype.getPhoneOptions=function(){
return[{
value:ZmContact.F_mobilePhone,label:"Mobile",max:1}
,{
value:ZmContact.F_homePhone,label:"Home",max:1}
,{
value:ZmContact.F_otherPhone,label:"Home Alternate",max:1}
,{
value:ZmContact.F_homeFax,label:"Home Fax",max:1}
,{
value:ZmContact.F_pager,label:"Work Pager",max:1}
,{
value:ZmContact.F_workPhone,label:"Work",max:1}
,{
value:VelodromeSkin.F_workMobile,label:"Work Mobile",max:1}
,{
value:ZmContact.F_workAltPhone,label:"Work Alternate",max:1}
,{
value:ZmContact.F_workFax,label:"Work Fax",max:1}
,{
value:ZmContact.F_assistantPhone,label:"Assistant",max:1}
,{
value:ZmContact.F_companyPhone,label:"Company",max:1}
,{
value:ZmContact.F_otherFax,label:"Other Fax",max:1}
,{
value:VelodromeSkin.F_tollFree,label:"Toll Free",max:1}
]
};
VelodromeSkin.prototype.getIMOptions2=function(){
return[{
value:VelodromeSkin.F_imNone,label:ZmMsg.none}
,{
value:VelodromeSkin.F_imYahoo,label:ZmMsg.imGateway_yahoo}
,{
value:VelodromeSkin.F_imAOL,label:ZmMsg.imGateway_aol}
,{
value:VelodromeSkin.F_imMSN,label:ZmMsg.imGateway_msn}
,{
value:VelodromeSkin.F_imOther,label:ZmMsg.other}
]
};
VelodromeSkin.prototype.getIMOptions=function(){
return[{
value:ZmContact.F_imAddress,label:"Home",max:2}
,{
value:VelodromeSkin.F_workIMAddress,label:"Work",max:2}
]
};
VelodromeSkin.prototype.getAddressOptions=function(){
return[{
value:VelodromeSkin.F_homeAddress,label:"Home",max:1}
,{
value:VelodromeSkin.F_workAddress,label:"Work",max:1}
,{
value:VelodromeSkin.F_otherAddress,label:ZmMsg.other,max:1}
]
};
VelodromeSkin.prototype.getURLOptions=function(){
return[{
value:ZmContact.F_homeURL,label:"Home",max:1}
,{
value:ZmContact.F_workURL,label:"Work",max:1}
]
};
VelodromeSkin.prototype.getOtherOptions=function(){
return[{
value:ZmContact.F_birthday,label:"Birthday",max:1}
,{
value:VelodromeSkin.F_otherAnniversary,label:"Anniversary",max:1}
,{
value:VelodromeSkin.F_otherOffice,label:"Office",max:1}
,{
value:VelodromeSkin.F_otherProfession,label:"Profession",max:1}
,{
value:VelodromeSkin.F_otherMgrName,label:"Manager",max:1}
,{
value:VelodromeSkin.F_otherAsstName,label:"Assistant",max:1}
,{
value:VelodromeSkin.F_otherCustom,label:"Custom",max:4}
]
};
VelodromeSkin.prototype.getFileAsOptions=function(){
return arguments.callee.func.apply(this,arguments)
};
AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._customContactFields_packageLoad));
AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(skin,skin._customContactFields_basePackageLoad));
if(!window.JSON){
JSON={
cx:/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable:/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,meta:{
"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}
,rep:null,quote:function(e){
JSON.escapable.lastIndex=0;
return JSON.escapable.test(e)?'"'+e.replace(JSON.escapable,function(t){
var o=JSON.meta[t];
return typeof o==="string"?o:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)
}
)+'"':'"'+e+'"'
}
,str:function(h,n){
var a,t,l,e,s=JSON.gap,o,r=n[h];
if(r&&typeof r==="object"&&typeof r.toJSON==="function"){
r=r.toJSON(h)
}
if(typeof JSON.rep==="function"){
r=JSON.rep.call(n,h,r)
}
switch(typeof r){
case"string":return JSON.quote(r);
case"number":return isFinite(r)?String(r):"null";
case"boolean":case"null":return String(r);
case"object":if(!r){
return"null"
}
JSON.gap+=JSON.indent;
o=[];
if(Object.prototype.toString.apply(r)==="[object Array]"){
e=r.length;
for(a=0;
a<e;
a+=1){
o[a]=JSON.str(a,r)||"null"
}
l=o.length===0?"[]":JSON.gap?"[\n"+JSON.gap+o.join(",\n"+JSON.gap)+"\n"+s+"]":"["+o.join(",")+"]";
JSON.gap=s;
return l
}
if(JSON.rep&&typeof JSON.rep==="object"){
e=JSON.rep.length;
for(a=0;
a<e;
a+=1){
t=JSON.rep[a];
if(typeof t==="string"){
l=JSON.str(t,r);
if(l){
o.push(JSON.quote(t)+(JSON.gap?": ":":")+l)
}}}}else{
for(t in r){
if(Object.hasOwnProperty.call(r,t)){
l=JSON.str(t,r);
if(l){
o.push(JSON.quote(t)+(JSON.gap?": ":":")+l)
}}}}
l=o.length===0?"{}":JSON.gap?"{\n"+JSON.gap+o.join(",\n"+JSON.gap)+"\n"+s+"}":"{"+o.join(",")+"}";
JSON.gap=s;
return l
}}
,stringify:function(o,t,a){
var e;
JSON.gap="";
JSON.indent="";
if(typeof a==="number"){
for(e=0;
e<a;
e+=1){
JSON.indent+=" "
}}else{
if(typeof a==="string"){
JSON.indent=a
}}
JSON.rep=t;
if(t&&typeof t!=="function"&&(typeof t!=="object"||typeof t.length!=="number")){
throw new Error("JSON.stringify")
}
return JSON.str("",{
"":o}
)
}
,parse:function(text,reviver){
var j;
var walk=function walk(holder,key){
var k,v,value=holder[key];
if(value&&typeof value==="object"){
for(k in value){
if(Object.hasOwnProperty.call(value,k)){
v=walk(value,k);
if(v!==undefined){
value[k]=v
}else{
delete value[k]
}}}}
return reviver.call(holder,key,value)
};
text=String(text);
JSON.lastIndex=0;
if(JSON.cx.test(text)){
text=text.replace(JSON.cx,function(a){
return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
}
)
}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){
j=eval("("+text+")");
return typeof reviver==="function"?walk({
"":j}
,""):j
}
throw new SyntaxError("JSON.parse")
}};
(function(){
function e(t){
return t<10?"0"+t:t
}
if(typeof Date.prototype.toJSON!=="function"){
Date.prototype.toJSON=function(t){
return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"Z":null
}
}
String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){
return this.valueOf()
}
}
)()
}
if(!window.JSON.gparse){
JSON.gparse=function(o,t){
try{
return JSON.parse(o,t)
}
catch(a){
return null
}}
}
window.PLAXO_URL_BASE="http://calendar.comcast.net";
window.CIMA_URL="https://login.comcast.net/api/web-access?c=cal";
if(!window.Comcast_plaxosync){
window.Comcast_plaxosync={}
}
Comcast_plaxosync.map={
z2p:{
anniversary:"anniversary",assistantPhone:"assistantPhone",birthday:"birthday",callbackPhone:"callbackPhone",carPhone:"carPhone",company:"company",companyPhone:"companyPhone",department:"deptName",email:"homeEmail1",email2:"homeEmail2",email3:"homeEmail3",firstName:"firstName",homeCity:"homeCity",homeCountry:"homeCountry",homeFax:"homeFax",homePhone:"homePhone1",homePhone2:"homePhone2",homePostalCode:"homePostalCode",homeState:"homeState",homeStreet:"homeAddress",homeURL:"homeWebPage",image:"workPhotoURL",jobTitle:"jobTitle",lastName:"lastName",middleName:"middleName",mobilePhone:"homeMobile",namePrefix:"nameTitle",nameSuffix:"nameSuffix",nickname:"nickname",otherCity:"otherCity",otherCountry:"otherCountry",otherFax:"otherFax",otherPhone:"otherPhone",otherPostalCode:"otherPostalCode",otherState:"otherState",otherStreet:"otherAddress",pager:"workPager",workCity:"workCity",workCountry:"workCountry",workEmail1:"workEmail1",workEmail2:"workEmail2",workEmail3:"workEmail3",workFax:"workFax",workMobile:"workMobile",workPhone:"workPhone1",workAltPhone:"workPhone2",workPostalCode:"workPostalCode",workState:"workState",workStreet:"workStreet",workURL:"workWebPage",workCardMessage:"workCardMessage",homeCardMessage:"homeCardMessage",fullName:null,itemId:"itemId"}
,p2z:{}
,im_z2p:{
imAddress:"homeIMList",workIM:"workIMList"}
,imPattern:/(\w+):\/\/(.+)/,map:function(s,o){
if(AjxUtil.isObject(o)){
if(AjxUtil.isArray(s)){
var n=[];
for(var a=0;
a<s.length;
a++){
n.push(this.map(s[a],o))
}
return n
}else{
if(AjxUtil.isObject(s)){
var n={};
for(var t in s){
if(t!=null){
var e=o[t]||null;
if(e!=null){
n[e]=s[t]
}}}
return n
}else{
if(AxjUtil.isString(s)){
return o[s]
}}}}
return null
}
,map_z2p:function(t){
if(AjxUtil.isArray(t)){
var e=[];
for(var n=0;
n<t.length;
n++){
var o=t[n];
var s=this.map(o,this.z2p);
var r=this.mapIM_z2p(o);
s=AjxUtil.hashUpdate(s,r,true);
e.push(s)
}
return e
}else{
if(AjxUtil.isObject(t)){
var e=this.map(t,this.z2p);
var a=this.mapIM_z2p(t);
e=AjxUtil.hashUpdate(e,a,true);
return e
}}}
,map_p2z:function(t){
if(AjxUtil.isArray(t)){
var e=[];
for(var n=0;
n<t.length;
n++){
var r=t[n];
var o=this.map(r,this.p2z);
var a=this.mapIM_p2z(r);
o=AjxUtil.hashUpdate(o,a,true);
e.push(o)
}
return e
}else{
if(AjxUtil.isObject(t)){
var e=this.map(t,this.p2z);
var s=this.mapIM_p2z(t);
e=AjxUtil.hashUpdate(e,s,true);
return e
}}}
,mapIM_z2p:function(d){
if(AjxUtil.isObject(d)){
var a={};
for(var e in this.im_z2p){
var r=this.im_z2p[e];
var o=new RegExp(e+"(\\d+)");
var h=[];
for(var c in d){
var n=o.exec(c);
if(n&&n.length>=2){
var s=parseInt(n[1])-1;
var l=d[c];
if(l!=null){
var t=this.mapIM_z2p_single(l);
if(t!=null){
h[s]=t
}}}}
if(h.length>0){
a[r]={
imAddress:h}
}}
return a
}}
,mapIM_z2p_single:function(n){
var t=this.imPattern.exec(n);
if(t&&t.length>=3){
var e=t[1];
var a=t[2];
var o={};
o.service=t[1];
o.address=t[2];
return o
}
return null
}
,mapIM_p2z:function(a){
var u={};
for(var t in this.im_z2p){
var c=this.im_z2p[t];
try{
var l=a[c];
var n=l.imAddress;
var s=1;
for(var r=0;
r<n.length;
r++){
var d=n[r];
var o=this.mapIM_p2z_single(d);
u[t+s]=o;
s++
}}
catch(h){}}
return u
}
,mapIM_p2z_single:function(e){
return e.service.toLowerCase()+"://"+e.address
}};
(function(){
var t=Comcast_plaxosync.map;
for(var e in t.z2p){
if(t.z2p[e]){
t.p2z[t.z2p[e]]=e
}}
t.p2z.email="email"
}
)();
if(!window.Comcast_plaxosync){
window.Comcast_plaxosync={}
}
Comcast_plaxosync.util={
add:function(a,t,o){
o=o||this[t];
if(o){
var e=a[t];
a[t]=function(){
var n=arguments;
n.push(e.apply(this,arguments));
return o.apply(this,n)
};
a[t].func=e
}}
,parseQuery:function(e){
locFound=/.*:.*/.test(e);
match=locFound&&/(.*)\(.*:(.*)\)$/.exec(e);
return{
location:(match&&AjxStringUtil.trim(match[2]))||(locFound&&e)||"",searchfor:(match&&AjxStringUtil.trim(match[1]))||(!locFound&&e)||""}
}
,getFirstAttr:function(e,n,o){
for(var a=0;
a<n.length;
a++){
var t=n[a];
if(e[t]){
return e[t]
}}
return o
}
,evalJSON:function(a){
try{
return JSON.parse(a)
}
catch(t){
return{}
}}
,pruneAttrs:function(a){
if(!this.validAttrs){
if(ZmContact&&ZmContact.DISPLAY_FIELDS&&window.VelodromeSkinOther){
this.validAttrs=AjxUtil.arrayAsHash(ZmContact.DISPLAY_FIELDS)
}else{
return this.hashUpdate({}
,a,true,["itemId"])
}}
var t={};
for(var o in a){
var e=o.replace(/\d+$/,"");
if(this.validAttrs[e]){
t[o]=a[o]
}}
return t
}
,send:function(o,t,h,n,r){
var e=new AjxCallback(this,this.receive,[h||null]);
var a="/zimbra/skins/velodrome2/public/proxy.jsp?api=ab&fwdHeader=Cookie&url="+AjxStringUtil.urlEncode(o);
if(AjxUtil.isObject(t)){
t=JSON.stringify(t)
}
var s=(t&&!n)?{
"Content-Type":"application/json; charset=utf-8"}
:{};
if(AjxEnv.isIE6&&(location.protocol=="https:")){
s.Connection="Close"
}
if(r&&AjxUtil.isObject(r)){
s=this.hashUpdate(s,r,true)
}
AjxRpc.invoke(t,a,s,e,n)
}
,receive:function(a,e){
if(e.success&&a){
var t=this.evalJSON(AjxStringUtil.trim(e.text));
a.run(t)
}}
,hashUpdate:function(n,o,t,s,e){
for(var a in o){
if((t||!(a in n))&&(!s||AjxUtil.indexOf(s,a)==-1)&&(!e||AjxUtil.indexOf(e,a)!=-1)){
n[a]=o[a]
}}
return n
}};
if(!window.Comcast_plaxosync){
window.Comcast_plaxosync={}
}
Comcast_plaxosync.frame={
p:Comcast_plaxosync,DISPLAY_IFRAME:true,PLAXO_URL_SHOW_ALL:window.PLAXO_URL_BASE+"/ab/contactList/?skin=none",PLAXO_URL_SHOW_CONTACT:window.PLAXO_URL_BASE+"/ab/home/contactView/{0}?skin=none",PLAXO_URL_SHOW_SEARCH:window.PLAXO_URL_BASE+"/ab/contactList?skin=none&src=addressBookSearch#query={0}",PLAXO_URL_NEW_CONTACT:window.PLAXO_URL_BASE+"/ab/home/contactAdd/?skin=none&name={0}&email={1}&phone={2}",PLAXO_URL_EDIT_CONTACT:window.PLAXO_URL_BASE+"/xfc/editContact?e={1}&n={0}&skin=none",PLAXO_URL_NEW_GROUP:window.PLAXO_URL_BASE+"/ab/contactList?skin=none#createGroup=1",init:function(){
var e=new AjxListener(this,function(){
if(!this._hasInited){
this._hasInited=true;
if(this.DISPLAY_IFRAME){
this._createIframeView()
}}}
);
ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,e);
ZmZimbraMail.addListener(ZmAppEvent.POST_STARTUP,e)
}
,handleFrameData:function(e,a,t){
if(AjxUtil.isString(e)){
if(t){
this.setIframeUrl(t)
}
var o={
action:ZmOperation.NEW_MESSAGE,toOverride:e,subjOverride:a||""};
AjxDispatcher.run("GetComposeController").doAction(o)
}}
,_createIframeView:function(){
if(this.DISPLAY_IFRAME){
this.viewName="PlaxoFrame";
var s={};
this._iframeView=new ZmUpsellView({
parent:appCtxt.getShell(),posStyle:Dwt.ABSOLUTE_STYLE,className:"ZmUpsellView"}
);
var o=this._iframeView.getHtmlElement();
var t=[];
var e=0;
t[e++]="<iframe id='iframe_";
t[e++]=this._iframeView.getHTMLElId();
t[e++]="' width='100%' height='100%' frameborder='0'>";
o.innerHTML=t.join("");
s[ZmAppViewMgr.C_APP_CONTENT_FULL]=this._iframeView;
var n={};
n[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this.displayIframeView);
n[ZmAppViewMgr.CB_POST_HIDE]=new AjxCallback(this,this._onHideView);
appCtxt.getAppViewMgr().createView({
viewId:this.viewName,appName:"Contacts",elements:s,isTransient:false,callbacks:n}
);
var a=this.getIframe();
a.onload=null
}}
,displayIframeView:function(e){
if(this.DISPLAY_IFRAME){
var t=[ZmMsg.zimbraTitle,"Address Book"].join(": ");
Dwt.setTitle(t)
}}
,getIframe:function(){
if(!this._iframe){
this._iframe=document.getElementById("iframe_"+this._iframeView.getHTMLElId())
}
return this._iframe
}
,getIframeView:function(){
return this._iframeView
}
,setIframeUrl:function(t,n){
if(this.DISPLAY_IFRAME){
if(t){
this._iframeSrc=t
}
if(this._iframeView){
var o=this.getIframe();
if(o){
var e=appCtxt.getAppViewMgr();
if(n&&e.getCurrentViewId()!=this.viewName){
appCtxt.getAppChooser().setSelected("Contacts");
if(t){
var a=AjxCallback.simpleClosure(this.displayIframe,this);
if(AjxEnv.isIE){
o.attachEvent("onload",a)
}else{
Dwt.setHandler(o,"onload",a)
}
this._displayLoading()
}}else{
Dwt.clearHandler(o,"onload")
}
if(t){
o.src=t
}}}}}
,displayIframe:function(){
var e=appCtxt.getAppViewMgr();
e.popView(ZmId.VIEW_LOADING,true);
e.pushView(this.viewName);
appCtxt.getAppChooser().setSelected("Contacts");
Dwt.clearHandler(this.getIframe(),"onload")
}
,_displayLoading:function(){
if(!appCtxt.inStartup){
appCtxt.getAppViewMgr().pushView(ZmId.VIEW_LOADING,true)
}}
,_onHideView:function(){}};
Comcast_plaxosync.handleFrameData=AjxCallback.simpleClosure(Comcast_plaxosync.frame.handleFrameData,Comcast_plaxosync.frame);
AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,function(){
var t=Comcast_plaxosync.frame,e=Comcast_plaxosync.util;
this.overrideAPI(ZmContactController.prototype,"show",function(a,h){
if(t.DISPLAY_IFRAME){
if(a){
if(a.type==ZmItem.GROUP){
var r=t.PLAXO_URL_NEW_GROUP
}else{
var s=[a.attr.firstName||"",a.attr.middleName||"",a.attr.lastName||""].join(" ").replace(/\s+/g," ");
s=s.replace(/^\s+|\s+$/g,"");
s=AjxStringUtil.urlComponentEncode(s);
var n=e.getFirstAttr(a.attr,["email","workEmail1"],"");
n=AjxStringUtil.urlComponentEncode(n);
var o=e.getFirstAttr(a.attr,ZmContact.PHONE_FIELDS,"");
o=AjxStringUtil.urlComponentEncode(o);
var r=(a.id)?AjxMessageFormat.format(t.PLAXO_URL_EDIT_CONTACT,[s,n]):AjxMessageFormat.format(t.PLAXO_URL_NEW_CONTACT,[s,n,o])
}
t.setIframeUrl(r,true)
}}else{
arguments.callee.func.apply(this,arguments)
}}
);
this.overrideAPI(ZmContactListController.prototype,"_defaultView",function(){
if(t.DISPLAY_IFRAME){
return t.viewName
}else{
return(appCtxt.get(ZmSetting.CONTACTS_VIEW)=="cards")?ZmId.VIEW_CONTACT_CARDS:ZmId.VIEW_CONTACT_SIMPLE
}}
);
this.overrideAPI(ZmContactListController.prototype,"show",function(){
this.switchView(t.viewName)
}
);
this.overrideAPI(ZmContactListController.prototype,"_createNewView",function(a){
if(a==t.viewName){
return t.getIframeView()
}
return arguments.callee.func.apply(this,arguments)
}
);
this.overrideAPI(ZmContactListController.prototype,"_initializeListView",function(a){
if(a==t.viewName){
this._listView[a]=this._createNewView(a)
}else{
arguments.callee.func.apply(this,arguments)
}}
);
this.overrideAPI(ZmContactListController.prototype,"switchView",function(a,n,s,o){
if(t.DISPLAY_IFRAME){
a=t.viewName;
s=true;
if(!this._appViews[a]){
this._appViews[a]=t.getIframeView()
}}
return arguments.callee.func.call(this,a,n,s,o)
}
);
this.overrideAPI(ZmContactListController.prototype,"_setViewContents",AjxCallback.returnFalse);
this.overrideAPI(ZmContactListController.prototype,"_resetOperations",AjxCallback.returnFalse)
}
));
AjxDispatcher.addPackageLoadFunction("Startup1_2",new AjxCallback(skin,function(){
this.overrideAPI(ZmSearchController.prototype,"_doSearch",function(r,e,h,t){
var a=r.types||this.getTypes(r),s=Comcast_plaxosync.frame;
if(s.DISPLAY_IFRAME&&((AjxUtil.isArray(a)&&a.length==1&&a[0]==ZmItem.CONTACT)||(a instanceof AjxVector&&a.size()==1&&a.get(0)==ZmItem.CONTACT))){
var o=r.query,n=o&&Comcast_plaxosync.util.parseQuery(o);
if(n&&n.searchfor){
s.setIframeUrl(AjxMessageFormat.format(s.PLAXO_URL_SHOW_SEARCH,[n.searchfor]),true)
}else{
if(!s._iframeSrc){
s.setIframeUrl(s.PLAXO_URL_SHOW_ALL,true)
}else{
s.displayIframe()
}}}
arguments.callee.func.apply(this,arguments)
}
);
Comcast_plaxosync.frame.init()
}
));
Comcast_preferences={
_iframeSrc:"http://prefs.connect.comcast.net/prefs/?skin=none"};
Comcast_preferences.init=function(){
var h=this.viewName="PreferenceFrame";
var r=this._iframeView=new ZmUpsellView({
parent:appCtxt.getShell(),posStyle:Dwt.ABSOLUTE_STYLE,className:"ZmUpsellView"}
);
r.setVisible(false);
var o=r.getHtmlElement();
o.style.top=0;
var t=[];
var e=0;
t[e++]="<iframe id='iframe_";
t[e++]=r.getHTMLElId();
t[e++]="' width='100%' height='100%' frameborder='0'>";
o.innerHTML=t.join("");
var s={};
s[ZmAppViewMgr.C_APP_CONTENT_FULL]=r;
var n={};
n[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this.onShow);
appCtxt.getAppViewMgr().createView({
viewId:h,elements:s,isTransient:false,callbacks:n}
);
var a=this.getIframe();
a.onload=null
};
Comcast_preferences.getIframe=function(){
if(!this._iframe){
this._iframe=document.getElementById("iframe_"+this._iframeView.getHTMLElId())
}
return this._iframe
};
Comcast_preferences.onShow=function(){
appCtxt.getAppChooser().setSelected("Options");
Dwt.setTitle([ZmMsg.zimbraTitle,ZmMsg.preferences].join(": "));
var e=Comcast_preferences.getIframe();
if(!e.src){
e.src=this._iframeSrc
}
this._iframeView.setVisible(true)
};
Comcast_preferences.displayIframe=function(){
var e=appCtxt.getAppViewMgr();
e.pushView(this.viewName)
};
VelodromeSkin.showListeners.push(new AjxCallback(this,function(){
AjxDispatcher.addPackageLoadFunction("Startup1_2",new AjxCallback(function(){
var t=false;
var e=new AjxListener(function(){
if(!t){
t=true;
Comcast_preferences.init()
}}
);
ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,e);
ZmZimbraMail.addListener(ZmAppEvent.POST_STARTUP,e);
skin.overrideAPI(ZmPreferencesApp.prototype,"launch",function(a,o){
Comcast_preferences.displayIframe();
AjxDispatcher.require(["PreferencesCore","Preferences"],true,new AjxCallback(function(){
appCtxt.getSettings().loadPreferenceData(new AjxCallback(function(){
o.run();
Comcast_preferences.displayIframe()
}
))
}
),null,true)
}
)
}
))
}
));
Comcast_voice={
_iframeSrc:"http://vmail.connect.comcast.net/voice/?skin=none"};
Comcast_voice.init=function(){
var h=this.viewName="VoiceFrame";
var r=this._iframeView=new ZmUpsellView({
parent:appCtxt.getShell(),posStyle:Dwt.ABSOLUTE_STYLE,className:"ZmUpsellView"}
);
var o=r.getHtmlElement();
o.style.top=0;
var t=[];
var e=0;
t[e++]="<iframe id='iframe_";
t[e++]=r.getHTMLElId();
t[e++]="' ";
t[e++]=" width='100%' height='100%' frameborder='0'>";
o.innerHTML=t.join("");
var s={};
s[ZmAppViewMgr.C_APP_CONTENT_FULL]=r;
var n={};
n[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this.onShow);
appCtxt.getAppViewMgr().createView({
viewId:h,elements:s,isTransient:false,callbacks:n}
);
var a=this.getIframe();
a.onload=null
};
Comcast_voice.getIframe=function(){
if(!this._iframe){
this._iframe=document.getElementById("iframe_"+this._iframeView.getHTMLElId())
}
return this._iframe
};
Comcast_voice.onShow=function(){
appCtxt.getAppChooser().setSelected("Voice");
var t=[ZmMsg.zimbraTitle,"Voice"].join(": ");
Dwt.setTitle(t);
var e=this.getIframe();
if(!e.src){
e.src=this._iframeSrc
}
this._iframeView.setVisible(true)
};
Comcast_voice.displayIframe=function(){
var e=appCtxt.getAppViewMgr();
e.pushView(this.viewName)
};
AjxDispatcher.addPackageLoadFunction("Startup1_2",new AjxCallback(function(){
var t=false;
var e=new AjxListener(function(){
if(!t){
t=true;
Comcast_voice.init()
}}
);
ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,e);
ZmZimbraMail.addListener(ZmAppEvent.POST_STARTUP,e);
skin.overrideAPI(ZmVoiceApp.prototype,"launch",function(a,o){
Comcast_voice.displayIframe();
AjxDispatcher.require(["Voicemail"],true,new AjxCallback(function(){
appCtxt.getSettings().loadPreferenceData(new AjxCallback(function(){
if(o){
o.run()
}
Comcast_voice.displayIframe()
}
))
}
),null,true)
}
)
}
));
Comcast_cometd={
CROSSDOMAIN_XML:"https://comet.adaptor.comcast.net/CometAdapter/crossdomain.xml",HANDSHAKE_URL:"https://comet.adaptor.comcast.net/CometAdapter/CreateSession",NOTIFICATION_URL:"https://comet.adaptor.comcast.net/CometAdapter/GetNotifications",DELETE_URL:"https://comet.adaptor.comcast.net/CometAdapter/DeleteSession",HANDSHAKE_XML:'<?xml version="1.0" encoding="UTF-8"?><CometServiceMappingTable><Service version=""><ServiceName lang="en-US">SMS</ServiceName><ServiceVersion>1.0</ServiceVersion><DocumentFormat>presence/pidf</DocumentFormat></Service><Authorization><s_ticket>{0}</s_ticket><TN>{1}</TN></Authorization></CometServiceMappingTable>',TIMEOUT:14*60*1000,FORCE_FLXHR:false,init:function(e,o,a){
this.log("Cometd client init"+(a?" (forced)":""));
e=e||this.tn;
if(e){
if(!this._inited||a){
this.tn=e;
this._parseCookies();
var t=this;
this._xhrInit(function(){
t.log("starting handshake");
if(a){
t.log("resetting handshake state");
t._handshakeState=0
}
t._handshake(function(){
t._inited=true;
if(t._isFct(o)){
o()
}}
)
}
)
}else{
if(this._isFct(o)){
o()
}}}}
,start:function(e,a){
if(!this._inited||a){
var t=this;
this.init(e,function(){
t.start(e)
}
,a)
}else{
this._getNotification()
}}
,stop:function(e){
if(this._inited){
if(this._currentRequest){
this._currentRequest.abort()
}
this._deleteSession(e)
}}
,addListener:function(e){
if(this._isFct(e)){
this._notificationCallbacks.push(e)
}}
,removeListener:function(t){
if(this._isFct(t)){
var e=this._notificationCallbacks;
for(var a=0;
a<e.length;
a++){
if(e[a]===t){
e.splice(a,1);
return true
}}}
return false
}
,_handshake:function(a){
this.log("CometD handshake state:",this._handshakeState);
var e=this;
if(this._isFct(a)){
this._handshakeCallbacks.push(a)
}
if(this._handshakeState==0){
this.log("Running handshake");
var t=this.HANDSHAKE_XML.replace(/\{0\}/g,this._getCookieValue("s_ticket")).replace(/\{1\}/g,this.tn);
this._xhr(this.HANDSHAKE_URL,null,t,function(o){
if(o.status==200){
e._handleHandshake()
}else{
e.log("Handshake failed, HTTP status "+o.status);
e.log("Waiting 120 seconds before trying again");
setTimeout(function(){
e.start(e.tn,true)
}
,120000)
}}
,"POST",true);
this._handshakeState=1
}else{
if(this._handshakeState==1){}else{
this._callHandshakeCallbacks()
}}}
,_handleHandshake:function(){
this._handshakeState=2;
this._callHandshakeCallbacks()
}
,_callHandshakeCallbacks:function(){
var t=[].concat(this._handshakeCallbacks);
this._handshakeCallbacks.length=0;
for(var e=0;
e<t.length;
e++){
t[e]()
}}
,_getNotification:function(a){
this.log("Polling for notification");
var t=this;
if(this._currentRequest){
this.log("Aborting previous request");
this._currentRequest.abort()
}
var e=new Date();
var o=this._currentRequest=this._xhr(this.NOTIFICATION_URL,null,"",function(s){
t.log("GetNotification response: ",s.status);
if(s.status==200){
try{
t._handleNotification(s)
}
catch(n){}
t._currentRequest=null;
if(!a){
t._getNotification()
}}else{
if(s.status==0){
t.log("GetNotification failure");
if(new Date().getTime()-e.getTime()>30000){
if(!a){
t.log("Trying again in 2 seconds");
setTimeout(function(){
t.start(t.tn,true)
}
,2000)
}}else{
if(!a){
t.log("Trying again in 300 seconds");
setTimeout(function(){
t.start(t.tn,true)
}
,300000)
}}}}}
,"GET",true,this.TIMEOUT,function(n){
if(!a){
t.log("timed out, re-sending");
t._getNotification()
}}
)
}
,_deleteSession:function(){
this.log("Delete session");
var e=this;
var t=this._xhr(this.DELETE_URL,null,null,function(a){
e.log("DeleteSession response:",a.status,a.statusText,a.responseText)
}
,"DELETE",true,0,function(a){
e.log("DeleteSession timed out!")
}
,false)
}
,_handleNotification:function(a){
this._lastNotificationTime=this._formatTime(new Date());
var t=this._notificationCallbacks;
this.log("Calling "+t.length+" listeners");
for(var o=0;
o<t.length;
o++){
try{
t[o]()
}
catch(n){
this.log("Listener "+o+" threw an exception")
}}}
,_isFct:function(e){
return(typeof(e)=="function")
}
,_xhr:function(o,n,r,u,t,s,l,c,e){
r=r||"";
if(this._hasGoodXHR){
var h=new XMLHttpRequest();
h.open(t,o,!e);
h.onreadystatechange=function(f){
if(h.readyState===4){
u(h)
}};
h.setRequestHeader("Content-Type","text/plain; charset=UTF-8");
if(n){
for(var d in n){
h.setRequestHeader(d,n[d])
}}
if(s){
h.withCredentials=true
}
if(l&&!e){
h.timeout=l;
if(c){
h.ontimeout=function(){
c(h)
}
}}
h.send(r);
return h
}else{
if(window.flensed){
var m=this;
var a=new flensed.flXHR({
autoUpdatePlayer:true,instancePooling:true,loadPolicyURL:m.CROSSDOMAIN_XML,sendTimeout:l}
);
a.xmlResponseText=false;
a.onreadystatechange=function(f){
if(f.readyState==4){
u(f)
}};
if(c){
a.ontimeout=function(){
c(a)
}
}
a.open(t,o);
a.setRequestHeader("Content-Type","text/plain; charset=UTF-8");
a.send(r);
return a
}else{
this.log("flXHR not loaded, cannot send CORS requests.")
}}}
,_xhrInit:function(a){
if(!this._xhrInited){
if(!this.FORCE_FLXHR&&window.XMLHttpRequest&&"withCredentials" in new XMLHttpRequest()){
this._hasGoodXHR=true;
a()
}else{
var t=document.createElement("script");
t.type="text/javascript";
t.src="/zimbra/skins/velodrome2/flxhr/flXHR.js";
var e=false;
t.onreadystatechange=function(){
if((t.readyState=="loaded"||t.readyState=="complete")&&!e){
e=true;
a()
}};
t.onload=a;
document.getElementsByTagName("head")[0].appendChild(t)
}
this._xhrInited=true
}else{
a()
}}
,_parseCookies:function(){
var e=document.cookie.split(/;\s?/);
var r=this._cookieMap={};
for(var o=0;
o<e.length;
o++){
var n=e[o],t=n.indexOf("="),a=t==-1?n:n.substring(0,t),s=t==-1?null:n.substring(t+1);
r[a]=s
}
return r
}
,_parseQueryString:function(t){
var n={};
if(t){
var e=t.split("&");
for(var o=0;
o<e.length;
o++){
var a=e[o].split("=");
n[a[0]]=a[1]
}}
return n
}
,_getCookieValue:function(e){
if(!this._cookieMap){
this._parseCookies()
}
return this._cookieMap[e]
}
,_formatTime:function(e){
return(e.getUTCFullYear()+"-"+e.getUTCMonth()+"-"+e.getUTCDate()+"T"+e.getUTCHours()+":"+e.getUTCMinutes()+":"+e.getUTCSeconds()+"Z")
}
,_inited:false,_handshakeCallbacks:[],_handshakeState:0,_notificationCallbacks:[],log:function(){
if(window.console){
try{
console.log.apply(console,arguments)
}
catch(t){
console.log(Array.prototype.join.call(arguments," "))
}}}};
if(window.ZmVoiceApp){
skin.overrideAPI(ZmVoiceApp.prototype,"getVoiceInfo",function(r,o,s,e){
skin.__handleVoiceLoad();
if(!this.phones.length||e){
if(!this._gettingVoiceInfo||e){
this.phones.length=0;
var n=AjxSoapDoc.create("GetVoiceInfoExtRequest","urn:zimbraVoice");
var a=n.set("prd","true");
var h=new AjxCallback(this,this._handleResponseVoiceInfo);
var l=new AjxCallback(this,this._handleErrorResponseVoiceInfo);
var t={
soapDoc:n,asyncMode:true,noBusyOverlay:s,callback:h,errorCallback:l};
appCtxt.getAppController().sendRequest(t);
this._gettingVoiceInfo=true
}
if(r){
this._voiceInfoCallbacks=this._voiceInfoCallbacks||[];
this._voiceInfoCallbacks.push(r)
}
if(o){
this._voiceInfoErrorCallbacks=this._voiceInfoErrorCallbacks||[];
this._voiceInfoErrorCallbacks.push(o)
}}else{
if(r){
r.run()
}}}
);
skin.overrideAPI(ZmVoiceApp.prototype,"_handleResponseVoiceInfo2",function(){
skin.__handleVoiceLoad();
return arguments.callee.func.apply(this,arguments)
}
);
VelodromeSkin.prototype.__handleVoiceLoad=function(){
if(!this.__hasOverriddenVoice&&window.ZmPhone){
this.__hasOverriddenVoice=true;
skin.overrideAPI(ZmPhone.prototype,"_loadFromDom",function(e){
this.hasTextMessaging=e.textmsg;
this.sns=e.sns;
this.textmsg_users=e.textmsg_users;
return arguments.callee.func.apply(this,arguments)
}
)
}};
AjxDispatcher.addPackageLoadFunction("Voice",new AjxCallback(skin,skin.__handleVoiceLoad))
}
Comcast_ssml={
phones:null,errorMap:{
"err.107":"voice.ACCOUNT_NOT_CPNI_COMPLIANT","http.504":"http.GATEWAY_TIMEOUT"}
,getVoiceInfo:function(e,t,a,o){
if(a||!this._loaded){
AjxRpc.invoke(null,"/zimbra/skins/velodrome2/public/ssml.jsp"+(o?"?prd=true":""),null,new AjxCallback(this,function(r){
if(r&&r.success){
var d=JSON.gparse(r.text);
if(d){
if(d.id){
var c=this.errorMap[d.id]||d.id;
caboUtil.run(t,c&&{
code:c,msg:d.message}
);
return
}
var l=AjxUtil.toArray(d.profile_type.tn_info);
this.phones=[];
for(var h=0;
h<l.length;
h++){
var n=l[h];
var s=this.phones[h]={
id:n.tn,name:n.tn,hasTextMessaging:n.textmsg&&n.textmsg.textmsg_enabled=="true",textmsg_users:n.textmsg&&n.textmsg.assigned_users,textmsgService:n.textmsg&&n.textmsg.service_status,hasVoiceMail:n.voicemail&&n.voicemail.vm_enabled=="true",sns:n.sns&&n.sns.sns_enabled=="true"||false,snsService:n.sns&&n.sns.service_status,mcdv:n.mcdv&&n.mcdv.mcdv_enabled=="true"||false,mcdvService:n.mcdv&&n.mcdv.service_status}
}
var u=d.profile_type.user_type;
this._storeprincipal={
id:u.guid,accountNumber:u.acct_id,name:u.username,is_primary:u.acct_role=="P",accountType:u.acct_type,productDesc:(function(){
var f=u.products;
if(f){
for(var p in f){
var m=f[p];
if(m.id=="voice"){
return m.desc
}}}}
)(),digitalVoiceService:u.digital_voice_status,serviceStatus:u.service_status,loginUserName:u.username};
this._loaded=true;
caboUtil.run(e)
}else{
caboUtil.run(t,r.text)
}}else{
caboUtil.run(t)
}}
),true)
}else{
caboUtil.run(e)
}}};
SkinLoadedZimlet=function(a,t,e){
if(!arguments.length){
return
}
this.name=a;
this.msgObj=t;
this.cfgObj=e;
this.isSkinLoadedZimlet=true
};
SkinLoadedZimlet.prototype.createApp=function(r,t,l,n){
var s=this.name;
var o=appCtxt.getAppController();
var a={
text:r,image:t,tooltip:l};
if(n!=null&&n>=0){
a.index=n
}
o.getAppChooser().addButton(s,a);
var h=this;
var e=new ZmApp(s,this,DwtShell.getShell(window));
e.launch=function(c,d){
h.getController().show();
ZmApp.prototype.launch.call(this,c);
if(h.appLaunch){
h.appLaunch(this.getName(),c)
}
if(d){
d.run()
}};
o.addApp(e);
return s
};
SkinLoadedZimlet.prototype.getMessage=function(e){
var t=this.msgObj[e];
if(AjxUtil.isUndefined(t)){
t="???"+this.name+".msg."+e+"???"
}
return t
};
SkinLoadedZimlet.prototype.getMessageF=function(e){
return this.msgObj[e]||""
};
SkinLoadedZimlet.prototype.getMsgObj=function(){
return this.msgObj
};
SkinLoadedZimlet.prototype.getConfig=function(e){
return this.cfgObj[e]
};
SkinLoadedZimlet.prototype.getResource=function(e){
return["/zimbra/skins/velodrome2/",this.name,"/",e].join("")
};
SkinLoadedZimlet.prototype.displayStatusMessage=function(e){
appCtxt.setStatusMsg(e)
};
if(!window.net_comcast_sms){
net_comcast_sms={}
}
net_comcast_sms.config={
deeplinkRef:"sms",broadcloudBase:"https://secure.api.comcast.net/textmsg",pollTime:10*60*1000};
if(!window.net_comcast_sms){
net_comcast_sms={}
}
net_comcast_sms.TEMPLATE_BASE="net_comcast_sms";
AjxPackage.define(net_comcast_sms.TEMPLATE_BASE);
net_comcast_sms.SmsZimlet=function(){
SkinLoadedZimlet.call(this,"net_comcast_sms",ZmMsg,net_comcast_sms.config);
this._loadCallbacks=[];
net_comcast_sms.instance=this
};
net_comcast_sms.SmsZimlet.prototype=new SkinLoadedZimlet;
net_comcast_sms.SmsZimlet.prototype.constructor=net_comcast_sms.SmsZimlet;
net_comcast_sms.SmsZimlet.prototype.toString=function(){
return"net_comcast_sms.SmsZimlet"
};
net_comcast_sms.SmsZimlet.prototype.getSubscribed=function(e){
return net_comcast_sms.Provisioning.getSubscribed(e)
};
net_comcast_sms.SmsZimlet.prototype.signup=function(a,e,o,t){
return net_comcast_sms.Provisioning.signup(a,e,o,t)
};
net_comcast_sms.SmsZimlet.prototype.getAvailableTNs=function(e){
net_comcast_sms.Provisioning.getAvailableTNs(e)
};
net_comcast_sms.SmsZimlet.prototype.isEntitled=function(){
return net_comcast_sms.Provisioning.isEntitled()
};
net_comcast_sms.SmsZimlet.prototype.loadVoiceData=function(e){
net_comcast_sms.Provisioning.load(e)
};
net_comcast_sms.SmsZimlet.prototype.init=function(){
var o=net_comcast_sms.Util.getCOSName();
if(o=="mail"||o=="mail-noad"){}else{
var a="/zimbra/skins/velodrome2/public/";
net_comcast_sms.SmsZimlet.PROXY=a+"proxy.jsp?api=codebig&url=";
net_comcast_sms.SmsZimlet.TERMS=a+"getTerm.jsp";
net_comcast_sms.SmsZimlet.RECORDCONTRACT=a+"recordContract.jsp";
net_comcast_sms.SmsZimlet.ORDERADD=a+"orderAdd.jsp";
net_comcast_sms.SmsZimlet.CONFIG=a+"getConfigValues.jsp";
net_comcast_sms.SmsZimlet.COSTS_LIMITED=this.getMessageF("prov_costs_limited.")||this.getResource("html/costs_limited.html");
net_comcast_sms.SmsZimlet.COSTS_UNLIMITED=this.getMessageF("prov_costs_unlimited")||this.getResource("html/costs_unlimited.html");
net_comcast_sms.SmsZimlet.COSTS_NEITHER=this.getMessageF("prov_costs_neither")||this.getResource("html/costs_neither.html");
net_comcast_sms.SmsZimlet.MARKETING=this.getMessageF("prov_marketing")||this.getResource("html/marketing.html");
net_comcast_sms.SmsZimlet.NOT_ENTITLED=this.getMessageF("prov_secondary")||this.getResource("html/secondary.html");
net_comcast_sms.SmsZimlet.BUSINESS=this.getMessageF("prov_business")||this.getResource("html/business.html");
net_comcast_sms.SmsZimlet.NO_CPNI=this.getMessageF("prov_noCPNI")||this.getResource("html/noCPNI.html");
net_comcast_sms.SmsZimlet.PENDING=this.getMessageF("prov_pending")||this.getResource("html/pending.html");
net_comcast_sms.SmsZimlet.PRIMARY_CCENTRAL=this.getMessageF("prov_primary_cCentral")||this.getResource("html/primary_cCentral.html");
net_comcast_sms.SmsZimlet.PRIMARY_CCENTRAL_MUSTGO=this.getMessageF("prov_primary_cCentral_mustgo")||this.getResource("html/primary_cCentral_mustgo.html");
net_comcast_sms.SmsZimlet.SECONDARY=this.getMessageF("prov_secondary")||this.getResource("html/secondary.html");
net_comcast_sms.SmsZimlet.SECONDARY_CCENTRAL=this.getMessageF("prov_secondary_cCentral")||this.getResource("html/secondary_cCentral.html");
net_comcast_sms.SmsZimlet.SECONDARY_NOTASSIGNED=this.getMessageF("prov_secondary_notAssigned")||this.getResource("html/secondary_notAssigned.html");
net_comcast_sms.SmsZimlet.SNS_ENABLED=this.getMessageF("prov_snsEnabled")||this.getResource("html/snsEnabled.jsp");
net_comcast_sms.SmsZimlet.SYNCING=this.getMessageF("prov_syncing")||this.getResource("html/syncing.html");
net_comcast_sms.SmsZimlet.NO_ACCESS=this.getMessageF("prov_noAccess")||this.getResource("html/noAccess.html");
net_comcast_sms.SmsZimlet.V2G_INTRO=this.getMessageF("prov_v2g_intro")||this.getResource("html/v2go_intro.html");
net_comcast_sms.SmsZimlet.V2G_INTRO_LARGE=this.getMessageF("prov_v2g_intro_large")||this.getResource("html/v2go_intro_large.html");
net_comcast_sms.SmsZimlet.V2G_INTRO_SIZE=this.getMessageF("prov_v2g_intro_size").split(",");
net_comcast_sms.SmsZimlet.V2G_CCENTRAL=this.getMessageF("prov_v2g_ccentral")||this.getResource("html/v2go_ccentral.html");
net_comcast_sms.SmsZimlet.V2G_CCENTRAL_SIZE=this.getMessageF("prov_v2g_ccentral_size").split(",");
net_comcast_sms.SmsZimlet.V2G_NOMAP=this.getMessageF("prov_v2g_nomap")||this.getResource("html/v2go_nomap.html");
net_comcast_sms.SmsZimlet.V2G_NOMAP_SIZE=this.getMessageF("prov_v2g_nomap_size").split(",");
this.getConfigObj();
this._controller=new net_comcast_sms.Controller(DwtShell.getShell(window),this);
this._setupTab();
var s=this.getConfig("deeplinkRef")||"net_comcast_sms";
var n=caboUtil.urlParam("app")||"";
if(n.toLowerCase()==s.toLowerCase()){
appCtxt.getAppController().activateApp(this.app._name,true)
}}
var t=ZmZimbraMail._confirmExitMethod;
var e=this;
ZmZimbraMail._confirmExitMethod=function(){
var r=t();
e._onUnLoad();
if(r){
setTimeout(function(){
e._onCancelUnLoad()
}
,3000)
}
return r
};
window.onbeforeunload=ZmZimbraMail._confirmExitMethod
};
net_comcast_sms.SmsZimlet.prototype.load=function(t){
caboUtil.log("Load sequence 1");
this._loadCallbacks.push(t);
if(!this._loadBegun){
this._loadBegun=true;
var e=net_comcast_sms.Provisioning.getMasterAccount(new AjxCallback(this,this._load2))
}else{
if(this._loadComplete){
this._finishLoad(t)
}}};
net_comcast_sms.SmsZimlet.prototype._load2=function(t){
caboUtil.log("Load sequence 2");
if(!t){
this._controller.showError(this.getMsg("loadErrorMasterAccountNotFound"))
}else{
this._masterAccount=t;
var e=t.users[0];
this._load3(e)
}};
net_comcast_sms.SmsZimlet.prototype._load3=function(e){
caboUtil.log("Load sequence 3");
this._controller.setUserAccount(e,new AjxCallback(this,this._finishLoad))
};
net_comcast_sms.SmsZimlet.prototype._finishLoad=function(){
caboUtil.log("Load sequence 4");
var a=!this._loadComplete;
this._loadComplete=true;
var t=[].concat(this._loadCallbacks);
this._loadCallbacks.length=0;
var e=this;
setTimeout(function(){
caboUtil.run(t)
}
,0);
this.getConfigObj(new AjxCallback(this,function(o){
if(o.comcast_cometEnabled&&!this._notificationClient){
this._notificationClient=window.Comcast_cometd
}
if(a&&this._notificationClient){
net_comcast_sms.Provisioning.getSelectedTN(new AjxCallback(this,function(s){
if(s){
var n=this._controller;
this._notificationClient.addListener(AjxCallback.simpleClosure(n.handleNotification,n));
this._notificationClient.start(s)
}}
))
}}
))
};
net_comcast_sms.SmsZimlet.prototype._onUnLoad=function(){
caboUtil.log("Unloading");
if(this._notificationClient){
try{
this._notificationClient.stop()
}
catch(t){}}};
net_comcast_sms.SmsZimlet.prototype._onCancelUnLoad=function(){
caboUtil.log("Not unloading after all");
if(this._notificationClient){
try{
this._notificationClient.start(null,true)
}
catch(t){}}};
net_comcast_sms.SmsZimlet.prototype.getConfigObj=function(t){
var e=caboUtil.LoadHandler.get(this);
e.run(t,new AjxCallback(this,function(a){
AjxRpc.invoke(null,net_comcast_sms.SmsZimlet.CONFIG,null,new AjxCallback(this,function(n){
var o=this.config=JSON.gparse(n.text);
if(!o.comcast_useRestSsml){
net_comcast_sms.SmsZimlet.PROXY="/zimbra/skins/velodrome2/public/proxy.jsp?api=codebig&noRest=1&url="
}
caboUtil.run(a,o)
}
),true)
}
))
};
net_comcast_sms.SmsZimlet.prototype.getDisplayName=function(){
return this.getMsg("xtmTitle")
};
net_comcast_sms.SmsZimlet.prototype.getMsg=function(t){
var a=this.getMessage(t);
if(arguments.length>1){
var e=Array.prototype.slice.call(arguments,1);
a=AjxMessageFormat.format(a,e)
}
return a
};
net_comcast_sms.SmsZimlet.prototype._setupTab=function(){
var r=appCtxt.getAppChooser();
var a=AjxUtil.indexOf(r.getChildren(),r.getButton(ZmApp.PREFERENCES));
var e=this.createApp(this.getMsg("xtmTitle"),"Telephone",this.getMsg("xtmTooltip"),a);
var s=appCtxt.getAppChooser();
var t={};
for(var n=0;
n<s._children.size();
n++){
var o=s._children.get(n);
t[o.getData("_id_")]=o
}
s._buttons=t;
this.app=appCtxt.getApp(e);
this.app._controller=this._controller
};
net_comcast_sms.SmsZimlet.prototype.getAppController=function(){
return this.app.getController()
};
net_comcast_sms.SmsZimlet.prototype.getOverviewWidth=function(){
return window.skin.getTreeWidth()
};
net_comcast_sms.SmsZimlet.prototype.setOverviewWidth=function(t){
var e=this.getOverviewWidth();
appCtxt.getAppViewMgr()._appTreeSashCallback(t-e)
};
net_comcast_sms.SmsZimlet.prototype.getNotificationClient=function(){
return this._notificationClient
};
net_comcast_sms.SmsZimlet.prototype.getController=function(){
return this._controller
};
net_comcast_sms.SmsZimlet.prototype.composeToContact=function(e){
return this._controller.composeToContact(e)
};
net_comcast_sms.SmsZimlet.prototype.getIframeLightbox=function(){
if(!this._iframeLightbox){
this._iframeLightbox=new net_comcast_sms.IframeLightBox({
parent:appCtxt.getShell(),controller:this._controller}
);
this._iframeLightbox.setSize(700,300)
}
return this._iframeLightbox
};
AjxTemplate.register("net_comcast_sms#ThreadViewList",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellspacing=0 cellpadding=0 width='100%' height='100%'><tr><td class='ThreadViewList'><div id='";
e[a++]=n.id;
e[a++]="_none' style='height:100%'></div><div id='";
e[a++]=n.id;
e[a++]="_thread' style='height:100%'></div></td></tr><tr><td class='ThreadViewFooter'><div id='";
e[a++]=n.id;
e[a++]="_reply'></div><div id='";
e[a++]=n.id;
e[a++]="_forward'></div><div id='";
e[a++]=n.id;
e[a++]="_deleteThread'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#ThreadViewList","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms",AjxTemplate.getTemplate("net_comcast_sms#ThreadViewList"),AjxTemplate.getParams("net_comcast_sms#ThreadViewList"));
AjxTemplate.register("net_comcast_sms#ThreadView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_header' class='ThreadViewHeader'></div><div id='";
e[a++]=n.id;
e[a++]="_more'></div><div id='";
e[a++]=n.id;
e[a++]="_thread' class='ThreadViewBody'></div>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#ThreadView","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#MessageViewIncoming",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_message' class='IncomingMessage'><table cellpadding='0' cellspacing='0'><tr><td class='MessageLeftPadding' width='33px'><div style='width:33px'><div id='";
e[a++]=n.id;
e[a++]="_forward_buttons' class='MessageForwardButtons'><div id='";
e[a++]=n.id;
e[a++]="_check_forward' class='MessageForwardButton'></div></div></div></td><td class='MessageTableCell' id='";
e[a++]=n.id;
e[a++]="_balloon' width='400px'><table border='0' cellspacing=0 cellpadding=0 class='MessageTable'><tr><td class='MessageImage'><!--<img id='";
e[a++]=n.id;
e[a++]="_image'/>--></td><td class='MessageBodyCell'><div class='MessageBody'><div id='";
e[a++]=n.id;
e[a++]="_body'></div></div></td></tr><tr><td><div id='";
e[a++]=n.id;
e[a++]="_lock' class='MessageLock'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_annotation' class='MessageAnnotation'></div></td></tr></table></td><td class='ButtonTableCell' width='100%'><table><tr><td class='MessageButtons'><div id='";
e[a++]=n.id;
e[a++]="_edit_buttons' class='MessageEditButtons' style='float:left'><table><tr><td><div id='";
e[a++]=n.id;
e[a++]="_button_lock' class='MessageEditButton'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_button_unlock' class='MessageEditButton'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_button_delete' class='MessageEditButton'></div></td></tr></table></div><div id='";
e[a++]=n.id;
e[a++]="_processing_area' class='MessageProcessingArea' style='float:left'><div id='";
e[a++]=n.id;
e[a++]="_processing' class='MessageProcessing'></div></div></td></tr></table></td><td class='MessageRightPadding' width='33px'><div style='width:33px'></div></td></tr><tr><td class='MessageLeftPadding'></td><td colspan='3'><div class='tip'>&nbsp;</div></td></tr></table></div><div id='";
e[a++]=n.id;
e[a++]="_restore' class='MessageRestore'><div id='";
e[a++]=n.id;
e[a++]="_button_restore' class='MessageRestoreButton'></div><div id='";
e[a++]=n.id;
e[a++]="_restoring_area' class='MessageProcessingArea'><div id='";
e[a++]=n.id;
e[a++]="_restoring' class='MessageProcessing'></div></div></div>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#MessageViewIncoming","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#MessageViewOutgoing",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_message' class='OutgoingMessage'><table cellpadding='0' cellspacing='0'><tr><td class='MessageLeftPadding' width='33px'><div style='width:33px'></div></td><td class='ButtonTableCell' width='100%' align=\"right\"><table><tr><td class='MessageButtons'><div id='";
e[a++]=n.id;
e[a++]="_edit_buttons' class='MessageEditButtons'><table><tr><td><div id='";
e[a++]=n.id;
e[a++]="_button_lock' class='MessageEditButton'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_button_unlock' class='MessageEditButton'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_button_delete' class='MessageEditButton'></div></td></tr></table></div><div id='";
e[a++]=n.id;
e[a++]="_forward_buttons' class='MessageForwardButtons' style='float:right'><div id='";
e[a++]=n.id;
e[a++]="_check_forward' class='MessageForwardButton'></div></div><div id='";
e[a++]=n.id;
e[a++]="_processing_area' class='MessageProcessingArea' style='float:right'><div id='";
e[a++]=n.id;
e[a++]="_processing' class='MessageProcessing'></div></div></td></tr></table></td><td class='MessageTableCell' id='";
e[a++]=n.id;
e[a++]="_balloon' width='400px'><table border='0' cellspacing=0 cellpadding=0 class='MessageTable'><tr><td class='MessageImage'></td><td class='MessageBodyCell'><div class='MessageBody'><div id='";
e[a++]=n.id;
e[a++]="_body'></div></div></td></tr><tr><td><div id='";
e[a++]=n.id;
e[a++]="_lock' class='MessageLock'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_annotation' class='MessageAnnotation'></div></td></tr></table></td><td class='MessageRightPadding' width='33px'><div style='width:33px'></div></td></tr><tr><td colspan='3'><div class='tip'>&nbsp;</div></td><td class='MessageRightPadding'></td></tr></table></div><div id='";
e[a++]=n.id;
e[a++]="_restore' class='MessageRestore'><div id='";
e[a++]=n.id;
e[a++]="_button_restore' class='MessageRestoreButton'></div><div id='";
e[a++]=n.id;
e[a++]="_restoring_area' class='MessageProcessingArea'><div id='";
e[a++]=n.id;
e[a++]="_restoring' class='MessageProcessing'></div></div></div>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#MessageViewOutgoing","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#Reply",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellspacing=0 cellpadding=0 width='100%' height='100%'><tr id='";
e[a++]=n.id;
e[a++]="_groupRow'><td class='ReplyGroup' colspan='3'><div id=\"";
e[a++]=n.id;
e[a++]="_group\"></div></td></tr><!--<tr id='";
e[a++]=n.id;
e[a++]="_subjectRow'><td class='ReplySubject' colspan='3'><table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td class='ReplySubjectLabel'>\n";
e[a++]="\t\t\t\t\t\t\t";
e[a++]=n.msg["replySubjectLabel"];
e[a++]="\n";
e[a++]="\t\t\t\t\t\t</td><td class='ReplySubjectField'><div id='";
e[a++]=n.id;
e[a++]="_subject'></div></td></tr></table></td></tr>--><tr><td class='ReplyField' colspan='3'><div id='";
e[a++]=n.id;
e[a++]="_field'></div></td></tr><tr class='ReplyRow'><td class='ReplyLength'><div id='";
e[a++]=n.id;
e[a++]="_length'></div></td><td width='100%'></td><td class='ReplyButtons'><table><tr><td class='ReplyEmoticon'><div id='";
e[a++]=n.id;
e[a++]="_emoticon' class='EmoticonReplyButton'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_send'></div></td></tr></table></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Reply","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#DeleteThread",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table><tr><td><div id='";
e[a++]=n.id;
e[a++]="_messageCount'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_deleteButton'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#DeleteThread","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#Forward",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table class='ForwardTable'><tr><td><div id='";
e[a++]=n.id;
e[a++]="_sms'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_email'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Forward","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#Compose",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr id='";
e[a++]=n.id;
e[a++]="_headerRow'><td class='ComposeViewHeader' colspan='2'><div id='";
e[a++]=n.id;
e[a++]="_header'></div></td></tr><tr id='";
e[a++]=n.id;
e[a++]="_toRow'><td class='ComposeTo' colspan='2'><table border='0' cellspacing='0' cellpadding='0' width='100%' ";
if(AjxEnv.isIE){
e[a++]=' style="padding-left:10px;padding-right:6px;" '
}
e[a++]="><tr><td class='ComposeToLabel'>";
e[a++]=n.msg["composeToLabel"];
e[a++]="</td><td class='ComposeToField'><div id='";
e[a++]=n.id;
e[a++]="_to'></div></td></tr></table></td></tr><!--<tr id='";
e[a++]=n.id;
e[a++]="_subjectRow'><td class='ComposeSubject' colspan='2'><table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td class='ComposeSubjectLabel'>";
e[a++]=n.msg["composeSubjectLabel"];
e[a++]="</td><td class='ComposeSubjectField'><div id='";
e[a++]=n.id;
e[a++]="_subject'></div></td></tr></table></td></tr>--><tr id='";
e[a++]=n.id;
e[a++]="_textRow'><td class='ComposeField' colspan='2'><div id='";
e[a++]=n.id;
e[a++]="_field'></div></td></tr><tr id='";
e[a++]=n.id;
e[a++]="_footerRow'><td class='ComposeLength'><div id='";
e[a++]=n.id;
e[a++]="_length'></div></td><td class='ComposeButtons'><table><tr><td><div id='";
e[a++]=n.id;
e[a++]="_emoticon'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_send'></div></td></tr></table></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Compose","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#EmoticonChooser",function(t,r,s,e){
var n=Boolean(e);
s=(typeof s=="string"?{
id:s}
:s)||{};
e=e||[];
var o=e.length;
e[o++]="<table border='0' cellspacing='3' cellpadding='0' height='100%'><tr>";
for(var a=0;
a<s.count;
a++){
e[o++]='<td><div id="';
e[o++]=s.id;
e[o++]="_btn";
e[o++]=a;
e[o++]='" class="ZButton"';
if(AjxEnv.isIE){
e[o++]=' style="width:20px;height:20px;"'
}
e[o++]='><div class="ZButtonBorder"><div id="';
e[o++]=s.id;
e[o++]="_emo";
e[o++]=a;
e[o++]='"></div></div></div></td>'
}
e[o++]="</tr></table>";
return n?e.length:e.join("")
}
,{
id:"net_comcast_sms#EmoticonChooser","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#UnsentView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td><div id='";
e[a++]=n.id;
e[a++]="_label'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_count'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#UnsentView","class":"ZWidget"}
,false);
AjxTemplate.register("net_comcast_sms#Preferences",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div align=right style='margin-right: 20px; margin-bottom: 10px;'><div id='";
e[a++]=n.id;
e[a++]="_REVERT_PAGE' tabindex='10' style='margin-right: 25px;'></div></div><table border='0' cellspacing='0' cellpadding='0' width='100%'><tr class='ZOptionsHeaderRow'><td class='ZOptionsHeaderL'><div class='ImgPrefsHeader_L'></div></td><td class='ZOptionsHeader ImgPrefsHeader'>";
e[a++]=n.msg["prefGeneralSectionTitle"];
e[a++]="</td><td class='ZOptionsHeaderR'><div class='ImgPrefsHeader_R'></div></td></tr></table><table class='ZOptionsSectionTable' border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td class='ZOptionsSectionMain'><table width=100%><tr><td class='ZOptionsLabelTop'>";
e[a++]=n.msg["prefAutoForwardLabel"];
e[a++]="</td><td class='ZOptionsField'><div id='";
e[a++]=n.id;
e[a++]="_SMS_AUTO_FORWARD_EMAIL' tabindex='36'></div></td><td class='ZOptionsLabelTop'>";
e[a++]=n.msg["prefAutoForwardToLabel"];
e[a++]="</td><td class='ZOptionsField' style='vertical-align:top'><div id='";
e[a++]=n.id;
e[a++]="_SMS_AUTO_FORWARD_EMAIL_ADDR' tabindex='37'></div></td></tr><tr><td></td><td class='ZOptionsField'><div id='";
e[a++]=n.id;
e[a++]="_SMS_UNSUBSCRIBE' tabindex='39'></div></td></tr></table></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Preferences"}
,false);
AjxTemplate.register("net_comcast_sms#Provisioning",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border='0' cellspacing='0' cellpadding='0' width='100%' height='100%'><tr><td class='ProvisioningHeader' colspan='2'><div id='";
e[a++]=n.id;
e[a++]="_header'></div></td></tr><tr><td><table border='0' cellspacing='0' cellpadding='0' width='100%' height='100%' class='ProvisioningBody'><tr><td height='100%' class='Content'><div id=\"";
e[a++]=n.id;
e[a++]='_notEntitled"></div><div id="';
e[a++]=n.id;
e[a++]='_marketing"></div><div id="';
e[a++]=n.id;
e[a++]='_accountChooser"></div><div id="';
e[a++]=n.id;
e[a++]='_terms"></div><div id="';
e[a++]=n.id;
e[a++]='_costs"></div><div id="';
e[a++]=n.id;
e[a++]="_congratulations\"></div></td></tr><tr><td align='center' class='Buttons'><table border='0' cellspacing='0' cellpadding='0'><tr><td><div id=\"";
e[a++]=n.id;
e[a++]='_backButton"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_declineButton"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_acceptButton"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_okButton"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_nextButton"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_signupButton"></div></td></tr></table></td></tr></table></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Provisioning"}
,false);
AjxTemplate.register("net_comcast_sms#Provisioning.AccountChooser",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border='0' cellspacing='0' cellpadding='0' width='100%' height='200' class='AccountChooser'><tr height='33%'><td><div id=\"";
e[a++]=n.id;
e[a++]="_text1\"></div></td></tr><tr height='34%'><td><div id=\"";
e[a++]=n.id;
e[a++]='_list" class="AccountChooserList"></div></td></tr><tr height=\'33%\'><td><div id="';
e[a++]=n.id;
e[a++]='_text2"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Provisioning.AccountChooser"}
,false);
AjxTemplate.register("net_comcast_sms#Provisioning.AccountChooser.RadioButton",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table cellpadding='2' cellspacing='0' border='0' width='100%'><tr><td><label id='";
e[a++]=n.id;
e[a++]="_text_left' for='";
e[a++]=n.id;
e[a++]="_input' class='Text' style='text-align:right'></label></td><td><input id='";
e[a++]=n.id;
e[a++]="_input' name='";
e[a++]=n.name;
e[a++]="' value='";
e[a++]=n.value;
e[a++]="' type='radio' ";
e[a++]=n.checked;
e[a++]="></td><td width='100%'><label id='";
e[a++]=n.id;
e[a++]="_text_right' for='";
e[a++]=n.id;
e[a++]="_input' class='Text' style='text-align:left'></label></td><td><div id='";
e[a++]=n.id;
e[a++]="_image_right' class='RadioButtonImage ImgCheck'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#Provisioning.AccountChooser.RadioButton"}
,false);
AjxTemplate.register("net_comcast_sms#ErrorView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table cellpadding='2' cellspacing='0' border='0'><tr><td><img src=\"";
e[a++]=n.img;
e[a++]='"/></td><td><h1 id="';
e[a++]=n.id;
e[a++]='_title">';
e[a++]=n.msg["loadFailedHead"];
e[a++]='</h1><p id="';
e[a++]=n.id;
e[a++]='_msg">';
e[a++]=n.msg["loadFailedBody"];
e[a++]="</p></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"net_comcast_sms#ErrorView"}
,false);
if(!window.caboUtil){
window.caboUtil={
onload_listeners:{}
,has_loaded:{}
,namespace:function(e){
if(!this[e]){
this[e]={};
return true
}
return false
}
,onload:function(e,t){
if(this.has_loaded[e]){
caboUtil.run(t)
}else{
if(!this.onload_listeners[e]){
this.onload_listeners[e]=[]
}
this.onload_listeners[e].push(t)
}}
,fill:function(e,a){
var t=(AjxUtil.isObject(e)&&e)||(AjxUtil.isString(e)&&this[e])||null;
if(t){
AjxUtil.hashUpdate(t,a,true)
}}
,fillProto:function(e,t){
if(this[e]&&this[e].prototype){
AjxUtil.hashUpdate(this[e].prototype,t,true)
}}
,run:function(o){
if(o){
var e=Array.prototype.slice.call(arguments,1);
if(o instanceof AjxCallback){
return o.run.apply(o,e)
}else{
if(AjxUtil.isFunction(o)){
return o.apply(o,e)
}else{
if(AjxUtil.isArray(o)){
var n=[];
var s=[].concat(o);
for(var a=0,t=s.length;
a<t;
a++){
n[a]=this.run.apply(this,[s[a]].concat(e))
}
return n
}}}}}
,apply:function(o,t){
var e=[o];
for(var a=0;
a<t.length;
a++){
e.push(t[a])
}
this.run.apply(this,e)
}
,augment:function(n,o,e,t){
if(!n){
n=window
}
var a=n[o];
if(a){
n[o]=function(){
if(t){
var s=e.apply(this,arguments);
return a.apply(this,s)
}else{
var s=[a.apply(this,arguments)].concat(Array.prototype.slice.call(arguments,0));
return e.apply(this,s)
}}
}}
,urlParam:function(e){
e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var a=new RegExp("[\\?&]"+e+"=([^&#]*)");
var t=a.exec(window.location.href);
return(t==null)?"":t[1]
}
,log:function(){
if(window.console&&window.console.log){
if(AjxEnv.isIE){
console.log(Array.prototype.join.call(arguments,", "))
}else{
console.log.apply(console,arguments)
}}}
,__load:function(t){
var e=this.onload_listeners[t];
this.run(e);
this.has_loaded[t]=true
}}
}
if(caboUtil.namespace("Coll")){
caboUtil.fill("Coll",{
collapseHashArray:function(t,a,n){
var e={};
for(var o=0;
o<t.length;
o++){
AjxUtil.hashUpdate(e,t[o],a,n)
}
return e
}
,asHash:function(t,e){
if(AjxUtil.isObject(t)){
if(AjxUtil.isArray(t)){
return AjxUtil.arrayAsHash(t,e)
}else{
return t
}}else{
return AjxUtil.arrayAsHash([t],e)
}}
,isEmpty:function(e){
if(AjxUtil.isObject(e)&&!AjxUtil.isArray(e)){
for(var t in e){
return false
}
return true
}else{
return AjxUtil.isEmpty(e)
}}
,uniq:function(o){
var t=[];
for(var s=0,n=o.length;
s<n;
s++){
var e=o[s];
if(!e.___uniq_flag){
e.___uniq_flag=true;
t.push(e)
}}
for(var s=0,n=o.length;
s<n;
s++){
delete o[s].___uniq_flag
}
return t
}
,range:function(n,o,t){
var e=[];
for(var a=n;
a<=o;
a++){
e.push(t?t(a):a)
}
return e
}
,deref:function(a,l,r){
var s=(arguments.length>=3);
var n=l.split(".");
for(var o=0,e=n.length;
o<e;
o++){
var h=n[o];
var t=s&&(o+1==e);
if(s){
if(t){
a[h]=r;
return
}else{
if(!AjxUtil.isObject(a[h])){
a[h]={}
}}}else{
if(!AjxUtil.isObject(a)){
return undefined
}}
a=a[h]
}
return a
}
,deepcopy:function(n){
if(AjxUtil.isObject(n)){
var e=AjxUtil.isArray(n)?[]:{};
for(var a in n){
var o=n[a];
if(AjxUtil.isArray(o)){
var s=e[a]=[];
for(var t=0;
t<o.length;
t++){
s[t]=this.deepcopy(o[t])
}}else{
if(AjxUtil.isObject(o)){
e[a]=this.deepcopy(o)
}else{
e[a]=o
}}}
return e
}else{
return n
}}
,isHash:function(e){
return AjxUtil.isObject(e)&&!AjxUtil.isArray(e)
}
,map:function(o,a){
if(AjxUtil.isFunction(a)){
return AjxUtil.map(o,a)
}else{
if(AjxUtil.isObject(a)){
var e=new Array(o.length);
for(var t=0;
t<o.length;
t++){
e[t]=a[o[t]]
}
return e
}}}
,mapToHash:function(o,a){
var e={};
for(var t=0;
t<o.length;
t++){
e[a(o[t])]=o[t]
}
return e
}
,flatten:function(o,a){
if(!AjxUtil.isObject(o)){
return[o]
}else{
if(AjxUtil.isObject(o)&&!AjxUtil.isArray(o)){
if(a&&o.constructor!==Object){
return[o]
}else{
o=AjxUtil.values(o)
}}}
var e=[];
for(var t=0;
t<o.length;
t++){
e=e.concat(this.flatten(o[t],a))
}
return e
}
,getValues:function(o,a){
var e=[];
for(var t=0;
t<a.length;
t++){
e[t]=o[a[t]]
}
return e
}}
);
caboUtil.__load("caboUtil.Coll")
}
if(caboUtil.namespace("MultiCallback")){
caboUtil.MultiCallback=function(t,e,o,a){
this.i=caboUtil.Coll.asHash(t);
this.e=e;
this.a=o;
this.r=AjxUtil.hashCopy(this.i);
this.v={};
this.o=a
};
caboUtil.MultiCallback.prototype._run=function(t){
if(this.i[t]){
if(this.r[t]){
delete this.r[t]
}else{
if(this.o){
return
}}
var e=this.v[t]=Array.prototype.slice.call(arguments,1);
caboUtil.run.apply(null,[this.e,t].concat(e));
if(caboUtil.Coll.isEmpty(this.r)){
caboUtil.run.apply(null,[this.a,this.v])
}}};
caboUtil.MultiCallback.prototype.getCallback=function(e){
return this.i[e]&&new AjxCallback(this,this._run,[e])||null
};
caboUtil.MultiCallback.simple=function(t,e,o,a){
return new caboUtil.MultiCallback(caboUtil.Coll.range(0,t-1),e,o,a)
};
caboUtil.__load("caboUtil.MultiCallback")
}
if(caboUtil.namespace("Dom")){
caboUtil.fill("Dom",{
getElementCssProperty:function(t,h){
var c,o=!AjxUtil.isArray(h);
if(o){
h=[h]
}
if(t.ownerDocument==null){
for(var r=t.parentNode;
r.parentNode!=null;
r=r.parentNode){}
var s=r
}else{
var s=t.ownerDocument
}
if(s.defaultView&&s.defaultView.getComputedStyle){
var e=s.defaultView.getComputedStyle(t,"");
if(e&&e.length>0){
c=caboUtil.Coll.map(h,AjxCallback.simpleClosure(e.getPropertyValue,e))
}}
if(!c){
var l=[];
for(var a=0;
a<h.length;
a++){
if(h[a]){
var n=h[a].split("-");
l.push(n.shift()+AjxUtil.map(n,AjxStringUtil.capitalize).join(""))
}}
if(t.currentStyle){
c=caboUtil.Coll.map(l,t.currentStyle)
}else{
if(t.style){
c=caboUtil.Coll.map(l,t.style)
}}}
return(o)?c[0]:c
}
,getScrollBarWidth:function(){
if(!this.__scrollbarSize){
var a=document.createElement("p");
AjxUtil.hashUpdate(a.style,{
width:"100%",height:"200px"}
,true);
var o=document.createElement("div");
AjxUtil.hashUpdate(o.style,{
position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}
,true);
o.appendChild(a);
document.body.appendChild(o);
var t=a.offsetWidth;
o.style.overflow="scroll";
var e=a.offsetWidth;
if(t==e){
e=o.clientWidth
}
document.body.removeChild(o);
this.__scrollbarSize=(t-e)
}
return this.__scrollbarSize
}
,isAncestor:Dwt.isAncestor||function(e,t){
if(e instanceof DwtControl){
e=e.getHtmlElement()
}
if(t instanceof DwtControl){
t=t.getHtmlElement()
}
if(e==t){
return true
}
while(t){
t=t.parentNode;
if(t==e){
return true
}}
return false
}
,htmlToElement:function(t,e){
var a=document.createElement(e||"div");
a.innerHTML=t;
return a.childNodes
}
,remove:function(t){
t=AjxUtil.toArray(t);
for(var e=0;
e<t.length;
e++){
var a=t[e];
if(a.parentNode){
a.parentNode.removeChild(a)
}}}
,hasClass:function(t,e){
if(!t||!e||!t.className){
return false
}
return t.className.match(new RegExp("\\b"+e+"\\b"))
}
,byClass:function(o,a){
a=a||document;
var n=[];
if(this.hasClass(a,o)){
n.push(a)
}
for(var t=0;
t<a.childNodes.length;
t++){
if(a.childNodes[t].nodeType==1){
var e=this.byClass(o,a.childNodes[t]);
if(e){
n=n.concat(e)
}}}
return n
}}
);
caboUtil.__load("caboUtil.Dom")
}
if(caboUtil.namespace("LoadHandler")){
caboUtil.LoadHandler=function(e){
this.obj=e;
this._listeners=[]
};
caboUtil.LoadHandler.prototype.run=function(o,e,t){
var a=this.obj;
if(this._loaded&&!t){
caboUtil.run(o,this._answer)
}else{
this._listeners.push(o);
if(!this._loading||t){
this._loading=true;
caboUtil.run(e,new AjxCallback(this,function(s){
this._answer=s;
this._loaded=true;
var n=[].concat(this._listeners);
this._listeners.length=0;
caboUtil.run(n)
}
))
}}};
caboUtil.LoadHandler.get=function(e){
return e.__loadHandler||(e.__loadHandler=new caboUtil.LoadHandler(e))
};
caboUtil.__load("caboUtil.LoadHandler")
}
net_comcast_sms.Util={};
net_comcast_sms.Util.UI={};
net_comcast_sms.Util.UI.dialog=function(a,t){
var e=appCtxt.getMsgDialog();
e.reset();
e.setMessage(a,DwtMessageDialog.INFO_STYLE,t||"Informational");
e.popup(null,true)
};
net_comcast_sms.Util.showLoading=function(t,h,e,n){
var a=appCtxt.getAppViewMgr();
if(!net_comcast_sms.Util.__loading_ids){
net_comcast_sms.Util.__loading_ids={}
}
var o=net_comcast_sms.Util.__loading_ids;
var r=caboUtil.Coll.isEmpty(o);
if(t){
o[h]=true
}else{
if(o[h]){
delete o[h]
}}
var s=caboUtil.Coll.isEmpty(o);
if(s!=r){
if(!s){
a.pushView(ZmId.VIEW_LOADING,n)
}else{
a.popView(n,ZmId.VIEW_LOADING,true);
if(e){
a.pushView(e)
}}}};
net_comcast_sms.Util.UI.loadingIsShown=function(){
return appCtxt.getAppViewMgr().getCurrentViewId()==ZmId.VIEW_LOADING
};
net_comcast_sms.Util.DOM={};
net_comcast_sms.Util.DOM.isAncestor=Dwt.isAncestor||function(t,e){
if(t==e){
return true
}
var a=e;
while(a){
a=a.parentNode;
if(a==t){
return true
}}
return false
};
net_comcast_sms.Util.DOM.resetSize=function(t){
var e=t.getSize();
if(e.x&&e.y){
t.setSize(e.x,e.y)
}};
net_comcast_sms.Util.DOM.getElements=function(e,o,l,d){
var t=AjxUtil.isString(o)&&o||"*";
var n=(o instanceof RegExp)&&o||null;
d=d||document;
var c=(l instanceof RegExp)?l:new RegExp("\\b"+l+"\\b");
var s=[];
var h=d.getElementsByTagName(t);
for(var r=0,a=h.length;
r<a;
r++){
var u=h[r];
if(!e||u.id==e){
if(!n||u.tagName.match(n)){
if(!l||u.className.match(c)){
s.push(u)
}}}}
return s
};
net_comcast_sms.Util.DOM.convertHtml2Text=function(a,n,o){
var t=true;
if(t){
if(!a){
return null
}
if(n&&AjxUtil.isFunction(n._before)){
a=n._before(a)
}
this._convert={
convertor:n,onlyOneNewLinePerP:o}
}
var e=AjxStringUtil.convertHtml2Text.call(this,a,n,o);
if(t){
this._convert=null;
if(n&&AjxUtil.isFunction(n._after)){
e=n._after(e)
}}
return e
};
net_comcast_sms.Util.DOM._traverse=function(e,p,u,c,h,n,s,d,m){
var r=(AjxStringUtil._traverse.length<9);
if(r){
d=d||(this._convert&&this._convert.convertor);
m=m||(this._convert&&this._convert.onlyOneNewLinePerP);
var l=e.nodeName.toLowerCase();
var g=null;
if(d&&d[l]){
g=d[l](e,s)
}
if(g===null&&l=="p"){
g=m?"\n":"\n\n"
}
if(g!==null){
p[u++]=g;
var f=e.childNodes;
var o=f.length;
for(var a=0;
a<o;
a++){
var t=f[a];
if(t.nodeType==1&&t.tagName.toLowerCase()=="li"){
n++
}
u=this._traverse(t,p,u,c,h,n,s,d,m)
}
if(d&&d["/"+l]){
p[u++]=d["/"+l](e)
}
s.lastNode=l;
return u
}}
return AjxStringUtil._traverse.call(this,e,p,u,c,h,n,s,d,m)
};
net_comcast_sms.Util.DOM.scrollIntoView=Dwt.scrollIntoView||function(a,t){
if(!a||!t){
return
}
var e=Dwt.toWindow(a,0,0,null,null,DwtPoint.tmp).y;
var r=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y+t.scrollTop;
var s=e-r;
if(s<0){
t.scrollTop+=s
}else{
var n=Dwt.getSize(t,DwtPoint.tmp).y;
var o=Dwt.getSize(a,DwtPoint.tmp).y;
s=(e+o)-(r+n);
if(s>0){
t.scrollTop+=s
}}};
net_comcast_sms.Util.Date={};
net_comcast_sms.Util.Date.WEEKDAY_NAMES=[I18nMsg.weekdaySunLong,I18nMsg.weekdayMonLong,I18nMsg.weekdayTueLong,I18nMsg.weekdayWedLong,I18nMsg.weekdayThuLong,I18nMsg.weekdayFriLong,I18nMsg.weekdaySatLong];
net_comcast_sms.Util.Date.computeDateStr=function(a){
var s=function(h){
h.setHours(0);
h.setMinutes(0);
h.setSeconds(0);
h.setMilliseconds(0);
return h
};
var t=s(new Date());
var o=s(new Date(a));
var r=AjxDateUtil.computeTimeString(a).toLowerCase();
var e;
var n=Math.floor(t.getTime()/AjxDateUtil.MSEC_PER_DAY)-Math.floor(o.getTime()/AjxDateUtil.MSEC_PER_DAY);
if(n==0){}else{
if(n==1){
e=ZmMsg.yesterday||"Yesterday"
}else{
if(n<7){
e=this.WEEKDAY_NAMES[a.getDay()]
}else{
if(a.getYear()==t.getYear()){
e=AjxDateUtil._dateFormatNoYear.format(a)
}else{
AjxDateFormat.format(AjxDateFormat.SHORT,a)
}}}}
return e?(r+"\n"+e):r
};
net_comcast_sms.Util.TN={};
net_comcast_sms.Util.TN.INTL_PREFIX="011";
net_comcast_sms.Util.TN.format=function(e){
if(e.length==13){
var t=e.substring(0,3);
if(t=="001"||t=="011"){
e=e.substring(3)
}}
if(e.length==11&&e.charAt(0)=="1"){
e=e.substring(1)
}
return e
};
net_comcast_sms.Util.TN.strip=function(e){
return e.replace(/\D/g,"")
};
net_comcast_sms.Util.TN.normalize=function(e,a){
if(!AjxUtil.isString(e)){
return e
}
var t=this.format(this.strip(e));
if(t!=""){
if(t.length<5||t.length>14){
return a?null:e
}else{
return t
}}else{
return a?null:e
}};
net_comcast_sms.Util.TN.pretty=function(e){
var t=e&&this.normalize(e);
if(t&&t.length==10){
return["(",t.substring(0,3),") ",t.substring(3,6),"-",t.substring(6,10)].join("")
}
return e
};
net_comcast_sms.Util.Contact={
__loadListeners:[]};
net_comcast_sms.Util.Contact.getByTN=function(e,o){
var a=appCtxt.getApp(ZmApp.CONTACTS);
this.__loadListeners.push(new AjxCallback(this,function(){
var n=appCtxt.getActiveAccount().id;
if(a.contactsLoaded[n]&&a._contactList[n]){
return this._handleGetContactList(e,o,a.getContactList())
}else{
a.getContactList(new AjxCallback(this,this._handleGetContactList,[e,o]),new AjxCallback(this,this._handleGetContactListFail,[e,o]))
}}
));
if(!this._loading){
this._loading=true;
AjxDispatcher.require(["ContactsCore","Contacts"],true,new AjxCallback(this,function(){
var n=[].concat(this.__loadListeners);
this.__loadListeners.length=0;
caboUtil.run(n);
this._loaded=true
}
))
}else{
if(this._loaded){
var t=[].concat(this.__loadListeners);
this.__loadListeners.length=0;
return caboUtil.run(t)[0]
}}};
net_comcast_sms.Util.Contact._handleGetContactList=function(u,m,d){
u=net_comcast_sms.Util.TN.normalize(u);
var r=null;
if(!this._contactHash){
if(d.size()){
this._contactHash={};
for(var o=0,t=d.size();
o<t;
o++){
var n=d.get(o);
for(var s=0;
s<ZmContact.PHONE_FIELDS.length;
s++){
var c=ZmContact.PHONE_FIELDS[s];
for(var a=1;
true;
a++){
var l=ZmContact.getAttributeName(c,a);
var h=ZmContact.getAttr(n,l);
if(!h){
break
}
var e=d._getPhoneDigits(h);
if(e){
e=net_comcast_sms.Util.TN.normalize(e);
this._contactHash[e]={
contact:n,field:l};
if(e==u){
r=this._contactHash[e]
}}}}}}}else{
r=this._contactHash[u]
}
caboUtil.run(m,r);
return r
};
net_comcast_sms.Util.Contact._handleGetContactListFail=function(e,t){
caboUtil.run(t,null)
};
net_comcast_sms.Util.Contact.getImageUrl=function(e){
return(e&&e.getImageUrl&&e.getImageUrl())||(e&&ZmContact.getAttr(e,"image")&&"http://"+ZmContact.getAttr(e,"image"))||[appCtxt.get(ZmSetting.CSFE_MSG_FETCHER_URI),"&id=",e.id,"&part=",1,"&t=",(new Date()).getTime()].join("")
};
net_comcast_sms.Util.Contact.getName=function(e){
return e&&AjxUtil.isObject(e)&&((e.getFileAs&&e.getFileAs())||ZmContact.getAttr(e,"fileAsStr")||ZmContact.getAttr(e,"fullName")||AjxUtil.collapseList([ZmContact.getAttr(e,"firstName"),ZmContact.getAttr(e,"lastName")]).join(""))||null
};
net_comcast_sms.Util.Contact.getPhone=function(e){
return ZmContact.getAttr(e,ZmContact.F_mobilePhone)||ZmContact.getAttr(e,ZmContact.F_workPhone)||ZmContact.getAttr(e,ZmContact.F_homePhone)||ZmContact.getAttr(e,ZmContact.F_otherPhone)
};
net_comcast_sms.Util.EMOTICONS=[{
img:"ImgEmoticonHappy",chars:":)",regex:":-?\\)"}
,{
img:"ImgEmoticonSad",chars:":(",regex:":-?\\("}
,{
img:"ImgEmoticonMellow",chars:":|",regex:":-?\\|"}
,{
img:"ImgEmoticonDry",chars:":/",regex:":-?/"}
,{
img:"ImgEmoticonGrin",chars:":D",regex:":-?D"}
,{
img:"ImgEmoticonTongue",chars:":P",regex:":-?P"}
];
net_comcast_sms.Util.getUserName=function(){
return appCtxt.get(ZmSetting.DISPLAY_NAME)||appCtxt.accountList.activeAccount.name
};
net_comcast_sms.Util.getCOSName=function(){
return appCtxt.accountList.mainAccount.settings.getInfoResponse.cos.name
};
net_comcast_sms.Util.getZimletHandler=function(){
return net_comcast_sms.instance
};
net_comcast_sms.Util.plainComparator=function(t,e){
if(t==e){
return 0
}
if(!t&&t!==0){
return 1
}
if(!e&&e!==0){
return -1
}
return(t<e)?-1:1
};
net_comcast_sms.Util.unescape=function(e){
return e.replace(/%([\da-e][\da-e])/ig,function(a,t){
var o=window.parseInt(t,16);
return(!isNaN(o))?String.fromCharCode(o):"?"
}
)
};
net_comcast_sms.Util.sendMail=function(e,s,h,l,r){
var a=new ZmMailMsg(1234567890,new ZmMailList(ZmItem.MSG),true);
for(var n=0,o=e.length;
n<o;
n++){
if(e[n] instanceof AjxEmailAddress){
a.addAddress(e[n])
}}
if(h){
a.setSubject(h)
}
var t=new ZmMimePart();
t.setContent(s);
t.setContentType("text/plain");
t.setIsBody(true);
a.setTopPart(t);
a.send(false,l,r)
};
net_comcast_sms.Util.getObjectProxy=function(e){
var t=function(){};
t.prototype=e;
return new t
};
net_comcast_sms.Util.freezeScreen=function(e){
if(!e){
return
}
var t=new Date().getTime()+e;
while(new Date().getTime()<t){}};
net_comcast_sms.Util.getProperty=function(e){
return this._getPropertiesObj(e,true)._content
};
net_comcast_sms.Util.setProperties=function(t,s){
var a=AjxSoapDoc.create("ModifyPropertiesRequest","urn:zimbraAccount");
for(var e in t){
var o=a.set("prop",t[e]);
o.setAttribute("zimlet","net_comcast_sms");
o.setAttribute("name",e)
}
var n={
soapDoc:a,callback:new AjxCallback(this,this._handleSetProperties,[t,s]),asyncMode:true,sensitive:true};
appCtxt.getAppController().sendRequest(n)
};
net_comcast_sms.Util._handleSetProperties=function(t,o){
for(var e in t){
var a=this._getPropertiesObj(e,true);
if(a){
a._content=String(t[e])
}}
caboUtil.run(o)
};
net_comcast_sms.Util._getPropertiesObj=function(t,o){
var n=appCtxt.accountList.mainAccount.settings.getInfoResponse.props;
var e=n.prop=n.prop||[];
for(var a=0;
a<e.length;
a++){
var s=e[a];
if(s&&s.zimlet=="net_comcast_sms"&&s.name==t){
return s
}}
if(o){
var s={
zimlet:"net_comcast_sms",name:t,_content:""};
e.push(s);
return s
}};
net_comcast_sms.Contact=function(e){
this.tn=e
};
net_comcast_sms.Contact.prototype.getDetails=function(e){
if(!this._hasDetails){
net_comcast_sms.Util.Contact.getByTN(this.tn,new AjxCallback(this,this._handleGetDetails,[e]))
}else{
caboUtil.run(e,this)
}};
net_comcast_sms.Contact.prototype._handleGetDetails=function(a,t){
if(t){
var e=this.contact=t.contact;
if(e){
this.name=net_comcast_sms.Util.Contact.getName(e)
}
this.field=t.field
}
this._hasDetails=true;
caboUtil.run(a,this)
};
net_comcast_sms.Model=function(){
this._listeners={}
};
net_comcast_sms.Model.USE_STATIC=0;
net_comcast_sms.Model.STATUS_OK=1;
net_comcast_sms.Model.prototype.getSessionId=function(){
return null
};
net_comcast_sms.Model.prototype.getBroadCloudDomain=function(){
return net_comcast_sms.Util.getZimletHandler().getConfig("broadcloudBase")
};
net_comcast_sms.Model.prototype.rest=function(t,l,n,o,s){
var h=net_comcast_sms.SmsZimlet.PROXY+AjxStringUtil.urlComponentEncode(t),r=n&&JSON.stringify(n)||null,e=new AjxCallback(this,this._handleRest,[l,t]),a={
"Content-type":"application/json"};
h+="&fwdHeader=Content-type";
if(!AjxUtil.isUndefined(s)){
h+="&timeout="+s
}
if(net_comcast_sms.Model.USE_STATIC){
var c=this;
setTimeout(function(){
c._handleRest(l,t,{
success:true,obj:net_comcast_sms.Testdata[t]}
)
}
,0)
}else{
AjxRpc.invoke(r,h,a,e,!!o)
}};
net_comcast_sms.Model.prototype._handleRest=function(o,t,e){
if(e&&e.success){
var a=e.obj||JSON.gparse(e.text);
caboUtil.run(o,a)
}else{
if(ZmZimbraMail._endSessionDone){}else{
caboUtil.run(o,new net_comcast_sms.ConnError(t,e))
}}};
net_comcast_sms.Model.prototype._copyParams=function(s,n,e,a){
a=a||this.acceptedParams||AjxUtil.keys(s);
if(e){
for(var t=0;
t<e.length;
t++){
var o=e[t];
if(AjxUtil.isUndefined(s[o])){
throw net_comcast_sms.ModelError.missingParameterInConstructor(o,this.toString())
}}}
for(var t=0;
t<a.length;
t++){
var o=a[t];
if(!AjxUtil.isUndefined(s[o])){
n[o]=s[o]
}}
return n
};
net_comcast_sms.Model.prototype.parseStatus=function(t){
var e=(t&&AjxUtil.isObject(t.status))?t.status:t;
if(AjxUtil.isArray(e)){
e=e[0]
}
return(e&&e.code==net_comcast_sms.Model.STATUS_OK)?true:new net_comcast_sms.RestError(e)
};
net_comcast_sms.Model.prototype.loginError=function(e){
throw net_comcast_sms.ModelError.notLoggedIn(this.toString()+"::"+e)
};
net_comcast_sms.Model.prototype.runCallback=function(e){
return caboUtil.run.apply(null,arguments)
};
net_comcast_sms.Model.prototype.addListener=function(e,t){
if(!this._listeners[e]){
this._listeners[e]=[]
}
if(AjxUtil.indexOf(this._listeners[e],t)==-1){
this._listeners[e].push(t)
}};
net_comcast_sms.Model.prototype.removeListener=function(e,t){
if(this._listeners[e]){
AjxUtil.arrayRemove(this._listeners[e],t)
}};
net_comcast_sms.Model.prototype.replaceListener=function(t,a,e){
this.removeListener(t,a);
this.addListener(t,e)
};
net_comcast_sms.Model.prototype.callListeners=function(t){
var a=this._listeners[t];
var e=Array.prototype.slice.call(arguments,1);
if(a){
caboUtil.apply(a,e)
}};
net_comcast_sms.Model.prototype.getUrl=function(){
var e=[];
for(var t=0;
t<arguments.length;
t++){
var a=arguments[t];
if(!AjxUtil.isUndefined(a)&&!AjxUtil.isNull(a)){
e.push(a)
}}
var o=this.getSessionId();
return e.join("/")+(o?(";JSESSIONID="+o):"")
};
net_comcast_sms.ModelError=function(e){
this.message=e
};
net_comcast_sms.ModelError.prototype.toString=function(){
return"ModelError: "+this.message
};
net_comcast_sms.ModelError.missingParameterInConstructor=function(e,t){
return new net_comcast_sms.ModelError('Required parameter "'+e+'" is undefined in '+t)
};
net_comcast_sms.ModelError.incorrectParameter=function(t,a,e){
return new net_comcast_sms.ModelError('Required parameter "'+t+'" must be of type "'+a+'" in '+e)
};
net_comcast_sms.ModelError.notLoggedIn=function(e){
return new net_comcast_sms.ModelError('The user must be logged in to access "'+e+'"')
};
net_comcast_sms.RestError=function(e){
if(!e||!e.message){
this.message="Empty response";
this.code=0
}else{
this.message=e.message||e.status;
this.code=e.code
}};
net_comcast_sms.RestError.prototype.toString=function(){
return"RestError: "+this.message
};
net_comcast_sms.ConnError=function(t,e){
this.message="Failed connection to "+t+"<br/>Response was:<br/>"+AjxStringUtil._escapeForHTML(JSON.stringify(e));
this.code=0
};
net_comcast_sms.ConnError.prototype.toString=function(){
return"ConnError: "+this.message
};
net_comcast_sms.FwdConfig=function(e){
net_comcast_sms.Model.call(this);
this.useraccount=e;
this._loading=false;
this._loaded=false;
this._loadListeners=[];
this._current={};
this._orig={}
};
net_comcast_sms.FwdConfig.prototype=new net_comcast_sms.Model;
net_comcast_sms.FwdConfig.prototype.constructor=net_comcast_sms.FwdConfig;
net_comcast_sms.FwdConfig.prototype.EMAIL="email";
net_comcast_sms.FwdConfig.prototype.SMS="sms";
net_comcast_sms.FwdConfig.prototype.acceptedParams=[net_comcast_sms.FwdConfig.prototype.EMAIL];
net_comcast_sms.FwdConfig.prototype.FLAG_OFF="off";
net_comcast_sms.FwdConfig.prototype.FLAG_ON="on";
net_comcast_sms.FwdConfig.prototype.toString=function(){
return"net_comcast_sms.FwdConfig"
};
net_comcast_sms.FwdConfig.prototype.getUAdomain=function(){
return this.useraccount.getUAdomain()
};
net_comcast_sms.FwdConfig.prototype.getUATN=function(){
return this.useraccount.getUATN()
};
net_comcast_sms.FwdConfig.prototype.setConfigValue=function(e,t){
caboUtil.Coll.deref(this._current,e,t)
};
net_comcast_sms.FwdConfig.prototype.getConfigValue=function(e){
return caboUtil.Coll.deref(this._current,e)
};
net_comcast_sms.FwdConfig.prototype.load=function(a){
if(this.useraccount.isLoggedIn()){
this._loading=true;
var t=this.getUrl(this.getUAdomain(),"ua","config","fwdinfo",this.getUATN());
var e=new AjxCallback(this,this._handleLoad,[a]);
this.rest(t,e,null,true)
}else{
this.loginError("getConfig")
}};
net_comcast_sms.FwdConfig.prototype._handleLoad=function(s,o){
var a=this.parseStatus(o);
if(a===true){
var n=this._current={
email:{}
,sms:{}};
for(var e=0;
e<this.acceptedParams.length;
e++){
var t=this.acceptedParams[e];
n[t].enabled=o[t]&&(o[t].flag==this.FLAG_ON)||false;
n[t].addr=o[t]&&o[t].data
}
this._orig=caboUtil.Coll.deepcopy(n)
}
this._loading=false;
this._loaded=true;
caboUtil.run(s,a)
};
net_comcast_sms.FwdConfig.prototype.get=function(e){
this._loadListeners.push(e);
if(!this._loading&&!this._loaded){
this.load(new AjxCallback(this,this._handleGet))
}else{
if(this._loaded){
this._handleGet()
}}};
net_comcast_sms.FwdConfig.prototype._handleGet=function(){
caboUtil.run(this._loadListeners,this);
this._loadListeners.length=0
};
net_comcast_sms.FwdConfig.prototype.put=function(l){
if(this.useraccount.isLoggedIn()){
var c=[];
for(var a=0;
a<this.acceptedParams.length;
a++){
var n=this.acceptedParams[a];
var r=this._current[n];
var t=this._orig[n];
if(r&&t){
r.addr=AjxUtil.toArray(r.addr);
t.addr=AjxUtil.toArray(t.addr);
var h=(AjxUtil.isArray(r.addr)?r.addr[0]:r.addr)||"";
var e=this.getUrl(this.getUAdomain(),"ua","config","fwddetail",this.getUATN());
var o={
data:h,type:n};
c.push({
url:e,body:o}
);
var e=this.getUrl(this.getUAdomain(),"ua","config","fwd",this.getUATN());
var o={
flag:r.enabled,type:n};
c.push({
url:e,body:o}
)
}}
var s=function(u){
var d=(u<c.length-1)?new AjxCallback(this,s,[u+1]):l;
this.rest(c[u].url,d,c[u].body)
};
s.call(this,0)
}else{
this.loginError("putConfig")
}};
net_comcast_sms.FwdConfig.prototype._handlePut=function(a,t){
var e=this.parseStatus(t);
if(e===true){
this._orig=caboUtil.Coll.deepcopy(this._current)
}
caboUtil.run(a,e)
};
net_comcast_sms.MasterAccount=function(t){
net_comcast_sms.Model.call(this);
var e=["spcode","sppwd","mname","users"];
this._copyParams(t,this,e);
this._created=false;
this._activated=false;
this.enabled=false
};
net_comcast_sms.MasterAccount.prototype=new net_comcast_sms.Model;
net_comcast_sms.MasterAccount.prototype.constructor=net_comcast_sms.MasterAccount;
net_comcast_sms.MasterAccount.prototype.acceptedParams=["spcode","sppwd","mname","acctnum","hwmac","zipcode","users"];
net_comcast_sms.MasterAccount.prototype.toString=function(){
return"net_comcast_sms.MasterAccount"
};
net_comcast_sms.MasterAccount.prototype.toJSON=function(){
var t=this._copyParams(this,{}
);
for(var e=0;
e<t.users.length;
e++){
t.users[e]=t.users[e].toJSON()
}
return t
};
net_comcast_sms.MasterAccount.prototype.getUserAccounts=function(){
return this.users
};
net_comcast_sms.MasterAccount.prototype.getUAdomain=function(){
return this.ua_domain
};
net_comcast_sms.MasterAccount.prototype.setCreated=function(t){
this._created=!!t;
for(var e=0;
e<this.users.length;
e++){
this.users[e].setCreated(t)
}};
net_comcast_sms.MasterAccount.prototype.setHandler=function(e){
this._handler=e
};
net_comcast_sms.MasterAccount.prototype.getHandler=function(){
return this._handler
};
net_comcast_sms.MasterAccount.prototype.create=function(n){
if(!this._created&&!this._creating){
this._creating=true;
var o=["spcode","sppwd","mname","users"];
var t=this.getUrl(this.getBroadCloudDomain(),"ma","create");
var a=this._copyParams(this,{}
,o,this.acceptedParams);
var e=new AjxCallback(this,this._handleCreate,[n]);
this.rest(t,e,a)
}};
net_comcast_sms.MasterAccount.prototype._handleCreate=function(a,t){
this._creating=false;
var e=this.parseStatus(t);
if(e===true){
this.setCreated(true)
}
if(a instanceof AjxCallback){
a.run(e)
}};
net_comcast_sms.MasterAccount.prototype.activate=function(n){
if(!this._activated&&!this._activating){
this._activating=true;
var t=this.getUrl(this.getBroadCloudDomain(),"ma","activate");
var o=["spcode","sppwd","mname"];
var a=this._copyParams(this,{}
,o,o);
var e=new AjxCallback(this,this._handleActivate,[n]);
this.rest(t,e,a)
}};
net_comcast_sms.MasterAccount.prototype._handleActivate=function(a,t){
this._activating=false;
var e=this.parseStatus(t);
if(e===true){
this._activated=true
}
if(a instanceof AjxCallback){
a.run(e)
}};
net_comcast_sms.MasterAccount.prototype.enable=function(a,s){
if(!this._enabling){
this._enabling=true;
var t=this.getUrl(this.getBroadCloudDomain(),"ma",a?"enable":"disable");
var n=["spcode","sppwd","mname"];
var o=this._copyParams(this,{}
,n,n);
var e=new AjxCallback(this,this._handleEnable,[a,s]);
this.rest(t,e,o)
}};
net_comcast_sms.MasterAccount.prototype._handleEnable=function(e,o,a){
this._enabling=false;
var t=this.parseStatus(a);
if(t===true){
this.enabled=e
}
if(o instanceof AjxCallback){
o.run(t)
}};
net_comcast_sms.MasterAccount.prototype.remove=function(n){
if(!this._deleting){
this._deleting=true;
var t=this.getUrl(this.getBroadCloudDomain(),"ma","delete");
var o=["spcode","sppwd","mname"];
var a=this._copyParams(this,{}
,o,o);
var e=new AjxCallback(this,this._handleRemove,[n]);
this.rest(t,e,a)
}};
net_comcast_sms.MasterAccount.prototype._handleRemove=function(a,t){
this._deleting=false;
var e=this.parseStatus(t);
if(e===true){
this.setCreated(false)
}
if(a instanceof AjxCallback){
a.run(e)
}};
net_comcast_sms.MasterAccount.prototype.info=function(a){
var t=this.getUrl(this.getBroadCloudDomain(),"ma","info",this.spcode,this.sppwd,this.mname);
var e=new AjxCallback(this,this._handleInfo,[a]);
this.rest(t,e,null,true)
};
net_comcast_sms.MasterAccount.prototype._handleInfo=function(n,a){
var t=this.parseStatus(a);
if(t===true){
var o=["enabled","mname","acctnum","ua_domain","hw_mac"];
this._copyParams(a,this,null,o);
this.users=[];
for(var e=0;
e<a.users.length;
e++){
this.users.push(new net_comcast_sms.UserAccount(this,a.users[e]))
}
this.setCreated(true)
}
if(n instanceof AjxCallback){
n.run(t)
}};
net_comcast_sms.MasterAccount.get=function(e,s,o,t,n){
var a=new net_comcast_sms.MasterAccount({
spcode:e,sppwd:s,mname:o,users:[]}
);
a.setHandler(t);
a.info(new AjxCallback(net_comcast_sms.MasterAccount._handleGet,[n,a]));
return a
};
net_comcast_sms.MasterAccount._handleGet=function(a,t,e){
caboUtil.run(a,t)
};
net_comcast_sms.UserAccount=function(a,t){
net_comcast_sms.Model.call(this);
this.masteraccount=a;
var e=["name","parameters"];
this._copyParams(t,this,e);
this._created=false;
this._loggedIn=false;
this._messageStore=new net_comcast_sms.MessageStore(this)
};
net_comcast_sms.UserAccount.prototype=new net_comcast_sms.Model;
net_comcast_sms.UserAccount.prototype.constructor=net_comcast_sms.UserAccount;
net_comcast_sms.UserAccount.prototype.acceptedParams=["tn","name","email","displayname","parameters"];
net_comcast_sms.UserAccount.prototype.toString=function(){
return"net_comcast_sms.UserAccount"
};
net_comcast_sms.UserAccount.prototype.getClientId=function(){
return"12345678"
};
net_comcast_sms.UserAccount.prototype.toJSON=function(){
return this._copyParams(this,{}
)
};
net_comcast_sms.UserAccount.prototype.setCreated=function(e){
this._created=!!e
};
net_comcast_sms.UserAccount.prototype.setMasterAccount=function(e){
this.masteraccount=e
};
net_comcast_sms.UserAccount.prototype.getMasterAccount=function(){
return this.masteraccount
};
net_comcast_sms.UserAccount.prototype.getUAdomain=function(){
return this.masteraccount.getUAdomain()
};
net_comcast_sms.UserAccount.prototype.getUATN=function(){
return this.tn
};
net_comcast_sms.UserAccount.prototype.isLoggedIn=function(){
return this._loggedIn
};
net_comcast_sms.UserAccount.prototype.getMessageStore=function(){
return this._messageStore
};
net_comcast_sms.UserAccount.prototype.getHandler=function(){
return this.masteraccount.getHandler()
};
net_comcast_sms.UserAccount.prototype.getSessionId=function(){
return this.sessionid||null
};
net_comcast_sms.UserAccount.prototype.login=function(e,n,s){
if(!this._loggedIn){
var a=this.getUrl(this.getUAdomain(),"ua","login"),o={
uname:e,pwd:n,clientid:this.getClientId()}
,t=new AjxCallback(this,this._handleLogin,[n,s]);
this.rest(a,t,o)
}};
net_comcast_sms.UserAccount.prototype._handleLogin=function(a,n,t){
var e=this.parseStatus(t);
if(e===true){
this._loggedIn=true;
var o=["enabled","serverid","sessionid","apiversion","expiry","pushurl","parameters"];
this._copyParams(t,this,null,o);
this._pwd=a
}else{
this._pwd=null;
this._loggedIn=false
}
if(n instanceof AjxCallback){
n.run(e)
}};
net_comcast_sms.UserAccount.prototype.logout=function(a){
if(this._loggedIn){
var t="https://"+[this.getUAdomain(),"ua","logout"].join("/"),e=new AjxCallback(this,this._handleLogout,[a]);
this.rest(t,e)
}};
net_comcast_sms.UserAccount.prototype._handleLogout=function(a,t){
var e=this.parseStatus(t);
if(e===true){
this._loggedIn=false
}
if(a instanceof AjxCallback){
a.run(e)
}};
net_comcast_sms.UserAccount.prototype.setupPush=function(o,a,s){
if(this._loggedIn){
var t=this.getUrl(this.getUAdomain(),"ua","push",a?"enable":"disable",this.tn),n={
deviceid:o}
,e=new AjxCallback(this,this._handleSetupPush,[s]);
this.rest(t,e,n)
}else{
this.loginError("setupPush")
}};
net_comcast_sms.UserAccount.prototype._handleSetupPush=function(a,t){
var e=this.parseStatus(t);
if(a instanceof AjxCallback){
a.run(e)
}};
net_comcast_sms.UserAccount.prototype.setPassword=function(a,n){
if(this._loggedIn&&this._pwd){
var t=this.getUrl(this.getUAdomain(),"ua","config","pwd",this.tn);
var o={
curpwd:this._pwd,newpwd:a};
var e=new AjxCallback(this,this._handleSetPassword,[n]);
this.rest(t,e,o)
}else{
this.loginError("setPassword")
}};
net_comcast_sms.UserAccount.prototype._handleSetPassword=function(a,t){
var e=this.parseStatus(t);
if(a instanceof AjxCallback){
a.run(e)
}};
net_comcast_sms.Message=function(t,e,a){
if(!arguments.length){
return
}
net_comcast_sms.Model.call(this);
this.useraccount=t;
this.thread=e;
this._copyParams(a,this,this.requiredParams);
this.body=net_comcast_sms.Util.unescape(this.body);
this.body=AjxStringUtil.htmlEncode(this.body);
if(this.thread&&this.time&&this.dir&&this.dir==net_comcast_sms.Message.DIR_INCOMING){
this.thread.getMessageStore().setLastUpdateTime(this.time)
}};
net_comcast_sms.Message.prototype=new net_comcast_sms.Model;
net_comcast_sms.Message.prototype.constructor=net_comcast_sms.Message;
net_comcast_sms.Message.prototype.requiredParams=["mid","status","type","body","tn"];
net_comcast_sms.Message.prototype.acceptedParams=["mid","status","type","time","stime","name","stype","body","dir","tn","long","lat","murl"];
net_comcast_sms.Message.prototype.toString=function(){
return"net_comcast_sms.Message"
};
net_comcast_sms.Message.STATUS={
N:1,U:2,R:3,L:4,D:5};
net_comcast_sms.Message.STATUSINDEX={
N:3,U:3,R:2,L:2,D:1};
net_comcast_sms.Message.TYPE_SMS="sms";
net_comcast_sms.Message.TYPE_GROUP="group";
net_comcast_sms.Message.TYPE_VMAIL="vmail";
net_comcast_sms.Message.DIR_INCOMING="I";
net_comcast_sms.Message.DIR_OUTGOING="O";
net_comcast_sms.Message.STATUS_NEW="N";
net_comcast_sms.Message.STATUS_UNREAD="U";
net_comcast_sms.Message.STATUS_READ="R";
net_comcast_sms.Message.STATUS_LOCKED="L";
net_comcast_sms.Message.STATUS_DELETED="D";
net_comcast_sms.Message.acceptedType=function(e){
return e&&(e==net_comcast_sms.Message.TYPE_SMS||e=="group"||e=="vmail")
};
net_comcast_sms.Message.acceptedStatus=function(e){
return e&&!!net_comcast_sms.Message.STATUS[e]
};
net_comcast_sms.Message.prototype.getUAdomain=function(){
return this.useraccount.getUAdomain()
};
net_comcast_sms.Message.prototype.getUATN=function(){
return this.useraccount.getUATN()
};
net_comcast_sms.Message.prototype.isLoggedIn=function(){
return this.useraccount.isLoggedIn()
};
net_comcast_sms.Message.prototype.getHandler=function(){
return this.useraccount.getHandler()
};
net_comcast_sms.Message.prototype.getSessionId=function(){
return this.useraccount.getSessionId()
};
net_comcast_sms.Message.prototype.getUSTN=function(){
return net_comcast_sms.Util.TN.normalize(this.tn)
};
net_comcast_sms.Message.prototype.getID=function(){
return this.mid
};
net_comcast_sms.Message.prototype.setStatus=function(e,s,o){
if(net_comcast_sms.Message.acceptedStatus(e)){
if(!o){
if(e==net_comcast_sms.Message.STATUS_DELETED){
return this.remove(s)
}
if(this.isLoggedIn()){
var a=this.getUrl(this.getUAdomain(),"ua","msg",this.type,"status",this.mid,this.getUATN()),n={
status:e}
,t=new AjxCallback(this,this._handleSetStatus,[e,s]);
this.rest(a,t,n,false)
}else{
this.loginError("setStatus")
}}}else{}};
net_comcast_sms.Message.prototype.setEditStatus=function(e){
this.editstatus=e;
this.thread.onChangeMessageEditStatus(this);
this.callListeners("editstatus")
};
net_comcast_sms.Message.prototype.getEditStatus=function(){
return this.editstatus
};
net_comcast_sms.Message.prototype.getContact=function(e){
if(this._contact){
caboUtil.run(e,this._contact);
return this._contact
}
net_comcast_sms.Util.Contact.getByTN(this.tn,new AjxCallback(this,this._handleGetContact,[e]))
};
net_comcast_sms.Message.prototype._handleGetContact=function(t,e){
this._contact=e;
caboUtil.run(t,e)
};
net_comcast_sms.Message.prototype.setForwardStatus=function(e){
this.forwardstatus=!!e;
this.thread.onChangeMessageForwardStatus(this);
this.callListeners("forwardstatus")
};
net_comcast_sms.Message.prototype.canDelete=function(){
var e=this.status;
return(e==net_comcast_sms.Message.STATUS_NEW||e==net_comcast_sms.Message.STATUS_UNREAD||e==net_comcast_sms.Message.STATUS_READ)
};
net_comcast_sms.Message.prototype._handleSetStatus=function(e,o,a){
var t=this.parseStatus(a);
if(t===true){
this.localSetStatus(e)
}else{
this._clearEditStatus();
if(t instanceof net_comcast_sms.RestError){}}
caboUtil.run(o,t)
};
net_comcast_sms.Message.prototype.localSetStatus=function(t){
var e=this.status;
this.status=t;
this._clearEditStatus();
this.thread.onChangeMessageStatus(this,e,t);
this.thread.store.onChangeMessageStatus(this,e,t);
this.callListeners("status")
};
net_comcast_sms.Message.prototype._clearEditStatus=function(){
if(this.editstatus){
this.editstatus=null;
this.callListeners("editstatus")
}};
net_comcast_sms.Message.prototype.setRead=function(e){
if(this.status==net_comcast_sms.Message.STATUS_NEW||this.status==net_comcast_sms.Message.STATUS_UNREAD){
this.setStatus(net_comcast_sms.Message.STATUS_READ,e)
}else{
caboUtil.run(e)
}};
net_comcast_sms.Message.prototype.setUnread=function(e){
if(this.status==net_comcast_sms.Message.STATUS_READ){
this.setStatus(net_comcast_sms.Message.STATUS_UNREAD,e)
}else{
caboUtil.run(e)
}};
net_comcast_sms.Message.prototype.getStatusIndex=function(){
return this.status&&net_comcast_sms.Message.STATUSINDEX[this.status]
};
net_comcast_sms.Message.prototype.getAnnotation=function(){
return[net_comcast_sms.Util.Date.computeDateStr(new Date(this.time)).replace(/\n/g," ")].join("")
};
net_comcast_sms.Message.prototype.getBody=function(){
return this.body
};
net_comcast_sms.Message.prototype.remove=function(o){
if(this.isLoggedIn()){
var t=this.getUrl(this.getUAdomain(),"ua","msg",this.type,"delete",this.getUATN()),a={
mids:[this.mid]}
,e=new AjxCallback(this,this._handleSetStatus,["D",o]);
this.rest(t,e,a,false)
}else{
this.loginError("remove")
}};
net_comcast_sms.Message.dateComparator=function(t,e){
return net_comcast_sms.Util.plainComparator(t&&t.time,e&&e.time)
};
net_comcast_sms.Message.statusComparator=function(t,e){
return net_comcast_sms.Util.plainComparator(t&&t.getStatusIndex(),e&&e.getStatusIndex())
};
net_comcast_sms.MessageStore=function(e){
net_comcast_sms.Model.call(this);
this.useraccount=e;
this.messages_byId={};
this.messages_byType={};
this.messages_byType[net_comcast_sms.Message.TYPE_SMS]={};
this.messages_byType[net_comcast_sms.Message.TYPE_GROUP]={};
this.messages_byType[net_comcast_sms.Message.TYPE_VMAIL]={};
this.messages_byStatus={
N:{}
,U:{}
,R:{}
,L:{}
,D:{}};
this.messages_byDir={
I:{}
,O:{}};
this.threads={};
this._hasMoreThreads=false;
window.messagestore=this
};
net_comcast_sms.MessageStore.prototype=new net_comcast_sms.Model;
net_comcast_sms.MessageStore.prototype.constructor=net_comcast_sms.MessageStore;
net_comcast_sms.MessageStore.prototype.toString=function(){
return"net_comcast_sms.MessageStore"
};
net_comcast_sms.MessageStore.prototype.getUAdomain=function(){
return this.useraccount.getUAdomain()
};
net_comcast_sms.MessageStore.prototype.getUATN=function(){
return this.useraccount.getUATN()
};
net_comcast_sms.MessageStore.prototype.isLoggedIn=function(){
return this.useraccount.isLoggedIn()
};
net_comcast_sms.MessageStore.prototype.getHandler=function(){
return this.useraccount.getHandler()
};
net_comcast_sms.MessageStore.prototype.getSessionId=function(){
return this.useraccount.getSessionId()
};
net_comcast_sms.MessageStore.prototype.getById=function(e){
if(AjxUtil.isArray(e)){
var a=[];
for(var t=0;
t<e.length;
t++){
a[t]=this.getById(e[t])
}
return a
}
return this.messages_byId[e]
};
net_comcast_sms.MessageStore.prototype.getByType=function(a){
if(AjxUtil.isArray(a)){
var t=[];
for(var e=0;
e<a.length;
e++){
t[e]=this.getByType(a[e])
}
return t
}
return this.messages_byType[a]
};
net_comcast_sms.MessageStore.prototype.getByStatus=function(e){
if(AjxUtil.isArray(e)){
var a=[];
for(var t=0;
t<e.length;
t++){
a[t]=this.getByStatus(e[t])
}
return a
}
return this.messages_byStatus[e]
};
net_comcast_sms.MessageStore.prototype.getByDir=function(e){
if(AjxUtil.isArray(e)){
var a=[];
for(var t=0;
t<e.length;
t++){
a[t]=this.getByDir(e[t])
}
return a
}
return this.messages_byDir[e]
};
net_comcast_sms.MessageStore.prototype.putCache=function(a){
var e=a.mid;
this.messages_byId[e]=a;
if(this.messages_byType[a.type]){
this.messages_byType[a.type][e]=a
}
if(this.messages_byStatus[a.status]){
var t=(this.messages_byStatus[a.status][e]!=a);
this.messages_byStatus[a.status][e]=a;
if(t){
this.callListeners("status")
}}
if(this.messages_byDir[a.dir]){
this.messages_byDir[a.dir][e]=a
}};
net_comcast_sms.MessageStore.prototype.delCache=function(o){
if(AjxUtil.isArray(o)){
for(var t=0;
t<o.length;
t++){
this.delCache(o[t])
}}
if(o instanceof net_comcast_sms.Message){
var e=o.mid;
delete this.messages_byId[e];
if(this.messages_byType[o.type]){
delete this.messages_byType[o.type][e]
}
if(this.messages_byStatus[o.status]){
var a=(this.messages_byStatus[o.status][e]==o);
delete this.messages_byStatus[o.status][e];
if(a){
this.callListeners("status")
}}
if(this.messages_byDir[o.dir]){
delete this.messages_byDir[o.dir][e]
}}};
net_comcast_sms.MessageStore.sortByType=function(n){
var a={};
for(var t=0,e=n.length;
t<e;
t++){
var o=n[t];
if(o){
if(!a[o.type]){
a[o.type]=[]
}
a[o.type].push(o)
}}
return a
};
net_comcast_sms.MessageStore.getMid=function(a){
if(AjxUtil.isArray(a)){
var o=[];
for(var t=0,e=a.length;
t<e;
t++){
o[t]=a[t].mid
}
return o
}
return a&&a.mid
};
net_comcast_sms.MessageStore.prototype.onChangeMessageStatus=function(o,e,t){
var a=o.mid;
if(o==this.messages_byStatus[e][a]){
delete this.messages_byStatus[e][a];
this.messages_byStatus[t][a]=o;
this.callListeners("status")
}};
net_comcast_sms.MessageStore.prototype.refreshThreadHeaders=function(t){
var e=20;
this.loadThreadHeaders(t,e,null,e)
};
net_comcast_sms.MessageStore.prototype.moreThreadHeaders=function(t,e){
e=e||this.getNextLoadSize();
this.loadThreadHeaders(t,e,this.getOldestThread().getNewest().time,this.getThreadCount()+e)
};
net_comcast_sms.MessageStore.prototype.loadThreadHeaders=function(s,n,e,o){
if(this.isLoggedIn()){
var a=this.getUrl(this.getUAdomain(),"ua","msg","sms","thread","headers",n||null,e||(n?0:null),this.getUATN()),t=new AjxCallback(this,this._handleLoadThreadHeaders,[s,o]);
this.rest(a,t,null,true)
}else{
this.loginError("loadThreadHeaders")
}};
net_comcast_sms.MessageStore.prototype._handleLoadThreadHeaders=function(s,e,n){
var a=this.parseStatus(n);
if(a===true||a.code=="0030006"){
var o;
if(n.messages){
o=n.messages.length;
for(var t=0;
t<n.messages.length;
t++){
this._createMessage(n.messages[t])
}}else{
o=this.getThreadCount()
}
if(e){
if(o<e){
this._hasMoreThreads=false
}else{
this._hasMoreThreads=true
}}
a=true
}else{
this._hasMoreThreads=false
}
caboUtil.run(s,a);
this.callListeners("threads");
this.callListeners("status")
};
net_comcast_sms.MessageStore.prototype.getNextLoadSize=function(){
var e=this.getThreadCount();
return(e<=40)?20:Math.ceil(e*0.5)
};
net_comcast_sms.MessageStore.prototype._createMessage=function(t){
var a=new net_comcast_sms.Message(this.useraccount,null,t),e=this.threads[a.tn]||this.threads["001"+a.tn];
if(e){
e.update(a,true)
}else{
this.threads[a.tn]=new net_comcast_sms.Thread(this.useraccount,this,a);
this.callListeners("threads")
}
this.putCache(a);
return a
};
net_comcast_sms.MessageStore.prototype.getThread=function(e){
if(e instanceof net_comcast_sms.Message){
if(!(this.threads[e.tn]||this.threads["001"+e])){
this.threads[e.tn]=new net_comcast_sms.Thread(this.useraccount,this,e);
this.callListeners("threads")
}
return this.threads[e.tn]
}else{
if(AjxUtil.isNumber(e)||AjxUtil.isString(e)){
return this.threads[e]||this.threads["001"+e]
}}};
net_comcast_sms.MessageStore.prototype.getThreads=function(){
return this.threads
};
net_comcast_sms.MessageStore.prototype.getNonDeletedThreads=function(a){
var t=[];
a=a||this.threads;
if(AjxUtil.isArray(a)){}else{
if(a instanceof AjxVector){
a=a.getArray()
}else{
if(AjxUtil.isObject(a)){
a=AjxUtil.values(a)
}else{
return t
}}}
for(var e=0;
e<a.length;
e++){
if(a[e].getNonDeletedCount()>0){
t.push(a[e])
}}
return t
};
net_comcast_sms.MessageStore.prototype.getThreadCount=function(){
return AjxUtil.keys(this.threads).length
};
net_comcast_sms.MessageStore.prototype.getOldestThread=function(){
var a,n;
for(var t in this.threads){
var e=this.threads[t],o=e.getNewest();
if(o){
var s=o.time;
if(!n||s<n){
a=e;
n=s
}}}
return a
};
net_comcast_sms.MessageStore.prototype.getNewestThread=function(){
var a,o;
for(var t in this.threads){
var e=this.threads[t],n=e.getNewest();
if(n){
var s=n.time;
if(!o||s>o){
a=e;
o=s
}}}
return a
};
net_comcast_sms.MessageStore.prototype.hasMoreThreads=function(){
return this._hasMoreThreads
};
net_comcast_sms.MessageStore.prototype.getMessage=function(a,o,s){
var n=this.getById(a);
if(n){
caboUtil.run(s,n)
}else{
if(this.isLoggedIn()){
var t=this.getUrl(this.getUAdomain(),"ua","msg",o,a,this.getUATN()),e=new AjxCallback(this,this._handleGetMessage,[a,s]);
this.rest(t,e,null,true)
}else{
this.loginError("getMessage")
}}};
net_comcast_sms.MessageStore.prototype._handleGetMessage=function(e,o,a){
var t=this.parseStatus(a);
if(t===true){
t=new net_comcast_sms.Message(this.useraccount,null,a.messages[0]);
t.thread=this.getThread(t);
this.putCache(t)
}
caboUtil.run(o,t)
};
net_comcast_sms.MessageStore.prototype.getMessageCounts=function(a){
if(this.isLoggedIn()){
var t=this.getUrl(this.getUAdomain(),"ua","msg","sms","msgcounts",this.getUATN()),e=new AjxCallback(this,this._handleGetMessageCounts,[a]);
this.rest(t,e,null,true)
}else{
this.loginError("getMessageCounts")
}};
net_comcast_sms.MessageStore.prototype._handleGetMessageCounts=function(o,t){
var e=this.parseStatus(t);
if(e===true){
var a=["smsnew","smsunread","smstotal","smsmax","smsquota","smsquotamax","family","group","vmail"];
e=this._copyParams(t,{}
,null,a)
}
caboUtil.run(o,e)
};
net_comcast_sms.MessageStore.prototype.getMessagesSince=function(a,o){
if(this.isLoggedIn()){
var t=this.getUrl(this.getUAdomain(),"ua","msg","sms","all","statuschange",a,this.getUATN()),e=new AjxCallback(this,this._handleGetMessagesSince,[o]);
this.rest(t,e,null,true)
}else{
this.loginError("getMessageCounts")
}};
net_comcast_sms.MessageStore.prototype._handleGetMessagesSince=function(n,a){
var t=this.parseStatus(a);
if(t===true){
for(var e=0;
e<a.messages.length;
e++){
var o=new net_comcast_sms.Message(this.useraccount,null,a.messages[e]);
this.getThread(o).update(o,true);
this.putCache(o)
}}
caboUtil.run(n,t)
};
net_comcast_sms.MessageStore.prototype.setLastUpdateTime=function(e){
if(!this._lastUpdateTime||this._lastUpdateTime<e){
this._lastUpdateTime=e
}};
net_comcast_sms.MessageStore.prototype.getLastUpdateTime=function(){
return this._lastUpdateTime
};
net_comcast_sms.MessageStore.prototype.remove=function(o,h){
if(this.isLoggedIn()){
var c=net_comcast_sms.Message.TYPE_SMS,t=net_comcast_sms.Message.TYPE_GROUP,r=net_comcast_sms.Message.TYPE_VMAIL,e=this.getById(o),n=net_comcast_sms.MessageStore.sortByType(e),a={}
,l=new AjxCallback(this,this._handleRemove,[o,h]);
a[c]=!!n[c];
a[t]=!!n[t];
a[r]=!!n[r];
if(a[c]){
this.removeByType(c,net_comcast_sms.MessageStore.getMid(n[c]),new AjxCallback(this,this._handleRemoveOne,[c,a,n[c],l]))
}
if(a[t]){
this.removeByType(t,net_comcast_sms.MessageStore.getMid(n[t]),new AjxCallback(this,this._handleRemoveOne,[t,a,n[t],l]))
}
if(a[r]){
this.removeByType(r,net_comcast_sms.MessageStore.getMid(n[r]),new AjxCallback(this,this._handleRemoveOne,[r,a,n[r],l]))
}}else{
this.loginError("remove")
}};
net_comcast_sms.MessageStore.prototype._handleRemoveOne=function(a,t,o,r,n){
t[a]=false;
var s=true;
for(var e in t){
if(t[e]){
s=false;
break
}}
if(s){
caboUtil.run(r,true)
}};
net_comcast_sms.MessageStore.prototype._handleRemove=function(t,a,e){
caboUtil.run(a,e)
};
net_comcast_sms.MessageStore.prototype.removeByType=function(o,r,h){
if(this.isLoggedIn()){
var n=this._copyParams(this.getByType(o),{}
,null,r),t=AjxUtil.map(AjxUtil.values(n),function(l){
return l.mid
}
);
if(t.length){
var a=this.getUrl(this.getUAdomain(),"ua","msg",o,"delete",this.getUATN()),s={
mids:t}
,e=new AjxCallback(this,this._handleRemoveByType,[n,h]);
this.rest(a,e,s)
}else{
if(h instanceof AjxCallback){
caboUtil.run(h,true)
}}}else{
this.loginError("remove")
}};
net_comcast_sms.MessageStore.prototype._handleRemoveByType=function(a,n,o){
var t=this.parseStatus(o);
if(t===true||t.code=="0030003"){
for(var e in a){
a[e].localSetStatus("D")
}}
caboUtil.run(n,t)
};
net_comcast_sms.MessageStore.prototype.sendMessage=function(t,e,s){
if(this.isLoggedIn()){
t=AjxUtil.toArray(t);
if(t&&t.length){
t=AjxUtil.map(t,function(r){
return net_comcast_sms.Util.TN.normalize(r,true)
}
);
t=AjxUtil.uniq(t);
var o=this.getUrl(this.getUAdomain(),"ua","msg","sms","send",this.getUATN()),n={
desttnarray:t,body:e}
,a=new AjxCallback(this,this._handleSendMessage,[n,s]);
this.rest(o,a,n)
}else{
caboUtil.run(s,false)
}}else{
this.loginError("sendMessage")
}};
net_comcast_sms.MessageStore.prototype._handleSendMessage=function(t,l,s){
var e=this.parseStatus(s);
if(e===true){
var n=[];
for(var r=0,a=s.message.length;
r<a;
r++){
var o=s.message[r];
o.body=t.body;
var c=this._createMessage(o);
n.push(c)
}
e=n
}
var h=this.useraccount.getHandler().getController();
h._handleTestQuota(true,true,null,s);
caboUtil.run(l,e)
};
net_comcast_sms.MessageStore.prototype.handleNotification=function(e){
if(e&&e.id=="comcast_SMS"){
var t=e.sms.id;
this.getMessage(t,"sms",function(a){
if(a instanceof net_comcast_sms.Message){
a.thread.update(a,true)
}}
)
}};
net_comcast_sms.Thread=function(t,e,a){
if(!arguments.length){
return
}
net_comcast_sms.Model.call(this);
this.useraccount=t;
this.store=e;
this._byIndex=new AjxVector();
this._byId={};
this._resetStatusCount();
this._hasMore=true;
this._nonloadedNewMsgs=0;
if(a&&!this.addSingle(a)){
throw net_comcast_sms.ModelError.incorrectParameter("headerMsg","net_comcast_sms.Message or raw hash",this.toString())
}};
net_comcast_sms.Thread.prototype=new net_comcast_sms.Model;
net_comcast_sms.Thread.prototype.constructor=net_comcast_sms.Thread;
net_comcast_sms.Thread.prototype.toString=function(){
return"net_comcast_sms.Thread"
};
net_comcast_sms.Thread.DEFAULT_COUNT=20;
net_comcast_sms.Thread.prototype.getUAdomain=function(){
return this.useraccount.getUAdomain()
};
net_comcast_sms.Thread.prototype.getUATN=function(){
return this.useraccount.getUATN()
};
net_comcast_sms.Thread.prototype.isLoggedIn=function(){
return this.useraccount.isLoggedIn()
};
net_comcast_sms.Thread.prototype.getMessageStore=function(){
return this.useraccount.getMessageStore()
};
net_comcast_sms.Thread.prototype.getHandler=function(){
return this.useraccount.getHandler()
};
net_comcast_sms.Thread.prototype.getSessionId=function(){
return this.useraccount.getSessionId()
};
net_comcast_sms.Thread.prototype.getContact=function(e){
if(!this._contact){
this._contact=new net_comcast_sms.Contact(this.getTN())
}
this._contact.getDetails(e);
return this._contact
};
net_comcast_sms.Thread.prototype.refresh=function(a){
var e=net_comcast_sms.Thread.DEFAULT_COUNT;
var t=caboUtil.LoadHandler.get(this);
t.run(a,new AjxCallback(this,function(o){
this._load(new AjxCallback(this,function(n){
this.setNonloadedNewMsgs(0);
caboUtil.run(o,n)
}
),e,null,true,e)
}
))
};
net_comcast_sms.Thread.prototype.more=function(t,e){
e=e||this.getNextLoadSize();
this._load(t,e,this.getOldest().time,true,this.size()+e)
};
net_comcast_sms.Thread.prototype._load=function(r,o,s,n,a){
if(this.isLoggedIn()){
this._loading=true;
o=o||net_comcast_sms.Thread.DEFAULT_COUNT;
s=s||(net_comcast_sms.Model.USE_STATIC_DATA?0:new Date().getTime());
var t=this.getUrl(this.getUAdomain(),"ua","msg","sms","thread",this.getUSTN(),o,s,this.getUATN()),e=new AjxCallback(this,this._handleLoad,[r,n,a]);
this.rest(t,e,null,true)
}else{
this.loginError("_load")
}};
net_comcast_sms.Thread.prototype._handleLoad=function(n,a,e,o){
var t=this.parseStatus(o);
if(t===true||t.code=="0030006"){
if(o.messages){
this.update(o.messages,a)
}
t=this;
this._loaded=true;
this._loading=false;
if(e&&(this.size()<e)){
this._hasMore=false
}}
caboUtil.run(n,t)
};
net_comcast_sms.Thread.prototype.hasMore=function(){
return this._hasMore
};
net_comcast_sms.Thread.prototype.update=function(h,t){
var r=false,s=AjxUtil.toArray(this._getMessage(h));
for(var l=0,o=s.length;
l<o;
l++){
r=this.addSingle(s[l],true)||r
}
if(!t){
var e=[];
for(var l=0,o=this.size();
l<o;
l++){
var u=false,a=this.getByIndex(l),d=a.mid;
for(var n=0,c=s.length;
n<c;
n++){
if(s[n].mid==d){
u=true;
break
}}
if(!u){
e.push(a)
}}
for(var l=0,o=e.length;
l<o;
l++){
r=this.removeSingle(e[l],true)||r
}}
if(r){
if(this.size()>1){
this._byIndex.sort(net_comcast_sms.Message.dateComparator)
}
this.onChangeMessageCount()
}
return r
};
net_comcast_sms.Thread.prototype._getMessage=function(a){
if(AjxUtil.isArray(a)){
var t=[];
for(var e=0;
e<a.length;
e++){
var o=this._getMessage(a[e]);
if(o instanceof net_comcast_sms.Message){
t.push(o)
}}
return t
}else{
if(a instanceof net_comcast_sms.Message){
a.thread=this;
return a
}else{
if(AjxUtil.isObject(a)&&net_comcast_sms.Message.acceptedType(a.type)){
return new net_comcast_sms.Message(this.useraccount,this,a)
}}}};
net_comcast_sms.Thread.prototype.addSingle=function(t,e){
var a=this._getMessage(t);
if(a&&!this.getById(a.mid)){
if(net_comcast_sms.Message.acceptedStatus(a.status)){
this._statusCount[a.status]++
}
this._byIndex.add(a);
this._byId[a.mid]=a;
this.store.putCache(a);
if(!e){
this.callListeners("messages",a)
}
return true
}else{
return false
}};
net_comcast_sms.Thread.prototype.removeSingle=function(t,e){
if(t instanceof net_comcast_sms.Message){
this._byIndex.remove(t);
delete this._byId[t.mid];
this.store.delCache(t);
if(!e){
this.callListeners("messages",t)
}
return true
}};
net_comcast_sms.Thread.prototype.deleteThread=function(n){
if(this.isLoggedIn()){
var e=net_comcast_sms.Util.TN.normalize(this.getTN());
var a=this.getUrl(this.getUAdomain(),"ua","msg","sms","thread","delete",e,this.getUATN());
var o={
tn:e};
var t=new AjxCallback(this,this._handleDeleteThread,[n]);
this.rest(a,t,o,false)
}else{
this.loginError("setStatus")
}};
net_comcast_sms.Thread.prototype._handleDeleteThread=function(s,e){
var o=this.parseStatus(e);
if(o===true){
for(var a=0,t=this.size();
a<t;
a++){
var n=this.getByIndex(a);
if(n.status!=net_comcast_sms.Message.STATUS_LOCKED){
n.localSetStatus(net_comcast_sms.Message.STATUS_DELETED)
}}}
caboUtil.run(s)
};
net_comcast_sms.Thread.prototype.getTN=function(){
var e=this.getNewest();
return e&&e.tn
};
net_comcast_sms.Thread.prototype.getUSTN=function(){
var e=this.getTN();
return e&&net_comcast_sms.Util.TN.normalize(e)
};
net_comcast_sms.Thread.prototype.getById=function(e){
return this._byId[e]||null
};
net_comcast_sms.Thread.prototype.getNewest=function(){
return this._byIndex.getLast()
};
net_comcast_sms.Thread.prototype.getNewestNonDeleted=function(){
for(var e=this._byIndex.size()-1;
e>-1;
e--){
var t=this._byIndex.get(e);
if(t.status!=net_comcast_sms.Message.STATUS_DELETED){
return t
}}
return null
};
net_comcast_sms.Thread.prototype.getOldest=function(){
return this._byIndex.get(0)||null
};
net_comcast_sms.Thread.prototype.getMessages=function(){
return this._byIndex
};
net_comcast_sms.Thread.prototype.getByIndex=function(e,t){
if(!t){
return this._byIndex.get(e)
}else{
if(t>0){
return this._byIndex.slice(e,t)
}else{
return this._byIndex.slice(e)
}}};
net_comcast_sms.Thread.prototype.size=function(){
return this._byIndex.size()
};
net_comcast_sms.Thread.prototype.getNextLoadSize=function(){
var e=this.size();
return(e<=40)?20:Math.ceil(e*0.5)
};
net_comcast_sms.Thread.prototype.isLoaded=function(){
return !!this._loaded
};
net_comcast_sms.Thread.prototype.isLoading=function(){
return !!this._loading
};
net_comcast_sms.Thread.prototype.setNonloadedNewMsgs=function(e){
this._nonloadedNewMsgs=e;
this.callListeners("newmessages")
};
net_comcast_sms.Thread.prototype.getNonloadedNewMsgs=function(){
return this._nonloadedNewMsgs
};
net_comcast_sms.Thread.prototype.getStatusCount=function(e){
if(this._statusCount[e]!==null){
return this._statusCount[e]
}
this._statusCount={
N:0,U:0,R:0,L:0,D:0};
for(var a=0,t=this.size();
a<t;
a++){
var o=this.getByIndex(a).status;
if(net_comcast_sms.Message.acceptedStatus(o)){
this._statusCount[o]++
}}
return this._statusCount[e]
};
net_comcast_sms.Thread.prototype._resetStatusCount=function(){
this._statusCount={
N:null,U:null,R:null,L:null,D:null}
};
net_comcast_sms.Thread.prototype.onChangeMessageStatus=function(o,e,a){
if(this.getById(o.mid)===o&&e!=a){
var t=AjxUtil.hashCopy(this._statusCount);
if(this._statusCount[e]){
this._statusCount[e]--
}
if(this._statusCount[a]!==null){
this._statusCount[a]++
}
this.callListeners("status")
}};
net_comcast_sms.Thread.prototype.onChangeMessageCount=function(){
var e=AjxUtil.hashCopy(this._statusCount);
this._resetStatusCount();
this.getStatusCount("N");
if(!AjxUtil.hashCompare(e,this._statusCount)){
this.callListeners("status")
}
this.callListeners("messages")
};
net_comcast_sms.Thread.prototype.onChangeMessageEditStatus=function(e){
this.callListeners("editstatus")
};
net_comcast_sms.Thread.prototype.onChangeMessageForwardStatus=function(e){
this.callListeners("forwardstatus")
};
net_comcast_sms.Thread.prototype.getNewMessageCount=function(){
return this.getStatusCount(net_comcast_sms.Message.STATUS_NEW)
};
net_comcast_sms.Thread.prototype.getUnreadMessageCount=function(){
return this.getStatusCount(net_comcast_sms.Message.STATUS_UNREAD)+this.getNewMessageCount()
};
net_comcast_sms.Thread.prototype.getDeletedCount=function(){
return this.getStatusCount(net_comcast_sms.Message.STATUS_DELETED)
};
net_comcast_sms.Thread.prototype.getNonDeletedCount=function(){
return this.size()-this.getDeletedCount()
};
net_comcast_sms.Thread.prototype.getID=function(){
return this.getTN()
};
net_comcast_sms.Thread.prototype.setStatus=function(e,n){
if(this.isLoggedIn()){
var a=this.getUrl(this.getUAdomain(),"ua","msg","sms","thread","status",this.getUATN());
var o={
tn:this.getTN(),status:e};
var t=new AjxCallback(this,this._handleSetStatus,[e,n]);
this.rest(a,t,o,true)
}else{
this.loginError("setStatus")
}};
net_comcast_sms.Thread.prototype._handleSetStatus=function(e,r,n){
var o=this.parseStatus(n);
if(o===true){
for(var a=0,t=this.size();
a<t;
a++){
var s=this.getByIndex(a);
this.onChangeMessageStatus(s,s.status,e);
s.status=e
}}
caboUtil.run(r,o)
};
net_comcast_sms.Thread.dateComparator=function(t,e){
return net_comcast_sms.Message.dateComparator(t.getNewestNonDeleted(),e.getNewestNonDeleted())
};
net_comcast_sms.Thread.unreadComparator=function(t,e){
return net_comcast_sms.Util.plainComparator(t.getUnreadMessageCount()+t.getNewMessageCount(),e.getUnreadMessageCount()+e.getNewMessageCount())
};
net_comcast_sms.Thread.statusComparator=function(t,e){
var n=t.getNewestNonDeleted();
var o=e.getNewestNonDeleted();
if(!n||!o){
return -1
}
return net_comcast_sms.Util.plainComparator(n.getStatusIndex(),o.getStatusIndex())||net_comcast_sms.Thread.unreadComparator(t,e)||net_comcast_sms.Thread.dateComparator(t,e)
};
AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(this,function(){
net_comcast_sms.Autocomplete=function(e){
if(!arguments.length){
return
}
this._aa=Dwt.getNextId();
ZmAutocomplete.call(this,e);
this.enabled=e.enabled||{
name:true,phone:true,email:false};
this._searchFields=[].concat(this.enabled.name?net_comcast_sms.Autocomplete.NAME_FIELDS:[],this.enabled.phone?net_comcast_sms.Autocomplete.PHONE_FIELDS:[],this.enabled.email?net_comcast_sms.Autocomplete.EMAIL_FIELDS:[]);
this._outTextFunc=e.outTextFunc
};
net_comcast_sms.Autocomplete.prototype=new ZmAutocomplete;
net_comcast_sms.Autocomplete.prototype.constructor=net_comcast_sms.Autocomplete;
net_comcast_sms.Autocomplete.prototype.toString=function(){
return"net_comcast_sms.Autocomplete"
};
net_comcast_sms.Autocomplete.PHONE_FIELDS=[ZmContact.F_mobilePhone].concat(AjxUtil.complement([ZmContact.F_mobilePhone],ZmContact.PHONE_FIELDS));
net_comcast_sms.Autocomplete.EMAIL_FIELDS=ZmContact.EMAIL_FIELDS;
net_comcast_sms.Autocomplete.NAME_FIELDS=[ZmContact.F_firstName,ZmContact.F_middleName,ZmContact.F_lastName];
net_comcast_sms.Autocomplete.DATA_FIELDS=net_comcast_sms.Autocomplete.PHONE_FIELDS;
net_comcast_sms.Autocomplete.SEARCH_FIELDS=net_comcast_sms.Autocomplete.NAME_FIELDS.concat(net_comcast_sms.Autocomplete.DATA_FIELDS);
net_comcast_sms.Autocomplete.counter=0;
net_comcast_sms.Autocomplete.prototype._doSearch=net_comcast_sms.Autocomplete.prototype._doAutocomplete=function(l,r,m,t,d,h){
l=l.replace(/[()]/,"");
var o=l.split(/\s+/);
var a=[];
for(var s=0,e=o.length;
s<e;
s++){
var c="("+AjxUtil.map(this._searchFields,function(f){
return"FIELD["+f+"]:*"+o[s]+"*"
}
).join(" || ")+")";
a.push(c)
}
var n=a.join(" && ");
var u=new ZmSearch({
query:n,types:AjxVector.fromArray([ZmItem.CONTACT]),accountName:h&&h.name,expandDL:appCtxt.get(ZmSetting.GAL_AUTOCOMPLETE),sortBy:ZmSearch.SCORE_DESC,attrs:[ZmContact.F_fileAs].concat(ZmContact.PHONE_FIELDS)}
);
this._currentStr=l;
this._current=net_comcast_sms.Autocomplete.counter++;
u.execute({
callback:new AjxCallback(this,this._handleResponseDoAutocomplete,[l,r,m,t,d,h,this._current]),timeout:ZmAutocomplete.AC_TIMEOUT}
)
};
net_comcast_sms.Autocomplete.prototype._handleResponseDoAutocomplete=function(b,c,t,n,a,e,h,l){
if(h==this._current){
if(c){
c.setWaiting(false)
}
var W,g=false,w=(f&&f.search&&f.search.isGalAutocompleteSearch);
var f=l.getResponse();
var r=f.getResults(ZmItem.CONTACT);
W=(r&&r.getArray())||[];
g=true;
if(!window.ZmResource){
window.ZmResource={
F_type:"zimbraCalResType"}
}
var T=[];
for(var q=0;
q<W.length;
q++){
var s=new ZmAutocompleteMatch(W[q],t,g||W[q] instanceof ZmContact,b);
if(s.acType==n){
if(s.type==ZmAutocomplete.AC_TYPE_GAL){
w=true
}
var x=s.item;
var p={};
var u=net_comcast_sms.Autocomplete.DATA_FIELDS;
for(var k=0,v=u.length;
k<v;
k++){
var y=x.getAttr(u[k]);
if(y||y===0){
p[u[k]]=y
}}
var O=net_comcast_sms.Autocomplete._contactHasValueInField(x,net_comcast_sms.Autocomplete.NAME_FIELDS,b);
var z=O||net_comcast_sms.Autocomplete._contactHasValueInField(x,net_comcast_sms.Autocomplete.PHONE_FIELDS,b);
for(var A in p){
var y=p[A];
if(O||(z&&AjxUtil.indexOf(ZmContact.PHONE_FIELDS,A)!=-1&&y.indexOf(b)!=-1)){
var o=AjxUtil.createProxy(s);
o.text=this._outTextFunc(A,s);
o.field=A;
o.value=y;
o.matches=net_comcast_sms.Autocomplete.Match_matches;
T.push(o)
}}}}
var d=!(f&&f.getAttribute("more"));
var m=this;
setTimeout(function(){
caboUtil.run(a,T);
m._cacheResults(b,n,T,w,d&&f._respEl.canBeCached,null,e)
}
,0)
}};
net_comcast_sms.Autocomplete._contactHasValueInField=function(r,o,l){
var s=l.toLowerCase().split(/\s+/);
var e=AjxUtil.collapseList(AjxUtil.map(o,function(d){
var u=r.getAttr(d);
return u&&u.toLowerCase()
}
));
for(var a=0,h=s.length;
a<h;
a++){
var c=false;
for(var t=0,n=e.length;
t<n;
t++){
if(e[t].indexOf(s[a])!=-1){
c=true;
break
}}
if(!c){
return false
}}
return true
};
net_comcast_sms.Autocomplete.Match_matches=function(s){
s=s.toLowerCase();
if(this.name&&!this._nameParsed){
var n=this.name.split(/\s+/,3);
var a=n[0];
this._lastName=n[n.length-1];
this._firstLast=[a,this._lastName].join(" ");
this._nameParsed=true
}
var e=[this.value,this.name,this._lastName,this._firstLast];
for(var t=0;
t<e.length;
t++){
var o=e[t];
var o=o&&o.toLowerCase();
if(o&&(o.indexOf(s)!=-1)){
return true
}}
return false
};
net_comcast_sms.Autocomplete.prototype.quickComplete=function(e){
return null
}
}
));
net_comcast_sms.Provisioning={
_loadListeners:[],_loaded:false,_loading:false};
net_comcast_sms.Provisioning.STATENAME="subscribeState";
net_comcast_sms.Provisioning.STATE_UNKNOWN="";
net_comcast_sms.Provisioning.STATE_NONE="";
net_comcast_sms.Provisioning.STATE_WAITING_REC_CONTRACT="1";
net_comcast_sms.Provisioning.STATE_WAITING_ORDERADD="2";
net_comcast_sms.Provisioning.STATE_WAITING_POLL="3";
net_comcast_sms.Provisioning.STATE_SUBSCRIBED="4";
net_comcast_sms.Provisioning.VOICE_LIMITED="voice-limited";
net_comcast_sms.Provisioning.COMMERCIAL="Commercial";
net_comcast_sms.Provisioning.ACTIVATED="A";
net_comcast_sms.Provisioning.setState=function(t,e,o){
caboUtil.log("Setting provisioning state to: ",t);
var a=e||{};
a[this.STATENAME]=t;
net_comcast_sms.Util.setProperties(a,o)
};
net_comcast_sms.Provisioning.getState=function(e){
caboUtil.run(e,net_comcast_sms.Util.getProperty(this.STATENAME))
};
net_comcast_sms.Provisioning.load=function(o,e,a){
var t=caboUtil.LoadHandler.get(this);
t.run(new AjxCallback(this,function(){
caboUtil.run(o,this.error)
}
),new AjxCallback(this,function(n){
var s=net_comcast_sms.Util.getZimletHandler();
s.getConfigObj(new AjxCallback(this,function(){
var r=s.config.comcast_useRestSsml;
var l,h=appCtxt.accountList.mainAccount;
if(this.isEntitled()){
var l;
if(net_comcast_sms.Model.USE_STATIC){
l=net_comcast_sms.voiceapp
}else{
if(r&&window.Comcast_ssml){
l=Comcast_ssml
}else{
l=appCtxt.getApp("Voice")
}}
l.getVoiceInfo(new AjxCallback(this,function(){
this._tn=this._availTNs=null;
this._phones={};
this._isSNSEnabled=false;
this._isMCDVEnabled=false;
var d=[],m=this._availTNs=[],f=appCtxt.getActiveAccount()&&appCtxt.getActiveAccount().name&&appCtxt.getActiveAccount().name.split("@")[0].toLowerCase(),u=l.phones.length;
for(var p=0;
p<u;
p++){
var y=l.phones[p],c=y.id,g=y.hasTextMessaging?d:m;
this._phones[y.id]=y;
g.push(c);
if(y.textmsg_users&&y.textmsg_users.toLowerCase()==f){
this._tn=c
}
if(y.sns){
this._isSNSEnabled=true
}
if(y.mcdv){
this._isMCDVEnabled=true;
this._mcdvService=y.mcdvService
}}
if(!this._tn){
for(var c in this._phones){
var y=this._phones[c];
if(y.textmsg_users){
this._tn=c
}}}
if(!this._tn){
for(var c in this._phones){
var y=this._phones[c];
if(y.hasTextMessaging){
this._tn=c
}}}
if(this._tn){
var y=this._phones[this._tn];
this._isSNSEnabled=y.sns;
this._isMCDVEnabled=y.mcdv;
this._mcdvService=y.mcdvService;
this._assignedUser=y.textmsg_users;
this._isAssignedUser=this._assignedUser&&this._assignedUser.toLowerCase()==f.toLowerCase()
}
caboUtil.log("Textmsg is "+(this._tn?"enabled":"disabled"));
caboUtil.log("Assigned users "+(this._assignedUser?"exists":"doesn't exist"));
caboUtil.log("User is"+(this._isAssignedUser?"":" not")+" the assigned user");
caboUtil.log("SNS (v2go) is "+(this._isSNSEnabled?"enabled":"disabled"));
var b=l._storeprincipal;
this._uid=b.accountNumber;
this._acctNum=b.accountNumber;
this._name=b.name;
this._isPrimary=b.is_primary;
caboUtil.log("Account is "+(this._isPrimary?"primary":"not primary"));
this._accountType=b.accountType;
this._isCommercial=!!(b.accountType&&b.accountType!="resi");
this._productDesc=b.productDesc;
this._isLimited=b.productDesc===this.VOICE_LIMITED;
this._isNeither=false;
this._dvs=b.digitalVoiceService;
this._isActivated=b.digitalVoiceService===this.ACTIVATED;
this._serviceActivated=this._mcdvService===this.ACTIVATED||!this._mcdvService;
this._loaded=true;
this.getState(new AjxCallback(this,function(w){
var v=null;
caboUtil.log('Last known state was "'+w+'"');
if(this._tn&&(w==this.STATE_WAITING_ORDERADD||w==this.STATE_WAITING_REC_CONTRACT||w==this.STATE_WAITING_POLL)){
v=this.STATE_NONE
}else{
if(w!=this.STATE_NONE&&w!=this.STATE_WAITING_REC_CONTRACT&&w!=this.STATE_WAITING_ORDERADD&&w!=this.STATE_WAITING_POLL){
v=this.STATE_NONE
}}
if(v!==null){
this.setState(v,null,n)
}else{
caboUtil.run(n)
}}
))
}
),new AjxCallback(this,function(c){
this.error=c||true;
caboUtil.run(n);
return true
}
),true,e)
}else{
caboUtil.run(n)
}}
))
}
),e)
};
net_comcast_sms.Provisioning._handleLoad=function(){
var e=[].concat(this._loadListeners);
this._loadListeners.length=0;
caboUtil.run(e,this.error)
};
net_comcast_sms.Provisioning.get=function(t,a,e){
t=AjxUtil.toArray(t);
this.load(new AjxCallback(this,function(){
caboUtil.apply(a,caboUtil.Coll.getValues(this,t))
}
))
};
net_comcast_sms.Provisioning.getSubscribed=function(e){
this.load(new AjxCallback(this,function(){
var t=this.error?null:!!(this._tn);
this.getState(new AjxCallback(this,function(a){
setTimeout(function(){
caboUtil.run(e,t&&a!=net_comcast_sms.Provisioning.STATE_WAITING_REC_CONTRACT&&a!=net_comcast_sms.Provisioning.STATE_WAITING_ORDERADD&&a!=net_comcast_sms.Provisioning.STATE_WAITING_POLL)
}
,0)
}
))
}
))
};
net_comcast_sms.Provisioning.isPrimary=function(){
return this._isPrimary
};
net_comcast_sms.Provisioning.isTextMsgEnabled=function(){
return !!this._tn
};
net_comcast_sms.Provisioning.isSNSEnabled=function(){
return this._isSNSEnabled
};
net_comcast_sms.Provisioning.isMCDVEnabled=function(){
return this._isMCDVEnabled
};
net_comcast_sms.Provisioning.getAccountType=function(){
return this._accountType
};
net_comcast_sms.Provisioning.isCommercial=function(){
return this._isCommercial
};
net_comcast_sms.Provisioning.isLimited=function(){
return this._isLimited
};
net_comcast_sms.Provisioning.isNeitherLimitedOrUnlimited=function(){
return this._isNeither
};
net_comcast_sms.Provisioning.isActivated=function(){
return this._isActivated
};
net_comcast_sms.Provisioning.hasAssignedUser=function(){
return this._assignedUser
};
net_comcast_sms.Provisioning.isAssignedUser=function(){
return this._isAssignedUser
};
net_comcast_sms.Provisioning.isServiceActivated=function(){
return this._serviceActivated
};
net_comcast_sms.Provisioning.isEntitled=function(){
var e=appCtxt.accountList.mainAccount;
return net_comcast_sms.Model.USE_STATIC||!!(e.isMain&&appCtxt.get(ZmSetting.VOICE_ENABLED,null,e)&&appCtxt.getApp("Voice"))
};
net_comcast_sms.Provisioning.signup=function(t,e,o,a){
this.getState(new AjxCallback(this,function(n){
var s=new AjxCallback(this,this._orderAdd,[e,t,new AjxCallback(this,this._handleSignup,[t,o]),a,60000]);
if(t&&n!=this.STATE_WAITING_ORDERADD){
this._recordContract(e,s,a)
}else{
caboUtil.run(s)
}}
))
};
net_comcast_sms.Provisioning._handleSignup=function(e,t){
this.setState(this.STATE_WAITING_POLL);
caboUtil.run(t)
};
net_comcast_sms.Provisioning._recordContract=function(e,a,t){
this.getAcctNum(new AjxCallback(this,function(o){
this.setState(this.STATE_WAITING_REC_CONTRACT,{
tn:e}
,new AjxCallback(this,function(){
var n=[net_comcast_sms.SmsZimlet.RECORDCONTRACT,"?tn=",e,"&acctNum=",o,"&uid=",this._name].join("");
AjxRpc.invoke(null,n,null,new AjxCallback(this,this._handleRecordContract,[a,t,e]),true)
}
))
}
))
};
net_comcast_sms.Provisioning._handleRecordContract=function(n,a,e,t){
var o=t.obj||JSON.gparse(t.text);
if(t.success&&o&&o.recordContractReturn){
this._tn=e;
caboUtil.run(n)
}else{
caboUtil.run(a,o&&o.__fault_messagetext)
}};
net_comcast_sms.Provisioning._orderAdd=function(e,t,n,a,o){
this.getAcctNum(new AjxCallback(this,function(s){
this.setState(this.STATE_WAITING_ORDERADD,null,new AjxCallback(this,function(d){
var c=!this._isLimited!=!d;
var l=[net_comcast_sms.SmsZimlet.ORDERADD,"?tn=",e,"&acctNum=",s,"&action=",t?"ADD":"DISCONNECT","&limited=",c?"1":"0"].join("");
var r=new AjxCallback(this,this._handleOrderAdd,[t,e,n,a]);
if(!t&&!d){
var u=arguments.callee;
var h=new AjxCallback(this,function(m){
var p=m.obj||JSON.gparse(m.text),f=p&&p.__fault_messagecode;
if(f=="FAULT"){
u(true)
}else{
caboUtil.run(r,m)
}}
)
}
AjxRpc.invoke(null,l,null,h||r,true,o)
}
))
}
))
};
net_comcast_sms.Provisioning._handleOrderAdd=function(t,h,l,r,o){
var n=o.obj||JSON.gparse(o.text),e=n&&n.__fault_messagecode;
if(e){
caboUtil.log("Received error code ",e)
}
if(n&&(o.success&&n.orderAddReturn)||(t&&e=="307")||(!t&&e=="OO-1037")||(!t&&e=="OO-1020")){
caboUtil.log("Continuing in spite of error (non-fatal error code)");
this._tn=t&&h;
this.setState(this.STATE_WAITING_POLL,null,l)
}else{
caboUtil.log("Halting because of error (unhandled, possibly fatal error)");
var s,d,c=net_comcast_sms.Util.getZimletHandler();
switch(e){
case"10072":case"OO-1019":case"OO-1037":s="provErrorAlready";
break;
case undefined:case null:e="No error code";
default:s="provErrorGeneric";
break
}
d="provErrorTitle";
var a=function(){
caboUtil.run(r,c.getMsg(s,e),c.getMsg(d))
};
if(!t){
this.setState(this.STATE_NONE,null,a)
}else{
a()
}}};
net_comcast_sms.Provisioning.getAvailableTNs=function(e){
this.get(["_availTNs","_tn"],e)
};
net_comcast_sms.Provisioning.getSelectedTN=function(t){
var e=this;
setTimeout(function(){
caboUtil.run(t,e._tn||null)
}
,0)
};
net_comcast_sms.Provisioning.getUserId=function(e){
this.get("_uid",e)
};
net_comcast_sms.Provisioning.getAcctNum=function(e){
this.get("_acctNum",e)
};
net_comcast_sms.Provisioning.getMasterAccount=function(e){
this.load(new AjxCallback(this,function(){
var a=net_comcast_sms.Util.getZimletHandler(),o;
if(this.error){
o=null
}else{
o=new net_comcast_sms.MasterAccount({
spcode:"spcode",sppwd:"sppwd",mname:"mname",users:[]}
);
AjxUtil.hashUpdate(o,{
mname:null,hwmac:null,enabled:true}
,true);
o.setHandler(a);
o.ua_domain=a.getConfig("broadcloudBase");
var t=new net_comcast_sms.UserAccount(o,{
name:this._name,tn:this._tn,parameters:{
sms_enable:true,sms_international:true,sms_max_total_msgs:1000,sms_max_sent_msgs:1000}}
);
t._loggedIn=true;
o.users.push(t)
}
caboUtil.run(e,o)
}
))
};
net_comcast_sms.Provisioning.poll=function(e,n,a,o){
var t=function(s){
caboUtil.run(a,new AjxCallback(this,function(r,l){
if(l){
setTimeout(function(){
caboUtil.run(e)
}
,0)
}else{
var h=r+1;
if(h>=o.length){
setTimeout(function(){
caboUtil.run(n)
}
,0)
}else{
setTimeout(function(){
t.call(this,h)
}
,(!isNaN(o[h])?o[h]:10)*1000)
}}}
,[s]))
};
t.call(this,0)
};
net_comcast_sms.Controller=function(e,t){
if(!arguments.length){
return
}
ZmController.call(this,this.toString(),e,t);
this._container=e;
this._handler=t;
this._registerOperations();
this._refreshListener=new AjxCallback(this,this._updateRefreshButton);
this._popdownListener=new AjxListener(this,this.popdownChoosers);
this._lastPoll=0;
this._canResizeOverview=true
};
net_comcast_sms.Controller.prototype=new ZmController;
net_comcast_sms.Controller.prototype.constructor=net_comcast_sms.Controller;
net_comcast_sms.Controller.prototype.toString=function(){
return"net_comcast_sms.Controller"
};
net_comcast_sms.Controller.VIEW_COMPOSE="net_comcast_VIEW_COMPOSE";
net_comcast_sms.Controller.VIEW_MAILCOMPOSE="net_comcast_VIEW_MAILCOMPOSE";
net_comcast_sms.Controller.VIEW_THREADS="net_comcast_VIEW_THREADS";
net_comcast_sms.Controller.INCOMING_QUOTA_WARN_LIMIT=0.95;
net_comcast_sms.Controller.OUTGOING_QUOTA_WARN_LIMIT=0.95;
net_comcast_sms.Controller.prototype.getHandler=function(){
return this._handler
};
net_comcast_sms.Controller.prototype.getMsg=function(){
return this._handler.getMsg.apply(this._handler,arguments)
};
net_comcast_sms.Controller.prototype.getMsgObj=function(){
return this._handler.getMsgObj()
};
net_comcast_sms.Controller.prototype.getMainView=function(){
if(!this._mainView){
var a=this._handler.app;
var e={};
e[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this._postShowCallback);
e[ZmAppViewMgr.CB_PRE_HIDE]=new AjxCallback(this,this._preHideCallback);
this._mainView=new net_comcast_sms.MainView({
parent:this._container,controller:this}
);
net_comcast_sms.Controller.__hack_clean_tabgroups(appCtxt.getRootTabGroup());
appCtxt.getRootTabGroup().addMember(this._mainView.getTabGroupMember());
var t={};
t[ZmAppViewMgr.C_TOOLBAR_TOP]=this.getToolbar();
t[ZmAppViewMgr.C_APP_CONTENT]=this._mainView;
a.createView({
viewId:this.getViewId(),elements:t,callbacks:e,isAppView:true,isTransient:false}
);
this.loadThreads()
}
return this._mainView
};
net_comcast_sms.Controller.prototype.getIframeView=function(){
if(!this._iframeView){
var o={};
o[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,function(){
Dwt.setTitle([ZmMsg.zimbraTitle,this.getMsg("xtmTitle")].join(": "));
appCtxt.getAppChooser().setSelected(this._handler.app.getName())
}
);
var s={};
var n=this._iframeView=s[ZmAppViewMgr.C_APP_CONTENT_FULL]=new ZmUpsellView({
parent:appCtxt.getShell(),posStyle:Dwt.ABSOLUTE_STYLE,className:"SmsIframe"}
);
var a=n.getHtmlElement();
var t=[];
var e=0;
var r=Dwt.getNextId();
t[e++]="<iframe id='";
t[e++]=r;
t[e++]="' width='100%' height='100%' frameborder='0' src='' scrolling='no'/>";
a.innerHTML=t.join("");
appCtxt.getAppViewMgr().createView({
viewId:"SmsIframe",elements:s,callbacks:o,isAppView:true}
);
n.iframe=Dwt.byId(r)
}
return this._iframeView
};
net_comcast_sms.Controller.prototype.setIframeUrl=function(a,e,s){
var o=this._iframeView&&this._iframeView.iframe;
if(o&&a){
var t=appCtxt.getAppViewMgr();
var n=function(){
if(e){
t.popView(true,ZmId.VIEW_LOADING);
t.pushView("SmsIframe")
}
Dwt.clearHandler(o,"onload");
caboUtil.run(s)
};
if(AjxEnv.isIE){
o.attachEvent("onload",n)
}else{
Dwt.setHandler(o,"onload",n)
}
if(e){
t.pushView(ZmId.VIEW_LOADING,true)
}else{
t.pushView("SmsIframe")
}
o.src=a
}};
net_comcast_sms.Controller.prototype.showIframe=function(a,t){
this.showLoading(false,"show");
this.showLoading(false,"load");
if(this._mainView&&t){
this._showToolbarItems(this.getToolbarOps(),false)
}
var e=this.getIframeView();
this.setIframeUrl(a,true);
this._showingIframe=true;
appCtxt.getAppViewMgr().setAppView(this._handler.name,"SmsIframe")
};
net_comcast_sms.Controller.__hack_clean_tabgroups=function(a){
if(a instanceof DwtTabGroup){
a.__members._array=caboUtil.Coll.uniq(a.__members._array);
for(var t=0,e=a.__members.length;
t<e;
t++){
net_comcast_sms.Controller.__hack_clean_tabgroups(a.__members[t])
}}};
net_comcast_sms.Controller.prototype._getOverview=function(){
var t=this._handler.app;
t.getOverviewPanelContent();
var e=t.getOverview();
if(!this._overviewHasBeenCleared){
e.clear();
this._overviewHasBeenCleared=true
}
return e
};
net_comcast_sms.Controller.prototype.getListView=function(){
if(!this._listView){
var t=this._getOverview();
var e=this._listView=new net_comcast_sms.ThreadListView({
parent:t,controller:this}
);
e.addSelectionListener(new AjxListener(this,this._handleSelectThread));
e.set(new AjxVector());
var a=t.getSize();
e.setSize(a.x,a.y);
caboUtil.augment(t,"setSize",function(n,o,s){
e.setSize(o,s)
}
)
}
return this._listView
};
net_comcast_sms.Controller.prototype.getToolbar=function(){
if(!this._toolbar){
var a=Dwt.byId("skin_main_toolbar_container")||Dwt.byId("skin_td_main"),l=this._toolbar=new ZmButtonToolBar({
parent:this._container,buttons:this.getToolbarOps(),className:"ZmToolBar ImgSkin_Toolbar MessageToolbar",refElementId:a&&a.id}
);
for(var n=0;
n<l.opList.length;
n++){
var h=l.opList[n],s=l.getOp(h);
if(s){
var d=ZmOperation.getProp(h,"text"),e=ZmOperation.getProp(h,"textKey"),u=ZmOperation.getProp(h,"tooltip"),r=ZmOperation.getProp(h,"tooltipKey"),o=ZmOperation.getProp(h,"action"),t=e&&this.getMsg(e);
if(AjxUtil.isString(t)){
s.setText(t)
}else{
if(d&&AjxUtil.isString(d)){
s.setText(d)
}}
t=r&&this.getMsg(r);
if(AjxUtil.isString(t)){
s.setToolTipContent(t)
}else{
if(u&&AjxUtil.isString(u)){
s.setToolTipContent(u)
}}
if(o instanceof AjxListener){
s.addSelectionListener(o)
}
if(s instanceof DwtButton&&h!="SMS_COMPOSEEMOTICON"){
s.addSelectionListener(this._popdownListener)
}}}
l._createPrecedenceList();
var c=this._newCount=l.getOp(ZmOperation.TEXT);
c.addClassName("itemCountText");
l.addListener(DwtEvent.ONMOUSEUP,this._popdownListener);
l.setSize(Dwt.DEFAULT,Dwt.CLEAR);
this._showToolbarItems(this.getToolbarOps(),false)
}
return this._toolbar
};
net_comcast_sms.Controller.prototype.getCurrentToolbar=function(){
return this.getToolbar()
};
net_comcast_sms.Controller.prototype.updateNewMessageCount=function(){
var t=this.getMessageStore().messages_byStatus;
var e=AjxUtil.keys(t[net_comcast_sms.Message.STATUS_NEW]).length+AjxUtil.keys(t[net_comcast_sms.Message.STATUS_UNREAD]).length;
if(this._newCountVal!==e){
this._newCountVal=e;
this._newCount.setText(this.getMsg("newMessageCount",e))
}};
net_comcast_sms.Controller.prototype.getUserAccount=function(){
return this._userAccount
};
net_comcast_sms.Controller.prototype.setUserAccount=function(e,t){
this._userAccount=e;
this.loadThreads(t,false)
};
net_comcast_sms.Controller.prototype.getMessageStore=function(){
return this._userAccount&&this._userAccount.getMessageStore()
};
net_comcast_sms.Controller.prototype.loadThreads=function(a,t){
var e=net_comcast_sms.Provisioning;
e.getState(new AjxCallback(this,function(o){
if(this._userAccount&&o==e.STATE_NONE&&e.isTextMsgEnabled()){
this.getMessageStore().refreshThreadHeaders(new AjxCallback(this,this._handleLoadThreads,[a]))
}else{
caboUtil.run(a)
}}
))
};
net_comcast_sms.Controller.prototype._handleLoadThreads=function(s,n){
if(n instanceof net_comcast_sms.ConnError||n instanceof net_comcast_sms.RestError||n instanceof net_comcast_sms.ModelError){
this.showLoading(false,"show");
var a=net_comcast_sms.Provisioning;
if(n.code=="0040005"&&a.isTextMsgEnabled()&&!a.hasAssignedUser()&&a.isPrimary()&&a.isMCDVEnabled()){
this.showError(this.getMsg("accountNotActiveError"),this.getMsg("accountNotActiveErrorHeader"))
}else{
this.showError(this.getMsg("loadFailedBody")+"<br/>"+n.toString(),this.getMsg("loadFailedHead"))
}
caboUtil.run(s)
}else{
var t=this.getMessageStore();
var o=this.getMessageStore().getNonDeletedThreads();
var e=this.getListView();
if(!this._lastIsCompose()&&!this._showingIframe){
this.getMainView().getThreadView().setVisible(true)
}
e.set(AjxVector.fromArray(AjxUtil.values(o)),ZmItem.F_STATUS);
t.addListener("threads",new AjxCallback(e,e.reset));
caboUtil.run(s)
}};
net_comcast_sms.Controller.prototype.showLoading=function(e,s){
var t=appCtxt.getAppViewMgr();
if(!this.__loading_ids){
this.__loading_ids={}
}
var a=this.__loading_ids;
var n=caboUtil.Coll.isEmpty(a);
if(e){
a[s]=true
}else{
if(a[s]){
delete a[s]
}}
var o=caboUtil.Coll.isEmpty(a);
if(o!=n){
if(!o){
this.getMainView().getLoadingView().setVisible(true)
}else{
this.getMainView().getLoadingView().setVisible(false)
}}};
net_comcast_sms.Controller.prototype.showError=function(t,e){
this.showLoading(false,"show");
this.showLoading(false,"load");
this._showingError=true;
if(this._mainView){
this._showToolbarItems(this.getMarketingToolbarOps(),true);
this._enableToolbarItems(this.getToolbarOps(),false,true);
this.getMainView().showErrorView(t,e);
if(this._showingIframe){
this.showIframe()
}}};
net_comcast_sms.Controller.prototype.showStatic=function(e){
this.showIframe(this._handler.getResource("html/"+e),true)
};
net_comcast_sms.Controller.prototype.showLightbox=function(o,t,e){
this.showLoading(false,"show");
this.showLoading(false,"load");
var a=this.getLightbox();
a.setSrc(o);
a.setSize(t,e);
a.popup()
};
net_comcast_sms.Controller.prototype.getLightbox=function(){
return this._handler.getIframeLightbox()
};
net_comcast_sms.Controller.prototype._resetToolbarOperations=function(){};
net_comcast_sms.Controller.prototype.getAutocompleter=function(){
if(!this._autoCompleter){
this._autoCompleter=new net_comcast_sms.Autocomplete({
enabled:{
name:true,phone:true}
,outTextFunc:function(t,e){
return e.text+" ["+(ZmContact._AB_FIELD[t]||AjxStringUtil.capitalizeWords(AjxStringUtil.fromMixed(t))||t)+"]"
}}
)
}
return this._autoCompleter
};
net_comcast_sms.Controller.prototype.show=function(e){
this._handler.getConfigObj(new AjxCallback(this,function(){
var s=this.getMainView();
var o=net_comcast_sms.Provisioning;
var n=this._handler.config.comcast_v2gUpsell;
var t=this;
this.showLoading(true,"load");
this._doShow();
var a;
var r=function(h){
caboUtil.log("Error in GetVoiceInfoExtRequest: ",h.code);
switch(h.code){
case"voice.ACCOUNT_NOT_CPNI_COMPLIANT":case"2070":case"ACCOUNT_CPNI_NOT_AVAILABLE":case"voice.ACCOUNT_CPNI_NOT_AVAILABLE":case"2071":a=net_comcast_sms.SmsZimlet.NO_CPNI;
break;
case"voice.UNABLE_TO_RETRIEVE_PROFILE_SUMMARY":t.showError(t.getMsg("provErrorProfile",h.msg),t.getMsg("provErrorHeader"));
break;
case"voice.UNABLE_TO_RETRIEVE_VOICEMAIL_SUMMARY":t.showError(t.getMsg("provErrorVoicemail",h.msg),t.getMsg("provErrorHeader"));
break;
case"voice.SECONDARY_NOT_ALLOWED":case"2051":a=net_comcast_sms.SmsZimlet.SECONDARY_NOTASSIGNED;
break;
default:t.showError(t.getMsg("provErrorException",h.msg),t.getMsg("provErrorHeader"));
break
}};
o.load(new AjxCallback(this,function(c){
var h,p,l,m,d=net_comcast_sms.SmsZimlet;
if(c){
r(c)
}else{
if(o.isCommercial()){
caboUtil.log("Account is BCDV");
a=net_comcast_sms.SmsZimlet.BUSINESS
}else{
if(!o.isActivated()){
caboUtil.log("Account is syncing");
a=net_comcast_sms.SmsZimlet.SYNCING
}else{
if(o.isTextMsgEnabled()){
if(o.hasAssignedUser()){
if(o.isAssignedUser()){
h=true
}else{
if(o.isPrimary()){
if(o.isMCDVEnabled()){
if(o.isServiceActivated()){
caboUtil.log("Provisioning case 1");
a=n?d.V2G_NOMAP:d.PRIMARY_CCENTRAL
}else{
a=d.PENDING
}}else{
caboUtil.log("Provisioning case 2");
a=n?d.V2G_INTRO_LARGE:d.NO_ACCESS
}}else{
if(o.isMCDVEnabled()){
caboUtil.log("Provisioning case 3a");
a=d.SECONDARY_NOTASSIGNED
}else{
caboUtil.log("Provisioning case 3b");
a=d.SECONDARY
}}}}else{
if(o.isPrimary()){
if(o.isMCDVEnabled()){
caboUtil.log("Provisioning case 4a");
if(o.isServiceActivated()){
if(n){
l=d.V2G_CCENTRAL;
m=d.V2G_CCENTRAL_SIZE
}else{
p=true
}
h=true
}else{
if(n){}else{
p=true
}
h=true
}}else{
caboUtil.log("Provisioning case 4b");
if(n){
l=d.V2G_INTRO;
m=d.V2G_INTRO_SIZE
}
h=true
}}else{
if(o.isMCDVEnabled()){
caboUtil.log("Provisioning case 5a");
a=d.SECONDARY_NOTASSIGNED
}else{
caboUtil.log("Provisioning case 5b");
a=d.SECONDARY
}}}}else{
if(o.isMCDVEnabled()){
if(o.isPrimary()){
caboUtil.log("Provisioning case 6");
if(n){
if(o.isServiceActivated()){
a=d.V2G_CCENTRAL
}else{
a=d.PENDING
}}else{
a=d.SNS_ENABLED
}}else{
caboUtil.log("Provisioning case 7");
a=d.SECONDARY_NOTASSIGNED
}}else{
if(o.isPrimary()){
caboUtil.log("Provisioning case 9");
var u=function(f){
if(f){
r(f)
}else{
if(o.isNeitherLimitedOrUnlimited()){
caboUtil.log("Account is neither limited or unlimited");
a=d.COSTS_NEITHER
}else{
if(o.isLimited()||!n){
h=true
}else{
a=d.V2G_INTRO_LARGE
}}}
if(a){
caboUtil.log("Showing iframe url: "+a);
this.showIframe(a,true)
}
if(h){
this.show2()
}};
if(this._handler.config.comcast_useRestSsml){
o.load(new AjxCallback(this,u),true,true)
}else{
u.call(this)
}}else{
caboUtil.log("Provisioning case 8");
a=d.SECONDARY
}}}}}}
if(a){
caboUtil.log("Showing iframe url: "+a);
this.showIframe(a,true)
}
if(h){
this.show2(l,m,p)
}}
));
caboUtil.run(e)
}
))
};
net_comcast_sms.Controller.prototype.show2=function(e,o,a){
var t=net_comcast_sms.Provisioning;
t.getState(new AjxCallback(this,function(h){
this.showLoading(false,"load");
caboUtil.log("state: ",h);
switch(h){
case t.STATE_NONE:case t.STATE_UNKNOWN:if(!net_comcast_sms.Provisioning.isTextMsgEnabled()){
caboUtil.log("Run signup");
this._showMarketing()
}else{
caboUtil.log("Run XTM");
this._updateRefreshButton();
if(this._lastIsCompose()){
this.showCompose()
}else{
if(a){
this.getMainView().getThreadView().setVisible(false);
var r=net_comcast_sms.SmsZimlet.SNS_ENABLED;
this.showIframe(r+(r.indexOf("?")==-1?"?":"&")+"xtmCallback=net_comcast_sms.instance.getController().showThreadList()",true)
}else{
this.showThreadList()
}}
if(e){
caboUtil.log("Showing lightbox url: "+e);
o=o||[600,400];
this.showLightbox(e,o[0],o[1])
}
this._hasInited=true;
var s=this;
setTimeout(function(){
s.showLoading(true,"load");
s.getHandler().load(new AjxCallback(s,function(){
s.showLoading(false,"show");
s.showLoading(false,"load");
var l=this.getMessageStore();
if(l){
this.testQuota(true,true);
l.addListener("status",new AjxCallback(this,this.updateNewMessageCount));
this.updateNewMessageCount()
}}
))
}
,5)
}
break;
case t.STATE_WAITING_REC_CONTRACT:case t.STATE_WAITING_ORDERADD:var n=net_comcast_sms.Util.getProperty("tn");
mainview.getProvisioningView().signup(n);
break
}}
))
};
net_comcast_sms.Controller.prototype.__continueShow=function(){
this.show(null,true)
};
net_comcast_sms.Controller.prototype._doShow=function(){
this._setThread(this._thread||null);
var e=appCtxt.getAppViewMgr();
if(net_comcast_sms.Util.UI.loadingIsShown()){
e.stageView(this.getViewId())
}else{
e.pushView(this.getViewId())
}};
net_comcast_sms.Controller.prototype._showMarketing=function(e){
this._showingIframe=false;
this.getMainView().showProvisioningView(e);
this._showToolbarItems(this.getMarketingToolbarOps(),true);
this._enableToolbarItems(this.getToolbarOps(),false,true)
};
net_comcast_sms.Controller.prototype.showThreadList=function(e,s,a){
var t=this;
this._showingIframe=false;
appCtxt.getAppViewMgr().pushView(this.getViewId());
if(this._showingError){
this.showError()
}else{
var n=function(){
var r=t.getMainView();
if(t._lastIsCompose()){
t._latestView=net_comcast_sms.Controller.VIEW_THREADS;
t.unmoveMailComposeToolbar();
r.getComposeView().endMailComposeView()
}
r.showThreadView();
t._showToolbarItems(t.getThreadToolbarOps(),true);
t._updateToolbarThreadButtons();
caboUtil.run(s)
};
if(!e&&this._lastIsCompose()){
var o=this._composeExitDialog;
if(!o){
o=this._composeExitDialog=new DwtMessageDialog({
parent:appCtxt.getShell(),buttons:[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON]}
);
o._button[DwtDialog.YES_BUTTON].setText(this.getMsg("composeExitNotificationOk"));
o._button[DwtDialog.NO_BUTTON].setText(this.getMsg("composeExitNotificationCancel"))
}else{
o.reset()
}
o.setMessage(this.getMsg("composeExitNotification"));
o.registerCallback(DwtDialog.YES_BUTTON,new AjxCallback(this,function(){
o.popdown();
n()
}
));
o.registerCallback(DwtDialog.NO_BUTTON,new AjxCallback(this,function(){
o.popdown();
caboUtil.run(a)
}
));
o.popup()
}else{
n()
}}};
net_comcast_sms.Controller.prototype.showCompose=function(){
this._showingIframe=false;
if(!this._lastIsCompose()){
this._latestView=net_comcast_sms.Controller.VIEW_COMPOSE
}
this.getMainView().showComposeView();
this._oldVisibleToolbarItems=this._getVisibleToolbarItems();
this._oldEnabledToolbarItems=this._getEnabledToolbarItems();
this._showToolbarItems(this.getComposeToolbarOps(),true);
this._enableToolbarItems(this.getComposeToolbarOps(),true)
};
net_comcast_sms.Controller.prototype.send=function(){
var e=this._getFirstComposeView();
if(e){
this._enableToolbarItems(this.getComposeToolbarOps(),false);
e.send(new AjxCallback(this,function(t){
if(!t){
this._enableToolbarItems(this.getComposeToolbarOps(),true)
}}
))
}};
net_comcast_sms.Controller.prototype.cancelCompose=function(){
var e=this._getFirstComposeView();
if(e){
e.cancel()
}
this.hideCompose()
};
net_comcast_sms.Controller.prototype.hideCompose=function(t){
var e=this;
return this.showThreadList(true,function(){
e._showToolbarItems(e._oldVisibleToolbarItems||e.getThreadToolbarOps(),true);
e._enableToolbarItems(e._oldEnabledToolbarItems||e.getThreadToolbarOps(),true)
}
)
};
net_comcast_sms.Controller.prototype._getFirstComposeView=function(){
var e=this.getMainView().getComposeView().getVisibleViews();
if(e&&e.length){
return e[0]
}};
net_comcast_sms.Controller.prototype.showMailCompose=function(e){
AjxPackage.require({
name:"Mail",callback:new AjxCallback(this,function(){
AjxDispatcher.setLoaded("Mail",true);
if(e.inNewWindow){
AjxDispatcher.run("GetComposeController").doAction(e)
}else{
this.getMainView().getComposeView().clear();
this._showToolbarItems(this.getMailComposeToolbarOps(),true);
if(!e){
e={
action:ZmId.OP_NEW_MESSAGE}
}
this._latestView=net_comcast_sms.Controller.VIEW_MAILCOMPOSE;
this.setCanResizeOverview(false);
var t=this.getMainView().showMailComposeView(e);
this.setCanResizeOverview(true);
this.moveMailComposeToolbar(t._controller)
}}
)}
)
};
net_comcast_sms.Controller.prototype.moveMailComposeToolbar=function(t){
if(this._movedToolbarButtons&&this._movedToolbarButtons.length){
this.unmoveMailComposeToolbar()
}
var e=t&&t._toolbar;
var s=this._toolbar;
var o=this._movedToolbarButtons=[];
var a=e&&e._buttons;
if(a){
for(var n in a){
o.push(a[n])
}
this.moveToolbarButtons(e,s,o);
e.getButton=function(r){
return s.getButton(r)
}
}};
net_comcast_sms.Controller.prototype.unmoveMailComposeToolbar=function(){
this.moveToolbarButtons(this._toolbar,null,this._movedToolbarButtons);
this._movedToolbarButtons=null
};
net_comcast_sms.Controller.prototype.moveToolbarButtons=function(e,s,o){
if(o&&o.length){
for(var a=0;
a<o.length;
a++){
var t=o[a];
var n=t.getData("_buttonId");
if(!t.textPrecedence){
t.textPrecedence=a
}
if(s){
t.reparent(s,a);
s._buttons[n]=t
}else{
if(e){
e.removeChild(t)
}}
if(e){
delete e._buttons[n]
}}
if(s){
s._createPrecedenceList()
}}};
net_comcast_sms.Controller.prototype._lastIsCompose=function(){
return(this._lastIsTextCompose()||this._lastIsMailCompose())
};
net_comcast_sms.Controller.prototype._lastIsTextCompose=function(){
return(this._latestView==net_comcast_sms.Controller.VIEW_COMPOSE)
};
net_comcast_sms.Controller.prototype._lastIsMailCompose=function(){
return(this._latestView==net_comcast_sms.Controller.VIEW_MAILCOMPOSE)
};
net_comcast_sms.Controller.prototype._postShowCallback=function(){
if(this._canResizeOverview){
this._priorWidth=this._handler.getOverviewWidth();
this._handler.setOverviewWidth(this._overviewWidth||net_comcast_sms.ThreadListView.DEFAULT_SIZE)
}
return true
};
net_comcast_sms.Controller.prototype._preHideCallback=function(){
if(this._canResizeOverview&&this._listView){
this._overviewWidth=this._listView.getSize().x;
this._handler.setOverviewWidth(this._priorWidth)
}
this.popdownChoosers();
return true
};
net_comcast_sms.Controller.prototype.popdownChoosers=function(){
net_comcast_sms.EmoticonChooser.popdown()
};
net_comcast_sms.Controller.prototype._saveUnsentMessage=function(){
this.setUnsentMessages(this.getMainView().getComposeView().getUnsentMessages())
};
net_comcast_sms.Controller.prototype._loadUnsentMessages=function(e){
this.getMainView().getComposeView().setUnsentMessages(e)
};
net_comcast_sms.Controller.prototype.isEntitled=function(){
return this._handler.isEntitled()
};
net_comcast_sms.Controller.prototype.loadVoiceData=function(e){
this._handler.loadVoiceData(e)
};
net_comcast_sms.Controller.prototype.getAvailableTNs=function(e){
this._handler.getAvailableTNs(e)
};
net_comcast_sms.Controller.prototype.signup=function(e,t){
this._handler.signup(true,e,new AjxCallback(this,this._handleSignup,[t]),new AjxCallback(this,this._handleSignupError,[t]))
};
net_comcast_sms.Controller.prototype._handleSignup=function(e){
this.showLoading(false,"signup");
caboUtil.run(e,true);
this.show()
};
net_comcast_sms.Controller.prototype._handleSignupError=function(a,t,e){
caboUtil.run(a,false,t,e);
this.showError(t,e)
};
net_comcast_sms.Controller.prototype.getViewId=function(){
return"net_comcast_sms_VIEW"
};
net_comcast_sms.Controller.prototype._getThreadViewType=function(){
return this.toString()+"_thread"
};
net_comcast_sms.Controller.prototype._getComposeViewType=function(){
return this.toString()+"_compose"
};
net_comcast_sms.Controller.prototype.handleKeyAction=function(e){
if(e==ZmKeyMap.CANCEL){
this.popdownChoosers()
}
return ZmController.prototype.handleKeyAction.call(this,e)
};
net_comcast_sms.Controller.prototype._registerOperations=function(){
ZmOperation.registerOp("SMS_NEW",{
text:this.getMsg("actionNew"),tooltip:this.getMsg("actionNewTooltip"),action:new AjxListener(this,this.compose),textPrecedence:11}
);
ZmOperation.registerOp("SMS_FORWARD",{
text:this.getMsg("actionForward"),tooltip:this.getMsg("actionForwardTooltip"),action:new AjxListener(this,this.forward),textPrecedence:10,style:DwtButton.TOGGLE_STYLE}
);
ZmOperation.registerOp("SMS_EDIT",{
text:this.getMsg("actionEdit"),tooltip:this.getMsg("actionEditTooltip"),action:new AjxListener(this,this.edit),textPrecedence:9,style:DwtButton.TOGGLE_STYLE}
);
ZmOperation.registerOp("SMS_REFRESH",{
text:this.getMsg("actionRefresh"),tooltip:this.getMsg("actionRefreshTooltip"),action:new AjxListener(this,this.refresh),textPrecedence:8}
);
ZmOperation.registerOp("SMS_SEND",{
text:this.getMsg("actionSend"),tooltip:this.getMsg("actionSendTooltip"),action:new AjxListener(this,this.send),textPrecedence:7}
);
ZmOperation.registerOp("SMS_COMPOSECANCEL",{
text:this.getMsg("actionCancel"),tooltip:this.getMsg("actionCancelTooltip"),action:new AjxListener(this,this.cancelCompose),textPrecedence:6}
);
ZmOperation.registerOp("SMS_COMPOSEEMOTICON",{
image:"HappyEmoticon",textPrecedence:5}
)
};
net_comcast_sms.Controller.prototype.getToolbarOps=function(){
var e=[ZmOperation.SMS_NEW,ZmOperation.SMS_FORWARD,ZmOperation.SMS_EDIT,ZmOperation.SMS_SEND,ZmOperation.SMS_COMPOSECANCEL,ZmOperation.SMS_COMPOSEEMOTICON,ZmOperation.FILLER];
if(true
/*this._handler.config.comcast_cometEnabled*/
){
e.push(ZmOperation.SMS_REFRESH)
}
e.push(ZmOperation.TEXT);
return e
};
net_comcast_sms.Controller.prototype.getStartToolbarOps=net_comcast_sms.Controller.prototype.getMarketingToolbarOps=net_comcast_sms.Controller.prototype.getThreadToolbarOps=function(){
var e=[ZmOperation.SMS_NEW,ZmOperation.SMS_FORWARD,ZmOperation.SMS_EDIT,ZmOperation.FILLER];
if(true
/*this._handler.config.comcast_cometEnabled*/
){
e.push(ZmOperation.SMS_REFRESH)
}
e.push(ZmOperation.TEXT);
return e
};
net_comcast_sms.Controller.prototype.getComposeToolbarOps=function(){
var e=[ZmOperation.SMS_SEND,ZmOperation.SMS_COMPOSECANCEL,ZmOperation.SMS_COMPOSEEMOTICON,ZmOperation.FILLER];
if(true
/*this._handler.config.comcast_cometEnabled*/
){
e.push(ZmOperation.SMS_REFRESH)
}
e.push(ZmOperation.TEXT);
return e
};
net_comcast_sms.Controller.prototype.getMailComposeToolbarOps=function(){
return[]
};
net_comcast_sms.Controller.prototype.setThread=function(e){
this._listView.setSelection(e)
};
net_comcast_sms.Controller.prototype._handleSelectThread=function(t){
var e=t.item;
if(e=="more"){
this.getMessageStore().moreThreadHeaders()
}else{
this._setThread(e)
}};
net_comcast_sms.Controller.prototype._setThread=function(e){
if(e){
var t=this.getMainView().getThreadView();
this.showThreadList(false,new AjxCallback(this,function(){
this._mainView.getThreadView().getReplyView().setVisible(true);
if(this._thread==e){
t.getThreadView().reset()
}else{
if(this._thread){
this._thread.removeListener("newmessages",this._refreshListener);
this._clearStatus();
this.popdownChoosers()
}
t.set(e);
e.addListener("newmessages",this._refreshListener)
}
this._thread=e;
this._updateRefreshButton();
this._showToolbarItems(this.getThreadToolbarOps(),true);
this._updateToolbarThreadButtons()
}
))
}else{
this._showToolbarItems(this.getThreadToolbarOps(),true);
this._updateToolbarThreadButtons();
this._mainView.getThreadView().getReplyView().setVisible(false)
}};
net_comcast_sms.Controller.prototype.getThread=function(){
return this._thread
};
net_comcast_sms.Controller.prototype.handleNotification=function(){
this.refresh()
};
net_comcast_sms.Controller.prototype.refresh=function(){
var e=this.getMessageStore();
var t=e.getLastUpdateTime();
e.getMessagesSince(t,new AjxCallback(this,this._handleRefresh))
};
net_comcast_sms.Controller.prototype._handleRefresh=function(e){
this._lastPoll=new Date().getTime();
this._updateRefreshButton()
};
net_comcast_sms.Controller.prototype._updateRefreshButton=function(){
if(true
/*this._handler.config.comcast_cometEnabled*/
){
var a=new Date().getTime()-this._lastPoll;
var t=a>60000;
var e=this._toolbar.getButton(ZmOperation.SMS_REFRESH);
e.setEnabled(t);
if(!t){
window.setTimeout(AjxCallback.simpleClosure(this._updateRefreshButton,this),(60000-a+1))
}}};
net_comcast_sms.Controller.prototype.testQuota=function(e,a,t){
if(e||a){
this.getInfo(new AjxCallback(this,this._handleTestQuota,[e,a,t]))
}else{
caboUtil.run(t)
}};
net_comcast_sms.Controller.prototype._handleTestQuota=function(t,n,o,e){
if(e&&!this._hasWarnedQuota){
var a=[];
if(t){
if(e.smstotal>=e.smsmax){
a.push(this.getMsg("quotaInReached"))
}else{
if(!this._hasWarnedInbox&&((e.smstotal/e.smsmax)>=net_comcast_sms.Controller.INCOMING_QUOTA_WARN_LIMIT)){
a.push(this.getMsg("quotaInNear"));
this._hasWarnedInbox=true
}}}
if(n){
if(e.smsquota>=e.smsquotamax){
a.push(this.getMsg("quotaOutReached"))
}else{
if(!this._hasWarnedOutbox&&((e.smsquota/e.smsquotamax)>=net_comcast_sms.Controller.OUTGOING_QUOTA_WARN_LIMIT)){
a.push(this.getMsg("quotaOutNear"));
this._hasWarnedOutbox=true
}}}
if(a.length){
net_comcast_sms.Util.UI.dialog(a.join("<br/>"),this.getMsg("quotaDialogTitle"));
this._hasWarnedQuota=true
}}
caboUtil.run(o)
};
net_comcast_sms.Controller.prototype.getInfo=function(e){
this.getMessageStore().getMessageCounts(new AjxCallback(this,this._handleGetInfo,[e]))
};
net_comcast_sms.Controller.prototype._handleGetInfo=function(t,e){
caboUtil.run(t,e)
};
net_comcast_sms.Controller.prototype._enableToolbarItems=function(t,a,o){
a=a!==false;
var e=[ZmOperation.FILLER];
if(true
/*this._handler.config.comcast_cometEnabled*/
){
e.push(ZmOperation.SMS_REFRESH)
}
e.push(ZmOperation.TEXT);
var n=AjxUtil.complement(t,this._toolbar.opList);
this._toolbar.enable(o?this._toolbar.opList:AjxUtil.complement(e,this._toolbar.opList),a);
this._toolbar.enable(o?n:AjxUtil.complement(e,n),!a)
};
net_comcast_sms.Controller.prototype._getEnabledToolbarItems=function(t){
t=t!==false;
var e=[];
var n=this._toolbar.opList;
for(var o=0,a=n.length;
o<a;
o++){
var s=this._toolbar.getButton(n[o]);
if(s&&s.getEnabled()==t){
e.push(n[o])
}}
return e
};
net_comcast_sms.Controller.prototype._getVisibleToolbarItems=function(n){
n=n!==false;
var e=[];
var o=this._toolbar.opList;
for(var a=0,t=o.length;
a<t;
a++){
var s=this._toolbar.getButton(o[a]);
if(s&&s.getVisible()==n){
e.push(o[a])
}}
return e
};
net_comcast_sms.Controller.prototype._showToolbarItems=function(t,n){
n=n!==false;
var e=AjxUtil.arrayAsHash(t);
for(var o=0;
o<this._toolbar.opList.length;
o++){
var s=this._toolbar.opList[o];
var a=this._toolbar.getButton(s);
if(a){
a.setVisible(e[s]==n)
}}};
net_comcast_sms.Controller.prototype.compose=function(){
this.showCompose();
var t=this.getMainView().getComposeView();
t.reset();
var e=t.add();
this._updateSendButton(false);
e.addUpdateSendListener(new AjxCallback(this,this._updateSendButton));
return e
};
net_comcast_sms.Controller.prototype.forward=function(){
this.setForwarding(!this._forwarding)
};
net_comcast_sms.Controller.prototype.setForwarding=function(e){
this._forwarding=e;
this.getMainView().getThreadView().setForwarding(e);
this.getMainView().showThreadView();
this._updateToolbarThreadButtons()
};
net_comcast_sms.Controller.prototype.edit=function(){
this.setEditing(!this._editing)
};
net_comcast_sms.Controller.prototype.setEditing=function(t){
this._editing=t;
this.getMainView().getThreadView().setEditing(t);
this.getListView().setEditing(t);
this._updateToolbarThreadButtons();
if(!t){
var e=this._thread;
if(e){
for(var n=0,o=e.size();
n<o;
n++){
var s=e.getByIndex(n);
var a=s.getEditStatus();
if(a){
s.setStatus(a)
}}}}};
net_comcast_sms.Controller.prototype._updateToolbarThreadButtons=function(){
var s=this.getToolbar(),n=!!this.getThread(),o=[],t=this._editing,e=this._forwarding;
if(!t&&!e){
o.push(ZmOperation.SMS_NEW)
}
if(!e&&n){
o.push(ZmOperation.SMS_EDIT)
}
if(!t&&n){
o.push(ZmOperation.SMS_FORWARD)
}
this._enableToolbarItems(o,true);
var r=s.getOp(ZmOperation.SMS_EDIT);
r.setText(this.getMsg(t?"actionEditEnd":"actionEdit"));
r.setToolTipContent(this.getMsg(t?"actionEditEndTooltip":"actionEditTooltip"));
var a=s.getOp(ZmOperation.SMS_FORWARD);
a.setText(this.getMsg(e?"actionForwardEnd":"actionForward"));
a.setToolTipContent(this.getMsg(e?"actionForwardEndTooltip":"actionForwardTooltip"))
};
net_comcast_sms.Controller.prototype._updateSendButton=function(t,e,a){
this.getToolbar().enable(ZmOperation.SMS_SEND,t||(e&&a))
};
net_comcast_sms.Controller.prototype._clearStatus=function(){
this._forwarding=true;
this.forward();
this._editing=true;
this.edit()
};
net_comcast_sms.Controller.prototype.doForwardAsText=function(o){
var h=this._forwarding=!this._forwarding;
this.getMainView().getThreadView().setForwarding(h);
this._updateToolbarThreadButtons();
var s=[];
for(var n=0,t=o.length;
n<t;
n++){
var e=o[n];
s[n]=e.mid
}
var r=function(){
var u="<br/>";
var c=[];
for(var f=0,m=o.length;
f<m;
f++){
var p=o[f];
var g;
c[f]=p.body+u+p.getAnnotation()
}
var d=this.compose();
d.setContent(c.join(u+u))
};
var l=new caboUtil.MultiCallback(s,null,new AjxCallback(this,r));
for(var n=0,t=o.length;
n<t;
n++){
var e=o[n];
var a=l.getCallback(e.mid);
if(e.dir==net_comcast_sms.Message.DIR_INCOMING){
e.getContact(a)
}else{
caboUtil.run(a)
}}};
net_comcast_sms.Controller.prototype.doForwardAsEmail=function(o){
var t=this._forwarding=!this._forwarding;
this.getMainView().getThreadView().setForwarding(t);
this._updateToolbarThreadButtons();
var a=(appCtxt.get(ZmSetting.COMPOSE_AS_FORMAT)==ZmSetting.COMPOSE_HTML);
var e=(o&&o.length)?this._getForwardBody(o).join(a?"<br/>":"\n"):"";
var n={
action:ZmId.OP_NEW_MESSAGE,extraBodyText:e,inNewWindow:appCtxt.get(ZmSetting.NEW_WINDOW_COMPOSE)};
this.showMailCompose(n);
this._handler.app.pushView(this.getViewId())
};
net_comcast_sms.Controller.prototype._getForwardBody=function(h){
if(h&&h.length){
var t=[];
for(var n=0,o=h.length;
n<o;
n++){
var r=h[n];
var a,s,e;
s=r.body;
e=r.getAnnotation();
t.push(s,e,"\n")
}
return t
}};
net_comcast_sms.Controller.prototype.composeToContact=function(e){
var t=this;
this._latestView=net_comcast_sms.Controller.VIEW_COMPOSE;
this.show(function(){
var a=t.getMainView().getComposeView();
a.clear();
a.add().addRecipient(e)
}
)
};
net_comcast_sms.Controller.prototype.setCanResizeOverview=function(e){
this._canResizeOverview=e
};
AjxDispatcher.addPackageLoadFunction("Mail",new AjxCallback(function(){
net_comcast_sms.ComposeController=function(a,o){
if(!arguments.length){
return
}
this._handler=o;
var t=appCtxt.getApp(ZmApp.MAIL);
t.getDataSourceCollection();
var n=net_comcast_sms.Util.getObjectProxy(t);
this._parentView=a;
var e=this._view=new DwtComposite({
parent:a,posStyle:Dwt.ABSOLUTE_STYLE}
);
this.viewId="net_comcast_sms_MAIL_"+Dwt.getNextId();
ZmComposeController.call(this,e,n)
};
net_comcast_sms.ComposeController.prototype=net_comcast_sms.Util.getObjectProxy(ZmComposeController.prototype);
net_comcast_sms.ComposeController.prototype.constructor=net_comcast_sms.ComposeController;
net_comcast_sms.ComposeController.prototype.toString=function(){
return"net_comcast_sms.ComposeController"
};
net_comcast_sms.ComposeController.prototype.getView=function(){
return this._view
};
net_comcast_sms.ComposeController.prototype.getMsg=function(){
return this._handler.getMsg.apply(this._handler,arguments)
};
net_comcast_sms.ComposeController.prototype.initComposeView=function(s,t){
if(this._composeView){
return
}
this.sessionId="_sms_"+Dwt.getNextId();
var e=this._container;
var a=this._composeView=new ZmComposeView(e,this,t);
this._initializeToolBar();
var n=this._toolbar;
n.setVisible(false);
if(this._newButton){
this._newButton.setVisible(false)
}
this._view.setSize=function(c,d){
DwtComposite.prototype.setSize.call(this,c,d);
a.setSize(c,d-n.getSize().y)
};
a.setLocation(0,n.getSize().y);
var l=this._view.getSize();
this._view.setSize(l.x,l.y);
if(this._composeView.identitySelect){
this._composeView.identitySelect.addChangeListener(new AjxListener(this,this._identityChangeListener,[true]))
}
var h=this._parentView;
var o=this._view;
var r=this;
this._app.popView=function(d,c){
h._controller.showThreadList(d);
return false
}
};
net_comcast_sms.ComposeController.prototype._cancelCompose=function(){
var t=this._composeView.isDirty();
var e=t||(this._draftType==ZmComposeController.DRAFT_TYPE_AUTO);
if(!e){
this._composeView.reset(true)
}else{
this._composeView.enableInputs(false)
}
this._composeView.reEnableDesignMode();
this._app.popView(!e)
};
net_comcast_sms.ComposeController.prototype._setComposeTabGroup=function(){
ZmComposeController.prototype._setComposeTabGroup.apply(this,arguments);
var t=this._tabGroup;
var e=t.__parent;
if(!e.contains(t)){
e.addMember(t)
}};
net_comcast_sms.ComposeController.prototype._getOptionsMenu=function(e){
return this._toolbar.getButton(ZmOperation.COMPOSE_OPTIONS).getMenu()||this._optionsMenu[e]
};
net_comcast_sms.ComposeController.prototype._getSignatureButton=function(){
var e=this._getOptionsMenu(ZmOperation.ADD_SIGNATURE);
return e&&e.getItemById(ZmPopupMenu.MENU_ITEM_ID_KEY,ZmOperation.ADD_SIGNATURE)
};
net_comcast_sms.ComposeController.prototype._switchInclude=function(o){
var t=this._curIncOptions.what;
var e=this._optionsMenu[this._action];
if(o==ZmOperation.USE_PREFIX||o==ZmOperation.INCLUDE_HEADERS){
var n=e.getOp(o);
if(n){
if(o==ZmOperation.USE_PREFIX){
this._curIncOptions.prefix=n.getChecked()
}else{
this._curIncOptions.headers=n.getChecked()
}}}else{
if(ZmComposeController.INC_MAP[o]){
this._curIncOptions.what=ZmComposeController.INC_MAP[o]
}}
var h=(t==ZmSetting.INC_BODY||t==ZmSetting.INC_SMART);
var a=this._composeView;
var s="";
if(o!=ZmOperation.FORMAT_HTML&&o!=ZmOperation.FORMAT_TEXT){
if(a._preface||!h){
var c=this._getBodyContent();
if(a._preface){
var l=c.indexOf(a._preface);
if(l>0){
s=c.substr(0,l)
}}else{
s=c
}}
if(a._composeMode==DwtHtmlEditor.TEXT){
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
a.getHtmlEditor().moveCaretToTop()
}
),200)
}}else{
if(!this._msg){
s=this._getBodyContent()
}}
var r=this._curIncOptions.what;
if(this._action==ZmOperation.FORWARD_INLINE&&r==ZmSetting.INC_ATTACH){
this._action=ZmOperation.FORWARD_ATT
}
if(this._action==ZmOperation.FORWARD_ATT&&r!=ZmSetting.INC_ATTACH){
this._action=ZmOperation.FORWARD_INLINE
}
a.resetBody(this._action,this._msg,s)
}
}
));
caboUtil.onload("caboUtil.Preferences",function(){
net_comcast_sms.PrefController=function(o,e,t,n,s,a){
if(!arguments.length){
return
}
caboUtil.Preferences.Controller.call(this,o,a._container,t,n,s,a)
};
net_comcast_sms.PrefController.prototype=new caboUtil.Preferences.Controller;
net_comcast_sms.PrefController.prototype.constructor=net_comcast_sms.PrefController;
net_comcast_sms.PrefController.prototype.toString=function(){
return"net_comcast_sms.PrefController"
};
net_comcast_sms.PrefController.prototype.__getPrefsView=function(){
return new net_comcast_sms.PrefsView(this._basePrefsView,this._section,this)
};
net_comcast_sms.PrefController.prototype.savePref=function(a,t){
var e=caboUtil.MultiCallback.simple(2,null,a,true);
caboUtil.Preferences.Controller.prototype.savePref.call(this,e.getCallback(0),t);
this._handler.saveSettings(e.getCallback(1))
}
}
);
net_comcast_sms.LightBox=function(t){
if(!arguments.length){
return
}
if(!t.className){
t.className="LightBox DwtDialog"
}
if(!t.mode){
t.mode=DwtBaseDialog.MODELESS
}
DwtBaseDialog.call(this,t);
this._noBorder=t.noBorder;
if(t.noBorder){
this.addClassName("NoBorder")
}
if(!net_comcast_sms.LightBox.background){
var e=net_comcast_sms.LightBox.background=document.createElement("div");
e.className="LightBoxBackground";
Dwt.setVisible(e,false);
Dwt.setHandler(e,"onclick",net_comcast_sms.LightBox.popdownAll);
document.body.appendChild(e)
}
this._background=net_comcast_sms.LightBox.background;
if(this._closeEl){
Dwt.setHandler(this._closeEl,DwtEvent.ONCLICK,AjxCallback.simpleClosure(this.popdown,this))
}
net_comcast_sms.LightBox.all.push(this);
this.reparentHtmlElement(document.body)
};
net_comcast_sms.LightBox.prototype=new DwtBaseDialog;
net_comcast_sms.LightBox.prototype.constructor=net_comcast_sms.LightBox;
net_comcast_sms.LightBox.prototype.toString=function(){
return"net_comcast_sms.LightBox"
};
net_comcast_sms.LightBox.all=[];
net_comcast_sms.LightBox.prototype.popup=function(){
Dwt.setVisible(this._background,true);
DwtBaseDialog.prototype.popup.apply(this,arguments)
};
net_comcast_sms.LightBox.prototype.popdown=function(){
Dwt.setVisible(this._background,false);
DwtBaseDialog.prototype.popdown.apply(this,arguments)
};
net_comcast_sms.LightBox.popdownAll=function(){
var t=net_comcast_sms.LightBox.all;
for(var e=0;
e<t.length;
e++){
t[e].popdown()
}};
net_comcast_sms.LightBox.prototype._createHtmlFromTemplate=function(t,a){
a.dragId=this._dragHandleId;
a.title=this._title;
a.icon="";
a.closeIcon1="ImgClose";
a.closeIcon2="";
a.controlsTemplateId=this.CONTROLS_TEMPLATE;
DwtComposite.prototype._createHtmlFromTemplate.call(this,t,a);
this._titleBarEl=Dwt.byId(a.id+"_titlebar");
this._titleEl=Dwt.byId(a.id+"_title");
this._contentEl=Dwt.byId(a.id+"_content");
var e=caboUtil.Dom.byClass(a.closeIcon1,Dwt.byId(this._dragHandleId));
if(e&&e.length){
this._closeEl=e[0]
}
this.setContent(this._getContentHtml())
};
net_comcast_sms.LightBox.prototype.setView=function(t){
if(this._view){
this._tabGroup.removeMember(this._view.getTabGroupMember())
}
this.reset();
if(t){
var e=this._getContentDiv();
Dwt.removeChildren(e);
e.appendChild(t.getHtmlElement())
}
this._view=t;
this._tabGroup.addMember(t.getTabGroupMember())
};
net_comcast_sms.IframeLightBox=function(t){
if(!arguments.length){
return
}
net_comcast_sms.LightBox.call(this,{
parent:t.parent,controller:t.controller,noBorder:true}
);
var e=new DwtComposite({
parent:this}
);
this._iframe=new DwtIframe({
parent:e,html:"",className:"SmsIframe"}
);
this.setView(e)
};
net_comcast_sms.IframeLightBox.prototype=new net_comcast_sms.LightBox;
net_comcast_sms.IframeLightBox.prototype.constructor=net_comcast_sms.IframeLightBox;
net_comcast_sms.IframeLightBox.prototype.toString=function(){
return"net_comcast_sms.IframeLightBox"
};
net_comcast_sms.IframeLightBox.prototype.getSrc=function(){
return this._src
};
net_comcast_sms.IframeLightBox.prototype.setSrc=function(e){
this._src=e;
this._iframe.setSrc(e)
};
net_comcast_sms.IframeLightBox.prototype.setSize=function(e,t){
this._iframe.setSize(e,t)
};
net_comcast_sms.IframeLightBox.close=function(e){
net_comcast_sms.LightBox.popdownAll();
if(e){
if(e.msg){
appCtxt.setStatusMsg({
msg:e.msg,level:e.level||null}
)
}}};
net_comcast_sms.MainView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"DwtComposite",posStyle:Dwt.ABSOLUTE_STYLE,noMaximize:false,controller:e.controller}
);
this._threadViewList=new net_comcast_sms.ThreadViewList({
parent:this,controller:this._controller}
);
this._composeViewList=new net_comcast_sms.ComposeViewList({
parent:this,controller:this._controller}
);
this._provisioningView=new net_comcast_sms.ProvisioningView({
parent:this,controller:this._controller}
);
this._errorView=new net_comcast_sms.ErrorView({
parent:this,controller:this._controller}
);
this._iframeView=new DwtIframe({
parent:this,html:"",className:"SmsIframe"}
);
this._loadingView=this.getLoadingView();
this._hideViews()
};
net_comcast_sms.MainView.prototype=new DwtComposite;
net_comcast_sms.MainView.prototype.constructor=net_comcast_sms.MainView;
net_comcast_sms.MainView.prototype.getTitle=function(){
return ZmMsg.zimbraTitle+": "+this._controller.getMsg("xtmTitle")
};
net_comcast_sms.MainView.prototype.getThreadView=function(){
return this._threadViewList
};
net_comcast_sms.MainView.prototype.getComposeView=function(){
return this._composeViewList
};
net_comcast_sms.MainView.prototype.getMailComposeController=function(){
return this._composeListView._mailController
};
net_comcast_sms.MainView.prototype.getController=function(){
return this._controller
};
net_comcast_sms.MainView.prototype.getProvisioningView=function(){
return this._provisioningView
};
net_comcast_sms.MainView.prototype._hideViews=function(){
this._provisioningView.setVisible(false);
this._composeViewList.setVisible(false);
this._threadViewList.setVisible(false);
this._errorView.setVisible(false)
};
net_comcast_sms.MainView.prototype.showIframeView=function(e){};
net_comcast_sms.MainView.prototype.showThreadView=function(){
this._hideViews();
this._threadViewList.setVisible(true)
};
net_comcast_sms.MainView.prototype.showComposeView=function(){
this._hideViews();
this._composeViewList.setVisible(true)
};
net_comcast_sms.MainView.prototype.showErrorView=function(t,e){
this._hideViews();
this._errorView.setVisible(true);
if(t){
this._errorView.setMsg(t)
}
if(e){
this._errorView.setTitle(e)
}};
net_comcast_sms.MainView.prototype.showProvisioningView=function(e){
this._hideViews();
this._provisioningView.setVisible(true);
if(e){
this._provisioningView.setLoadedCallback(e)
}};
net_comcast_sms.MainView.prototype.showMailComposeView=function(t){
this._hideViews();
this._composeViewList.setVisible(true);
this._composeViewList.clear();
var e=this._composeViewList.addMail(t);
return e
};
net_comcast_sms.MainView.prototype.setSize=function(e,t){
this._threadViewList.setSize(e,t);
this._composeViewList.setSize(e,t);
this._provisioningView.setSize(e,t);
this._loadingView.setSize(e,t);
DwtComposite.prototype.setSize.call(this,e,t)
};
net_comcast_sms.MainView.prototype.getTabGroupMember=function(){
if(!this._tabGroup){
this._tabGroup=new DwtTabGroup(this.toString());
this._tabGroup.addMember(this._composeViewList.getTabGroupMember());
this._tabGroup.addMember(this._threadViewList.getTabGroupMember());
this._tabGroup.toString=function(){
return"SMS Mainview"
}
}
return this._tabGroup
};
net_comcast_sms.MainView.prototype.showCustomView=function(e){};
net_comcast_sms.MainView.prototype.getLoadingView=function(){
if(!this._loadingView){
this._loadingView=new DwtControl({
parent:this,className:"DwtListView",posStyle:Dwt.ABSOLUTE_STYLE}
);
this._loadingView.setSize("100%","100%");
var e=this._loadingView.getHtmlElement();
e.innerHTML=AjxTemplate.expand("share.App#Loading",this._htmlElId);
e.style.top="0px";
e.style.zIndex="300"
}
return this._loadingView
};
net_comcast_sms.ThreadListView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
ZmListView.call(this,{
view:"net_comcast_sms_THREADLIST",parent:e.parent,className:"ThreadListView DwtListView",posStyle:Dwt.STATIC_STYLE,headerList:this._getHeaderList(),noMaximize:false,controller:e.controller}
);
this._statusCallbacks={};
this._messageCallbacks={}
};
net_comcast_sms.ThreadListView.prototype=new ZmListView;
net_comcast_sms.ThreadListView.prototype.constructor=net_comcast_sms.ThreadListView;
net_comcast_sms.ThreadListView.prototype.toString=function(){
return"net_comcast_sms.ThreadListView"
};
net_comcast_sms.ThreadListView.DEFAULT_SIZE=300;
net_comcast_sms.ThreadListView.prototype.set=function(n,a){
if(this._list){
for(var r=0,s=this._list.size();
r<s;
r++){
var h=this._list.get(r);
if(!this._isMore(h)){
var t=this._messageCallbacks[h.getID()];
if(t){
h.removeListener("messages",t);
h.removeListener("status",t)
}}}}
for(var r=0,s=n.size();
r<s;
r++){
var h=n.get(r),t=this._messageCallbacks[h.getID()]=new AjxCallback(this,this._updateThread,[h]);
h.addListener("messages",t);
h.addListener("status",t)
}
if(n){
n=AjxVector.fromArray(this._controller.getMessageStore().getNonDeletedThreads(n))
}
var o=this._controller.getMessageStore();
if(o&&o.hasMoreThreads()){
n.add("more")
}
a=a||(this._headerIdHash&&this._headerIdHash[this._currentColId]&&this._headerIdHash[this._currentColId]._field)||ZmItem.F_STATUS;
if(a){
this._sortItems(n,a,this._bSortAsc)
}
var e=this._parentEl.scrollTop;
ZmListView.prototype.set.call(this,n,a);
this._focus();
this._parentEl.scrollTop=e
};
net_comcast_sms.ThreadListView.prototype.reset=function(){
var t=this._controller.getMessageStore().getThreads(),e=AjxVector.fromArray(AjxUtil.values(t));
this.set(e)
};
net_comcast_sms.ThreadListView.prototype._getHeaderList=function(e){
var t=[];
t.push(new DwtListHeaderItem({
field:ZmItem.F_STATUS,icon:"ThreadStatus",width:40,resizeable:false,sortable:true,align:"center",noSortArrow:true}
));
t.push(new DwtListHeaderItem({
field:ZmItem.F_FROM,text:ZmMsg.sender,resizeable:false,sortable:true,noRemove:true}
));
t.push(new DwtListHeaderItem({
field:ZmItem.F_DATE,text:ZmMsg.date,width:60,resizeable:true,sortable:true}
));
return t
};
net_comcast_sms.ThreadListView.prototype._getCellId=function(e,t){
return"sms_list_"+((e instanceof net_comcast_sms.Thread)?e.getTN():"more")+"_"+t
};
net_comcast_sms.ThreadListView.prototype._getItemId=function(e,t){
return DwtId.getListViewItemId(DwtId.WIDGET_ITEM,this._view,(e instanceof net_comcast_sms.Thread)?e.getTN():"more")
};
net_comcast_sms.ThreadListView.prototype._getCellContents=function(h,r,l,s,n,o){
var a;
if(l instanceof net_comcast_sms.Thread){
var e=this._getFieldId(l,s),t=this._getCellId(l,s);
switch(s){
case ZmItem.F_STATUS:a=this.getStatusCellContents(t,l);
break;
case ZmItem.F_FROM:a=this.getBodyCellContents(t,l);
break;
case ZmItem.F_DATE:a=this.getDateCellContents(t,l);
break
}}else{
if(this._isMore(l)){
a="<div class='MoreThreadsCell'>"+this._controller.getMsg("actionMore")+"</div><div class='DwtWait32Icon MoreWaitCell'></div>"
}}
if(a){
h[r++]=a
}
return r
};
net_comcast_sms.ThreadListView.prototype._getCell=function(m,u,p,c,o,a){
if(this._isMore(p)){
if(!o){
var t=this._getCellId(p,c,a),d=t?[" id=","'",t,"'"].join(""):"",r=(" width='100%'"),h=this._getCellClass(p,c,a),n=h?[" class=",h].join(""):"",f=this._getCellAlign(o,a),l=f?[" align=",f].join(""):"",e=(this._getCellAttrText(p,c,a))||"",s=[d,r,n,l,e].join(" ");
m[u++]="<td";
m[u++]=s?(" "+s):"";
m[u++]=">";
u=this._getCellContents(m,u,p,c,o,a);
m[u++]="</td>"
}
return u
}else{
return ZmListView.prototype._getCell.apply(this,arguments)
}};
net_comcast_sms.ThreadListView.prototype._getDivClass=function(a,t,o){
var e=DwtListView.prototype._getDivClass.apply(this,arguments);
return this._isMore(t)?e+" MoreThreadsRow":e
};
net_comcast_sms.ThreadListView.prototype._resetList=function(){
ZmListView.prototype._resetList.call(this);
this._statusCallbacks={}
};
net_comcast_sms.ThreadListView.prototype._isMore=function(e){
return e=="more"
};
net_comcast_sms.ThreadListView.prototype.getMinSize=function(){
return 200
};
net_comcast_sms.ThreadListView.prototype._sortColumn=function(e,t){
if(this._list){
if(this._sortItems(this._list,e._field,t)){
this._renderList(this._list)
}}
this._controller.popdownChoosers()
};
net_comcast_sms.ThreadListView.prototype._sortThreads=function(t,e,a){
if(e){
t.sort(e);
if(!a){
t.reverse()
}}};
net_comcast_sms.ThreadListView.prototype._sortItems=function(t,a,o){
var n=t.remove("more");
var e=net_comcast_sms.ThreadListView.COMPARATOR[a];
this._sortThreads(t,e,o);
if(n){
t.add("more")
}
return !!e
};
net_comcast_sms.ThreadListView.prototype._getNoResultsMessage=function(){
return this._controller.getMsg("threadNone")
};
net_comcast_sms.ThreadListView.prototype.getStatusCellContents=function(t,e){
var a=new AjxCallback(this,this._updateStatusCell,[t,e]);
if(e.isLoaded()){
contents=a.run()
}else{
contents=a.run(true);
e.refresh(a)
}
if(!this._statusCallbacks[t]){
this._statusCallbacks[t]=a;
e.addListener("status",a)
}
return contents
};
net_comcast_sms.ThreadListView.prototype.redrawItem=function(e){
DwtListView.prototype.redrawItem.apply(this,arguments)
};
net_comcast_sms.ThreadListView.prototype._updateStatusCell=function(n,t,s){
if(n&&t){
var a=t.getUnreadMessageCount(),e=Dwt.byId(n),o=["<div class='",(a?"MessageUnreadBalloon":"MessageReadBalloon"),"'>",(s!==true&&a||""),"</div>"].join("");
if(e){
Dwt.setInnerHtml(e,o)
}
return o
}};
net_comcast_sms.ThreadListView.prototype.getBodyCellContents=function(a,t){
if(t instanceof net_comcast_sms.Thread){
var e=t.getContact(new AjxCallback(this,this._updateBodyCell,[a,t]));
return this._updateBodyCell(a,t,e)
}
return""
};
net_comcast_sms.ThreadListView.prototype._updateBodyCell=function(n,a,t){
var s=a.getNewestNonDeleted();
if(s){
var o=t.name||null;
tn=net_comcast_sms.Util.TN.pretty(t.tn),field=t.field,contents=["<div class='MessageSender'>",o?(o+"<br/>"):"",tn,field?(" ("+ZmMsg["AB_FIELD_"+field]+")"):"","</div>","<div class='MessageBody'>",AjxStringUtil.clipByLength(s.getBody(),30),"</div>"].join("");
if(n){
var e=Dwt.byId(n);
if(e){
Dwt.setInnerHtml(e,contents)
}}
return contents
}
return""
};
net_comcast_sms.ThreadListView.prototype.setEditing=function(t){
this._editing=t;
for(var o=0,a=this._list.size();
o<a;
o++){
var e=this._list.get(o),n=this._getCellId(e,ZmItem.F_FROM);
this.getBodyCellContents(n,e)
}};
net_comcast_sms.ThreadListView.prototype.getDateCellContents=function(t,e){
var a=e.getNewestNonDeleted();
return["<div class='MessageDate'>",a.time&&net_comcast_sms.Util.Date.computeDateStr(new Date(a.time)).replace(/\n/g,"<br/>")||"","</div>"].join("")
};
net_comcast_sms.ThreadListView.prototype._updateThread=function(e){
if(!e.getNonDeletedCount()){
if(this._controller.getThread()==e){
this._selectNextItem(true,false,true,e)
}
this.removeItem(e)
}else{
var t=this.getSelection();
if(this._list.indexOf(e)==-1){
this.addItem(e)
}
this.reset();
this.setSelectedItems(t)
}};
net_comcast_sms.ThreadListView.prototype._selectNextItem=function(o,t,s,e){
if(!this.size()){
return
}
var a=this._getElFromItem(e),n=(a)?this._getSiblingElement(a,o):this._parentEl.firstChild;
this._scrollList(n);
this._emulateSingleClick({
target:n,button:DwtMouseEvent.LEFT,shiftKey:t,kbNavEvent:s}
)
};
net_comcast_sms.ThreadListView.senderComparator=function(t,e){
return net_comcast_sms.Util.plainComparator(t.getTN(),e.getTN())
};
net_comcast_sms.ThreadListView.COMPARATOR={};
net_comcast_sms.ThreadListView.COMPARATOR[ZmItem.F_STATUS]=net_comcast_sms.Thread.statusComparator;
net_comcast_sms.ThreadListView.COMPARATOR[ZmItem.F_FROM]=net_comcast_sms.ThreadListView.senderComparator;
net_comcast_sms.ThreadListView.COMPARATOR[ZmItem.F_DATE]=net_comcast_sms.Thread.dateComparator;
net_comcast_sms.ThreadView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"ThreadView DwtComposite",posStyle:Dwt.STATIC_STYLE,controller:e.controller}
);
this.setScrollStyle(Dwt.SCROLL);
this._messageViews=[];
this._messageListener=new AjxCallback(this,this.updateMessages);
this._createHtml();
this._initialize()
};
net_comcast_sms.ThreadView.prototype=new DwtComposite;
net_comcast_sms.ThreadView.prototype.constructor=net_comcast_sms.ThreadView;
net_comcast_sms.ThreadView.prototype.toString=function(){
return"net_comcast_sms.ThreadView"
};
net_comcast_sms.ThreadView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#ThreadView";
net_comcast_sms.ThreadView.prototype._createHtml=function(){
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId()}
)
};
net_comcast_sms.ThreadView.prototype._initialize=function(){
var a=this.getHTMLElId();
var e=this._contactLabel=new DwtLabel({
parent:this,className:"ThreadLabel DwtLabel overviewHeader"}
);
e.replaceElement(a+"_header");
e.setVisible(false);
this._messageArea=Dwt.byId(a+"_thread");
var t=this._moreButton=new DwtButton({
parent:this,className:"ThreadMore ZButton"}
);
t.replaceElement(a+"_more");
t.addSelectionListener(new AjxListener(this,this.getMore));
t.setText(this._controller.getMsg("threadMoreButton"));
t.setVisible(false)
};
net_comcast_sms.ThreadView.prototype.dispose=function(){
this.clear(true);
DwtComposite.prototype.dispose.call(this)
};
net_comcast_sms.ThreadView.prototype.setSize=function(e,t){
DwtComposite.prototype.setSize.call(this,e,t)
};
net_comcast_sms.ThreadView.prototype.setVisible=function(a){
DwtComposite.prototype.setVisible.call(this,a);
if(this._pendingScroll){
var t=this._pendingScroll,e=this.getHtmlElement();
setTimeout(function(){
net_comcast_sms.Util.DOM.scrollIntoView(t,e)
}
,1);
this._pendingScroll=null
}};
net_comcast_sms.ThreadView.prototype.getMsg=function(){
return this._controller.getMsg.apply(this._controller,arguments)
};
net_comcast_sms.ThreadView.prototype.setContact=function(e){
var t=this._controller.getMsg("threadHeader",[e.name?(e.name+" "):"",net_comcast_sms.Util.TN.pretty(e.tn),e.field?(" ("+ZmMsg["AB_FIELD_"+e.field]+")"):""].join(""));
this._contactLabel.setText(t)
};
net_comcast_sms.ThreadView.prototype.set=function(a){
if(a){
this._moreButton.setVisible(false);
var t=a.getTN();
var e=a.getContact(new AjxCallback(this,this.setContact));
this.setContact(e);
if(a!=this._thread){
this._sorted=false;
this.clear(false);
this._thread=a;
this._thread.addListener("messages",this._messageListener);
this._thread.addListener("status",this._messageListener)
}
this._updateList(a);
var o=this;
setTimeout(function(){
o._moreButton.setVisible(true);
o._updateMoreButton()
}
,0)
}
this._contactLabel.setVisible(!!a)
};
net_comcast_sms.ThreadView.prototype.reset=function(){
this.set(this._thread);
this.setEditing(this._editing);
this.setForwarding(this._forwarding)
};
net_comcast_sms.ThreadView.prototype._updateList=function(e){
if(e instanceof net_comcast_sms.Thread){
this.setMessages(e.getMessages().getArray())
}};
net_comcast_sms.ThreadView.prototype.addMessage=function(a){
if(a.status!==net_comcast_sms.Message.STATUS_DELETED&&!this.getMessageView(a)){
var e=new net_comcast_sms.MessageView({
parent:this,controller:this._controller,message:a}
);
var t=this._messageViews;
var o;
t.push(e);
if(t.length>1){
t.sort(function(s,n){
return net_comcast_sms.Message.dateComparator(s.getMessage(),n.getMessage())
}
);
o=AjxUtil.indexOf(t,e)
}else{
o=0
}
e.reparentHtmlElement(this._messageArea,o);
a.setRead()
}};
net_comcast_sms.ThreadView.prototype.setMessages=function(a){
var t=this._messageViews;
var r=t.length&&t[t.length-1];
for(var n=0;
n<a.length;
n++){
var l=a[n];
var h=this.getMessageView(l);
if(!h){
h=new net_comcast_sms.MessageView({
parent:this,controller:this._controller,message:l}
);
t.push(h)
}
l.setRead()
}
t.sort(function(d,c){
return net_comcast_sms.Message.dateComparator(d.getMessage(),c.getMessage())
}
);
for(var n=0;
n<t.length;
n++){
t[n].reparentHtmlElement(this._messageArea,n)
}
var s=t.length&&t[t.length-1];
if(s&&r!=s){
var e=this.getHtmlElement(),o=s.getHtmlElement();
if(this.getVisible()&&this.parent.getVisible()){
setTimeout(function(){
net_comcast_sms.Util.DOM.scrollIntoView(o,e)
}
,1)
}else{
this._pendingScroll=o
}}};
net_comcast_sms.ThreadView.prototype.getMessageView=function(o){
var e=this._messageViews;
for(var a=0,t=e.length;
a<t;
a++){
if(e[a].getMessage()==o){
return e[a]
}}
return null
};
net_comcast_sms.ThreadView.prototype.clear=function(e){
if(this._thread){
this._thread.removeListener("messages",this._messageListener);
this._thread.removeListener("status",this._messageListener)
}
while(this._messageViews.length){
this.removeChild(this._messageViews.pop())
}
this._controller.setEditing(false);
if(e){
this.parent.set(null)
}};
net_comcast_sms.ThreadView.prototype.getMore=function(e){
this._thread.more(new AjxCallback(this,this._updateMoreButton,[e]))
};
net_comcast_sms.ThreadView.prototype._updateMoreButton=function(e){
this._moreButton.setVisible(this._thread.hasMore());
caboUtil.run(e)
};
net_comcast_sms.ThreadView.prototype.setEditing=function(e){
this._editing=e;
for(var a=0,t=this._messageViews.length;
a<t;
a++){
this._messageViews[a].setEditing(e)
}};
net_comcast_sms.ThreadView.prototype.setForwarding=function(e){
this._forwarding=e;
for(var a=0,t=this._messageViews.length;
a<t;
a++){
this._messageViews[a].setForwarding(e)
}};
net_comcast_sms.ThreadView.prototype.getMessagesForForwarding=function(){
var o=[];
for(var a=0,t=this._messageViews.length;
a<t;
a++){
var e=this._messageViews[a];
if(e.isSelectedForForwarding()){
o.push(e.getMessage())
}}
return o
};
net_comcast_sms.ThreadView.prototype.updateMessages=function(){
var e=this._thread.getNonDeletedCount();
if(!e){
this.clear(true)
}else{
if(e!=this._messageViews.length){
this.reset()
}}};
net_comcast_sms.ThreadViewList=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"ThreadViewList DwtComposite",posStyle:Dwt.ABSOLUTE_STYLE,noMaximize:false,controller:e.controller}
);
this.setScrollStyle(DwtControl.CLIP);
this._createHtml();
this._initialize()
};
net_comcast_sms.ThreadViewList.prototype=new DwtComposite;
net_comcast_sms.ThreadViewList.prototype.constructor=net_comcast_sms.ThreadViewList;
net_comcast_sms.ThreadViewList.prototype.toString=function(){
return"net_comcast_sms.ThreadViewList"
};
net_comcast_sms.ThreadViewList.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#ThreadViewList";
net_comcast_sms.ThreadViewList.prototype._createHtml=function(){
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId()}
)
};
net_comcast_sms.ThreadViewList.prototype._initialize=function(){
var s=this.getHTMLElId();
var n=this._noneView=new DwtControl({
parent:this}
);
n.replaceElement(s+"_none");
n.setContent(AjxTemplate.expand("dwt.Widgets#DwtListView-NoResults",{
message:this._controller.getMsg("threadPleaseSelect")}
));
n.setVisible(true);
var a=this._threadView=new net_comcast_sms.ThreadView({
parent:this,controller:this._controller}
);
a.replaceElement(s+"_thread");
a.setVisible(false);
var o=this._replyView=new net_comcast_sms.ReplyView({
parent:this,controller:this._controller}
);
o.replaceElement(s+"_reply");
o.setEnabled(false);
var t=this._deleteThreadView=new net_comcast_sms.DeleteThreadView({
parent:this,controller:this._controller}
);
t.replaceElement(s+"_deleteThread");
var e=this._forwardView=new net_comcast_sms.ForwardView({
parent:this,controller:this._controller}
);
e.replaceElement(s+"_forward");
this.setEditing(false);
this.setForwarding(false);
this.setVisible(false)
};
net_comcast_sms.ThreadViewList.prototype.setSize=function(e,o){
DwtComposite.prototype.setSize.call(this,e,o);
var a=(this._replyView.getVisible()&&this._replyView)||(this._deleteThreadView.getVisible()&&this._deleteThreadView)||(this._forwardView.getVisible()&&this._forwardView);
var t=o-(a&&a.getSize().y||0);
this._threadView.setSize(e,t)
};
net_comcast_sms.ThreadViewList.prototype.setVisible=function(e){
DwtComposite.prototype.setVisible.call(this,e);
this._threadView.setVisible(e);
if(e){
net_comcast_sms.Util.DOM.resetSize(this)
}};
net_comcast_sms.ThreadViewList.prototype.clear=function(){
this._threadView.clear();
this.set(null)
};
net_comcast_sms.ThreadViewList.prototype.set=function(e){
var t=!!e;
this._noneView.setVisible(!t);
this._threadView.setVisible(!!t);
this._threadView.set(e);
this._deleteThreadView.set(e);
this._thread=e;
net_comcast_sms.Util.DOM.resetSize(this);
this._replyView.setEnabled(t);
this._threadView.setVisible(t)
};
net_comcast_sms.ThreadViewList.prototype.getThreadView=function(){
return this._threadView
};
net_comcast_sms.ThreadViewList.prototype.setEditing=function(e){
this._editing=e;
this._threadView.setEditing(e);
this._replyView.setVisible(!e&&!this._forwarding);
this._deleteThreadView.setVisible(e&&!this._forwarding);
this._deleteThreadView.set();
this._forwardView.setVisible(!e&&this._forwarding);
if(!e&&this._forwarding){
this._forwardView.setThread(this._thread)
}
net_comcast_sms.Util.DOM.resetSize(this)
};
net_comcast_sms.ThreadViewList.prototype.setForwarding=function(e){
this._forwarding=e;
this._threadView.setForwarding(e);
this._replyView.setVisible(!e&&!this._editing);
this._deleteThreadView.setVisible(!e&&this._editing);
this._forwardView.setVisible(e&&!this._editing);
if(e&&!this._editing){
this._forwardView.setThread(this._thread)
}
net_comcast_sms.Util.DOM.resetSize(this)
};
net_comcast_sms.ThreadViewList.prototype.popdownChoosers=function(){
this._replyView.popdownChoosers()
};
net_comcast_sms.ThreadViewList.prototype.getReplyView=function(){
return this._replyView
};
net_comcast_sms.MessageView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"MessageView DwtComposite",controller:e.controller}
);
this._message=e.message;
this._noImage=this._controller.getHandler().getResource("img/none.png");
this._statusListener=new AjxCallback(this,this.updateStatus);
this._createHtml();
this._initialize();
this._setMouseEvents();
this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
this._updateStatusCallback=new AjxCallback(this,this.updateStatus)
};
net_comcast_sms.MessageView.prototype=new DwtComposite;
net_comcast_sms.MessageView.prototype.constructor=net_comcast_sms.MessageView;
net_comcast_sms.MessageView.prototype.toString=function(){
return"net_comcast_sms.MessageView"
};
net_comcast_sms.MessageView.prototype.TEMPLATE={};
net_comcast_sms.MessageView.prototype.TEMPLATE[0]=net_comcast_sms.MessageView.prototype.TEMPLATE[net_comcast_sms.Message.DIR_INCOMING]=net_comcast_sms.TEMPLATE_BASE+"#MessageViewIncoming";
net_comcast_sms.MessageView.prototype.TEMPLATE[net_comcast_sms.Message.DIR_OUTGOING]=net_comcast_sms.TEMPLATE_BASE+"#MessageViewOutgoing";
net_comcast_sms.MessageView.prototype.NO_CONTACT_IMAGE=(window.ZmEditContactViewImage&&ZmEditContactViewImage.NO_IMAGE_URL)||(appContextPath+"/img/large/ImgPerson_48.png");
net_comcast_sms.MessageView.prototype.NO_CONTACT_IMAGE_CLASS="ImgPerson_48";
net_comcast_sms.MessageView.prototype._createHtml=function(){
if(!net_comcast_sms.MessageView.LOCKED_HTML){
net_comcast_sms.MessageView.LOCKED_HTML="<img src='"+this._controller.getHandler().getResource("img/locked.png")+"'/>"
}
this._createHtmlFromTemplate(this.TEMPLATE[this._message.dir]||this.TEMPLATE[0],{
id:this.getHTMLElId(),msg:this._controller.getHandler().getMsgObj()}
)
};
net_comcast_sms.MessageView.prototype._initialize=function(){
var e=this.getHTMLElId();
var a=this._message;
var h=this._controller;
this._img=Dwt.byId(e+"_image");
if(a.dir==net_comcast_sms.Message.DIR_INCOMING){
net_comcast_sms.Util.Contact.getByTN(a.tn,new AjxCallback(this,this._setContactImage))
}else{
this._clearContactImage()
}
this._body=Dwt.byId(e+"_body");
this._body.innerHTML=this.replaceEmoticons(a.getBody());
this._balloon=Dwt.byId(e+"_balloon");
this._annotation=Dwt.byId(e+"_annotation");
this._lock=Dwt.byId(e+"_lock");
var n=this._lockButton=new DwtButton({
parent:this}
);
n.replaceElement(e+"_button_lock",true,true);
n.setText(h.getMsg("actionLock"));
n.addSelectionListener(new AjxListener(this,this.lock,[true]));
var t=this._unlockButton=new DwtButton({
parent:this}
);
t.replaceElement(e+"_button_unlock",true,true);
t.setText(h.getMsg("actionUnlock"));
t.addSelectionListener(new AjxListener(this,this.unlock,[true]));
var l=this._deleteButton=new DwtButton({
parent:this}
);
l.replaceElement(e+"_button_delete",true,true);
l.setText(h.getMsg("actionDelete"));
l.addSelectionListener(new AjxListener(this,this.remove,[true]));
var s=this._restoreButton=new DwtButton({
parent:this}
);
s.replaceElement(e+"_button_restore",true,true);
s.setText(h.getMsg("actionRestore"));
s.addSelectionListener(new AjxListener(this,this.restore,[true]));
var r=this._forwardCheckbox=new DwtCheckbox({
parent:this}
);
r.replaceElement(e+"_check_forward",true,true);
r.addSelectionListener(new AjxListener(this,this._handleForwardSelect));
var o=this._processing=new DwtLabel({
parent:this}
);
o.replaceElement(e+"_processing");
o.setText(h.getMsg("processing"));
var d=this._restoring=new DwtLabel({
parent:this}
);
d.replaceElement(e+"_restoring");
d.setText(h.getMsg("processing"));
this._messageDiv=Dwt.byId(e+"_message");
this._restoreDiv=Dwt.byId(e+"_restore");
this.setVisible(false);
var c=this;
setTimeout(function(){
c.updateStatus();
c.setVisible(true)
}
,0);
a.addListener("status",this._statusListener)
};
net_comcast_sms.MessageView.prototype.dispose=function(){
this._message.removeListener("status",this._statusListener);
DwtComposite.prototype.dispose.call(this)
};
net_comcast_sms.MessageView.prototype._setContactImage=function(t){
var a=this._img;
this._clearContactImage();
if(t&&a){
var e=new Image();
e.onload=function(){
a.src=e.src;
a.className=""
};
e.src=net_comcast_sms.Util.Contact.getImageUrl(t)
}};
net_comcast_sms.MessageView.prototype._clearContactImage=function(){
var e=this._img;
if(e){
e.src=this._noImage;
e.className=this.NO_CONTACT_IMAGE_CLASS
}};
net_comcast_sms.MessageView.prototype.setEditing=function(e){
this._editing=e;
this.condClassName(e,"editing","");
this.updateStatus()
};
net_comcast_sms.MessageView.prototype.setForwarding=function(e){
this._forwarding=e;
this.condClassName(e,"forwarding","");
if(!e){
this._forwardCheckbox.setSelected(false);
this._handleForwardSelect()
}};
net_comcast_sms.MessageView.prototype.setProcessing=function(e){
this.condClassName(e,"processing","")
};
net_comcast_sms.MessageView.prototype.isSelectedForForwarding=function(){
return this._forwardCheckbox.isSelected()
};
net_comcast_sms.MessageView.prototype._handleForwardSelect=function(){
this._message.setForwardStatus(this._forwardCheckbox.isSelected())
};
net_comcast_sms.MessageView.prototype.updateStatus=function(){
this.setProcessing(false);
var a=this._getStatus();
var t=(a==net_comcast_sms.Message.STATUS_LOCKED);
var e=(a==net_comcast_sms.Message.STATUS_DELETED);
if(this._editing){
this._setButtonVisible(this._lockButton,!t);
this._setButtonVisible(this._unlockButton,t);
this._setButtonVisible(this._deleteButton,!t&&!e)
}
Dwt.setVisible(this._restoreDiv,e);
Dwt.setVisible(this._messageDiv,!e);
this._lock.innerHTML=(a==net_comcast_sms.Message.STATUS_LOCKED)?net_comcast_sms.MessageView.LOCKED_HTML:"";
this._annotation.innerHTML=this._message.getAnnotation();
this.condClassName(e,"deleted","");
this._setActionEnabled("lock",!t);
this._setActionEnabled("unlock",t);
this._setActionEnabled("delete",!t&&!e);
this._setActionEnabled("forward",!e&&!this._editing)
};
net_comcast_sms.MessageView.prototype._setButtonVisible=function(e,t){
if(e.getVisible()!=t){
e.setVisible(t)
}};
net_comcast_sms.MessageView.prototype._setPendingStatus=function(e){
this._message.setEditStatus(e)
};
net_comcast_sms.MessageView.prototype._getStatus=function(e){
return(!e&&this._message.getEditStatus())||this._message.status
};
net_comcast_sms.MessageView.prototype._applyStatus=function(e){
this._message.setStatus(this._getStatus(false),e)
};
net_comcast_sms.MessageView.prototype.getMessage=function(){
return this._message
};
net_comcast_sms.MessageView.prototype.lock=function(e){
this._setPendingStatus(net_comcast_sms.Message.STATUS_LOCKED);
this._handleChangeStatus(e);
return true
};
net_comcast_sms.MessageView.prototype.unlock=function(e){
this._setPendingStatus(net_comcast_sms.Message.STATUS_READ);
this._handleChangeStatus(e);
return true
};
net_comcast_sms.MessageView.prototype.remove=function(e){
if(this._getStatus()!=net_comcast_sms.Message.STATUS_LOCKED){
this._setPendingStatus(net_comcast_sms.Message.STATUS_DELETED);
this._handleChangeStatus(e);
return true
}};
net_comcast_sms.MessageView.prototype.restore=function(e){
this._setPendingStatus(net_comcast_sms.Message.STATUS_READ);
this._handleChangeStatus(e);
return true
};
net_comcast_sms.MessageView.prototype._handleChangeStatus=function(e){
if(e){
this.setProcessing(true);
this._applyStatus(this._updateStatusCallback)
}else{
this.updateStatus()
}};
net_comcast_sms.MessageView.prototype.forward=function(){
this._controller.setForwarding(true);
this._forwardCheckbox.setSelected(true);
this._handleForwardSelect()
};
net_comcast_sms.MessageView.prototype._mouseUpListener=function(e){
if(e.button==DwtMouseEvent.RIGHT){
if(!this._editing&&!this._forwarding&&caboUtil.Dom.isAncestor(this._balloon,e.target)){
var t=this._getActionMenu();
if(t&&t instanceof DwtMenu){
this.updateStatus();
t.popup(0,e.docX,e.docY)
}}}else{
if(this._forwarding){
this._forwardCheckbox.setSelected(!this._forwardCheckbox.isSelected());
this._handleForwardSelect()
}}
this._controller.popdownChoosers()
};
net_comcast_sms.MessageView.prototype._getActionMenu=function(){
if(!this._actionMenu){
var t=this._controller;
var o=[{
id:"lock",text:t.getMsg("actionLock"),listener:new AjxListener(this,this.lock,[true])}
,{
id:"unlock",text:t.getMsg("actionUnlock"),listener:new AjxListener(this,this.unlock,[true])}
,{
id:"delete",text:t.getMsg("actionDelete"),listener:new AjxListener(this,this.remove,[true])}
,{
id:"forward",text:t.getMsg("actionForward"),listener:new AjxListener(this,this.forward)}
];
var h=this._actionMenu=new ZmPopupMenu(this);
for(var s=0,n=o.length;
s<n;
s++){
var r=o[s];
var e="lock";
var a=h.createMenuItem(r.id,{
text:r.text}
);
h.addSelectionListener(r.id,r.listener)
}}
return this._actionMenu
};
net_comcast_sms.MessageView.prototype._setActionEnabled=function(o,e){
var a=this._getActionMenu();
var t=a.getItemById("menuItemId",o);
if(t){
t.setVisible(e)
}};
net_comcast_sms.MessageView.prototype.replaceEmoticons=function(e){
var o=net_comcast_sms.Util.EMOTICONS;
for(var a=0,t=o.length;
a<t;
a++){
var s=o[a];
var n=new RegExp(s.regex,"g");
e=e.replace(n,"<span class='"+s.img+"'></span>")
}
return e
};
net_comcast_sms.MessageView.prototype.reparentHtmlElement=function(a,e){
if(typeof a=="string"){
a=document.getElementById(a)
}
if(!a){
return
}
var t=this.getHtmlElement();
if(t){
if(e==null){
a.appendChild(t)
}else{
if(typeof e=="object"){
a.insertBefore(t,e)
}else{
if(a.childNodes[e]){
if(a.childNodes[e]!=t){
a.insertBefore(t,a.childNodes[e])
}}else{
a.appendChild(t)
}}}}};
net_comcast_sms.ComposeView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:e.className||"ComposeView DwtComposite",posStyle:e.posStyle||Dwt.ABSOLUTE_STYLE,noMaximize:false,controller:e.controller}
);
this.resetCachedBodyText();
this._recipients={};
this._maxHeight=100;
this._minHeight=100;
this._keyEventListened="keydown";
this._subjectSettingListener=new AjxListener(this,this._updateSubjectVisibility);
this._updateSendListeners=[];
this.setVisible(true);
this._setKeyPressEventHdlr(false)
};
net_comcast_sms.ComposeView.prototype=new DwtComposite;
net_comcast_sms.ComposeView.prototype.constructor=net_comcast_sms.ComposeView;
net_comcast_sms.ComposeView.prototype.toString=function(){
return"net_comcast_sms.ComposeView"
};
net_comcast_sms.ComposeView.prototype.getMsg=function(){
return this._controller.getMsg.apply(this._controller,arguments)
};
net_comcast_sms.ComposeView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#Compose";
net_comcast_sms.ComposeView.RECIPIENT_SEP=/\s*[;,]+\s*/g;
net_comcast_sms.ComposeView.SUBJECT_SEP=". ";
net_comcast_sms.ComposeView.prototype.getTabGroupMember=function(){
if(!this._tabGroup){
this._tabGroup=new DwtTabGroup(this.toString()+"_"+Dwt.getNextId())
}
this._tabGroup.toString=function(){
return"SMS Compose View"
};
return this._tabGroup
};
net_comcast_sms.ComposeView.prototype._createHtml=function(){
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId(),msg:this._controller.getHandler().getMsgObj()}
)
};
net_comcast_sms.ComposeView.prototype._initialize=function(){
var e=this.getHTMLElId();
var a=this.getTabGroupMember();
var h=this._contactLabel=new DwtLabel({
parent:this,className:"ComposeLabel DwtLabel overviewHeader"}
);
h.replaceElement(e+"_header");
h.setText(this.getMsg("composeHeader"));
var s=this._toField=new DwtInputField({
parent:this}
);
s.replaceElement(e+"_to");
a.addMember(s.getTabGroupMember());
var t=this._acList=new ZmAutocompleteListView({
dataClass:this._controller.getAutocompleter(),matchValue:"text",compCallback:new AjxCallback(this,this._acComplete),keyUpCallback:new AjxCallback(this,this._acKeyUp),options:{
addrBubbles:false,needItem:true}}
);
t.handle(s.getInputElement());
t.setActiveAccount(appCtxt.accountList.activeAccount);
t._acInterval=700;
t._setSelected=function(g){
if(g==this._selected){
return
}
var m=document.getElementById(this._tableId);
var f=m&&m.rows;
if(!(f&&f.length)){
return
}
var c=f.length;
if(g==ZmAutocompleteListView.NEXT||g==ZmAutocompleteListView.PREV){
g=this._getRowId(f,g,c);
if(!g){
return
}}
for(var d=0;
d<c;
d++){
var p=f[d];
var u=p.className;
if(p.id==g){
p.className=this._selClass
}else{
if(u!=this._origClass){
p.className=this._origClass
}}}
this._selected=g
};
var n=this._textField=new DwtHtmlEditor({
parent:this,mode:DwtHtmlEditor.HTML}
);
n.replaceElement(e+"_field");
n.setSize("100%",100);
if(AjxEnv.isIE){
n.getHtmlElement().style.marginLeft="10px"
}
caboUtil.augment(n,"_handleEditorEvent",AjxCallback.simpleClosure(this._handleEditorEvent,this),false);
a.addMember(n);
n.replaceNodeContent=net_comcast_sms.ComposeView.__override_replaceNodeContent(this);
var r=this._lengthLabel=new DwtLabel({
parent:this}
);
r.replaceElement(e+"_length");
if(AjxEnv.isIE){
r.getHtmlElement().style.marginLeft="10px"
}
var l=this._controller._toolbar.getButton(ZmOperation.SMS_COMPOSEEMOTICON);
var o=this._emoChooser=new net_comcast_sms.EmoticonChooser({
button:l,callback:new AjxCallback(this,this._applyEmoticon)}
);
this._loadEmoticons();
this.updateLength()
};
net_comcast_sms.ComposeView.prototype.dispose=function(){
this.popdownChoosers();
DwtComposite.prototype.dispose.call(this)
};
net_comcast_sms.ComposeView.prototype._handleEditorEvent=function(a,t){
if(t.type==this._keyEventListened){
var e=this,o;
if(t.keyCode==13){
a=false;
o=true
}
if(t.keyCode==90&&t.ctrlKey){
a=false
}
if(t.keyCode==89&&t.ctrlKey){
a=false
}
window.setTimeout(function(){
e.resetCachedBodyText();
e.updateLength();
if(o&&e._canSend()){
e.send()
}}
,0)
}
if(t.type=="mousedown"){
this._controller.popdownChoosers();
if(this._acList){
this._acList.show(false)
}}
if(!this.getEnabled()){
a=false
}
if(!a){
DwtUiEvent.setDhtmlBehaviour(t,true,false)
}
return a
};
net_comcast_sms.ComposeView.prototype.addUpdateSendListener=function(e){
this._updateSendListeners.push(e)
};
net_comcast_sms.ComposeView.prototype._updateSend=function(){
caboUtil.run(this._updateSendListeners,this._canSend(),this._hasInvalidTNs(),!!this.getBodyText().length)
};
net_comcast_sms.ComposeView.prototype.setVisible=function(e){
if(e&&!this._initialized){
this._createHtml();
this._initialize();
this._initialized=true
}
DwtComposite.prototype.setVisible.call(this,e);
if(e){
this.updateMaxHeight();
this.updateHeight();
if(this._toField){
this._toField.focus()
}}
if(!e){
this.popdownChoosers()
}};
net_comcast_sms.ComposeView.prototype.popdownChoosers=function(){
if(this._emoChooser){
this._emoChooser.popdown()
}};
net_comcast_sms.ComposeView.prototype.setSize=function(e,t){
DwtComposite.prototype.setSize.apply(this,arguments);
this.updateMaxHeight();
this.updateHeight()
};
net_comcast_sms.ComposeView.prototype.setContent=function(a){
this._textField.setContent(a);
this.resetCachedBodyText();
var e=this;
var t=function(){
if(e._textField._pendingContent){
setTimeout(t,10)
}else{
e.updateLength()
}};
t()
};
net_comcast_sms.ComposeView.prototype.addRecipient=function(h,s){
if(h){
var o;
if(h instanceof ZmContact){
if(!s){
var r=ZmContact.PHONE_FIELDS;
for(var t=0;
t<r.length;
t++){
s=r[t];
if(h.getAttr(s)){
break
}}}
if(s){
var a=h.getAttr(s);
var n=ZmContact._AB_FIELD[s];
o=h.getFileAs()+" ["+n+"]";
this._recipients[o]={
field:s,value:a}
}}else{
if(AjxUtil.isString(h)){
var e=net_comcast_sms.Util.TN.pretty(h,true);
if(e){
o=e
}}}
if(o){
this._toField.setValue(this._toField.getValue()+o+"; ");
return true
}}
return false
};
net_comcast_sms.ComposeView.prototype._acComplete=function(a,o,t){
var e=this;
if(t&&t.value){
setTimeout(function(){
e._recipients[t.text]={
field:t.field,value:t.value&&t.value.address||t.value};
e._updateSend()
}
,100)
}};
net_comcast_sms.ComposeView.prototype._acKeyUp=function(){
var e=this;
setTimeout(function(){
e._updateSend()
}
,200)
};
net_comcast_sms.ComposeView.prototype.cancel=function(){
this.parent.endMailComposeView(this);
this._controller.setForwarding(false)
};
net_comcast_sms.ComposeView.prototype.reset=function(){
this._toField.setValue("");
this._recipients={};
this.setContent("")
};
net_comcast_sms.ComposeView.prototype.getRecipients=function(u,n){
var o=this._toField.getValue().split(net_comcast_sms.ComposeView.RECIPIENT_SEP);
var e=[];
var r=[];
var h=!u||!!(AjxUtil.intersection(u,ZmContact.PHONE_FIELDS).length);
u=(AjxUtil.isObject(u)&&(AjxUtil.isArray(u)?AjxUtil.arrayAsHash(u):u))||null;
for(var a=0,t=o.length;
a<t;
a++){
var s=o[a]&&AjxStringUtil.trim(o[a]);
if(s){
var d=this._recipients[s];
if(d){
var l=u?(u[d.field]?d.value:null):(d.value||d);
if(net_comcast_sms.Util.TN.normalize(l,true)){
e.push(l)
}else{
r.push(l)
}}else{
if(AjxUtil.isString(s)&&h){
var c=net_comcast_sms.Util.TN.normalize(s,true);
if(c){
e.push(c)
}else{
r.push(s)
}}}
if(n&&e.length){
break
}}}
return{
invalid:r,valid:e}
};
net_comcast_sms.ComposeView.prototype.getPhoneRecipients=function(){
var e=this;
return AjxUtil.collapseList(AjxUtil.map(this.getRecipients(ZmContact.PHONE_FIELDS).valid,function(t){
return net_comcast_sms.Util.TN.normalize(t,true)
}
))
};
net_comcast_sms.ComposeView.prototype.CONVERTOR={
_before:function(e){
this.__ff_hasIgnoredBR=false;
return e
}
,_after:function(e){
return e.replace(new RegExp(String.fromCharCode(160),"g")," ")
}
,"#text":function(t,e){
var a=t.nodeValue;
if(a.search(AjxStringUtil._NON_WHITESPACE)!=-1){
if(e&&(e.lastNode=="ol"||e.lastNode=="ul")){
return"\n"
}
return(e&&e.isPreformatted)?a:a.replace(AjxStringUtil._LF," ")
}
return a
}
,br:function(t,e){
if(!this.__ff_hasIgnoredBR){
this.__ff_hasIgnoredBR=true;
return""
}
return null
}
,img:function(t,e){
var a=Dwt.getObjectFromElement(t,"emoticon");
if(a&&a.chars){
return a.chars
}
return null
}};
net_comcast_sms.ComposeView.prototype.CONVERTOR.p=net_comcast_sms.ComposeView.prototype.CONVERTOR.br;
net_comcast_sms.ComposeView.prototype.CONVERTOR_NOEMO={
_before:net_comcast_sms.ComposeView.prototype.CONVERTOR._before,"#text":net_comcast_sms.ComposeView.prototype.CONVERTOR["#text"],br:net_comcast_sms.ComposeView.prototype.CONVERTOR.br,p:net_comcast_sms.ComposeView.prototype.CONVERTOR.p,img:function(t,e){
var a=Dwt.getObjectFromElement(t,"emoticon");
if(a){
return"@"
}
return null
}};
net_comcast_sms.ComposeView.prototype.resetCachedBodyText=function(){
return this._bodyValue=null
};
net_comcast_sms.ComposeView.prototype.getBodyText=function(){
if(this._bodyValue===null){
var t=this._textField._getIframeDoc();
var e=t&&t.body;
this._bodyValue=net_comcast_sms.Util.DOM.convertHtml2Text(e,this.CONVERTOR,true)
}
return this._bodyValue||""
};
net_comcast_sms.ComposeView.prototype.getRawBodyText=function(){
var t=this._textField._getIframeDoc();
var e=t&&t.body&&t.body.innerHTML;
e=e&&e.replace(/<[^>]+>/g,"");
return e
};
net_comcast_sms.ComposeView.prototype.getFullText=function(){
return this.getBodyText()
};
net_comcast_sms.ComposeView.prototype.updateLength=function(){
if(this.getEnabled()){
if(this._emoticonElements&&this._hasUnconvertedEmoticons()){
this._replaceEmoticons()
}
var o=this._textField;
var s=this.getFullText();
var t=s.length;
if(t!==this._lastCharCount){
var n=Math.ceil(t/160)||1;
var a=t%160;
this._lengthLabel.setText([a,"/",160,n>1?(" ("+n+")"):""].join(""));
this._lastCharCount=t;
this._updateSend()
}
var e=s.replace(/[^\n]/g,"").length+1;
if(e!==this._lastLineCount){
this.updateHeight();
this._lastLineCount=e
}}};
net_comcast_sms.ComposeView.prototype.updateMaxHeight=function(){
var o=0;
var s=this.getHtmlElement().firstChild;
if(s){
var e=Dwt.byId(this.getHTMLElId()+"_textRow");
for(var a=0,t=s.rows.length;
a<t;
a++){
var r=s.rows[a];
if(r!=e){
var n=r.clientHeight;
o+=n
}}
this._maxHeight=this.getSize().y-o
}};
net_comcast_sms.ComposeView.prototype.updateHeight=function(){
if(this._textField){
var a=this._maxHeight;
var o=Math.min(this._minHeight,a);
var t=this._textField._getIframeDoc().body;
var s=0;
if(t){
try{
s=t.scrollHeight||(Dwt.getSize(t).y+(parseInt(caboUtil.Dom.getElementCssProperty(t,"margin-top"))||0)+(parseInt(caboUtil.Dom.getElementCssProperty(t,"margin-bottom"))))
}
catch(n){}
this._textField.setSize(Dwt.DEFAULT,Math.max(Math.min(s,a),o))
}}};
net_comcast_sms.ComposeView.prototype._canSend=function(){
return !!(this.getBodyText().length&&this.getRecipients(null,true).valid.length)
};
net_comcast_sms.ComposeView.prototype._hasInvalidTNs=function(){
return !!(this.getRecipients(null,false).invalid.length)
};
net_comcast_sms.ComposeView.prototype.send=function(r){
if(this._hasInvalidTNs()){
this._controller.getHandler().displayStatusMessage({
msg:this.getMsg("composeInvalidTN"),level:ZmStatusView.LEVEL_CRITICAL}
);
this._updateSend()
}else{
if(!AjxStringUtil.trim(this.getFullText()).length){
this._controller.getHandler().displayStatusMessage({
msg:this.getMsg("composeEmptyError"),level:ZmStatusView.LEVEL_WARNING}
);
this._updateSend()
}else{
var o="sms";
var t=this._controller.getMessageStore();
var s=this.getPhoneRecipients();
var n=[];
if(s&&s.length){
n.push(o)
}
if(n.length){
this._controller.getHandler().displayStatusMessage(this.getMsg("composeSendingStatus"));
var e=new caboUtil.MultiCallback(n,null,new AjxCallback(this,this._handleSend,[s,r]),true);
if(s&&s.length){
for(var a=0;
a<s.length;
a++){
s[a]=s[a].replace(/^\+1/,"").replace(/^\+/,net_comcast_sms.Util.TN.INTL_PREFIX)
}
t.sendMessage(s,this.getFullText(),e.getCallback(o))
}}}}};
net_comcast_sms.ComposeView.prototype._handleSend=function(t,h,e){
var a="sms";
if(e){
var o=this._controller;
var l=o.getHandler();
var c=e[a];
if(c&&c[0] instanceof net_comcast_sms.RestError){
caboUtil.run(h,false);
return
}}
l.displayStatusMessage(this.getMsg("composeSentStatus"));
this.reset();
var r=t&&t.length&&t[0];
var s=this._controller.getMessageStore();
var n=s.getThread(r);
if(n){
n.refresh(new AjxCallback(this,this._handleLoadThread,[n,h]))
}else{
s.refreshThreadHeaders(new AjxCallback(this,this._handleLoadHeaders,[r,h]))
}};
net_comcast_sms.ComposeView.prototype._handleLoadHeaders=function(t,o){
var a=this._controller.getMessageStore();
var e=a.getThread(t);
if(e){
e.load(new AjxCallback(this,this._handleLoadThread,[e,o]))
}else{
this._controller.hideCompose();
caboUtil.run(o,true)
}};
net_comcast_sms.ComposeView.prototype._handleLoadThread=function(e,t){
this._controller.hideCompose();
this._controller.setThread(e);
caboUtil.run(t,true)
};
net_comcast_sms.ComposeView.prototype._hasUnconvertedEmoticons=function(e){
e=e||this.getRawBodyText();
var o=net_comcast_sms.Util.EMOTICONS;
for(var a=0,t=o.length;
a<t;
a++){
if(new RegExp(o[a].regex).test(e)){
return true
}}
return false
};
net_comcast_sms.ComposeView.prototype._applyEmoticon=function(t){
var n=this._textField,a=n._getIframeDoc();
n.focus();
var o=a.createTextNode(t);
n._insertNodeAtSelection(o,true);
if(AjxEnv.isIE){
n._currInsPt=a.selection.createRange();
if(a.selection.type=="None"){
n._currInsPt.collapse(false)
}}else{
var e=n._getRange();
e.selectNode(o);
e.collapse(false)
}
this.resetCachedBodyText();
this.updateLength()
};
net_comcast_sms.ComposeView.prototype._loadEmoticons=function(){
this._emoticonElements=[];
var l=net_comcast_sms.Util.EMOTICONS;
for(var r=0,o=l.length;
r<o;
r++){
var a=l[r];
var t=this._emoticonElements[r]=document.createElement("img");
t.src=this._controller.getHandler().getResource("img/none.png");
t.className=a.img;
document.body.appendChild(t);
var d=["background-color","background-image","background-repeat","background-attachment","width","height"];
if(AjxEnv.isIE){
d.push("background-position-x","background-position-y")
}else{
d.push("background-position")
}
for(var n=0;
n<d.length;
n++){
var s=d[n];
var u=s.replace(/-(\w)/g,function(e,m){
return m.toUpperCase()
}
);
var c=caboUtil.Dom.getElementCssProperty(t,s);
if(!AjxUtil.isUndefined(c)){
t.style[u]=c
}}
t.style.display="inline-block";
t.className="__emoticon__";
Dwt.associateElementWithObject(t,a,"emoticon");
try{
document.body.removeChild(t)
}
catch(h){}}};
net_comcast_sms.ComposeView.prototype._replaceEmoticons=function(){
var h=this._textField,u=net_comcast_sms.Util.EMOTICONS,r=net_comcast_sms.Util.DOM.getElements(null,"img","__emoticon__",h._getIframeDoc());
if(AjxEnv.isIE){
var d=h._getIframeDoc().selection.createRange();
var a=d.getBookmark()
}else{
var d=h._getRange();
d.collapse(false);
var s=document.createElement("span");
d.insertNode(s)
}
for(var c=0,n=u.length;
c<n;
c++){
var t=this._emoticonElements[c],o=u[c];
if(AjxEnv.isIE){
h.range_findnreplace={
findText:true}
}
var l=h.searchnReplace({
searchstring:o.regex,replacestring:t,replacemode:"all"}
)
}
if(AjxEnv.isIE){
d.moveToBookmark(a)
}else{
d.selectNode(s);
d.collapse(false);
var e=h._getIframeWin().getSelection();
e.removeAllRanges();
e.addRange(d);
s.parentNode.removeChild(s)
}};
net_comcast_sms.ComposeView.__override_replaceNodeContent=function(e){
return function(l,s,x,m,g){
var p=this,q=e;
if(!AjxEnv.isIE||(x&&(x.nodeType!=1))){
for(var k=0;
k<l.childNodes.length;
k++){
var w=l.childNodes[k];
if(w.nodeType==3){
if(x&&(x.nodeType==1)){
if(s.test(w.nodeValue)){
var b=w.nodeValue.split(s);
var o=w.nextSibling;
for(var v=0;
v<b.length;
v++){
var t=(v==0)?w:w.cloneNode(false);
t.nodeValue=b[v];
if(v>0){
var r=x.cloneNode(false);
var y=Dwt.getObjectFromElement(x,"emoticon");
if(y){
Dwt.associateElementWithObject(r,AjxUtil.hashCopy(y),"emoticon")
}
if(o){
l.insertBefore(r,o);
l.insertBefore(t,o)
}else{
l.appendChild(r);
l.appendChild(t)
}
g++;
if(m!="all"){
return g
}}}}
s.lastIndex=0
}else{
var u=w.nodeValue.replace(s,x);
if(w.nodeValue!=u){
w.nodeValue=u;
g++;
if(m!="all"){
return g
}}}}
this.replaceNodeContent(w,s,x,m,g);
if((m!="all")&&(g>0)){
return g
}}}else{
var c=100;
do{
var f=p._getIframeDoc().selection.createRange();
f.moveToElementText(l);
var a=f.text,h=s.exec(a);
if(h){
s.lastIndex=0;
var n=h[0].length,z=f.duplicate();
f.collapse(true);
f.moveEnd("character",n);
for(var k=0,d=-1;
k<100&&d<0;
k++){
if(k>0){
f.moveStart("character",1);
f.moveEnd("character",1)
}
d=f.compareEndPoints("EndToEnd",z);
if(s.test(f.text)){
f.pasteHTML(x.outerHTML);
g++;
if(m!="all"){
return g
}
break
}
s.lastIndex=0
}}}
while(h&&c--)
}
return g
}
};
net_comcast_sms.ComposeViewList=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"ComposeViewList DwtComposite",posStyle:Dwt.ABSOLUTE_STYLE,noMaximize:false,controller:e.controller}
);
this._composeViews=[];
this.setScrollStyle(Dwt.SCROLL)
};
net_comcast_sms.ComposeViewList.prototype=new DwtComposite;
net_comcast_sms.ComposeViewList.prototype.constructor=net_comcast_sms.ComposeViewList;
net_comcast_sms.ComposeViewList.prototype.toString=function(){
return"net_comcast_sms.ComposeViewList"
};
net_comcast_sms.ComposeViewList.MIN_COMPOSE_SIZE=250;
net_comcast_sms.ComposeViewList.prototype.setSize=function(r,s){
DwtComposite.prototype.setSize.call(this,r,s);
var c=this.getVisibleViews();
var t=c.length;
if(t){
var o=s;
var h=Math.floor(o/t);
var l=0;
if(h<net_comcast_sms.ComposeViewList.MIN_COMPOSE_SIZE){
h=net_comcast_sms.ComposeViewList.MIN_COMPOSE_SIZE;
r-=caboUtil.Dom.getScrollBarWidth()
}else{
l=o-t*h
}
var u=[];
var n=0;
for(var a=0,e=c.length;
a<e;
a++){
var d=h+((l-->0)?1:0);
c[a].setSize(r,d);
c[a].setLocation(Dwt.DEFAULT,n);
n+=d
}}};
net_comcast_sms.ComposeViewList.prototype.setVisible=function(o){
DwtComposite.prototype.setVisible.call(this,o);
for(var a=0,t=this._composeViews.length;
a<t;
a++){
var e=this._composeViews[a];
e.setVisible(o&&!e._forceHide)
}
if(o){
net_comcast_sms.Util.DOM.resetSize(this)
}};
net_comcast_sms.ComposeViewList.prototype.getVisibleViews=function(){
var o=[];
for(var a=0,t=this._composeViews.length;
a<t;
a++){
var e=this._composeViews[a];
if(e.getVisible()){
o.push(e)
}}
return o
};
net_comcast_sms.ComposeViewList.prototype.clear=function(){
for(var a=0,t=this._composeViews.length;
a<t;
a++){
var e=this._composeViews[a];
this._tabGroup.removeMember(e.getTabGroupMember());
e._forceHide=true;
e.setVisible(false)
}};
net_comcast_sms.ComposeViewList.prototype.reset=function(){
this.clear()
};
net_comcast_sms.ComposeViewList.prototype.add=function(){
var e=new net_comcast_sms.ComposeView({
parent:this,controller:this._controller}
);
this._composeViews.push(e);
this._tabGroup.addMember(e.getTabGroupMember());
net_comcast_sms.Util.DOM.resetSize(this);
return e
};
net_comcast_sms.ComposeViewList.prototype.addMail=function(a){
if(!a){
a={
action:ZmId.OP_NEW_MESSAGE}
}
var t=new net_comcast_sms.ComposeController(this,this._controller._handler);
var e=t.getView();
e._controller=t;
this._composeViews.push(e);
net_comcast_sms.Util.DOM.resetSize(this);
t.doAction(a);
return e
};
net_comcast_sms.ComposeViewList.prototype.endMailComposeView=function(t){
t=t&&AjxUtil.toArray(t)||this._composeViews;
for(var a=0;
a<t.length;
a++){
var e=t[a];
this._controller.unmoveMailComposeToolbar(e._controller);
AjxUtil.arrayRemove(this._composeViews,e);
DwtControl.prototype.dispose.call(e)
}};
net_comcast_sms.ComposeViewList.prototype.get=function(e){
return this._composeViews[e]
};
net_comcast_sms.ComposeViewList.prototype.getFirst=function(){
return this._composeViews[0]||null
};
net_comcast_sms.ComposeViewList.prototype.getTabGroupMember=function(){
if(!this._tabGroup){
this._tabGroup=new DwtTabGroup(this.toString());
for(var t=0,e=this._composeViews.length;
t<e;
t++){
this._tabGroup.addMember(this._composeViews[t].getTabGroupMember())
}
this._tabGroup.toString=function(){
return"SMS Compose View List"
}
}
return this._tabGroup
};
net_comcast_sms.ReplyView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
net_comcast_sms.ComposeView.call(this,{
parent:e.parent,className:e.className||"ReplyView DwtComposite",controller:e.controller,posStyle:Dwt.STATIC_STYLE}
);
this._createHtml();
this._initialize()
};
net_comcast_sms.ReplyView.prototype=new net_comcast_sms.ComposeView;
net_comcast_sms.ReplyView.prototype.constructor=net_comcast_sms.ReplyView;
net_comcast_sms.ReplyView.prototype.toString=function(){
return"net_comcast_sms.ReplyView"
};
net_comcast_sms.ReplyView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#Reply";
net_comcast_sms.ReplyView.prototype._createHtml=function(){
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId(),msg:this._controller.getHandler().getMsgObj()}
)
};
net_comcast_sms.ReplyView.prototype._initialize=function(){
var r=this.getHTMLElId();
var o=this._textField=new DwtHtmlEditor({
parent:this,mode:DwtHtmlEditor.HTML}
);
o.replaceElement(r+"_field");
if(!AjxEnv.isIE){
o.addListener(DwtEvent.ONKEYUP,new AjxListener(this,this.updateLength))
}else{
var n=AjxCallback.simpleClosure(this.updateLength,this);
setTimeout(function(){
var l=o._getIframeDoc();
var h=l&&l.body;
if(h){
h.attachEvent(DwtEvent.ONKEYUP,n)
}}
,0)
}
o.setSize("100%",64);
caboUtil.augment(o,"_handleEditorEvent",AjxCallback.simpleClosure(this._handleEditorEvent,this),false);
o.replaceNodeContent=net_comcast_sms.ComposeView.__override_replaceNodeContent(this);
var e=this._lengthLabel=new DwtLabel({
parent:this}
);
e.replaceElement(r+"_length");
var s=this._emoButton=new DwtButton({
parent:this}
);
s.setImage("HappyEmoticon");
s.replaceElement(r+"_emoticon");
var a=this._emoChooser=new net_comcast_sms.EmoticonChooser({
button:s,callback:new AjxCallback(this,this._applyEmoticon)}
);
var t=this._sendButton=new DwtButton({
parent:this}
);
t.setText(this.getMsg("replySendButton"));
t.replaceElement(r+"_send");
t.addSelectionListener(new AjxListener(this,this.send));
this.addUpdateSendListener(new AjxCallback(this,this._updateSendButton));
this._updateSendButton(false);
this._loadEmoticons();
this.updateLength()
};
net_comcast_sms.ReplyView.prototype.reset=function(){
this.setContent("")
};
net_comcast_sms.ReplyView.prototype.setVisible=function(e){
DwtComposite.prototype.setVisible.call(this,e);
if(this._textField){
this._textField.setVisible(e);
this._textField.setVisibility(e)
}
if(this._emoButton){
this._emoButton.setVisible(e);
this._emoButton.setVisibility(e)
}
if(this._sendButton){
this._sendButton.setVisible(e);
this._sendButton.setVisibility(e)
}
if(!e){
this.popdownChoosers()
}};
net_comcast_sms.ReplyView.prototype.popdownChoosers=function(){
net_comcast_sms.ComposeView.prototype.popdownChoosers.call(this)
};
net_comcast_sms.ReplyView.prototype.setEnabled=function(e){
DwtComposite.prototype.setEnabled.call(this,e);
this._textField.setEnabled(e);
this._emoButton.setEnabled(e)
};
net_comcast_sms.ReplyView.prototype._updateSendButton=function(e){
this._sendButton.setEnabled(e)
};
net_comcast_sms.ReplyView.prototype.updateHeight=function(){};
net_comcast_sms.ReplyView.prototype._canSend=function(){
return !!(this.getBodyText().length)
};
net_comcast_sms.ReplyView.prototype._hasInvalidTNs=function(){
return false
};
net_comcast_sms.ReplyView.prototype.send=function(a){
if(!AjxStringUtil.trim(this.getFullText()).length){
this._controller.getHandler().displayStatusMessage({
msg:this.getMsg("composeEmptyError"),level:ZmStatusView.LEVEL_WARNING}
);
this._updateSend()
}else{
var t=this._controller.getMessageStore();
var e=this._controller.getThread();
t.sendMessage(e.getTN(),this.getFullText(),new AjxCallback(this,this._handleSend,[a||null]));
this.reset()
}};
net_comcast_sms.ReplyView.prototype._handleSend=function(o,a){
var e=this._controller;
var t=e.getHandler();
if(a instanceof net_comcast_sms.RestError){
t.displayStatusMessage(this.getMsg((a.code=="0030009")?"quotaError":"composeErrorStatus",[a.message]));
return
}
this._textField.focus();
caboUtil.run(o)
};
net_comcast_sms.ForwardView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"ForwardView DwtComposite",controller:e.controller}
);
this._updateListener=new AjxListener(this,this.updateButtons);
this._createHtml();
this._initialize();
this._thread=null
};
net_comcast_sms.ForwardView.prototype=new DwtComposite;
net_comcast_sms.ForwardView.prototype.constructor=net_comcast_sms.ForwardView;
net_comcast_sms.ForwardView.prototype.toString=function(){
return"net_comcast_sms.ForwardView"
};
net_comcast_sms.ForwardView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#Forward";
net_comcast_sms.ForwardView.prototype._createHtml=function(){
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId()}
)
};
net_comcast_sms.ForwardView.prototype._initialize=function(){
var a=this.getHTMLElId();
var t=this._smsButton=new DwtButton({
parent:this}
);
t.setText(this._controller.getMsg("forwardTextButton"));
t.replaceElement(a+"_sms");
t.addSelectionListener(new AjxListener(this,this._fwdAsSms));
var e=this._emailButton=new DwtButton({
parent:this}
);
e.setText(this._controller.getMsg("forwardEmailButton"));
e.replaceElement(a+"_email");
e.addSelectionListener(new AjxListener(this,this._fwdAsEmail));
if(!appCtxt.get(ZmSetting.MAIL_ENABLED)){
e.setVisible(false)
}
this.updateButtons()
};
net_comcast_sms.ForwardView.prototype.dispose=function(){
if(this._thread){
this._thread.removeListener("forwardstatus",this._updateListener)
}
DwtComposite.prototype.dispose.call(this)
};
net_comcast_sms.ForwardView.prototype.setThread=function(e){
if(this._thread){
this._thread.removeListener("forwardstatus",this._updateListener)
}
if(e){
e.addListener("forwardstatus",this._updateListener)
}
this._thread=e
};
net_comcast_sms.ForwardView.prototype._getSelectedMessages=function(){
var e=this.parent.getThreadView();
return e&&e.getMessagesForForwarding()||[]
};
net_comcast_sms.ForwardView.prototype._fwdAsSms=function(){
this._controller.doForwardAsText(this._getSelectedMessages())
};
net_comcast_sms.ForwardView.prototype._fwdAsEmail=function(){
this._controller.doForwardAsEmail(this._getSelectedMessages())
};
net_comcast_sms.ForwardView.prototype.updateButtons=function(){
var t=this._getSelectedMessages();
var e=!!(t&&t.length);
this._smsButton.setEnabled(e);
this._emailButton.setEnabled(e)
};
net_comcast_sms.DeleteThreadView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:"DeleteThreadView DwtComposite",controller:e.controller}
);
this._deleteListener=new AjxListener(this,this._doDelete);
this._updateListener=new AjxCallback(this,this.update);
this._createHtml();
this._initialize()
};
net_comcast_sms.DeleteThreadView.prototype=new DwtComposite;
net_comcast_sms.DeleteThreadView.prototype.constructor=net_comcast_sms.DeleteThreadView;
net_comcast_sms.DeleteThreadView.prototype.toString=function(){
return"net_comcast_sms.DeleteThreadView"
};
net_comcast_sms.DeleteThreadView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#DeleteThread";
net_comcast_sms.DeleteThreadView.prototype._createHtml=function(){
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId()}
)
};
net_comcast_sms.DeleteThreadView.prototype._initialize=function(){
var a=this.getHTMLElId();
var e=this._countLabel=new DwtLabel({
parent:this}
);
e.replaceElement(a+"_messageCount");
var t=this._deleteButton=new DwtButton({
parent:this}
);
t.setText("<nobr>"+this._controller.getMsg("deleteThreadButton")+"</nobr>");
t.replaceElement(a+"_deleteButton");
t.setEnabled(false);
t.addSelectionListener(new AjxListener(this,this._deleteThread))
};
net_comcast_sms.DeleteThreadView.prototype.dispose=function(){
if(this._thread){
this._thread.removeListener("editstatus",this._updateListener);
this._thread.removeListener("status",this._updateListener);
this._thread.removeListener("messages",this._updateListener)
}
DwtComposite.prototype.dispose.call(this)
};
net_comcast_sms.DeleteThreadView.prototype.set=function(e){
if(e){
if(this._thread){
this._thread.removeListener("editstatus",this._updateListener);
this._thread.removeListener("status",this._updateListener);
this._thread.removeListener("messages",this._updateListener)
}
this._thread=e;
e.addListener("editstatus",this._updateListener);
e.addListener("status",this._updateListener);
e.addListener("messages",this._updateListener)
}
this.update()
};
net_comcast_sms.DeleteThreadView.prototype._updateCount=function(){
if(this._thread instanceof net_comcast_sms.Thread){
this._countLabel.setText(this._controller.getMsg("deleteThreadMsg",[this._thread.getNonDeletedCount()]))
}};
net_comcast_sms.DeleteThreadView.prototype._deleteThread=function(){
var e=this._dialog=appCtxt.getOkCancelMsgDialog();
e.reset();
e.setMessage(this._controller.getMsg("deleteThreadWarning"));
e.setButtonListener(DwtDialog.OK_BUTTON,this._deleteListener);
e.popup()
};
net_comcast_sms.DeleteThreadView.prototype._doDelete=function(){
this._dialog.popdown();
this._thread.deleteThread()
};
net_comcast_sms.DeleteThreadView.prototype._handleDelete=function(){
this.update()
};
net_comcast_sms.DeleteThreadView.prototype.update=function(){
var e=this._thread;
var o=false;
if(e){
for(var a=0,t=e.size();
a<t&&!o;
a++){
var n=e.getByIndex(a);
if(n.canDelete()&&n.getEditStatus()!=net_comcast_sms.Message.STATUS_LOCKED){
o=true
}}
this._deleteButton.setEnabled(o);
this._updateCount()
}};
net_comcast_sms.EmoticonChooser=function(t){
if(!arguments.length){
return
}
this._emoticons=net_comcast_sms.Util.EMOTICONS;
DwtToolTip.call(this,appCtxt.getShell(),"EmoticonChooser DwtToolTip");
var a=this.id=this._div.id=Dwt.getNextId();
var e="dwt.Widgets#"+this._borderStyle;
this._div.innerHTML=AjxTemplate.expand(e,a+"_");
this._contentDiv=document.getElementById(a+"_Contents");
this._button=t.button;
t.button.addSelectionListener(new AjxListener(this,this.toggle));
this._callback=t.callback;
this._createHtml();
this._initialize();
net_comcast_sms.EmoticonChooser.instances.push(this)
};
net_comcast_sms.EmoticonChooser.prototype=new DwtToolTip;
net_comcast_sms.EmoticonChooser.prototype.constructor=net_comcast_sms.EmoticonChooser;
net_comcast_sms.EmoticonChooser.prototype.toString=function(){
return"net_comcast_sms.EmoticonChooser"
};
net_comcast_sms.EmoticonChooser.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#EmoticonChooser";
net_comcast_sms.EmoticonChooser.instances=[];
net_comcast_sms.EmoticonChooser.prototype.charsToImg=function(o){
for(var a=0,t=this._emoticons.length;
a<t;
a++){
var n=this._emoticons[a];
if(n.chars==o){
return n.img
}}};
net_comcast_sms.EmoticonChooser.prototype._createHtml=function(){
this.setContent(AjxTemplate.expand(this.TEMPLATE,{
id:this.id,count:this._emoticons.length}
),true)
};
net_comcast_sms.EmoticonChooser.prototype._initialize=function(){
this._emos=[];
var e=this.id+"_emo";
var s=this.id+"_btn";
for(var o=0,a=this._emoticons.length;
o<a;
o++){
var n=this._emos[o]=Dwt.byId(e+o);
if(n){
n.className=this._emoticons[o].img;
Dwt.setHandler(n,DwtEvent.ONCLICK,AjxCallback.simpleClosure(this._choose,this,this._emoticons[o].chars))
}
var t=Dwt.byId(s+o);
if(t){
Dwt.setHandler(t,DwtEvent.ONMOUSEOVER,net_comcast_sms.EmoticonChooser.btnOver);
Dwt.setHandler(t,DwtEvent.ONMOUSEOUT,net_comcast_sms.EmoticonChooser.btnOut)
}}};
net_comcast_sms.EmoticonChooser.prototype.toggle=function(){
if(this._poppedUp){
this.popdown()
}else{
var n=this._button.getLocation();
var t=this._button.getSize();
var e=n.x+0.5*t.x;
var o=n.y+t.y;
var a=(o+8+Dwt.getSize(Dwt.byId(this.id+"_TopPointer")).y-this._borderHeight+Dwt.getSize(this._div).y<DwtShell.getShell(window).getSize().y-5);
if(!a){
o=n.y
}
this.popup(e,o,true)
}};
net_comcast_sms.EmoticonChooser.prototype._choose=function(e){
this.popdown();
caboUtil.run(this._callback,e)
};
net_comcast_sms.EmoticonChooser.popdown=function(e){
var o=net_comcast_sms.EmoticonChooser.instances;
for(var a=0,t=o.length;
a<t;
a++){
if(!e||!net_comcast_sms.Util.DOM.isAncestor(o[a]._contentDiv,e)){
o[a].popdown()
}}};
(function(){
var e=document.onmousedown;
document.onmousedown=function(t){
if(!t){
t=window.event
}
net_comcast_sms.EmoticonChooser.popdown(t&&(t.target||t.srcElement)||null);
caboUtil.apply(e,arguments)
}
}
());
net_comcast_sms.EmoticonChooser.btnOver=function(t){
if(!t){
t=window.event
}
var e=(t.target)?t.target:t.srcElement;
Dwt.addClass(e,"ZHover")
};
net_comcast_sms.EmoticonChooser.btnOut=function(t){
if(!t){
t=window.event
}
var e=(t.target)?t.target:t.srcElement;
Dwt.delClass(e,"ZHover")
};
net_comcast_sms.EmoticonChooser.prototype._positionElement=function(T,z){
this._popupAction=null;
var n=this._div;
var m=this.id+"_";
var j=this._dialog;
var q=5;
var c=8;
var h=8;
var e=document.getElementById(m+"TopPointer");
e.style.display="block";
var y=Dwt.getSize(e),v=y.x,a=y.y;
var s=document.getElementById(m+"BottomPointer");
s.style.display="block";
y=Dwt.getSize(s),bottomPointerWidth=y.x,bottomPointerHeight=y.y;
var k=e;
var r=DwtShell.getShell(window).getSize(),B=r.x,f=r.y;
var W=Dwt.getSize(n),x=W.x,d=W.y;
var u=this._borderHeight,C=this._borderHeight,g=this._borderWidth,w=this._borderWidth;
var A=T-x/2-c,O;
var t,o,b;
if(z+h+a-u+d<f-q){
s.style.display="none";
O=z+h+a-u;
t=u-a;
b=v;
k=e
}else{
e.style.display="none";
O=z-h-bottomPointerHeight+C-d;
t=d-C;
b=bottomPointerWidth;
k=s
}
var l=document.getElementById(m+"Contents");
if(x-g-w<b){
l.width=b;
l.style.width=String(b)+"px"
}else{
l.width="auto";
l.style.width="auto"
}
if(A<q){
A=q
}else{
if(A+x>B-q){
A=B-q-x
}}
o=T-A-b/2;
if(o+b>x-w){
o=x-w-b
}
if(o<g){
o=g
}
k.style.left=o;
k.style.top=t;
Dwt.setLocation(n,A,O);
var p=j?j.getZIndex()+Dwt._Z_INC:Dwt.Z_TOOLTIP;
Dwt.setZIndex(n,p);
this._poppedUp=true
};
caboUtil.onload("caboUtil.Preferences",function(){
net_comcast_sms.PrefsView=function(t,a,e){
if(!arguments.length){
return
}
caboUtil.Preferences.View.call(this,t,a,e)
};
net_comcast_sms.PrefsView.prototype=new caboUtil.Preferences.View;
net_comcast_sms.PrefsView.prototype.constructor=net_comcast_sms.PrefsView;
net_comcast_sms.PrefsView.prototype.toString=function(){
return"net_comcast_sms.PrefsView"
};
net_comcast_sms.PrefsView.prototype.showMe=function(){
var e=this._controller.getHandler().getSubscribed(new AjxCallback(this,this._doShow));
this._doShow(e)
};
net_comcast_sms.PrefsView.prototype._doShow=function(t){
if(AjxUtil.isUndefined(t)){
this.showLoading()
}else{
if(!t){
this.showUnsubscribed()
}else{
this.showChildren(true);
this.showLoading(false);
ZmPreferencesPage.prototype.showMe.apply(this,arguments);
if(!this._isShown){
this._isShown=true;
var e=this._controller.getHandler();
if(!e.getSettingsLoaded()){
this.showLoading(true);
e.loadSettings(new AjxCallback(this,this._handleSettingsLoaded))
}
this._dwtObjects[ZmSetting.SMS_AUTO_FORWARD_EMAIL].addSelectionListener(new AjxListener(this,this._handleForwardChanged));
this._handleForwardChanged()
}}}};
net_comcast_sms.PrefsView.prototype.showLoading=function(e){
if(!this._loadingView){
var t=this._loadingView=new DwtComposite({
parent:this}
);
t.setContent("Loading ...")
}
this.showChildren(!e);
this._loadingView.setVisible(e)
};
net_comcast_sms.PrefsView.prototype.showUnsubscribed=function(){
if(!this._unsubscribedView){
var e=this._unsubscribedView=new DwtComposite({
parent:this}
);
e.setContent("You are not subscribed to XTM")
}
this.showChildren(false);
this._unsubscribedView.setVisible(true)
};
net_comcast_sms.PrefsView.prototype.showChildren=function(e){
for(var t=0;
t<this._children.size();
t++){
this._children.get(t).setVisible(e)
}};
net_comcast_sms.PrefsView.prototype._setupCustom=function(o,e,a){
if(o=="SMS_UNSUBSCRIBE"){
var t=this._addButton(Dwt.byId(this.getHTMLElId()+"_SMS_UNSUBSCRIBE"),this._controller.getMsg("unsubscribe"),110,new AjxListener(this,this._unsubscribe));
this.setFormObject("SMS_UNSUBSCRIBE",t)
}else{
return ZmPreferencesPage.prototype._setupCustom.call(this,o,e,a)
}};
net_comcast_sms.PrefsView.prototype._handleSettingsLoaded=function(){
var e=appCtxt.getSettings();
this._dwtObjects[ZmSetting.SMS_AUTO_FORWARD_EMAIL].setSelectedValue(e.getSetting("SMS_AUTO_FORWARD_EMAIL").value);
this._dwtObjects[ZmSetting.SMS_AUTO_FORWARD_EMAIL_ADDR].setValue(e.getSetting("SMS_AUTO_FORWARD_EMAIL_ADDR").value);
this.showLoading(false)
};
net_comcast_sms.PrefsView.prototype._handleForwardChanged=function(){
var e=this._dwtObjects[ZmSetting.SMS_AUTO_FORWARD_EMAIL].getSelectedValue();
this._dwtObjects[ZmSetting.SMS_AUTO_FORWARD_EMAIL_ADDR].setEnabled(e&&e!="false")
};
net_comcast_sms.PrefsView.prototype._unsubscribe=function(){
var e=this._controller.getHandler();
var t=this._getUnsubscribeDialog();
t.reset();
t.popup()
};
net_comcast_sms.PrefsView.prototype._doUnsubscribe=function(a,e){
var t=this._controller.getHandler();
t.unsubscribe(a,e)
};
net_comcast_sms.PrefsView.prototype._getUnsubscribeDialog=function(){
if(!this._unsubscribeDialog){
var e=this._controller.getHandler();
var t=this._unsubscribeDialog=new net_comcast_sms.UnsubscribeDialog({
parent:appCtxt.getShell(),handler:e}
,new AjxCallback(this,this._doUnsubscribe))
}
return this._unsubscribeDialog
};
net_comcast_sms.PrefsView.prototype._getTemplateData=function(){
var e=caboUtil.Preferences.View.prototype._getTemplateData.call(this);
e.msg=this._controller.getHandler().getMsgObj();
return e
}
}
);
net_comcast_sms.ProvisioningView=function(t){
if(!arguments.length){
return
}
var e=this._controller=t.controller;
t.className="ProvisioningView";
DwtComposite.call(this,t);
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId()}
);
this._initialize();
if(e.isEntitled()){
e.loadVoiceData(new AjxCallback(this,function(a){
if(a){
if(a.code=="voice.SECONDARY_NOT_ALLOWED"){
this.showNotEntitled()
}else{
e.showError(this.getMsg("provErrorException",JSON.stringify(a)),this.getMsg("provErrorHeader"))
}}else{
this.showMarketing()
}}
))
}else{
this.showNotEntitled()
}
this._loaded=true;
caboUtil.run(this._loadedCallback)
};
net_comcast_sms.ProvisioningView.prototype=new DwtComposite();
net_comcast_sms.ProvisioningView.prototype.constructor=net_comcast_sms.ProvisioningView;
net_comcast_sms.ProvisioningView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#Provisioning";
net_comcast_sms.ProvisioningView.prototype.toString=function(){
return"net_comcast_sms.ProvisioningView"
};
net_comcast_sms.ProvisioningView.prototype.getMsg=function(){
return this._controller.getMsg.apply(this._controller,arguments)
};
net_comcast_sms.ProvisioningView.prototype.setLoadedCallback=function(e){
if(this._loaded){
caboUtil.run(e)
}else{
this._loadedCallback=e
}};
net_comcast_sms.ProvisioningView.prototype._initialize=function(){
var t=this.getHTMLElId();
var c=[];
var p=this._nameLabel=new DwtLabel({
parent:this,className:"ProvisioningLabel DwtLabel overviewHeader"}
);
p.replaceElement(t+"_header");
p.setText(appCtxt.get(ZmSetting.DISPLAY_NAME)||appCtxt.getUsername());
var d=this._notEntitled=new DwtIframe({
parent:this,html:""}
);
d.replaceElement(t+"_notEntitled");
c.push(d);
var l=this._marketing=new DwtIframe({
parent:this,html:""}
);
l.replaceElement(t+"_marketing");
c.push(l);
var u=this._signupButton=new DwtButton({
parent:this}
);
u.replaceElement(t+"_signupButton");
u.setText(this.getMsg("provSignup"));
var h=this._terms=new DwtIframe({
parent:this,html:"",onload:"net_comcast_sms.ProvisioningView.handleShowTerms(this)"}
);
Dwt.associateElementWithObject(h.getIframe(),this,"provisioningView");
h.replaceElement(t+"_terms");
c.push(h);
var e=this._costs=new DwtIframe({
parent:this,html:"",onload:"net_comcast_sms.ProvisioningView.handleShowCosts(this)"}
);
Dwt.associateElementWithObject(e.getIframe(),this,"provisioningView");
e.replaceElement(t+"_costs");
c.push(e);
var a=this._congratulations=new DwtIframe({
parent:this,html:""}
);
a.replaceElement(t+"_congratulations");
c.push(a);
var y=this._backButton=new DwtButton({
parent:this}
);
y.replaceElement(t+"_backButton");
y.setText(this.getMsg("provBack"));
var o=this._declineButton=new DwtButton({
parent:this}
);
o.replaceElement(t+"_declineButton");
o.setText(this.getMsg("provDecline"));
var m=this._acceptButton=new DwtButton({
parent:this}
);
m.replaceElement(t+"_acceptButton");
m.setText(this.getMsg("provAccept"));
var f=this._okButton=new DwtButton({
parent:this}
);
f.replaceElement(t+"_okButton");
f.setText(this.getMsg("provOK"));
var g=this._nextButton=new DwtButton({
parent:this}
);
g.replaceElement(t+"_nextButton");
g.setText(this.getMsg("provNext"));
for(var r=0;
r<c.length;
r++){
var s=c[r];
var n=s.getIframe();
n.width=n.height="100%"
}};
net_comcast_sms.ProvisioningView.prototype.hideAll=function(){
var e=false;
this._backButton.setVisible(e);
this._okButton.setVisible(e);
this._declineButton.setVisible(e);
this._acceptButton.setVisible(e);
this._nextButton.setVisible(e);
this._signupButton.setVisible(e);
this._notEntitled.setVisible(e);
this._marketing.setVisible(e);
if(this._accountChooser){
this._accountChooser.setVisible(e)
}else{
Dwt.setVisible(Dwt.byId(this.getHTMLElId()+"_accountChooser"),e)
}
this._terms.setVisible(e);
this._costs.setVisible(e);
this._congratulations.setVisible(e)
};
net_comcast_sms.ProvisioningView.prototype._setSelectionListener=function(e,t){
e.removeSelectionListeners();
e.addSelectionListener(t)
};
net_comcast_sms.ProvisioningView.prototype._hasMultipleTNs=function(){
return this._tns&&this._tns.length>1
};
net_comcast_sms.ProvisioningView.prototype.showMarketing=function(){
this.hideAll();
if(!this.__showingMarketing){
this.__showingMarketing=true;
this._marketing.setSrc(net_comcast_sms.SmsZimlet.MARKETING)
}
this._signupButton.setVisible(true);
this._setSelectionListener(this._signupButton,new AjxListener(this,this.showCost));
this._marketing.setVisible(true)
};
net_comcast_sms.ProvisioningView.prototype.showNotEntitled=function(){
this.hideAll();
this._notEntitled.setSrc(net_comcast_sms.SmsZimlet.NOT_ENTITLED);
this._notEntitled.setVisible(true)
};
net_comcast_sms.ProvisioningView.prototype.showTNChooser=function(e){
this.hideAll();
this._controller.showLoading(true,"tns");
this._controller.getAvailableTNs(new AjxCallback(this,this._handleGetTNs,[e]))
};
net_comcast_sms.ProvisioningView.prototype._handleGetTNs=function(e,t,n){
this._tns=t||[n];
if(this._hasMultipleTNs()){
var a=this._backButton,s=this._nextButton;
if(!this._accountChooser){
var o=this._accountChooser=new net_comcast_sms.ProvisioningView.AccountChooser({
parent:this,tns:t,controller:this._controller}
);
o.replaceElement(this.getHTMLElId()+"_accountChooser")
}else{
var o=this._accountChooser
}
this._setSelectionListener(a,new AjxListener(this,this.showMarketing));
this._setSelectionListener(s,new AjxListener(this,this.showTerms));
a.setVisible(true);
s.setVisible(true);
o.setVisible(true)
}else{
if(e){
this.showMarketing()
}else{
this.showTerms()
}}
this._controller.showLoading(false,"tns")
};
net_comcast_sms.ProvisioningView.prototype.showCost=function(){
var t=this._acceptButton,n=this._declineButton,s=this._okButton,a=this._costs,e=net_comcast_sms.Provisioning.isLimited();
this.hideAll();
if(!this.__showingCosts){
this._controller.showLoading(true,"costs");
this.__showingCosts=true;
var o=e?net_comcast_sms.SmsZimlet.COSTS_LIMITED:net_comcast_sms.SmsZimlet.COSTS_UNLIMITED;
a.setSrc(o)
}else{
this._handleShowCosts()
}
this._setSelectionListener(n,new AjxListener(this,this.showMarketing,[true]));
this._setSelectionListener(t,new AjxListener(this,this.showTNChooser,[false]));
this._setSelectionListener(s,new AjxListener(this,this.showTNChooser,[false]));
if(e){
n.setEnabled(true);
n.setVisible(true);
t.setEnabled(true);
t.setVisible(true)
}else{
s.setVisible(true);
s.setEnabled(true)
}
a.setVisible(true)
};
net_comcast_sms.ProvisioningView.handleShowCosts=function(t){
var e=Dwt.getObjectFromElement(t,"provisioningView");
if(e&&e.__showingCosts){
e._handleShowCosts()
}};
net_comcast_sms.ProvisioningView.prototype._handleShowCosts=function(){
this._controller.showLoading(false,"costs")
};
net_comcast_sms.ProvisioningView.prototype.showTerms=function(){
var t=this._acceptButton,a=this._declineButton,e=this._terms;
this.hideAll();
if(!this.__showingTerms){
this._controller.showLoading(true,"terms");
this.__showingTerms=true;
e.setSrc(net_comcast_sms.SmsZimlet.TERMS)
}else{
this._handleShowTerms()
}
e.setVisible(true)
};
net_comcast_sms.ProvisioningView.handleShowTerms=function(t){
var e=Dwt.getObjectFromElement(t,"provisioningView");
if(e&&e.__showingTerms){
e._handleShowTerms()
}};
net_comcast_sms.ProvisioningView.prototype._handleShowTerms=function(){
var e=this._acceptButton,t=this._declineButton;
this._setSelectionListener(t,new AjxListener(this,this.showCost));
this._setSelectionListener(e,new AjxListener(this,this.signup,[null]));
e.setEnabled(true);
e.setVisible(true);
t.setEnabled(true);
t.setVisible(true);
this._controller.showLoading(false,"terms")
};
net_comcast_sms.ProvisioningView.prototype.signup=function(e){
this._declineButton.setEnabled(false);
this._acceptButton.setEnabled(false);
this._controller.showLoading(true,"signup");
if(e){
this._tns=[e]
}
this._controller.signup(this._hasMultipleTNs()?this._accountChooser.getSelectedValue():this._tns[0],new AjxCallback(this,this._handleSignup))
};
net_comcast_sms.ProvisioningView.prototype._handleSignup=function(t,e){
this._controller.showLoading(false,"signup");
if(t){
this.showCongratulations()
}else{
net_comcast_sms.Util.UI.dialog(this.getMsg("provFailed",e),this.getMsg("provErrorTitle"));
this._declineButton.setEnabled(true);
this._acceptButton.setEnabled(true)
}};
net_comcast_sms.ProvisioningView.prototype.showCongratulations=function(){
var t=this._okButton;
this.hideAll();
var e=net_comcast_sms.SmsZimlet.CONGRATULATIONS;
this._congratulations.setSrc(e);
t.setVisible(true);
t.setEnabled(true);
this._setSelectionListener(t,new AjxListener(this,this.close))
};
net_comcast_sms.ProvisioningView.prototype.close=function(){
this.setVisible(false)
};
net_comcast_sms.ProvisioningView.AccountChooser=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
this._tns=e.tns;
DwtComposite.call(this,e);
this._createHtmlFromTemplate(this.TEMPLATE,{
id:this.getHTMLElId()}
);
this._initialize()
};
net_comcast_sms.ProvisioningView.AccountChooser.prototype=new DwtComposite();
net_comcast_sms.ProvisioningView.AccountChooser.prototype.constructor=net_comcast_sms.ProvisioningView.AccountChooser;
net_comcast_sms.ProvisioningView.AccountChooser.prototype.TEMPLATE="net_comcast_sms#Provisioning.AccountChooser";
net_comcast_sms.ProvisioningView.AccountChooser.prototype.toString=function(){
return"net_comcast_sms.ProvisioningView"
};
net_comcast_sms.ProvisioningView.AccountChooser.prototype._initialize=function(){
var r=this.getHTMLElId();
var s=new DwtLabel({
parent:this,className:"AccountChooserText"}
);
s.replaceElement(r+"_text1");
s.setText(this._controller.getMsg("provText1"));
var t=this._radioButtons=[];
var n=Dwt.byId(r+"_list");
for(var e=0;
e<this._tns.length;
e++){
var o=new net_comcast_sms.ProvisioningView.AccountChooser.RadioButton({
parent:this,style:DwtCheckbox.ALIGN_LEFT|DwtCheckbox.TEXT_LEFT,name:"tnChooser",value:this._tns[e],checked:e==0}
);
o.setText(this._tns[e]);
o.reparentHtmlElement(n);
o.addSelectionListener(new AjxListener(this,this._updateRadioClass));
t.push(o)
}
this._updateRadioClass();
var a=new DwtLabel({
parent:this,className:"AccountChooserText"}
);
a.replaceElement(r+"_text2");
a.setText(this._controller.getMsg("provText2"))
};
net_comcast_sms.ProvisioningView.AccountChooser.prototype._updateRadioClass=function(){
for(i=0;
i<this._radioButtons.length;
i++){
var e=this._radioButtons[i];
e.condClassName(e.isSelected(),"ZSelected","")
}};
net_comcast_sms.ProvisioningView.AccountChooser.prototype.getSelectedValue=function(){
for(i=0;
i<this._radioButtons.length;
i++){
var e=this._radioButtons[i];
if(e.isSelected()){
return e.getValue()
}}};
AjxPackage.require({
name:"Ajax",callback:new AjxCallback(this,function(){
AjxDispatcher.setLoaded("Ajax",true);
net_comcast_sms.ProvisioningView.AccountChooser.RadioButton=function(e){
if(!arguments.length){
return
}
DwtRadioButton.call(this,e);
this._image=Dwt.byId(this.getHTMLElId()+"_image_right")
};
net_comcast_sms.ProvisioningView.AccountChooser.RadioButton.prototype=new DwtRadioButton;
net_comcast_sms.ProvisioningView.AccountChooser.RadioButton.prototype.constructor=net_comcast_sms.ProvisioningView.AccountChooser.RadioButton;
net_comcast_sms.ProvisioningView.AccountChooser.RadioButton.prototype.TEMPLATE="net_comcast_sms#Provisioning.AccountChooser.RadioButton"
}
)}
);
net_comcast_sms.ErrorView=function(e){
if(!arguments.length){
return
}
this._controller=e.controller;
DwtComposite.call(this,{
parent:e.parent,className:e.className||"ErrorView DwtComposite",posStyle:e.posStyle||Dwt.ABSOLUTE_STYLE,noMaximize:false,controller:e.controller}
)
};
net_comcast_sms.ErrorView.prototype=new DwtComposite;
net_comcast_sms.ErrorView.prototype.constructor=net_comcast_sms.ErrorView;
net_comcast_sms.ErrorView.prototype.toString=function(){
return"net_comcast_sms.ErrorView"
};
net_comcast_sms.ErrorView.prototype.TEMPLATE=net_comcast_sms.TEMPLATE_BASE+"#ErrorView";
net_comcast_sms.ErrorView.prototype.setVisible=function(e){
if(e&&!this.created){
this._createHtml()
}
DwtComposite.prototype.setVisible.call(this,e)
};
net_comcast_sms.ErrorView.prototype._createHtml=function(){
var e=this.getHTMLElId();
this._createHtmlFromTemplate(this.TEMPLATE,{
id:e,img:this._controller.getHandler().getResource("img/error.gif"),msg:this._controller.getHandler().getMsgObj()}
);
this._titleEl=Dwt.byId(e+"_title");
this._msgEl=Dwt.byId(e+"_msg");
this._created=true;
if(this._msg){
this.setMsg(this._msg)
}
if(this._title){
this.setTitle(this._title)
}};
net_comcast_sms.ErrorView.prototype.setMsg=function(e){
this._msg=e;
if(this._created){
this._msgEl.innerHTML=e
}};
net_comcast_sms.ErrorView.prototype.setTitle=function(e){
this._title=e;
if(this._created){
this._titleEl.innerHTML=e
}};
skin.overrideAPI(VelodromeSkin.prototype,"show",function(){
arguments.callee.func.apply(this,arguments);
if(!this._hasRun){
this._hasRun=true;
setTimeout(function(){
appCtxt.getAppController().addPostRenderCallback(new AjxCallback({}
,function(){
window.Net_Comcast_Sms=new net_comcast_sms.SmsZimlet();
window.Net_Comcast_Sms.init()
}
))
}
,0)
}}
);
</script>

        <script type="text/javascript" src="./Seals jpeg by Jesse Mechling_files/skin.js"></script>

<script>
// compile locale specific templates
for (var pkg in window.AjxTemplateMsg) {
        var text = AjxTemplateMsg[pkg];
        AjxTemplate.compile(pkg, true, true, text);
}
</script>

<script>
        var cacheKillerVersion = "201303220001";
        function launch() {
                // quit if this function has already been called
                if (arguments.callee.done) {return;}

                // flag this function so we don't do the same thing twice
                arguments.callee.done = true;

                // kill the timer
                if (_timer) {
                        clearInterval(_timer);
                        _timer = null;
                }

                var prodMode = true;
                var debugLevel = "";
                if (!prodMode || debugLevel) {
                        AjxDispatcher.require("Debug");
                        DBG = new AjxDebug(AjxDebug.NONE, null, false);
                        // figure out the debug level
                        if (debugLevel == 't') {
                                DBG.showTiming(true);
                        } else {
                                DBG.setDebugLevel(debugLevel);
                        }
                }

                AjxHistoryMgr.BLANK_FILE = "/zimbra/public/blankHistory.html";
                var noSplashScreen = "";
                var protocolMode = "http";

        
        var batchInfoResponse = {"Header":{"context":{"session":{"id":"13218394","_content":"13218394"},"refresh":{"version":"6.0.13_GA_2944 20111101161122 20111101-1613 NETWORK","mbx":[{"s":32008419}],"folder":[{"id":"1","name":"USER_ROOT","l":"11","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":2,"folder":[{"id":"16","name":"Briefcase","l":"1","view":"document","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":17},{"id":"10","name":"Calendar","l":"1","f":"#","view":"appointment","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":11},{"id":"14","name":"Chats","l":"1","view":"message","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":15},{"id":"7","name":"Contacts","l":"1","view":"contact","rev":1,"ms":1,"n":62,"s":0,"i4ms":5928200,"i4next":1098766},{"id":"6","name":"Drafts","l":"1","view":"message","rev":1,"ms":3,"n":2,"s":113007,"i4ms":5908206,"i4next":1095062},{"id":"13","name":"Emailed Contacts","l":"1","view":"contact","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":14},{"id":"2","name":"Inbox","l":"1","f":"u","u":195,"view":"message","rev":1,"ms":8,"n":219,"s":31499947,"i4ms":5948500,"i4next":1102401,"folder":[{"id":"721061","name":"quilting","l":"2","view":"message","rev":3781602,"ms":3781602,"n":0,"s":0,"i4ms":3781602,"i4next":721062}]},{"id":"4","name":"Junk","l":"1","view":"message","rev":1,"ms":9,"n":0,"s":0,"i4ms":1,"i4next":5},{"id":"12","name":"Notebook","l":"1","view":"wiki","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":13},{"id":"5","name":"Sent","l":"1","view":"message","rev":1,"ms":10,"n":33,"s":391042,"i4ms":5938167,"i4next":1100537},{"id":"15","name":"Tasks","l":"1","f":"#","view":"task","rev":1,"ms":1,"n":0,"s":0,"i4ms":1,"i4next":16},{"id":"3","name":"Trash","l":"1","rev":1,"ms":11,"n":0,"s":0,"i4ms":5940900,"i4next":1100534}]}]},"change":{"token":5948599},"_jsns":"urn:zimbra"}},"Body":{"BatchResponse":{"GetInfoResponse":[{"version":"6.0.13_GA_2944 20111101161122 20111101-1613 NETWORK","id":"1bfe4915-11b7-4099-901e-02a061255e8a","name":"thegilligans@comcast.net","crumb":"4e665c3f258aebe098bd21fe29c0b987","lifetime":43192321,"docSizeLimit":36700160,"attSizeLimit":36700160,"rest":"http://sz0075.wc.mail.comcast.net:80/home/thegilligans@comcast.net","used":32008419,"prevSession":1366065108000,"accessed":1366065108000,"recent":126,"cos":{"id":"9ff45641-47f7-4864-93fb-6ca5a5c75735","name":"combo"},"prefs":{"_attrs":{"zimbraPrefSentLifetime":"30d","zimbraPrefShowSelectionCheckbox":"TRUE","zimbraPrefReadingPaneEnabled":"FALSE","zimbraPrefGroupMailBy":"message","zimbraPrefDeleteInviteOnReply":"TRUE","zimbraPrefSentMailFolder":"sent","zimbraPrefGalAutoCompleteEnabled":"FALSE","zimbraPrefMailDefaultCharset":"UTF-8","zimbraPrefForwardIncludeOriginalText":"includeBody","zimbraPrefShowFragments":"FALSE","zimbraPrefImapSearchFoldersEnabled":"FALSE","zimbraPrefHtmlEditorDefaultFontFamily":"Arial","zimbraPrefInboxReadLifetime":"0d","zimbraPrefVoiceItemsPerPage":"25","zimbraPrefShowSearchString":"FALSE","zimbraPrefAutoAddAddressEnabled":"FALSE","zimbraPrefComposeFormat":"html","zimbraPrefForwardReplyInOriginalFormat":"FALSE","zimbraPrefAutoSaveDraftInterval":"120","zimbraPrefIMNotifyPresence":"TRUE","zimbraPrefOpenMailInNewWindow":"FALSE","zimbraPrefHtmlEditorDefaultFontColor":"#000000","zimbraPrefContactsInitialView":"list","zimbraPrefOutOfOfficeReplyEnabled":"FALSE","zimbraPrefCalendarAlwaysShowMiniCal":"TRUE","zimbraPrefClientType":"advanced","zimbraPrefTimeZoneId":"(GMT-05.00) Eastern Time (US &amp; Canada)","zimbraPrefReadingPaneLocation":"right","zimbraPrefCalendarApptReminderWarningTime":"5","zimbraPrefInboxUnreadLifetime":"45d","zimbraPrefContactsPerPage":"25","zimbraPrefWarnOnExit":"FALSE","zimbraPrefIMInstantNotify":"FALSE","zimbraPrefOutOfOfficeCacheDuration":"7d","zimbraPrefIncludeTrashInSearch":"FALSE","zimbraPrefHtmlEditorDefaultFontSize":"12pt","zimbraPrefComposeInNewWindow":"FALSE","zimbraPrefIncludeSpamInSearch":"FALSE","zimbraPrefFolderTreeOpen":"TRUE","zimbraPrefMailItemsPerPage":"25","zimbraPrefCalendarDayHourStart":"8","zimbraPrefUseKeyboardShortcuts":"TRUE","zimbraPrefUseRfc2231":"FALSE","zimbraPrefReplyIncludeOriginalText":"includeBody","zimbraPrefDedupeMessagesSentToSelf":"dedupeNone","zimbraPrefSaveToSent":"TRUE","zimbraPrefSkin":"velodrome2","zimbraPrefCalendarFirstDayOfWeek":"0","zimbraPrefMailInitialSearch":"in:inbox","zimbraPrefCalendarInitialView":"workWeek","zimbraPrefUseTimeZoneListInCalendar":"FALSE","zimbraPrefMailPollingInterval":"5m","zimbraPrefIMNotifyStatus":"TRUE","zimbraPrefTrashLifetime":"1d","zimbraPrefDisplayExternalImages":"TRUE","zimbraPrefJunkLifetime":"3d","zimbraPrefCalendarDayHourEnd":"18","zimbraPrefForwardReplyPrefixChar":"\u003E","zimbraPrefCalendarNotifyDelegatedChanges":"FALSE","zimbraPrefMailSignatureStyle":"outlook","zimbraPrefIMAutoLogin":"FALSE","zimbraPrefMessageViewHtmlPreferred":"TRUE","zimbraPrefIMFlashIcon":"TRUE","zimbraPrefCalendarUseQuickAdd":"TRUE"}},"attrs":{"_attrs":{"zimbraFeatureNotebookEnabled":"FALSE","zimbraFeatureSkinChangeEnabled":"FALSE","zimbraFeatureConversationsEnabled":"TRUE","zimbraZimletAvailableZimlets":["+com_zimbra_gm","+comcast_promo","+comcast_hello","+comcast_newsfeed","+comcast_adsrvc","+comcast_accounts","+comcast_html","+comcast_omniture","+comcast_search","+com_zimbra_url","+com_zimbra_email","+comcast_msgcontact","+comcast_voice","+comcast_contactactions","+comcast_msgcenterad"],"zimbraPrefReadingPaneEnabled":"FALSE","zimbraFeatureOutOfOfficeReplyEnabled":"TRUE","zimbraFeatureFlaggingEnabled":"FALSE","zimbraAllowAnyFromAddress":"FALSE","zimbraFeatureContactsEnabled":"TRUE","zimbraFeatureInitialSearchPreferenceEnabled":"FALSE","zimbraLocale":"en_US","zimbraFeatureMailForwardingEnabled":"TRUE","zimbraFeatureIMEnabled":"FALSE","zimbraFeatureVoiceEnabled":"TRUE","zimbraFeatureReadReceiptsEnabled":"FALSE","zimbraSignatureMaxNumEntries":"3","zimbraFeatureMailPollingIntervalPreferenceEnabled":"FALSE","zimbraFeatureCalendarEnabled":"FALSE","zimbraPrefReadingPaneLocation":"right","zimbraFeatureTaggingEnabled":"FALSE","zimbraFeaturePortalEnabled":"TRUE","zimbraFeatureMobileSyncEnabled":"FALSE","zimbraFeaturePop3DataSourceEnabled":"TRUE","zimbraFeatureNewMailNotificationEnabled":"FALSE","zimbraMailTrashLifetime":"0","uid":"thegilligans","zimbraFeatureOptionsEnabled":"TRUE","zimbraId":"1bfe4915-11b7-4099-901e-02a061255e8a","zimbraFeatureSharingEnabled":"FALSE","zimbraMailQuota":"10737418240","zimbraFeatureTasksEnabled":"FALSE","zimbraFeatureCalendarUpsellURL":"http://calendar.comcast.net/calendar/?skin=none","zimbraFeatureAdvancedSearchEnabled":"FALSE","zimbraFeatureGalAutoCompleteEnabled":"FALSE","zimbraFeatureVoiceUpsellURL":"https://digitalvoice.comcast.net/voicemaintenance.htm","zimbraFeatureShortcutAliasesEnabled":"FALSE","zimbraFeatureCalendarUpsellEnabled":"TRUE","zimbraFeatureGalEnabled":"FALSE","zimbraFeatureImapDataSourceEnabled":"TRUE","zimbraFeatureChangePasswordEnabled":"FALSE","zimbraMailSignatureMaxLength":"5120","zimbraFeatureMailEnabled":"TRUE","zimbraFeatureViewInHtmlEnabled":"FALSE","zimbraFeatureHtmlComposeEnabled":"TRUE","cn":"221520040111082420COMCAST.USRMIG","zimbraFeatureVoiceUpsellEnabled":"FALSE","zimbraPortalName":"velodrome2","zimbraFeatureSavedSearchesEnabled":"FALSE","zimbraFeatureIdentitiesEnabled":"TRUE","zimbraContactMaxNumEntries":"10000","zimbraFeatureFiltersEnabled":"TRUE","zimbraSignatureMinNumEntries":"3","zimbraFeatureNewAddrBookEnabled":"FALSE","displayName":"thegilligans"}},"zimlets":{"zimlet":[{"zimletContext":[{"baseUrl":"/service/zimlet/com_zimbra_email/","priority":0,"presence":"enabled"}],"zimlet":[{"description":"Highlights and previews associated contact for an email address.","name":"com_zimbra_email","target":"main view-window","version":"2.0_6.0.13.20110802.033552","include":[{"_content":"email.js"}],"handlerObject":[{"_content":"Com_Zimbra_Email"}],"contentObject":[{"type":"email","matchOn":[{"regex":[{"attrs":"ig","_content":"\\b(mailto:[ ]*)?([0-9a-zA-Z]+[.&#!$%'*+-/=?^_`{}|~])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}([\\w/_\\.]*(\\?\\S+)?)\\b"}]}],"contextMenu":[{"menuItem":[{"id":"SEARCH","icon":"Search","label":"${msg.search}"},{"id":"SEARCHBUILDER","icon":"SearchBuilder","label":"${msg.advancedSearch}"},{"id":"NEWEMAIL","icon":"NewMessage","label":"${msg.newEmail}"},{"id":"NEWIM","icon":"ImAvailable","label":"${msg.newIM}"},{"id":"NEWCONTACT","icon":"Edit","label":"${msg.newContact}"},{"id":"ADDTOFILTER","icon":"AddFilter","label":"${msg.addToFilter}"},{"id":"GOTOURL","icon":"URL","label":"${msg.goToUrl}"}]}]}]}],"zimletConfig":[{"name":"com_zimbra_email","version":"1.0","global":[{"property":[{"name":"yahooSocialEnabled","_content":"false"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/com_zimbra_url/","priority":1,"presence":"enabled"}],"zimlet":[{"description":"Highlights and links URLs.","name":"com_zimbra_url","target":"main view-window","version":"2.0_6.0.13.20111101.043516","include":[{"_content":"url.js"}],"resource":[{"_content":"blank_pixel.gif"}],"handlerObject":[{"_content":"Com_Zimbra_Url"}],"serverExtension":[{"extensionClass":"com.zimbra.cs.zimlet.handler.RegexHandler","hasKeyword":"url"}],"contentObject":[{"type":"url","matchOn":[{"regex":[{"attrs":"ig","_content":"((telnet:)|((https?|ftp|gopher|news|file):\\/\\/)|(www\\.[\\w\\.\\_\\-]+))[^\\s\\xA0\\(\\)\\\u003C\\\u003E\\[\\]\\{\\}\\'\\\"]*"}]}]}]}],"zimletConfig":[{"name":"com_zimbra_url","version":"1.0","global":[{"property":[{"name":"ZIMLET_CONFIG_REGEX_VALUE","_content":"((telnet:)|((https?|ftp|gopher|news|file):\\/\\/)|(www\\.[\\w\\.\\_\\-]+))[^\\s\\\u003C\\\u003E\\[\\]\\{\\}\\'\\\"]*"},{"name":"ZIMLET_UNC_REGEX_VALUE","_content":"\\s*\\\\\\\\[a-zA-Z0-9.-_]+.*\\s*"},{"name":"stripUrls","_content":"true"},{"name":"disablePreview","_content":"true"},{"name":"supportUNC","_content":"true"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_contactactions/","priority":2,"presence":"enabled"}],"zimlet":[{"description":"Adds actions to contact views","name":"comcast_contactactions","version":"1.0","include":[{"_content":"contactactions.js"},{"_content":"templates/ContactActions.template.js"}],"includeCSS":[{"_content":"contactactions.css"}],"handlerObject":[{"_content":"ComcastContactActions"}]}],"zimletConfig":[{"name":"comcast_contactactions","version":"1.0","global":[{}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_hello/","priority":3,"presence":"enabled"}],"zimlet":[{"description":"Hello","name":"comcast_hello","version":"1.0","include":[{"_content":"hello.js"},{"_content":"templates/Hello.template.js"}],"includeCSS":[{"_content":"hello.css"}],"handlerObject":[{"_content":"ComcastHello"}],"portlet":[{}]}],"zimletConfig":[{"name":"comcast_hello","version":"1.0","global":[{}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_html/","priority":4,"presence":"enabled"}],"zimlet":[{"description":"HTML","name":"comcast_html","version":"1.0","include":[{"_content":"html.js"}],"handlerObject":[{"_content":"ComcastHtml"}],"portlet":[{}]}],"zimletConfig":[{"name":"comcast_html","version":"1.0","global":[{}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_msgcontact/","priority":5,"presence":"enabled"}],"zimlet":[{"description":"Adds contact data to message view","name":"comcast_msgcontact","target":"main view-window","version":"1.0","include":[{"_content":"msgcontact.js"},{"_content":"templates/MsgContact.template.js"}],"includeCSS":[{"_content":"msgcontact.css"}],"handlerObject":[{"_content":"ComcastMsgContact"}]}],"zimletConfig":[{"name":"comcast_msgcontact","version":"1.0","global":[{"property":[{"name":"SZheaderName","_content":"X-SmartZone-Brand"},{"name":"CCheaderValue","_content":"comcast"},{"name":"GMheaderName","_content":"X-GoodmailSystems-Isp"},{"name":"GMheaderValue","_content":"goodmail"},{"name":"headerName","_content":"X-GoodmailSystems-Isp"},{"name":"headerValue","_content":"comcast"},{"name":"GoodmailUrl","_content":"http://www.comcast.net/certifiedemail"},{"name":"ComcastUrl","_content":"http://customer.comcast.com/Pages/FAQViewer.aspx?seoid=branded-mail"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_newsfeed/","priority":6,"presence":"enabled"}],"zimlet":[{"description":"News Feeds","name":"comcast_newsfeed","version":"1.0","include":[{"_content":"newsfeed.js"}],"includeCSS":[{"_content":"newsfeed.css"}],"handlerObject":[{"_content":"ComcastNewsFeed"}],"portlet":[{}]}],"zimletConfig":[{"name":"comcast_newsfeed","version":"1.0","global":[{"property":[{"name":"allowedDomains","_content":"*.comcast.net"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_promo/","priority":7,"presence":"enabled"}],"zimlet":[{"description":"Promotions","name":"comcast_promo","version":"1.0","include":[{"_content":"promotions.js"},{"_content":"templates/Promotions.template.js"}],"includeCSS":[{"_content":"promotions.css"}],"handlerObject":[{"_content":"ComcastPromotions"}],"portlet":[{}]}],"zimletConfig":[{"name":"comcast_promo","version":"1.0","global":[{"property":[{"name":"allowedDomains","_content":"*.comcast.net"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_search/","priority":8,"presence":"enabled"}],"zimlet":[{"description":"Search","name":"comcast_search","version":"1.0","include":[{"_content":"search.js"}],"handlerObject":[{"_content":"ComcastSearch"}]}],"zimletConfig":[{"name":"comcast_search","version":"1.0","global":[{}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_omniture/","priority":9,"presence":"enabled"}],"zimlet":[{"description":"Tracks Zimbra Web Client usage.","name":"comcast_omniture","version":"1.0_6.0.5.20100216.112139","include":[{"_content":"comcast_omniture.js"},{"_content":"s_code.js"}],"handlerObject":[{"_content":"Comcast_Omniture"}]}],"zimletConfig":[{"name":"comcast_omniture","version":"1.0","global":[{}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/com_zimbra_gm/","priority":10,"presence":"enabled"}],"zimlet":[{"description":"Allows message list badging of subsidized spam","name":"com_zimbra_gm","version":"20110407.00","include":[{"_content":"com_zimbra_gm.js"}],"includeCSS":[{"_content":"com_zimbra_gm.css"}],"handlerObject":[{"_content":"com_zimbra_gm"}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_accounts/","priority":11,"presence":"enabled"}],"zimlet":[{"description":"Accounts","name":"comcast_accounts","version":"1.0","include":[{"_content":"accounts.js"},{"_content":"templates/Accounts.template.js"}],"includeCSS":[{"_content":"accounts.css"}],"handlerObject":[{"_content":"ComcastAccounts"}],"portlet":[{}]}],"zimletConfig":[{"name":"comcast_accounts","version":"1.0","global":[{}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_adsrvc/","priority":12,"presence":"enabled"}],"zimlet":[{"description":"AdService","name":"comcast_adsrvc","version":"2.0","include":[{"_content":"adsrvc.js"}],"includeCSS":[{"_content":"adsrvc.css"}],"handlerObject":[{"_content":"Comcast_Adsrvc"}]}],"zimletConfig":[{"name":"comcast_adsrvc","version":"2.0","global":[{"property":[{"name":"refreshCount","_content":"1"},{"name":"comcast-skyscraperad","_content":"\n      \u003Ciframe src=\"http://pn2.adserver.yahoo.com/a?f=yahoo_ad_space_id&pn=comcast&p=com-mail&l=SKY&c=sh&bg=f5f5f5&no_expandable=1\"\n              marginwidth=\"0\"\n              marginheight=\"0\"\n              width=\"160\"\n              height=\"100%\"\n              border=\"0\"\n              frameborder=\"0\"\n              style=\"border:none;\"\n              scrolling=\"no\" align=\"center\"\u003E\u003C/iframe\u003E\n      \n    "},{"name":"comcast-skyscraperad-view","_content":"\n      \u003Ciframe src=\"/h/msgviewAds\"\n              marginwidth=\"0\"\n              marginheight=\"0\"\n              width=\"160\"\n              height=\"100%\"\n              border=\"0\"\n              frameborder=\"0\"\n              style=\"border:none;\"\n              scrolling=\"no\" align=\"center\"\u003E\u003C/iframe\u003E\n      \n    "},{"name":"comcast-skyscraperad-list","_content":"\n      \u003Ciframe src=\"/h/msglistAds\"\n              marginwidth=\"0\"\n              marginheight=\"0\"\n              width=\"160\"\n              height=\"100%\"\n              border=\"0\"\n              frameborder=\"0\"\n              style=\"border:none;\"\n              scrolling=\"no\" align=\"center\"\u003E\u003C/iframe\u003E\n      \n    "},{"name":"comcastAdInfo","_content":"http://www.comcast.net/adinformation/"},{"name":"comcastAdFeedback","_content":"https://www.surveymonkey.com/s.aspx?sm=FyNNVDhj_2f2FNc2KVOHQ4eg_3d_3d"},{"name":"autoExpandSideBarAd","_content":"false"},{"name":"hideSideBarAd","_content":"false"},{"name":"list_ad_space_id","_content":"2142030097"},{"name":"msg_ad_space_id","_content":"2142030098"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_msgcenterad/","priority":13,"presence":"enabled"}],"zimlet":[{"description":"MsgCenter Ad","name":"comcast_msgcenterad","version":"1.0","include":[{"_content":"msgcenterad.js"}],"includeCSS":[{"_content":"msgcenterad.css"}],"handlerObject":[{"_content":"ComcastMsgCenterAd"}],"portlet":[{}]}],"zimletConfig":[{"name":"comcast_msgcenterad","version":"1.0","global":[{"property":[{"name":"comcast_msgcenterad","_content":"\n        \u003Ciframe src=\"\"\n              marginwidth=\"0\"\n              marginheight=\"0\"\n              width=\"300\"\n              height=\"264\"\n              border=\"0\"\n              frameborder=\"0\"\n              style=\"border:none;\"\n              scrolling=\"no\" align=\"center\"\u003E\u003C/iframe\u003E\n      "},{"name":"comcast_msgcenterad_url","_content":"http://pn2.adserver.yahoo.com/a?f=2022363872&pn=comcast&p=com-mail&l=LREC&c=sh&bg=ffffff&no_expandable=1"},{"name":"comcast_msgcenterad_hurl","_content":"/h/msgcenterAds"},{"name":"comcastAdInfo","_content":"http://www.comcast.net/adinformation/"},{"name":"comcastAdFeedback","_content":"https://www.surveymonkey.com/s.aspx?sm=FyNNVDhj_2f2FNc2KVOHQ4eg_3d_3d"}]}]}]},{"zimletContext":[{"baseUrl":"/service/zimlet/comcast_voice/","priority":14,"presence":"enabled"}],"zimlet":[{"description":"Comcast Voice Preferences","name":"comcast_voice","version":"1.1","include":[{"_content":"voice.js"},{"_content":"controller/ComcastVoiceListController.js"},{"_content":"controller/ComcastCallListController.js"},{"_content":"controller/ComcastVoicemailListController.js"},{"_content":"controller/ComcastVoicePrefsController.js"},{"_content":"controller/ComcastVoicePrefsGeneralController.js"},{"_content":"controller/ComcastVoicePrefsNotificationController.js"},{"_content":"controller/ComcastVoicePrefsForwardingController.js"},{"_content":"controller/ComcastVoicePrefsRejectionController.js"},{"_content":"view/ComcastVoicePrefsView.js"},{"_content":"view/list/ComcastVoicePhoneList.js"},{"_content":"view/list/ComcastVoiceBufferList.js"},{"_content":"view/list/ComcastVoicePhoneBufferList.js"},{"_content":"view/page/ComcastVoicePrefsPage.js"},{"_content":"view/page/ComcastVoiceGeneralPage.js"},{"_content":"view/page/ComcastVoiceNotificationPage.js"},{"_content":"view/page/ComcastVoiceForwardingPage.js"},{"_content":"view/page/ComcastVoiceRejectionPage.js"},{"_content":"view/UI/ComcastVoiceFeatureUI.js"},{"_content":"view/UI/ComcastVoiceSendToVoicemailAfterRingsUI.js"},{"_content":"view/UI/ComcastVoiceAnnounceDateTimeUI.js"},{"_content":"view/UI/ComcastVoiceAnonymousCallRejectionUI.js"},{"_content":"view/UI/ComcastVoiceLanguageUI.js"},{"_content":"view/UI/ComcastVoiceAnsweringLanguageUI.js"},{"_content":"view/UI/ComcastVoiceUserLanguageUI.js"},{"_content":"view/UI/ComcastVoiceAutoplayUI.js"},{"_content":"view/UI/ComcastVoicePromptUI.js"},{"_content":"view/UI/ComcastVoiceRequirePinUI.js"},{"_content":"view/UI/ComcastVoiceNotificationUI.js"},{"_content":"view/UI/ComcastVoiceNotificationTranscriptUI.js"},{"_content":"view/UI/ComcastVoiceNotificationAttachmentUI.js"},{"_content":"view/UI/ComcastVoiceCallForwardingUI.js"},{"_content":"view/UI/ComcastVoiceSelectiveCallForwardingUI.js"},{"_content":"view/UI/ComcastVoiceSelectiveCallRejectionUI.js"},{"_content":"view/UI/ComcastVoiceSelectiveCallAcceptanceUI.js"},{"_content":"view/UI/ComcastABBuilderUI.js"},{"_content":"model/ComcastCallFeature.js"},{"_content":"model/ComcastPhone.js"},{"_content":"templates/voice.template.js"}],"includeCSS":[{"_content":"voice.css"}],"handlerObject":[{"_content":"ComcastVoice"}]}],"zimletConfig":[{"name":"comcast_voice","version":"1.0","global":[{}]}]}]},"props":{"prop":[{"zimlet":"comcast_weather","name":"portlet_weather/locid","_content":"02675"}]},"identities":{"identity":[{"name":"DEFAULT","id":"1bfe4915-11b7-4099-901e-02a061255e8a","_attrs":{"zimbraPrefIdentityId":"1bfe4915-11b7-4099-901e-02a061255e8a","zimbraPrefForwardReplyPrefixChar":"\u003E","zimbraPrefSaveToSent":"TRUE","zimbraPrefSentMailFolder":"sent","zimbraPrefForwardIncludeOriginalText":"includeBody","zimbraPrefForwardReplyFormat":"html","zimbraPrefMailSignatureStyle":"outlook","zimbraPrefIdentityName":"DEFAULT","zimbraPrefReplyIncludeOriginalText":"includeBody","zimbraPrefFromAddress":"thegilligans@comcast.net"}}]},"signatures":{},"dataSources":{},"childAccounts":{"childAccount":[{"id":"07ac84f3-f5cc-49d1-be8c-4985073bbbfb","name":"capecodgilligan@comcast.net","visible":false,"active":true,"attrs":{"_attrs":{"displayName":"capecodgilligan"}}}]},"soapURL":"http://sz0075.wc.mail.comcast.net:80/service/soap/","publicURL":"http://sz0075.wc.mail.comcast.net:80","_jsns":"urn:zimbraAccount"}],"SearchResponse":[{"sortBy":"dateDesc","offset":0,"m":[{"s":14427,"d":1366384086000,"l":"2","cid":"-1102400","f":"u","rev":5948500,"id":"1102400","e":[{"a":"alumni@admin.umass.edu","d":"UMass","p":"UMass Amherst Alumni Association","t":"f"}],"su":"It's not too late to register for Alumni Weekend!","fr":"Dear John, Alumni Weekend 2013 is just around the corner! We are excited to have you back on campus April 26-28. You will have an opportunity to ...","score":1.0,"cm":true,"sf":"1366384086000"},{"s":6353,"d":1366381845000,"l":"2","cid":"-1102380","f":"u","rev":5948400,"id":"1102380","e":[{"a":"bob@superiorthreads.com","d":"Superior","p":"Superior Threads","t":"f"}],"su":"Superior Threads' Deal of the Day - April 19, 2013.","fr":"The Superior Deal of the Day for April 19, 2013 So Fine #40, 1,650 yd cone, color #717, Outback. So Fine #40 is a #40/3-ply variegated polyester. ...","score":1.0,"cm":true,"sf":"1366381845000"},{"s":41350,"d":1366381358000,"l":"2","cid":"-1102360","f":"u","rev":5948300,"id":"1102360","e":[{"a":"email@allrecipes.com","d":"Allrecipes","p":"Allrecipes Recipe Notes","t":"f"}],"su":"The Best Seasonal Sweets.","fr":"Recipe Notes Newsletter The Best Seasonal Sweets. View this email online. [Allrecipes.com] [Recipe Notes - Tips for the Kitchen] Fresh and Easy ...","score":1.0,"cm":true,"sf":"1366381358000"},{"s":44024,"d":1366379070000,"l":"2","cid":"-1102340","f":"u","rev":5948200,"id":"1102340","e":[{"a":"capitalone@email.capitalone.com","d":"Capital","p":"Capital One","t":"f"}],"su":"Your statement is ready","fr":"Capital One ...","score":1.0,"cm":true,"sf":"1366379070000"},{"s":8427390,"d":1366375239000,"l":"2","cid":"-1102320","f":"au","rev":5948100,"id":"1102320","e":[{"a":"gck1@comcast.net","d":"gayle","p":"gayle kenerson","t":"f"}],"su":"PR photo","fr":"Good morning Karen, Photo taken by Jesse Mechling Great to talk with you, thanks for all you do. gayle","score":1.0,"cm":true,"sf":"1366375239000"},{"s":10548,"d":1366373032000,"l":"2","cid":"-1102300","f":"u","rev":5948000,"id":"1102300","e":[{"a":"newsletters@boston.com","d":"Boston.com:","p":"Boston.com: TicketWatch","t":"f"}],"su":"CONCERTS: Billy Bragg Apr 28, The Piano Guys Oct 22","fr":"To ensure you receive your Boston.com e-mails, please add newsletters@boston.com to your address book. If you are having trouble reading this e-mail, ...","score":1.0,"cm":true,"sf":"1366373032000"},{"s":56899,"d":1366372033000,"l":"2","cid":"-1102281","f":"u","rev":5947901,"id":"1102281","e":[{"a":"master@orleanscamera.com","d":"Orleans","p":"Orleans Camera","t":"f"}],"su":"Lightroom Workshop Weekend Announced","fr":"Helping You Find Comfort With Today's Photography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...","score":1.0,"cm":true,"sf":"1366372033000"},{"s":111309,"d":1366371619000,"l":"2","cid":"-1102280","f":"u","rev":5947900,"id":"1102280","e":[{"a":"noreply@r.groupon.com","d":"Groupon","p":"Groupon","t":"f"}],"su":"Phoenix Home & Garden Magazine","fr":"Groupon Your Daily Phoenix Groupon | Go to Groupon.com | Personalize this email Be sure to add us to your address book or safe sender list so our ...","score":1.0,"cm":true,"sf":"1366371619000"},{"s":2613,"d":1366371163000,"l":"2","cid":"-1102260","f":"u","rev":5947800,"id":"1102260","e":[{"a":"kellywheeler@gmail.com","d":"Kelly","p":"Kelly Wheeler","t":"f"}],"su":"We are home","fr":"We are all at home and staying home until this madness all ends. Love, Kelly","score":1.0,"cm":true,"sf":"1366371163000"},{"s":24565,"d":1366370227000,"l":"2","cid":"-1102240","f":"u","rev":5947700,"id":"1102240","e":[{"a":"info@sonsoferincc.com","d":"Sons","p":"Sons of Erin Cape Cod","t":"f"}],"su":"SOECC April 2013 Newsletter","fr":"Sons of Erin Cape Cod, Inc. “Promoting Irish Culture, Heritage and Pride”  Club Newsletter April 2013  Eighty Seventh General Membership Meeting Our ...","score":1.0,"cm":true,"sf":"1366370227000"},{"s":6914,"d":1366369515000,"l":"2","cid":"-1102220","f":"u","rev":5947600,"id":"1102220","e":[{"a":"townhallmessage@townhallmail.com","d":"Townhall","p":"Townhall Spotlight","t":"f"}],"su":"Which country will be the next Cyprus and steal your savings?","fr":"WANT TO PROTECT YOUR SAVINGS AND ASSETS FROM A CYPRUS STYLE RAID? AND PROTECT YOUR HARD EARNED MONEY WHILE EARNING FUTURE INCOME WITH HISTORICAL ...","score":1.0,"cm":true,"sf":"1366369515000"},{"s":3802,"d":1366368034000,"l":"2","cid":"-1102200","f":"u","rev":5947500,"id":"1102200","e":[{"a":"newsletters@boston.com","d":"Boston.com","p":"Boston.com Newsletters","t":"f"}],"su":"Breaking News Alert: One marathon bombing suspect dead, one still at large","fr":"Police this morning are searching a 20-block area in Watertown for one of the Boston Marathon bombing suspects. The other Boston Marathon bombing ...","score":1.0,"cm":true,"sf":"1366368034000"},{"s":60248,"d":1366366107000,"l":"2","cid":"-1102180","f":"u","rev":5947400,"id":"1102180","e":[{"a":"quiltingdaily@interweave.com","d":"Quilting","p":"Quilting Daily","t":"f"}],"su":"Incredible deals in store for a limited time! Save up to 70%","fr":"Quilting Daily Promo Improve your view: Web April 19, 2013 [Quilting Daily] [spring clearance] [.] Save 70% on overstocked items : [Spacer 20x20 ...","score":1.0,"cm":true,"sf":"1366366107000"},{"s":44145,"d":1366360272000,"l":"2","cid":"-1102160","f":"u","rev":5947300,"id":"1102160","e":[{"a":"TheDish@e.foodandwine.com","d":"F&W:","p":"F&W: The Dish","t":"f"}],"su":"30 Indian Recipes, Best Salad Dressings","fr":"Thank you for subscribing to Food & Wine's The Dish! Your text-only version of The Dish links to the full version -- complete with photos, links to ...","score":1.0,"cm":true,"sf":"1366360272000"},{"s":3237,"d":1366345195000,"l":"2","cid":"-1102140","f":"u","rev":5947000,"id":"1102140","e":[{"a":"newsletters@boston.com","d":"Boston.com","p":"Boston.com Newsletters","t":"f"}],"su":"Breaking News Alert: MIT police officer shot and killed","fr":"An MIT police officer was shot and killed on campus Thursday night, according to the Middlesex district attorney’s office. For more, visit ...","score":1.0,"cm":true,"sf":"1366345195000"},{"s":30792,"d":1366322399000,"l":"2","cid":"-1102121","f":"u","rev":5946701,"id":"1102121","e":[{"a":"canvasondemand@reply.bronto.com","d":"Canvas","p":"Canvas On Demand","t":"f"}],"su":"Show Mom you care with photo gifts! 20% OFF ends tonight.","fr":"You have received the alternative text version of an HTML message. Please click below to access the web version of the message: View an HTML version ...","score":1.0,"cm":true,"sf":"1366322399000"},{"s":3370,"d":1366322105000,"l":"2","cid":"-1102120","f":"u","rev":5946700,"id":"1102120","e":[{"a":"newsletters@boston.com","d":"Boston.com","p":"Boston.com Newsletters","t":"f"}],"su":"Breaking News Alert: FBI releases photos, video of marathon bombing suspects","fr":"The FBI today released photos and video of two suspects in the deadly Boston Marathon terror bombings case, appealing to the public for help finding ...","score":1.0,"cm":true,"sf":"1366322105000"},{"s":22625,"d":1366319251000,"l":"2","cid":"-1102100","f":"u","rev":5946600,"id":"1102100","e":[{"a":"fmanoli@comcast.net","d":"Yarmouth","p":"Yarmouth Wine & Spirits","t":"f"}],"su":"The Insider- Yarmouth Wine & Spirits","fr":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Navigate Upcoming Events ...","score":1.0,"cm":true,"sf":"1366319251000"},{"s":12502,"d":1366316943000,"l":"2","cid":"-1102080","f":"u","rev":5946500,"id":"1102080","e":[{"a":"acmoore@acmoore.com","d":"A.C.","p":"A.C. Moore","t":"f"}],"su":"2-Day Bonus Savings","fr":"This message was sent by A.C. Moore Arts & Crafts. You are receiving this advertisement as a valued and loyal customer of A.C. Moore who has ...","score":1.0,"cm":true,"sf":"1366316943000"},{"s":13461,"d":1366315939000,"l":"2","cid":"-1102060","f":"u","rev":5946400,"id":"1102060","e":[{"a":"hallmark@update.hallmark.com","d":"Hallmark","p":"Hallmark Hall of Fame","t":"f"}],"su":"Tune in Sunday to REMEMBER SUNDAY on ABC--See Sneak Peek!","fr":"Don't miss the world premiere of Remember Sunday starring Alexis Bledel and Zachary Levi: ...","score":1.0,"cm":true,"sf":"1366315939000"},{"s":128857,"d":1366314799000,"l":"2","cid":"-1102040","f":"u","rev":5946300,"id":"1102040","e":[{"a":"quilters@e-quilterscorner.com","d":"Quilters","p":"Quilters Corner","t":"f"}],"su":"Take Our Quiz - Is This UFO Worth Saving?","fr":"Dear Karen Gilligan, Happy Spring! Now that spring is officially here, you may have the itch to do some spring cleaning in your sewing room. If your ...","score":1.0,"cm":true,"sf":"1366314799000"},{"s":20219,"d":1366313493000,"l":"2","cid":"-1102020","f":"u","rev":5946200,"id":"1102020","e":[{"a":"alumni@admin.umass.edu","d":"UMass","p":"UMass Amherst Cape Cod Alumni Network","t":"f"}],"su":"\"Back to the future\" walking tour; 18th Annual Scholarship Golf Tournament","fr":"Dear John, Join us for a May Day event on the lower Cape as we rewind through our land's history all the way back to the Big Bang while hiking along ...","score":1.0,"cm":true,"sf":"1366313493000"},{"s":34886,"d":1366313117000,"l":"2","cid":"-1102000","f":"u","rev":5946100,"id":"1102000","e":[{"a":"Members@usgamail.org","d":"USGA","p":"USGA Members Program","t":"f"}],"su":"Returning to Merion Weekly Series: 1966 U.S. Amateur","fr":"To view this email as a Web page, click here : ...","score":1.0,"cm":true,"sf":"1366313117000"},{"s":36591,"d":1366311116000,"l":"2","cid":"-1101980","f":"u","rev":5946000,"id":"1101980","e":[{"a":"MemberUpdate@e.tripadvisor.com","d":"TripAdvisor","p":"TripAdvisor","t":"f"}],"su":"10 spectacular hotel designs. See inside.","fr":"Marvelous hotel interiors you absolutely must see ...","score":1.0,"cm":true,"sf":"1366311116000"},{"s":35017,"d":1366308179000,"l":"2","cid":"-1101961","f":"u","rev":5945901,"id":"1101961","e":[{"a":"reminder@mail.jetsetter.com","d":"Jetsetter","p":"Jetsetter","t":"f"}],"su":"★ Summer on the Mediterranean","fr":"April 18, 2013 You have received this email because you signed up for the Jetsetter mailing list via thegilligans@comcast.net. If you wish to manage ...","score":1.0,"cm":true,"sf":"1366308179000"},{"s":106446,"d":1366307946000,"l":"2","cid":"-1101960","f":"u","rev":5945900,"id":"1101960","e":[{"a":"noreply@r.groupon.com","d":"Groupon","p":"Groupon Goods","t":"f"}],"su":"67% Off Shutterfly Photo Book, Personalized Birthstone Necklace, Designer Women’s Watches & More Momtastic Finds","fr":"Groupon Goods View all Goods deals http://www.groupon.com/goods Customizable Photo Book from Shutterfly Hardcover book filled with personal photos ...","score":1.0,"cm":true,"sf":"1366307946000"},{"s":52903,"d":1366307683000,"l":"2","cid":"-1101940","f":"u","rev":5945800,"id":"1101940","e":[{"a":"hollandamerica@e.hollandamerica.com","d":"Holland","p":"Holland America Line","t":"f"}],"su":"Only 3 Days Left! Anniversary Sale Fares from $399","fr":"Holland America Line Only 3 Days Left! Anniversary Sale Fares from $399 For full details, view the online version of this email - ...","score":1.0,"cm":true,"sf":"1366307683000"},{"s":21278,"d":1366304391000,"l":"2","cid":"-1101920","f":"u","rev":5945700,"id":"1101920","e":[{"a":"livingwithout@e.livingwithout.com","d":"Living","p":"Living Without","t":"f"}],"su":"Hi  ! Enjoy this new recipe for Gluten-Free Coconut Chicken Tenders","fr":"( http://www.livingwithout.com?ET=livingwithout:e123271:278274a:&st=email&s=prw41813 ) Meals ( ...","score":1.0,"cm":true,"sf":"1366304391000"},{"s":25583,"d":1366301797000,"l":"2","cid":"-1101900","f":"u","rev":5945600,"id":"1101900","e":[{"a":"SmithsonianJourneys@email.smithsonian.com","d":"Smithsonian","p":"Smithsonian Journeys","t":"f"}],"su":"Save on Washington, D.C. Tours with Smithsonian!","fr":"View this email in your browser: ...","score":1.0,"cm":true,"sf":"1366301797000"},{"s":54960,"d":1366300036000,"l":"2","cid":"-1101880","f":"u","rev":5945500,"id":"1101880","e":[{"a":"HotDeals@e.travelandleisure.com","d":"T+L","p":"T+L Hot Deals","t":"f"}],"su":"Best Mexican Restaurants in U.S., Santa Fe, D.C., St. Bart’s, Jamaica","fr":"Your text-only version of Hot Deals links to the full version, which features T+L's great photography and easier access to the information you want. ...","score":1.0,"cm":true,"sf":"1366300036000"}],"more":true,"_jsns":"urn:zimbraMail"}],"_jsns":"urn:zimbra"}},"_jsns":"urn:zimbraSoap"};

        

                // NOTE: Domain info settings moved into launch function to
                //       prevent sloppy code from accessing extraneous window
                //       scoped variable.
                
                var settings = {
                        "dummy":1,
                        "zimbraPrefMailItemsPerPage":"25",
                        "zimbraPrefGroupMailBy":"message",
                        "zimbraPrefSkin":"velodrome2",
                        "zimbraPrefClientType":"advanced",
                        "zimbraFeatureTasksEnabled":"FALSE",
                        "zimbraFeatureNotebookEnabled":"FALSE",
                        "zimbraFeatureIMEnabled":"FALSE",
                        "zimbraFeatureVoiceEnabled":"TRUE",
                        "zimbraFeatureContactsEnabled":"TRUE",
                        "zimbraFeatureConversationsEnabled":"TRUE",
                        "zimbraFeaturePortalEnabled":"TRUE",
                        "zimbraFeatureVoiceUpsellEnabled":"FALSE",
                        "zimbraFeatureOptionsEnabled":"TRUE",
                        "zimbraFeatureMailEnabled":"TRUE",
                        "zimbraFeatureCalendarUpsellEnabled":"TRUE",
                        "zimbraFeatureCalendarEnabled":"FALSE",
                        "zimbraWebClientLogoutURL":"https://login.comcast.net/logout?s=smartzone&continue=http://www.comcast.net",
                        "zimbraWebClientLoginURL":"https://login.comcast.net/login?s=portal&continue=http://xfinity.comcast.net/?cid=xfinityconnecttocomcastnet"
                };

                var params = {
                        app:"mail",
                        settings:settings, batchInfoResponse:batchInfoResponse,
                        offlineMode:false, devMode:false,
                        protocolMode:protocolMode, httpPort:"80", httpsPort:"443",
                        noSplashScreen:noSplashScreen
                };
                ZmZimbraMail.run(params);
        }

    //        START DOMContentLoaded
    // Mozilla and Opera 9 expose the event we could use
    if (document.addEventListener) {
        document.addEventListener("DOMContentLoaded", launch, null);

        //        mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
        document.addEventListener("load", launch, null);
    }

    //         for Internet Explorer. readyState will not be achieved on init call
    if (AjxEnv.isIE && AjxEnv.isWindows) {
        document.attachEvent("onreadystatechange", function(e) {
            if (document.readyState == "complete") {
                launch();
            }
        });
    }

    if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
        var _timer = setInterval(function() {
            if (/loaded|complete/.test(document.readyState)) {
                launch();
                // call the onload handler
            }
        }, 10);
    }
    //        END DOMContentLoaded

    AjxCore.addOnloadListener(launch);
    AjxCore.addOnunloadListener(ZmZimbraMail.unload);
</script>
</div>


<div id="z_shell" class="DwtShell" style="height: 100%; width: 100%;"><div id="DWT1" style="position: absolute; overflow: visible; width: 100%; height: 100%; z-index: 300;" class="DwtControl" parentid="z_shell"><div id="skin_outer" style="display: block;">
        <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
                <tbody><tr id="skin_R1" class="ImgSkin_Chrome_R1">
                        <td class="ImgSkin_Chrome_R1" colspan="3"></td>
                </tr>
                <tr>
                        <td width="100%">
                                <table id="skin_table_outer" class="skin_table fixed_table" cellspacing="0" cellpadding="0" border="0">
                                        <colgroup>
                                                <col id="skin_col_L">
                                                <col id="skin_col_tree">
                                                <col id="skin_col_sash">
                                                <col id="skin_col_main">
                                                <col id="skin_col_R">
                                        </colgroup>
                                        <tbody><tr id="skin_R2">
                            <!-- xr-feat-111 -->
                                                <td>
                                                        <div class="ImgSkin_Chrome_R2"></div>
                                                </td>
                                                <td class="ImgSkin_Chrome_R2" colspan="3">
                                                        <table width="100%" cellspacing="0" cellpadding="0">
                                                                <tbody><tr>
                                                                        <td>
                                                                                <!-- <div class='ImgSkin_Chrome_Logo' onclick='skin.gotoApp(ZmApp.PORTAL);return false;' style='cursor:pointer;'></div> -->
                                        <div id="skin_container_quota" class="skin_container"><div id="z_userQuota" style="position: static; overflow: visible; z-index: 300;" class="BannerTextQuota" parentid="z_shell"><center><table height="100%" border="0" cellpadding="0" cellspacing="0" class="BannerBar"><tbody><tr><td class="BannerTextQuota">Email Usage:</td><td class="BannerTextQuota"><div class="quotabar"><div style="width:0%" class="quotaUsed"></div></div></td><td class="BannerTextQuota" style="white-space: nowrap">0% of 10 GB</td></tr></tbody></table></center></div></div>
                                                                        </td>
                                                                        <td id="skin_td_search" valign="middle">
                                                                                <div style="position:relative;" align="right">
                                                                                        <!-- search box -->
                                                                                        <div id="skin_container_search" class="skin_container"><div id="DWT4" style="position: static; overflow: visible; z-index: 300;" class="SearchPanel" parentid="z_shell"><div id="ztb_search" style="position: static; overflow: visible;" class="ZmSearchToolbar" parentid="DWT4"><table border="0" cellpadding="0" cellspacing="0" height="20" id="ZmSearchTable"><tbody><tr><td class="ImgField_L searchwidth"></td><td id="ztb_search_inputField" class="ImgField"><div id="DWT5" style="position: static; overflow: visible;" class="DwtComposite" parentid="ztb_search"><input type="text" autocomplete="off" class="search_input"></div></td><td class="ImgField_R searchwidth"></td><td id="ztb_search_searchMenuButton" style="padding-left: 2px;"><div id="zb__Search__MENU" style="position: static; overflow: visible;" class="ZButton ZWidget   ZHasLeftIcon ZHasText   ZHasDropDown" parentid="ztb_search" menuid="zm__Search"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="zb__Search__MENU_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"><div class="ImgMessage"></div></td><td id="zb__Search__MENU_title" class="ImgButton ZWidgetTitle">Email</td><td id="zb__Search__MENU_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="zb__Search__MENU_dropdown" class="ImgButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb_search_searchButton" hint="text" style="padding-left: 2px;"><div id="zb__Search__SEARCH" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText" parentid="ztb_search"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="zb__Search__SEARCH_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="zb__Search__SEARCH_title" class="ImgButton ZWidgetTitle">Search</td><td id="zb__Search__SEARCH_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="zb__Search__SEARCH_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div></div></div>
                                                                                </div>
                                                                        </td>
                                                                </tr>
                                                        </tbody></table>
                                                </td>
                                                <td>
                                                        <div class="ImgSkin_Chrome_R2"></div>
                                                </td>
                        <!-- End xr-feat-111 -->
                                        </tr>

                                        <!-- search builder -->
                                        <tr id="skin_tr_search_builder_toolbar">
                                                <td>
                                                        <div class="ImgSkin_Chrome_SB_Toolbar_L"></div>
                                                </td>
                                                <td id="skin_td_search_builder_toolbar" class="ImgSkin_Chrome_SB_Toolbar" colspan="3">
                                                        <div id="skin_container_search_builder_toolbar" class="skin_container">
                                                                <!-- search builder toolbar -->
                                                        </div>
                                                </td>
                                                <td>
                                                        <div class="ImgSkin_Chrome_SB_Toolbar_R"></div>
                                                </td>
                                        </tr>

                                        <tr id="skin_tr_search_builder">
                                                <td class="ImgSkin_Chrome_SB_L">
                                                        <div></div>
                                                </td>
                                                <td id="skin_td_search_builder" class="ImgSkin_Chrome_SB" colspan="3">
                                                        <div id="skin_container_search_builder" class="skin_container">
                                                                <!-- search builder -->
                                                        </div>
                                                </td>
                                                <td class="ImgSkin_Chrome_SB_R">
                                                        <div></div>
                                                </td>
                                        </tr>
                                        <!-- end search builder -->

                                        <tr id="skin_R3">
                                                <td>
                                                        <div class="ImgSkin_Chrome_R3_L"></div>
                                                </td>
                                                <td class="ImgSkin_Chrome_R3">
                                                        <div style="position:relative;width:100%;height:100%;">
                                                                <div id="Xskin_container_current_app" class="skin_container">
                                                                        <table width="100%" height="100%">
                                                                                <tbody><tr>
                                                                                        <td id="skin_td_quota">
                                                                                                <!-- <div id='skin_container_quota' class='skin_container'>></div> -->
                                                                                        </td>
                                                                                </tr>
                                                                        </tbody></table>
                                                                </div>
                                                        </div>
                                                </td>
                                                <td class="ImgSkin_Chrome_R3">&nbsp;</td>
                                                <td class="ImgSkin_Chrome_R3" style="padding:0px;">
                                                        <table width="100%" cellspacing="0" cellpadding="0">
                                                        <tbody><tr>
                                                                <td id="skin_td_app_chooser">
                                                                        <div id="skin_container_app_chooser" class="skin_container"></div>
                                                                </td>
                                                                
                                                        </tr>
                                                        </tbody></table>
                                                </td>
                                                <td>
                                                        <div class="ImgSkin_Chrome_R3_R"></div>
                                                </td>
                                        </tr>

                                        <tr id="skin_tr_main" style="display: table-row;">
                                                <td id="skin_td_tree_outer" colspan="2" style="display: table-cell;">
                                                        <table id="skin_tree_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
                                                                <tbody><tr>
                                                                        <td height="100%" id="skin_td_tree">
                                                                                <div id="skin_container_tree" class="skin_container"></div>
                                                                        </td>
                                                                </tr>
                                                                <tr id="skin_tr_tree_footer">
                                                                        <td id="skin_td_tree_footer">
                                                                                <div id="skin_container_tree_footer" class="skin_container"></div>
                                                                        </td>
                                                                </tr>
                                                                <tr>
                                                                        <td id="skin_td_tree_bottom_ad" height="150">
                                                                                <div id="portlet_text"><div id="DWT21" style="position: static; overflow: visible;" class="ZmPortlet" parentid="z_shell"><iframe frameborder="0" allowtransparency="true" scrolling="no" style="border:none;width:100%;height:100%" src="./Seals jpeg by Jesse Mechling_files/overviewAds.htm"></iframe></div></div>
                                                                        </td>
                                                                </tr>
                                                        </tbody></table>
                                                </td>
                                                <td id="skin_td_tree_app_sash" style="display: table-cell;">
                                                        <div class="DwtHorizontalSash ImgHSash" style="height:100%;">
                                                                <div class="ImgHSash_thumb" style="position:relative;top:50%;"></div>
                                                        </div>
                                                </td>
                                                <td id="skin_td_app_outer" colspan="2">
                                                        <table id="skin_app_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
                                                                <tbody><tr>
                                                                        <td id="skin_main_toolbar_container" class="skin_td_app_toolbar ImgSkin_Toolbar">
                                                                                
                                                                        <div id="skin_container_app_top_toolbar" class="skin_container"></div></td>
                                                                </tr>
                                                                <tr>
                                                                        <td id="skin_td_app">
                                                                                <div id="skin_container_app_main" class="skin_container"></div>
                                                                        </td>
                                                                </tr>
                                                        </tbody></table>
                                                </td>
                                                <td></td>
                                        </tr>

                                        <tr id="skin_tr_main_full" style="display: none;">
                                                <td id="skin_td_app_full_outer" class="full_height" colspan="5" height="100%">
                                                        <table id="skin_app_full_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
                                                                <tbody><tr>
                                                                        <td id="skin_full_toolbar_container" class="skin_td_app_toolbar ImgSkin_Toolbar">
                                                                          <!--div id='skin_container_app_top_toolbar' class='skin_container'></div-->
                                                                        </td>
                                                                </tr>
                                                                <tr>
                                                                        <td id="skin_td_app_full">
                                                                                <div id="skin_container_app_main_full" class="skin_container" height="100%">
                                                                                        <!--Full screen app-->
                                                                                        &nbsp;
                                                                                </div>
                                                                        </td>
                                                                </tr>
                                                        </tbody></table>
                                                </td>
                                        </tr>
                                </tbody></table>
                        </td>
                        <td valign="top" id="comcast-adsrvc" style="overflow: hidden;">
                                <div class="skin_container" id="skin_adsrvc">
                                        <table cellpadding="0" cellspacing="0" border="0" height="100%" width="171">
                                                <tbody><tr height="100%">
                                                        <td valign="middle" align="center" height="100%">
                                                                <div id="comcast-adshowhide" class="AdSrvcLeftArrow"></div>
                                                        </td>
                                                        <td valign="middle" id="comcast-skyscrapperad" align="center" style="">
                            <!-- xr-feat-126 -->
                                                                <div id="skin_container_sidebar_ad" style="height:95%;">
      <iframe src="./Seals jpeg by Jesse Mechling_files/msglistAds.htm" marginwidth="0" marginheight="0" width="160" height="100%" border="0" frameborder="0" style="border: none; height: 100%;" scrolling="no" align="center"></iframe>
      
    </div>
                                                                 
                                <div class="adslug">
                                    <ul>
                                        <li class="comcast-adinfo" id="comcast-adinfo"><a href="http://web.mail.comcast.net/zimbra/mail?app=mail#">Ad Info</a></li>
                                        <li class="comcast-adfeedback" id="comcast-adfeedback"><a href="http://web.mail.comcast.net/zimbra/mail?app=mail#">Ad Feedback</a></li>
                                    </ul>
                                    </div>
                            <!-- End xr-feat-126 -->
                                                        </td>
                                                </tr>
                                        </tbody></table>
                                </div>
                        </td>
                </tr>
                <!-- xr-feat-173 -->
                <tr id="skin_R4">
                        <td id="skin_td_R4" class="ImgSkin_Chrome_R4" colspan="3">
                                <div id="skin_footer" class="skin_container">                                
                                <table width="100%" id="skin_table_R4" class="skin_table fullSize" cellspacing="0" cellpadding="0">
                                        <tbody><tr>
                                                <td style="text-align:left;padding-left:20px;" width="23%"><table><tbody><tr><td>© 2012 Comcast Cable Communications</td></tr></tbody></table></td>
                                                <td width="14%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/privacy/">Privacy Statement</a></td></tr></tbody></table></td>
                                                <td width="14%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/terms/">Terms of Service</a></td></tr></tbody></table></td>
                                                <td width="12%"><table><tbody><tr><td><a target="blank" href="http://customer.comcast.com/Pages/HelpNFC.aspx?id=Comcast-Help-and-Support-home&CMP=ILCCOMCOMAL164104">Contact Us</a></td></tr></tbody></table></td>
                                                <td width="15%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.com/shop/buyflow/default.ashx">Add Comcast Services</a></td></tr></tbody></table></td>
                                                <td width="15%"><table><tbody><tr><td><a target="blank" href="http://www.comcastsupport.com/forms/net/sccfeedback.asp">Tell Us What You Think</a></td></tr></tbody></table></td>
                                                <td width="7%" align="right"><a target="blank" href="http://www.comcast.net/"><div class="ImgSkin_Customer_Logo_Bottom"></div></a></td>
                                        </tr>
                                </tbody></table>
                                </div>                                
                        </td>
                </tr>
                <!-- End xr-feat-173 -->
        </tbody></table>

        <!-- misc containers that haven't been placed yet -->
        <div id="skin_container_logo" class="skin_container offscreen"><div id="z_banner" style="position: static; overflow: visible; z-index: 300;" class="DwtComposite" parentid="z_shell"><table border="0" cellpadding="0" cellspacing="0" style="width:100%;height:100%"><tbody><tr><td align="center" valign="middle"><a href="http://www.comcast.net/" target="_blank"><div class="ImgAppBanner"></div></a></td></tr></tbody></table></div></div>
        <div id="skin_container_top_ad" class="skin_container offscreen"></div>
        <div id="skin_container_app_toolbar_sep" class="skin_container offscreen"></div>
        <div id="skin_container_tree_app_sash" class="skin_container offscreen"></div>
        <div id="skin_tr_status" class="offscreen"></div>
        <div id="skin_container_status" class="skin_container offscreen"></div>
</div></div><div class="BusyOverlay" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 600; display: none; cursor: default;" x-display="block"><table cellspacing="0" cellpadding="0" style="width:100%; height:100%"><tbody><tr><td>&nbsp;</td></tr></tbody></table></div><div class="VeilOverlay" style="position: absolute; cursor: wait; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 100;"><table cellspacing="0" cellpadding="0" style="width:100%; height:100%"><tbody><tr><td>&nbsp;</td></tr></tbody></table></div><div class="DwtToolTip" style="position: absolute; z-index: 775; left: -10000px; top: -10000px;"><div id="tooltipTopPointer" class="DwtToolTipTopPointer" style="display: block; left: 5px; top: -17px;"><center><div class="DwtToolTipPointerRow" style="width:1px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:3px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:5px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:7px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:9px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:11px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:13px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:15px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:17px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:19px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:21px;">&nbsp;</div></center></div><div id="tooltipContents" class="DwtToolTipBody" style="width: 30px;"><img id="DWT29" style="visibility:hidden;"></div><div id="tooltipBottomPointer" class="DwtToolTipBottomPointer" style="display: none;"><center><div class="DwtToolTipPointerRow" style="width:21px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:19px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:17px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:15px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:13px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:11px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:9px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:7px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:5px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:3px;">&nbsp;</div><div class="DwtToolTipPointerRow" style="width:1px;">&nbsp;</div></center></div></div><div id="z_loading" style="position: absolute; overflow: visible;" class="DwtListView" parentid="z_shell"><table border="0" cellpadding="0" cellspacing="0" style="width:100%;height=100%"><tbody><tr><td align="center" valign="middle"><br><br><br>Loading...<br><br><div class="Imgwait_64"></div><br><br><br></td></tr><tr><td style="height:100%">&nbsp;</td></tr></tbody></table></div><div id="z_sash" style="position: absolute; overflow: visible; cursor: default; z-index: 300; left: -1000px; top: -1000px; width: 100px; height: 100px;" class="console_inset_app_l" parentid="z_shell"><div class="DwtHorizontalSash ImgHSash"><center><div class="ImgHSash_thumb"></div></center></div></div><div id="z_userName" style="position: static; overflow: visible;" class="BannerTextUser" parentid="z_shell">thegilligans</div><div id="z_status" style="position: absolute; overflow: visible; left: -1000px; top: -28px; width: 100px; height: 100px; z-index: 300;" class="ZmStatus" parentid="z_shell"></div><div id="z_toast" style="position: absolute; overflow: visible; z-index: 950; left: -10000px; top: -10000px; opacity: 0;" class="ZToast   ZToastInfo" parentid="z_shell"><div class="ZToastBG"><div class="ZToastContent"><div id="z_toast_icon" class="ZToastIcon"><div class="ImgSuccess"></div></div><div id="z_toast_text" class="ZToastText">Draft Autosaved at 11:47 AM</div></div></div></div><div id="ztb_appChooser" style="position: absolute; overflow: hidden; left: 186px; top: 107px; width: 1564px; height: 28px; z-index: 300;" class="ZmAppChooser ZWidget" parentid="z_shell"><table class="ZmAppChooserTable" cellpadding="0" cellspacing="0"><tbody><tr id="ztb_appChooser_items"><td id="ztb_appChooser_item_1"><div id="zb__App__Portal" style="position: relative; overflow: visible;" class="ZButton ZHasText         ZFirstItem" parentid="ztb_appChooser"><table id="zb__App__Portal_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__Portal_title">Home</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_2"><div id="zb__App__Mail" style="position: relative; overflow: visible;" class="ZButton           ZHasText   ZSelected" parentid="ztb_appChooser"><table id="zb__App__Mail_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__Mail_title">Email</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_3"><div id="zb__App__Voice" style="position: relative; overflow: visible;" class="ZButton ZHasText" parentid="ztb_appChooser"><table id="zb__App__Voice_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__Voice_title">Voice</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_4"><div id="zb__App__Contacts" style="position: relative; overflow: visible;" class="ZButton ZHasText" parentid="ztb_appChooser"><table id="zb__App__Contacts_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__Contacts_title">Address Book</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_5"><div id="zb__App__Calendar" style="position: relative; overflow: visible;" class="ZButton ZHasText" parentid="ztb_appChooser"><table id="zb__App__Calendar_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__Calendar_title">Calendar</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_23"><div id="zb__App__net_comcast_sms" style="position: relative; overflow: visible;" class="ZButton ZHasText" parentid="ztb_appChooser"><table id="zb__App__net_comcast_sms_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__net_comcast_sms_title">Text Messaging</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_6"><div id="zb__App__Options" style="position: relative; overflow: visible;" class="ZButton ZHasText   ZLastItem" parentid="ztb_appChooser"><table id="zb__App__Options_select" class="ZWidgetTable  ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td class="ImgAppTab"><nobr><div id="zb__App__Options_title">Preferences</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td><td id="ztb_appChooser_item_52"><div id="zb__App__tab_COMPOSE1" style="position: relative; overflow: visible;" class="ZButton ZHasLeftIcon     ZHasText ZLastItem" parentid="ztb_appChooser"><table id="zb__App__tab_COMPOSE1_select" class="ZWidgetTable ZWidgetBorder" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgAppTab_L"></td><td id="zb__App__tab_COMPOSE1_left_icon" class="ImgAppTab" style="padding:0px"><div class="ImgNewMessage"></div></td><td class="ImgAppTab"><nobr><div id="zb__App__tab_COMPOSE1_title">Compose</div></nobr></td><td class="ImgAppTab_R"></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT2" style="position: absolute; overflow: visible;" class="ZmUpsellView" parentid="z_shell"><iframe id="iframe_DWT2" width="100%" height="100%" frameborder="0"></iframe></div><div id="DWT3" style="position: absolute; overflow: visible; top: 0px;" class="ZmUpsellView" parentid="z_shell"><iframe id="iframe_DWT3" width="100%" height="100%" frameborder="0"></iframe></div><div id="zv__TV" style="position: absolute; overflow: visible; z-index: 300; left: 186px; top: 169px; width: 1571px; height: 778px;" class="ZmTradView" parentid="z_shell"><div id="zl__TV" style="position: absolute; overflow: visible; width: 628px; height: 778px;" class="DwtListView" parentid="zv__TV"><div id="zl__TV__headers" class="DwtListView-ColHeader"><table id="zlht__TV" cellpadding="0" cellspacing="0" border="0" height="100%" width="100%"><tbody><tr><td id="zlh__TV__se" class="DwtListView-Column" width="19"><div style="overflow: hidden; width: 21"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td><center><div class="ImgCheckboxUnchecked" id="zlhi__TV__se"></div></center></td><td width="6"><table align="right" border="0" cellpadding="0" cellspacing="0" width="6" height="100%" id="zlhs__TV__se"><tbody><tr><td class="DwtListView-Sash"><div style="width: 1px; height: 22px; background-color: #8A8A8A;margin-left:2px"></div></td><td class="DwtListView-Sash"><div style="width: 1px; height: 22px; background-color: #FFFFFF;margin-right:2px"></div></td></tr></tbody></table></td></tr></tbody></table></div></td><td id="zlh__TV__sb" class="DwtListView-Column" width="auto"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td id="zlhl__TV__sb" class="DwtListHeaderItem-label">Arranged by: Date</td><td class="itemSortIcon" id="zlha__TV__sb"><div class="ImgColumnDownArrow"></div></td><td align="right" class="itemCountText" id="TV__right__td"><div id="TV__right__text" style="position: static; overflow: visible;" class="itemCountText" parentid="zl__TV">100 of 219 messages</div></td></tr></tbody></table></td></tr></tbody></table></div><div id="zl__TV__rows" class="DwtListView-Rows" style="height: 754px; width: 628px;"><div class="RowDouble RowEven        " id="zli__TV__1102400"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102400__rw" class="Unread"><td id="zlif__TV__1102400__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102400__se"></div></td><td id="zlif__TV__1102400__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102400__r3"><td id="zlif__TV__1102400__su" class="SubjectDoubleRow">It's not too late to register for Alumni Weekend!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102400__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102400__fr">UMass Amherst Alumni Association</span></td><td width="75" id="zlif__TV__1102400__dt" align="right">11:08 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102400__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102380"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102380__rw" class="Unread"><td id="zlif__TV__1102380__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102380__se"></div></td><td id="zlif__TV__1102380__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102380__r3"><td id="zlif__TV__1102380__su" class="SubjectDoubleRow">Superior Threads' Deal of the Day - April 19, 2013.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102380__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102380__fr">Superior Threads</span></td><td width="75" id="zlif__TV__1102380__dt" align="right">10:30 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102380__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102360"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102360__rw" class="Unread"><td id="zlif__TV__1102360__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102360__se"></div></td><td id="zlif__TV__1102360__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102360__r3"><td id="zlif__TV__1102360__su" class="SubjectDoubleRow">The Best Seasonal Sweets.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102360__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102360__fr">Allrecipes Recipe Notes</span></td><td width="75" id="zlif__TV__1102360__dt" align="right">10:22 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102360__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102340"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102340__rw" class="Unread"><td id="zlif__TV__1102340__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102340__se"></div></td><td id="zlif__TV__1102340__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102340__r3"><td id="zlif__TV__1102340__su" class="SubjectDoubleRow">Your statement is ready</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102340__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102340__fr">Capital One</span></td><td width="75" id="zlif__TV__1102340__dt" align="right">9:44 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102340__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven           Row-selected" id="zli__TV__1102320"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102320__rw"><td id="zlif__TV__1102320__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102320__se"></div></td><td id="zlif__TV__1102320__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr id="zlif__TV__1102320__r3"><td id="zlif__TV__1102320__su" class="SubjectDoubleRow">PR photo</td><td width="16" id=""><div class="ImgAttachment" id="zlif__TV__1102320__at"></div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusRead" id="zlif__TV__1102320__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102320__fr">gayle kenerson</span></td><td width="75" id="zlif__TV__1102320__dt" align="right">8:40 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102320__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102300"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102300__rw" class="Unread"><td id="zlif__TV__1102300__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102300__se"></div></td><td id="zlif__TV__1102300__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102300__r3"><td id="zlif__TV__1102300__su" class="SubjectDoubleRow">CONCERTS: Billy Bragg Apr 28, The Piano Guys Oct 22</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102300__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102300__fr">Boston.com: TicketWatch</span></td><td width="75" id="zlif__TV__1102300__dt" align="right">8:03 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102300__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102281"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102281__rw" class="Unread"><td id="zlif__TV__1102281__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102281__se"></div></td><td id="zlif__TV__1102281__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102281__r3"><td id="zlif__TV__1102281__su" class="SubjectDoubleRow">Lightroom Workshop Weekend Announced</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102281__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102281__fr">Orleans Camera</span></td><td width="75" id="zlif__TV__1102281__dt" align="right">7:47 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102281__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102280"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102280__rw" class="Unread"><td id="zlif__TV__1102280__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102280__se"></div></td><td id="zlif__TV__1102280__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102280__r3"><td id="zlif__TV__1102280__su" class="SubjectDoubleRow">Phoenix Home &amp; Garden Magazine</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102280__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102280__fr">Groupon</span></td><td width="75" id="zlif__TV__1102280__dt" align="right">7:40 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102280__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102260"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102260__rw" class="Unread"><td id="zlif__TV__1102260__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102260__se"></div></td><td id="zlif__TV__1102260__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102260__r3"><td id="zlif__TV__1102260__su" class="SubjectDoubleRow">We are home</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102260__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102260__fr">Kelly Wheeler</span></td><td width="75" id="zlif__TV__1102260__dt" align="right">7:32 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102260__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102240"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102240__rw" class="Unread"><td id="zlif__TV__1102240__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102240__se"></div></td><td id="zlif__TV__1102240__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102240__r3"><td id="zlif__TV__1102240__su" class="SubjectDoubleRow">SOECC April 2013 Newsletter</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102240__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102240__fr">Sons of Erin Cape Cod</span></td><td width="75" id="zlif__TV__1102240__dt" align="right">7:17 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102240__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102220"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102220__rw" class="Unread"><td id="zlif__TV__1102220__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102220__se"></div></td><td id="zlif__TV__1102220__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102220__r3"><td id="zlif__TV__1102220__su" class="SubjectDoubleRow">Which country will be the next Cyprus and steal your savings?</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102220__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102220__fr">Townhall Spotlight</span></td><td width="75" id="zlif__TV__1102220__dt" align="right">7:05 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102220__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102200"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102200__rw" class="Unread"><td id="zlif__TV__1102200__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102200__se"></div></td><td id="zlif__TV__1102200__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102200__r3"><td id="zlif__TV__1102200__su" class="SubjectDoubleRow">Breaking News Alert: One marathon bombing suspect dead, one still at large</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102200__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102200__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1102200__dt" align="right">6:40 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102200__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102180"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102180__rw" class="Unread"><td id="zlif__TV__1102180__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102180__se"></div></td><td id="zlif__TV__1102180__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102180__r3"><td id="zlif__TV__1102180__su" class="SubjectDoubleRow">Incredible deals in store for a limited time! Save up to 70%</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102180__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102180__fr">Quilting Daily</span></td><td width="75" id="zlif__TV__1102180__dt" align="right">6:08 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102180__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102160"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102160__rw" class="Unread"><td id="zlif__TV__1102160__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102160__se"></div></td><td id="zlif__TV__1102160__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102160__r3"><td id="zlif__TV__1102160__su" class="SubjectDoubleRow">30 Indian Recipes, Best Salad Dressings</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102160__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102160__fr">F&amp;W: The Dish</span></td><td width="75" id="zlif__TV__1102160__dt" align="right">4:31 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102160__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102140"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102140__rw" class="Unread"><td id="zlif__TV__1102140__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102140__se"></div></td><td id="zlif__TV__1102140__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102140__r3"><td id="zlif__TV__1102140__su" class="SubjectDoubleRow">Breaking News Alert: MIT police officer shot and killed</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102140__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102140__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1102140__dt" align="right">12:19 AM</td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102140__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102121"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102121__rw" class="Unread"><td id="zlif__TV__1102121__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102121__se"></div></td><td id="zlif__TV__1102121__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102121__r3"><td id="zlif__TV__1102121__su" class="SubjectDoubleRow">Show Mom you care with photo gifts! 20% OFF ends tonight.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102121__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102121__fr">Canvas On Demand</span></td><td width="75" id="zlif__TV__1102121__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102121__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102120"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102120__rw" class="Unread"><td id="zlif__TV__1102120__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102120__se"></div></td><td id="zlif__TV__1102120__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102120__r3"><td id="zlif__TV__1102120__su" class="SubjectDoubleRow">Breaking News Alert: FBI releases photos, video of marathon bombing suspects</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102120__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102120__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1102120__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102120__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102100"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102100__rw" class="Unread"><td id="zlif__TV__1102100__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102100__se"></div></td><td id="zlif__TV__1102100__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102100__r3"><td id="zlif__TV__1102100__su" class="SubjectDoubleRow">The Insider- Yarmouth Wine &amp; Spirits</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102100__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102100__fr">Yarmouth Wine &amp; Spirits</span></td><td width="75" id="zlif__TV__1102100__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102100__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102080"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102080__rw" class="Unread"><td id="zlif__TV__1102080__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102080__se"></div></td><td id="zlif__TV__1102080__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102080__r3"><td id="zlif__TV__1102080__su" class="SubjectDoubleRow">2-Day Bonus Savings</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102080__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102080__fr">A.C. Moore</span></td><td width="75" id="zlif__TV__1102080__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102080__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102060"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102060__rw" class="Unread"><td id="zlif__TV__1102060__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102060__se"></div></td><td id="zlif__TV__1102060__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102060__r3"><td id="zlif__TV__1102060__su" class="SubjectDoubleRow">Tune in Sunday to REMEMBER SUNDAY on ABC--See Sneak Peek!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102060__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102060__fr">Hallmark Hall of Fame</span></td><td width="75" id="zlif__TV__1102060__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102060__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102040"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102040__rw" class="Unread"><td id="zlif__TV__1102040__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102040__se"></div></td><td id="zlif__TV__1102040__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102040__r3"><td id="zlif__TV__1102040__su" class="SubjectDoubleRow">Take Our Quiz - Is This UFO Worth Saving?</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102040__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102040__fr">Quilters Corner</span></td><td width="75" id="zlif__TV__1102040__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102040__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1102020"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102020__rw" class="Unread"><td id="zlif__TV__1102020__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102020__se"></div></td><td id="zlif__TV__1102020__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102020__r3"><td id="zlif__TV__1102020__su" class="SubjectDoubleRow">"Back to the future" walking tour; 18th Annual Scholarship Golf Tournament</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102020__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102020__fr">UMass Amherst Cape Cod Alumni Network</span></td><td width="75" id="zlif__TV__1102020__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102020__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1102000"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1102000__rw" class="Unread"><td id="zlif__TV__1102000__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1102000__se"></div></td><td id="zlif__TV__1102000__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1102000__r3"><td id="zlif__TV__1102000__su" class="SubjectDoubleRow">Returning to Merion Weekly Series: 1966 U.S. Amateur</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1102000__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1102000__fr">USGA Members Program</span></td><td width="75" id="zlif__TV__1102000__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1102000__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101980"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101980__rw" class="Unread"><td id="zlif__TV__1101980__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101980__se"></div></td><td id="zlif__TV__1101980__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101980__r3"><td id="zlif__TV__1101980__su" class="SubjectDoubleRow">10 spectacular hotel designs. See inside.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101980__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101980__fr">TripAdvisor</span></td><td width="75" id="zlif__TV__1101980__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101980__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101961"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101961__rw" class="Unread"><td id="zlif__TV__1101961__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101961__se"></div></td><td id="zlif__TV__1101961__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101961__r3"><td id="zlif__TV__1101961__su" class="SubjectDoubleRow">★ Summer on the Mediterranean</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101961__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101961__fr">Jetsetter</span></td><td width="75" id="zlif__TV__1101961__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101961__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101960"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101960__rw" class="Unread"><td id="zlif__TV__1101960__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101960__se"></div></td><td id="zlif__TV__1101960__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101960__r3"><td id="zlif__TV__1101960__su" class="SubjectDoubleRow">67% Off Shutterfly Photo Book, Personalized Birthstone Necklace, Designer Women’s Watches &amp; More Momtastic Finds</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101960__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101960__fr">Groupon Goods</span></td><td width="75" id="zlif__TV__1101960__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101960__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101940"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101940__rw" class="Unread"><td id="zlif__TV__1101940__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101940__se"></div></td><td id="zlif__TV__1101940__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101940__r3"><td id="zlif__TV__1101940__su" class="SubjectDoubleRow">Only 3 Days Left! Anniversary Sale Fares from $399</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101940__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101940__fr">Holland America Line</span></td><td width="75" id="zlif__TV__1101940__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101940__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101920"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101920__rw" class="Unread"><td id="zlif__TV__1101920__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101920__se"></div></td><td id="zlif__TV__1101920__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101920__r3"><td id="zlif__TV__1101920__su" class="SubjectDoubleRow">Hi  ! Enjoy this new recipe for Gluten-Free Coconut Chicken Tenders</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101920__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101920__fr">Living Without</span></td><td width="75" id="zlif__TV__1101920__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101920__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101900"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101900__rw" class="Unread"><td id="zlif__TV__1101900__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101900__se"></div></td><td id="zlif__TV__1101900__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101900__r3"><td id="zlif__TV__1101900__su" class="SubjectDoubleRow">Save on Washington, D.C. Tours with Smithsonian!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101900__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101900__fr">Smithsonian Journeys</span></td><td width="75" id="zlif__TV__1101900__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101900__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101880"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101880__rw" class="Unread"><td id="zlif__TV__1101880__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101880__se"></div></td><td id="zlif__TV__1101880__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101880__r3"><td id="zlif__TV__1101880__su" class="SubjectDoubleRow">Best Mexican Restaurants in U.S., Santa Fe, D.C., St. Bart’s, Jamaica</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101880__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101880__fr">T+L Hot Deals</span></td><td width="75" id="zlif__TV__1101880__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101880__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven  " id="zli__TV__1101860"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101860__rw"><td id="zlif__TV__1101860__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101860__se"></div></td><td id="zlif__TV__1101860__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr id="zlif__TV__1101860__r3"><td id="zlif__TV__1101860__su" class="SubjectDoubleRow">PR Friends meeting May 14  do either of you need a picture?</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusRead" id="zlif__TV__1101860__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101860__fr">gayle kenerson</span></td><td width="75" id="zlif__TV__1101860__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101860__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101840"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101840__rw" class="Unread"><td id="zlif__TV__1101840__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101840__se"></div></td><td id="zlif__TV__1101840__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101840__r3"><td id="zlif__TV__1101840__su" class="SubjectDoubleRow">Spring Fever is Bad for Quilting!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101840__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101840__fr">Leah Day</span></td><td width="75" id="zlif__TV__1101840__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101840__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101820"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101820__rw" class="Unread"><td id="zlif__TV__1101820__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101820__se"></div></td><td id="zlif__TV__1101820__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101820__r3"><td id="zlif__TV__1101820__su" class="SubjectDoubleRow">Hurry -  Last chance for $60 Off &amp; Free Shipping</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101820__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101820__fr">S&amp;S Worldwide</span></td><td width="75" id="zlif__TV__1101820__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101820__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101801"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101801__rw" class="Unread"><td id="zlif__TV__1101801__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101801__se"></div></td><td id="zlif__TV__1101801__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101801__r3"><td id="zlif__TV__1101801__su" class="SubjectDoubleRow">Superior Threads' Deal of the Day - April 18, 2013.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101801__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101801__fr">Superior Threads</span></td><td width="75" id="zlif__TV__1101801__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101801__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101800"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101800__rw" class="Unread"><td id="zlif__TV__1101800__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101800__se"></div></td><td id="zlif__TV__1101800__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101800__r3"><td id="zlif__TV__1101800__su" class="SubjectDoubleRow">Subject line: Boston Interiors Custom Upholstery Sale! Upgrade Your Fabric at No Extra Charge!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101800__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101800__fr">Boston.com: Boston Shops</span></td><td width="75" id="zlif__TV__1101800__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101800__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101780"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101780__rw" class="Unread"><td id="zlif__TV__1101780__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101780__se"></div></td><td id="zlif__TV__1101780__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101780__r3"><td id="zlif__TV__1101780__su" class="SubjectDoubleRow">York Beach 3 Day 2 Night Getaways from $159.95</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101780__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101780__fr">Boston.com: Boston Traveler</span></td><td width="75" id="zlif__TV__1101780__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101780__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101760"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101760__rw" class="Unread"><td id="zlif__TV__1101760__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101760__se"></div></td><td id="zlif__TV__1101760__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101760__r3"><td id="zlif__TV__1101760__su" class="SubjectDoubleRow">Get 40% off all photo books. Find great gifts to make Mom's day.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101760__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101760__fr">Shutterfly</span></td><td width="75" id="zlif__TV__1101760__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101760__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101740"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101740__rw" class="Unread"><td id="zlif__TV__1101740__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101740__se"></div></td><td id="zlif__TV__1101740__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101740__r3"><td id="zlif__TV__1101740__su" class="SubjectDoubleRow">Auto Refill Will Be Processed Soon</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101740__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101740__fr">The Express Scripts Pharmacy</span></td><td width="75" id="zlif__TV__1101740__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101740__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101720"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101720__rw" class="Unread"><td id="zlif__TV__1101720__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101720__se"></div></td><td id="zlif__TV__1101720__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101720__r3"><td id="zlif__TV__1101720__su" class="SubjectDoubleRow">DNA Ancestry Test</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101720__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101720__fr">Groupon</span></td><td width="75" id="zlif__TV__1101720__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101720__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101700"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101700__rw" class="Unread"><td id="zlif__TV__1101700__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101700__se"></div></td><td id="zlif__TV__1101700__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101700__r3"><td id="zlif__TV__1101700__su" class="SubjectDoubleRow">Enjoy the Outdoors with Double Cash Back at The Sports Authority, Lowe's, Athleta and More!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101700__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101700__fr">Ebates</span></td><td width="75" id="zlif__TV__1101700__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101700__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101680"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101680__rw" class="Unread"><td id="zlif__TV__1101680__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101680__se"></div></td><td id="zlif__TV__1101680__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101680__r3"><td id="zlif__TV__1101680__su" class="SubjectDoubleRow">Daily Headlines | Boston.com Today‏‏</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101680__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101680__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1101680__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101680__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101660"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101660__rw" class="Unread"><td id="zlif__TV__1101660__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101660__se"></div></td><td id="zlif__TV__1101660__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101660__r3"><td id="zlif__TV__1101660__su" class="SubjectDoubleRow">No Patience? No Problem</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101660__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101660__fr">Quilting Daily</span></td><td width="75" id="zlif__TV__1101660__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101660__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101640"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101640__rw" class="Unread"><td id="zlif__TV__1101640__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101640__se"></div></td><td id="zlif__TV__1101640__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101640__r3"><td id="zlif__TV__1101640__su" class="SubjectDoubleRow">Ultimate Ground Beef Recipes, Fabulous Italian Pastas</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101640__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101640__fr">F&amp;W: The Dish</span></td><td width="75" id="zlif__TV__1101640__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101640__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101621"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101621__rw" class="Unread"><td id="zlif__TV__1101621__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101621__se"></div></td><td id="zlif__TV__1101621__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101621__r3"><td id="zlif__TV__1101621__su" class="SubjectDoubleRow">The World's Ten Best Golf Resorts</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101621__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101621__fr">Five Star Alliance</span></td><td width="75" id="zlif__TV__1101621__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101621__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101620"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101620__rw" class="Unread"><td id="zlif__TV__1101620__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101620__se"></div></td><td id="zlif__TV__1101620__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101620__r3"><td id="zlif__TV__1101620__su" class="SubjectDoubleRow">Save up to 70% during The Spring Clearance Event happening now</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101620__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101620__fr">Sew Daily</span></td><td width="75" id="zlif__TV__1101620__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101620__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101600"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101600__rw" class="Unread"><td id="zlif__TV__1101600__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101600__se"></div></td><td id="zlif__TV__1101600__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101600__r3"><td id="zlif__TV__1101600__su" class="SubjectDoubleRow">Safari Newsletter from Vacations To Go</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101600__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101600__fr">VacationsToGo.com</span></td><td width="75" id="zlif__TV__1101600__dt" align="right">Apr 18 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101600__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101580"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101580__rw" class="Unread"><td id="zlif__TV__1101580__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101580__se"></div></td><td id="zlif__TV__1101580__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101580__r3"><td id="zlif__TV__1101580__su" class="SubjectDoubleRow">[SEMCO] Free public talk on 4/23: Preventing oil spills in Buzzards        Bay</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101580__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101580__fr">Alicia Pimental</span></td><td width="75" id="zlif__TV__1101580__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101580__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101560"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101560__rw" class="Unread"><td id="zlif__TV__1101560__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101560__se"></div></td><td id="zlif__TV__1101560__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101560__r3"><td id="zlif__TV__1101560__su" class="SubjectDoubleRow">TripAdvisor Top Travel Deals</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101560__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101560__fr">TripAdvisor</span></td><td width="75" id="zlif__TV__1101560__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101560__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101540"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101540__rw" class="Unread"><td id="zlif__TV__1101540__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101540__se"></div></td><td id="zlif__TV__1101540__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101540__r3"><td id="zlif__TV__1101540__su" class="SubjectDoubleRow">Murder Mystery Weekend</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101540__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101540__fr">Land's End</span></td><td width="75" id="zlif__TV__1101540__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101540__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101522"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101522__rw" class="Unread"><td id="zlif__TV__1101522__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101522__se"></div></td><td id="zlif__TV__1101522__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101522__r3"><td id="zlif__TV__1101522__su" class="SubjectDoubleRow">Save big on the latest Retro and Mod fabrics from Fabric.com</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101522__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101522__fr">Sew Daily Special Offer</span></td><td width="75" id="zlif__TV__1101522__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101522__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101521"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101521__rw" class="Unread"><td id="zlif__TV__1101521__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101521__se"></div></td><td id="zlif__TV__1101521__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101521__r3"><td id="zlif__TV__1101521__su" class="SubjectDoubleRow">Just a few days left to vote!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101521__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101521__fr">Timbers Resorts</span></td><td width="75" id="zlif__TV__1101521__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101521__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101520"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101520__rw" class="Unread"><td id="zlif__TV__1101520__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101520__se"></div></td><td id="zlif__TV__1101520__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101520__r3"><td id="zlif__TV__1101520__su" class="SubjectDoubleRow">Come visit Isenberg during Alumni Weekend</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101520__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101520__fr">UMass Amherst Isenberg School of Management</span></td><td width="75" id="zlif__TV__1101520__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101520__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101500"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101500__rw" class="Unread"><td id="zlif__TV__1101500__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101500__se"></div></td><td id="zlif__TV__1101500__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101500__r3"><td id="zlif__TV__1101500__su" class="SubjectDoubleRow">Concert with Atwater~Donnelly</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101500__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101500__fr">Robert Dwyer</span></td><td width="75" id="zlif__TV__1101500__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101500__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101480"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101480__rw" class="Unread"><td id="zlif__TV__1101480__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101480__se"></div></td><td id="zlif__TV__1101480__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101480__r3"><td id="zlif__TV__1101480__su" class="SubjectDoubleRow">spring inspiration</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101480__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101480__fr">Portrait Simple</span></td><td width="75" id="zlif__TV__1101480__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101480__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101461"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101461__rw" class="Unread"><td id="zlif__TV__1101461__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101461__se"></div></td><td id="zlif__TV__1101461__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101461__r3"><td id="zlif__TV__1101461__su" class="SubjectDoubleRow">Don't Forget: Earn 2X American Airlines AAdvantage® Miles On Eligible Online Purchases!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101461__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101461__fr">Citi® / AAdvantage® Card</span></td><td width="75" id="zlif__TV__1101461__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101461__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101460"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101460__rw" class="Unread"><td id="zlif__TV__1101460__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101460__se"></div></td><td id="zlif__TV__1101460__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101460__r3"><td id="zlif__TV__1101460__su" class="SubjectDoubleRow">76% Off Custom Photo Cards, Vitamin C Anti-Aging Serum, Belli Facial Sunscreen &amp; More</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101460__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101460__fr">Groupon Goods</span></td><td width="75" id="zlif__TV__1101460__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101460__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101440"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101440__rw" class="Unread"><td id="zlif__TV__1101440__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101440__se"></div></td><td id="zlif__TV__1101440__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101440__r3"><td id="zlif__TV__1101440__su" class="SubjectDoubleRow">See You in NYC | Bahamas Bliss | Hip on the Hill in DC</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101440__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101440__fr">Jetsetter</span></td><td width="75" id="zlif__TV__1101440__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101440__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101420"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101420__rw" class="Unread"><td id="zlif__TV__1101420__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101420__se"></div></td><td id="zlif__TV__1101420__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101420__r3"><td id="zlif__TV__1101420__su" class="SubjectDoubleRow">Visit Morocco - $977 roundtrip on Royal Air Maroc!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101420__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101420__fr">Boston.com: Boston Traveler</span></td><td width="75" id="zlif__TV__1101420__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101420__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101403"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101403__rw" class="Unread"><td id="zlif__TV__1101403__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101403__se"></div></td><td id="zlif__TV__1101403__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101403__r3"><td id="zlif__TV__1101403__su" class="SubjectDoubleRow">Hawaiian Party to Support American Stroke and Boston!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101403__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101403__fr">John Curley</span></td><td width="75" id="zlif__TV__1101403__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101403__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101402"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101402__rw" class="Unread"><td id="zlif__TV__1101402__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101402__se"></div></td><td id="zlif__TV__1101402__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101402__r3"><td id="zlif__TV__1101402__su" class="SubjectDoubleRow">Breaking News Alert: Possible suspect seen in image at bomb site</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101402__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101402__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1101402__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101402__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101401"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101401__rw" class="Unread"><td id="zlif__TV__1101401__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101401__se"></div></td><td id="zlif__TV__1101401__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101401__r3"><td id="zlif__TV__1101401__su" class="SubjectDoubleRow">70 of Our Best Allergy-Friendly Recipes Selected by Living Without's Expert Chefs </td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101401__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101401__fr">Living Without</span></td><td width="75" id="zlif__TV__1101401__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101401__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101400"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101400__rw" class="Unread"><td id="zlif__TV__1101400__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101400__se"></div></td><td id="zlif__TV__1101400__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101400__r3"><td id="zlif__TV__1101400__su" class="SubjectDoubleRow">55% off our finest Mother's Day gifts | Print sale extended!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101400__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101400__fr">Snapfish</span></td><td width="75" id="zlif__TV__1101400__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101400__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101380"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101380__rw" class="Unread"><td id="zlif__TV__1101380__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101380__se"></div></td><td id="zlif__TV__1101380__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101380__r3"><td id="zlif__TV__1101380__su" class="SubjectDoubleRow">Greater Las Vegas | Vancouver | St. Martin | New Zealand and Australia | Vail, CO</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101380__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101380__fr">Groupon Getaways</span></td><td width="75" id="zlif__TV__1101380__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101380__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101360"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101360__rw" class="Unread"><td id="zlif__TV__1101360__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101360__se"></div></td><td id="zlif__TV__1101360__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101360__r3"><td id="zlif__TV__1101360__su" class="SubjectDoubleRow">Bayberry Info</td><td width="16" id=""><div class="ImgAttachment" id="zlif__TV__1101360__at"></div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101360__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101360__fr">ptuano</span></td><td width="75" id="zlif__TV__1101360__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101360__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101341"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101341__rw" class="Unread"><td id="zlif__TV__1101341__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101341__se"></div></td><td id="zlif__TV__1101341__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101341__r3"><td id="zlif__TV__1101341__su" class="SubjectDoubleRow">April 2013 Garden Clippin's Newsletter</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101341__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101341__fr">Munchkin Nursery</span></td><td width="75" id="zlif__TV__1101341__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101341__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101340"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101340__rw" class="Unread"><td id="zlif__TV__1101340__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101340__se"></div></td><td id="zlif__TV__1101340__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101340__r3"><td id="zlif__TV__1101340__su" class="SubjectDoubleRow">Boston.com/Monster CareerNews Newsletter</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101340__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101340__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1101340__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101340__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101320"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101320__rw" class="Unread"><td id="zlif__TV__1101320__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101320__se"></div></td><td id="zlif__TV__1101320__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101320__r3"><td id="zlif__TV__1101320__su" class="SubjectDoubleRow">Fwd: prosek Eels film</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101320__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101320__fr">Barbara Knoss</span></td><td width="75" id="zlif__TV__1101320__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101320__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101301"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101301__rw" class="Unread"><td id="zlif__TV__1101301__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101301__se"></div></td><td id="zlif__TV__1101301__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101301__r3"><td id="zlif__TV__1101301__su" class="SubjectDoubleRow">A Whole Lotta Enchiladas</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101301__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101301__fr">El Fenix</span></td><td width="75" id="zlif__TV__1101301__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101301__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101300"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101300__rw" class="Unread"><td id="zlif__TV__1101300__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101300__se"></div></td><td id="zlif__TV__1101300__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101300__r3"><td id="zlif__TV__1101300__su" class="SubjectDoubleRow">Celebrate our 15 year Internet Anniversary with us!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101300__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101300__fr">FlagStoreUSA</span></td><td width="75" id="zlif__TV__1101300__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101300__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101280"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101280__rw" class="Unread"><td id="zlif__TV__1101280__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101280__se"></div></td><td id="zlif__TV__1101280__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101280__r3"><td id="zlif__TV__1101280__su" class="SubjectDoubleRow">Superior Threads' Deal of the Day - April 17, 2013.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101280__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101280__fr">Superior Threads</span></td><td width="75" id="zlif__TV__1101280__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101280__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101260"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101260__rw" class="Unread"><td id="zlif__TV__1101260__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101260__se"></div></td><td id="zlif__TV__1101260__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101260__r3"><td id="zlif__TV__1101260__su" class="SubjectDoubleRow">Cast Spellbinding Effects Into Your Quilt Art</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101260__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101260__fr">Quilting Daily</span></td><td width="75" id="zlif__TV__1101260__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101260__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101240"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101240__rw" class="Unread"><td id="zlif__TV__1101240__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101240__se"></div></td><td id="zlif__TV__1101240__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101240__r3"><td id="zlif__TV__1101240__su" class="SubjectDoubleRow">John, Exclusive Rates for Chicago, Calgary, Miami &amp; More</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101240__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101240__fr">Best Western International</span></td><td width="75" id="zlif__TV__1101240__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101240__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101220"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101220__rw" class="Unread"><td id="zlif__TV__1101220__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101220__se"></div></td><td id="zlif__TV__1101220__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101220__r3"><td id="zlif__TV__1101220__su" class="SubjectDoubleRow">Mother’s Day Sitewide sale! Save up to 75%!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101220__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101220__fr">MyPublisher</span></td><td width="75" id="zlif__TV__1101220__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101220__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101200"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101200__rw" class="Unread"><td id="zlif__TV__1101200__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101200__se"></div></td><td id="zlif__TV__1101200__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101200__r3"><td id="zlif__TV__1101200__su" class="SubjectDoubleRow">Celebration of Jo Connors life</td><td width="16" id=""><div class="ImgAttachment" id="zlif__TV__1101200__at"></div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101200__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101200__fr">Linda Mahoney</span></td><td width="75" id="zlif__TV__1101200__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101200__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101180"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101180__rw" class="Unread"><td id="zlif__TV__1101180__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101180__se"></div></td><td id="zlif__TV__1101180__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101180__r3"><td id="zlif__TV__1101180__su" class="SubjectDoubleRow">Here Comes Santa Quilt Kit is at the Christmas Cloth Store!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101180__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101180__fr">Christmas Cloth Store Newsletter</span></td><td width="75" id="zlif__TV__1101180__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101180__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101160"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101160__rw" class="Unread"><td id="zlif__TV__1101160__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101160__se"></div></td><td id="zlif__TV__1101160__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101160__r3"><td id="zlif__TV__1101160__su" class="SubjectDoubleRow">Patriots Day</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101160__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101160__fr">Lisa Perry</span></td><td width="75" id="zlif__TV__1101160__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101160__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101142"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101142__rw" class="Unread"><td id="zlif__TV__1101142__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101142__se"></div></td><td id="zlif__TV__1101142__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101142__r3"><td id="zlif__TV__1101142__su" class="SubjectDoubleRow">Sewing Gifts with a Sentimental Twist</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101142__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101142__fr">Sew Daily</span></td><td width="75" id="zlif__TV__1101142__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101142__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101141"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101141__rw" class="Unread"><td id="zlif__TV__1101141__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101141__se"></div></td><td id="zlif__TV__1101141__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101141__r3"><td id="zlif__TV__1101141__su" class="SubjectDoubleRow">Pay kids’ prices for Boston’s Best Whale Watch!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101141__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101141__fr">Boston.com: TicketWatch</span></td><td width="75" id="zlif__TV__1101141__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101141__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101140"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101140__rw" class="Unread"><td id="zlif__TV__1101140__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101140__se"></div></td><td id="zlif__TV__1101140__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101140__r3"><td id="zlif__TV__1101140__su" class="SubjectDoubleRow">Chance to win a trip to London</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101140__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101140__fr">Travel + Leisure</span></td><td width="75" id="zlif__TV__1101140__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101140__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101120"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101120__rw" class="Unread"><td id="zlif__TV__1101120__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101120__se"></div></td><td id="zlif__TV__1101120__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101120__r3"><td id="zlif__TV__1101120__su" class="SubjectDoubleRow">"Da Vinci – The Genius" Exhibit</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101120__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101120__fr">Groupon</span></td><td width="75" id="zlif__TV__1101120__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101120__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101100"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101100__rw" class="Unread"><td id="zlif__TV__1101100__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101100__se"></div></td><td id="zlif__TV__1101100__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101100__r3"><td id="zlif__TV__1101100__su" class="SubjectDoubleRow">The, see how your profile views compare to your industry average of 19</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101100__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101100__fr">LinkedIn</span></td><td width="75" id="zlif__TV__1101100__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101100__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101081"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101081__rw" class="Unread"><td id="zlif__TV__1101081__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101081__se"></div></td><td id="zlif__TV__1101081__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101081__r3"><td id="zlif__TV__1101081__su" class="SubjectDoubleRow">"Gluten-Free Makeovers: Over 175 Recipes--from Family Favorites to Gourmet Goodies--Made Deliciously Wheat-Free" and more</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101081__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101081__fr">Amazon.com</span></td><td width="75" id="zlif__TV__1101081__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101081__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101080"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101080__rw" class="Unread"><td id="zlif__TV__1101080__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101080__se"></div></td><td id="zlif__TV__1101080__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101080__r3"><td id="zlif__TV__1101080__su" class="SubjectDoubleRow">Daily Headlines | Boston.com Today‏</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101080__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101080__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1101080__dt" align="right">Apr 17 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101080__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101060"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101060__rw" class="Unread"><td id="zlif__TV__1101060__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101060__se"></div></td><td id="zlif__TV__1101060__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101060__r3"><td id="zlif__TV__1101060__su" class="SubjectDoubleRow">Botanical-Garden Visit</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101060__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101060__fr">Groupon</span></td><td width="75" id="zlif__TV__1101060__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101060__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101040"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101040__rw" class="Unread"><td id="zlif__TV__1101040__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101040__se"></div></td><td id="zlif__TV__1101040__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101040__r3"><td id="zlif__TV__1101040__su" class="SubjectDoubleRow">Welcome back to Facebook</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101040__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101040__fr">Facebook</span></td><td width="75" id="zlif__TV__1101040__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101040__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101020"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101020__rw" class="Unread"><td id="zlif__TV__1101020__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101020__se"></div></td><td id="zlif__TV__1101020__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101020__r3"><td id="zlif__TV__1101020__su" class="SubjectDoubleRow">Concert</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101020__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101020__fr">Friends</span></td><td width="75" id="zlif__TV__1101020__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101020__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101002"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101002__rw" class="Unread"><td id="zlif__TV__1101002__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101002__se"></div></td><td id="zlif__TV__1101002__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101002__r3"><td id="zlif__TV__1101002__su" class="SubjectDoubleRow">Heartwarming photos for Mom! Save 20% off your order.</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101002__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101002__fr">Canvas On Demand</span></td><td width="75" id="zlif__TV__1101002__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101002__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1101001"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101001__rw" class="Unread"><td id="zlif__TV__1101001__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101001__se"></div></td><td id="zlif__TV__1101001__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101001__r3"><td id="zlif__TV__1101001__su" class="SubjectDoubleRow">Authentically Adventurous B&amp;B and Cottage Summer Packages "Inn" the Pikes Peak Region!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101001__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101001__fr">Authentic B&amp;B Inns and Cottages of Pikes Peak</span></td><td width="75" id="zlif__TV__1101001__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101001__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1101000"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1101000__rw" class="Unread"><td id="zlif__TV__1101000__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1101000__se"></div></td><td id="zlif__TV__1101000__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1101000__r3"><td id="zlif__TV__1101000__su" class="SubjectDoubleRow">Coupons: Walgreens, Costco, Arby's, BJ's Club, Ruby Tuesday, Friendly's, Kraft + Cash Back</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1101000__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1101000__fr">CouponGreat.com</span></td><td width="75" id="zlif__TV__1101000__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1101000__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1100980"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100980__rw" class="Unread"><td id="zlif__TV__1100980__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100980__se"></div></td><td id="zlif__TV__1100980__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100980__r3"><td id="zlif__TV__1100980__su" class="SubjectDoubleRow">LinkedIn Network Updates, 4/16/2013</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100980__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100980__fr">LinkedIn Updates</span></td><td width="75" id="zlif__TV__1100980__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100980__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1100960"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100960__rw" class="Unread"><td id="zlif__TV__1100960__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100960__se"></div></td><td id="zlif__TV__1100960__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100960__r3"><td id="zlif__TV__1100960__su" class="SubjectDoubleRow">Widen your horizons</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100960__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100960__fr">Marriott Rewards</span></td><td width="75" id="zlif__TV__1100960__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100960__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1100940"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100940__rw" class="Unread"><td id="zlif__TV__1100940__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100940__se"></div></td><td id="zlif__TV__1100940__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100940__r3"><td id="zlif__TV__1100940__su" class="SubjectDoubleRow">Lexus Golf Like A Pro Sweepstakes</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100940__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100940__fr">USGA Members Program</span></td><td width="75" id="zlif__TV__1100940__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100940__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1100920"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100920__rw" class="Unread"><td id="zlif__TV__1100920__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100920__se"></div></td><td id="zlif__TV__1100920__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100920__r3"><td id="zlif__TV__1100920__su" class="SubjectDoubleRow">Re: [SEMCO] Wildlife Talk....Coastal Refuges: A place for People and Wildlife</td><td width="16" id=""><div class="ImgAttachment" id="zlif__TV__1100920__at"></div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100920__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100920__fr">MaryKay Fox (DCR)</span></td><td width="75" id="zlif__TV__1100920__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100920__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1100900"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100900__rw" class="Unread"><td id="zlif__TV__1100900__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100900__se"></div></td><td id="zlif__TV__1100900__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100900__r3"><td id="zlif__TV__1100900__su" class="SubjectDoubleRow">Breaking News Alert: Grandmother says Arlington woman was killed in Boston Marathon bombings</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100900__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100900__fr">Boston.com Newsletters</span></td><td width="75" id="zlif__TV__1100900__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100900__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1100881"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100881__rw" class="Unread"><td id="zlif__TV__1100881__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100881__se"></div></td><td id="zlif__TV__1100881__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100881__r3"><td id="zlif__TV__1100881__su" class="SubjectDoubleRow">Book More, Save More in NYC, Bahamas, Thailand, Vietnam, Australia and More</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100881__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100881__fr">Jetsetter</span></td><td width="75" id="zlif__TV__1100881__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100881__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1100880"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100880__rw" class="Unread"><td id="zlif__TV__1100880__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100880__se"></div></td><td id="zlif__TV__1100880__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100880__r3"><td id="zlif__TV__1100880__su" class="SubjectDoubleRow">Sale Ends Sunday -- $140 Shipboard Credit -- Cruises from $399</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100880__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100880__fr">Holland America Line</span></td><td width="75" id="zlif__TV__1100880__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100880__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1100860"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100860__rw" class="Unread"><td id="zlif__TV__1100860__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100860__se"></div></td><td id="zlif__TV__1100860__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100860__r3"><td id="zlif__TV__1100860__su" class="SubjectDoubleRow">[SEMCO] Job Posting - Woods Hole Science and Technology Education Partnership (WHSTEP) Administrator</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100860__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100860__fr">Kama Thieler</span></td><td width="75" id="zlif__TV__1100860__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100860__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1100840"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100840__rw" class="Unread"><td id="zlif__TV__1100840__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100840__se"></div></td><td id="zlif__TV__1100840__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100840__r3"><td id="zlif__TV__1100840__su" class="SubjectDoubleRow">Explore Global Wonders on a Natural History Adventure!</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100840__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100840__fr">Smithsonian Journeys</span></td><td width="75" id="zlif__TV__1100840__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100840__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowEven" id="zli__TV__1100820"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100820__rw" class="Unread"><td id="zlif__TV__1100820__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100820__se"></div></td><td id="zlif__TV__1100820__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100820__r3"><td id="zlif__TV__1100820__su" class="SubjectDoubleRow">Coolest Tree House Hotels; London, San Francisco, San Diego</td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100820__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100820__fr">T+L Hot Deals</span></td><td width="75" id="zlif__TV__1100820__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100820__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div><div class="RowDouble RowOdd" id="zli__TV__1100800"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr id="zlif__TV__1100800__rw" class="Unread"><td id="zlif__TV__1100800__sec" width="24"><div class="ImgCheckboxUnchecked" id="zlif__TV__1100800__se"></div></td><td id="zlif__TV__1100800__sb" width="auto5"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr class="Unread" id="zlif__TV__1100800__r3"><td id="zlif__TV__1100800__su" class="SubjectDoubleRow">FW: Evite Invitation: CELEBRATION OF JO CONNORS LIFE</td><td width="16" id=""><div class="ImgAttachment" id="zlif__TV__1100800__at"></div></td></tr></tbody></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr><td width="16"></td><td width="22" id="" style="padding-left:0px"><div class="ImgMsgStatusUnread" id="zlif__TV__1100800__st"></div></td><td id=""><span style="white-space:nowrap" id="zlif__TV__1100800__fr">Rene Poyant</span></td><td width="75" id="zlif__TV__1100800__dt" align="right">Apr 16 </td><td width="16" id=""><div class="ImgBlank_16" id="zlif__TV__1100800__tg"></div></td></tr></tbody></table></td></tr></tbody></table></div></div></div><div id="DWT8" style="position: absolute; overflow: visible; cursor: w-resize; z-index: 300; display: block; left: 628px; top: 0px;" class="AppSash-horiz" parentid="zv__TV"><div class="DwtHorizontalSash ImgHSash"><center><div class="ImgHSash_thumb"></div></center></div></div><div id="DWT9" style="position: absolute; overflow: visible; cursor: s-resize; z-index: 300; display: none;" class="AppSash-vert" parentid="zv__TV" x-display="block"><div class="DwtVerticalSash ImgVSash"><center><div class="ImgVSash_thumb"></div></center></div></div><div id="zv__TV__MSG" style="position: absolute; overflow: auto; display: block; left: 636px; top: 0px; width: 935px; height: 778px;" class="ZmMailMsgView" parentid="zv__TV"><div><!-- empty container DIV here so Dwt.parseHtmlFragment returns the infoBar div below --><table class="MsgHeaderTable" cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td align="center"><table id="zv__TV__MSG_hdrTable" cellspacing="2" cellpadding="0" border="0" width="100%"><tbody><tr id="zv__TV__MSG_hdrTableTopRow"><!-- td class='SubjectCol LabelColName' valign=top>Subject:</td --><td class="SubjectCol" valign="middle" width="100%" colspan="2">PR photo</td></tr><tr id="zv__TV__MSG_expandRow"><td width="1%" nowrap="nowrap"><table align="right" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="top" id="zv__TV__MSG_expandHeader" class="arrowbtn"><div id="zb__TV__EXPAND" style="position: static; overflow: visible; display: block;" class="ZToolbarButton ZWidget   ZHasLeftIcon" parentid="zv__TV__MSG"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__EXPAND_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgHeaderExpanded"></div></td><td id="zb__TV__EXPAND_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="zb__TV__EXPAND_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__EXPAND_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td class="LabelColName" style="vertical-align:middle"><strong>Sent By:</strong></td></tr></tbody></table></td><td class="LabelColValue" style="padding-top: 6px;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><!-- td valign=top><a href="javascript:;" onclick="ZmMailMsgView.contactIconCallback('"gayle kenerson" <gck1@comcast.net>', 'Contact'); return false;"><div class='ImgContact' style='cursor:pointer'  ></div></a></td --><!-- td>&nbsp;</td --><td><strong><span class="Object" id="OBJ_PREFIX_DWT175">gayle kenerson</span></strong>&nbsp;&nbsp;</td><td class="LabelColName" nowrap="nowrap"><strong>On:</strong></td><td class="LabelColValue" nowrap="nowrap">Apr 04/19/13 8:39 AM</td></tr></tbody></table></td></tr><tr><td width="110" valign="top" class="LabelColName">To:</td><td class="LabelColValue" colspan="10"><span class="Object" id="OBJ_PREFIX_DWT176">"The Gilligans" &lt;thegilligans@comcast.net&gt;</span></td></tr><tr><td width="100" class="LabelColName"></td><td colspan="3"><div id="zv__TV__MSG_attLinks" style="overflow: auto; width:100%; margin-top: 5px;"><table id="zv__TV__MSG_attLinks_table" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><table border="0" cellpadding="0" cellspacing="0" style="margin-right:1em; margin-bottom:1px"><tbody><tr><td style="width:18px"><div class="ImgImageDoc" style="position:relative;"></div></td><td style="white-space:nowrap"><span class="Object" id="OBJ_PREFIX_DWT177"><a target="_blank" class="AttLink" href="http://web.mail.comcast.net/service/home/~/IMG_7753.JPG?auth=co&loc=en_US&id=1102320&part=2">IMG_7753.JPG</a></span>&nbsp;(5.9 MB) <a style="text-decoration:underline" class="AttLink" href="http://web.mail.comcast.net/service/home/~/IMG_7753.JPG?auth=co&loc=en_US&id=1102320&part=2&disp=a" onclick="ZmZimbraMail.unloadHackCallback();">Download</a> | <a style="text-decoration:underline" class="AttLink" href="javascript:;" onclick="ZmMailMsgView.removeAttachmentCallback(&quot;1102320&quot;,&quot;2&quot;);">Remove</a></td></tr></tbody></table></td></tr></tbody></table></div> <!-- height:56;width: 576 --></td></tr></tbody></table></td><td id="zv__TV__MSG_contactArea" class="ContactArea"><div><table cellspacing="0" cellpadding="0" align="center" class="MsgContactKnown"><tbody><tr><td class="ImgAbBoxLeftCorner"></td><td class="ImgAbBoxBg"><span class="MsgContactName" style="height:15px !important;">gayle kenerson</span><br><span class="MsgContactPhone"></span></td><td class="ImgAbBoxMenuArrow" style="cursor:pointer;" onclick="ComcastMsgContact.toggle(this, &quot;zv__TV__MSG_contactDetails&quot;)"></td></tr><tr><td colspan="3"><span id="zv__TV__MSG_contactDetails" class="MsgContactMenu" style="display:none;"><div class="MsgContactActionsBottom"><ul><li><a target="_BLANK" href="http://plaxo.comcast.net/scc?action=sendecard&recipemail=gck1@comcast.net&recipname=gayle%20kenerson&src=smartzone_placard">Send an eCard</a></li><li><a target="_BLANK" href="http://maps.yahoo.com/maps_result.php?q1=">Get a map or directions</a></li></ul></div></span></td></tr></tbody></table></div></td></tr></tbody></table><div id="zv__TV__MSG_infoBar"></div></div><div id="zv__TV__MSG_body" style="position: static; overflow: visible;" class="MsgBody" parentid="zv__TV__MSG"><iframe scrolling="no" style="width: 100%; height: 148px;" frameborder="0" width="100%" id="zv__TV__MSG_body__iframe" name="zv__TV__MSG_body__iframe" src="javascript:"";"></iframe></div></div></div><div id="ztb__TV" style="position: absolute; overflow: visible; z-index: 300; left: 186px; top: 141px; width: 1571px; height: 28px;" class="ZToolbar ZWidget" parentid="z_shell"><table class="ZToolbarTable" border="0" cellpadding="0" cellspacing="0"><tbody><tr id="ztb__TV_items"><td id="ztb__TV_item_7"><div id="zb__TV__NEW_MENU" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget   ZHasDropDown                                                 ZHasText     ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__NEW_MENU_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgNewMessage"></div></td><td id="zb__TV__NEW_MENU_title" class="ImgToolbarButton ZWidgetTitle">New</td><td id="zb__TV__NEW_MENU_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__NEW_MENU_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_8"><div id="zb__TV__CHECK_MAIL" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget                                       ZHasText     ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__CHECK_MAIL_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgRefresh"></div></td><td id="zb__TV__CHECK_MAIL_title" class="ImgToolbarButton ZWidgetTitle">Get Mail</td><td id="zb__TV__CHECK_MAIL_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__CHECK_MAIL_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_9" valign="middle"><div class="vertSep"></div></td><td id="ztb__TV_item_10"><div id="zb__TV__REPLY" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget           ZHasText       ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__REPLY_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgReply"></div></td><td id="zb__TV__REPLY_title" class="ImgToolbarButton ZWidgetTitle">Reply</td><td id="zb__TV__REPLY_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__REPLY_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_11"><div id="zb__TV__REPLY_ALL" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget           ZHasText       ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__REPLY_ALL_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgReplyAll"></div></td><td id="zb__TV__REPLY_ALL_title" class="ImgToolbarButton ZWidgetTitle">Reply to All</td><td id="zb__TV__REPLY_ALL_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__REPLY_ALL_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_12"><div id="zb__TV__FORWARD" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget           ZHasText       ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__FORWARD_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgForward"></div></td><td id="zb__TV__FORWARD_title" class="ImgToolbarButton ZWidgetTitle">Forward</td><td id="zb__TV__FORWARD_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__FORWARD_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_13" valign="middle"><div class="vertSep"></div></td><td id="ztb__TV_item_14"><div id="zb__TV__EDIT" style="position: static; overflow: visible; display: none;" class="ZToolbarButton ZWidget   ZHasText           ZHasLeftIcon" parentid="ztb__TV" x-display="block"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__EDIT_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgEdit"></div></td><td id="zb__TV__EDIT_title" class="ImgToolbarButton ZWidgetTitle">Edit</td><td id="zb__TV__EDIT_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__EDIT_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_15"><div id="zb__TV__DELETE" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget                         ZHasText ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__DELETE_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgDelete"></div></td><td id="zb__TV__DELETE_title" class="ImgToolbarButton ZWidgetTitle">Delete</td><td id="zb__TV__DELETE_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__DELETE_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_16"><div id="zb__TV__MOVE" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget                     ZHasText ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__MOVE_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgMoveToFolder"></div></td><td id="zb__TV__MOVE_title" class="ImgToolbarButton ZWidgetTitle">Move</td><td id="zb__TV__MOVE_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__MOVE_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_17"><div id="zb__TV__SPAM" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget                                         ZHasText ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__SPAM_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgJunkMail"></div></td><td id="zb__TV__SPAM_title" class="ImgToolbarButton ZWidgetTitle">Spam</td><td id="zb__TV__SPAM_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__SPAM_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_18"><div id="zb__TV__PRINT" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget                     ZHasText ZHasLeftIcon" parentid="ztb__TV"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__PRINT_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgPrint"></div></td><td id="zb__TV__PRINT_title" class="ImgToolbarButton ZWidgetTitle">Print</td><td id="zb__TV__PRINT_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__PRINT_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_19" valign="middle"><div class="vertSep"></div></td><td id="ztb__TV_item_20"><div id="zb__TV__VIEW_MENU" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget           ZHasDropDown                                       ZHasText     ZHasLeftIcon" parentid="ztb__TV" menuid="DWT10"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__TV__VIEW_MENU_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgMessageView"></div></td><td id="zb__TV__VIEW_MENU_title" class="ImgToolbarButton ZWidgetTitle">View</td><td id="zb__TV__VIEW_MENU_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__TV__VIEW_MENU_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__TV_item_21" class="ZToolbarFiller" width="100%">&nbsp;</td><td id="ztb__TV_item_22"><div id="ztvText" style="position: static; overflow: visible;" class="ZWidgetTitle itemCountText          " parentid="ztb__TV"></div></td></tr></tbody></table></div><div id="DWT10" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT11" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT11_check" class="ZCheckIcon"><div></div></td><td id="DWT11_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgConversationView"></div></td><td id="DWT11_title" class="ZWidgetTitle">By Conversation</td><td id="DWT11_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT12" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT12_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="DWT12_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgMessageView"></div></td><td id="DWT12_title" class="ZWidgetTitle">By Message</td><td id="DWT12_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT13" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasText           ZHasLeftIcon" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT13_check" class="ZCheckIcon"><div></div></td><td id="DWT13_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgOpenInNewWindow"></div></td><td id="DWT13_title" class="ZWidgetTitle">Open in a separate window</td><td id="DWT13_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT14" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT14_check" class="ZCheckIcon"><div></div></td><td id="DWT14_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT14_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT15" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT15_check" class="ZCheckIcon"><div></div></td><td id="DWT15_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgSplitPane"></div></td><td id="DWT15_title" class="ZWidgetTitle">Reading Pane At The Bottom</td><td id="DWT15_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT16" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT16_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="DWT16_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgSplitPaneVertical"></div></td><td id="DWT16_title" class="ZWidgetTitle">Reading Pane On The Right</td><td id="DWT16_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT17" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="DWT10"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT17_check" class="ZCheckIcon"><div></div></td><td id="DWT17_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgSplitPaneOff"></div></td><td id="DWT17_title" class="ZWidgetTitle">Reading Pane Off</td><td id="DWT17_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT18" style="position: absolute; overflow: auto; display: none;" class="ZmAutocompleteListView" parentid="z_shell" x-display="block"></div><div id="zov__main_Mail" style="position: absolute; overflow: auto; left: 7px; top: 146px; width: 170px; height: 647px; z-index: 300;" class="ZmOverview" parentid="z_shell"><div id="main_Mail-parent-PREF_PAGE"></div><div id="main_Mail-parent-ADDRBOOK"></div><div id="main_Mail-parent-CALENDAR"></div><div id="main_Mail-parent-Voice"></div><div id="main_Mail-parent-FOLDER"><div id="zt__main_Mail__FOLDER" style="position: static; overflow: visible; display: block;" class="OverviewTree" parentid="zov__main_Mail"><div id="ztih__main_Mail__FOLDER" style="position: static; overflow: visible; display: block;" class="DwtComposite"><div class="overviewHeader" id="ztih__main_Mail__FOLDER_div"><table id="ztih__main_Mail__FOLDER_table" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td align="center" nowrap="" id="ztih__main_Mail__FOLDER_nodeCell" style="height: 16px; width: 16px;"><div class="ImgNodeExpanded"></div></td><td nowrap="" class="imageCell" id="ztih__main_Mail__FOLDER_imageCell"></td><td nowrap="" class="overviewHeader-Text" id="ztih__main_Mail__FOLDER_textCell" width="100%">Folders</td><td class="overviewHeader-Text FakeAnchor" style="padding-right:4px"><div id="DWT174" style="position: static; overflow: visible;" class="ImgNewFolder ZWidget"><table class="ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0" style="table-layout:auto;"><tbody><tr><td id="DWT174_left_icon" class="ZLeftIcon ZWidgetIcon"></td><td id="DWT174_title" class="ZWidgetTitle"></td><td id="DWT174_right_icon" class="ZRightIcon ZWidgetIcon"></td><td id="DWT174_dropdown" class="ZDropDown"></td></tr></tbody></table></div></td></tr></tbody></table></div><div class="DwtTreeItemLevel1ChildDiv" style="display: block;"><div id="zti__main_Mail__2" style="position: static; overflow: visible;" class="DwtComposite"><div class="DwtTreeItem-selected" id="zti__main_Mail__2_div"><table id="zti__main_Mail__2_table" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" nowrap="" id="zti__main_Mail__2_nodeCell" style="height: 16px; width: 16px;"><div class="ImgNodeCollapsed"></div></td><td nowrap="" class="imageCell" id="zti__main_Mail__2_imageCell"><div class="ImgInbox"></div></td><td nowrap="" class="DwtTreeItem-Text" id="zti__main_Mail__2_textCell"><span style="font-weight:bold">Inbox (193)</span></td><td nowrap="" width="16" class="imageCell" id="zti__main_Mail__2_extraCell"><div class="ImgBlank_16"></div></td></tr></tbody></table></div></div><div id="zti__main_Mail__5" style="position: static; overflow: visible;" class="DwtComposite"><div class="DwtTreeItem" id="zti__main_Mail__5_div"><table id="zti__main_Mail__5_table" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" nowrap="" id="zti__main_Mail__5_nodeCell" style="height: 16px; width: 16px;"></td><td nowrap="" class="imageCell" id="zti__main_Mail__5_imageCell"><div class="ImgSentFolder"></div></td><td nowrap="" class="DwtTreeItem-Text" id="zti__main_Mail__5_textCell">Sent</td><td nowrap="" width="16" class="imageCell" id="zti__main_Mail__5_extraCell"><div class="ImgBlank_16"></div></td></tr></tbody></table></div></div><div id="zti__main_Mail__6" style="position: static; overflow: visible;" class="DwtComposite"><div class="DwtTreeItem" id="zti__main_Mail__6_div"><table id="zti__main_Mail__6_table" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" nowrap="" id="zti__main_Mail__6_nodeCell" style="height: 16px; width: 16px;"></td><td nowrap="" class="imageCell" id="zti__main_Mail__6_imageCell"><div class="ImgDraftFolder"></div></td><td nowrap="" class="DwtTreeItem-Text" id="zti__main_Mail__6_textCell"><span style="font-weight:bold">Drafts (3)</span></td><td nowrap="" width="16" class="imageCell" id="zti__main_Mail__6_extraCell"><div class="ImgBlank_16"></div></td></tr></tbody></table></div></div><div id="zti__main_Mail__4" style="position: static; overflow: visible;" class="DwtComposite"><div class="DwtTreeItem" id="zti__main_Mail__4_div"><table id="zti__main_Mail__4_table" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" nowrap="" id="zti__main_Mail__4_nodeCell" style="height: 16px; width: 16px;"></td><td nowrap="" class="imageCell" id="zti__main_Mail__4_imageCell"><div class="ImgSpamFolder"></div></td><td nowrap="" class="DwtTreeItem-Text" id="zti__main_Mail__4_textCell">Spam</td><td nowrap="" width="16" class="imageCell" id="zti__main_Mail__4_extraCell"><div class="ImgBlank_16"></div></td></tr></tbody></table></div></div><div id="zti__main_Mail__3" style="position: static; overflow: visible;" class="DwtComposite"><div class="DwtTreeItem" id="zti__main_Mail__3_div"><table id="zti__main_Mail__3_table" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" nowrap="" id="zti__main_Mail__3_nodeCell" style="height: 16px; width: 16px;"></td><td nowrap="" class="imageCell" id="zti__main_Mail__3_imageCell"><div class="ImgTrash"></div></td><td nowrap="" class="DwtTreeItem-Text" id="zti__main_Mail__3_textCell">Trash</td><td nowrap="" width="16" class="imageCell" id="zti__main_Mail__3_extraCell"><div class="ImgBlank_16"></div></td></tr></tbody></table></div></div><div class="vSpace"></div></div></div><div class="vSpace"></div></div></div><div id="main_Mail-parent-SEARCH"></div><div id="main_Mail-parent-TAG"></div><div id="main_Mail-parent-ZIMLET"><div id="zt__main_Mail__ZIMLET" style="position: static; overflow: visible;" class="OverviewTree" parentid="zov__main_Mail"></div></div></div><div id="DWT20" style="position: absolute; overflow: visible; display: none; top: 0px;" class="ZmUpsellView" parentid="z_shell" x-display="block"><iframe id="iframe_DWT20" width="100%" height="100%" frameborder="0"></iframe></div><div id="zm__Search" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT22" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__Search"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT22_check" class="ZCheckIcon"><div></div></td><td id="DWT22_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgGlobe"></div></td><td id="DWT22_title" class="ZWidgetTitle">Web</td><td id="DWT22_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT23" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="zm__Search"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT23_check" class="ZCheckIcon"><div></div></td><td id="DWT23_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT23_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__Search__MAIL" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__Search"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__Search__MAIL_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="zmi__Search__MAIL_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgMessage"></div></td><td id="zmi__Search__MAIL_title" class="ZWidgetTitle">Email</td><td id="zmi__Search__MAIL_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__Search__CONTACT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__Search"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__Search__CONTACT_check" class="ZCheckIcon"><div></div></td><td id="zmi__Search__CONTACT_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgContactsFolder"></div></td><td id="zmi__Search__CONTACT_title" class="ZWidgetTitle">Address Book</td><td id="zmi__Search__CONTACT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="zv__COMPOSE1" style="position: absolute; overflow: hidden; z-index: 100; left: -10000px; top: -10000px; width: 1571px; height: 778px;" class="ZmComposeView" parentid="z_shell"><!-- header --><table id="zv__COMPOSE1_header" border="0" cellpadding="2" cellspacing="2" width="100%"><tbody><tr id="zv__COMPOSE1_identity_row" style="display: none;"><td align="right" style="width:64px; overflow:visible; white-space:nowrap"><div>From:</div></td><td colspan="2"><div id="DWT36" style="width: auto;" class="ZSelectAutoSizingContainer" parentid="zv__COMPOSE1"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="DWT36_select_container" class="ZSelect"><table class="ZSelectBorder ZSelectTable ZWidgetTable" cellspacing="0" cellpadding="0"><tbody><tr><td><div class="ImgSelect_L"></div></td><td id="DWT36_left_icon" class="ImgSelect ZLeftIcon ZWidgetIcon"></td><td id="DWT36_title" class="ImgSelect ZWidgetTitle">Primary Account ("" &lt;thegilligans@comcast.net&gt;)</td><td id="DWT36_right_icon" class="ImgSelect ZRightIcon ZWidgetIcon"></td><td><div class="ImgSelect_R"></div></td></tr></tbody></table></td></tr><tr><td><table id="DWT36_pseudoitems_container" border="0" cellpadding="0" cellspacing="0" style="display: none;"><tbody><tr><td class="ZSelectPseudoItem"><div class="ZWidgetTitle">Primary Account ("" &lt;thegilligans@comcast.net&gt;)</div></td></tr></tbody></table></td></tr></tbody></table></div></td></tr><tr id="zv__COMPOSE1_to_row" style="display: table-row;"><td align="right" valign="middle" style="width:64px; overflow:visible; white-space:nowrap"><div id="zb__COMPOSE1__TO" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText  " parentid="zv__COMPOSE1"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="zb__COMPOSE1__TO_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__TO_title" class="ImgButton ZWidgetTitle">To:</td><td id="zb__COMPOSE1__TO_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__TO_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td width="96%" colspan="2"><textarea id="zv__COMPOSE1_to_control" class="addresses" style="height: 21px; overflow: hidden;" rows="1"></textarea></td></tr><tr id="zv__COMPOSE1_cc_row" style="display: table-row;"><td align="right" valign="middle" style="width:64px; overflow:visible; white-space:nowrap"><div id="zb__COMPOSE1__CC" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText  " parentid="zv__COMPOSE1"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="zb__COMPOSE1__CC_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__CC_title" class="ImgButton ZWidgetTitle">Cc:</td><td id="zb__COMPOSE1__CC_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__CC_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td><textarea id="zv__COMPOSE1_cc_control" class="addresses" style="height: 21px; overflow: hidden;" rows="1"></textarea></td><td width="5%"><div><a href="http://web.mail.comcast.net/zimbra/mail?app=mail#" id="zv__COMPOSE1_toggle_bcc">Show BCC</a></div></td></tr><tr id="zv__COMPOSE1_bcc_row" style="display: none;"><td align="right" valign="middle" style="width:64px; overflow:visible; white-space:nowrap"><div id="zb__COMPOSE1__BCC" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText" parentid="zv__COMPOSE1"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="zb__COMPOSE1__BCC_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__BCC_title" class="ImgButton ZWidgetTitle">Bcc:</td><td id="zb__COMPOSE1__BCC_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__BCC_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td colspan="2"><textarea id="zv__COMPOSE1_bcc_control" class="addresses" style="height: 21px; overflow: hidden;" rows="1"></textarea></td></tr><tr id="zv__COMPOSE1_subject_row"><td align="right" style="width:64px; overflow:visible; white-space:nowrap">Subject:</td><td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td width="99%" style="padding-right:4px;"><input id="zv__COMPOSE1_subject_control" class="subjectField" autocomplete="off"></td><td id="zv__COMPOSE1_identity_row" nowrap="" width="10%" style="display:none;"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td align="right" style="width:64px; overflow:visible; white-space:nowrap">Account:&nbsp;</td><td width="*"><select id="zv__COMPOSE1_identity_control"></select></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr id="zv__COMPOSE1_obo_row" style="display: none;"><td align="right"><input type="checkbox" id="zv__COMPOSE1_obo_checkbox"></td><td colspan="2"><div id="zv__COMPOSE1_obo_label"></div></td></tr><tr id="zv__COMPOSE1_attachments_row"><td colspan="3"><div id="zv__COMPOSE1_attachments_div" style=""></div></td></tr></tbody></table><!-- compose editor is automatically appended below the header --><div id="DWT37" style="position: relative; overflow: visible;" class="ZmHtmlEditor" parentid="zv__COMPOSE1"><div id="DWT38" style="position: relative; overflow: visible; display: block;" class="ZToolbar ZWidget" parentid="DWT37"><table class="ZToolbarTable" border="0" cellpadding="0" cellspacing="0"><tbody><tr id="DWT38_items"><td id="DWT38_item_24"><div id="DWT39" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasDropDown ZHasText    " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT39_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"></td><td id="DWT39_title" class="ImgToolbarButton ZWidgetTitle">Arial</td><td id="DWT39_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT39_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_25"><div id="DWT50" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasDropDown   ZHasText    " parentid="DWT38" menuid="DWT51"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT50_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"></td><td id="DWT50_title" class="ImgToolbarButton ZWidgetTitle">3 (12pt)</td><td id="DWT50_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT50_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_26"><div id="DWT59" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasText ZHasDropDown    " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT59_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"></td><td id="DWT59_title" class="ImgToolbarButton ZWidgetTitle"><span style="font-size:13px">§</span></td><td id="DWT59_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT59_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_27"><div id="DWT70" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasDropDown    " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT70_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgLeftJustify"></div></td><td id="DWT70_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT70_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT70_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_28"><div id="DWT76" style="position: static; overflow: visible;" class="vertSep" parentid="DWT38"></div></td><td id="DWT38_item_29"><div id="DWT77" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasDropDown        " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT77_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgBulletedList"></div></td><td id="DWT77_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT77_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT77_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_30"><div id="DWT81" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasDropDown    " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT81_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgOutdent"></div></td><td id="DWT81_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT81_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT81_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_31"><div id="DWT85" style="position: static; overflow: visible;" class="vertSep" parentid="DWT38"></div></td><td id="DWT38_item_32"><div id="DWT86" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon  " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT86_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgBold"></div></td><td id="DWT86_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT86_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT86_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_33"><div id="DWT87" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon  " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT87_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgItalics"></div></td><td id="DWT87_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT87_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT87_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_34"><div id="DWT88" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon  " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT88_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgUnderline"></div></td><td id="DWT88_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT88_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT88_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_35"><div id="DWT89" style="position: static; overflow: visible;" class="vertSep" parentid="DWT38"></div></td><td id="DWT38_item_36"><div id="DWT90" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasDropDown ZHasLeftIcon  " parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT90_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgFontColor"></div></td><td id="DWT90_title" class="ImgToolbarButton ZWidgetTitle"><div id="DWT90_color" class="DwtButtonColorPicker-display" unselectable="" style="background-color: rgb(0, 0, 0);"></div></td><td id="DWT90_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT90_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_37"><div id="DWT94" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasDropDown ZHasLeftIcon" parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT94_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgFontBackground"></div></td><td id="DWT94_title" class="ImgToolbarButton ZWidgetTitle"><div id="DWT94_color" class="DwtButtonColorPicker-display" unselectable=""></div></td><td id="DWT94_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT94_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_38"><div id="DWT98" style="position: static; overflow: visible;" class="vertSep" parentid="DWT38"></div></td><td id="DWT38_item_39"><div id="DWT99" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon" parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT99_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgHorizRule"></div></td><td id="DWT99_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT99_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT99_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_40"><div id="DWT100" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon" parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT100_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgURL"></div></td><td id="DWT100_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT100_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT100_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT38_item_41"><div id="DWT101" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasDropDown" parentid="DWT38"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="DWT101_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgTable"></div></td><td id="DWT101_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="DWT101_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="DWT101_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><iframe id="iframe_DWT119" class="DwtHtmlEditorIFrame" border="0" frameborder="0" vspace="0" autocomplete="off" src="./Seals jpeg by Jesse Mechling_files/blank.htm" style="width: 1564px; height: 666px;"></iframe></div></div><div id="DWT35" style="position: absolute; overflow: auto; display: none; z-index: 100;" class="ZmAutocompleteListView" parentid="z_shell" x-display="block"></div><div id="DWT40" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT41" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT41_check" class="ZCheckIcon"><div></div></td><td id="DWT41_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT41_title" class="ZWidgetTitle">Arial</td><td id="DWT41_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT42" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT42_check" class="ZCheckIcon"><div></div></td><td id="DWT42_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT42_title" class="ZWidgetTitle">Bookman Old Style</td><td id="DWT42_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT43" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT43_check" class="ZCheckIcon"><div></div></td><td id="DWT43_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT43_title" class="ZWidgetTitle">Courier New</td><td id="DWT43_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT44" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT44_check" class="ZCheckIcon"><div></div></td><td id="DWT44_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT44_title" class="ZWidgetTitle">Garamond</td><td id="DWT44_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT45" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT45_check" class="ZCheckIcon"><div></div></td><td id="DWT45_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT45_title" class="ZWidgetTitle">Lucida Console</td><td id="DWT45_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT46" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT46_check" class="ZCheckIcon"><div></div></td><td id="DWT46_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT46_title" class="ZWidgetTitle">Symbol</td><td id="DWT46_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT47" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT47_check" class="ZCheckIcon"><div></div></td><td id="DWT47_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT47_title" class="ZWidgetTitle">Tahoma</td><td id="DWT47_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT48" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT48_check" class="ZCheckIcon"><div></div></td><td id="DWT48_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT48_title" class="ZWidgetTitle">Times New Roman</td><td id="DWT48_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT49" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT40"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT49_check" class="ZCheckIcon"><div></div></td><td id="DWT49_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT49_title" class="ZWidgetTitle">Verdana</td><td id="DWT49_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT51" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT52" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT52_check" class="ZCheckIcon"><div></div></td><td id="DWT52_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT52_title" class="ZWidgetTitle">1 (8pt)</td><td id="DWT52_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT53" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT53_check" class="ZCheckIcon"><div></div></td><td id="DWT53_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT53_title" class="ZWidgetTitle">2 (10pt)</td><td id="DWT53_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT54" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT54_check" class="ZCheckIcon"><div></div></td><td id="DWT54_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT54_title" class="ZWidgetTitle">3 (12pt)</td><td id="DWT54_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT55" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT55_check" class="ZCheckIcon"><div></div></td><td id="DWT55_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT55_title" class="ZWidgetTitle">4 (14pt)</td><td id="DWT55_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT56" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT56_check" class="ZCheckIcon"><div></div></td><td id="DWT56_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT56_title" class="ZWidgetTitle">5 (18pt)</td><td id="DWT56_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT57" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT57_check" class="ZCheckIcon"><div></div></td><td id="DWT57_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT57_title" class="ZWidgetTitle">6 (24pt)</td><td id="DWT57_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT58" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT51"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT58_check" class="ZCheckIcon"><div></div></td><td id="DWT58_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT58_title" class="ZWidgetTitle">7 (36pt)</td><td id="DWT58_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT60" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT61" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT61_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="DWT61_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT61_title" class="ZWidgetTitle">Normal</td><td id="DWT61_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT62" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT62_check" class="ZCheckIcon"><div></div></td><td id="DWT62_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT62_title" class="ZWidgetTitle">Heading 1</td><td id="DWT62_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT63" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT63_check" class="ZCheckIcon"><div></div></td><td id="DWT63_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT63_title" class="ZWidgetTitle">Heading 2</td><td id="DWT63_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT64" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT64_check" class="ZCheckIcon"><div></div></td><td id="DWT64_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT64_title" class="ZWidgetTitle">Heading 3</td><td id="DWT64_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT65" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT65_check" class="ZCheckIcon"><div></div></td><td id="DWT65_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT65_title" class="ZWidgetTitle">Heading 4</td><td id="DWT65_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT66" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT66_check" class="ZCheckIcon"><div></div></td><td id="DWT66_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT66_title" class="ZWidgetTitle">Heading 5</td><td id="DWT66_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT67" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT67_check" class="ZCheckIcon"><div></div></td><td id="DWT67_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT67_title" class="ZWidgetTitle">Heading 6</td><td id="DWT67_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT68" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT68_check" class="ZCheckIcon"><div></div></td><td id="DWT68_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT68_title" class="ZWidgetTitle">Address</td><td id="DWT68_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT69" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT60"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT69_check" class="ZCheckIcon"><div></div></td><td id="DWT69_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT69_title" class="ZWidgetTitle">Preformatted</td><td id="DWT69_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT71" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT72" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT71"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT72_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="DWT72_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgLeftJustify"></div></td><td id="DWT72_title" class="ZWidgetTitle"></td><td id="DWT72_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT73" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT71"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT73_check" class="ZCheckIcon"><div></div></td><td id="DWT73_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgCenterJustify"></div></td><td id="DWT73_title" class="ZWidgetTitle"></td><td id="DWT73_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT74" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT71"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT74_check" class="ZCheckIcon"><div></div></td><td id="DWT74_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgRightJustify"></div></td><td id="DWT74_title" class="ZWidgetTitle"></td><td id="DWT74_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT75" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT71"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT75_check" class="ZCheckIcon"><div></div></td><td id="DWT75_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgFullJustify"></div></td><td id="DWT75_title" class="ZWidgetTitle"></td><td id="DWT75_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT78" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT79" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT78"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT79_check" class="ZCheckIcon"><div></div></td><td id="DWT79_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgBulletedList"></div></td><td id="DWT79_title" class="ZWidgetTitle"></td><td id="DWT79_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT80" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT78"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT80_check" class="ZCheckIcon"><div></div></td><td id="DWT80_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgNumberedList"></div></td><td id="DWT80_title" class="ZWidgetTitle"></td><td id="DWT80_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT82" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT83" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT82"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT83_check" class="ZCheckIcon"><div></div></td><td id="DWT83_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgOutdent"></div></td><td id="DWT83_title" class="ZWidgetTitle"></td><td id="DWT83_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT84" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon" parentid="DWT82"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT84_check" class="ZCheckIcon"><div></div></td><td id="DWT84_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgIndent"></div></td><td id="DWT84_title" class="ZWidgetTitle"></td><td id="DWT84_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT91" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtMenu" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT92" style="position: static; overflow: visible;" class="DwtColorPicker" parentid="DWT91"><table cellpadding="0" cellspacing="0" border="0" align="center"><tbody><tr><td id="DWT93#FFFFFF" style="background-color: rgb(255, 255, 255); border: 2px outset rgb(255, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFCCCC" style="background-color: rgb(255, 204, 204); border: 2px outset rgb(255, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFCC99" style="background-color: rgb(255, 204, 153); border: 2px outset rgb(255, 204, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFFF99" style="background-color: rgb(255, 255, 153); border: 2px outset rgb(255, 255, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFFFCC" style="background-color: rgb(255, 255, 204); border: 2px outset rgb(255, 255, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#99FF99" style="background-color: rgb(153, 255, 153); border: 2px outset rgb(153, 255, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#99FFFF" style="background-color: rgb(153, 255, 255); border: 2px outset rgb(153, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CCFFFF" style="background-color: rgb(204, 255, 255); border: 2px outset rgb(204, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CCCCFF" style="background-color: rgb(204, 204, 255); border: 2px outset rgb(204, 204, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFCCFF" style="background-color: rgb(255, 204, 255); border: 2px outset rgb(255, 204, 255);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT93#CCCCCC" style="background-color: rgb(204, 204, 204); border: 2px outset rgb(204, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FF6666" style="background-color: rgb(255, 102, 102); border: 2px outset rgb(255, 102, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FF9966" style="background-color: rgb(255, 153, 102); border: 2px outset rgb(255, 153, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFFF66" style="background-color: rgb(255, 255, 102); border: 2px outset rgb(255, 255, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFFF33" style="background-color: rgb(255, 255, 51); border: 2px outset rgb(255, 255, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#66FF99" style="background-color: rgb(102, 255, 153); border: 2px outset rgb(102, 255, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#33FFFF" style="background-color: rgb(51, 255, 255); border: 2px outset rgb(51, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#66FFFF" style="background-color: rgb(102, 255, 255); border: 2px outset rgb(102, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#9999FF" style="background-color: rgb(153, 153, 255); border: 2px outset rgb(153, 153, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FF99FF" style="background-color: rgb(255, 153, 255); border: 2px outset rgb(255, 153, 255);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT93#C0C0C0" style="background-color: rgb(192, 192, 192); border: 2px outset rgb(192, 192, 192);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FF0000" style="background-color: rgb(255, 0, 0); border: 2px outset rgb(255, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FF9900" style="background-color: rgb(255, 153, 0); border: 2px outset rgb(255, 153, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFCC66" style="background-color: rgb(255, 204, 102); border: 2px outset rgb(255, 204, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFFF00" style="background-color: rgb(255, 255, 0); border: 2px outset rgb(255, 255, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#33FF33" style="background-color: rgb(51, 255, 51); border: 2px outset rgb(51, 255, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#66CCCC" style="background-color: rgb(102, 204, 204); border: 2px outset rgb(102, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#33CCFF" style="background-color: rgb(51, 204, 255); border: 2px outset rgb(51, 204, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#6666CC" style="background-color: rgb(102, 102, 204); border: 2px outset rgb(102, 102, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CC66CC" style="background-color: rgb(204, 102, 204); border: 2px outset rgb(204, 102, 204);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT93#999999" style="background-color: rgb(153, 153, 153); border: 2px outset rgb(153, 153, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CC0000" style="background-color: rgb(204, 0, 0); border: 2px outset rgb(204, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FF6600" style="background-color: rgb(255, 102, 0); border: 2px outset rgb(255, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFCC33" style="background-color: rgb(255, 204, 51); border: 2px outset rgb(255, 204, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#FFCC00" style="background-color: rgb(255, 204, 0); border: 2px outset rgb(255, 204, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#33CC00" style="background-color: rgb(51, 204, 0); border: 2px outset rgb(51, 204, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#00CCCC" style="background-color: rgb(0, 204, 204); border: 2px outset rgb(0, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#3366FF" style="background-color: rgb(51, 102, 255); border: 2px outset rgb(51, 102, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#6633FF" style="background-color: rgb(102, 51, 255); border: 2px outset rgb(102, 51, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CC33CC" style="background-color: rgb(204, 51, 204); border: 2px outset rgb(204, 51, 204);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT93#666666" style="background-color: rgb(102, 102, 102); border: 2px outset rgb(102, 102, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#990000" style="background-color: rgb(153, 0, 0); border: 2px outset rgb(153, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CC6600" style="background-color: rgb(204, 102, 0); border: 2px outset rgb(204, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#CC9933" style="background-color: rgb(204, 153, 51); border: 2px outset rgb(204, 153, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#999900" style="background-color: rgb(153, 153, 0); border: 2px outset rgb(153, 153, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#009900" style="background-color: rgb(0, 153, 0); border: 2px outset rgb(0, 153, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#339999" style="background-color: rgb(51, 153, 153); border: 2px outset rgb(51, 153, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#3333FF" style="background-color: rgb(51, 51, 255); border: 2px outset rgb(51, 51, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#6600CC" style="background-color: rgb(102, 0, 204); border: 2px outset rgb(102, 0, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#993399" style="background-color: rgb(153, 51, 153); border: 2px outset rgb(153, 51, 153);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT93#333333" style="background-color: rgb(51, 51, 51); border: 2px outset rgb(51, 51, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#660000" style="background-color: rgb(102, 0, 0); border: 2px outset rgb(102, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#993300" style="background-color: rgb(153, 51, 0); border: 2px outset rgb(153, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#996633" style="background-color: rgb(153, 102, 51); border: 2px outset rgb(153, 102, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#666600" style="background-color: rgb(102, 102, 0); border: 2px outset rgb(102, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#006600" style="background-color: rgb(0, 102, 0); border: 2px outset rgb(0, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#336666" style="background-color: rgb(51, 102, 102); border: 2px outset rgb(51, 102, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#000099" style="background-color: rgb(0, 0, 153); border: 2px outset rgb(0, 0, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#333399" style="background-color: rgb(51, 51, 153); border: 2px outset rgb(51, 51, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#663366" style="background-color: rgb(102, 51, 102); border: 2px outset rgb(102, 51, 102);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT93#000000" style="background-color: rgb(0, 0, 0); border: 2px outset rgb(0, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#330000" style="background-color: rgb(51, 0, 0); border: 2px outset rgb(51, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#663300" style="background-color: rgb(102, 51, 0); border: 2px outset rgb(102, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#663333" style="background-color: rgb(102, 51, 51); border: 2px outset rgb(102, 51, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#333300" style="background-color: rgb(51, 51, 0); border: 2px outset rgb(51, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#003300" style="background-color: rgb(0, 51, 0); border: 2px outset rgb(0, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#003333" style="background-color: rgb(0, 51, 51); border: 2px outset rgb(0, 51, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#000066" style="background-color: rgb(0, 0, 102); border: 2px outset rgb(0, 0, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#330099" style="background-color: rgb(51, 0, 153); border: 2px outset rgb(51, 0, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT93#330033" style="background-color: rgb(51, 0, 51); border: 2px outset rgb(51, 0, 51);" width="12" height="14"><img height="1" width="1"></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT95" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtMenu" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT96" style="position: static; overflow: visible;" class="DwtColorPicker" parentid="DWT95"><table cellpadding="0" cellspacing="0" border="0" align="center"><tbody><tr><td id="DWT97#FFFFFF" style="background-color: rgb(255, 255, 255); border: 2px outset rgb(255, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFCCCC" style="background-color: rgb(255, 204, 204); border: 2px outset rgb(255, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFCC99" style="background-color: rgb(255, 204, 153); border: 2px outset rgb(255, 204, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFFF99" style="background-color: rgb(255, 255, 153); border: 2px outset rgb(255, 255, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFFFCC" style="background-color: rgb(255, 255, 204); border: 2px outset rgb(255, 255, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#99FF99" style="background-color: rgb(153, 255, 153); border: 2px outset rgb(153, 255, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#99FFFF" style="background-color: rgb(153, 255, 255); border: 2px outset rgb(153, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CCFFFF" style="background-color: rgb(204, 255, 255); border: 2px outset rgb(204, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CCCCFF" style="background-color: rgb(204, 204, 255); border: 2px outset rgb(204, 204, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFCCFF" style="background-color: rgb(255, 204, 255); border: 2px outset rgb(255, 204, 255);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT97#CCCCCC" style="background-color: rgb(204, 204, 204); border: 2px outset rgb(204, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FF6666" style="background-color: rgb(255, 102, 102); border: 2px outset rgb(255, 102, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FF9966" style="background-color: rgb(255, 153, 102); border: 2px outset rgb(255, 153, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFFF66" style="background-color: rgb(255, 255, 102); border: 2px outset rgb(255, 255, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFFF33" style="background-color: rgb(255, 255, 51); border: 2px outset rgb(255, 255, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#66FF99" style="background-color: rgb(102, 255, 153); border: 2px outset rgb(102, 255, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#33FFFF" style="background-color: rgb(51, 255, 255); border: 2px outset rgb(51, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#66FFFF" style="background-color: rgb(102, 255, 255); border: 2px outset rgb(102, 255, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#9999FF" style="background-color: rgb(153, 153, 255); border: 2px outset rgb(153, 153, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FF99FF" style="background-color: rgb(255, 153, 255); border: 2px outset rgb(255, 153, 255);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT97#C0C0C0" style="background-color: rgb(192, 192, 192); border: 2px outset rgb(192, 192, 192);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FF0000" style="background-color: rgb(255, 0, 0); border: 2px outset rgb(255, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FF9900" style="background-color: rgb(255, 153, 0); border: 2px outset rgb(255, 153, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFCC66" style="background-color: rgb(255, 204, 102); border: 2px outset rgb(255, 204, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFFF00" style="background-color: rgb(255, 255, 0); border: 2px outset rgb(255, 255, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#33FF33" style="background-color: rgb(51, 255, 51); border: 2px outset rgb(51, 255, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#66CCCC" style="background-color: rgb(102, 204, 204); border: 2px outset rgb(102, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#33CCFF" style="background-color: rgb(51, 204, 255); border: 2px outset rgb(51, 204, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#6666CC" style="background-color: rgb(102, 102, 204); border: 2px outset rgb(102, 102, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CC66CC" style="background-color: rgb(204, 102, 204); border: 2px outset rgb(204, 102, 204);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT97#999999" style="background-color: rgb(153, 153, 153); border: 2px outset rgb(153, 153, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CC0000" style="background-color: rgb(204, 0, 0); border: 2px outset rgb(204, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FF6600" style="background-color: rgb(255, 102, 0); border: 2px outset rgb(255, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFCC33" style="background-color: rgb(255, 204, 51); border: 2px outset rgb(255, 204, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#FFCC00" style="background-color: rgb(255, 204, 0); border: 2px outset rgb(255, 204, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#33CC00" style="background-color: rgb(51, 204, 0); border: 2px outset rgb(51, 204, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#00CCCC" style="background-color: rgb(0, 204, 204); border: 2px outset rgb(0, 204, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#3366FF" style="background-color: rgb(51, 102, 255); border: 2px outset rgb(51, 102, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#6633FF" style="background-color: rgb(102, 51, 255); border: 2px outset rgb(102, 51, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CC33CC" style="background-color: rgb(204, 51, 204); border: 2px outset rgb(204, 51, 204);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT97#666666" style="background-color: rgb(102, 102, 102); border: 2px outset rgb(102, 102, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#990000" style="background-color: rgb(153, 0, 0); border: 2px outset rgb(153, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CC6600" style="background-color: rgb(204, 102, 0); border: 2px outset rgb(204, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#CC9933" style="background-color: rgb(204, 153, 51); border: 2px outset rgb(204, 153, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#999900" style="background-color: rgb(153, 153, 0); border: 2px outset rgb(153, 153, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#009900" style="background-color: rgb(0, 153, 0); border: 2px outset rgb(0, 153, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#339999" style="background-color: rgb(51, 153, 153); border: 2px outset rgb(51, 153, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#3333FF" style="background-color: rgb(51, 51, 255); border: 2px outset rgb(51, 51, 255);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#6600CC" style="background-color: rgb(102, 0, 204); border: 2px outset rgb(102, 0, 204);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#993399" style="background-color: rgb(153, 51, 153); border: 2px outset rgb(153, 51, 153);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT97#333333" style="background-color: rgb(51, 51, 51); border: 2px outset rgb(51, 51, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#660000" style="background-color: rgb(102, 0, 0); border: 2px outset rgb(102, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#993300" style="background-color: rgb(153, 51, 0); border: 2px outset rgb(153, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#996633" style="background-color: rgb(153, 102, 51); border: 2px outset rgb(153, 102, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#666600" style="background-color: rgb(102, 102, 0); border: 2px outset rgb(102, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#006600" style="background-color: rgb(0, 102, 0); border: 2px outset rgb(0, 102, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#336666" style="background-color: rgb(51, 102, 102); border: 2px outset rgb(51, 102, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#000099" style="background-color: rgb(0, 0, 153); border: 2px outset rgb(0, 0, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#333399" style="background-color: rgb(51, 51, 153); border: 2px outset rgb(51, 51, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#663366" style="background-color: rgb(102, 51, 102); border: 2px outset rgb(102, 51, 102);" width="12" height="14"><img height="1" width="1"></td></tr><tr><td id="DWT97#000000" style="background-color: rgb(0, 0, 0); border: 2px outset rgb(0, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#330000" style="background-color: rgb(51, 0, 0); border: 2px outset rgb(51, 0, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#663300" style="background-color: rgb(102, 51, 0); border: 2px outset rgb(102, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#663333" style="background-color: rgb(102, 51, 51); border: 2px outset rgb(102, 51, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#333300" style="background-color: rgb(51, 51, 0); border: 2px outset rgb(51, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#003300" style="background-color: rgb(0, 51, 0); border: 2px outset rgb(0, 51, 0);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#003333" style="background-color: rgb(0, 51, 51); border: 2px outset rgb(0, 51, 51);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#000066" style="background-color: rgb(0, 0, 102); border: 2px outset rgb(0, 0, 102);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#330099" style="background-color: rgb(51, 0, 153); border: 2px outset rgb(51, 0, 153);" width="12" height="14"><img height="1" width="1"></td><td id="DWT97#330033" style="background-color: rgb(51, 0, 51); border: 2px outset rgb(51, 0, 51);" width="12" height="14"><img height="1" width="1"></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT102" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtMenu ZHasSubMenu ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT103" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasDropDown ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT103_check" class="ZCheckIcon"><div></div></td><td id="DWT103_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgInsertTable"></div></td><td id="DWT103_title" class="ZWidgetTitle">Insert Table</td><td id="DWT103_dropdown" class="ZDropDown"><div class="ImgCascade"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT106" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT106_check" class="ZCheckIcon"><div></div></td><td id="DWT106_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT106_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT107" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT107_check" class="ZCheckIcon"><div></div></td><td id="DWT107_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgTableProperties"></div></td><td id="DWT107_title" class="ZWidgetTitle">Table Properties…</td><td id="DWT107_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT108" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT108_check" class="ZCheckIcon"><div></div></td><td id="DWT108_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgCellProperties"></div></td><td id="DWT108_title" class="ZWidgetTitle">Cell Properties…</td><td id="DWT108_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT109" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT109_check" class="ZCheckIcon"><div></div></td><td id="DWT109_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT109_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT110" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT110_check" class="ZCheckIcon"><div></div></td><td id="DWT110_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgInsertRowBefore"></div></td><td id="DWT110_title" class="ZWidgetTitle">Insert Row Above</td><td id="DWT110_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT111" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT111_check" class="ZCheckIcon"><div></div></td><td id="DWT111_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgInsertRowAfter"></div></td><td id="DWT111_title" class="ZWidgetTitle">Insert Row Under</td><td id="DWT111_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT112" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT112_check" class="ZCheckIcon"><div></div></td><td id="DWT112_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgDeleteRow"></div></td><td id="DWT112_title" class="ZWidgetTitle">Delete Row</td><td id="DWT112_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT113" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT113_check" class="ZCheckIcon"><div></div></td><td id="DWT113_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT113_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT114" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT114_check" class="ZCheckIcon"><div></div></td><td id="DWT114_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgInsertColBefore"></div></td><td id="DWT114_title" class="ZWidgetTitle">Insert Column Before</td><td id="DWT114_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT115" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT115_check" class="ZCheckIcon"><div></div></td><td id="DWT115_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgInsertColAfter"></div></td><td id="DWT115_title" class="ZWidgetTitle">Insert Column After</td><td id="DWT115_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT116" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT116_check" class="ZCheckIcon"><div></div></td><td id="DWT116_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgDeleteCol"></div></td><td id="DWT116_title" class="ZWidgetTitle">Delete Column</td><td id="DWT116_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT117" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT117_check" class="ZCheckIcon"><div></div></td><td id="DWT117_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT117_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT118" style="position: static; overflow: visible;" class="ZMenuItem ZWidget   ZHasLeftIcon ZHasText" parentid="DWT102"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT118_check" class="ZCheckIcon"><div></div></td><td id="DWT118_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgMergeCells"></div></td><td id="DWT118_title" class="ZWidgetTitle">Delete Table</td><td id="DWT118_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT104" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtMenu" parentid="z_shell"><div id="DWT105" style="position: static; overflow: visible;" class="DwtGridSizePicker" parentid="DWT104"><table cellpadding="0" border="0" cellspacing="0"><tbody><tr class="info"><td colspan="7">Table Size</td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr><tr class="grid"><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td><td unselectable="unselectable"></td></tr></tbody></table></div></div><div id="ztb__COMPOSE1" style="position: absolute; overflow: visible; z-index: 100; left: -10000px; top: -10000px; width: 1571px; height: 28px;" class="ZmAppToolBar ImgSkin_Toolbar ZWidget" parentid="z_shell"><table class="ZToolbarTable" border="0" cellpadding="0" cellspacing="0"><tbody><tr id="ztb__COMPOSE1_items"><td id="ztb__COMPOSE1_item_42"><div id="zb__COMPOSE1__SEND" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasText  " parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__SEND_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgSend"></div></td><td id="zb__COMPOSE1__SEND_title" class="ImgToolbarButton ZWidgetTitle">Send</td><td id="zb__COMPOSE1__SEND_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__SEND_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_43"><div id="zb__COMPOSE1__CANCEL" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasText" parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__CANCEL_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgCancel"></div></td><td id="zb__COMPOSE1__CANCEL_title" class="ImgToolbarButton ZWidgetTitle">Cancel</td><td id="zb__COMPOSE1__CANCEL_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__CANCEL_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_44" valign="middle"><div class="vertSep"></div></td><td id="ztb__COMPOSE1_item_45"><div id="zb__COMPOSE1__SAVE_DRAFT" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasText" parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__SAVE_DRAFT_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgDraftFolder"></div></td><td id="zb__COMPOSE1__SAVE_DRAFT_title" class="ImgToolbarButton ZWidgetTitle">Save Draft</td><td id="zb__COMPOSE1__SAVE_DRAFT_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__SAVE_DRAFT_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_46"><div id="zb__COMPOSE1__ATTACHMENT" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasText        " parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__ATTACHMENT_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgAttachment"></div></td><td id="zb__COMPOSE1__ATTACHMENT_title" class="ImgToolbarButton ZWidgetTitle">Add Attachment</td><td id="zb__COMPOSE1__ATTACHMENT_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__ATTACHMENT_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_47"><div id="zb__COMPOSE1__SPELL_CHECK" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget   ZHasText ZHasLeftIcon" parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__SPELL_CHECK_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgSpellCheck"></div></td><td id="zb__COMPOSE1__SPELL_CHECK_title" class="ImgToolbarButton ZWidgetTitle">Spell Check</td><td id="zb__COMPOSE1__SPELL_CHECK_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__SPELL_CHECK_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_48"><div id="zb__COMPOSE1__ADD_SIGNATURE" style="position: static; overflow: visible; display: none;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasText   ZHasDropDown" parentid="ztb__COMPOSE1" x-display="block" menuid="DWT125"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__ADD_SIGNATURE_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgAddSignature"></div></td><td id="zb__COMPOSE1__ADD_SIGNATURE_title" class="ImgToolbarButton ZWidgetTitle">Signature</td><td id="zb__COMPOSE1__ADD_SIGNATURE_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__ADD_SIGNATURE_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_49"><div id="zb__COMPOSE1__COMPOSE_OPTIONS" style="position: static; overflow: visible; display: block;" class="ZToolbarButton ZWidget ZHasLeftIcon ZHasText ZHasDropDown" parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__COMPOSE_OPTIONS_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgPreferences"></div></td><td id="zb__COMPOSE1__COMPOSE_OPTIONS_title" class="ImgToolbarButton ZWidgetTitle">Options</td><td id="zb__COMPOSE1__COMPOSE_OPTIONS_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__COMPOSE_OPTIONS_dropdown" class="ImgToolbarButton ZDropDown"><div class="ImgSelectPullDownArrow"></div></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td><td id="ztb__COMPOSE1_item_50" class="ZToolbarFiller" width="100%">&nbsp;</td><td id="ztb__COMPOSE1_item_51"><div id="zb__COMPOSE1__DETACH_COMPOSE" style="position: static; overflow: visible;" class="ZToolbarButton ZWidget ZHasLeftIcon" parentid="ztb__COMPOSE1"><table class="ZWidgetBorder ZToolbarButtonBorder ZWidgetTable ZToolbarButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgToolbarButton_L"><div></div></td><td id="zb__COMPOSE1__DETACH_COMPOSE_left_icon" class="ImgToolbarButton ZLeftIcon ZWidgetIcon"><div class="ImgOpenInNewWindow"></div></td><td id="zb__COMPOSE1__DETACH_COMPOSE_title" class="ImgToolbarButton ZWidgetTitle"></td><td id="zb__COMPOSE1__DETACH_COMPOSE_right_icon" class="ImgToolbarButton ZRightIcon ZWidgetIcon"></td><td id="zb__COMPOSE1__DETACH_COMPOSE_dropdown" class="ImgToolbarButton ZDropDown"></td><td class="ImgToolbarButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="zm__COMPOSE1_NEW_MESSAGE" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_HTML" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_NEW_MESSAGE"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_HTML_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_HTML_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgHtmlDoc"></div></td><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_HTML_title" class="ZWidgetTitle">Format As HTML</td><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_HTML_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_TEXT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_NEW_MESSAGE"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_TEXT_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_TEXT_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgGenericDoc"></div></td><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_TEXT_title" class="ZWidgetTitle">Format As Plain Text</td><td id="zmi__COMPOSE1_NEW_MESSAGE__FORMAT_TEXT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="zm__COMPOSE1_REPLY" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__REPLY" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__REPLY_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__REPLY_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgReply"></div></td><td id="zmi__COMPOSE1_REPLY__REPLY_title" class="ZWidgetTitle">Reply to Sender</td><td id="zmi__COMPOSE1_REPLY__REPLY_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__REPLY_ALL" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__REPLY_ALL_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__REPLY_ALL_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgReplyAll"></div></td><td id="zmi__COMPOSE1_REPLY__REPLY_ALL_title" class="ZWidgetTitle">Reply to All</td><td id="zmi__COMPOSE1_REPLY__REPLY_ALL_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT120" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT120_check" class="ZCheckIcon"><div></div></td><td id="DWT120_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT120_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__FORMAT_HTML" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__FORMAT_HTML_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__FORMAT_HTML_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgHtmlDoc"></div></td><td id="zmi__COMPOSE1_REPLY__FORMAT_HTML_title" class="ZWidgetTitle">Format As HTML</td><td id="zmi__COMPOSE1_REPLY__FORMAT_HTML_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__FORMAT_TEXT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__FORMAT_TEXT_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__FORMAT_TEXT_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgGenericDoc"></div></td><td id="zmi__COMPOSE1_REPLY__FORMAT_TEXT_title" class="ZWidgetTitle">Format As Plain Text</td><td id="zmi__COMPOSE1_REPLY__FORMAT_TEXT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT121" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT121_check" class="ZCheckIcon"><div></div></td><td id="DWT121_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT121_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__INC_NONE" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__INC_NONE_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_NONE_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_NONE_title" class="ZWidgetTitle">Don't Include Original Message</td><td id="zmi__COMPOSE1_REPLY__INC_NONE_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__INC_BODY" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__INC_BODY_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_BODY_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_BODY_title" class="ZWidgetTitle">Include Original Message</td><td id="zmi__COMPOSE1_REPLY__INC_BODY_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__INC_SMART" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__INC_SMART_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_SMART_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_SMART_title" class="ZWidgetTitle">Include Last Message Only</td><td id="zmi__COMPOSE1_REPLY__INC_SMART_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__INC_ATTACHMENT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__INC_ATTACHMENT_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_ATTACHMENT_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INC_ATTACHMENT_title" class="ZWidgetTitle">Include Original As Attachment</td><td id="zmi__COMPOSE1_REPLY__INC_ATTACHMENT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT122" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT122_check" class="ZCheckIcon"><div></div></td><td id="DWT122_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT122_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__USE_PREFIX" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__USE_PREFIX_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__USE_PREFIX_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__USE_PREFIX_title" class="ZWidgetTitle">Use prefix</td><td id="zmi__COMPOSE1_REPLY__USE_PREFIX_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_REPLY__INCLUDE_HEADERS" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_REPLY"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_REPLY__INCLUDE_HEADERS_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INCLUDE_HEADERS_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_REPLY__INCLUDE_HEADERS_title" class="ZWidgetTitle">Include headers</td><td id="zmi__COMPOSE1_REPLY__INCLUDE_HEADERS_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="zm__COMPOSE1_FORWARD_ATT" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_HTML" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_HTML_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_HTML_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgHtmlDoc"></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_HTML_title" class="ZWidgetTitle">Format As HTML</td><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_HTML_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_TEXT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_TEXT_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_TEXT_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgGenericDoc"></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_TEXT_title" class="ZWidgetTitle">Format As Plain Text</td><td id="zmi__COMPOSE1_FORWARD_ATT__FORMAT_TEXT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT123" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT123_check" class="ZCheckIcon"><div></div></td><td id="DWT123_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT123_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_FORWARD_ATT__INC_BODY" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_FORWARD_ATT__INC_BODY_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__INC_BODY_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__INC_BODY_title" class="ZWidgetTitle">Include Original Message</td><td id="zmi__COMPOSE1_FORWARD_ATT__INC_BODY_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_FORWARD_ATT__INC_ATTACHMENT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_FORWARD_ATT__INC_ATTACHMENT_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__INC_ATTACHMENT_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__INC_ATTACHMENT_title" class="ZWidgetTitle">Include Original As Attachment</td><td id="zmi__COMPOSE1_FORWARD_ATT__INC_ATTACHMENT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="DWT124" style="position: static; overflow: visible;" class="ZMenuItemSeparator ZWidget" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT124_check" class="ZCheckIcon"><div></div></td><td id="DWT124_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT124_title" class="ZWidgetTitle"><div class="ZMenuItem-Separator"></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_FORWARD_ATT__USE_PREFIX" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_FORWARD_ATT__USE_PREFIX_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__USE_PREFIX_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__USE_PREFIX_title" class="ZWidgetTitle">Use prefix</td><td id="zmi__COMPOSE1_FORWARD_ATT__USE_PREFIX_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_FORWARD_ATT__INCLUDE_HEADERS" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="zm__COMPOSE1_FORWARD_ATT"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_FORWARD_ATT__INCLUDE_HEADERS_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__INCLUDE_HEADERS_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="zmi__COMPOSE1_FORWARD_ATT__INCLUDE_HEADERS_title" class="ZWidgetTitle">Include headers</td><td id="zmi__COMPOSE1_FORWARD_ATT__INCLUDE_HEADERS_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="zm__COMPOSE1_DECLINE_PROPOSAL" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ActionMenu ZHasCheck ZHasIcon" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_HTML" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_DECLINE_PROPOSAL"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_HTML_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_HTML_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgHtmlDoc"></div></td><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_HTML_title" class="ZWidgetTitle">Format As HTML</td><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_HTML_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr><tr><td nowrap=""><div id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_TEXT" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasLeftIcon ZHasText" parentid="zm__COMPOSE1_DECLINE_PROPOSAL"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_TEXT_check" class="ZCheckIcon"><div></div></td><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_TEXT_left_icon" class="ZLeftIcon ZWidgetIcon"><div class="ImgGenericDoc"></div></td><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_TEXT_title" class="ZWidgetTitle">Format As Plain Text</td><td id="zmi__COMPOSE1_DECLINE_PROPOSAL__FORMAT_TEXT_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT125" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtMenu ZHasCheck" parentid="z_shell"><table cellspacing="0" cellpadding="0" border="0" class="DwtMenuTable"><tbody><tr><td nowrap=""><div id="DWT126" style="position: static; overflow: visible;" class="ZMenuItem ZWidget ZHasText" parentid="DWT125"><table class="ZWidgetTable ZMenuItemTable ZMenuItemBorder" cellspacing="0" cellpadding="0"><tbody><tr><td id="DWT126_check" class="ZCheckIcon"><div class="ImgMenuRadio"></div></td><td id="DWT126_left_icon" class="ZLeftIcon ZWidgetIcon"><div></div></td><td id="DWT126_title" class="ZWidgetTitle">Do Not Attach Signature</td><td id="DWT126_dropdown" class="ZDropDown"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div><div id="DWT130" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtDialog" parentid="z_shell"><div class="DwtDialog"><table cellspacing="0" cellpadding="0" style="cursor:move;" border="0"><tbody><tr id="DWT130_handle"><td class="ImgDialog_NW" width="6"></td><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="ImgDialog_N minWidth" width="1%"></td><td id="DWT130_title" class="ImgDialog_N DwtDialogTitle" nowrap="nowrap">Warning</td><td class="ImgDialog_N minWidth" width="1%"><div class=""></div></td><td class="ImgDialog_N minWidth width=" 1%'=""><div class=""></div></td></tr></tbody></table></td><td class="ImgDialog_NE" width="6"></td></tr><tr><td class="ImgDialog_W" width="6"></td><td class="DwtDialogBody" id="DWT130_content"><div id="DWT127" class="DwtMsgDialog"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top"><div class="ImgWarning_32"></div></td><td class="DwtMsgArea">You will have to reattach your file(s). Open in new window anyway?</td></tr></tbody></table></div></td><td class="ImgDialog_E" width="6"></td></tr><tr><td valign="bottom" class="ImgDialog_SW" width="6"></td><td class="ImgDialog_S"><div id="DWT130_buttons" class="DwtDialogButtonBar"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td align="right"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT128"><div id="DWT131" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText" parentid="DWT130"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT131_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT131_title" class="ImgButton ZWidgetTitle">OK</td><td id="DWT131_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT131_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT129"><div id="DWT132" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText" parentid="DWT130"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT132_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT132_title" class="ImgButton ZWidgetTitle">Cancel</td><td id="DWT132_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT132_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></div></td><td valign="bottom" class="ImgDialog_SE" width="6"></td></tr></tbody></table></div></div><div id="DWT135" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="ZmAttachDialog" parentid="z_shell"><div class="DwtDialog"><table cellspacing="0" cellpadding="0" style="cursor:move;" border="0"><tbody><tr id="DWT135_handle"><td class="ImgDialog_NW" width="6"></td><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="ImgDialog_N minWidth" width="1%"></td><td id="DWT135_title" class="ImgDialog_N DwtDialogTitle" nowrap="nowrap">Attach File(s)</td><td class="ImgDialog_N minWidth" width="1%"><div class=""></div></td><td class="ImgDialog_N minWidth width=" 1%'=""><div class=""></div></td></tr></tbody></table></td><td class="ImgDialog_NE" width="6"></td></tr><tr><td class="ImgDialog_W" width="6"></td><td class="DwtDialogBody" id="DWT135_content"><div id="DWT138" style="position: static; overflow: visible;" class="ZmAttachDialog-container" parentid="DWT135"><div id="DWT139" style="position: static; overflow: visible;" class="ZTabView ZWidget" parentid="DWT138"><div id="DWT139_tabbar"><div id="DWT140" style="position: static; overflow: visible;" class="ZTabBar ZWidget" parentid="DWT139"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr valign="bottom" id="DWT140_items"><td id="DWT140_prefix" class="ZTabBarPrefix ImgTab">&nbsp;</td><td id="DWT140_item_53"><div id="DWT145" style="position: static; overflow: visible;" class="ZTab ZWidget ZHasText                                          ZFirstItem ZLastItem ZSelected " parentid="DWT140"><table class="ZWidgetBorder ZTabTable ZWidgetTable" cellspacing="0" cellpadding="0"><tbody><tr><td><div class="ImgTab_L"></div></td><td id="DWT145_left_icon" class="ImgTab ZLeftIcon ZWidgetIcon"></td><td id="DWT145_title" class="ImgTab ZWidgetTitle">My Computer</td><td id="DWT145_right_icon" class="ImgTab ZRightIcon ZWidgetIcon"></td><td><div class="ImgTab_R"></div></td></tr></tbody></table></div></td><td id="DWT140_suffix" class="ZTabBarSuffix ImgTab">&nbsp;</td></tr></tbody></table></div></div><div id="DWT139_page"><div id="DWT143" style="position: static; overflow: auto; z-index: 310; height: 240px; display: block;" class="ZTabPage" parentid="DWT139" x-display="block"><div style="overflow:auto"><form accept-charset="utf-8" method="POST" action="http://web.mail.comcast.net/service/upload?fmt=extended" id="DWT143_uploadForm" enctype="multipart/form-data"><input type="hidden" name="_charset_"><table id="DWT143_attachmentTable" cellspacing="0" cellpadding="0" border="0" class="iframeTable"><tbody><tr><td><br><br></td></tr><tr><td><table cellspacing="2" cellpadding="0" border="0"><tbody><tr><td><div class="attachText">Attach:</div></td><td class="nobreak"><input id="DWT161_input" type="file" name="_attFile_" size="40">&nbsp;
                                <span id="DWT161_remove" onmouseover="this.style.cursor=&quot;pointer&quot;" onmouseout="this.style.cursor=&quot;default&quot;" class="ZmAttachDialog-removeLink">Remove</span><span id="DWT161_size">&nbsp;</span></td></tr></tbody></table></td></tr><tr><td><table cellspacing="2" cellpadding="0" border="0"><tbody><tr><td><div class="attachText">Attach:</div></td><td class="nobreak"><input id="DWT162_input" type="file" name="_attFile_" size="40">&nbsp;
                                <span id="DWT162_remove" onmouseover="this.style.cursor=&quot;pointer&quot;" onmouseout="this.style.cursor=&quot;default&quot;" class="ZmAttachDialog-removeLink">Remove</span><span id="DWT162_size">&nbsp;</span></td></tr></tbody></table></td></tr><tr><td><table cellspacing="2" cellpadding="0" border="0"><tbody><tr><td><div class="attachText">Attach:</div></td><td class="nobreak"><input id="DWT163_input" type="file" name="_attFile_" size="40">&nbsp;
                                <span id="DWT163_remove" onmouseover="this.style.cursor=&quot;pointer&quot;" onmouseout="this.style.cursor=&quot;default&quot;" class="ZmAttachDialog-removeLink">Remove</span><span id="DWT163_size">&nbsp;</span></td></tr></tbody></table></td></tr><tr><td><table cellspacing="2" cellpadding="0" border="0"><tbody><tr><td><div class="attachText">Attach:</div></td><td class="nobreak"><input id="DWT164_input" type="file" name="_attFile_" size="40">&nbsp;
                                <span id="DWT164_remove" onmouseover="this.style.cursor=&quot;pointer&quot;" onmouseout="this.style.cursor=&quot;default&quot;" class="ZmAttachDialog-removeLink">Remove</span><span id="DWT164_size">&nbsp;</span></td></tr></tbody></table></td></tr><tr><td><table cellspacing="2" cellpadding="0" border="0"><tbody><tr><td><div class="attachText">Attach:</div></td><td class="nobreak"><input id="DWT165_input" type="file" name="_attFile_" size="40">&nbsp;
                                <span id="DWT165_remove" onmouseover="this.style.cursor=&quot;pointer&quot;" onmouseout="this.style.cursor=&quot;default&quot;" class="ZmAttachDialog-removeLink">Remove</span><span id="DWT165_size">&nbsp;</span></td></tr></tbody></table></td></tr></tbody></table></form></div><div><table id="DWT143_attachmentButtonTable"><tbody><tr><td><div id="DWT144" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText        " parentid="DWT143"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT144_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT144_title" class="ImgButton ZWidgetTitle">Add More Attachments</td><td id="DWT144_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT144_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></div></div></div></div><div class="ZmAttachDialog-note"><b>Note:&nbsp;</b>Maximum size of message, including headers and encoded attachments, is 25 MB.<br><a href="http://customer.comcast.com/help-and-support/internet/limitations-on-sending-email/" target="_blank">Learn More</a></div><div class="ZmAttachDialog-inline" id="DWT141" option="inline"><input type="checkbox" name="inlineimages" id="DWT135_inlineCheckbox"> <label for="DWT135_inlineCheckbox">Show images in message body</label></div><div class="ZmAttachDialog-footer" id="DWT142"></div></div></td><td class="ImgDialog_E" width="6"></td></tr><tr><td valign="bottom" class="ImgDialog_SW" width="6"></td><td class="ImgDialog_S"><div id="DWT135_buttons" class="DwtDialogButtonBar"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td align="right"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT133"><div id="DWT136" style="position: static; overflow: visible;" class="ZButton ZWidget   ZHasText    " parentid="DWT135"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT136_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT136_title" class="ImgButton ZWidgetTitle">Attach</td><td id="DWT136_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT136_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT134"><div id="DWT137" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText          " parentid="DWT135"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT137_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT137_title" class="ImgButton ZWidgetTitle">Cancel</td><td id="DWT137_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT137_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></div></td><td valign="bottom" class="ImgDialog_SE" width="6"></td></tr></tbody></table></div></div><div id="DWT169" style="position: absolute; overflow: visible; left: -10000px; top: -10000px; z-index: 100;" class="DwtDialog" parentid="z_shell"><div class="DwtDialog"><table cellspacing="0" cellpadding="0" style="cursor:move;" border="0"><tbody><tr id="DWT169_handle"><td class="ImgDialog_NW" width="6"></td><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="ImgDialog_N minWidth" width="1%"></td><td id="DWT169_title" class="ImgDialog_N DwtDialogTitle" nowrap="nowrap"></td><td class="ImgDialog_N minWidth" width="1%"><div class=""></div></td><td class="ImgDialog_N minWidth width=" 1%'=""><div class=""></div></td></tr></tbody></table></td><td class="ImgDialog_NE" width="6"></td></tr><tr><td class="ImgDialog_W" width="6"></td><td class="DwtDialogBody" id="DWT169_content"><div id="DWT166" class="DwtMsgDialog"></div></td><td class="ImgDialog_E" width="6"></td></tr><tr><td valign="bottom" class="ImgDialog_SW" width="6"></td><td class="ImgDialog_S"><div id="DWT169_buttons" class="DwtDialogButtonBar"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td align="right"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT167"><div id="DWT170" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText" parentid="DWT169"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT170_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT170_title" class="ImgButton ZWidgetTitle">OK</td><td id="DWT170_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT170_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT168"><div id="DWT171" style="position: static; overflow: visible;" class="ZButton ZWidget ZHasText" parentid="DWT169"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT171_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT171_title" class="ImgButton ZWidgetTitle">Cancel</td><td id="DWT171_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT171_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></div></td><td valign="bottom" class="ImgDialog_SE" width="6"></td></tr></tbody></table></div></div><div id="zovc__main_Mail" style="position: absolute; overflow-y: auto; overflow-x: hidden;" class="ZmOverviewContainer" parentid="z_shell"><div id="DWT172" style="position: static; overflow: hidden;" class="DwtComposite ZmOverviewSection"><div class="DwtTreeItem" id="DWT172_div"><table id="DWT172_table" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td align="center" nowrap="" id="DWT172_nodeCell" style="height: 16px; width: 16px;"><div class="ImgNodeCollapsed"></div></td><td nowrap="" class="imageCell" id="DWT172_imageCell"><div class="ImgAccountZimbra"></div></td><td nowrap="" class="DwtTreeItem-Text" id="DWT172_textCell">thegilligans</td><td nowrap="" width="16" class="imageCell" id="DWT172_extraCell"><div></div></td></tr></tbody></table></div><div class="DwtTreeItemLevel1ChildDiv" style="display: none;"><div id="zov__main_Mail__DWT173" style="position: static; overflow: hidden;" class="ZmOverview"><div id="main_Mail-parent-PREF_PAGE"></div><div id="main_Mail-parent-ADDRBOOK"></div><div id="main_Mail-parent-CALENDAR"></div><div id="main_Mail-parent-Voice"></div><div id="main_Mail-parent-FOLDER"></div><div id="main_Mail-parent-SEARCH"></div><div id="main_Mail-parent-TAG"></div><div id="main_Mail-parent-ZIMLET"></div></div></div></div></div></div><div style="z-index: 0; position: absolute; visibility: hidden;"><table><tbody><tr></tr></tbody></table></div><textarea id="kbff" tabindex="0" style="position: absolute; left: -10000px; top: -10000px;"></textarea></body></html>