Ticket #7721: PageSource_772015185.html

File PageSource_772015185.html, 596.8 KB (added by stargatefan, 13 years ago)
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
2<!--
3 launchZCS.jsp
4 * ***** BEGIN LICENSE BLOCK *****
5 * Zimbra Collaboration Suite Web Client
6 * Copyright (C) 2007, 2008, 2009, 2010 Zimbra, Inc.
7 *
8 * The contents of this file are subject to the Zimbra Public License
9 * Version 1.3 ("License"); you may not use this file except in
10 * compliance with the License. You may obtain a copy of the License at
11 * http://www.zimbra.com/license.
12 *
13 * Software distributed under the License is distributed on an "AS IS"
14 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
15 * ***** END LICENSE BLOCK *****
16-->
17
18<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
19
20<title>XFINITY Connect</title>
21<link href="/zimbra/css/images,common,dwt,msgview,login,zm,spellcheck,wiki,skin.css?v=110527090709&amp;debug=&amp;skin=velodrome2&amp;locale=en_US" rel="stylesheet" type="text/css">
22
23<link rel="SHORTCUT ICON" href="/zimbra/img/logo/favicon.ico">
24<script>
25 appContextPath = "/zimbra";
26 appCurrentSkin = "velodrome2";
27 appExtension = ".zgz";
28 appDevMode = false;
29
30function purl(name, temp_string ) {
31 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
32 var regexS = "[\\?&]"+name+"=([^&#]*)";
33 var regex = new RegExp( regexS );
34 var results = regex.exec( temp_string );
35 if( results == null )
36 return "";
37 else
38 return results[1];
39}
40
41function update_prefs_cookie ( old_cookie_name, new_cookie_name ) {
42
43 var results_new = document.cookie.match ( '(^|;) ?' + new_cookie_name + '=([^;]*)(;|$)' );
44
45 if (results_new) {
46
47 var results_old = document.cookie.match ( '(^|;) ?' + old_cookie_name + '=([^;]*)(;|$)' );
48 if (results_old) {
49 var old_cookie_temp = unescape(results_old[2]);
50 old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_user_guid=\"\""),"");
51 old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_user_guid="),"");
52 old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip=\"\""),"");
53 old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip=%22%22"),"");
54 old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip="),"");
55 }
56 else {
57 var old_cookie_temp = "";
58 }
59
60 var adt_zip = purl("zip", (unescape(results_new[2])));
61 var ad_user_guid = purl("tid", (unescape(results_new[2])));
62
63 //Delete old cookie
64 document.cookie = old_cookie_name + '=""; path=/; domain=.comcast.net; expires=Thu, 01-Jan-1970 00:00:01 GMT';
65
66 //Re-write new cookie
67 if (old_cookie_temp) {
68 old_cookie_temp += "&adt_zip=\"" + adt_zip + "\"&adt_user_guid=\"" + ad_user_guid + "\"";
69 }
70 else {
71 old_cookie_temp = "adt_zip=\"" + adt_zip + "\"&adt_user_guid=\"" + ad_user_guid + "\"";
72 }
73
74 var d = new Date();
75 d.setDate(d.getDate()+1000)
76 var cd = d.toGMTString();
77
78 document.cookie = old_cookie_name + '=' + old_cookie_temp+'; path=/; domain=.comcast.net; expires='+cd;
79 var zip_array = new Array("zip", adt_zip);
80 return zip_array;
81 }
82 else {
83 return null;
84 }
85}
86</script>
87
88<script type="text/javascript">
89 // <![CDATA[
90 var f_ADTARGET_ZIP = (function() {
91 var zip_matches = document.cookie.match(/adt_zip=\"(.*?)\"/);
92 if(!zip_matches)
93 zip_matches = document.cookie.match(/adt_zip=%22(.*?)%22/);
94 if (!zip_matches)
95 zip_matches = update_prefs_cookie("prefs", "MYPORTAL");
96 var flag_matches = document.cookie.match(/adt_optout_flag=(true|false)/);
97 if(flag_matches && flag_matches[1]=="true") {
98 return "US:UNKNOWN";
99 } else {
100 if(zip_matches) {
101 return "US:"+zip_matches[1];
102 } else return "US:UNKNOWN";
103 }
104 })();
105 document['f_ADTARGET_ZIP'] = f_ADTARGET_ZIP;
106 // ]]>
107</script>
108<noscript></noscript>
109<script>
110/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
111if(AjxPackage.define("Startup2")){
112if(AjxPackage.define("ajax.net.AjxInclude")){
113AjxInclude=function(i,n,o,a){
114var t=document.getElementsByTagName("head")[0];
115function e(h){
116if(AjxEnv.isIE&&h&&!/loaded|complete/.test(h.readyState)){
117return
118}
119if(h){
120h[AjxInclude.eventName]=null
121}
122var s=AjxInclude.dwhack_scripts.length>0?AjxInclude.dwhack_scripts:i;
123window.status="";
124if(s.length>0){
125var c=s.shift();
126var d=c;
127if(!/^((https?|ftps?):\x2f\x2f|\x2f)/.test(c)){
128if(n){
129c=n+c
130}
131if(cacheKillerVersion){
132c+="?v="+cacheKillerVersion
133}}else{
134if(a&&c.indexOf("/")!=0){
135c=a+AjxStringUtil.urlEncode(c)
136}}
137var h=document.createElement("script");
138var l=AjxCallback.simpleClosure(e,null,h);
139if(AjxEnv.isIE){
140h.attachEvent("onreadystatechange",l);
141h.attachEvent("onerror",l)
142}else{
143h.addEventListener("load",l,true);
144h.addEventListener("error",l,true)
145}
146h.type="text/javascript";
147h.src=c;
148window.status="Loading script: "+d;
149t.appendChild(h)
150}else{
151if(i.length==0){
152h=null;
153t=null;
154if(o){
155o.run()
156}}}}
157e(null)
158};
159AjxInclude.dwhack_scripts=[];
160document.write=document.writeln=function(){
161var e=[];
162for(var t=0;
163t<arguments.length;
164++t){
165e[t]=arguments[t]
166}
167var o=e.join("");
168if(/<script[^>]+src=([\x22\x27])(.*?)\1/i.test(o)){
169AjxInclude.dwhack_scripts.push(RegExp.$2)
170}};
171if(AjxEnv.isIE){
172AjxInclude._removeWriteln=function(){
173document.write=document.writeln=null;
174window.detachEvent("onunload",AjxInclude._removeWriteln)
175};
176window.attachEvent("onunload",AjxInclude._removeWriteln)
177}}
178if(AjxPackage.define("ajax.util.AjxDateUtil")){
179AjxDateUtil=function(){};
180AjxDateUtil.YEAR=1;
181AjxDateUtil.MONTH=2;
182AjxDateUtil.WEEK=3;
183AjxDateUtil.DAY=4;
184AjxDateUtil.TWO_WEEKS=5;
185AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES=900000;
186AjxDateUtil.MSEC_PER_HALF_HOUR=1800000;
187AjxDateUtil.MSEC_PER_HOUR=3600000;
188AjxDateUtil.MSEC_PER_DAY=24*AjxDateUtil.MSEC_PER_HOUR;
189AjxDateUtil.WEEKDAY_SHORT=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
190AjxDateUtil.WEEKDAY_MEDIUM=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
191AjxDateUtil.WEEKDAY_LONG=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
192AjxDateUtil.MONTH_SHORT=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
193AjxDateUtil.MONTH_MEDIUM=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
194AjxDateUtil.MONTH_LONG=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
195AjxDateUtil._daysPerMonth={
1960:31,1:29,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31};
197AjxDateUtil.WEEK_ONE_JAN_DATE=1;
198AjxDateUtil._init=function(){
199AjxDateUtil._dateFormat=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT).clone();
200var e=AjxDateUtil._dateFormat.getSegments();
201for(var t=0;
202t<e.length;
203t++){
204if(e[t] instanceof AjxDateFormat.YearSegment){
205e[t]=new AjxDateFormat.YearSegment(AjxDateUtil._dateFormat,"yyyy")
206}}
207AjxDateUtil._dateTimeFormat=new AjxDateFormat(AjxDateUtil._dateFormat.toPattern()+" "+AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT));
208AjxDateUtil._dateFormatNoYear=new AjxDateFormat(AjxMsg.formatDateMediumNoYear)
209};
210AjxDateUtil._init();
211AjxDateUtil.validDate=function(o,e,i){
212var t=new Date(o,e,i);
213var a=o>999?t.getFullYear():t.getYear();
214return t.getMonth()==e&&t.getDate()==i&&a==o
215};
216AjxDateUtil.daysInMonth=function(a,e){
217var t=new Date(a,e,1,12);
218t.setMonth(t.getMonth()+1);
219t.setDate(t.getDate()-1);
220return t.getDate()
221};
222AjxDateUtil.isLeapYear=function(e){
223return(new Date(e,1,29)).getMonth()==1
224};
225AjxDateUtil.isLocale24Hour=function(){
226var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
227var e=t._segments.length;
228for(var a=0;
229a<e;
230a++){
231if(t._segments[a]._s=="a"){
232return false
233}}
234return true
235};
236AjxDateUtil.roll=function(t,a,o){
237var i=t.getDate();
238if(a==AjxDateUtil.MONTH){
239t.setDate(1);
240t.setMonth(t.getMonth()+o);
241var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
242t.setDate(Math.min(i,e))
243}else{
244if(a==AjxDateUtil.YEAR){
245t.setDate(1);
246t.setFullYear(t.getFullYear()+o);
247var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
248t.setDate(Math.min(i,e))
249}else{
250if(a==AjxDateUtil.WEEK){
251t.setDate(t.getDate()+7*o)
252}else{
253if(a==AjxDateUtil.DAY){
254t.setDate(t.getDate()+o)
255}else{
256if(a==AjxDateUtil.TWO_WEEKS){
257t.setDate(t.getDate()+14*o)
258}else{
259return t
260}}}}}
261return t
262};
263AjxDateUtil.isDayShifted=function(e){
264var t=new Date(e.getTime());
265t.setDate(t.getDate()+1);
266t.setHours(0,0,0,0);
267return t.getTime()==e.getTime()
268};
269AjxDateUtil.rollToNextDay=function(e){
270e.setHours(0,0,0,0);
271e.setTime(e.getTime()+AjxDateUtil.MSEC_PER_DAY)
272};
273AjxDateUtil.computeDateDelta=function(e){
274var t=(new Date()).getTime()-e;
275var a=AjxDateUtil.computeDuration(t);
276return a?(a+" "+AjxMsg.ago):null
277};
278AjxDateUtil.computeDuration=function(a,l){
279if(a<0){
280return null
281}
282var o=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*365));
283if(o!=0){
284a-=o*AjxDateUtil.MSEC_PER_DAY*365
285}
286var t=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*30.42));
287if(t>0){
288a-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
289}
290var h=Math.floor(a/AjxDateUtil.MSEC_PER_DAY);
291if(h>0){
292a-=h*AjxDateUtil.MSEC_PER_DAY
293}
294var n=Math.floor(a/AjxDateUtil.MSEC_PER_HOUR);
295if(n>0){
296a-=n*AjxDateUtil.MSEC_PER_HOUR
297}
298var e=Math.floor(a/60000);
299if(e>0){
300a-=e*60000
301}
302var i=Math.floor(a/1000);
303var s=l?AjxDurationFormatConcise:AjxDurationFormatVerbose;
304if(o>0){
305return s.formatYears(o,t)
306}else{
307if(t>0){
308return s.formatMonths(t,h)
309}else{
310if(h>0){
311return s.formatDays(h,n)
312}else{
313if(n>0){
314return s.formatHours(n,e)
315}else{
316if(e>0){
317return s.formatMinutes(e,i)
318}else{
319return s.formatSeconds(i)
320}}}}}};
321AjxDateUtil.simpleComputeDateStr=function(t,a){
322var e=AjxDateUtil._dateFormat.format(t);
323return a?a+e:e
324};
325AjxDateUtil.simpleParseDateStr=function(e){
326return AjxDateUtil._dateFormat.parse(e)
327};
328AjxDateUtil.simpleComputeDateTimeStr=function(t,a){
329var e=AjxDateUtil._dateTimeFormat.format(t);
330return a?a+e:e
331};
332AjxDateUtil.simpleParseDateTimeStr=function(e){
333return AjxDateUtil._dateTimeFormat.parse(e)
334};
335AjxDateUtil.longComputeDateStr=function(e){
336var t=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
337return t.format(e)
338};
339AjxDateUtil.computeDateStr=function(a,t){
340if(t==null){
341return""
342}
343var e=new Date(t);
344if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
345return AjxDateUtil.computeTimeString(e)
346}
347if(a.getFullYear()==e.getFullYear()){
348return AjxDateUtil._dateFormatNoYear.format(e)
349}
350return AjxDateUtil.simpleComputeDateStr(e)
351};
352AjxDateUtil.computeWordyDateStr=function(a,t){
353if(t==null){
354return""
355}
356var e=new Date(t);
357if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
358if(!AjxDateUtil._wordyDateToday){
359AjxDateUtil._wordyDateToday=new AjxDateFormat(AjxMsg.formatWordyDateToday)
360}
361return AjxDateUtil._wordyDateToday.format(e)
362}else{
363if((a.getTime()-t)<(2*AjxDateUtil.MSEC_PER_DAY)&&(a.getDay()-1)==e.getDay()){
364if(!AjxDateUtil._wordyDateYesterday){
365AjxDateUtil._wordyDateYesterday=new AjxDateFormat(AjxMsg.formatWordyDateYesterday)
366}
367return AjxDateUtil._wordyDateYesterday.format(e)
368}else{
369if(!AjxDateUtil._wordyDate){
370AjxDateUtil._wordyDate=new AjxDateFormat(AjxMsg.formatWordyDate)
371}
372return AjxDateUtil._wordyDate.format(e)
373}}};
374AjxDateUtil.computeTimeString=function(e){
375var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
376return t.format(e)
377};
378AjxDateUtil.computeDateTimeString=function(e){
379var t=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG);
380return t.format(e)
381};
382AjxDateUtil._getHoursStr=function(t,a,e){
383var i=t.getHours();
384if(!e){
385i%=12;
386if(i==0){
387i=12
388}}
389return a?AjxDateUtil._pad(i):i
390};
391AjxDateUtil._getMinutesStr=function(e){
392return AjxDateUtil._pad(e.getMinutes())
393};
394AjxDateUtil._getSecondsStr=function(e){
395return AjxDateUtil._pad(e.getSeconds())
396};
397AjxDateUtil._getAMPM=function(t,a){
398var e=t.getHours();
399return(e<12)?(a?"AM":"am"):(a?"PM":"pm")
400};
401AjxDateUtil._getMonthName=function(e,t){
402return t?AjxDateUtil.MONTH_MEDIUM[e.getMonth()]:AjxDateUtil.MONTH_LONG[e.getMonth()]
403};
404AjxDateUtil._getMonth=function(e,a){
405var t=e.getMonth()+1;
406if(a){
407return AjxDateUtil._pad(t)
408}else{
409return t
410}};
411AjxDateUtil._getDate=function(e,t){
412var a=e.getDate();
413return t?AjxDateUtil._pad(a):a
414};
415AjxDateUtil._getWeekday=function(e){
416var t=e.getDay();
417return AjxDateUtil.WEEKDAY_LONG[t]
418};
419AjxDateUtil._getWeekdayMedium=function(e){
420var t=e.getDay();
421return AjxDateUtil.WEEKDAY_MEDIUM[t]
422};
423AjxDateUtil._getFullYear=function(e){
424return e.getFullYear()
425};
426AjxDateUtil.getFirstDayOfWeek=function(i,e){
427e=e||0;
428var t=i.getDay();
429var a=(t-e+7)%7;
430i.setDate(i.getDate()-a);
431return i
432};
433AjxDateUtil.getWeekNumber=function(g,c,x,w){
434c=c||0;
435x=x||AjxDateUtil.WEEK_ONE_JAN_DATE;
436g=g||new Date();
437g.setHours(12,0,0,0);
438var o=g,k,h;
439if(o.getDay()===c){
440k=o
441}else{
442k=AjxDateUtil.getFirstDayOfWeek(o,c)
443}
444var u=k.getFullYear(),l=k.getTime();
445h=new Date(k.getTime()+6*AjxDateUtil.MSEC_PER_DAY);
446var e;
447if(!w){
448if(u!==h.getFullYear()&&h.getDate()>=x){
449e=1
450}else{
451var n=(new Date(u,0,x));
452n.setHours(12,0,0,0);
453var i=AjxDateUtil.getFirstDayOfWeek(n,c);
454var f=Math.round((o.getTime()-i.getTime())/AjxDateUtil.MSEC_PER_DAY);
455var t=f%7;
456var v=(f-t)/7;
457e=v+1
458}
459return e
460}else{
461var y=new Date(g.getFullYear(),0,1);
462var m=y.getDay()-1;
463m=(m>=0?m:m+7);
464var a=Math.floor((g.getTime()-y.getTime()-(g.getTimezoneOffset()-y.getTimezoneOffset())*60000)/AjxDateUtil.MSEC_PER_DAY)+1;
465if(m<4){
466e=Math.floor((a+m-1)/7)+1;
467if(e>52){
468var b=new Date(g.getFullYear()+1,0,1);
469var p=b.getDay()-1;
470p=p>=0?p:p+7;
471e=p<4?1:53
472}}else{
473e=Math.floor((a+m-1)/7);
474if(e==0){
475var s=new Date(g.getFullYear()-1,0,1);
476var d=s.getDay()-1;
477d=(d>=0?d:d+7);
478e=(d==3||(AjxDateUtil.isLeapYear(s.getFullYear())&&d==2))?53:52
479}}
480return e
481}};
482AjxDateUtil.getTimeStr=function(e,a){
483var t=a;
484t=t.replace(/%d/g,AjxDateUtil._getDate(e,true));
485t=t.replace(/%D/g,AjxDateUtil._getDate(e,false));
486t=t.replace(/%w/g,AjxDateUtil._getWeekday(e));
487t=t.replace(/%M/g,AjxDateUtil._getMonthName(e));
488t=t.replace(/%t/g,AjxDateUtil._getMonthName(e,true));
489t=t.replace(/%n/g,AjxDateUtil._getMonth(e,true));
490t=t.replace(/%Y/g,AjxDateUtil._getFullYear(e));
491t=t.replace(/%h/g,AjxDateUtil._getHoursStr(e,false,false));
492t=t.replace(/%H/g,AjxDateUtil._getHoursStr(e,true,false));
493t=t.replace(/%m/g,AjxDateUtil._getMinutesStr(e));
494t=t.replace(/%s/g,AjxDateUtil._getSecondsStr(e));
495t=t.replace(/%P/g,AjxDateUtil._getAMPM(e,true));
496t=t.replace(/%p/g,AjxDateUtil._getAMPM(e,false));
497return t
498};
499AjxDateUtil.getRoundedMins=function(e,a){
500var t=e.getMinutes();
501if(t!=0&&a){
502t=(Math.ceil((t/a)))*a
503}
504return t
505};
506AjxDateUtil.roundTimeMins=function(t,i){
507var a=t.getMinutes();
508var e=t.getHours();
509if(a!=0&&i){
510a=(Math.ceil((a/i)))*i;
511if(a==60){
512a=0;
513e++
514}
515t.setMinutes(a);
516t.setHours(e)
517}
518return t
519};
520AjxDateUtil.isInRange=function(i,t,a,e){
521return(i<e&&t>a)
522};
523AjxDateUtil.getSimpleDateFormat=function(){
524return AjxDateUtil._dateFormat
525};
526AjxDateUtil.getServerDate=function(e){
527if(!AjxDateUtil._serverDateFormatter){
528AjxDateUtil._serverDateFormatter=new AjxDateFormat("yyyyMMdd")
529}
530return AjxDateUtil._serverDateFormatter.format(e)
531};
532AjxDateUtil.getServerDateTime=function(t,i){
533var e=t;
534var a=null;
535if(i){
536if(!AjxDateUtil._serverDateTimeFormatterUTC){
537AjxDateUtil._serverDateTimeFormatterUTC=new AjxDateFormat("yyyyMMdd'T'HHmmss'Z'")
538}
539a=AjxDateUtil._serverDateTimeFormatterUTC;
540e=new Date(t.getTime());
541e.setMinutes(e.getMinutes()+e.getTimezoneOffset())
542}else{
543if(!AjxDateUtil._serverDateTimeFormatter){
544AjxDateUtil._serverDateTimeFormatter=new AjxDateFormat("yyyyMMdd'T'HHmmss")
545}
546a=AjxDateUtil._serverDateTimeFormatter
547}
548return a.format(e)
549};
550AjxDateUtil.parseServerTime=function(i,e){
551if(i.charAt(8)=="T"){
552var a=parseInt(i.substr(9,2),10);
553var o=parseInt(i.substr(11,2),10);
554var t=parseInt(i.substr(13,2),10);
555if(i.charAt(15)=="Z"){
556o+=AjxTimezone.getOffset(AjxTimezone.DEFAULT,e)
557}
558e.setHours(a,o,t,0)
559}
560return e
561};
562AjxDateUtil.parseISO8601Date=function(o){
563var t=AjxDateUtil.__ISO8601_formats;
564if(!t){
565t=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")]
566}
567for(var a=0;
568a<t.length;
569a++){
570var e=t[a].parse(o);
571if(e){
572return e
573}}
574return null
575};
576AjxDateUtil.TZDFormat=function(o){
577if(arguments.length==0){
578return
579}
580AjxDateFormat.apply(this,arguments);
581var e=this._segments||[];
582for(var t=0;
583t<e.length;
584t++){
585var a=e[t];
586if(a instanceof AjxDateFormat.TimezoneSegment){
587e[t]=new AjxDateUtil.TZDSegment(a.toSubPattern())
588}}};
589AjxDateUtil.TZDFormat.prototype=new AjxDateFormat;
590AjxDateUtil.TZDFormat.prototype.constructor=AjxDateUtil.TZDFormat;
591AjxDateUtil.TZDFormat.prototype.toString=function(){
592return"TZDFormat"
593};
594AjxDateUtil.TZDSegment=function(e){
595if(arguments.length==0){
596return
597}
598AjxDateFormat.TimezoneSegment.apply(this,arguments)
599};
600AjxDateUtil.TZDSegment.prototype=new AjxDateFormat.TimezoneSegment;
601AjxDateUtil.TZDSegment.prototype.constructor=AjxDateUtil.TZDSegment;
602AjxDateUtil.TZDSegment.prototype.toString=function(){
603return"TZDSegment"
604};
605AjxDateUtil.TZDSegment.prototype.parse=function(c,n,a){
606var e=/^(Z)|^(\+|\-)(\d\d):(\d\d)/.exec(n.substr(a));
607if(e){
608var l=new Date().getTimezoneOffset();
609if(e[1]){
610c.timezone=l
611}else{
612var t=parseInt(e[3],10),h=parseInt(e[4],10);
613c.timezone=t*60+h;
614if(e[2]!="-"){
615c.timezone*=-1
616}
617c.timezone-=l
618}}
619return a+(e?e[0].length:0)
620};
621AjxDateUtil.parseServerDateTime=function(t){
622if(t==null){
623return null
624}
625var a=new Date();
626var o=parseInt(t.substr(0,4),10);
627var i=parseInt(t.substr(4,2),10);
628var e=parseInt(t.substr(6,2),10);
629a.setFullYear(o);
630a.setMonth(i-1);
631a.setMonth(i-1);
632a.setDate(e);
633AjxDateUtil.parseServerTime(t,a);
634return a
635};
636AjxDateUtil._pad=function(e){
637return e<10?("0"+e):e
638};
639AjxDurationFormatVerbose=function(){};
640AjxDurationFormatVerbose.formatYears=function(a,e){
641var t=a+" ";
642t+=(a>1)?AjxMsg.years:AjxMsg.year;
643if(a<=3&&e>0){
644t+=" "+e;
645t+=" "+((e>1)?AjxMsg.months:AjxMsg.months)
646}
647return t
648};
649AjxDurationFormatVerbose.formatMonths=function(e,a){
650var t=e+" ";
651t+=(e>1)?AjxMsg.months:AjxMsg.month;
652if(e<=3&&a>0){
653t+=" "+a;
654t+=" "+((a>1)?AjxMsg.days:AjxMsg.day)
655}
656return t
657};
658AjxDurationFormatVerbose.formatDays=function(a,e){
659var t=a+" ";
660t+=(a>1)?AjxMsg.days:AjxMsg.day;
661if(a<=2&&e>0){
662t+=" "+e;
663t+=" "+((e>1)?AjxMsg.hours:AjxMsg.hour)
664}
665return t
666};
667AjxDurationFormatVerbose.formatHours=function(e,a){
668var t=e+" ";
669t+=(e>1)?AjxMsg.hours:AjxMsg.hour;
670if(e<5&&a>0){
671t+=" "+a;
672t+=" "+((a>1)?AjxMsg.minutes:AjxMsg.minute)
673}
674return t
675};
676AjxDurationFormatVerbose.formatMinutes=function(a,t){
677var e=a+" ";
678e+=((a>1)?AjxMsg.minutes:AjxMsg.minute);
679if(a<5&&t>0){
680e+=" "+t;
681e+=" "+((t>1)?AjxMsg.seconds:AjxMsg.second)
682}
683return e
684};
685AjxDurationFormatVerbose.formatSeconds=function(e){
686return(e+" "+((e>1)?AjxMsg.seconds:AjxMsg.second))
687};
688AjxDurationFormatConcise=function(){};
689AjxDurationFormatConcise.formatYears=function(t,e){
690return this._format(t,e)
691};
692AjxDurationFormatConcise.formatMonths=function(e,t){
693return this._format(e,t)
694};
695AjxDurationFormatConcise.formatDays=function(t,e){
696return this._format(t,e)
697};
698AjxDurationFormatConcise.formatHours=function(e,t){
699return this._format(e,t)
700};
701AjxDurationFormatConcise.formatMinutes=function(t,e){
702return this._format(t,e)
703};
704AjxDurationFormatConcise.formatSeconds=function(e){
705return this._format(0,e)
706};
707AjxDurationFormatConcise._format=function(o,t){
708var n=0;
709var e=[];
710e[n++]=o;
711e[n++]=":";
712if(t<10){
713e[n++]="0"
714}
715e[n++]=t;
716return e.join("")
717};
718AjxDateUtil.SUNDAY=0;
719AjxDateUtil.MONDAY=1;
720AjxDateUtil.TUESDAY=2;
721AjxDateUtil.WEDNESDAY=3;
722AjxDateUtil.THURSDAY=4;
723AjxDateUtil.FRIDAY=5;
724AjxDateUtil.SATURDAY=6;
725AjxDateUtil.getDateForNextDay=function(t,n,o){
726o=o||1;
727var a=new Date(t);
728for(var e=0;
729e<o;
730e++){
731a=AjxDateUtil._getDateForNextWeekday(a,n);
732if(e<o-1){
733a.setDate(a.getDate()+1)
734}}
735return a
736};
737AjxDateUtil.getDateForNextWorkWeekDay=function(t,o){
738o=o?o:1;
739var a=new Date(t);
740for(var e=0;
741e<o;
742e++){
743a=AjxDateUtil._getDateForNextWorkWeekday(a);
744if(e<o-1){
745a.setDate(a.getDate()+1)
746}}
747return a
748};
749AjxDateUtil.getDateForThisDay=function(e,a,t){
750if(t<0){
751return AjxDateUtil.getDateForPrevDay(e,a,-t)
752}else{
753return AjxDateUtil.getDateForNextDay(e,a,t)
754}};
755AjxDateUtil.getDateForThisWorkWeekDay=function(e,t){
756if(t<0){
757return AjxDateUtil.getDateForPrevWorkWeekDay(e,-t)
758}else{
759return AjxDateUtil.getDateForNextWorkWeekDay(e,t)
760}};
761AjxDateUtil.getDateForPrevDay=function(t,n,o){
762o=o||1;
763var a=new Date(t);
764for(var e=0;
765e<o;
766e++){
767a=AjxDateUtil._getDateForPrevWeekday(a,n);
768if(e<o-1){
769a.setDate(a.getDate()-1)
770}}
771return a
772};
773AjxDateUtil.getDateForPrevWorkWeekDay=function(t,o){
774o=o||1;
775var a=new Date(t);
776for(var e=0;
777e<o;
778e++){
779a=AjxDateUtil._getDateForPrevWorkWeekday(a);
780if(e<o-1){
781a.setDate(a.getDate()-1)
782}}
783return a
784};
785AjxDateUtil._getDateForNextWeekday=function(a,o){
786var e=new Date(a);
787var t=a.getDay();
788if(t==o){
789return e
790}
791var i=(o-t);
792if(i>0){
793e.setDate(a.getDate()+i)
794}else{
795e.setDate(a.getDate()+(7+i))
796}
797return e
798};
799AjxDateUtil._getDateForNextWorkWeekday=function(a){
800var e=new Date(a);
801var t=a.getDay();
802if(t==AjxDateUtil.SUNDAY){
803e.setDate(a.getDate()+1)
804}else{
805if(t==AjxDateUtil.SATURDAY){
806e.setDate(a.getDate()+2)
807}}
808return e
809};
810AjxDateUtil._getDateForPrevWeekday=function(a,o){
811var e=new Date(a);
812var t=a.getDay();
813if(t==o){
814return e
815}
816var i=(t-o);
817if(i>0){
818e.setDate(a.getDate()-i)
819}else{
820e.setDate(a.getDate()-(7+i))
821}
822return e
823};
824AjxDateUtil._getDateForPrevWorkWeekday=function(a){
825var e=new Date(a);
826var t=a.getDay();
827if(t==AjxDateUtil.SUNDAY){
828e.setDate(a.getDate()-2)
829}else{
830if(t==AjxDateUtil.SATURDAY){
831e.setDate(a.getDate()-1)
832}}
833return e
834};
835AjxDateUtil.calculate=function(f,n){
836if(!AjxDateUtil.__calculate_initialized){
837AjxDateUtil.__calculate_initialized=true;
838AjxDateUtil.__calculate_init()
839}
840var e=n||new Date;
841f=f.replace(/^\s*|\s*$/,"").replace(/\s*=\s*/g,"=").replace(/\s*,\s*/g,",");
842var p=f.split(/\s+/g);
843var y,h,o,l,u,d,g,t;
844for(var c=0;
845c<p.length;
846c++){
847y=p[c];
848if(y.match(AjxDateUtil.RE_COMMENT)){
849break
850}
851if(y.match(AjxDateUtil.RE_NOW)){
852n=new Date(e.getTime());
853continue
854}
855if(h=y.match(AjxDateUtil.RE_ADD_NUMBER)){
856o=h[1];
857l=AjxDateUtil.__calculate_parseInt(h[2]);
858u=p[++c];
859d=o=="+"?l:l*-1;
860AjxDateUtil.__calculate_add(n,u,d);
861continue
862}
863if(h=y.match(AjxDateUtil.RE_SET)){
864AjxDateUtil.__calculate_set(n,h[1],h[2]);
865continue
866}
867n=AjxDateFormat.parse("yyyyy-MM-dd",y);
868if(!n&&(n=AjxDateFormat.parse("yyyy-MM-dd'T'hh:mm:ss'Z'",y))){
869n.setMinutes(n.getMinutes()-n.getTimezoneOffset())
870}
871if(!n){
872n=AjxDateFormat.parse("yyyy-MM-dd'T'HH:mm:ss",y)
873}
874if(!n){
875throw'invalid date pattern: "'+y+'"'
876}}
877return n
878};
879AjxDateUtil.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("|");
880AjxDateUtil.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("|");
881AjxDateUtil.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("|");
882AjxDateUtil.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")];
883AjxMsg["calc.now"]="now";
884AjxMsg["calc.date"]="date";
885AjxMsg["calc.duration.year"]="year|years";
886AjxMsg["calc.duration.month"]="mon|mons|month|months";
887AjxMsg["calc.duration.day"]="day|days";
888AjxMsg["calc.duration.hour"]="hour|hours";
889AjxMsg["calc.duration.minute"]="min|mins|minute|minutes";
890AjxMsg["calc.duration.week"]="week";
891AjxMsg["calc.duration.second"]="sec|secs|second|seconds";
892AjxMsg["calc.duration.millisecond"]="milli|millis|millisecond|milliseconds";
893AjxDateUtil.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("|");
894AjxDateUtil.__calculate_init=function(){
895AjxDateUtil.WEEKDAYS={};
896var t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];
897for(var o=0;
898o<t.length;
899o++){
900var n=AjxMsg["calc.dayname."+t[o]].split("|");
901for(var a=0;
902a<n.length;
903a++){
904AjxDateUtil.WEEKDAYS[n[a].toLowerCase()]=o
905}}
906AjxDateUtil.MONTHNAME2MONTHNUM={};
907var e=["january","february","march","april","may","june","july","august","september","october","november","december"];
908for(var o=0;
909o<e.length;
910o++){
911var s=AjxMsg["calc.monthname."+e[o]].split("|");
912for(var a=0;
913a<s.length;
914a++){
915AjxDateUtil.MONTHNAME2MONTHNUM[s[a].toLowerCase()]=o
916}}
917AjxDateUtil.RE_YEAR=new RegExp("^("+AjxMsg["calc.duration.year"]+")$","i");
918AjxDateUtil.RE_MONTH=new RegExp("^("+AjxMsg["calc.duration.month"]+")$","i");
919AjxDateUtil.RE_WEEK=new RegExp("^("+AjxMsg["calc.duration.week"]+")$","i");
920AjxDateUtil.RE_DAY=new RegExp("^("+AjxMsg["calc.duration.day"]+")$","i");
921AjxDateUtil.RE_HOUR=new RegExp("^("+AjxMsg["calc.duration.hour"]+")$","i");
922AjxDateUtil.RE_MINUTE=new RegExp("^("+AjxMsg["calc.duration.minute"]+")$","i");
923AjxDateUtil.RE_SECOND=new RegExp("^("+AjxMsg["calc.duration.second"]+")$","i");
924AjxDateUtil.RE_MILLISECOND=new RegExp("^("+AjxMsg["calc.duration.millisecond"]+")$","i");
925AjxDateUtil.RE_DATE=new RegExp("^("+AjxMsg["calc.date"]+")$","i");
926AjxDateUtil.RE_DAYNAME=new RegExp("^("+AjxDateUtil.S_DAYNAME+")$","i");
927AjxDateUtil.RE_MONTHNAME=new RegExp("^("+AjxDateUtil.S_MONTHNAME+")$","i");
928AjxDateUtil.RE_WEEKORD=new RegExp("^("+AjxDateUtil.S_WEEKORD+")$","i");
929AjxDateUtil.RE_COMMENT=/^#/;
930AjxDateUtil.RE_NOW=new RegExp("^("+AjxMsg["calc.now"]+")$","i");
931AjxDateUtil.RE_ADD_NUMBER=new RegExp("^([+\\-])(\\d+)$","i");
932AjxDateUtil.RE_SET=new RegExp("^("+AjxDateUtil.S_DURATION+"|"+AjxMsg["calc.date"]+")=(.*)$","i")
933};
934AjxDateUtil.__calculate_normalizeFullWidthDigit=function(t){
935var e="0".charCodeAt(0)+t.charCodeAt(0)-"\uff10".charCodeAt(0);
936return String.fromCharCode(e)
937};
938AjxDateUtil.__calculate_replaceFullWidthDigit=function(e,t){
939return AjxDateUtil.__calculate_normalizeFullWidthDigit(t)
940};
941AjxDateUtil.__calculate_parseInt=function(e){
942e=e.replace(/([\uFF10-\uFF19])/g,AjxDateUtil.__calculate_normalizeFullWidthDigit);
943return parseInt(e,10)
944};
945AjxDateUtil.__calculate_add=function(a,o,i){
946if(o.match(AjxDateUtil.RE_YEAR)){
947a.setFullYear(a.getFullYear()+i);
948return
949}
950if(o.match(AjxDateUtil.RE_MONTH)){
951var n=a.getMonth();
952a.setMonth(n+i);
953if(Math.abs(n+i)%12!=a.getMonth()){
954a.setDate(0)
955}
956return
957}
958if(o.match(AjxDateUtil.RE_WEEK)){
959a.setDate(a.getDate()+i*7);
960return
961}
962if(o.match(AjxDateUtil.RE_DAY)){
963a.setDate(a.getDate()+i);
964return
965}
966if(o.match(AjxDateUtil.RE_HOUR)){
967a.setHours(a.getHours()+i);
968return
969}
970if(o.match(AjxDateUtil.RE_MINUTE)){
971a.setMinutes(a.getMinutes()+i);
972return
973}
974if(o.match(AjxDateUtil.RE_SECOND)){
975a.setSeconds(a.getSeconds()+i);
976return
977}
978if(o.match(AjxDateUtil.RE_MILLISECOND)){
979a.setMilliseconds(a.getMilliseconds()+i);
980return
981}
982if(o.match(AjxDateUtil.RE_MONTHNAME)){
983var e=AjxDateUtil.MONTHNAME2MONTHNUM[o.toLowerCase()];
984if(e<a.getMonth()){
985i+=i>0?0:1
986}else{
987if(e>a.getMonth()){
988i+=i>0?-1:0
989}}
990a.setFullYear(a.getFullYear()+i,e,1);
991return
992}
993if(o.match(AjxDateUtil.RE_DAYNAME)){
994var t=AjxDateUtil.WEEKDAYS[o.toLowerCase()];
995if(t<a.getDay()){
996i+=i>0?0:1
997}else{
998if(t>a.getDay()){
999i+=i>0?-1:0
1000}}
1001a.setDate(a.getDate()+(t-a.getDay())+7*i);
1002return
1003}
1004throw"unknown type: "+o
1005};
1006AjxDateUtil.__calculate_add_ordinal=function(){
1007throw"TODO: not implemented"
1008};
1009AjxDateUtil.__calculate_set=function(i,h,c){
1010var n=c.split(/,/);
1011if(h.match(AjxDateUtil.RE_YEAR)){
1012n[0]=AjxDateUtil.__calculate_fullYear(n[0]);
1013if(n[1]!=null){
1014n[1]=AjxDateUtil.__calculate_month(n[1])
1015}
1016if(n[2]!=null){
1017n[2]=parseInt(n[2],10)
1018}
1019i.setFullYear.apply(i,n);
1020return
1021}
1022if(h.match(AjxDateUtil.RE_MONTH)){
1023n[0]=AjxDateUtil.__calculate_month(n[0]);
1024if(n[1]!=null){
1025n[1]=parseInt(n[1],10)
1026}
1027i.setMonth.apply(i,n);
1028return
1029}
1030if(h.match(AjxDateUtil.RE_WEEK)){
1031var t=AjxDateUtil.__calculate_week(n[0]);
1032var l=n[1]?AjxDateUtil.__calculate_day(n[1]):i.getDay();
1033var o;
1034if(t!=-1){
1035var e=new Date(i.getFullYear(),i.getMonth(),1,12,0,0,0);
1036var a=e.getDay();
1037var d=a-l;
1038o=new Date(e.getTime());
1039o.setDate(1-d);
1040if(d>0){
1041o.setDate(o.getDate()+7)
1042}
1043o.setDate(o.getDate()+7*t)
1044}else{
1045var s=new Date(i.getFullYear(),i.getMonth()+1,0,12,0,0,0);
1046o=new Date(s.getTime());
1047o.setDate(o.getDate()-(o.getDay()-l));
1048if(o.getMonth()!=s.getMonth()){
1049o.setDate(o.getDate()-7)
1050}}
1051if(o&&(i.getMonth()==o.getMonth())){
1052i.setTime(o.getTime())
1053}
1054return
1055}
1056if(h.match(AjxDateUtil.RE_DATE)){
1057n[0]=parseInt(n[0],10);
1058i.setDate.apply(i,n);
1059return
1060}
1061if(h.match(AjxDateUtil.RE_HOUR)){
1062n[0]=parseInt(n[0],10);
1063if(n[1]!=null){
1064n[1]=parseInt(n[1],10)
1065}
1066if(n[2]!=null){
1067n[2]=parseInt(n[2],10)
1068}
1069if(n[3]!=null){
1070n[3]=parseInt(n[3],10)
1071}
1072i.setHours.apply(i,n);
1073return
1074}
1075if(h.match(AjxDateUtil.RE_MINUTE)){
1076n[0]=parseInt(n[0],10);
1077if(n[1]!=null){
1078n[1]=parseInt(n[1],10)
1079}
1080if(n[2]!=null){
1081n[2]=parseInt(n[2],10)
1082}
1083i.setMinutes.apply(i,n);
1084return
1085}
1086if(h.match(AjxDateUtil.RE_SECOND)){
1087n[0]=parseInt(n[0],10);
1088if(n[1]!=null){
1089n[1]=parseInt(n[1],10)
1090}
1091i.setSeconds.apply(i,n);
1092return
1093}
1094if(h.match(AjxDateUtil.RE_MILLISECOND)){
1095i.setMilliseconds.apply(i,n);
1096return
1097}
1098throw"unknown type: "+h
1099};
1100AjxDateUtil.__calculate_fullYear=function(e){
1101if(e.length==2){
1102var t=new Date;
1103t.setYear(parseInt(e,10));
1104e=String(t.getFullYear()).substr(0,2)+e
1105}
1106return parseInt(e,10)
1107};
1108AjxDateUtil.__calculate_month=function(t){
1109var e=AjxDateUtil.MONTHNAME2MONTHNUM[t.toLowerCase()];
1110return e!=null?e:parseInt(t,10)-1
1111};
1112AjxDateUtil.__calculate_week=function(t){
1113for(var e=0;
1114e<AjxDateUtil.WEEKORD_RE.length;
1115e++){
1116if(t.match(AjxDateUtil.WEEKORD_RE[e])){
1117if(e==AjxDateUtil.WEEKORD_RE.length-1){
1118return -1
1119}
1120return e
1121}}
1122return 0
1123};
1124AjxDateUtil.__calculate_day=function(t){
1125var e=AjxDateUtil.WEEKDAYS[t.toLowerCase()];
1126return e!=null?e:parseInt(t,10)
1127}
1128}
1129if(AjxPackage.define("ajax.util.AjxSelectionManager")){
1130AjxSelectionManager=function(e){
1131this._owner=e
1132};
1133AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS=0;
1134AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS=1;
1135AjxSelectionManager.SELECT_TO_ANCHOR=2;
1136AjxSelectionManager.DESELECT_ALL=3;
1137AjxSelectionManager.SELECT_ALL=4;
1138AjxSelectionManager.prototype.getItems=function(){
1139if(this._selectedItems==null){
1140this._selectedItems=this._createItemsCollection()
1141}
1142return this._selectedItems
1143};
1144AjxSelectionManager.prototype.getLength=function(){
1145return this.getItems().length
1146};
1147AjxSelectionManager.prototype.getAnchor=function(){
1148if(this._anchor==null){
1149var e=this.getItems();
1150if(e.length>0){
1151this._anchor=e[0]
1152}}
1153return this._anchor
1154};
1155AjxSelectionManager.prototype.getCursor=function(){
1156if(this._cursor==null){
1157this._cursor=this.getAnchor()
1158}
1159return this._cursor
1160};
1161AjxSelectionManager.prototype.isSelected=function(e){
1162return this.getItems().binarySearch(e)!=-1
1163};
1164AjxSelectionManager.prototype.selectOneItem=function(e){
1165this.select(e,AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS)
1166};
1167AjxSelectionManager.prototype.toggleItem=function(e){
1168this.select(e,AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS)
1169};
1170AjxSelectionManager.prototype.selectFromAnchorToItem=function(e){
1171this.select(e,AjxSelectionManager.SELECT_TO_ANCHOR)
1172};
1173AjxSelectionManager.prototype.deselectAll=function(){
1174this.select(null,AjxSelectionManager.DESELECT_ALL)
1175};
1176AjxSelectionManager.prototype.selectAll=function(){
1177this.select(null,AjxSelectionManager.SELECT_ALL)
1178};
1179AjxSelectionManager.prototype.select=function(p,s){
1180this._setAnchorAndCursor(p,s);
1181var f=this._selectedItems;
1182var n=(f==null)?0:f.length;
1183this._selectedItems=null;
1184this._selectedItems=this._createItemsCollection();
1185var e=this._owner.getItemCount();
1186var m=false;
1187var o=false;
1188var d=false;
1189for(var l=0;
1190l<e;
1191++l){
1192var c=this._owner.getItem(l);
1193var u=this._isItemOldSelection(c,f);
1194var t=u;
1195switch(s){
1196case AjxSelectionManager.SELECT_TO_ANCHOR:if(this._anchor==null){
1197this._anchor=c
1198}
1199var a=(c==this._anchor||c==p);
1200var h=false;
1201if(!d&&a){
1202d=true;
1203h=true
1204}
1205t=d;
1206if((!h||this._anchor==p)&&d&&a){
1207d=false
1208}
1209break;
1210case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:t=(c==p);
1211break;
1212case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:if(c==p){
1213t=!u
1214}
1215break;
1216case AjxSelectionManager.DESELECT_ALL:t=false;
1217break;
1218case AjxSelectionManager.SELECT_ALL:t=true;
1219break
1220}
1221if(t){
1222this._selectedItems.add(c);
1223m=(this._selectedItems.length>1)
1224}
1225if(t!=u){
1226if(this._owner.itemSelectionChanged!=null){
1227this._owner.itemSelectionChanged(c,l,t)
1228}
1229o=true
1230}}
1231o=o||(n!=this._selectedItems.length);
1232if(m){
1233this._selectedItems.sort()
1234}
1235if(o&&this._owner.selectionChanged!=null){
1236this._owner.selectionChanged(p)
1237}};
1238AjxSelectionManager.prototype.removeItem=function(t){
1239if(this._selectedItems){
1240var e=this._selectedItems.binarySearch(t);
1241if(e>-1){
1242this._selectedItems.removeAt(e)
1243}}};
1244AjxSelectionManager.prototype._createItemsCollection=function(){
1245return new AjxVector()
1246};
1247AjxSelectionManager.prototype._isItemOldSelection=function(t,i){
1248var e=false;
1249if(i){
1250var a=i.binarySearch(t);
1251if(a>-1){
1252i.removeAt(a)
1253}
1254e=(a!=-1)
1255}
1256return e
1257};
1258AjxSelectionManager.prototype._setAnchorAndCursor=function(e,t){
1259switch(t){
1260case AjxSelectionManager.SELECT_TO_ANCHOR:this._cursor=e;
1261break;
1262case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:this._anchor=e;
1263this._cursor=e;
1264break;
1265case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:this._anchor=e;
1266this._cursor=e;
1267break;
1268case AjxSelectionManager.DESELECT_ALL:this._anchor=null;
1269this._cursor=null;
1270break;
1271case AjxSelectionManager.SELECT_ALL:return
1272}}
1273}
1274if(AjxPackage.define("ajax.net.AjxPost")){
1275AjxPost=function(e){
1276this._callback=null;
1277this._iframeId=e
1278};
1279AjxPost._reqIds=0;
1280AjxPost._outStandingRequests=new Object();
1281AjxPost.SC_CONTINUE=100;
1282AjxPost.SC_OK=200;
1283AjxPost.SC_ACCEPTED=202;
1284AjxPost.SC_NO_CONTENT=204;
1285AjxPost.SC_BAD_REQUEST=400;
1286AjxPost.SC_UNAUTHORIZED=401;
1287AjxPost.SC_REQUEST_TIMEOUT=408;
1288AjxPost.SC_CONFLICT=409;
1289AjxPost.SC_REQUEST_ENTITY_TOO_LARGE=413;
1290AjxPost.SC_INTERNAL_SERVER_ERROR=500;
1291AjxPost.SC_BAD_GATEWAY=502;
1292AjxPost.SC_SERVICE_UNAVAILABLE=503;
1293AjxPost.prototype.execute=function(d,e,c){
1294var u=e.getElementsByTagName("input");
1295var n=new Array();
1296for(var a=0;
1297a<u.length;
1298a++){
1299var m=u[a];
1300if(m.type=="file"){
1301n.push(m);
1302continue
1303}
1304if(m.name&&m.name.match(/^filename\d+$/)){
1305m.parentNode.removeChild(m);
1306a--;
1307continue
1308}}
1309for(var a=0;
1310a<n.length;
1311a++){
1312var o=document.createElement("input");
1313o.type="hidden";
1314o.name="filename"+(a+1);
1315o.value=n[a].value;
1316n[a].parentNode.insertBefore(o,n[a])
1317}
1318e.target=this._iframeId;
1319this._callback=d;
1320var l=new AjxPostRequest(e);
1321var t=new AjxTimedAction(this,this._onFailure,[l.id]);
1322var h=c?c:5000;
1323AjxPost._outStandingRequests[l.id]=l;
1324try{
1325l.send(t,h)
1326}
1327catch(s){
1328if(AjxEnv.isIE){
1329if(s.number==-2147024891){
1330throw new AjxException(ZmMsg.uploadErrorAccessDenied,s.number)
1331}}
1332throw s
1333}};
1334AjxPost.prototype._onFailure=function(t){
1335var e=AjxPost._outStandingRequests[t];
1336e.cancel();
1337delete AjxPost._outStandingRequests[t];
1338if(this._callback){
1339this._callback.run([404]);
1340this._callback=null
1341}};
1342AjxPost.prototype.loaded=function(e,a,i){
1343var t=AjxPost._outStandingRequests[a];
1344if(t&&!t.hasBeenCancelled()){
1345t.cancelTimeout()
1346}
1347delete AjxPost._outStandingRequests[a];
1348if(this._callback){
1349this._callback.run(e,i);
1350this._callback=null
1351}};
1352AjxPostRequest=function(t){
1353this.id=AjxPost._reqIds++;
1354this._cancelled=false;
1355this._form=t;
1356var e=t.elements.namedItem("requestId");
1357if(!e){
1358e=t.ownerDocument.createElement("input");
1359e.type="hidden";
1360e.name="requestId"
1361}
1362e.value=this.id;
1363t.appendChild(e)
1364};
1365AjxPostRequest.prototype.send=function(t,e){
1366this._form.submit()
1367};
1368AjxPostRequest.prototype.hasBeenCancelled=function(){
1369return this._cancelled
1370};
1371AjxPostRequest.prototype.cancelTimeout=function(){
1372AjxTimedAction.cancelAction(this._timeoutId)
1373};
1374AjxPostRequest.prototype.cancel=function(){
1375this._cancelled=true
1376}
1377}
1378if(AjxPackage.define("ajax.util.AjxBuffer")){
1379AjxBuffer=function(){
1380this.clear();
1381if(arguments.length>0){
1382arguments.join=this.buffer.join;
1383this.buffer[this.buffer.length]=arguments.join("")
1384}};
1385AjxBuffer.prototype.toString=function(){
1386return this.buffer.join("")
1387};
1388AjxBuffer.prototype.join=function(e){
1389if(e==null){
1390e=""
1391}
1392return this.buffer.join(e)
1393};
1394AjxBuffer.prototype.append=function(){
1395arguments.join=this.buffer.join;
1396this.buffer[this.buffer.length]=arguments.join("")
1397};
1398AjxBuffer.prototype.join=function(e){
1399return this.buffer.join(e)
1400};
1401AjxBuffer.prototype.set=function(e){
1402this.buffer=[e]
1403};
1404AjxBuffer.prototype.clear=function(){
1405this.buffer=[]
1406};
1407AjxBuffer.concat=function(){
1408arguments.join=Array.prototype.join;
1409return arguments.join("")
1410};
1411AjxBuffer.append=AjxBuffer.concat
1412}
1413if(AjxPackage.define("ajax.xslt.AjxXslt")){
1414AjxXslt=function(){
1415var o=AjxXmlDoc.create();
1416if(AjxEnv.isIE){
1417var n=null;
1418var e=["MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.3.0"];
1419for(var a=0;
1420a<e.length;
1421a++){
1422try{
1423n=new ActiveXObject(e[a]);
1424break
1425}
1426catch(t){}}
1427if(!n){
1428throw new AjxException("FreeThreadedDOMDocument",AjxException.UNSUPPORTED,"AjxXslt")
1429}
1430n.async=false;
1431o._doc=n
1432}
1433this._doc=o
1434};
1435AjxXslt.prototype.toString=function(){
1436return"AjxXslt"
1437};
1438AjxXslt.createFromUrl=function(e){
1439var t=new AjxXslt();
1440t.loadUrl(e);
1441return t
1442};
1443AjxXslt.createFromString=function(t){
1444var e=new AjxXslt();
1445e._doc.loadFromString(t);
1446e.createProcessor();
1447return e
1448};
1449AjxXslt.prototype.createProcessor=function(){
1450var s=this._doc.getDoc();
1451if(AjxEnv.isNav){
1452this._processor=new XSLTProcessor();
1453this._processor.importStylesheet(s)
1454}else{
1455if(AjxEnv.isIE){
1456var n=s.parseError;
1457if(n.errorCode!=0){
1458throw new AjxException(n.reason,AjxException.INVALID_PARAM,"AjxXslt.createProcessor")
1459}
1460var e=null;
1461var t=["MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate.3.0"];
1462for(var o=0;
1463o<t.length;
1464o++){
1465try{
1466e=new ActiveXObject(t[o]);
1467break
1468}
1469catch(a){}}
1470if(!e){
1471throw new AjxException("XSLTemplate",AjxException.UNSUPPORTED,"AjxXslt.createProcessor")
1472}
1473this._processor=e;
1474this._processor.stylesheet=s
1475}}};
1476AjxXslt._finishedLoading=function(){
1477var e=this._xslt;
1478e.createProcessor()
1479};
1480AjxXslt.prototype.loadUrl=function(e){
1481var a=this._doc;
1482if(AjxEnv.isNav){
1483var t=a.getDoc();
1484t._xslt=this;
1485t.addEventListener("load",AjxXslt._finishedLoading,false)
1486}
1487a.loadFromUrl(e);
1488if(AjxEnv.isIE){
1489this.createProcessor()
1490}};
1491AjxXslt.prototype.transformToDom=function(a){
1492var e;
1493if(AjxEnv.isIE){
1494e=this.transformIE(a)
1495}else{
1496if(AjxEnv.isNav){
1497return this.transformNav(a)
1498}else{
1499return a
1500}}
1501var t=AjxXmlDoc.createFromXml(e);
1502return t.getDoc()
1503};
1504AjxXslt.prototype.transformToString=function(a){
1505var e;
1506if(AjxEnv.isIE){
1507return this.transformIE(a)
1508}else{
1509if(AjxEnv.isNav){
1510e=this.transformNav(a)
1511}else{
1512return a.documentElement.innerHTML
1513}}
1514if(!e||!e.documentElement){
1515throw new AjxException("XSL transformation failed.",AjxException.INVALID_PARAM,"AjxXslt.transformToString")
1516}
1517var t=e.documentElement;
1518if((t instanceof HTMLElement)||(t instanceof HTMLHtmlElement)){
1519return t.innerHTML
1520}else{
1521if(t instanceof Element){
1522return AjxXmlDoc.replaceInvalidChars(t.xml)
1523}}
1524return a.documentElement.innerHTML
1525};
1526AjxXslt.prototype.transformIE=function(t){
1527try{
1528var a=this._processor.createProcessor();
1529a.input=t;
1530a.transform();
1531return a.output
1532}
1533catch(e){
1534throw new AjxException(e.description,AjxException.INVALID_PARAM,"AjxXslt.transformIE")
1535}};
1536AjxXslt.prototype.transformNav=function(e){
1537return this._processor.transformToDocument(e)
1538};
1539AjxXslt.prototype.transformNav2=function(e){
1540this._fragment=document.implementation.createDocument("","",null);
1541return this._processor.transformToFragment(e,this._fragment)
1542}
1543}
1544if(AjxPackage.define("ajax.util.AjxSHA1")){
1545var AjxSHA1=function(){
1546var p=0;
1547var v="";
1548var a=8;
1549function c(k){
1550return l(o(w(k),k.length*a))
1551}
1552function h(k){
1553return m(o(w(k),k.length*a))
1554}
1555function i(k){
1556return y(o(w(k),k.length*a))
1557}
1558function t(k,x){
1559return l(n(k,x))
1560}
1561function s(k,x){
1562return m(n(k,x))
1563}
1564function u(k,x){
1565return y(n(k,x))
1566}
1567function e(){
1568return c("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"
1569}
1570function o(R,B){
1571R[B>>5]|=128<<(24-B%32);
1572R[((B+64>>9)<<4)+15]=B;
1573var H=Array(80);
1574var M=1732584193;
1575var F=-271733879;
1576var S=-1732584194;
1577var D=271733878;
1578var C=-1009589776;
1579for(var O=0;
1580O<R.length;
1581O+=16){
1582var W=M;
1583var A=F;
1584var T=S;
1585var z=D;
1586var k=C;
1587for(var q=0;
1588q<80;
1589q++){
1590if(q<16){
1591H[q]=R[O+q]
1592}else{
1593H[q]=f(H[q-3]^H[q-8]^H[q-14]^H[q-16],1)
1594}
1595var I=g(g(f(M,5),b(q,F,S,D)),g(g(C,H[q]),d(q)));
1596C=D;
1597D=S;
1598S=f(F,30);
1599F=M;
1600M=I
1601}
1602M=g(M,W);
1603F=g(F,A);
1604S=g(S,T);
1605D=g(D,z);
1606C=g(C,k)
1607}
1608return Array(M,F,S,D,C)
1609}
1610function b(x,k,j,q){
1611if(x<20){
1612return(k&j)|((~k)&q)
1613}
1614if(x<40){
1615return k^j^q
1616}
1617if(x<60){
1618return(k&j)|(k&q)|(j&q)
1619}
1620return k^j^q
1621}
1622function d(k){
1623return(k<20)?1518500249:(k<40)?1859775393:(k<60)?-1894007588:-899497514
1624}
1625function n(q,T){
1626var z=w(q);
1627if(z.length>16){
1628z=o(z,q.length*a)
1629}
1630var k=Array(16),j=Array(16);
1631for(var x=0;
1632x<16;
1633x++){
1634k[x]=z[x]^909522486;
1635j[x]=z[x]^1549556828
1636}
1637var O=o(k.concat(w(T)),512+T.length*a);
1638return o(j.concat(O),512+160)
1639}
1640function g(k,z){
1641var j=(k&65535)+(z&65535);
1642var q=(k>>16)+(z>>16)+(j>>16);
1643return(q<<16)|(j&65535)
1644}
1645function f(k,x){
1646return(k<<x)|(k>>>(32-x))
1647}
1648function w(j){
1649var q=Array();
1650var k=(1<<a)-1;
1651for(var x=0;
1652x<j.length*a;
1653x+=a){
1654q[x>>5]|=(j.charCodeAt(x/a)&k)<<(32-a-x%32)
1655}
1656return q
1657}
1658function y(q){
1659var j="";
1660var k=(1<<a)-1;
1661for(var x=0;
1662x<q.length*32;
1663x+=a){
1664j+=String.fromCharCode((q[x>>5]>>>(32-a-x%32))&k)
1665}
1666return j
1667}
1668function l(q){
1669var x=p?"0123456789ABCDEF":"0123456789abcdef";
1670var j="";
1671for(var k=0;
1672k<q.length*4;
1673k++){
1674j+=x.charAt((q[k>>2]>>((3-k%4)*8+4))&15)+x.charAt((q[k>>2]>>((3-k%4)*8))&15)
1675}
1676return j
1677}
1678function m(z){
1679var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1680var O="";
1681for(var x=0;
1682x<z.length*4;
1683x+=3){
1684var 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);
1685for(var k=0;
1686k<4;
1687k++){
1688if(x*8+k*6>z.length*32){
1689O+=v
1690}else{
1691O+=q.charAt((T>>6*(3-k))&63)
1692}}}
1693return O
1694}
1695this.hex_sha1=c;
1696this.b64_sha1=h;
1697this.str_sha1=i;
1698this.hex_hmac_sha1=t;
1699this.b64_hmac_sha1=s;
1700this.str_hmac_sha1=u;
1701this.sha1_vm_test=e
1702};
1703AjxSHA1=new AjxSHA1()
1704}
1705if(AjxPackage.define("ajax.dwt.core.DwtDraggable")){
1706DwtDraggable=function(){};
1707DwtDraggable.dragEl=null;
1708DwtDraggable.init=function(i,m,n,t,o,e,h,d,u,l,s,c,a){
1709i.onmousedown=DwtDraggable.__start;
1710i.__hMode=l?false:true;
1711i.__vMode=s?false:true;
1712i.__root=(m&&m!=null)?m:i;
1713if(i.__hMode&&isNaN(parseInt(i.__root.style.left))){
1714i.__root.style.left="0px"
1715}
1716if(i.__vMode&&isNaN(parseInt(i.__root.style.top))){
1717i.__root.style.top="0px"
1718}
1719if(!i.__hMode&&isNaN(parseInt(i.__root.style.right))){
1720i.__root.style.right="0px"
1721}
1722if(!i.__vMode&&isNaN(parseInt(i.__root.style.bottom))){
1723i.__root.style.bottom="0px"
1724}
1725i.__minX=(typeof n!="undefined")?n:null;
1726i.__minY=(typeof o!="undefined")?o:null;
1727i.__maxX=(typeof t!="undefined")?t:null;
1728i.__maxY=(typeof e!="undefined")?e:null;
1729i.__xMapper=c?c:null;
1730i.__yMapper=a?a:null;
1731i.__root.onDragStart=h;
1732i.__root.onDragEnd=u;
1733i.__root.onDrag=d
1734};
1735DwtDraggable.setDragBoundaries=function(t,e,i,o,a){
1736if(t!=null){
1737if(e!=null){
1738t.__minX=e
1739}
1740if(i!=null){
1741t.__maxX=i
1742}
1743if(o!=null){
1744t.__minY=o
1745}
1746if(a!=null){
1747t.__maxY=a
1748}}};
1749DwtDraggable.__start=function(i){
1750var a=DwtDraggable.dragEl=this;
1751i=DwtDraggable.__fixE(i);
1752var t=parseInt(a.__hMode?a.__root.style.left:a.__root.style.right);
1753var o=parseInt(a.__vMode?a.__root.style.top:a.__root.style.bottom);
1754if(a.__root.onDragStart){
1755a.__root.onDragStart.run([t,o])
1756}
1757a.__lastMouseX=i.clientX;
1758a.__lastMouseY=i.clientY;
1759if(a.__hMode){
1760if(a.__minX!=null){
1761a.__minMouseX=i.clientX-t+a.__minX
1762}
1763if(a.__maxX!=null){
1764a.__maxMouseX=a.__minMouseX+a.__maxX-a.__minX
1765}}else{
1766if(a.__minX!=null){
1767a.__maxMouseX=-a.__minX+i.clientX+t
1768}
1769if(a.__maxX!=null){
1770a.__minMouseX=-a.__maxX+i.clientX+t
1771}}
1772if(a.__vMode){
1773if(a.__minY!=null){
1774a.__minMouseY=i.clientY-o+a.__minY
1775}
1776if(a.__maxY!=null){
1777a.__maxMouseY=a.__minMouseY+a.__maxY-a.__minY
1778}}else{
1779if(a.__minY!=null){
1780a.__maxMouseY=-a.__minY+i.clientY+o
1781}
1782if(a.__maxY!=null){
1783a.__minMouseY=-a.__maxY+i.clientY+o
1784}}
1785document.onmousemove=DwtDraggable.__drag;
1786document.onmouseup=DwtDraggable.__end;
1787return false
1788};
1789DwtDraggable.__drag=function(s){
1790s=DwtDraggable.__fixE(s);
1791var i=DwtDraggable.dragEl;
1792var o=s.clientY;
1793var n=s.clientX;
1794var a=parseInt(i.__hMode?i.__root.style.left:i.__root.style.right);
1795var l=parseInt(i.__vMode?i.__root.style.top:i.__root.style.bottom);
1796var t,h;
1797if(!i.__xMapper){
1798if(i.__minX!=null){
1799n=i.__hMode?Math.max(n,i.__minMouseX):Math.min(n,i.__maxMouseX)
1800}
1801if(i.__maxX!=null){
1802n=i.__hMode?Math.min(n,i.__maxMouseX):Math.max(n,i.__minMouseX)
1803}
1804t=a+((n-i.__lastMouseX)*(i.__hMode?1:-1))
1805}else{
1806t=i.__xMapper(a,n)
1807}
1808if(!i.__yMapper){
1809if(i.__minY!=null){
1810o=i.__vMode?Math.max(o,i.__minMouseY):Math.min(o,i.__maxMouseY)
1811}
1812if(i.__maxY!=null){
1813o=i.__vMode?Math.min(o,i.__maxMouseY):Math.max(o,i.__minMouseY)
1814}
1815h=l+((o-i.__lastMouseY)*(i.__vMode?1:-1))
1816}else{
1817h=i.__yMapper(l,o)
1818}
1819DwtDraggable.dragEl.__root.style[i.__hMode?"left":"right"]=t+"px";
1820DwtDraggable.dragEl.__root.style[i.__vMode?"top":"bottom"]=h+"px";
1821DwtDraggable.dragEl.__lastMouseX=n;
1822DwtDraggable.dragEl.__lastMouseY=o;
1823if(DwtDraggable.dragEl.__root.onDrag){
1824DwtDraggable.dragEl.__root.onDrag.run([t,h])
1825}
1826return false
1827};
1828DwtDraggable.__end=function(){
1829document.onmousemove=null;
1830document.onmouseup=null;
1831if(DwtDraggable.dragEl.__root.onDragEnd){
1832DwtDraggable.dragEl.__root.onDragEnd.run([parseInt(DwtDraggable.dragEl.__root.style[DwtDraggable.dragEl.__hMode?"left":"right"]),parseInt(DwtDraggable.dragEl.__root.style[DwtDraggable.dragEl.__vMode?"top":"bottom"])])
1833}
1834DwtDraggable.dragEl=null
1835};
1836DwtDraggable.__fixE=function(t){
1837if(typeof t=="undefined"){
1838t=window.event
1839}
1840if(typeof t.layerX=="undefined"){
1841t.layerX=t.offsetX
1842}
1843if(typeof t.layerY=="undefined"){
1844t.layerY=t.offsetY
1845}
1846return t
1847}
1848}
1849if(AjxPackage.define("ajax.dwt.core.DwtDragTracker")){
1850DwtDragTracker=function(){};
1851DwtDragTracker.init=function(o,t,s,n,l,e,a){
1852var h=o._dragTrackerContext={};
1853var i=o.getHtmlElement();
1854if(t){
1855i.style.cursor=t
1856}
1857h.style=t;
1858h.threshX=(s>0)?s:1;
1859h.threshY=(n>0)?n:1;
1860h.data={
1861delta:{}
1862,userData:a};
1863h.captureObj=new DwtMouseEventCapture({
1864targetObj:o,mouseOverHdlr:DwtDragTracker._mouseOverHdlr,mouseDownHdlr:DwtDragTracker._mouseDownHdlr,mouseMoveHdlr:DwtDragTracker._mouseMoveHdlr,mouseUpHdlr:DwtDragTracker._mouseUpHdlr,mouseOutHdlr:DwtDragTracker._mouseOutHdlr}
1865);
1866o.setHandler(DwtEvent.ONMOUSEDOWN,DwtDragTracker._mouseDownHdlr);
1867o.setHandler(DwtEvent.ONMOUSEOVER,DwtDragTracker._mouseOverHdlr);
1868o.setHandler(DwtEvent.ONMOUSEOUT,DwtDragTracker._mouseOutHdlr);
1869h.callbackFunc=l;
1870h.callbackObj=e
1871};
1872DwtDragTracker.STYLE_NONE="auto";
1873DwtDragTracker.STYLE_MOVE="move";
1874DwtDragTracker.STYLE_RESIZE_NORTHWEST="nw-resize";
1875DwtDragTracker.STYLE_RESIZE_NORTH="n-resize";
1876DwtDragTracker.STYLE_RESIZE_NORTHEAST="ne-resize";
1877DwtDragTracker.STYLE_RESIZE_WEST="w-resize";
1878DwtDragTracker.STYLE_RESIZE_EAST="e-resize";
1879DwtDragTracker.STYLE_RESIZE_SOUTHWEST="sw-resize";
1880DwtDragTracker.STYLE_RESIZE_SOUTH="s-resize";
1881DwtDragTracker.STYLE_RESIZE_SOUTHEAST="se-resize";
1882DwtDragTracker.STATE_START=1;
1883DwtDragTracker.STATE_DRAGGING=2;
1884DwtDragTracker.STATE_END=3;
1885DwtDragTracker._mouseOverHdlr=function(t){
1886var e=DwtShell.mouseEvent;
1887e.setFromDhtmlEvent(t);
1888e._stopPropagation=true;
1889e._returnValue=false;
1890e.setToDhtmlEvent(t);
1891return false
1892};
1893DwtDragTracker._mouseDownHdlr=function(a){
1894var t=DwtShell.mouseEvent;
1895t.setFromDhtmlEvent(a,true);
1896if(t.button!=DwtMouseEvent.LEFT){
1897DwtUiEvent.setBehaviour(a,true,false);
1898return false
1899}
1900var i=t.dwtObj;
1901if(i&&i._dragTrackerContext){
1902var e=i._dragTrackerContext;
1903if(e.callbackFunc!=null){
1904e.oldCapture=DwtMouseEventCapture.getCaptureObj();
1905if(e.oldCapture){
1906e.oldCapture.release()
1907}
1908e.captureObj.capture();
1909e.data.startDoc={
1910x:t.docX,y:t.docY};
1911e.data.state=DwtDragTracker.STATE_START;
1912DwtDragTracker._doCallback(e,t)
1913}}
1914t._stopPropagation=true;
1915t._returnValue=false;
1916t.setToDhtmlEvent(a);
1917return false
1918};
1919DwtDragTracker._doCallback=function(e,t){
1920e.data.mouseEv=t;
1921if(e.callbackObj!=null){
1922e.callbackFunc.call(e.callbackObj,e.data)
1923}else{
1924e.callbackFunc(e.data)
1925}
1926e.data.mouseEv=null
1927};
1928DwtDragTracker._mouseMoveHdlr=function(a){
1929var t=DwtShell.mouseEvent;
1930t.setFromDhtmlEvent(a);
1931var o=DwtMouseEventCapture.getTargetObj();
1932var e=o._dragTrackerContext;
1933var i=e.data;
1934i.delta.x=t.docX-i.startDoc.x;
1935i.delta.y=t.docY-i.startDoc.y;
1936if(Math.abs(i.delta.x)>=e.threshX||Math.abs(i.delta.y)>=e.threshY){
1937i.prevState=i.state;
1938i.state=DwtDragTracker.STATE_DRAGGING;
1939DwtDragTracker._doCallback(e,t)
1940}
1941t._stopPropagation=true;
1942t._returnValue=false;
1943t.setToDhtmlEvent(a);
1944return false
1945};
1946DwtDragTracker._mouseUpHdlr=function(a){
1947var t=DwtShell.mouseEvent;
1948t.setFromDhtmlEvent(a);
1949if(t.button!=DwtMouseEvent.LEFT){
1950DwtUiEvent.setBehaviour(a,true,false);
1951return false
1952}
1953var e=DwtMouseEventCapture.getTargetObj()._dragTrackerContext;
1954if(e){
1955if(e.callbackFunc!=null){
1956DwtMouseEventCapture.getCaptureObj().release()
1957}
1958if(e.oldCapture){
1959e.oldCapture.capture();
1960e.oldCapture=null
1961}
1962e.data.state=DwtDragTracker.STATE_END;
1963DwtDragTracker._doCallback(e,t)
1964}
1965t._stopPropagation=true;
1966t._returnValue=false;
1967t.setToDhtmlEvent(a);
1968return false
1969};
1970DwtDragTracker._mouseOutHdlr=function(t){
1971var e=DwtShell.mouseEvent;
1972e.setFromDhtmlEvent(t);
1973e._stopPropagation=true;
1974e._returnValue=false;
1975e.setToDhtmlEvent(t);
1976return false
1977}
1978}
1979if(AjxPackage.define("ajax.dwt.events.DwtDateRangeEvent")){
1980DwtDateRangeEvent=function(e){
1981if(arguments.length==0){
1982return
1983}
1984DwtEvent.call(this,true);
1985this.reset()
1986};
1987DwtDateRangeEvent.prototype=new DwtEvent;
1988DwtDateRangeEvent.prototype.constructor=DwtDateRangeEvent;
1989DwtDateRangeEvent.prototype.toString=function(){
1990return"DwtDateRangeEvent"
1991};
1992DwtDateRangeEvent.prototype.reset=function(){
1993this.start=null;
1994this.end=null
1995}
1996}
1997if(AjxPackage.define("ajax.dwt.widgets.DwtColorPicker")){
1998DwtColorPicker=function(a,t,e,i,o){
1999if(arguments.length==0){
2000return
2001}
2002t=t||"DwtColorPicker";
2003DwtControl.call(this,{
2004parent:a,className:t,posStyle:e}
2005);
2006this._noFillLabel=i;
2007this._allowColorInput=o;
2008this._createColorTable();
2009this._registerEventHdlrs()
2010};
2011DwtColorPicker.prototype=new DwtControl;
2012DwtColorPicker.prototype.constructor=DwtColorPicker;
2013DwtColorPicker._RGB_RE=/rgb\(([0-9]{1,3}), ([0-9]{1,3}), ([0-9]{1,3})\)/;
2014DwtColorPicker._HEX_RE=/\#([0-9FCfc]{2})([0-9FCfc]{2})([0-9FCfc]{2})/;
2015DwtColorPicker._HEX_COMPLETE_RE=/\#([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})/;
2016DwtColorPicker.prototype.toString=function(){
2017return"DwtColorPicker"
2018};
2019DwtColorPicker.prototype.addSelectionListener=function(e){
2020this.addListener(DwtEvent.SELECTION,e)
2021};
2022DwtColorPicker.prototype.removeSelectionListener=function(e){
2023this.removeListener(DwtEvent.SELECTION,e)
2024};
2025DwtColorPicker.prototype.dispose=function(){
2026if(this._disposed){
2027return
2028}
2029DwtControl.prototype.dispose.call(this)
2030};
2031DwtColorPicker.prototype._registerEventHdlrs=function(){
2032var s=this.getHtmlElement().firstChild;
2033var h=s.rows;
2034var l=h.length;
2035for(var o=0;
2036o<l;
2037o++){
2038var a=h[o].cells;
2039var n=a.length;
2040for(var t=0;
2041t<n;
2042t++){
2043var e=a[t];
2044if(h[o].className=="ColorInput"){
2045if(e.className=="ColorInputField"){}else{
2046if(e.className=="SetInputColor"){
2047Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
2048Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr)
2049}}}else{
2050Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
2051Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr);
2052if(!AjxEnv.isIE){
2053Dwt.setHandler(e,DwtEvent.ONMOUSEOVER,DwtColorPicker._mouseOverHdlr);
2054Dwt.setHandler(e,DwtEvent.ONMOUSEOUT,DwtColorPicker._mouseOutHdlr)
2055}else{
2056Dwt.setHandler(e,DwtEvent.ONMOUSEENTER,DwtColorPicker._mouseOverHdlr);
2057Dwt.setHandler(e,DwtEvent.ONMOUSELEAVE,DwtColorPicker._mouseOutHdlr)
2058}
2059if(e.className!="NoFill"){
2060e.style.border="2px outset "+e.style.backgroundColor
2061}}}}};
2062DwtColorPicker.prototype._createColorTable=function(){
2063this._tdId=Dwt.getNextId();
2064var t=new Array(150);
2065var e=0;
2066t[e++]="<table cellpadding='0' cellspacing='0' border='0' align='center'>";
2067if(this._noFillLabel){
2068t[e++]="<tr><td colspan='10' class='NoFill'>"+this._noFillLabel+"</td></tr>"
2069}
2070t[e++]="<tr>";
2071t[e++]="<td id='"+this._tdId+"#FFFFFF' style='background-color:#FFFFFF' width='12' height='14'><img height='1' width='1'/></td>";
2072t[e++]="<td id='"+this._tdId+"#FFCCCC' style='background-color:#FFCCCC' width='12' height='14'><img height='1' width='1'/></td>";
2073t[e++]="<td id='"+this._tdId+"#FFCC99' style='background-color:#FFCC99' width='12' height='14'><img height='1' width='1'/></td>";
2074t[e++]="<td id='"+this._tdId+"#FFFF99' style='background-color:#FFFF99' width='12' height='14'><img height='1' width='1'/></td>";
2075t[e++]="<td id='"+this._tdId+"#FFFFCC' style='background-color:#FFFFCC' width='12' height='14'><img height='1' width='1'/></td>";
2076t[e++]="<td id='"+this._tdId+"#99FF99' style='background-color:#99FF99' width='12' height='14'><img height='1' width='1'/></td>";
2077t[e++]="<td id='"+this._tdId+"#99FFFF' style='background-color:#99FFFF' width='12' height='14'><img height='1' width='1'/></td>";
2078t[e++]="<td id='"+this._tdId+"#CCFFFF' style='background-color:#CCFFFF' width='12' height='14'><img height='1' width='1'/></td>";
2079t[e++]="<td id='"+this._tdId+"#CCCCFF' style='background-color:#CCCCFF' width='12' height='14'><img height='1' width='1'/></td>";
2080t[e++]="<td id='"+this._tdId+"#FFCCFF' style='background-color:#FFCCFF' width='12' height='14'><img height='1' width='1'/></td>";
2081t[e++]="</tr><tr>";
2082t[e++]="<td id='"+this._tdId+"#CCCCCC' style='background-color:#CCCCCC' width='12' height='14'><img height='1' width='1'/></td>";
2083t[e++]="<td id='"+this._tdId+"#FF6666' style='background-color:#FF6666' width='12' height='14'><img height='1' width='1'/></td>";
2084t[e++]="<td id='"+this._tdId+"#FF9966' style='background-color:#FF9966' width='12' height='14'><img height='1' width='1'/></td>";
2085t[e++]="<td id='"+this._tdId+"#FFFF66' style='background-color:#FFFF66' width='12' height='14'><img height='1' width='1'/></td>";
2086t[e++]="<td id='"+this._tdId+"#FFFF33' style='background-color:#FFFF33' width='12' height='14'><img height='1' width='1'/></td>";
2087t[e++]="<td id='"+this._tdId+"#66FF99' style='background-color:#66FF99' width='12' height='14'><img height='1' width='1'/></td>";
2088t[e++]="<td id='"+this._tdId+"#33FFFF' style='background-color:#33FFFF' width='12' height='14'><img height='1' width='1'/></td>";
2089t[e++]="<td id='"+this._tdId+"#66FFFF' style='background-color:#66FFFF' width='12' height='14'><img height='1' width='1'/></td>";
2090t[e++]="<td id='"+this._tdId+"#9999FF' style='background-color:#9999FF' width='12' height='14'><img height='1' width='1'/></td>";
2091t[e++]="<td id='"+this._tdId+"#FF99FF' style='background-color:#FF99FF' width='12' height='14'><img height='1' width='1'/></td>";
2092t[e++]="</tr><tr>";
2093t[e++]="<td id='"+this._tdId+"#C0C0C0' style='background-color:#C0C0C0' width='12' height='14'><img height='1' width='1'/></td>";
2094t[e++]="<td id='"+this._tdId+"#FF0000' style='background-color:#FF0000' width='12' height='14'><img height='1' width='1'/></td>";
2095t[e++]="<td id='"+this._tdId+"#FF9900' style='background-color:#FF9900' width='12' height='14'><img height='1' width='1'/></td>";
2096t[e++]="<td id='"+this._tdId+"#FFCC66' style='background-color:#FFCC66' width='12' height='14'><img height='1' width='1'/></td>";
2097t[e++]="<td id='"+this._tdId+"#FFFF00' style='background-color:#FFFF00' width='12' height='14'><img height='1' width='1'/></td>";
2098t[e++]="<td id='"+this._tdId+"#33FF33' style='background-color:#33FF33' width='12' height='14'><img height='1' width='1'/></td>";
2099t[e++]="<td id='"+this._tdId+"#66CCCC' style='background-color:#66CCCC' width='12' height='14'><img height='1' width='1'/></td>";
2100t[e++]="<td id='"+this._tdId+"#33CCFF' style='background-color:#33CCFF' width='12' height='14'><img height='1' width='1'/></td>";
2101t[e++]="<td id='"+this._tdId+"#6666CC' style='background-color:#6666CC' width='12' height='14'><img height='1' width='1'/></td>";
2102t[e++]="<td id='"+this._tdId+"#CC66CC' style='background-color:#CC66CC' width='12' height='14'><img height='1' width='1'/></td>";
2103t[e++]="</tr><tr>";
2104t[e++]="<td id='"+this._tdId+"#999999' style='background-color:#999999' width='12' height='14'><img height='1' width='1'/></td>";
2105t[e++]="<td id='"+this._tdId+"#CC0000' style='background-color:#CC0000' width='12' height='14'><img height='1' width='1'/></td>";
2106t[e++]="<td id='"+this._tdId+"#FF6600' style='background-color:#FF6600' width='12' height='14'><img height='1' width='1'/></td>";
2107t[e++]="<td id='"+this._tdId+"#FFCC33' style='background-color:#FFCC33' width='12' height='14'><img height='1' width='1'/></td>";
2108t[e++]="<td id='"+this._tdId+"#FFCC00' style='background-color:#FFCC00' width='12' height='14'><img height='1' width='1'/></td>";
2109t[e++]="<td id='"+this._tdId+"#33CC00' style='background-color:#33CC00' width='12' height='14'><img height='1' width='1'/></td>";
2110t[e++]="<td id='"+this._tdId+"#00CCCC' style='background-color:#00CCCC' width='12' height='14'><img height='1' width='1'/></td>";
2111t[e++]="<td id='"+this._tdId+"#3366FF' style='background-color:#3366FF' width='12' height='14'><img height='1' width='1'/></td>";
2112t[e++]="<td id='"+this._tdId+"#6633FF' style='background-color:#6633FF' width='12' height='14'><img height='1' width='1'/></td>";
2113t[e++]="<td id='"+this._tdId+"#CC33CC' style='background-color:#CC33CC' width='12' height='14'><img height='1' width='1'/></td>";
2114t[e++]="</tr><tr>";
2115t[e++]="<td id='"+this._tdId+"#666666' style='background-color:#666666' width='12' height='14'><img height='1' width='1'/></td>";
2116t[e++]="<td id='"+this._tdId+"#990000' style='background-color:#990000' width='12' height='14'><img height='1' width='1'/></td>";
2117t[e++]="<td id='"+this._tdId+"#CC6600' style='background-color:#CC6600' width='12' height='14'><img height='1' width='1'/></td>";
2118t[e++]="<td id='"+this._tdId+"#CC9933' style='background-color:#CC9933' width='12' height='14'><img height='1' width='1'/></td>";
2119t[e++]="<td id='"+this._tdId+"#999900' style='background-color:#999900' width='12' height='14'><img height='1' width='1'/></td>";
2120t[e++]="<td id='"+this._tdId+"#009900' style='background-color:#009900' width='12' height='14'><img height='1' width='1'/></td>";
2121t[e++]="<td id='"+this._tdId+"#339999' style='background-color:#339999' width='12' height='14'><img height='1' width='1'/></td>";
2122t[e++]="<td id='"+this._tdId+"#3333FF' style='background-color:#3333FF' width='12' height='14'><img height='1' width='1'/></td>";
2123t[e++]="<td id='"+this._tdId+"#6600CC' style='background-color:#6600CC' width='12' height='14'><img height='1' width='1'/></td>";
2124t[e++]="<td id='"+this._tdId+"#993399' style='background-color:#993399' width='12' height='14'><img height='1' width='1'/></td>";
2125t[e++]="</tr><tr>";
2126t[e++]="<td id='"+this._tdId+"#333333' style='background-color:#333333' width='12' height='14'><img height='1' width='1'/></td>";
2127t[e++]="<td id='"+this._tdId+"#660000' style='background-color:#660000' width='12' height='14'><img height='1' width='1'/></td>";
2128t[e++]="<td id='"+this._tdId+"#993300' style='background-color:#993300' width='12' height='14'><img height='1' width='1'/></td>";
2129t[e++]="<td id='"+this._tdId+"#996633' style='background-color:#996633' width='12' height='14'><img height='1' width='1'/></td>";
2130t[e++]="<td id='"+this._tdId+"#666600' style='background-color:#666600' width='12' height='14'><img height='1' width='1'/></td>";
2131t[e++]="<td id='"+this._tdId+"#006600' style='background-color:#006600' width='12' height='14'><img height='1' width='1'/></td>";
2132t[e++]="<td id='"+this._tdId+"#336666' style='background-color:#336666' width='12' height='14'><img height='1' width='1'/></td>";
2133t[e++]="<td id='"+this._tdId+"#000099' style='background-color:#000099' width='12' height='14'><img height='1' width='1'/></td>";
2134t[e++]="<td id='"+this._tdId+"#333399' style='background-color:#333399' width='12' height='14'><img height='1' width='1'/></td>";
2135t[e++]="<td id='"+this._tdId+"#663366' style='background-color:#663366' width='12' height='14'><img height='1' width='1'/></td>";
2136t[e++]="</tr><tr>";
2137t[e++]="<td id='"+this._tdId+"#000000' style='background-color:#000000' width='12' height='14'><img height='1' width='1'/></td>";
2138t[e++]="<td id='"+this._tdId+"#330000' style='background-color:#330000' width='12' height='14'><img height='1' width='1'/></td>";
2139t[e++]="<td id='"+this._tdId+"#663300' style='background-color:#663300' width='12' height='14'><img height='1' width='1'/></td>";
2140t[e++]="<td id='"+this._tdId+"#663333' style='background-color:#663333' width='12' height='14'><img height='1' width='1'/></td>";
2141t[e++]="<td id='"+this._tdId+"#333300' style='background-color:#333300' width='12' height='14'><img height='1' width='1'/></td>";
2142t[e++]="<td id='"+this._tdId+"#003300' style='background-color:#003300' width='12' height='14'><img height='1' width='1'/></td>";
2143t[e++]="<td id='"+this._tdId+"#003333' style='background-color:#003333' width='12' height='14'><img height='1' width='1'/></td>";
2144t[e++]="<td id='"+this._tdId+"#000066' style='background-color:#000066' width='12' height='14'><img height='1' width='1'/></td>";
2145t[e++]="<td id='"+this._tdId+"#330099' style='background-color:#330099' width='12' height='14'><img height='1' width='1'/></td>";
2146t[e++]="<td id='"+this._tdId+"#330033' style='background-color:#330033' width='12' height='14'><img height='1' width='1'/></td>";
2147if(this._allowColorInput){
2148t[e++]="<tr><td></td></tr></tr><tr class='ColorInput'>";
2149t[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>"
2150}
2151t[e++]="</tr></table>";
2152this.getHtmlElement().innerHTML=t.join("")
2153};
2154DwtColorPicker._mouseOverHdlr=function(a){
2155var t=DwtShell.mouseEvent;
2156t.setFromDhtmlEvent(a,true);
2157var i=t.target;
2158if(i.nodeName.toLowerCase()=="img"){
2159i=i.parentNode
2160}
2161if(t.dwtObj._downTdId==i.id){
2162var e=i.style.backgroundColor;
2163i.style.backgroundColor=t.dwtObj._swappedColor;
2164t.dwtObj._swappedColor=e;
2165i.style.borderStyle="inset";
2166i.style.borderColor=e
2167}
2168this._stopPropagation=true;
2169this._returnValue=false;
2170t.setToDhtmlEvent(a);
2171return false
2172};
2173DwtColorPicker._mouseOutHdlr=function(a){
2174var t=DwtShell.mouseEvent;
2175t.setFromDhtmlEvent(a,true);
2176var i=t.target;
2177if(i.nodeName.toLowerCase()=="img"){
2178i=i.parentNode
2179}
2180if(t.dwtObj._downTdId==i.id){
2181var e=i.style.backgroundColor;
2182i.style.backgroundColor=t.dwtObj._swappedColor;
2183t.dwtObj._swappedColor=e;
2184i.style.borderStyle="outset";
2185i.style.borderColor=e;
2186t.dwtObj._downTdId=null
2187}
2188this._stopPropagation=true;
2189this._returnValue=false;
2190t.setToDhtmlEvent(a);
2191return false
2192};
2193DwtColorPicker._mouseDownHdlr=function(s){
2194var n=DwtShell.mouseEvent;
2195n.setFromDhtmlEvent(s,true);
2196var h=n.target;
2197if(h.nodeName.toLowerCase()=="img"){
2198h=h.parentNode
2199}
2200var a=n.target.style.backgroundColor;
2201var t;
2202var o,i,e;
2203n.dwtObj._downTdId=h.id;
2204n.dwtObj._swappedColor=a;
2205h.style.borderStyle="inset";
2206if((h.className!="NoFill")&&(h.className!="SetInputColor")){
2207if(a.substr(0,1)=="#"){
2208t=a.match(DwtColorPicker._HEX_RE);
2209t[1]=DwtColorPicker._hexConv(t[1]);
2210t[2]=DwtColorPicker._hexConv(t[2]);
2211t[3]=DwtColorPicker._hexConv(t[3])
2212}else{
2213t=a.match(DwtColorPicker._RGB_RE)
2214}
2215o=Math.max(Math.floor(t[1]-(t[1]*0.25)),0);
2216i=Math.max(Math.floor(t[2]-(t[2]*0.25)),0);
2217e=Math.max(Math.floor(t[3]-(t[3]*0.25)),0);
2218a="rgb("+o+","+i+","+e+")";
2219h.style.backgroundColor=a
2220}
2221n._stopPropagation=true;
2222n._returnValue=false;
2223n.setToDhtmlEvent(s);
2224return false
2225};
2226DwtColorPicker._hexConv=function(e){
2227if(e=="00"){
2228return 0
2229}else{
2230if(e=="33"){
2231return 51
2232}else{
2233if(e=="66"){
2234return 102
2235}else{
2236if(e=="99"){
2237return 153
2238}else{
2239if(e.toUpperCase()=="CC"){
2240return 204
2241}else{
2242if(e.toUpperCase()=="FF"){
2243return 255
2244}else{
2245if(e.toUpperCase()=="C0"){
2246return 192
2247}}}}}}}};
2248DwtColorPicker._mouseUpHdlr=function(a){
2249var t=DwtShell.mouseEvent;
2250t.setFromDhtmlEvent(a,true);
2251var e=t.dwtObj;
2252var o=t.target;
2253if(o.nodeName.toLowerCase()=="img"){
2254o=o.parentNode
2255}
2256if(e._downTdId==o.id){
2257o.style.borderStyle="outset";
2258o.style.borderColor=t.dwtObj._swappedColor;
2259o.style.backgroundColor=t.dwtObj._swappedColor
2260}
2261if(e._downTdId==o.id){
2262if(e.parent instanceof DwtMenu){
2263DwtMenu.closeActiveMenu()
2264}
2265if(e.isListenerRegistered(DwtEvent.SELECTION)){
2266var i=DwtShell.selectionEvent;
2267DwtUiEvent.copy(i,t);
2268i.item=e;
2269if(o.id==(e._tdId+".SetInputColor")){
2270i.detail=e.getInputColor()
2271}else{
2272i.detail=t.target.id.substr(t.target.id.indexOf("#"))
2273}
2274e.notifyListeners(DwtEvent.SELECTION,i)
2275}}
2276e._downTdId=null;
2277t._stopPropagation=true;
2278t._returnValue=false;
2279t.setToDhtmlEvent(a);
2280return false
2281};
2282DwtColorPicker.prototype.getInputColor=function(){
2283var e=document.getElementById(this._tdId+".ColorInputField").firstChild;
2284var t="#"+e.value;
2285if(t.match(DwtColorPicker._HEX_COMPLETE_RE)!=null){
2286return t
2287}else{
2288return""
2289}}
2290}
2291if(AjxPackage.define("ajax.dwt.widgets.DwtCheckbox")){
2292DwtCheckbox=function(e){
2293if(arguments.length==0){
2294return
2295}
2296e=Dwt.getParams(arguments,DwtCheckbox.PARAMS);
2297e.className=e.className||"DwtCheckbox";
2298DwtControl.call(this,e);
2299this._textPosition=DwtCheckbox.DEFAULT_POSITION;
2300this._initName=e.name;
2301this._initValue=e.value;
2302this._initChecked=e.checked;
2303this._createHtml()
2304};
2305DwtCheckbox.prototype=new DwtControl;
2306DwtCheckbox.prototype.constructor=DwtCheckbox;
2307DwtCheckbox.prototype.toString=function(){
2308return"DwtCheckbox"
2309};
2310DwtCheckbox.PARAMS=["parent","style","name","checked","className","posStyle","id","index","value"];
2311DwtCheckbox.TEXT_LEFT="left";
2312DwtCheckbox.TEXT_RIGHT="right";
2313DwtCheckbox.DEFAULT_POSITION=DwtCheckbox.TEXT_RIGHT;
2314DwtCheckbox.prototype.TEMPLATE="dwt.Widgets#DwtCheckbox";
2315DwtCheckbox.prototype.getTabGroupMember=function(){
2316return this._inputEl
2317};
2318DwtCheckbox.prototype.focus=function(){
2319if(this._inputEl){
2320this._inputEl.focus();
2321DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
2322}};
2323DwtCheckbox.prototype.blur=function(){
2324if(this._inputEl){
2325this._inputEl.blur()
2326}};
2327DwtCheckbox.prototype.addSelectionListener=function(e){
2328this.addListener(DwtEvent.SELECTION,e)
2329};
2330DwtCheckbox.prototype.removeSelectionListener=function(e){
2331this.removeListener(DwtEvent.SELECTION,e)
2332};
2333DwtCheckbox.prototype.setEnabled=function(e){
2334if(e!=this._enabled){
2335DwtControl.prototype.setEnabled.call(this,e);
2336this._inputEl.disabled=!e;
2337var t=e?"Text":"DisabledText";
2338if(this._textElLeft){
2339this._textElLeft.className=t
2340}
2341if(this._textElRight){
2342this._textElRight.className=t
2343}}};
2344DwtCheckbox.prototype.setSelected=function(e){
2345if(this._inputEl&&this._inputEl.checked!=e){
2346this._inputEl.checked=e
2347}};
2348DwtCheckbox.prototype.isSelected=function(){
2349return this._inputEl&&this._inputEl.checked
2350};
2351DwtCheckbox.prototype.setText=function(e){
2352if(this._textEl&&this._text!=e){
2353this._text=e;
2354this._textEl.innerHTML=e||""
2355}};
2356DwtCheckbox.prototype.getText=function(){
2357return this._text
2358};
2359DwtCheckbox.prototype.setTextPosition=function(e){
2360this._textEl=e==DwtCheckbox.TEXT_LEFT?this._textElLeft:this._textElRight;
2361if(this._textPosition!=e){
2362this._textPosition=e;
2363if(this._textElLeft){
2364this._textElLeft.innerHTML=""
2365}
2366if(this._textElRight){
2367this._textElRight.innerHTML=""
2368}
2369this.setText(this._text)
2370}};
2371DwtCheckbox.prototype.getTextPosition=function(){
2372return this._textPosition
2373};
2374DwtCheckbox.prototype.setValue=function(t){
2375var e=this._inputEl||this;
2376if(e.value!==t){
2377e.value=t
2378}};
2379DwtCheckbox.prototype.getValue=function(){
2380var e=this._inputEl||this;
2381return e.value!=null?e.value:this.getText()
2382};
2383DwtCheckbox.prototype.getInputElement=function(){
2384return this._inputEl
2385};
2386DwtCheckbox.prototype._replaceElementHook=function(t,a,e,i){
2387a=this.getInputElement();
2388DwtControl.prototype._replaceElementHook.call(this,t,a,e,i);
2389if(t.id){
2390this.setHtmlElementId(t.id+"_control");
2391a.id=t.id;
2392if(this._textEl){
2393this._textEl.setAttribute("for",t.id)
2394}}};
2395DwtCheckbox.prototype._createHtml=function(e){
2396var t={
2397id:this._htmlElId};
2398this._createHtmlFromTemplate(e||this.TEMPLATE,t)
2399};
2400DwtCheckbox.prototype._createHtmlFromTemplate=function(t,a){
2401a.name=this._initName||this._htmlElId;
2402a.value=this._initValue;
2403a.checked=Boolean(this._initChecked)?"checked":"";
2404DwtControl.prototype._createHtmlFromTemplate.call(this,t,a);
2405this._inputEl=document.getElementById(a.id+"_input");
2406if(this._inputEl){
2407var e=DwtShell.getShell(window).getKeyboardMgr();
2408var i=AjxCallback.simpleClosure(e.grabFocus,e,this.getTabGroupMember());
2409Dwt.setHandler(this._inputEl,DwtEvent.ONFOCUS,i);
2410Dwt.setHandler(this._inputEl,DwtEvent.ONCLICK,DwtCheckbox.__handleClick)
2411}
2412this._textElLeft=document.getElementById(a.id+"_text_left");
2413this._textElRight=document.getElementById(a.id+"_text_right");
2414this.setTextPosition(this._textPosition)
2415};
2416DwtCheckbox.__handleClick=function(e){
2417var t=DwtUiEvent.getEvent(e);
2418var o=DwtUiEvent.getTarget(t);
2419var i=DwtShell.selectionEvent;
2420DwtUiEvent.copy(i,t);
2421i.item=this;
2422i.detail=o.checked;
2423var a=DwtControl.findControl(o);
2424a.setSelected(o.checked);
2425a.notifyListeners(DwtEvent.SELECTION,i)
2426}
2427}
2428if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButton")){
2429DwtRadioButton=function(e){
2430if(arguments.length==0){
2431return
2432}
2433e=Dwt.getParams(arguments,DwtRadioButton.PARAMS);
2434e.className=e.className||"DwtRadioButton";
2435DwtCheckbox.call(this,e)
2436};
2437DwtRadioButton.PARAMS=DwtCheckbox.PARAMS;
2438DwtRadioButton.prototype=new DwtCheckbox;
2439DwtRadioButton.prototype.constructor=DwtRadioButton;
2440DwtRadioButton.prototype.toString=function(){
2441return"DwtRadioButton"
2442};
2443DwtRadioButton.prototype.TEMPLATE="dwt.Widgets#DwtRadioButton"
2444}
2445if(AjxPackage.define("ajax.dwt.widgets.DwtMessageDialog")){
2446DwtMessageDialog=function(e){
2447if(arguments.length==0){
2448return
2449}
2450e=Dwt.getParams(arguments,DwtMessageDialog.PARAMS);
2451this._msgCellId=Dwt.getNextId();
2452e.standardButtons=e.buttons||[DwtDialog.OK_BUTTON];
2453DwtDialog.call(this,e);
2454this.setContent(this._contentHtml());
2455this._msgCell=document.getElementById(this._msgCellId);
2456this.addEnterListener(new AjxListener(this,this._enterListener))
2457};
2458DwtMessageDialog.PARAMS=["parent","className","buttons","extraButtons"];
2459DwtMessageDialog.prototype=new DwtDialog;
2460DwtMessageDialog.prototype.constructor=DwtMessageDialog;
2461DwtMessageDialog.CRITICAL_STYLE=1;
2462DwtMessageDialog.INFO_STYLE=2;
2463DwtMessageDialog.WARNING_STYLE=3;
2464DwtMessageDialog.TITLE={};
2465DwtMessageDialog.TITLE[DwtMessageDialog.CRITICAL_STYLE]=AjxMsg.criticalMsg;
2466DwtMessageDialog.TITLE[DwtMessageDialog.INFO_STYLE]=AjxMsg.infoMsg;
2467DwtMessageDialog.TITLE[DwtMessageDialog.WARNING_STYLE]=AjxMsg.warningMsg;
2468DwtMessageDialog.ICON={};
2469DwtMessageDialog.ICON[DwtMessageDialog.CRITICAL_STYLE]="Critical_32";
2470DwtMessageDialog.ICON[DwtMessageDialog.INFO_STYLE]="Information_32";
2471DwtMessageDialog.ICON[DwtMessageDialog.WARNING_STYLE]="Warning_32";
2472DwtMessageDialog.prototype.toString=function(){
2473return"DwtMessageDialog"
2474};
2475DwtMessageDialog.prototype.setMessage=function(a,o,n){
2476o=o||DwtMessageDialog.INFO_STYLE;
2477n=n||DwtMessageDialog.TITLE[o];
2478this.setTitle(n);
2479if(a){
2480var t=[];
2481var e=0;
2482t[e++]="<table cellspacing=0 cellpadding=0 border=0><tr><td valign='top'>";
2483t[e++]=AjxImg.getImageHtml(DwtMessageDialog.ICON[o]);
2484t[e++]="</td><td class='DwtMsgArea'>";
2485t[e++]=a;
2486t[e++]="</td></tr></table>";
2487this._msgCell.innerHTML=t.join("")
2488}else{
2489this._msgCell.innerHTML=""
2490}};
2491DwtMessageDialog.prototype.setSize=function(t,e){
2492var a=document.getElementById(this._msgCellId);
2493if(a&&(t||e)){
2494Dwt.setSize(a,t,e)
2495}};
2496DwtMessageDialog.prototype.reset=function(){
2497this._msgCell.innerHTML="";
2498DwtDialog.prototype.reset.call(this)
2499};
2500DwtMessageDialog.prototype.handleKeyAction=function(e,t){
2501if((e==DwtKeyMap.CANCEL)&&!this._button[DwtDialog.CANCEL_BUTTON]){
2502e=DwtKeyMap.ENTER
2503}
2504switch(e){
2505case DwtKeyMap.CANCEL:this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
2506break;
2507default:DwtDialog.prototype.handleKeyAction.call(this,e,t);
2508break
2509}
2510return true
2511};
2512DwtMessageDialog.prototype._contentHtml=function(){
2513return"<div id='"+this._msgCellId+"' class='DwtMsgDialog'></div>"
2514};
2515DwtMessageDialog.prototype._enterListener=function(e){
2516this._runEnterCallback()
2517}
2518}
2519if(AjxPackage.define("ajax.dwt.widgets.DwtHtmlEditor")){
2520DwtHtmlEditor=function(e){
2521if(arguments.length==0){
2522return
2523}
2524e=Dwt.getParams(arguments,DwtHtmlEditor.PARAMS);
2525this.setBlankIframeSrc(e.blankIframeSrc);
2526e.className=e.className||"DwtHtmlEditor";
2527DwtComposite.call(this,e);
2528this._mode=(e.mode==DwtHtmlEditor.HTML&&this.isHtmlEditingSupported())?e.mode:DwtHtmlEditor.TEXT;
2529this.__eventClosure=AjxCallback.simpleClosure(this.__eventClosure,this);
2530this._pendingContent=e.content||"";
2531this._htmlModeInited=false;
2532this._initialize()
2533};
2534DwtHtmlEditor.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
2535DwtHtmlEditor.prototype=new DwtComposite();
2536DwtHtmlEditor.prototype.constructor=DwtHtmlEditor;
2537DwtHtmlEditor.HTML="text/html";
2538DwtHtmlEditor.TEXT="text/plain";
2539DwtHtmlEditor.H1=1;
2540DwtHtmlEditor.H2=2;
2541DwtHtmlEditor.H3=3;
2542DwtHtmlEditor.H4=4;
2543DwtHtmlEditor.H5=5;
2544DwtHtmlEditor.H6=6;
2545DwtHtmlEditor.PARAGRAPH=7;
2546DwtHtmlEditor.ADDRESS=8;
2547DwtHtmlEditor.PREFORMATTED=9;
2548DwtHtmlEditor._STYLES=["","<h1>","<h2>","<h3>","<h4>","<h5>","<h6>","<p>","<address>","<pre>"];
2549DwtHtmlEditor.BOLD_STYLE="bold";
2550DwtHtmlEditor.ITALIC_STYLE="italic";
2551DwtHtmlEditor.UNDERLINE_STYLE="underline";
2552DwtHtmlEditor.STRIKETHRU_STYLE="strikethrough";
2553DwtHtmlEditor.SUBSCRIPT_STYLE="subscript";
2554DwtHtmlEditor.SUPERSCRIPT_STYLE="superscript";
2555DwtHtmlEditor.JUSTIFY_LEFT="justifyleft";
2556DwtHtmlEditor.JUSTIFY_CENTER="justifycenter";
2557DwtHtmlEditor.JUSTIFY_RIGHT="justifyright";
2558DwtHtmlEditor.JUSTIFY_FULL="justifyfull";
2559DwtHtmlEditor.OUTDENT="outdent";
2560DwtHtmlEditor.INDENT="indent";
2561DwtHtmlEditor.HORIZ_RULE="inserthorizontalrule";
2562DwtHtmlEditor.ORDERED_LIST="insertorderedlist";
2563DwtHtmlEditor.UNORDERED_LIST="insertunorderedlist";
2564DwtHtmlEditor.IMAGE="insertimage";
2565DwtHtmlEditor.BORDER_TOP=0;
2566DwtHtmlEditor.BORDER_MIDDLE=1;
2567DwtHtmlEditor.BORDER_BOTTOM=2;
2568DwtHtmlEditor.BORDER_LEFT=3;
2569DwtHtmlEditor.BORDER_CENTER=4;
2570DwtHtmlEditor.BORDER_RIGHT=5;
2571DwtHtmlEditor._H1_RE=/Heading 1|h1/;
2572DwtHtmlEditor._H2_RE=/Heading 2|h2/;
2573DwtHtmlEditor._H3_RE=/Heading 2|h3/;
2574DwtHtmlEditor._H4_RE=/Heading 2|h4/;
2575DwtHtmlEditor._H5_RE=/Heading 2|h5/;
2576DwtHtmlEditor._H6_RE=/Heading 2|h6/;
2577DwtHtmlEditor._PARAGRAPH_RE=/Normal|p/;
2578DwtHtmlEditor._ADDRESS_RE=/Address|address/;
2579DwtHtmlEditor._PREFORMATTED_RE=/Formatted|pre/;
2580DwtHtmlEditor._FONT_NAME="fontname";
2581DwtHtmlEditor._FONT_SIZE="fontsize";
2582DwtHtmlEditor._FONT_COLOR="forecolor";
2583DwtHtmlEditor._FONT_HILITE="hilitecolor";
2584DwtHtmlEditor._FONT_HILITE_IE="backcolor";
2585DwtHtmlEditor._FORMAT_BLOCK="formatblock";
2586DwtHtmlEditor._INITDELAY=50;
2587DwtHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
2588DwtHtmlEditor._BLOCK_ELEMENTS={
2589address: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};
2590DwtHtmlEditor._ACTION_CODE_TO_CMD={};
2591DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_BOLD]=DwtHtmlEditor.BOLD_STYLE;
2592DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_ITALIC]=DwtHtmlEditor.ITALIC_STYLE;
2593DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_UNDERLINE]=DwtHtmlEditor.UNDERLINE_STYLE;
2594DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_STRIKETHRU]=DwtHtmlEditor.STRIKETHRU_STYLE;
2595DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_LEFT]=DwtHtmlEditor.JUSTIFY_LEFT;
2596DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_CENTER]=DwtHtmlEditor.JUSTIFY_CENTER;
2597DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_RIGHT]=DwtHtmlEditor.JUSTIFY_RIGHT;
2598DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER1]=DwtHtmlEditor._STYLES[1];
2599DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER2]=DwtHtmlEditor._STYLES[2];
2600DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER3]=DwtHtmlEditor._STYLES[3];
2601DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER4]=DwtHtmlEditor._STYLES[4];
2602DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER5]=DwtHtmlEditor._STYLES[5];
2603DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER6]=DwtHtmlEditor._STYLES[6];
2604DwtHtmlEditor.INIT_HTML=["<html><head><title>ZWC</title></head><body><p>",AjxEnv.isGeckoBased?"<br type='_moz' />":"","</p></body></html>"].join("");
2605DwtHtmlEditor.prototype.focus=function(){
2606if(!AjxEnv.isIE&&this._mode==DwtHtmlEditor.TEXT){
2607document.getElementById(this._textAreaId).focus()
2608}else{
2609try{
2610if(!this._htmlModeInited){
2611setTimeout(AjxCallback.simpleClosure(this.focus,this),DwtHtmlEditor._INITDELAY);
2612return
2613}
2614if(AjxEnv.isSafari){
2615document.getElementById(this._iFrameId).focus()
2616}else{
2617this._getIframeWin().focus()
2618}
2619if(AjxEnv.isIE){
2620if(this._currInsPt){
2621if(this._currInsPt.text.length<=1){
2622this._currInsPt.collapse(false)
2623}
2624this._currInsPt.select()
2625}}}
2626catch(e){}}};
2627DwtHtmlEditor.prototype.moveCaretToTop=function(){
2628var a=document.activeElement;
2629if(this._mode==DwtHtmlEditor.TEXT){
2630var t=document.getElementById(this._textAreaId);
2631if(t.createTextRange){
2632var e=t.createTextRange();
2633e.collapse(true);
2634e.select()
2635}else{
2636if(t.setSelectionRange){
2637t.setSelectionRange(0,0)
2638}}}else{
2639this._moveCaretToTopHtml(true)
2640}
2641if(a){
2642a.focus()
2643}};
2644DwtHtmlEditor.prototype._moveCaretToTopHtml=function(t){
2645var e=this._getIframeDoc().body;
2646var o=false;
2647if(AjxEnv.isIE){
2648if(e){
2649e.createTextRange().collapse(true);
2650o=true
2651}}else{
2652var a=this._getSelection();
2653if(a){
2654a.collapse(e,0);
2655o=true
2656}}
2657if(!o&&t){
2658var i=new AjxTimedAction(this,this._moveCaretToTopHtml);
2659AjxTimedAction.scheduleAction(i,DwtHtmlEditor._INITDELAY+1)
2660}};
2661DwtHtmlEditor.prototype.addStateChangeListener=function(e){
2662this.addListener(DwtEvent.STATE_CHANGE,e)
2663};
2664DwtHtmlEditor.prototype.removeStateChangeListener=function(e){
2665this.removeListener(DwtEvent.STATE_CHANGE,e)
2666};
2667DwtHtmlEditor.prototype.clear=function(){
2668this.setContent("")
2669};
2670DwtHtmlEditor.prototype.enable=function(e){
2671if(this._textAreaId!=null){
2672document.getElementById(this._textAreaId).disabled=!e
2673}
2674if(this._iFrameId!=null){
2675document.getElementById(this._iFrameId).disabled=!e
2676}};
2677DwtHtmlEditor.prototype.setBlankIframeSrc=function(e){
2678this._blankIframeSrc=e
2679};
2680DwtHtmlEditor.prototype.isHtmlEditingSupported=function(){
2681return(!!(AjxEnv.isGeckoBased||AjxEnv.isIE||AjxEnv.isSafari3up))
2682};
2683DwtHtmlEditor.prototype.getContent=function(){
2684if(this._mode==DwtHtmlEditor.HTML){
2685var a=this._getIframeDoc();
2686var e=a&&a.body?(this._getIframeDoc().body.innerHTML):"";
2687return this._embedHtmlContent(e)
2688}else{
2689var t=document.getElementById(this._textAreaId);
2690return t&&t.value
2691}};
2692DwtHtmlEditor.prototype._embedHtmlContent=function(e){
2693return["<html><body>",e,"</body></html>"].join("")
2694};
2695DwtHtmlEditor.prototype.setContent=function(e){
2696if(AjxEnv.isIE){
2697this._currInsPt=null
2698}
2699if(this._mode==DwtHtmlEditor.HTML){
2700this._pendingContent=e||"";
2701if(this._htmlModeInited){
2702this._setContentOnTimer()
2703}}else{
2704document.getElementById(this._textAreaId).value=(e||"")
2705}};
2706DwtHtmlEditor.prototype.insertElement=function(e){
2707this._execCommand(e)
2708};
2709DwtHtmlEditor.prototype.insertText=function(a,e){
2710var t=this._getIframeDoc().createTextNode(a);
2711this._insertNodeAtSelection(t,e)
2712};
2713DwtHtmlEditor.prototype.insertImage=function(n,s,a,e){
2714if(s){
2715var i=this._getIframeDoc();
2716var t=i.createElement("img");
2717t.src=n;
2718if(a){
2719t.width=a
2720}else{
2721t.removeAttribute("width")
2722}
2723if(e){
2724t.height=e
2725}else{
2726t.removeAttribute("height")
2727}
2728var o=i.createDocumentFragment();
2729o.appendChild(t);
2730this._insertNodeAtSelection(o)
2731}else{
2732this._execCommand(DwtHtmlEditor.IMAGE,n)
2733}};
2734DwtHtmlEditor.prototype.insertTable=function(b,m,a,t,l,u){
2735if(this._mode!=DwtHtmlEditor.HTML){
2736return
2737}
2738var g=this._getIframeDoc();
2739var y=g.createElement("table");
2740y.style.borderRight="1px solid #000";
2741y.style.borderLeft="1px solid #000";
2742y.style.borderTop="1px solid #000";
2743y.style.borderBottom="1px solid #000";
2744if(a!=null){
2745y.style.width=a
2746}else{
2747y.style.width="100%"
2748}
2749y.style.textAlign="left";
2750y.style.verticalAlign="middle";
2751if(u!=null){
2752y.align=u.toLowerCase()
2753}
2754if(t!=null){
2755y.cellSpacing=t
2756}else{
2757y.cellSpacing=0
2758}
2759if(l!=null){
2760y.cellPadding=l
2761}else{
2762y.cellPadding=0
2763}
2764if(!AjxEnv.isIE){
2765y.style.border="1px solid #000"
2766}
2767y.style.borderCollapse="collapse";
2768var c;
2769c=Math.floor(100/m)+"%";
2770var h=g.createElement("tbody");
2771y.appendChild(h);
2772for(var s=0;
2773s<b;
2774s++){
2775var d=g.createElement("tr");
2776h.appendChild(d);
2777for(var n=0;
2778n<m;
2779n++){
2780var o=g.createElement("td");
2781if(s==0&&c){
2782o.style.width=c
2783}
2784if(AjxEnv.isGeckoBased){
2785o.appendChild(g.createElement("br"))
2786}else{
2787if(AjxEnv.isIE){
2788o.innerHTML="&nbsp;"
2789}}
2790if(AjxEnv.isIE){
2791o.style.border="1px solid #000"
2792}else{
2793o.style.borderTop=o.style.borderLeft="1px solid #000"
2794}
2795d.appendChild(o)
2796}}
2797var e=g.createElement("br");
2798var f=g.createDocumentFragment();
2799f.appendChild(e);
2800f.appendChild(y);
2801f.appendChild(e.cloneNode(true));
2802this._insertNodeAtSelection(f);
2803this.selectNodeContents(y.rows[0].cells[0],true);
2804return y
2805};
2806DwtHtmlEditor.prototype.applyTableProperties=function(d,l){
2807var c=this._getIframeDoc();
2808var h=[];
2809for(var s in l){
2810var e=AjxStringUtil.trim(l[s].toString());
2811var t=e!="";
2812switch(s){
2813case"caption":var u=d.getElementsByTagName("caption");
2814u=u.length>0?u[0]:null;
2815if(t&&!u){
2816u=c.createElement("caption");
2817d.insertBefore(u,d.firstChild)
2818}
2819if(!t&&u){
2820u.parentNode.removeChild(u)
2821}
2822if(u){
2823u.innerHTML=e
2824}
2825break;
2826case"summary":case"align":case"cellSpacing":case"cellPadding":if(!t){
2827d.removeAttribute(s,0)
2828}else{
2829d[s]=e
2830}
2831break;
2832case"borderWidth":case"borderStyle":case"borderColor":d.style[s]=e;
2833h.push([s,e]);
2834break;
2835default:d.style[s]=e;
2836break
2837}}
2838if(h.length>0){
2839var n=d.getElementsByTagName("td");
2840for(var s=n.length;
2841--s>=0;
2842){
2843var a=n[s];
2844for(var o=h.length;
2845--o>=0;
2846){
2847a.style[h[o][0]]=h[o][1]
2848}}}
2849if(AjxEnv.isGeckoBased){
2850this._forceRedraw()
2851}};
2852DwtHtmlEditor.prototype.applyCellProperties=function(d,u,n){
2853var s=true;
2854for(var a=u.length;
2855--a>=0;
2856){
2857var m=u[a];
2858var o=(a==0);
2859var c=true;
2860for(var t=m.length;
2861--t>=0;
2862){
2863var l=(t==0);
2864var e=m[t];
2865if(n.backgroundColor!=null){
2866e.style.backgroundColor=n.backgroundColor
2867}
2868if(n.color!=null){
2869e.style.color=n.color
2870}
2871if(n.textAlign!=null){
2872e.style.textAlign=n.textAlign
2873}
2874if(n.verticalAlign!=null){
2875e.style.verticalAlign=n.verticalAlign
2876}
2877if(n.width!=null){
2878if(n.width){
2879e.style.width=n.width+"px"
2880}else{
2881e.style.width=""
2882}}
2883if(n.height!=null){
2884if(n.height){
2885e.style.height=n.height+"px"
2886}else{
2887e.style.height=""
2888}}
2889if(n.vertPadding!=null){
2890if(n.vertPadding){
2891e.style.paddingTop=e.style.paddingBottom=n.vertPadding+"px"
2892}else{
2893e.style.paddingTop=e.style.paddingBottom=""
2894}}
2895if(n.horizPadding!=null){
2896if(n.horizPadding){
2897e.style.paddingLeft=e.style.paddingRight=n.horizPadding+"px"
2898}else{
2899e.style.paddingLeft=e.style.paddingRight=""
2900}}
2901var i=n.borders,h;
2902h=i[DwtHtmlEditor.BORDER_TOP];
2903if(h!=null&&o){
2904e.style.borderTop=h.width+" "+h.style+" "+h.color
2905}
2906h=i[DwtHtmlEditor.BORDER_MIDDLE];
2907if(h!=null){
2908h=h.width+" "+h.style+" "+h.color;
2909if(!s){
2910e.style.borderBottom=h
2911}
2912if(!o){
2913e.style.borderTop=h
2914}}
2915h=i[DwtHtmlEditor.BORDER_BOTTOM];
2916if(h!=null&&s){
2917e.style.borderBottom=h.width+" "+h.style+" "+h.color
2918}
2919h=i[DwtHtmlEditor.BORDER_LEFT];
2920if(h!=null&&l){
2921e.style.borderLeft=h.width+" "+h.style+" "+h.color
2922}
2923h=i[DwtHtmlEditor.BORDER_CENTER];
2924if(h!=null){
2925h=h.width+" "+h.style+" "+h.color;
2926if(!c){
2927e.style.borderRight=h
2928}
2929if(!l){
2930e.style.borderLeft=h
2931}}
2932h=i[DwtHtmlEditor.BORDER_RIGHT];
2933if(h!=null&&c){
2934e.style.borderRight=h.width+" "+h.style+" "+h.color
2935}
2936c=false
2937}
2938s=false
2939}
2940if(AjxEnv.isGeckoBased){
2941this._forceRedraw()
2942}};
2943DwtHtmlEditor.prototype._insertHTML=function(a){
2944var i=this._getSelection();
2945var e=this._createRange(i);
2946if(AjxEnv.isIE){
2947if(this.insertRange){
2948this.insertRange.pasteHTML(a)
2949}else{
2950e.pasteHTML(a)
2951}}else{
2952var n=this._getIframeDoc();
2953var t=n.createDocumentFragment();
2954var o=n.createElement("div");
2955o.innerHTML=a;
2956while(o.firstChild){
2957t.appendChild(o.firstChild)
2958}
2959this._insertNodeAtSelection(t)
2960}};
2961DwtHtmlEditor.prototype._insertNodeAtSelection=function(n,t){
2962this.focus();
2963if(!AjxEnv.isIE){
2964var a=this._getRange();
2965var s=this._getIframeWin().getSelection();
2966s.removeAllRanges();
2967try{
2968a.deleteContents();
2969a.insertNode(n);
2970a.selectNode(n);
2971if(t){
2972s.addRange(a)
2973}}
2974catch(h){}}else{
2975var s=this._getRange();
2976var a=s.createRange();
2977var l="FOO-"+Dwt.getNextId();
2978try{
2979a.pasteHTML("<span id='"+l+"'></span>")
2980}
2981catch(i){
2982a.collapse(false);
2983a.pasteHTML("<span id='"+l+"'></span>")
2984}
2985var o=this._getIframeDoc().getElementById(l);
2986o.parentNode.insertBefore(n,o);
2987o.parentNode.removeChild(o)
2988}};
2989DwtHtmlEditor.prototype.isHtmlModeInited=function(){
2990return this._htmlModeInited
2991};
2992DwtHtmlEditor.prototype.setMode=function(n,i){
2993if(n==this._mode||(n!=DwtHtmlEditor.HTML&&n!=DwtHtmlEditor.TEXT)){
2994return
2995}
2996var t=this._getIframeDoc();
2997this._mode=n;
2998if(n==DwtHtmlEditor.HTML){
2999var o=document.getElementById(this._textAreaId);
3000var e;
3001if(this._iFrameId){
3002t.body.innerHTML=i?AjxStringUtil.convertToHtml(o.value):o.value;
3003e=document.getElementById(this._iFrameId)
3004}else{
3005var a=i?AjxStringUtil.convertToHtml(o.value):o.value;
3006e=this._initHtmlMode(a)
3007}
3008Dwt.setVisible(o,false);
3009Dwt.setVisible(e,true);
3010if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
3011this._enableDesignMode(t)
3012}}else{
3013var o=this._textAreaId?document.getElementById(this._textAreaId):this._initTextMode(true);
3014o.value=i?this._convertHtml2Text():t.innerHTML;
3015Dwt.setVisible(document.getElementById(this._iFrameId),false);
3016Dwt.setVisible(o,true)
3017}};
3018DwtHtmlEditor.prototype.getMode=function(){
3019return this._mode
3020};
3021DwtHtmlEditor.prototype.setFont=function(o,i,a,e,t){
3022if(o){
3023this._execCommand(DwtHtmlEditor._FONT_NAME,o)
3024}
3025if(i){
3026this._execCommand(i)
3027}
3028if(a){
3029this._execCommand(DwtHtmlEditor._FONT_SIZE,a)
3030}
3031if(e){
3032this._execCommand(DwtHtmlEditor._FONT_COLOR,e)
3033}
3034if(t){
3035this._execCommand((AjxEnv.isIE)?DwtHtmlEditor._FONT_HILITE_IE:DwtHtmlEditor._FONT_HILITE,t)
3036}};
3037DwtHtmlEditor.prototype.setJustification=function(e){
3038this._execCommand(e)
3039};
3040DwtHtmlEditor.prototype.setIndent=function(e){
3041this._execCommand(e)
3042};
3043DwtHtmlEditor.prototype.setStyle=function(e){
3044this._execCommand(DwtHtmlEditor._FORMAT_BLOCK,DwtHtmlEditor._STYLES[e])
3045};
3046DwtHtmlEditor.prototype.setSize=function(a,t){
3047DwtComposite.prototype.setSize.call(this,a,t);
3048var i=this.getHtmlElement();
3049if(this._iFrameId!=null){
3050var e=document.getElementById(this._iFrameId);
3051e.width=i.style.width;
3052e.height=i.style.height
3053}else{
3054var o=document.getElementById(this._textAreaId);
3055o.style.width=i.style.width;
3056o.style.height=i.style.height
3057}};
3058DwtHtmlEditor.prototype.getIframe=function(){
3059return document.getElementById(this._iFrameId)
3060};
3061DwtHtmlEditor.prototype.getInputElement=function(){
3062var e=(this._mode==DwtHtmlEditor.HTML)?this._iFrameId:this._textAreaId;
3063return document.getElementById(e)
3064};
3065DwtHtmlEditor.prototype._initialize=function(){
3066if(this._mode==DwtHtmlEditor.HTML){
3067this._initHtmlMode(this._pendingContent)
3068}else{
3069this._initTextMode()
3070}};
3071DwtHtmlEditor.prototype.TEXTAREA_CLASSNAME="DwtHtmlEditorTextArea";
3072DwtHtmlEditor.prototype._initTextMode=function(t){
3073var e=this.getHtmlElement();
3074this._textAreaId="textarea_"+Dwt.getNextId();
3075var a=document.createElement("textarea");
3076a.className=this.TEXTAREA_CLASSNAME;
3077a.id=this._textAreaId;
3078e.appendChild(a);
3079if(!t){
3080a.value=this._pendingContent;
3081this._pendingContent=null
3082}
3083return a
3084};
3085DwtHtmlEditor.prototype._initHtmlMode=function(a){
3086this._pendingContent=a||"";
3087this._keyEvent=new DwtKeyEvent();
3088this._stateEvent=new DwtHtmlEditorStateEvent();
3089this._stateEvent.dwtObj=this;
3090this._updateStateAction=new AjxTimedAction(this,this._updateState);
3091var i=this.getHtmlElement();
3092this._iFrameId="iframe_"+Dwt.getNextId();
3093var t=document.createElement("iframe");
3094t.id=this._iFrameId;
3095t.className="DwtHtmlEditorIFrame";
3096t.setAttribute("border","0",false);
3097t.setAttribute("frameborder","0",false);
3098t.setAttribute("vspace","0",false);
3099t.setAttribute("autocomplete","off",false);
3100var e=AjxCallback.simpleClosure(this._finishHtmlModeInit,this);
3101setTimeout(e,DwtHtmlEditor._INITDELAY);
3102t.src=this._blankIframeSrc||"";
3103i.appendChild(t);
3104return t
3105};
3106DwtHtmlEditor.prototype._finishHtmlModeInit=function(){
3107var a=this._getIframeDoc();
3108try{
3109if(AjxEnv.isSafari&&a.body==null){
3110a.open();
3111a.write("<html><head></head><body></body></html>");
3112a.close()
3113}}
3114catch(t){
3115return
3116}
3117if(AjxEnv.isGeckoBased){
3118a.open();
3119a.write(DwtHtmlEditor.INIT_HTML);
3120a.close()
3121}
3122function e(i){
3123this._enableDesignMode(i);
3124this._setContentOnTimer();
3125this._updateState();
3126this._htmlModeInited=true;
3127this._registerEditorEventHandlers(document.getElementById(this._iFrameId),i)
3128}
3129if(AjxEnv.isIE||AjxEnv.isChrome){
3130setTimeout(AjxCallback.simpleClosure(e,this,a),DwtHtmlEditor._INITDELAY)
3131}else{
3132e.call(this,a)
3133}};
3134DwtHtmlEditor.prototype._focus=function(){
3135this.focus()
3136};
3137DwtHtmlEditor.prototype._getIframeDoc=function(){
3138return this._iFrameId?Dwt.getIframeDoc(document.getElementById(this._iFrameId)):null
3139};
3140DwtHtmlEditor.prototype._getIframeWin=function(){
3141return Dwt.getIframeWindow(document.getElementById(this._iFrameId))
3142};
3143DwtHtmlEditor.prototype._getParentElement=function(){
3144if(AjxEnv.isIE){
3145var n=this._getIframeDoc();
3146var a=n.selection;
3147var t=a.createRange();
3148if(a.type=="None"||a.type=="Text"){
3149return a.createRange().parentElement()
3150}
3151if(a.type=="Control"){
3152return a.createRange().item(0)
3153}
3154return n.body
3155}else{
3156try{
3157var t=this._getRange();
3158var o=t.commonAncestorContainer;
3159if(!t.collapsed&&t.startContainer==t.endContainer&&t.startOffset-t.endOffset<=1&&t.startContainer.hasChildNodes()){
3160o=t.startContainer.childNodes[t.startOffset]
3161}
3162while(o.nodeType==3){
3163o=o.parentNode
3164}
3165return o
3166}
3167catch(i){
3168return null
3169}}};
3170DwtHtmlEditor.prototype.getNearestElement=function(t){
3171try{
3172var a=this._getParentElement();
3173t=t.toLowerCase();
3174while(a&&a.nodeName.toLowerCase()!=t){
3175a=a.parentNode
3176}
3177return a
3178}
3179catch(e){
3180return null
3181}};
3182DwtHtmlEditor.prototype.selectNodeContents=function(a,n,e){
3183var t;
3184var o=(typeof n=="boolean");
3185if(AjxEnv.isIE){
3186t=this._getIframeDoc().body.createTextRange();
3187t.moveToElementText(a);
3188(o)&&t.collapse(n);
3189t.select()
3190}else{
3191var i=this._getSelection();
3192t=this._getIframeDoc().createRange();
3193if(e){
3194t.selectNode(a)
3195}else{
3196t.selectNodeContents(a)
3197}
3198(o)&&t.collapse(n);
3199i.removeAllRanges();
3200i.addRange(t)
3201}};
3202DwtHtmlEditor.prototype._forceRedraw=function(){
3203var e=this._getIframeDoc().body;
3204e.style.display="none";
3205var t=this;
3206setTimeout(function(){
3207e.style.display="";
3208t.focus();
3209t=null
3210}
3211,10)
3212};
3213DwtHtmlEditor.prototype.getSelectedCells=function(){
3214var l=null;
3215var e=this._getSelection();
3216var s,n=0;
3217var a=1000;
3218var d=[];
3219var c=null;
3220if(!AjxEnv.isIE){
3221try{
3222for(n=0;
3223s=e.getRangeAt(n)&&n<a;
3224n++){
3225var t=s.startContainer.childNodes[s.startOffset];
3226if(t){
3227if(t.parentNode!=c){
3228c=t.parentNode;
3229l&&d.push(l);
3230l=[]
3231}
3232if(t.tagName&&/^td$/i.test(t.tagName)){
3233l.push(t)
3234}}}}
3235catch(h){}
3236d.push(l)
3237}else{
3238s=e.createRange();
3239var o=s.duplicate();
3240s.collapse(true);
3241for(n=0;
3242o.compareEndPoints("EndToStart",s)>=0&&n<a;
3243n++){
3244var t=s.parentElement();
3245while(t&&t.nodeName.toLowerCase()!="td"){
3246t=t.parentNode
3247}
3248if(t){
3249if(t.parentNode!=c){
3250c=t.parentNode;
3251l&&d.push(l);
3252l=[]
3253}
3254l.push(t);
3255s.moveToElementText(t);
3256s.collapse(false)
3257}
3258if(s.move("character",1)==0){
3259break
3260}}
3261o.select();
3262d.push(l)
3263}
3264if(d.length==0||!d[0]||d[0].length==0){
3265l=this.getNearestElement("td");
3266if(l){
3267d=[[l]]
3268}}
3269return d
3270};
3271DwtHtmlEditor.prototype._splitCells=function(n){
3272var i=n;
3273while(i&&i.nodeName.toLowerCase()!="table"){
3274i=i.parentNode
3275}
3276var e=AjxEnv.isGeckoBased?"<br />":"";
3277function t(m){
3278var u=m.rowSpan;
3279var d=m.colSpan;
3280m.rowSpan=1;
3281tr=m.parentNode;
3282var l=tr.rowIndex;
3283var s=tr.parentNode.rows;
3284var h=m.cellIndex;
3285while(--u>0){
3286tr=s[++l];
3287var c=m.cloneNode(false);
3288c.removeAttribute("rowspan");
3289c.colSpan=m.colSpan;
3290c.innerHTML=e;
3291tr.insertBefore(c,tr.cells[h])
3292}}
3293function o(c){
3294var l=c.colSpan;
3295c.colSpan=1;
3296tr=c.parentNode;
3297var h=c.nextSibling;
3298while(--l>0){
3299var s=c.cloneNode(false);
3300s.removeAttribute("colspan");
3301s.rowSpan=c.rowSpan;
3302s.innerHTML=e;
3303tr.insertBefore(s,h)
3304}}
3305function a(c){
3306var l=c.colSpan;
3307o(c);
3308var s=c.parentNode.cells;
3309var h=c.cellIndex;
3310while(l-->0){
3311t(s[h++])
3312}}
3313a(n)
3314};
3315DwtHtmlEditor.prototype.doTableOperation=function(e,a){
3316var d=a.table||this.getNearestElement("table");
3317var t=a.td||this.getNearestElement("td");
3318var l,c,h;
3319if(t){
3320l=t.cellIndex;
3321h=t.parentNode;
3322c=h.rowIndex
3323}else{
3324l=0;
3325h=this.getNearestElement("tr");
3326if(h){
3327c=h.rowIndex
3328}}
3329var u=a.cells;
3330while(true){
3331switch(e){
3332case"insertRowAbove":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t));
3333break;
3334case"insertRowUnder":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t,true));
3335break;
3336case"insertColumnBefore":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t));
3337break;
3338case"insertColumnAfter":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t,true));
3339break;
3340case"deleteRow":for(var n=0;
3341n<u.length;
3342++n){
3343var t=DwtHtmlEditor.table_deleteRow(u[n][0]);
3344if(t){
3345this.selectNodeContents(t,true);
3346this.focus()
3347}}
3348break;
3349case"deleteColumn":for(var n=0;
3350n<u[0].length;
3351++n){
3352var t=DwtHtmlEditor.table_deleteCol(u[0][n]);
3353if(t){
3354this.selectNodeContents(t,true);
3355this.focus()
3356}}
3357break;
3358case"mergeCells":t=u[0][0];
3359var s=[t.innerHTML.replace(/<br>$/i,"")];
3360for(var n=0;
3361n<u.length;
3362++n){
3363var m=u[n];
3364for(var o=0;
3365o<m.length;
3366++o){
3367if(n||o){
3368s.push(m[o].innerHTML.replace(/<br>$/i,""));
3369m[o].parentNode.removeChild(m[o])
3370}}}
3371t.colSpan=u[0].length;
3372t.rowSpan=u.length;
3373s=s.join(" ");
3374if(AjxEnv.isGeckoBased){
3375s+="<br/>"
3376}
3377t.innerHTML=s;
3378this.selectNodeContents(t,true);
3379break;
3380case"splitCells":this._splitCells(t);
3381break;
3382case"deleteTable":if(!AjxEnv.isIE){
3383this.selectNodeContents(d,null,true);
3384this.deleteSelectedNodes()
3385}else{
3386d.parentNode.removeChild(d)
3387}
3388break
3389}
3390break
3391}
3392if(AjxEnv.isGeckoBased){
3393this._forceRedraw()
3394}
3395this._updateState()
3396};
3397DwtHtmlEditor.prototype._getRange=function(){
3398var i=this._getIframeDoc();
3399if(AjxEnv.isIE){
3400return i.selection
3401}else{
3402this.focus();
3403var t=this._getIframeWin().getSelection();
3404if(t!=null){
3405try{
3406return t.getRangeAt(0)
3407}
3408catch(a){
3409return i.createRange()
3410}}else{
3411return i.createRange()
3412}}};
3413DwtHtmlEditor.prototype._createRange=function(t){
3414var i=this._getIframeDoc();
3415if(AjxEnv.isIE){
3416return t.createRange()
3417}else{
3418this.focus();
3419if(t!=null){
3420try{
3421return t.getRangeAt(0)
3422}
3423catch(a){
3424return i.createRange()
3425}}else{
3426return i.createRange()
3427}}};
3428DwtHtmlEditor.prototype.deleteSelectedNodes=function(){
3429var e=this._getSelection();
3430if(AjxEnv.isGeckoBased){
3431e.deleteFromDocument()
3432}else{
3433e.clear()
3434}};
3435DwtHtmlEditor.prototype._getSelection=function(){
3436if(AjxEnv.isIE){
3437return this._getIframeDoc().selection
3438}else{
3439return this._getIframeWin().getSelection()
3440}};
3441DwtHtmlEditor.prototype.__eventClosure=function(e){
3442return this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e)
3443};
3444DwtHtmlEditor.prototype._registerEditorEventHandlers=function(e,o){
3445var a=["mouseup","drag","mousedown","keydown"];
3446if(!AjxEnv.isIE7up){
3447a.push("keypress")
3448}
3449for(var t=0;
3450t<a.length;
3451++t){
3452this._registerEditorEventHandler(o,a[t])
3453}};
3454DwtHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
3455if(AjxEnv.isIE){
3456t.attachEvent("on"+e,this.__eventClosure)
3457}else{
3458t.addEventListener(e,this.__eventClosure,true)
3459}};
3460DwtHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
3461if(AjxEnv.isIE){
3462t.detachEvent("on"+e,this.__eventClosure)
3463}else{
3464t.removeEventListener(e,this.__eventClosure,true)
3465}};
3466DwtHtmlEditor.prototype._handleEditorEvent=function(d){
3467var i=true;
3468if(d.type=="mousedown"){
3469DwtMenu._outsideMouseDownListener(d)
3470}
3471if(d.type=="mouseup"){
3472var t=DwtShell.getShell(window).getKeyboardMgr();
3473if(AjxEnv.isIE){
3474t.__focusObj=this
3475}else{
3476t.grabFocus(this)
3477}}
3478if(d.type=="contextmenu"){
3479var m=DwtShell.mouseEvent;
3480m.setFromDhtmlEvent(d);
3481var c=Dwt.getLocation(document.getElementById(this._iFrameId));
3482if(!AjxEnv.isIE){
3483var u=this._getIframeDoc();
3484var n=u.documentElement.scrollLeft||u.body.scrollLeft;
3485var p=u.documentElement.scrollTop||u.body.scrollTop;
3486c.x-=n;
3487c.y-=p
3488}
3489m.docX+=c.x;
3490m.docY+=c.y;
3491DwtControl.__mouseEvent(d,DwtEvent.ONCONTEXTMENU,this,m);
3492i=m._returnValue
3493}
3494var o=null;
3495if(DwtKeyEvent.isKeyPressEvent(d)){
3496var h=this._keyEvent;
3497h.setFromDhtmlEvent(d);
3498if(AjxEnv.isGeckoBased&&d.keyCode==13){
3499this._stateEvent._ignoreCommandState=true;
3500var e=this._getRange(),a=e.startContainer,l=/^h[1-6]$/i;
3501if((a.nodeType==3&&l.test(a.parentNode.tagName))||l.test(a.tagName)){
3502var f=this;
3503setTimeout(function(){
3504var y=f._getIframeDoc();
3505y.body.style.display="none";
3506y.body.style.display="";
3507var g=f._getSelection();
3508g.removeAllRanges();
3509g.addRange(e)
3510}
3511,5)
3512}}}
3513if(d.type=="keydown"){
3514if(d.keyCode==9){
3515if(AjxEnv.isIE){
3516this._handleIETabKey(!d.shiftKey);
3517h._stopPropagation=true;
3518h._returnValue=false;
3519h.setToDhtmlEvent(d);
3520i=false
3521}}else{
3522if(DwtKeyboardMgr.isPossibleInputShortcut(d)){
3523i=DwtKeyboardMgr.__keyDownHdlr(d)
3524}}}
3525if(AjxEnv.isIE){
3526var s=this._getIframeDoc();
3527this._currInsPt=s.selection.createRange();
3528if(s.selection.type=="None"){
3529this._currInsPt.collapse(false)
3530}}
3531if(this._stateUpdateActionId!=null){
3532AjxTimedAction.cancelAction(this._stateUpdateActionId)
3533}
3534this._stateUpdateActionId=AjxTimedAction.scheduleAction(this._updateStateAction,100);
3535if(window.DwtIdleTimer){
3536DwtIdleTimer.resetIdle()
3537}
3538return i
3539};
3540DwtHtmlEditor.prototype.getKeyMapName=function(){
3541return"DwtHtmlEditor"
3542};
3543DwtHtmlEditor.prototype.handleKeyAction=function(t,a){
3544var o="",i="";
3545if(t==DwtKeyMap.SWITCH_MODE){
3546try{
3547this.setMode((this._mode==DwtHtmlEditor.HTML)?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML,true)
3548}
3549catch(n){}}else{
3550if(t.indexOf("Header")==0){
3551o=DwtHtmlEditor._FORMAT_BLOCK;
3552i=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
3553}else{
3554o=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
3555}}
3556if(o){
3557this._execCommand(o,i);
3558return true
3559}
3560return false
3561};
3562DwtHtmlEditor.prototype._handleIETabKey=function(n){
3563var l=this._getIframeDoc();
3564var i=this._getParentElement();
3565var c=i.parentNode;
3566var d=i.tagName.toLowerCase();
3567if(d=="p"||d=="body"){
3568if(n){
3569this._insertHTML("&nbsp;&nbsp;&nbsp;")
3570}}else{
3571if(d=="li"){
3572this._execCommand((n)?"Indent":"Outdent","")
3573}else{
3574try{
3575var t=this._getAllAncestors();
3576var s=this._locateNode(t,"td");
3577if(s!=null){
3578i=s;
3579c=i.parentNode;
3580d=i.tagName.toLowerCase();
3581if(d=="td"){
3582var e=(n?i.nextSibling:i.previousSibling);
3583if(e!=null){
3584this._setCursor(e)
3585}else{
3586e=(n)?c.nextSibling:c.previousSibling;
3587if(e==null){
3588if(!n){
3589return
3590}
3591DwtHtmlEditor.table_insertRow(i,n);
3592e=c.nextSibling
3593}
3594if(e!=null){
3595var o=e.childNodes;
3596if(o!=null&&o.length>0){
3597var a=(n)?(0):(o.length-1);
3598this._setCursor(o[a])
3599}}}}}}
3600catch(h){}}}};
3601DwtHtmlEditor.prototype._setCursor=function(a){
3602var n=this._getIframeDoc();
3603var e=n.body;
3604var t;
3605if(AjxEnv.isIE){
3606t=e.createTextRange();
3607t.moveToElementText(a);
3608t.collapse(0);
3609t.select()
3610}else{
3611t=n.createRange();
3612t.selectNodeContents(a);
3613t.collapse(false);
3614var o=this._getIframeWin().contentWindow;
3615var i=o.getSelection();
3616i.addRange(t);
3617i.collapseToEnd()
3618}};
3619DwtHtmlEditor.prototype._locateNode=function(t,e){
3620if(t&&e){
3621for(var a=0;
3622a<t.length;
3623a++){
3624if(t[a].tagName.toLowerCase()==e.toLowerCase()){
3625return t[a]
3626}}}
3627return null
3628};
3629DwtHtmlEditor.prototype._getAllAncestors=function(){
3630var a=this._getParentElement();
3631var e=[];
3632while(a&&(a.nodeType==1)&&(a.tagName.toLowerCase()!="body")){
3633e.push(a);
3634a=a.parentNode
3635}
3636var t=this._getIframeDoc();
3637if(t.body!=null){
3638e.push(t.body)
3639}
3640return e
3641};
3642DwtHtmlEditor.prototype._updateState=function(){
3643if(this._mode!=DwtHtmlEditor.HTML){
3644return
3645}
3646this._stateUpdateActionId=null;
3647var a=this._stateEvent;
3648if(!a._ignoreCommandState){
3649a.reset()
3650}
3651var o=this._getIframeDoc();
3652try{
3653if(!a._ignoreCommandState){
3654a.isBold=o.queryCommandState(DwtHtmlEditor.BOLD_STYLE);
3655a.isItalic=o.queryCommandState(DwtHtmlEditor.ITALIC_STYLE);
3656a.isUnderline=o.queryCommandState(DwtHtmlEditor.UNDERLINE_STYLE);
3657a.isStrikeThru=o.queryCommandState(DwtHtmlEditor.STRIKETHRU_STYLE);
3658a.isSuperscript=o.queryCommandState(DwtHtmlEditor.SUPERSCRIPT_STYLE);
3659a.isSubscript=o.queryCommandState(DwtHtmlEditor.SUBSCRIPT_STYLE);
3660a.isOrderedList=o.queryCommandState(DwtHtmlEditor.ORDERED_LIST);
3661a.isUnorderedList=o.queryCommandState(DwtHtmlEditor.UNORDERED_LIST)
3662}else{
3663a._ignoreCommandState=null
3664}
3665a.fontFamily=o.queryCommandValue(DwtHtmlEditor._FONT_NAME);
3666var i=o.queryCommandValue(DwtHtmlEditor._FONT_SIZE);
3667if(i==""){
3668i=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE))+1)
3669}else{
3670if(/\d+px/.test(i)){
3671i=Math.ceil(0.75*parseInt(i))+"pt"
3672}}
3673if(/\d+pt/.test(i)){
3674i=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(i)+1)
3675}
3676a.fontSize=i;
3677a.backgroundColor=o.queryCommandValue((AjxEnv.isIE)?"backcolor":"hilitecolor");
3678a.color=o.queryCommandValue("forecolor");
3679if(AjxEnv.isIE){
3680a.backgroundColor="#"+DwtButtonColorPicker.toHex(a.backgroundColor,6).replace(/(..)(..)(..)/,"$3$2$1");
3681a.color="#"+DwtButtonColorPicker.toHex(a.color,6).replace(/(..)(..)(..)/,"$3$2$1")
3682}
3683a.justification=null;
3684a.direction=null;
3685var t=o.queryCommandValue(DwtHtmlEditor._FORMAT_BLOCK);
3686if(t){
3687if(t.search(DwtHtmlEditor._H1_RE)!=-1){
3688a.style=DwtHtmlEditor.H1
3689}else{
3690if(t.search(DwtHtmlEditor._H2_RE)!=-1){
3691a.style=DwtHtmlEditor.H2
3692}else{
3693if(t.search(DwtHtmlEditor._H3_RE)!=-1){
3694a.style=DwtHtmlEditor.H3
3695}else{
3696if(t.search(DwtHtmlEditor._H4_RE)!=-1){
3697a.style=DwtHtmlEditor.H4
3698}else{
3699if(t.search(DwtHtmlEditor._H5_RE)!=-1){
3700a.style=DwtHtmlEditor.H5
3701}else{
3702if(t.search(DwtHtmlEditor._H6_RE)!=-1){
3703a.style=DwtHtmlEditor.H6
3704}else{
3705if(t.search(DwtHtmlEditor._PARAGRAPH_RE)!=-1){
3706a.style=DwtHtmlEditor.PARAGRAPH
3707}else{
3708if(t.search(DwtHtmlEditor._ADDRESS_RE)!=-1){
3709a.style=DwtHtmlEditor.ADDRESS
3710}else{
3711if(t.search(DwtHtmlEditor._PREFORMATTED_RE)!=-1){
3712a.style=DwtHtmlEditor.PREFORMATTED
3713}}}}}}}}}}
3714if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_LEFT)){
3715a.justification=DwtHtmlEditor.JUSTIFY_LEFT
3716}else{
3717if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_CENTER)){
3718a.justification=DwtHtmlEditor.JUSTIFY_CENTER
3719}else{
3720if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_RIGHT)){
3721a.justification=DwtHtmlEditor.JUSTIFY_RIGHT
3722}else{
3723if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_FULL)){
3724a.justification=DwtHtmlEditor.JUSTIFY_FULL
3725}}}}
3726if(this.isListenerRegistered(DwtEvent.STATE_CHANGE)){
3727this.notifyListeners(DwtEvent.STATE_CHANGE,a)
3728}}
3729catch(e){
3730if(AjxEnv.isGeckoBased){
3731this._enableDesignMode(o)
3732}}};
3733DwtHtmlEditor.prototype._enableDesignMode=function(a){
3734if(!a){
3735return
3736}
3737try{
3738Dwt.enableDesignMode(a,true);
3739if(AjxEnv.isGeckoBased&&(AjxEnv.isLinux||AjxEnv.isMac)){
3740this._registerEditorEventHandlers(document.getElementById(this._iFrameId),a)
3741}}
3742catch(t){
3743if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
3744var e=new AjxTimedAction(this,this._enableDesignMode,[a]);
3745AjxTimedAction.scheduleAction(e,10);
3746return true
3747}else{
3748return false
3749}}};
3750DwtHtmlEditor.prototype._onContentInitialized=function(){
3751this._pendingContent=null
3752};
3753DwtHtmlEditor.prototype._setContentOnTimer=function(){
3754var a=this._getIframeDoc();
3755try{
3756if(this._pendingContent!=null){
3757a.body.innerHTML=this._pendingContent
3758}
3759if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
3760this._enableDesignMode(a)
3761}
3762this._onContentInitialized()
3763}
3764catch(t){
3765var e=new AjxTimedAction(this,this._setContentOnTimer);
3766AjxTimedAction.scheduleAction(e,10);
3767return true
3768}};
3769DwtHtmlEditor.prototype._execCommand=function(i,t){
3770if(this._mode!=DwtHtmlEditor.HTML){
3771return
3772}
3773try{
3774this.focus();
3775this._getIframeDoc().execCommand(i,false,t)
3776}
3777catch(a){
3778this._enableDesignMode(this._getIframeDoc())
3779}
3780this._updateState()
3781};
3782DwtHtmlEditor.prototype._convertHtml2Text=function(e){
3783var t=this._getIframeDoc();
3784return(t&&t.body)?AjxStringUtil.convertHtml2Text(t.body,e):""
3785};
3786DwtHtmlEditor.prototype.insertLink=function(o){
3787var d=this._getIframeDoc();
3788var h=(AjxEnv.isIE&&d&&d.body)?(d.body.innerHTML):"";
3789if(AjxEnv.isIE&&h==""){
3790var c=d.createElement("a");
3791c.href=o.url;
3792if(o.title){
3793c.title=o.title
3794}
3795var s=d.createTextNode(o.text);
3796c.appendChild(s);
3797d.body.appendChild(c);
3798return c
3799}else{
3800var e="javascript:"+Dwt.getNextId();
3801if(AjxEnv.isIE){
3802var t=this._getIframeDoc().createElement("a");
3803t.href=e;
3804if(o.text){
3805t.innerHTML=o.text
3806}
3807this._insertNodeAtSelection(t,false);
3808this.selectNodeContents(t)
3809}else{
3810if(o.text){
3811this.insertText(o.text,true)
3812}
3813this._execCommand("createlink",e)
3814}
3815var c=d.getElementsByTagName("a");
3816var l;
3817for(var n=c.length;
3818--n>=0;
3819){
3820if(c[n].href==e){
3821l=c[n];
3822break
3823}}
3824if(l){
3825l.href=o.url;
3826if(o.title){
3827l.title=o.title
3828}}
3829return l
3830}};
3831DwtHtmlEditor.prototype.getLinkProps=function(){
3832var e=this.getNearestElement("a");
3833if(e){
3834this.selectNodeContents(e)
3835}
3836var t=this._getRange();
3837var i={
3838text:AjxEnv.isIE?t.text:t.toString()};
3839if(e){
3840i.url=e.href;
3841i.title=e.title
3842}
3843return i
3844};
3845DwtHtmlEditor.table_analyzeCells=function(c){
3846var d=c.parentNode.parentNode;
3847while(d&&!/table/i.test(d.tagName)){
3848d=d.parentNode
3849}
3850var l={};
3851var m=d.rows;
3852for(var n=0;
3853n<m.length;
3854++n){
3855var u=m[n].cells;
3856var h=0;
3857for(var a=0;
3858a<u.length;
3859){
3860var e=u[a];
3861var s=e.colSpan||1;
3862var t=(e.rowSpan||1)-1;
3863var o=l[h];
3864if(o){
3865if(--o.rs==0){
3866l[h]=null
3867}
3868h+=o.cs
3869}
3870e.ZmIndex=h;
3871if(++a<u.length){
3872if(t){
3873l[h]={
3874cs:s,rs:t}
3875}
3876h+=s
3877}}}
3878return d
3879};
3880DwtHtmlEditor.table_getCellAt=function(h,s){
3881var c=h.cells;
3882var l=null,o=null;
3883for(var a=0;
3884a<c.length;
3885++a){
3886var e=c[a];
3887var n=(e.colSpan||1)-1;
3888if(e.ZmIndex<=s&&e.ZmIndex+n>=s){
3889var t=(e.rowSpan||1)-1;
3890return{
3891td:e,cs:n,rs:t}
3892}else{
3893if(e.ZmIndex<s){
3894l=e
3895}else{
3896if(e.ZmIndex+n>s&&!o){
3897o=e
3898}}}}
3899return{
3900last:l,next:o}
3901};
3902DwtHtmlEditor.table_getPrevCellAt=function(n,e){
3903var a=n.parentNode;
3904while(a&&!/table/i.test(a.tagName)){
3905a=a.parentNode
3906}
3907var o=a.rows;
3908for(var t=n.rowIndex;
3909--t>=0;
3910){
3911var s=DwtHtmlEditor.table_getCellAt(o[t],e);
3912if(s.td){
3913s.dist=n.rowIndex-t;
3914return s
3915}}
3916return null
3917};
3918DwtHtmlEditor.table_fixCells=function(e){
3919for(var t=0;
3920t<e.length;
3921++t){
3922var a=e[t];
3923if(AjxEnv.isIE){
3924a.innerHTML="&nbsp;"
3925}else{
3926if(AjxEnv.isGeckoBased){
3927a.innerHTML="<br/>"
3928}}}};
3929DwtHtmlEditor.table_insertCol=function(n,t){
3930var u=DwtHtmlEditor.table_analyzeCells(n);
3931var m=u.rows;
3932var c=n.ZmIndex;
3933if(t){
3934c+=n.colSpan-1
3935}
3936var l=[];
3937var s=0;
3938for(var h=0;
3939h<m.length;
3940++h){
3941var d=m[h];
3942var a=DwtHtmlEditor.table_getCellAt(d,c);
3943var o=a.td;
3944var e=null;
3945if(o){
3946if(o.ZmIndex==c&&!t){
3947e=d.insertCell(o.cellIndex)
3948}else{
3949if(o.ZmIndex+a.cs==c&&t){
3950e=d.insertCell(o.cellIndex+1)
3951}}
3952if(e){
3953s=a.rs
3954}else{
3955o.colSpan=a.cs+2
3956}}else{
3957if(s>0){
3958if(a.last){
3959e=d.insertCell(a.last.cellIndex+1)
3960}else{
3961if(a.next){
3962e=d.insertCell(a.next.cellIndex)
3963}}
3964--s
3965}}
3966if(e){
3967l.push(e)
3968}}
3969return l
3970};
3971DwtHtmlEditor.table_insertRow=function(o,t){
3972var c=o.parentNode;
3973var f=DwtHtmlEditor.table_analyzeCells(o);
3974var l=c.rowIndex;
3975if(t){
3976l+=o.rowSpan;
3977c=f.rows[l-1]
3978}
3979o=f.rows[0].cells[f.rows[0].cells.length-1];
3980var d=o.ZmIndex+o.colSpan;
3981var u=f.insertRow(l);
3982var h=[];
3983var m=c.cells;
3984var e;
3985for(var s=0;
3986s<d;
3987++s){
3988var a=DwtHtmlEditor.table_getCellAt(c,s);
3989if(a.td){
3990if(!t||!a.rs){
3991for(var n=0;
3992n<=a.cs;
3993++n){
3994h.push(u.insertCell(-1))
3995}}else{
3996if(a.rs){
3997a.td.rowSpan=a.rs+2
3998}}}else{
3999a=DwtHtmlEditor.table_getPrevCellAt(c,s);
4000if(t&&a.rs==a.dist){
4001for(var n=0;
4002n<=a.cs;
4003++n){
4004h.push(u.insertCell(-1))
4005}}else{
4006a.td.rowSpan=a.rs+2
4007}}
4008s+=a.cs
4009}
4010return h
4011};
4012DwtHtmlEditor.table_deleteCol=function(a){
4013if(!a){
4014return
4015}
4016var c=DwtHtmlEditor.table_analyzeCells(a);
4017var d=c.rows;
4018var n=a.ZmIndex;
4019var l=a.parentNode;
4020var s;
4021try{
4022s=l.cells[a.cellIndex+1];
4023if(!s){
4024s=l.cells[a.cellIndex-1]
4025}}
4026catch(h){
4027s=null
4028}
4029var e=[];
4030for(var o=0;
4031o<d.length;
4032++o){
4033var l=d[o];
4034var t=DwtHtmlEditor.table_getCellAt(l,n);
4035if(t.td){
4036if(t.cs){
4037t.td.colSpan=t.cs
4038}else{
4039l.removeChild(t.td);
4040if(l.cells.length==0){
4041e.push(l)
4042}}
4043o+=t.rs
4044}}
4045for(var o=e.length;
4046--o>=0;
4047){
4048l=e[o];
4049l.parentNode.removeChild(l)
4050}
4051if(c.rows.length==0){
4052c.parentNode.removeChild(c)
4053}
4054return s
4055};
4056DwtHtmlEditor.table_deleteRow=function(t){
4057if(!t){
4058return
4059}
4060var s=t.parentNode;
4061var c=DwtHtmlEditor.table_analyzeCells(t);
4062t=c.rows[0].cells[c.rows[0].cells.length-1];
4063var h=t.ZmIndex+t.colSpan;
4064var l;
4065for(var a=h;
4066--a>=0;
4067){
4068var e=DwtHtmlEditor.table_getCellAt(s,a);
4069if(e.td){
4070if(e.rs){
4071l=c.rows[s.rowIndex+1];
4072var o=DwtHtmlEditor.table_getCellAt(l,a);
4073t=null;
4074if(o.last){
4075t=l.insertCell(o.last.cellIndex+1)
4076}else{
4077if(o.next){
4078t=l.insertCell(o.next.cellIndex)
4079}}
4080if(t){
4081if(e.cs>0){
4082t.colSpan=e.cs+1
4083}
4084if(e.rs>1){
4085t.rowSpan=e.rs
4086}}}
4087s.removeChild(e.td)
4088}else{
4089e=DwtHtmlEditor.table_getPrevCellAt(s,a);
4090if(e){
4091if(e.rs){
4092e.td.rowSpan=e.rs;
4093a-=e.cs
4094}}}}
4095try{
4096l=c.rows[s.rowIndex+1];
4097if(!l){
4098l=c.rows[s.rowIndex-1]
4099}}
4100catch(n){
4101l=null
4102}
4103s.parentNode.removeChild(s);
4104if(c.rows.length==0){
4105c.parentNode.removeChild(c)
4106}
4107if(l){
4108return l.cells[0]
4109}};
4110DwtHtmlEditor.prototype.searchnReplace=function(a){
4111var o=this._getIframeWin();
4112o.focus();
4113var h=this._getIframeDoc();
4114var i=h.body;
4115var n=this._getSelectedText();
4116if(i.innerHTML==""){
4117return true
4118}
4119str1=a.searchstring;
4120str2=n;
4121if(a.replacemode=="current"){
4122str1=str1.toString();
4123str2=str2.toString();
4124if(!a.casesensitive){
4125str1=str1.toLowerCase();
4126str2=str2.toLowerCase()
4127}
4128if(str1==str2){
4129this.replaceSel(a.searchstring,a.replacestring);
4130a.replacemode="none"
4131}}
4132if(AjxEnv.isIE){
4133var e=this.lastSearchRng?this.lastSearchRng:this.range_findnreplace;
4134var t=0;
4135if(a.wholeword){
4136t=t|2
4137}
4138if(a.casesensitive){
4139t=t|4
4140}
4141if(!e.findText){
4142alert("This operation is currently not supported by this browser.");
4143return true
4144}
4145if(a.replacemode=="all"){
4146if(AjxEnv.isIE){
4147this.focus()
4148}
4149var s=new RegExp(a.searchstring,((a.casesensitive)?"":"i")+"g");
4150var l=this.replaceNodeContent(i,s,a.replacestring,"all",0);
4151return true
4152}
4153if(e.findText(a.searchstring,a.backwards?-1:1,t)){
4154e.scrollIntoView();
4155e.select();
4156e.collapse(a.backwards);
4157this.lastSearchRng=e;
4158if(AjxEnv.isIE&&(a.replacemode=="current")){
4159this.replaceSel(a.searchstring,a.replacestring)
4160}}else{
4161rng1=i.createTextRange();
4162rng1.findText(a.searchstring,a.backwards?-1:1,t);
4163rng1.scrollIntoView();
4164if(rng1.text.toLowerCase()==a.searchstring.toLowerCase()){
4165rng1.select()
4166}
4167rng1.collapse(false);
4168this.lastSearchRng=rng1;
4169if(AjxEnv.isIE&&(a.replacemode=="current")){
4170this.replaceSel(a.searchstring,a.replacestring)
4171}}}else{
4172if(a.replacemode=="all"){
4173var s=new RegExp(a.searchstring,(a.casesensitive?"":"i")+"g");
4174var l=this.replaceNodeContent(i,s,a.replacestring,"all",0);
4175return true
4176}
4177if(!o.find(a.searchstring,a.casesensitive,a.backwards,a.wrap,a.wholeword,false,false)){
4178while(o.find(a.searchstring,a.casesensitive,true,a.wrap,a.wholeword,false,false)){}}}};
4179DwtHtmlEditor.prototype.replaceSel=function(e,n){
4180if(n==null){
4181return
4182}
4183var o=this._getIframeWin();
4184var i=o.document;
4185var t;
4186if(!AjxEnv.isIE){
4187var a=o.getSelection();
4188t=a.getRangeAt(0)
4189}else{
4190t=o.document.selection.createRange()
4191}
4192if(!AjxEnv.isIE){
4193if(n.indexOf(e)==-1){
4194t.deleteContents();
4195t.insertNode(t.createContextualFragment(n));
4196t.collapse(false)
4197}}else{
4198if(t.item){
4199t.item(0).outerHTML=n
4200}else{
4201t.pasteHTML(n)
4202}}};
4203DwtHtmlEditor.prototype._getSelectedText=function(){
4204var a=this._getIframeWin();
4205var t=this._getIframeDoc();
4206var e="";
4207if(a.getSelection){
4208e=a.getSelection()
4209}else{
4210if(t.getSelection){
4211e=t.getSelection()
4212}else{
4213if(t.selection){
4214e=t.selection.createRange().text
4215}}}
4216return e
4217};
4218DwtHtmlEditor.prototype.replaceNodeContent=function(a,h,o,l,t){
4219for(var n=0;
4220n<a.childNodes.length;
4221n++){
4222var s=a.childNodes[n];
4223if(s.nodeType==3){
4224var e=s.nodeValue.replace(h,o);
4225if(s.nodeValue!=e){
4226s.nodeValue=e;
4227t++;
4228if(l!="all"){
4229return t
4230}}}
4231this.replaceNodeContent(s,h,o,l,t);
4232if((l!="all")&&(t>0)){
4233return t
4234}}
4235return t
4236}
4237}
4238if(AjxPackage.define("ajax.dwt.widgets.DwtPasswordField")){
4239DwtPasswordField=function(e){
4240if(arguments.length==0){
4241return
4242}
4243e=e||{
4244parent:DwtShell.getShell(window)};
4245e.type=DwtInputField.PASSWORD;
4246DwtInputField.call(this,e);
4247this._tabGroup=new DwtTabGroup(this._htmlElId);
4248this._createHtml()
4249};
4250DwtPasswordField.prototype=new DwtInputField;
4251DwtPasswordField.prototype.constructor=DwtPasswordField;
4252DwtPasswordField.prototype.TEMPLATE="dwt.Widgets#DwtPasswordField";
4253DwtPasswordField.prototype.getTabGroupMember=function(){
4254return this._tabGroup
4255};
4256DwtPasswordField.prototype.setShowPassword=function(e){
4257this._showCheckbox.setSelected(e);
4258this.setInputType(e?DwtInputField.STRING:DwtInputField.PASSWORD)
4259};
4260DwtPasswordField.prototype._createHtml=function(e){
4261var t={
4262id:this._htmlElId};
4263this._createHtmlFromTemplate(e||this.TEMPLATE,t)
4264};
4265DwtPasswordField.prototype._createHtmlFromTemplate=function(a,o){
4266this._tabGroup.removeAllMembers();
4267var e=document.createDocumentFragment();
4268var s=this.getHtmlElement().firstChild;
4269while(s){
4270var i=s.nextSibling;
4271e.appendChild(s);
4272s=i
4273}
4274DwtInputField.prototype._createHtmlFromTemplate.apply(this,arguments);
4275var n=document.getElementById(o.id+"_input");
4276n.appendChild(e);
4277this._tabGroup.addMember(this.getInputElement());
4278var t=document.getElementById(o.id+"_show_password");
4279if(t){
4280this._showCheckbox=new DwtCheckbox({
4281parent:this}
4282);
4283this._showCheckbox.setText(AjxMsg.showPassword);
4284this._showCheckbox.addSelectionListener(new AjxListener(this,this._handleShowCheckbox));
4285this._showCheckbox.replaceElement(t);
4286this._tabGroup.addMember(this._showCheckbox)
4287}};
4288DwtPasswordField.prototype._handleShowCheckbox=function(e){
4289this.setShowPassword(e.detail)
4290}
4291}
4292if(AjxPackage.define("ajax.dwt.widgets.DwtCalendar")){
4293DwtCalendar=function(e){
4294if(arguments.length==0){
4295return
4296}
4297e=Dwt.getParams(arguments,DwtCalendar.PARAMS);
4298e.className=e.className||"DwtCalendar";
4299DwtComposite.call(this,e);
4300this._skipNotifyOnPage=false;
4301this._hidePrevNextMo=e.hidePrevNextMo;
4302this._readOnly=e.readOnly;
4303this._showWeekNumber=e.showWeekNumber;
4304this._uuid=Dwt.getNextId();
4305var t=this._origDayClassName=e.className+"Day";
4306this._todayClassName=" "+e.className+"Day-today";
4307this._selectedDayClassName=" "+t+"-"+DwtCssStyle.SELECTED;
4308this._hoveredDayClassName=" "+t+"-"+DwtCssStyle.HOVER;
4309this._activeDayClassName=" "+t+"-"+DwtCssStyle.ACTIVE;
4310this._hiliteClassName=" "+t+"-hilited";
4311this._greyClassName=" "+t+"-grey";
4312if(!this._readOnly){
4313this._installListeners()
4314}
4315this._selectionMode=DwtCalendar.DAY;
4316this._init();
4317this._weekDays=new Array(7);
4318this._workingDays=e.workingDays||DwtCalendar._DEF_WORKING_DAYS;
4319this._useISO8601WeekNo=e.useISO8601WeekNo;
4320this.setFirstDayOfWeek(e.firstDayOfWeek||DwtCalendar.SUN);
4321this._forceRollOver=(e.forceRollOver!==false)
4322};
4323DwtCalendar.PARAMS=["parent","className","posStyle","firstDayOfWeek","forceRollOver","workingDaysArray","hidePrevNextMo","readOnly"];
4324DwtCalendar.prototype=new DwtComposite;
4325DwtCalendar.prototype.constructor=DwtCalendar;
4326DwtCalendar.SUN=0;
4327DwtCalendar.MON=1;
4328DwtCalendar.TUE=2;
4329DwtCalendar.WED=3;
4330DwtCalendar.THU=4;
4331DwtCalendar.FRI=5;
4332DwtCalendar.SAT=6;
4333DwtCalendar.DAY=1;
4334DwtCalendar.WEEK=2;
4335DwtCalendar.WORK_WEEK=3;
4336DwtCalendar.MONTH=4;
4337DwtCalendar.RANGE_CHANGE="DwtCalendar.RANGE_CHANGE";
4338DwtCalendar._FULL_WEEK=[1,1,1,1,1,1,1];
4339DwtCalendar._DEF_WORKING_DAYS=[0,1,1,1,1,1,0];
4340DwtCalendar._DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];
4341DwtCalendar._NO_MONTH=-2;
4342DwtCalendar._PREV_MONTH=-1;
4343DwtCalendar._THIS_MONTH=0;
4344DwtCalendar._NEXT_MONTH=1;
4345DwtCalendar._NORMAL=1;
4346DwtCalendar._HOVERED=2;
4347DwtCalendar._ACTIVE=3;
4348DwtCalendar._SELECTED=4;
4349DwtCalendar._DESELECTED=5;
4350DwtCalendar.DATE_SELECTED=1;
4351DwtCalendar.DATE_DESELECTED=2;
4352DwtCalendar.DATE_DBL_CLICKED=3;
4353DwtCalendar._LAST_DAY_CELL_IDX=41;
4354DwtCalendar._BUTTON_CLASS="DwtCalendarButton";
4355DwtCalendar._BUTTON_HOVERED_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.HOVER;
4356DwtCalendar._BUTTON_ACTIVE_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.ACTIVE;
4357DwtCalendar._TITLE_CLASS="DwtCalendarTitle";
4358DwtCalendar._TITLE_HOVERED_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.HOVER;
4359DwtCalendar._TITLE_ACTIVE_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.ACTIVE;
4360DwtCalendar.prototype.toString=function(){
4361return"DwtCalendar"
4362};
4363DwtCalendar.prototype.addSelectionListener=function(e){
4364this.addListener(DwtEvent.SELECTION,e)
4365};
4366DwtCalendar.prototype.removeSelectionListener=function(e){
4367this.removeListener(DwtEvent.SELECTION,e)
4368};
4369DwtCalendar.prototype.addActionListener=function(e){
4370this.addListener(DwtEvent.ACTION,e)
4371};
4372DwtCalendar.prototype.removeActionListener=function(e){
4373this.removeListener(DwtEvent.ACTION,e)
4374};
4375DwtCalendar.prototype.addDateRangeListener=function(e){
4376this.addListener(DwtEvent.DATE_RANGE,e)
4377};
4378DwtCalendar.prototype.removeDateRangeListener=function(e){
4379this.removeListener(DwtEvent.DATE_RANGE,e)
4380};
4381DwtCalendar.prototype.setSkipNotifyOnPage=function(e){
4382this._skipNotifyOnPage=e
4383};
4384DwtCalendar.prototype.getSkipNotifyOnPage=function(){
4385return this._skipNotifyOnPage
4386};
4387DwtCalendar.prototype.setDate=function(i,s,a,t){
4388a=(a==null)?this._forceRollOver:a;
4389var c=new Date(i.getTime());
4390var o=this._date;
4391var n=false;
4392var u=false;
4393var e;
4394if(this._date2CellId!=null){
4395var l=(c.getFullYear()*10000)+(c.getMonth()*100)+c.getDate();
4396var e=this._date2CellId[l];
4397if(e){
4398if(e==this._selectedCellId){
4399u=true
4400}
4401var d=document.getElementById(e);
4402if(d._dayType==DwtCalendar._THIS_MONTH){
4403u=true
4404}else{
4405if(a){
4406u=n=true
4407}else{
4408u=true
4409}}}else{
4410u=n=true
4411}}else{
4412u=n=true
4413}
4414if(u){
4415if(this._date){
4416if(AjxDateUtil.isDayShifted(c)){
4417AjxDateUtil.rollToNextDay(c)
4418}
4419c.setHours(this._date.getHours(),this._date.getMinutes(),this._date.getSeconds(),0)
4420}
4421this._date=c;
4422if(!n&&!this._readOnly){
4423this._setSelectedDate();
4424this._setToday()
4425}}
4426if(n){
4427this._layout()
4428}
4429if(u&&!s){
4430var h=t?DwtCalendar.DATE_DBL_CLICKED:DwtCalendar.DATE_SELECTED;
4431this._notifyListeners(DwtEvent.SELECTION,h,this._date)
4432}
4433return true
4434};
4435DwtCalendar.prototype.isSelected=function(t){
4436if(t==this._selectedDayElId){
4437return true
4438}else{
4439if(this._selectionMode!=DwtCalendar.DAY){
4440var e=this._getDayCellIndex(t);
4441if(Math.floor(e/7)==Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)&&this._currWorkingDays[e%7]){
4442return true
4443}}}
4444return false
4445};
4446DwtCalendar.prototype.getForceRollOver=function(){
4447return this._forceRollOver
4448};
4449DwtCalendar.prototype.setForceRollOver=function(e){
4450if(e==null){
4451return
4452}
4453if(this._forceRollOver!=e){
4454this._forceRollOver=e;
4455this._layout()
4456}};
4457DwtCalendar.prototype.getSelectionMode=function(){
4458return this._selectionMode
4459};
4460DwtCalendar.prototype.setSelectionMode=function(e){
4461if(this._selectionMode==e){
4462return
4463}
4464this._selectionMode=e;
4465if(e==DwtCalendar.WEEK){
4466this._currWorkingDays=DwtCalendar._FULL_WEEK
4467}else{
4468if(e==DwtCalendar.WORK_WEEK){
4469this._currWorkingDays=this._workingDays
4470}}
4471this._layout()
4472};
4473DwtCalendar.prototype.setWorkingWeek=function(e){
4474this._workingDays=this._currWorkingDays=e;
4475if(this._selectionMode==DwtCalendar.WORK_WEEK){
4476this._layout()
4477}};
4478DwtCalendar.prototype.setHilite=function(s,a,t){
4479if(this._date2CellId==null){
4480return
4481}
4482var e;
4483var h;
4484if(t){
4485for(h in this._date2CellId){
4486e=document.getElementById(this._date2CellId[h]);
4487if(e._isHilited){
4488e._isHilited=false;
4489this._setClassName(e,DwtCalendar._NORMAL)
4490}}}
4491var n;
4492for(var o in s){
4493h=s[o];
4494n=this._date2CellId[h.getFullYear()*10000+h.getMonth()*100+h.getDate()];
4495if(n){
4496e=document.getElementById(n);
4497if(e._isHilited!=a){
4498e._isHilited=a;
4499this._setClassName(e,DwtCalendar._NORMAL)
4500}}}};
4501DwtCalendar.prototype.getDate=function(){
4502return this._date
4503};
4504DwtCalendar.prototype.setFirstDayOfWeek=function(e){
4505for(var a=0;
4506a<7;
4507a++){
4508this._weekDays[a]=(a<e)?(6-(e-a-1)):(a-e);
4509var t=document.getElementById(this._getDOWCellId(a));
4510t.innerHTML=AjxDateUtil.WEEKDAY_SHORT[(e+a)%7]
4511}
4512this._firstDayOfWeek=e;
4513this._layout()
4514};
4515DwtCalendar.prototype.getDateRange=function(){
4516return this._range
4517};
4518DwtCalendar.prototype._getDayCellId=function(e){
4519return("c:"+e+":"+this._uuid)
4520};
4521DwtCalendar.prototype._getDayCellIndex=function(e){
4522return e.substring(2,e.indexOf(":",3))
4523};
4524DwtCalendar.prototype._getDOWCellId=function(e){
4525return("w:"+e+":"+this._uuid)
4526};
4527DwtCalendar.prototype._getWeekNumberCellId=function(e){
4528return("k:"+e+":"+this._uuid)
4529};
4530DwtCalendar.prototype._getDaysInMonth=function(t,e){
4531if(t!=1){
4532return DwtCalendar._DAYS_IN_MONTH[t]
4533}
4534if(e%4!=0||(e%100==0&&e%400!=0)){
4535return 28
4536}
4537return 29
4538};
4539DwtCalendar.prototype._installListeners=function(){
4540this._setMouseEventHdlrs();
4541this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
4542this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
4543this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
4544this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
4545this.addListener(DwtEvent.ONDBLCLICK,new AjxListener(this,this._doubleClickListener))
4546};
4547DwtCalendar.prototype._notifyListeners=function(e,a,t,i){
4548if(!this.isListenerRegistered(e)){
4549return
4550}
4551var o=DwtShell.selectionEvent;
4552if(i){
4553DwtUiEvent.copy(o,i)
4554}else{
4555o.reset()
4556}
4557o.item=this;
4558o.detail=t;
4559o.type=a;
4560this.notifyListeners(e,o)
4561};
4562DwtCalendar.prototype._layout=function(){
4563if(this._date==null){
4564return false
4565}
4566if(!this._calWidgetInited){
4567this._init()
4568}
4569var g=new Date(this._date.getTime());
4570g.setDate(1);
4571var s=g.getFullYear();
4572var y=g.getMonth();
4573var n=g.getDay();
4574var a=this._getDaysInMonth(y,s);
4575var c=1;
4576var b=1;
4577this._date2CellId=new Object();
4578this._selectedDayElId=null;
4579var o,u,w,p,e;
4580if(!this._hidePrevNextMo){
4581if(y!=0){
4582o=this._getDaysInMonth(y-1,s)-this._weekDays[n]+1;
4583u=s;
4584w=y-1;
4585if(y!=11){
4586p=y+1;
4587e=s
4588}else{
4589p=0;
4590e=s+1
4591}}else{
4592o=this._getDaysInMonth(11,s-1)-this._weekDays[n]+1;
4593u=s-1;
4594w=11;
4595p=1;
4596e=s
4597}}
4598for(var d=0;
4599d<6;
4600d++){
4601for(var l=0;
4602l<7;
4603l++){
4604var f=document.getElementById(this._getDayCellId(d*7+l));
4605if(f._isHilited==null){
4606f._isHilited=false
4607}
4608if(c<=a){
4609if(d!=0||l>=this._weekDays[n]){
4610this._date2CellId[(s*10000)+(y*100)+c]=f.id;
4611f._day=c;
4612f._month=y;
4613f._year=s;
4614f.innerHTML=c++;
4615f._dayType=DwtCalendar._THIS_MONTH;
4616if(this._readOnly){
4617f.style.fontFamily="Arial";
4618f.style.fontSize="10px"
4619}}else{
4620if(this._hidePrevNextMo){
4621f.innerHTML=""
4622}else{
4623this._date2CellId[(u*10000)+(w*100)+o]=f.id;
4624f._day=o;
4625f._month=w;
4626f._year=u;
4627f.innerHTML=o++;
4628f._dayType=DwtCalendar._PREV_MONTH
4629}}}else{
4630if(!this._hidePrevNextMo){
4631this._date2CellId[(e*10000)+(p*100)+b]=f.id;
4632f._day=b;
4633f._month=p;
4634f._year=e;
4635f.innerHTML=b++;
4636f._dayType=DwtCalendar._NEXT_MONTH
4637}}
4638this._setClassName(f,DwtCalendar._NORMAL)
4639}
4640if(this._showWeekNumber){
4641var h=this._getWeekNumberCellId("kw"+d*7);
4642var m=document.getElementById(h);
4643if(m){
4644var t=document.getElementById(this._getDayCellId(d*7));
4645m.innerHTML=AjxDateUtil.getWeekNumber(new Date(t._year,t._month,t._day),this._firstDayOfWeek,null,this._useISO8601WeekNo)
4646}}}
4647this._setTitle(y,s);
4648if(!this._readOnly){
4649this._setSelectedDate();
4650this._setToday()
4651}
4652this._setRange()
4653};
4654DwtCalendar.prototype._setRange=function(){
4655var e=document.getElementById(this._getDayCellId(0));
4656var i=new Date(e._year,e._month,e._day,0,0,0,0);
4657e=document.getElementById(this._getDayCellId(DwtCalendar._LAST_DAY_CELL_IDX));
4658var a=this._getDaysInMonth(e._month,e._year);
4659var t;
4660if(e._day<a){
4661t=new Date(e._year,e._month,e._day+1,0,0,0,0)
4662}else{
4663if(e._month<11){
4664t=new Date(e._year,e._month+1,1,0,0,0,0)
4665}else{
4666t=new Date(e._year+1,0,1,0,0,0,0)
4667}}
4668if(this._range==null){
4669this._range={}
4670}else{
4671if(this._range.start.getTime()==i.getTime()&&this._range.end.getTime()==t.getTime()){
4672return false
4673}}
4674this._range.start=i;
4675this._range.end=t;
4676if(!this.isListenerRegistered(DwtEvent.DATE_RANGE)){
4677return
4678}
4679if(!this._dateRangeEvent){
4680this._dateRangeEvent=new DwtDateRangeEvent(true)
4681}
4682this._dateRangeEvent.item=this;
4683this._dateRangeEvent.start=i;
4684this._dateRangeEvent.end=t;
4685this.notifyListeners(DwtEvent.DATE_RANGE,this._dateRangeEvent)
4686};
4687DwtCalendar.prototype._setToday=function(){
4688var e;
4689var t=new Date();
4690var a=t.getDate();
4691if(!this._todayDay||this._todayDay!=a){
4692if(this._todayCellId!=null){
4693e=document.getElementById(this._todayCellId);
4694e._isToday=false;
4695this._setClassName(e,DwtCalendar._NORMAL)
4696}
4697this._todayCellId=this._date2CellId[(t.getFullYear()*10000)+(t.getMonth()*100)+a];
4698if(this._todayCellId!=null){
4699e=document.getElementById(this._todayCellId);
4700e._isToday=true;
4701this._setClassName(e,DwtCalendar._NORMAL)
4702}}};
4703DwtCalendar.prototype._setSelectedDate=function(){
4704var t=this._date.getDate();
4705var o=this._date.getMonth();
4706var a=this._date.getFullYear();
4707var e;
4708if(this._selectedDayElId){
4709e=document.getElementById(this._selectedDayElId);
4710this._setClassName(e,DwtCalendar._DESELECTED)
4711}
4712var i=this._date2CellId[(a*10000)+(o*100)+t];
4713e=document.getElementById(i);
4714this._selectedDayElId=i;
4715this._setClassName(e,DwtCalendar._SELECTED)
4716};
4717DwtCalendar.prototype._setCellClassName=function(t,a,i){
4718if(t._dayType!=DwtCalendar._THIS_MONTH){
4719a+=this._greyClassName
4720}
4721if(this._selectionMode==DwtCalendar.DAY&&t.id==this._selectedDayElId&&i!=DwtCalendar._DESELECTED){
4722a+=this._selectedDayClassName
4723}else{
4724if(this._selectionMode!=DwtCalendar.DAY&&i!=DwtCalendar._DESELECTED&&this._selectedDayElId!=null){
4725var e=this._getDayCellIndex(t.id);
4726if(Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)==Math.floor(e/7)&&this._currWorkingDays[e%7]){
4727a+=this._selectedDayClassName
4728}}}
4729if(t._isHilited){
4730a+=this._hiliteClassName
4731}
4732if(t._isToday){
4733a+=this._todayClassName
4734}
4735return a
4736};
4737DwtCalendar.prototype._setClassName=function(e,s){
4738var a="";
4739if(s==DwtCalendar._NORMAL){
4740a=this._origDayClassName
4741}else{
4742if(s==DwtCalendar._HOVERED){
4743a=this._hoveredDayClassName
4744}else{
4745if(s==DwtCalendar._ACTIVE){
4746a=this._activeDayClassName
4747}else{
4748if(s==DwtCalendar._DESELECTED&&this._selectionMode==DwtCalendar.DAY){
4749a=this._origDayClassName
4750}else{
4751if(this._selectionMode!=DwtCalendar.DAY&&(s==DwtCalendar._SELECTED||s==DwtCalendar._DESELECTED)){
4752var n=Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)*7;
4753for(var t=0;
4754t<7;
4755t++){
4756a=this._origDayClassName;
4757var o=document.getElementById(this._getDayCellId(n++));
4758o.className=this._setCellClassName(o,a,s)
4759}
4760return
4761}}}}}
4762e.className=this._setCellClassName(e,a,s)
4763};
4764DwtCalendar.prototype._setTitle=function(o,i){
4765var e=document.getElementById(this._monthCell);
4766var a=DwtCalendar.getMonthFormatter();
4767var t=new Date(i,o);
4768e.innerHTML=a.format(t)
4769};
4770DwtCalendar.prototype._init=function(){
4771var o=new Array(100);
4772var e=0;
4773this._monthCell="t:"+this._uuid;
4774o[e++]="<table width=100% cellspacing='0' cellpadding='0' style='border-collapse:collapse;'>";
4775o[e++]="<tr><td class=DwtCalendarTitlebar>";
4776o[e++]="<table width='100%' cellspacing='0' cellpadding='0'>";
4777o[e++]="<tr>";
4778o[e++]="<td class='";
4779o[e++]=DwtCalendar._BUTTON_CLASS;
4780o[e++]="' id='b:py:";
4781o[e++]=this._uuid;
4782o[e++]="'>";
4783o[e++]=AjxImg.getImageHtml("FastRevArrowSmall",null,["id='b:py:img:",this._uuid,"'"].join(""));
4784o[e++]="</td>";
4785o[e++]="<td class='";
4786o[e++]=DwtCalendar._BUTTON_CLASS;
4787o[e++]="' id='b:pm:";
4788o[e++]=this._uuid;
4789o[e++]="'>";
4790o[e++]=AjxImg.getImageHtml("RevArrowSmall",null,["id='b:pm:img:",this._uuid,"'"].join(""));
4791o[e++]="</td>";
4792o[e++]="<td align='center' class='DwtCalendarTitleCell' nowrap'><span class='";
4793o[e++]=DwtCalendar._TITLE_CLASS;
4794o[e++]="' id='";
4795o[e++]=this._monthCell;
4796o[e++]="'>&nbsp;</span></td>";
4797o[e++]="<td class='";
4798o[e++]=DwtCalendar._BUTTON_CLASS;
4799o[e++]="' id='b:nm:";
4800o[e++]=this._uuid;
4801o[e++]="'>";
4802o[e++]=AjxImg.getImageHtml("FwdArrowSmall",null,["id='b:nm:img:",this._uuid,"'"].join(""));
4803o[e++]="</td>";
4804o[e++]="<td class='";
4805o[e++]=DwtCalendar._BUTTON_CLASS;
4806o[e++]="' id='b:ny:";
4807o[e++]=this._uuid;
4808o[e++]="'>";
4809o[e++]=AjxImg.getImageHtml("FastFwdArrowSmall",null,["id='b:ny:img:",this._uuid,"'"].join(""));
4810o[e++]="</td>";
4811o[e++]="</tr>";
4812o[e++]="</table>";
4813o[e++]="</td></tr>";
4814o[e++]="<tr><td>";
4815o[e++]="<table cellspacing='0' cellpadding='1' width='100%'>";
4816o[e++]="<tr>";
4817if(this._showWeekNumber){
4818o[e++]="<td class='DwtCalendarWeekNoTitle' width='14%' id='";
4819o[e++]=this._getWeekNumberCellId("kw");
4820o[e++]="'>";
4821o[e++]=AjxMsg.calendarWeekTitle;
4822o[e++]="</td>"
4823}
4824for(var a=0;
4825a<7;
4826a++){
4827o[e++]="<td class='DwtCalendarDow' width='";
4828o[e++]=(a<5?"14%":"15%");
4829o[e++]="' id='";
4830o[e++]=this._getDOWCellId(a);
4831o[e++]="'>&nbsp;</td>"
4832}
4833o[e++]="</tr>";
4834for(var a=0;
4835a<6;
4836a++){
4837o[e++]=(AjxEnv.isLinux||AjxEnv.isMac)?"<tr style='line-height:12px'>":"<tr>";
4838if(this._showWeekNumber){
4839o[e++]="<td class='DwtCalendarWeekNo' id='"+this._getWeekNumberCellId("kw"+a*7)+"'>&nbsp;</td>"
4840}
4841for(var t=0;
4842t<7;
4843t++){
4844o[e++]="<td id='";
4845o[e++]=this._getDayCellId(a*7+t);
4846o[e++]="'>&nbsp;</td>"
4847}
4848o[e++]="</tr>"
4849}
4850o[e++]="</td></tr></table></table>";
4851this.getHtmlElement().innerHTML=o.join("");
4852if(!this._readOnly){
4853document.getElementById("b:py:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastRevArrowSmall");
4854document.getElementById("b:pm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("RevArrowSmall");
4855document.getElementById("b:nm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FwdArrowSmall");
4856document.getElementById("b:ny:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastFwdArrowSmall")
4857}
4858this._calWidgetInited=true
4859};
4860DwtCalendar.prototype.setMouseOverDayCallback=function(e){
4861this._mouseOverDayCB=e
4862};
4863DwtCalendar.prototype.setMouseOutDayCallback=function(e){
4864this._mouseOutDayCB=e
4865};
4866DwtCalendar.prototype.getDndDate=function(){
4867var e=this._lastDndCell;
4868if(e){
4869return new Date(e._year,e._month,e._day)
4870}
4871return null
4872};
4873DwtCalendar._tmpDate=new Date();
4874DwtCalendar._tmpDate.setHours(0,0,0,0);
4875DwtCalendar.prototype._mouseOverListener=function(t){
4876var a=t.target;
4877if(a.id.charAt(0)=="c"){
4878this._setClassName(a,DwtCalendar._HOVERED);
4879if(this._mouseOverDayCB){
4880DwtCalendar._tmpDate.setFullYear(a._year,a._month,a._day);
4881this._mouseOverDayCB.run(this,DwtCalendar._tmpDate)
4882}}else{
4883if(a.id.charAt(0)=="t"){
4884return
4885}else{
4886if(a.id.charAt(0)=="b"){
4887var e;
4888if(a.firstChild==null){
4889e=a;
4890AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
4891}else{
4892a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
4893e=AjxImg.getImageElement(a)
4894}
4895e.className=e._origClassName
4896}}}
4897t._stopPropagation=true
4898};
4899DwtCalendar.prototype._mouseOutListener=function(t){
4900this.setToolTipContent(null);
4901var a=t.target;
4902if(a.id.charAt(0)=="c"){
4903this._setClassName(a,DwtCalendar._NORMAL);
4904if(this._mouseOutDayCB){
4905this._mouseOutDayCB.run(this)
4906}}else{
4907if(a.id.charAt(0)=="b"){
4908var e;
4909a.className=DwtCalendar._BUTTON_CLASS;
4910if(a.firstChild==null){
4911e=a;
4912AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_CLASS
4913}else{
4914a.className=DwtCalendar._BUTTON_CLASS;
4915e=AjxImg.getImageElement(a)
4916}
4917e.className=e._origClassName
4918}}};
4919DwtCalendar.prototype._mouseDownListener=function(t){
4920if(t.button==DwtMouseEvent.LEFT){
4921var a=t.target;
4922if(a.id.charAt(0)=="c"){
4923this._setClassName(a,DwtCalendar._ACTIVE)
4924}else{
4925if(a.id.charAt(0)=="t"){
4926a.className=DwtCalendar._TITLE_ACTIVE_CLASS
4927}else{
4928if(a.id.charAt(0)=="b"){
4929var e;
4930if(a.firstChild==null){
4931e=a;
4932AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_ACTIVE_CLASS
4933}else{
4934a.className=DwtCalendar._BUTTON_ACTIVE_CLASS;
4935e=AjxImg.getImageElement(a)
4936}
4937e.className=e._origClassName
4938}else{
4939if(a.id.charAt(0)=="w"){}}}}}};
4940DwtCalendar.prototype._mouseUpListener=function(t){
4941var a=t.target;
4942if(t.button==DwtMouseEvent.LEFT){
4943if(a.id.charAt(0)=="c"){
4944if(this.parent instanceof DwtMenu){
4945DwtMenu.closeActiveMenu()
4946}
4947if(this.setDate(new Date(a._year,a._month,a._day))){
4948return
4949}
4950this._setClassName(a,DwtCalendar._HOVERED)
4951}else{
4952if(a.id.charAt(0)=="b"){
4953var e;
4954if(a.firstChild==null){
4955e=a;
4956AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
4957}else{
4958a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
4959e=AjxImg.getImageElement(a)
4960}
4961e.className=e._origClassName;
4962if(e.id.indexOf("py")!=-1){
4963this._prevYear()
4964}else{
4965if(e.id.indexOf("pm")!=-1){
4966this._prevMonth()
4967}else{
4968if(e.id.indexOf("nm")!=-1){
4969this._nextMonth()
4970}else{
4971this._nextYear()
4972}}}}else{
4973if(a.id.charAt(0)=="t"){
4974a.className=DwtCalendar._TITLE_HOVERED_CLASS;
4975this.setDate(new Date(),this._skipNotifyOnPage);
4976if(this.parent instanceof DwtMenu){
4977DwtMenu.closeActiveMenu()
4978}}}}}else{
4979if(t.button==DwtMouseEvent.RIGHT&&a.id.charAt(0)=="c"){
4980this._notifyListeners(DwtEvent.ACTION,0,new Date(a._year,a._month,a._day),t)
4981}}};
4982DwtCalendar.prototype._doubleClickListener=function(e){
4983var t=e.target;
4984if(this._selectionEvent){
4985this._selectionEvent.type=DwtCalendar.DATE_DBL_CLICKED
4986}
4987if(t.id.charAt(0)=="c"){
4988if(this.parent instanceof DwtMenu){
4989DwtMenu.closeActiveMenu()
4990}
4991this.setDate(new Date(t._year,t._month,t._day),false,false,true)
4992}};
4993DwtCalendar.prototype._prevMonth=function(e){
4994var t=new Date(this._date.getTime());
4995this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,-1),this._skipNotifyOnPage)
4996};
4997DwtCalendar.prototype._nextMonth=function(e){
4998var t=new Date(this._date.getTime());
4999this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,1),this._skipNotifyOnPage)
5000};
5001DwtCalendar.prototype._prevYear=function(e){
5002var t=new Date(this._date.getTime());
5003this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,-1),this._skipNotifyOnPage)
5004};
5005DwtCalendar.prototype._nextYear=function(e){
5006var t=new Date(this._date.getTime());
5007this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,1),this._skipNotifyOnPage)
5008};
5009DwtCalendar.getDateFormatter=function(){
5010if(!DwtCalendar._dateFormatter){
5011DwtCalendar._dateFormatter=new AjxDateFormat(AjxMsg.formatCalDate)
5012}
5013return DwtCalendar._dateFormatter
5014};
5015DwtCalendar.getDateLongFormatter=function(){
5016if(!DwtCalendar._dateLongFormatter){
5017DwtCalendar._dateLongFormatter=new AjxDateFormat(AjxMsg.formatCalDateLong)
5018}
5019return DwtCalendar._dateLongFormatter
5020};
5021DwtCalendar.getDateFullFormatter=function(){
5022if(!DwtCalendar._dateFullFormatter){
5023DwtCalendar._dateFullFormatter=new AjxDateFormat(AjxMsg.formatCalDateFull)
5024}
5025return DwtCalendar._dateFullFormatter
5026};
5027DwtCalendar.getHourFormatter=function(){
5028if(!DwtCalendar._hourFormatter){
5029DwtCalendar._hourFormatter=new AjxMessageFormat(AjxMsg.formatCalHour)
5030}
5031return DwtCalendar._hourFormatter
5032};
5033DwtCalendar.getDayFormatter=function(){
5034if(!DwtCalendar._dayFormatter){
5035DwtCalendar._dayFormatter=new AjxDateFormat(AjxMsg.formatCalDay)
5036}
5037return DwtCalendar._dayFormatter
5038};
5039DwtCalendar.getMonthFormatter=function(){
5040if(!DwtCalendar._monthFormatter){
5041DwtCalendar._monthFormatter=new AjxDateFormat(AjxMsg.formatCalMonth)
5042}
5043return DwtCalendar._monthFormatter
5044};
5045DwtCalendar.getShortMonthFormatter=function(){
5046if(!DwtCalendar._shortMonthFormatter){
5047DwtCalendar._shortMonthFormatter=new AjxDateFormat(AjxMsg.formatShortCalMonth)
5048}
5049return DwtCalendar._shortMonthFormatter
5050};
5051DwtCalendar.prototype._dragEnter=function(e){};
5052DwtCalendar.prototype._dragHover=function(e){};
5053DwtCalendar.prototype._dragOver=function(e){
5054var t=e.target;
5055if(t.id.charAt(0)=="c"){
5056this._setClassName(t,DwtCalendar._HOVERED);
5057this._lastDndCell=t
5058}else{
5059this._lastDndCell=null
5060}};
5061DwtCalendar.prototype._dragLeave=function(e){}
5062}
5063if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyPage")){
5064DwtPropertyPage=function(e){
5065if(arguments.length==0){
5066return
5067}
5068e=Dwt.getParams(arguments,DwtPropertyPage.PARAMS);
5069e.className=e.className||"DwtPropertyPage";
5070DwtComposite.call(this,e);
5071this._fieldIds=new Object();
5072this._fildDivIds=new Object();
5073this._isDirty=false
5074};
5075DwtPropertyPage.prototype=new DwtComposite;
5076DwtPropertyPage.prototype.constructor=DwtPropertyPage;
5077DwtPropertyPage.prototype.toString=function(){
5078return"DwtPropertyPage"
5079};
5080DwtPropertyPage.PARAMS=DwtComposite.PARAMS;
5081DwtPropertyPage.prototype.setDirty=function(e){
5082this._isDirty=e
5083};
5084DwtPropertyPage.prototype.isDirty=function(){
5085return this._isDirty
5086};
5087DwtPropertyPage.prototype._installOnKeyUpHandler=function(i,t){
5088if(!i){
5089return
5090}
5091var a=null;
5092a=document.getElementById(this._fieldIds[i]);
5093if(a){
5094Dwt.setHandler(a,DwtEvent.ONKEYUP,t?t:this._onKeyUp);
5095a._view=this;
5096a._field=i
5097}};
5098DwtPropertyPage.prototype._installOnClickHandler=function(i,t){
5099if(!i){
5100return
5101}
5102var a=document.getElementById(this._fieldIds[i]);
5103if(a){
5104Dwt.setHandler(a,DwtEvent.ONCLICK,t?t:this._onClick);
5105a._view=this;
5106a._field=i
5107}};
5108DwtPropertyPage.prototype._onClick=function(e){
5109this._view.setDirty(true);
5110return true
5111};
5112DwtPropertyPage.prototype._onKeyUp=function(e){
5113this._view.setDirty(true);
5114return true
5115};
5116DwtPropertyPage.prototype._installOnChangeHandler=function(i,t){
5117if(!i){
5118return
5119}
5120var a=null;
5121a=document.getElementById(this._fieldIds[i]);
5122if(a){
5123Dwt.setHandler(a,DwtEvent.ONCHANGE,t?t:this._onChange);
5124a._view=this;
5125a._field=i
5126}};
5127DwtPropertyPage._onChange=function(e){
5128this._view.setDirty(true);
5129return true
5130};
5131DwtPropertyPage.prototype._onChange2=function(e){
5132this.setDirty(true);
5133return true
5134};
5135DwtPropertyPage.prototype._addDwtSelectEntryRow=function(o,n,a,e,i){
5136var t="30ex";
5137if(i){
5138t=i
5139}
5140a[e++]="<tr valign='center'>";
5141e=this._addDwtSelectEntryCell(o,n,a,e,t);
5142a[e++]="</tr>";
5143return e
5144};
5145DwtPropertyPage.prototype._addDwtSelectEntryCell=function(a,i,t,e,n){
5146var o=Dwt.getNextId();
5147this._fieldIds[a]=o;
5148if(i){
5149t[e++]="<td align='left' style='width:"+n+"'>";
5150t[e++]=AjxStringUtil.htmlEncode(i)+":";
5151t[e++]="</td>"
5152}
5153t[e++]="<td align='left'>";
5154t[e++]="<div id='"+o+"'></div></td>";
5155return e
5156};
5157DwtPropertyPage.prototype._addBoolEntryRow=function(a,i,t,e,o){
5158t[e++]="<tr valign='center'>";
5159e=this._addBoolEntryCell(a,i,t,e,o);
5160t[e++]="</tr>";
5161return e
5162};
5163DwtPropertyPage.prototype._addBoolEntryCell=function(i,o,t,e,s){
5164var n=Dwt.getNextId();
5165this._fieldIds[i]=n;
5166var a="20ex";
5167if(s){
5168a=s
5169}
5170if(o){
5171t[e++]="<td style='width:"+a+";' align='left'>";
5172t[e++]=AjxStringUtil.htmlEncode(o)+":";
5173t[e++]="</td>"
5174}
5175t[e++]="<td align='left'>";
5176t[e++]="<input type='checkbox' id='"+n+"'>";
5177t[e++]="</td>";
5178return e
5179};
5180DwtPropertyPage.prototype._addTextAreaEntryRow=function(i,o,t,e,s){
5181var a="on";
5182if(s){
5183a="off"
5184}
5185var n=Dwt.getNextId();
5186this._fieldIds[i]=n;
5187t[e++]="<tr valign='center'>";
5188t[e++]="<td align='left' style='width:60ex;'>";
5189t[e++]=AjxStringUtil.htmlEncode(o)+":";
5190t[e++]="</td></tr>";
5191t[e++]="<tr valign='center'><td align='left' style='width:60ex;'><textarea wrap='"+a+"' rows='8' cols ='60' id='";
5192t[e++]=n;
5193t[e++]="'/></textarea></td></tr>";
5194return e
5195};
5196DwtPropertyPage.prototype._addEntryRow=function(s,n,t,l,i,o,e,h,a){
5197t[l++]="<tr valign='center'>";
5198l=this._addEntryCell(s,n,t,l,i,o,e,h,a);
5199t[l++]="</tr>";
5200return l
5201};
5202DwtPropertyPage.prototype._addEntryCell=function(l,h,i,d,n,s,t,c,o){
5203if(n==null){
5204n="text"
5205}
5206if(s==null){
5207s=35
5208}
5209var a="20ex";
5210if(c){
5211a=c
5212}
5213var e=Dwt.getNextId();
5214this._fieldIds[l]=e;
5215if(h){
5216i[d++]="<td align='left' style='width:"+a+";'>";
5217i[d++]=AjxStringUtil.htmlEncode(h)+":";
5218i[d++]="</td>"
5219}
5220i[d++]="<td ";
5221if(o){
5222i[d++]="class='redAsteric' "
5223}
5224i[d++]=" align='left'><input autocomplete='off' size='"+s+"' type='"+n+"' id='";
5225i[d++]=e;
5226i[d++]="'";
5227if(o){
5228i[d++]="/>*"
5229}else{
5230i[d++]="/>&nbsp;"
5231}
5232if(t!=null){
5233i[d++]=t
5234}
5235i[d++]="</td>";
5236return d
5237};
5238DwtPropertyPage.prototype._createHTML=function(){}
5239}
5240if(AjxPackage.define("ajax.dwt.widgets.DwtTabView")){
5241DwtTabView=function(t){
5242if(arguments.length==0){
5243return
5244}
5245t=Dwt.getParams(arguments,DwtListView.PARAMS);
5246t.className=t.className||"ZTabView";
5247t.posStyle=t.posStyle||DwtControl.ABSOLUTE_STYLE;
5248DwtComposite.call(this,t);
5249this._stateChangeEv=new DwtEvent(true);
5250this._stateChangeEv.item=this;
5251this._tabs=[];
5252this._tabIx=1;
5253this._createHtml();
5254var e=[this.toString(),this._htmlElId].join("-");
5255this._tabGroup=new DwtTabGroup(e);
5256this._tabGroup.addMember(this._tabBar)
5257};
5258DwtTabView.PARAMS=["parent","className","posStyle"];
5259DwtTabView.prototype=new DwtComposite;
5260DwtTabView.prototype.constructor=DwtTabView;
5261DwtTabView.Z_ACTIVE_TAB=Dwt.Z_VIEW+10;
5262DwtTabView.Z_HIDDEN_TAB=Dwt.Z_HIDDEN;
5263DwtTabView.Z_TAB_PANEL=Dwt.Z_VIEW+20;
5264DwtTabView.Z_CURTAIN=Dwt.Z_CURTAIN;
5265DwtTabView.prototype.TEMPLATE="dwt.Widgets#ZTabView";
5266DwtTabView.prototype.toString=function(){
5267return"DwtTabView"
5268};
5269DwtTabView.prototype.addStateChangeListener=function(e){
5270this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
5271};
5272DwtTabView.prototype.removeStateChangeListener=function(e){
5273this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
5274};
5275DwtTabView.prototype.getTabGroupMember=function(){
5276return this._tabGroup
5277};
5278DwtTabView.prototype.addTab=function(o,i,t,e){
5279var a=this._tabIx++;
5280this._tabs[a]={
5281title:o,button:this._tabBar.addButton(a,o,t,e)};
5282this.setTabView(a,i);
5283if(a==1){
5284if(i instanceof AjxCallback){
5285i=i.run(a)
5286}
5287if(i){
5288i.showMe()
5289}
5290this._currentTabKey=a;
5291this.switchToTab(a)
5292}else{
5293if(i&&!(i instanceof AjxCallback)){
5294i.hideMe();
5295Dwt.setVisible(i.getHtmlElement(),false)
5296}}
5297this._tabBar.addSelectionListener(a,new AjxListener(this,DwtTabView.prototype._tabButtonListener));
5298return a
5299};
5300DwtTabView.prototype.enable=function(e){
5301for(var a in this._tabs){
5302var t=this._tabs[a].button;
5303if(t){
5304t.setEnabled(e)
5305}}};
5306DwtTabView.prototype.getCurrentTab=function(){
5307return this._currentTabKey
5308};
5309DwtTabView.prototype.getNumTabs=function(){
5310return(this._tabs.length-1)
5311};
5312DwtTabView.prototype.getTab=function(e){
5313return(this._tabs&&this._tabs[e])?this._tabs[e]:null
5314};
5315DwtTabView.prototype.getTabBar=function(){
5316return this._tabBar
5317};
5318DwtTabView.prototype.getTabTitle=function(e){
5319return(this._tabs&&this._tabs[e])?this._tabs[e]["title"]:null
5320};
5321DwtTabView.prototype.getTabButton=function(e){
5322return(this._tabs&&this._tabs[e])?this._tabs[e]["button"]:null
5323};
5324DwtTabView.prototype.setTabView=function(i,a){
5325var t=this.getTab(i);
5326t.view=a;
5327if(a&&!(a instanceof AjxCallback)){
5328this._pageEl.appendChild(a.getHtmlElement());
5329a._tabKey=i;
5330if(i==this._currentTabKey){
5331var e=a.getTabGroupMember();
5332this._tabGroup.replaceMember(t.tabGroup,e);
5333t.tabGroup=e
5334}}};
5335DwtTabView.prototype.getTabView=function(i){
5336var a=this.getTab(i);
5337var t=a&&a.view;
5338if(t instanceof AjxCallback){
5339var o=t;
5340t=o.run(i);
5341this.setTabView(i,t);
5342var e=this._getTabSize();
5343t.setSize(e.x,e.y)
5344}
5345return t
5346};
5347DwtTabView.prototype.switchToTab=function(a){
5348var t=this.getTab(a);
5349if(t){
5350var e=this.getTab(this._currentTabKey);
5351if(e){
5352this._tabGroup.removeMember(e.tabGroup)
5353}
5354this._showTab(a);
5355this._tabBar.openTab(a);
5356if(!t.tabGroup&&t.view){
5357t.tabGroup=t.view.getTabGroupMember()
5358}
5359this._tabGroup.addMember(t.tabGroup);
5360if(this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
5361this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
5362}}};
5363DwtTabView.prototype.setBounds=function(t,i,a,e){
5364DwtComposite.prototype.setBounds.call(this,t,i,a,e);
5365this._resetTabSizes(a,e)
5366};
5367DwtTabView.prototype.getActiveView=function(){
5368return this._tabs[this._currentTabKey].view
5369};
5370DwtTabView.prototype.getKeyMapName=function(){
5371return"DwtTabView"
5372};
5373DwtTabView.prototype.resetKeyBindings=function(){
5374var t=this.shell.getKeyboardMgr();
5375if(t.isEnabled()){
5376var n=t.__keyMapMgr;
5377if(!n){
5378return
5379}
5380var o=this.getNumTabs();
5381var h=n.getKeySequences("DwtTabView","GoToTab");
5382for(var e=0;
5383e<h.length;
5384e++){
5385var l=h[e];
5386for(var a=1;
5387a<=o;
5388a++){
5389var s=48+a;
5390var c=l.replace(/NNN/,s);
5391n.setMapping("DwtTabView",c,"GoToTab"+a)
5392}}
5393n.reloadMap("DwtTabView")
5394}};
5395DwtTabView.prototype.handleKeyAction=function(i){
5396switch(i){
5397case DwtKeyMap.NEXT_TAB:var a=this.getCurrentTab();
5398if(a<this.getNumTabs()){
5399this.switchToTab(a+1)
5400}
5401break;
5402case DwtKeyMap.PREV_TAB:var a=this.getCurrentTab();
5403if(a>1){
5404this.switchToTab(a-1)
5405}
5406break;
5407default:var t=i.match(DwtKeyMap.GOTO_TAB_RE);
5408if(t&&t.length){
5409var e=t[1];
5410if((e<=this.getNumTabs())&&(e!=this.getCurrentTab())){
5411this.switchToTab(e)
5412}}else{
5413return false
5414}}
5415return true
5416};
5417DwtTabView.prototype._resetTabSizes=function(a,e){
5418if(this._tabs&&this._tabs.length){
5419for(var o in this._tabs){
5420var t=this._tabs[o].view;
5421if(t&&!(t instanceof AjxCallback)){
5422var i;
5423i=i||e-Dwt.getSize(this._tabBarEl).y;
5424t.resetSize(a,i)
5425}}}};
5426DwtTabView.prototype._getTabSize=function(){
5427var t=this.getSize();
5428var a=t.x||this.getHtmlElement().clientWidth;
5429var e=t.y||this.getHtmlElement().clientHeight;
5430var i=this._tabBar.getSize();
5431var o=i.y||this._tabBar.getHtmlElement().clientHeight;
5432return new DwtPoint(a,(e-o))
5433};
5434DwtTabView.prototype._createHtml=function(e){
5435this._createHtmlFromTemplate(e||this.TEMPLATE,{
5436id:this._htmlElId}
5437)
5438};
5439DwtTabView.prototype._createHtmlFromTemplate=function(e,t){
5440DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
5441this._tabBarEl=document.getElementById(t.id+"_tabbar");
5442this._tabBar=new DwtTabBar(this);
5443this._tabBar.reparentHtmlElement(this._tabBarEl);
5444this._pageEl=document.getElementById(t.id+"_page")
5445};
5446DwtTabView.prototype._showTab=function(t){
5447if(this._tabs&&this._tabs[t]){
5448this._currentTabKey=t;
5449this._hideAllTabs();
5450var e=this.getTabView(t);
5451if(e){
5452e.setVisible(true);
5453e.showMe()
5454}}};
5455DwtTabView.prototype._hideAllTabs=function(){
5456if(this._tabs&&this._tabs.length){
5457for(var t in this._tabs){
5458var e=this._tabs[t].view;
5459if(e&&!(e instanceof AjxCallback)){
5460e.hideMe();
5461Dwt.setVisible(e.getHtmlElement(),false)
5462}}}};
5463DwtTabView.prototype._tabButtonListener=function(e){
5464this.switchToTab(e.item.getData("tabKey"))
5465};
5466DwtTabViewPage=function(a,t,e){
5467if(arguments.length==0){
5468return
5469}
5470params=Dwt.getParams(arguments,DwtTabViewPage.PARAMS);
5471params.className=params.className||"ZTabPage";
5472params.posStyle=params.posStyle||DwtControl.ABSOLUTE_STYLE;
5473this._rendered=true;
5474DwtPropertyPage.call(this,params);
5475this._createHtml();
5476this.getHtmlElement().style.overflowY="auto";
5477this.getHtmlElement().style.overflowX="visible";
5478if(params.contentTemplate){
5479this.getContentHtmlElement().innerHTML=AjxTemplate.expand(params.contentTemplate,this._htmlElId)
5480}};
5481DwtTabViewPage.prototype=new DwtPropertyPage;
5482DwtTabViewPage.prototype.constructor=DwtTabViewPage;
5483DwtTabViewPage.prototype.toString=function(){
5484return"DwtTabViewPage"
5485};
5486DwtTabViewPage.prototype.TEMPLATE="dwt.Widgets#ZTabPage";
5487DwtTabViewPage.PARAMS=DwtPropertyPage.PARAMS.concat("contentTemplate");
5488DwtTabViewPage.prototype.getContentHtmlElement=function(){
5489return this._contentEl||this.getHtmlElement()
5490};
5491DwtTabViewPage.prototype.showMe=function(){
5492this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
5493if(this.parent.getHtmlElement().offsetHeight>80){
5494this._contentEl.style.height=this.parent.getHtmlElement().offsetHeight-80
5495}else{
5496var t=parseInt(this.parent.getHtmlElement().style.height);
5497var e=AjxStringUtil.getUnitsFromSizeString(this.parent.getHtmlElement().style.height);
5498if(t>80){
5499this._contentEl.style.height=(Number(t-80).toString()+e)
5500}}
5501this._contentEl.style.width=this.parent.getHtmlElement().style.width
5502};
5503DwtTabViewPage.prototype.hideMe=function(){
5504this.setZIndex(DwtTabView.Z_HIDDEN_TAB)
5505};
5506DwtTabViewPage.prototype.resetSize=function(t,e){
5507this.setSize(t,e)
5508};
5509DwtTabViewPage.prototype._createHtml=function(e){
5510this._createHtmlFromTemplate(e||this.TEMPLATE,{
5511id:this._htmlElId}
5512)
5513};
5514DwtTabViewPage.prototype._createHtmlFromTemplate=function(e,t){
5515DwtPropertyPage.prototype._createHtmlFromTemplate.call(this,e,t);
5516this._contentEl=document.getElementById(t.id+"_content")||this.getHtmlElement()
5517};
5518DwtTabBar=function(a,t,i){
5519if(arguments.length==0){
5520return
5521}
5522this._buttons=[];
5523this._btnStyle=i||"ZTab";
5524this._btnImage=null;
5525this._currentTabKey=1;
5526var e=t||"ZTabBar";
5527DwtToolBar.call(this,{
5528parent:a,className:e,posStyle:DwtControl.STATIC_STYLE}
5529)
5530};
5531DwtTabBar.prototype=new DwtToolBar;
5532DwtTabBar.prototype.constructor=DwtTabBar;
5533DwtTabBar.prototype.TEMPLATE="dwt.Widgets#ZTabBar";
5534DwtTabBar.prototype.toString=function(){
5535return"DwtTabBar"
5536};
5537DwtTabBar.prototype.getCurrentTab=function(){
5538return this._currentTabKey
5539};
5540DwtTabBar.prototype.addStateChangeListener=function(e){
5541this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
5542};
5543DwtTabBar.prototype.removeStateChangeListener=function(e){
5544this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
5545};
5546DwtTabBar.prototype.addSelectionListener=function(t,e){
5547this._buttons[t].addSelectionListener(e)
5548};
5549DwtTabBar.prototype.removeSelectionListener=function(t,e){
5550this._buttons[t].removeSelectionListener(e)
5551};
5552DwtTabBar.prototype.addButton=function(n,o,s,a){
5553var t=this._buttons[n]=new DwtTabButton(this,s,a);
5554this._buttons[n].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
5555if(this._btnImage!=null){
5556t.setImage(this._btnImage)
5557}
5558if(o!=null){
5559t.setText(o)
5560}
5561t.setEnabled(true);
5562t.setData("tabKey",n);
5563if(parseInt(n)==1){
5564this.openTab(n,true)
5565}
5566var e=this.__getButtonIndex(this._currentTabKey);
5567if(e!=-1){
5568var i=this.__getButtonIndex(n);
5569if(i==e+1){
5570Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
5571}}
5572return t
5573};
5574DwtTabBar.prototype.getButton=function(e){
5575return(this._buttons[e])?this._buttons[e]:null
5576};
5577DwtTabBar.prototype.openTab=function(e,o){
5578this._currentTabKey=e;
5579var i=this._buttons.length;
5580for(var t=0;
5581t<i;
5582t++){
5583if(t==e){
5584continue
5585}
5586var a=this._buttons[t];
5587if(a){
5588this.__markPrevNext(t,false);
5589a.setClosed()
5590}}
5591var a=this._buttons[e];
5592if(a){
5593a.setOpen();
5594this.__markPrevNext(e,true)
5595}
5596if(!o&&this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
5597this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
5598}};
5599DwtTabBar._setActiveTab=function(a){
5600var e;
5601if(a&&a.item){
5602e=a.item.getData("tabKey")
5603}else{
5604if(a&&a.target){
5605var t=a.target;
5606while(t.tagName!="TABLE"&&t.offsetParent){
5607t=t.offsetParent
5608}
5609e=t.getAttribute("tabKey");
5610if(e==null){
5611return false
5612}}else{
5613return false
5614}}
5615this.openTab(e)
5616};
5617DwtTabButton=function(t,a,e){
5618if(arguments.length==0){
5619return
5620}
5621DwtButton.call(this,{
5622parent:t,className:"ZTab",id:a,index:e}
5623)
5624};
5625DwtTabButton.prototype=new DwtButton;
5626DwtTabButton.prototype.constructor=DwtTabButton;
5627DwtTabButton.prototype.TEMPLATE="dwt.Widgets#ZTab";
5628DwtTabButton.prototype.toString=function(){
5629return"DwtTabButton"
5630};
5631DwtTabButton.prototype.setOpen=function(){
5632this._isSelected=true;
5633this.setDisplayState(DwtControl.SELECTED)
5634};
5635DwtTabButton.prototype.setClosed=function(){
5636this._isSelected=false;
5637this.setDisplayState(DwtControl.NORMAL)
5638};
5639DwtTabButton.prototype.setDisplayState=function(e){
5640if(this._isSelected&&e!=DwtControl.SELECTED){
5641e=[DwtControl.SELECTED,e].join(" ")
5642}
5643DwtButton.prototype.setDisplayState.call(this,e)
5644};
5645DwtTabBarFloat=function(t,e,a){
5646if(arguments.length==0){
5647return
5648}
5649DwtTabBar.call(this,t,e,a)
5650};
5651DwtTabBarFloat.prototype=new DwtTabBar;
5652DwtTabBarFloat.prototype.constructor=DwtTabBarFloat;
5653DwtTabBarFloat.prototype.TEMPLATE="dwt.Widgets#ZTabBarFloat";
5654DwtTabBarFloat.prototype.addButton=function(o,i,n){
5655var t=this._buttons[o]=new DwtTabButtonFloat(this,n);
5656this._buttons[o].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
5657if(this._btnImage!=null){
5658t.setImage(this._btnImage)
5659}
5660if(i!=null){
5661t.setText(i)
5662}
5663t.setEnabled(true);
5664t.setData("tabKey",o);
5665if(parseInt(o)==1){
5666this.openTab(o,true)
5667}
5668var e=this.__getButtonIndex(this._currentTabKey);
5669if(e!=-1){
5670var a=this.__getButtonIndex(o);
5671if(a==e+1){
5672Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
5673}}
5674return t
5675};
5676DwtTabBarFloat.prototype.addChild=function(t,e){
5677DwtComposite.prototype.addChild.apply(this,arguments);
5678this._addItem(DwtToolBar.ELEMENT,t,e)
5679};
5680DwtTabBarFloat.prototype._addItem=function(i,a,t){
5681var o=this._items[t]||this._suffixEl;
5682var e=t||(typeof t=="number")?t:this._items.length;
5683this._items.splice(e,0,a);
5684this._itemsEl.insertBefore(a.getHtmlElement(),o)
5685};
5686DwtTabButtonFloat=function(e,t){
5687DwtTabButton.call(this,e,t)
5688};
5689DwtTabButtonFloat.prototype=new DwtTabButton;
5690DwtTabButtonFloat.prototype.constructor=DwtTabButtonFloat;
5691DwtTabButtonFloat.prototype.TEMPLATE="dwt.Widgets#ZTabFloat"
5692}
5693if(AjxPackage.define("ajax.dwt.widgets.DwtWizardDialog")){
5694DwtWizardDialog=function(o,i,l,e,a){
5695if(arguments.length==0){
5696return
5697}
5698i=i||"DwtDialog";
5699var s=new DwtDialog_ButtonDescriptor(DwtWizardDialog.NEXT_BUTTON,AjxMsg._next,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goNext));
5700var t=new DwtDialog_ButtonDescriptor(DwtWizardDialog.PREV_BUTTON,AjxMsg._prev,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goPrev));
5701var n=new DwtDialog_ButtonDescriptor(DwtWizardDialog.FINISH_BUTTON,AjxMsg._finish,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.finishWizard));
5702DwtDialog.call(this,{
5703parent:o,className:i,standardButtons:[DwtDialog.CANCEL_BUTTON],extraButtons:[t,s,n]}
5704);
5705if(!e){
5706this._contentW="80ex"
5707}else{
5708this._contentW=e
5709}
5710if(!a){
5711this._contentH="100ex"
5712}else{
5713this._contentH=a
5714}
5715this._pages=new Array();
5716this._pageIx=1;
5717this._currentPage=1;
5718this._progressDiv=document.createElement("div");
5719this._progressDiv.style.position=DwtControl.STATIC_STYLE;
5720this._pageDiv=document.createElement("div");
5721this._pageDiv.className="DwtWizardDialogPageDiv";
5722this._pageDiv.style.width=this._contentW;
5723this._pageDiv.style.height=this._contentH;
5724this._progressBar=new DwtWizProgressBar(this);
5725this._createContentHtml();
5726this.setTitle(l)
5727};
5728DwtWizardDialog.prototype=new DwtDialog;
5729DwtWizardDialog.prototype.constructor=DwtWizardDialog;
5730DwtWizardDialog.Z_ACTIVE_PAGE=Dwt.Z_VIEW+10;
5731DwtWizardDialog.Z_HIDDEN_PAGE=Dwt.Z_HIDDEN;
5732DwtWizardDialog.Z_TAB_PANEL=Dwt.Z_VIEW+20;
5733DwtWizardDialog.Z_CURTAIN=Dwt.Z_CURTAIN;
5734DwtWizardDialog.NEXT_BUTTON=12;
5735DwtWizardDialog.PREV_BUTTON=11;
5736DwtWizardDialog.FINISH_BUTTON=13;
5737DwtWizardDialog.prototype.toString=function(){
5738return"DwtWizardDialog"
5739};
5740DwtWizardDialog.prototype.popdown=function(){
5741DwtDialog.prototype.popdown.call(this);
5742this._hideAllPages()
5743};
5744DwtWizardDialog.prototype.goPage=function(e){
5745if(this._pages&&this._pages[e]){
5746this._currentPage=e;
5747this._showPage(e);
5748this._progressBar.showStep(e);
5749this._pages[e].setActive()
5750}};
5751DwtWizardDialog.prototype.goNext=function(){
5752var e=this._currentPage+1;
5753if(this._pages&&this._pages[this._currentPage]){
5754this._pages[this._currentPage].switchToNextPage(e)
5755}};
5756DwtWizardDialog.prototype.goPrev=function(){
5757var e=this._currentPage-1;
5758if(this._pages&&this._pages[this._currentPage]){
5759this._pages[this._currentPage].switchToPrevPage(e)
5760}};
5761DwtWizardDialog.prototype.finishWizard=function(){
5762this.popdown()
5763};
5764DwtWizardDialog.prototype.getPage=function(e){
5765if(this._pages&&this._pages[e]){
5766return this._pages[e]
5767}else{
5768return null
5769}};
5770DwtWizardDialog.prototype.addPage=function(e,t){
5771var a=this._pageIx++;
5772this._pages[a]=e;
5773this._progressBar.addStep(a,t);
5774this._pageDiv.appendChild(this._pages[a].getHtmlElement());
5775if(a==1){
5776this._pages[a].setZIndex(DwtWizardDialog.Z_ACTIVE_PAGE)
5777}else{
5778this._pages[a].setZIndex(DwtWizardDialog.Z_HIDDEN_PAGE);
5779Dwt.setVisible(this._pages[a].getHtmlElement(),false)
5780}
5781return a
5782};
5783DwtWizardDialog.prototype._createContentHtml=function(){
5784this._table=document.createElement("table");
5785this._table.border=0;
5786this._table.width=this._contentW;
5787this._table.cellPadding=this._table.cellSpacing=0;
5788this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
5789var i;
5790var o;
5791i=this._table.insertRow(0);
5792i.align="left";
5793i.vAlign="middle";
5794o=i.insertCell(i.cells.length);
5795o.align="left";
5796o.vAlign="middle";
5797o.noWrap=true;
5798o.width="100%";
5799o.className="DwtTabTable";
5800o.appendChild(this._progressBar.getHtmlElement());
5801var s;
5802var e;
5803s=this._table.insertRow(1);
5804s.align="center";
5805s.vAlign="middle";
5806e=s.insertCell(s.cells.length);
5807e.align="left";
5808e.vAlign="middle";
5809e.noWrap=true;
5810e.style.width=this._contentW;
5811var n=document.createElement("div");
5812n.className="horizSep";
5813n.style.width=this._contentW;
5814n.style.height="5px";
5815e.appendChild(n);
5816var t;
5817var a;
5818t=this._table.insertRow(2);
5819t.align="left";
5820t.vAlign="middle";
5821a=t.insertCell(t.cells.length);
5822a.align="left";
5823a.vAlign="middle";
5824a.noWrap=true;
5825a.width=this._contentW;
5826a.appendChild(this._pageDiv);
5827this._getContentDiv().appendChild(this._table)
5828};
5829DwtWizardDialog.prototype.addChild=function(e){
5830this._children.add(e)
5831};
5832DwtWizardDialog.prototype._showPage=function(e){
5833if(this._pages&&this._pages[e]){
5834this._hideAllPages();
5835this._pages[e].showMe();
5836Dwt.setVisible(this._pages[e].getHtmlElement(),true)
5837}};
5838DwtWizardDialog.prototype._hideAllPages=function(){
5839if(this._pages&&this._pages.length){
5840for(var e in this._pages){
5841if(this._pages[e]){
5842this._pages[e].hideMe();
5843Dwt.setVisible(this._pages[e].getHtmlElement(),false)
5844}}}};
5845DwtWizardPage=function(t,e){
5846if(arguments.length==0){
5847return
5848}
5849var a=e||"DwtDialog";
5850DwtPropertyPage.call(this,t,e,DwtControl.ABSOLUTE_STYLE)
5851};
5852DwtWizardPage.prototype=new DwtTabViewPage;
5853DwtWizardPage.prototype.constructor=DwtWizardPage;
5854DwtWizardPage.prototype.toString=function(){
5855return"DwtWizardPage"
5856};
5857DwtWizardPage.prototype.setActive=function(){};
5858DwtWizardPage.prototype.switchToNextPage=function(e){
5859this.parent.goPage(e)
5860};
5861DwtWizardPage.prototype.switchToPrevPage=function(e){
5862this.parent.goPage(e)
5863};
5864DwtWizardPage.prototype.showMe=function(){
5865this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
5866this.getHtmlElement().style.height=this.parent._contentH;
5867this.getHtmlElement().style.width=this.parent._contentW
5868};
5869DwtWizProgressBar=function(e){
5870if(arguments.length==0){
5871return
5872}
5873DwtComposite.call(this,{
5874parent:e,className:"DwtWizProgressBar",posStyle:DwtControl.STATIC_STYLE}
5875);
5876this._table=document.createElement("table");
5877this._table.border=0;
5878this._table.cellPadding=0;
5879this._table.cellSpacing=0;
5880this.getHtmlElement().appendChild(this._table);
5881this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
5882this._stepsNumber=0;
5883this._steps=new Array();
5884this._lblHeader=new DwtStepLabel(this);
5885this._lblHeader.setText("Step 0 of 0");
5886this._lblHeader.setActive(true)
5887};
5888DwtWizProgressBar.prototype=new DwtComposite;
5889DwtWizProgressBar.prototype.constructor=DwtWizProgressBar;
5890DwtWizProgressBar.prototype.toString=function(){
5891return"DwtWizProgressBar"
5892};
5893DwtWizProgressBar.prototype.showStep=function(t){
5894var e="Step "+t+" of "+this._stepsNumber;
5895if(this._steps[t]){
5896e=e+": "+this._steps[t]
5897}
5898this._lblHeader.setText(e)
5899};
5900DwtWizProgressBar.prototype.addStep=function(t,e){
5901this._steps[t]=e;
5902return(++this._stepsNumber)
5903};
5904DwtWizProgressBar.prototype.addChild=function(a){
5905this._children.add(a);
5906var t;
5907var e;
5908this._table.width="100%";
5909t=(this._table.rows.length!=0)?this._table.rows[0]:this._table.insertRow(0);
5910t.align="center";
5911t.vAlign="middle";
5912e=t.insertCell(t.cells.length);
5913e.align="center";
5914e.vAlign="middle";
5915e.noWrap=true;
5916e.appendChild(a.getHtmlElement())
5917};
5918DwtStepLabel=function(e){
5919DwtLabel.call(this,{
5920parent:e,style:DwtLabel.ALIGN_CENTER,className:"DwtStepLabel"}
5921)
5922};
5923DwtStepLabel.prototype=new DwtLabel;
5924DwtStepLabel.prototype.constructor=DwtStepLabel;
5925DwtStepLabel.prototype.toString=function(){
5926return"DwtStepLabel"
5927};
5928DwtStepLabel.prototype.setActive=function(e){
5929if(e){
5930this._textCell.className="DwtStepLabelActive"
5931}else{
5932this._textCell.className="DwtStepLabelInactive"
5933}}
5934}
5935if(AjxPackage.define("ajax.dwt.widgets.DwtSelect")){
5936DwtSelect=function(o){
5937if(arguments.length==0){
5938return
5939}
5940o=Dwt.getParams(arguments,DwtSelect.PARAMS);
5941o.className=o.className||"ZSelect";
5942o.posStyle=o.posStyle||Dwt.STATIC_STYLE;
5943DwtButton.call(this,o);
5944var a=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
5945this._setEventHdlrs(a);
5946this._hasSetMouseEvents=true;
5947this._currentSelectionId=-1;
5948this._options=new AjxVector();
5949this._optionValuesToIndices={};
5950this._selectedValue=this._selectedOption=null;
5951this._cascade=o.cascade==null||o.cascade;
5952var e=o.options;
5953if(e){
5954for(var t=0;
5955t<e.length;
5956++t){
5957this.addOption(e[t])
5958}}
5959this.setDropDownImages("SelectPullDownArrow","SelectPullDownArrowDis","SelectPullDownArrow","SelectPullDownArrow");
5960this._menuCallback=new AjxListener(this,this._createMenu);
5961this.setMenu(this._menuCallback,true)
5962};
5963DwtSelect.PARAMS=["parent","options","style","className"];
5964DwtSelect.prototype=new DwtButton;
5965DwtSelect.prototype.constructor=DwtSelect;
5966DwtSelect.prototype.toString=function(){
5967return"DwtSelect"
5968};
5969DwtSelect._CONTAINER_TEMPLATE="dwt.Widgets#ZSelectAutoSizingContainer";
5970DwtSelect._objectIds=[null];
5971DwtSelect.prototype.TEMPLATE="dwt.Widgets#ZSelect";
5972DwtSelect.getObjectFromElement=function(e){
5973return e&&e.dwtObj?AjxCore.objectWithId(e.dwtObj):null
5974};
5975DwtSelect.prototype.addOption=function(i,a,n){
5976if(!i){
5977return -1
5978}
5979var t=null;
5980var h=null;
5981if(typeof(i)=="string"){
5982h=n!=null?n:i;
5983t=new DwtSelectOption(h,a,i,this,null,null)
5984}else{
5985if(i instanceof DwtSelectOption){
5986t=i;
5987if(n){
5988t.setValue(n)
5989}
5990a=t.isSelected()
5991}else{
5992if(i instanceof DwtSelectOptionData||i.value!=null){
5993h=n!=null?n:i.value;
5994t=new DwtSelectOption(h,i.isSelected,i.displayValue,this,null,i.image,i.selectedValue);
5995a=Boolean(i.isSelected)
5996}else{
5997return -1
5998}}}
5999this._options.add(t);
6000if(this._options.size()==1||a){
6001this._setSelectedOption(t)
6002}
6003var o=this._pseudoItemsEl;
6004var s=o.insertRow(-1);
6005var e=s.insertCell(-1);
6006e.className="ZSelectPseudoItem";
6007e.innerHTML=["<div class='ZWidgetTitle'>",AjxStringUtil.htmlEncode(t.getDisplayValue()),"</div>"].join("");
6008this.setMenu(this._menuCallback,true);
6009this._optionValuesToIndices[t.getValue()]=this._options.size()-1;
6010return(this._options.size()-1)
6011};
6012DwtSelect.prototype.popup=function(){
6013var n=this.getMenu();
6014if(!n){
6015return
6016}
6017var i=this._selectEl;
6018var t=Dwt.getBounds(i);
6019var o=(i.style.borderLeftWidth=="")?0:parseInt(i.style.borderLeftWidth);
6020var h=(i.style.borderTopWidth=="")?0:parseInt(i.style.borderTopWidth);
6021h+=(i.style.borderBottomWidth=="")?0:parseInt(i.style.borderBottomWidth);
6022var a=Dwt.toWindow(i,0,0);
6023var e=a.x+o;
6024var s=a.y+t.height+h;
6025n.popup(0,e,s)
6026};
6027DwtSelect.prototype.rename=function(t,a){
6028var e=this.getOptionWithValue(t);
6029e._displayValue=a;
6030if(this.__selectedOption&&(this.__selectedOption._value==t)){
6031this.setText(AjxStringUtil.htmlEncode(a))
6032}
6033this.setMenu(this._menuCallback,true)
6034};
6035DwtSelect.prototype.enableOption=function(i,e){
6036var t=this.getOptionWithValue(i);
6037if(t.enabled!=e){
6038t.enabled=e;
6039var a=t.getItem();
6040if(a){
6041a.setEnabled(e)
6042}}};
6043DwtSelect.prototype.clearOptions=function(){
6044var t=this._options.getArray();
6045for(var e=0;
6046e<t.length;
6047++e){
6048t[e]=null
6049}
6050this._options.removeAll();
6051this._optionValuesToIndices=null;
6052this._optionValuesToIndices=[];
6053this._selectedValue=null;
6054this._selectedOption=null;
6055this._currentSelectionId=-1
6056};
6057DwtSelect.prototype.setName=function(e){
6058this._name=e
6059};
6060DwtSelect.prototype.getName=function(){
6061return this._name
6062};
6063DwtSelect.prototype.setSelectedValue=function(t){
6064var e=this._optionValuesToIndices[t];
6065if(e!=null){
6066this.setSelected(e)
6067}};
6068DwtSelect.prototype.setSelected=function(e){
6069var t=this.getOptionWithHandle(e);
6070this.setSelectedOption(t)
6071};
6072DwtSelect.prototype.getOptionCount=function(){
6073return this._options.size()
6074};
6075DwtSelect.prototype.getOptions=function(){
6076return this._options
6077};
6078DwtSelect.prototype.getOptionWithHandle=function(e){
6079return this._options.get(e)
6080};
6081DwtSelect.prototype.getOptionAtIndex=DwtSelect.prototype.getOptionWithHandle;
6082DwtSelect.prototype.getIndexForValue=function(e){
6083return this._optionValuesToIndices[e]
6084};
6085DwtSelect.prototype.getOptionWithValue=function(a){
6086var e=this._optionValuesToIndices[a];
6087var t=null;
6088if(e!=null){
6089t=this.getOptionWithHandle(e)
6090}
6091return t
6092};
6093DwtSelect.prototype.setSelectedOption=function(e){
6094if(e){
6095this._setSelectedOption(e)
6096}};
6097DwtSelect.prototype.getValue=function(){
6098return this._selectedValue
6099};
6100DwtSelect.prototype.getSelectedOption=function(){
6101return this._selectedOption
6102};
6103DwtSelect.prototype.getSelectedIndex=function(){
6104return this.getIndexForValue(this.getValue())
6105};
6106DwtSelect.prototype.addChangeListener=function(e){
6107this.addListener(DwtEvent.ONCHANGE,e)
6108};
6109DwtSelect.prototype.size=function(){
6110return this._options.size()
6111};
6112DwtSelect.prototype.disable=function(){
6113this.setEnabled(false)
6114};
6115DwtSelect.prototype.enable=function(){
6116this.setEnabled(true)
6117};
6118DwtSelect.prototype.setImage=function(e){
6119DwtLabel.prototype.setImage.call(this,e)
6120};
6121DwtSelect.prototype.setText=function(e){
6122DwtLabel.prototype.setText.call(this,e)
6123};
6124DwtSelect.prototype.dispose=function(){
6125this._selectEl=null;
6126this._pseudoItemsEl=null;
6127this._containerEl=null;
6128DwtButton.prototype.dispose.call(this);
6129if(this._internalObjectId){
6130DwtSelect._unassignId(this._internalObjectId)
6131}};
6132DwtSelect._assignId=function(e){
6133var t=DwtSelect._objectIds.length;
6134DwtSelect._objectIds[t]=e;
6135return t
6136};
6137DwtSelect._getObjectWithId=function(e){
6138return DwtSelect._objectIds[e]
6139};
6140DwtSelect._unassignId=function(e){
6141DwtSelect._objectIds[e]=null
6142};
6143DwtSelect.prototype._createHtmlFromTemplate=function(a,o){
6144var t=DwtSelect._CONTAINER_TEMPLATE;
6145var e={
6146id:o.id,selectTemplateId:a||this.TEMPLATE,selectData:o};
6147DwtButton.prototype._createHtmlFromTemplate.call(this,t,e);
6148this._selectEl=document.getElementById(o.id+"_select_container");
6149this._pseudoItemsEl=document.getElementById(o.id+"_pseudoitems_container");
6150this._pseudoItemsEl.style.display="none";
6151var i=this.getHtmlElement();
6152this._containerEl=i;
6153this._selectEl.className=i.className;
6154i.className="ZSelectAutoSizingContainer";
6155i.setAttribute("style","");
6156if(AjxEnv.isIE){
6157i.style.overflow="hidden"
6158}};
6159DwtSelect.prototype._createMenu=function(){
6160var h=new DwtSelectMenu(this);
6161for(var a=0,e=this._options.size();
6162a<e;
6163++a){
6164var t=new DwtSelectMenuItem(h);
6165var o=this._options.get(a);
6166var n=o.getImage();
6167if(n){
6168t.setImage(n)
6169}
6170var s=o.getDisplayValue();
6171if(s){
6172t.setText(AjxStringUtil.htmlEncode(s))
6173}
6174t.setEnabled(o.enabled);
6175t.addSelectionListener(new AjxListener(this,this._handleOptionSelection));
6176t._optionIndex=a;
6177o.setItem(t)
6178}
6179return h
6180};
6181DwtSelect.prototype._handleOptionSelection=function(s){
6182var i=s.item;
6183var n=i._optionIndex;
6184var a=this._options.get(n);
6185var t=this.getValue();
6186this._setSelectedOption(a);
6187var e=new Object();
6188e.selectObj=this;
6189e.newValue=a.getValue();
6190e.oldValue=t;
6191var o=DwtUiEvent.getEvent(s);
6192o._args=e;
6193this.notifyListeners(DwtEvent.ONCHANGE,o)
6194};
6195DwtSelect.prototype._clearOptionSelection=function(){
6196if(this._currentSelectionId!=-1){
6197var e=DwtSelect._getObjectWithId(this._currentSelectionId);
6198e.deSelect()
6199}};
6200DwtSelect.prototype._setSelectedOption=function(t){
6201var e=t.getSelectedValue()||t.getDisplayValue();
6202var a=t.getImage();
6203if(this._selectedOption!=t){
6204if(e){
6205this.setText(AjxStringUtil.htmlEncode(e))
6206}
6207this.setImage(a);
6208this._selectedValue=t._value;
6209this._selectedOption=t
6210}
6211this._updateSelection(t);
6212this.autoResize()
6213};
6214DwtSelect.prototype.autoResize=function(){
6215var e=this.getHtmlElement();
6216AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
6217var t=document.getElementById(e.id);
6218if(t){
6219t.style.width=t.childNodes[0].offsetWidth||"auto"
6220}}
6221,200))
6222};
6223DwtSelect.prototype._updateSelection=function(e){
6224var t=(this._currentSelectionId!=-1)?DwtSelect._getObjectWithId(this._currentSelectionId):null;
6225if(t){
6226t.deSelect()
6227}
6228if(e){
6229e.select();
6230this._currentSelectionId=e.getIdentifier()
6231}};
6232DwtSelect.prototype.updateRendering=function(){
6233var e=this.getScrollStyle();
6234this.setScrollStyle(e==Dwt.VISIBLE?Dwt.CLIP:Dwt.VISIBLE);
6235var t=function(){
6236try{
6237this.setScrollStyle(e)
6238}
6239catch(i){}};
6240var a=new AjxTimedAction(this,t);
6241AjxTimedAction.scheduleAction(a,4)
6242};
6243DwtSelectOptionData=function(i,a,e,t,o){
6244if(i==null||a==null){
6245return null
6246}
6247this.value=i;
6248this.displayValue=a;
6249this.isSelected=e;
6250this.selectedValue=t;
6251this.image=o
6252};
6253DwtSelectOption=function(n,o,i,t,e,s,a){
6254this._value=n;
6255this._selected=o;
6256this._displayValue=i;
6257this._image=s;
6258this._selectedValue=a;
6259this._internalObjectId=DwtSelect._assignId(this);
6260this.enabled=true
6261};
6262DwtSelectOption.prototype.setItem=function(e){
6263this._menuItem=e
6264};
6265DwtSelectOption.prototype.getItem=function(e){
6266return this._menuItem
6267};
6268DwtSelectOption.prototype.getDisplayValue=function(){
6269return this._displayValue
6270};
6271DwtSelectOption.prototype.getImage=function(){
6272return this._image
6273};
6274DwtSelectOption.prototype.getSelectedValue=function(){
6275return this._selectedValue
6276};
6277DwtSelectOption.prototype.getValue=function(){
6278return this._value
6279};
6280DwtSelectOption.prototype.setValue=function(e){
6281this._value=e
6282};
6283DwtSelectOption.prototype.select=function(){
6284this._selected=true
6285};
6286DwtSelectOption.prototype.deSelect=function(){
6287this._selected=false
6288};
6289DwtSelectOption.prototype.isSelected=function(){
6290return this._selected
6291};
6292DwtSelectOption.prototype.getIdentifier=function(){
6293return this._internalObjectId
6294};
6295DwtSelectMenu=function(e){
6296DwtMenu.call(this,{
6297parent:e,style:DwtMenu.DROPDOWN_STYLE,className:"DwtMenu",cascade:e._cascade}
6298)
6299};
6300DwtSelectMenu.prototype=new DwtMenu;
6301DwtSelectMenu.prototype.constructor=DwtSelectMenu;
6302DwtSelectMenu.prototype.TEMPLATE="dwt.Widgets#ZSelectMenu";
6303DwtSelectMenuItem=function(e){
6304DwtMenuItem.call(this,{
6305parent:e,style:DwtMenuItem.SELECT_STYLE,className:"ZSelectMenuItem"}
6306)
6307};
6308DwtSelectMenuItem.prototype=new DwtMenuItem;
6309DwtSelectMenuItem.prototype.constructor=DwtSelectMenuItem;
6310DwtSelectMenuItem.prototype.TEMPLATE="dwt.Widgets#ZSelectMenuItem"
6311}
6312if(AjxPackage.define("ajax.dwt.widgets.DwtAlert")){
6313DwtAlert=function(a,t,e){
6314if(arguments.length==0){
6315return
6316}
6317t=t||"DwtAlert";
6318e=e||DwtControl.STATIC_STYLE;
6319DwtControl.call(this,{
6320parent:a,className:t,posStyle:e}
6321);
6322this._alertStyle=DwtAlert.INFORMATION;
6323this._createHtml()
6324};
6325DwtAlert.prototype=new DwtControl;
6326DwtAlert.prototype.constructor=DwtAlert;
6327DwtAlert.INFORMATION=0;
6328DwtAlert.WARNING=1;
6329DwtAlert.CRITICAL=2;
6330DwtAlert._ICONS=[AjxImg.getClassForImage("Information_32"),AjxImg.getClassForImage("Warning_32"),AjxImg.getClassForImage("Critical_32")];
6331DwtAlert._CLASSES=["DwtAlertInfo","DwtAlertWarn","DwtAlertCrit"];
6332DwtAlert._RE_ICONS=new RegExp(DwtAlert._ICONS.join("|"));
6333DwtAlert._RE_CLASSES=new RegExp(DwtAlert._CLASSES.join("|"));
6334DwtAlert.prototype.TEMPLATE="dwt.Widgets#DwtAlert";
6335DwtAlert.prototype.setStyle=function(e){
6336this._alertStyle=e||DwtAlert.INFORMATION;
6337if(this._iconDiv){
6338Dwt.delClass(this._iconDiv,DwtAlert._RE_ICONS,DwtAlert._ICONS[this._alertStyle])
6339}
6340Dwt.delClass(this.getHtmlElement(),DwtAlert._RE_CLASSES,DwtAlert._CLASSES[this._alertStyle])
6341};
6342DwtAlert.prototype.getStyle=function(){
6343return this._alertStyle
6344};
6345DwtAlert.prototype.setIconVisible=function(e){
6346if(this._iconDiv){
6347Dwt.setVisible(this._iconDiv,e)
6348}};
6349DwtAlert.prototype.getIconVisible=function(){
6350return this._iconDiv?Dwt.getVisible(this._iconDiv):false
6351};
6352DwtAlert.prototype.setTitle=function(e){
6353this._alertTitle=e;
6354if(this._titleDiv){
6355this._titleDiv.innerHTML=e||""
6356}};
6357DwtAlert.prototype.getTitle=function(){
6358return this._alertTitle
6359};
6360DwtAlert.prototype.setContent=function(e){
6361this._alertContent=e;
6362if(this._contentDiv){
6363this._contentDiv.innerHTML=e||""
6364}};
6365DwtAlert.prototype.getContent=function(){
6366return this._alertContent
6367};
6368DwtAlert.prototype.setDismissContent=function(e){
6369if(this._dismissDiv){
6370e.reparentHtmlElement(this._dismissDiv.id)
6371}};
6372DwtAlert.prototype.getTabGroupMember=function(){
6373return null
6374};
6375DwtAlert.prototype._createHtml=function(e){
6376var t={
6377id:this._htmlElId};
6378this._createHtmlFromTemplate(e||this.TEMPLATE,t)
6379};
6380DwtAlert.prototype._createHtmlFromTemplate=function(e,t){
6381DwtControl.prototype._createHtmlFromTemplate.apply(this,arguments);
6382this._iconDiv=document.getElementById(t.id+"_icon");
6383this._titleDiv=document.getElementById(t.id+"_title");
6384this._contentDiv=document.getElementById(t.id+"_content");
6385this._dismissDiv=document.getElementById(t.id+"_dismiss")
6386}
6387}
6388if(AjxPackage.define("ajax.dwt.widgets.DwtPropertySheet")){
6389DwtPropertySheet=function(o,i,a,e){
6390if(arguments.length==0){
6391return
6392}
6393i=i||"DwtPropertySheet";
6394DwtComposite.call(this,{
6395parent:o,className:i,posStyle:a}
6396);
6397this._labelSide=e||DwtPropertySheet.DEFAULT;
6398this._propertyIdCount=0;
6399this._propertyList=[];
6400this._propertyMap={};
6401this._tableEl=document.createElement("TABLE");
6402this._tableEl.border=0;
6403this._tableEl.cellSpacing=3;
6404this._tableEl.cellPadding=0;
6405var t=this.getHtmlElement();
6406t.appendChild(this._tableEl)
6407};
6408DwtPropertySheet.prototype=new DwtComposite;
6409DwtPropertySheet.prototype.constructor=DwtPropertySheet;
6410DwtPropertySheet.prototype.toString=function(){
6411return"DwtPropertySheet"
6412};
6413DwtPropertySheet.RIGHT="right";
6414DwtPropertySheet.LEFT="left";
6415DwtPropertySheet.DEFAULT=DwtPropertySheet.LEFT;
6416DwtPropertySheet.prototype._labelSide;
6417DwtPropertySheet.prototype._labelCssClass="Label";
6418DwtPropertySheet.prototype._valueCssClass="Field";
6419DwtPropertySheet.prototype._tableEl;
6420DwtPropertySheet.prototype._propertyIdCount;
6421DwtPropertySheet.prototype._propertyList;
6422DwtPropertySheet.prototype._propertyMap;
6423DwtPropertySheet.prototype.addProperty=function(t,i,n){
6424var e=this._tableEl.rows.length;
6425var o=this._tableEl.insertRow(e);
6426o.vAlign=this._vAlign?this._vAlign:"top";
6427if(this._labelSide==DwtPropertySheet.LEFT){
6428this._insertLabel(o,t,n);
6429this._insertValue(o,i,n)
6430}else{
6431this._insertValue(o,i,n);
6432this._insertLabel(o,t,n)
6433}
6434var s=this._propertyIdCount++;
6435var a={
6436id:s,index:e,row:o,visible:true};
6437this._propertyList.push(a);
6438this._propertyMap[s]=a;
6439return s
6440};
6441DwtPropertySheet.prototype._insertLabel=function(o,e,i){
6442var a=o.insertCell(-1);
6443a.className=this._labelCssClass;
6444if(this._labelSide!=DwtPropertySheet.LEFT){
6445a.width="100%";
6446a.style.textAlign="left"
6447}
6448a.innerHTML=e;
6449if(i){
6450var t=this._tableEl.ownerDocument.createElement("SUP");
6451t.innerHTML="*";
6452a.insertBefore(t,a.firstChild)
6453}};
6454DwtPropertySheet.prototype._insertValue=function(i,t,a){
6455var e=i.insertCell(-1);
6456e.className=this._valueCssClass;
6457if(!t){
6458e.innerHTML="&nbsp;"
6459}else{
6460if(t instanceof DwtControl){
6461e.appendChild(t.getHtmlElement())
6462}else{
6463if(t.nodeType==AjxUtil.ELEMENT_NODE){
6464e.appendChild(t)
6465}else{
6466e.innerHTML=String(t)
6467}}}};
6468DwtPropertySheet.prototype.removeProperty=function(s){
6469var n=this._propertyMap[s];
6470if(n.visible){
6471var t=n.index;
6472var o=this.__getTableIndex(t);
6473var a=this._tableEl.rows[o];
6474a.parentNode.removeChild(a)
6475}
6476n.row=null;
6477for(var e=index+1;
6478e<this._propertyList.length;
6479e++){
6480var n=this._propertyList[e];
6481n.index--
6482}
6483this._propertyList.splice(index,1);
6484delete this._propertyMap[s]
6485};
6486DwtPropertySheet.prototype.setPropertyVisible=function(n,i){
6487var o=this._propertyMap[n];
6488if(o.visible!=i){
6489o.visible=i;
6490var e=o.index;
6491if(i){
6492var a=this.__getTableIndex(e);
6493var t=this._tableEl.insertRow(a);
6494DwtPropertySheet.__moveChildNodes(o.row,t);
6495o.row=t
6496}else{
6497var t=o.row;
6498if(t&&t.parentNode){
6499t.parentNode.removeChild(t)
6500}}}};
6501DwtPropertySheet.prototype.__getTableIndex=function(t){
6502var a=0;
6503for(var e=0;
6504e<t;
6505e++){
6506var o=this._propertyList[e];
6507if(o.visible){
6508a++
6509}}
6510return a
6511};
6512DwtPropertySheet.__moveChildNodes=function(t,e){
6513if(t===e){
6514return
6515}
6516var a=t.firstChild;
6517while(a!=null){
6518e.appendChild(a);
6519a=t.firstChild
6520}}
6521}
6522if(AjxPackage.define("ajax.dwt.widgets.DwtGrouper")){
6523DwtGrouper=function(i,a,t){
6524if(arguments.length==0){
6525return
6526}
6527a=a||"DwtGrouper";
6528t=t||DwtControl.STATIC_STYLE;
6529DwtComposite.call(this,{
6530parent:i,posStyle:t}
6531);
6532this._labelEl=document.createElement("LEGEND");
6533this._insetEl=document.createElement("DIV");
6534this._borderEl=document.createElement("FIELDSET");
6535this._borderEl.appendChild(this._labelEl);
6536this._borderEl.appendChild(this._insetEl);
6537var e=this.getHtmlElement();
6538e.appendChild(this._borderEl)
6539};
6540DwtGrouper.prototype=new DwtComposite;
6541DwtGrouper.prototype.constructor=DwtGrouper;
6542DwtGrouper.prototype._borderEl;
6543DwtGrouper.prototype._labelEl;
6544DwtGrouper.prototype._insetEl;
6545DwtGrouper.prototype.setLabel=function(e){
6546Dwt.setVisible(this._labelEl,Boolean(e));
6547this._labelEl.style.display="";
6548this._labelEl.innerHTML=e?e:""
6549};
6550DwtGrouper.prototype.setContent=function(t){
6551var e=this._insetEl;
6552e.innerHTML=t
6553};
6554DwtGrouper.prototype.setElement=function(t){
6555var e=this._insetEl;
6556Dwt.removeChildren(e);
6557e.appendChild(t)
6558};
6559DwtGrouper.prototype.setView=function(e){
6560this.setElement(e.getHtmlElement())
6561};
6562DwtGrouper.prototype.getInsetHtmlElement=function(){
6563return this._insetEl
6564}
6565}
6566if(AjxPackage.define("ajax.dwt.widgets.DwtProgressBar")){
6567DwtProgressBar=function(a,t,e){
6568if(arguments.length==0){
6569return
6570}
6571e=e||DwtControl.STATIC_STYLE;
6572DwtComposite.call(this,{
6573parent:a,posStyle:e}
6574);
6575this._maxValue=100;
6576this._value=0;
6577this._quotabarDiv=null;
6578this._quotausedDiv=null;
6579this._progressBgColor=null;
6580this._progressCssClass="quotaused";
6581this._wholeBgColor=null;
6582this._wholeCssClass="quotabar";
6583this._createHTML()
6584};
6585DwtProgressBar.prototype=new DwtComposite;
6586DwtProgressBar.prototype.constructor=DwtProgressBar;
6587DwtProgressBar.prototype.setProgressBgColor=function(e){
6588this._progressBgColor=e
6589};
6590DwtProgressBar.prototype.setWholeBgColor=function(e){
6591this._wholeBgColor=e
6592};
6593DwtProgressBar.prototype.setProgressCssClass=function(e){
6594this._progressCssClass=e
6595};
6596DwtProgressBar.prototype.setWholeCssClass=function(e){
6597this._wholeCssClass=e
6598};
6599DwtProgressBar.prototype.setProgressCssStyle=function(e){
6600this._progressCssStyle=e
6601};
6602DwtProgressBar.prototype.setWholeCssStyle=function(e){
6603this._wholeCssStyle=e
6604};
6605DwtProgressBar.prototype.setValue=function(t){
6606this._value=parseInt(t);
6607var e;
6608if(this._value==this._maxValue){
6609e=100
6610}else{
6611e=Math.min(Math.round((this._value/this._maxValue)*100),100)
6612}
6613if(isNaN(e)){
6614e="0"
6615}
6616if(!this._quotabarDiv){
6617this._quotabarDiv=document.createElement("div");
6618if(this._wholeCssClass){
6619this._quotabarDiv.className=this._wholeCssClass
6620}
6621if(this._wholeBgColor){
6622this._quotabarDiv.backgroundColor=this._wholeBgColor
6623}
6624this._cell.appendChild(this._quotabarDiv)
6625}
6626if(!this._quotausedDiv){
6627this._quotausedDiv=document.createElement("div");
6628if(this._progressCssClass){
6629this._quotausedDiv.className=this._progressCssClass
6630}
6631if(this._progressBgColor){
6632this._quotausedDiv.style.backgroundColor=this._progressBgColor
6633}
6634this._quotabarDiv.appendChild(this._quotausedDiv)
6635}
6636this._quotausedDiv.style.width=e+"%"
6637};
6638DwtProgressBar.prototype.setValueByPercent=function(e){
6639this.setMaxValue(100);
6640this.setValue(e.replace(/\%/gi,""))
6641};
6642DwtProgressBar.prototype.getValue=function(){
6643return this._value
6644};
6645DwtProgressBar.prototype.getMaxValue=function(){
6646return this._maxValue
6647};
6648DwtProgressBar.prototype.setMaxValue=function(e){
6649this._maxValue=parseInt(e)
6650};
6651DwtProgressBar.prototype.setLabel=function(o,t){
6652var a=document.createTextNode(o);
6653var e=t?-1:0;
6654var i=this._row.insertCell(e);
6655i.appendChild(a)
6656};
6657DwtProgressBar.prototype._createHTML=function(){
6658this._table=document.createElement("table");
6659this._table.border=this._table.cellpadding=this._table.cellspacing=0;
6660this._row=this._table.insertRow(-1);
6661this._cell=this._row.insertCell(-1);
6662this.getHtmlElement().appendChild(this._table)
6663}
6664}
6665if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyEditor")){
6666DwtPropertyEditor=function(o,t,i,a,e){
6667if(arguments.length>0){
6668if(!i){
6669i="DwtPropertyEditor"
6670}
6671DwtComposite.call(this,{
6672parent:o,className:i,posStyle:a,deferred:e}
6673);
6674this._useDwtInputField=t!=null?t:true;
6675this._schema=null;
6676this._init()
6677}};
6678DwtPropertyEditor.MSG_TIMEOUT=4000;
6679DwtPropertyEditor.MSG={
6680mustMatch:"This field does not match validators: REGEXP",mustNotMatch:"This field matches anti-validators: REGEXP"};
6681DwtPropertyEditor.prototype=new DwtComposite;
6682DwtPropertyEditor.prototype.constructor=DwtPropertyEditor;
6683DwtPropertyEditor.prototype.toString=function(){
6684return"DwtPropertyEditor"
6685};
6686DwtPropertyEditor.prototype._init=function(){
6687var t=document.createElement("div");
6688t.id=this._relDivId=Dwt.getNextId();
6689t.style.position="relative";
6690var e=document.createElement("table");
6691e.id=this._tableId=Dwt.getNextId();
6692e.cellSpacing=e.cellPadding=0;
6693e.appendChild(document.createElement("tbody"));
6694t.appendChild(e);
6695this.getHtmlElement().appendChild(t);
6696this.maxLabelWidth=0;
6697this.maxFieldWidth=0;
6698this._setMouseEventHdlrs();
6699this._onMouseDown=new AjxListener(this,this._onMouseDown);
6700this.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown)
6701};
6702DwtPropertyEditor.prototype.getRelDiv=function(){
6703return document.getElementById(this._relDivId)
6704};
6705DwtPropertyEditor.prototype.getTable=function(){
6706return document.getElementById(this._tableId)
6707};
6708DwtPropertyEditor.prototype._onMouseDown=function(a){
6709var i=a.target;
6710var e=i.tagName.toLowerCase();
6711if(e=="input"){
6712a._stopPropagation=false;
6713a._returnValue=true;
6714return true
6715}
6716if(this._currentInputField&&!this._currentInputField.onblur()){
6717a._stopPropagation=true;
6718a._returnValue=false;
6719return false
6720}
6721try{
6722while(i&&e!="tr"){
6723i=i.parentNode;
6724e=i.tagName.toLowerCase()
6725}
6726if(i&&i.__msh_doMouseDown){
6727i.__msh_doMouseDown(a)
6728}}
6729catch(t){}};
6730DwtPropertyEditor.prototype.getProperties=function(){
6731if(this._currentInputField){
6732this._currentInputField.onblur()
6733}
6734function e(o){
6735var h={}
6736,a,s=o.length;
6737for(var t=0;
6738t<s;
6739++t){
6740a=o[t];
6741if(a.type=="struct"){
6742h[a.name]=e(a.children)
6743}else{
6744h[a.name]=a.value
6745}}
6746return h
6747}
6748return e(this._schema)
6749};
6750DwtPropertyEditor.prototype.validateData=function(){
6751var e=true;
6752function t(s){
6753var o,h=s.length;
6754for(var a=0;
6755a<h;
6756++a){
6757o=s[a];
6758if(o.type=="struct"){
6759t(o.children)
6760}else{
6761if(!o._validate()){
6762e=false
6763}}}}
6764t(this._schema);
6765return e
6766};
6767DwtPropertyEditor.prototype.initProperties=function(a,t){
6768if(t==null){
6769this._schema=a;
6770t=null
6771}
6772for(var e=0;
6773e<a.length;
6774++e){
6775this._createProperty(a[e],t)
6776}};
6777DwtPropertyEditor.prototype._createProperty=function(e,c){
6778var t=c?c._level+1:0;
6779var l=this.getTable().firstChild.appendChild(document.createElement("tr"));
6780e._parent=c;
6781e._level=t;
6782e._rowElId=l.id=Dwt.getNextId();
6783e._propertyEditor=this;
6784for(var s in DwtPropertyEditor._prop_functions){
6785e[s]=DwtPropertyEditor._prop_functions[s]
6786}
6787e._init();
6788l.className="level-"+t;
6789if(e.visible=="false"){
6790l.className+=" invisible"
6791}
6792if(e.readonly){
6793l.className+=" readonly"
6794}
6795if(e.type!="struct"){
6796l.className+=" "+e.type;
6797var a=document.createElement("td");
6798a.className="label";
6799if(e.type=="checkboxgroup"){
6800a.className+=" grouplabel"
6801}
6802l.appendChild(a);
6803var h=AjxStringUtil.htmlEncode(e.label||e.name);
6804if(e.required){
6805h+="<span class='DwtPropertyEditor-required'>*</span>"
6806}
6807a.innerHTML=h;
6808var o=document.createElement("td");
6809o.className="field";
6810l.appendChild(o);
6811switch(e.type){
6812case"boolean":this._createCheckbox(e,o);
6813break;
6814case"enum":this._createDropDown(e,o);
6815break;
6816case"date":this._createCalendar(e,o);
6817break;
6818case"checkboxgroup":this._createCheckBoxGroup(e,o);
6819break;
6820default:if(this._useDwtInputField){
6821this._createInputField(e,o)
6822}else{
6823o.innerHTML=e._makeDisplayValue();
6824l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._edit,e)
6825}
6826break
6827}
6828e._fieldCellId=o.id=Dwt.getNextId();
6829if(a.offsetWidth>this.maxLabelWidth){
6830this.maxLabelWidth=a.offsetWidth
6831}
6832if(o.offsetWidth>this.maxFieldWidth){
6833this.maxFieldWidth=o.offsetWidth
6834}}else{
6835var n=document.createElement("td");
6836n.colSpan=2;
6837l.appendChild(n);
6838n.className="label";
6839l.className+=" expander-collapsed";
6840n.innerHTML=["<div>",AjxStringUtil.htmlEncode(e.label),"</div>"].join("");
6841this.initProperties(e.children,e);
6842l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._toggle,e)
6843}
6844if(t>0){
6845l.style.display="none";
6846c._hidden=true
6847}};
6848DwtPropertyEditor.prototype.setFixedLabelWidth=function(e){
6849try{
6850this.getTable().rows[0].cells[0].style.width=(e||this.maxLabelWidth)+"px"
6851}
6852catch(t){}};
6853DwtPropertyEditor.prototype.setFixedFieldWidth=function(e){
6854try{
6855this.getTable().rows[0].cells[1].style.width=(e||this.maxFieldWidth)+"px"
6856}
6857catch(t){}};
6858DwtPropertyEditor.prototype._setCurrentMsgDiv=function(e){
6859this._currentMsgDiv=e;
6860this._currentMsgDivTimer=setTimeout(DwtPropertyEditor.simpleClosure(this._clearMsgDiv,this),DwtPropertyEditor.MSG_TIMEOUT)
6861};
6862DwtPropertyEditor.prototype._clearMsgDiv=function(){
6863try{
6864this._stopMsgDivTimer()
6865}
6866catch(e){}
6867var t=this._currentMsgDiv;
6868if(t){
6869t.parentNode.removeChild(t);
6870this._currentMsgDiv=t=null;
6871this._currentMsgDivTimer=null
6872}};
6873DwtPropertyEditor.prototype._stopMsgDivTimer=function(){
6874if(this._currentMsgDivTimer){
6875clearTimeout(this._currentMsgDivTimer);
6876this._currentMsgDivTimer=null
6877}};
6878DwtPropertyEditor.prototype.addChild=function(e){
6879if(!this._currentFieldCell){
6880DwtComposite.prototype.addChild.call(this,e)
6881}else{
6882this._children.add(e);
6883this._currentFieldCell.appendChild(e.getHtmlElement())
6884}};
6885DwtPropertyEditor.prototype._createCheckbox=function(a,t){
6886var e=document.createElement("input");
6887e._prop=a;
6888e.id=a.name;
6889e.type="checkbox";
6890if(AjxEnv.isIE){
6891e.attachEvent("onclick",a._onCheckboxChange)
6892}else{
6893e.addEventListener("click",a._onCheckboxChange,false)
6894}
6895this._children.add(e);
6896t.appendChild(e);
6897if(a.value=="true"){
6898e.checked=a.value
6899}};
6900DwtPropertyEditor.prototype._createCheckBoxGroup=function(e,n){
6901var t=document.createElement("div");
6902t._prop=e;
6903t.id=e.name;
6904e._checkBox=[];
6905t.appendChild(document.createTextNode(e.value));
6906var l=document.createElement("table");
6907l.id=Dwt.getNextId();
6908l.border=0;
6909l.cellSpacing=l.cellPadding=0;
6910l.appendChild(document.createElement("tbody"));
6911for(var a=0;
6912a<e.checkBox.length;
6913a++){
6914var s=document.createElement("tr");
6915var c=document.createElement("td");
6916c.className="field";
6917var o=this._createCheckboxForGroup(e,e.checkBox[a],c);
6918s.appendChild(c);
6919o._label=e.checkBox[a].label;
6920var h=document.createElement("td");
6921h.className="field";
6922h.appendChild(document.createTextNode(e.checkBox[a].label));
6923s.appendChild(h);
6924l.firstChild.appendChild(s);
6925e._checkBox[a]=o
6926}
6927t.appendChild(l);
6928this._children.add(t);
6929n.appendChild(t);
6930return t
6931};
6932DwtPropertyEditor.prototype._createCheckboxForGroup=function(e,i,a){
6933var t=document.createElement("input");
6934t._prop=e;
6935t.id=i.name;
6936t.type="checkbox";
6937if(i.value=="true"){
6938t.checked=i.value
6939}
6940if(AjxEnv.isIE){
6941t.attachEvent("onclick",e._onCheckboxGroupChange)
6942}else{
6943t.addEventListener("click",e._onCheckboxGroupChange,false)
6944}
6945this._children.add(t);
6946a.appendChild(t);
6947return t
6948};
6949DwtPropertyEditor.prototype._createDropDown=function(h,s){
6950this._currentFieldCell=s;
6951var o,n,a=0,t=[],e=h.item;
6952while(o=e[a]){
6953t[a++]=new DwtSelectOption(o.value,o.value==h.value,o.label)
6954}
6955h._select=n=new DwtSelect({
6956parent:this,options:t}
6957);
6958n.addChangeListener(new AjxListener(h,h._onSelectChange));
6959n.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown);
6960this._currentFieldCell=null
6961};
6962DwtPropertyEditor.prototype._createCalendar=function(n,i){
6963this._currentFieldCell=i;
6964var t=new DwtButton({
6965parent:this}
6966);
6967this._currentFieldCell=null;
6968t.setText(n._makeDisplayValue());
6969var o=new DwtMenu({
6970parent:t,style:DwtMenu.CALENDAR_PICKER_STYLE}
6971);
6972o.setAssociatedObj(t);
6973var a=new DwtCalendar({
6974parent:o}
6975);
6976var e=new Date();
6977e.setTime(n.value);
6978a.setDate(e);
6979a.setSize(150,"auto");
6980a.addSelectionListener(new AjxListener(n,n._onCalendarSelect));
6981t.setMenu(o);
6982n._dateButton=t;
6983n._dateCalendar=a
6984};
6985DwtPropertyEditor.DWT_INPUT_FIELD_TYPES={
6986string:DwtInputField.STRING,password:DwtInputField.PASSWORD,integer:DwtInputField.INTEGER,number:DwtInputField.FLOAT};
6987DwtPropertyEditor.prototype._createInputField=function(i,a){
6988this._currentFieldCell=a;
6989var e=DwtPropertyEditor.DWT_INPUT_FIELD_TYPES[i.type]||DwtInputField.STRING;
6990var t=new DwtInputField({
6991parent:this,type:e,initialValue:i.value,maxLen:i.maxLength,rows:i.rows}
6992);
6993if(e==DwtInputField.INTEGER||e==DwtInputField.FLOAT){
6994t.setValidNumberRange(i.minValue||null,i.maxValue||null);
6995if(i.decimals!=null){
6996t.setNumberPrecision(i.decimals)
6997}}
6998if(e==DwtInputField.STRING||e==DwtInputField.PASSWORD){
6999t.setValidStringLengths(i.minLength,i.maxLength)
7000}
7001if(i.required){
7002t.setRequired()
7003}
7004this._currentFieldCell=null;
7005i._inputField=t;
7006t.setValue(i.value);
7007if(i.readonly){
7008t.setReadOnly(true)
7009}
7010t.setValidationCallback(new AjxCallback(i,i._onDwtInputFieldValidated))
7011};
7012DwtPropertyEditor._prop_functions={
7013_init:function(){
7014this.type!=null||(this.type="string");
7015this.value!=null||(this.value="");
7016this._initialVal=this.value;
7017if(this.type=="date"){
7018if(!this.value){
7019this.value=new Date().getTime()
7020}
7021if(!this.format){
7022this.format=AjxDateUtil.getSimpleDateFormat().toPattern()
7023}}}
7024,_modified:function(){
7025return this._initialVal!=this.value
7026}
7027,_getRowEl:function(){
7028return document.getElementById(this._rowElId)
7029}
7030,_makeDisplayValue:function(){
7031var t=this._getValue();
7032switch(this.type){
7033case"password":t=t.replace(/./g,"*");
7034break;
7035case"date":var e=new Date();
7036e.setTime(t);
7037t=AjxDateFormat.format(this.format,e);
7038break
7039}
7040if(t==""){
7041t="<br />"
7042}else{
7043t=AjxStringUtil.htmlEncode(String(t))
7044}
7045return t
7046}
7047,_display:function(o){
7048var n=this.children,a=o?"":"none";
7049if(n){
7050var e=n.length;
7051while(--e>=0){
7052n[e]._getRowEl().style.display=a;
7053if(!o){
7054n[e]._display(false)
7055}}
7056this._hidden=!o;
7057var t=this._getRowEl();
7058t.className=t.className.replace(/expander-[^\s]+/,o?"expander-expanded":"expander-collapsed")
7059}}
7060,_toggle:function(){
7061this._display(this._hidden)
7062}
7063,_edit:function(){
7064if(this.readonly){
7065return
7066}
7067switch(this.type){
7068case"string":case"number":case"integer":case"password":setTimeout(DwtPropertyEditor.simpleClosure(this._createInputField,this),50);
7069break
7070}}
7071,_createInputField:function(){
7072var e=this._propertyEditor;
7073var n=document.getElementById(this._fieldCellId);
7074var a=e.getRelDiv();
7075var t=document.createElement("input");
7076t.className="DwtPropertyEditor-input "+this.type;
7077t.setAttribute("autocomplete","off");
7078t.type=this.type=="password"?"password":"text";
7079var o=n.offsetLeft,i=n.offsetTop;
7080if(AjxEnv.isGeckoBased){
7081--o;
7082--i
7083}
7084t.style.left=o+"px";
7085t.style.top=i+"px";
7086t.style.width=n.offsetWidth+1+"px";
7087t.style.height=n.offsetHeight+1+"px";
7088t.value=this._getValue();
7089a.appendChild(t);
7090t.focus();
7091t.onblur=DwtPropertyEditor.simpleClosure(this._saveInput,this);
7092t.onkeydown=DwtPropertyEditor.simpleClosure(this._inputKeyPress,this);
7093this._propertyEditor._currentInputField=this._inputField=t;
7094if(!AjxEnv.isGeckoBased){
7095t.select()
7096}else{
7097t.setSelectionRange(0,t.value.length)
7098}}
7099,_getValue:function(){
7100return this.value||""
7101}
7102,_checkValue:function(a){
7103var e=a=="";
7104if(e){
7105if(!this.required){
7106return a
7107}
7108this._displayMsg(AjxMsg.valueIsRequired);
7109return null
7110}
7111if(this.maxLength!=null&&a.length>this.maxLength){
7112this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooLong,this.maxLength));
7113return null
7114}
7115if(this.minLength!=null&&a.length<this.minLength){
7116this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooShort,this.minLength));
7117return null
7118}
7119if(this.mustMatch&&!this.mustMatch.test(a)){
7120this._displayMsg(this.msg_mustMatch||DwtPropertyEditor.MSG.mustMatch.replace(/REGEXP/,this.mustMatch.toString()));
7121return null
7122}
7123if(this.mustNotMatch&&this.mustNotMatch.test(a)){
7124this._displayMsg(this.msg_mustNotMatch||DwtPropertyEditor.MSG.mustNotMatch.replace(/REGEXP/,this.mustNotMatch.toString()));
7125return null
7126}
7127switch(this.type){
7128case"integer":case"number":var o=new Number(a);
7129if(isNaN(o)){
7130this._displayMsg(AjxMsg.notANumber);
7131return null
7132}
7133if(this.type=="integer"&&Math.round(o)!=o){
7134this._displayMsg(AjxMsg.notAnInteger);
7135return null
7136}
7137if(this.minValue!=null&&o<this.minValue){
7138this._displayMsg(AjxMessageFormat.format(AjxMsg.numberLessThanMin,this.minValue));
7139return null
7140}
7141if(this.maxValue!=null&&o>this.maxValue){
7142this._displayMsg(AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this.maxValue));
7143return null
7144}
7145a=o;
7146if(this.type=="number"&&this.decimals!=null){
7147var t=a.toString();
7148var i=t.indexOf(".");
7149if(i==-1){
7150i=t.length
7151}
7152a=a.toPrecision(i+this.decimals)
7153}
7154break
7155}
7156return a
7157}
7158,_displayMsg:function(t){
7159var s,n,l,i;
7160var o=this._propertyEditor;
7161var e=o._currentMsgDiv;
7162if(!e){
7163e=document.createElement("div");
7164e.className="DwtPropertyEditor-ErrorMsg";
7165o.getRelDiv().appendChild(e)
7166}else{
7167o._stopMsgDivTimer()
7168}
7169e.style.visibility="hidden";
7170e.innerHTML=AjxStringUtil.htmlEncode(t);
7171var c=o.getTable();
7172l=c.offsetWidth;
7173if(!AjxEnv.isIE){
7174l-=12
7175}
7176s=c.offsetLeft;
7177e.style.left=s+"px";
7178e.style.width=l+"px";
7179i=e.offsetHeight;
7180var a=document.getElementById(this._fieldCellId);
7181n=a.offsetTop+a.offsetHeight;
7182if(n+i>c.offsetTop+c.offsetHeight){
7183n=a.offsetTop-i
7184}
7185e.style.top=n+"px";
7186e.style.visibility="";
7187o._setCurrentMsgDiv(e)
7188}
7189,_saveInput:function(){
7190var e=this._inputField;
7191var t=this._checkValue(e.value);
7192if(t!=null){
7193this._setValue(t);
7194e.onblur=e.onkeyup=e.onkeydown=e.onkeypress=null;
7195var a=document.getElementById(this._fieldCellId);
7196a.innerHTML=this._makeDisplayValue();
7197this._inputField=null;
7198this._propertyEditor._currentInputField=null;
7199this._propertyEditor._clearMsgDiv();
7200e.parentNode.removeChild(e);
7201return true
7202}else{
7203if(e.className.indexOf(" DwtPropertyEditor-input-error")==-1){
7204e.className+=" DwtPropertyEditor-input-error"
7205}
7206e.focus();
7207return false
7208}}
7209,_inputKeyPress:function(t){
7210t||(t=window.event);
7211var e=this._inputField;
7212if(t.keyCode==13){
7213this._saveInput()
7214}else{
7215if(t.keyCode==27){
7216e.value=this._getValue();
7217this._saveInput()
7218}else{
7219this._propertyEditor._clearMsgDiv();
7220e.className=e.className.replace(/ DwtPropertyEditor-input-error/,"")
7221}}}
7222,_onCheckboxChange:function(t){
7223t||(t=window.event);
7224var e=AjxEnv.isIE?t.srcElement:t.target;
7225e._prop._setValue(e.checked?"true":"false")
7226}
7227,_onSelectChange:function(){
7228this._setValue(this._select.getValue())
7229}
7230,_onCheckboxGroupChange:function(o){
7231o||(o=window.event);
7232var a=AjxEnv.isIE?o.srcElement:o.target;
7233var e=a._prop._checkBox;
7234var n=[];
7235for(var t=0;
7236t<e.length;
7237t++){
7238if(e[t].checked){
7239n.push(e[t]._label)
7240}}
7241a._prop._setValue(n)
7242}
7243,_onCalendarSelect:function(){
7244this._setValue(this._dateCalendar.getDate().getTime());
7245this._dateButton.setText(this._makeDisplayValue())
7246}
7247,_onDwtInputFieldValidated:function(e,a,t){
7248if(a){
7249this._setValue(t)
7250}}
7251,_setValue:function(t){
7252this.value=t;
7253var e=this._getRowEl();
7254e.className=e.className.replace(/ dirty/,"");
7255if(this._modified()){
7256e.className+=" dirty"
7257}}
7258,_validate:function(){
7259if(this._inputField){
7260if(this._inputField instanceof DwtInputField){
7261return this._inputField.validate()
7262}else{
7263return this._inputField.onblur()
7264}}else{
7265return true
7266}}};
7267DwtPropertyEditor.simpleClosure=function(e,t){
7268return function(){
7269return e.call(t,arguments[0])
7270}
7271}
7272}
7273if(AjxPackage.define("ajax.dwt.widgets.DwtConfirmDialog")){
7274DwtConfirmDialog=function(t,e){
7275if(arguments.length==0){
7276return
7277}
7278var a=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.CANCEL_BUTTON];
7279DwtDialog.call(this,{
7280parent:t,className:e,title:AjxMsg.confirmTitle,standardButtons:a}
7281);
7282this._questionDiv=document.createElement("DIV");
7283this._questionDiv.className="DwtConfirmDialogQuestion";
7284this._getContentDiv().appendChild(this._questionDiv);
7285this.registerCallback(DwtDialog.YES_BUTTON,this._handleYesButton,this);
7286this.registerCallback(DwtDialog.NO_BUTTON,this._handleNoButton,this);
7287this.registerCallback(DwtDialog.CANCEL_BUTTON,this._handleCancelButton,this)
7288};
7289DwtConfirmDialog.prototype=new DwtDialog;
7290DwtConfirmDialog.prototype.constructor=DwtConfirmDialog;
7291DwtConfirmDialog.prototype.toString=function(){
7292return"DwtConfirmDialog"
7293};
7294DwtConfirmDialog.prototype.popup=function(a,e,i,t,o){
7295this._questionDiv.innerHTML=a||"";
7296this._yesCallback=e;
7297this._noCallback=i;
7298this._cancelCallback=t;
7299this.setButtonVisible(DwtDialog.CANCEL_BUTTON,Boolean(i));
7300DwtDialog.prototype.popup.call(this,o)
7301};
7302DwtConfirmDialog.prototype.popdown=function(){
7303this._yesCallback=this._noCallback=this._cancelCallback=null;
7304DwtDialog.prototype.popdown.call(this)
7305};
7306DwtConfirmDialog.prototype._handleYesButton=function(e){
7307if(this._yesCallback){
7308this._yesCallback.run(e)
7309}
7310this.popdown()
7311};
7312DwtConfirmDialog.prototype._handleNoButton=function(e){
7313if(this._noCallback){
7314this._noCallback.run(e)
7315}
7316this.popdown()
7317};
7318DwtConfirmDialog.prototype._handleCancelButton=function(e){
7319if(this._cancelCallback){
7320this._cancelCallback.run(e)
7321}
7322this.popdown()
7323};
7324DwtConfirmDialog.prototype._getSeparatorTemplate=function(){
7325return""
7326}
7327}
7328if(AjxPackage.define("ajax.dwt.widgets.DwtChooser")){
7329DwtChooser=function(a){
7330if(arguments.length==0){
7331return
7332}
7333DwtComposite.call(this,a.parent,a.className);
7334this._slvClassName=a.slvClassName;
7335this._tlvClassName=a.tlvClassName;
7336this._layoutStyle=a.layoutStyle?a.layoutStyle:DwtChooser.HORIZ_STYLE;
7337this._selectStyle=a.selectStyle?a.selectStyle:DwtChooser.MULTI_SELECT;
7338this._mode=a.listStyle?a.listStyle:DwtChooser.MODE_MOVE;
7339this._noDuplicates=(a.noDuplicates!==false);
7340this._singleHeight=a.singleHeight?a.singleHeight:45;
7341this._listSize=a.listSize;
7342this._sourceEmptyOk=a.sourceEmptyOk;
7343this._allButtons=a.allButtons;
7344this._hasTextField=a.hasTextField;
7345this._handleButtonInfo(a.buttonInfo);
7346this._mode=a.mode?a.mode:this._hasMultiButtons?DwtChooser.MODE_COPY:DwtChooser.MODE_MOVE;
7347this._createHtml();
7348this._initialize();
7349var t=a.parent.getSize();
7350var i=a.listWidth||t.x;
7351var e=a.listHeight||t.y;
7352if(i&&e){
7353this.resize(i,e)
7354}};
7355DwtChooser.prototype=new DwtComposite;
7356DwtChooser.prototype.constructor=DwtChooser;
7357DwtChooser.HORIZ_STYLE=1;
7358DwtChooser.VERT_STYLE=2;
7359DwtChooser.SINGLE_SELECT=1;
7360DwtChooser.MULTI_SELECT=2;
7361DwtChooser.MODE_COPY=1;
7362DwtChooser.MODE_MOVE=2;
7363DwtChooser.REMOVE_BTN_ID="__remove__";
7364DwtChooser.ADD_ALL_BTN_ID="__addAll__";
7365DwtChooser.REMOVE_ALL_BTN_ID="__removeAll__";
7366DwtChooser.prototype.toString=function(){
7367return"DwtChooser"
7368};
7369DwtChooser.prototype.setItems=function(t,e,a){
7370e=e?e:DwtChooserListView.SOURCE;
7371this._reset(e);
7372this.addItems(t,e,true);
7373this._selectFirst(e);
7374if(a){
7375this._reset((e==DwtChooserListView.SOURCE)?DwtChooserListView.TARGET:DwtChooserListView.SOURCE)
7376}};
7377DwtChooser.prototype.getItems=function(e){
7378e=e?e:DwtChooserListView.TARGET;
7379if(e==DwtChooserListView.SOURCE){
7380return this.sourceListView.getList().clone()
7381}else{
7382if(this._hasMultiButtons){
7383var a={};
7384for(var t in this._data){
7385a[t]=this._data[t].clone()
7386}
7387return a
7388}else{
7389return this._data[this._buttonInfo[0].id].clone()
7390}}};
7391DwtChooser.prototype.addItems=function(t,e,o,h){
7392e=e?e:DwtChooserListView.SOURCE;
7393var s=(t instanceof AjxVector)?t.getArray():(t instanceof Array)?t:[t];
7394if(e==DwtChooserListView.SOURCE){
7395for(var a=0;
7396a<s.length;
7397a++){
7398this._addToSource(s[a],null,o)
7399}}else{
7400var n;
7401if(this._selectStyle==DwtChooser.SINGLE_SELECT){
7402this.targetListView._resetList();
7403s=(s.length>0)?[s[0]]:s
7404}
7405for(var a=0;
7406a<s.length;
7407a++){
7408this._addToTarget(s[a],h,o)
7409}}
7410if(e==DwtChooserListView.SOURCE){
7411var s=this.sourceListView.getList();
7412this._sourceSize=s?s.size():0
7413}};
7414DwtChooser.prototype.removeItems=function(o,e,a){
7415o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
7416for(var t=0;
7417t<o.length;
7418t++){
7419(e==DwtChooserListView.SOURCE)?this._removeFromSource(o[t],a):this._removeFromTarget(o[t],a)
7420}};
7421DwtChooser.prototype.transfer=function(t,i,e){
7422i=i?i:this._activeButtonId;
7423this._setActiveButton(i);
7424if(this._mode==DwtChooser.MODE_MOVE){
7425if(this._selectStyle==DwtChooser.SINGLE_SELECT){
7426var a=this.targetListView.getList();
7427if(a&&a.size()){
7428this.remove(a,true)
7429}}
7430this.removeItems(t,DwtChooserListView.SOURCE,true)
7431}
7432this.addItems(t,DwtChooserListView.TARGET,e);
7433this.sourceListView.deselectAll()
7434};
7435DwtChooser.prototype.remove=function(o,a){
7436o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
7437if(this._mode==DwtChooser.MODE_MOVE){
7438for(var t=0;
7439t<o.length;
7440t++){
7441var e=this._getInsertionIndex(this.sourceListView,o[t]);
7442this.sourceListView.addItem(o[t],e,true)
7443}
7444this._sourceSize=o?o.length:0
7445}
7446this.removeItems(o,DwtChooserListView.TARGET)
7447};
7448DwtChooser.prototype.setSelectStyle=function(i,s){
7449if(i==this._selectStyle){
7450return
7451}
7452this._selectStyle=i;
7453if(this._defLabel){
7454var t=this._button[this._buttonInfo[0].id];
7455t.setText((i==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add)
7456}
7457if(!s){
7458var o=this.getSize();
7459this.resize(o.x,o.y)
7460}
7461if(this._allButtons){
7462this._addAllButton.setVisible(i==DwtChooser.MULTI_SELECT);
7463this._removeAllButton.setVisible(i==DwtChooser.MULTI_SELECT);
7464this._enableButtons()
7465}
7466if(i==DwtChooser.SINGLE_SELECT){
7467var n=this.targetListView.getList();
7468var e=n?n.clone().getArray():null;
7469if(e&&e.length){
7470this._reset(DwtChooserListView.TARGET);
7471this.addItems(e[0],DwtChooserListView.TARGET,true);
7472this.targetListView.deselectAll();
7473if(e.length>1&&this._mode==DwtChooser.MODE_MOVE){
7474this.addItems(e.slice(1),DwtChooserListView.SOURCE,true)
7475}
7476this._enableButtons()
7477}}
7478this.sourceListView.multiSelectEnabled=(i==DwtChooser.MULTI_SELECT);
7479this.targetListView.multiSelectEnabled=(i==DwtChooser.MULTI_SELECT)
7480};
7481DwtChooser.prototype.reset=function(e){
7482this._reset(e);
7483this._setActiveButton(this._buttonInfo[0].id);
7484this._enableButtons();
7485if(this._hasTextField){
7486this._textField.setValue("")
7487}};
7488DwtChooser.prototype._reset=function(e){
7489if(!e||e==DwtChooserListView.SOURCE){
7490this.sourceListView._resetList()
7491}
7492if(!e||e==DwtChooserListView.TARGET){
7493this.targetListView._resetList();
7494for(var t in this._data){
7495this._data[t].removeAll()
7496}}};
7497DwtChooser.prototype.addStateChangeListener=function(e){
7498this.targetListView.addStateChangeListener(e)
7499};
7500DwtChooser.prototype.removeStateChangeListener=function(e){
7501this.targetListView.removeStateChangeListener(e)
7502};
7503DwtChooser.prototype.getSourceListView=function(){
7504return document.getElementById(this._sourceListViewDivId)
7505};
7506DwtChooser.prototype.getButtons=function(){
7507return document.getElementById(this._buttonsDivId)
7508};
7509DwtChooser.prototype.getTargetListView=function(){
7510return document.getElementById(this._targetListViewDivId)
7511};
7512DwtChooser.prototype.getTextField=function(){
7513return this._textField
7514};
7515DwtChooser.prototype._createHtml=function(){
7516this._sourceListViewDivId=Dwt.getNextId();
7517this._targetListViewDivId=Dwt.getNextId();
7518this._buttonsDivId=Dwt.getNextId();
7519this._removeButtonDivId=Dwt.getNextId();
7520if(this._allButtons){
7521this._addAllButtonDivId=Dwt.getNextId();
7522this._removeAllButtonDivId=Dwt.getNextId()
7523}
7524if(this._hasTextField){
7525this._textFieldTdId=Dwt.getNextId()
7526}
7527var a=[];
7528var e=0;
7529if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
7530a[e++]="<table cellspacing=0 cellpadding=0 border=0>";
7531a[e++]="<tr>";
7532a[e++]="<td id='";
7533a[e++]=this._sourceListViewDivId;
7534a[e++]="'></td>";
7535a[e++]="<td valign='middle' id='";
7536a[e++]=this._buttonsDivId;
7537a[e++]="'>";
7538if(this._allButtons){
7539a[e++]="<div id='";
7540a[e++]=this._addAllButtonDivId;
7541a[e++]="'></div><br>"
7542}
7543for(var t=0;
7544t<this._buttonInfo.length;
7545t++){
7546var o=this._buttonInfo[t].id;
7547a[e++]="<div id='";
7548a[e++]=this._buttonDivId[o];
7549a[e++]="'></div><br>"
7550}
7551a[e++]="<br><div id='";
7552a[e++]=this._removeButtonDivId;
7553a[e++]="'></div>";
7554if(this._allButtons){
7555a[e++]="<br><div id='";
7556a[e++]=this._removeAllButtonDivId;
7557a[e++]="'></div><br>"
7558}
7559a[e++]="</td>";
7560a[e++]="<td id='";
7561a[e++]=this._targetListViewDivId;
7562a[e++]="'></td>";
7563a[e++]="</tr>";
7564if(this._hasTextField){
7565a[e++]="<tr><td>";
7566a[e++]="<table border=0 width=100%><tr><td style='white-space:nowrap; width:1%'>";
7567a[e++]=AjxMsg.add;
7568a[e++]=":</td><td id='";
7569a[e++]=this._textFieldTdId;
7570a[e++]="'></td></tr></table>";
7571a[e++]="</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
7572}
7573a[e++]="</table>"
7574}else{
7575a[e++]="<div id='";
7576a[e++]=this._sourceListViewDivId;
7577a[e++]="'></div>";
7578a[e++]="<div align='center' id='";
7579a[e++]=this._buttonsDivId;
7580a[e++]="'>";
7581a[e++]="<table><tr>";
7582if(this._allButtons){
7583a[e++]="<td id='";
7584a[e++]=this._addAllButtonDivId;
7585a[e++]="'></td>"
7586}
7587for(var t=0;
7588t<this._buttonInfo.length;
7589t++){
7590var o=this._buttonInfo[t].id;
7591a[e++]="<td id='";
7592a[e++]=this._buttonDivId[o];
7593a[e++]="'></td>"
7594}
7595a[e++]="<td id='";
7596a[e++]=this._removeButtonDivId;
7597a[e++]="'></td>";
7598if(this._allButtons){
7599a[e++]="<td id='";
7600a[e++]=this._removeAllButtonDivId;
7601a[e++]="'></td>"
7602}
7603a[e++]="</tr></table></div>";
7604a[e++]="<div id='";
7605a[e++]=this._targetListViewDivId;
7606a[e++]="'></div>"
7607}
7608this.getHtmlElement().innerHTML=a.join("")
7609};
7610DwtChooser.prototype._handleButtonInfo=function(t){
7611if(!t){
7612this._defLabel=(this._selectStyle==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add;
7613t=[{
7614label:this._defLabel}
7615]
7616}
7617this._buttonInfo=t;
7618this._buttonDivId={};
7619this._buttonId={};
7620if(this._buttonInfo.length==1){
7621if(!this._buttonInfo[0].id){
7622this._buttonInfo[0].id=Dwt.getNextId()
7623}
7624this._activeButtonId=this._buttonInfo[0].id
7625}
7626for(var e=0;
7627e<this._buttonInfo.length;
7628e++){
7629var a=this._buttonInfo[e].id;
7630this._buttonDivId[a]=Dwt.getNextId();
7631this._buttonId[a]=Dwt.getNextId()
7632}
7633this._hasMultiButtons=(this._buttonInfo.length>1)
7634};
7635DwtChooser.prototype._initialize=function(){
7636var e=new AjxListener(this,this._transferButtonListener);
7637this._button={};
7638this._buttonIndex={};
7639this._data={};
7640for(var t=0;
7641t<this._buttonInfo.length;
7642t++){
7643var o=this._buttonInfo[t].id;
7644this._button[o]=this._setupButton(o,this._buttonId[o],this._buttonDivId[o],this._buttonInfo[t].label);
7645this._button[o].addSelectionListener(e);
7646this._buttonIndex[o]=t;
7647this._data[o]=new AjxVector()
7648}
7649this.sourceListView=this._createSourceListView();
7650this._addListView(this.sourceListView,this._sourceListViewDivId);
7651this.sourceListView.addSelectionListener(new AjxListener(this,this._sourceListener));
7652this.targetListView=this._createTargetListView();
7653this._addListView(this.targetListView,this._targetListViewDivId);
7654this.targetListView.addSelectionListener(new AjxListener(this,this._targetListener));
7655this._removeButtonId=Dwt.getNextId();
7656this._removeButton=this._setupButton(DwtChooser.REMOVE_BTN_ID,this._removeButtonId,this._removeButtonDivId,AjxMsg.remove);
7657this._removeButton.addSelectionListener(new AjxListener(this,this._removeButtonListener));
7658if(this._allButtons){
7659this._addAllButtonId=Dwt.getNextId();
7660this._addAllButton=this._setupButton(DwtChooser.ADD_ALL_BTN_ID,this._addAllButtonId,this._addAllButtonDivId,AjxMsg.addAll);
7661this._addAllButton.addSelectionListener(new AjxListener(this,this._addAllButtonListener));
7662this._removeAllButtonId=Dwt.getNextId();
7663this._removeAllButton=this._setupButton(DwtChooser.REMOVE_ALL_BTN_ID,this._removeAllButtonId,this._removeAllButtonDivId,AjxMsg.removeAll);
7664this._removeAllButton.addSelectionListener(new AjxListener(this,this._removeAllButtonListener));
7665if(this._selectStyle==DwtChooser.SINGLE_SELECT){
7666this._addAllButton.setVisible(false);
7667this._removeAllButton.setVisible(false)
7668}}
7669if(this._hasTextField){
7670var a={
7671parent:this,type:DwtInputField.STRING};
7672this._textField=new DwtInputField(a);
7673this._textField.reparentHtmlElement(this._textFieldTdId);
7674this._textField._chooser=this;
7675this._textField.setHandler(DwtEvent.ONKEYUP,DwtChooser._onKeyUp);
7676Dwt.setSize(this._textField.getInputElement(),"100%",Dwt.DEFAULT)
7677}
7678if(this._selectStyle==DwtChooser.SINGLE_SELECT){
7679this.sourceListView.multiSelectEnabled=false;
7680this.targetListView.multiSelectEnabled=false
7681}};
7682DwtChooser.prototype._createSourceListView=function(){
7683return new DwtChooserListView(this,DwtChooserListView.SOURCE,this._slvClassName)
7684};
7685DwtChooser.prototype._createTargetListView=function(){
7686return new DwtChooserListView(this,DwtChooserListView.TARGET,this._tlvClassName)
7687};
7688DwtChooser.prototype._addListView=function(t,a){
7689var e=document.getElementById(a);
7690e.appendChild(t.getHtmlElement());
7691t.setUI(null,true);
7692t._initialized=true
7693};
7694DwtChooser.prototype.resize=function(o,e){
7695if(!o||!e){
7696return
7697}
7698if(o==Dwt.DEFAULT&&e==Dwt.DEFAULT){
7699return
7700}
7701var a=document.getElementById(this._buttonsDivId);
7702var s=Dwt.getSize(a);
7703var t,i,n;
7704if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
7705t=this._listSize?this._listSize:(o==Dwt.DEFAULT)?o:Math.floor(((o-s.x)/2)-12);
7706i=n=e
7707}else{
7708t=o;
7709if(this._selectStyle==DwtChooser.SINGLE_SELECT){
7710i=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:e-s.y-this._singleHeight-30;
7711n=(e==Dwt.DEFAULT)?e:e-s.y-i-30
7712}else{
7713i=n=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:Math.floor(((e-s.y)/2)-12)
7714}}
7715this.sourceListView.setSize(t+2,i);
7716this.targetListView.setSize(t+2,n)
7717};
7718DwtChooser.prototype._setupButton=function(n,a,o,e){
7719var t=new DwtButton({
7720parent:this,id:a}
7721);
7722t.setText(e);
7723t.id=a;
7724t._buttonId=n;
7725var i=document.getElementById(o);
7726i.appendChild(t.getHtmlElement());
7727return t
7728};
7729DwtChooser.prototype._sourceListener=function(e){
7730if(e.detail==DwtListView.ITEM_DBL_CLICKED){
7731this.transfer(this.sourceListView.getSelection(),this._activeButtonId);
7732this.sourceListView.deselectAll()
7733}else{
7734if(this._activeButtonId==DwtChooser.REMOVE_BTN_ID){
7735var t=this._lastActiveTransferButtonId?this._lastActiveTransferButtonId:this._buttonInfo[0].id;
7736this._setActiveButton(t)
7737}}
7738this.targetListView.deselectAll();
7739this._enableButtons()
7740};
7741DwtChooser.prototype._targetListener=function(e){
7742if(e.detail==DwtListView.ITEM_DBL_CLICKED){
7743this.remove(this.targetListView.getSelection())
7744}else{
7745this._setActiveButton(DwtChooser.REMOVE_BTN_ID);
7746this.sourceListView.deselectAll();
7747this._enableButtons()
7748}};
7749DwtChooser.prototype._transferButtonListener=function(a){
7750var t=DwtControl.getTargetControl(a);
7751var n=t._buttonId;
7752var o=this.sourceListView.getSelection();
7753if(o&&o.length){
7754this.transfer(o,n);
7755var i=this.sourceListView.getList();
7756if(i&&i.size()){
7757this._selectFirst(DwtChooserListView.SOURCE)
7758}else{
7759this._enableButtons()
7760}}else{
7761var e=this._getEmailFromText();
7762if(e){
7763this.transfer([e],n)
7764}else{
7765this._setActiveButton(n)
7766}}};
7767DwtChooser.prototype._removeButtonListener=function(e){
7768this.remove(this.targetListView.getSelection());
7769var t=this.targetListView.getList();
7770if(t&&t.size()){
7771this._selectFirst(DwtChooserListView.TARGET)
7772}else{
7773this._enableButtons()
7774}};
7775DwtChooser.prototype._addAllButtonListener=function(e){
7776this.transfer(this.sourceListView.getList().clone());
7777this._selectFirst(DwtChooserListView.TARGET)
7778};
7779DwtChooser.prototype._removeAllButtonListener=function(e){
7780this.remove(this.targetListView.getList().clone());
7781this._selectFirst(DwtChooserListView.SOURCE)
7782};
7783DwtChooser.prototype._enableButtons=function(a,h){
7784var l=this.sourceListView.getList();
7785var d=this.targetListView.getList();
7786var o=(a||(this.sourceListView.getSelectionCount()>0));
7787for(var s=0;
7788s<this._buttonInfo.length;
7789s++){
7790var t=this._buttonInfo[s].id;
7791this._button[t].setEnabled(o)
7792}
7793var c=(h||(this.targetListView.getSelectionCount()>0));
7794this._removeButton.setEnabled(c);
7795if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){
7796var e=l?l.size():0;
7797var n=d?d.size():0;
7798this._addAllButton.setEnabled(e>0);
7799this._removeAllButton.setEnabled(n>0)
7800}};
7801DwtChooser.prototype._selectFirst=function(t,a){
7802var e=(t==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView;
7803var i=e.getList();
7804if(i&&i.size()>0){
7805e.setSelection(i.get(0))
7806}};
7807DwtChooser.prototype._setActiveButton=function(i){
7808if(!this._hasMultiButtons){
7809return
7810}
7811if(i!=this._activeButtonId){
7812var a=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId];
7813if(a){
7814var e=DwtControl.findControl(document.getElementById(a));
7815if(e){
7816e.setDisplayState(DwtControl.NORMAL)
7817}}
7818a=(i==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[i];
7819var t=DwtControl.findControl(document.getElementById(a));
7820if(t){
7821t.setDisplayState(DwtControl.DEFAULT)
7822}
7823this._activeButtonId=i;
7824if(i!=DwtChooser.REMOVE_BTN_ID){
7825this._lastActiveTransferButtonId=i
7826}}};
7827DwtChooser.prototype._isDuplicate=function(e,t){
7828return t.contains(e)
7829};
7830DwtChooser.prototype._addToSource=function(a,e,t){
7831if(!a){
7832return
7833}
7834if(!a._chooserIndex){
7835var i=this.sourceListView.getList();
7836a._chooserIndex=i?i.size()+1:1
7837}
7838this.sourceListView.addItem(a,e,t)
7839};
7840DwtChooser.prototype._addToTarget=function(c,e,s){
7841if(!c){
7842return
7843}
7844e=e?e:this._activeButtonId;
7845if(this._noDuplicates&&this._data[e]&&this._isDuplicate(c,this._data[e])){
7846return
7847}
7848var n=this.targetListView.getList();
7849if(n&&n.contains(c)&&c.clone){
7850var a=c.clone();
7851a.id=Dwt.getNextId();
7852c=a
7853}
7854var h=null;
7855if(this._hasMultiButtons){
7856n=[];
7857for(var t=0;
7858t<this._buttonInfo.length;
7859t++){
7860n=n.concat(this._data[this._buttonInfo[t].id].getArray())
7861}
7862var o=this._buttonIndex[e];
7863for(h=0;
7864h<n.length;
7865h++){
7866var l=this._buttonIndex[n[h]._buttonId];
7867if(l>o){
7868break
7869}}}
7870c._buttonId=e;
7871c.id=c.id||Dwt.getNextId();
7872this._data[e].add(c);
7873this.targetListView.addItem(c,h,s)
7874};
7875DwtChooser.prototype._removeFromSource=function(t,e){
7876if(!t){
7877return
7878}
7879var a=this.sourceListView.getList();
7880if(!a){
7881return
7882}
7883if(!a.contains(t)){
7884return
7885}
7886this.sourceListView.removeItem(t,e)
7887};
7888DwtChooser.prototype._removeFromTarget=function(t,e){
7889if(!t){
7890return
7891}
7892var a=this.targetListView.getList();
7893if(!a){
7894return
7895}
7896if(!a.contains(t)){
7897return
7898}
7899this._data[t._buttonId].remove(t);
7900this.targetListView.removeItem(t,e)
7901};
7902DwtChooser.prototype._getInsertionIndex=function(t,n){
7903var s=t.getList();
7904if(!s){
7905return null
7906}
7907var e=s.getArray();
7908for(var o=0;
7909o<e.length;
7910o++){
7911if(n._chooserIndex&&e[o]._chooserIndex&&(e[o]._chooserIndex>=n._chooserIndex)){
7912return o
7913}}
7914return null
7915};
7916DwtChooser.prototype._getEmailFromText=function(){
7917var t=this._textField.getValue();
7918var e=AjxEmailAddress.parse(t);
7919if(e){
7920e.id=Dwt.getNextId();
7921return e
7922}};
7923DwtChooser._onKeyUp=function(o){
7924var a=DwtUiEvent.getTarget(o);
7925var n=DwtControl.findControl(a);
7926var i=n._chooser;
7927var t=DwtKeyEvent.getCharCode(o);
7928if(t==3||t==13){
7929var e=i._getEmailFromText();
7930if(e){
7931i.transfer([e],i._activeButtonId);
7932a.value=""
7933}}
7934i._enableButtons(a.value.length)
7935};
7936DwtChooserListView=function(e){
7937if(arguments.length==0){
7938return
7939}
7940e=Dwt.getParams(arguments,DwtChooserListView.PARAMS);
7941e.className=e.className||"DwtChooserListView";
7942e.headerList=this._getHeaderList(parent);
7943DwtListView.call(this,e);
7944this.type=e.type;
7945this._chooserParent=e.parent.parent
7946};
7947DwtChooserListView.PARAMS=["parent","type","className","view"];
7948DwtChooserListView.SOURCE=1;
7949DwtChooserListView.TARGET=2;
7950DwtChooserListView.prototype=new DwtListView;
7951DwtChooserListView.prototype.constructor=DwtChooserListView;
7952DwtChooserListView.prototype._getHeaderList=function(){};
7953DwtChooserListView.prototype.toString=function(){
7954return"DwtChooserListView"
7955};
7956DwtChooserListView.prototype.setUI=function(t,e){
7957e=e?e:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk);
7958DwtListView.prototype.setUI.call(this,t,e)
7959};
7960DwtChooserListView.prototype._itemClicked=function(e,t){
7961if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){
7962return
7963}else{
7964DwtListView.prototype._itemClicked.call(this,e,t)
7965}};
7966DwtChooserListView.prototype._sortColumn=function(t,e){
7967this._chooserParent.search(t,e)
7968};
7969DwtChooserListView.prototype._getHeaderSashLocation=function(){
7970var t=this.getHtmlElement();
7971if(Dwt.getPosition(t)==Dwt.ABSOLUTE_STYLE){
7972return DwtListView.prototype._getHeaderSashLocation.call(this)
7973}
7974var a=Dwt.toWindow(t,0,0);
7975var e=Dwt.toWindow(this._chooserParent.getHtmlElement(),0,0);
7976if(!this._tmpPoint){
7977this._tmpPoint=new DwtPoint()
7978}
7979this._tmpPoint.x=a.x-e.x;
7980this._tmpPoint.y=a.y-e.y;
7981return this._tmpPoint
7982}
7983}
7984if(AjxPackage.define("ajax.dwt.widgets.DwtGridSizePicker")){
7985DwtGridSizePicker=function(e,t){
7986if(arguments.length==0){
7987return
7988}
7989DwtControl.call(this,{
7990parent:e,className:"DwtGridSizePicker"}
7991);
7992this._title=t;
7993if(e instanceof DwtMenu){
7994e.addPopdownListener(new AjxListener(this,this._reset))
7995}
7996this._reset()
7997};
7998DwtGridSizePicker.prototype=new DwtControl;
7999DwtGridSizePicker.prototype.constructor=DwtGridSizePicker;
8000DwtGridSizePicker.prototype.addSelectionListener=function(e){
8001this.addListener(DwtEvent.SELECTION,e)
8002};
8003DwtGridSizePicker.prototype.removeSelectionListener=function(e){
8004this.removeListener(DwtEvent.SELECTION,e)
8005};
8006DwtGridSizePicker.prototype._createGrid=function(){
8007var a=this.getHtmlElement();
8008var t=["<table cellpadding='0' border='0' cellspacing='0'>","<tr class='info'><td colspan='",this.maxCols,"'>",this._title,"</td></tr>"];
8009var o=["<tr class='grid'>"];
8010for(var e=0;
8011e<this.maxCols;
8012++e){
8013o.push("<td unselectable='unselectable'></td>")
8014}
8015o.push("</tr>");
8016o=o.join("");
8017for(var e=0;
8018e<this.maxRows;
8019++e){
8020t.push(o)
8021}
8022t.push("</table>");
8023t=t.join("");
8024a.innerHTML=t;
8025a.onmouseover=DwtGridSizePicker._onMouseOver;
8026a.onmouseup=DwtGridSizePicker._onSelect
8027};
8028DwtGridSizePicker.prototype._reset=function(){
8029this._endRow=-1;
8030this._endCol=-1;
8031this.maxRows=7;
8032this.maxCols=7;
8033this._createGrid()
8034};
8035DwtGridSizePicker._onSelect=function(e){
8036if(AjxEnv.isIE){
8037e=window.event
8038}
8039DwtControl.getTargetControl(e)._onSelect(e)
8040};
8041DwtGridSizePicker.prototype._onSelect=function(i){
8042if(AjxEnv.isIE){
8043i=window.event
8044}
8045var a=new DwtUiEvent();
8046a.setFromDhtmlEvent(i);
8047var o=a.target;
8048if(o.tagName.toLowerCase()=="td"){
8049var n=o.parentNode.rowIndex;
8050if(n>0){
8051var e=o.cellIndex;
8052var t=DwtShell.selectionEvent;
8053t.item=this;
8054t.detail={
8055rows:n,cols:e+1};
8056if(this.parent instanceof DwtMenu){
8057DwtMenu.closeActiveMenu()
8058}
8059this.notifyListeners(DwtEvent.SELECTION,t)
8060}}};
8061DwtGridSizePicker.prototype._onMouseOut=function(i){
8062if(AjxEnv.isIE){
8063i=window.event
8064}
8065var t=new DwtUiEvent();
8066t.setFromDhtmlEvent(i);
8067var o=t.target;
8068var a=this.getHtmlElement().firstChild;
8069try{
8070while(o&&o!==a){
8071o=o.parentNode
8072}}
8073catch(e){
8074o=null
8075}
8076if(!o){
8077this._endRow=this._endCol=-1;
8078this._update()
8079}};
8080DwtGridSizePicker._onMouseOver=function(e){
8081if(AjxEnv.isIE){
8082e=window.event
8083}
8084DwtControl.getTargetControl(e)._onMouseOver(e)
8085};
8086DwtGridSizePicker.prototype._onMouseOver=function(t){
8087var e=new DwtUiEvent(true);
8088e.setFromDhtmlEvent(t);
8089var a=e.target;
8090if(this._updateTimeout){
8091clearTimeout(this._updateTimeout)
8092}
8093this._updateTimeout=setTimeout(AjxCallback.simpleClosure(this._updateOnTimeout,this,a),10);
8094e.setToDhtmlEvent(t)
8095};
8096DwtGridSizePicker.prototype._addRow=function(){
8097var t=this.getHtmlElement().firstChild;
8098var a=t.insertRow(-1);
8099a.className="grid";
8100for(var e=0;
8101e<this.maxCols;
8102++e){
8103var o=a.insertCell(-1);
8104o.unselectable=true
8105}
8106++this.maxRows
8107};
8108DwtGridSizePicker.prototype._addCol=function(){
8109var t=this.getHtmlElement().firstChild;
8110var o=t.rows;
8111for(var e=1;
8112e<=this.maxRows;
8113++e){
8114var a=o[e];
8115var n=a.insertCell(-1);
8116n.unselectable=true
8117}
8118++t.rows[0].cells[0].colSpan;
8119++this.maxCols
8120};
8121DwtGridSizePicker.prototype._updateOnTimeout=function(a){
8122var e=true,i,t;
8123if(a.tagName.toLowerCase()=="td"){
8124i=a.parentNode.rowIndex;
8125if(i>0){
8126t=this._endCol=a.cellIndex;
8127this._endRow=a.parentNode.rowIndex-1;
8128e=false
8129}}
8130if(e){
8131this._endRow=this._endCol=-1
8132}
8133this._update();
8134if(!e){
8135if(i==this.maxRows){
8136this._addRow()
8137}
8138if(t==this.maxCols-1){
8139this._addCol()
8140}}};
8141DwtGridSizePicker.prototype._update=function(){
8142var t=this._endRow;
8143var s=this._endCol;
8144var l=this.getHtmlElement().firstChild;
8145var n=l.rows[0].cells[0];
8146this._rows=t+1;
8147this._cols=s+1;
8148if(this._rows>0&&this._cols>0){
8149n.innerHTML=this._rows+" x "+this._cols
8150}else{
8151n.innerHTML=this._title
8152}
8153for(var a=0;
8154a<this.maxRows;
8155++a){
8156var c=l.rows[a+1];
8157for(var e=0;
8158e<this.maxCols;
8159++e){
8160var h=c.cells[e];
8161var o=(a>this._endRow)||(e>this._endCol);
8162if(o){
8163Dwt.delClass(h,"Hovered")
8164}else{
8165Dwt.addClass(h,"Hovered")
8166}}}}
8167}
8168if(AjxPackage.define("ajax.dwt.widgets.DwtSpinner")){
8169DwtSpinner=function(e){
8170if(arguments.length==0){
8171return
8172}
8173DwtControl.call(this,{
8174parent:e.parent,className:e.className,posStyle:e.posStyle,parentElement:e.parentElement}
8175);
8176this._maxValue=e.max!=null?e.max:null;
8177this._minValue=e.min!=null?e.min:null;
8178this._fieldSize=e.size!=null?e.size:3;
8179this._origValue=e.value||0;
8180this._maxLen=e.maxLen||null;
8181this._step=e.step||1;
8182this._decimals="decimals" in e?e.decimals:0;
8183this._align=e.align||null;
8184this._timerFunc=AjxCallback.simpleClosure(this._timerFunc,this);
8185this._btnPressCapture=new DwtMouseEventCapture({
8186targetObj:this,id:"DwtSpinner",mouseUpHdlr:AjxCallback.simpleClosure(this._stopCapture,this)}
8187);
8188this._createElements()
8189};
8190DwtSpinner.prototype=new DwtControl;
8191DwtSpinner.prototype.constructor=DwtSpinner;
8192DwtSpinner.INIT_TIMER=250;
8193DwtSpinner.SLOW_TIMER=125;
8194DwtSpinner.FAST_TIMER=33;
8195DwtSpinner.prototype._createElements=function(){
8196var n=this.getHtmlElement();
8197var o=Dwt.getNextId();
8198this._idField=o;
8199this._idUpButton=o+"-up";
8200this._idDownButton=o+"-down";
8201var 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>"];
8202n.innerHTML=i.join("");
8203var a=this._getUpButton();
8204a.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Up");
8205var t=this._getDownButton();
8206t.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Down");
8207var e=this.getInputElement();
8208if(this._maxLen){
8209e.maxLength=this._maxLen
8210}
8211if(this._fieldSize){
8212e.size=this._fieldSize
8213}
8214if(this._align){
8215e.style.textAlign=this._align
8216}
8217if(this._origValue!=null){
8218this.setValue(this._origValue)
8219}
8220e.onblur=AjxCallback.simpleClosure(this.setValue,this,null);
8221e[(AjxEnv.isIE||AjxEnv.isOpera)?"onkeydown":"onkeypress"]=AjxCallback.simpleClosure(this.__onKeyPress,this)
8222};
8223DwtSpinner.prototype._getValidValue=function(e){
8224var t=parseFloat(e);
8225if(isNaN(t)||t==null){
8226t=this._lastValidValue
8227}
8228if(t==null){
8229t=this._minValue||0
8230}
8231if(this._minValue!=null&&t<this._minValue){
8232t=this._minValue
8233}
8234if(this._maxValue!=null&&t>this._maxValue){
8235t=this._maxValue
8236}
8237t=parseFloat(t);
8238if(this._decimals!=null){
8239t=t.toFixed(this._decimals)
8240}
8241this._lastValidValue=t;
8242return t
8243};
8244DwtSpinner.prototype.getInputElement=function(){
8245return document.getElementById(this._idField)
8246};
8247DwtSpinner.prototype._getUpButton=function(){
8248return document.getElementById(this._idUpButton)
8249};
8250DwtSpinner.prototype._getDownButton=function(){
8251return document.getElementById(this._idDownButton)
8252};
8253DwtSpinner.prototype._getButton=function(e){
8254switch(e){
8255case"Up":return this._getUpButton();
8256case"Down":return this._getDownButton()
8257}};
8258DwtSpinner.prototype._setBtnState=function(e,a){
8259var t=this._getButton(e);
8260if(a){
8261Dwt.addClass(t,"DwtSpinner-"+e+"-disabled");
8262t.firstChild.className="Img"+e+"ArrowSmallDis"
8263}else{
8264Dwt.delClass(t,"DwtSpinner-"+e+"-disabled");
8265t.firstChild.className="Img"+e+"ArrowSmall"
8266}};
8267DwtSpinner.prototype.getValue=function(){
8268return parseFloat(this._getValidValue(this.getInputElement().value))
8269};
8270DwtSpinner.prototype.setValue=function(e){
8271if(e==null){
8272e=this.getInputElement().value
8273}
8274e=this._getValidValue(e);
8275this.getInputElement().value=e;
8276e=parseFloat(e);
8277this._setBtnState("Down",this._minValue!=null&&this._minValue==e);
8278this._setBtnState("Up",this._maxValue!=null&&this._maxValue==e)
8279};
8280DwtSpinner.prototype.setEnabled=function(e){
8281DwtControl.prototype.setEnabled.call(this,e);
8282this.getInputElement().disabled=!e;
8283var t=this.getHtmlElement().firstChild;
8284if(!e){
8285Dwt.addClass(t,"DwtSpinner-disabled")
8286}else{
8287Dwt.delClass(t,"DwtSpinner-disabled")
8288}};
8289DwtSpinner.prototype._rotateVal=function(e){
8290var t=this.getValue();
8291switch(e){
8292case"Up":t+=this._step;
8293break;
8294case"Down":t-=this._step;
8295break
8296}
8297this.setValue(t)
8298};
8299DwtSpinner.prototype._btnPressed=function(e){
8300if(!this.getEnabled()){
8301return
8302}
8303Dwt.addClass(this._getButton(e),"DwtSpinner-"+e+"-pressed");
8304this._direction=e;
8305this._rotateVal(e);
8306this._btnPressCapture.capture();
8307this._timerSteps=0;
8308this._timer=setTimeout(this._timerFunc,DwtSpinner.INIT_TIMER)
8309};
8310DwtSpinner.prototype._timerFunc=function(){
8311var a=this.getValue();
8312this._rotateVal(this._direction);
8313var t=this.getValue();
8314this._timerSteps++;
8315var e=this._timerSteps>4?DwtSpinner.FAST_TIMER:DwtSpinner.SLOW_TIMER;
8316if(a!=t){
8317this._timer=setTimeout(this._timerFunc,e)
8318}else{
8319this._stopCapture()
8320}};
8321DwtSpinner.prototype._stopCapture=function(){
8322if(this._timer){
8323clearTimeout(this._timer)
8324}
8325this._timer=null;
8326this._timerSteps=null;
8327var t=this._direction;
8328Dwt.delClass(this._getButton(t),"DwtSpinner-"+t+"-pressed");
8329this._direction=null;
8330this._btnPressCapture.release();
8331var e=this.getInputElement();
8332e.focus();
8333Dwt.setSelectionRange(e,0,e.value.length)
8334};
8335DwtSpinner.prototype.__onKeyPress=function(a){
8336if(AjxEnv.isIE){
8337a=window.event
8338}
8339var t=null;
8340switch(a.keyCode){
8341case 38:t="Up";
8342break;
8343case 40:t="Down";
8344break
8345}
8346if(t){
8347this._rotateVal(t);
8348var e=this.getInputElement();
8349Dwt.setSelectionRange(e,0,e.value.length)
8350}};
8351DwtSpinner.prototype.focus=function(){
8352this.getInputElement().focus()
8353};
8354DwtSpinner.prototype.select=function(){
8355var e=this.getInputElement();
8356e.focus();
8357Dwt.setSelectionRange(e,0,e.value.length)
8358}
8359}
8360if(AjxPackage.define("ajax.dwt.widgets.DwtButtonColorPicker")){
8361DwtButtonColorPicker=function(a){
8362if(arguments.length==0){
8363return
8364}
8365a=Dwt.getParams(arguments,DwtButtonColorPicker.PARAMS);
8366a.actionTiming=DwtButton.ACTION_MOUSEUP;
8367DwtButton.call(this,a);
8368var e=new DwtMenu({
8369parent:this,style:DwtMenu.COLOR_PICKER_STYLE}
8370);
8371this.setMenu(e);
8372var t=new DwtColorPicker(e,null,null,a.noFillLabel,a.allowColorInput);
8373t.addSelectionListener(new AjxListener(this,this._colorPicked));
8374this.__colorPicker=t;
8375this.__color=""
8376};
8377DwtButtonColorPicker.PARAMS=["parent","style","className","posStyle","id","index","noFillLabel","allowColorInput"];
8378DwtButtonColorPicker.prototype=new DwtButton;
8379DwtButtonColorPicker.prototype.constructor=DwtButtonColorPicker;
8380DwtButtonColorPicker._RGB_RE=/rgb\(([0-9]{1,3}),\s*([0-9]{1,3}),\s*([0-9]{1,3})\)/;
8381DwtButtonColorPicker._hexdigits=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
8382DwtButtonColorPicker.toHex=function(i,t){
8383var e=[];
8384while(i){
8385var a=DwtButtonColorPicker._hexdigits[i&15];
8386e.push(a);
8387i=i>>4
8388}
8389if(t!=null){
8390t-=e.length;
8391while(t-->0){
8392e.push("0")
8393}}
8394e.reverse();
8395return e.join("")
8396};
8397DwtButtonColorPicker.prototype.showColorDisplay=function(e){
8398if(!this._colorEl){
8399return
8400}
8401if(!e){
8402this._colorEl.onmouseover=DwtButtonColorPicker.__colorDisplay_onMouseOver;
8403this._colorEl.onmouseout=DwtButtonColorPicker.__colorDisplay_onMouseOut;
8404this._colorEl.onmousedown=DwtButtonColorPicker.__colorDisplay_onMouseDown
8405}};
8406DwtButtonColorPicker.prototype.getColor=function(){
8407return this.__color
8408};
8409DwtButtonColorPicker.prototype.setColor=function(e){
8410var t=e.match(DwtButtonColorPicker._RGB_RE);
8411if(t){
8412e="#"+DwtButtonColorPicker.toHex(parseInt(t[1]),2)+DwtButtonColorPicker.toHex(parseInt(t[2]),2)+DwtButtonColorPicker.toHex(parseInt(t[3]),2)
8413}
8414this.__color=e;
8415var a=this._colorEl;
8416if(a){
8417a.style.backgroundColor=e
8418}};
8419DwtButtonColorPicker.prototype._createHtmlFromTemplate=function(t,a){
8420DwtButton.prototype._createHtmlFromTemplate.call(this,t,a);
8421var e=AjxTemplate.expand("dwt.Widgets#ZButtonColorDisplay",a);
8422this.setText(e);
8423this._colorEl=document.getElementById(a.id+"_color")
8424};
8425DwtButtonColorPicker.prototype._setMinWidth=function(){};
8426DwtButtonColorPicker.prototype._colorPicked=function(a){
8427var e=a.detail;
8428this.__color=this.__detail=e;
8429var t=this._colorEl;
8430if(t){
8431t.style.backgroundColor=e
8432}
8433if(this.isListenerRegistered(DwtEvent.SELECTION)){
8434var i=DwtShell.selectionEvent;
8435i.item=this;
8436i.detail=e;
8437this.notifyListeners(DwtEvent.SELECTION,i)
8438}};
8439DwtButtonColorPicker.prototype.__colorDisplay_onMouseOver=function(e,t){
8440if(!this.getEnabled()){
8441return
8442}
8443Dwt.addClass(t,"ImgDisable")
8444};
8445DwtButtonColorPicker.prototype.__colorDisplay_onMouseOut=function(e,t){
8446if(!this.getEnabled()){
8447return
8448}
8449Dwt.delClass(t,"ImgDisable")
8450};
8451DwtButtonColorPicker.prototype.__colorDisplay_onMouseDown=function(t,i){
8452if(!this.getEnabled()){
8453return
8454}
8455var e=DwtShell.mouseEvent;
8456e.setFromDhtmlEvent(t);
8457this.__color=this.__detail=i.style.backgroundColor="";
8458if(this.isListenerRegistered(DwtEvent.SELECTION)){
8459var a=DwtShell.selectionEvent;
8460a.item=this;
8461a.detail="";
8462this.notifyListeners(DwtEvent.SELECTION,a)
8463}
8464e._stopPropagation=true;
8465e._returnValue=false;
8466e.setToDhtmlEvent(t);
8467return false
8468};
8469DwtButtonColorPicker.__colorDisplay_onMouseOver=function(e){
8470var t=DwtControl.getTargetControl(e);
8471t.__colorDisplay_onMouseOver(e,this)
8472};
8473DwtButtonColorPicker.__colorDisplay_onMouseOut=function(e){
8474var t=DwtControl.getTargetControl(e);
8475t.__colorDisplay_onMouseOut(e,this)
8476};
8477DwtButtonColorPicker.__colorDisplay_onMouseDown=function(e){
8478var t=DwtControl.getTargetControl(e);
8479t.__colorDisplay_onMouseDown(e,this)
8480}
8481}
8482if(AjxPackage.define("ajax.dwt.widgets.DwtMessageComposite")){
8483DwtMessageComposite=function(a,t,e){
8484if(arguments.length==0){
8485return
8486}
8487t=t||"DwtMessageComposite";
8488DwtComposite.call(this,{
8489parent:a,className:t,posStyle:e}
8490)
8491};
8492DwtMessageComposite.prototype=new DwtComposite;
8493DwtMessageComposite.prototype.constructor=DwtMessageComposite;
8494DwtMessageComposite.prototype.toString=function(){
8495return"DwtMessageComposite"
8496};
8497DwtMessageComposite.prototype._formatter;
8498DwtMessageComposite.prototype._controls;
8499DwtMessageComposite.prototype.setFormat=function(f,l,n){
8500this._formatter=new AjxMessageFormat(f);
8501this._controls={};
8502var y=this._htmlElId;
8503var x=["<table class='DwtCompositeTable' border='0' cellspacing='0' cellpadding='0'><tr valign='center'>"];
8504var b=this._formatter.getSegments();
8505var s={};
8506var w={};
8507for(var v=0;
8508v<b.length;
8509v++){
8510var t=b[v];
8511var k=t instanceof AjxMessageFormat.MessageSegment;
8512var d=[y,v].join("_");
8513x.push("<td id='",d,"' class='",(k?"MessageControl"+t.getIndex():"")," DwtCompositeCell'>");
8514if(k){
8515var u=l?l.run(this,t,v):null;
8516if(!u){
8517u=new DwtInputField({
8518parent:this}
8519)
8520}
8521s[d]=u.getHtmlElement();
8522w[d]=n&&n.run(this,t,v);
8523var m=t.getIndex();
8524this._controls[m]=this._controls[m]||u
8525}else{
8526x.push(t.toSubPattern())
8527}
8528x.push("</td>")
8529}
8530x.push("</tr></table>");
8531var o=this.getHtmlElement();
8532var c=o.childNodes.length;
8533var q=document.createElement("DIV");
8534q.className=y+"_container";
8535o.appendChild(q);
8536q.innerHTML=x.join("");
8537for(var d in s){
8538var e=s[d];
8539var h=document.getElementById(d);
8540h.appendChild(e);
8541for(var g in w[d]){
8542h[g]=w[d][g]
8543}}};
8544DwtMessageComposite.prototype.format=function(){
8545var t=[];
8546for(var e in this._controls){
8547t[e]=this._controls[e].getValue()
8548}
8549return this._formatter.format(t)
8550}
8551}
8552if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButtonGroup")){
8553DwtRadioButtonGroup=function(a,e){
8554this._radios={};
8555this._radioButtons={};
8556this._values={};
8557this._value2id={};
8558this._eventMgr=new AjxEventMgr();
8559for(var t in a){
8560this.addRadio(t,a[t],(t==e))
8561}};
8562DwtRadioButtonGroup.prototype.toString=function(){
8563return"DwtRadioButtonGroup"
8564};
8565DwtRadioButtonGroup.prototype._enabled=true;
8566DwtRadioButtonGroup.prototype._visible=true;
8567DwtRadioButtonGroup.prototype.addSelectionListener=function(e){
8568return this._eventMgr.addListener(DwtEvent.SELECTION,e)
8569};
8570DwtRadioButtonGroup.prototype.removeSelectionListener=function(e){
8571return this._eventMgr.removeListener(DwtEvent.SELECTION,e)
8572};
8573DwtRadioButtonGroup.prototype.setEnabled=function(e){
8574this._enabled=e;
8575for(var t in this._radios){
8576this._radios[t].disabled=!e
8577}};
8578DwtRadioButtonGroup.prototype.isEnabled=function(){
8579return this._enabled
8580};
8581DwtRadioButtonGroup.prototype.setVisible=function(e){
8582this._visible=e;
8583for(var t in this._radioButtons){
8584this._radioButtons[t].setVisible(e)
8585}
8586for(var t in this._radios){
8587Dwt.setVisible(this._radios[t],e)
8588}};
8589DwtRadioButtonGroup.prototype.isVisible=function(){
8590return this._visible
8591};
8592DwtRadioButtonGroup.prototype.addRadio=function(h,s,i){
8593var e=s instanceof DwtRadioButton;
8594var o=e?s:null;
8595var n=o?o.getValue():s;
8596this._values[h]=n;
8597this._value2id[n]=h;
8598var t=document.getElementById(h);
8599this._radios[h]=t;
8600this._radioButtons[h]=o;
8601var a=AjxCallback.simpleClosure(this._handleClick,this);
8602Dwt.setHandler(t,DwtEvent.ONCLICK,a);
8603t.checked=i;
8604if(i){
8605this._selectedId=h
8606}};
8607DwtRadioButtonGroup.prototype.getRadioByValue=function(e){
8608var t=this._value2id[e];
8609return this._radios[t]
8610};
8611DwtRadioButtonGroup.prototype.getRadioButtonByValue=function(e){
8612var t=this._value2id[e];
8613return this._radioButtons[t]
8614};
8615DwtRadioButtonGroup.prototype.setSelectedId=function(i,e){
8616if(i!=this._selectedId){
8617var t=document.getElementById(i);
8618if(!t){
8619return
8620}
8621t.checked=true;
8622this._selectedId=i;
8623if(!e){
8624var a=DwtShell.selectionEvent;
8625a.reset();
8626this._notifySelection(a)
8627}}};
8628DwtRadioButtonGroup.prototype.setSelectedValue=function(t,e){
8629var a=this._valueToId(t);
8630this.setSelectedId(a,e)
8631};
8632DwtRadioButtonGroup.prototype.getSelectedId=function(){
8633return this._selectedId
8634};
8635DwtRadioButtonGroup.prototype.getSelectedValue=function(){
8636return this._values[this._selectedId]
8637};
8638DwtRadioButtonGroup.prototype.getValue=function(){
8639return this.getSelectedValue()
8640};
8641DwtRadioButtonGroup.prototype.getData=function(t){
8642var e=!AjxUtil.isUndefined(this._selectedId)&&this._radioButtons[this._selectedId];
8643if(e){
8644return e.getData(t)
8645}};
8646DwtRadioButtonGroup.prototype._valueToId=function(e){
8647for(var t in this._values){
8648if(this._values[t]==e){
8649return t
8650}
8651if(e===true&&this._values[t]=="true"){
8652return t
8653}
8654if(e===false&&(this._values[t]=="false"||this._values[t]=="")){
8655return t
8656}}
8657return null
8658};
8659DwtRadioButtonGroup.prototype._notifySelection=function(e){
8660e.item=this;
8661e.detail={
8662id:this._selectedId,value:this._values[this._selectedId]};
8663this._eventMgr.notifyListeners(DwtEvent.SELECTION,e)
8664};
8665DwtRadioButtonGroup.prototype._handleClick=function(e){
8666e=DwtUiEvent.getEvent(e);
8667var a=DwtUiEvent.getTarget(e);
8668if(a&&a.nodeName.match(/label/i)){
8669a=document.getElementById(a.getAttribute(AjxEnv.isIE?"htmlFor":"for"))
8670}
8671var i=a.id;
8672if(!a.checked){
8673for(i in this._radios){
8674if(this._radios[i].checked){
8675break
8676}}}
8677if(i!=this._selectedId){
8678this._selectedId=i;
8679var t=DwtShell.selectionEvent;
8680DwtUiEvent.copy(t,e);
8681this._notifySelection(t)
8682}}
8683}
8684if(AjxPackage.define("ajax.dwt.widgets.DwtComboBox")){
8685DwtComboBox=function(e){
8686if(arguments.length==0){
8687return
8688}
8689e=Dwt.getParams(arguments,DwtComboBox.PARAMS);
8690e.className=e.className||"DwtComboBox";
8691DwtComposite.call(this,e);
8692this.input=null;
8693this._button=null;
8694this._textToValue={};
8695this._valueToText={};
8696this._valueToItem={};
8697this._size=0;
8698this._hasMenuCallback=true;
8699this._menuItemListenerObj=new AjxListener(this,this._menuItemListener);
8700this._inputParams=e.inputParams;
8701this._createHtml()
8702};
8703DwtComboBox.PARAMS=["parent","inputParams","className","posStyle","dialog"];
8704DwtComboBox.prototype=new DwtComposite;
8705DwtComboBox.prototype.constructor=DwtComboBox;
8706DwtComboBox.prototype.toString=function(){
8707return"DwtComboBox"
8708};
8709DwtComboBox.prototype.TEMPLATE="dwt.Widgets#DwtComboBox";
8710DwtComboBox.prototype.getTabGroupMember=function(){
8711return this._tabGroup
8712};
8713DwtComboBox.prototype.addChangeListener=function(e){
8714this.addListener(DwtEvent.ONCHANGE,e)
8715};
8716DwtComboBox.prototype.removeChangeListener=function(e){
8717this.removeListener(DwtEvent.ONCHANGE,e)
8718};
8719DwtComboBox.prototype.add=function(i,t,e){
8720this._textToValue[i]=t;
8721this._valueToText[t]=i;
8722if(!this._hasMenuCallback){
8723var a=this._button.getMenu();
8724this._createMenuItem(a,i)
8725}
8726if(e){
8727this.setText(i)
8728}
8729this._size++;
8730this._updateButton()
8731};
8732DwtComboBox.prototype.remove=function(t){
8733var e=this._valueToItem[t];
8734if(e){
8735this._button.getMenu().removeChild(e);
8736var a=this._valueToText[t];
8737delete this._textToValue[a];
8738delete this._valueToText[t];
8739delete this._valueToItem[t];
8740if(this.getText()==a){
8741this.setText("")
8742}
8743this._size--;
8744this._updateButton()
8745}};
8746DwtComboBox.prototype.removeAll=function(){
8747this._button.setMenu(new AjxCallback(this,this._createMenu),true);
8748this._hasMenuCallback=true;
8749this._textToValue={};
8750this._valueToText={};
8751this._valueToItem={};
8752this._size=0;
8753this._updateButton()
8754};
8755DwtComboBox.prototype.getValue=function(){
8756var e=this.getText();
8757return this._textToValue[e]
8758};
8759DwtComboBox.prototype.setValue=function(e){
8760var t=this._valueToText[e];
8761this.setText(t||e)
8762};
8763DwtComboBox.prototype.getText=function(){
8764return this.input.getValue()
8765};
8766DwtComboBox.prototype.setText=function(e){
8767this.input.setValue(e)
8768};
8769DwtComboBox.prototype.setEnabled=function(e){
8770if(e!=this._enabled){
8771DwtComposite.prototype.setEnabled.call(this,e);
8772this.input.setEnabled(e);
8773this._button.setEnabled(e)
8774}};
8775DwtComboBox.prototype.focus=function(){
8776this.input.focus()
8777};
8778DwtComboBox.prototype._createMenu=function(){
8779var o=new DwtMenu({
8780parent:this}
8781);
8782for(var e in this._textToValue){
8783var t=this._createMenuItem(o,e);
8784var a=this._textToValue[e];
8785this._valueToItem[a]=t
8786}
8787this._hasMenuCallback=false;
8788return o
8789};
8790DwtComboBox.prototype._createMenuItem=function(a,t){
8791var e=new DwtMenuItem({
8792parent:a}
8793);
8794e.setText(t);
8795e.addSelectionListener(this._menuItemListenerObj);
8796if(!this._menuWidth){
8797this._menuWidth=this.getW()-10
8798}
8799e.getHtmlElement().style.minWidth=this._menuWidth;
8800return e
8801};
8802DwtComboBox.prototype._menuItemListener=function(i){
8803var t=i.dwtObj;
8804var o=this.input.getValue();
8805var n=t.getText();
8806this.input.setValue(n);
8807var a=DwtUiEvent.getEvent(i);
8808a._args={
8809selectObj:this,newValue:n,oldValue:o};
8810this.notifyListeners(DwtEvent.ONCHANGE,a);
8811var e=this.input.getInputElement();
8812e.focus();
8813e.select()
8814};
8815DwtComboBox.prototype._handleKeyDown=function(e){
8816this.__ovalue=this.input.getValue();
8817return true
8818};
8819DwtComboBox.prototype._handleKeyUp=function(t){
8820DwtInputField._keyUpHdlr(t);
8821var e=DwtUiEvent.getEvent(t);
8822e._args={
8823selectObj:this,newValue:this.input.getValue(),oldValue:this.__ovalue};
8824this.notifyListeners(DwtEvent.ONCHANGE,e);
8825return true
8826};
8827DwtComboBox.prototype._updateButton=function(){
8828this._button.setVisible(this._size>0)
8829};
8830DwtComboBox.prototype._createHtml=function(e){
8831var t={
8832id:this._htmlElId};
8833this._createHtmlFromTemplate(e||this.TEMPLATE,t)
8834};
8835DwtComboBox.prototype._createHtmlFromTemplate=function(t,a){
8836DwtComposite.prototype._createHtmlFromTemplate.call(this,t,a);
8837var e=this._inputParams||{};
8838e.parent=this;
8839e.size=e.size||40;
8840delete this._inputParams;
8841this.input=new DwtInputField(e);
8842this.input.replaceElement(a.id+"_input");
8843this.input.setHandler(DwtEvent.ONKEYDOWN,AjxCallback.simpleClosure(this._handleKeyDown,this));
8844this.input.setHandler(DwtEvent.ONKEYUP,AjxCallback.simpleClosure(this._handleKeyUp,this));
8845this._button=new DwtComboBoxButton({
8846parent:this}
8847);
8848this._button.setMenu(new AjxListener(this,this._createMenu),true);
8849this._button.replaceElement(a.id+"_button");
8850this._updateButton();
8851this._tabGroup=new DwtTabGroup(this._htmlElId);
8852this._tabGroup.addMember(this.input);
8853this._tabGroup.addMember(this._button)
8854};
8855DwtComboBox.prototype._replaceElementHook=function(t,a,e,i){
8856DwtComposite.prototype._replaceElementHook.apply(this,arguments);
8857if(t.size){
8858this.input.getInputElement().size=t.size
8859}
8860if(t.title){
8861this.input.setHint(t.title)
8862}};
8863DwtComboBoxButton=function(e){
8864e=Dwt.getParams(arguments,DwtComboBoxButton.PARAMS);
8865e.posStyle=Dwt.RELATIVE_STYLE;
8866DwtButton.call(this,e)
8867};
8868DwtComboBoxButton.prototype=new DwtButton;
8869DwtComboBoxButton.prototype.constructor=DwtComboBoxButton;
8870DwtComboBoxButton.prototype.toString=function(){
8871return"DwtComboBoxButton"
8872};
8873DwtComboBoxButton.PARAMS=["parent","className"];
8874DwtComboBoxButton.prototype.TEMPLATE="dwt.Widgets#DwtComboBoxButton"
8875}
8876if(AjxPackage.define("zimbra.common.ZLoginFactory")){
8877ZLoginFactory=function(){};
8878ZLoginFactory.USER_ID="ZLoginUserName";
8879ZLoginFactory.PASSWORD_ID="ZLoginPassword";
8880ZLoginFactory.REMEMBER_ME_ID="rememberMe";
8881ZLoginFactory.REMEMBER_ME_CONTAINER_ID="ZLoginRememberMeContainer";
8882ZLoginFactory.NEW_PASSWORD_ID="newpass1";
8883ZLoginFactory.NEW_PASSWORD_TR_ID="ZLoginNewPassword1Tr";
8884ZLoginFactory.PASSWORD_CONFIRM_TR_ID="ZLoginNewPassword2Tr";
8885ZLoginFactory.PASSWORD_CONFIRM_ID="newpass2";
8886ZLoginFactory.LOGIN_BUTTON_ID="ZLoginButton";
8887ZLoginFactory.HIDDEN_BUTTON_ID="ZLoginHiddenButton";
8888ZLoginFactory.TEXT_TYPE=0;
8889ZLoginFactory.CHECKBOX_TYPE=1;
8890ZLoginFactory.BUTTON_TYPE=2;
8891ZLoginFactory.TAB_ORDER=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_ID,ZLoginFactory.PASSWORD_CONFIRM_ID,ZLoginFactory.REMEMBER_ME_ID,ZLoginFactory.LOGIN_BUTTON_ID];
8892ZLoginFactory.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];
8893ZLoginFactory.TAB_TYPE=[ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.CHECKBOX_TYPE,ZLoginFactory.BUTTON_TYPE];
8894ZLoginFactory.copyDefaultParams=function(e){
8895return{
8896showPanelBorder: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||""}
8897};
8898ZLoginFactory.getLoginPanel=function(){
8899var e=this.get("ZLoginPanel");
8900if(!e){
8901e=this.get("ZLoginPanelInvisible")
8902}
8903return e
8904};
8905ZLoginFactory.showErrorMsg=function(e){
8906this.setHTML("ZLoginErrorMsg",e);
8907this.show("ZLoginErrorPanel");
8908this._flickerErrorMessagePanel()
8909};
8910ZLoginFactory.hideErrorMsg=function(){
8911this.hide("ZLoginErrorPanel")
8912};
8913ZLoginFactory.getErrorMsgPanel=function(){
8914return this.get("ZLoginErrorPanel")
8915};
8916ZLoginFactory.showAboutMsg=function(e){
8917this.setHTML("ZLoginAboutPanel",e);
8918this.show("ZLoginAboutPanel")
8919};
8920ZLoginFactory.hideAboutMsg=function(){
8921this.hide("ZLoginAboutPanel")
8922};
8923ZLoginFactory.getAboutMsg=function(){
8924return this.get("ZLoginAboutPanel")
8925};
8926ZLoginFactory.showLoadingMsg=function(e){
8927this.setHTML("ZLoginLoadingMsg",e);
8928this.show("ZLoginAboutPanel")
8929};
8930ZLoginFactory.hideLoadingMsg=function(){
8931this.hide("ZLoginAboutPanel")
8932};
8933ZLoginFactory.getLoadingMsg=function(){
8934return this.get("ZLoginAboutPanel")
8935};
8936ZLoginFactory.showForm=function(){
8937this.show("ZLoginFormPanel")
8938};
8939ZLoginFactory.hideForm=function(){
8940this.hide("ZLoginFormPanel")
8941};
8942ZLoginFactory.getForm=function(){
8943return this.get("ZLoginFormPanel")
8944};
8945ZLoginFactory.showUserField=function(e){
8946this.setValue(ZLoginFactory.USER_ID,e);
8947this.show(ZLoginFactory.USER_ID)
8948};
8949ZLoginFactory.hideUserField=function(){
8950this.hide(ZLoginFactory.USER_ID)
8951};
8952ZLoginFactory.getUserField=function(){
8953return this.get(ZLoginFactory.USER_ID)
8954};
8955ZLoginFactory.showPasswordField=function(e){
8956this.show(ZLoginFactory.PASSWORD_ID)
8957};
8958ZLoginFactory.hidePasswordField=function(){
8959this.hide(ZLoginFactory.PASSWORD_ID)
8960};
8961ZLoginFactory.getPasswordField=function(){
8962return this.get(ZLoginFactory.PASSWORD_ID)
8963};
8964ZLoginFactory.showNewPasswordFields=function(){
8965this.show(ZLoginFactory.NEW_PASSWORD_TR_ID);
8966this.show(ZLoginFactory.PASSWORD_CONFIRM_TR_ID)
8967};
8968ZLoginFactory.hideNewPasswordFields=function(){
8969this.hide(ZLoginFactory.NEW_PASSWORD_TR_ID);
8970this.hide(ZLoginFactory.PASSWORD_CONFIRM_TR_ID)
8971};
8972ZLoginFactory.areNewPasswordFieldsShown=function(){
8973return this.isShown(ZLoginFactory.NEW_PASSWORD_TR_ID)
8974};
8975ZLoginFactory.getNewPasswordField=function(){
8976return this.get(ZLoginFactory.NEW_PASSWORD_ID)
8977};
8978ZLoginFactory.getPasswordConfirmField=function(){
8979return this.get(ZLoginFactory.PASSWORD_CONFIRM_ID)
8980};
8981ZLoginFactory.showRememberMeCheckbox=function(){
8982this.show(ZLoginFactory.REMEMBER_ME_CONTAINER_ID)
8983};
8984ZLoginFactory.hideRememberMeCheckbox=function(){
8985this.hide(ZLoginFactory.REMEMBER_ME_CONTAINER_ID)
8986};
8987ZLoginFactory.showLogOff=function(){
8988this.show("ZLoginLogOffContainer")
8989};
8990ZLoginFactory.hideLogOff=function(){
8991this.hide("ZLoginLogOffContainer")
8992};
8993ZLoginFactory.setLoginButtonName=function(e){
8994this.setHTML("ZLoginButtonText",e)
8995};
8996ZLoginFactory.setLoginButtonAction=function(t){
8997var e=document.getElementById(ZLoginFactory.LOGIN_BUTTON_ID);
8998if(e){
8999e.onclick=t
9000}};
9001ZLoginFactory.getLoginButton=function(){
9002return this.get(ZLoginFactory.LOGIN_BUTTON_ID)
9003};
9004ZLoginFactory.getLoginDialogHTML=function(t){
9005var 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("");
9006return e
9007};
9008ZLoginFactory.setHTML=function(a,e){
9009var t=document.getElementById(a);
9010if(t&&e!=null){
9011t.innerHTML=e
9012}};
9013ZLoginFactory.setValue=function(a,e){
9014var t=document.getElementById(a);
9015if(t&&e!=null){
9016t.value=e
9017}};
9018ZLoginFactory.show=function(a,e){
9019var t=document.getElementById(a);
9020if(t){
9021t.style.display=""
9022}};
9023ZLoginFactory.isShown=function(t){
9024var e=document.getElementById(t);
9025return e?(e.style.display!="none"):false
9026};
9027ZLoginFactory.hide=function(t){
9028var e=document.getElementById(t);
9029if(e){
9030e.style.display="none"
9031}};
9032ZLoginFactory.get=function(e){
9033return document.getElementById(e)
9034};
9035ZLoginFactory.handleKeyPress=function(h){
9036h=h||window.event;
9037if(h==null){
9038return true
9039}
9040var n=h.target?h.target:h.srcElement;
9041if(!n){
9042return true
9043}
9044var c=h.keyCode;
9045var e=false;
9046if(c==13){
9047if(n.id==ZLoginFactory.USER_ID||n.id==ZLoginFactory.NEW_PASSWORD_ID){
9048e=true
9049}else{
9050var t=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID).onclick;
9051if(t){
9052t.call(n)
9053}
9054ZLoginFactory._cancelEvent(h);
9055return false
9056}}
9057if(e||(c==9)){
9058var l=ZLoginFactory.TAB_ORDER.length-1;
9059for(var a=0;
9060a<ZLoginFactory.TAB_ORDER.length;
9061a++){
9062if(ZLoginFactory.TAB_ORDER[a]==n.id){
9063l=a;
9064break
9065}}
9066var o=!h.shiftKey;
9067var u=ZLoginFactory._getTabToIndex(l,o);
9068var s=ZLoginFactory.TAB_ORDER[u];
9069var d=ZLoginFactory.TAB_TYPE[u];
9070ZLoginFactory._onFocusChange(d,s,n);
9071ZLoginFactory._cancelEvent(h)
9072}};
9073ZLoginFactory._cancelEvent=function(e){
9074if(e.stopPropagation){
9075e.stopPropagation()
9076}
9077if(e.preventDefault){
9078e.preventDefault()
9079}
9080e.cancelBubble=true;
9081e.returnValue=false
9082};
9083ZLoginFactory._onFocusChange=function(t,n,o){
9084if((t!=ZLoginFactory.BUTTON_TYPE)&&!AjxEnv.isIE){
9085ZLoginFactory._loginButtonBlur()
9086}
9087if(t==ZLoginFactory.TEXT_TYPE){
9088var a=ZLoginFactory.get(n);
9089a.focus();
9090a.select()
9091}else{
9092if(t==ZLoginFactory.CHECKBOX_TYPE){
9093var i=ZLoginFactory.get(n);
9094i.focus()
9095}else{
9096var e=ZLoginFactory.get(n);
9097if(AjxEnv.isIE){
9098e.focus()
9099}else{
9100ZLoginFactory._loginButtonFocus(e);
9101o.blur();
9102document.getElementById(ZLoginFactory.HIDDEN_BUTTON_ID).focus()
9103}}}};
9104ZLoginFactory._getTabToIndex=function(n,e){
9105var t=n;
9106do{
9107var o;
9108if(e){
9109t=(t==(ZLoginFactory.TAB_ORDER.length-1))?0:t+1
9110}else{
9111t=(t==0)?(ZLoginFactory.TAB_ORDER.length-1):t-1
9112}
9113var s=ZLoginFactory.TAB_ORDER[t];
9114var a=ZLoginFactory.VISIBILITY[t];
9115var i=ZLoginFactory.get(s);
9116if(ZLoginFactory.isShown(a)&&!ZLoginFactory.get(s).disabled){
9117return t
9118}}
9119while(t!=n);
9120return 0
9121};
9122ZLoginFactory._loginButtonFocus=function(e){
9123e.className="DwtButton-focused"
9124};
9125ZLoginFactory._loginButtonBlur=function(e){
9126var e=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID);
9127e.className="DwtButton"
9128};
9129ZLoginFactory._flickerErrorMessagePanel=function(){
9130ZLoginFactory.getErrorMsgPanel().style.visibility="hidden";
9131window.setTimeout(ZLoginFactory._showErrorMessagePanel,8)
9132};
9133ZLoginFactory._showErrorMessagePanel=function(){
9134ZLoginFactory.getErrorMsgPanel().style.visibility="visible"
9135}
9136}
9137if(AjxPackage.define("zimbra.common.ZmBaseSplashScreen")){
9138ZmBaseSplashScreen=function(t,e,a){
9139if(arguments.length==0){
9140return
9141}
9142if(!(t instanceof DwtShell)){
9143throw new AjxException("Parent must be a DwtShell",AjxException.INVALIDPARENT,"ZSplashScreen")
9144}
9145a=a||"ZSplashScreen";
9146DwtControl.call(this,{
9147parent:t,className:a,posStyle:Dwt.ABSOLUTE_STYLE}
9148);
9149this.__createContents()
9150};
9151ZmBaseSplashScreen.prototype=new DwtControl;
9152ZmBaseSplashScreen.prototype.constructor=ZmBaseSplashScreen;
9153ZmBaseSplashScreen.prototype.getHtml=function(){};
9154ZmBaseSplashScreen.prototype.setVisible=function(e){
9155if(e==this.getVisible()){
9156return
9157}
9158if(e){
9159this.__createContents()
9160}
9161DwtControl.prototype.setVisible.call(this,e);
9162if(!e){
9163this.getHtmlElement().innerHTML=""
9164}};
9165ZmBaseSplashScreen.prototype.__createContents=function(){
9166var a=this.getHtmlElement();
9167a.style.zIndex=Dwt.Z_SPLASH;
9168var t=document.createElement("table");
9169t.border=t.cellSpacing=t.cellPadding=0;
9170Dwt.setSize(t,"100%","100%");
9171var i=t.insertRow(0);
9172var e=i.insertCell(0);
9173e.vAlign="middle";
9174e.align="center";
9175e.innerHTML=this.getHtml();
9176a.appendChild(t);
9177a.style.cursor="wait"
9178}
9179}
9180if(AjxPackage.define("zimbra.common.ZmErrorDialog")){
9181ZmErrorDialog=function(t,a){
9182this._strNav=this._getNavigatorInfo();
9183this._subjPfx=this._getSubjectPrefix();
9184var i=new DwtDialog_ButtonDescriptor(ZmErrorDialog.REPORT_BUTTON,a.report,DwtDialog.ALIGN_LEFT);
9185var e=new DwtDialog_ButtonDescriptor(ZmErrorDialog.DETAIL_BUTTON,a.showDetails,DwtDialog.ALIGN_LEFT);
9186DwtMessageDialog.call(this,{
9187parent:t,extraButtons:[i,e]}
9188);
9189this.registerCallback(ZmErrorDialog.REPORT_BUTTON,this._reportCallback,this);
9190this.registerCallback(ZmErrorDialog.DETAIL_BUTTON,this._showDetail,this);
9191this._showDetailsMsg=a.showDetails;
9192this._hideDetailsMsg=a.hideDetails
9193};
9194ZmErrorDialog.prototype=new DwtMessageDialog;
9195ZmErrorDialog.prototype.constructor=ZmErrorDialog;
9196ZmErrorDialog.prototype.toString=function(){
9197return"ZmErrorDialog"
9198};
9199ZmErrorDialog.REPORT_BUTTON=++DwtDialog.LAST_BUTTON;
9200ZmErrorDialog.DETAIL_BUTTON=++DwtDialog.LAST_BUTTON;
9201ZmErrorDialog.DEFAULT_REPORT_URL="//www.zimbra.com/e/";
9202ZmErrorDialog.prototype._detailsVisible=false;
9203ZmErrorDialog.prototype.CONTROLS_TEMPLATE="zimbra.Widgets#ZmErrorDialogControls";
9204ZmErrorDialog.prototype.reset=function(){
9205this.setDetailString();
9206DwtMessageDialog.prototype.reset.call(this)
9207};
9208ZmErrorDialog.prototype.setDetailString=function(e){
9209if(!(this._button[ZmErrorDialog.DETAIL_BUTTON])){
9210return
9211}
9212this._button[ZmErrorDialog.DETAIL_BUTTON].setVisible(e!=null);
9213this._detailStr=e
9214};
9215ZmErrorDialog.prototype.setMessage=function(e,i,t,a){
9216this._msgStr=e;
9217this.setDetailString(i);
9218this._msgStyle=t;
9219this._msgTitle=a;
9220this._detailsVisible=false;
9221this._button[ZmErrorDialog.DETAIL_BUTTON].setText(this._showDetailsMsg);
9222DwtMessageDialog.prototype.setMessage.call(this,e,t,a)
9223};
9224ZmErrorDialog.prototype.popup=function(e,t){
9225if(t){
9226this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,false)
9227}
9228DwtMessageDialog.prototype.popup.call(this,e)
9229};
9230ZmErrorDialog.prototype.popdown=function(){
9231DwtMessageDialog.prototype.popdown.call(this);
9232this.setSize(Dwt.CLEAR,Dwt.CLEAR);
9233this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,true)
9234};
9235ZmErrorDialog.prototype._getNavigatorInfo=function(){
9236var a=[];
9237var e=0;
9238a[e++]="\n\n";
9239a[e++]="href: ";
9240a[e++]=location.href;
9241a[e++]="\n";
9242for(var t in navigator){
9243if(typeof navigator[t]=="function"){
9244continue
9245}
9246if(typeof navigator[t]=="unknown"){
9247continue
9248}
9249a[e++]=t+": "+navigator[t]+"\n"
9250}
9251return a.join("")
9252};
9253ZmErrorDialog.prototype._getSubjectPrefix=function(){
9254var t=[];
9255var e=0;
9256t[e++]="ER: ";
9257if(AjxEnv.isIE){
9258t[e++]="IE "
9259}else{
9260if(AjxEnv.isFirefox){
9261t[e++]="FF "
9262}else{
9263if(AjxEnv.isMozilla){
9264t[e++]="MOZ "
9265}else{
9266if(AjxEnv.isSafari){
9267t[e++]="SAF "
9268}else{
9269if(AjxEnv.isOpera){
9270t[e++]="OPE "
9271}else{
9272t[e++]="UKN "
9273}}}}}
9274if(AjxEnv.isWindows){
9275t[e++]="WIN "
9276}else{
9277if(AjxEnv.isLinux){
9278t[e++]="LNX "
9279}else{
9280if(AjxEnv.isMac){
9281t[e++]="MAC "
9282}else{
9283t[e++]="UNK "
9284}}}
9285t[e++]=appCtxt.get(ZmSetting.CLIENT_VERSION)+" ";
9286return t.join("")
9287};
9288ZmErrorDialog.prototype._getUserPrefs=function(){
9289var o=appCtxt.getCurrentSearch();
9290var a=[];
9291var e=0;
9292a[e++]="\n\n";
9293a[e++]="username: ";
9294a[e++]=appCtxt.get(ZmSetting.USERNAME);
9295a[e++]="\n";
9296if(o){
9297a[e++]="currentSearch: ";
9298a[e++]=o.query;
9299a[e++]="\n"
9300}
9301for(var t in ZmSetting.INIT){
9302if(ZmSetting.INIT[t][0]){
9303a[e++]=ZmSetting.INIT[t][0];
9304a[e++]=": ";
9305a[e++]=(""+ZmSetting.INIT[t][3]);
9306a[e++]="\n"
9307}}
9308return a.join("")
9309};
9310ZmErrorDialog.prototype._reportCallback=function(){
9311this._iframe=document.createElement("iframe");
9312this._iframe.style.width=this._iframe.style.height=0;
9313this._iframe.style.visibility="hidden";
9314var a=this._getContentDiv();
9315a.appendChild(this._iframe);
9316var l=this._getUserPrefs();
9317var h=Dwt.getNextId();
9318var o=[];
9319var s=0;
9320var n=this._subjPfx+this._detailStr.substring(0,40);
9321var t=(location.protocol=="https:")?"https:":"http:";
9322o[s++]="<html><head></head><body><form id='";
9323o[s++]=h;
9324o[s++]="' method='POST' action='";
9325o[s++]=t;
9326o[s++]=appCtxt.get(ZmSetting.ERROR_REPORT_URL)||ZmErrorDialog.DEFAULT_REPORT_URL;
9327o[s++]="'>";
9328o[s++]="<textarea name='details'>";
9329o[s++]=this._detailStr;
9330o[s++]="version - ";
9331o[s++]=appCtxt.get(ZmSetting.CLIENT_VERSION);
9332o[s++]="\n";
9333o[s++]="release - ";
9334o[s++]=appCtxt.get(ZmSetting.CLIENT_RELEASE);
9335o[s++]="\n";
9336o[s++]="date - ";
9337o[s++]=appCtxt.get(ZmSetting.CLIENT_DATETIME);
9338o[s++]="</textarea><textarea name='navigator'>";
9339o[s++]=this._strNav;
9340o[s++]="</textarea><textarea name='prefs'>";
9341o[s++]=l;
9342o[s++]="</textarea><textarea name='subject'>";
9343o[s++]=n;
9344o[s++]="</textarea></form></body></html>";
9345var i=Dwt.getIframeDoc(this._iframe);
9346i.open();
9347i.write(o.join(""));
9348i.close();
9349var e=i.getElementById(h);
9350if(e){
9351e.submit();
9352appCtxt.setStatusMsg(ZmMsg.errorReportSent)
9353}
9354this.popdown()
9355};
9356ZmErrorDialog.prototype._showDetail=function(){
9357this._detailsVisible=!this._detailsVisible;
9358var e=this._msgStr;
9359if(this._detailsVisible){
9360e+="<hr>"+this._detailStr;
9361this.setSize(Dwt.CLEAR,"300")
9362}else{
9363this.setSize(Dwt.CLEAR,Dwt.CLEAR)
9364}
9365DwtMessageDialog.prototype.setMessage.call(this,e,this._msgStyle,this._msgTitle);
9366this._button[ZmErrorDialog.DETAIL_BUTTON].setText(this._detailsVisible?this._hideDetailsMsg:this._showDetailsMsg)
9367}
9368}
9369if(AjxPackage.define("zimbraMail.share.model.ZmAuthenticate")){
9370ZmAuthenticate=function(){};
9371ZmAuthenticate._isAdmin=false;
9372ZmAuthenticate.setAdmin=function(e){
9373ZmAuthenticate._isAdmin=e
9374};
9375ZmAuthenticate.prototype.toString=function(){
9376return"ZmAuthenticate"
9377};
9378ZmAuthenticate.prototype.execute=function(e,o,s){
9379var i=new ZmCsfeCommand();
9380var a;
9381if(!ZmAuthenticate._isAdmin){
9382a=AjxSoapDoc.create("AuthRequest","urn:zimbraAccount");
9383var t=a.set("account",e);
9384t.setAttribute("by","name")
9385}else{
9386a=AjxSoapDoc.create("AuthRequest","urn:zimbraAdmin",null);
9387a.set("name",e)
9388}
9389a.set("virtualHost",location.hostname);
9390a.set("password",o);
9391var n=new AjxCallback(this,this._handleResponseExecute,s);
9392i.invoke({
9393soapDoc:a,noAuthToken:true,noSession:true,asyncMode:true,callback:n}
9394)
9395};
9396ZmAuthenticate.prototype._handleResponseExecute=function(a,e){
9397if(!e.isException()){
9398var t=e.getResponse().Body.AuthResponse;
9399this._setAuthToken(t)
9400}
9401if(a){
9402a.run(e)
9403}};
9404ZmAuthenticate.prototype._setAuthToken=function(t){
9405var e=appCtxt.rememberMe?t.lifetime:0;
9406ZmCsfeCommand.setAuthToken(t.authToken[0]._content,e)
9407}
9408}
9409if(AjxPackage.define("zimbraMail.share.model.ZmAutocomplete")){
9410ZmAutocomplete=function(){
9411this._acRequests={};
9412if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
9413var a=new AjxListener(this,this._settingChangeListener);
9414var t=[ZmSetting.GAL_AUTOCOMPLETE,ZmSetting.AUTOCOMPLETE_SHARE,ZmSetting.AUTOCOMPLETE_SHARED_ADDR_BOOKS,ZmSetting.AUTOCOMPLETE_NO_GROUP_MATCH];
9415for(var e=0;
9416e<t.length;
9417e++){
9418appCtxt.getSettings().getSetting(t[e]).addChangeListener(a)
9419}}};
9420ZmAutocomplete.AC_VALUE_FULL="fullAddress";
9421ZmAutocomplete.AC_VALUE_EMAIL="email";
9422ZmAutocomplete.AC_VALUE_NAME="name";
9423ZmAutocomplete.AC_TIMEOUT=20;
9424ZmAutocomplete.AC_TYPE_CONTACT="contact";
9425ZmAutocomplete.AC_TYPE_GAL="gal";
9426ZmAutocomplete.AC_TYPE_GROUP="group";
9427ZmAutocomplete.AC_TYPE_TABLE="rankingTable";
9428ZmAutocomplete.AC_TYPE_UNKNOWN="unknown";
9429ZmAutocomplete.AC_TYPE_LOCATION="Location";
9430ZmAutocomplete.AC_TYPE_EQUIPMENT="Equipment";
9431ZmAutocomplete.AC_ICON={};
9432ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_CONTACT]="Contact";
9433ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_GAL]="GALContact";
9434ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_GROUP]="Group";
9435ZmAutocomplete.GAL_RESULTS_TTL=900000;
9436ZmAutocomplete.prototype.toString=function(){
9437return"ZmAutocomplete"
9438};
9439ZmAutocomplete.prototype.autocompleteMatch=function(n,h,t,e,o){
9440n=n.toLowerCase().replace(/"/g,"");
9441this._curAcStr=n;
9442var a=(e&&e.type)||ZmAutocomplete.AC_TYPE_CONTACT;
9443var i=this._checkCache(n,a,o);
9444if(i!==null){
9445this._handleResponseAutocompleteMatch(n,h,i);
9446return
9447}
9448var s=new AjxCallback(this,this._handleResponseAutocompleteMatch,[n,h]);
9449this._doAutocomplete(n,t,e,a,s,o)
9450};
9451ZmAutocomplete.prototype._handleResponseAutocompleteMatch=function(t,a,e){
9452if(t==this._curAcStr){
9453a.run(e)
9454}};
9455ZmAutocomplete.prototype._doAutocomplete=function(n,i,c,t,h,o){
9456if(this._acRequests[n]){
9457return
9458}
9459for(var e in this._acRequests){
9460if(n!=e){
9461appCtxt.getAppController().cancelRequest(this._acRequests[e],null,true);
9462delete this._acRequests[n]
9463}}
9464var a={
9465query:n,isAutocompleteSearch:true};
9466if(t!=ZmAutocomplete.AC_TYPE_CONTACT){
9467a.isGalAutocompleteSearch=true;
9468a.isAutocompleteSearch=false;
9469a.limit=a.limit*2;
9470a.types=AjxVector.fromArray([ZmItem.CONTACT]);
9471a.galType=ZmSearch.GAL_RESOURCE
9472}else{}
9473a.accountName=o&&o.name;
9474var l=new ZmSearch(a);
9475var s={
9476callback:(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};
9477this._acRequests[n]=l.execute(s)
9478};
9479ZmAutocomplete.prototype._handleResponseDoAutocomplete=function(u,l,p,e,f,c,g){
9480if(u!=this._curAcStr){
9481return
9482}
9483delete this._acRequests[u];
9484var t,h=false,s=false;
9485var a=g.getResponse();
9486if(a&&a.search&&a.search.isGalAutocompleteSearch){
9487var m=a.getResults(ZmItem.CONTACT);
9488t=(m&&m.getArray())||[];
9489h=s=true
9490}else{
9491t=a._respEl.match||[]
9492}
9493var d=[];
9494for(var o=0;
9495o<t.length;
9496o++){
9497var n=new ZmAutocompleteMatch(t[o],p,h);
9498if(n.acType==e){
9499if(n.type==ZmAutocomplete.AC_TYPE_GAL){
9500s=true
9501}
9502d.push(n)
9503}}
9504f.run(d);
9505this._cacheResults(u,e,d,s,a._respEl.canBeCached,null,c)
9506};
9507ZmAutocomplete.prototype._handleErrorDoAutocomplete=function(a,t,e){
9508appCtxt.getAppController().cancelRequest(this._acRequests[a],null,true);
9509appCtxt.setStatusMsg({
9510msg:ZmMsg.autocompleteFailed,level:ZmStatusView.LEVEL_WARNING}
9511);
9512delete this._acRequests[a];
9513return true
9514};
9515ZmAutocomplete.acSortCompare=function(t,e){
9516var o=(t&&t.score)||0;
9517var i=(e&&e.score)||0;
9518return(o>i)?1:(o<i)?-1:0
9519};
9520ZmAutocomplete.prototype.isComplete=function(e){
9521return AjxEmailAddress.isValid(e)
9522};
9523ZmAutocomplete.prototype.quickComplete=function(n){
9524if(n.indexOf("@")!=-1){
9525return null
9526}
9527if(!this._userDomain){
9528var t=appCtxt.get(ZmSetting.USERNAME);
9529if(t){
9530var e=t.split("@");
9531if(e&&e.length){
9532this._userDomain=e[e.length-1]
9533}}}
9534if(this._userDomain){
9535var o=[n,this._userDomain].join("@");
9536var i=new ZmAutocompleteMatch();
9537i.name=i.email=i.fullAddress=o;
9538return i
9539}else{
9540return null
9541}};
9542ZmAutocomplete.prototype.forget=function(i,a){
9543var t={
9544RankingActionRequest:{
9545_jsns:"urn:zimbraMail"}};
9546t.RankingActionRequest.action={
9547op:"delete",email:i};
9548var e=new AjxCallback(this,this._handleResponseForget,[a]);
9549appCtxt.getRequestMgr().sendRequest({
9550jsonObj:t,asyncMode:true,callback:e}
9551)
9552};
9553ZmAutocomplete.prototype._handleResponseForget=function(e){
9554appCtxt.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT);
9555if(e){
9556e.run()
9557}};
9558ZmAutocomplete.prototype._getCache=function(a,o,i,t){
9559var e=AjxEnv.isIE?window.appCtxt:window.parentAppCtxt||window.appCtxt;
9560return e.getAutocompleteCache(a,o,i,t)
9561};
9562ZmAutocomplete.prototype._cacheResults=function(s,i,n,a,e,h,o){
9563var t=this._getCache(i,s,o,true);
9564t.list=n;
9565t.cacheable=(h&&h.cacheable)||e;
9566if(a){
9567t.ts=(h&&h.ts)||(new Date()).getTime()
9568}};
9569ZmAutocomplete.prototype._checkCache=function(l,t,s){
9570var e=this._getCachedResults(l,t,null,s);
9571var h=e&&e.list;
9572if(h!==null){
9573return h
9574}
9575if(l.length<=1){
9576return null
9577}
9578var a=l;
9579while(a&&!h){
9580a=a.slice(0,-1);
9581e=this._getCachedResults(a,t,true,s);
9582h=e&&e.list;
9583if(h&&h.length==0){
9584return h
9585}}
9586var c=[];
9587if(h&&h.length){
9588for(var o=0;
9589o<h.length;
9590o++){
9591var n=h[o];
9592if(n.matches(l)){
9593c.push(n)
9594}}}else{
9595return null
9596}
9597this._cacheResults(l,t,c,false,false,e,s);
9598return c
9599};
9600ZmAutocomplete.prototype._getCachedResults=function(n,i,e,o){
9601var t=this._getCache(i,n,o);
9602if(t){
9603if(e&&(t.cacheable===false)){
9604return null
9605}
9606if(t.ts){
9607var a=(new Date()).getTime();
9608if(a>(t.ts+ZmAutocomplete.GAL_RESULTS_TTL)){
9609return null
9610}}
9611return t
9612}else{
9613return null
9614}};
9615ZmAutocomplete.prototype._settingChangeListener=function(t){
9616if(t.type!=ZmEvent.S_SETTING){
9617return
9618}
9619var e=AjxEnv.isIE?window.appCtxt:window.parentAppCtxt||window.appCtxt;
9620e.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT)
9621};
9622ZmAutocompleteMatch=function(a,t,n){
9623if(!a){
9624return
9625}
9626this.type=a.type;
9627if(n){
9628this.text=this.name=a.getFullName();
9629this.email=a.getEmail();
9630this.item=a;
9631this.type=ZmContact.getAttr(a,ZmResource.F_type)||ZmAutocomplete.AC_TYPE_GAL
9632}else{
9633if(this.type==ZmAutocomplete.AC_TYPE_GROUP){
9634this.fullAddress=a.email;
9635this.name=a.display;
9636var h=[];
9637var s=a.email.split(",");
9638for(var o=0;
9639o<s.length;
9640o++){
9641var e=AjxEmailAddress.parse(s[o]);
9642if(e&&e.getAddress()){
9643h.push(e.getAddress())
9644}}
9645this.email=h.join(";");
9646this.text=a.display
9647}else{
9648var e=AjxEmailAddress.parse(a.email);
9649if(e){
9650this.fullAddress=e.toString();
9651this.name=e.getName();
9652this.email=e.getAddress()
9653}else{
9654this.email=a.email
9655}
9656this.text=AjxStringUtil.htmlEncode(a.email);
9657if(t&&t.needItem&&window.ZmContact){
9658this.item=new ZmContact(null);
9659this.item.initFromEmail(e||a.email)
9660}}
9661this.icon=ZmAutocomplete.AC_ICON[a.type];
9662this.score=a.ranking
9663}
9664this.icon=this.icon||ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_CONTACT];
9665this.acType=(this.type==ZmAutocomplete.AC_TYPE_LOCATION||this.type==ZmAutocomplete.AC_TYPE_EQUIPMENT)?this.type:ZmAutocomplete.AC_TYPE_CONTACT;
9666this.canForget=(a.type==ZmAutocomplete.AC_TYPE_TABLE)
9667};
9668ZmAutocompleteMatch.prototype.toString=function(){
9669return"ZmAutocompleteMatch"
9670};
9671ZmAutocompleteMatch.prototype.matches=function(s){
9672if(this.name&&!this._nameParsed){
9673var n=this.name.split(/\s+/,3);
9674var a=n[0];
9675this._lastName=n[n.length-1];
9676this._firstLast=[a,this._lastName].join(" ");
9677this._nameParsed=true
9678}
9679var e=[this.email,this.name,this._lastName,this._firstLast];
9680for(var t=0;
9681t<e.length;
9682t++){
9683var o=e[t]&&e[t].toLowerCase();
9684if(o&&(o.indexOf(s)==0)){
9685return true
9686}}
9687return false
9688};
9689ZmSearchAutocomplete=function(){
9690this._op={};
9691this._list={};
9692this._loadFunc={};
9693var e={
9694loader:this._loadTags,text:function(t){
9695return t.getName(false,null,true,true)
9696}
9697,icon:function(t){
9698return t.getIcon()
9699}
9700,matchText:function(t){
9701return t.createQuery()
9702}};
9703this._registerHandler("tag",e);
9704e={
9705listType:ZmId.ORG_FOLDER,text:function(t){
9706return t.getPath(false,false,null,true,true)
9707}
9708,icon:function(t){
9709return t.getIcon()
9710}
9711,matchText:function(t){
9712return t.createQuery()
9713}};
9714this._loadFunc[ZmId.ORG_FOLDER]=this._loadFolders;
9715this._registerHandler("in",e);
9716this._registerHandler("under",e);
9717e={
9718loader:this._loadFlags};
9719this._registerHandler("is",e);
9720e={
9721loader:this._loadObjects,icon:function(t){
9722return ZmSearchAutocomplete.ICON[t]
9723}};
9724this._registerHandler("has",e);
9725e={
9726listType:ZmId.ITEM_ATT,text:function(t){
9727return t.desc
9728}
9729,icon:function(t){
9730return t.image
9731}
9732,matchText:function(t){
9733return t.type
9734}
9735,quoteMatch:true};
9736this._loadFunc[ZmId.ITEM_ATT]=this._loadTypes;
9737this._registerHandler("type",e);
9738this._registerHandler("attachment",e);
9739appCtxt.getFolderTree().addChangeListener(new AjxListener(this,this._folderTreeChangeListener));
9740appCtxt.getTagTree().addChangeListener(new AjxListener(this,this._tagTreeChangeListener))
9741};
9742ZmSearchAutocomplete.ICON={};
9743ZmSearchAutocomplete.ICON.attachment="Attachment";
9744ZmSearchAutocomplete.ICON.phone="Telephone";
9745ZmSearchAutocomplete.ICON.url="URL";
9746ZmSearchAutocomplete.prototype._registerHandler=function(a,e){
9747var t=e.loader||this._loadFunc[e.listType];
9748this._op[a]={
9749loader:new AjxCallback(this,t),text:e.text,icon:e.icon,listType:e.listType||a,matchText:e.matchText||e.text,quoteMatch:e.quoteMatch}
9750};
9751ZmSearchAutocomplete.prototype.autocompleteMatch=function(n,s,i,l){
9752if(ZmSearchAutocomplete._ignoreNextKey){
9753ZmSearchAutocomplete._ignoreNextKey=false;
9754return
9755}
9756n=n.toLowerCase().replace(/"/g,"");
9757var t=n.match(/\b-?([a-z]+):/);
9758if(!(t&&t.length)){
9759s.run();
9760return
9761}
9762var a=t[1];
9763var e=this._op[a];
9764if(!e){
9765s.run();
9766return
9767}
9768var o=this._list[e.listType];
9769if(o){
9770s.run(this._getMatches(a,n))
9771}else{
9772var h=new AjxCallback(this,this._handleResponseLoad,[a,n,s]);
9773this._list[e.listType]=[];
9774e.loader.run(e.listType,h)
9775}};
9776ZmSearchAutocomplete.prototype._getMatches=function(l,m){
9777var e=this._op[l];
9778var s=[];
9779var d=this._list[e.listType];
9780var a=m.substr(m.indexOf(":")+1);
9781if(e.listType==ZmId.ORG_FOLDER){
9782a=a.replace(/^\//,"")
9783}
9784for(var h=0,c=d.length;
9785h<c;
9786h++){
9787var t=d[h];
9788var f=e.text?e.text(t):t;
9789var u=f.toLowerCase();
9790if(!a||(u.indexOf(a)==0)){
9791var n=e.matchText?e.matchText(t):e.quoteMatch?[l,":",'"',f,'"'].join(""):[l,":",f].join("");
9792n=m.replace(l+":"+a,n);
9793s.push({
9794text:f,icon:e.icon?e.icon(t):null,matchText:n,exactMatch:(u.length==a.length)}
9795)
9796}}
9797if(s.length==1&&s[0].exactMatch){
9798s=[]
9799}
9800return s
9801};
9802ZmSearchAutocomplete.prototype._handleResponseLoad=function(a,e,t){
9803t.run(this._getMatches(a,e))
9804};
9805ZmSearchAutocomplete.prototype._loadTags=function(n,h){
9806var s=this._list[n];
9807var a=appCtxt.getTagTree().asList();
9808for(var o=0,t=a.length;
9809o<t;
9810o++){
9811var e=a[o];
9812if(e.id!=ZmOrganizer.ID_ROOT){
9813s.push(e)
9814}}
9815s.sort(ZmTag.sortCompare);
9816if(h){
9817h.run()
9818}};
9819ZmSearchAutocomplete.prototype._loadFolders=function(o,h){
9820var s=this._list[o];
9821var a=appCtxt.getFolderTree().asList({
9822includeRemote:true}
9823);
9824for(var t=0,e=a.length;
9825t<e;
9826t++){
9827var n=a[t];
9828if(n.id!=ZmOrganizer.ID_ROOT&&n.type==ZmOrganizer.FOLDER){
9829s.push(n)
9830}}
9831s.sort(ZmFolder.sortComparePath);
9832if(h){
9833h.run()
9834}};
9835ZmSearchAutocomplete.prototype._loadFlags=function(e,t){
9836this._list[e]=["anywhere","unread","read","flagged","unflagged","sent","received","replied","unreplied","forwarded","unforwarded","invite","solo","tome","fromme","ccme","tofromme","fromccme","tofromccme","local","remote"].sort();
9837if(t){
9838t.run()
9839}};
9840ZmSearchAutocomplete.prototype._loadObjects=function(a,n){
9841var o=this._list[a];
9842o.push("attachment");
9843var e=appCtxt.getZimletMgr().getIndexedZimlets();
9844if(e.length){
9845for(var t=0;
9846t<e.length;
9847t++){
9848o.push(e[t].keyword)
9849}}
9850o.sort();
9851if(n){
9852n.run()
9853}};
9854ZmSearchAutocomplete.prototype._loadTypes=function(t,i){
9855AjxDispatcher.require("Browse");
9856var e=new ZmAttachmentTypeList();
9857var a=new AjxCallback(this,this._handleResponseLoadTypes,[e,t,i]);
9858e.load(a)
9859};
9860ZmSearchAutocomplete.prototype._handleResponseLoadTypes=function(e,t,a){
9861this._list[t]=e.getAttachments();
9862if(a){
9863a.run()
9864}};
9865ZmSearchAutocomplete.prototype._folderTreeChangeListener=function(a){
9866var e=a.getDetail("fields");
9867if(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])){
9868var t=ZmId.ORG_FOLDER;
9869if(this._list[t]){
9870this._list[t]=[];
9871this._loadFolders(t)
9872}}};
9873ZmSearchAutocomplete.prototype._tagTreeChangeListener=function(a){
9874var e=a.getDetail("fields");
9875if(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])){
9876var t="tag";
9877if(this._list[t]){
9878this._list[t]=[];
9879this._loadTags(t)
9880}}}
9881}
9882if(AjxPackage.define("zimbraMail.share.model.ZmInvite")){
9883ZmInvite=function(){
9884ZmModel.call(this)
9885};
9886ZmInvite.prototype=new ZmModel;
9887ZmInvite.prototype.constructor=ZmInvite;
9888ZmInvite.prototype.toString=function(){
9889return"ZmInvite: name="+this.name+" id="+this.id
9890};
9891ZmInvite._sendFun=null;
9892ZmInvite.createFromDom=function(n){
9893var t=new ZmInvite();
9894t.components=n[0].comp;
9895t.replies=n[0].replies;
9896if(t.components==null){
9897t.components=[{}
9898];
9899t.components.empty=true
9900}
9901var e=n[0];
9902if(e.tz){
9903for(var o=0;
9904o<e.tz.length;
9905o++){
9906var l=e.tz[o];
9907var s=AjxTimezone.getRule(l.id);
9908if(!s){
9909var h={
9910standard:l.standard?AjxUtil.createProxy(l.standard[0]):{}
9911,daylight:l.daylight?AjxUtil.createProxy(l.daylight[0]):null};
9912h.standard.offset=l.stdoff;
9913delete h.standard._object_;
9914if(l.daylight){
9915h.daylight.offset=l.dayoff;
9916delete h.daylight._object_
9917}
9918s=AjxTimezone.getRule(l.id,h);
9919if(s){
9920var a=AjxUtil.createProxy(s);
9921a.aliasId=s.clientId;
9922a.clientId=l.id;
9923a.serverId=l.id;
9924AjxTimezone.addRule(a)
9925}}
9926if(!s){
9927s={
9928clientId:l.id,serverId:l.id,autoDetected:true};
9929if(l.daylight){
9930s.standard=AjxUtil.createProxy(l.standard[0]);
9931s.standard.offset=l.stdoff;
9932s.standard.trans=AjxTimezone.createTransitionDate(s.standard);
9933s.daylight=AjxUtil.createProxy(l.daylight[0]);
9934s.daylight.offset=l.dayoff;
9935s.daylight.trans=AjxTimezone.createTransitionDate(s.daylight)
9936}else{
9937s.standard={
9938offset:l.stdoff}
9939}
9940AjxTimezone.addRule(s)
9941}}}
9942t.type=e&&e.type?e.type:"appt";
9943return t
9944};
9945ZmInvite.prototype.setMessageId=function(e){
9946this.msgId=e
9947};
9948ZmInvite.prototype.getMessageId=function(){
9949return this.msgId
9950};
9951ZmInvite.prototype.getComponent=function(e){
9952return this.components[e]
9953};
9954ZmInvite.prototype.getComponents=function(){
9955return this.components
9956};
9957ZmInvite.prototype.getComponentByUid=function(t){
9958for(var e=0;
9959e<components.length;
9960++e){
9961if(components.uid==t){
9962break
9963}}};
9964ZmInvite.prototype.hasMultipleComponents=function(){
9965return(this.components.length>1)
9966};
9967ZmInvite.prototype.hasOtherAttendees=function(e){
9968var t=e||0;
9969return this.components[t].at&&this.components[t].at.length>0
9970};
9971ZmInvite.prototype.getEventName=function(e){
9972var t=e||0;
9973return this.components[t]?this.components[t].name:null
9974};
9975ZmInvite.prototype.getAlarm=function(e){
9976var t=e||0;
9977return this.components[t]?this.components[t].alarm:null
9978};
9979ZmInvite.prototype.getInviteMethod=function(e){
9980var t=e||0;
9981return this.components[t]?this.components[t].method:null
9982};
9983ZmInvite.prototype.getSequenceNo=function(e){
9984var t=e||0;
9985return this.components[t]?this.components[t].seq:null
9986};
9987ZmInvite.prototype.getOrganizerEmail=function(e){
9988var t=e||0;
9989return(this.components[t]&&this.components[t].or&&this.components[t].or.url)?(this.components[t].or.url.replace("MAILTO:","")):null
9990};
9991ZmInvite.prototype.getOrganizerName=function(e){
9992var t=e||0;
9993return(this.components[t]&&this.components[t].or)?(this.components[t].or.d||this.components[t].or.url):null
9994};
9995ZmInvite.prototype.getSentBy=function(e){
9996var t=e||0;
9997return(this.components[t]&&this.components[t].or)?this.components[t].or.sentBy:null
9998};
9999ZmInvite.prototype.isOrganizer=function(e){
10000var t=e||0;
10001return this.components[t]?(!!this.components[t].isOrg):false
10002};
10003ZmInvite.prototype.shouldRsvp=function(e){
10004var t=e||0;
10005return this.components[t]?this.components[t].rsvp:null
10006};
10007ZmInvite.prototype.getRecurrenceRules=function(e){
10008var t=e||0;
10009return this.components[t].recur
10010};
10011ZmInvite.prototype.getAttendees=function(a){
10012var n=a||0;
10013var e=this.components[n].at;
10014var o=[];
10015if(!(e&&e.length)){
10016return o
10017}
10018for(var t=0;
10019t<e.length;
10020t++){
10021if(!e[t].cutype||(e[t].cutype==ZmCalendarApp.CUTYPE_INDIVIDUAL)){
10022o.push(e[t])
10023}}
10024return o
10025};
10026ZmInvite.prototype.getReplies=function(e){
10027var t=e||0;
10028return(this.replies&&this.replies[t])?this.replies[t].reply:null
10029};
10030ZmInvite.prototype.getResources=function(a){
10031var n=a||0;
10032var e=this.components[n].at;
10033var o=[];
10034if(!(e&&e.length)){
10035return o
10036}
10037for(var t=0;
10038t<e.length;
10039t++){
10040if(e[t].cutype==ZmCalendarApp.CUTYPE_RESOURCE){
10041o.push(e[t])
10042}}
10043return o
10044};
10045ZmInvite.prototype.getExceptId=function(e){
10046var t=e||0;
10047return(this.components[t]&&this.components[t].exceptId)?this.components[t].exceptId[0]:null
10048};
10049ZmInvite.prototype.getAppointmentId=function(e){
10050var t=e||0;
10051return this.components[t].apptId
10052};
10053ZmInvite.prototype.getStatus=function(e){
10054var t=e||0;
10055return this.components[t].status
10056};
10057ZmInvite.prototype.isEmpty=function(){
10058return Boolean(this.components.empty)
10059};
10060ZmInvite.prototype.isException=function(e){
10061var t=e||0;
10062return this.components[t]?this.components[t].ex:false
10063};
10064ZmInvite.prototype.isRecurring=function(e){
10065var t=e||0;
10066return this.components[t]?this.components[t].recur:false
10067};
10068ZmInvite.prototype.isAllDayEvent=function(e){
10069var t=e||0;
10070return this.components[t]?this.components[t].allDay=="1":false
10071};
10072ZmInvite.prototype.isMultiDay=function(t){
10073var i=t||0;
10074var a=this.getServerStartDate(i);
10075var e=this.getServerEndDate(i);
10076return(a.getDate()!=e.getDate())||(a.getMonth()!=e.getMonth())||(a.getFullYear()!=e.getFullYear())
10077};
10078ZmInvite.prototype.getComponentDescriptionHtml=function(t){
10079var n=t||0;
10080var e=this.components[n];
10081if(e==null){
10082return
10083}
10084var o=e.descHtml;
10085var i=o&&o[0]._content||null;
10086if(!i){
10087var a=e.desc;
10088a=(a&&a[0]._content)||null;
10089if(!a){
10090i=this.getApptSummary(true)
10091}}
10092return i
10093};
10094ZmInvite.prototype.getComponentDescription=function(t){
10095var n=t||0;
10096var e=this.components[n];
10097if(e==null){
10098return
10099}
10100var i=e.desc;
10101var a=i&&i[0]._content||null;
10102if(!a){
10103var o=e.descHtml;
10104o=(o&&o[0]._content)||null;
10105if(!o){
10106a=this.getApptSummary()
10107}}
10108return a
10109};
10110ZmInvite.prototype.getServerEndTime=function(l){
10111var u=l||0;
10112if(this.components[u]==null){
10113return
10114}
10115if(this._serverEndTime==null){
10116if(this.components[u].e!=null){
10117this._serverEndTime=this.components[u].e[0].d
10118}else{
10119if(this.components[u].s){
10120var a=this.components[u].dur;
10121var f=a&&a[0].d||0;
10122var e=a&&a[0].w||0;
10123var o=a&&a[0].h||0;
10124var n=a&&a[0].m||0;
10125var g=a&&a[0].s||0;
10126var p=parseInt(g)+(parseInt(n)*60)+(parseInt(o)*3600)+(parseInt(f)*24*3600)+(parseInt(e)*7*24*3600);
10127var i=this.components[u].s[0].d;
10128var s=parseInt(i.substr(0,4),10);
10129var m=parseInt(i.substr(4,2),10);
10130var f=parseInt(i.substr(6,2),10);
10131var c=new Date(s,m-1,f);
10132if(i.charAt(8)=="T"){
10133o=parseInt(i.substr(9,2),10);
10134n=parseInt(i.substr(11,2),10);
10135g=parseInt(i.substr(13,2),10);
10136c.setHours(o,n,g,0)
10137}
10138var h=new Date(c.getTime()+(p*1000));
10139m=AjxDateUtil._pad(c.getMonth()+1);
10140f=AjxDateUtil._pad(c.getDate());
10141o=AjxDateUtil._pad(c.getHours());
10142n=AjxDateUtil._pad(c.getMinutes());
10143g=AjxDateUtil._pad(c.getSeconds());
10144s=c.getFullYear();
10145this._serverEndTime=[s,m,f,"T",o,n,g].join("")
10146}}}
10147return this._serverEndTime
10148};
10149ZmInvite.prototype.getServerEndDate=function(e){
10150var t=e||0;
10151if(this._serverEndDate==null){
10152this._serverEndDate=AjxDateUtil.parseServerDateTime(this.getServerEndTime(t))
10153}
10154return this._serverEndDate
10155};
10156ZmInvite.prototype.getServerStartTime=function(e){
10157var t=e||0;
10158return this.components[t]&&this.components[t].s?this.components[t].s[0].d:null
10159};
10160ZmInvite.prototype.getServerStartDate=function(e){
10161var t=e||0;
10162if(this._serverStartDate==null){
10163this._serverStartDate=AjxDateUtil.parseServerDateTime(this.getServerStartTime(t))
10164}
10165return this._serverStartDate
10166};
10167ZmInvite.prototype.getServerStartTimeTz=function(e){
10168var a=e||0;
10169if(this.components[a]==null){
10170return
10171}
10172if(this._serverStartTimeZone==null){
10173var t=this.getServerStartTime();
10174this._serverStartTimeZone=t&&t.charAt(t.length-1)=="Z"?AjxTimezone.GMT_NO_DST:(this.components[a].s?this.components[a].s[0].tz:null)
10175}
10176return this._serverStartTimeZone
10177};
10178ZmInvite.prototype.getServerEndTimeTz=function(t){
10179var a=t||0;
10180if(this.components[a]==null){
10181return
10182}
10183if(this._serverEndTimeZone==null){
10184var e=this.getServerEndTime();
10185this._serverEndTimeZone=e&&startTime.charAt(e.length-1)=="Z"?AjxTimezone.GMT_NO_DST:this.components[a].e[0].tz
10186}
10187return this._serverEndTimeZone
10188};
10189ZmInvite.prototype.getDurationText=function(m,y,e,l){
10190var p=this.components[m];
10191var o=this.getServerStartDate(m);
10192var i=this.getServerEndDate(m);
10193if(!o&&!i){
10194return""
10195}
10196if(this.isAllDayEvent(m)){
10197if(y){
10198return""
10199}
10200var f=this.getServerStartDate(m);
10201if(this.isMultiDay(m)){
10202var c=this.getServerEndDate(m);
10203var h=AjxDateFormat.getDateInstance();
10204var u=h.format(f);
10205var t=h.format(c);
10206if(!ZmInvite._daysFormatter){
10207ZmInvite._daysFormatter=new AjxMessageFormat(ZmMsg.durationDays)
10208}
10209return ZmInvite._daysFormatter.format([u,t])
10210}else{
10211var h=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
10212return h.format(f)
10213}}else{
10214var h=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
10215var s=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
10216var f=this.getServerStartDate(m);
10217var g=[];
10218if(f){
10219g=[h.format(f),l?" ":"<br>"];
10220if(e){
10221g.push(s.format(f))
10222}else{
10223var c=this.getServerEndDate(m);
10224if(c){
10225var n=s.format(f);
10226var d=s.format(c);
10227if(!ZmInvite._hoursFormatter){
10228ZmInvite._hoursFormatter=new AjxMessageFormat(ZmMsg.durationHours)
10229}
10230g.push(ZmInvite._hoursFormatter.format([n,d]))
10231}}}
10232return g.join("")
10233}};
10234ZmInvite.prototype.getName=function(e){
10235var t=e||0;
10236return this.components[t]?this.components[t].name:null
10237};
10238ZmInvite.prototype.getFreeBusy=function(e){
10239var t=e||0;
10240return this.components[t]?this.components[t].fb:null
10241};
10242ZmInvite.prototype.getPrivacy=function(e){
10243var t=e||0;
10244return this.components[t]?this.components[t]["class"]:null
10245};
10246ZmInvite.prototype.getXProp=function(e){
10247var t=e||0;
10248return this.components[t]?this.components[t]["xprop"]:null
10249};
10250ZmInvite.prototype.getLocation=function(e){
10251var t=e||0;
10252return this.components[t]?this.components[t].loc:null
10253};
10254ZmInvite.prototype.getRecurrenceId=function(e){
10255var t=e||0;
10256return this.components[t]?this.components[t].ridZ:null
10257};
10258ZmInvite.prototype.getToolTip=function(){
10259if(this._toolTip){
10260return this._toolTip
10261}
10262var i=0;
10263var a=[];
10264var t=0;
10265a[t++]="<table cellpadding=0 cellspacing=0 border=0 >";
10266a[t++]="<tr valign='center'><td colspan=2 align='left'>";
10267a[t++]="<div style='border-bottom: 1px solid black;'>";
10268a[t++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
10269a[t++]="<tr valign='center'><td><b>";
10270a[t++]="<div style='white-space:nowrap'><table border=0 cellpadding=0 cellspacing=0 style='display:inline'><tr>";
10271if(this.hasOtherAttendees(i)){
10272a[t++]="<td>";
10273a[t++]=AjxImg.getImageHtml("ApptMeeting");
10274a[t++]="</td>"
10275}
10276if(this.isException(i)){
10277a[t++]="<td>";
10278a[t++]=AjxImg.getImageHtml("ApptException");
10279a[t++]="</td>"
10280}else{
10281if(this.isRecurring(i)){
10282a[t++]="<td>";
10283a[t++]=AjxImg.getImageHtml("ApptRecur");
10284a[t++]="</td>"
10285}}
10286a[t++]="</tr></table>&nbsp;";
10287a[t++]=AjxStringUtil.htmlEncode(this.getName(i));
10288a[t++]="&nbsp;</div></b></td><td align='right'>";
10289a[t++]=AjxImg.getImageHtml("Appointment");
10290a[t++]="</td></table></div></td></tr>";
10291var e=this.getDurationText(i,false,false);
10292t=this._addEntryRow(ZmMsg.when,e,a,t,false,null,true);
10293if(this.isRecurring(i)){
10294if(!this._recurBlurb){
10295AjxDispatcher.require("CalendarCore");
10296var o=new ZmRecurrence();
10297o.parse(this.getRecurrenceRules(i));
10298this._recurBlurb=o.getBlurb()
10299}
10300t=this._addEntryRow(ZmMsg.repeats,this._recurBlurb,a,t,true,null,true)
10301}
10302t=this._addEntryRow(ZmMsg.location,this.getLocation(i),a,t,false);
10303a[t++]="</table>";
10304this._toolTip=a.join("");
10305return this._toolTip
10306};
10307ZmInvite.prototype.getApptSummary=function(e){
10308var a=this.getMessageId();
10309var i=appCtxt.getById(this.getMessageId());
10310var t;
10311if(i){
10312AjxDispatcher.require("CalendarCore");
10313t=new ZmAppt();
10314t.setFromMessage(i)
10315}
10316return t?t.getSummary(e):this.getSummary(e)
10317};
10318ZmInvite.prototype.getSummary=function(e){
10319var h=0;
10320var c=this.getOrganizerName(h);
10321var u=this.getDurationText(h,false,false,true);
10322var l=this.getLocation(h);
10323if(this.isRecurring(h)){
10324if(!this._recurBlurb){
10325AjxDispatcher.require("CalendarCore");
10326var s=new ZmRecurrence();
10327s.setRecurrenceRules(this.getRecurrenceRules(h),this.getServerStartDate(h));
10328this._recurBlurb=s.getBlurb()
10329}}
10330var n=this._recurBlurb;
10331var t=[];
10332var o=0;
10333if(!this._summaryHtmlLineFormatter){
10334this._summaryHtmlLineFormatter=new AjxMessageFormat("<tr><th align='left'>{0}</th><td>{1} {2}</td></tr>");
10335this._summaryTextLineFormatter=new AjxMessageFormat("{0} {1} {2}")
10336}
10337var d=e?this._summaryHtmlLineFormatter:this._summaryTextLineFormatter;
10338var a=[];
10339if(e){
10340t[o++]="<p>\n<table border='0'>\n"
10341}
10342if(c){
10343a=[ZmMsg.organizerLabel,c,""];
10344t[o++]=d.format(a);
10345t[o++]="\n"
10346}
10347if(u){
10348a=[ZmMsg.whenLabel,u,""];
10349t[o++]=d.format(a);
10350t[o++]="\n"
10351}
10352if(l){
10353a=[ZmMsg.locationLabel,l,""];
10354t[o++]=d.format(a);
10355t[o++]="\n"
10356}
10357if(n){
10358a=[ZmMsg.repeatLabel,n,""];
10359t[o++]=d.format(a);
10360t[o++]="\n"
10361}
10362if(e){
10363t[o++]="</table>\n"
10364}
10365t[o++]=e?"<div>":"\n\n";
10366t[o++]=ZmItem.NOTES_SEPARATOR;
10367t[o++]=e?"</div><br>":"\n\n";
10368return t.join("")
10369};
10370ZmInvite.prototype._addEntryRow=function(s,n,t,e,o,i,a){
10371if(n!=null&&n!=""){
10372t[e++]="<tr valign='top'><td align='right' style='padding-right: 5px;'><b><div style='white-space:nowrap'>";
10373t[e++]=AjxMessageFormat.format(ZmMsg.makeLabel,AjxStringUtil.htmlEncode(s));
10374t[e++]="</div></b></td><td align='left'><div style='white-space:";
10375t[e++]=o?"wrap;":"nowrap;";
10376if(i){
10377t[e++]="width:";
10378t[e++]=i;
10379t[e++]="px;"
10380}
10381t[e++]="'>";
10382t[e++]=a?n:AjxStringUtil.htmlEncode(n);
10383t[e++]="</div></td></tr>"
10384}
10385return e
10386};
10387ZmInvite.prototype.hasAcceptableComponents=function(){
10388for(var e in this.components){
10389if(this.getStatus(e)!=ZmCalendarApp.STATUS_CANC){
10390return true
10391}}
10392return false
10393};
10394ZmInvite.prototype.hasInviteReplyMethod=function(t){
10395var e=this.getInviteMethod(t);
10396var a=(e==ZmCalendarApp.METHOD_REQUEST||e==ZmCalendarApp.METHOD_PUBLISH);
10397return((e==null)||a)
10398};
10399ZmInvite.prototype.hasCounterMethod=function(t){
10400var e=this.getInviteMethod(t);
10401return(e==ZmCalendarApp.METHOD_COUNTER)
10402};
10403ZmInvite.prototype.getProposedTimeStr=function(t){
10404var e=this.getInviteMethod(t);
10405if(e==ZmCalendarApp.METHOD_COUNTER){
10406return this.getDurationText(t,false,false,true)
10407}
10408return""
10409}
10410}
10411if(AjxPackage.define("zimbraMail.share.view.ZmAutocompleteListView")){
10412ZmAutocompleteListView=function(i){
10413var e=i.className?i.className:"ZmAutocompleteListView";
10414DwtComposite.call(this,i.parent||appCtxt.getShell(),e,DwtControl.ABSOLUTE_STYLE);
10415this._dataClass=this._dataAPI=i.dataClass;
10416this._dataLoader=i.dataLoader;
10417this._dataLoaded=false;
10418this._matchValue=i.matchValue;
10419this._separator=(i.separator!=null)?i.separator:AjxEmailAddress.SEPARATOR;
10420this._compCallback=i.compCallback;
10421this._keyDownCallback=i.keyDownCallback;
10422this._keyPressCallback=i.keyPressCallback;
10423this._keyUpCallback=i.keyUpCallback;
10424this._enterCallback=i.enterCallback;
10425this._options=i.options||{};
10426this._isDelim=AjxUtil.arrayAsHash(i.delims||ZmAutocompleteListView.DELIMS);
10427this._isDelimCode=AjxUtil.arrayAsHash(i.delimCodes||ZmAutocompleteListView.DELIM_CODES);
10428if(!i.delims&&!i.delimCodes){
10429this._isDelim[","]=this._isDelimCode[188]=appCtxt.get(ZmSetting.AUTOCOMPLETE_ON_COMMA);
10430var t=new AjxListener(this,this._settingChangeListener);
10431var a=appCtxt.getSettings().getSetting(ZmSetting.AUTOCOMPLETE_ON_COMMA);
10432if(a){
10433a.addChangeListener(t)
10434}}
10435this._setMouseEventHdlrs();
10436this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
10437this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
10438this._addSelectionListener(new AjxListener(this,this._listSelectionListener));
10439this._outsideListener=new AjxListener(null,ZmAutocompleteListView._outsideMouseDownListener);
10440this._acInterval=appCtxt.get(ZmSetting.AC_TIMER_INTERVAL);
10441this._acAction=new AjxTimedAction(null,this._autocompleteAction);
10442this._acActionId=-1;
10443if(AjxEnv.isGeckoBased){
10444this._focusAction=new AjxTimedAction(null,this._autocompleteFocus)
10445}
10446this._origClass="acRow";
10447this._selClass="acRow-selected";
10448this._showForgetTextClass="ForgetText";
10449this._hideForgetTextClass="ForgetText-hide";
10450this._hideSelForgetTextClass="ForgetText-hide-selected";
10451this._numChars=0;
10452this._done={};
10453this.setVisible(false);
10454this.setScrollStyle(Dwt.SCROLL)
10455};
10456ZmAutocompleteListView.prototype=new DwtComposite;
10457ZmAutocompleteListView.prototype.constructor=ZmAutocompleteListView;
10458ZmAutocompleteListView.DELIMS=[",",";","\n","\r","\t"];
10459ZmAutocompleteListView.DELIM_CODES=[188,59,186,3,13,9];
10460ZmAutocompleteListView.WAIT_ID="wait";
10461ZmAutocompleteListView.NEXT=-1;
10462ZmAutocompleteListView.PREV=-2;
10463ZmAutocompleteListView.onKeyDown=function(n){
10464n=DwtUiEvent.getEvent(n);
10465var e=null;
10466var i=DwtKeyEvent.getCharCode(n);
10467if(i==38||i==40){
10468ZmAutocompleteListView.__geckoKeyCode=null;
10469e=ZmAutocompleteListView._onKeyUp(n)
10470}else{
10471e=ZmAutocompleteListView._onKeyDown(n)
10472}
10473var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
10474var t=DwtControl.ALL_BY_ID[a._aclvId];
10475if(t&&t._keyDownCallback){
10476var o=t._keyDownCallback.run(n,t,e);
10477e=(o===true||o===false)?o:e
10478}
10479return e
10480};
10481ZmAutocompleteListView.onKeyPress=function(n){
10482n=DwtUiEvent.getEvent(n);
10483DwtKeyEvent.geckoCheck(n);
10484var e=null;
10485var i=DwtKeyEvent.getCharCode(n);
10486if(AjxEnv.isGeckoBased&&(i==38||i==40)){
10487if(ZmAutocompleteListView.__geckoKeyCode){
10488e=ZmAutocompleteListView._onKeyUp(n)
10489}else{
10490ZmAutocompleteListView.__geckoKeyCode=i
10491}}
10492var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
10493var t=DwtControl.ALL_BY_ID[a._aclvId];
10494if(t&&t._keyPressCallback){
10495var o=t._keyPressCallback.run(n,t);
10496e=(o===true||o===false)?o:e
10497}
10498return(e!=null)?e:ZmAutocompleteListView._echoKey(true,n)
10499};
10500ZmAutocompleteListView.onKeyUp=function(n){
10501n=DwtUiEvent.getEvent(n);
10502var i=DwtKeyEvent.getCharCode(n);
10503if(i==38||i==40){
10504ZmAutocompleteListView.__geckoKeyCode=null;
10505return true
10506}
10507var e=ZmAutocompleteListView._onKeyUp(n);
10508var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
10509var t=DwtControl.ALL_BY_ID[a._aclvId];
10510if(t&&t._keyUpCallback){
10511var o=t._keyUpCallback.run(n,t,e);
10512e=(o===true||o===false)?o:e
10513}
10514return e
10515};
10516ZmAutocompleteListView._onKeyDown=function(i){
10517var a=DwtKeyEvent.getCharCode(i);
10518if(a==3||a==13){
10519var t=DwtUiEvent.getTargetWithProp(i,"_aclvId");
10520if(!t){
10521return ZmAutocompleteListView._echoKey(true,i)
10522}
10523var e=DwtControl.ALL_BY_ID[t._aclvId];
10524if(e&&e.getVisible()){
10525return ZmAutocompleteListView._echoKey(false,i)
10526}}
10527if(a==9||a==27){
10528return ZmAutocompleteListView._onKeyUp(i)
10529}else{
10530return ZmAutocompleteListView._echoKey(true,i)
10531}};
10532ZmAutocompleteListView._onKeyUp=function(s){
10533this._hasCompleted=false;
10534var n=DwtUiEvent.getTargetWithProp(s,"_aclvId");
10535if(!n){
10536return ZmAutocompleteListView._echoKey(true,s)
10537}
10538var o=DwtControl.ALL_BY_ID[n._aclvId];
10539var i=DwtKeyEvent.getCharCode(s);
10540if(AjxEnv.isIE&&s.type=="keyup"&&(i==9||i==27)){
10541return ZmAutocompleteListView._echoKey(true,s)
10542}
10543var h=n.value;
10544if(o._acActionId!=-1&&!DwtKeyMap.IS_MODIFIER[i]){
10545AjxTimedAction.cancelAction(o._acActionId);
10546o._acActionId=-1
10547}
10548if(DwtKeyMap.IS_MODIFIER[i]||DwtKeyMapMgr.hasModifier(s)){
10549return ZmAutocompleteListView._echoKey(true,s)
10550}
10551if(!h){
10552o.reset();
10553return ZmAutocompleteListView._echoKey(true,s)
10554}
10555if(i==37||i==39){
10556return ZmAutocompleteListView._echoKey(true,s)
10557}
10558if((i==9||i==27)&&!o.size()){
10559return ZmAutocompleteListView._echoKey(true,s)
10560}
10561if(AjxStringUtil.isPrintKey(i)||(i==3||i==9||i==13)){
10562o._numChars++
10563}
10564var t=(o.getVisible()&&(o._numChars==1)&&(!s.shiftKey&&o._isDelimCode[i]));
10565if(t||(i==27||(o.getVisible()&&(i==38||i==40)))){
10566o.handleAction(i,t);
10567if(AjxEnv.isGeckoBased&&i==9){
10568o._focusAction.args=[n];
10569AjxTimedAction.scheduleAction(o._focusAction,0)
10570}
10571if((i==13||i==3)&&o._enterCallback){
10572var e=o._enterCallback.run(s);
10573return(e!=null)?e:ZmAutocompleteListView._echoKey(true,s)
10574}
10575return ZmAutocompleteListView._echoKey(false,s)
10576}
10577if(!AjxStringUtil.isPrintKey(i)&&(i!=3&&i!=13&&i!=9&&i!=8&&i!=46)){
10578return ZmAutocompleteListView._echoKey(true,s)
10579}
10580if((i==13||i==3)&&o._enterCallback){
10581o.reset();
10582var e=o._enterCallback.run(s);
10583return(e!=null)?e:ZmAutocompleteListView._echoKey(true,s)
10584}
10585var a=new DwtKeyEvent();
10586DwtKeyEvent.copy(a,s);
10587a.aclv=o;
10588a.element=n;
10589o._acAction.obj=o;
10590o._acAction.args=[a];
10591o._acActionId=AjxTimedAction.scheduleAction(o._acAction,o._acInterval);
10592return ZmAutocompleteListView._echoKey(true,s)
10593};
10594ZmAutocompleteListView._echoKey=function(e,t){
10595DwtUiEvent.setBehaviour(t,!e,e);
10596return e
10597};
10598ZmAutocompleteListView._outsideMouseDownListener=function(t){
10599var e=ZmAutocompleteListView._activeAcList;
10600if(e.getVisible()){
10601var a=DwtControl.getTargetControl(t);
10602if(a!=e&&!a.isForgetText){
10603e.show(false);
10604t._stopPropagation=false;
10605t._returnValue=true
10606}}};
10607ZmAutocompleteListView.prototype.toString=function(){
10608return"ZmAutocompleteListView"
10609};
10610ZmAutocompleteListView.prototype.setActiveAccount=function(e){
10611this._activeAccount=e
10612};
10613ZmAutocompleteListView.prototype.handle=function(e){
10614e._aclvId=this._htmlElId;
10615Dwt.setHandler(e,DwtEvent.ONKEYDOWN,ZmAutocompleteListView.onKeyDown);
10616Dwt.setHandler(e,DwtEvent.ONKEYPRESS,ZmAutocompleteListView.onKeyPress);
10617Dwt.setHandler(e,DwtEvent.ONKEYUP,ZmAutocompleteListView.onKeyUp)
10618};
10619ZmAutocompleteListView.prototype.autocomplete=function(t){
10620if(!t||(t.text=="undefined")){
10621return
10622}
10623if(this._dataLoader&&!this._dataLoaded){
10624this._data=this._dataLoader.call(this._dataClass);
10625this._dataAPI=this._data;
10626this._dataLoaded=true
10627}
10628var a=new AjxCallback(this,this.autocomplete);
10629if(t.start<t.text.length){
10630var e=this._nextChunk(t.text,t.start);
10631this._autocomplete(e,a)
10632}else{
10633if(t.change){
10634this._updateField(t.text,t.match)
10635}}};
10636ZmAutocompleteListView.prototype.reset=function(){
10637this._matches=null;
10638this._matchHash={};
10639this._canForget={};
10640this._selected=null;
10641this.show(false)
10642};
10643ZmAutocompleteListView.prototype.handleAction=function(t,e){
10644if(e){
10645this._update(true)
10646}else{
10647if(t==38||t==40){
10648if(this.size()<=1){
10649return
10650}
10651if(t==40){
10652this._setSelected(ZmAutocompleteListView.NEXT)
10653}else{
10654if(t==38){
10655this._setSelected(ZmAutocompleteListView.PREV)
10656}}}else{
10657if(t==27){
10658this.reset()
10659}}}};
10660ZmAutocompleteListView.prototype.setWaiting=function(t){
10661if(t&&!this._waitingRow){
10662if(!this.size()){
10663this.show(true)
10664}
10665var i=this._getTable();
10666var o=this._waitingRow=i.insertRow(-1);
10667var e=o.insertCell(-1);
10668e.innerHTML="<div class='DwtWait16Icon'></div>";
10669e=o.insertCell(-1);
10670e.innerHTML=ZmMsg.autocompleteWaiting;
10671e=o.insertCell(-1);
10672e.innerHTML="&nbsp;"
10673}else{
10674var a=new AjxTimedAction(this,this._clearWaiting);
10675AjxTimedAction.scheduleAction(a,1000)
10676}};
10677ZmAutocompleteListView.prototype._autocompleteAction=function(a){
10678var t=a.element;
10679var e=a.aclv;
10680e._acActionId=-1;
10681e._numChars=0;
10682e.reset();
10683e._element=t;
10684var i={
10685text:t.value,start:0};
10686e.autocomplete(i)
10687};
10688ZmAutocompleteListView.prototype.show=function(e,t){
10689if(e){
10690this._popup(t)
10691}else{
10692this._hasCompleted=false;
10693this._popdown()
10694}};
10695ZmAutocompleteListView.prototype._nextChunk=function(o,s){
10696while(o.charAt(s)==" "){
10697s++
10698}
10699var e=false;
10700for(var a=s;
10701a<o.length;
10702a++){
10703var n=o.charAt(a);
10704if(n=='"'){
10705n=o.charAt(++a);
10706while(a<o.length&&n!='"'){
10707n=o.charAt(++a)
10708}}
10709if(this._isDelim[n]){
10710var t=o.substring(s,a);
10711if(this._dataAPI.isComplete&&this._dataAPI.isComplete(t)){
10712s=a+1;
10713while(o.charAt(s)==" "){
10714s++
10715}}else{
10716return{
10717text:o,str:t,start:s,end:a,delim:true}
10718}}}
10719var t=o.substring(s,a);
10720return{
10721text:o,str:t,start:s,end:a,delim:false}
10722};
10723ZmAutocompleteListView.prototype._autocomplete=function(e,n){
10724if(!e||!(this._dataAPI&&this._dataAPI.autocompleteMatch)){
10725return
10726}
10727var a=AjxStringUtil.trim(e.str);
10728if(!(a&&a.length)||(this._done[a])){
10729if(n){
10730n.run({
10731text:e.text,start:e.end+1}
10732);
10733return
10734}else{
10735return{
10736text:e.text,start:e.end+1}
10737}}
10738this._start=e.start;
10739this._end=e.end;
10740var t=e.text;
10741var o=e.end;
10742this._removeAll();
10743var i=new AjxCallback(this,this._handleResponseAutocomplete,[a,e,t,o,n]);
10744this._dataAPI.autocompleteMatch(a,i,this,this._options,this._activeAccount)
10745};
10746ZmAutocompleteListView.prototype._handleResponseAutocomplete=function(o,s,l,e,h,i){
10747var t;
10748var n=false;
10749if(!t){
10750if(i&&i.length){
10751this._set(i)
10752}
10753var a;
10754if(s&&s.delim&&(s.end==s.text.length-1)){
10755var c=this._complete(l,o,true);
10756if(c){
10757l=c.text;
10758e=c.start;
10759a=c.match;
10760n=true
10761}}else{
10762if(i&&i.length){
10763if(!this._hasCompleted){
10764this.show(true)
10765}}}
10766t={
10767text:l,start:e,match:a,change:n}
10768}
10769if(h){
10770h.run(t)
10771}};
10772ZmAutocompleteListView.prototype._complete=function(d,l,t){
10773var s=this._matchHash[this._selected];
10774if(!s&&l&&t&&this._dataAPI.quickComplete){
10775s=this._dataAPI.quickComplete(l)
10776}
10777if(!s){
10778return
10779}
10780var e=this._start;
10781var a=t?this._end+1:this._end;
10782var c="";
10783if(this._matchValue instanceof Array){
10784for(var o=0,h=this._matchValue.length;
10785o<h;
10786o++){
10787if(s[this._matchValue[o]]){
10788c=s[this._matchValue[o]];
10789break
10790}}}else{
10791c=s[this._matchValue]||""
10792}
10793var n=[d.substring(0,e),c,this._separator,d.substring(a,d.length)].join("");
10794if(c){
10795this._done[c]=true
10796}
10797return{
10798text:n,start:e+c.length+this._separator.length,match:s}
10799};
10800ZmAutocompleteListView.prototype._updateField=function(a,e){
10801var t=this._element;
10802t.value=a;
10803t.focus();
10804Dwt.setSelectionRange(t,a.length,a.length);
10805this.reset();
10806this._hasCompleted=true;
10807if(this._compCallback){
10808this._compCallback.run(a,t,e)
10809}};
10810ZmAutocompleteListView.prototype._update=function(t){
10811var e=this._complete(this._element.value,null,t);
10812if(e){
10813this._updateField(e.text,e.match)
10814}};
10815ZmAutocompleteListView.prototype._mouseDownListener=function(e){
10816e=DwtUiEvent.getEvent(e);
10817var a=DwtUiEvent.getTargetWithProp(e,"id");
10818if(!a||!a.id){
10819return
10820}
10821if(e.button==DwtMouseEvent.LEFT){
10822this._setSelected(a.id);
10823if(this.isListenerRegistered(DwtEvent.SELECTION)){
10824var t=DwtShell.selectionEvent;
10825DwtUiEvent.copy(t,e);
10826t.detail=0;
10827this.notifyListeners(DwtEvent.SELECTION,t);
10828return true
10829}}};
10830ZmAutocompleteListView.prototype._mouseOverListener=function(e){
10831e=DwtUiEvent.getEvent(e);
10832var t=Dwt.findAncestor(DwtUiEvent.getTarget(e),"id");
10833if(t){
10834this._setSelected(t.id)
10835}
10836return true
10837};
10838ZmAutocompleteListView.prototype._addSelectionListener=function(e){
10839this._eventMgr.addListener(DwtEvent.SELECTION,e)
10840};
10841ZmAutocompleteListView.prototype._listSelectionListener=function(e){
10842this._update(true)
10843};
10844ZmAutocompleteListView.prototype._getTable=function(){
10845var a=this._tableId&&document.getElementById(this._tableId);
10846if(!a){
10847var t=[],e=0;
10848this._tableId=Dwt.getNextId();
10849t[e++]="<table id='"+this._tableId+"' cellpadding=0 cellspacing=0 border=0>";
10850t[e++]="</table>";
10851this.getHtmlElement().innerHTML=t.join("");
10852a=document.getElementById(this._tableId)
10853}
10854return a
10855};
10856ZmAutocompleteListView.prototype._set=function(s){
10857var c=this._getTable();
10858this._matches=s;
10859var n=this._matches.length;
10860for(var t=0;
10861t<n;
10862t++){
10863var o=this._matches[t];
10864if(o&&(o.text||o.icon)){
10865var e=o.id=this._getId("Row",t);
10866this._matchHash[e]=o;
10867var d=c.insertRow(-1);
10868d.className=this._origClass;
10869d.id=e;
10870var a=[],h=0;
10871var l=d.insertCell(-1);
10872l.className="Icon";
10873if(o.icon){
10874l.innerHTML=(o.icon.indexOf("Dwt")!=-1)?["<div class='",o.icon,"'></div>"].join(""):AjxImg.getImageHtml(o.icon)
10875}else{
10876l.innerHTML="&nbsp;"
10877}
10878l=d.insertCell(-1);
10879l.innerHTML=o.text||"&nbsp;";
10880if(this._options.supportForget!==false){
10881this._canForget[e]=o.canForget;
10882l=d.insertCell(-1);
10883l.className="Forget";
10884l.innerHTML=o.canForget?"<a id='"+this._getId("Forget",t)+"'></a>":""
10885}}}
10886this._addForgetLinks();
10887AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
10888this._setSelected(this._getId("Row",0))
10889}
10890),100)
10891};
10892ZmAutocompleteListView.prototype._getId=function(t,e){
10893return[this._htmlElId,"ac"+t,e].join("_")
10894};
10895ZmAutocompleteListView.prototype._addForgetLinks=function(){
10896this._rowForgetHash={};
10897var e=this._matches.length;
10898for(var a=0;
10899a<e;
10900a++){
10901var t=this._matches[a];
10902var h=t.id=this._getId("Row",a);
10903var o=this._getId("Forget",a);
10904var s=document.getElementById(o);
10905if(s){
10906var l=new DwtText({
10907parent:this,className:this._hideForgetTextClass}
10908);
10909this._rowForgetHash[h]=l;
10910l.isForgetText=true;
10911l.setText(ZmMsg.forget);
10912l.setToolTipContent(ZmMsg.forgetTooltip);
10913var n=new AjxListener(this,this._handleForgetLink,[t.email,h]);
10914l.addListener(DwtEvent.ONMOUSEDOWN,n);
10915l.reparentHtmlElement(s)
10916}}};
10917ZmAutocompleteListView.prototype._showForgetLink=function(a,t){
10918var e=this._rowForgetHash[a];
10919if(e){
10920e.setClassName(!t?this._hideForgetTextClass:this._canForget[a]?this._showForgetTextClass:this._hideSelForgetTextClass)
10921}};
10922ZmAutocompleteListView.prototype._popup=function(a){
10923var i=this.shell.getSize().y;
10924var o=Dwt.getLocation(this._element);
10925var c=Dwt.getSize(this._element);
10926var h=o.x;
10927var n=o.y+c.y;
10928var l=i-n;
10929var s=this.size()*this._getRowHeight();
10930this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
10931this.setVisible(true);
10932var e=this.getSize();
10933if(l<s){
10934this.setSize(Dwt.DEFAULT,l-(AjxEnv.isIE?30:10));
10935var t=this.getHtmlElement();
10936if(t.clientWidth!=t.scrollWidth){
10937this.setSize(e.x+Dwt.SCROLLBAR_WIDTH,Dwt.DEFAULT)
10938}}else{
10939if(e.y<s){
10940this.setSize(Dwt.CLEAR,s)
10941}}
10942this.setLocation(h,n);
10943this.setVisible(true);
10944this.setZIndex(Dwt.Z_DIALOG_MENU);
10945ZmAutocompleteListView._activeAcList=this;
10946DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,ZmAutocompleteListView._outsideMouseDownListener);
10947this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN]);
10948this.shell.addListener(DwtEvent.ONMOUSEDOWN,this._outsideListener)
10949};
10950ZmAutocompleteListView.prototype._popdown=function(){
10951this.setZIndex(Dwt.Z_HIDDEN);
10952this.setVisible(false);
10953ZmAutocompleteListView._activeAcList=null;
10954DwtEventManager.removeListener(DwtEvent.ONMOUSEDOWN,ZmAutocompleteListView._outsideMouseDownListener);
10955this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN],true);
10956this.shell.removeListener(DwtEvent.ONMOUSEDOWN,this._outsideListener)
10957};
10958ZmAutocompleteListView.prototype._setSelected=function(e){
10959if(e==this._selected){
10960return
10961}
10962var h=document.getElementById(this._tableId);
10963var c=h&&h.rows;
10964if(!(c&&c.length)){
10965return
10966}
10967var a=c.length;
10968var s=-1;
10969if(e==ZmAutocompleteListView.NEXT||e==ZmAutocompleteListView.PREV){
10970if(a<=1){
10971return
10972}
10973for(var t=0;
10974t<a;
10975t++){
10976if(c[t].id==this._selected){
10977s=t;
10978break
10979}}
10980var n=(e==ZmAutocompleteListView.PREV)?s-1:s+1;
10981if(n<0||n>=a){
10982return
10983}
10984e=c[n].id
10985}
10986DwtControl._scrollIntoView(c[n],this.getHtmlElement());
10987for(var t=0;
10988t<a;
10989t++){
10990var l=c[t];
10991var o=l.className;
10992if(l.id==e){
10993l.className=this._selClass
10994}else{
10995if(o!=this._origClass){
10996l.className=this._origClass
10997}}}
10998this._showForgetLink(this._selected,false);
10999this._showForgetLink(e,true);
11000this._selected=e
11001};
11002ZmAutocompleteListView.prototype._getRowHeight=function(){
11003if(!this._rowHeight){
11004if(!ZmAutocompleteListView._activeAcList){
11005this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
11006this.setVisible(true)
11007}
11008var e=this._getTable().rows[0];
11009this._rowHeight=e&&Dwt.getSize(e).y
11010}
11011return this._rowHeight||18
11012};
11013ZmAutocompleteListView.prototype._removeAll=function(){
11014this._matches=null;
11015var n=this._getTable();
11016for(var o=n.rows.length-1;
11017o>=0;
11018o--){
11019var s=n.rows[o];
11020if(s!=this._waitingRow){
11021n.deleteRow(o)
11022}}
11023var a=AjxUtil.values(this._rowForgetHash);
11024for(var o=0,t=a.length;
11025o<t;
11026o++){
11027var e=a[o];
11028DwtControl.ALL_BY_ID[e]=null;
11029delete DwtControl.ALL_BY_ID[e]
11030}};
11031ZmAutocompleteListView.prototype.size=function(){
11032return this._getTable().rows.length
11033};
11034ZmAutocompleteListView.prototype._autocompleteFocus=function(e){
11035e.focus()
11036};
11037ZmAutocompleteListView.prototype._getAcListLoc=function(a){
11038var t=a.element;
11039var i=Dwt.getLocation(t);
11040var e=Dwt.getSize(t).y;
11041return(new DwtPoint(i.x,i.y+e))
11042};
11043ZmAutocompleteListView.prototype._clearWaiting=function(){
11044if(this._waitingRow&&this._waitingRow.parentNode){
11045this._waitingRow.parentNode.removeChild(this._waitingRow)
11046}
11047this._waitingRow=null;
11048if(!this.size()){
11049this.show(false)
11050}};
11051ZmAutocompleteListView.prototype._settingChangeListener=function(e){
11052if(e.type!=ZmEvent.S_SETTING){
11053return
11054}
11055if(e.source.id==ZmSetting.AUTOCOMPLETE_ON_COMMA){
11056this._isDelim[","]=this._isDelimCode[188]=appCtxt.get(ZmSetting.AUTOCOMPLETE_ON_COMMA)
11057}};
11058ZmAutocompleteListView.prototype._handleForgetLink=function(e,t){
11059if(this._dataAPI.forget){
11060this._dataAPI.forget(e,new AjxCallback(this,this._handleResponseForget,[t,e]))
11061}};
11062ZmAutocompleteListView.prototype._handleResponseForget=function(t,e){
11063var i=document.getElementById(t);
11064if(i){
11065i.parentNode.removeChild(i);
11066var a=AjxMessageFormat.format(ZmMsg.forgetSummary,[e]);
11067appCtxt.setStatusMsg(a)
11068}}
11069}
11070if(AjxPackage.define("zimbraMail.share.view.assistant.ZmAssistant")){
11071ZmAssistant=function(o,i,t){
11072if(arguments.length==0){
11073return
11074}
11075this._objectManager=new ZmObjectManager();
11076try{
11077if(window.ZmDate10ObjectHandler){
11078this._objectManager.addHandler(new ZmDate10ObjectHandler(),ZmObjectManager.DATE,100)
11079}}
11080catch(a){}
11081this._fields={};
11082this._title=o;
11083this._commandSummary=t?t:o;
11084this._command=i
11085};
11086ZmAssistant.prototype.constructor=ZmAssistant;
11087ZmAssistant._handlers={};
11088ZmAssistant._commands=[];
11089ZmAssistant._allCommands=[];
11090ZmAssistant.register=function(t,e){
11091if(e==null){
11092e=t.getCommand()
11093}
11094if(e in ZmAssistant._handlers){
11095return
11096}
11097ZmAssistant._handlers[e]=t;
11098ZmAssistant._allCommands.push(e);
11099ZmAssistant._allCommands.sort();
11100if(e.substring(0,1)!="."){
11101ZmAssistant._commands.push(e);
11102ZmAssistant._commands.sort()
11103}};
11104ZmAssistant.matchWord=function(a,o){
11105if(o==null){
11106o=ZmAssistant._allCommands
11107}
11108var t;
11109var e=[];
11110for(t in o){
11111var s=o[t];
11112if(s==a){
11113return[s]
11114}else{
11115if(s.substring(0,a.length)==a){
11116e.push(s)
11117}}}
11118return e
11119};
11120ZmAssistant.getHandler=function(e){
11121return ZmAssistant._handlers[e]
11122};
11123ZmAssistant.getHandlerCommands=function(){
11124return ZmAssistant._commands
11125};
11126ZmAssistant.prototype.initialize=function(t){
11127var e=new AjxBuffer();
11128this._tableId=Dwt.getNextId();
11129e.append("<table cellspacing='3' border='0' width='100%'><tbody id='",this._tableId,"'>");
11130e.append("</tbody></table>");
11131t.setAssistantContent(e.toString())
11132};
11133ZmAssistant.prototype.finish=function(e){
11134this._clearFields()
11135};
11136ZmAssistant.prototype.getTitle=function(){
11137return this._title
11138};
11139ZmAssistant.prototype.getCommand=function(){
11140return this._command
11141};
11142ZmAssistant.prototype.getCommandSummary=function(){
11143return this._commandSummary
11144};
11145ZmAssistant.prototype.handle=function(t,a,e){};
11146ZmAssistant.prototype.okHandler=function(e){
11147return true
11148};
11149ZmAssistant.prototype.getHelp=function(){
11150return null
11151};
11152ZmAssistant.prototype.extraButtonHandler=function(e){
11153return true
11154};
11155ZmAssistant.prototype._matchTime=function(a){
11156var e,o,t=null;
11157var n=a.match(/\s*(?:(?:@|at|\-)\s*)?(\d+):(\d\d)(?:\s*(AM|PM))?\s*/i);
11158var i=a.match(/\s*(?:(?:@|at|\-)\s*)?(\d+)(AM|PM)\s*/i);
11159if(n&&i){
11160if(n.index<i.index){
11161i=null
11162}else{
11163n=null
11164}}
11165if(n){
11166e=parseInt(n[1]);
11167o=parseInt(n[2]);
11168if(n[3]){
11169t=n[3].toLowerCase()
11170}
11171a=a.replace(n[0]," ")
11172}else{
11173if(i){
11174e=parseInt(i[1]);
11175o=0;
11176t=i[2].toLowerCase();
11177a=a.replace(i[0]," ")
11178}else{
11179return null
11180}}
11181if(t=="pm"&&e<12){
11182e+=12
11183}else{
11184if(t=="am"&&e==12){
11185e=0
11186}}
11187return{
11188hour:e,minute:o,args:a}
11189};
11190ZmAssistant._BRACKETS="ZmAssistantBrackets";
11191ZmAssistant._PARENS="ZmAssistantParens";
11192ZmAssistant.prototype._matchTypedObject=function(n,t,a){
11193var i;
11194var l=0;
11195if(t==ZmAssistant._BRACKETS){
11196i=n.match(/\s*\[([^\]]*)\]?\s*/);
11197l=1
11198}else{
11199i=this._objectManager.findMatch(n,t)
11200}
11201if(!i){
11202return null
11203}
11204var s=a.defaultType;
11205var e=null;
11206if(i.index>0){
11207var o=n.substring(0,i.index);
11208e=o.match(/\b(\w+):\s*$/i);
11209if(e){
11210s=e[1].toLowerCase()
11211}}
11212if(e){
11213n=n.replace(e[0]+i[0]," ")
11214}else{
11215n=n.replace(i[0]," ")
11216}
11217if(a.aliases){
11218var h=a.aliases[s];
11219if(h){
11220s=h
11221}}
11222return{
11223data:i[l],args:n,type:s}
11224};
11225ZmAssistant.prototype._clearField=function(a){
11226var t=this._fields[a];
11227if(t){
11228var e=document.getElementById(t.rowId);
11229if(e){
11230e.parentNode.removeChild(e)
11231}
11232delete this._fields[a]
11233}};
11234ZmAssistant.prototype._setOptField=function(n,i,a,o,t,e){
11235if(i&&i!=""){
11236return this._setField(n,i,a,o,t,e)
11237}else{
11238this._clearField(n);
11239return -1
11240}};
11241ZmAssistant.prototype._setField=function(u,f,o,h,c,n){
11242var s=o?"ZmAsstFieldDefValue":"ZmAsstField";
11243var l=-1;
11244var t=this._fields[u];
11245if(h){
11246f=AjxStringUtil.htmlEncode(f)
11247}
11248if(t){
11249var i=document.getElementById(t.rowId);
11250if(i){
11251l=i.rowIndex
11252}
11253var p=document.getElementById(t.id);
11254p.innerHTML=f;
11255p.className=s
11256}else{
11257var e=Dwt.getNextId();
11258if(c!=null){
11259l=c
11260}
11261var a=document.getElementById(this._tableId);
11262var g=a.insertRow(l);
11263g.id=Dwt.getNextId();
11264var m=g.insertCell(-1);
11265m.vAlign=n?n:"top";
11266m.className="ZmAsstFieldLabel";
11267m.innerHTML=AjxStringUtil.htmlEncode(u+":");
11268var d=g.insertCell(-1);
11269d.innerHTML="<div id='"+e+"' class='"+s+"'>"+f+"</div></td>";
11270this._fields[u]={
11271id:e,rowId:g.id};
11272l=g.rowIndex
11273}
11274return l
11275};
11276ZmAssistant.prototype._clearFields=function(){
11277for(var e in this._fields){
11278this._clearField(e)
11279}}
11280}
11281if(AjxPackage.define("zimbraMail.share.view.htmlEditor.ZmHtmlEditor")){
11282ZmHtmlEditor=function(i,a,o,s,e){
11283if(arguments.length==0){
11284return
11285}
11286this._toolbars=[];
11287this.ACE_ENABLED=!!e;
11288this.ACE_DEBUG=false;
11289if(this.ACE_ENABLED){
11290this._ace_componentsLoading=0
11291}
11292DwtHtmlEditor.call(this,{
11293parent:i,className:"ZmHtmlEditor",posStyle:a,content:o,mode:s,blankIframeSrc:appContextPath+"/public/blank.html"}
11294);
11295this.addStateChangeListener(new AjxListener(this,this._rteStateChangeListener));
11296var t=appCtxt.getSettings();
11297var n=new AjxListener(this,this._settingChangeListener);
11298t.getSetting(ZmSetting.COMPOSE_INIT_FONT_COLOR).addChangeListener(n);
11299t.getSetting(ZmSetting.COMPOSE_INIT_FONT_FAMILY).addChangeListener(n);
11300t.getSetting(ZmSetting.COMPOSE_INIT_FONT_SIZE).addChangeListener(n);
11301this._ignoreWords={}
11302};
11303ZmHtmlEditor.prototype=new DwtHtmlEditor;
11304ZmHtmlEditor.prototype.constructor=ZmHtmlEditor;
11305ZmHtmlEditor._VALUE="value";
11306ZmHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
11307ZmHtmlEditor.__makeFontName=function(e){
11308return e.replace(/,.*/,"").replace(/\b[a-z]/g,ZmHtmlEditor.__toUpperCase)
11309};
11310ZmHtmlEditor.__toUpperCase=function(e){
11311return e.toUpperCase()
11312};
11313ZmHtmlEditor.FONT_FAMILY={};
11314(function(){
11315var e=["fontFamilyIntl","fontFamilyBase"];
11316var n,a,o,s,t;
11317for(a=0;
11318a<e.length;
11319a++){
11320for(n=1;
11321s=AjxMsg[e[a]+n+".css"];
11322n++){
11323if(s.match(/^#+$/)){
11324break
11325}
11326t=AjxMsg[e[a]+n+".display"];
11327ZmHtmlEditor.FONT_FAMILY[s]={
11328name:t,value:s}
11329}}}
11330)();
11331ZmHtmlEditor.ACE_IFRAME_RE=new RegExp("<iframe\\s+.*?\\bid\\s*=\\s*[\"']?(ace-[^\"'\\s]*).*?>.*?</iframe(\\s.*?)?>","ig");
11332ZmHtmlEditor.prototype.toString=function(){
11333return"ZmHtmlEditor"
11334};
11335ZmHtmlEditor.prototype.isHtmlEditingSupported=function(){
11336var e=DwtHtmlEditor.prototype.isHtmlEditingSupported.call(this);
11337if(e){
11338e=appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)
11339}
11340return e
11341};
11342ZmHtmlEditor.prototype.setContent=function(e){
11343DwtHtmlEditor.prototype.setContent.apply(this,arguments);
11344this._ignoreWords={}
11345};
11346ZmHtmlEditor.prototype.setMode=function(o,a){
11347this.discardMisspelledWords();
11348DwtHtmlEditor.prototype.setMode.call(this,o,a);
11349if(o==DwtHtmlEditor.HTML){
11350this._createToolbars()
11351}
11352for(var e=0;
11353e<this._toolbars.length;
11354e++){
11355var t=this._toolbars[e];
11356t.setVisible(o==DwtHtmlEditor.HTML)
11357}
11358appCtxt.notifyZimlets("on_htmlEditor_setMode",[this,o])
11359};
11360ZmHtmlEditor.prototype.getBodyFieldId=function(){
11361return this._mode==DwtHtmlEditor.HTML?this._iFrameId:this._textAreaId
11362};
11363ZmHtmlEditor.prototype.getTextVersion=function(e){
11364return this._mode==DwtHtmlEditor.HTML?this._convertHtml2Text(e):this.getContent()
11365};
11366ZmHtmlEditor.prototype.reEnableDesignMode=function(){
11367if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
11368this._enableDesignMode(this._getIframeDoc())
11369}};
11370ZmHtmlEditor.prototype.addEventCallback=function(e){
11371this._eventCallback=e
11372};
11373ZmHtmlEditor.prototype._onContentInitialized=function(){
11374DwtHtmlEditor.prototype._onContentInitialized.call(this);
11375this._loadExternalStyle("/css/editor.css");
11376this._setFontStyles();
11377if(this.ACE_ENABLED&&this._mode==DwtHtmlEditor.HTML){
11378setTimeout(AjxCallback.simpleClosure(this._deserializeAceObjects,this),100)
11379}
11380if(this._onContentInitializeCallback){
11381this._onContentInitializeCallback.run()
11382}};
11383ZmHtmlEditor.prototype.addOnContentIntializedListener=function(e){
11384this._onContentInitializeCallback=e
11385};
11386ZmHtmlEditor.prototype.removeOnContentIntializedListener=function(){
11387this._onContentInitializeCallback=null
11388};
11389ZmHtmlEditor.prototype.getContent=function(e,a){
11390this.discardMisspelledWords();
11391var i;
11392if(this._mode==DwtHtmlEditor.HTML){
11393var o=this._getIframeDoc();
11394var t=this._pendingContent||(o&&o.body?(this._getIframeDoc().body.innerHTML):"");
11395i=this._embedHtmlContent(t,e,a);
11396if(this.ACE_ENABLED){
11397i=this._serializeAceObjects(i)
11398}}else{
11399i=document.getElementById(this._textAreaId).value
11400}
11401return i
11402};
11403ZmHtmlEditor.prototype.checkMisspelledWords=function(o,t,e){
11404var i=this.getTextVersion();
11405if(/\S/.test(i)){
11406AjxDispatcher.require("Extras");
11407this._spellChecker=new ZmSpellChecker(this);
11408this._spellCheck=null;
11409this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
11410if(!this.onExitSpellChecker){
11411this.onExitSpellChecker=t
11412}
11413var a={
11414text:i,ignore:AjxUtil.keys(this._ignoreWords).join()};
11415this._spellChecker.check(a,o,e);
11416return true
11417}
11418return false
11419};
11420ZmHtmlEditor.prototype.spellCheck=function(a){
11421var t=this.getTextVersion();
11422if(/\S/.test(t)){
11423AjxDispatcher.require("Extras");
11424this._spellChecker=new ZmSpellChecker(this);
11425this._spellCheck=null;
11426this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
11427if(!this.onExitSpellChecker){
11428this.onExitSpellChecker=a
11429}
11430var e={
11431text:t,ignore:AjxUtil.keys(this._ignoreWords).join()};
11432this._spellChecker.check(e,new AjxCallback(this,this._spellCheckCallback));
11433return true
11434}
11435return false
11436};
11437ZmHtmlEditor.prototype.resetSpellCheck=function(){
11438this.discardMisspelledWords();
11439this._spellCheckHideModeDiv()
11440};
11441ZmHtmlEditor.prototype.discardMisspelledWords=function(c){
11442if(!this._spellCheck){
11443return
11444}
11445if(this._mode==DwtHtmlEditor.HTML){
11446var s=this._getIframeDoc();
11447s.body.style.display="none";
11448var t=null;
11449var h=this._spellCheck.spanIds;
11450for(var n in h){
11451var l=s.getElementById(n);
11452if(!l){
11453continue
11454}
11455t=l.parentNode;
11456while(l.firstChild){
11457t.insertBefore(l.firstChild,l)
11458}
11459t.removeChild(l)
11460}
11461if(!AjxEnv.isIE){
11462s.body.normalize()
11463}else{
11464s.body.innerHTML=s.body.innerHTML
11465}
11466t=s.getElementById("ZM-SPELLCHECK-STYLE");
11467if(t){
11468t.parentNode.removeChild(t)
11469}
11470s.body.style.display="";
11471this._unregisterEditorEventHandler(s,"contextmenu")
11472}else{
11473if(this._spellCheckDivId!=null){
11474var e=document.getElementById(this._spellCheckDivId);
11475var o=e.scrollTop;
11476var a=document.getElementById(this._textAreaId);
11477if(AjxEnv.isGeckoBased){
11478e.innerHTML=AjxStringUtil.htmlDecode(e.innerHTML,true)
11479}
11480a.value=AjxUtil.getInnerText(e);
11481e.onclick=null;
11482e.oncontextmenu=null;
11483e.onmousedown=null;
11484e.parentNode.removeChild(e);
11485a.style.display="";
11486a.scrollTop=o
11487}}
11488this._spellCheckDivId=this._spellCheck=null;
11489window.status="";
11490if(!c){
11491this._spellCheckHideModeDiv()
11492}
11493if(this.onExitSpellChecker){
11494this.onExitSpellChecker.run()
11495}};
11496ZmHtmlEditor.prototype._resetFormatControls=function(){
11497this._resetFormatControlDefaults();
11498setTimeout(AjxCallback.simpleClosure(this._loadExternalStyle,this,"/css/editor.css"),250);
11499setTimeout(AjxCallback.simpleClosure(this._setFontStyles,this),250)
11500};
11501ZmHtmlEditor.prototype._resetFormatControlDefaults=function(){
11502this._fontFamilyButton.setText(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY));
11503this._fontSizeButton.setText(this._getFontSizeLabel(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE)));
11504this._fontColorButton.setColor(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR));
11505this._styleMenu.checkItem(ZmHtmlEditor._VALUE,DwtHtmlEditor.PARAGRAPH,true);
11506this._justifyMenu.checkItem(ZmHtmlEditor._VALUE,DwtHtmlEditor.JUSTIFY_LEFT,true)
11507};
11508ZmHtmlEditor.prototype._loadExternalStyle=function(n){
11509var o=this._getIframeDoc();
11510var a=o.getElementById(n);
11511if(!a){
11512a=o.createElement("link");
11513a.id=n;
11514a.rel="stylesheet";
11515a.type="text/css";
11516var i=appContextPath+n+"?v="+cacheKillerVersion;
11517if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
11518i=document.baseURI.replace(/^(https?:\x2f\x2f[^\x2f]+).*$/,"$1")+i
11519}
11520var e=DBG&&DBG.getDebugLevel();
11521if(e){
11522i=i+"&debug="+e
11523}
11524a.href=i;
11525var t=o.getElementsByTagName("head")[0];
11526if(!t){
11527t=o.createElement("head");
11528var s=o.documentElement;
11529if(s){
11530s.insertBefore(t,s.firstChild)
11531}}
11532t.appendChild(a)
11533}};
11534ZmHtmlEditor.prototype._setFontStyles=function(){
11535var t=this._getIframeDoc();
11536var e=t.body&&t.body.style;
11537if(e){
11538e.fontFamily=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
11539e.fontSize=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
11540e.color=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR)
11541}};
11542ZmHtmlEditor.prototype.highlightMisspelledWords=function(u,t){
11543this.discardMisspelledWords(t);
11544var y,p,w,o,d=this,n={}
11545,m={}
11546,v=["([^A-Za-z0-9']|^)("],l={};
11547for(var f=0;
11548f<u.length;
11549++f){
11550y=u[f].word;
11551if(!l[y]){
11552f&&v.push("|");
11553v.push(y);
11554var b=u[f].suggestions.split(/\s*,\s*/);
11555if(!b[b.length-1]){
11556b.pop()
11557}
11558l[y]=b;
11559if(l[y].length>5){
11560l[y].length=5
11561}}}
11562v.push(")([^A-Za-z0-9']|$)");
11563v=new RegExp(v.join(""),"gm");
11564function h(z,O){
11565z=O?AjxStringUtil.convertToHtml(z):AjxStringUtil.htmlEncode(z);
11566var k;
11567v.lastIndex=0;
11568while(k=v.exec(z)){
11569var j=k[0];
11570var x=k[1];
11571var a=k[2];
11572var T=k[3];
11573var i=Dwt.getNextId();
11574n[i]=a;
11575if(!m[a]){
11576m[a]=[]
11577}
11578m[a].push(i);
11579var q=[x,'<span word="',a,'" id="',i,'" class="ZM-SPELLCHECK-MISSPELLED">',a,"</span>",T].join("");
11580z=[z.substr(0,k.index),q,z.substr(k.index+j.length)].join("");
11581v.lastIndex=k.index+q.length-T.length
11582}
11583return z
11584}
11585var w;
11586rec=function(z){
11587switch(z.nodeType){
11588case 1:for(var j=z.firstChild;
11589j;
11590j=rec(j)){}
11591z=z.nextSibling;
11592break;
11593case 3:if(!/[^\s\xA0]/.test(z.data)){
11594z=z.nextSibling;
11595break
11596}
11597var q=null,x=null;
11598var k=/^[\s\xA0]+/.exec(z.data);
11599if(k){
11600q=z;
11601z=z.splitText(k[0].length)
11602}
11603k=/[\s\xA0]+$/.exec(z.data);
11604if(k){
11605x=z.splitText(z.data.length-k[0].length)
11606}
11607var O=h(z.data,false);
11608O=O.replace(/^ +/,"&nbsp;").replace(/ +$/,"&nbsp;");
11609var A=w.createElement("div");
11610A.innerHTML=O;
11611if(q){
11612A.insertBefore(q,A.firstChild)
11613}
11614if(x){
11615A.appendChild(x)
11616}
11617var T=z.parentNode;
11618while(A.firstChild){
11619T.insertBefore(A.firstChild,z)
11620}
11621A=z.nextSibling;
11622T.removeChild(z);
11623z=A;
11624break;
11625default:z=z.nextSibling
11626}
11627return z
11628};
11629if(this._mode==DwtHtmlEditor.HTML){
11630w=this._getIframeDoc();
11631o=w.body;
11632this._loadExternalStyle("/css/spellcheck.css");
11633o.style.display="none";
11634if(!AjxEnv.isIE){
11635o.normalize()
11636}else{
11637o.innerHTML=o.innerHTML
11638}
11639rec(o);
11640if(!AjxEnv.isIE){
11641o.normalize()
11642}else{
11643o.innerHTML=o.innerHTML
11644}
11645o.style.display="";
11646this._registerEditorEventHandler(w,"contextmenu")
11647}else{
11648var g=document.getElementById(this._textAreaId);
11649var e=g.scrollTop;
11650var c=Dwt.getSize(g);
11651g.style.display="none";
11652var s=document.createElement("div");
11653s.className="TextSpellChecker";
11654this._spellCheckDivId=s.id=Dwt.getNextId();
11655s.style.overflow="auto";
11656if(!AjxEnv.isIE){
11657c.x-=4;
11658c.y-=6
11659}
11660s.style.width=c.x+"px";
11661s.style.height=c.y+"px";
11662s.innerHTML=AjxStringUtil.convertToHtml(this.getContent());
11663w=document;
11664rec(s);
11665g.parentNode.insertBefore(s,g);
11666s.scrollTop=e;
11667s.oncontextmenu=s.onclick=function(a){
11668d._handleSpellCheckerEvents(a||window.event)
11669}
11670}
11671this._spellCheckShowModeDiv();
11672this._spellCheck={
11673suggestions:l,spanIds:n,wordIds:m}
11674};
11675ZmHtmlEditor.prototype.setSize=function(t,l){
11676var h=this._spellCheckDivId&&document.getElementById(this._spellCheckDivId);
11677var e=document.getElementById(this.getBodyFieldId());
11678var s=this._mode==DwtHtmlEditor.HTML?8:10;
11679if(t==Dwt.CLEAR){
11680e.style.width=null;
11681if(h){
11682h.style.width=null
11683}}else{
11684if(t==Dwt.DEFAULT){
11685e.style.width="auto";
11686if(h){
11687h.style.width="auto"
11688}}else{
11689if(typeof(t)=="number"){
11690t-=s+4;
11691if(t<0){
11692t=0
11693}
11694e.style.width=t+5+"px";
11695if(h){
11696if(!AjxEnv.isIE){
11697t=t>4?(t-4):t
11698}
11699h.style.width=t+"px"
11700}}}}
11701if(l==Dwt.CLEAR){
11702e.style.height=null;
11703if(h){
11704h.style.height=null
11705}}else{
11706if(l==Dwt.DEFAULT){
11707e.style.height="auto";
11708if(h){
11709h.style.height="auto"
11710}}else{
11711if(typeof(l)=="number"){
11712if(this._spellCheckModeDivId){
11713var a=document.getElementById(this._spellCheckModeDivId).offsetHeight;
11714l-=(isNaN(a)?0:a)
11715}
11716if(this._mode==DwtHtmlEditor.HTML&&this._toolbars.length>0){
11717for(var o=0;
11718o<this._toolbars.length;
11719o++){
11720var n=this._toolbars[o];
11721l-=n.getHtmlElement().offsetHeight
11722}}
11723l-=s;
11724if(l<0){
11725l=0
11726}
11727e.style.height=l+"px";
11728if(h){
11729if(!AjxEnv.isIE){
11730l=l>4?(l-4):l
11731}else{
11732l+=2
11733}
11734h.style.height=l+"px"
11735}}}}};
11736ZmHtmlEditor.prototype._initialize=function(){
11737if(this._mode==DwtHtmlEditor.HTML){
11738this._createToolbars()
11739}
11740DwtHtmlEditor.prototype._initialize.call(this)
11741};
11742ZmHtmlEditor.prototype._styleListener=function(e){
11743this.setStyle(e.item.getData(ZmHtmlEditor._VALUE))
11744};
11745ZmHtmlEditor.prototype._fontFamilyListener=function(e){
11746var t=e.item.getData(ZmHtmlEditor._VALUE);
11747this.setFont(ZmHtmlEditor.FONT_FAMILY[t].value);
11748this._fontFamilyButton.setText(ZmHtmlEditor.FONT_FAMILY[t].name)
11749};
11750ZmHtmlEditor.prototype._fontSizeListener=function(e){
11751this.setFont(null,null,e.item.getData(ZmHtmlEditor._VALUE))
11752};
11753ZmHtmlEditor.prototype._indentListener=function(e){
11754this.setIndent(e.item.getData(ZmHtmlEditor._VALUE))
11755};
11756ZmHtmlEditor.prototype._insertLinkListener=function(){
11757var o=this._insertLinkDialog;
11758if(!o){
11759o=this._insertLinkDialog=new DwtDialog({
11760parent:DwtShell.getShell(window),title:ZmMsg.linkProperties}
11761);
11762var n=o.base_id=Dwt.getNextId();
11763var a=AjxTemplate.expand("share.Dialogs#EditorInsertLink",{
11764id:n}
11765);
11766o.setContent(a);
11767o.linkText=new DwtInputField({
11768parent:o,size:40,parentElement:n+"_linkTextCont"}
11769);
11770o.linkTarget=new DwtInputField({
11771parent:o,size:40,parentElement:n+"_linkTargetCont"}
11772);
11773function e(){
11774var s=o.linkTarget.getValue();
11775if(s&&!/^(https?|ftp):\x2f\x2f/i.test(s)){
11776s="http://"+s;
11777o.linkTarget.setValue(s)
11778}
11779return s
11780}
11781var t=new DwtButton({
11782parent:o,parentElement:n+"_testBtnCont"}
11783);
11784t.setText(ZmMsg.testUrl);
11785t.setToolTipContent(ZmMsg.testUrlTooltip);
11786t.addSelectionListener(new AjxListener(this,function(){
11787var s=e();
11788if(s){
11789window.open(s)
11790}}
11791));
11792o._tabGroup.addMember(o.linkText,0);
11793o._tabGroup.addMember(o.linkTarget,1);
11794o._tabGroup.addMember(t,2);
11795o.registerCallback(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
11796var h=e();
11797var s=this.getNearestElement("img");
11798var l=o.linkText.getValue()||h;
11799if(s){
11800var l=o.linkText.getValue()
11801}
11802o.popdown();
11803this.insertLink({
11804text:l,url:h}
11805)
11806}
11807))
11808}
11809var i=this.getLinkProps();
11810o.linkText.setValue(i.text||"");
11811o.linkTarget.setValue(i.url||"");
11812o.popup();
11813if(/\S/.test(i.text)){
11814o.linkTarget.focus()
11815}else{
11816o.linkText.focus()
11817}};
11818ZmHtmlEditor.prototype._insElementListener=function(e){
11819this.insertElement(e.item.getData(ZmHtmlEditor._VALUE))
11820};
11821ZmHtmlEditor.prototype._justificationListener=function(e){
11822this.setJustification(e.item.getData(ZmHtmlEditor._VALUE))
11823};
11824ZmHtmlEditor.prototype._fontStyleListener=function(e){
11825this.setFont(null,e.item.getData(ZmHtmlEditor._VALUE))
11826};
11827ZmHtmlEditor.prototype._fontColorListener=function(e){
11828this.setFont(null,null,null,e.detail||"#000000")
11829};
11830ZmHtmlEditor.prototype._fontHiliteListener=function(e){
11831this.setFont(null,null,null,null,e.detail||"#ffffff")
11832};
11833ZmHtmlEditor.prototype._createToolbars=function(t){
11834if(!this._toolbar1){
11835var e=this._toolbar1=new DwtToolBar({
11836parent:this,className:"ZToolbar",posStyle:DwtControl.RELATIVE_STYLE,cellSpacing:2,index:0}
11837);
11838e.setVisible(this._mode==DwtHtmlEditor.HTML);
11839if(!t){
11840this._createToolBar1(e);
11841new DwtControl({
11842parent:e,className:"vertSep"}
11843);
11844this._createToolBar2(e);
11845this._resetFormatControls()
11846}
11847this._toolbars.push(e)
11848}};
11849ZmHtmlEditor.prototype._createToolBar1=function(e){
11850this._createFontFamilyMenu(e);
11851this._createFontSizeMenu(e);
11852this._createStyleMenu(e);
11853this._createJustifyMenu(e);
11854new DwtControl({
11855parent:e,className:"vertSep"}
11856);
11857this._createListMenu(e);
11858this._createIndentMenu(e);
11859new DwtControl({
11860parent:e,className:"vertSep"}
11861);
11862this._createBUIButtons(e);
11863appCtxt.notifyZimlets("on_htmlEditor_createToolbar1",[this,e])
11864};
11865ZmHtmlEditor.prototype._createToolBar2=function(e){
11866this._createFontColorButtons(e);
11867new DwtControl({
11868parent:e,className:"vertSep"}
11869);
11870this._createHorizRuleButton(e);
11871this._createUrlButton(e);
11872this._createTableMenu(e);
11873if(this.ACE_ENABLED){
11874this._createSpreadSheetButton(e)
11875}
11876appCtxt.notifyZimlets("on_htmlEditor_createToolbar2",[this,e])
11877};
11878ZmHtmlEditor.prototype.__createTableOperationItems=function(e){
11879var h=new AjxListener(this,this._tableOperationsListener);
11880var s=["tableProperties...","cellProperties...",null,"insertRowAbove","insertRowUnder","deleteRow",null,"insertColumnBefore","insertColumnAfter","deleteColumn",null];
11881if(AjxEnv.isGeckoBased){
11882s.push("mergeCells","splitCells",null)
11883}
11884s.push("deleteTable");
11885var a=["TableProperties","CellProperties",null,"InsertRowBefore","InsertRowAfter","DeleteRow",null,"InsertColBefore","InsertColAfter","DeleteCol",null,"MergeCells","SplitCells",null,"DeleteTable"];
11886e._tblItems={};
11887for(var n=0;
11888n<s.length;
11889++n){
11890var t=s[n];
11891if(t==null){
11892new DwtMenuItem({
11893parent:e,style:DwtMenuItem.SEPARATOR_STYLE}
11894)
11895}else{
11896var l="";
11897if(/\.\.\.$/.test(t)){
11898t=t.substr(0,t.length-3);
11899l="&hellip;"
11900}
11901var c=new DwtMenuItem({
11902parent:e}
11903);
11904e._tblItems[t]=c;
11905var o=ZmMsg[t]||t;
11906c.setText(o+l);
11907if(a[n]){
11908c.setImage(a[n])
11909}
11910c.setData("TableOperations",t);
11911c.addSelectionListener(h)
11912}}
11913e.addPopupListener(new AjxListener(this,this.__onTableOperationsPopup))
11914};
11915ZmHtmlEditor.prototype.__onTableOperationsPopup=function(t){
11916this.focus();
11917var m=this.getNearestElement("table");
11918var c=t._tblItems;
11919for(var s in c){
11920c[s].setEnabled(!!m)
11921}
11922if(!m){
11923return
11924}
11925t.setData("table",m);
11926if(!AjxEnv.isIE){
11927var o=this.getNearestElement("td");
11928var d=o&&((o.colSpan&&o.colSpan>1)||(o.rowSpan&&o.rowSpan>1));
11929c.splitCells.setEnabled(d);
11930var u=this.getSelectedCells();
11931var f=true;
11932var h=0;
11933try{
11934for(var s=u.length;
11935--s>=0;
11936){
11937var e=u[s];
11938for(var n=e.length;
11939--n>=0;
11940){
11941var o=e[n];
11942++h;
11943if(o.rowSpan>1||o.colSpan>1){
11944throw"can't merge"
11945}}}}
11946catch(l){
11947f=false
11948}
11949if(h<2){
11950f=false
11951}
11952c.mergeCells.setEnabled(f)
11953}};
11954ZmHtmlEditor.prototype._tableOperationsListener=function(a){
11955var t=a.item;
11956var e=t.parent.getData("table");
11957var i=t.getData("TableOperations");
11958this.focus();
11959switch(i){
11960case"tableProperties":AjxDispatcher.require("Extras");
11961var o=ZmTableEditor.getTablePropsDialog(this,this.getNearestElement("table"));
11962o.popup();
11963break;
11964case"cellProperties":AjxDispatcher.require("Extras");
11965var o=ZmTableEditor.getCellPropsDialog(this,this.getNearestElement("table"),this.getSelectedCells());
11966o.popup();
11967break;
11968default:this.doTableOperation(i,{
11969table:e,cells:this.getSelectedCells()}
11970)
11971}};
11972ZmHtmlEditor.prototype._createTableListener=function(t){
11973var e=t.detail;
11974this.insertTable(e.rows,e.cols,"90%",null,3,"center")
11975};
11976ZmHtmlEditor.prototype._menu_insertObject=function(t){
11977var e=t.item;
11978var a=e.getData("ACE");
11979this.insertObject(a)
11980};
11981ZmHtmlEditor.prototype.insertObject=function(e,s,o){
11982var a=document.URL.replace(/^(https?:\x2f\x2f[^\x2f]+\x2f?).*$/i,"$1").replace(/\x2f*$/,"");
11983var n=null;
11984switch(e){
11985case"ZmSpreadSheet":n=[a,appContextPath,"/public/Spreadsheet.jsp?localeId=",AjxEnv.DEFAULT_LOCALE].join("");
11986break
11987}
11988if(n){
11989var l=this._getIframeDoc();
11990this.focus();
11991++this._ace_componentsLoading;
11992if(AjxEnv.isGeckoBased){
11993Dwt.enableDesignMode(l,false)
11994}
11995var i=l.createElement("iframe");
11996i.id="ACE-"+Dwt.getNextId();
11997i.frameBorder=0;
11998i.src=n;
11999i.style.width="100%";
12000i.style.height="400px";
12001i.ondragstart=AjxCallback.returnFalse;
12002if(!s){
12003var t=l.createElement("br");
12004var h=l.createDocumentFragment();
12005h.appendChild(t);
12006h.appendChild(i);
12007h.appendChild(t.cloneNode(true));
12008this._insertNodeAtSelection(h)
12009}else{
12010s.parentNode.replaceChild(i,s)
12011}
12012var c=AjxCallback.simpleClosure(this._ace_finishedLoading,this,i,e,o);
12013if(AjxEnv.isIE){
12014i.onreadystatechange=c
12015}else{
12016i.addEventListener("load",c,true)
12017}}};
12018ZmHtmlEditor.prototype._ace_finishedLoading=function(i,t,a){
12019var e=this;
12020if(!AjxEnv.isIE||i.readyState=="complete"){
12021setTimeout(function(){
12022try{
12023var n=Dwt.getIframeWindow(i);
12024n.ZmACE=true;
12025n.ZmACE_COMPONENT_NAME=t;
12026i.onload=null;
12027i.onreadystatechange=null;
12028n.create(a);
12029--e._ace_componentsLoading
12030}
12031catch(o){
12032--e._ace_componentsLoading;
12033var s=appCtxt.getErrorDialog();
12034s.setMessage(ZmMsg.aleError,o.msg||o.toString(),DwtMessageDialog.WARNING_STYLE,"ALE error");
12035s.popup(null,true)
12036}}
12037,10)
12038}};
12039ZmHtmlEditor.prototype._getAceObjects=function(){
12040var o=this._getIframeDoc().getElementsByTagName("iframe");
12041var e=new Array(o.length);
12042for(var t=o.length;
12043--t>=0;
12044){
12045e[t]=o[t]
12046}
12047return e
12048};
12049ZmHtmlEditor.prototype._embedHtmlContent=function(o,a,i){
12050if(!a&&!i){
12051if(!(this.ACE_ENABLED&&this._headContent)){
12052return DwtHtmlEditor.prototype._embedHtmlContent.call(this,o)
12053}}
12054if(i){
12055var t=[],e=0;
12056if(a){
12057t[e++]="<div";
12058t[e++]=" style='font-family:";
12059t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
12060t[e++]="; font-size: ";
12061t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
12062t[e++]="; color: ";
12063t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
12064t[e++]=";'>";
12065t[e++]=o;
12066t[e++]="</div>"
12067}else{
12068t[e++]=o
12069}
12070return t.join("")
12071}
12072var n="<style type='text/css'>p { margin: 0; }</style>";
12073if(a){
12074o=this._getFontStyle(o)
12075}
12076var s=this._headContent?this._headContent.join(""):"";
12077return["<html><head>",n,s,"</head><body>",o,"</body></html>"].join("")
12078};
12079ZmHtmlEditor.prototype._getFontStyle=function(o){
12080var e=[],t=0;
12081e[t++]="<div style='font-family: ";
12082e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
12083e[t++]="; font-size: ";
12084e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
12085e[t++]="; color: ";
12086e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
12087e[t++]="'>";
12088e[t++]=o;
12089e[t++]="</div>";
12090return e.join("")
12091};
12092ZmHtmlEditor.prototype._serializeAceObjects=function(t){
12093this._headContent=[];
12094var e={};
12095var a=AjxCallback.simpleClosure(this._replaceAceIframes,this,e);
12096return t.replace(ZmHtmlEditor.ACE_IFRAME_RE,a)
12097};
12098ZmHtmlEditor.prototype._replaceAceIframes=function(e,a,h){
12099var o=this._getIframeDoc().getElementById(h);
12100var s=Dwt.getIframeWindow(o);
12101var i=s.getHTML();
12102var n=s.serialize().replace(/&/g,"&amp;").replace(/>/g,"&gt;");
12103var t=s.ZmACE_COMPONENT_NAME;
12104if(!e[t]&&typeof s.getHeadHTML=="function"){
12105e[t]=true;
12106this._headContent.push(s.getHeadHTML())
12107}
12108return['<div class="ACE ',t,'">',i,"<!--","ACE[",t,"]:",n,"-->","</div>"].join("")
12109};
12110ZmHtmlEditor.prototype._deserializeAceObjects=function(){
12111var n=this._getIframeDoc().getElementsByTagName("div");
12112var o=new Array(n.length);
12113for(var a=0;
12114a<n.length;
12115++a){
12116o[a]=n.item(a)
12117}
12118n=o;
12119for(var a=0;
12120a<n.length;
12121++a){
12122var t=n[a];
12123if(/^ACE\s+([^\s]+)/.test(t.className)){
12124var e=RegExp.$1;
12125var s=t.lastChild;
12126if(s.nodeType==8){
12127s=s.data;
12128var h="ACE["+e+"]:";
12129if(s.indexOf(h)==0){
12130s=s.substr(h.length).replace(/&gt;/g,">").replace(/&amp;/g,"&");
12131this.insertObject(e,t,s)
12132}}}}};
12133ZmHtmlEditor.prototype._createBUIButtons=function(e){
12134var a={
12135parent:e,style:DwtButton.TOGGLE_STYLE};
12136var t=new AjxListener(this,this._fontStyleListener);
12137this._boldButton=new DwtToolBarButton(a);
12138this._boldButton.setImage("Bold");
12139this._boldButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_BOLD));
12140this._boldButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.BOLD_STYLE);
12141this._boldButton.addSelectionListener(t);
12142this._italicButton=new DwtToolBarButton(a);
12143this._italicButton.setImage("Italics");
12144this._italicButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_ITALIC));
12145this._italicButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.ITALIC_STYLE);
12146this._italicButton.addSelectionListener(t);
12147this._underlineButton=new DwtToolBarButton(a);
12148this._underlineButton.setImage("Underline");
12149this._underlineButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_UNDERLINE));
12150this._underlineButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.UNDERLINE_STYLE);
12151this._underlineButton.addSelectionListener(t)
12152};
12153ZmHtmlEditor.prototype._createFontColorButtons=function(e){
12154this._fontColorButton=new ZmHtmlEditorColorPicker(e,null,"ZToolbarButton");
12155this._fontColorButton.dontStealFocus();
12156this._fontColorButton.setImage("FontColor");
12157this._fontColorButton.showColorDisplay(true);
12158this._fontColorButton.setToolTipContent(ZmMsg.fontColor);
12159this._fontColorButton.addSelectionListener(new AjxListener(this,this._fontColorListener));
12160this._fontBackgroundButton=new ZmHtmlEditorColorPicker(e,null,"ZToolbarButton");
12161this._fontBackgroundButton.dontStealFocus();
12162this._fontBackgroundButton.setImage("FontBackground");
12163this._fontBackgroundButton.showColorDisplay(true);
12164this._fontBackgroundButton.setToolTipContent(ZmMsg.fontBackground);
12165this._fontBackgroundButton.addSelectionListener(new AjxListener(this,this._fontHiliteListener))
12166};
12167ZmHtmlEditor.prototype._createHorizRuleButton=function(e){
12168var t={
12169parent:e};
12170this._horizRuleButton=new DwtToolBarButton(t);
12171this._horizRuleButton.setImage("HorizRule");
12172this._horizRuleButton.setToolTipContent(ZmMsg.horizRule);
12173this._horizRuleButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.HORIZ_RULE);
12174this._horizRuleButton.addSelectionListener(new AjxListener(this,this._insElementListener))
12175};
12176ZmHtmlEditor.prototype._createUrlButton=function(e){
12177var t={
12178parent:e};
12179this._insertLinkButton=new DwtToolBarButton(t);
12180this._insertLinkButton.setImage("URL");
12181this._insertLinkButton.setToolTipContent(ZmMsg.insertLink);
12182this._insertLinkButton.addSelectionListener(new AjxListener(this,this._insertLinkListener))
12183};
12184ZmHtmlEditor.prototype._createTableMenu=function(t){
12185var s={
12186parent:t};
12187var e=this._tableMenu=new DwtToolBarButton(s);
12188e.setToolTipContent(ZmMsg.insertTable);
12189e.dontStealFocus();
12190e.setImage("Table");
12191var n=new DwtMenu({
12192parent:e}
12193);
12194e.setMenu(n);
12195var o=new DwtMenuItem({
12196parent:n}
12197);
12198o.setText(ZmMsg.insertTable);
12199var i=new DwtMenu({
12200parent:o,style:DwtMenu.GENERIC_WIDGET_STYLE}
12201);
12202var a=new DwtGridSizePicker(i,ZmMsg.tableSize);
12203a.addSelectionListener(new AjxListener(this,this._createTableListener));
12204o.setMenu(i);
12205o.setImage("InsertTable");
12206new DwtMenuItem({
12207parent:n,style:DwtMenuItem.SEPARATOR_STYLE}
12208);
12209this.__createTableOperationItems(n)
12210};
12211ZmHtmlEditor.prototype._createSpreadSheetButton=function(t){
12212new DwtControl({
12213parent:t,className:"vertSep"}
12214);
12215var a={
12216parent:t,style:0};
12217var e=new DwtToolBarButton(a);
12218e.setImage("SpreadSheet");
12219e.setData("ACE","ZmSpreadSheet");
12220e.setToolTipContent(ZmMsg.insertSpreadsheet);
12221e.addSelectionListener(new AjxListener(this,this._menu_insertObject))
12222};
12223ZmHtmlEditor.prototype._createStyleMenu=function(e){
12224var n=new DwtToolBarButton({
12225parent:e}
12226);
12227n.setText("x");
12228n._textEl.innerHTML="<span style='font-size:13px'>&sect;</span>";
12229n.setToolTipContent(ZmMsg.sections);
12230n.dontStealFocus();
12231var c=this._styleMenu=new ZmPopupMenu(n);
12232var l=new AjxListener(this,this._styleListener);
12233var o=[{
12234label:ZmMsg.normal,id:DwtHtmlEditor.PARAGRAPH}
12235,{
12236label:ZmMsg.heading1,id:DwtHtmlEditor.H1}
12237,{
12238label:ZmMsg.heading2,id:DwtHtmlEditor.H2}
12239,{
12240label:ZmMsg.heading3,id:DwtHtmlEditor.H3}
12241,{
12242label:ZmMsg.heading4,id:DwtHtmlEditor.H4}
12243,{
12244label:ZmMsg.heading5,id:DwtHtmlEditor.H5}
12245,{
12246label:ZmMsg.heading6,id:DwtHtmlEditor.H6}
12247,{
12248label:ZmMsg.address,id:DwtHtmlEditor.ADDRESS}
12249,{
12250label:ZmMsg.preformatted,id:DwtHtmlEditor.PREFORMATTED}
12251];
12252for(var a=0;
12253a<o.length;
12254a++){
12255var h=o[a];
12256var t=c.createMenuItem(h.id,{
12257text:h.label,style:DwtMenuItem.RADIO_STYLE}
12258);
12259t.addSelectionListener(l);
12260t.setData(ZmHtmlEditor._VALUE,h.id);
12261if(a==0){
12262t.setChecked(true,true)
12263}}
12264n.setMenu(c)
12265};
12266ZmHtmlEditor.prototype._createListMenu=function(t){
12267var e=this._listMenuButton=new DwtToolBarButton({
12268parent:t}
12269);
12270e.dontStealFocus();
12271e.setImage("BulletedList");
12272e.setToolTipContent(ZmMsg.bulletedList);
12273var a=new AjxListener(this,this._insElementListener);
12274var n=this._listMenu=new ZmPopupMenu(e);
12275var i=this._bulletListMenuItem=n.createMenuItem(DwtHtmlEditor.UNORDERED_LIST,{
12276image:"BulletedList",style:DwtMenuItem.SELECT_STYLE}
12277);
12278i.addSelectionListener(a);
12279i.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.UNORDERED_LIST);
12280var o=this._numberListMenuItem=n.createMenuItem(DwtHtmlEditor.ORDERED_LIST,{
12281image:"NumberedList",style:DwtMenuItem.SELECT_STYLE}
12282);
12283o.addSelectionListener(a);
12284o.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.ORDERED_LIST);
12285e.setMenu(n)
12286};
12287ZmHtmlEditor.prototype._createIndentMenu=function(t){
12288var e=this._indentMenuButton=new DwtToolBarButton({
12289parent:t}
12290);
12291e.dontStealFocus();
12292e.setImage("Outdent");
12293e.setToolTipContent(ZmMsg.indentTooltip);
12294var o=new AjxListener(this,this._indentListener);
12295var n=this._indentMenu=new ZmPopupMenu(e);
12296var a=this._indentMenuItem=n.createMenuItem(DwtHtmlEditor.OUTDENT,{
12297image:"Outdent",style:DwtMenuItem.SELECT_STYLE}
12298);
12299a.addSelectionListener(o);
12300a.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.OUTDENT);
12301var i=this._outdentMenuItem=n.createMenuItem(DwtHtmlEditor.INDENT,{
12302image:"Indent",style:DwtMenuItem.SELECT_STYLE}
12303);
12304i.addSelectionListener(o);
12305i.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.INDENT);
12306e.setMenu(n)
12307};
12308ZmHtmlEditor.prototype._createJustifyMenu=function(t){
12309var e=new DwtToolBarButton({
12310parent:t}
12311);
12312e.dontStealFocus();
12313e.setImage("LeftJustify");
12314e.setToolTipContent(ZmMsg.alignment);
12315var l=this._justifyMenu=new ZmPopupMenu(e);
12316var h=new AjxListener(this,this._justificationListener);
12317var n=[{
12318image:"LeftJustify",id:DwtHtmlEditor.JUSTIFY_LEFT}
12319,{
12320image:"CenterJustify",id:DwtHtmlEditor.JUSTIFY_CENTER}
12321,{
12322image:"RightJustify",id:DwtHtmlEditor.JUSTIFY_RIGHT}
12323,{
12324image:"FullJustify",id:DwtHtmlEditor.JUSTIFY_FULL}
12325];
12326for(var o=0;
12327o<n.length;
12328o++){
12329var s=n[o];
12330var a=l.createMenuItem(s.id,{
12331image:s.image,style:DwtMenuItem.RADIO_STYLE}
12332);
12333a.addSelectionListener(h);
12334a.setData(ZmHtmlEditor._VALUE,s.id);
12335if(o==0){
12336a.setChecked(true,true)
12337}}
12338e.setMenu(l,false,DwtMenuItem.RADIO_STYLE)
12339};
12340ZmHtmlEditor.prototype._createFontFamilyMenu=function(e){
12341this._fontFamilyButton=new DwtToolBarButton({
12342parent:e}
12343);
12344this._fontFamilyButton.dontStealFocus();
12345this._fontFamilyButton.setSize(Dwt.DEFAULT);
12346this._fontFamilyButton.setAlign(DwtLabel.ALIGN_LEFT);
12347var o=new ZmPopupMenu(this._fontFamilyButton);
12348var i=new AjxListener(this,this._fontFamilyListener);
12349for(var n in ZmHtmlEditor.FONT_FAMILY){
12350var a=ZmHtmlEditor.FONT_FAMILY[n];
12351var t=o.createMenuItem(a.name,{
12352text:a.name}
12353);
12354t.addSelectionListener(i);
12355t.setData(ZmHtmlEditor._VALUE,a.value)
12356}
12357this._fontFamilyButton.setMenu(o)
12358};
12359ZmHtmlEditor.prototype._createFontSizeMenu=function(e){
12360this._fontSizeButton=new DwtToolBarButton({
12361parent:e}
12362);
12363this._fontSizeButton.dontStealFocus();
12364var l=new ZmPopupMenu(this._fontSizeButton);
12365var s=new AjxListener(this,this._fontSizeListener);
12366for(var o=0;
12367o<ZmHtmlEditor.FONT_SIZE_VALUES.length;
12368o++){
12369var n=ZmHtmlEditor.FONT_SIZE_VALUES[o];
12370var a=o+1;
12371var h=a+" ("+n+")";
12372var t=l.createMenuItem(o,{
12373text:h}
12374);
12375t.addSelectionListener(s);
12376t.setData(ZmHtmlEditor._VALUE,a)
12377}
12378this._fontSizeButton.setMenu(l)
12379};
12380ZmHtmlEditor.prototype._getFontSizeLabel=function(a){
12381for(var e=0;
12382e<ZmHtmlEditor.FONT_SIZE_VALUES.length;
12383e++){
12384var t=ZmHtmlEditor.FONT_SIZE_VALUES[e];
12385if(a==t){
12386return((e+1)+" ("+t+")")
12387}}
12388return"3 (12pt)"
12389};
12390ZmHtmlEditor.prototype._rteStateChangeListener=function(a){
12391this._boldButton.setSelected(a.isBold);
12392this._underlineButton.setSelected(a.isUnderline);
12393this._italicButton.setSelected(a.isItalic);
12394if(this._strikeThruButton){
12395this._strikeThruButton.setSelected(a.isStrikeThru)
12396}
12397if(this._subscriptButton){
12398this._subscriptButton.setSelected(a.isSubscript)
12399}
12400if(this._superscriptButton){
12401this._superscriptButton.setSelected(a.isSuperscript)
12402}
12403if(a.color){
12404this._fontColorButton.setColor(a.color)
12405}
12406if(a.backgroundColor){
12407this._fontBackgroundButton.setColor(a.backgroundColor)
12408}
12409if(a.style){
12410this._styleMenu.checkItem(ZmHtmlEditor._VALUE,a.style,true)
12411}
12412if(!AjxEnv.isIE){
12413if(a.fontFamily){
12414var i=a.fontFamily;
12415var t=ZmHtmlEditor.FONT_FAMILY[i]&&ZmHtmlEditor.FONT_FAMILY[i].name;
12416t=t||ZmHtmlEditor.__makeFontName(i);
12417this._fontFamilyButton.setText(t)
12418}
12419if(a.fontSize){
12420var e=this._fontSizeButton.getMenu().getItem(parseInt(a.fontSize)-1);
12421if(e){
12422this._fontSizeButton.setText(e.getText())
12423}}}
12424this._justifyMenu.checkItem(ZmHtmlEditor._VALUE,a.justification,true)
12425};
12426ZmHtmlEditor.prototype._settingChangeListener=function(e){
12427if(e.type!=ZmEvent.S_SETTING){
12428return
12429}
12430var t=e.source.id;
12431if(t==ZmSetting.COMPOSE_INIT_FONT_COLOR||t==ZmSetting.COMPOSE_INIT_FONT_FAMILY||t==ZmSetting.COMPOSE_INIT_FONT_SIZE){
12432this._resetFormatControlDefaults();
12433this._fontStyle=null
12434}};
12435ZmHtmlEditor.prototype._handleEditorEvent=function(s){
12436var a=this._eventCallback?this._eventCallback.run(s):true;
12437if(a){
12438a=DwtHtmlEditor.prototype._handleEditorEvent.call(this,s)
12439}
12440if(this._TIMER_spell){
12441clearTimeout(this._TIMER_spell)
12442}
12443var l=this;
12444if(this._spellCheck){
12445var e;
12446if(/mouse|context|click|select/i.test(s.type)){
12447e=new DwtMouseEvent(true)
12448}else{
12449e=new DwtUiEvent(true)
12450}
12451e.setFromDhtmlEvent(s);
12452this._TIMER_spell=setTimeout(function(){
12453l._handleSpellCheckerEvents(e);
12454this._TIMER_spell=null
12455}
12456,100)
12457}
12458if(/keydown/i.test(s.type)){
12459if(s.keyCode==13){
12460var i=this._getParentElement();
12461var o=i;
12462while(o){
12463var h=Dwt.getAttr(o,"tagName");
12464if(h&&h.toLowerCase()==="blockquote"){
12465break
12466}
12467o=o.parentNode
12468}
12469if(o){
12470this._splitBlockquote(o,i);
12471a=false
12472}}
12473if(s.keyCode==8||s.keyCode==46){
12474setTimeout(AjxCallback.simpleClosure(function(){
12475var m,d;
12476for(var u=this._getIframeDoc().body.firstChild;
12477u&&u.nextSibling;
12478u=u.nextSibling){
12479var c=u.nextSibling;
12480if(c&&c.tagName&&c.tagName.toLowerCase()=="p"&&this._elementIsIEFiller(c.firstChild)){
12481c=c.nextSibling
12482}
12483if(c&&u.tagName&&c.tagName&&u.tagName.toLowerCase()=="blockquote"&&c.tagName.toLowerCase()=="blockquote"){
12484this._mergeBlockquotes(u,c)
12485}}}
12486,this),5);
12487if(s.keyCode==46){
12488if(!AjxEnv.isIE){
12489var n=this._getRange();
12490var t=n.startContainer.childNodes[n.startOffset];
12491if(t&&t.tagName&&t.tagName.toLowerCase()=="br"){
12492this._removeElement(t)
12493}}}}}
12494return a
12495};
12496ZmHtmlEditor.prototype._splitBlockquote=function(e,i){
12497var d,a,n=null,s=null;
12498var l,h;
12499if(AjxEnv.isIE){
12500var u=this._getIframeDoc();
12501d=u.selection.createRange();
12502d.collapse(false);
12503a=i;
12504var z="###"+Dwt.getNextId()+"###";
12505d.pasteHTML(z);
12506n=a.innerHTML.indexOf(z);
12507a.innerHTML=a.innerHTML.replace(z,"");
12508l=n?a.innerHTML.substring(0,n):"";
12509h=a.innerHTML.substring(n)
12510}else{
12511d=this._getRange();
12512d.collapse(false);
12513var o=d.startContainer.nodeType;
12514if(o==3||o==4||o==8){
12515n=d.startOffset;
12516a=d.startContainer.parentNode;
12517l=n?d.startContainer.textContent.substring(0,n):"";
12518h=d.startContainer.textContent.substring(n);
12519var w=d.startContainer.previousSibling;
12520while(w){
12521l=this._getElementHTML(w)+l;
12522w=w.previousSibling
12523}
12524w=d.startContainer.nextSibling;
12525while(w){
12526h=h+this._getElementHTML(w);
12527w=w.nextSibling
12528}}else{
12529s=d.startOffset;
12530a=d.startContainer
12531}}
12532var b=a.id=a.id||Dwt.getNextId();
12533var y=e.cloneNode(true);
12534var f=a;
12535var m=Dwt.byId(b,y);
12536m.removeAttribute("id");
12537if(n!==null){
12538f.innerHTML=l;
12539m.innerHTML=h
12540}else{
12541if(s!==null){
12542this._removeNextSiblings(f.childNodes[s]);
12543var v=m.childNodes[s];
12544this._removePreviousSiblings(v);
12545this._removeElement(v)
12546}}
12547while(f!=e){
12548this._removeNextSiblings(f);
12549f=f.parentNode
12550}
12551while(m!=y){
12552this._removePreviousSiblings(m);
12553m=m.parentNode
12554}
12555if(e.nextSibling){
12556e.parentNode.insertBefore(y,e.nextSibling)
12557}else{
12558e.parentNode.appendChild(y)
12559}
12560if(AjxEnv.isIE){
12561var g=document.createElement("p");
12562var q=document.createElement("span");
12563var k=document.createElement("span");
12564var j=document.createElement("br");
12565q.appendChild(k);
12566q.appendChild(j);
12567g.appendChild(q);
12568y.parentNode.insertBefore(g,y);
12569this._setCursor(k);
12570this._setIEFiller(q);
12571k.parentNode.removeChild(k)
12572}else{
12573if(AjxEnv.isSafari){
12574var c=this;
12575setTimeout(function(){
12576var T;
12577if(e.lastChild&&e.lastChild.childElementCount==1&&e.lastChild.firstChild instanceof HTMLBRElement){
12578T=e.lastChild
12579}else{
12580if(y.firstChild&&y.firstChild.childElementCount==1&&y.firstChild.firstChild instanceof HTMLBRElement){
12581T=y.firstChild
12582}}
12583if(T){
12584e.parentNode.insertBefore(T,y);
12585d.setStart(T,0);
12586var t=c._getSelection();
12587t.removeAllRanges();
12588t.addRange(d)
12589}}
12590,5)
12591}
12592d.setStartAfter(e);
12593var x=this._getSelection();
12594x.removeAllRanges();
12595x.addRange(d)
12596}};
12597ZmHtmlEditor.prototype._getElementHTML=function(t){
12598if(AjxEnv.isIE){
12599return t.outerHTML
12600}
12601var e=document.createElement(t.parentNode&&t.parentNode.tagName||"span");
12602e.appendChild(t.cloneNode(true));
12603return e.innerHTML
12604};
12605ZmHtmlEditor.prototype._removeElement=function(e){
12606if(e&&e.parentNode){
12607e.parentNode.removeChild(e)
12608}};
12609ZmHtmlEditor.prototype._removePreviousSiblings=function(e){
12610if(e&&e.parentNode){
12611while(e.previousSibling){
12612this._removeElement(e.previousSibling)
12613}}};
12614ZmHtmlEditor.prototype._removeNextSiblings=function(e){
12615if(e&&e.parentNode){
12616while(e.nextSibling){
12617this._removeElement(e.nextSibling)
12618}}};
12619ZmHtmlEditor.prototype._selectNode=function(a){
12620var i;
12621var e=this._getRange();
12622while(!i&&a){
12623try{
12624e.setStartBefore(a);
12625i=true
12626}
12627catch(t){
12628a=a.parentNode;
12629i=false
12630}}};
12631ZmHtmlEditor.prototype._nextElement=function(e){
12632if(e.childNodes&&e.childNodes.length){
12633return e.childNodes[0]
12634}
12635if(e.nextSibling){
12636return e.nextSibling
12637}
12638var t=e.parentNode;
12639while(!e.nextSibling){
12640e=e.parentNode;
12641if(!e){
12642return null
12643}}
12644return e.nextSibling
12645};
12646ZmHtmlEditor.prototype._elementIsIEFiller=function(t){
12647if(t.attributes){
12648for(var e=0;
12649e<t.attributes.length;
12650e++){
12651if(t.attributes[e].name=="_ieFiller"){
12652return true
12653}}}};
12654ZmHtmlEditor.prototype._setIEFiller=function(e){
12655if(e){
12656e.setAttribute("_ieFiller","")
12657}};
12658ZmHtmlEditor.prototype._removeIEFiller=function(t){
12659if(t){
12660if(this._elementIsIEFiller(t)){
12661t.parentNode.removeChild(t)
12662}
12663for(var e=0;
12664e<t.children.length;
12665e++){
12666this._removeIEFiller(t.children[e])
12667}}};
12668ZmHtmlEditor.prototype._mergeBlockquotes=function(h,s){
12669if(AjxEnv.isIE){
12670this._removeIEFiller(h.lastChild)
12671}
12672var i=h;
12673var u=0;
12674while(i.childNodes.length){
12675i=i.childNodes[i.childNodes.length-1];
12676while(i.previousSibling&&i.tagName=="BR"){
12677i=i.previousSibling
12678}
12679u++
12680}
12681var a=s;
12682var d=0;
12683while(a.childNodes.length){
12684a=a.childNodes[0];
12685d++
12686}
12687if(i.nodeType==3){
12688i=i.parentNode;
12689u--
12690}
12691if(a.nodeType==3){
12692a=a.parentNode;
12693d--
12694}
12695var l=(AjxEnv.isIE)?this._getIframeDoc().selection.createRange():this._getRange();
12696if(u==d){
12697var f=[i.innerHTML,a.innerHTML];
12698var o="###"+Dwt.getNextId()+"###";
12699i.innerHTML=f.join(o);
12700var n=i.innerHTML.replace(/<br>/ig," ").replace(/<\/?[^>]+>/g,"").indexOf(o);
12701i.innerHTML=f.join("");
12702if(AjxEnv.isIE){
12703l.moveToElementText(i);
12704l.moveStart("character",n)
12705}else{
12706var e;
12707for(var e=i;
12708e!=null&&n>0;
12709e=this._nextElement(e)){
12710var m=e.nodeType;
12711var c=e.textContent||e.innerText||e.innerHTML||"";
12712if(m==3||m==4||m==8){
12713if(n<=c.length){
12714break
12715}
12716n-=c.length
12717}else{
12718if(e.tagName.toLowerCase()=="br"){
12719n--
12720}
12721if(n==0){
12722break
12723}}}
12724l.setStart(e,n)
12725}}else{
12726if(u==d+1){
12727while(a.firstChild){
12728i.parentNode.appendChild(a.firstChild)
12729}
12730if(AjxEnv.isIE){
12731var m=e.nodeType;
12732var n=1;
12733if(m==3||m==4||m==8){
12734n=e.length;
12735e=e.parentNode
12736}
12737l.moveToElementText(e);
12738l.moveStart("character",n)
12739}else{
12740if(i.tagName&&i.tagName.toLowerCase()=="br"){
12741l.setStartBefore(i)
12742}else{
12743l.setStartAfter(i)
12744}}
12745i=i.parentNode
12746}else{
12747if(u+1==d){
12748var e=i.childNodes.length?i.childNodes[i.childNodes.length-1]:i;
12749a=a.parentNode;
12750while(a.firstChild){
12751i.appendChild(a.firstChild)
12752}
12753if(AjxEnv.isIE){
12754var m=e.nodeType;
12755var n=1;
12756if(m==3||m==4||m==8){
12757n=e.length;
12758e=e.parentNode
12759}
12760l.moveToElementText(e);
12761l.moveStart("character",n)
12762}else{
12763if(e.tagName&&e.tagName.toLowerCase()=="br"){
12764l.setStartBefore(e)
12765}else{
12766l.setStartAfter(e)
12767}}}else{
12768return
12769}}}
12770while(i!=h&&a!=s){
12771while(a.nextSibling){
12772i.parentNode.appendChild(a.nextSibling)
12773}
12774i=i.parentNode;
12775a=a.parentNode
12776}
12777this._removeElement(s);
12778l.collapse(true);
12779if(AjxEnv.isIE){
12780l.select()
12781}else{
12782var t=this._getSelection();
12783t.removeAllRanges();
12784t.addRange(l)
12785}};
12786ZmHtmlEditor._spellCheckResumeEditing=function(){
12787var e=Dwt.getObjectFromElement(this);
12788e.discardMisspelledWords()
12789};
12790ZmHtmlEditor._spellCheckAgain=function(){
12791var e=Dwt.getObjectFromElement(this);
12792e.discardMisspelledWords();
12793e.spellCheck()
12794};
12795ZmHtmlEditor.prototype._spellCheckShowModeDiv=function(){
12796var o=this.getSize();
12797if(!this._spellCheckModeDivId){
12798var s=document.createElement("div");
12799s.className="SpellCheckModeDiv";
12800s.id=this._spellCheckModeDivId=Dwt.getNextId();
12801var a=new Array();
12802var t=0;
12803a[t++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='width:25'>";
12804a[t++]=AjxImg.getImageHtml("SpellCheck");
12805a[t++]="</td><td style='white-space:nowrap'><span class='SpellCheckLink'>";
12806a[t++]=ZmMsg.resumeEditing;
12807a[t++]="</span> | <span class='SpellCheckLink'>";
12808a[t++]=ZmMsg.checkAgain;
12809a[t++]="</span></td></tr></table>";
12810s.innerHTML=a.join("");
12811var e=document.getElementById((this._spellCheckDivId||this.getBodyFieldId()));
12812e.parentNode.insertBefore(s,e);
12813var n=s.getElementsByTagName("span");
12814Dwt.associateElementWithObject(n[0],this);
12815Dwt.setHandler(n[0],"onclick",ZmHtmlEditor._spellCheckResumeEditing);
12816Dwt.associateElementWithObject(n[1],this);
12817Dwt.setHandler(n[1],"onclick",ZmHtmlEditor._spellCheckAgain)
12818}else{
12819document.getElementById(this._spellCheckModeDivId).style.display=""
12820}
12821this.setSize(o.x,o.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
12822};
12823ZmHtmlEditor.prototype._spellCheckHideModeDiv=function(){
12824var e=this.getSize();
12825if(this._spellCheckModeDivId){
12826document.getElementById(this._spellCheckModeDivId).style.display="none"
12827}
12828this.setSize(e.x,e.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
12829};
12830ZmHtmlEditor.prototype._spellCheckSuggestionListener=function(l){
12831var m=l.item;
12832var d=m.getData("orig");
12833if(!d){
12834return
12835}
12836var t=m.getData("value");
12837var n=this._mode==DwtHtmlEditor.TEXT;
12838var h=m.getData("fixall");
12839var u=n?document:this._getIframeDoc();
12840var o=u.getElementById(m.getData("spanId"));
12841var i=m.getData(ZmPopupMenu.MENU_ITEM_ID_KEY);
12842switch(i){
12843case"ignore":t=d;
12844this._ignoreWords[t]=true;
12845if(h){}
12846break;
12847case"add":t=d;
12848var c=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
12849var s=c.set("pref",t);
12850s.setAttribute("name","+zimbraPrefSpellIgnoreWord");
12851var a={
12852soapDoc:c,asyncMode:true,callback:new AjxCallback(appCtxt,appCtxt.setStatusMsg,[ZmMsg.wordAddedToDictionary])};
12853appCtxt.getAppController().sendRequest(a);
12854this._ignoreWords[t]=true;
12855break;
12856default:break
12857}
12858if(n&&t==null){
12859this._editWord(h,o)
12860}else{
12861var e=h?this._spellCheck.wordIds[d]:o;
12862this._editWordFix(e,t)
12863}
12864this._handleSpellCheckerEvents(null)
12865};
12866ZmHtmlEditor.prototype._getEditorDocument=function(){
12867var e=this._mode==DwtHtmlEditor.TEXT;
12868return e?document:this._getIframeDoc()
12869};
12870ZmHtmlEditor.prototype._editWord=function(s,e){
12871var o=this._getEditorDocument();
12872var t=o.createElement("input");
12873t.type="text";
12874t.value=AjxUtil.getInnerText(e);
12875t.className="SpellCheckInputField";
12876t.style.left=e.offsetLeft-2+"px";
12877t.style.top=e.offsetTop-2+"px";
12878t.style.width=e.offsetWidth+4+"px";
12879var n=o.getElementById(this._spellCheckDivId);
12880var i=n.scrollTop;
12881n.appendChild(t);
12882n.scrollTop=i;
12883t.setAttribute("autocomplete","off");
12884t.focus();
12885if(!AjxEnv.isGeckoBased){
12886t.select()
12887}else{
12888t.setSelectionRange(0,t.value.length)
12889}
12890var a=AjxCallback.simpleClosure(this._editWordHandler,this,s,e);
12891t.onblur=a;
12892t.onkeydown=a
12893};
12894ZmHtmlEditor.prototype._editWordHandler=function(a,e,t){
12895t=DwtUiEvent.getEvent(t);
12896t={
12897type:t.type,keyCode:t.keyCode,ctrlKey:t.ctrlKey,target:DwtUiEvent.getTarget(t)};
12898setTimeout(AjxCallback.simpleClosure(this._editWordHandler2,this,a,e,t),20)
12899};
12900ZmHtmlEditor.prototype._editWordHandler2=function(s,o,h){
12901h=DwtUiEvent.getEvent(h);
12902var l=h.type;
12903var t=h.keyCode;
12904var i=h.ctrlKey;
12905var c=DwtUiEvent.getTarget(h);
12906var n=/key/.test(l);
12907var a=true;
12908if(/blur/.test(l)||(n&&t==13)){
12909if(i){
12910s=!s
12911}
12912var d=AjxUtil.getInnerText(o);
12913var e=s?this._spellCheck.wordIds[d]:o;
12914this._editWordFix(e,c.value)
12915}else{
12916if(n&&t==27){
12917this._editWordFix(o,AjxUtil.getInnerText(o))
12918}else{
12919a=false
12920}}
12921if(a){
12922c.onblur=null;
12923c.onkeydown=null;
12924if(c.parentNode){
12925c.parentNode.removeChild(c)
12926}}
12927this._handleSpellCheckerEvents(null)
12928};
12929ZmHtmlEditor.prototype._editWordFix=function(a,o){
12930a=a instanceof Array?a:[a];
12931var n=this._getEditorDocument();
12932for(var t=a.length-1;
12933t>=0;
12934t--){
12935var e=a[t];
12936if(typeof e=="string"){
12937e=n.getElementById(e)
12938}
12939if(e){
12940e.innerHTML=o
12941}}};
12942ZmHtmlEditor.prototype._handleSpellCheckerEvents=function(f){
12943var h=this._mode==DwtHtmlEditor.TEXT;
12944var n=h?(f?DwtUiEvent.getTarget(f):null):this._getParentElement(),y,e,s,l,d=this._spellCheck,g=this._getEditorDocument(),b=false,o="";
12945if(f&&/^span$/i.test(n.tagName)&&/ZM-SPELLCHECK/.test(n.className)){
12946o=n.getAttribute("word");
12947b=o!=AjxUtil.getInnerText(n)
12948}
12949e=d.spanIds;
12950for(s in e){
12951y=g.getElementById(s);
12952if(y){
12953if(e[s]!=AjxUtil.getInnerText(y)||this._ignoreWords[e[s]]){
12954y.className="ZM-SPELLCHECK-FIXED"
12955}else{
12956if(e[s]==o){
12957y.className="ZM-SPELLCHECK-MISSPELLED2"
12958}else{
12959y.className="ZM-SPELLCHECK-MISSPELLED"
12960}}}}
12961if(d.menu&&(!f||(/click|mousedown|mouseup|contextmenu/.test(f.type)||(/key/.test(f.type)&&(!o||b))))){
12962if(d.menu._menuItems.fixall){
12963d.menu._menuItems.fixall.getMenu().dispose()
12964}
12965d.menu.dispose();
12966d.menu=null;
12967window.status=""
12968}
12969if(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])){
12970d.menu=this._spellCheckCreateMenu(this,0,l,o,n.id,b);
12971var m,a=d.menu.getSize(),c=this.shell.getSize();
12972if(!h){
12973m=Dwt.toWindow(document.getElementById(this._iFrameId),0,0,null,true);
12974var u=Dwt.toWindow(n,0,0,null,true);
12975m.x+=u.x-(g.documentElement.scrollLeft||g.body.scrollLeft);
12976m.y+=u.y-(g.documentElement.scrollTop||g.body.scrollTop)
12977}else{
12978m=Dwt.toWindow(n,0,0,null,true);
12979var t=document.getElementById(this._spellCheckDivId);
12980m.x-=t.scrollLeft;
12981m.y-=t.scrollTop
12982}
12983m.y+=n.offsetHeight;
12984if(m.y+a.y>c.y){
12985m.y-=a.y+n.offsetHeight
12986}
12987d.menu.popup(0,m.x,m.y);
12988f._stopPropagation=true;
12989f._returnValue=false
12990}};
12991ZmHtmlEditor.prototype._spellCheckCreateMenu=function(d,c,l,t,o,u){
12992var a=new ZmPopupMenu(d);
12993if(u){
12994var s="<b>"+t+"</b>";
12995this._spellCheckCreateMenuItem(a,"orig",{
12996text:s}
12997,c,t,t,o)
12998}
12999if(l.length>0){
13000for(var n=0;
13001n<l.length;
13002++n){
13003this._spellCheckCreateMenuItem(a,"sug-"+n,{
13004text:l[n],className:""}
13005,c,l[n],t,o)
13006}
13007if(!(d instanceof DwtMenuItem)&&this._spellCheck.wordIds[t].length>1){
13008if(!this._replaceAllFormatter){
13009this._replaceAllFormatter=new AjxMessageFormat(ZmMsg.replaceAllMenu)
13010}
13011var s="<i>"+this._replaceAllFormatter.format(this._spellCheck.wordIds[t].length)+"</i>";
13012var m=a.createMenuItem("fixall",{
13013text:s}
13014);
13015var e=this._spellCheckCreateMenu(m,1,l,t,o,u);
13016m.setMenu(e)
13017}}else{
13018var m=this._spellCheckCreateMenuItem(a,"noop",{
13019text:ZmMsg.noSuggestions}
13020,c,"",t,o);
13021m.setEnabled(false);
13022this._spellCheckCreateMenuItem(a,"clear",{
13023text:"<i>"+ZmMsg.clearText+"</i>"}
13024,c,"",t,o)
13025}
13026a.createSeparator();
13027var h=this._mode==DwtHtmlEditor.TEXT;
13028if(h){
13029var s=c?ZmMsg.editAll:ZmMsg.edit;
13030this._spellCheckCreateMenuItem(a,"edit",{
13031text:s}
13032,c,null,t,o)
13033}
13034if(!c){
13035this._spellCheckCreateMenuItem(a,"ignore",{
13036text:ZmMsg.ignoreWord}
13037,0,null,t,o)
13038}
13039if(!c&&appCtxt.get(ZmSetting.SPELL_CHECK_ADD_WORD_ENABLED)){
13040this._spellCheckCreateMenuItem(a,"add",{
13041text:ZmMsg.addWord}
13042,c,null,t,o)
13043}
13044return a
13045};
13046ZmHtmlEditor.prototype._spellCheckCreateMenuItem=function(a,t,o,s,h,e,n,i){
13047if(o.className==null){
13048o.className="ZMenuItem ZmSpellMenuItem"
13049}
13050var l=a.createMenuItem(t,o);
13051l.setData("fixall",s);
13052l.setData("value",h);
13053l.setData("orig",e);
13054l.setData("spanId",n);
13055l.addSelectionListener(i||this._spellCheckSuggestionListenerObj);
13056return l
13057};
13058ZmHtmlEditor.prototype._spellCheckCallback=function(i){
13059var e=false;
13060if(i&&i.available){
13061var a=i.misspelled;
13062if(a==null||a.length==0){
13063appCtxt.setStatusMsg(ZmMsg.noMisspellingsFound,ZmStatusView.LEVEL_INFO)
13064}else{
13065var t=AjxMessageFormat.format(ZmMsg.misspellingsResult,a.length);
13066appCtxt.setStatusMsg(t,ZmStatusView.LEVEL_WARNING);
13067this.highlightMisspelledWords(a);
13068e=true
13069}}else{
13070appCtxt.setStatusMsg(ZmMsg.spellCheckUnavailable,ZmStatusView.LEVEL_CRITICAL)
13071}
13072if(AjxEnv.isGeckoBased&&this._mode==DwtHtmlEditor.HTML){
13073setTimeout(AjxCallback.simpleClosure(this.focus,this),10)
13074}
13075if(this.onExitSpellChecker){
13076this.onExitSpellChecker.run(e)
13077}};
13078ZmHtmlEditor.prototype._enableDesignMode=function(e){
13079if(!e){
13080return
13081}
13082if(!(AjxEnv.isGeckoBased&&this.ACE_ENABLED)){
13083return DwtHtmlEditor.prototype._enableDesignMode.call(this,e)
13084}
13085if(!this._hasGeckoFocusHacks){
13086this.__enableGeckoFocusHacks()
13087}
13088this._getIframeWin().addEventListener("blur",this._designModeHack_blur,true);
13089this._getIframeWin().addEventListener("focus",this._designModeHack_focus,true)
13090};
13091ZmHtmlEditor.prototype.__enableGeckoFocusHacks=function(){
13092var t=null;
13093var a=0;
13094this._hasGeckoFocusHacks=true;
13095function e(n){
13096var o=[];
13097for(var s=0;
13098s<this._toolbars.length;
13099s++){
13100o=o.concat(this._toolbars[s].getChildren())
13101}
13102for(var s=0;
13103s<o.length;
13104++s){
13105o[s].setEnabled(n)
13106}}
13107this._designModeHack_blur=AjxCallback.simpleClosure(function(u){
13108if(a<0){
13109return
13110}
13111var c=false;
13112var h=DwtShell.mouseEvent;
13113h.setFromDhtmlEvent(u,true);
13114var n=appCtxt.getKeyboardMgr();
13115if(n&&n.__focusObj){
13116for(var l=0;
13117l<this._toolbars.length;
13118l++){
13119if((n.__focusObj==this._toolbars[l])||(n.__focusObj.parent==this._toolbars[l])){
13120c=true;
13121break
13122}}}
13123e.call(this,c);
13124var m=this._getIframeDoc();
13125Dwt.enableDesignMode(m,false);
13126a=-1;
13127if(this._ace_componentsLoading>0){
13128return
13129}
13130try{
13131var s=this._getIframeWin().getSelection();
13132var l=0,o;
13133try{
13134t=[];
13135while(o=s.getRangeAt(l++)){
13136t.push(o)
13137}}
13138catch(d){}
13139s.removeAllRanges()
13140}
13141catch(d){
13142t=null
13143}}
13144,this);
13145e.call(this,false);
13146this._designModeHack_focus=AjxCallback.simpleClosure(function(n){
13147if(a>0){
13148return
13149}
13150var h=this._getIframeDoc();
13151var s=this._getIframeWin().getSelection();
13152e.call(this,true);
13153if(this._ace_componentsLoading>0){
13154return
13155}
13156Dwt.enableDesignMode(h,true);
13157if(!t||t.length==0){
13158r=h.createRange();
13159r.selectNodeContents(h.body);
13160r.collapse(true);
13161t=[r]
13162}
13163s.removeAllRanges();
13164for(var o=0;
13165o<t.length;
13166++o){
13167s.addRange(t[o])
13168}
13169t=null;
13170a=1
13171}
13172,this)
13173};
13174ZmHtmlEditor.WRAP_LENGTH=72;
13175ZmHtmlEditor.HTML_QUOTE_PRE='<blockquote style="border-left:2px solid '+AjxStringUtil.HTML_QUOTE_COLOR+';margin-left:5px;padding-left:5px;">';
13176ZmHtmlEditor.HTML_QUOTE_POST="</blockquote><br/>";
13177ZmHtmlEditor.getWrapParams=function(a,e){
13178e=e||{};
13179var t={};
13180t.htmlMode=a;
13181t.len=ZmHtmlEditor.WRAP_LENGTH;
13182t.eol=a?"<br/>":"\n";
13183t.pre=(a||!e.prefix)?"":appCtxt.get(ZmSetting.REPLY_PREFIX)+" ";
13184t.before=(a&&e.prefix)?ZmHtmlEditor.HTML_QUOTE_PRE:"";
13185t.after=(a&&e.prefix)?ZmHtmlEditor.HTML_QUOTE_POST:"";
13186return t
13187};
13188ZmHtmlEditorColorPicker=function(a,t,e){
13189DwtButtonColorPicker.call(this,a,t,e)
13190};
13191ZmHtmlEditorColorPicker.prototype=new DwtButtonColorPicker;
13192ZmHtmlEditorColorPicker.prototype.constructor=ZmHtmlEditorColorPicker;
13193ZmHtmlEditorColorPicker.prototype.TEMPLATE="dwt.Widgets#ZToolbarButton"
13194}
13195if(AjxPackage.define("zimbraMail.share.view.htmlEditor.ZmAdvancedHtmlEditor")){
13196ZmAdvancedHtmlEditor=function(a,t,i,o,e){
13197if(arguments.length==0){
13198return
13199}
13200this.isTinyMCE=window.isTinyMCE;
13201this._mode=o;
13202this._hasFocus={};
13203this.initTinyMCEEditor(a,t,i,o,e);
13204this._ignoreWords={}
13205};
13206ZmAdvancedHtmlEditor.TINY_MCE_PATH="/tiny_mce/3.2.6";
13207ZmAdvancedHtmlEditor.prototype.toString=function(){
13208return"ZmAdvancedHtmlEditor"
13209};
13210ZmAdvancedHtmlEditor.prototype.getEditor=function(){
13211return(window.tinyMCE)?tinyMCE.get(this._bodyTextAreaId):null
13212};
13213ZmAdvancedHtmlEditor.prototype.getBodyFieldId=function(){
13214if(this._mode==DwtHtmlEditor.HTML){
13215var e=this.getEditor();
13216return e?this._bodyTextAreaId+"_ifr":this._bodyTextAreaId
13217}
13218return this._bodyTextAreaId
13219};
13220ZmAdvancedHtmlEditor.prototype.getBodyField=function(){
13221return document.getElementById(this.getBodyFieldId())
13222};
13223ZmAdvancedHtmlEditor.prototype.resizeWidth=function(e){
13224var t=document.getElementById(this._bodyTextAreaId+"_tbl");
13225if(t){
13226t.style.width=e
13227}};
13228ZmAdvancedHtmlEditor.prototype.setSize=function(e,n){
13229var a=this.getEditor();
13230var t=this.getBodyField();
13231var o=this._mode==DwtHtmlEditor.HTML?10:8;
13232e-=o+4;
13233n-=o;
13234if(e<0){
13235e=0
13236}
13237if(n<0){
13238n=0
13239}
13240var i=document.getElementById(this._bodyTextAreaId+"_tbl");
13241if(a&&i){
13242i.style.height=n+"px";
13243i.style.width="100%"
13244}
13245if(this._mode==DwtHtmlEditor.HTML&&this.isTinyMCE){
13246n-=26
13247}
13248t.style.width=e+5+"px";
13249t.style.height=n+"px"
13250};
13251ZmAdvancedHtmlEditor.prototype.editorContainerFocus=function(){
13252this.focus()
13253};
13254ZmAdvancedHtmlEditor.prototype.focus=function(){
13255var t=this.getEditor();
13256if(t){
13257t.focus();
13258this.setFocusStatus(true)
13259}else{
13260var e=this.getContentField();
13261if(e){
13262e.focus()
13263}
13264this.setFocusStatus(true,true)
13265}};
13266ZmAdvancedHtmlEditor.prototype.getTextVersion=function(){
13267var t=this.getContentField();
13268if(this._mode==DwtHtmlEditor.HTML){
13269var e=this.getEditor();
13270return e?this._convertHtml2Text():""
13271}
13272return t.value
13273};
13274ZmAdvancedHtmlEditor.prototype.getContent=function(e,t){
13275this.discardMisspelledWords();
13276var o=this.getContentField();
13277if(this._mode==DwtHtmlEditor.HTML){
13278var a=this.getEditor();
13279var n={};
13280n.format="raw";
13281var i=a?a.getContent(n):(this._pendingContent||"");
13282if(i=='<br mce_bogus="1">'||i=='<br mce_bogus="1"/>'){
13283i=""
13284}
13285i=this._embedHtmlContent(i,e,t);
13286return i
13287}
13288return o.value
13289};
13290ZmAdvancedHtmlEditor.prototype._embedHtmlContent=function(o,a,i){
13291if(!a&&!i){
13292return["<html><body>",o,"</body></html>"].join("")
13293}
13294if(i){
13295var t=[];
13296var e=0;
13297if(a){
13298t[e++]="<div";
13299t[e++]=" style='font-family:";
13300t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
13301t[e++]="; font-size: ";
13302t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
13303t[e++]="; color: ";
13304t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
13305t[e++]=";'>";
13306t[e++]=o;
13307t[e++]="</div>"
13308}else{
13309t[e++]=o
13310}
13311return t.join("")
13312}
13313var n="<style type='text/css'>p { margin: 0; }</style>";
13314if(a){
13315o=this._getFontStyle(o)
13316}
13317return["<html><head>",n,"</head><body>",o,"</body></html>"].join("")
13318};
13319ZmAdvancedHtmlEditor.prototype._getFontStyle=function(o){
13320var e=[],t=0;
13321e[t++]="<div style='font-family: ";
13322e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
13323e[t++]="; font-size: ";
13324e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
13325e[t++]="; color: ";
13326e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
13327e[t++]="'>";
13328e[t++]=o;
13329e[t++]="</div>";
13330return e.join("")
13331};
13332ZmAdvancedHtmlEditor.prototype.setContent=function(t){
13333if(this._mode==DwtHtmlEditor.HTML){
13334var e=this.getEditor();
13335if(e&&this._editorInitialized){
13336e.setContent(t,{
13337format:"raw"}
13338)
13339}else{
13340this._pendingContent=t
13341}}else{
13342var a=this.getContentField();
13343a.value=t
13344}
13345this._ignoreWords={}
13346};
13347ZmAdvancedHtmlEditor.prototype.reEnableDesignMode=function(){};
13348ZmAdvancedHtmlEditor.prototype.getMode=function(){
13349return this._mode
13350};
13351ZmAdvancedHtmlEditor.prototype.isHtmlModeInited=function(){
13352return Boolean(this.getEditor())
13353};
13354ZmAdvancedHtmlEditor.prototype._convertHtml2Text=function(){
13355var e=this.getEditor();
13356var t=e&&e.getDoc();
13357return(t&&t.body)?this._convertHtml2TextContinue(t.body):""
13358};
13359ZmAdvancedHtmlEditor.prototype._convertHtml2TextContinue=function(a){
13360var i=[];
13361var t=0;
13362var e={};
13363AjxStringUtil._traverse(a,i,t,AjxStringUtil._NO_LIST,0,0,e);
13364if(i.length&&i[0]=="\n\n"){
13365i[0]=""
13366}
13367return i.join("")
13368};
13369ZmAdvancedHtmlEditor.prototype.moveCaretToTop=function(){
13370var i=document.activeElement;
13371if(this._mode==DwtHtmlEditor.TEXT){
13372var a=this.getContentField();
13373if(a.createTextRange){
13374var e=a.createTextRange();
13375e.collapse(true);
13376e.select()
13377}else{
13378if(a.setSelectionRange){
13379a.setSelectionRange(0,0)
13380}}}else{
13381this._moveCaretToTopHtml(true)
13382}
13383try{
13384if(i){
13385i.focus()
13386}}
13387catch(t){}};
13388ZmAdvancedHtmlEditor.prototype._moveCaretToTopHtml=function(t){
13389var i=this.getEditor();
13390if(!i){
13391return
13392}
13393var e=i.getDoc().body;
13394var n=false;
13395if(AjxEnv.isIE){
13396if(e){
13397e.createTextRange().collapse(true);
13398n=true
13399}}else{
13400var a=i.selection?i.selection.getSel():"";
13401if(a){
13402a.collapse(e,0);
13403n=true
13404}}
13405if(!n&&t){
13406var o=new AjxTimedAction(this,this._moveCaretToTopHtml);
13407AjxTimedAction.scheduleAction(o,DwtHtmlEditor._INITDELAY+1)
13408}};
13409ZmAdvancedHtmlEditor.prototype.getEditorContainer=function(){
13410return this._editorContainer
13411};
13412ZmAdvancedHtmlEditor.prototype.hasFocus=function(){
13413return Boolean(this._hasFocus[this._mode])
13414};
13415ZmAdvancedHtmlEditor.prototype._getIframeDoc=function(){
13416var e=this.getEditor();
13417return e?e.getDoc():null
13418};
13419ZmAdvancedHtmlEditor.prototype._getIframeWin=function(){
13420var e=this.getEditor();
13421return e?e.getWin():null
13422};
13423ZmAdvancedHtmlEditor.prototype.clear=function(){
13424this.setPendingContent(null);
13425var e=this.getEditor();
13426if(e){
13427e.setContent("",{
13428format:"raw"}
13429)
13430}
13431var t=this.getContentField();
13432if(t){
13433t.value=""
13434}};
13435ZmAdvancedHtmlEditor.prototype.reparentHtmlElement=function(t,e){
13436return this._editorContainer.reparentHtmlElement(t,e)
13437};
13438ZmAdvancedHtmlEditor.prototype.getParent=function(){
13439return this._editorContainer.parent
13440};
13441ZmAdvancedHtmlEditor.prototype.getInputElement=function(){
13442return document.getElementById(this._bodyTextAreaId)
13443};
13444ZmAdvancedHtmlEditor.prototype.initTinyMCEEditor=function(h,a,s,n,l){
13445var i={
13446parent:h,posStyle:a,mode:n,content:s,withAce:l,className:"ZmHtmlEditor"};
13447this._editorContainer=new ZmEditorContainer(i);
13448var t=this._editorContainer.getHtmlElement();
13449var e=this._bodyTextAreaId=this._editorContainer.getHTMLElId()+"_content";
13450var d=document.createElement("textarea");
13451d.setAttribute("id",e);
13452d.setAttribute("name",e);
13453d.className="DwtHtmlEditorTextArea";
13454t.appendChild(d);
13455this._textAreaId=e;
13456Dwt.setHandler(d,DwtEvent.ONFOCUS,AjxCallback.simpleClosure(this.setFocusStatus,this,true,true));
13457Dwt.setHandler(d,DwtEvent.ONBLUR,AjxCallback.simpleClosure(this.setFocusStatus,this,false,true));
13458this._editorContainer.setFocusMember(d);
13459if(s!=null){
13460this.setPendingContent(s)
13461}
13462if(!window.tinyMCE){
13463var c=new AjxCallback(this,this.initEditorManager,[e,n,s]);
13464var o={
13465name:"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};
13466AjxPackage.require(o);
13467this.initEditorManager(e,n,s)
13468}else{
13469this.initEditorManager(e,n,s)
13470}};
13471ZmAdvancedHtmlEditor.prototype.getPendingContent=function(){
13472return this._pendingContent
13473};
13474ZmAdvancedHtmlEditor.prototype.setPendingContent=function(e){
13475this._pendingContent=e
13476};
13477ZmAdvancedHtmlEditor.prototype.addOnContentIntializedListener=function(e){
13478this._onContentInitializeCallback=e
13479};
13480ZmAdvancedHtmlEditor.prototype.removeOnContentIntializedListener=function(){
13481this._onContentInitializeCallback=null
13482};
13483ZmAdvancedHtmlEditor.prototype._handleEditorKeyEvent=function(t,e){
13484var i=true;
13485var a=null;
13486if(DwtKeyEvent.isKeyPressEvent(t)){
13487if(DwtKeyboardMgr.isPossibleInputShortcut(t)){
13488i=DwtKeyboardMgr.__keyDownHdlr(t)
13489}}
13490if(window.DwtIdleTimer){
13491DwtIdleTimer.resetIdle()
13492}
13493return i
13494};
13495ZmAdvancedHtmlEditor.prototype.onLoadContent=function(t){
13496var e=this.getPendingContent();
13497if(e!=null){
13498t.setContent(e,{
13499format:"raw"}
13500);
13501this.setPendingContent(null)
13502}
13503if(this._onContentInitializeCallback){
13504this._onContentInitializeCallback.run()
13505}};
13506ZmAdvancedHtmlEditor.prototype.setFocusStatus=function(a,e){
13507var t=e?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML;
13508this._hasFocus[t]=a
13509};
13510ZmAdvancedHtmlEditor.prototype.initEditorManager=function(t,s,h){
13511var o=this;
13512function n(d){
13513o.onLoadContent(d);
13514o.initDefaultFontSize(d)
13515}
13516function c(d){
13517o.initDefaultFontSize(d);
13518tinymce.dom.Event.add(d.getWin(),"focus",function(m){
13519o.setFocusStatus(true)
13520}
13521);
13522tinymce.dom.Event.add(d.getWin(),"blur",function(m){
13523o.setFocusStatus(false)
13524}
13525);
13526var u=o.getEditorContainer();
13527u.setFocusMember(d.getWin());
13528o._editorInitialized=true
13529}
13530function i(d,u){
13531return o._handleEditorKeyEvent(u,d)
13532}
13533var a=AjxStringUtil.parseURL(location.href);
13534tinymce.baseURL=appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH+"/";
13535if(tinymce.EditorManager){
13536tinymce.EditorManager.baseURI=new tinymce.util.URI(a.protocol+"://"+a.authority+tinymce.baseURL)
13537}
13538if(tinymce.dom){
13539tinymce.DOM=new tinymce.dom.DOMUtils(document,{
13540process_html:0}
13541)
13542}
13543if(tinymce.dom&&tinymce.dom.Event){
13544tinymce.dom.Event.domLoaded=true
13545}
13546var l=appCtxt.get(ZmSetting.LOCALE_NAME);
13547var e=appContextPath+"/css/editor_ui.css?v="+window.cacheKillerVersion+"&skin="+appCurrentSkin+"&locale="+l;
13548tinyMCE.init({
13549mode:(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){
13550d.onLoadContent.add(n);
13551d.onInit.add(c);
13552d.onKeyPress.add(i)
13553}}
13554);
13555this._editor=this.getEditor();
13556this._iFrameId=this._bodyTextAreaId+"_ifr"
13557};
13558ZmAdvancedHtmlEditor.prototype.setMode=function(s,o){
13559this.discardMisspelledWords();
13560if(s==this._mode||(s!=DwtHtmlEditor.HTML&&s!=DwtHtmlEditor.TEXT)){
13561return
13562}
13563this._mode=s;
13564var e=this.getEditor();
13565if(s==DwtHtmlEditor.HTML){
13566var n=this.getContentField();
13567if(e&&e.getDoc()){
13568var i=e.getDoc();
13569var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
13570i.body.innerHTML=a;
13571this._pendingContent=a;
13572n.value="";
13573this._editorContainer.setFocusMember(e.getWin())
13574}else{
13575var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
13576this._pendingContent=a
13577}
13578tinyMCE.execCommand("mceToggleEditor",false,this._bodyTextAreaId)
13579}else{
13580var n=this.getContentField();
13581var i=e.getDoc();
13582var t=o?this._convertHtml2Text():i.innerHTML;
13583tinyMCE.execCommand("mceToggleEditor",false,this._bodyTextAreaId);
13584n.value=t;
13585this._editorContainer.setFocusMember(n)
13586}};
13587ZmAdvancedHtmlEditor.prototype.getContentField=function(){
13588return document.getElementById(this._bodyTextAreaId)
13589};
13590ZmAdvancedHtmlEditor.prototype.insertImage=function(n,s,o,t){
13591var i=[];
13592var e=0;
13593i[e++]="<img";
13594i[e++]=" src='";
13595i[e++]=n;
13596i[e++]="'";
13597if(o!=null){
13598i[e++]=" width='"+o+"'"
13599}
13600if(t!=null){
13601i[e++]=" height='"+t+"'"
13602}
13603i[e++]=">";
13604var a=this.getEditor();
13605if(tinymce.isWebKit){
13606a.getWin().focus()
13607}
13608a.execCommand("mceInsertContent",false,i.join(""),{
13609skip_undo:1}
13610)
13611};
13612ZmAdvancedHtmlEditor.prototype.initDefaultFontSize=function(e){
13613var t=e&&e.getDoc();
13614if(t){
13615t.body.style.fontFamily=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
13616t.body.style.fontSize=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
13617t.body.style.color=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR)
13618}};
13619ZmAdvancedHtmlEditor.prototype.addCSSForDefaultFontSize=function(t){
13620var a="body,td,pre";
13621var 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("");
13622var i=t?t.getDoc():null;
13623if(i){
13624this.insertDefaultCSS(i,a,e)
13625}};
13626ZmAdvancedHtmlEditor.prototype.insertDefaultCSS=function(o,i,t){
13627var a,e;
13628if(o.createStyleSheet){
13629a=o.createStyleSheet()
13630}else{
13631e=o.createElement("style");
13632o.getElementsByTagName("head")[0].appendChild(e);
13633a=e.styleSheet?e.styleSheet:e.sheet
13634}
13635if(!a&&e){
13636t=t.replace(/^\{?([^\}])/,"$1");
13637e.innerHTML=i+t
13638}else{
13639if(a.addRule){
13640t=t.replace(/^\{?([^\}])/,"$1");
13641a.addRule(i,t)
13642}else{
13643if(a.insertRule){
13644if(!/^\{[^\}]*\}$/.test(t)){
13645t="{"+t+"}"
13646}
13647a.insertRule(i+" "+t,a.cssRules.length)
13648}}}};
13649ZmAdvancedHtmlEditor.prototype.resetSpellCheck=function(){
13650this.discardMisspelledWords();
13651this._spellCheckHideModeDiv()
13652};
13653ZmAdvancedHtmlEditor.prototype.checkMisspelledWords=function(o,t,e){
13654var i=this.getTextVersion();
13655if(/\S/.test(i)){
13656AjxDispatcher.require("Extras");
13657this._spellChecker=new ZmSpellChecker(this);
13658this._spellCheck=null;
13659this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
13660if(!this.onExitSpellChecker){
13661this.onExitSpellChecker=t
13662}
13663var a={
13664text:i,ignore:AjxUtil.keys(this._ignoreWords).join()};
13665this._spellChecker.check(a,o,e);
13666return true
13667}
13668return false
13669};
13670ZmAdvancedHtmlEditor.prototype.spellCheck=function(a){
13671var t=this.getTextVersion();
13672if(/\S/.test(t)){
13673AjxDispatcher.require("Extras");
13674this._spellChecker=new ZmSpellChecker(this);
13675this._spellCheck=null;
13676this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
13677if(!this.onExitSpellChecker){
13678this.onExitSpellChecker=a
13679}
13680var e={
13681text:t,ignore:AjxUtil.keys(this._ignoreWords).join()};
13682this._spellChecker.check(e,new AjxCallback(this,this._spellCheckCallback));
13683return true
13684}
13685return false
13686};
13687ZmAdvancedHtmlEditor.prototype._spellCheckCallback=function(i){
13688var e=false;
13689if(i&&i.available){
13690var a=i.misspelled;
13691if(a==null||a.length==0){
13692appCtxt.setStatusMsg(ZmMsg.noMisspellingsFound,ZmStatusView.LEVEL_INFO)
13693}else{
13694var t=AjxMessageFormat.format(ZmMsg.misspellingsResult,a.length);
13695appCtxt.setStatusMsg(t,ZmStatusView.LEVEL_WARNING);
13696this.highlightMisspelledWords(a);
13697e=true
13698}}else{
13699appCtxt.setStatusMsg(ZmMsg.spellCheckUnavailable,ZmStatusView.LEVEL_CRITICAL)
13700}
13701if(AjxEnv.isGeckoBased&&this._mode==DwtHtmlEditor.HTML){
13702setTimeout(AjxCallback.simpleClosure(this.focus,this),10)
13703}
13704if(this.onExitSpellChecker){
13705this.onExitSpellChecker.run(e)
13706}};
13707ZmAdvancedHtmlEditor.prototype._spellCheckSuggestionListener=function(h){
13708var f=this;
13709var m=h.item;
13710var d=m.getData("orig");
13711if(!d){
13712return
13713}
13714var t=m.getData(ZmHtmlEditor._VALUE);
13715var o=this._mode==DwtHtmlEditor.TEXT;
13716var s=m.getData("fixall");
13717var u=o?document:this._getIframeDoc();
13718var c=u.getElementById(m.getData("spanId"));
13719var i=m.getData(ZmPopupMenu.MENU_ITEM_ID_KEY);
13720switch(i){
13721case"ignore":t=d;
13722this._ignoreWords[t]=true;
13723if(s){}
13724break;
13725case"add":t=d;
13726var l=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
13727var n=l.set("pref",t);
13728n.setAttribute("name","+zimbraPrefSpellIgnoreWord");
13729var a={
13730soapDoc:l,asyncMode:true,callback:new AjxCallback(appCtxt,appCtxt.setStatusMsg,[ZmMsg.wordAddedToDictionary])};
13731appCtxt.getAppController().sendRequest(a);
13732this._ignoreWords[t]=true;
13733break;
13734default:break
13735}
13736if(o&&t==null){
13737this._editWord(s,c)
13738}else{
13739var e=s?this._spellCheck.wordIds[d]:c;
13740this._editWordFix(e,t)
13741}
13742this._handleSpellCheckerEvents(null)
13743};
13744ZmAdvancedHtmlEditor.prototype._getEditorDocument=function(){
13745var e=this._mode==DwtHtmlEditor.TEXT;
13746return e?document:this._getIframeDoc()
13747};
13748ZmAdvancedHtmlEditor.prototype._editWord=function(s,e){
13749var o=this._getEditorDocument();
13750var t=o.createElement("input");
13751t.type="text";
13752t.value=AjxUtil.getInnerText(e);
13753t.className="SpellCheckInputField";
13754t.style.left=e.offsetLeft-2+"px";
13755t.style.top=e.offsetTop-2+"px";
13756t.style.width=e.offsetWidth+4+"px";
13757var n=o.getElementById(this._spellCheckDivId);
13758var i=n.scrollTop;
13759n.appendChild(t);
13760n.scrollTop=i;
13761t.setAttribute("autocomplete","off");
13762t.focus();
13763if(!AjxEnv.isGeckoBased){
13764t.select()
13765}else{
13766t.setSelectionRange(0,t.value.length)
13767}
13768var a=AjxCallback.simpleClosure(this._editWordHandler,this,s,e);
13769t.onblur=a;
13770t.onkeydown=a
13771};
13772ZmAdvancedHtmlEditor.prototype._editWordHandler=function(a,e,t){
13773setTimeout(AjxCallback.simpleClosure(this._editWordHandler2,this,a,e,t),20)
13774};
13775ZmAdvancedHtmlEditor.prototype._editWordHandler2=function(s,o,h){
13776h=DwtUiEvent.getEvent(h);
13777var l=h.type;
13778var t=h.keyCode;
13779var i=h.ctrlKey;
13780var c=DwtUiEvent.getTarget(h);
13781var n=/key/.test(l);
13782var a=true;
13783if(/blur/.test(l)||(n&&t==13)){
13784if(i){
13785s=!s
13786}
13787var d=AjxUtil.getInnerText(o);
13788var e=s?this._spellCheck.wordIds[d]:o;
13789this._editWordFix(e,c.value)
13790}else{
13791if(n&&t==27){
13792this._editWordFix(o,AjxUtil.getInnerText(o))
13793}else{
13794a=false
13795}}
13796if(a){
13797c.onblur=null;
13798c.onkeydown=null;
13799if(c.parentNode){
13800c.parentNode.removeChild(c)
13801}}
13802this._handleSpellCheckerEvents(null)
13803};
13804ZmAdvancedHtmlEditor.prototype._editWordFix=function(a,o){
13805a=a instanceof Array?a:[a];
13806var n=this._getEditorDocument();
13807for(var t=a.length-1;
13808t>=0;
13809t--){
13810var e=a[t];
13811if(typeof e=="string"){
13812e=n.getElementById(e)
13813}
13814if(e){
13815e.innerHTML=o
13816}}};
13817ZmAdvancedHtmlEditor.prototype._getParentElement=function(){
13818var e=this.getEditor();
13819if(e.selection){
13820return e.selection.getNode()
13821}else{
13822var t=this._getIframeDoc();
13823return t?t.body:null
13824}};
13825ZmAdvancedHtmlEditor.prototype._handleSpellCheckerEvents=function(v){
13826var l=this._mode==DwtHtmlEditor.TEXT;
13827var 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="";
13828if(v&&/^span$/i.test(u.tagName)&&/ZM-SPELLCHECK/.test(u.className)){
13829b=u.getAttribute("word");
13830window.status="Suggestions: "+e.suggestions[b].join(", ");
13831n=b!=AjxUtil.getInnerText(u)
13832}
13833f=e.spanIds;
13834for(y in f){
13835g=k.getElementById(y);
13836if(g){
13837if(f[y]!=AjxUtil.getInnerText(g)||this._ignoreWords[f[y]]){
13838g.className="ZM-SPELLCHECK-FIXED"
13839}else{
13840if(f[y]==b){
13841g.className="ZM-SPELLCHECK-MISSPELLED2"
13842}else{
13843g.className="ZM-SPELLCHECK-MISSPELLED"
13844}}}}
13845if(e.menu&&(!v||(/click|mousedown|mouseup|contextmenu/.test(v.type)||(/key/.test(v.type)&&(!b||n))))){
13846if(e.menu._menuItems.fixall){
13847e.menu._menuItems.fixall.getMenu().dispose()
13848}
13849e.menu.dispose();
13850e.menu=null;
13851window.status=""
13852}
13853if(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])){
13854e.menu=this._spellCheckCreateMenu(this.getParent(),0,c,b,u.id,n);
13855if(e.wordIds[b].length>1){
13856e.menu.createSeparator();
13857this._replaceAllFormatter=this._replaceAllFormatter||new AjxMessageFormat(ZmMsg.replaceAllMenu);
13858var s=this._replaceAllFormatter.format(e.wordIds[b].length);
13859var w=e.menu.createMenuItem("fixall",{
13860text:s}
13861);
13862w.setMenu(makeMenu(1,w))
13863}
13864var o,m=e.menu.getSize(),t=this._editorContainer.shell.getSize();
13865if(!l){
13866o=Dwt.toWindow(document.getElementById(this._iFrameId),0,0,null,true);
13867var a=Dwt.toWindow(u,0,0,null,true);
13868o.x+=a.x-(k.documentElement.scrollLeft||k.body.scrollLeft);
13869o.y+=a.y-(k.documentElement.scrollTop||k.body.scrollTop)
13870}else{
13871o=Dwt.toWindow(u,0,0,null,true);
13872var h=document.getElementById(this._spellCheckDivId);
13873o.x-=h.scrollLeft;
13874o.y-=h.scrollTop
13875}
13876o.y+=u.offsetHeight;
13877if(o.y+m.y>t.y){
13878o.y-=m.y+u.offsetHeight
13879}
13880e.menu.popup(0,o.x,o.y);
13881v._stopPropagation=true;
13882v._returnValue=false
13883}};
13884ZmAdvancedHtmlEditor.prototype._spellCheckCreateMenu=function(d,c,l,t,o,u){
13885var a=new ZmPopupMenu(d);
13886if(u){
13887var s="<b>"+t+"</b>";
13888this._spellCheckCreateMenuItem(a,"orig",{
13889text:s}
13890,c,t,t,o)
13891}
13892if(l.length>0){
13893for(var n=0;
13894n<l.length;
13895++n){
13896this._spellCheckCreateMenuItem(a,"sug-"+n,{
13897text:l[n],className:""}
13898,c,l[n],t,o)
13899}
13900if(!(d instanceof DwtMenuItem)&&this._spellCheck.wordIds[t].length>1){
13901if(!this._replaceAllFormatter){
13902this._replaceAllFormatter=new AjxMessageFormat(ZmMsg.replaceAllMenu)
13903}
13904var s="<i>"+this._replaceAllFormatter.format(this._spellCheck.wordIds[t].length)+"</i>";
13905var m=a.createMenuItem("fixall",{
13906text:s}
13907);
13908var e=this._spellCheckCreateMenu(m,1,l,t,o,u);
13909m.setMenu(e)
13910}}else{
13911var m=this._spellCheckCreateMenuItem(a,"noop",{
13912text:ZmMsg.noSuggestions}
13913,c,"",t,o);
13914m.setEnabled(false);
13915this._spellCheckCreateMenuItem(a,"clear",{
13916text:"<i>"+ZmMsg.clearText+"</i>"}
13917,c,"",t,o)
13918}
13919a.createSeparator();
13920var h=this._mode==DwtHtmlEditor.TEXT;
13921if(h){
13922var s=c?ZmMsg.editAll:ZmMsg.edit;
13923this._spellCheckCreateMenuItem(a,"edit",{
13924text:s}
13925,c,null,t,o)
13926}
13927if(!c){
13928this._spellCheckCreateMenuItem(a,"ignore",{
13929text:ZmMsg.ignoreWord}
13930,0,null,t,o)
13931}
13932if(!c&&appCtxt.get(ZmSetting.SPELL_CHECK_ADD_WORD_ENABLED)){
13933this._spellCheckCreateMenuItem(a,"add",{
13934text:ZmMsg.addWord}
13935,c,null,t,o)
13936}
13937return a
13938};
13939ZmAdvancedHtmlEditor.prototype._spellCheckCreateMenuItem=function(a,t,o,s,h,e,n,i){
13940if(o.className==null){
13941o.className="ZMenuItem ZmSpellMenuItem"
13942}
13943var l=a.createMenuItem(t,o);
13944l.setData("fixall",s);
13945l.setData("value",h);
13946l.setData("orig",e);
13947l.setData("spanId",n);
13948l.addSelectionListener(i||this._spellCheckSuggestionListenerObj);
13949return l
13950};
13951ZmAdvancedHtmlEditor.prototype.discardMisspelledWords=function(c){
13952if(!this._spellCheck){
13953return
13954}
13955if(this._mode==DwtHtmlEditor.HTML){
13956var s=this._getIframeDoc();
13957s.body.style.display="none";
13958var t=null;
13959var h=this._spellCheck.spanIds;
13960for(var n in h){
13961var l=s.getElementById(n);
13962if(!l){
13963continue
13964}
13965t=l.parentNode;
13966while(l.firstChild){
13967t.insertBefore(l.firstChild,l)
13968}
13969t.removeChild(l)
13970}
13971if(!AjxEnv.isIE){
13972s.body.normalize()
13973}else{
13974s.body.innerHTML=s.body.innerHTML
13975}
13976t=s.getElementById("ZM-SPELLCHECK-STYLE");
13977if(t){
13978t.parentNode.removeChild(t)
13979}
13980s.body.style.display="";
13981this._unregisterEditorEventHandler(s,"contextmenu")
13982}else{
13983if(this._spellCheckDivId!=null){
13984var e=document.getElementById(this._spellCheckDivId);
13985var o=e.scrollTop;
13986var a=document.getElementById(this._textAreaId);
13987if(AjxEnv.isGeckoBased){
13988e.innerHTML=AjxStringUtil.htmlDecode(e.innerHTML,true)
13989}
13990a.value=AjxUtil.getInnerText(e);
13991e.onclick=null;
13992e.oncontextmenu=null;
13993e.onmousedown=null;
13994e.parentNode.removeChild(e);
13995a.style.display="";
13996a.scrollTop=o
13997}}
13998this._spellCheckDivId=this._spellCheck=null;
13999window.status="";
14000if(!c){
14001this._spellCheckHideModeDiv()
14002}
14003if(this.onExitSpellChecker){
14004this.onExitSpellChecker.run()
14005}};
14006ZmAdvancedHtmlEditor.prototype._spellCheckShowModeDiv=function(){
14007var o=this._editorContainer.getSize();
14008if(!this._spellCheckModeDivId){
14009var s=document.createElement("div");
14010s.className="SpellCheckModeDiv";
14011s.id=this._spellCheckModeDivId=Dwt.getNextId();
14012var a=new Array();
14013var t=0;
14014a[t++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='width:25'>";
14015a[t++]=AjxImg.getImageHtml("SpellCheck");
14016a[t++]="</td><td style='white-space:nowrap'><span class='SpellCheckLink'>";
14017a[t++]=ZmMsg.resumeEditing;
14018a[t++]="</span> | <span class='SpellCheckLink'>";
14019a[t++]=ZmMsg.checkAgain;
14020a[t++]="</span></td></tr></table>";
14021s.innerHTML=a.join("");
14022var e=this._editorContainer.getHtmlElement();
14023e.insertBefore(s,e.firstChild);
14024var n=s.getElementsByTagName("span");
14025Dwt.associateElementWithObject(n[0],this);
14026Dwt.setHandler(n[0],"onclick",ZmAdvancedHtmlEditor._spellCheckResumeEditing);
14027Dwt.associateElementWithObject(n[1],this);
14028Dwt.setHandler(n[1],"onclick",ZmAdvancedHtmlEditor._spellCheckAgain)
14029}else{
14030document.getElementById(this._spellCheckModeDivId).style.display=""
14031}
14032this.setSize(o.x,o.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
14033};
14034ZmAdvancedHtmlEditor._spellCheckResumeEditing=function(){
14035var e=Dwt.getObjectFromElement(this);
14036e.discardMisspelledWords()
14037};
14038ZmAdvancedHtmlEditor._spellCheckAgain=function(){
14039var e=Dwt.getObjectFromElement(this);
14040e.discardMisspelledWords();
14041e.spellCheck()
14042};
14043ZmAdvancedHtmlEditor.prototype._spellCheckHideModeDiv=function(){
14044var e=this._editorContainer.getSize();
14045if(this._spellCheckModeDivId){
14046document.getElementById(this._spellCheckModeDivId).style.display="none"
14047}
14048this.setSize(e.x,e.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
14049};
14050ZmAdvancedHtmlEditor.prototype.highlightMisspelledWords=function(m,t){
14051this.discardMisspelledWords(t);
14052var b,g,v,n,u=this,s={}
14053,f={}
14054,k=["([^A-Za-z0-9']|^)("],c={};
14055for(var p=0;
14056p<m.length;
14057++p){
14058b=m[p].word;
14059if(!c[b]){
14060p&&k.push("|");
14061k.push(b);
14062var w=m[p].suggestions.split(/\s*,\s*/);
14063if(!w[w.length-1]){
14064w.pop()
14065}
14066c[b]=w;
14067if(c[b].length>5){
14068c[b].length=5
14069}}}
14070k.push(")([^A-Za-z0-9']|$)");
14071k=new RegExp(k.join(""),"gm");
14072function l(T,A){
14073T=A?AjxStringUtil.convertToHtml(T):AjxStringUtil.htmlEncode(T);
14074var x;
14075k.lastIndex=0;
14076while(x=k.exec(T)){
14077var z=x[0];
14078var q=x[1];
14079var a=x[2];
14080var O=x[3];
14081var i=Dwt.getNextId();
14082s[i]=a;
14083if(!f[a]){
14084f[a]=[]
14085}
14086f[a].push(i);
14087var j=[q,'<span word="',a,'" id="',i,'" class="ZM-SPELLCHECK-MISSPELLED">',a,"</span>",O].join("");
14088T=[T.substr(0,x.index),j,T.substr(x.index+z.length)].join("");
14089k.lastIndex=x.index+j.length-O.length
14090}
14091return T
14092}
14093var v;
14094rec=function(T){
14095switch(T.nodeType){
14096case 1:for(var z=T.firstChild;
14097z;
14098z=rec(z)){}
14099T=T.nextSibling;
14100break;
14101case 3:if(!/[^\s\xA0]/.test(T.data)){
14102T=T.nextSibling;
14103break
14104}
14105var j=null,q=null;
14106var x=/^[\s\xA0]+/.exec(T.data);
14107if(x){
14108j=T;
14109T=T.splitText(x[0].length)
14110}
14111x=/[\s\xA0]+$/.exec(T.data);
14112if(x){
14113q=T.splitText(T.data.length-x[0].length)
14114}
14115var A=l(T.data,false);
14116A=A.replace(/^ +/,"&nbsp;").replace(/ +$/,"&nbsp;");
14117var W=v.createElement("div");
14118W.innerHTML=A;
14119if(j){
14120W.insertBefore(j,W.firstChild)
14121}
14122if(q){
14123W.appendChild(q)
14124}
14125var O=T.parentNode;
14126while(W.firstChild){
14127O.insertBefore(W.firstChild,T)
14128}
14129W=T.nextSibling;
14130O.removeChild(T);
14131T=W;
14132break;
14133default:T=T.nextSibling
14134}
14135return T
14136};
14137if(this._mode==DwtHtmlEditor.HTML){
14138v=this._getIframeDoc();
14139n=v.body;
14140this._loadExternalStyle("/css/spellcheck.css");
14141n.style.display="none";
14142if(!AjxEnv.isIE){
14143n.normalize()
14144}else{
14145n.innerHTML=n.innerHTML
14146}
14147rec(n);
14148if(!AjxEnv.isIE){
14149n.normalize()
14150}else{
14151n.innerHTML=n.innerHTML
14152}
14153n.style.display="";
14154var o=this.getEditor();
14155o.onContextMenu.add(this._handleEditorEvent,this);
14156o.onMouseUp.add(this._handleEditorEvent,this)
14157}else{
14158var y=document.getElementById(this._textAreaId);
14159var e=y.scrollTop;
14160var d=Dwt.getSize(y);
14161y.style.display="none";
14162var h=document.createElement("div");
14163h.className="TextSpellChecker";
14164this._spellCheckDivId=h.id=Dwt.getNextId();
14165h.style.overflow="auto";
14166if(!AjxEnv.isIE){
14167d.x-=4;
14168d.y-=6
14169}
14170h.style.width=d.x+"px";
14171h.style.height=d.y+"px";
14172h.innerHTML=AjxStringUtil.convertToHtml(this.getContent());
14173v=document;
14174rec(h);
14175y.parentNode.insertBefore(h,y);
14176h.scrollTop=e;
14177h.oncontextmenu=h.onclick=function(a){
14178u._handleSpellCheckerEvents(a||window.event)
14179}
14180}
14181this._spellCheckShowModeDiv();
14182this._spellCheck={
14183suggestions:c,spanIds:s,wordIds:f}
14184};
14185ZmAdvancedHtmlEditor.prototype._loadExternalStyle=function(o){
14186var i=this._getIframeDoc();
14187var t=i.getElementById(o);
14188if(!t){
14189t=i.createElement("link");
14190t.id=o;
14191t.rel="stylesheet";
14192t.type="text/css";
14193var a=appContextPath+o+"?v="+cacheKillerVersion;
14194if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
14195a=document.baseURI.replace(/^(https?:\x2f\x2f[^\x2f]+).*$/,"$1")+a
14196}
14197t.href=a;
14198var e=i.getElementsByTagName("head")[0];
14199if(!e){
14200e=i.createElement("head");
14201var n=i.documentElement;
14202if(n){
14203n.insertBefore(e,n.firstChild)
14204}}
14205e.appendChild(t)
14206}};
14207ZmAdvancedHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
14208if(AjxEnv.isIE){
14209t.attachEvent("on"+e,this.__eventClosure)
14210}else{
14211t.addEventListener(e,this.__eventClosure,true)
14212}};
14213ZmAdvancedHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
14214if(AjxEnv.isIE){
14215t.detachEvent("on"+e,this.__eventClosure)
14216}else{
14217t.removeEventListener(e,this.__eventClosure,true)
14218}};
14219ZmAdvancedHtmlEditor.prototype.__eventClosure=function(e){
14220this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e);
14221return tinymce.dom.Event.cancel(e)
14222};
14223ZmAdvancedHtmlEditor.prototype._handleEditorEvent=function(i,n){
14224var t=true;
14225if(n.type=="contextmenu"){
14226var h=DwtShell.mouseEvent;
14227h.setFromDhtmlEvent(n);
14228var o=Dwt.getLocation(document.getElementById(this._iFrameId));
14229if(!AjxEnv.isIE){
14230var s=this._getIframeDoc();
14231var a=s.documentElement.scrollLeft||s.body.scrollLeft;
14232var c=s.documentElement.scrollTop||s.body.scrollTop;
14233o.x-=a;
14234o.y-=c
14235}
14236h.docX+=o.x;
14237h.docY+=o.y;
14238DwtControl.__mouseEvent(n,DwtEvent.ONCONTEXTMENU,this,h);
14239t=h._returnValue
14240}
14241var l=this;
14242if(this._spellCheck){
14243var e;
14244if(/mouse|context|click|select/i.test(n.type)){
14245e=new DwtMouseEvent(true)
14246}else{
14247e=new DwtUiEvent(true)
14248}
14249e.setFromDhtmlEvent(n);
14250this._TIMER_spell=setTimeout(function(){
14251l._handleSpellCheckerEvents(e);
14252this._TIMER_spell=null
14253}
14254,100);
14255return tinymce.dom.Event.cancel(n)
14256}
14257return t
14258};
14259ZmAdvancedHtmlEditor.prototype._getSelection=function(){
14260if(AjxEnv.isIE){
14261return this._getIframeDoc().selection
14262}else{
14263return this._getIframeWin().getSelection()
14264}};
14265ZmEditorContainer=function(e){
14266if(arguments.length==0){
14267return
14268}
14269e=Dwt.getParams(arguments,ZmEditorContainer.PARAMS);
14270DwtComposite.call(this,e)
14271};
14272ZmEditorContainer.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
14273ZmEditorContainer.prototype=new DwtComposite();
14274ZmEditorContainer.prototype.constructor=ZmEditorContainer;
14275ZmEditorContainer.prototype.setFocusMember=function(e){
14276this._focusMember=e
14277};
14278ZmEditorContainer.prototype._focus=function(){
14279if(this._focusMember){
14280this._focusMember.focus()
14281}}
14282}
14283if(AjxPackage.define("zimbraMail.share.view.dialog.ZmDialog")){
14284ZmDialog=function(e){
14285if(arguments.length==0){
14286return
14287}
14288DwtDialog.call(this,e);
14289if(!e.view){
14290this.setContent(this._contentHtml())
14291}
14292if(this._button[DwtDialog.OK_BUTTON]){
14293this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._okButtonListener))
14294}
14295this._overview={};
14296this._opc=appCtxt.getOverviewController();
14297this._baseTabGroupSize=this._tabGroup.size()
14298};
14299ZmDialog.prototype=new DwtDialog;
14300ZmDialog.prototype.constructor=ZmDialog;
14301ZmDialog.prototype._contentHtml=function(){
14302return""
14303};
14304ZmDialog.prototype.setView=function(i,e){
14305this.reset();
14306if(i){
14307var a=this._getContentDiv();
14308var t=i.getHtmlElement();
14309a.parentNode.replaceChild(t,a);
14310this._contentDiv=t
14311}};
14312ZmDialog.prototype.popup=function(){
14313this._tabGroup.__members._array.splice(this._baseTabGroupSize);
14314this._tabGroup.addMember(this._getTabGroupMembers());
14315DwtDialog.prototype.popup.call(this);
14316if(this._focusElement){
14317appCtxt.getKeyboardMgr().grabFocus(this._focusElement)
14318}};
14319ZmDialog.prototype.reset=function(){
14320if(this._nameField){
14321this._nameField.value=""
14322}
14323DwtDialog.prototype.reset.call(this)
14324};
14325ZmDialog.prototype._okButtonListener=function(){
14326this.popdown()
14327};
14328ZmDialog.prototype._setNameField=function(e){
14329this._nameField=this._focusElement=document.getElementById(e);
14330if(this._enterListener){
14331this.addEnterListener(new AjxListener(this,this._enterListener))
14332}};
14333ZmDialog.prototype._setOverview=function(i,e){
14334if(appCtxt.multiAccounts){
14335var t=this._opc.getOverviewContainer(this._curOverviewId)||this._opc.getOverview(this._curOverviewId);
14336if(t){
14337t.setVisible(false)
14338}}
14339if(appCtxt.multiAccounts&&!e){
14340var s=this._curOverviewId=i.overviewId;
14341var l=this._opc.getOverviewContainer(s);
14342if(!l){
14343var h={
14344overviewClass:"dialogOverviewContainer",headerClass:"DwtTreeItem",noTooltips:true,treeStyle:i.treeStyle,treeIds:i.treeIds,overviewTrees:i.overviewTrees,omit:i.omit,omitPerAcct:i.omitPerAcct,selectable:i.selectable};
14345var o={
14346appName:i.appName,containerId:s};
14347l=this._opc.createOverviewContainer(o,h);
14348l.setSize(Dwt.DEFAULT,"200");
14349document.getElementById(i.fieldId).appendChild(l.getHtmlElement())
14350}
14351l.setVisible(true);
14352return l
14353}
14354var a=this._curOverviewId=i.overviewId;
14355var c=this._opc.getOverview(a);
14356if(!c){
14357var n={
14358overviewId:a,overviewClass:"dialogOverview",headerClass:"DwtTreeItem",noTooltips:true,treeStyle:i.treeStyle,treeIds:i.treeIds,account:((appCtxt.multiAccounts&&i.forceSingle)?appCtxt.getActiveAccount():i.account)};
14359c=this._overview[a]=this._opc.createOverview(n);
14360this._renderOverview(c,i.treeIds,i.omit,i.noRootSelect);
14361document.getElementById(i.fieldId).appendChild(c.getHtmlElement())
14362}
14363this._makeOverviewVisible(a);
14364return c
14365};
14366ZmDialog.prototype._makeOverviewVisible=function(e){
14367for(var t in this._overview){
14368this._overview[t].setVisible(t==e)
14369}};
14370ZmDialog.prototype._renderOverview=function(h,a,n,s){
14371h.set(a,n);
14372if(!s){
14373for(var o=0;
14374o<a.length;
14375o++){
14376var e=h.getTreeView(a[o]);
14377var t=e&&e.getHeaderItem();
14378if(t){
14379t.enableSelection(true)
14380}}}};
14381ZmDialog.prototype._getOverview=function(){
14382return this._overview[this._curOverviewId]
14383};
14384ZmDialog.prototype._getInputFields=function(){
14385return(this._nameField)?[this._nameField]:null
14386};
14387ZmDialog.prototype._showError=function(i,a){
14388var t=a||(new DwtPoint(this.getLocation().x+50,this.getLocation().y+100));
14389var e=appCtxt.getMsgDialog();
14390e.reset();
14391e.setMessage(i,DwtMessageDialog.CRITICAL_STYLE);
14392e.popup(t)
14393};
14394ZmDialog.prototype._getTabGroupMembers=function(){
14395return[this._nameField]
14396}
14397}
14398if(AjxPackage.define("zimbraMail.share.view.dialog.ZmAttachDialog")){
14399ZmAttachDialog=function(e,t){
14400t=t||"ZmAttachDialog";
14401DwtDialog.call(this,{
14402parent:e,className:t,title:ZmMsg.attachFile}
14403);
14404this._createBaseHtml();
14405this._defaultCancelCallback=new AjxCallback(this,this._defaultCancelListener);
14406this._cancelListeners={};
14407this._defaultOkCallback=new AjxCallback(this,this._defaultOkListener);
14408this._okListeners={};
14409this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,function(){
14410this._cancelButtonListener()
14411}
14412));
14413this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
14414this._okButtonListener()
14415}
14416));
14417this._tabKeys={};
14418var a=this.getButton(DwtDialog.OK_BUTTON);
14419a.setText(ZmMsg.attach);
14420this._addMyComputerTab();
14421if(appCtxt.get(ZmSetting.BRIEFCASE_ENABLED)){
14422this._addBriefcaseViewTab()
14423}};
14424ZmAttachDialog.prototype=new DwtDialog;
14425ZmAttachDialog.prototype.constructor=ZmAttachDialog;
14426ZmAttachDialog.TABKEY_MYCOMPUTER="MY_COMPUTER";
14427ZmAttachDialog.TABKEY_BRIEFCASE="BRIEFCASE";
14428ZmAttachDialog.supportsHTML5=(window.FileReader||AjxEnv.isChrome||AjxEnv.isSafari4up);
14429ZmAttachDialog.prototype.addCancelListener=function(t,e){
14430if(e&&(e instanceof AjxListener||e instanceof AjxCallback)){
14431this._cancelListeners[t]=e
14432}};
14433ZmAttachDialog.prototype._defaultCancelListener=function(){
14434this.popdown()
14435};
14436ZmAttachDialog.prototype._cancelButtonListener=function(){
14437var e=this._cancelListeners[this._tabView.getCurrentTab()];
14438if(e){
14439e.run()
14440}else{
14441this._defaultCancelCallback.run()
14442}};
14443ZmAttachDialog.prototype.addOkListener=function(t,e){
14444if(e&&(e instanceof AjxListener||e instanceof AjxCallback)){
14445this._okListeners[t]=e
14446}};
14447ZmAttachDialog.prototype._defaultOkListener=function(){
14448this.popdown()
14449};
14450ZmAttachDialog.prototype._okButtonListener=function(){
14451var t=this.getButton(DwtDialog.OK_BUTTON);
14452t.setEnabled(false);
14453var e=this._okListeners[this._tabView.getCurrentTab()];
14454if(e){
14455e.run(this)
14456}else{
14457this._defaultOkCallback.run()
14458}
14459t.setEnabled(true)
14460};
14461ZmAttachDialog.prototype._createBaseHtml=function(){
14462this._baseContainerView=new DwtComposite({
14463parent:this,className:"ZmAttachDialog-container"}
14464);
14465this._initializeTabView(this._baseContainerView);
14466this.setView(this._baseContainerView)
14467};
14468ZmAttachDialog.prototype._initializeTabView=function(e){
14469this._tabView=new ZmAttachTabView(e,null,Dwt.STATIC_STYLE);
14470this._tabView.addTabChangeListener(new AjxListener(this,this.tabChangeListener));
14471this._tabView.addStateChangeListener(new AjxListener(this,this.stateChangeListener));
14472this._setAttachmentSizeSection(e);
14473this._setInlineOptionSection(e);
14474this._setFooterSection(e)
14475};
14476ZmAttachDialog.prototype.stateChangeListener=function(e){
14477this._resetInlineOption()
14478};
14479ZmAttachDialog.prototype.tabChangeListener=function(t){
14480this.setFooter("");
14481var a=this._tabView.getCurrentTab();
14482var e=this._tabView.getTabView(a);
14483if(e&&e.gotAttachments()){
14484this.setFooter(ZmMsg.attachClearUploadMessage);
14485return false
14486}
14487return true
14488};
14489ZmAttachDialog.prototype._setAttachmentSizeSection=function(e){
14490var a=document.createElement("div");
14491a.className="ZmAttachDialog-note";
14492var t=AjxUtil.formatSize(appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)||0,true);
14493a.innerHTML=AjxMessageFormat.format(ZmMsg.attachmentLimitMsg,t);
14494e.getHtmlElement().appendChild(a)
14495};
14496ZmAttachDialog.prototype._setFooterSection=function(e){
14497var t=document.createElement("div");
14498t.className="ZmAttachDialog-footer";
14499t.id=Dwt.getNextId();
14500e.getHtmlElement().appendChild(t);
14501this._footer=document.getElementById(t.id)
14502};
14503ZmAttachDialog.prototype.setFooter=function(e){
14504if(typeof e=="string"){
14505this._footer.innerHTML=e
14506}else{
14507this._footer.appendChild(e)
14508}};
14509ZmAttachDialog.prototype.getTabView=function(){
14510return this._tabView
14511};
14512ZmAttachDialog.prototype.addTab=function(a,t,e){
14513if(!this._tabView||!e){
14514return null
14515}
14516this._tabKeys[a]=this._tabView.addTab(t,e);
14517return this._tabKeys[a]
14518};
14519ZmAttachDialog.prototype.getTabKey=function(e){
14520return this._tabKeys[e]
14521};
14522ZmAttachDialog.prototype.getTabViewPage=function(e){
14523return this._tabView.getTabView(this._tabKeys[e])
14524};
14525ZmAttachDialog.prototype.popup=function(){
14526var e=this.getTabKey(ZmAttachDialog.TABKEY_MYCOMPUTER);
14527this._tabView.switchToTab(e,true);
14528this.setButtonEnabled(DwtDialog.OK_BUTTON,true);
14529this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
14530this.setFooter("");
14531DwtDialog.prototype.popup.call(this);
14532this.setFooter("")
14533};
14534ZmAttachDialog.prototype.uploadFiles=function(){
14535this.setFooter("");
14536var a=this._tabView.getCurrentTab();
14537var e=this._tabView.getTabView(a);
14538if(e&&e.validate){
14539var t=e.validate();
14540if(!t.status){
14541this.setFooter(t.error);
14542return false
14543}}
14544if(e&&e.gotAttachments()){
14545this.upload(this._uploadCallback,e.uploadForm)
14546}else{
14547this.setFooter(ZmMsg.attachSelectMessage)
14548}};
14549ZmAttachDialog.prototype.cancelUploadFiles=function(){
14550this._cancelUpload=true;
14551this._defaultCancelListener()
14552};
14553ZmAttachDialog.prototype.setUploadCallback=function(e){
14554this._uploadCallback=e
14555};
14556ZmAttachDialog.prototype.getUploadCallback=function(){
14557return this._uploadCallback
14558};
14559ZmAttachDialog.prototype.upload=function(t,e){
14560if(!t){
14561t=false
14562}
14563this.setButtonEnabled(DwtDialog.OK_BUTTON,false);
14564this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
14565this.setFooter(ZmMsg.attachingFiles);
14566this._cancelUpload=false;
14567this._processUpload(t,e)
14568};
14569ZmAttachDialog.prototype._processUpload=function(o,a){
14570var i=new AjxCallback(this,this._uploadDoneCallback,[o]);
14571var e=appCtxt.getUploadManager();
14572window._uploadManager=e;
14573try{
14574e.execute(i,a)
14575}
14576catch(t){
14577i.run()
14578}};
14579ZmAttachDialog.prototype._uploadDoneCallback=function(n,e,t){
14580if(this._cancelUpload){
14581return
14582}
14583this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
14584if(e==AjxPost.SC_OK){
14585this.setFooter(ZmMsg.attachingFilesDone);
14586if(n){
14587n.run(e,t)
14588}}else{
14589if(e==AjxPost.SC_UNAUTHORIZED){
14590var i=new AjxException("401 response during attachment upload",ZmCsfeException.SVC_AUTH_EXPIRED);
14591appCtxt.getAppController()._handleException(i,{
14592continueCallback:n}
14593)
14594}else{
14595var o=AjxMessageFormat.format(ZmMsg.errorAttachment,(e||AjxPost.SC_NO_CONTENT));
14596switch(e){
14597case AjxPost.SC_REQUEST_ENTITY_TOO_LARGE:o+=" "+ZmMsg.errorAttachmentTooBig+"<br><br>";
14598break;
14599default:o+=" ";
14600break
14601}
14602var a=appCtxt.getMsgDialog();
14603a.setMessage(o,DwtMessageDialog.CRITICAL_STYLE);
14604a.popup();
14605this.setFooter(ZmMsg.attachingFilesError)
14606}}
14607this.setButtonEnabled(DwtDialog.OK_BUTTON,true)
14608};
14609ZmAttachDialog.prototype._addMyComputerTab=function(){
14610this._myComputerTabViewPage=new ZmMyComputerTabViewPage(this._tabView);
14611var e=this.addTab(ZmAttachDialog.TABKEY_MYCOMPUTER,ZmMsg.myComputer,this._myComputerTabViewPage);
14612this.addOkListener(e,(new AjxCallback(this,this.uploadFiles)));
14613this.addCancelListener(e,(new AjxCallback(this,this.cancelUploadFiles)))
14614};
14615ZmAttachDialog.prototype._addBriefcaseViewTab=function(){
14616var e=new AjxCallback(this,this.getBriefcaseTabView);
14617var t=this.addTab(ZmAttachDialog.TABKEY_BRIEFCASE,ZmMsg.briefcase,e)
14618};
14619ZmAttachDialog.prototype.getBriefcaseTabView=function(t){
14620if(!this._briefcaseTabView){
14621AjxDispatcher.require(["BriefcaseCore","Briefcase"]);
14622this._briefcaseTabView=new ZmBriefcaseTabView(this._tabView);
14623var e=new AjxCallback(this._briefcaseTabView,this._briefcaseTabView.uploadFiles);
14624this.addOkListener(t,e);
14625this.addCancelListener(t,(new AjxCallback(this,this.cancelUploadFiles)))
14626}
14627return this._briefcaseTabView
14628};
14629ZmAttachDialog.prototype._setInlineOptionSection=function(e){
14630var t=document.createElement("div");
14631t.className="ZmAttachDialog-inline";
14632t.id=Dwt.getNextId();
14633e.getHtmlElement().appendChild(t);
14634this._inlineOption=document.getElementById(t.id)
14635};
14636ZmAttachDialog.prototype.enableInlineOption=function(e){
14637if(e){
14638var t=this._htmlElId+"_inlineCheckbox";
14639this._inlineOption.setAttribute("option","inline");
14640this._inlineOption.innerHTML=["<input type='checkbox' name='inlineimages' id='",t,"'> <label for='",t,"'>",ZmMsg.inlineAttachmentOption,"</label>"].join("")
14641}else{
14642this._inlineOption.innerHTML=""
14643}};
14644ZmAttachDialog.prototype._resetInlineOption=function(){
14645var e=document.getElementById(this._htmlElId+"_inlineCheckbox");
14646if(e){
14647e.checked=false
14648}};
14649ZmAttachDialog.prototype.isInline=function(){
14650var e=document.getElementById(this._htmlElId+"_inlineCheckbox");
14651return(e&&e.checked)
14652};
14653ZmAttachTabView=function(a,t,e){
14654if(arguments.length==0){
14655return
14656}
14657DwtTabView.call(this,a,t,e)
14658};
14659ZmAttachTabView.prototype=new DwtTabView;
14660ZmAttachTabView.prototype.constructor=new ZmAttachTabView;
14661ZmAttachTabView.prototype.addTabChangeListener=function(e){
14662this._addTabChangeListener=e
14663};
14664ZmAttachTabView.prototype.switchToTab=function(a,t){
14665if(!t&&this._addTabChangeListener&&!this._addTabChangeListener.run()){
14666var e=this._tabBar.getButton(this.getCurrentTab());
14667e.setOpen();
14668e=this._tabBar.getButton(a);
14669e.setClosed();
14670return
14671}
14672DwtTabView.prototype.switchToTab.call(this,a)
14673};
14674ZmMyComputerTabViewPage=function(a,t,e){
14675if(arguments.length==0){
14676return
14677}
14678DwtTabViewPage.call(this,a,t,Dwt.STATIC_STYLE);
14679this.setScrollStyle(Dwt.SCROLL)
14680};
14681ZmMyComputerTabViewPage.prototype=new DwtTabViewPage;
14682ZmMyComputerTabViewPage.prototype.constructor=ZmMyComputerTabViewPage;
14683ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS=5;
14684ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS=10;
14685ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME="_attFile_";
14686ZmMyComputerTabViewPage.prototype.toString=function(){
14687return"ZmMyComputerTabViewPage"
14688};
14689ZmMyComputerTabViewPage.prototype.showMe=function(){
14690this.resetAttachments();
14691DwtTabViewPage.prototype.showMe.call(this);
14692this.setSize(Dwt.DEFAULT,"240");
14693this._focusAttEl()
14694};
14695ZmMyComputerTabViewPage.prototype.hideMe=function(){
14696DwtTabViewPage.prototype.hideMe.call(this)
14697};
14698ZmMyComputerTabViewPage.prototype._createHtml=function(){
14699var e={
14700id:this._htmlElId,uri:(appCtxt.get(ZmSetting.CSFE_ATTACHMENT_UPLOAD_URI)+"?fmt=extended")};
14701this._contentEl=this.getContentHtmlElement();
14702this._contentEl.innerHTML=AjxTemplate.expand("share.Dialogs#ZmAttachDialog-MyComputerTab",e);
14703this.attachmentTable=document.getElementById(this._htmlElId+"_attachmentTable");
14704this.uploadForm=document.getElementById(this._htmlElId+"_uploadForm");
14705this.attachmentButtonTable=document.getElementById(this._htmlElId+"_attachmentButtonTable");
14706this._addAttachmentFieldButton();
14707this._attachCount=0
14708};
14709ZmMyComputerTabViewPage.prototype._addAttachmentField=function(){
14710if(this._attachCount>=ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS){
14711return
14712}
14713this._attachCount++;
14714var h=this.attachmentTable.insertRow(-1);
14715var e=h.insertCell(-1);
14716var a=Dwt.getNextId();
14717var i={
14718id:a,uploadName:ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME};
14719e.innerHTML=AjxTemplate.expand("share.Dialogs#ZmAttachDialog-MyComputerTab-AddAttachment",i);
14720var o=document.getElementById(a+"_remove");
14721o.onclick=AjxCallback.simpleClosure(this._removeAttachmentField,this,h);
14722var t=a+"_input";
14723if(this._focusElId==-1){
14724this._focusElId=t
14725}
14726var s=document.getElementById(t);
14727var n=document.getElementById(a+"_size");
14728if(ZmAttachDialog.supportsHTML5){
14729Dwt.setHandler(s,"onchange",AjxCallback.simpleClosure(this._handleFileSize,this,s,n))
14730}
14731if(AjxEnv.isIE){
14732s.onkeydown=AjxCallback.simpleClosure(this._handleKeys,this)
14733}};
14734ZmMyComputerTabViewPage.prototype._handleFileSize=function(o,i){
14735var a=o.files;
14736if(!a){
14737return
14738}
14739var t=a[0];
14740var e=t.size||t.fileSize;
14741if(i){
14742i.innerHTML=" ("+AjxUtil.formatSize(e,true)+")";
14743if(e>appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)){
14744Dwt.addClass(i,"RedC")
14745}else{
14746Dwt.delClass(i,"RedC")
14747}}};
14748ZmMyComputerTabViewPage.prototype._removeAttachmentField=function(e){
14749this.attachmentTable.deleteRow(e.rowIndex);
14750this._attachCount--;
14751if(this._attachCount==0){
14752this._addAttachmentField()
14753}};
14754ZmMyComputerTabViewPage.prototype._addAttachmentFieldButton=function(){
14755var a=this.attachmentButtonTable.insertRow(-1);
14756var e=a.insertCell(-1);
14757var t=new DwtButton({
14758parent:this,parentElement:e}
14759);
14760t.setText(ZmMsg.addMoreAttachments);
14761t.addSelectionListener(new AjxListener(this,this._addAttachmentField))
14762};
14763ZmMyComputerTabViewPage.prototype.gotAttachments=function(){
14764var t=document.getElementsByName(ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME);
14765for(var e=0;
14766e<t.length;
14767e++){
14768if(t[e].value.length){
14769return true
14770}}
14771return false
14772};
14773ZmMyComputerTabViewPage.prototype.resetAttachments=function(){
14774this._cleanTable(this.attachmentTable);
14775this._attachCount=0;
14776if(ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS>ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS){
14777ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS=ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS
14778}
14779this._focusElId=-1;
14780var a=this.attachmentTable.insertRow(-1);
14781var e=a.insertCell(-1);
14782e.appendChild(document.createElement("br"));
14783e.appendChild(document.createElement("br"));
14784for(var t=0;
14785t<ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS;
14786t++){
14787this._addAttachmentField()
14788}
14789delete t
14790};
14791ZmMyComputerTabViewPage.prototype._focusAttEl=function(){
14792var e=document.getElementById(this._focusElId);
14793if(e){
14794e.focus()
14795}};
14796ZmMyComputerTabViewPage.prototype._cleanTable=function(e){
14797if(!e||!e.rows){
14798return
14799}
14800while(e.rows.length>0){
14801e.deleteRow(0)
14802}};
14803ZmMyComputerTabViewPage.prototype._handleKeys=function(t){
14804var e=DwtKeyEvent.getCharCode(t);
14805return(e!=DwtKeyEvent.KEY_ENTER&&e!=DwtKeyEvent.KEY_END_OF_TEXT)
14806};
14807ZmMyComputerTabViewPage.prototype._validateFileSize=function(){
14808var o=document.getElementsByName(ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME);
14809var a,t;
14810for(var e=0;
14811e<o.length;
14812e++){
14813a=o[e].files;
14814if(!a||a.length==0){
14815continue
14816}
14817a=a[0];
14818t=a.size||a.fileSize;
14819if(t>appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)){
14820return false
14821}}
14822return true
14823};
14824ZmMyComputerTabViewPage.prototype.validate=function(){
14825var e,t;
14826if(ZmAttachDialog.supportsHTML5){
14827e=this._validateFileSize();
14828t=AjxMessageFormat.format(ZmMsg.attachmentSizeError,AjxUtil.formatSize(appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)))
14829}else{
14830e=true
14831}
14832return{
14833status:e,error:t}
14834}
14835}
14836if(AjxPackage.define("zimbraMail.share.view.dialog.ZmLoginDialog")){
14837ZmLoginDialog=function(i,a){
14838a=a||"ZmLoginDialog";
14839DwtComposite.call(this,{
14840parent:i,className:a,posStyle:DwtControl.ABSOLUTE_STYLE}
14841);
14842this._origClassName=a;
14843this._xparentClassName=a+"-Transparent";
14844this.setBounds(0,0,"100%","100%");
14845var o=this.getHtmlElement();
14846o.style.zIndex=Dwt.Z_DIALOG+1;
14847o.className=a;
14848this.setVisible(false);
14849var n=ZLoginFactory.copyDefaultParams(ZmMsg);
14850n.showPanelBorder=true;
14851n.showForm=true;
14852n.showUserField=true;
14853n.showPasswordField=true;
14854n.showLicenseMsg=true;
14855n.showRememberMeCheckbox=false;
14856n.showLogOff=true;
14857n.logOffAction="ZmLoginDialog._loginDiffListener()";
14858n.loginAction="ZmLoginDialog._loginListener(this)";
14859n.showButton=true;
14860var t=[];
14861var e=0;
14862t[e++]="<table border=0 cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td align='center' valign='center'>";
14863t[e++]=ZLoginFactory.getLoginDialogHTML(n);
14864t[e++]="</td></tr></table>";
14865o.innerHTML=t.join("");
14866var s=ZLoginFactory.LOGIN_BUTTON_ID;
14867if(s&&DwtControl.ALL_BY_ID){
14868DwtControl.ALL_BY_ID[s]=this
14869}
14870this.setReloginMode(false)
14871};
14872ZmLoginDialog.prototype=new DwtComposite;
14873ZmLoginDialog.prototype.constructor=ZmLoginDialog;
14874ZmLoginDialog.prototype.toString=function(){
14875return"ZmLoginDialog"
14876};
14877ZmLoginDialog.prototype.registerCallback=function(t,a,e){
14878this._callback=new AjxCallback(a,t,e)
14879};
14880ZmLoginDialog.prototype.clearAll=function(){
14881ZLoginFactory.get(ZLoginFactory.USER_ID).value="";
14882ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value=""
14883};
14884ZmLoginDialog.prototype.clearPassword=function(){
14885ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value=""
14886};
14887ZmLoginDialog.prototype.setError=function(e){
14888if(e&&e.length){
14889ZLoginFactory.showErrorMsg(e)
14890}else{
14891ZLoginFactory.hideErrorMsg()
14892}};
14893ZmLoginDialog.prototype.setFocus=function(t,e){
14894ZLoginFactory.showUserField(t);
14895this.setReloginMode(t&&t.length&&e)
14896};
14897ZmLoginDialog.prototype.setVisible=function(a,e){
14898DwtComposite.prototype.setVisible.call(this,a);
14899var i=appCtxt.getKeyboardMgr();
14900if(i){
14901if(a){
14902if(i.isEnabled()){
14903i.enable(false);
14904this._kbnavDisabled=true
14905}}else{
14906if(this._kbnavDisabled){
14907i.enable(true);
14908this._kbnavDisabled=false
14909}}}
14910if(!a){
14911return
14912}
14913this.setCursor("default");
14914if((e==null||!e)&&this._className!=this._origClassName){
14915this.getHtmlElement().className=this._origClassName;
14916this._className=this._origClassName
14917}else{
14918if(e&&this._className!=this._xparentClassName){
14919this.getHtmlElement().className=this._xparentClassName;
14920this._className=this._xparentClassName
14921}}
14922Dwt.setHandler(this.getHtmlElement(),DwtEvent.ONKEYDOWN,ZLoginFactory.handleKeyPress);
14923var t=ZLoginFactory.get(ZLoginFactory.PASSWORD_ID);
14924if(t&&t.focus){
14925t.focus()
14926}};
14927ZmLoginDialog.prototype.addChild=function(t,e){
14928this._children.add(t)
14929};
14930ZmLoginDialog.prototype.setReloginMode=function(e){
14931e?ZLoginFactory.showLogOff():ZLoginFactory.hideLogOff();
14932ZLoginFactory.get(ZLoginFactory.USER_ID).disabled=e
14933};
14934ZmLoginDialog.prototype._loginSelListener=function(){
14935this.setCursor("wait");
14936var t=ZLoginFactory.get(ZLoginFactory.USER_ID).value;
14937if(!(t&&t.length)){
14938this.setError(ZmMsg.enterUsername);
14939return
14940}
14941if(this._callback){
14942var e=ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value;
14943this._callback.run(t,e,appCtxt.rememberMe)
14944}};
14945ZmLoginDialog._loginListener=function(a){
14946var t=a;
14947while(t){
14948var e=DwtControl.fromElement(t);
14949if(e instanceof ZmLoginDialog){
14950e._loginSelListener();
14951break
14952}
14953t=t.parentNode
14954}};
14955ZmLoginDialog._loginDiffListener=function(e){
14956ZmZimbraMail.logOff()
14957}
14958}
14959if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewOrganizerDialog")){
14960ZmNewOrganizerDialog=function(a,t,i,e){
14961if(arguments.length==0){
14962return
14963}
14964ZmDialog.call(this,{
14965parent:a,className:t,title:i}
14966);
14967this._organizerType=e;
14968this._setupControls()
14969};
14970ZmNewOrganizerDialog.prototype=new ZmDialog;
14971ZmNewOrganizerDialog.prototype.constructor=ZmNewOrganizerDialog;
14972ZmNewOrganizerDialog.prototype.toString=function(){
14973return"ZmNewOrganizerDialog"
14974};
14975ZmNewOrganizerDialog.prototype.popup=function(t,s){
14976if(this._folderTreeCellId){
14977var n={
14978overviewId:this.toString(),treeIds:this._treeIds,omit:this._omit,fieldId:this._folderTreeCellId,overviewTrees:[this._organizerType]};
14979this._setOverview(n);
14980if(this._folderTreeView){
14981this._folderTreeView.getHeaderItem().setVisible(true,true);
14982if(t){
14983if(t.nId==ZmOrganizer.ID_ROOT){
14984t=appCtxt.getFolderTree().root
14985}}else{
14986t=appCtxt.getFolderTree().root
14987}
14988var e=this._folderTreeView.getTreeItemById(t.id);
14989if(e){
14990this._folderTreeView.setSelection(e)
14991}
14992if(t.nId==ZmOrganizer.ID_ROOT){
14993var a=ZmOrganizer.getSystemId(t.id);
14994var e=this._folderTreeView.getTreeItemById(a);
14995if(e){
14996e.setExpanded(true)
14997}}}}
14998if(t&&(t.type!=ZmOrganizer.FOLDER)&&this._colorSelect){
14999var l=this._colorSelect.getMenu().getItem(0);
15000if(l.getText()==ZmOrganizer.COLOR_TEXT[0]){
15001this._colorSelect.getMenu().removeChild(l)
15002}}
15003var c=appCtxt.multiAccounts&&this._opc.getOverviewContainer(this.toString());
15004if(c){
15005if(!t||(t&&t.nId==ZmOrganizer.ID_ROOT)){
15006var h=s||appCtxt.getActiveAccount();
15007c.setSelection(c.getHeaderItem(h))
15008}else{
15009var o=appCtxt.getOverviewId(this.toString(),s);
15010var d=c.getOverview(o);
15011var i=d&&d.getTreeView(this._organizerType);
15012if(i){
15013c.deselectAll();
15014var e=i.getTreeItemById(t.id);
15015i.setSelection(e)
15016}}
15017c.expandAccountOnly(s)
15018}
15019ZmDialog.prototype.popup.call(this)
15020};
15021ZmNewOrganizerDialog.prototype.reset=function(e){
15022ZmDialog.prototype.reset.apply(this,arguments);
15023if(this._colorSelect){
15024this._initColorSelect(e)
15025}
15026if(this._remoteCheckboxField){
15027this._remoteCheckboxField.checked=false;
15028var t=document.getElementById(this._remoteCheckboxFieldId+"URLrow");
15029if(t){
15030t.style.display="none"
15031}}
15032if(this._urlField){
15033this._urlField.value=""
15034}
15035if(appCtxt.multiAccounts){
15036this._account=e
15037}else{
15038this._account=null
15039}};
15040ZmNewOrganizerDialog.prototype._getRemoteLabel=function(){
15041return ZmMsg.subscribeToFeed
15042};
15043ZmNewOrganizerDialog.prototype._initColorSelect=function(a){
15044var e=(this._colorSelect.getValue()+1)%ZmOrganizer.COLOR_CHOICES.length;
15045var t=this._colorSelect.getOptionWithValue(e);
15046this._colorSelect.setSelectedOption(t)
15047};
15048ZmNewOrganizerDialog.prototype._contentHtml=function(){
15049var t=[];
15050var e=0;
15051t[e++]="<table cellpadding=0 cellspacing=5 border=0";
15052t[e++]=(AjxEnv.isSafari)?" width='300'>":">";
15053e=this._createStandardContentHtml(t,e);
15054e=this._createExtraContentHtml(t,e);
15055t[e++]="</table>";
15056return t.join("")
15057};
15058ZmNewOrganizerDialog.prototype._createStandardContentHtml=function(t,e){
15059e=this._createNameContentHtml(t,e);
15060e=this._createColorContentHtml(t,e);
15061return e
15062};
15063ZmNewOrganizerDialog.prototype._createNameContentHtml=function(t,e){
15064this._nameFieldId=this._htmlElId+"_name";
15065t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogName",{
15066id:this._htmlElId}
15067);
15068return e
15069};
15070ZmNewOrganizerDialog.prototype._createColorContentHtml=function(t,e){
15071this._colorSelectId=this._htmlElId+"_colorSelect";
15072t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogColor",{
15073id:this._htmlElId}
15074);
15075return e
15076};
15077ZmNewOrganizerDialog.prototype._createExtraContentHtml=function(t,e){
15078e=this._createRemoteContentHtml(t,e);
15079e=this._createFolderContentHtml(t,e);
15080return e
15081};
15082ZmNewOrganizerDialog.prototype._createRemoteContentHtml=function(a,e){
15083this._remoteCheckboxFieldId=this._htmlElId+"_remote";
15084this._urlFieldId=this._htmlElId+"_url";
15085var t={
15086id:this._htmlElId,remoteLabel:this._getRemoteLabel()};
15087a[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogRemote",t);
15088return e
15089};
15090ZmNewOrganizerDialog.prototype._createFolderContentHtml=function(t,e){
15091this._folderTreeCellId=this._htmlElId+"_folderTree";
15092t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogFolder",{
15093id:this._htmlElId}
15094);
15095return e
15096};
15097ZmNewOrganizerDialog.prototype._setupControls=function(){
15098this._setupStandardControls();
15099this._setupExtraControls()
15100};
15101ZmNewOrganizerDialog.prototype._setupStandardControls=function(){
15102this._setupNameControl();
15103this._setupColorControl()
15104};
15105ZmNewOrganizerDialog.prototype._setupNameControl=function(){
15106this._setNameField(this._nameFieldId)
15107};
15108ZmNewOrganizerDialog.prototype._setupColorControl=function(){
15109this._colorSelect=new DwtSelect({
15110parent:this}
15111);
15112for(var t=0;
15113t<ZmOrganizer.COLOR_CHOICES.length;
15114t++){
15115var e=ZmOrganizer.COLOR_CHOICES[t];
15116this._colorSelect.addOption(e.label,t==0,e.value)
15117}
15118var a=document.getElementById(this._colorSelectId);
15119if(a){
15120a.appendChild(this._colorSelect.getHtmlElement())
15121}};
15122ZmNewOrganizerDialog.prototype._setupExtraControls=function(){
15123this._setupRemoteControl();
15124this._setupFolderControl()
15125};
15126ZmNewOrganizerDialog.prototype._setupRemoteControl=function(){
15127this._remoteCheckboxField=document.getElementById(this._remoteCheckboxFieldId);
15128if(this._remoteCheckboxField){
15129this._urlField=document.getElementById(this._remoteCheckboxFieldId+"URLfield");
15130Dwt.setHandler(this._remoteCheckboxField,DwtEvent.ONCLICK,this._handleCheckbox)
15131}};
15132ZmNewOrganizerDialog.prototype._setupFolderControl=function(){
15133if(!this._folderTreeCellId){
15134return
15135}
15136this._treeIds=[this._organizerType];
15137this._omit={};
15138this._omit[ZmFolder.ID_SPAM]=true;
15139this._omit[ZmFolder.ID_DRAFTS]=true;
15140this._omit[ZmFolder.ID_SYNC_FAILURES]=true;
15141this._omit[ZmFolder.ID_OUTBOX]=true;
15142var e=appCtxt.getFolderTree();
15143var t=e?e.getByName(ZmFolder.SYNC_ISSUES):null;
15144if(t){
15145this._omit[t.id]=true
15146}
15147this._omit[ZmOrganizer.ID_ZIMLET]=true
15148};
15149ZmNewOrganizerDialog.prototype._renderOverview=function(i,e,t,a){
15150this._setupFolderControl();
15151ZmDialog.prototype._renderOverview.apply(this,arguments);
15152this._folderTreeView=i.getTreeView(this._organizerType)
15153};
15154ZmNewOrganizerDialog.prototype._getFolderData=function(){
15155var i=appCtxt.multiAccounts?this._opc.getOverviewContainer(this.toString()):this._opc.getOverview(this._curOverviewId);
15156var s=i?i.getSelected():appCtxt.getFolderTree(this._account).root;
15157var a=AjxStringUtil.trim(this._nameField.value);
15158var n=ZmFolder.checkName(a,s);
15159if(!n&&s.hasChild(a)){
15160n=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[a])
15161}
15162var e=null;
15163if(!n&&this._colorSelectId){
15164e=this._colorSelect.getValue()
15165}
15166var t=null;
15167if(!n&&this._remoteCheckboxField){
15168t=this._remoteCheckboxField.checked?this._urlField.value:null;
15169if(t||t!=null){
15170n=ZmOrganizer.checkUrl(t)
15171}}
15172if(!n&&s.disallowSubFolder){
15173n=AjxMessageFormat.format(ZmMsg.errorSubFolderNotAllowed,s.name)
15174}
15175var o=appCtxt.multiAccounts?s.getAccount():null;
15176return(n?this._showError(n):{
15177l:s.id,name:a,color:e,url:t,account:o}
15178)
15179};
15180ZmNewOrganizerDialog.prototype._getTabGroupMembers=function(){
15181var e=[this._nameField];
15182if(this._colorSelect){
15183e.push(this._colorSelect)
15184}
15185if(this._overview[this._curOverviewId]){
15186e.push(this._overview[this._curOverviewId])
15187}
15188return e
15189};
15190ZmNewOrganizerDialog.prototype._okButtonListener=function(t){
15191var e=this._getFolderData();
15192if(e){
15193DwtDialog.prototype._buttonListener.call(this,t,e)
15194}};
15195ZmNewOrganizerDialog.prototype._enterListener=function(t){
15196var e=this._getFolderData();
15197if(e){
15198this._runEnterCallback(e)
15199}};
15200ZmNewOrganizerDialog.prototype._handleCheckbox=function(e){
15201e=e||window.event;
15202var a=DwtUiEvent.getTarget(e);
15203var t=document.getElementById(a.id+"URLrow");
15204var i=document.getElementById(a.id+"URLfield");
15205t.style.display=a.checked?(AjxEnv.isIE?"block":"table-row"):"none";
15206if(a.checked){
15207i.focus()
15208}}
15209}
15210if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewFolderDialog")){
15211ZmNewFolderDialog=function(a,t){
15212var i=ZmMsg.createNewFolder;
15213var e=ZmOrganizer.FOLDER;
15214ZmNewOrganizerDialog.call(this,a,t,i,e)
15215};
15216ZmNewFolderDialog.prototype=new ZmNewOrganizerDialog;
15217ZmNewFolderDialog.prototype.constructor=ZmNewFolderDialog;
15218ZmNewFolderDialog.prototype.toString=function(){
15219return"ZmNewFolderDialog"
15220};
15221ZmNewFolderDialog.prototype._createColorContentHtml=function(t,e){
15222return e
15223};
15224ZmNewFolderDialog.prototype._setupColorControl=function(){}
15225}
15226if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewSearchDialog")){
15227ZmNewSearchDialog=function(t,e){
15228ZmDialog.call(this,{
15229parent:t,className:e,title:ZmMsg.saveSearch}
15230);
15231this._omit={};
15232this._omit[ZmFolder.ID_SPAM]=true;
15233this._omit[ZmFolder.ID_DRAFTS]=true;
15234this._setNameField(this._nameFieldId)
15235};
15236ZmNewSearchDialog.prototype=new ZmDialog;
15237ZmNewSearchDialog.prototype.constructor=ZmNewSearchDialog;
15238ZmNewSearchDialog.prototype.toString=function(){
15239return"ZmNewSearchDialog"
15240};
15241ZmNewSearchDialog.prototype.popup=function(n){
15242var a=appCtxt.multiAccounts?appCtxt.getActiveAccount():null;
15243var o=this._curOverviewId=(a?([this.toString(),a.name].join("-")):this.toString());
15244var i={
15245account:a,treeIds:[ZmOrganizer.FOLDER,ZmOrganizer.SEARCH],fieldId:this._folderTreeCellId,omit:this._omit,overviewId:o};
15246var t=this._setOverview(i,true);
15247this._folderTreeView=t.getTreeView(ZmOrganizer.FOLDER);
15248this._searchTreeView=t.getTreeView(ZmOrganizer.SEARCH);
15249this._search=n.search;
15250this._searchTreeView.setSelected(appCtxt.getFolderTree(a).root,true);
15251this._isGlobalSearch=appCtxt.multiAccounts&&appCtxt.getSearchController().searchAllAccounts;
15252if(appCtxt.multiAccounts){
15253this._searchTreeView.setVisible(true);
15254this._makeOverviewVisible(o)
15255}
15256var e=document.getElementById(this._overviewDivId);
15257if(e){
15258Dwt.setVisible(e,(n.showOverview&&!this._isGlobalSearch))
15259}
15260ZmDialog.prototype.popup.call(this)
15261};
15262ZmNewSearchDialog.prototype._contentHtml=function(){
15263this._nameFieldId=this._htmlElId+"_nameField";
15264this._folderTreeCellId=this._htmlElId+"_folderTreeCell";
15265this._overviewDivId=this._htmlElId+"_overviewDiv";
15266return(AjxTemplate.expand("share.Dialogs#NewSearch",{
15267id:this._htmlElId}
15268))
15269};
15270ZmNewSearchDialog.prototype._okButtonListener=function(t){
15271var e=this._getSearchData();
15272if(e){
15273DwtDialog.prototype._buttonListener.call(this,t,e)
15274}};
15275ZmNewSearchDialog.prototype._getSearchData=function(){
15276var a=this._isGlobalSearch?appCtxt.getById(ZmOrganizer.ID_ROOT):this._overview[this._curOverviewId].getSelected();
15277var e=AjxStringUtil.trim(this._nameField.value);
15278var t=ZmFolder.checkName(e,a);
15279if(!t&&a.hasChild(e)){
15280t=ZmMsg.folderOrSearchNameExists
15281}
15282if(!t&&(a.id==ZmOrganizer.ID_ROOT)&&appCtxt.getFolderTree().root.hasChild(e)){
15283t=ZmMsg.folderOrSearchNameExists
15284}
15285if(t){
15286return this._showError(t)
15287}else{
15288return{
15289parent:a,isGlobal:this._isGlobalSearch,name:e,search:this._search}
15290}};
15291ZmNewSearchDialog.prototype._enterListener=function(t){
15292var e=this._getSearchData();
15293if(e){
15294this._runEnterCallback(e)
15295}};
15296ZmNewSearchDialog.prototype._getTabGroupMembers=function(){
15297var e=[this._nameField];
15298if(this._overview[this._curOverviewId]){
15299e.push(this._overview[this._curOverviewId])
15300}
15301return e
15302}
15303}
15304if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewTagDialog")){
15305ZmNewTagDialog=function(t,e){
15306ZmDialog.call(this,{
15307parent:t,className:e,title:ZmMsg.createNewTag}
15308);
15309this._setNameField(this._htmlElId+"_name");
15310this._setTagColorMenu();
15311this._setAccountMenu()
15312};
15313ZmNewTagDialog.prototype=new ZmDialog;
15314ZmNewTagDialog.prototype.constructor=ZmNewTagDialog;
15315ZmNewTagDialog.prototype.toString=function(){
15316return"ZmNewTagDialog"
15317};
15318ZmNewTagDialog.prototype.popup=function(a,e){
15319if(this._accountSelect){
15320var t=e||appCtxt.getActiveAccount();
15321this._accountSelect.setSelectedValue(t.id)
15322}
15323ZmDialog.prototype.popup.call(this)
15324};
15325ZmNewTagDialog.prototype.cleanup=function(e){
15326DwtDialog.prototype.cleanup.call(this,e);
15327var t=this._getNextColor();
15328this._setColorButton(t,ZmOrganizer.COLOR_TEXT[t],ZmTag.COLOR_ICON[t])
15329};
15330ZmNewTagDialog.prototype._colorListener=function(t){
15331var e=t.item.getData(ZmOperation.MENUITEM_ID);
15332this._setColorButton(e,ZmOrganizer.COLOR_TEXT[e],ZmTag.COLOR_ICON[e])
15333};
15334ZmNewTagDialog.prototype._setTagColorMenu=function(){
15335var a=this._htmlElId+"_tagColor";
15336this._colorButton=new DwtButton({
15337parent:this,parentElement:a,id:"ZmTagColorMenu"}
15338);
15339this._colorButton.noMenuBar=true;
15340ZmOperation.addColorMenu(this._colorButton);
15341var t=ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG];
15342this._setColorButton(t,ZmOrganizer.COLOR_TEXT[t],ZmTag.COLOR_ICON[t]);
15343this._tagColorListener=new AjxListener(this,this._colorListener);
15344var e=this._colorButton.getMenu().getItems();
15345for(var o=0;
15346o<e.length;
15347o++){
15348e[o].addSelectionListener(this._tagColorListener)
15349}};
15350ZmNewTagDialog.prototype._setAccountMenu=function(){
15351if(!appCtxt.multiAccounts){
15352return
15353}
15354var e=this._htmlElId+"_account";
15355this._accountSelect=new DwtSelect({
15356parent:this,parentElement:e}
15357);
15358var a=appCtxt.accountList.visibleAccounts;
15359for(var t=0;
15360t<a.length;
15361t++){
15362var s=a[t];
15363if(appCtxt.get(ZmSetting.TAGGING_ENABLED,null,s)){
15364var n=new DwtSelectOption(s.id,null,s.getDisplayName(),null,null,s.getIcon());
15365this._accountSelect.addOption(n)
15366}}};
15367ZmNewTagDialog.prototype._setColorButton=function(e,a,t){
15368this._colorButton.setData(ZmOperation.MENUITEM_ID,e);
15369this._colorButton.setText(a);
15370this._colorButton.setImage(t)
15371};
15372ZmNewTagDialog.prototype._contentHtml=function(){
15373return AjxTemplate.expand("share.Dialogs#ZmPromptDialog",{
15374id:this._htmlElId}
15375)
15376};
15377ZmNewTagDialog.prototype._okButtonListener=function(t){
15378var e=this._getTagData();
15379if(e){
15380DwtDialog.prototype._buttonListener.call(this,t,e)
15381}};
15382ZmNewTagDialog.prototype._getTagData=function(){
15383var a=this._accountSelect&&this._accountSelect.getValue();
15384var i=a&&appCtxt.accountList.getAccount(a);
15385var t=AjxStringUtil.trim(this._nameField.value);
15386var o=ZmTag.checkName(t);
15387var e=appCtxt.getTagTree(i);
15388if(!o&&e&&e.getByName(t)){
15389o=ZmMsg.tagNameExists
15390}
15391return(o)?this._showError(o):{
15392name:t,color:this._colorButton.getData(ZmOperation.MENUITEM_ID),accountName:(i&&i.name)}
15393};
15394ZmNewTagDialog.prototype._enterListener=function(t){
15395var e=this._getTagData();
15396if(e){
15397this._runEnterCallback(e)
15398}};
15399ZmNewTagDialog.prototype._getNextColor=function(){
15400var a={};
15401var e=appCtxt.getTagTree();
15402if(!e){
15403return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
15404}
15405var o=e.root.children.getArray();
15406if(!(o&&o.length)){
15407return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
15408}
15409for(var n=0;
15410n<o.length;
15411n++){
15412a[o[n].color]=true
15413}
15414for(var n=0;
15415n<ZmTagTree.COLOR_LIST.length;
15416n++){
15417var t=ZmTagTree.COLOR_LIST[n];
15418if(!a[t]){
15419return t
15420}}
15421return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
15422};
15423ZmNewTagDialog.prototype._getTabGroupMembers=function(){
15424return[this._nameField,this._colorButton]
15425}
15426}
15427if(AjxPackage.define("zimbraMail.share.view.dialog.ZmFolderPropsDialog")){
15428ZmFolderPropsDialog=function(a,t){
15429t=t||"ZmFolderPropsDialog";
15430var i;
15431if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
15432i=[new DwtDialog_ButtonDescriptor(ZmFolderPropsDialog.ADD_SHARE_BUTTON,ZmMsg.addShare,DwtDialog.ALIGN_LEFT)]
15433}
15434DwtDialog.call(this,{
15435parent:a,className:t,title:ZmMsg.folderProperties,extraButtons:i}
15436);
15437if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
15438this.registerCallback(ZmFolderPropsDialog.ADD_SHARE_BUTTON,this._handleAddShareButton,this)
15439}
15440this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
15441this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,this._handleCancelButton));
15442this._folderChangeListener=new AjxListener(this,this._handleFolderChange);
15443var e=this._createView();
15444this.setView(e)
15445};
15446ZmFolderPropsDialog.prototype=new DwtDialog;
15447ZmFolderPropsDialog.prototype.constructor=ZmFolderPropsDialog;
15448ZmFolderPropsDialog.ADD_SHARE_BUTTON=++DwtDialog.LAST_BUTTON;
15449ZmFolderPropsDialog.SHARES_HEIGHT="9em";
15450ZmFolderPropsDialog.prototype.toString=function(){
15451return"ZmFolderPropsDialog"
15452};
15453ZmFolderPropsDialog.prototype.popup=function(t){
15454this._organizer=t;
15455t.addChangeListener(this._folderChangeListener);
15456if(this._color&&t.type!=ZmOrganizer.FOLDER&&t.type!=ZmOrganizer.TASKS&&t.type!=ZmOrganizer.ADDRBOOK){
15457this._color.clearOptions();
15458for(var o=1;
15459o<ZmOrganizer.COLOR_CHOICES.length;
15460o++){
15461var a=ZmOrganizer.COLOR_CHOICES[o];
15462this._color.addOption(a.label,false,a.value)
15463}}else{
15464this._color.clearOptions();
15465for(var o=0;
15466o<ZmOrganizer.COLOR_CHOICES.length;
15467o++){
15468var a=ZmOrganizer.COLOR_CHOICES[o];
15469this._color.addOption(a.label,false,a.value)
15470}}
15471this._handleFolderChange();
15472if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
15473var e=(!t.link||t.isAdmin());
15474this.setButtonVisible(ZmFolderPropsDialog.ADD_SHARE_BUTTON,e)
15475}
15476DwtDialog.prototype.popup.call(this);
15477if(this._nameInputEl.style.display!="none"){
15478this._nameInputEl.focus()
15479}};
15480ZmFolderPropsDialog.prototype.popdown=function(){
15481if(this._organizer){
15482this._organizer.removeChangeListener(this._folderChangeListener);
15483this._organizer=null
15484}
15485DwtDialog.prototype.popdown.call(this)
15486};
15487ZmFolderPropsDialog.prototype._getSeparatorTemplate=function(){
15488return""
15489};
15490ZmFolderPropsDialog.prototype._handleEditShare=function(a,t){
15491t=t||Dwt.getObjectFromElement(DwtUiEvent.getTarget(a));
15492var e=appCtxt.getSharePropsDialog();
15493e.popup(ZmSharePropsDialog.EDIT,t.object,t);
15494return false
15495};
15496ZmFolderPropsDialog.prototype._handleRevokeShare=function(a,t){
15497t=t||Dwt.getObjectFromElement(DwtUiEvent.getTarget(a));
15498var e=appCtxt.getRevokeShareDialog();
15499e.popup(t);
15500return false
15501};
15502ZmFolderPropsDialog.prototype._handleResendShare=function(o,i){
15503AjxDispatcher.require("Share");
15504i=i||Dwt.getObjectFromElement(DwtUiEvent.getTarget(o));
15505var e=new ZmShare({
15506object:i.object}
15507);
15508e.grantee.id=i.grantee.id;
15509e.grantee.email=(i.grantee.type=="guest")?i.grantee.id:i.grantee.name;
15510e.grantee.name=i.grantee.name;
15511if(e.object.isRemote()){
15512e.grantor.id=e.object.zid;
15513e.grantor.email=e.object.owner;
15514e.grantor.name=e.grantor.email;
15515e.link.id=e.object.rid
15516}else{
15517e.grantor.id=appCtxt.get(ZmSetting.USERID);
15518e.grantor.email=appCtxt.get(ZmSetting.USERNAME);
15519e.grantor.name=appCtxt.get(ZmSetting.DISPLAY_NAME)||e.grantor.email;
15520e.link.id=e.object.id
15521}
15522e.link.name=i.object.name;
15523e.link.view=ZmOrganizer.getViewName(i.object.type);
15524e.link.perm=i.link.perm;
15525if(i.grantee.type=="guest"){
15526if(!this._guestFormatter){
15527this._guestFormatter=new AjxMessageFormat(ZmMsg.shareWithGuestNotes)
15528}
15529var a=i.object.getRestUrl();
15530var n=e.grantee.email;
15531var t=i.link.pw;
15532if(t&&n){
15533e.notes=this._guestFormatter.format([a,n,t])
15534}}
15535e.sendMessage(ZmShare.NEW);
15536appCtxt.setStatusMsg(ZmMsg.resentShareMessage);
15537return false
15538};
15539ZmFolderPropsDialog.prototype._handleAddShareButton=function(t){
15540var e=appCtxt.getSharePropsDialog();
15541e.popup(ZmSharePropsDialog.NEW,this._organizer,null)
15542};
15543ZmFolderPropsDialog.prototype._handleOkButton=function(a){
15544if(!this._handleErrorCallback){
15545this._handleErrorCallback=new AjxCallback(this,this._handleError);
15546this._handleRenameErrorCallback=new AjxCallback(this,this._handleRenameError)
15547}
15548var i=new AjxCallback(this,this._handleColor);
15549var e=this._organizer;
15550if(!e.isSystem()&&!e.isDataSource()){
15551var t=this._nameInputEl.value;
15552if(e.name!=t){
15553e.rename(t,i,this._handleRenameErrorCallback);
15554return
15555}}
15556i.run(null)
15557};
15558ZmFolderPropsDialog.prototype._handleColor=function(a){
15559var i=new AjxCallback(this,this._handleFreeBusy);
15560var e=this._organizer;
15561var t=this._color.getValue();
15562if(e.color!=t){
15563e.setColor(t,i,this._handleErrorCallback);
15564return
15565}
15566i.run(a)
15567};
15568ZmFolderPropsDialog.prototype._handleFreeBusy=function(t){
15569var i=new AjxCallback(this,this.popdown);
15570var e=this._organizer;
15571if(Dwt.getVisible(this._excludeFbEl)&&e.setFreeBusy){
15572var a=this._excludeFbCheckbox.checked;
15573if(e.excludeFreeBusy!=a){
15574e.setFreeBusy(a,i,this._handleErrorCallback);
15575return
15576}}
15577i.run(t)
15578};
15579ZmFolderPropsDialog.prototype._handleError=function(e){};
15580ZmFolderPropsDialog.prototype._handleRenameError=function(e){
15581var a=this._nameInputEl.value;
15582var i,t;
15583if(e.code==ZmCsfeException.MAIL_ALREADY_EXISTS){
15584i=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[a])
15585}else{
15586if(e.code==ZmCsfeException.MAIL_IMMUTABLE){
15587i=AjxMessageFormat.format(ZmMsg.errorCannotRename,[a])
15588}else{
15589if(e.code==ZmCsfeException.SVC_INVALID_REQUEST){
15590i=e.msg
15591}}}
15592appCtxt.getAppController().popupErrorDialog(i,e.msg,null,true);
15593return true
15594};
15595ZmFolderPropsDialog.prototype._handleCancelButton=function(e){
15596this.popdown()
15597};
15598ZmFolderPropsDialog.prototype._handleFolderChange=function(i){
15599var t=this._organizer;
15600if(t.isSystem()||t.isDataSource()){
15601this._nameOutputEl.innerHTML=AjxStringUtil.htmlEncode(t.name);
15602this._nameOutputEl.style.display="block";
15603this._nameInputEl.style.display="none"
15604}else{
15605this._nameInputEl.value=t.name;
15606this._nameInputEl.style.display="block";
15607this._nameOutputEl.style.display="none"
15608}
15609this._ownerEl.innerHTML=AjxStringUtil.htmlEncode(t.owner);
15610this._typeEl.innerHTML=ZmMsg[ZmOrganizer.FOLDER_KEY[t.type]]||ZmMsg.folder;
15611this._urlEl.innerHTML=t.url||"";
15612if(this._color){
15613this._color.setSelectedValue(t.color);
15614var e=(t.type!=ZmOrganizer.FOLDER||(t.type==ZmOrganizer.FOLDER&&appCtxt.get(ZmSetting.MAIL_FOLDER_COLORS_ENABLED)));
15615this._props.setPropertyVisible(this._colorId,e)
15616}
15617this._excludeFbCheckbox.checked=t.excludeFreeBusy;
15618var n=t.isMountpoint;
15619if(n){
15620AjxDispatcher.require("Share");
15621var a=ZmShare.getShareFromLink(t);
15622var o=a&&a.link&&a.link.role;
15623this._permEl.innerHTML=ZmShare.getRoleActions(o)
15624}
15625if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
15626this._populateShares(t)
15627}
15628this._props.setPropertyVisible(this._ownerId,t.owner!=null);
15629this._props.setPropertyVisible(this._urlId,t.url);
15630this._props.setPropertyVisible(this._permId,n);
15631Dwt.setVisible(this._excludeFbEl,!t.link&&(t.type==ZmOrganizer.CALENDAR))
15632};
15633ZmFolderPropsDialog.prototype._populateShares=function(e){
15634this._sharesGroup.setContent("");
15635var s=this._getDisplayShares(e);
15636var a=false;
15637if(s.length){
15638for(var t=0;
15639t<s.length;
15640t++){
15641var o=s[t];
15642if(!(o.grantee&&o.grantee.name)){
15643a=true
15644}}}
15645if(a){
15646var n=new AjxCallback(this,this._handleResponseGetFolder,[s]);
15647e.getFolder(n)
15648}else{
15649this._handleResponseGetFolder(s)
15650}
15651this._sharesGroup.setVisible(s.length>0)
15652};
15653ZmFolderPropsDialog.prototype._getDisplayShares=function(e){
15654var a=e.shares;
15655var h=[];
15656if((!e.link||e.isAdmin())&&a&&a.length>0){
15657AjxDispatcher.require("Share");
15658var s=appCtxt.accountList.mainAccount.id;
15659for(var t=0;
15660t<a.length;
15661t++){
15662var o=a[t];
15663if(o.grantee){
15664var n=o.grantee.id;
15665if((o.grantee.type!=ZmShare.TYPE_USER)||(o.grantee.id!=s)){
15666h.push(o)
15667}}}}
15668return h
15669};
15670ZmFolderPropsDialog.prototype._handleResponseGetFolder=function(c,h){
15671if(h){
15672c=this._getDisplayShares(h)
15673}
15674if(c.length){
15675var u=document.createElement("TABLE");
15676u.border=0;
15677u.cellSpacing=0;
15678u.cellPadding=3;
15679for(var n=0;
15680n<c.length;
15681n++){
15682var d=c[n];
15683var m=u.insertRow(-1);
15684var t=m.insertCell(-1);
15685t.style.paddingRight="15px";
15686var s=d.grantee&&d.grantee.name;
15687if(d.isAll()){
15688s=ZmMsg.shareWithAll
15689}else{
15690if(d.isPublic()){
15691s=ZmMsg.shareWithPublic
15692}else{
15693if(d.isGuest()){
15694s=s||(d.grantee&&d.grantee.id)
15695}}}
15696t.innerHTML=AjxStringUtil.htmlEncode(s);
15697var o=m.insertCell(-1);
15698o.style.paddingRight="15px";
15699o.innerHTML=ZmShare.getRoleName(d.link.role);
15700this.__createCmdCells(m,d)
15701}
15702this._sharesGroup.setElement(u);
15703var e=Dwt.DEFAULT;
15704var l=c.length>5?ZmFolderPropsDialog.SHARES_HEIGHT:Dwt.CLEAR;
15705var a=this._sharesGroup.getInsetHtmlElement();
15706Dwt.setScrollStyle(a,Dwt.SCROLL);
15707Dwt.setSize(a,e,l)
15708}
15709this._sharesGroup.setVisible(c.length>0)
15710};
15711ZmFolderPropsDialog.prototype.__createCmdCells=function(d,c){
15712var s=c.grantee.type;
15713if(s==ZmShare.TYPE_DOMAIN||!c.link.role){
15714var l=d.insertCell(-1);
15715l.colSpan=3;
15716l.innerHTML=ZmMsg.configureWithAdmin;
15717return
15718}
15719var a=[ZmShare.EDIT,ZmShare.REVOKE,ZmShare.RESEND];
15720var e=[this._handleEditShare,this._handleRevokeShare,this._handleResendShare];
15721for(var o=0;
15722o<a.length;
15723o++){
15724var t=a[o];
15725var l=d.insertCell(-1);
15726var n=c.grantee&&(c.grantee.type==ZmShare.TYPE_ALL);
15727if((n||c.isPublic())&&(t==ZmShare.EDIT||t==ZmShare.RESEND)){
15728continue
15729}
15730var h=document.createElement("A");
15731h.href="#";
15732h.innerHTML=ZmShare.ACTION_LABEL[t];
15733Dwt.setHandler(h,DwtEvent.ONCLICK,e[o]);
15734Dwt.associateElementWithObject(h,c);
15735l.appendChild(h)
15736}};
15737ZmFolderPropsDialog.prototype._createView=function(){
15738var t=new DwtComposite(this);
15739this._nameOutputEl=document.createElement("SPAN");
15740this._nameInputEl=document.createElement("INPUT");
15741this._nameInputEl.style.width="20em";
15742this._nameInputEl._dialog=this;
15743var l=this._nameInputEl;
15744this._ownerEl=document.createElement("DIV");
15745this._typeEl=document.createElement("DIV");
15746this._urlEl=document.createElement("DIV");
15747this._permEl=document.createElement("DIV");
15748var n=document.createElement("DIV");
15749n.appendChild(this._nameOutputEl);
15750n.appendChild(l);
15751this._excludeFbCheckbox=document.createElement("INPUT");
15752this._excludeFbCheckbox.type="checkbox";
15753this._excludeFbCheckbox._dialog=this;
15754this._excludeFbEl=document.createElement("DIV");
15755this._excludeFbEl.style.display="none";
15756this._excludeFbEl.appendChild(this._excludeFbCheckbox);
15757this._excludeFbEl.appendChild(document.createTextNode(ZmMsg.excludeFromFreeBusy));
15758var o=new DwtGrouper(t);
15759o.setLabel(ZmMsg.properties);
15760this._props=new DwtPropertySheet(o);
15761this._color=new DwtSelect({
15762parent:this._props}
15763);
15764for(var h=0;
15765h<ZmOrganizer.COLOR_CHOICES.length;
15766h++){
15767var a=ZmOrganizer.COLOR_CHOICES[h];
15768this._color.addOption(a.label,false,a.value)
15769}
15770this._props.addProperty(ZmMsg.nameLabel,n);
15771this._props.addProperty(ZmMsg.typeLabel,this._typeEl);
15772this._ownerId=this._props.addProperty(ZmMsg.ownerLabel,this._ownerEl);
15773this._urlId=this._props.addProperty(ZmMsg.urlLabel,this._urlEl);
15774this._permId=this._props.addProperty(ZmMsg.permissions,this._permEl);
15775this._colorId=this._props.addProperty(ZmMsg.colorLabel,this._color);
15776var e=document.createElement("DIV");
15777e.appendChild(this._props.getHtmlElement());
15778e.appendChild(this._excludeFbEl);
15779o.setElement(e);
15780if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
15781this._sharesGroup=new DwtGrouper(t);
15782this._sharesGroup.setLabel(ZmMsg.folderSharing);
15783this._sharesGroup.setVisible(false);
15784this._sharesGroup.setScrollStyle(Dwt.SCROLL)
15785}
15786var s=t.getHtmlElement();
15787s.appendChild(o.getHtmlElement());
15788if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
15789s.appendChild(this._sharesGroup.getHtmlElement())
15790}
15791return t
15792}
15793}
15794if(AjxPackage.define("zimbraMail.share.view.dialog.ZmQuickAddDialog")){
15795ZmQuickAddDialog=function(t,o,e,a,i){
15796if(arguments.length==0){
15797return
15798}
15799DwtDialog.call(this,{
15800parent:t,title:o,standardButtons:e,extraButtons:a,loc:i}
15801)
15802};
15803ZmQuickAddDialog.prototype=new DwtDialog;
15804ZmQuickAddDialog.prototype.constructor=ZmQuickAddDialog;
15805ZmQuickAddDialog.prototype.toString=function(){
15806return"ZmQuickAddDialog"
15807};
15808ZmQuickAddDialog.prototype.TEMPLATE="dwt.Widgets#DwtSemiModalDialog";
15809ZmQuickAddDialog.prototype.addSelectionListener=function(e,t){
15810this._button[e].addSelectionListener(t)
15811}
15812}
15813if(AjxPackage.define("zimbraMail.core.ZmNewWindow")){
15814ZmNewWindow=function(){
15815ZmController.call(this,null);
15816appCtxt.setAppController(this);
15817this._settings=appCtxt.getSettings();
15818this._shell=appCtxt.getShell();
15819this._kbMgr=appCtxt.getKeyboardMgr();
15820if(appCtxt.get(ZmSetting.USE_KEYBOARD_SHORTCUTS)){
15821this._kbMgr.enable(true);
15822this._kbMgr.registerKeyMap(new ZmKeyMap());
15823this._kbMgr.pushDefaultHandler(this)
15824}
15825this._apps={}
15826};
15827ZmNewWindow.prototype=new ZmController;
15828ZmNewWindow.prototype.constructor=ZmNewWindow;
15829ZmNewWindow.prototype.toString=function(){
15830return"ZmNewWindow"
15831};
15832ZmNewWindow.run=function(){
15833AjxDispatcher.setLoaded("MailCore",true);
15834AjxDispatcher.setLoaded("Mail",true);
15835var a=window.opener||window;
15836if(!window.parentController){
15837window.parentController=a._zimbraMail
15838}
15839window.appCtxt=new ZmAppCtxt();
15840window.appCtxt.isChildWindow=true;
15841window.parentAppCtxt=a.appCtxt;
15842appCtxt.setSettings(parentAppCtxt.getSettings());
15843appCtxt.isOffline=parentAppCtxt.isOffline;
15844appCtxt.multiAccounts=parentAppCtxt.multiAccounts;
15845window.ZmSetting=a.ZmSetting;
15846ZmOperation.initialize();
15847ZmApp.initialize();
15848var e=new DwtShell({
15849className:"MainShell"}
15850);
15851window.onbeforeunload=ZmNewWindow._confirmExitMethod;
15852appCtxt.setShell(e);
15853var t=new ZmNewWindow();
15854t.startup()
15855};
15856ZmNewWindow.unload=function(e){
15857if(!window.opener||!window.parentController){
15858return
15859}
15860if(window.command=="compose"||window.command=="composeDetach"){
15861var a=AjxDispatcher.run("GetComposeController",appCtxt.composeCtlrSessionId);
15862if(a){
15863a.dispose()
15864}}else{
15865if(window.command=="msgViewDetach"){
15866var t=AjxDispatcher.run("GetMsgController",appCtxt.msgCtlrSessionId);
15867if(t){
15868t.dispose()
15869}}}
15870if(window.parentController){
15871window.parentController.removeChildWindow(window)
15872}};
15873ZmNewWindow.prototype.startup=function(){
15874if(window.parentController){
15875var h=window.parentController.getChildWindow(window);
15876if(h){
15877window.newWindowCommand=h.command;
15878window.newWindowParams=h.params
15879}}
15880var o=window.newWindowCommand;
15881var s=window.newWindowParams;
15882if(o=="shortcuts"){
15883var e={};
15884e[ZmApp.PREFERENCES]=true;
15885this._createEnabledApps(e);
15886this._createView();
15887return
15888}
15889if(!this._appViewMgr){
15890this._appViewMgr=new ZmAppViewMgr(this._shell,this,true,false);
15891this._statusView=new ZmStatusView(this._shell,"ZmStatus",Dwt.ABSOLUTE_STYLE,ZmId.STATUS_VIEW)
15892}
15893var m=appCtxt.getRootTabGroup();
15894var e={};
15895e[ZmApp.MAIL]=true;
15896e[ZmApp.CONTACTS]=true;
15897var i=(o=="msgViewDetach")?s.msg:null;
15898if(i&&i.isInvite()){
15899e[ZmApp.CALENDAR]=true
15900}
15901e[ZmApp.PREFERENCES]=true;
15902e[ZmApp.BRIEFCASE]=true;
15903this._createEnabledApps(e);
15904var c=parentAppCtxt.getApp(ZmApp.MAIL);
15905appCtxt.getApp(ZmApp.MAIL)._identityCollection=c.getIdentityCollection();
15906var d;
15907if(o=="compose"||o=="composeDetach"){
15908d="compose-window"
15909}else{
15910if(o=="msgViewDetach"){
15911d="view-window"
15912}}
15913if(d){
15914var l=parentAppCtxt.get(ZmSetting.ZIMLETS);
15915l=l||[];
15916var u=this._settings._getCheckedZimlets(l);
15917if(this._hasZimletsForTarget(u,d)){
15918var a=appCtxt.getZimletMgr();
15919var n=this._getUserProps();
15920var t=new AjxCallback(this,this._createView);
15921appCtxt.setZimletsPresent(true);
15922a.loadZimlets(u,n,d,t,true);
15923return
15924}}
15925this._createView()
15926};
15927ZmNewWindow.prototype._createView=function(){
15928var o=window.newWindowCommand;
15929var n=window.newWindowParams;
15930var l=appCtxt.getRootTabGroup();
15931var a;
15932if(o=="compose"||o=="composeDetach"){
15933var i=AjxDispatcher.run("GetComposeController");
15934appCtxt.composeCtlrSessionId=i.sessionId;
15935if(n.action==ZmOperation.REPLY_ALL){
15936n.msg=this._deepCopyMsg(n.msg)
15937}
15938if(o=="compose"){
15939i._setView(n)
15940}else{
15941var h=n.action||ZmOperation.NEW_MESSAGE;
15942if(n.msg&&n.msg._mode){
15943switch(n.msg._mode){
15944case ZmAppt.MODE_DELETE:case ZmAppt.MODE_DELETE_INSTANCE:case ZmAppt.MODE_DELETE_SERIES:h=ZmOperation.REPLY_CANCEL;
15945break
15946}}
15947n.action=h;
15948i._setView(n);
15949i._composeView.setDetach(n);
15950var c=window.parentController.getApp(ZmApp.MAIL).getComposeController(n.sessionId);
15951if(c&&c._composeView){
15952c._composeView.reset(true);
15953c._app.popView(true)
15954}}
15955i._setComposeTabGroup();
15956l.addMember(i.getTabGroup());
15957a=i._getDefaultFocusItem();
15958target="compose-window"
15959}else{
15960if(o=="msgViewDetach"){
15961var s=AjxDispatcher.run("GetMsgController");
15962appCtxt.msgCtlrSessionId=s.sessionId;
15963s.show(n.msg,n.mode);
15964l.addMember(s.getTabGroup());
15965a=s.getCurrentView();
15966target="view-window"
15967}else{
15968if(o=="shortcuts"){
15969var e=appCtxt.getShortcutsPanel();
15970e.popup(n.cols)
15971}}}
15972var t=appCtxt.getKeyboardMgr();
15973t.setTabGroup(l);
15974t.grabFocus(a)
15975};
15976ZmNewWindow.prototype._hasZimletsForTarget=function(t,o){
15977var s=new RegExp("\\b"+o+"\\b");
15978for(var a=0;
15979a<t.length;
15980a++){
15981var e=t[a];
15982var n=e.zimlet[0];
15983if(s.test(n.target||"main")){
15984return true
15985}}
15986return false
15987};
15988ZmNewWindow.prototype._getUserProps=function(){
15989var s=parentAppCtxt.get(ZmSetting.USER_PROPS);
15990s=s?[].concat(s):[];
15991var e=parentAppCtxt.getZimletMgr().getZimletsHash();
15992var h=parentAppCtxt.get(ZmSetting.ZIMLETS);
15993for(var o=0;
15994o<h.length;
15995o++){
15996var n=h[o].zimlet[0].name;
15997var t=e[n];
15998if(!t||!t.userProperties){
15999continue
16000}
16001for(var a=0;
16002a<t.userProperties.length;
16003a++){
16004var c=t.userProperties[a];
16005var l={
16006zimlet:n,name:c.name,_content:c.value};
16007s.push(l)
16008}}
16009return s
16010};
16011ZmNewWindow.prototype.cancelRequest=function(a,e,t){
16012return window.parentController?window.parentController.cancelRequest(a,e,t):null
16013};
16014ZmNewWindow.prototype.sendRequest=function(e){
16015window.onbeforeunload=null;
16016e.errorCallback=new AjxCallback(this,this._handleException,[(e.errorCallback||null)]);
16017return window.parentController?window.parentController.sendRequest(e):null
16018};
16019ZmNewWindow.prototype._handleException=function(e,t){
16020var a=false;
16021if(e){
16022a=e.run(t)
16023}
16024if(!a){
16025ZmController.prototype._handleException.apply(this,[t])
16026}
16027return true
16028};
16029ZmNewWindow.prototype.popupErrorDialog=function(o,a,t,s){
16030var i;
16031if(a instanceof Object||typeof a=="object"){
16032var e=[];
16033a.msg=a.msg||o;
16034for(var n in a){
16035if(typeof a[n]=="function"||(typeof a[n]=="object"&&a[n].apply&&a[n].call)){
16036continue
16037}
16038e.push([n,": ",a[n],"<br/>\n"].join(""))
16039}
16040i=e.join("")
16041}
16042ZmController.prototype.popupErrorDialog.call(this,o,(i||a),t,s)
16043};
16044ZmNewWindow.prototype.setStatusMsg=function(e){
16045e=Dwt.getParams(arguments,ZmStatusView.MSG_PARAMS);
16046this._statusView.setStatusMsg(e)
16047};
16048ZmNewWindow.prototype.getApp=function(e){
16049if(!this._apps[e]){
16050this._createApp(e)
16051}
16052return this._apps[e]
16053};
16054ZmNewWindow.prototype.getAppViewMgr=function(){
16055return this._appViewMgr
16056};
16057ZmNewWindow.prototype.setActiveApp=function(){};
16058ZmNewWindow.prototype.getKeyMapMgr=function(){
16059return this._kbMgr
16060};
16061ZmNewWindow.prototype.getKeyMapName=function(){
16062var e=appCtxt.getCurrentController();
16063if(e&&e.getKeyMapName){
16064return e.getKeyMapName()
16065}
16066return"Global"
16067};
16068ZmNewWindow.prototype.handleKeyAction=function(t,a){
16069var e=appCtxt.getCurrentController();
16070if(e&&e.handleKeyAction){
16071return e.handleKeyAction(t,a)
16072}
16073return false
16074};
16075ZmNewWindow.prototype._createEnabledApps=function(a){
16076for(var o in ZmApp.CLASS){
16077if(!a||a[o]){
16078ZmApp.APPS.push(o)
16079}}
16080ZmApp.APPS.sort(function(n,i){
16081return ZmZimbraMail.hashSortCompare(ZmApp.LOAD_SORT,n,i)
16082}
16083);
16084for(var e=0;
16085e<ZmApp.APPS.length;
16086e++){
16087var o=ZmApp.APPS[e];
16088if(o!=ZmApp.IM){
16089var t=ZmApp.SETTING[o];
16090if(!t||appCtxt.get(t)){
16091this._createApp(o)
16092}}}};
16093ZmNewWindow.prototype._createApp=function(appName){
16094if(this._apps[appName]){
16095return
16096}
16097var appClass=eval(ZmApp.CLASS[appName]);
16098this._apps[appName]=new appClass(this._shell,window.parentController)
16099};
16100ZmNewWindow.prototype._deepCopyMsg=function(o){
16101var e=null;
16102var d=o.list.search;
16103if(d){
16104e=new ZmSearch();
16105for(var s in d){
16106if((typeof d[s]=="object")||(typeof d[s]=="function")){
16107continue
16108}
16109e[s]=d[s]
16110}
16111e.types=new AjxVector();
16112var l=d.types.getArray();
16113for(var s in l){
16114e.types.add(l[s])
16115}}
16116var c=new ZmMailList(o.list.type,e);
16117for(var s in o.list){
16118if((typeof o.list[s]=="object")||(typeof o.list[s]=="function")){
16119continue
16120}
16121c[s]=o.list[s]
16122}
16123var a=new ZmMailMsg(o.id,c);
16124for(var s in o){
16125if((typeof o[s]=="object")||(typeof o[s]=="function")){
16126continue
16127}
16128a[s]=o[s]
16129}
16130for(var s in o._addrs){
16131var h=o._addrs[s].getArray();
16132for(var n in h){
16133a._addrs[s].add(h[n])
16134}}
16135if(o.attachments&&o.attachments.length>0){
16136for(var s in o.attachments){
16137a.attachments.push(o.attachments[s])
16138}}
16139for(var s in o._bodyParts){
16140a._bodyParts.push(o._bodyParts[s])
16141}
16142if(o._topPart){
16143a._topPart=new ZmMimePart();
16144for(var s in o._topPart){
16145if((typeof o._topPart[s]=="object")||(typeof o._topPart[s]=="function")){
16146continue
16147}
16148a._topPart[s]=o._topPart[s]
16149}
16150var t=o._topPart.children.getArray();
16151for(var s in t){
16152a._topPart.children.add(t[s])
16153}}
16154return a
16155};
16156ZmNewWindow._confirmExitMethod=function(e){
16157if(window.parentController&&(window.newWindowCommand=="compose"||window.newWindowCommand=="composeDetach")){
16158var t=AjxDispatcher.run("GetComposeController",appCtxt.composeCtlrSessionId);
16159if(t&&t._composeView&&t._composeView.isDirty()){
16160return ZmMsg.newWinComposeExit
16161}}}
16162}
16163if(AjxPackage.define("zimbraMail.calendar.model.ZmCalMgr")){
16164ZmCalMgr=function(e){
16165this._container=e;
16166this.clearCache();
16167this._listeners={};
16168this._folderNames={};
16169this._listeners[ZmOperation.NEW_APPT]=new AjxListener(this,this._newApptAction);
16170this._listeners[ZmOperation.NEW_ALLDAY_APPT]=new AjxListener(this,this._newAllDayApptAction);
16171this._listeners[ZmOperation.SEARCH_MAIL]=new AjxListener(this,this._searchMailAction)
16172};
16173ZmCalMgr.prototype.toString=function(){
16174return"ZmCalMgr"
16175};
16176ZmCalMgr.prototype.clearCache=function(){
16177this._miniCalData={}
16178};
16179ZmCalMgr.prototype._createMiniCalendar=function(o){
16180o=o?o:new Date();
16181var e=appCtxt.get(ZmSetting.CAL_FIRST_DAY_OF_WEEK)||0;
16182var h=AjxTimezone.getServerId(AjxTimezone.DEFAULT);
16183var t=(h&&h.indexOf("Europe")==0&&h!="Europe/London");
16184this._miniCalendar=new DwtCalendar({
16185parent:this._container,posStyle:DwtControl.ABSOLUTE_STYLE,firstDayOfWeek:e,showWeekNumber:appCtxt.get(ZmSetting.CAL_SHOW_CALENDAR_WEEK),useISO8601WeekNo:t}
16186);
16187this._miniCalendar.setDate(o);
16188this._miniCalendar.setScrollStyle(Dwt.CLIP);
16189this._miniCalendar.addSelectionListener(new AjxListener(this,this._miniCalSelectionListener));
16190this._miniCalendar.addActionListener(new AjxListener(this,this._miniCalActionListener));
16191this._miniCalendar.addDateRangeListener(new AjxListener(this,this._miniCalDateRangeListener));
16192this._miniCalendar.setMouseOverDayCallback(new AjxCallback(this,this._miniCalMouseOverDayCallback));
16193this._miniCalendar.setMouseOutDayCallback(new AjxCallback(this,this._miniCalMouseOutDayCallback));
16194var l=[];
16195if(appCtxt.get(ZmSetting.MAIL_ENABLED)){
16196l.push("ZmMailMsg");
16197l.push("ZmConv")
16198}
16199if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
16200l.push("ZmContact")
16201}
16202this._miniCalDropTarget=new DwtDropTarget(l);
16203this._miniCalDropTarget.addDropListener(new AjxListener(this,this._miniCalDropTargetListener));
16204this._miniCalendar.setDropTarget(this._miniCalDropTarget);
16205var m=[];
16206for(var n=0;
16207n<7;
16208n++){
16209var c=(n+e)%7;
16210m[n]=(c>0&&c<6)
16211}
16212this._miniCalendar.setWorkingWeek(m);
16213var s={};
16214s[ZmAppViewMgr.C_TREE_FOOTER]=this._miniCalendar;
16215appCtxt.getAppViewMgr().addComponents(s,true);
16216var a=appCtxt.getApp(ZmApp.CALENDAR);
16217var u=a._active||appCtxt.get(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL);
16218this._miniCalendar.setSkipNotifyOnPage(u&&!a._active);
16219if(!a._active){
16220this._miniCalendar.setSelectionMode(DwtCalendar.DAY)
16221}};
16222ZmCalMgr.prototype._miniCalDropTargetListener=function(t){
16223var e=this.getCalViewController();
16224e._miniCalDropTargetListener(t)
16225};
16226ZmCalMgr.prototype.getMiniCalendar=function(){
16227if(!this._miniCalendar){
16228this._createMiniCalendar()
16229}
16230return this._miniCalendar
16231};
16232ZmCalMgr.prototype._refreshCallback=function(e){
16233this.getReminderController()._refreshCallback(e)
16234};
16235ZmCalMgr.prototype.getReminderController=function(){
16236if(!this._reminderController){
16237this._reminderController=new ZmReminderController(this)
16238}
16239return this._reminderController
16240};
16241ZmCalMgr.prototype._miniCalSelectionListener=function(t){
16242if(t.item instanceof DwtCalendar){
16243var e=this.getCalViewController();
16244e._handleLoadMiniCalSelection(t)
16245}};
16246ZmCalMgr.prototype._miniCalActionListener=function(e){
16247var t=this._getMiniCalActionMenu();
16248t.__detail=e.detail;
16249t.popup(0,e.docX,e.docY)
16250};
16251ZmCalMgr.prototype._getMiniCalActionMenu=function(){
16252if(this._minicalMenu==null){
16253this.postInitListeners();
16254var o=[ZmOperation.NEW_APPT,ZmOperation.NEW_ALLDAY_APPT,ZmOperation.SEP,ZmOperation.SEARCH_MAIL];
16255var s=ZmZimlet.actionMenus?ZmZimlet.actionMenus.ZmCalViewController:null;
16256if(s&&s.length){
16257for(var a=0;
16258a<s.length;
16259a++){
16260var h=s[a];
16261ZmOperation.defineOperation(null,h);
16262o.push(h.id)
16263}}
16264var n={
16265parent:appCtxt.getShell(),menuItems:o};
16266this._minicalMenu=new ZmActionMenu(n);
16267o=this._minicalMenu.opList;
16268var t=o.length;
16269for(var e=0;
16270e<t;
16271e++){
16272if(this._listeners[o[e]]){
16273this._minicalMenu.addSelectionListener(o[e],this._listeners[o[e]])
16274}}}
16275return this._minicalMenu
16276};
16277ZmCalMgr.prototype.postInitListeners=function(){
16278if(ZmZimlet.listeners&&ZmZimlet.listeners.ZmCalViewController){
16279for(var e in ZmZimlet.listeners.ZmCalViewController){
16280if(ZmZimlet.listeners.ZmCalViewController[e] instanceof AjxListener){
16281this._listeners[e]=ZmZimlet.listeners.ZmCalViewController[e]
16282}else{
16283this._listeners[e]=new AjxListener(this,this._proxyListeners,[ZmZimlet.listeners.ZmCalViewController[e]])
16284}}}};
16285ZmCalMgr.prototype._proxyListeners=function(t,a){
16286var e=this.getCalViewController();
16287return(new AjxListener(e,t)).handleEvent(a)
16288};
16289ZmCalMgr.prototype.isMiniCalCreated=function(){
16290return(this._miniCalendar!=null)
16291};
16292ZmCalMgr.prototype._miniCalDateRangeListener=function(a){
16293var e=appCtxt.getCurrentViewId();
16294if(e==ZmId.VIEW_CAL_APPT||e==ZmId.VIEW_CAL){
16295var t=this.getCalViewController();
16296t._scheduleMaintenance(ZmCalViewController.MAINT_MINICAL)
16297}else{
16298this.highlightMiniCal()
16299}};
16300ZmCalMgr.prototype._miniCalMouseOverDayCallback=function(a,e){
16301this._currentMouseOverDay=e;
16302var t=new AjxTimedAction(this,this._getDayToolTipOnDelay,[a,e]);
16303AjxTimedAction.scheduleAction(t,1000)
16304};
16305ZmCalMgr.prototype.getCalViewController=function(){
16306var e=AjxDispatcher.run("GetCalController");
16307e._miniCalendar=this._miniCalendar;
16308e._minicalMenu=this._minicalMenu;
16309e._miniCalDropTarget=this._miniCalDropTarget;
16310return e
16311};
16312ZmCalMgr.prototype._miniCalMouseOutDayCallback=function(e){
16313this._currentMouseOverDay=null
16314};
16315ZmCalMgr.prototype._getDayToolTipOnDelay=function(a,e){
16316if(!this._currentMouseOverDay){
16317return
16318}
16319if((this._currentMouseOverDay.getDate()==e.getDate())&&(this._currentMouseOverDay.getMonth()==e.getMonth())){
16320this._currentMouseOverDay=null;
16321var t=DwtShell.mouseEvent;
16322if(t&&t.docX>0&&t.docY>0){
16323var i=new AjxCallback(this,this.showTooltip,[a,t.docX,t.docY]);
16324this.getCalViewController().getDayToolTipText(e,false,i)
16325}}};
16326ZmCalMgr.prototype.showTooltip=function(o,e,n,i){
16327o.setToolTipContent(i);
16328if(e>0&&n>0){
16329var t=DwtShell.getShell(window);
16330var a=t.getToolTip();
16331a.setContent(i);
16332a.popup(e,n);
16333o.__tooltipClosed=false
16334}};
16335ZmCalMgr.prototype.getApptSummaries=function(t){
16336var e=this.setSearchParams(t);
16337if(e!=null&&(e instanceof AjxVector)){
16338return e
16339}
16340this._rawAppts=[];
16341if(t.callback){
16342this._search(t)
16343}else{
16344return this._search(t)
16345}};
16346ZmCalMgr.prototype.setSearchParams=function(o){
16347if(!(o.folderIds instanceof Array)){
16348o.folderIds=[o.folderIds]
16349}else{
16350if(o.folderIds.length==0){
16351var t=new AjxVector();
16352if(o.callback){
16353o.callback.run(t)
16354}
16355return t
16356}}
16357var n={};
16358var l="";
16359for(var h=0;
16360h<o.folderIds.length;
16361h++){
16362var a=o.folderIds[h];
16363var s=appCtxt.getActiveAccount().isMain?a:ZmOrganizer.getSystemId(a);
16364var e=appCtxt.getById(s);
16365var d=e?e.getRemoteId():s;
16366n[d]=s;
16367if(l.length){
16368l+=" OR "
16369}
16370var c=AjxUtil.isNumeric(a)?a:['"',a,'"'].join("");
16371l+="inid:"+c
16372}
16373o.queryHint=l;
16374o.folderIdMapper=n;
16375o.offset=0
16376};
16377ZmCalMgr.prototype._search=function(o){
16378var n={
16379SearchRequest:{
16380_jsns:"urn:zimbraMail"}};
16381var i=n.SearchRequest;
16382this._setSoapParams(i,o);
16383var a=appCtxt.multiAccounts?appCtxt.accountList.mainAccount.name:null;
16384if(o.callback){
16385appCtxt.getAppController().sendRequest({
16386jsonObj:n,asyncMode:true,callback:(new AjxCallback(this,this._getApptSummariesResponse,[o])),noBusyOverlay:o.noBusyOverlay,accountName:a}
16387)
16388}else{
16389var t=appCtxt.getAppController().sendRequest({
16390jsonObj:n,accountName:a}
16391);
16392var e=new ZmCsfeResult(t,false);
16393return this._getApptSummariesResponse(o,e)
16394}};
16395ZmCalMgr.prototype._setSoapParams=function(e,a){
16396e.sortBy="none";
16397e.limit="500";
16398e.calExpandInstStart=a.start;
16399e.calExpandInstEnd=a.end;
16400e.types=ZmSearch.TYPE[ZmItem.APPT];
16401e.offset=a.offset;
16402var t=a.query;
16403if(a.queryHint){
16404t=(t!=null)?(t+" ("+a.queryHint+")"):a.queryHint
16405}
16406e.query={
16407_content:t}
16408};
16409ZmCalMgr.prototype._getApptSummariesResponse=function(n,e){
16410if(!e){
16411return
16412}
16413var s=n.callback;
16414var o;
16415try{
16416o=e.getResponse()
16417}
16418catch(t){
16419if(s){
16420s.run(new AjxVector())
16421}
16422return
16423}
16424var i=o.SearchResponse;
16425var a=this.processSearchResponse(i,n);
16426if(a==null){
16427return
16428}
16429if(s){
16430s.run(a,n.query)
16431}else{
16432return a
16433}};
16434ZmCalMgr.prototype.processSearchResponse=function(s,n){
16435if(!s){
16436return
16437}
16438if(s&&s.appt&&s.appt.length){
16439this._rawAppts=this._rawAppts!=null?this._rawAppts.concat(s.appt):s.appt;
16440if(s.more){
16441var d=s.appt[s.appt.length-1];
16442if(d){
16443n.offset+=500;
16444this._search(n);
16445return
16446}}}
16447var a=new AjxVector();
16448if(this._rawAppts&&this._rawAppts.length){
16449this._list=new ZmList(ZmItem.APPT);
16450for(var l=0;
16451l<this._rawAppts.length;
16452l++){
16453var o=this._rawAppts[l];
16454var t=o?o.inst:null;
16455if(t){
16456var c={
16457list:this._list};
16458for(var h=0;
16459h<t.length;
16460h++){
16461var e=ZmCalBaseItem.createFromDom(o,c,t[h]);
16462if(e){
16463a.add(e)
16464}}}}}
16465return a
16466};
16467ZmCalMgr.prototype.getCalendarName=function(e){
16468var t=appCtxt.getApp(ZmApp.CALENDAR);
16469return t.getCalendarName(e)
16470};
16471ZmCalMgr.prototype._newApptAction=function(t){
16472var e=this.getCalViewController();
16473e._newApptAction(t)
16474};
16475ZmCalMgr.prototype._newAllDayApptAction=function(t){
16476var e=this.getCalViewController();
16477e._newAllDayApptAction(t)
16478};
16479ZmCalMgr.prototype._searchMailAction=function(t){
16480var e=this.getCalViewController();
16481e._searchMailAction(t)
16482};
16483ZmCalMgr.prototype.getCheckedCalendarFolderIds=function(e){
16484var t=appCtxt.getApp(ZmApp.CALENDAR);
16485return t.getCheckedCalendarFolderIds(e)
16486};
16487ZmCalMgr.prototype._handleError=function(t){
16488if(t.code=="mail.INVITE_OUT_OF_DATE"||t.code=="mail.NO_SUCH_APPT"){
16489var e=appCtxt.getMsgDialog();
16490e.setMessage(ZmMsg.apptOutOfDate,DwtMessageDialog.INFO_STYLE);
16491e.popup();
16492return true
16493}
16494return false
16495};
16496ZmCalMgr.prototype.highlightMiniCal=function(){
16497this.getMiniCalCache()._getMiniCalData(this.getMiniCalendarParams())
16498};
16499ZmCalMgr.prototype.getMiniCalendarParams=function(){
16500var e=this.getMiniCalendar().getDateRange();
16501return{
16502start:e.start.getTime(),end:e.end.getTime(),fanoutAllDay:true,noBusyOverlay:true,folderIds:this.getCheckedCalendarFolderIds(),tz:AjxTimezone.DEFAULT}
16503};
16504ZmCalMgr.prototype.getMiniCalCache=function(){
16505if(!this._miniCalCache){
16506this._miniCalCache=new ZmMiniCalCache(this)
16507}
16508return this._miniCalCache
16509};
16510ZmCalMgr.prototype.getQuickReminderSearchTimeRange=function(){
16511var a=new Date();
16512a.setHours(23,59,59,999);
16513var e=new Date(a.getTime());
16514var t=a;
16515t.setHours(0,0,0,0);
16516return{
16517start:t.getTime(),end:e.getTime()}
16518};
16519ZmCalMgr.prototype.showQuickReminder=function(){
16520var e=this.getQuickReminderParams();
16521this.getApptSummaries(e)
16522};
16523ZmCalMgr.prototype.getQuickReminderParams=function(){
16524var e=this.getQuickReminderSearchTimeRange();
16525return{
16526start:e.start,end:e.end,fanoutAllDay:false,folderIds:this.getCheckedCalendarFolderIds(true),callback:(new AjxCallback(this,this._quickReminderCallback)),includeReminders:true}
16527};
16528ZmCalMgr.prototype._quickReminderCallback=function(l){
16529var o=new AjxVector();
16530this._cacheMap={};
16531var d=l.size();
16532var a=(new Date()).getTime();
16533for(var h=0;
16534h<d;
16535h++){
16536var e=l.get(h);
16537var t=e.id;
16538if(!this._cacheMap[t]){
16539this._cacheMap[t]=e;
16540if(e.isAllDayEvent()){
16541continue
16542}
16543var c=e.getStartTime()-a;
16544var s=(c>=0&&c<=AjxDateUtil.MSEC_PER_HOUR);
16545if((a>=e.getStartTime()&&a<=e.getEndTime())||s){
16546e.isUpcomingEvent=s;
16547o.add(e)
16548}}}
16549var n=this.getQuickReminderDialog();
16550n.initialize(o);
16551n.popup()
16552};
16553ZmCalMgr.prototype.getQuickReminderDialog=function(){
16554if(this._reminderDialog==null){
16555this._reminderDialog=new ZmQuickReminderDialog(appCtxt.getShell(),this,this._calController)
16556}
16557return this._reminderDialog
16558}
16559}
16560if(AjxPackage.define("zimbraMail.calendar.model.ZmMiniCalCache")){
16561ZmMiniCalCache=function(e){
16562this._calViewController=e;
16563this.clearCache()
16564};
16565ZmMiniCalCache.prototype.toString=function(){
16566return"ZmMiniCalCache"
16567};
16568ZmMiniCalCache.prototype.clearCache=function(){
16569this._miniCalData={}
16570};
16571ZmMiniCalCache.prototype.updateCache=function(a,t){
16572var e=this._getCacheKey(a);
16573this._miniCalData[e]=t
16574};
16575ZmMiniCalCache.prototype._getCacheKey=function(t){
16576var e=[];
16577e=e.concat(t.folderIds);
16578e.sort();
16579return(t.start+":"+t.end+":"+e.join(":"))
16580};
16581ZmMiniCalCache.prototype._getMiniCalData=function(i){
16582var a=this._getCacheKey(i);
16583var t=this._miniCalData[a];
16584if(t){
16585this.highlightMiniCal(t);
16586if(i.callback){
16587i.callback.run(t);
16588return
16589}
16590return t
16591}
16592var o={
16593GetMiniCalRequest:{
16594_jsns:"urn:zimbraMail"}};
16595var e=o.GetMiniCalRequest;
16596this._setSoapParams(e,i);
16597appCtxt.getAppController().sendRequest({
16598jsonObj: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)}
16599)
16600};
16601ZmMiniCalCache.prototype.getCacheData=function(a){
16602var t=this._getCacheKey(a);
16603var e=this._miniCalData[t];
16604if(e){
16605return e
16606}};
16607ZmMiniCalCache.prototype._handleMiniCalResponseError=function(o,e){
16608var a=e?e.code:null;
16609if(a==ZmCsfeException.ACCT_NO_SUCH_ACCOUNT||a==ZmCsfeException.MAIL_NO_SUCH_MOUNTPOINT){
16610var i=(e&&e.data)?e.data:null;
16611var n=(i&&i.itemId&&(i.itemId.length>0))?i.itemId[0]:null;
16612if(n&&appCtxt.getById(n)&&this._faultHandler){
16613var t=appCtxt.getById(n);
16614t.noSuchFolder=true;
16615this._faultHandler.run(t);
16616return true
16617}}
16618if(o.callback){
16619o.callback.run([])
16620}
16621return true
16622};
16623ZmMiniCalCache.prototype._setSoapParams=function(a,o){
16624a.s=o.start;
16625a.e=o.end;
16626a.tz=o.tz;
16627var e=null;
16628if(o.folderIds&&o.folderIds.length){
16629a.folder=[];
16630for(var t=0;
16631t<o.folderIds.length;
16632t++){
16633a.folder.push({
16634id:o.folderIds[t]}
16635)
16636}}
16637if(o.tz){
16638a.tz=[];
16639a.tz.push({
16640id:o.tz}
16641)
16642}};
16643ZmMiniCalCache.prototype.setFaultHandler=function(e){
16644this._faultHandler=e
16645};
16646ZmMiniCalCache.prototype._getMiniCalResponse=function(h,e){
16647var o=[];
16648if(!e){
16649return o
16650}
16651var l=h.callback;
16652var s=e&&e._data&&e._data;
16653var a=s.GetMiniCalResponse;
16654if(a&&a.date){
16655var n=a.date;
16656if(n){
16657for(var t=0;
16658t<n.length;
16659t++){
16660if(n[t]._content){
16661o.push(n[t]._content)
16662}}}
16663this.highlightMiniCal(o)
16664}else{
16665this.highlightMiniCal([])
16666}
16667this.updateCache(h,o);
16668if(h.callback){
16669h.callback.run(o);
16670return
16671}
16672return o
16673};
16674ZmMiniCalCache.prototype.processBatchResponse=function(a,t){
16675if(!a){
16676return
16677}
16678for(var e=0;
16679e<a.length;
16680e++){
16681var o=(a[e]&&a[e].date);
16682if(o){
16683for(var e=0;
16684e<o.length;
16685e++){
16686if(o[e]._content){
16687t.push(o[e]._content)
16688}}}}};
16689ZmMiniCalCache.prototype.highlightMiniCal=function(a){
16690var e=[];
16691for(var t=0;
16692t<a.length;
16693t++){
16694if(a[t]){
16695e[a[t]]=AjxDateFormat.parse("yyyyMMdd",a[t])
16696}}
16697if(this._calViewController&&this._calViewController._miniCalendar){
16698this._calViewController._miniCalendar.setHilite(e,true,true)
16699}}
16700}
16701if(AjxPackage.define("zimbraMail.calendar.controller.ZmReminderController")){
16702ZmReminderController=function(e){
16703this._calController=e;
16704this._apptState={};
16705this._cacheMap={};
16706this._cachedAppts=new AjxVector();
16707this._activeAppts=new AjxVector();
16708this._oldAppts=new AjxVector();
16709this._housekeepingTimedAction=new AjxTimedAction(this,this._housekeepingAction);
16710this._refreshTimedAction=new AjxTimedAction(this,this.refresh);
16711var a=appCtxt.getSettings();
16712var i=new AjxListener(this,this._settingChangeListener);
16713var t=a.getSetting(ZmSetting.CAL_REMINDER_WARNING_TIME);
16714if(t){
16715t.addChangeListener(i);
16716this._warningTime=appCtxt.get(ZmSetting.CAL_REMINDER_WARNING_TIME)
16717}};
16718ZmReminderController.prototype.constructor=ZmReminderController;
16719ZmReminderController._STATE_ACTIVE=1;
16720ZmReminderController._STATE_DISMISSED=2;
16721ZmReminderController._STATE_SNOOZED=3;
16722ZmReminderController._CACHE_RANGE=24;
16723ZmReminderController._CACHE_REFRESH=16;
16724ZmReminderController.prototype.toString=function(){
16725return"ZmReminderController"
16726};
16727ZmReminderController.prototype._settingChangeListener=function(i){
16728if(i.type!=ZmEvent.S_SETTING){
16729return
16730}
16731var a=i.source;
16732if(a.id!=ZmSetting.CAL_REMINDER_WARNING_TIME){
16733return
16734}
16735var t=this._warningTime;
16736var e=this._warningTime=a.getValue();
16737if(e==0){
16738this._cancelRefreshAction();
16739this._cancelHousekeepingAction()
16740}else{
16741if(t==0){
16742this.refresh()
16743}else{
16744this._cancelHousekeepingAction();
16745this._housekeepingAction()
16746}}
16747this._warningTime=e
16748};
16749ZmReminderController.prototype.refresh=function(){
16750if(this._warningTime==0){
16751return
16752}
16753this._searchTimeRange=this.getSearchTimeRange();
16754var e=this.getRefreshParams();
16755this._calController.getApptSummaries(e);
16756if(this._refreshActionId){
16757AjxTimedAction.cancelAction(this._refreshActionId)
16758}
16759this._refreshActionId=AjxTimedAction.scheduleAction(this._refreshTimedAction,(AjxDateUtil.MSEC_PER_HOUR*ZmReminderController._CACHE_REFRESH))
16760};
16761ZmReminderController.prototype.getSearchTimeRange=function(){
16762var a=new Date();
16763a.setHours(23,59,59,999);
16764var e=new Date(a.getTime());
16765a.setDate(a.getDate()-7);
16766var t=a;
16767t.setHours(0,0,0,0);
16768return{
16769start:t.getTime(),end:e.getTime()}
16770};
16771ZmReminderController.prototype.getRefreshParams=function(){
16772var e=this.getSearchTimeRange();
16773return{
16774start:e.start,end:e.end,fanoutAllDay:false,folderIds:this._calController.getCheckedCalendarFolderIds(true),callback:(new AjxCallback(this,this._refreshCallback)),includeReminders:true}
16775};
16776ZmReminderController.prototype._cancelRefreshAction=function(){
16777if(this._refreshActionId){
16778AjxTimedAction.cancelAction(this._refreshActionId);
16779delete this._refreshActionId
16780}};
16781ZmReminderController.prototype._cancelHousekeepingAction=function(){
16782if(this._houseKeepingActionId){
16783AjxTimedAction.cancelAction(this._housekeepingActionId);
16784delete this._houseKeepingActionId
16785}};
16786ZmReminderController.prototype._refreshCallback=function(n){
16787if(this._refreshDelay>0){
16788AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._refreshCallback,[n]),this._refreshDelay);
16789this._refreshDelay=0;
16790return
16791}
16792if(n instanceof ZmCsfeException){
16793this._calController._handleError(n,new AjxCallback(this,this._maintErrorHandler));
16794return
16795}
16796var a=new AjxVector();
16797this._cacheMap={};
16798var t=n.size();
16799for(var e=0;
16800e<t;
16801e++){
16802var o=n.get(e);
16803var s=o.id;
16804if(o.hasAlarmData()){
16805if(!this._cacheMap[s]){
16806this._cacheMap[s]=true;
16807a.add(o)
16808}}}
16809this._cachedAppts=a.clone();
16810this._cachedAppts.sort(ZmCalBaseItem.compareByTimeAndDuration);
16811this._activeAppts.removeAll();
16812this._cancelHousekeepingAction();
16813this._housekeepingAction()
16814};
16815ZmReminderController.prototype.updateCache=function(n){
16816if(!n){
16817return
16818}
16819if(!this._cachedAppts){
16820this._cachedAppts=new AjxVector()
16821}
16822var h=this.getSearchTimeRange();
16823var o=0;
16824var t=n.size();
16825for(var e=0;
16826e<t;
16827e++){
16828var a=n.get(e);
16829var s=a.id;
16830if(a.hasAlarmData()&&!this._cacheMap[s]&&a.isStartInRange(h.start,h.end)){
16831this._cacheMap[s]=true;
16832this._cachedAppts.add(a);
16833o++
16834}}};
16835ZmReminderController.prototype.isApptSnoozed=function(e){
16836return(this._apptState[e]==ZmReminderController._STATE_SNOOZED)
16837};
16838ZmReminderController.prototype._housekeepingAction=function(){
16839var p=this.getReminderDialog();
16840if(!ZmCsfeCommand.getAuthToken()){
16841if(p&&p.isPoppedUp()){
16842p.popdown()
16843}
16844return
16845}
16846if(this._searchTimeRange){
16847var u=this.getSearchTimeRange();
16848var f=u.end-this._searchTimeRange.end;
16849if(f>AjxDateUtil.MSEC_PER_HOUR){
16850this._searchTimeRange=null;
16851this.refresh();
16852return
16853}}
16854var t=this._cachedAppts.size();
16855var l=this._activeAppts.size();
16856if(t==0&&l==0){
16857this._housekeepingActionId=AjxTimedAction.scheduleAction(this._housekeepingTimedAction,60*1000);
16858return
16859}
16860var m=0;
16861var n=(new Date()).getTime();
16862var c=n+(this._warningTime*60*1000);
16863var o=[];
16864for(var h=0;
16865h<t;
16866h++){
16867var e=this._cachedAppts.get(h);
16868if(e&&this._snoozedAppt){
16869var d=e.getUniqueId(true);
16870if(this._snoozedAppt[d]){
16871this._apptState[d]=ZmReminderController._STATE_ACTIVE;
16872o.push(e);
16873m++;
16874this._activeAppts.add(e);
16875delete this._snoozedAppt[d];
16876continue
16877}}
16878if(!e||e.ptst==ZmCalBaseItem.PSTATUS_DECLINED){
16879o.push(e)
16880}else{
16881if(e.isAlarmInRange()){
16882var d=e.getUniqueId(true);
16883var a=this._apptState[d];
16884var s=false;
16885if(a==ZmReminderController._STATE_DISMISSED){}else{
16886if(a==ZmReminderController._STATE_ACTIVE){
16887s=true
16888}else{
16889if(a!=ZmReminderController._STATE_SNOOZED){
16890m++;
16891s=true;
16892this._apptState[d]=ZmReminderController._STATE_ACTIVE
16893}}}
16894if(s){
16895o.push(e);
16896if(!appCtxt.get(ZmSetting.CAL_SHOW_PAST_DUE_REMINDERS)&&e.isAlarmOld()){
16897m--;
16898this._oldAppts.add(e)
16899}else{
16900this._activeAppts.add(e)
16901}}}}}
16902for(var h in o){
16903this._cachedAppts.remove(o[h])
16904}
16905if(m||p.isPoppedUp()){
16906if(this._activeAppts.size()==0&&p.isPoppedUp()){
16907p.popdown()
16908}else{
16909p.initialize(this._activeAppts);
16910if(!p.isPoppedUp()){
16911p.popup()
16912}}}
16913if(this._oldAppts.size()>0){
16914this.dismissAppt(this._oldAppts,new AjxCallback(this,this._silentDismissCallback))
16915}
16916this._housekeepingActionId=AjxTimedAction.scheduleAction(this._housekeepingTimedAction,60*1000)
16917};
16918ZmReminderController.prototype._silentDismissCallback=function(o){
16919var t=o.size();
16920for(var e=0;
16921e<t;
16922e++){
16923var a=o.get(e);
16924if(a&&a.hasAlarmData()){
16925if(a.isAlarmInRange()){
16926this._activeAppts.add(a)
16927}}}
16928this._oldAppts.removeAll();
16929this._cancelHousekeepingAction();
16930this._housekeepingAction()
16931};
16932ZmReminderController.prototype.dismissAppt=function(a,o){
16933var t;
16934if(!(a instanceof AjxVector)){
16935a=AjxVector.fromArray((a instanceof Array)?a:[a])
16936}
16937for(var e=0;
16938e<a.size();
16939e++){
16940var t=a.get(e);
16941this._apptState[t.getUniqueId(true)]=ZmReminderController._STATE_DISMISSED;
16942this._activeAppts.remove(t)
16943}
16944this.dismissApptRequest(a,o)
16945};
16946ZmReminderController.prototype.snoozeAppt=function(n){
16947var a=[];
16948var o;
16949var t;
16950for(var e=0;
16951e<n.size();
16952e++){
16953o=n.get(e);
16954t=o.getUniqueId(true);
16955this._apptState[t]=ZmReminderController._STATE_SNOOZED;
16956a.push(t);
16957this._activeAppts.remove(o);
16958this._cachedAppts.add(o)
16959}
16960return a
16961};
16962ZmReminderController.prototype.activateSnoozedAppts=function(n){
16963var o=this.getReminderDialog();
16964if(o&&o.isPoppedUp()){
16965o.popdown()
16966}
16967if(this._snoozedAppt==null){
16968this._snoozedAppt={}
16969}
16970var a;
16971var t;
16972for(var e=0;
16973e<n.size();
16974e++){
16975a=n.get(e);
16976if(a){
16977t=a.getUniqueId(true);
16978this._snoozedAppt[t]=true
16979}}
16980this._cancelHousekeepingAction();
16981this._housekeepingAction()
16982};
16983ZmReminderController.prototype.dismissApptRequest=function(s,c){
16984var l=AjxSoapDoc.create("DismissCalendarItemAlarmRequest","urn:zimbraMail");
16985var t=(new Date()).getTime();
16986for(var n=0;
16987n<s.size();
16988n++){
16989var e=s.get(n);
16990var a=l.set("appt");
16991a.setAttribute("id",e.id);
16992a.setAttribute("dismissedAt",t)
16993}
16994var h=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount;
16995var o={
16996soapDoc:l,asyncMode:true,accountName:(h?h.name:null),callback:(new AjxCallback(this,this._handleDismissAppt,[s,c])),errorCallback:(new AjxCallback(this,this._handleErrorDismissAppt,[s,c]))};
16997appCtxt.getAppController().sendRequest(o);
16998return true
16999};
17000ZmReminderController.prototype.setAlarmData=function(e,t,i){
17001var a=e.set("alarmData",null,t);
17002a.setAttribute("")
17003};
17004ZmReminderController.prototype._handleDismissAppt=function(n,l,d){
17005if(d.isException()){
17006return
17007}
17008var t=d.getResponse();
17009var s=t.DismissCalendarItemAlarmResponse;
17010var a=s?s.appt:null;
17011if(!a){
17012return
17013}
17014var h={};
17015for(var o in a){
17016var e=a[o];
17017if(e&&e.calItemId){
17018h[e.calItemId]=e.alarmData?e.alarmData:{}
17019}}
17020var c=n.size();
17021for(var o=0;
17022o<c;
17023o++){
17024var e=n.get(o);
17025if(e){
17026if(h[e.id]){
17027e.alarmData=(h[e.id]!={}
17028)?h[e.id]:null
17029}}}
17030if(l){
17031l.run(n)
17032}};
17033ZmReminderController.prototype._handleErrorDismissAppt=function(t,a,e){};
17034ZmReminderController.prototype.getReminderDialog=function(){
17035if(this._reminderDialog==null){
17036this._reminderDialog=new ZmReminderDialog(appCtxt.getShell(),this,this._calController)
17037}
17038return this._reminderDialog
17039}
17040}
17041if(AjxPackage.define("zimbraMail.calendar.view.ZmReminderDialog")){
17042ZmReminderDialog=function(n,h,e){
17043var o=Dwt.getNextId();
17044var a=[];
17045var t=0;
17046a[t++]="<td valign='middle' class='ZmReminderField'>";
17047a[t++]=ZmMsg.snoozeAll;
17048a[t++]="</td><td valign='middle' id='";
17049a[t++]=o;
17050a[t++]="'></td><td valign='middle' id=\"{0}\"></td>";
17051var s=new DwtDialog_ButtonDescriptor(ZmReminderDialog.SNOOZE_BUTTON,ZmMsg.snooze,DwtDialog.ALIGN_LEFT,null,a.join(""));
17052var l=new DwtDialog_ButtonDescriptor(ZmReminderDialog.DISMISS_ALL_BUTTON,ZmMsg.dismissAll,DwtDialog.ALIGN_RIGHT);
17053DwtDialog.call(this,{
17054parent:n,standardButtons:DwtDialog.NO_BUTTONS,extraButtons:[s,l]}
17055);
17056this._reminderController=h;
17057this._calController=e;
17058this.setContent(this._contentHtml(o));
17059this.setTitle(ZmMsg.apptReminders);
17060this.registerCallback(ZmReminderDialog.SNOOZE_BUTTON,this._handleSnoozeButton,this);
17061this.registerCallback(ZmReminderDialog.DISMISS_ALL_BUTTON,this._handleDismissAllButton,this)
17062};
17063ZmReminderDialog.prototype=new DwtDialog;
17064ZmReminderDialog.prototype.constructor=ZmReminderDialog;
17065ZmReminderDialog.SNOOZE_BUTTON=++DwtDialog.LAST_BUTTON;
17066ZmReminderDialog.DISMISS_ALL_BUTTON=++DwtDialog.LAST_BUTTON;
17067ZmReminderDialog.SOON=-AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES;
17068ZmReminderDialog.prototype.toString=function(){
17069return"ZmReminderDialog"
17070};
17071ZmReminderDialog.prototype.popup=function(){
17072DwtDialog.prototype.popup.call(this);
17073this._cancelSnooze();
17074if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_BROWSER)){
17075AjxPackage.require("Alert");
17076ZmBrowserAlert.getInstance().start(ZmMsg.appointmentReminder)
17077}
17078if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_SOUNDS)){
17079AjxPackage.require("Alert");
17080ZmSoundAlert.getInstance().start()
17081}
17082if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_TOASTER)){
17083AjxPackage.require("Alert");
17084var o=[];
17085var e=this._list.getArray();
17086for(var t=0;
17087t<e.length&&t<5;
17088t++){
17089var a=e[t];
17090var s=this._formatDeltaString(this._computeDelta(a));
17091var n=[a.getName(),", ",this._getDurationText(a),"\n(",s,")"].join("");
17092if(AjxEnv.isMac){
17093ZmDesktopAlert.getInstance().start(ZmMsg.appointmentReminder,n)
17094}else{
17095if(AjxEnv.isWindows){
17096o.push(n)
17097}}}
17098if(AjxEnv.isWindows&&o.length>0){
17099if(e.length>5){
17100o.push(ZmMsg.andMore)
17101}
17102ZmDesktopAlert.getInstance().start(ZmMsg.appointmentReminder,o.join("\n"),5)
17103}}};
17104ZmReminderDialog.prototype.initialize=function(u){
17105this._list=u.clone();
17106this._apptData={};
17107var c=[];
17108var m=0;
17109var p=u.size();
17110c[m++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
17111for(var h=0;
17112h<p;
17113h++){
17114var e=u.get(h);
17115var d=e.getUniqueId(true);
17116var s=this._apptData[d]={
17117appt:e};
17118m=this._addAppt(c,m,e,s,(h>0))
17119}
17120c[m++]="</table>";
17121if(this._dismissButtons){
17122for(var a in this._dismissButtons){
17123this._dismissButtons[a].dispose()
17124}}
17125if(this._openButtons){
17126for(var a in this._openButtons){
17127this._openButtons[a].dispose()
17128}}
17129this._dismissButtons={};
17130this._openButtons={};
17131var o=new AjxListener(this,this._dismissButtonListener);
17132var f=new AjxListener(this,this._openButtonListener);
17133var t=document.getElementById(this._listId);
17134t.innerHTML=c.join("");
17135for(var h=0;
17136h<p;
17137h++){
17138var e=u.get(h);
17139var d=e.getUniqueId(true);
17140var s=this._apptData[d];
17141var l=this._dismissButtons[s.dismissBtnId]=new DwtButton({
17142parent:this,className:"DwtToolbarButton",parentElement:s.dismissBtnId}
17143);
17144l.setImage("Cancel");
17145l.setText(ZmMsg.dismiss);
17146l.addSelectionListener(o);
17147l.apptUid=d;
17148var n=this._openButtons[s.openBtnId]=new DwtButton({
17149parent:this,className:"DwtToolbarButton",parentElement:s.openBtnId}
17150);
17151n.setImage(e.otherAttendees?"ApptMeeting":"Appointment");
17152n.setText(ZmMsg.viewAppointment);
17153n.addSelectionListener(f);
17154n.apptUid=d;
17155this._updateDelta(s)
17156}};
17157ZmReminderDialog.prototype._contentHtml=function(o){
17158this._listId=Dwt.getNextId();
17159var e=[1,5,10,15,30,45,60];
17160this._select=new DwtSelect({
17161parent:this}
17162);
17163var n=new AjxMessageFormat(ZmMsg.reminderSnoozeMinutes);
17164for(var a=0;
17165a<e.length;
17166a++){
17167var t=n.format(e[a]);
17168this._select.addOption(t,a==0,e[a])
17169}
17170this._select.reparentHtmlElement(o);
17171return["<div class='ZmReminderDialog' id='",this._listId,"'>"].join("")
17172};
17173ZmReminderDialog.prototype._updateDelta=function(t){
17174var a=document.getElementById(t.deltaId);
17175if(a){
17176var e=this._computeDelta(t.appt);
17177if(e>=0){
17178a.className="ZmReminderOverdue"
17179}else{
17180if(e>ZmReminderDialog.SOON){
17181a.className="ZmReminderSoon"
17182}else{
17183a.className="ZmReminderFuture"
17184}}
17185a.innerHTML=this._formatDeltaString(e)
17186}};
17187ZmReminderDialog.prototype._addAppt=function(t,e,a,i,h){
17188i.dismissBtnId=Dwt.getNextId();
17189i.openBtnId=Dwt.getNextId();
17190i.deltaId=Dwt.getNextId();
17191i.rowId=Dwt.getNextId();
17192var n=(a.folderId!=ZmOrganizer.ID_CALENDAR&&this._calController)?this._calController.getCalendarName(a.folderId):null;
17193var o=appCtxt.getById(a.folderId);
17194var s={
17195needSep: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};
17196t[e++]=AjxTemplate.expand("calendar.Calendar#ReminderDialogRow",s);
17197return e
17198};
17199ZmReminderDialog.prototype._openButtonListener=function(o){
17200appCtxt.getAppController().setStatusMsg(ZmMsg.allRemindersAreSnoozed,ZmStatusView.LEVEL_INFO);
17201this._handleSnoozeButton();
17202var s=DwtControl.getTargetControl(o);
17203var n=this._apptData[s.apptUid];
17204var a=n?n.appt:null;
17205if(a){
17206AjxDispatcher.require(["CalendarCore","Calendar"]);
17207var l=AjxDispatcher.run("GetCalController");
17208var t=new ZmAppt();
17209for(var e in a){
17210if(!AjxUtil.isFunction(a[e])){
17211t[e]=a[e]
17212}}
17213var h=new AjxCallback(l,l._showAppointmentDetails,t);
17214t.getDetails(null,h,null,null,true)
17215}};
17216ZmReminderDialog.prototype._dismissButtonListener=function(a){
17217var n=DwtControl.getTargetControl(a);
17218var o=this._apptData[n.apptUid];
17219if(!o){
17220return
17221}
17222this._reminderController.dismissAppt(o.appt);
17223var e=this._dismissButtons[o.dismissBtnId];
17224if(e){
17225e.dispose();
17226delete this._dismissButtons[o.dismissBtnId]
17227}
17228var i=this._openButtons[o.openBtnId];
17229if(i){
17230i.dispose();
17231delete this._openButtons[o.openBtnId]
17232}
17233var s=document.getElementById(o.rowId);
17234if(s){
17235var t=s.nextSibling;
17236if(t&&t.getAttribute("name")=="rdsep"){
17237t.parentNode.removeChild(t)
17238}
17239s.parentNode.removeChild(s)
17240}
17241delete this._apptData[n.apptUid];
17242this._list.remove(o.appt);
17243if(this._list.size()==0){
17244this.popdown()
17245}};
17246ZmReminderDialog.prototype._handleSnoozeButton=function(){
17247this.popdown();
17248var e=this._reminderController.snoozeAppt(this._list);
17249var a=this._list.clone();
17250var t=new AjxTimedAction(this,this._snoozeAction,[a]);
17251AjxTimedAction.scheduleAction(t,this._select.getValue()*60*1000)
17252};
17253ZmReminderDialog.prototype._snoozeAction=function(e){
17254if(e){
17255this._reminderController.activateSnoozedAppts(e)
17256}};
17257ZmReminderDialog.prototype._cancelSnooze=function(){
17258if(this._snoozeActionId){
17259AjxTimedAction.cancelAction(this._snoozeActionId);
17260delete this._snoozeActionId
17261}};
17262ZmReminderDialog.prototype._handleDismissAllButton=function(){
17263this._cancelSnooze();
17264this.popdown();
17265this._reminderController.dismissAppt(this._list)
17266};
17267ZmReminderDialog.prototype._getDurationText=function(a){
17268var o=a.isMultiDay();
17269var n=a._alarmInstStart?new Date(a._alarmInstStart):a.startDate;
17270var t=a._alarmInstStart?(n.getTime()+a.getDuration()):a.getEndTime();
17271var e=new Date(t);
17272if(a.isAllDayEvent()){
17273e=new Date(t-(o?2*AjxDateUtil.MSEC_PER_HOUR:0));
17274var i=o?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
17275return AjxMessageFormat.format(i,[n,e])
17276}
17277var i=o?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
17278return AjxMessageFormat.format(i,[n,e,""])
17279};
17280ZmReminderDialog.prototype._computeDelta=function(e){
17281return(e.alarmData&&e.alarmData.length>0)?((new Date()).getTime()-e.adjustMS(e.alarmData[0].alarmInstStart,e.tzo)):((new Date()).getTime()-e.getStartTime())
17282};
17283ZmReminderDialog.prototype._formatDeltaString=function(i){
17284var o=i<0?"In":"OverdueBy";
17285i=Math.abs(i);
17286var s=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*365));
17287if(s!=0){
17288i-=s*AjxDateUtil.MSEC_PER_DAY*365
17289}
17290var t=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*30.42));
17291if(t>0){
17292i-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
17293}
17294var d=Math.floor(i/AjxDateUtil.MSEC_PER_DAY);
17295if(d>0){
17296i-=d*AjxDateUtil.MSEC_PER_DAY
17297}
17298var l=Math.floor(i/AjxDateUtil.MSEC_PER_HOUR);
17299if(l>0){
17300i-=l*AjxDateUtil.MSEC_PER_HOUR
17301}
17302var e=Math.floor(i/60000);
17303if(e>0){
17304i-=e*60000
17305}
17306var n=Math.floor(i/1000);
17307if(n>30&&e<59){
17308e++
17309}
17310var n=0;
17311var a;
17312if(s>0){
17313a="Years";
17314if(s<=3&&t>0){
17315a="YearsMonths"
17316}}else{
17317if(t>0){
17318a="Months";
17319if(t<=3&&d>0){
17320a="MonthsDays"
17321}}else{
17322if(d>0){
17323a="Days";
17324if(d<=2&&l>0){
17325a="DaysHours"
17326}}else{
17327if(l>0){
17328a="Hours";
17329if(l<5&&e>0){
17330a="HoursMinutes"
17331}}else{
17332a="Minutes"
17333}}}}
17334var c=["reminder",o,a].join("");
17335var h=[i,s,t,d,l,e,n];
17336return AjxMessageFormat.format(ZmMsg[c],h)
17337}
17338}
17339if(AjxPackage.define("zimbraMail.calendar.view.ZmQuickReminderDialog")){
17340ZmQuickReminderDialog=function(a,i,e){
17341var t=Dwt.getNextId();
17342DwtDialog.call(this,{
17343parent:a,standardButtons:[DwtDialog.OK_BUTTON]}
17344);
17345this._reminderController=i;
17346this._calController=e;
17347this.setContent(this._contentHtml(t));
17348this.setTitle(ZmMsg.currentMeetings)
17349};
17350ZmQuickReminderDialog.prototype=new DwtDialog;
17351ZmQuickReminderDialog.prototype.constructor=ZmQuickReminderDialog;
17352ZmQuickReminderDialog.SOON=-AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES;
17353ZmQuickReminderDialog.prototype.toString=function(){
17354return"ZmQuickReminderDialog"
17355};
17356ZmQuickReminderDialog.prototype.popup=function(){
17357DwtDialog.prototype.popup.call(this)
17358};
17359ZmQuickReminderDialog.prototype.initialize=function(c){
17360this._list=c.clone();
17361this._apptData={};
17362var h=[];
17363var d=0;
17364var m=c.size();
17365h[d++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
17366for(var s=0;
17367s<m;
17368s++){
17369var e=c.get(s);
17370var l=e.getUniqueId(true);
17371var n=this._apptData[l]={
17372appt:e};
17373d=this._addAppt(h,d,e,n,(s>0))
17374}
17375if(m==0){
17376h[d++]='<tr name="rdsep">';
17377h[d++]="<td colspan=3><div>"+ZmMsg.noMeetingsFound+"</div></td>";
17378h[d++]="</tr>"
17379}
17380h[d++]="</table>";
17381if(this._openButtons){
17382for(var a in this._openButtons){
17383this._openButtons[a].dispose()
17384}}
17385this._openButtons={};
17386var u=new AjxListener(this,this._openButtonListener);
17387var t=document.getElementById(this._listId);
17388t.innerHTML=h.join("");
17389for(var s=0;
17390s<m;
17391s++){
17392var e=c.get(s);
17393var l=e.getUniqueId(true);
17394var n=this._apptData[l];
17395var o=this._openButtons[n.openBtnId]=new DwtButton({
17396parent:this,className:"DwtToolbarButton",parentElement:n.openBtnId}
17397);
17398o.setImage(e.otherAttendees?"ApptMeeting":"Appointment");
17399o.setText(ZmMsg.viewAppointment);
17400o.addSelectionListener(u);
17401o.apptUid=l;
17402this._updateDelta(n)
17403}};
17404ZmQuickReminderDialog.prototype._contentHtml=function(e){
17405this._listId=Dwt.getNextId();
17406return["<div class='ZmQuickReminderDialog' id='",this._listId,"'>"].join("")
17407};
17408ZmQuickReminderDialog.prototype._updateDelta=function(t){
17409var a=document.getElementById(t.deltaId);
17410if(a){
17411var e=this._computeDelta(t.appt);
17412if(e>=0){
17413a.className="ZmReminderOverdue"
17414}else{
17415if(e>ZmQuickReminderDialog.SOON){
17416a.className="ZmReminderSoon"
17417}else{
17418a.className="ZmReminderFuture"
17419}}
17420a.innerHTML=this._formatDeltaString(e)
17421}};
17422ZmQuickReminderDialog.prototype._addAppt=function(o,h,e,i,s){
17423i.openBtnId=Dwt.getNextId();
17424i.deltaId=Dwt.getNextId();
17425i.rowId=Dwt.getNextId();
17426var n=(e.folderId!=ZmOrganizer.ID_CALENDAR&&this._calController)?this._calController.getCalendarName(e.folderId):null;
17427var a=appCtxt.getById(e.folderId);
17428var l=e.isUpcomingEvent?" ("+ZmMsg.upcoming+")":"";
17429var t={
17430needSep: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};
17431o[h++]=AjxTemplate.expand("calendar.Calendar#ReminderDialogRow",t);
17432return h
17433};
17434ZmQuickReminderDialog.prototype._openButtonListener=function(o){
17435var s=DwtControl.getTargetControl(o);
17436var n=this._apptData[s.apptUid];
17437var a=n?n.appt:null;
17438if(a){
17439AjxDispatcher.require(["CalendarCore","Calendar"]);
17440var l=AjxDispatcher.run("GetCalController");
17441var t=new ZmAppt();
17442for(var e in a){
17443if(!AjxUtil.isFunction(a[e])){
17444t[e]=a[e]
17445}}
17446var h=new AjxCallback(l,l._showAppointmentDetails,t);
17447t.getDetails(null,h,null,null,true);
17448this.popdown()
17449}};
17450ZmQuickReminderDialog.prototype._getDurationText=function(a){
17451var o=a.isMultiDay();
17452var n=a.startDate;
17453var t=a.getEndTime();
17454var e=new Date(t);
17455if(a.isAllDayEvent()){
17456e=new Date(t-(o?2*AjxDateUtil.MSEC_PER_HOUR:0));
17457var i=o?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
17458return AjxMessageFormat.format(i,[n,e])
17459}
17460var i=o?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
17461return AjxMessageFormat.format(i,[n,e,""])
17462};
17463ZmQuickReminderDialog.prototype._computeDelta=function(e){
17464return((new Date()).getTime()-e.getStartTime())
17465};
17466ZmQuickReminderDialog.prototype._formatDeltaString=function(i){
17467var o=i<0?"In":"OverdueBy";
17468i=Math.abs(i);
17469var s=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*365));
17470if(s!=0){
17471i-=s*AjxDateUtil.MSEC_PER_DAY*365
17472}
17473var t=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*30.42));
17474if(t>0){
17475i-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
17476}
17477var d=Math.floor(i/AjxDateUtil.MSEC_PER_DAY);
17478if(d>0){
17479i-=d*AjxDateUtil.MSEC_PER_DAY
17480}
17481var l=Math.floor(i/AjxDateUtil.MSEC_PER_HOUR);
17482if(l>0){
17483i-=l*AjxDateUtil.MSEC_PER_HOUR
17484}
17485var e=Math.floor(i/60000);
17486if(e>0){
17487i-=e*60000
17488}
17489var n=Math.floor(i/1000);
17490if(n>30&&e<59){
17491e++
17492}
17493var n=0;
17494var a;
17495if(s>0){
17496a="Years";
17497if(s<=3&&t>0){
17498a="YearsMonths"
17499}}else{
17500if(t>0){
17501a="Months";
17502if(t<=3&&d>0){
17503a="MonthsDays"
17504}}else{
17505if(d>0){
17506a="Days";
17507if(d<=2&&l>0){
17508a="DaysHours"
17509}}else{
17510if(l>0){
17511a="Hours";
17512if(l<5&&e>0){
17513a="HoursMinutes"
17514}}else{
17515a="Minutes"
17516}}}}
17517var c=["reminder",o,a].join("");
17518var h=[i,s,t,d,l,e,n];
17519return AjxMessageFormat.format(ZmMsg[c],h)
17520}
17521}};
17522</script></head><body style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; overflow-x: hidden; overflow-y: hidden; ">
17523
17524<!--
17525***** BEGIN LICENSE BLOCK *****
17526Zimbra Collaboration Suite Web Client
17527Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Zimbra, Inc.
17528
17529The contents of this file are subject to the Zimbra Public License
17530Version 1.3 ("License"); you may not use this file except in
17531compliance with the License. You may obtain a copy of the License at
17532http://www.zimbra.com/license.
17533
17534Software distributed under the License is distributed on an "AS IS"
17535basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
17536***** END LICENSE BLOCK *****
17537-->
17538<script type="text/javascript" src="/zimbra/res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,AjxTemplateMsg.js.zgz?v=110527090709&amp;skin=velodrome2"></script>
17539
17540
17541<!-- image overlays and masks -->
17542<script>
17543if (!window.AjxImgData) AjxImgData = {};
17544AjxImgData["ImgCalendarFolderOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgCalendarFolderOverlay.png"};
17545AjxImgData["ImgContactsFolderOverlay"]={t:0,l:0,w:14,h:16,f:"@AppContextPath@/img/overlays/ImgContactsFolderOverlay.png"};
17546AjxImgData["ImgEmailedContactsOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgEmailedContactsOverlay.png"};
17547AjxImgData["ImgFolderOverlay"]={t:0,l:0,w:16,h:14,f:"@AppContextPath@/img/overlays/ImgFolderOverlay.png"};
17548AjxImgData["ImgInboxOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgInboxOverlay.png"};
17549AjxImgData["ImgMailFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgMailFolderOverlay.png"};
17550AjxImgData["ImgNotebookOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgNotebookOverlay.png"};
17551AjxImgData["ImgRSSOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgRSSOverlay.png"};
17552AjxImgData["ImgSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSectionOverlay.png"};
17553AjxImgData["ImgSentFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSentFolderOverlay.png"};
17554AjxImgData["ImgSharedCalendarFolderOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgSharedCalendarFolderOverlay.png"};
17555AjxImgData["ImgSharedContactsFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedContactsFolderOverlay.png"};
17556AjxImgData["ImgSharedMailFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedMailFolderOverlay.png"};
17557AjxImgData["ImgSharedNotebookOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedNotebookOverlay.png"};
17558AjxImgData["ImgSharedSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedSectionOverlay.png"};
17559AjxImgData["ImgSharedTaskListOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSharedTaskListOverlay.png"};
17560AjxImgData["ImgTagOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTagOverlay.png"};
17561AjxImgData["ImgTaskListOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTaskListOverlay.png"};
17562AjxImgData["ImgMailFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/mail.gif"};
17563AjxImgData["ImgRSSMask"]={t:-354,l:0,w:16,h:16,f:"@AppContextPath@/img/mail.gif"};
17564AjxImgData["ImgSharedTaskListMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/tasks.gif"};
17565AjxImgData["ImgTaskListMask"]={t:-114,l:0,w:16,h:16,f:"@AppContextPath@/img/tasks.gif"};
17566AjxImgData["ImgSentFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/startup.gif"};
17567AjxImgData["ImgSharedMailFolderMask"]={t:-18,l:0,w:16,h:17,f:"@AppContextPath@/img/startup.gif"};
17568AjxImgData["ImgInboxMask"]={t:-611,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
17569AjxImgData["ImgTagMask"]={t:-1491,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
17570AjxImgData["ImgFolderMask"]={t:-1731,l:0,w:16,h:14,f:"@AppContextPath@/img/startup.gif"};
17571AjxImgData["ImgSharedContactsFolderMask"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/contacts.gif"};
17572AjxImgData["ImgContactsFolderMask"]={t:-65,l:0,w:14,h:16,f:"@AppContextPath@/img/contacts.gif"};
17573AjxImgData["ImgEmailedContactsMask"]={t:-113,l:0,w:16,h:16,f:"@AppContextPath@/img/contacts.gif"};
17574AjxImgData["ImgNotebookMask"]={t:-80,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
17575AjxImgData["ImgSectionMask"]={t:-128,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
17576AjxImgData["ImgSharedNotebookMask"]={t:-160,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
17577AjxImgData["ImgSharedSectionMask"]={t:-208,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
17578AjxImgData["ImgCalendarFolderMask"]={t:-96,l:0,w:16,h:16,f:"@AppContextPath@/img/calendar.gif"};
17579AjxImgData["ImgSharedCalendarFolderMask"]={t:-413,l:0,w:15,h:15,f:"@AppContextPath@/img/calendar.gif"};
17580if (!window.AjxImgData) AjxImgData = {};
17581
17582document.write("<DIV style='display:none'>");
17583for (var id in AjxImgData) {
17584 var data = AjxImgData[id];
17585 if (data.f) data.f = data.f.replace(/@AppContextPath@/,appContextPath);
17586 document.write("<IMG id='",id,"' src='",data.d||data.f,"'>");
17587}
17588document.write("</DIV>");
17589</script><div style="display:none"><img id="ImgCalendarFolderOverlay" src="/zimbra/img/overlays/ImgCalendarFolderOverlay.png"><img id="ImgContactsFolderOverlay" src="/zimbra/img/overlays/ImgContactsFolderOverlay.png"><img id="ImgEmailedContactsOverlay" src="/zimbra/img/overlays/ImgEmailedContactsOverlay.png"><img id="ImgFolderOverlay" src="/zimbra/img/overlays/ImgFolderOverlay.png"><img id="ImgInboxOverlay" src="/zimbra/img/overlays/ImgInboxOverlay.png"><img id="ImgMailFolderOverlay" src="/zimbra/img/overlays/ImgMailFolderOverlay.png"><img id="ImgNotebookOverlay" src="/zimbra/img/overlays/ImgNotebookOverlay.png"><img id="ImgRSSOverlay" src="/zimbra/img/overlays/ImgRSSOverlay.png"><img id="ImgSectionOverlay" src="/zimbra/img/overlays/ImgSectionOverlay.png"><img id="ImgSentFolderOverlay" src="/zimbra/img/overlays/ImgSentFolderOverlay.png"><img id="ImgSharedCalendarFolderOverlay" src="/zimbra/img/overlays/ImgSharedCalendarFolderOverlay.png"><img id="ImgSharedContactsFolderOverlay" src="/zimbra/img/overlays/ImgSharedContactsFolderOverlay.png"><img id="ImgSharedMailFolderOverlay" src="/zimbra/img/overlays/ImgSharedMailFolderOverlay.png"><img id="ImgSharedNotebookOverlay" src="/zimbra/img/overlays/ImgSharedNotebookOverlay.png"><img id="ImgSharedSectionOverlay" src="/zimbra/img/overlays/ImgSharedSectionOverlay.png"><img id="ImgSharedTaskListOverlay" src="/zimbra/img/overlays/ImgSharedTaskListOverlay.png"><img id="ImgTagOverlay" src="/zimbra/img/overlays/ImgTagOverlay.png"><img id="ImgTaskListOverlay" src="/zimbra/img/overlays/ImgTaskListOverlay.png"><img id="ImgMailFolderMask" src="/zimbra/img/mail.gif"><img id="ImgRSSMask" src="/zimbra/img/mail.gif"><img id="ImgSharedTaskListMask" src="/zimbra/img/tasks.gif"><img id="ImgTaskListMask" src="/zimbra/img/tasks.gif"><img id="ImgSentFolderMask" src="/zimbra/img/startup.gif"><img id="ImgSharedMailFolderMask" src="/zimbra/img/startup.gif"><img id="ImgInboxMask" src="/zimbra/img/startup.gif"><img id="ImgTagMask" src="/zimbra/img/startup.gif"><img id="ImgFolderMask" src="/zimbra/img/startup.gif"><img id="ImgSharedContactsFolderMask" src="/zimbra/img/contacts.gif"><img id="ImgContactsFolderMask" src="/zimbra/img/contacts.gif"><img id="ImgEmailedContactsMask" src="/zimbra/img/contacts.gif"><img id="ImgNotebookMask" src="/zimbra/img/notes.gif"><img id="ImgSectionMask" src="/zimbra/img/notes.gif"><img id="ImgSharedNotebookMask" src="/zimbra/img/notes.gif"><img id="ImgSharedSectionMask" src="/zimbra/img/notes.gif"><img id="ImgCalendarFolderMask" src="/zimbra/img/calendar.gif"><img id="ImgSharedCalendarFolderMask" src="/zimbra/img/calendar.gif"></div>
17590
17591<!--
17592 --
17593 --
17594 --
17595 BEGIN SKIN
17596 --
17597 --
17598 --
17599 -->
17600
17601<!--
17602 - #define NAVIGATOR_COMPATIBLE true
17603 - #define SAFARI_3 true
17604 - #define SAFARI true
17605 - #define WEBKIT true
17606 - #define CHROME true
17607 - #define SAFARI_2_OR_HIGHER true
17608 -->
17609
17610<!--
17611 - File: zimbra/skins/velodrome2/skin.html
17612 -->
17613
17614<!-- BEGIN SKIN HTML -->
17615<script type="text/javascript">
17616document.title=ZmMsg.zimbraTitle;
17617</script>
17618
17619<!-- END SKIN HTML -->
17620
17621<!-- BEGIN SPLASH SCREEN -->
17622<div id="skin_container_splash_screen" class="skin_container_splash_screen" align="center">
17623 <script language="javascript">
17624 function showCompanyUrl() {
17625 window.open('<fmt:message key="splashScreenCompanyURL/>', '_blank');
17626 }
17627 </script>
17628 <!-- xr-feat-163 -->
17629 <div id="skin_container_splash_logo" class="skin_container_splash_logo"></div>
17630 <div class="skin_container_splash_loading"></div>
17631 <div class="skin_container_splash_footer">
17632 <div class="skin_container_splash_footer_logo"></div>
17633 <p>Copyright © Comcast Interactive Media 2011. All rights reserved.</p>
17634 </div>
17635 <!-- End xr-feat-163 -->
17636</div>
17637<!-- END SPLASH SCREEN -->
17638
17639
17640<!--
17641 --
17642 --
17643 --
17644 END SKIN
17645 --
17646 --
17647 --
17648 -->
17649<div style="display:none;">
17650
17651<!-- bootstrap classes -->
17652
17653 <script type="text/javascript">
17654 AjxEnv=function(){};
17655AjxEnv.DEFAULT_LOCALE=window.navigator.userLanguage||window.navigator.language||window.navigator.systemLanguage;
17656AjxEnv._inited=false;
17657AjxEnv.geckoDate;
17658AjxEnv.mozVersion;
17659AjxEnv.webKitVersion;
17660AjxEnv.isMac;
17661AjxEnv.isWindows;
17662AjxEnv.isLinux;
17663AjxEnv.isNav;
17664AjxEnv.isIE;
17665AjxEnv.isNav4;
17666AjxEnv.trueNs;
17667AjxEnv.isNav6;
17668AjxEnv.isNav6up;
17669AjxEnv.isNav7;
17670AjxEnv.isIE3;
17671AjxEnv.isIE4;
17672AjxEnv.isIE4up;
17673AjxEnv.isIE5;
17674AjxEnv.isIE5_5;
17675AjxEnv.isIE5up;
17676AjxEnv.isIE5_5up;
17677AjxEnv.isIE6;
17678AjxEnv.isIE6up;
17679AjxEnv.isIE7;
17680AjxEnv.isIE7up;
17681AjxEnv.isIE8;
17682AjxEnv.isIE8up;
17683AjxEnv.isNormalResolution;
17684AjxEnv.ieScaleFactor;
17685AjxEnv.isFirefox;
17686AjxEnv.isFirefox1up;
17687AjxEnv.isFirefox1_5up;
17688AjxEnv.isFirefox3up;
17689AjxEnv.isFirefox3_6up;
17690AjxEnv.isMozilla;
17691AjxEnv.isMozilla1_4up;
17692AjxEnv.isSafari;
17693AjxEnv.isSafari2;
17694AjxEnv.isSafari3;
17695AjxEnv.isSafari3up;
17696AjxEnv.isSafari4;
17697AjxEnv.isSafari4up;
17698AjxEnv.isSafari5up;
17699AjxEnv.isCamino;
17700AjxEnv.isChrome;
17701AjxEnv.isGeckoBased;
17702AjxEnv.isWebKitBased;
17703AjxEnv.isOpera;
17704AjxEnv.useTransparentPNGs;
17705AjxEnv.isDesktop;
17706AjxEnv.isDesktop2up;
17707AjxEnv.is800x600orLower;
17708AjxEnv.is1024x768orLower;
17709AjxEnv.reset=function(){
17710AjxEnv.geckoDate=0;
17711AjxEnv.mozVersion=-1;
17712AjxEnv.webKitVersion=-1;
17713AjxEnv.isMac=false;
17714AjxEnv.isWindows=false;
17715AjxEnv.isLinux=false;
17716AjxEnv.isNav=false;
17717AjxEnv.isIE=false;
17718AjxEnv.isNav4=false;
17719AjxEnv.trueNs=true;
17720AjxEnv.isNav6=false;
17721AjxEnv.isNav6up=false;
17722AjxEnv.isNav7=false;
17723AjxEnv.isIE3=false;
17724AjxEnv.isIE4=false;
17725AjxEnv.isIE4up=false;
17726AjxEnv.isIE5=false;
17727AjxEnv.isIE5_5=false;
17728AjxEnv.isIE5up=false;
17729AjxEnv.isIE5_5up=false;
17730AjxEnv.isIE6=false;
17731AjxEnv.isIE6up=false;
17732AjxEnv.isIE7=false;
17733AjxEnv.isIE7up=false;
17734AjxEnv.isIE8=false;
17735AjxEnv.isIE8up=false;
17736AjxEnv.isNormalResolution=false;
17737AjxEnv.ieScaleFactor=1;
17738AjxEnv.isFirefox=false;
17739AjxEnv.isFirefox1up=false;
17740AjxEnv.isFirefox1_5up=false;
17741AjxEnv.isFirefox3up=false;
17742AjxEnv.isFirefox3_6up=false;
17743AjxEnv.isMozilla=false;
17744AjxEnv.isMozilla1_4up=false;
17745AjxEnv.isSafari=false;
17746AjxEnv.isSafari2=false;
17747AjxEnv.isSafari3=false;
17748AjxEnv.isSafari4=false;
17749AjxEnv.isSafari3up=false;
17750AjxEnv.isSafari4up=false;
17751AjxEnv.isSafari5up=false;
17752AjxEnv.isCamino=false;
17753AjxEnv.isChrome=false;
17754AjxEnv.isGeckoBased=false;
17755AjxEnv.isWebKitBased=false;
17756AjxEnv.isOpera=false;
17757AjxEnv.useTransparentPNGs=false;
17758AjxEnv.isDesktop=false;
17759AjxEnv.isDesktop2up=false;
17760AjxEnv.is800x600orLower=screen&&(screen.width<=800&&screen.height<=600);
17761AjxEnv.is1024x768orLower=screen&&(screen.width<=1024&&screen.height<=768)
17762};
17763AjxEnv.parseUA=function(){
17764AjxEnv.reset();
17765var n=navigator.userAgent.toLowerCase();
17766var t=n.split(" ");
17767var c=false;
17768var o=false;
17769var r=false;
17770var e=false;
17771var a=false;
17772if(t!=null){
17773var u;
17774var l=-1;
17775if((l=t[0].search(/^\s*mozilla\//))!=-1){
17776e=true;
17777AjxEnv.browserVersion=parseFloat(t[0].substring(l+8));
17778AjxEnv.isNav=true
17779}
17780var s;
17781for(var h=0;
17782h<t.length;
17783++h){
17784s=t[h];
17785if(s.indexOf("compatible")!=-1){
17786a=true;
17787AjxEnv.isNav=false
17788}else{
17789if((s.indexOf("opera"))!=-1){
17790AjxEnv.isOpera=true;
17791AjxEnv.isNav=false;
17792u=parseFloat(t[h+1])
17793}else{
17794if((s.indexOf("spoofer"))!=-1){
17795c=true;
17796AjxEnv.isNav=false
17797}else{
17798if((s.indexOf("webtv"))!=-1){
17799o=true;
17800AjxEnv.isNav=false
17801}else{
17802if((s.indexOf("hotjava"))!=-1){
17803r=true;
17804AjxEnv.isNav=false
17805}else{
17806if((l=s.indexOf("msie"))!=-1){
17807AjxEnv.isIE=true;
17808u=parseFloat(t[h+1])
17809}else{
17810if((l=s.indexOf("gecko/"))!=-1){
17811AjxEnv.isGeckoBased=true;
17812AjxEnv.geckoDate=parseFloat(s.substr(l+6))
17813}else{
17814if((l=s.indexOf("applewebkit/"))!=-1){
17815AjxEnv.isWebKitBased=true;
17816AjxEnv.webKitVersion=parseFloat(s.substr(l+12))
17817}else{
17818if((l=s.indexOf("rv:"))!=-1){
17819AjxEnv.mozVersion=parseFloat(s.substr(l+3));
17820u=AjxEnv.mozVersion
17821}else{
17822if((l=s.indexOf("firefox/"))!=-1){
17823AjxEnv.isFirefox=true;
17824u=parseFloat(s.substr(l+8))
17825}else{
17826if((l=s.indexOf("prism"))!=-1){
17827AjxEnv.isPrism=true
17828}else{
17829if((l=s.indexOf("camino/"))!=-1){
17830AjxEnv.isCamino=true;
17831u=parseFloat(s.substr(l+7))
17832}else{
17833if((l=s.indexOf("netscape6/"))!=-1){
17834AjxEnv.trueNs=true;
17835u=parseFloat(s.substr(l+10))
17836}else{
17837if((l=s.indexOf("netscape/"))!=-1){
17838AjxEnv.trueNs=true;
17839u=parseFloat(s.substr(l+9))
17840}else{
17841if((l=s.indexOf("safari/"))!=-1){
17842AjxEnv.isSafari=true
17843}else{
17844if((l=s.indexOf("chrome/"))!=-1){
17845AjxEnv.isChrome=true;
17846u=parseFloat(s.substr(l+7))
17847}else{
17848if(l=s.indexOf("version/")!=-1){
17849u=parseFloat(s.substr(l+7))
17850}else{
17851if(s.indexOf("windows")!=-1){
17852AjxEnv.isWindows=true
17853}else{
17854if((s.indexOf("macintosh")!=-1)||(s.indexOf("mac_")!=-1)){
17855AjxEnv.isMac=true
17856}else{
17857if(s.indexOf("linux")!=-1){
17858AjxEnv.isLinux=true
17859}else{
17860if((l=s.indexOf("zdesktop/"))!=-1){
17861AjxEnv.isDesktop=true;
17862u=parseFloat(s.substr(l+9))
17863}}}}}}}}}}}}}}}}}}}}}}
17864AjxEnv.browserVersion=u;
17865AjxEnv.isNav=(e&&!c&&!a&&!AjxEnv.isOpera&&!o&&!r&&!AjxEnv.isSafari);
17866AjxEnv.isIE=(AjxEnv.isIE&&!AjxEnv.isOpera);
17867AjxEnv.isNav4=(AjxEnv.isNav&&(u==4)&&(!AjxEnv.isIE));
17868AjxEnv.isNav6=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6&&u<7));
17869AjxEnv.isNav6up=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6));
17870AjxEnv.isNav7=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=7&&u<8));
17871AjxEnv.isIE3=(AjxEnv.isIE&&u<4);
17872AjxEnv.isIE4=(AjxEnv.isIE&&u>=4&&u<5);
17873AjxEnv.isIE4up=(AjxEnv.isIE&&u>=4);
17874AjxEnv.isIE5=(AjxEnv.isIE&&u>=5&&u<6);
17875AjxEnv.isIE5_5=(AjxEnv.isIE&&u==5.5);
17876AjxEnv.isIE5up=(AjxEnv.isIE&&u>=5);
17877AjxEnv.isIE5_5up=(AjxEnv.isIE&&u>=5.5);
17878AjxEnv.isIE6=(AjxEnv.isIE&&u>=6&&u<7);
17879AjxEnv.isIE6up=(AjxEnv.isIE&&u>=6);
17880AjxEnv.isIE7=(AjxEnv.isIE&&u>=7&&u<8);
17881AjxEnv.isIE7up=(AjxEnv.isIE&&u>=7);
17882AjxEnv.isIE8=(AjxEnv.isIE&&u>=8&&u<9);
17883AjxEnv.isIE8up=(AjxEnv.isIE&&u>=8);
17884AjxEnv.isMozilla=((AjxEnv.isNav&&AjxEnv.mozVersion&&AjxEnv.isGeckoBased&&(AjxEnv.geckoDate!=0)));
17885AjxEnv.isMozilla1_4up=(AjxEnv.isMozilla&&(AjxEnv.mozVersion>=1.4));
17886AjxEnv.isFirefox=((AjxEnv.isMozilla&&AjxEnv.isFirefox));
17887AjxEnv.isFirefox1up=(AjxEnv.isFirefox&&u>=1);
17888AjxEnv.isFirefox1_5up=(AjxEnv.isFirefox&&u>=1.5);
17889AjxEnv.isFirefox2_0up=(AjxEnv.isFirefox&&u>=2);
17890AjxEnv.isFirefox3up=(AjxEnv.isFirefox&&u>=3);
17891AjxEnv.isFirefox3_5up=(AjxEnv.isFirefox&&u>=3.5);
17892AjxEnv.isFirefox3_6up=(AjxEnv.isFirefox&&u>=3.6);
17893AjxEnv.isSafari2=(AjxEnv.isSafari&&u>=2&&u<3);
17894AjxEnv.isSafari3=(AjxEnv.isSafari&&u>=3&&u<4)||AjxEnv.isChrome;
17895AjxEnv.isSafari4=(AjxEnv.isSafari&&u>=4);
17896AjxEnv.isSafari3up=(AjxEnv.isSafari&&u>=3)||AjxEnv.isChrome;
17897AjxEnv.isSafari4up=(AjxEnv.isSafari&&u>=4)||AjxEnv.isChrome;
17898AjxEnv.isSafari5up=(AjxEnv.isSafari&&u>=5)||AjxEnv.isChrome;
17899AjxEnv.isDesktop2up=(AjxEnv.isDesktop&&u>=2);
17900AjxEnv.isChrome7=(AjxEnv.isChrome&&u>=7);
17901AjxEnv.browser="[unknown]";
17902if(AjxEnv.isOpera){
17903AjxEnv.browser="OPERA"
17904}else{
17905if(AjxEnv.isSafari3up){
17906AjxEnv.browser="SAF3"
17907}else{
17908if(AjxEnv.isSafari){
17909AjxEnv.browser="SAF"
17910}else{
17911if(AjxEnv.isCamino){
17912AjxEnv.browser="CAM"
17913}else{
17914if(o){
17915AjxEnv.browser="WEBTV"
17916}else{
17917if(r){
17918AjxEnv.browser="HOTJAVA"
17919}else{
17920if(AjxEnv.isFirefox3up){
17921AjxEnv.browser="FF3.0"
17922}else{
17923if(AjxEnv.isFirefox2_0up){
17924AjxEnv.browser="FF2.0"
17925}else{
17926if(AjxEnv.isFirefox1_5up){
17927AjxEnv.browser="FF1.5"
17928}else{
17929if(AjxEnv.isFirefox1up){
17930AjxEnv.browser="FF1.0"
17931}else{
17932if(AjxEnv.isFirefox){
17933AjxEnv.browser="FF"
17934}else{
17935if(AjxEnv.isPrism){
17936AjxEnv.browser="PRISM"
17937}else{
17938if(AjxEnv.isNav7){
17939AjxEnv.browser="NAV7"
17940}else{
17941if(AjxEnv.isNav6){
17942AjxEnv.browser="NAV6"
17943}else{
17944if(AjxEnv.isNav4){
17945AjxEnv.browser="NAV4"
17946}else{
17947if(AjxEnv.isIE8){
17948AjxEnv.browser="IE8"
17949}else{
17950if(AjxEnv.isIE7){
17951AjxEnv.browser="IE7"
17952}else{
17953if(AjxEnv.isIE6){
17954AjxEnv.browser="IE6"
17955}else{
17956if(AjxEnv.isIE5){
17957AjxEnv.browser="IE5"
17958}else{
17959if(AjxEnv.isIE4){
17960AjxEnv.browser="IE4"
17961}else{
17962if(AjxEnv.isIE3){
17963AjxEnv.browser="IE"
17964}else{
17965if(AjxEnv.isDesktop){
17966AjxEnv.browser="ZDESKTOP"
17967}}}}}}}}}}}}}}}}}}}}}}
17968AjxEnv.platform="[unknown]";
17969if(AjxEnv.isWindows){
17970AjxEnv.platform="Win"
17971}else{
17972if(AjxEnv.isMac){
17973AjxEnv.platform="Mac"
17974}else{
17975if(AjxEnv.isLinux){
17976AjxEnv.platform="Linux"
17977}}}}
17978if(AjxEnv.isIE){
17979AjxEnv.isNormalResolution=true;
17980AjxEnv.ieScaleFactor=screen.deviceXDPI/screen.logicalXDPI;
17981if(AjxEnv.ieScaleFactor>1){
17982AjxEnv.isNormalResolution=false
17983}}
17984AjxEnv.useTransparentPNGs=!AjxEnv.isIE&&!AjxEnv.isLinux&&!AjxEnv.isSafari;
17985AjxEnv._inited=!AjxEnv.isIE;
17986if(AjxEnv.isSafari){
17987var d=AjxEnv.getWebkitVersion();
17988AjxEnv.isSafariNightly=(d&&d.is_nightly);
17989AjxEnv.isSafari2=!AjxEnv.isSafari3&&!AjxEnv.isSafariNightly
17990}};
17991AjxEnv.getWebkitVersion=function(){
17992var t;
17993var o=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");
17994var s=o.exec(navigator.userAgent);
17995if(s){
17996var e=s[1];
17997var n=e.split(".");
17998var a=(e[e.length-1]=="+");
17999var i=a?"+":parseInt(n[1]);
18000if(isNaN(i)){
18001i=""
18002}
18003t={
18004major:parseInt(n[0]),minor:i,is_nightly:a}
18005}
18006return t||{}
18007};
18008AjxEnv.parseUA();
18009AjxCallback=function(a,t,e){
18010if(arguments.length==0){
18011return
18012}
18013if(typeof arguments[0]=="function"){
18014this.obj=null;
18015this.func=arguments[0];
18016this.args=arguments[1]
18017}else{
18018this.obj=a;
18019this.func=t;
18020this.args=e
18021}};
18022AjxCallback.prototype.toString=function(){
18023return"AjxCallback"
18024};
18025AjxCallback.NOP=new AjxCallback(function(){}
18026);
18027AjxCallback.prototype.run=function(){
18028var e=[];
18029if(typeof this.args!="undefined"){
18030if(this.args instanceof Array){
18031e=arguments.length>0?e.concat(this.args):this.args
18032}else{
18033e.push(this.args)
18034}}
18035for(var t=0;
18036t<arguments.length;
18037++t){
18038e.push(arguments[t])
18039}
18040if(this.func){
18041return this.func.apply(this.obj||window,e)
18042}};
18043AjxCallback.prototype.run1=function(t){
18044var e=[];
18045if(typeof this.args!="undefined"){
18046if(this.args instanceof Array){
18047e=arguments.length>0?e.concat(this.args):this.args
18048}else{
18049e.push(this.args)
18050}}
18051if(t&&t.length){
18052for(var a=0;
18053a<t.length;
18054++a){
18055e.push(t[a])
18056}}
18057if(this.func){
18058return this.func.apply(this.obj||window,e)
18059}};
18060AjxCallback.simpleClosure=function(a,o){
18061var e=[];
18062for(var t=2;
18063t<arguments.length;
18064++t){
18065e.push(arguments[t])
18066}
18067return function(){
18068var s=[];
18069for(var n=0;
18070n<arguments.length;
18071++n){
18072s.push(arguments[n])
18073}
18074return a.apply(o||this,e.concat(s))
18075}
18076};
18077AjxCallback.returnFalse=function(){
18078return false
18079};
18080AjxCallback.isNull=function(e){
18081return e==null
18082};
18083AjxLoader=function(){};
18084AjxLoader.__createXHR;
18085if(window.XMLHttpRequest){
18086AjxLoader.__createXHR=function(){
18087return new XMLHttpRequest()
18088}
18089}else{
18090if(window.ActiveXObject){
18091(function(){
18092var t=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
18093for(var a=0;
18094a<t.length;
18095a++){
18096try{
18097new ActiveXObject(t[a]);
18098AjxLoader.__createXHR=function(){
18099return new ActiveXObject(t[a])
18100};
18101break
18102}
18103catch(o){}}}
18104)()
18105}}
18106AjxLoader.load=function(a){
18107var n=a;
18108if(typeof a=="string"){
18109n={
18110url:a}
18111}
18112var o=AjxLoader.__createXHR();
18113var i=Boolean(n.callback)?function(){
18114AjxLoader._response(o,n.callback)
18115}
18116:null;
18117var s=n.method||(n.content!=null?"POST":"GET");
18118if(i){
18119o.onreadystatechange=i
18120}
18121var t=n.async!=null?n.async:Boolean(i);
18122o.open(s,n.url,t,n.userName,n.password);
18123for(var e in n.headers){
18124o.setRequestHeader(e,n.headers[e])
18125}
18126o.send(n.content||"");
18127return o
18128};
18129AjxLoader._response=function(e,t){
18130if(e.readyState==4){
18131t.run(e)
18132}};
18133AjxPackage=function(){};
18134AjxPackage.METHOD_XHR_SYNC="xhr-sync";
18135AjxPackage.METHOD_XHR_ASYNC="xhr-async";
18136AjxPackage.METHOD_SCRIPT_TAG="script-tag";
18137AjxPackage.DEFAULT_SYNC=AjxPackage.METHOD_XHR_SYNC;
18138AjxPackage.DEFAULT_ASYNC=AjxEnv.isIE?AjxPackage.METHOD_XHR_ASYNC:AjxPackage.METHOD_SCRIPT_TAG;
18139AjxPackage._packages={};
18140AjxPackage._extension=".js";
18141AjxPackage.__depth=0;
18142AjxPackage.__scripts=[];
18143AjxPackage.__data={};
18144AjxPackage.setBasePath=function(e){
18145AjxPackage._basePath=e
18146};
18147AjxPackage.setExtension=function(e){
18148AjxPackage._extension=e
18149};
18150AjxPackage.setQueryString=function(e){
18151AjxPackage._queryString=e
18152};
18153AjxPackage.isDefined=function(e){
18154return Boolean(AjxPackage._packages[e])
18155};
18156AjxPackage.define=function(e){
18157AjxPackage.__log("DEFINE "+e,"font-weight:bold;font-style:italic");
18158e=AjxPackage.__package2path(e);
18159if(!AjxPackage._packages[e]){
18160AjxPackage._packages[e]=true;
18161return true
18162}
18163return false
18164};
18165AjxPackage.undefine=function(e){
18166AjxPackage.__log("UNDEFINE "+e,"font-weight:bold;font-style:italic");
18167e=AjxPackage.__package2path(e);
18168if(AjxPackage._packages[e]){
18169delete AjxPackage._packages[e]
18170}};
18171AjxPackage.require=function(a){
18172var b=a;
18173if(typeof a=="string"){
18174b={
18175name:a}
18176}
18177var s=b.name;
18178if(s instanceof Array){
18179if(!s.internal){
18180s=[].concat(s);
18181s.internal=true;
18182b.name=s
18183}
18184var x=s.shift();
18185if(s.length>0){
18186var o=new Function();
18187o.prototype=b;
18188o.prototype.constructor=o;
18189var n=new o();
18190n.name=x;
18191n.callback=new AjxCallback(null,AjxPackage.__requireNext,b);
18192AjxPackage.require(n);
18193return
18194}
18195b.name=x
18196}
18197var c=b.name;
18198var x=AjxPackage.__package2path(c);
18199var i=b.callback;
18200if(typeof i=="function"){
18201i=new AjxCallback(i)
18202}
18203var f=i?" (callback)":"";
18204var y=AjxPackage._packages[x]?" LOADED":"";
18205var d=AjxPackage.__scripts.length?" (async, queueing...)":"";
18206AjxPackage.__log(['REQUIRE "',c,'"',f,y,d].join(""));
18207var g=b.forceReload!=null?b.forceReload:false;
18208if(AjxPackage._packages[x]&&!g){
18209if(i){
18210i.run()
18211}
18212return
18213}
18214var w=b.basePath||AjxPackage._basePath||window.contextPath;
18215var h=b.extension||AjxPackage._extension;
18216var t=b.queryString||AjxPackage._queryString;
18217var k=[w,"/",x,h];
18218if(t){
18219k.push("?",t)
18220}
18221var m=k.join("");
18222var e=b.method||(b.callback?AjxPackage.DEFAULT_ASYNC:AjxPackage.DEFAULT_SYNC);
18223var l=e==AjxPackage.METHOD_XHR_SYNC||b.forceSync;
18224var r=!l;
18225var v={
18226name:x,path:m,method:e,async:r,callback:i||AjxCallback.NOP,scripts:r?[]:null};
18227if(l||AjxPackage.__scripts.length==0){
18228AjxPackage.__doLoad(v)
18229}else{
18230var p=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
18231v.method=p.method;
18232v.async=p.async;
18233v.scripts=[];
18234if(i){
18235var u=AjxPackage.__scripts[0];
18236u.callback=new AjxCallback(AjxPackage.__chainCallbacks,[u.callback,i]);
18237v.callback=AjxCallback.NOP
18238}
18239p.scripts.push(v)
18240}};
18241AjxPackage.eval=function(text){
18242if(window.execScript){
18243window.execScript(text)
18244}else{
18245if(AjxEnv.isGeckoBased){
18246window.eval(text)
18247}else{
18248var e=document.createElement("SCRIPT");
18249var t=document.createTextNode(text);
18250e.appendChild(t);
18251var heads=document.getElementsByTagName("HEAD");
18252if(heads.length==0){
18253heads=[document.createElement("HEAD")];
18254document.documentElement.appendChild(heads[0])
18255}
18256heads[0].appendChild(e)
18257}}};
18258AjxPackage.__package2path=function(e){
18259return e.replace(/\./g,"/").replace(/\*$/,"__all__")
18260};
18261AjxPackage.__requireNext=function(t){
18262var e=AjxCallback.simpleClosure(AjxPackage.require,null,t);
18263setTimeout(e,AjxEnv.isIE?10:0)
18264};
18265AjxPackage.__doLoad=function(e){
18266if(e.async){
18267AjxPackage.__doAsyncLoad(e)
18268}else{
18269AjxPackage.__doXHR(e)
18270}};
18271AjxPackage.__doAsyncLoad=function(t,e){
18272AjxPackage.__data[name]=t;
18273if(e||AjxPackage.__scripts.length==0){
18274AjxPackage.__scripts.push(t);
18275if(t.method==AjxPackage.METHOD_SCRIPT_TAG){
18276AjxPackage.__doScriptTag(t)
18277}else{
18278AjxPackage.__doXHR(t)
18279}}else{
18280var a=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
18281a.scripts.push(t)
18282}};
18283AjxPackage.__doScriptTag=function(i){
18284var e=document.createElement("SCRIPT");
18285e.type="text/javascript";
18286e.src=i.path;
18287if(AjxEnv.isIE){
18288var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoadIE,null,e);
18289e.attachEvent("onreadystatechange",t)
18290}else{
18291var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoad,null,i.name);
18292e.addEventListener("load",t,true)
18293}
18294var a=document.getElementsByTagName("HEAD");
18295if(!a||a.length==0){
18296a=[document.createElement("HEAD")];
18297document.documentElement.appendChild(a[0])
18298}
18299a[0].appendChild(e)
18300};
18301AjxPackage.__doXHR=function(a){
18302var i=a.async?new AjxCallback(null,AjxPackage.__onXHR,[a]):null;
18303var e={
18304url:a.path,userName:a.userName,password:a.password,async:a.async,callback:i};
18305var t=AjxLoader.load(e);
18306if(!a.async){
18307AjxPackage.__onXHR(a,t)
18308}};
18309AjxPackage.__onXHR=function(t,e){
18310if(e.status==200||e.status==0){
18311AjxPackage.__requireEval(e.responseText||"")
18312}else{
18313AjxPackage.__log("error: "+e.status,"background-color:red")
18314}
18315if(t.async){
18316AjxPackage.__onAsyncLoad()
18317}else{
18318AjxPackage.__onLoad(t)
18319}};
18320AjxPackage.__onAsyncLoadIE=function(e){
18321if(e.readyState=="loaded"){
18322AjxPackage.__onAsyncLoad()
18323}};
18324AjxPackage.__onAsyncLoad=function(){
18325var e;
18326while(e=AjxPackage.__scripts.pop()){
18327if(e.scripts.length){
18328AjxPackage.__scripts.push(e);
18329e=e.scripts.shift();
18330AjxPackage.__scripts.push(e);
18331AjxPackage.__doAsyncLoad(e,true);
18332return
18333}
18334AjxPackage.__onLoad(e)
18335}};
18336AjxPackage.__onLoad=function(t){
18337AjxPackage.define(t.name);
18338if(t.callback){
18339try{
18340t.callback.run()
18341}
18342catch(a){
18343AjxPackage.__log("error on callback: "+a,"color:red")
18344}}};
18345AjxPackage.__requireEval=function(text){
18346AjxPackage.__depth++;
18347try{
18348AjxPackage.eval(text)
18349}
18350catch(e){
18351AjxPackage.__log("error on eval: "+e,"color:red")
18352}
18353AjxPackage.__depth--
18354};
18355AjxPackage.__log=function(t,e){};
18356AjxPackage.__alertStack=function(r){
18357var e=[];
18358if(r){
18359e.push(r,"\n\n")
18360}
18361for(var s=AjxPackage.__scripts.length-1;
18362s>=0;
18363s--){
18364var t=AjxPackage.__scripts[s];
18365e.push(t.name," (",Boolean(t.callback),")","\n");
18366if(t.scripts){
18367for(var n=0;
18368n<t.scripts.length;
18369n++){
18370var o=t.scripts[n];
18371e.push(" ",o.name," (",Boolean(o.callback),")","\n")
18372}}}
18373alert(e.join(""))
18374};
18375AjxPackage.__chainCallbacks=function(t,e){
18376if(t){
18377t.run()
18378}
18379if(e){
18380e.run()
18381}};
18382AjxTemplate=function(){};
18383AjxTemplate._templates={};
18384AjxTemplate._stack=[];
18385AjxTemplate.setBasePath=function(e){
18386AjxTemplate._basePath=e
18387};
18388AjxTemplate.setExtension=function(e){
18389AjxTemplate._extension=e
18390};
18391AjxTemplate.register=function(t,a,i,e){
18392if(!e&&AjxTemplate._templates[t]&&AjxTemplate._templates[t].authoritative){
18393return
18394}
18395AjxTemplate._templates[t]={
18396name:t,func:a,params:i||{}
18397,authoritative:e}
18398};
18399AjxTemplate.getTemplate=function(e){
18400var t=AjxTemplate._templates[e];
18401return t&&t.func
18402};
18403AjxTemplate.getParams=function(e){
18404var t=AjxTemplate._templates[e];
18405return t&&t.params
18406};
18407AjxTemplate.expand=function(t,r,s){
18408if(!AjxTemplate._templates[t]&&AjxTemplate.compile){
18409var i=document.getElementById(t);
18410if(i){
18411var d=i.nodeName.toUpperCase()=="TEXTAREA";
18412AjxTemplate.compile(t,true,true,d?i.value:i.innerHTML)
18413}}
18414var c=AjxTemplate.__name2Package(t);
18415var a=t.replace(/^[^#]*#?/,"");
18416if(a){
18417t=[c,a].join("#")
18418}
18419AjxTemplate.require(c);
18420var h=Boolean(s);
18421s=s||[];
18422var o=AjxTemplate.getTemplate(t);
18423if(o){
18424try{
18425AjxTemplate._stack.push(c);
18426var n=AjxTemplate.getParams(t);
18427o(t,n,r,s)
18428}
18429catch(l){
18430s.push(this.__formatError(t,l))
18431}
18432finally{
18433AjxTemplate._stack.pop()
18434}}else{
18435s.push(this.__formatError(t,"template not found"))
18436}
18437return h?s.length:s.join("")
18438};
18439AjxTemplate.require=function(e){
18440AjxPackage.require({
18441name:AjxTemplate.__name2Package(e),basePath:AjxTemplate._basePath,extension:AjxTemplate._extension}
18442);
18443return AjxTemplate.getTemplate(e)!=null
18444};
18445AjxTemplate.setContent=function(a,e,i){
18446if(typeof a=="string"){
18447a=document.getElementById(a)
18448}
18449if(a==null){
18450return
18451}
18452var t=AjxTemplate.expand(e,i);
18453a.innerHTML=t
18454};
18455AjxTemplate.__name2Package=function(t){
18456var e=t.replace(/#.*$/,"");
18457if(t.match(/^#/)&&AjxTemplate._stack.length>0){
18458e=AjxTemplate._stack[AjxTemplate._stack.length-1]
18459}
18460return e
18461};
18462AjxTemplate.__formatError=function(e,t){
18463return"Error in template '"+e+"': "+t
18464};
18465AjxTemplate.compile=function(d,u,l,f){
18466var e=AjxPackage.__package2path(d);
18467var g=f!=null?f:AjxLoader.load(e).reponseText;
18468var r=[],s=0,h=true;
18469AjxTemplate.__RE_TEMPLATE.lastIndex=0;
18470var o=AjxTemplate.__RE_TEMPLATE.exec(g);
18471if(o){
18472do{
18473var p=AjxTemplate.__parseAttrs(o[1]);
18474var c=o[2];
18475if(p["xml:space"]!="preserve"){
18476c=c.replace(AjxTemplate.__RE_GT_LINESEP_LT,"><").trim()
18477}
18478var n=d;
18479var a=p.id;
18480if(a&&(a.indexOf("#")!=-1||a.match(/^\//))){
18481if(a.indexOf("#")==-1){
18482a+="#"
18483}
18484n=a.replace(/#.*$/,"").replace(/^\//,"").replace(/\//g,".");
18485a=a.replace(/^.*#/,"")
18486}
18487var t=a?n+"#"+a:n;
18488var i=AjxTemplate.__convertLines(c);
18489AjxTemplate.register(n,i,p,u);
18490if(h&&l){
18491AjxPackage.define(n)
18492}
18493if(h){
18494h=false;
18495AjxTemplate.register(n,i,p,u)
18496}}
18497while(o=AjxTemplate.__RE_TEMPLATE.exec(g))
18498}else{
18499if(l){
18500AjxPackage.define(d)
18501}
18502var i=AjxTemplate.__convertLines(g);
18503AjxTemplate.register(d,i,{}
18504,u)
18505}};
18506AjxTemplate.__RE_REPLACE=new RegExp(["\\$\\{(.+?)\\}","<\\$=(.+?)\\$>","<\\$(.+?)\\$>"].join("|"),"mg");
18507AjxTemplate.__RE_TEMPLATE=new RegExp("<template(.*?)>(.*?)</template>","mg");
18508AjxTemplate.__RE_ATTR=new RegExp("\\s*(\\S+)\\s*=\\s*('[^']*'|\"[^\"]*\")","mg");
18509AjxTemplate.__RE_PARAM_PART=new RegExp("([^\\(\\.]+)(\\(.*?\\))?\\.?","g");
18510AjxTemplate.__RE_GT_LINESEP_LT=new RegExp([">","\\s*\\n+\\s*","<"].join(""),"mg");
18511AjxTemplate.__convertLines=function(a){
18512var t=[],r=0;
18513t[r++]="\tvar _hasBuffer = Boolean(buffer);";
18514t[r++]='\tdata = (typeof data == "string" ? { id: data } : data) || {};';
18515t[r++]="\tbuffer = buffer || [];";
18516t[r++]="\tvar _i = buffer.length;";
18517t[r++]="\n";
18518AjxTemplate.__RE_REPLACE.lastIndex=0;
18519var e=AjxTemplate.__RE_REPLACE.exec(a);
18520if(e){
18521var o=0;
18522do{
18523var i=AjxTemplate.__RE_REPLACE.lastIndex-e[0].length;
18524if(o<i){
18525AjxTemplate.__printStringLines(t,a.substring(o,i))
18526}
18527var s=e[1];
18528var n=e[2];
18529if(s){
18530r=AjxTemplate.__printDataLine(t,s)
18531}else{
18532if(n){
18533r=AjxTemplate.__printBufferLine(t,n)
18534}else{
18535r=AjxTemplate.__printLine(t,"\t",e[3].replace(/\n/g,"\n\t"),"\n")
18536}}
18537o=AjxTemplate.__RE_REPLACE.lastIndex
18538}
18539while(e=AjxTemplate.__RE_REPLACE.exec(a));
18540if(o<a.length){
18541r=AjxTemplate.__printStringLines(t,a.substring(o))
18542}}else{
18543r=AjxTemplate.__printStringLines(t,a)
18544}
18545t[r++]="\n";
18546t[r++]='\treturn _hasBuffer ? buffer.length : buffer.join("");';
18547return new Function("name,params,data,buffer",t.join(""))
18548};
18549AjxTemplate.__parseAttrs=function(a){
18550var t={}
18551,e;
18552AjxTemplate.__RE_ATTR.lastIndex=0;
18553while(e=AjxTemplate.__RE_ATTR.exec(a)){
18554var i=e[2];
18555t[e[1]]=i.substring(1,i.length-1)
18556}
18557return t
18558};
18559AjxTemplate.__printLine=function(e,a){
18560var o=e.length;
18561for(var t=1;
18562t<arguments.length;
18563t++){
18564e[o++]=arguments[t]
18565}
18566return o
18567};
18568AjxTemplate.__printStringLines=function(a,r){
18569var l=a.length;
18570for(var n=1;
18571n<arguments.length;
18572n++){
18573var h=arguments[n];
18574var t=h.split("\n");
18575for(var o=0;
18576o<t.length;
18577o++){
18578var e=t[o];
18579l=AjxTemplate.__printStringLine(a,e,n<t.length-1?"\n":"")
18580}}
18581return l
18582};
18583AjxTemplate.__printStringLine=function(e,a){
18584var o=e.length;
18585e[o++]='\tbuffer[_i++] = "';
18586for(var t=1;
18587t<arguments.length;
18588t++){
18589o=AjxTemplate.__printEscaped(e,arguments[t])
18590}
18591e[o++]='";';
18592return o
18593};
18594AjxTemplate.__printDataLine=function(t,a){
18595var i=t.length,e;
18596t[i++]="\tbuffer[_i++] = data";
18597AjxTemplate.__RE_PARAM_PART.lastIndex=0;
18598while(e=AjxTemplate.__RE_PARAM_PART.exec(a)){
18599t[i++]='["';
18600t[i++]=e[1];
18601t[i++]='"]';
18602if(e[2]!=null){
18603t[i++]=e[2]
18604}}
18605t[i++]=";";
18606return i
18607};
18608AjxTemplate.__printBufferLine=function(e,a){
18609var o=e.length;
18610e[o++]="\tbuffer[_i++] = ";
18611for(var t=1;
18612t<arguments.length;
18613t++){
18614e[o++]=arguments[t]
18615}
18616e[o++]=";";
18617return o
18618};
18619AjxTemplate.__printEscaped=function(e,t){
18620var a=e.length;
18621e[a++]=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace("\n","\\n").replace("\r","\\r").replace("\t","\\t");
18622return a
18623};
18624AjxDispatcher=function(){};
18625AjxDispatcher._registry={};
18626AjxDispatcher._package={};
18627AjxDispatcher._preLoad=[];
18628AjxDispatcher._postLoad=[];
18629AjxDispatcher._loadFunctionsEnabled=false;
18630AjxDispatcher._timedAction=null;
18631AjxDispatcher.addPackageLoadFunction=function(e,a){
18632var t=AjxDispatcher._getPackageData(e);
18633if(!t._loaded&&!AjxPackage.isDefined(e)){
18634t.callback.push(a)
18635}else{
18636AjxTimedAction.scheduleAction(new AjxTimedAction(a,a.run),0)
18637}};
18638AjxDispatcher.addPreLoadFunction=function(e){
18639AjxDispatcher._preLoad.push(e)
18640};
18641AjxDispatcher.addPostLoadFunction=function(e){
18642AjxDispatcher._postLoad.push(e)
18643};
18644AjxDispatcher.setPackageLoadFunction=AjxDispatcher.addPackageLoadFunction;
18645AjxDispatcher.setPreLoadFunction=AjxDispatcher.addPreLoadFunction;
18646AjxDispatcher.setPostLoadFunction=AjxDispatcher.addPostLoadFunction;
18647AjxDispatcher.enableLoadFunctions=function(e){
18648AjxDispatcher._loadFunctionsEnabled=e
18649};
18650AjxDispatcher.loaded=function(e){
18651var t=AjxDispatcher._getPackageData(e);
18652return(t&&t._loaded)||AjxPackage.isDefined(e)
18653};
18654AjxDispatcher.setLoaded=function(t,e){
18655var n=AjxDispatcher._getPackageData(t);
18656n._loaded=e;
18657if(e){
18658var o=n.callback||[];
18659for(var a=0;
18660a<o.length;
18661a++){
18662o[a].run()
18663}}};
18664AjxDispatcher.registerMethod=function(a,e,t){
18665AjxDispatcher._registry[a]={
18666pkg:e,callback:t}
18667};
18668AjxDispatcher.run=function(o){
18669if(!o){
18670return
18671}
18672var e,a,t,l,h;
18673if(typeof(o)=="string"){
18674e=o;
18675t=false;
18676h=false
18677}else{
18678e=o.method;
18679a=o.noLoad;
18680l=o.callback;
18681t=o.async!=null?o.async:Boolean(l);
18682h=o.preLoadOk!=null?o.preLoadOk:(l!=null)
18683}
18684var c=AjxDispatcher._registry[e];
18685if(!c){
18686AjxPackage.__log("API method '"+e+"' not found");
18687return
18688}
18689AjxPackage.__log("Run method: "+e);
18690var r=c.pkg;
18691var s=[];
18692for(var n=1;
18693n<arguments.length;
18694++n){
18695s.push(arguments[n])
18696}
18697if(l){
18698s.push(l)
18699}
18700return AjxDispatcher.require(r,t,c.callback,s,h)
18701};
18702AjxDispatcher.require=function(n,a,h,s,r){
18703if(!n){
18704return
18705}
18706if(typeof(n)=="string"){
18707n=[n]
18708}
18709var l=[];
18710for(var o=0;
18711o<n.length;
18712o++){
18713var t=n[o];
18714if(!AjxDispatcher._getPackageData(t)._loaded){
18715l.push(t)
18716}}
18717if(l.length==0){
18718return AjxDispatcher._postLoadCallback(n,false,h,s)
18719}else{
18720var e=AjxDispatcher._preLoad;
18721if(r&&AjxDispatcher._loadFunctionsEnabled&&e.length){
18722AjxPackage.__log("pre-load function");
18723AjxDispatcher._timedAction=new AjxCallback(null,AjxDispatcher._continueRequire,[l,a,h,s]);
18724for(var o=0;
18725o<e.length;
18726o++){
18727e[o].run()
18728}
18729window.setTimeout("AjxDispatcher._timedAction.run()",0)
18730}else{
18731return AjxDispatcher._continueRequire(l,a,h,s)
18732}}};
18733AjxDispatcher._continueRequire=function(s,e,c,r){
18734var l=s.join(", ");
18735AjxPackage.__log("------------------------------------- Loading package: "+l);
18736if(window.console){
18737console.log("------------------------------------- Loading package: "+l)
18738}
18739if(e&&c){
18740var o=new AjxCallback(null,AjxDispatcher._postLoadCallback,[s,true,c,r]);
18741AjxPackage.require({
18742name:s,callback:o}
18743)
18744}else{
18745var n=new Date();
18746for(var a=0;
18747a<s.length;
18748a++){
18749AjxPackage.require(s[a])
18750}
18751var h=new Date();
18752var d=h.getTime()-n.getTime();
18753AjxPackage.__log("LOAD TIME for "+l+": "+d);
18754return AjxDispatcher._postLoadCallback(s,true,c,r)
18755}};
18756AjxDispatcher._postLoadCallback=function(r,n,l,h){
18757for(var a=0;
18758a<r.length;
18759a++){
18760AjxDispatcher._getPackageData(r[a])._loaded=true
18761}
18762for(var a=0;
18763a<r.length;
18764a++){
18765var e=AjxDispatcher._getPackageData(r[a]);
18766if(n&&e.callback.length&&!e.callbackDone){
18767e.callbackDone=true;
18768AjxPackage.__log("Running post-load package function for "+r[a]);
18769var s=e.callback;
18770for(var t=0;
18771t<s.length;
18772t++){
18773s[t].run()
18774}
18775e.callback.length=0
18776}}
18777if(n){
18778var o=AjxDispatcher._postLoad;
18779if(AjxDispatcher._loadFunctionsEnabled&&o.length){
18780for(var a=0;
18781a<o.length;
18782a++){
18783o[a].run()
18784}}}
18785if(l){
18786return l.run1(h)
18787}};
18788AjxDispatcher._getPackageData=function(e){
18789if(!AjxDispatcher._package[e]){
18790AjxDispatcher._package[e]={
18791callback:[]}
18792}
18793return AjxDispatcher._package[e]
18794};
18795 </script>
18796
18797
18798<script type="text/javascript">
18799AjxPackage.setBasePath("/zimbra/js");
18800AjxPackage.setExtension("_all.js.zgz");
18801AjxPackage.setQueryString("v=110527090709");
18802
18803AjxTemplate.setBasePath("/zimbra/templates");
18804AjxTemplate.setExtension(".template.js");
18805</script>
18806
18807<script>
18808 AjxEnv.DEFAULT_LOCALE = "en_US";
18809
18810 function switchToStandardClient() {
18811 document.location = appContextPath + "/?client=standard";
18812 }
18813
18814 var enforceMinDisplay = true;
18815 var unsupported = (screen && (screen.width <= 800 && screen.height <= 600) && !false) || (AjxEnv.isSafari && !AjxEnv.isSafari4up);
18816 if (enforceMinDisplay && unsupported) {
18817 switchToStandardClient();
18818 }
18819
18820</script>
18821<script>
18822/**
18823 * DO NOT EDIT! This file is generated.
18824 * <p>
18825 * Any copy of this file checked into source control is merely for
18826 * convenience and should not be edited in any way.
18827 * <p>
18828 * Generated at Sun Sep 30 09:07:34 PDT 2012
18829 * @private
18830 */
18831AjxTimezoneData = {};
18832
18833AjxTimezoneData.TRANSITION_YEAR = 2012;
18834
18835AjxTimezoneData.TIMEZONE_RULES = [
18836 { serverId: "Etc/GMT+12", clientId: "Etc/GMT+12", score: 100, standard: { offset: -720, tzname: "GMT+12" } },
18837 { serverId: "Pacific/Midway", clientId: "Pacific/Midway", score: 100, standard: { offset: -660, tzname: "SST" } },
18838 { serverId: "Pacific/Honolulu", clientId: "Pacific/Honolulu", score: 200, standard: { offset: -600, tzname: "HST" } },
18839 { serverId: "America/Anchorage", clientId: "America/Anchorage", score: 200,
18840 standard: { offset: -540, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "AKST" },
18841 daylight: { offset: -480, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "AKDT" }
18842 },
18843 { serverId: "America/Los_Angeles", clientId: "America/Los_Angeles", score: 200,
18844 standard: { offset: -480, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "PST" },
18845 daylight: { offset: -420, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "PDT" }
18846 },
18847 { serverId: "America/Tijuana", clientId: "America/Tijuana", score: 100,
18848 standard: { offset: -480, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "PST" },
18849 daylight: { offset: -420, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "PDT" }
18850 },
18851 { serverId: "America/Chihuahua", clientId: "America/Chihuahua", score: 100,
18852 standard: { offset: -420, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MST" },
18853 daylight: { offset: -360, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "MDT" }
18854 },
18855 { serverId: "America/Denver", clientId: "America/Denver", score: 200,
18856 standard: { offset: -420, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "MST" },
18857 daylight: { offset: -360, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "MDT" }
18858 },
18859 { serverId: "America/Phoenix", clientId: "America/Phoenix", score: 200, standard: { offset: -420, tzname: "MST" } },
18860 { serverId: "America/Chicago", clientId: "America/Chicago", score: 200,
18861 standard: { offset: -360, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "CST" },
18862 daylight: { offset: -300, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "CDT" }
18863 },
18864 { serverId: "America/Guatemala", clientId: "America/Guatemala", score: 100, standard: { offset: -360 } },
18865 { serverId: "America/Mexico_City", clientId: "America/Mexico_City", score: 100,
18866 standard: { offset: -360, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CST" },
18867 daylight: { offset: -300, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CDT" }
18868 },
18869 { serverId: "America/Regina", clientId: "America/Regina", score: 200, standard: { offset: -360, tzname: "CST" } },
18870 { serverId: "America/Bogota", clientId: "America/Bogota", score: 100, standard: { offset: -300 } },
18871 { serverId: "America/Indiana/Indianapolis", clientId: "America/Indiana/Indianapolis", score: 100,
18872 standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "EST" },
18873 daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "EDT" }
18874 },
18875 { serverId: "America/New_York", clientId: "America/New_York", score: 200,
18876 standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "EST" },
18877 daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "EDT" }
18878 },
18879 { serverId: "America/Caracas", clientId: "America/Caracas", score: 100, standard: { offset: -270, tzname: "VET" } },
18880 { serverId: "America/Asuncion", clientId: "America/Asuncion", score: 100,
18881 standard: { offset: -240, mon: 4, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 8 ], tzname: "PYT" },
18882 daylight: { offset: -180, mon: 10, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "PYST" }
18883 },
18884 { serverId: "America/Cuiaba", clientId: "America/Cuiaba", score: 100,
18885 standard: { offset: -240, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 2, 19 ], tzname: "AMT" },
18886 daylight: { offset: -180, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 21 ], tzname: "AMST" }
18887 },
18888 { serverId: "America/Guyana", clientId: "America/Guyana", score: 100, standard: { offset: -240, tzname: "GYT" } },
18889 { serverId: "America/Halifax", clientId: "America/Halifax", score: 100,
18890 standard: { offset: -240, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "AST" },
18891 daylight: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "ADT" }
18892 },
18893 { serverId: "America/Santiago", clientId: "America/Santiago", score: 100,
18894 standard: { offset: -240, mon: 4, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CLT" },
18895 daylight: { offset: -180, mon: 10, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 14 ], tzname: "CLST" }
18896 },
18897 { serverId: "America/St_Johns", clientId: "America/St_Johns", score: 100,
18898 standard: { offset: -210, mon: 11, week: 1, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2012, 11, 4 ], tzname: "NST" },
18899 daylight: { offset: -150, mon: 3, week: 2, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2012, 3, 11 ], tzname: "NDT" }
18900 },
18901 { serverId: "America/Argentina/Buenos_Aires", clientId: "America/Argentina/Buenos_Aires", score: 100, standard: { offset: -180 } },
18902 { serverId: "America/Cayenne", clientId: "America/Cayenne", score: 100, standard: { offset: -180, tzname: "GFT" } },
18903 { serverId: "America/Godthab", clientId: "America/Godthab", score: 100,
18904 standard: { offset: -180, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "WGT" },
18905 daylight: { offset: -120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "WGST" }
18906 },
18907 { serverId: "America/Montevideo", clientId: "America/Montevideo", score: 100,
18908 standard: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "UYT" },
18909 daylight: { offset: -120, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "UYST" }
18910 },
18911 { serverId: "America/Sao_Paulo", clientId: "America/Sao_Paulo", score: 100,
18912 standard: { offset: -180, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 2, 19 ], tzname: "BRT" },
18913 daylight: { offset: -120, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 21 ], tzname: "BRST" }
18914 },
18915 { serverId: "Atlantic/South_Georgia", clientId: "Atlantic/South_Georgia", score: 100, standard: { offset: -120, tzname: "GST" } },
18916 { serverId: "Atlantic/Azores", clientId: "Atlantic/Azores", score: 100,
18917 standard: { offset: -60, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AZOT" },
18918 daylight: { offset: 0, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AZOST" }
18919 },
18920 { serverId: "Atlantic/Cape_Verde", clientId: "Atlantic/Cape_Verde", score: 100, standard: { offset: -60, tzname: "CVT" } },
18921 { serverId: "Africa/Casablanca", clientId: "Africa/Casablanca", score: 100,
18922 standard: { offset: 0, mon: 8, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 8, 12 ], tzname: "WET" },
18923 daylight: { offset: 60, mon: 5, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 5, 6 ], tzname: "WEST" }
18924 },
18925 { serverId: "Africa/Monrovia", clientId: "Africa/Monrovia", score: 100, standard: { offset: 0, tzname: "GMT" } },
18926 { serverId: "Europe/London", clientId: "Europe/London", score: 100,
18927 standard: { offset: 0, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "GMT/BST" },
18928 daylight: { offset: 60, mon: 3, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "GMT/BST" }
18929 },
18930 { serverId: "UTC", clientId: "UTC", score: 100, standard: { offset: 0, tzname: "UTC" } },
18931 { serverId: "Africa/Algiers", clientId: "Africa/Algiers", score: 100, standard: { offset: 60, tzname: "CET" } },
18932 { serverId: "Africa/Windhoek", clientId: "Africa/Windhoek", score: 100,
18933 standard: { offset: 60, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "WAT" },
18934 daylight: { offset: 120, mon: 9, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 2 ], tzname: "WAST" }
18935 },
18936 { serverId: "Europe/Belgrade", clientId: "Europe/Belgrade", score: 100,
18937 standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
18938 daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
18939 },
18940 { serverId: "Europe/Berlin", clientId: "Europe/Berlin", score: 200,
18941 standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
18942 daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
18943 },
18944 { serverId: "Europe/Brussels", clientId: "Europe/Brussels", score: 100,
18945 standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
18946 daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
18947 },
18948 { serverId: "Europe/Warsaw", clientId: "Europe/Warsaw", score: 100,
18949 standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
18950 daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
18951 },
18952 { serverId: "Africa/Cairo", clientId: "Africa/Cairo", score: 100,
18953 standard: { offset: 120, mon: 9, week: -1, wkday: 5, hour: 0, min: 0, sec: 0, trans: [ 2012, 9, 27 ], tzname: "EET" },
18954 daylight: { offset: 180, mon: 4, week: -1, wkday: 6, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 27 ], tzname: "EEST" }
18955 },
18956 { serverId: "Africa/Harare", clientId: "Africa/Harare", score: 100, standard: { offset: 120, tzname: "CAT" } },
18957 { serverId: "Asia/Amman", clientId: "Asia/Amman", score: 100,
18958 standard: { offset: 120, mon: 10, week: -1, wkday: 6, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 26 ], tzname: "EET" },
18959 daylight: { offset: 180, mon: 3, week: -1, wkday: 5, hour: 23, min: 59, sec: 59, trans: [ 2012, 3, 29 ], tzname: "EEST" }
18960 },
18961 { serverId: "Asia/Beirut", clientId: "Asia/Beirut", score: 100,
18962 standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
18963 daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
18964 },
18965 { serverId: "Asia/Jerusalem", clientId: "Asia/Jerusalem", score: 100,
18966 standard: { offset: 120, mon: 9, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 9 ], tzname: "IST" },
18967 daylight: { offset: 180, mon: 3, week: -1, wkday: 6, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 30 ], tzname: "IDT" }
18968 },
18969 { serverId: "Europe/Athens", clientId: "Europe/Athens", score: 200,
18970 standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
18971 daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
18972 },
18973 { serverId: "Europe/Helsinki", clientId: "Europe/Helsinki", score: 100,
18974 standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
18975 daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
18976 },
18977 { serverId: "Europe/Minsk", clientId: "Europe/Minsk", score: 100,
18978 standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
18979 daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
18980 },
18981 { serverId: "Africa/Nairobi", clientId: "Africa/Nairobi", score: 200, standard: { offset: 180, tzname: "EAT" } },
18982 { serverId: "Asia/Baghdad", clientId: "Asia/Baghdad", score: 100, standard: { offset: 180 } },
18983 { serverId: "Asia/Kuwait", clientId: "Asia/Kuwait", score: 100, standard: { offset: 180, tzname: "AST" } },
18984 { serverId: "Europe/Moscow", clientId: "Europe/Moscow", score: 100,
18985 standard: { offset: 180, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MSK/MSD" },
18986 daylight: { offset: 240, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "MSK/MSD" }
18987 },
18988 { serverId: "Asia/Tehran", clientId: "Asia/Tehran", score: 100,
18989 standard: { offset: 210, mon: 9, week: 4, wkday: 4, hour: 0, min: 0, sec: 0, trans: [ 2012, 9, 26 ], tzname: "IRST" },
18990 daylight: { offset: 270, mon: 3, week: 4, wkday: 2, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 26 ], tzname: "IRDT" }
18991 },
18992 { serverId: "Asia/Baku", clientId: "Asia/Baku", score: 100,
18993 standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 5, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AZT" },
18994 daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AZST" }
18995 },
18996 { serverId: "Asia/Muscat", clientId: "Asia/Muscat", score: 100, standard: { offset: 240, tzname: "GST" } },
18997 { serverId: "Asia/Tbilisi", clientId: "Asia/Tbilisi", score: 200, standard: { offset: 240, tzname: "GET" } },
18998 { serverId: "Asia/Yerevan", clientId: "Asia/Yerevan", score: 100,
18999 standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AMT" },
19000 daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AMST" }
19001 },
19002 { serverId: "Indian/Mauritius", clientId: "Indian/Mauritius", score: 100, standard: { offset: 240 } },
19003 { serverId: "Asia/Kabul", clientId: "Asia/Kabul", score: 100, standard: { offset: 270, tzname: "AFT" } },
19004 { serverId: "Asia/Karachi", clientId: "Asia/Karachi", score: 200, standard: { offset: 300 } },
19005 { serverId: "Asia/Tashkent", clientId: "Asia/Tashkent", score: 100, standard: { offset: 300, tzname: "UZT" } },
19006 { serverId: "Asia/Yekaterinburg", clientId: "Asia/Yekaterinburg", score: 100,
19007 standard: { offset: 300, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "YEKT" },
19008 daylight: { offset: 360, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "YEKST" }
19009 },
19010 { serverId: "Asia/Colombo", clientId: "Asia/Colombo", score: 100, standard: { offset: 330, tzname: "IST" } },
19011 { serverId: "Asia/Kolkata", clientId: "Asia/Kolkata", score: 200, standard: { offset: 330, tzname: "IST" } },
19012 { serverId: "Asia/Almaty", clientId: "Asia/Almaty", score: 100, standard: { offset: 360, tzname: "ALMT" } },
19013 { serverId: "Asia/Dhaka", clientId: "Asia/Dhaka", score: 100, standard: { offset: 360 } },
19014 { serverId: "Asia/Novosibirsk", clientId: "Asia/Novosibirsk", score: 100,
19015 standard: { offset: 360, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "NOVT" },
19016 daylight: { offset: 420, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "NOVST" }
19017 },
19018 { serverId: "Asia/Rangoon", clientId: "Asia/Rangoon", score: 100, standard: { offset: 390, tzname: "MMT" } },
19019 { serverId: "Asia/Bangkok", clientId: "Asia/Bangkok", score: 100, standard: { offset: 420, tzname: "ICT" } },
19020 { serverId: "Asia/Krasnoyarsk", clientId: "Asia/Krasnoyarsk", score: 100,
19021 standard: { offset: 420, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "KRAT" },
19022 daylight: { offset: 480, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "KRAST" }
19023 },
19024 { serverId: "Asia/Hong_Kong", clientId: "Asia/Hong_Kong", score: 200, standard: { offset: 480 } },
19025 { serverId: "Asia/Irkutsk", clientId: "Asia/Irkutsk", score: 100,
19026 standard: { offset: 480, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "IRKT" },
19027 daylight: { offset: 540, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "IRKST" }
19028 },
19029 { serverId: "Asia/Kuala_Lumpur", clientId: "Asia/Kuala_Lumpur", score: 100, standard: { offset: 480, tzname: "MYT" } },
19030 { serverId: "Asia/Taipei", clientId: "Asia/Taipei", score: 100, standard: { offset: 480 } },
19031 { serverId: "Asia/Ulaanbaatar", clientId: "Asia/Ulaanbaatar", score: 100, standard: { offset: 480 } },
19032 { serverId: "Australia/Perth", clientId: "Australia/Perth", score: 100, standard: { offset: 480, tzname: "WST" } },
19033 { serverId: "Asia/Seoul", clientId: "Asia/Seoul", score: 100, standard: { offset: 540 } },
19034 { serverId: "Asia/Tokyo", clientId: "Asia/Tokyo", score: 200, standard: { offset: 540 } },
19035 { serverId: "Asia/Yakutsk", clientId: "Asia/Yakutsk", score: 100,
19036 standard: { offset: 540, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "YAKT" },
19037 daylight: { offset: 600, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "YAKST" }
19038 },
19039 { serverId: "Australia/Adelaide", clientId: "Australia/Adelaide", score: 100,
19040 standard: { offset: 570, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CST" },
19041 daylight: { offset: 630, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "CST" }
19042 },
19043 { serverId: "Australia/Darwin", clientId: "Australia/Darwin", score: 100, standard: { offset: 570, tzname: "CST" } },
19044 { serverId: "Asia/Vladivostok", clientId: "Asia/Vladivostok", score: 100,
19045 standard: { offset: 600, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "VLAT" },
19046 daylight: { offset: 660, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "VLAST" }
19047 },
19048 { serverId: "Australia/Brisbane", clientId: "Australia/Brisbane", score: 200, standard: { offset: 600, tzname: "EST" } },
19049 { serverId: "Australia/Hobart", clientId: "Australia/Hobart", score: 100,
19050 standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "EST" },
19051 daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "EST" }
19052 },
19053 { serverId: "Australia/Sydney", clientId: "Australia/Sydney", score: 200,
19054 standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "EST" },
19055 daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "EST" }
19056 },
19057 { serverId: "Pacific/Guam", clientId: "Pacific/Guam", score: 100, standard: { offset: 600, tzname: "ChST" } },
19058 { serverId: "Asia/Magadan", clientId: "Asia/Magadan", score: 100,
19059 standard: { offset: 660, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MAGT" },
19060 daylight: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "MAGST" }
19061 },
19062 { serverId: "Asia/Kamchatka", clientId: "Asia/Kamchatka", score: 100,
19063 standard: { offset: 720, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "PETT" },
19064 daylight: { offset: 780, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "PETST" }
19065 },
19066 { serverId: "Pacific/Auckland", clientId: "Pacific/Auckland", score: 100,
19067 standard: { offset: 720, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "NZST" },
19068 daylight: { offset: 780, mon: 9, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 30 ], tzname: "NZDT" }
19069 },
19070 { serverId: "Pacific/Fiji", clientId: "Pacific/Fiji", score: 100,
19071 standard: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "FJT" },
19072 daylight: { offset: 780, mon: 10, week: 4, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "FJST" }
19073 },
19074 { serverId: "Pacific/Tongatapu", clientId: "Pacific/Tongatapu", score: 100, standard: { offset: 780 } }
19075];
19076
19077</script>
19078
19079 <script src="/zimbra/js/Startup1_1_all.js.zgz?v=110527090709"></script>
19080
19081 <script src="/zimbra/js/Startup1_2_all.js.zgz?v=110527090709"></script>
19082
19083<script type="text/javascript">
19084function ZmSkin(e){
19085this.hints=this.mergeObjects({
19086name:"velodrome2",version:"2.0.0",logo:{
19087url:"http://www.comcast.net/"}
19088,banner:{
19089position:"static",url:"http://www.comcast.net/"}
19090,userInfo:{
19091position:"static"}
19092,search:{
19093position:"static"}
19094,quota:{
19095position:"static"}
19096,appChooser:{
19097direction:"LR"}
19098,helpButton:{
19099style:"link",container:"quota",url:""}
19100,logoutButton:{
19101style:"link",container:"quota"}
19102,toast:{
19103location:"N",transitions:[{
19104type:"fade-in",step:10,duration:200}
19105,{
19106type:"pause",duration:1000}
19107,{
19108type:"fade-out",step:-10,duration:500}
19109]}
19110,skin:{
19111containers:"skin_outer"}
19112,tree:{
19113minWidth:150,maxWidth:300,containers:["skin_td_outer_tree","skin_outer_tree","skin_col_tree_inner","skin_col_tree"]}
19114,searchBuilder:{
19115containers:["skin_container_search_builder_outer","skin_td_search_builder"]}
19116,topToolbar:{
19117containers:["skin_tr_top_toolbar","!skin_tr_top_toolbar_shim"]}
19118,bottomToolbar:{
19119containers:["skin_tr_bottom_toolbar","!skin_tr_bottom_toolbar_shim"]}
19120,treeFooter:{
19121containers:["skin_tr_tree_footer_sep","skin_tr_tree_footer"]}
19122,topAd:{
19123containers:["skin_tr_top_ad"]}
19124,sidebarAd:{
19125containers:["skin_td_sidebar_ad"]}
19126,fullScreen:{
19127containers:["skin_tr_toolbar_full","skin_tr_main_full","!skin_tr_toolbar","!skin_tr_main","!skin_tr_status"]}}
19128,e)
19129}
19130window.BaseSkin=ZmSkin;
19131ZmSkin.prototype={
19132show:function(a,r){
19133var s=this.hints[a]&&this.hints[a].containers;
19134if(s){
19135if(typeof s=="function"){
19136s(this,r);
19137skin._reflowApp();
19138return
19139}
19140if(typeof s=="string"){
19141s=[s]
19142}
19143for(var n=0;
19144n<s.length;
19145n++){
19146var o=s[n];
19147var t=o.replace(/^!/,"");
19148var e=o!=t;
19149this._showEl(t,e?!r:r)
19150}
19151skin._reflowApp()
19152}
19153if(a=="fullScreen"){
19154this._showFullScreen(r)
19155}}
19156,hide:function(e){
19157this.show(e,false)
19158}
19159,gotoApp:function(e,t){
19160appCtxt.getAppController().activateApp(e,null,t)
19161}
19162,gotoPrefs:function(e){
19163if(appCtxt.getCurrentAppName()!=ZmApp.PREFERENCES){
19164var t=new AjxCallback(this,this._gotoPrefPage,[e]);
19165this.gotoApp(ZmApp.PREFERENCES,t)
19166}else{
19167this._gotoPrefPage(e)
19168}}
19169,mergeObjects:function(e,o){
19170if(e==null){
19171e={}
19172}
19173for(var a=1;
19174a<arguments.length;
19175a++){
19176var n=arguments[a];
19177for(var t in n){
19178var s=e[t];
19179if(typeof s=="object"&&!(s instanceof Array)){
19180this.mergeObjects(e[t],n[t]);
19181continue
19182}
19183e[t]=n[t]
19184}}
19185return e
19186}
19187,getTreeWidth:function(){
19188return Dwt.getSize(this._getEl(this.hints.tree.containers[0])).x
19189}
19190,setTreeWidth:function(e){
19191this._setContainerSizes("tree",e,null)
19192}
19193,showTopAd:function(e){
19194skin._showEl("skin_tr_top_ad",e);
19195skin._reflowApp()
19196}
19197,hideTopAd:function(){
19198skin.showTopAd(false)
19199}
19200,getTopAdContainer:function(){
19201return skin._getEl("skin_container_top_ad")
19202}
19203,showSidebarAd:function(e){
19204var t="skin_td_sidebar_ad";
19205if(e!=null){
19206skin._setSize(t,e)
19207}
19208skin._showEl(t);
19209skin._reflowApp()
19210}
19211,hideSidebarAd:function(){
19212var e="skin_td_sidebar_ad";
19213skin._hideEl(e);
19214skin._reflowApp()
19215}
19216,getSidebarAdContainer:function(){
19217return this._getEl("skin_container_sidebar_ad")
19218}
19219,_getEl:function(e){
19220return(typeof e=="string"?document.getElementById(e):e)
19221}
19222,_showEl:function(o,i){
19223var t=this._getEl(o);
19224if(!t){
19225return
19226}
19227var a;
19228if(i==false){
19229a="none"
19230}else{
19231var e=t.tagName;
19232if(e=="TD"&&document.all==null){
19233a="table-cell"
19234}else{
19235if(e=="TR"&&document.all==null){
19236a="table-row"
19237}else{
19238a="block"
19239}}}
19240t.style.display=a
19241}
19242,_hideEl:function(e){
19243this._showEl(e,false)
19244}
19245,_reparentEl:function(i,e){
19246var a=this._getEl(e);
19247var t=a&&this._getEl(i);
19248if(t){
19249a.appendChild(t)
19250}}
19251,_setSize:function(i,a,e){
19252var t=this._getEl(i);
19253if(!t){
19254return
19255}
19256if(a!=null){
19257t.style.width=a
19258}
19259if(e!=null){
19260t.style.height=e
19261}}
19262,_setContainerSizes:function(n,a,e){
19263var o=this.hints[n].containers;
19264for(var t=0;
19265t<o.length;
19266t++){
19267this._setSize(o[t],a,null)
19268}}
19269,_reflowApp:function(){
19270if(window._zimbraMail){
19271window._zimbraMail.getAppViewMgr().fitAll()
19272}}
19273,_showFullScreen:function(i){
19274var a="skin_container_app_top_toolbar";
19275var t=i==null||i;
19276var e=t?"skin_border_app_top_toolbar_full":"skin_td_app_top_toolbar";
19277this._reparentEl(a,e);
19278if(AjxEnv.isIE){
19279var o=document.getElementById("skin_container_app_main_full");
19280if(o){
19281Dwt.setVisible(o,t)
19282}}}
19283,_gotoPrefPage:function(a){
19284if(a==null){
19285return
19286}
19287var i=appCtxt.getApp(ZmApp.PREFERENCES);
19288var t=i.getPrefController();
19289var e=t.getPrefsView();
19290e.selectSection(a)
19291}};
19292window.skin=new ZmSkin();
19293function VelodromeSkin(){
19294BaseSkin.call(this,{
19295appChooser:{
19296direction:"LR",fullWidth:true}
19297,helpButton:{
19298style:"link",container:"quota",hideIcon:true,url:"http://www.comcast.net/help/faq/index.jsp?cat=Email#SmartZone"}
19299,logoutButton:{
19300style:"link",container:"quota",hideIcon:true}
19301,quota:{
19302containers:["skin_td_quota"]}
19303,userInfo:{
19304position:"static"}
19305,sidebarAd:{
19306containers:function(t,e){
19307t._showEl("skin_sidebar_ad_outer",e);
19308t._reflowApp()
19309}}
19310,fullScreen:{
19311containers:["skin_tr_main_full","!skin_tr_main","!skin_td_tree_outer","!skin_td_tree_app_sash"]}
19312,searchBuilder:{
19313containers:["skin_tr_search_builder_toolbar","skin_tr_search_builder","skin_td_search_builder_toolbar","skin_td_search_builder"]}
19314,treeFooter:{
19315containers:["skin_tr_tree_footer","skin_td_tree_footer","skin_container_tree_footer"]}}
19316)
19317}
19318VelodromeSkin.prototype=new BaseSkin;
19319VelodromeSkin.prototype.constructor=VelodromeSkin;
19320VelodromeSkin.prototype.show=function(n,i){
19321ZmFolder.HIDE_ID[ZmFolder.ID_AUTO_ADDED]=true;
19322BaseSkin.prototype.show.apply(this,arguments);
19323if(n=="fullScreen"){
19324i=i==null||i;
19325var o=i?"skin_full_toolbar_container":"skin_main_toolbar_container";
19326var a=document.getElementById(o);
19327var t="skin_container_app_top_toolbar";
19328var e=document.getElementById(t);
19329a.appendChild(e)
19330}};
19331VelodromeSkin.prototype.getSidebarAdContainer=function(){
19332return document.getElementById("skin_container_sidebar_ad")
19333};
19334VelodromeSkin.prototype._getPortalToolBarOps=function(){
19335return[]
19336};
19337skin=new VelodromeSkin();
19338skin.__handleMailLaunch=function(){
19339appCtxt.set(ZmSetting.SEND_ON_BEHALF_OF,true)
19340};
19341ZmZimbraMail.addAppListener(ZmApp.MAIL,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin.__handleMailLaunch));
19342skin.__handleVoiceLaunch=function(){
19343ZmVoiceApp.overviewFallbackApp=ZmApp.MAIL
19344};
19345ZmZimbraMail.addAppListener(ZmApp.VOICE,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin.__handleVoiceLaunch));
19346skin.__handlePortalLaunch=function(){
19347this.overrideAPI(ZmPortalController.prototype,"_getToolBarOps",this._getPortalToolBarOps)
19348};
19349AjxDispatcher.addPackageLoadFunction("Portal",new AjxCallback(skin,skin.__handlePortalLaunch));
19350VelodromeSkin.prototype.overrideAPI=function(a,t,i){
19351i=i||this[t];
19352if(i){
19353var e=a[t];
19354a[t]=function(){
19355i.func=e;
19356return i.apply(this,arguments)
19357};
19358a[t].func=e
19359}};
19360VelodromeSkin.prototype.setShortcut=function(e){};
19361skin.overrideAPI(DwtMenuItem.prototype,"setShortcut");
19362VelodromeSkin.prototype._noImportExport_handlePrefsPreLaunch=function(){
19363var e="IMPORT_FOLDER";
19364var t=ZmPref.getPrefSectionWithPref(e);
19365ZmPref.unregisterPrefSection(t&&t.id);
19366e="CHECKED_ZIMLETS";
19367t=ZmPref.getPrefSectionWithPref(e);
19368ZmPref.unregisterPrefSection(t&&t.id)
19369};
19370ZmZimbraMail.addAppListener(ZmApp.PREFERENCES,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin._noImportExport_handlePrefsPreLaunch));
19371VelodromeSkin.prototype._collapseImapTrees_handlePreStartup=function(){
19372appCtxt.set(ZmSetting.COLLAPSE_IMAP_TREES,true)
19373};
19374ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,new AjxListener(skin,skin._collapseImapTrees_handlePreStartup));
19375VelodromeSkin.prototype._saveToImapSent_handlePreStartup=function(){
19376appCtxt.set(ZmSetting.SAVE_TO_IMAP_SENT,true)
19377};
19378ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,new AjxListener(skin,skin._saveToImapSent_handlePreStartup));
19379VelodromeSkin.prototype._MailList_initializeToolBar=function(t){
19380arguments.callee.func.call(this,t);
19381var e=this._toolbar[t];
19382if(e){
19383var a;
19384a=e.getButton(ZmOperation.CHECK_MAIL);
19385if(a){
19386if(!appCtxt.isOffline){
19387var i=(appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT)?ZmMsg.checkMailPrefDefault_velodrome:ZmMsg.checkMailPrefUpdate_velodrome;
19388a.setToolTipContent(i)
19389}}
19390a=e.getButton(ZmOperation.PRINT);
19391if(a){
19392a.setText(ZmMsg.print)
19393}
19394if(!appCtxt.isChildWindow){
19395a=e.getButton(ZmOperation.MOVE);
19396if(a){
19397a.setText(ZmMsg.move)
19398}
19399a=e.getButton(ZmOperation.DELETE_MENU);
19400if(a){
19401a.setText(ZmMsg.del)
19402}
19403a=e.getButton(ZmOperation.DELETE);
19404if(a){
19405a.setText(ZmMsg.del)
19406}
19407if(AjxEnv.is800x600orLower){
19408a=e.getButton(REPLY);
19409if(a){
19410a.setText("")
19411}
19412a=e.getButton(REPLY_ALL);
19413if(a){
19414a.setText("")
19415}}}}};
19416VelodromeSkin.prototype._DoublePane_getToolBarOps=VelodromeSkin.prototype._MailList_getToolBarOps=function(){
19417if(appCtxt.isChildWindow){
19418return[ZmOperation.PRINT,ZmOperation.CLOSE]
19419}
19420var e=this._getDefaultToolBarOps();
19421e.push(ZmOperation.SEP,ZmOperation.VIEW_MENU);
19422return e
19423};
19424VelodromeSkin.prototype._Msg_getToolBarOps=VelodromeSkin.prototype._Conv_getToolBarOps=function(){
19425if(appCtxt.isChildWindow){
19426return[ZmOperation.PRINT,ZmOperation.CLOSE]
19427}
19428var e=this._getDefaultToolBarOps();
19429e.push(ZmOperation.TAG_MENU,ZmOperation.SEP);
19430if(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)){
19431e.push(ZmOperation.DETACH)
19432}
19433return e
19434};
19435VelodromeSkin.prototype._Mail_getDefaultToolBarOps=function(){
19436var e=[];
19437e.push(ZmOperation.NEW_MENU,ZmOperation.CHECK_MAIL,ZmOperation.SEP,ZmOperation.REPLY,ZmOperation.REPLY_ALL,ZmOperation.FORWARD,ZmOperation.SEP,ZmOperation.EDIT);
19438e.push((window.ZmConvController&&this instanceof ZmConvController)?ZmOperation.DELETE_MENU:ZmOperation.DELETE);
19439e.push(ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.PRINT);
19440return e
19441};
19442VelodromeSkin.prototype._Mail_resetOperations=function(o,a){
19443arguments.callee.func.call(this,o,a);
19444if(o&&o instanceof ZmToolBar){
19445var n;
19446var e=this._getSearchFolderId();
19447if(a==1&&(e!=ZmFolder.ID_DRAFTS)){
19448var s=this._listView[this._currentView].getSelection();
19449if(s&&s.length){
19450n=s[0]
19451}}
19452var t=(n&&n.isDraft)||(e==ZmFolder.ID_DRAFTS);
19453var i=o.getButton&&o.getButton(ZmOperation.VIEW_MENU);
19454if(i){
19455var r=i.getMenu();
19456if(r){
19457r.enable(ZmOperation.DETACH,(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)&&!t&&a==1))
19458}}}};
19459VelodromeSkin.prototype._Mail_setupGroupByMenuItems=function(e,a){
19460arguments.callee.func.call(this,e,a);
19461if(a){
19462var t=a.createMenuItem(ZmOperation.DETACH,{
19463image:"OpenInNewWindow",text:ZmMsg.detach}
19464);
19465t.addSelectionListener(this._listeners[ZmOperation.DETACH])
19466}};
19467VelodromeSkin.prototype._createComcastAppIconButton=function(){
19468if(!appCtxt.isChildWindow){
19469VelodromeSkin.prototype._Msg_getTabParams=function(t,e){
19470return{
19471id:t,image:"MessageView",textPrecedence:85,tooltip:ZmMsgController.DEFAULT_TAB_TEXT,tabCallback:e,hasIcon:true}
19472};
19473VelodromeSkin.prototype._Compose_getTabParams=function(){
19474return{
19475id:this.tabId,image:"NewMessage",textPrecedence:75,tooltip:ZmComposeController.DEFAULT_TAB_TEXT,hasIcon:true}
19476};
19477ComcastAppIconButton=function(e){
19478if(arguments.length==0){
19479return
19480}
19481ZmAppButton.call(this,e)
19482};
19483ComcastAppIconButton.prototype=new ZmAppButton;
19484ComcastAppIconButton.prototype.constructor=ComcastAppIconButton;
19485ComcastAppIconButton.prototype.toString=function(){
19486return"ComcastAppIconButton"
19487};
19488ComcastAppIconButton.prototype.TEMPLATE="share.Widgets#ZmAppChooserIconButton";
19489VelodromeSkin.prototype._appChooser_addButton=function(i,a){
19490var t={
19491parent:this,id:ZmId.getButtonId(ZmId.APP,i),text:a.text,image:a.image,index:a.index};
19492var e=(a.hasIcon)?new ComcastAppIconButton(t):new ZmAppButton(t);
19493e.setToolTipContent(a.tooltip);
19494e.textPrecedence=a.textPrecedence;
19495e.imagePrecedence=a.imagePrecedence;
19496e.setData(Dwt.KEY_ID,i);
19497e.addSelectionListener(this._buttonListener);
19498this._buttons[i]=e;
19499if(e.textPrecedence||e.imagePrecedence){
19500this._createPrecedenceList()
19501}
19502this.adjustSize();
19503return e
19504}
19505}};
19506VelodromeSkin.prototype._mail_handleStartup2Load=function(){
19507if(appCtxt&&!appCtxt.isChildWindow){
19508this._createComcastAppIconButton();
19509var e=window.ZmAppChooser&&ZmAppChooser.prototype;
19510if(e){
19511this.overrideAPI(ZmAppChooser.prototype,"addButton",this._appChooser_addButton)
19512}}};
19513AjxDispatcher.addPackageLoadFunction("Startup2",new AjxCallback(skin,skin._mail_handleStartup2Load));
19514VelodromeSkin.prototype._mail_handleMailCoreLoad=function(){
19515var e=window.ZmDoublePaneController&&ZmDoublePaneController.prototype;
19516if(e){
19517this.overrideAPI(e,"_getToolBarOps",this._DoublePane_getToolBarOps);
19518this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
19519this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations)
19520}
19521var e=window.ZmMailListController&&ZmMailListController.prototype;
19522if(e){
19523this.overrideAPI(e,"_initializeToolBar",this._MailList_initializeToolBar);
19524this.overrideAPI(e,"_getToolBarOps",this._MailList_getToolBarOps);
19525this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
19526this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations);
19527this.overrideAPI(e,"_setupGroupByMenuItems",this._Mail_setupGroupByMenuItems)
19528}
19529ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_MESSAGE]="newMessage";
19530ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_FOLDER]="newFolder"
19531};
19532VelodromeSkin.prototype._mail_handleMailLoad=function(){
19533var e=window.ZmMsgController&&ZmMsgController.prototype;
19534if(e){
19535this.overrideAPI(e,"_getToolBarOps",this._Msg_getToolBarOps);
19536this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
19537this.overrideAPI(e,"_getTabParams",this._Msg_getTabParams)
19538}
19539var e=window.ZmConvController&&ZmConvController.prototype;
19540if(e){
19541this.overrideAPI(e,"_getToolBarOps",this._Conv_getToolBarOps);
19542this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
19543this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations)
19544}
19545var e=window.ZmComposeController&&ZmComposeController.prototype;
19546if(e){
19547this.overrideAPI(e,"_getTabParams",this._Compose_getTabParams)
19548}};
19549AjxDispatcher.addPackageLoadFunction("MailCore",new AjxCallback(skin,skin._mail_handleMailCoreLoad));
19550AjxDispatcher.addPackageLoadFunction("Mail",new AjxCallback(skin,skin._mail_handleMailLoad));
19551VelodromeSkin.prototype._getContactListToolBarOps=function(){
19552return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.PRINT,ZmOperation.SEP,ZmOperation.TAG_MENU]
19553};
19554VelodromeSkin.prototype._getContactListActionMenuOps=function(){
19555var e=this._participantOps();
19556e.push(ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.PRINT_CONTACT);
19557return e
19558};
19559VelodromeSkin.prototype.addRow=function(e,t){
19560arguments.callee.func.apply(this,arguments);
19561if(this._rowCount>=this._maxRows){
19562return
19563}
19564if(t==null){
19565t=this._rowCount-1
19566}
19567e=e||(this._rowDef&&AjxUtil.createProxy(this._rowDef));
19568if(!e){
19569return
19570}
19571e.id=e.id||this._items[t].id;
19572var a={};
19573a.id=e.id+"_helptext";
19574a.visible="true";
19575var o=this._registerControl(a,null,null,null,null,"DwtLabel");
19576var i=this._items[e.id];
19577i._helpId=a.id;
19578this._setControlIds(i.id,t);
19579if(this._itemDef.id=="EMAIL"){
19580this._setFirstHelpText(ZmMsg.contactEditAddRemoveHelp)
19581}};
19582VelodromeSkin.prototype.removeRow=function(e){
19583arguments.callee.func.apply(this,arguments);
19584if(this._itemDef.id=="EMAIL"){
19585this._setFirstHelpText(ZmMsg.contactEditAddRemoveHelp)
19586}};
19587VelodromeSkin.prototype._setFirstHelpText=function(o){
19588for(var e=0;
19589e<this._rowCount;
19590e++){
19591var a=this._items[e]._helpId;
19592if(a){
19593var t=this._items[a].control;
19594if(t){
19595t.setText((e==0)?o:"")
19596}}}};
19597VelodromeSkin.prototype._setControlIds=function(i,e){
19598arguments.callee.func.apply(this,arguments);
19599var o=[this.getHTMLElId(),e].join("_");
19600var t=this._items[i];
19601var a=this._items[t._helpId];
19602this._setControlId(a&&a.control,o+"_helptext")
19603};
19604VelodromeSkin.prototype._handleContactsLoad=function(){
19605var e=window.ZmContactListController&&ZmContactListController.prototype;
19606if(e){
19607this.overrideAPI(e,"_getToolBarOps",this._getContactListToolBarOps);
19608this.overrideAPI(e,"_getActionMenuOps",this._getContactListActionMenuOps)
19609}
19610var e=window.ZmEditContactViewInputSelectRows&&ZmEditContactViewInputSelectRows.prototype;
19611if(e){
19612this.overrideAPI(e,"addRow",this.addRow);
19613this.overrideAPI(e,"removeRow",this.removeRow);
19614this.overrideAPI(e,"_setControlIds",this._setControlIds);
19615this.overrideAPI(e,"_setFirstHelpText",this._setFirstHelpText)
19616}
19617ZmEditContactViewRows.prototype.ROW_TEMPLATE="abook.Contacts#ZmEditContactViewRow"
19618};
19619VelodromeSkin.prototype._handleContactsCoreLoad=function(){
19620ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_CONTACT]="newContact";
19621ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_GROUP]="newGroup"
19622};
19623AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._handleContactsLoad));
19624AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(skin,skin._handleContactsCoreLoad));
19625VelodromeSkin.prototype._SignaturesPage_initialize=function(t){
19626t.getHtmlElement().innerHTML=AjxTemplate.expand(ZmSignaturesPage.SIGNATURE_TEMPLATE,{
19627id:this._htmlElId}
19628);
19629var r=document.getElementById(this._htmlElId+"_SIG_LIST");
19630var h=new ZmSignatureListView(this);
19631this._replaceControlElement(r,h);
19632h.setMultiSelect(false);
19633h.addSelectionListener(new AjxListener(this,this._selectionListener));
19634h.setUI(null,true);
19635this._sigList=h;
19636var a=document.getElementById(this._htmlElId+"_SIG_NAME");
19637var o={
19638parent:this,type:DwtInputField.STRING,required:true,validationStyle:DwtInputField.CONTINUAL_VALIDATION,validator:AjxCallback.simpleClosure(this._updateName,this)};
19639var c=this._sigName=new DwtInputField(o);
19640this._replaceControlElement(a,c);
19641var l=document.getElementById(this._htmlElId+"_SIG_FORMAT");
19642if(l&&appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
19643var d=new DwtSelect(this);
19644d.setToolTipContent(ZmMsg.formatTooltip);
19645d.addOption(ZmMsg.formatAsText,1,true);
19646d.addOption(ZmMsg.formatAsHtml,0,false);
19647d.addChangeListener(new AjxListener(this,this._handleFormatSelect));
19648this._replaceControlElement(l,d);
19649this._sigFormat=d
19650}
19651var e=document.getElementById(this._htmlElId+"_SIG_BUTTON");
19652var n=new DwtButton(this);
19653n.setText(ZmMsg.del);
19654n.addSelectionListener(new AjxListener(this,this._handleDeleteButton));
19655this._replaceControlElement(e,n);
19656this._sigBtn=n;
19657var i=document.getElementById(this._htmlElId+"_SIG_EDITOR");
19658var s=new ZmSignatureEditor(this);
19659this._replaceControlElement(i,s);
19660this._sigEditor=s
19661};
19662VelodromeSkin.prototype._SignaturesPage_validate=function(){
19663if(this._selSignature){
19664this._updateSignature()
19665}
19666var h=this.getAllSignatures(true);
19667var e=appCtxt.get(ZmSetting.SIGNATURE_MAX_LENGTH);
19668for(var n=0;
19669n<h.length;
19670n++){
19671var t=h[n];
19672var r=(t.name.replace(/\s*/g,"")=="");
19673var o=(t.value.replace(/\s*/g,"")=="");
19674var l=new RegExp("^"+ZmMsg.signature+"\\s#(\\d+)$","i");
19675var a=t.name.match(l);
19676if(r&&o){
19677this._deleteSignature(t)
19678}else{
19679if(r||(o&&!a)){
19680this._errorMsg=r?ZmMsg.signatureNameMissingRequired:ZmMsg.signatureValueMissingRequired;
19681return false
19682}}
19683var s=t.value;
19684if(s.length>e){
19685this._errorMsg=AjxMessageFormat.format((t.contentType==ZmMimeTable.TEXT_HTML)?ZmMsg.errorHtmlSignatureTooLong:ZmMsg.errorSignatureTooLong,e);
19686return false
19687}}
19688return true
19689};
19690VelodromeSkin.prototype._preferences_handlePreferencesLoad=function(){
19691var e=window.ZmSignaturesPage&&ZmSignaturesPage.prototype;
19692if(e){
19693this.overrideAPI(e,"_initialize",this._SignaturesPage_initialize);
19694this.overrideAPI(e,"validate",this._SignaturesPage_validate)
19695}};
19696AjxDispatcher.addPackageLoadFunction("Preferences",new AjxCallback(skin,skin._preferences_handlePreferencesLoad));
19697VelodromeSkin.F_homeAddress="homeAddress";
19698VelodromeSkin.F_otherAddress="otherAddress";
19699VelodromeSkin.F_otherAnniversary="otherAnniversary";
19700VelodromeSkin.F_otherAsstName="otherAsstName";
19701VelodromeSkin.F_otherCustom="otherCustom";
19702VelodromeSkin.F_otherDepartment="otherDepartment";
19703VelodromeSkin.F_otherMgrName="otherMgrName";
19704VelodromeSkin.F_otherOffice="otherOffice";
19705VelodromeSkin.F_otherProfession="otherProfession";
19706VelodromeSkin.F_tollFree="tollFree";
19707VelodromeSkin.F_workAddress="workAddress";
19708VelodromeSkin.F_workEmail="workEmail";
19709VelodromeSkin.F_workIMAddress="workIM";
19710VelodromeSkin.F_workMobile="workMobile";
19711VelodromeSkin.F_imNone="_NONE";
19712VelodromeSkin.F_imYahoo="yahoo";
19713VelodromeSkin.F_imAOL="aol";
19714VelodromeSkin.F_imMSN="msn";
19715VelodromeSkin.F_imOther="other";
19716VelodromeSkin.prototype._customContactFields_packageLoad=function(){
19717window.VelodromeSkinOther=function(){
19718ZmEditContactViewOther.apply(this,arguments)
19719};
19720VelodromeSkinOther.prototype=new ZmEditContactViewOther;
19721VelodromeSkinOther.prototype.constructor=VelodromeSkinOther;
19722VelodromeSkinOther.prototype.DATE_ATTRS={
19723birthday:true,otherAnniversary:true};
19724VelodromeSkinOther.prototype._createSelect=function(){
19725var t=ZmEditContactViewInputSelect.prototype._createSelect.apply(this,arguments);
19726t.addChangeListener(new AjxListener(this,this._resetPicker));
19727return t
19728};
19729ZmEditContactView.updateFieldLists();
19730ZmEditContactView.LISTS.EMAIL.onlyvalue=false;
19731ZmEditContactView.LISTS.IM.onlyvalue=false;
19732ZmEditContactView.LISTS.VELODROME_ADDRESS=ZmEditContactView.LISTS.ADDRESS;
19733ZmEditContactView.ATTRS.DEPARTMENT=VelodromeSkin.F_otherDepartment;
19734delete ZmEditContactView.LISTS.ADDRESS;
19735ZmEditContactView.ALWAYS_SHOW={
19736FIRST:true,LAST:true,TITLE:true,COMPANY:true};
19737var e=ZmEditContactView.prototype;
19738this.overrideAPI(e,"getFormItems");
19739this.overrideAPI(e,"getEmailOptions");
19740this.overrideAPI(e,"getPhoneOptions");
19741this.overrideAPI(e,"getIMOptions");
19742this.overrideAPI(e,"getIMOptions2");
19743this.overrideAPI(e,"getAddressOptions");
19744this.overrideAPI(e,"getURLOptions");
19745this.overrideAPI(e,"getOtherOptions");
19746this.overrideAPI(e,"getFileAsOptions")
19747};
19748VelodromeSkin.prototype._customContactFields_basePackageLoad=function(){
19749ZmContact.EMAIL_FIELDS=[ZmContact.F_email,VelodromeSkin.F_workEmail];
19750ZmContact.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];
19751ZmContact.IM_FIELDS=[ZmContact.F_imAddress,VelodromeSkin.F_workIMAddress];
19752ZmContact.ADDRESS_FIELDS=[VelodromeSkin.F_homeAddress,VelodromeSkin.F_workAddress,VelodromeSkin.F_otherAddress];
19753ZmContact.OTHER_FIELDS=[ZmContact.F_birthday,VelodromeSkin.F_otherAnniversary,VelodromeSkin.F_otherOffice,VelodromeSkin.F_otherProfession,VelodromeSkin.F_otherMgrName,VelodromeSkin.F_otherAsstName,VelodromeSkin.F_otherCustom];
19754ZmContact.updateFieldConstants();
19755ZmContact.IS_ADDONE[VelodromeSkin.F_workEmail]=true;
19756ZmContact.IS_ADDONE[VelodromeSkin.F_workIMAddress]=true;
19757ZmContact.IS_ADDONE[VelodromeSkin.F_otherCustom]=true;
19758ZmContact.IGNORE_NORMALIZATION=[ZmContact.F_homePhone]
19759};
19760VelodromeSkin.prototype.getFormItems=function(){
19761var t=arguments.callee.func.apply(this,arguments);
19762if(!t._modified){
19763t._modified=true;
19764var i=this.getFormItemById("IM",t);
19765i.type="ZmEditContactViewInputDoubleSelectRows";
19766i.rowitem={
19767type:"ZmEditContactViewIMDouble",equals:ZmEditContactViewInputSelect.equals,params:{
19768hint:ZmMsg.imScreenNameHint,cols:60,options:this.getIMOptions(),options2:this.getIMOptions2()}};
19769i.maxrows=4;
19770var a=this.getFormItemById("ADDRESS",t);
19771a.id="VELODROME_ADDRESS",a.rowitem={
19772type:"ZmEditContactViewInputSelect",equals:ZmEditContactViewInputSelect.equals,template:"abook.Contacts#ZmEditContactViewAddressSelect",params:{
19773hint:"Address",cols:40,rows:3,options:this.getAddressOptions()}};
19774var e=this.getFormItemById("OTHER",t);
19775e.rowitem.type="VelodromeSkinOther"
19776}
19777return t
19778};
19779VelodromeSkin.prototype.getEmailOptions=function(){
19780return[{
19781value:ZmContact.F_email,label:"Home",max:3}
19782,{
19783value:VelodromeSkin.F_workEmail,label:"Work",max:3}
19784]
19785};
19786VelodromeSkin.prototype.getPhoneOptions=function(){
19787return[{
19788value:ZmContact.F_mobilePhone,label:"Mobile",max:1}
19789,{
19790value:ZmContact.F_homePhone,label:"Home",max:1}
19791,{
19792value:ZmContact.F_otherPhone,label:"Home Alternate",max:1}
19793,{
19794value:ZmContact.F_homeFax,label:"Home Fax",max:1}
19795,{
19796value:ZmContact.F_pager,label:"Work Pager",max:1}
19797,{
19798value:ZmContact.F_workPhone,label:"Work",max:1}
19799,{
19800value:VelodromeSkin.F_workMobile,label:"Work Mobile",max:1}
19801,{
19802value:ZmContact.F_workAltPhone,label:"Work Alternate",max:1}
19803,{
19804value:ZmContact.F_workFax,label:"Work Fax",max:1}
19805,{
19806value:ZmContact.F_assistantPhone,label:"Assistant",max:1}
19807,{
19808value:ZmContact.F_companyPhone,label:"Company",max:1}
19809,{
19810value:ZmContact.F_otherFax,label:"Other Fax",max:1}
19811,{
19812value:VelodromeSkin.F_tollFree,label:"Toll Free",max:1}
19813]
19814};
19815VelodromeSkin.prototype.getIMOptions2=function(){
19816return[{
19817value:VelodromeSkin.F_imNone,label:ZmMsg.none}
19818,{
19819value:VelodromeSkin.F_imYahoo,label:ZmMsg.imGateway_yahoo}
19820,{
19821value:VelodromeSkin.F_imAOL,label:ZmMsg.imGateway_aol}
19822,{
19823value:VelodromeSkin.F_imMSN,label:ZmMsg.imGateway_msn}
19824,{
19825value:VelodromeSkin.F_imOther,label:ZmMsg.other}
19826]
19827};
19828VelodromeSkin.prototype.getIMOptions=function(){
19829return[{
19830value:ZmContact.F_imAddress,label:"Home",max:2}
19831,{
19832value:VelodromeSkin.F_workIMAddress,label:"Work",max:2}
19833]
19834};
19835VelodromeSkin.prototype.getAddressOptions=function(){
19836return[{
19837value:VelodromeSkin.F_homeAddress,label:"Home",max:1}
19838,{
19839value:VelodromeSkin.F_workAddress,label:"Work",max:1}
19840,{
19841value:VelodromeSkin.F_otherAddress,label:ZmMsg.other,max:1}
19842]
19843};
19844VelodromeSkin.prototype.getURLOptions=function(){
19845return[{
19846value:ZmContact.F_homeURL,label:"Home",max:1}
19847,{
19848value:ZmContact.F_workURL,label:"Work",max:1}
19849]
19850};
19851VelodromeSkin.prototype.getOtherOptions=function(){
19852return[{
19853value:ZmContact.F_birthday,label:"Birthday",max:1}
19854,{
19855value:VelodromeSkin.F_otherAnniversary,label:"Anniversary",max:1}
19856,{
19857value:VelodromeSkin.F_otherOffice,label:"Office",max:1}
19858,{
19859value:VelodromeSkin.F_otherProfession,label:"Profession",max:1}
19860,{
19861value:VelodromeSkin.F_otherMgrName,label:"Manager",max:1}
19862,{
19863value:VelodromeSkin.F_otherAsstName,label:"Assistant",max:1}
19864,{
19865value:VelodromeSkin.F_otherCustom,label:"Custom",max:4}
19866]
19867};
19868VelodromeSkin.prototype.getFileAsOptions=function(){
19869return arguments.callee.func.apply(this,arguments)
19870};
19871AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._customContactFields_packageLoad));
19872AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(skin,skin._customContactFields_basePackageLoad));
19873JSON=function(){};
19874(function(){
19875function e(t){
19876return t<10?"0"+t:t
19877}
19878if(typeof Date.prototype.toJSON!=="function"){
19879Date.prototype.toJSON=function(t){
19880return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"Z":null
19881}
19882}
19883String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){
19884return this.valueOf()
19885}
19886}
19887)();
19888JSON.cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
19889JSON.escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
19890JSON.meta={
19891"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
19892JSON.rep;
19893JSON.quote=function(e){
19894JSON.escapable.lastIndex=0;
19895return JSON.escapable.test(e)?'"'+e.replace(JSON.escapable,function(t){
19896var i=JSON.meta[t];
19897return typeof i==="string"?i:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)
19898}
19899)+'"':'"'+e+'"'
19900};
19901JSON.str=function(h,n){
19902var a,t,l,e,s=JSON.gap,o,r=n[h];
19903if(r&&typeof r==="object"&&typeof r.toJSON==="function"){
19904r=r.toJSON(h)
19905}
19906if(typeof JSON.rep==="function"){
19907r=JSON.rep.call(n,h,r)
19908}
19909switch(typeof r){
19910case"string":return JSON.quote(r);
19911case"number":return isFinite(r)?String(r):"null";
19912case"boolean":case"null":return String(r);
19913case"object":if(!r){
19914return"null"
19915}
19916JSON.gap+=JSON.indent;
19917o=[];
19918if(Object.prototype.toString.apply(r)==="[object Array]"){
19919e=r.length;
19920for(a=0;
19921a<e;
19922a+=1){
19923o[a]=str(a,r)||"null"
19924}
19925l=o.length===0?"[]":JSON.gap?"[\n"+JSON.gap+o.join(",\n"+JSON.gap)+"\n"+s+"]":"["+o.join(",")+"]";
19926JSON.gap=s;
19927return l
19928}
19929if(JSON.rep&&typeof JSON.rep==="object"){
19930e=JSON.rep.length;
19931for(a=0;
19932a<e;
19933a+=1){
19934t=JSON.rep[a];
19935if(typeof t==="string"){
19936l=str(t,r);
19937if(l){
19938o.push(JSON.quote(t)+(JSON.gap?": ":":")+l)
19939}}}}else{
19940for(t in r){
19941if(Object.hasOwnProperty.call(r,t)){
19942l=str(t,r);
19943if(l){
19944o.push(JSON.quote(t)+(JSON.gap?": ":":")+l)
19945}}}}
19946l=o.length===0?"{}":JSON.gap?"{\n"+JSON.gap+o.join(",\n"+JSON.gap)+"\n"+s+"}":"{"+o.join(",")+"}";
19947JSON.gap=s;
19948return l
19949}};
19950JSON.stringify=function(o,t,a){
19951var e;
19952JSON.gap="";
19953JSON.indent="";
19954if(typeof a==="number"){
19955for(e=0;
19956e<a;
19957e+=1){
19958JSON.indent+=" "
19959}}else{
19960if(typeof a==="string"){
19961JSON.indent=a
19962}}
19963JSON.rep=t;
19964if(t&&typeof t!=="function"&&(typeof t!=="object"||typeof t.length!=="number")){
19965throw new Error("JSON.stringify")
19966}
19967return JSON.str("",{
19968"":o}
19969)
19970};
19971JSON.parse=function(text,reviver){
19972var j;
19973var walk=function walk(holder,key){
19974var k,v,value=holder[key];
19975if(value&&typeof value==="object"){
19976for(k in value){
19977if(Object.hasOwnProperty.call(value,k)){
19978v=walk(value,k);
19979if(v!==undefined){
19980value[k]=v
19981}else{
19982delete value[k]
19983}}}}
19984return reviver.call(holder,key,value)
19985};
19986text=String(text);
19987JSON.lastIndex=0;
19988if(JSON.cx.test(text)){
19989text=text.replace(JSON.cx,function(a){
19990return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
19991}
19992)
19993}
19994if(/^[\],:{}\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,""))){
19995j=eval("("+text+")");
19996return typeof reviver==="function"?walk({
19997"":j}
19998,""):j
19999}
20000throw new SyntaxError("JSON.parse")
20001};
20002window.PLAXO_URL_BASE="http://calendar.comcast.net";
20003window.CIMA_URL="https://login.comcast.net/api/web-access?c=cal";
20004Comcast_plaxosync_map={};
20005Comcast_plaxosync_map.z2p={
20006anniversary:"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"};
20007Comcast_plaxosync_map.p2z={};
20008for(var key in Comcast_plaxosync_map.z2p){
20009if(Comcast_plaxosync_map.z2p[key]){
20010Comcast_plaxosync_map.p2z[Comcast_plaxosync_map.z2p[key]]=key
20011}}
20012Comcast_plaxosync_map.p2z.email="email";
20013Comcast_plaxosync_map.im_z2p={
20014imAddress:"homeIMList",workIM:"workIMList"};
20015Comcast_plaxosync_map.imPattern=/(\w+):\/\/(.+)/;
20016Comcast_plaxosync_map.map=function(s,o){
20017if(AjxUtil.isObject(o)){
20018if(AjxUtil.isArray(s)){
20019var n=[];
20020for(var a=0;
20021a<s.length;
20022a++){
20023n.push(Comcast_plaxosync_map.map(s[a],o))
20024}
20025return n
20026}else{
20027if(AjxUtil.isObject(s)){
20028var n={};
20029for(var t in s){
20030if(t!=null){
20031var e=o[t]||null;
20032if(e!=null){
20033n[e]=s[t]
20034}}}
20035return n
20036}else{
20037if(AxjUtil.isString(s)){
20038return o[s]
20039}}}}
20040return null
20041};
20042Comcast_plaxosync_map.map_z2p=function(t){
20043if(AjxUtil.isArray(t)){
20044var e=[];
20045for(var n=0;
20046n<t.length;
20047n++){
20048var o=t[n];
20049var s=Comcast_plaxosync_map.map(o,Comcast_plaxosync_map.z2p);
20050var r=Comcast_plaxosync_map.mapIM_z2p(o);
20051s=AjxUtil.hashUpdate(s,r,true);
20052e.push(s)
20053}
20054return e
20055}else{
20056if(AjxUtil.isObject(t)){
20057var e=Comcast_plaxosync_map.map(t,Comcast_plaxosync_map.z2p);
20058var a=Comcast_plaxosync_map.mapIM_z2p(t);
20059e=AjxUtil.hashUpdate(e,a,true);
20060return e
20061}}};
20062Comcast_plaxosync_map.map_p2z=function(t){
20063if(AjxUtil.isArray(t)){
20064var e=[];
20065for(var n=0;
20066n<t.length;
20067n++){
20068var r=t[n];
20069var o=Comcast_plaxosync_map.map(r,Comcast_plaxosync_map.p2z);
20070var a=Comcast_plaxosync_map.mapIM_p2z(r);
20071o=AjxUtil.hashUpdate(o,a,true);
20072e.push(o)
20073}
20074return e
20075}else{
20076if(AjxUtil.isObject(t)){
20077var e=Comcast_plaxosync_map.map(t,Comcast_plaxosync_map.p2z);
20078var s=Comcast_plaxosync_map.mapIM_p2z(t);
20079e=AjxUtil.hashUpdate(e,s,true);
20080return e
20081}}};
20082Comcast_plaxosync_map.mapIM_z2p=function(d){
20083if(AjxUtil.isObject(d)){
20084var a={};
20085for(var e in Comcast_plaxosync_map.im_z2p){
20086var r=Comcast_plaxosync_map.im_z2p[e];
20087var o=new RegExp(e+"(\\d+)");
20088var h=[];
20089for(var c in d){
20090var n=o.exec(c);
20091if(n&&n.length>=2){
20092var s=parseInt(n[1])-1;
20093var l=d[c];
20094if(l!=null){
20095var t=Comcast_plaxosync_map.mapIM_z2p_single(l);
20096if(t!=null){
20097h[s]=t
20098}}}}
20099if(h.length>0){
20100a[r]={
20101imAddress:h}
20102}}
20103return a
20104}};
20105Comcast_plaxosync_map.mapIM_z2p_single=function(o){
20106var t=Comcast_plaxosync_map.imPattern.exec(o);
20107if(t&&t.length>=3){
20108var e=t[1];
20109var a=t[2];
20110var i={};
20111i.service=t[1];
20112i.address=t[2];
20113return i
20114}
20115return null
20116};
20117Comcast_plaxosync_map.mapIM_p2z=function(a){
20118var u={};
20119for(var t in Comcast_plaxosync_map.im_z2p){
20120var c=Comcast_plaxosync_map.im_z2p[t];
20121try{
20122var l=a[c];
20123var n=l.imAddress;
20124var s=1;
20125for(var r=0;
20126r<n.length;
20127r++){
20128var d=n[r];
20129var o=Comcast_plaxosync_map.mapIM_p2z_single(d);
20130u[t+s]=o;
20131s++
20132}}
20133catch(h){}}
20134return u
20135};
20136Comcast_plaxosync_map.mapIM_p2z_single=function(e){
20137return e.service.toLowerCase()+"://"+e.address
20138};
20139Comcast_plaxosync=function(){
20140this.requestmgr=new Comcast_plaxosync_requestmgr();
20141window.Comcast_plaxosync_instance=this
20142};
20143Comcast_plaxosync.DISPLAY_IFRAME=true;
20144Comcast_plaxosync.prototype.toString=function(){
20145return"Comcast_plaxosync"
20146};
20147Comcast_plaxosync.handleFrameData=function(e,a,t){
20148if(AjxUtil.isString(e)){
20149if(t){
20150Comcast_plaxosync_instance.setIframeUrl(t)
20151}
20152var i={
20153action:ZmOperation.NEW_MESSAGE,toOverride:e,subjOverride:a||""};
20154AjxDispatcher.run("GetComposeController").doAction(i)
20155}};
20156Comcast_plaxosync.prototype.init=function(){
20157var e=new AjxListener(this,this.init2);
20158ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,e);
20159ZmZimbraMail.addListener(ZmAppEvent.POST_STARTUP,e)
20160};
20161Comcast_plaxosync.prototype.init2=function(){
20162if(!this._init2run){
20163this._init2run=true;
20164if(Comcast_plaxosync.DISPLAY_IFRAME){
20165this._createIframeView()
20166}
20167this.requestmgr.init()
20168}};
20169Comcast_plaxosync.PLAXO_URL_SHOW_ALL=window.PLAXO_URL_BASE+"/ab/contactList/?skin=none";
20170Comcast_plaxosync.PLAXO_URL_SHOW_CONTACT=window.PLAXO_URL_BASE+"/ab/home/contactView/{0}?skin=none";
20171Comcast_plaxosync.PLAXO_URL_SHOW_SEARCH=window.PLAXO_URL_BASE+"/ab/contactList?skin=none&query=Search&src=addressBookSearch#search={0}";
20172Comcast_plaxosync.PLAXO_URL_NEW_CONTACT=window.PLAXO_URL_BASE+"/ab/home/contactAdd/?skin=none&name={0}&email={1}&phone={2}";
20173Comcast_plaxosync.PLAXO_URL_EDIT_CONTACT=window.PLAXO_URL_BASE+"/xfc/editContact?e={1}&n={0}&skin=none";
20174Comcast_plaxosync.PLAXO_URL_NEW_GROUP=window.PLAXO_URL_BASE+"/ab/contactList?skin=none#createGroup=1";
20175Comcast_plaxosync.prototype._createIframeView=function(){
20176if(Comcast_plaxosync.DISPLAY_IFRAME){
20177this.viewName="PlaxoFrame";
20178this._iframeView=new ZmUpsellView({
20179parent:appCtxt.getShell(),posStyle:Dwt.ABSOLUTE_STYLE,className:"ZmUpsellView"}
20180);
20181var i=this._iframeView.getHtmlElement();
20182var t=[];
20183var e=0;
20184t[e++]="<iframe id='iframe_";
20185t[e++]=this._iframeView.getHTMLElId();
20186t[e++]="' ";
20187if(this._iframeSrc){
20188t[e++]="src='";
20189t[e++]="'"
20190}
20191t[e++]=" width='100%' height='100%' frameborder='0'>";
20192i.innerHTML=t.join("");
20193var n={};
20194n[ZmAppViewMgr.C_APP_CONTENT_FULL]=this._iframeView;
20195var o={};
20196o[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this.displayIframeView);
20197appCtxt.getAppViewMgr().createView({
20198viewId:this.viewName,elements:n,isTransient:false,callbacks:o}
20199);
20200var a=this.getIframe();
20201a.onload=null
20202}};
20203Comcast_plaxosync.prototype.displayIframeView=function(e){
20204if(Comcast_plaxosync.DISPLAY_IFRAME){
20205var t=[ZmMsg.zimbraTitle,"Address Book"].join(": ");
20206Dwt.setTitle(t)
20207}};
20208Comcast_plaxosync.prototype.getIframe=function(){
20209if(!this._iframe){
20210this._iframe=document.getElementById("iframe_"+this._iframeView.getHTMLElId())
20211}
20212return this._iframe
20213};
20214Comcast_plaxosync.prototype.getIframeView=function(){
20215return this._iframeView
20216};
20217Comcast_plaxosync.prototype.setIframeUrl=function(t,o){
20218if(Comcast_plaxosync.DISPLAY_IFRAME){
20219if(t){
20220this._iframeSrc=t
20221}
20222if(this._iframeView){
20223var i=this.getIframe();
20224if(i){
20225var e=appCtxt.getAppViewMgr();
20226if(o&&e.getCurrentViewId()!=this.viewName){
20227appCtxt.getAppChooser().setSelected("Contacts");
20228if(t){
20229var a=AjxCallback.simpleClosure(this.displayIframe,this);
20230if(AjxEnv.isIE){
20231i.attachEvent("onload",a)
20232}else{
20233Dwt.setHandler(i,"onload",a)
20234}
20235this._displayLoading()
20236}}else{
20237Dwt.clearHandler(i,"onload")
20238}
20239if(t){
20240i.src=t
20241}}}}};
20242Comcast_plaxosync.prototype.displayIframe=function(){
20243var e=appCtxt.getAppViewMgr();
20244e.popView(ZmId.VIEW_LOADING,true);
20245e.pushView(this.viewName);
20246appCtxt.getAppChooser().setSelected("Contacts")
20247};
20248Comcast_plaxosync.prototype._displayLoading=function(){
20249if(!appCtxt.inStartup){
20250appCtxt.getAppViewMgr().pushView(ZmId.VIEW_LOADING,true)
20251}};
20252Comcast_plaxosync.prototype.add=function(a,t,i){
20253i=i||this[t];
20254if(i){
20255var e=a[t];
20256a[t]=function(){
20257var o=arguments;
20258o.push(e.apply(this,arguments));
20259return i.apply(this,o)
20260};
20261a[t].func=e
20262}};
20263Comcast_plaxosync.parseQuery=function(e){
20264locFound=/.*:.*/.test(e);
20265match=locFound&&/(.*)\(.*:(.*)\)$/.exec(e);
20266return{
20267location:(match&&AjxStringUtil.trim(match[2]))||(locFound&&e)||"",searchfor:(match&&AjxStringUtil.trim(match[1]))||(!locFound&&e)||""}
20268};
20269Comcast_plaxosync.getFirstAttr=function(e,n,o){
20270for(var a=0;
20271a<n.length;
20272a++){
20273var t=n[a];
20274if(e[t]){
20275return e[t]
20276}}
20277return o
20278};
20279VelodromeSkin.prototype.sendRequest=function(o){
20280var a=o.jsonObj;
20281var e;
20282if(a){
20283var i=window.plaxosync.requestmgr;
20284var n=new AjxCallback(this,this._handleDataReturn,o);
20285if(a.CreateContactRequest){
20286i.createContactRequest(a.CreateContactRequest,n);
20287delete a.CreateContactRequest
20288}
20289if(a.ModifyContactRequest){
20290i.modifyContactRequest(a.ModifyContactRequest,n);
20291delete a.ModifyContactRequest
20292}
20293if(a.ContactActionRequest){
20294i.contactActionRequest(a.ContactActionRequest,n);
20295delete a.ContactActionRequest
20296}
20297for(var t in a){
20298if(a[t]&&(t!="SearchRequest"||!e)){
20299return this.sendRequest.func.call(this,o)
20300}}}else{
20301return this.sendRequest.func.call(this,o)
20302}};
20303VelodromeSkin.prototype._handleDataReturn=function(a,e){
20304var t=a.jsonObj;
20305if(t){
20306if(t.SearchRequest){
20307if(t.SearchRequest.types){
20308a.callback=new AjxCallback(this,function(o,i){
20309i._data.SearchResponse.cn=e.Body.SearchResponse.cn;
20310o.run(i)
20311}
20312,a.callback);
20313this.sendRequest.func.call(this,a);
20314return
20315}}
20316a.response=e;
20317this.sendRequest.func.call(this,a)
20318}};
20319VelodromeSkin.prototype.load=function(i,e,t){
20320this.isCanonical=true;
20321var a=new AjxCallback(this,this._handleResponseLoad,[i]);
20322window.plaxosync.requestmgr.getContacts(new AjxCallback(this,this._handleResponseLoad,[i]))
20323};
20324VelodromeSkin.prototype._handleResponseLoad=function(r,i){
20325for(var s in i){
20326var e=i[s];
20327var o={}
20328,n={};
20329for(var t in e){
20330var a=e[t];
20331if(ZmContactList.IS_CONTACT_FIELD[t]){
20332o[t]=a
20333}else{
20334n[t]=a
20335}}
20336o._attrs=n;
20337o.id=s;
20338this._addContact(o)
20339}
20340this._finishLoading();
20341if(r){
20342r.run()
20343}};
20344VelodromeSkin.prototype._show=function(e,s){
20345if(Comcast_plaxosync.DISPLAY_IFRAME){
20346if(e){
20347if(e.type==ZmItem.GROUP){
20348var o=Comcast_plaxosync.PLAXO_URL_NEW_GROUP
20349}else{
20350var i=[e.attr.firstName||"",e.attr.middleName||"",e.attr.lastName||""].join(" ").replace(/\s+/g," ");
20351i=i.replace(/^\s+|\s+$/g,"");
20352var n=["email","workEmail1"];
20353var a=Comcast_plaxosync.getFirstAttr(e.attr,n,"");
20354var t=Comcast_plaxosync.getFirstAttr(e.attr,ZmContact.PHONE_FIELDS,"");
20355var o=(e.id)?AjxMessageFormat.format(Comcast_plaxosync.PLAXO_URL_EDIT_CONTACT,[i,a]):AjxMessageFormat.format(Comcast_plaxosync.PLAXO_URL_NEW_CONTACT,[i,a,t])
20356}
20357window.plaxosync.setIframeUrl(o,true)
20358}}else{
20359arguments.callee.func.apply(this,arguments)
20360}};
20361VelodromeSkin.prototype._Portalshow=function(e,t){
20362window.location="http://xfinityconnect.mail.comcast.net/"
20363};
20364VelodromeSkin.prototype._doSearch=function(s,e,r,t){
20365var i=s.types||this.getTypes(s);
20366if(Comcast_plaxosync.DISPLAY_IFRAME&&((AjxUtil.isArray(i)&&i.length==1&&i[0]==ZmItem.CONTACT)||(i instanceof AjxVector&&i.size()==1&&i.get(0)==ZmItem.CONTACT))){
20367var o=s.query;
20368var n=o&&Comcast_plaxosync.parseQuery(o);
20369var a;
20370if(n&&n.searchfor){
20371window.plaxosync.setIframeUrl(AjxMessageFormat.format(Comcast_plaxosync.PLAXO_URL_SHOW_SEARCH,[n.searchfor]),true)
20372}else{
20373if(!window.plaxosync._iframeSrc){
20374window.plaxosync.setIframeUrl(Comcast_plaxosync.PLAXO_URL_SHOW_ALL,true)
20375}else{
20376window.plaxosync.displayIframe()
20377}}}
20378arguments.callee.func.apply(this,arguments)
20379};
20380VelodromeSkin.prototype._defaultView=function(){
20381if(Comcast_plaxosync.DISPLAY_IFRAME){
20382return window.plaxosync.viewName
20383}else{
20384return(appCtxt.get(ZmSetting.CONTACTS_VIEW)=="cards")?ZmId.VIEW_CONTACT_CARDS:ZmId.VIEW_CONTACT_SIMPLE
20385}};
20386VelodromeSkin.prototype.switchView=function(e,a,i,t){
20387if(Comcast_plaxosync.DISPLAY_IFRAME){
20388e=window.plaxosync.viewName;
20389i=true;
20390if(!this._appViews[e]){
20391this._appViews[e]=window.plaxosync.getIframeView()
20392}}
20393return arguments.callee.func.call(this,e,a,i,t)
20394};
20395VelodromeSkin.prototype.listShow=function(){
20396this.switchView(window.plaxosync.viewName)
20397};
20398VelodromeSkin.prototype._createNewView=function(e){
20399if(e==window.plaxosync.viewName){
20400return window.plaxosync.getIframeView()
20401}
20402return arguments.callee.func.apply(this,arguments)
20403};
20404VelodromeSkin.prototype._initializeListView=function(e){
20405if(e==window.plaxosync.viewName){
20406this._listView[e]=this._createNewView(e)
20407}else{
20408arguments.callee.func.apply(this,arguments)
20409}};
20410VelodromeSkin.prototype._handleContactsCoreLoad=function(){
20411this.overrideAPI(ZmContactList.prototype,"load",this.load);
20412this.overrideAPI(ZmContactList.prototype,"_handleResponseLoad",this._handleResponseLoad)
20413};
20414VelodromeSkin.prototype._handleContactsLoad=function(){
20415this.overrideAPI(ZmContactController.prototype,"show",this._show);
20416this.overrideAPI(ZmContactListController.prototype,"_defaultView",this._defaultView);
20417this.overrideAPI(ZmContactListController.prototype,"show",this.listShow);
20418this.overrideAPI(ZmContactListController.prototype,"_createNewView",this._createNewView);
20419this.overrideAPI(ZmContactListController.prototype,"_initializeListView",this._initializeListView);
20420this.overrideAPI(ZmContactListController.prototype,"switchView",this.switchView);
20421this.overrideAPI(ZmContactListController.prototype,"_setViewContents",AjxCallback.returnFalse);
20422this.overrideAPI(ZmContactListController.prototype,"_resetOperations",AjxCallback.returnFalse)
20423};
20424VelodromeSkin.prototype._handlePortalLoad=function(){
20425this.overrideAPI(ZmPortalController.prototype,"show",this._Portalshow)
20426};
20427VelodromeSkin.prototype._handleStartupLoad=function(){
20428window.plaxosync=new Comcast_plaxosync();
20429this.overrideAPI(ZmRequestMgr.prototype,"sendRequest",this.sendRequest);
20430this.overrideAPI(ZmRequestMgr.prototype,"_handleDataReturn",this._handleDataReturn);
20431this.overrideAPI(ZmSearchController.prototype,"_doSearch",this._doSearch);
20432window.plaxosync.init()
20433};
20434AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._handleContactsLoad));
20435AjxDispatcher.addPackageLoadFunction("Portal",new AjxCallback(skin,skin._handlePortalLoad));
20436AjxDispatcher.addPackageLoadFunction("Startup1_2",new AjxCallback(skin,skin._handleStartupLoad));
20437Comcast_plaxosync_requestmgr=function(){
20438this.session=null;
20439this.token=null;
20440this.clientId="cal"
20441};
20442Comcast_plaxosync_requestmgr.prototype.init=function(){
20443this._cimaQueue=[]
20444};
20445Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON=window.PLAXO_URL_BASE+"/axis/json/contact";
20446Comcast_plaxosync_requestmgr.PLAXO_CONTACT_URL=window.PLAXO_URL_BASE+"/axis/contact";
20447Comcast_plaxosync_requestmgr.PLAXO_FOLDER_JSON=window.PLAXO_URL_BASE+"/axis/json/folder";
20448Comcast_plaxosync_requestmgr.SEARCH_FIELDS=["firstName","lastName","fullName"];
20449Comcast_plaxosync_requestmgr.PROMPT_IF_MISSING=true;
20450Comcast_plaxosync_requestmgr.prototype.getCIMAAccess=function(){
20451this._cimaQueue=[];
20452var t="/service/proxy?target="+AjxStringUtil.urlComponentEncode(window.CIMA_URL);
20453var e=AjxCookie.getCookie(document,"s_ticket")||(Comcast_plaxosync_requestmgr.PROMPT_IF_MISSING&&prompt("Please enter a valid comcast s_ticket cookie value",""));
20454if(e){
20455var a={
20456Authorization:"cima-session "+e,"Content-type":"application/x-www-form-urlencoded"};
20457var i=new AjxCallback(this,this._handleGetCIMAAccess);
20458AjxRpc.invoke("",t,a,i,false,0)
20459}else{
20460appCtxt.setStatusMsg("Login failed: nonexistent s_ticket",ZmStatusView.LEVEL_CRITICAL);
20461this._cimaQueue=null
20462}};
20463Comcast_plaxosync_requestmgr.findDescendant=function(n){
20464if(arguments.length<2){
20465return n
20466}
20467var e=AjxUtil.isArray(arguments[1])?arguments[1]:Array.prototype.slice.call(arguments,1);
20468for(var a=0;
20469a<e.length;
20470a++){
20471var t=e[a];
20472if(t instanceof RegExp){
20473for(var o in n){
20474if(t.test(o)){
20475n=n[o];
20476break
20477}}}else{
20478n=n[t]
20479}
20480if(!n){
20481return null
20482}}
20483return n
20484};
20485Comcast_plaxosync_requestmgr.prototype._handleGetCIMAAccess=function(e){
20486if(e.success){
20487var n=AjxXmlDoc.createFromDom(e.xml).toJSObject();
20488var o=Comcast_plaxosync_requestmgr.findDescendant(n,"cima:ServiceToken",/^[^:]+:GetSessionResponse/,"response","session","__msh_content");
20489if(o){
20490if(o.match(/^[\d:]+$/)){
20491this.session=o
20492}else{
20493this.token=o
20494}}
20495this.userid=Comcast_plaxosync_requestmgr.findDescendant(n,"cima:ServiceToken",/^[^:]+:GetSessionResponse/,"response","userId","__msh_content");
20496if(!this.token&&!this.session){
20497appCtxt.setStatusMsg("Login failed: invalid s_ticket",ZmStatusView.LEVEL_CRITICAL)
20498}else{
20499if(this._cimaQueue&&this._cimaQueue.length){
20500for(var a=0;
20501a<this._cimaQueue.length;
20502a++){
20503this._cimaQueue[a].run()
20504}}
20505this._cimaQueue=null
20506}}else{
20507appCtxt.setStatusMsg("Login failed: cannot connect to single-signon service",ZmStatusView.LEVEL_CRITICAL)
20508}};
20509Comcast_plaxosync_requestmgr.prototype.send=function(i,t,r,o,s){
20510var e=new AjxCallback(this,this.receive,[r||null]);
20511var a="/service/proxy?target="+AjxStringUtil.urlEncode(i);
20512if(AjxUtil.isObject(t)){
20513t=AjxStringUtil.objToString(t)
20514}
20515var n={
20516"Content-Type":"application/json; charset=utf-8"};
20517if(AjxEnv.isIE6&&(location.protocol=="https:")){
20518n.Connection="Close"
20519}
20520if(s&&AjxUtil.isObject(s)){
20521n=Comcast_plaxosync_requestmgr.hashUpdate(n,s,true)
20522}
20523AjxRpc.invoke(t,a,n,e,o)
20524};
20525Comcast_plaxosync_requestmgr.prototype.receive=function(a,e){
20526if(e.success&&a){
20527var t=Comcast_plaxosync_requestmgr.evalJSON(AjxStringUtil.trim(e.text));
20528a.run(t)
20529}};
20530Comcast_plaxosync_requestmgr.prototype.createContactRequest=function(s,h){
20531if(this.isLoggedIn()){
20532var n=s.cn.a;
20533var r={};
20534var a={};
20535for(var o=0;
20536o<n.length;
20537o++){
20538var t=n[o];
20539a[t.n]=t._content
20540}
20541if(!a.firstName&&!a.containsKey.lastName&&!a.fullName&&!a.displayName){
20542if(a.email){
20543a.fullName=a.email
20544}}
20545var e={
20546AddContactRequest:{
20547authInfo:this.getAuthInfo(),contact:Comcast_plaxosync_map.map_z2p(a)}};
20548this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,e,new AjxCallback(this,this.createContactResponse,[s,h]),false)
20549}else{
20550if(this._cimaQueue!==null){
20551this._cimaQueue.push(new AjxCallback(this,this.createContactRequest,[s,h]))
20552}else{
20553this.createContactResponse(s,h,{}
20554)
20555}}};
20556Comcast_plaxosync_requestmgr.prototype.createContactResponse=function(n,u,s){
20557var c=s&&s.contact&&Comcast_plaxosync_map.map_p2z(s.contact);
20558var d,t,h,o;
20559if(c){
20560d=this.pruneAttrs(c);
20561t=c.itemId;
20562h=""+t;
20563o=ZmContact.computeFileAs(d)
20564}
20565var l=appCtxt.getActiveAccount().name;
20566var e=n.cn.l;
20567var a=new Date().getTime();
20568var r=40500;
20569var m=appCtxt.getRequestMgr()._highestNotifySeen+1;
20570var i={
20571Header:{
20572context:{
20573change:{
20574token:r}
20575,notify:[{
20576seq:m,created:c?{
20577cn:[{
20578id:h,l:e,d:a,rev:r,fileAsStr:o,_attrs:d}
20579]}
20580:{}
20581,modified:c?{
20582folder:[{
20583id:e,n:8,s:0,i4ms:r,i4next:t+1}
20584]}
20585:{}}
20586],_jsns:"urn:zimbra"}}
20587,Body:{
20588CreateContactResponse:{
20589cn:c?[{
20590id:h,l:e,d:a,rev:r,fileAsStr:o,_attrs:d}
20591]:[],_jsns:"urn:zimbraMail"}}
20592,_jsns:"urn:zimbraSoap"};
20593if(u){
20594u.run(i)
20595}
20596return i
20597};
20598Comcast_plaxosync_requestmgr.prototype.modifyContactRequest=function(n,u){
20599if(this.isLoggedIn()){
20600var e=n.cn.id;
20601var t=n.cn.a;
20602var o={};
20603var c={};
20604for(var s=0;
20605s<t.length;
20606s++){
20607var a=t[s];
20608c[a.n]=a._content
20609}
20610var d;
20611for(var s=0;
20612s<ZmContact.ADDRESS_FIELDS.length&&!d;
20613s++){
20614if(o[ZmContact.ADDRESS_FIELDS[s]]){
20615d=true
20616}}
20617if(!Comcast_plaxosync_requestmgr.NAME_FIELDS){
20618Comcast_plaxosync_requestmgr.NAME_FIELDS=[ZmContact.F_firstName,ZmContact.F_lastName,ZmContact.F_maidenName,ZmContact.F_middleName,ZmContact.F_namePrefix,ZmContact.F_nameSuffix]
20619}
20620var r;
20621for(var s=0;
20622s<Comcast_plaxosync_requestmgr.NAME_FIELDS.length&&!r;
20623s++){
20624if(c[Comcast_plaxosync_requestmgr.NAME_FIELDS[s]]){
20625r=true
20626}}
20627if(d||r){
20628var h=appCtxt.getById(e);
20629if(h){
20630if(d){
20631Comcast_plaxosync_requestmgr.hashUpdate(c,h.attr,true,null,ZmContact.ADDRESS_FIELDS)
20632}
20633if(r){
20634Comcast_plaxosync_requestmgr.hashUpdate(c,h.attr,true,null,Comcast_plaxosync_requestmgr.NAME_FIELDS)
20635}}}
20636c.itemId=e;
20637var l={
20638SetContactRequest:{
20639authInfo:this.getAuthInfo(),contact:Comcast_plaxosync_map.map_z2p(c)}};
20640this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,l,new AjxCallback(this,this.modifyContactResponse,[n,u]),false)
20641}else{
20642if(this._cimaQueue!==null){
20643this._cimaQueue.push(new AjxCallback(this,this.modifyContactRequest,[n,u]))
20644}else{
20645this.modifyContactResponse(n,u,{}
20646)
20647}}};
20648Comcast_plaxosync_requestmgr.hashUpdate=function(o,i,t,n,e){
20649for(var a in i){
20650if((t||!(a in o))&&(!n||AjxUtil.indexOf(n,a)==-1)&&(!e||AjxUtil.indexOf(e,a)!=-1)){
20651o[a]=i[a]
20652}}
20653return o
20654};
20655Comcast_plaxosync_requestmgr.prototype.modifyContactResponse=function(n,u,s){
20656var c=s&&s.contact&&Comcast_plaxosync_map.map_p2z(s.contact);
20657var d,o,t,h;
20658if(c){
20659d=this.pruneAttrs(c);
20660o=ZmContact.computeFileAs(d);
20661t=c.itemId;
20662h=""+t
20663}
20664var l=appCtxt.getActiveAccount().name;
20665var e=n.cn.l;
20666var a=new Date().getTime();
20667var r=41200;
20668var m=appCtxt.getRequestMgr()._highestNotifySeen+1;
20669var i={
20670Header:{
20671context:{
20672change:{
20673token:r}
20674,notify:[{
20675seq:m,modified:c?{
20676folder:[{
20677id:e,n:12,s:0,i4ms:r,i4next:t+1}
20678],cn:[{
20679id:t,f:"",d:a,rev:r,fileAsStr:o,_attrs:d}
20680]}
20681:{}}
20682],_jsns:"urn:zimbra"}}
20683,Body:{
20684ModifyContactResponse:{
20685cn:c?[{
20686id:t,l:e,d:a,rev:r,fileAsStr:o,_attrs:d}
20687]:[],_jsns:"urn:zimbraMail"}}
20688,_jsns:"urn:zimbraSoap"};
20689if(u){
20690u.run(i)
20691}
20692return i
20693};
20694Comcast_plaxosync_requestmgr.prototype.contactActionRequest=function(t,o){
20695var i=t.action.id;
20696var e=t.action.l;
20697var a=t.action.op;
20698if(a=="delete"||(a=="move"&&e==3)||a=="trash"){
20699this.deleteContactRequest(new AjxCallback(this,this.contactActionResponse,[t,o]),i)
20700}};
20701Comcast_plaxosync_requestmgr.prototype.deleteContactRequest=function(t,e){
20702return this.deleteContactsRequest(t,[e])
20703};
20704Comcast_plaxosync_requestmgr.prototype.deleteContactsRequest=function(a,t){
20705if(this.isLoggedIn()){
20706var e={
20707DeleteContactsRequest:{
20708authInfo:this.getAuthInfo(),itemIds:{
20709delimited:{
20710data:t.join(",")}}}};
20711this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,e,new AjxCallback(this,this.deleteContactsResponse,[a]),false)
20712}else{
20713if(this._cimaQueue!==null){
20714this._cimaQueue.push(new AjxCallback(this,this.deleteContactsRequest,[a,t]))
20715}else{
20716this.deleteContactsResponse(a,{}
20717)
20718}}};
20719Comcast_plaxosync_requestmgr.prototype.deleteContactsResponse=function(i,t){
20720var a=t&&t.affected;
20721var e=t.response&&t.response["code"];
20722if(i){
20723i.run(t)
20724}};
20725Comcast_plaxosync_requestmgr.prototype.contactActionResponse=function(o,d,s){
20726var u=!!(s&&s.affected);
20727var c=appCtxt.getActiveAccount().name;
20728var e=o.action.id;
20729var f=appCtxt.getById(e);
20730var t=o.action.l;
20731var n=f.folderId;
20732var l=o.action.op;
20733var h=""+e;
20734var a=new Date().getTime();
20735var r=41200;
20736var m=appCtxt.getRequestMgr()._highestNotifySeen+1;
20737var i={
20738Header:{
20739context:{
20740change:{
20741token:r}
20742,notify:[{
20743seq:m,modified:u?{
20744folder:[{
20745id:n,n:11,s:0,i4ms:r,i4next:5261}
20746,{
20747id:t,n:167,s:491637,i4ms:r,i4next:5280}
20748],cn:[{
20749id:h,l:t}
20750]}
20751:{}}
20752],_jsns:"urn:zimbra"}}
20753,Body:{
20754ContactActionResponse:{
20755action:{
20756id:h,op:l}
20757,_jsns:"urn:zimbraMail"}}
20758,_jsns:"urn:zimbraSoap"};
20759if(d){
20760d.run(i)
20761}
20762return i
20763};
20764Comcast_plaxosync_requestmgr.prototype.search=function(T,h){
20765if(this.isLoggedIn()){
20766var o=T.query&&AjxStringUtil.trim(T.query)||"";
20767var r=T.fields;
20768var a,f,t,m;
20769var v=o&&Comcast_plaxosync.parseQuery(o);
20770var z=T.limit||0;
20771var d=T.offset||0;
20772var l=v&&v.searchfor;
20773if(l){
20774l=l.replace(/[^\w\d]/g,"")
20775}
20776var e=-1;
20777var q={};
20778var n={};
20779n.authInfo=this.getAuthInfo();
20780if(z>0){
20781var c={};
20782c.limit=z;
20783if(d>0){
20784c.offset=d
20785}
20786n.page=c
20787}
20788var w=(l&&l.length);
20789var u=(e>=0);
20790if(w||u){
20791var b={};
20792if(w){
20793var s={};
20794var k={};
20795var x=[];
20796for(var j=0;
20797j<Comcast_plaxosync_requestmgr.SEARCH_FIELDS.length;
20798j++){
20799var y={
20800field:Comcast_plaxosync_requestmgr.SEARCH_FIELDS[j],op:"StartsWith",value:l};
20801x.push(y)
20802}
20803k.byField=x;
20804s.fields=k;
20805s.op="Or";
20806b.byFields=s
20807}
20808if(u){
20809b.byFolderId=e
20810}
20811n.filters=b
20812}
20813if(r){
20814var g=[];
20815for(var j=0;
20816j<r.length;
20817j++){
20818g.push(r[j].toString())
20819}
20820n.fields={
20821field:g}
20822}
20823q.GetContactsRequest=n;
20824this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,q,new AjxCallback(this,this._handleSearch,[h,d]),false)
20825}else{
20826if(this._cimaQueue!==null){
20827this._cimaQueue.push(new AjxCallback(this,this.search,[T,h]))
20828}else{
20829this._handleSearch(h)
20830}}};
20831Comcast_plaxosync_requestmgr.prototype._handleSearch=function(n,o,i){
20832var a=i&&i.contacts&&i.contacts["contact"];
20833var t=i&&i.editCounter;
20834var e=i&&i.totalCount;
20835if(n){
20836n.run(a&&Comcast_plaxosync_map.map_p2z(a),t,e,o)
20837}};
20838Comcast_plaxosync_requestmgr.prototype.searchRequest=function(e,t){
20839this.search(e,new AjxCallback(this,this.searchResponse,[t]))
20840};
20841Comcast_plaxosync_requestmgr.prototype.searchResponse=function(m,a,d,f,n){
20842var h=41200;
20843a=a||[];
20844var r=[];
20845var t=new Date().getTime();
20846for(var s=0;
20847s<a.length;
20848s++){
20849var c=a[s];
20850var u=this.pruneAttrs(c);
20851var e={
20852id:c.itemId,f:"",d:t,rev:h,fileAsStr:ZmContact.computeFileAs(c),_attrs:u};
20853r.push(e)
20854}
20855r.sort(function(p,i){
20856return p.fileAsStr>i.fileAsStr
20857}
20858);
20859var l=appCtxt.getActiveAccount().name;
20860var t=new Date().getTime();
20861var o={
20862Header:{
20863context:{
20864change:{
20865token:h}
20866,_jsns:"urn:zimbra"}}
20867,Body:{
20868SearchResponse:{
20869sortBy:"com.zimbra.cs.index.LocalizedSortBy@a4f040",offset:n||0,cn:r,more:(a.length+n<f)?true:false,_jsns:"urn:zimbraMail"}}
20870,_jsns:"urn:zimbraSoap"};
20871if(m){
20872m.run(o)
20873}
20874return o
20875};
20876Comcast_plaxosync_requestmgr.prototype.autoCompleteRequest=function(e,a){
20877var t={
20878query:e.name._content};
20879this.search(t,new AjxCallback(this,this.autoCompleteResponse,[e,a]))
20880};
20881Comcast_plaxosync_requestmgr.prototype.autoCompleteResponse=function(a,n,r){
20882var b=41200;
20883var o=a.name._content;
20884var y=[];
20885if(r){
20886var s=new Date().getTime();
20887for(var f=0;
20888f<r.length&&f<1000;
20889f++){
20890var t=r[f];
20891var d=this.pruneAttrs(t);
20892var w=this.getFirstMatching(o,[d.displayName,d.fullName,AjxUtil.collapseList([d.firstName,d.middleName,d.lastName]).join(" ")]);
20893var l=[d[ZmContact.F_email],d[ZmContact.F_workEmail1],d[ZmContact.F_email2],d[ZmContact.F_workEmail2],d[ZmContact.F_email3],d[ZmContact.F_workEmail3]];
20894var g=AjxUtil.uniq(AjxUtil.collapseList(l));
20895for(var m=0;
20896m<g.length;
20897m++){
20898var u=g[m];
20899var h=new AjxEmailAddress(u,null,w).toString();
20900var p=this.getMatchScore(o,w,u);
20901var c={
20902id:t.itemId,email:h,type:"contact",ranking:p};
20903y.push(c)
20904}}
20905y.sort(function(v,i){
20906return v.ranking&&v.ranking<i.ranking
20907}
20908)
20909}
20910var e={
20911Header:{
20912context:{
20913change:{
20914token:b}
20915,_jsns:"urn:zimbra"}}
20916,Body:{
20917AutoCompleteResponse:{
20918canBeCached:true,match:y,_jsns:"urn:zimbraMail"}}
20919,_jsns:"urn:zimbraSoap"};
20920if(n){
20921n.run(e)
20922}
20923return e
20924};
20925Comcast_plaxosync_requestmgr.prototype.getContacts=function(e){
20926this.search({
20927fields:["NameFields","EmailFields","PhoneFields"]}
20928,new AjxCallback(this,this._handleGetContacts,[e]))
20929};
20930Comcast_plaxosync_requestmgr.prototype._handleGetContacts=function(o,e){
20931if(e){
20932var a={};
20933for(var t=0;
20934t<e.length;
20935t++){
20936a[e[t].itemId]=this.pruneAttrs(e[t])
20937}
20938if(o){
20939o.run(a)
20940}
20941return a
20942}};
20943Comcast_plaxosync_requestmgr.prototype.getFirstMatching=function(n,o,a){
20944var t=new RegExp(n,e);
20945for(var e=0;
20946e<o.length;
20947e++){
20948if(t.test(o[e])){
20949return o[e]
20950}}
20951if(!AjxUtil.isUndefined(a)){
20952return a
20953}
20954for(var e=0;
20955e<o.length;
20956e++){
20957if(o[e]){
20958return o[e]
20959}}
20960return o[o.length-1]
20961};
20962Comcast_plaxosync_requestmgr.prototype.getMatchScore=function(i,a,t){
20963var o=0;
20964if(i){
20965i=i.toLowerCase();
20966a=a&&a.toLowerCase();
20967t=t&&t.toLowerCase();
20968if(a){
20969var e=a.indexOf(i);
20970if(e!=-1){
20971o+=(a.length-e)/a.length
20972}}
20973if(t){
20974var e=t.indexOf(i);
20975if(e!=-1){
20976o+=(t.length-e)/t.length
20977}}}
20978return 0.5*o
20979};
20980Comcast_plaxosync_requestmgr.evalJSON=function(a){
20981try{
20982return JSON.parse(a)
20983}
20984catch(t){
20985return{}
20986}};
20987Comcast_plaxosync_requestmgr.prototype.pruneAttrs=function(a){
20988if(!this.validAttrs){
20989if(ZmContact&&ZmContact.DISPLAY_FIELDS&&window.VelodromeSkinOther){
20990this.validAttrs=AjxUtil.arrayAsHash(ZmContact.DISPLAY_FIELDS)
20991}else{
20992return Comcast_plaxosync_requestmgr.hashUpdate({}
20993,a,true,["itemId"])
20994}}
20995var t={};
20996for(var i in a){
20997var e=i.replace(/\d+$/,"");
20998if(this.validAttrs[e]){
20999t[i]=a[i]
21000}}
21001return t
21002};
21003Comcast_plaxosync_requestmgr.prototype.urlFormat=function(o){
21004var e=[],a=0;
21005for(var t in o){
21006if(o[t]!==undefined){
21007e[a++]=t+"="+o[t]
21008}}
21009return e.join("&")
21010};
21011Comcast_plaxosync_requestmgr.prototype.getCommonParams=function(){
21012if(!this._commonParams){
21013this._commonParams={
21014u:appCtxt.getActiveAccount().getEmail()}
21015}
21016return this._commonParams
21017};
21018Comcast_plaxosync_requestmgr.prototype.isLoggedIn=function(){
21019return !!((this.userid&&this.token)||this.session)
21020};
21021Comcast_plaxosync_requestmgr.prototype.getSessionType=function(){
21022return"ShortSession"
21023};
21024Comcast_plaxosync_requestmgr.prototype.getClientInfo=function(){
21025var e={};
21026e.clientId=this.clientId;
21027return e
21028};
21029Comcast_plaxosync_requestmgr.prototype.getAuthInfo=function(){
21030var e={};
21031e.sessionType="NoSession";
21032if(this.clientId){
21033e.clientInfo=this.getClientInfo()
21034}
21035if(this.userid&&this.token){
21036e.authByToken=Comcast_plaxosync_requestmgr.getAuthByToken(this.userid,this.token)
21037}else{
21038if(this.session){
21039e.authBySession=Comcast_plaxosync_requestmgr.getAuthBySession(this.session)
21040}}
21041return e
21042};
21043Comcast_plaxosync_requestmgr.prototype.loginPlain=function(a,t){
21044var e={
21045GetSessionRequest:{
21046authInfo:{
21047sessionType:this.getSessionType(),clientInfo:this.getClientInfo(),authByEmail:Comcast_plaxosync_requestmgr.getAuthByEmail(a,t)}}};
21048this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,e,new AjxCallback(this,this._handleLoginResponse,[a]),false)
21049};
21050Comcast_plaxosync_requestmgr.prototype._handleLoginResponse=function(i,a){
21051if(a){
21052var e=a.response;
21053if(e){
21054var t=e.code;
21055if(t==200){
21056this.session=e.session;
21057this.username=i;
21058return
21059}else{
21060appCtxt.setStatusMsg("Login failed: "+e.message+" (Code "+e.code+")",ZmStatusView.LEVEL_CRITICAL);
21061return
21062}}}
21063appCtxt.setStatusMsg("Login failed: Plaxo server sent invalid response",ZmStatusView.LEVEL_CRITICAL)
21064};
21065Comcast_plaxosync_requestmgr.getAuthBySession=function(e){
21066return{
21067session:e}
21068};
21069Comcast_plaxosync_requestmgr.getAuthByUhid=function(e,t){
21070return{
21071userId:e,password:t}
21072};
21073Comcast_plaxosync_requestmgr.getAuthByEmail=function(t,e){
21074return{
21075email:t,password:e}
21076};
21077Comcast_plaxosync_requestmgr.getAuthByComcast=function(t,e){
21078return{
21079comcastUsername:t,password:e}
21080};
21081Comcast_plaxosync_requestmgr.getAuthByIdentity=function(e,t){
21082return{
21083identity:e,password:t}
21084};
21085Comcast_plaxosync_requestmgr.getAuthByToken=function(t,e){
21086return{
21087userId:t,token:e}
21088};
21089</script>
21090
21091 <script type="text/javascript" src="/zimbra/js/skin.js?client=advanced&amp;skin=velodrome2&amp;locale=en_US&amp;debug=false&amp;compress=true&amp;templates=only&amp;v=110527090709"></script>
21092
21093<script>
21094// compile locale specific templates
21095for (var pkg in window.AjxTemplateMsg) {
21096 var text = AjxTemplateMsg[pkg];
21097 AjxTemplate.compile(pkg, true, true, text);
21098}
21099</script>
21100
21101<script>
21102 var cacheKillerVersion = "110527090709";
21103 function launch() {
21104 // quit if this function has already been called
21105 if (arguments.callee.done) {return;}
21106
21107 // flag this function so we don't do the same thing twice
21108 arguments.callee.done = true;
21109
21110 // kill the timer
21111 if (_timer) {
21112 clearInterval(_timer);
21113 _timer = null;
21114 }
21115
21116 var prodMode = true;
21117 var debugLevel = "";
21118 if (!prodMode || debugLevel) {
21119 AjxDispatcher.require("Debug");
21120 DBG = new AjxDebug(AjxDebug.NONE, null, false);
21121 // figure out the debug level
21122 if (debugLevel == 't') {
21123 DBG.showTiming(true);
21124 } else {
21125 DBG.setDebugLevel(debugLevel);
21126 }
21127 }
21128
21129 AjxHistoryMgr.BLANK_FILE = "/zimbra/public/blankHistory.html";
21130 var noSplashScreen = "";
21131 var protocolMode = "http";
21132
21133
21134 var batchInfoResponse =
21135 // NOTE: Domain info settings moved into launch function to
21136 // prevent sloppy code from accessing extraneous window
21137 // scoped variable.
21138
21139 var settings = {
21140 "dummy":1,
21141 "zimbraPrefMailItemsPerPage":"25",
21142 "zimbraPrefGroupMailBy":"message",
21143 "zimbraPrefSkin":"velodrome2",
21144 "zimbraPrefClientType":"advanced",
21145 "zimbraFeatureTasksEnabled":"FALSE",
21146 "zimbraFeatureNotebookEnabled":"FALSE",
21147 "zimbraFeatureIMEnabled":"FALSE",
21148 "zimbraFeatureVoiceEnabled":"TRUE",
21149 "zimbraFeatureContactsEnabled":"TRUE",
21150 "zimbraFeatureConversationsEnabled":"TRUE",
21151 "zimbraFeaturePortalEnabled":"TRUE",
21152 "zimbraFeatureVoiceUpsellEnabled":"FALSE",
21153 "zimbraFeatureOptionsEnabled":"TRUE",
21154 "zimbraFeatureMailEnabled":"TRUE",
21155 "zimbraFeatureCalendarUpsellEnabled":"TRUE",
21156 "zimbraFeatureCalendarEnabled":"FALSE",
21157 "zimbraWebClientLogoutURL":"https://login.comcast.net/logout?s=smartzone&continue=http://www.comcast.net",
21158 "zimbraWebClientLoginURL":"https://login.comcast.net/login?s=smartzone"
21159 };
21160
21161 var params = {
21162 app:"mail",
21163 settings:settings, batchInfoResponse:batchInfoResponse,
21164 offlineMode:false, devMode:false,
21165 protocolMode:protocolMode, httpPort:"80", httpsPort:"443",
21166 noSplashScreen:noSplashScreen
21167 };
21168 ZmZimbraMail.run(params);
21169 }
21170
21171 // START DOMContentLoaded
21172 // Mozilla and Opera 9 expose the event we could use
21173 if (document.addEventListener) {
21174 document.addEventListener("DOMContentLoaded", launch, null);
21175
21176 // mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
21177 document.addEventListener("load", launch, null);
21178 }
21179
21180 // for Internet Explorer. readyState will not be achieved on init call
21181 if (AjxEnv.isIE && AjxEnv.isWindows) {
21182 document.attachEvent("onreadystatechange", function(e) {
21183 if (document.readyState == "complete") {
21184 launch();
21185 }
21186 });
21187 }
21188
21189 if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
21190 var _timer = setInterval(function() {
21191 if (/loaded|complete/.test(document.readyState)) {
21192 launch();
21193 // call the onload handler
21194 }
21195 }, 10);
21196 }
21197 // END DOMContentLoaded
21198
21199 AjxCore.addOnloadListener(launch);
21200 AjxCore.addOnunloadListener(ZmZimbraMail.unload);
21201</script>
21202</div>
21203
21204
21205<div id="z_shell" class="DwtShell" style="height: 100%; width: 100%; "><div id="DWT1" style="position: absolute; overflow-x: visible; overflow-y: visible; width: 100%; height: 100%; z-index: 300; " class="DwtControl" parentid="z_shell"><div id="skin_outer" style="display: block; ">
21206 <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
21207 <tbody><tr id="skin_R1" class="ImgSkin_Chrome_R1">
21208 <td class="ImgSkin_Chrome_R1" colspan="3">
21209 <table width="98%" cellspacing="0" cellpadding="0" border="0" align="center">
21210 <tbody><tr>
21211 <!-- xr-feat-101 -->
21212 <td>
21213 <iframe scrolling="no" frameborder="0" style="height: 22px; width: 320px; margin-top: 0px; margin-right: 0px; margin-left: auto; position: relative; display: block;" src="/zimbra/skins/velodrome2/xpbar.html"></iframe>
21214 </td>
21215 <td class="ImgSkin_Chrome_R1"></td>
21216 <td width="100%">&nbsp;&nbsp;</td>
21217 <td class="R1Text">Hi, </td>
21218 <td><div id="skin_container_username"></div></td>
21219 <td class="R1Link"><nobr><a href="javascript:;" onclick="ZmZimbraMail._onClickLogOff();">Sign Out</a></nobr></td>
21220 <td class="R1Sep">&nbsp;|&nbsp;</td>
21221 <td class="R1Link R1Account"><a target="_new" href="https://customer.comcast.com/SmartUrl/Secure/Users.aspx">My Account</a></td>
21222 <td class="R1Link"><a href="javascript:;" onclick="ZmZimbraMail.helpLinkCallback();">Help</a></td>
21223 <td class="R1Sep">|</td>
21224 <td class="R1Link"><nobr><a target="_new" href="http://www.comcast.net/security/">Security</a></nobr></td>
21225 <td class="R1Sep">|</td>
21226 <td class="R1Link"><nobr><a target="_new" href="http://www.comcast.net/providers/askcomcast/popup.html" onclick="window.open(this.href,&quot;AskComcast&quot;,&quot;width=640,height=480,dependent,resizable&quot;);return false;">Ask Comcast</a></nobr></td>
21227 <td class="ImgSkin_Chrome_R1"></td>
21228 <!-- xr-feat-101 -->
21229 </tr>
21230 </tbody></table>
21231 </td>
21232 </tr>
21233 <tr>
21234 <td width="100%">
21235 <table id="skin_table_outer" class="skin_table fixed_table" cellspacing="0" cellpadding="0" border="0">
21236 <colgroup>
21237 <col id="skin_col_L">
21238 <col id="skin_col_tree">
21239 <col id="skin_col_sash">
21240 <col id="skin_col_main">
21241 <col id="skin_col_R">
21242 </colgroup>
21243 <tbody><tr id="skin_R2">
21244 <!-- xr-feat-111 -->
21245 <td>
21246 <div class="ImgSkin_Chrome_R2"></div>
21247 </td>
21248 <td class="ImgSkin_Chrome_R2" colspan="3">
21249 <table width="100%" cellspacing="0" cellpadding="0">
21250 <tbody><tr>
21251 <td>
21252 <div class="ImgSkin_Chrome_Logo" onclick="skin.gotoApp(ZmApp.PORTAL);return false;" style="cursor:pointer;"></div>
21253 </td>
21254 <td id="skin_td_search" valign="middle">
21255 <div style="position:relative;" align="right">
21256 <!-- search box -->
21257 <div id="skin_container_search" class="skin_container"></div>
21258 </div>
21259 </td>
21260 </tr>
21261 </tbody></table>
21262 </td>
21263 <td>
21264 <div class="ImgSkin_Chrome_R2"></div>
21265 </td>
21266 <!-- End xr-feat-111 -->
21267 </tr>
21268
21269 <!-- search builder -->
21270 <tr id="skin_tr_search_builder_toolbar">
21271 <td>
21272 <div class="ImgSkin_Chrome_SB_Toolbar_L"></div>
21273 </td>
21274 <td id="skin_td_search_builder_toolbar" class="ImgSkin_Chrome_SB_Toolbar" colspan="3">
21275 <div id="skin_container_search_builder_toolbar" class="skin_container">
21276 <!-- search builder toolbar -->
21277 </div>
21278 </td>
21279 <td>
21280 <div class="ImgSkin_Chrome_SB_Toolbar_R"></div>
21281 </td>
21282 </tr>
21283
21284 <tr id="skin_tr_search_builder">
21285 <td class="ImgSkin_Chrome_SB_L">
21286 <div></div>
21287 </td>
21288 <td id="skin_td_search_builder" class="ImgSkin_Chrome_SB" colspan="3">
21289 <div id="skin_container_search_builder" class="skin_container">
21290 <!-- search builder -->
21291 </div>
21292 </td>
21293 <td class="ImgSkin_Chrome_SB_R">
21294 <div></div>
21295 </td>
21296 </tr>
21297 <!-- end search builder -->
21298
21299 <tr id="skin_R3">
21300 <td>
21301 <div class="ImgSkin_Chrome_R3_L"></div>
21302 </td>
21303 <td class="ImgSkin_Chrome_R3">
21304 <div style="position:relative;width:100%;height:100%;">
21305 <div id="Xskin_container_current_app" class="skin_container">
21306 <table width="100%" height="100%">
21307 <tbody><tr>
21308 <td id="skin_td_quota">
21309 <div id="skin_container_quota" class="skin_container"><!-- quota --></div>
21310 </td>
21311 </tr>
21312 </tbody></table>
21313 </div>
21314 </div>
21315 </td>
21316 <td class="ImgSkin_Chrome_R3">&nbsp;</td>
21317 <td class="ImgSkin_Chrome_R3" style="padding:0px;">
21318 <table width="100%" cellspacing="0" cellpadding="0">
21319 <tbody><tr>
21320 <td id="skin_td_app_chooser">
21321 <div id="skin_container_app_chooser" class="skin_container"></div>
21322 </td>
21323
21324 </tr>
21325 </tbody></table>
21326 </td>
21327 <td>
21328 <div class="ImgSkin_Chrome_R3_R"></div>
21329 </td>
21330 </tr>
21331
21332 <tr id="skin_tr_main">
21333 <td id="skin_td_tree_outer" colspan="2">
21334 <table id="skin_tree_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
21335 <tbody><tr>
21336 <td height="100%" id="skin_td_tree">
21337 <div id="skin_container_tree" class="skin_container"></div>
21338 </td>
21339 </tr>
21340 <tr id="skin_tr_tree_footer">
21341 <td id="skin_td_tree_footer">
21342 <div id="skin_container_tree_footer" class="skin_container"></div>
21343 </td>
21344 </tr>
21345 <tr>
21346 <td id="skin_td_tree_bottom_ad" height="150">
21347 <div id="portlet_text">Loading...</div>
21348 </td>
21349 </tr>
21350 </tbody></table>
21351 </td>
21352 <td id="skin_td_tree_app_sash">
21353 <div class="DwtHorizontalSash ImgHSash" style="height:100%;">
21354 <div class="ImgHSash_thumb" style="position:relative;top:50%;"></div>
21355 </div>
21356 </td>
21357 <td id="skin_td_app_outer" colspan="2">
21358 <table id="skin_app_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
21359 <tbody><tr>
21360 <td id="skin_main_toolbar_container" class="skin_td_app_toolbar ImgSkin_Toolbar">
21361 <div id="skin_container_app_top_toolbar" class="skin_container"></div>
21362 </td>
21363 </tr>
21364 <tr>
21365 <td id="skin_td_app">
21366 <div id="skin_container_app_main" class="skin_container"></div>
21367 </td>
21368 </tr>
21369 </tbody></table>
21370 </td>
21371 <td></td>
21372 </tr>
21373
21374 <tr id="skin_tr_main_full" style="display:none">
21375 <td id="skin_td_app_full_outer" class="full_height" colspan="5" height="100%">
21376 <table id="skin_app_full_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
21377 <tbody><tr>
21378 <td id="skin_full_toolbar_container" class="skin_td_app_toolbar ImgSkin_Toolbar">
21379 <!--div id='skin_container_app_top_toolbar' class='skin_container'></div-->
21380 </td>
21381 </tr>
21382 <tr>
21383 <td id="skin_td_app_full">
21384 <div id="skin_container_app_main_full" class="skin_container" height="100%">
21385 <!--Full screen app-->
21386 &nbsp;
21387 </div>
21388 </td>
21389 </tr>
21390 </tbody></table>
21391 </td>
21392 </tr>
21393 </tbody></table>
21394 </td>
21395 <td valign="top" id="comcast-adsrvc" style="display:none;overflow:hidden;">
21396 <div class="skin_container" id="skin_adsrvc">
21397 <table cellpadding="0" cellspacing="0" border="0" height="100%" width="171">
21398 <tbody><tr height="100%">
21399 <td valign="middle" align="center" height="100%">
21400 <div id="comcast-adshowhide" class="AdSrvcLeftArrow"></div>
21401 </td>
21402 <td valign="middle" id="comcast-skyscrapperad" align="center">
21403 <!-- xr-feat-126 -->
21404 <div id="skin_container_sidebar_ad" style="height:95%;"></div>
21405
21406 <div class="adslug">
21407 <ul>
21408 <li class="comcast-adinfo" id="comcast-adinfo"><a href="#">Ad Info</a></li>
21409 <li class="comcast-adfeedback" id="comcast-adfeedback"><a href="#">Ad Feedback</a></li>
21410 </ul>
21411 </div>
21412 <!-- End xr-feat-126 -->
21413 </td>
21414 </tr>
21415 </tbody></table>
21416 </div>
21417 </td>
21418 </tr>
21419 <!-- xr-feat-173 -->
21420 <tr id="skin_R4">
21421 <td id="skin_td_R4" class="ImgSkin_Chrome_R4" colspan="3">
21422 <div id="skin_footer" class="skin_container">
21423 <table width="100%" id="skin_table_R4" class="skin_table fullSize" cellspacing="0" cellpadding="0">
21424 <tbody><tr>
21425 <td style="text-align:left;padding-left:20px;" width="23%"><table><tbody><tr><td>© 2011 Comcast Cable Communications</td></tr></tbody></table></td>
21426 <td width="14%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/privacy/">Privacy Statement</a></td></tr></tbody></table></td>
21427 <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>
21428 <td width="12%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/help/contact">Contact Us</a></td></tr></tbody></table></td>
21429 <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>
21430 <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>
21431 <td width="7%" align="right"><a target="blank" href="http://www.comcast.net/"><div class="ImgSkin_Customer_Logo_Bottom"></div></a></td>
21432 </tr>
21433 </tbody></table>
21434 </div>
21435 </td>
21436 </tr>
21437 <!-- End xr-feat-173 -->
21438 </tbody></table>
21439
21440 <!-- misc containers that haven't been placed yet -->
21441 <div id="skin_container_logo" class="skin_container offscreen"></div>
21442 <div id="skin_container_top_ad" class="skin_container offscreen"></div>
21443 <div id="skin_container_app_toolbar_sep" class="skin_container offscreen"></div>
21444 <div id="skin_container_tree_app_sash" class="skin_container offscreen"></div>
21445 <div id="skin_tr_status" class="offscreen"></div>
21446 <div id="skin_container_status" class="skin_container offscreen"></div>
21447</div></div><div class="BusyOverlay" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 600; cursor: default; display: none; " 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: 600; "><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: 100; left: -10000px; top: -10000px; "><div id="tooltipTopPointer" class="DwtToolTipTopPointer"><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"></div><div id="tooltipBottomPointer" class="DwtToolTipBottomPointer"><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-x: visible; overflow-y: 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-x: visible; overflow-y: visible; cursor: w-resize; z-index: 300; " class="console_inset_app_l" parentid="z_shell"><div class="DwtHorizontalSash ImgHSash"><center><div class="ImgHSash_thumb"></div></center></div></div><div id="z_banner" style="position: absolute; overflow-x: visible; overflow-y: visible; " 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 id="z_userName" style="position: static; overflow-x: visible; overflow-y: visible; " class="BannerTextUser" parentid="z_shell"></div><div id="z_userQuota" style="position: static; overflow-x: visible; overflow-y: visible; " class="BannerTextQuota" parentid="z_shell"></div><div id="z_status" style="position: absolute; overflow-x: visible; overflow-y: visible; " class="ZmStatus" parentid="z_shell"></div><div id="z_toast" style="position: absolute; overflow-x: visible; overflow-y: visible; z-index: 950; " class="ZToast ZToastInfo" parentid="z_shell"><div class="ZToastBG"><div class="ZToastContent"><div id="z_toast_icon" class="ZToastIcon"></div><div id="z_toast_text" class="ZToastText"></div></div></div></div><div id="DWT6" style="position: absolute; overflow-x: visible; overflow-y: visible; left: 345px; top: 309px; z-index: 700; " class="DwtDialog" parentid="z_shell"><div class="DwtDialog"><table cellspacing="0" cellpadding="0" style="cursor:move;" border="0"><tbody><tr id="DWT6_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="DWT6_title" class="ImgDialog_N DwtDialogTitle" nowrap="nowrap">XFINITY Connect</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="DWT6_content"><div id="DWT2" class="DwtMsgDialog"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top"><div class="ImgCritical_32"></div></td><td class="DwtMsgArea">Result of expression 'o' [undefined] is not an object.</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="DWT6_buttons" class="DwtDialogButtonBar"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td align="left"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT4"><div id="DWT8" style="position: static; overflow-x: visible; overflow-y: visible; " class="ZButton ZWidget ZHasText" parentid="DWT6"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT8_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT8_title" class="ImgButton ZWidgetTitle">Send Error Report</td><td id="DWT8_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT8_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT5"><div id="DWT9" style="position: static; overflow-x: visible; overflow-y: visible; display: block; " class="ZButton ZWidget ZHasText" parentid="DWT6"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT9_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT9_title" class="ImgButton ZWidgetTitle">Show Details</td><td id="DWT9_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT9_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></td><td align="right"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT3"><div id="DWT7" style="position: static; overflow-x: visible; overflow-y: visible; " class="ZButton ZWidget ZHasText" parentid="DWT6"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT7_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT7_title" class="ImgButton ZWidgetTitle">OK</td><td id="DWT7_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT7_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></body></html>