/****** BEGIN LICENSE BLOCK *****

Zimbra Collaboration Suite Web Client
Copyright (C) 2004, 2005, 2006, 2007 Zimbra, Inc.

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

Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.

***** END LICENSE BLOCK *****
*/function AjxEnv(){
}
AjxEnv._inited=false;
AjxEnv.DEFAULT_LOCALE=window.navigator.userLanguage||window.navigator.language||window.navigator.systemLanguage;
AjxEnv.reset=function(){
AjxEnv.browserVersion=-1;
AjxEnv.geckoDate=0;
AjxEnv.mozVersion=-1;
AjxEnv.isMac=false;
AjxEnv.isWindows=false;
AjxEnv.isLinux=false;
AjxEnv.isNav=false;
AjxEnv.isIE=false;
AjxEnv.isNav4=false;
AjxEnv.trueNs=true;
AjxEnv.isNav6=false;
AjxEnv.isNav6up=false;
AjxEnv.isNav7=false;
AjxEnv.isIE3=false;
AjxEnv.isIE4=false;
AjxEnv.isIE4up=false;
AjxEnv.isIE5=false;
AjxEnv.isIE5_5=false;
AjxEnv.isIE5up=false;
AjxEnv.isIE5_5up=false;
AjxEnv.isIE6=false;
AjxEnv.isIE6up=false;
AjxEnv.isNormalResolution=false;
AjxEnv.ieScaleFactor=1;
AjxEnv.isFirefox=false;
AjxEnv.isFirefox1up=false;
AjxEnv.isFirefox1_5up=false;
AjxEnv.isFirefox3up=false;
AjxEnv.isMozilla=false;
AjxEnv.isMozilla1_4up=false;
AjxEnv.isSafari=false;
AjxEnv.isCamino=false;
AjxEnv.isGeckoBased=false;
AjxEnv.isOpera=false;
AjxEnv.useTransparentPNGs=false;
AjxEnv.is800x600orLower=screen.width<=800&&screen.height<=600;
};
AjxEnv.parseUA=function(_1){
var _2=_1.toLowerCase();
var _3=_2.split(" ");
var i=0;
var _5=-1;
var _6=null;
var _7=false;
var _8=false;
var _9=false;
var _a=false;
var _b=false;
if(_3!=null){
if((_5=_3[0].search(/^\s*mozilla\//))!=-1){
_a=true;
AjxEnv.browserVersion=parseFloat(_3[0].substring(_5+8));
AjxEnv.isNav=true;
}
for(;i<_3.length;++i){
_6=_3[i];
if(_6.indexOf("compatible")!=-1){
_b=true;
AjxEnv.isNav=false;
}else{
if((_6.indexOf("opera"))!=-1){
AjxEnv.isOpera=true;
AjxEnv.isNav=false;
AjxEnv.browserVersion=parseFloat(_3[i+1]);
}else{
if((_6.indexOf("spoofer"))!=-1){
_7=true;
AjxEnv.isNav=false;
}else{
if((_6.indexOf("webtv"))!=-1){
_8=true;
AjxEnv.isNav=false;
}else{
if((_6.indexOf("hotjava"))!=-1){
_9=true;
AjxEnv.isNav=false;
}else{
if((_5=_6.indexOf("msie"))!=-1){
AjxEnv.isIE=true;
AjxEnv.browserVersion=parseFloat(_3[i+1]);
}else{
if((_5=_6.indexOf("gecko/"))!=-1){
AjxEnv.isGeckoBased=true;
AjxEnv.geckoDate=parseFloat(_6.substr(_5+6));
}else{
if((_5=_6.indexOf("rv:"))!=-1){
AjxEnv.mozVersion=parseFloat(_6.substr(_5+3));
AjxEnv.browserVersion=AjxEnv.mozVersion;
}else{
if((_5=_6.indexOf("firefox/"))!=-1){
AjxEnv.isFirefox=true;
AjxEnv.browserVersion=parseFloat(_6.substr(_5+8));
}else{
if((_5=_6.indexOf("camino/"))!=-1){
AjxEnv.isCamino=true;
AjxEnv.browserVersion=parseFloat(_6.substr(_5+7));
}else{
if((_5=_6.indexOf("netscape6/"))!=-1){
AjxEnv.trueNs=true;
AjxEnv.browserVersion=parseFloat(_6.substr(_5+10));
}else{
if((_5=_6.indexOf("netscape/"))!=-1){
AjxEnv.trueNs=true;
AjxEnv.browserVersion=parseFloat(_6.substr(_5+9));
}else{
if((_5=_6.indexOf("safari/"))!=-1){
AjxEnv.isSafari=true;
AjxEnv.browserVersion=parseFloat(_6.substr(_5+7));
}else{
if(_6.indexOf("windows")!=-1){
AjxEnv.isWindows=true;
}else{
if((_6.indexOf("macintosh")!=-1)||(_6.indexOf("mac_")!=-1)){
AjxEnv.isMac=true;
}else{
if(_6.indexOf("linux")!=-1){
AjxEnv.isLinux=true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
AjxEnv.isNav=(_a&&!_7&&!_b&&!AjxEnv.isOpera&&!_8&&!_9&&!AjxEnv.isSafari);
AjxEnv.isIE=(AjxEnv.isIE&&!AjxEnv.isOpera);
AjxEnv.isNav4=(AjxEnv.isNav&&(AjxEnv.browserVersion==4)&&(!AjxEnv.isIE));
AjxEnv.isNav6=(AjxEnv.isNav&&AjxEnv.trueNs&&(AjxEnv.browserVersion>=6)&&(AjxEnv.browserVersion<7));
AjxEnv.isNav6up=(AjxEnv.isNav&&AjxEnv.trueNs&&(AjxEnv.browserVersion>=6));
AjxEnv.isNav7=(AjxEnv.isNav&&AjxEnv.trueNs&&(AjxEnv.browserVersion==7));
AjxEnv.isIE3=(AjxEnv.isIE&&(AjxEnv.browserVersion<4));
AjxEnv.isIE4=(AjxEnv.isIE&&(AjxEnv.browserVersion==4)&&(AjxEnv.browserVersion==4));
AjxEnv.isIE4up=(AjxEnv.isIE&&(AjxEnv.browserVersion>=4));
AjxEnv.isIE5=(AjxEnv.isIE&&(AjxEnv.browserVersion==4)&&(AjxEnv.browserVersion==5));
AjxEnv.isIE5_5=(AjxEnv.isIE&&(AjxEnv.browserVersion==4)&&(AjxEnv.browserVersion==5.5));
AjxEnv.isIE5up=(AjxEnv.isIE&&(AjxEnv.browserVersion>=5));
AjxEnv.isIE5_5up=(AjxEnv.isIE&&(AjxEnv.browserVersion>=5.5));
AjxEnv.isIE6=(AjxEnv.isIE&&(AjxEnv.browserVersion==6));
AjxEnv.isIE6up=(AjxEnv.isIE&&(AjxEnv.browserVersion>=6));
AjxEnv.isIE7=(AjxEnv.isIE&&(AjxEnv.browserVersion==7));
AjxEnv.isIE7up=(AjxEnv.isIE&&(AjxEnv.browserVersion>=7));
AjxEnv.isMozilla=((AjxEnv.isNav&&AjxEnv.mozVersion&&AjxEnv.isGeckoBased&&(AjxEnv.geckoDate!=0)));
AjxEnv.isMozilla1_4up=(AjxEnv.isMozilla&&(AjxEnv.mozVersion>=1.4));
AjxEnv.isFirefox=((AjxEnv.isMozilla&&AjxEnv.isFirefox));
AjxEnv.isFirefox1up=(AjxEnv.isFirefox&&AjxEnv.browserVersion>=1);
AjxEnv.isFirefox1_5up=(AjxEnv.isFirefox&&AjxEnv.browserVersion>=1.5);
AjxEnv.isFirefox2_0up=(AjxEnv.isFirefox&&AjxEnv.browserVersion>=2);
AjxEnv.isFirefox3up=(AjxEnv.isFirefox&&AjxEnv.browserVersion>=3);
AjxEnv.browser="";
if(AjxEnv.isOpera){
AjxEnv.browser="OPERA";
}else{
if(AjxEnv.isSafari){
AjxEnv.browser="SAF";
}else{
if(AjxEnv.isCamino){
AjxEnv.browser="CAM";
}else{
if(_8){
AjxEnv.browser="WEBTV";
}else{
if(_9){
AjxEnv.browser="HOTJAVA";
}else{
if(AjxEnv.isFirefox3up){
AjxEnv.browser="FF3.0";
}else{
if(AjxEnv.isFirefox2_0up){
AjxEnv.browser="FF2.0";
}else{
if(AjxEnv.isFirefox1_5up){
AjxEnv.browser="FF1.5";
}else{
if(AjxEnv.isFirefox1up){
AjxEnv.browser="FF1.0";
}else{
if(AjxEnv.isFirefox){
AjxEnv.browser="FF";
}else{
if(AjxEnv.isNav7){
AjxEnv.browser="NAV7";
}else{
if(AjxEnv.isNav6){
AjxEnv.browser="NAV6";
}else{
if(AjxEnv.isNav4){
AjxEnv.browser="NAV4";
}else{
if(AjxEnv.isIE7){
AjxEnv.browser="IE7";
}else{
if(AjxEnv.isIE6){
AjxEnv.browser="IE6";
}else{
if(AjxEnv.isIE5){
AjxEnv.browser="IE5";
}else{
if(AjxEnv.isIE4){
AjxEnv.browser="IE4";
}else{
if(AjxEnv.isIE3){
AjxEnv.browser="IE";
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
AjxEnv.platform="";
if(AjxEnv.isWindows){
AjxEnv.platform="Win";
}else{
if(AjxEnv.isMac){
AjxEnv.platform="Mac";
}else{
if(AjxEnv.isLinux){
AjxEnv.platform="Linux";
}
}
}
}
if(AjxEnv.isIE){
AjxEnv.isNormalResolution=true;
AjxEnv.ieScaleFactor=screen.deviceXDPI/screen.logicalXDPI;
if(AjxEnv.ieScaleFactor>1){
AjxEnv.isNormalResolution=false;
}
}
AjxEnv.useTransparentPNGs=!AjxEnv.isIE&&!AjxEnv.isLinux&&!AjxEnv.isSafari;
AjxEnv._inited=!AjxEnv.isIE;
var _c=AjxEnv.isSafari?AjxEnv.getWebkitVersion():null;
AjxEnv.isSafariNightly=_c&&_c["is_nightly"];
};
AjxEnv.getWebkitVersion=function(){
var _d;
var _e=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");
var _f=_e.exec(navigator.userAgent);
if(_f){
var _10=_f[1];
var _11=_10.split(".");
var _12=(_10[_10.length-1]=="+");
var _13=_12?"+":parseInt(_11[1]);
if(isNaN(_13)){
_13="";
}
_d={major:parseInt(_11[0]),minor:_13,is_nightly:_12};
}
return {major:_d["major"],minor:_d["minor"],is_nightly:_d["is_nightly"]};
};
AjxEnv.reset();
AjxEnv.parseUA(navigator.userAgent);
if(AjxEnv.isSafari){
if(!String.prototype._AjxOldReplace){
String.prototype._AjxOldReplace=String.prototype.replace;
String.prototype.replace=function(re,val){
if(typeof val!="function"){
return this._AjxOldReplace(re,val);
}else{
var str=this.slice(0),v,l,a;
while(a=re.exec(str)){
v=val.apply(null,a);
l=a[0].length;
re.lastIndex-=l-v.length;
str=str.substr(0,a.index)+v+str.substr(a.index+l);
if(!re.global){
break;
}
}
return str;
}
};
}
}
function AjxCallback(obj,_18,_19){
if(arguments.length==0){
return;
}
this.obj=obj;
this.func=_18;
this.args=_19;
}
AjxCallback.prototype.toString=function(){
return "AjxCallback";
};
AjxCallback.prototype.run=function(){
var _1a=[];
if(typeof this.args!="undefined"){
if(this.args instanceof Array){
_1a=arguments.length>0?_1a.concat(this.args):this.args;
}else{
_1a.push(this.args);
}
}
for(var i=0;i<arguments.length;++i){
_1a.push(arguments[i]);
}
return this.func.apply(this.obj||window,_1a);
};
AjxCallback.simpleClosure=function(_1c,obj){
var _1e=[];
for(var i=2;i<arguments.length;++i){
_1e.push(arguments[i]);
}
return function(){
var _20=[];
for(var i=0;i<arguments.length;++i){
_20.push(arguments[i]);
}
return _1c.apply(obj||this,_1e.concat(_20));
};
};
AjxCallback.returnFalse=function(){
return false;
};
function AjxLoader(){
}
AjxLoader.__createXHR;
if(window.XMLHttpRequest){
AjxLoader.__createXHR=function(){
return new XMLHttpRequest();
};
}else{
if(ActiveXObject){
(function(){
var _22=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
for(var i=0;i<_22.length;i++){
try{
new ActiveXObject(_22[i]);
AjxLoader.__createXHR=function(){
return new ActiveXObject(_22[i]);
};
break;
}
catch(e){
}
}
})();
}
}
AjxLoader.syncLoad=function(url,_25,_26,_27){
return AjxLoader.load(null,url,_25,_26,_27);
};
AjxLoader.asyncLoad=function(_28,url,_2a,_2b,_2c){
return AjxLoader.load(_28,url,_2a,_2b,_2c);
};
AjxLoader.load=function(_2d,url,_2f,_30,_31){
var req=AjxLoader.__createXHR();
var _33=Boolean(_2d)?function(){
AjxLoader._response(req,_2d);
}:null;
var _34=_2f?"POST":"GET";
if(_33){
req.onreadystatechange=_33;
}
req.open(_34,url,Boolean(_33),_30,_31);
req.send(_2f);
return req;
};
AjxLoader._response=function(req,_36){
if(req.readyState==4){
_36.run(req);
}
};
function AjxPackage(){
}
AjxPackage._packages={};
AjxPackage._extension=".js";
AjxPackage.__depth=0;
AjxPackage.setBasePath=function(_37){
AjxPackage._basePath=_37;
};
AjxPackage.setExtension=function(_38){
AjxPackage._extension=_38;
};
AjxPackage.setQueryString=function(_39){
AjxPackage._queryString=_39;
};
AjxPackage.define=function(_3a){
AjxPackage.__log("define "+_3a,"font-weight:bold");
_3a=AjxPackage.__package2path(_3a);
if(!AjxPackage._packages[_3a]){
AjxPackage._packages[_3a]=true;
return true;
}
return false;
};
AjxPackage.undefine=function(_3b){
AjxPackage.__log("undefine "+_3b,"font-weight:bold;font-style:italic");
_3b=AjxPackage.__package2path(_3b);
if(AjxPackage._packages[_3b]){
delete AjxPackage._packages[_3b];
}
};
AjxPackage.require=function(_3c,_3d,_3e,_3f,_40){
var _41=_3c;
AjxPackage.__log("require "+_3c,"font-style:italic");
_3c=AjxPackage.__package2path(_3c);
if(AjxPackage._packages[_3c]){
return;
}
AjxPackage.define(_41);
_3d=_3d||AjxPackage._basePath||window.contextPath;
_3e=_3e||AjxPackage._extension;
var _42=[_3d,"/",_3c,_3e];
if(AjxPackage._queryString){
_42.push("?",AjxPackage._queryString);
}
var _43=_42.join("");
AjxPackage.__log("loading "+_43);
var req=AjxLoader.syncLoad(_43,null,_3f,_40);
if(req.status==200){
var _45=req.responseText||"";
AjxPackage.__requireEval(_45);
}else{
AjxPackage.__log("error: "+req.status,"background-color:red");
}
};
AjxPackage.__package2path=function(_46){
return _46.replace(/\./g,"/").replace(/\*$/,"__all__");
};
AjxPackage.__requireEval=function(_47){
AjxPackage.__depth++;
if(window.execScript){
window.execScript(_47);
}else{
if(AjxEnv.isGeckoBased){
window.eval(_47);
}else{
var e=document.createElement("SCRIPT");
var t=document.createTextNode(_47);
e.appendChild(t);
var _4a=document.getElementsByTagName("HEAD");
if(_4a.length==0){
var h=document.createElement("HEAD");
document.documentElement.appendChild(h);
_4a=[h];
}
_4a[0].appendChild(e);
}
}
AjxPackage.__depth--;
};
AjxPackage.__log=function(s,_4d){
};
function AjxTemplate(){
}
AjxTemplate._templates={};
AjxTemplate.register=function(_4e,_4f,_50){
AjxPackage.define(_4e.replace(/#.*$/,""));
AjxTemplate._templates[_4e]={name:_4e,func:_4f,params:_50||{}};
};
AjxTemplate.getTemplate=function(_51){
var _52=AjxTemplate._templates[_51];
return _52&&_52.func;
};
AjxTemplate.getParams=function(_53){
var _54=AjxTemplate._templates[_53];
return _54&&_54.params;
};
AjxTemplate.expand=function(_55,_56,_57){
var pkg=_55.replace(/#.*$/,"");
var id=_55.replace(/^[^#]*#?/,"");
if(id){
_55=[pkg,id].join("#");
}
AjxPackage.require(pkg);
var _5a=Boolean(_57);
_57=_57||[];
var _5b=AjxTemplate.getTemplate(_55);
if(_5b){
try{
var _5c=AjxTemplate.getParams(_55);
_5b(_55,_5c,_56,_57);
}
catch(e){
_57.push(this.__formatError(_55,e));
}
}else{
_57.push(this.__formatError(_55,"template not found"));
}
return _5a?_57.length:_57.join("");
};
AjxTemplate.setContent=function(_5d,_5e,_5f){
if(typeof _5d=="string"){
_5d=document.getElementById(_5d);
}
if(_5d==null){
return;
}
var _60=AjxTemplate.expand(_5e,_5f);
_5d.innerHTML=_60;
};
AjxTemplate.__formatError=function(_61,_62){
return "Error in template '"+_61+"': "+_62;
};
function AjxCore(){
}
AjxCore._objectIds=[null];
AjxCore.assignId=function(_63){
var _64=AjxCore._objectIds.length;
AjxCore._objectIds[_64]=_63;
return _64;
};
AjxCore.unassignId=function(_65){
AjxCore._objectIds[_65]=null;
};
AjxCore.objectWithId=function(_66){
return AjxCore._objectIds[_66];
};
AjxCore.addListener=function(_67,_68,_69){
_67=AjxCore._getEventSource(_67);
var _6a=AjxCore._getListenerStruct(_67,_68,true);
_6a.list[_6a.list.length]=_69;
};
AjxCore.setEventHandler=function(_6b,_6c,_6d){
_6b=AjxCore._getEventSource(_6b);
var _6e=AjxCore._getListenerStruct(_6b,_6c,true);
_6e.single=_6d;
};
AjxCore.removeListener=function(_6f,_70,_71){
_6f=AjxCore._getEventSource(_6f);
var _72=AjxCore._getListenerStruct(_6f,_70);
if(_72){
var _73=_72.list;
var len=_73.length;
for(var i=0;i<len;i++){
if(_73[i]==_71){
_73[i]=null;
}
}
}
};
AjxCore.removeAllListeners=function(_76,_77){
_76=AjxCore._getEventSource(_76);
var _78=AjxCore._getListenerStruct(_76,_77);
if(_78){
var _79=_78.list;
var len=_79.length;
for(var i=0;i<len;i++){
_79[i]=null;
}
}
AjxCore.unassignId(_78.id);
};
AjxCore.notifyListeners=function(_7c,_7d,_7e){
_7c=AjxCore._getEventSource(_7c);
var _7f=AjxCore._getListenerStruct(_7c,_7d);
if(_7f){
_7c[_7d](_7e);
}
};
AjxCore._getEventSource=function(_80){
if(typeof (_80)=="string"){
_80=document.getElementById(_80);
}
return _80;
};
AjxCore.getListenerStruct=function(_81,_82){
return AjxCore._getListenerStruct(_81,_82);
};
AjxCore._getListenerStruct=function(_83,_84,_85){
var _86=null;
if(_83[_84]){
var id=_83[_84]._lsListenerStructId;
_86=AjxCore.objectWithId(id);
}else{
if(_85){
_86=AjxCore._setupListener(_83,_84);
}
}
return _86;
};
AjxCore._setupListener=function(_88,_89,id){
var _8b=new Object();
_8b.list=new Array();
_8b.single=null;
var id=_8b.id=AjxCore.assignId(_8b);
var _8c=AjxCore._createListenerClosure(id);
_88[_89]=_8c;
_88[_89]._lsListenerStructId=id;
return _8b;
};
AjxCore._createListenerClosure=function(id){
var _8e=function(_8f){
var _90=AjxCore.objectWithId(id);
var _91=_90.list;
var len=_91.length;
for(var i=0;i<len;i++){
var _94=_91[i];
if(_94){
if(typeof (_94)=="string"){
eval(_94);
}else{
if(_94.handleEvent){
_94.handleEvent(_8f,this);
}else{
_94(_8f,this);
}
}
}
}
if(_90.single){
var _94=_90.single;
if(typeof (_94)=="string"){
eval(_94);
}else{
return _94.handleEvent?_94.handleEvent(_8f,this):_94(_8f,this);
}
}
};
return _8e;
};
AjxCore.addOnloadListener=function(_95){
if(window.onload&&(!window.onload._lsListenerStructId)){
var _96=window.onload;
window.onload=null;
AjxCore.addListener(window,"onload",_96);
}
AjxCore.addListener(window,"onload",_95);
};
AjxCore.addOnunloadListener=function(_97){
if(window.onunload&&(!window.onunload._lsListenerStructId)){
var _98=window.onunload;
window.onunload=null;
AjxCore.addListener(window,"onunload",_98);
}
AjxCore.addListener(window,"onunload",_97);
};
function AjxUtil(){
}
AjxUtil.FLOAT_RE=/^[+\-]?((\d+(\.\d*)?)|((\d*\.)?\d+))([eE][+\-]?\d+)?$/;
AjxUtil.NOTFLOAT_RE=/[^\d\.]/;
AjxUtil.NOTINT_RE=/[^0-9]+/;
AjxUtil.LIFETIME_FIELD=/^([0-9])+([dhms])?$/;
AjxUtil.isSpecified=function(_99){
return ((_99!==void 0)&&(_99!==null));
};
AjxUtil.isUndefined=function(_9a){
return (_9a===void 0);
};
AjxUtil.isNull=function(_9b){
return (_9b===null);
};
AjxUtil.isBoolean=function(_9c){
return (typeof (_9c)=="boolean");
};
AjxUtil.isString=function(_9d){
return (typeof (_9d)=="string");
};
AjxUtil.isNumber=function(_9e){
return (typeof (_9e)=="number");
};
AjxUtil.isObject=function(_9f){
return ((typeof (_9f)=="object")&&(_9f!==null));
};
AjxUtil.isArray=function(_a0){
return AjxUtil.isInstance(_a0,Array);
};
AjxUtil.isFunction=function(_a1){
return (typeof (_a1)=="function");
};
AjxUtil.isDate=function(_a2){
return AjxUtil.isInstance(_a2,Date);
};
AjxUtil.isLifeTime=function(_a3){
return AjxUtil.LIFETIME_FIELD.test(_a3);
};
AjxUtil.isNumeric=function(_a4){
return (!isNaN(parseFloat(_a4))&&AjxUtil.FLOAT_RE.test(_a4)&&!AjxUtil.NOTFLOAT_RE.test(_a4));
};
AjxUtil.isLong=function(_a5){
return (AjxUtil.isNumeric(_a5)&&!AjxUtil.NOTINT_RE.test(_a5));
};
AjxUtil.isNonNegativeLong=function(_a6){
return (AjxUtil.isNumeric(_a6)&&AjxUtil.isLong(_a6)&&(parseFloat(_a6)>=0));
};
AjxUtil.IP_ADDRESS_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?$/;
AjxUtil.DOMAIN_NAME_SHORT_RE=/^[A-Za-z0-9\-]{2,}$/;
AjxUtil.DOMAIN_NAME_FULL_RE=/^[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{2,}){1,}$/;
AjxUtil.HOST_NAME_RE=/^[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{1,})*(\.[A-Za-z0-9\-]{2,})*$/;
AjxUtil.HOST_NAME_WITH_PORT_RE=/^[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{2,})*:([0-9])+$/;
AjxUtil.EMAIL_SHORT_RE=/^[^@\s]+$/;
AjxUtil.EMAIL_FULL_RE=/^[^@\s]+@[A-Za-z0-9\-]{2,}(\.[A-Za-z0-9\-]{2,})*$/;
AjxUtil.EMAIL_RE=/^([a-zA-Z0-9_\-\'])+((\.)?([a-zA-Z0-9_\-\'])+)*@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
AjxUtil.SHORT_URL_RE=/^[A-Za-z0-9]{2,}:\/\/[A-Za-z]+[A-Za-z0-9\-]+(\.[A-Za-z]+[A-Za-z0-9\-]+)*(:([0-9])+)*$/;
AjxUtil.IP_SHORT_URL_RE=/^[A-Za-z0-9]{2,}:\/\/\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?(:([0-9])+)*$/;
AjxUtil.isIpAddress=function(s){
return AjxUtil.IP_ADDR_RE.test(s);
};
AjxUtil.isDomain=function(s){
return AjxUtil.DOMAIN_RE.test(s);
};
AjxUtil.isHostName=function(s){
return AjxUtil.HOST_NAME_RE.test(s);
};
AjxUtil.isDomainName=function(s,_ab){
return _ab?AjxUtil.DOMAIN_NAME_SHORT_RE.test(s):AjxUtil.DOMAIN_NAME_FULL_RE.test(s);
};
AjxUtil.isEmailAddress=function(s,_ad){
return _ad?AjxUtil.EMAIL_SHORT_RE.test(s):AjxUtil.EMAIL_FULL_RE.test(s);
};
AjxUtil.SIZE_GIGABYTES="GB";
AjxUtil.SIZE_MEGABYTES="MB";
AjxUtil.SIZE_KILOBYTES="KB";
AjxUtil.SIZE_BYTES="B";
AjxUtil.formatSize=function(_ae,_af,_b0){
if(_af==null){
_af=true;
}
if(_b0==null){
_b0=20;
}
var _b1=AjxUtil.SIZE_BYTES;
if(_ae>=1073741824){
_ae/=1073741824;
_b1=AjxUtil.SIZE_GIGABYTES;
}else{
if(_ae>=1048576){
_ae/=1048576;
_b1=AjxUtil.SIZE_MEGABYTES;
}else{
if(_ae>1023){
_ae/=1024;
_b1=AjxUtil.SIZE_KILOBYTES;
}
}
}
var _b2=_af?Math.round(_ae):_ae.toFixed(_b0).replace(/\.?0+$/,"");
var _b3=" "+_b1;
return _b2+_b3;
};
AjxUtil.formatSizeForUnits=function(_b4,_b5,_b6,_b7){
if(_b5==null){
_b5=AjxUtil.SIZE_BYTES;
}
if(_b6==null){
_b6=true;
}
if(_b7==null){
_b7=20;
}
switch(_b5){
case AjxUtil.SIZE_GIGABYTES:
_b4/=1073741824;
break;
case AjxUtil.SIZE_MEGABYTES:
_b4/=1048576;
break;
case AjxUtil.SIZE_KILOBYTES:
_b4/=1024;
break;
}
var _b8=_b6?Math.round(_b4):_b4.toFixed(_b7).replace(/\.?0+$/,"");
return _b8;
};
AjxUtil.parseSize=function(_b9,_ba){
if(typeof _b9!=_STRING_){
_b9=_b9.toString();
}
var _bb=parseFloat(_b9.replace(/^\s*/,""));
var _bc=/[GMK]?B$/i;
var _bd=_bc.exec(_b9);
if(_bd){
_ba=_bd[0].toUpperCase();
}
switch(_ba){
case AjxUtil.SIZE_GIGABYTES:
_bb*=1073741824;
break;
case AjxUtil.SIZE_MEGABYTES:
_bb*=1048576;
break;
case AjxUtil.SIZE_KILOBYTES:
_bb*=1024;
break;
}
return _bb;
};
AjxUtil.isInstance=function(_be,_bf){
return !!(_be&&_be.constructor&&(_be.constructor===_bf));
};
AjxUtil.assert=function(_c0,_c1){
if(!_c0&&AjxUtil.onassert){
AjxUtil.onassert(_c1);
}
};
AjxUtil.onassert=function(_c2){
var _c3=new Object();
_c3.message=_c2;
var _c4=new Array();
if(AjxEnv.isIE5_5up){
var _c5=arguments.caller;
while(_c5){
_c4[_c4.length]=_c5.callee;
_c5=_c5.caller;
}
}else{
try{
var _c5=arguments.callee.caller;
while(_c5){
_c4[_c4.length]=_c5;
if(_c4.length>2){
break;
}
_c5=_c5.caller;
}
}
catch(e){
}
}
_c3.stack=_c4;
var _c6="";
var _c7=170;
for(var i=1;i<_c4.length;i++){
if(i>1){
_c6+="\n";
}
if(i<11){
var fs=_c4[i].toString();
if(fs.length>_c7){
fs=fs.substr(0,_c7)+"...";
fs=fs.replace(/\n/g,"");
}
_c6+=i+": "+fs;
}else{
_c6+="("+(_c4.length-11)+" frames follow)";
break;
}
}
alert("assertion:\n\n"+_c2+"\n\n---- Call Stack ---\n"+_c6);
throw _c3;
};
AjxUtil.NODE_REPEATS=new Object();
AjxUtil.NODE_REPEATS["folder"]=true;
AjxUtil.NODE_REPEATS["search"]=true;
AjxUtil.NODE_REPEATS["tag"]=true;
AjxUtil.NODE_REPEATS["pref"]=true;
AjxUtil.NODE_REPEATS["attr"]=true;
AjxUtil.NODE_REPEATS["c"]=true;
AjxUtil.NODE_REPEATS["m"]=true;
AjxUtil.NODE_REPEATS["cn"]=true;
AjxUtil.NODE_REPEATS["e"]=true;
AjxUtil.NODE_REPEATS["a"]=true;
AjxUtil.NODE_REPEATS["mbx"]=true;
AjxUtil.NODE_REPEATS["prefs"]=true;
AjxUtil.NODE_REPEATS["attrs"]=true;
AjxUtil.NODE_REPEATS["tags"]=true;
AjxUtil.NODE_IS_ATTR=new Object();
AjxUtil.NODE_IS_ATTR["authToken"]=true;
AjxUtil.NODE_IS_ATTR["lifetime"]=true;
AjxUtil.NODE_IS_ATTR["sessionId"]=true;
AjxUtil.NODE_IS_ATTR["name"]=true;
AjxUtil.NODE_IS_ATTR["quotaUsed"]=true;
AjxUtil.NODE_IS_ATTR["su"]=true;
AjxUtil.NODE_IS_ATTR["fr"]=true;
AjxUtil.NODE_IS_ATTR["mid"]=true;
AjxUtil.NODE_CONTENT=new Object();
AjxUtil.NODE_CONTENT["pref"]=true;
AjxUtil.NODE_CONTENT["attr"]=true;
AjxUtil.NODE_CONTENT["a"]=true;
AjxUtil.ELEMENT_NODE=1;
AjxUtil.TEXT_NODE=3;
AjxUtil.xmlToJs=function(_ca,_cb){
if(_ca.nodeType==AjxUtil.TEXT_NODE){
return ["\"",_ca.data,"\""].join("");
}
var _cc=_ca.name?_ca.name:_ca.localName;
if(_ca.nodeType==AjxUtil.ELEMENT_NODE){
var _cd=(_ca.childNodes&&_ca.childNodes.length==1&&(_ca.childNodes[0].nodeType==AjxUtil.TEXT_NODE));
var _ce;
if(_cb){
_ce="{";
}else{
if(_cd){
_ce=[_cc,":"].join("");
}else{
_ce=[_cc,":{"].join("");
}
}
var _cf=false;
if(_ca.attributes){
for(var i=0;i<_ca.attributes.length;i++){
var _d1=_ca.attributes[i];
if(_d1.name=="xmlns"){
continue;
}
if(_cf){
_ce+=",";
}
var _d2=AjxUtil.isNumeric(_d1.value)?_d1.value:AjxUtil.jsEncode(_d1.value);
_ce=[_ce,_d1.name,":",_d2].join("");
_cf=true;
}
}
if(_ca.hasChildNodes()){
var _d3=new Object();
var _d4=false;
var len=_ca.childNodes.length;
for(var i=0;i<len;i++){
var _d6=_ca.childNodes[i];
var _d7=_d6.name?_d6.name:_d6.localName;
var _d8=AjxUtil.NODE_IS_ATTR[_d7]||(_cc=="content"&&parent.name=="note");
if(_d8){
if(_cf){
_ce+=",";
}
_ce=[_ce,_d7,":",AjxUtil.jsEncode(_d6.textContent)].join("");
_cf=true;
}else{
if(!_d3[_d7]){
_d3[_d7]=new Array();
}
_d3[_d7].push(_d6);
_d4=true;
}
}
if(_d4&&_cf){
_ce+=",";
_cf=false;
}
for(var _d7 in _d3){
if(_cf){
_ce+=",";
_cf=false;
}
var _d9=AjxUtil.NODE_REPEATS[_d7]||(_d7=="mp"&&_cc=="mp");
if(_d9){
_ce+=_d7+":[";
}
var _da=_d3[_d7];
for(var i=0;i<_da.length;i++){
if(_cf){
_ce+=",";
}
_ce+=AjxUtil.xmlToJs(_da[i],_d9);
_cf=true;
}
if(_d9){
_ce+="]";
}
}
}
if(!_cd){
_ce+="}";
}
}
return _ce;
};
AjxUtil.JS_CHAR_ENCODINGS=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F"];
AjxUtil.jsEncode=function(_db){
if(!_db){
return "\"\"";
}
var _dc="\"";
for(var i=0;i<_db.length;i++){
var c=_db.charAt(i);
switch(c){
case "\\":
case "\"":
case "/":
_dc+="\\"+c;
break;
default:
var _df=_db.charCodeAt(i);
_dc+=(_df<32)?AjxUtil.JS_CHAR_ENCODINGS[_df]:c;
}
}
_dc+="\"";
return _dc;
};
AjxUtil.getInnerText=function(_e0){
if(AjxEnv.isIE){
return _e0.innerText;
}
function f(n){
if(n){
if(n.nodeType==3){
return n.data;
}
if(n.nodeType==1){
if(/^br$/i.test(n.tagName)){
return "\r\n";
}
var str="";
for(var i=n.firstChild;i;i=i.nextSibling){
str+=f(i);
}
return str;
}
}
return "";
}
return f(_e0);
};
AjxUtil.createProxy=function(_e4,_e5){
var _e6;
var _e7=function(){
};
_e7.prototype=_e4;
if(_e4 instanceof Array){
_e6=new Array();
var cnt=_e4.length;
for(var ix=0;ix<cnt;ix++){
_e6[ix]=_e4[ix];
}
}else{
_e6=new _e7;
}
if(_e5){
for(var _ea in _e4){
if(typeof _e4[_ea]=="object"){
_e6[_ea]=AjxUtil.createProxy(_e4[_ea],_e5-1);
}
}
}
_e6._object_=_e4;
return _e6;
};
AjxUtil.collapseList=function(_eb){
var _ec=[];
for(var i=0;i<_eb.length;i++){
if(_eb[i]){
_ec.push(_eb[i]);
}
}
return _ec;
};
AjxUtil.indexOf=function(_ee,_ef,_f0){
if(_ee){
for(var i=0;i<_ee.length;i++){
var _f2=_ee[i];
if((_f0&&_f2===_ef)||(!_f0&&_f2==_ef)){
return i;
}
}
}
return -1;
};
AjxUtil.keys=function(_f3){
var _f4=[];
for(var p in _f3){
_f4.push(p);
}
return _f4;
};
AjxUtil.values=function(_f6){
var _f7=[];
for(var p in _f6){
_f7.push(_f6[p]);
}
return _f7;
};
AjxUtil.parseQueryString=function(){
var _f9=""+window.location;
var _fa=_f9.indexOf("?");
if(_fa==-1){
return {};
}
var _fb=_f9.substring(_fa+1).split("&");
var _fc={};
for(var i=0;i<_fb.length;i++){
var _fe=_fb[i].split("=");
_fc[_fe[0]]=_fe[1];
}
return _fc;
};
function AjxException(msg,code,_101,_102){
if(arguments.length==0){
return;
}
this.msg=msg;
this.code=code;
this.method=_101;
this.detail=_102;
}
AjxException.prototype.toString=function(){
return "AjxException";
};
AjxException.prototype.dump=function(){
return "AjxException: msg="+this.msg+" code="+this.code+" method="+this.method+" detail="+this.detail;
};
AjxException.INVALIDPARENT="AjxException.INVALIDPARENT";
AjxException.INVALID_OP="AjxException.INVALID_OP";
AjxException.INTERNAL_ERROR="AjxException.INTERNAL_ERROR";
AjxException.INVALID_PARAM="AjxException.INVALID_PARAM";
AjxException.UNIMPLEMENTED_METHOD="AjxException.UNIMPLEMENTED_METHOD";
AjxException.NETWORK_ERROR="AjxException.NETWORK_ERROR";
AjxException.OUT_OF_RPC_CACHE="AjxException.OUT_OF_RPC_CACHE";
AjxException.UNSUPPORTED="AjxException.UNSUPPORTED";
AjxException.UNKNOWN_ERROR="AjxException.UNKNOWN_ERROR";
AjxException.CANCELED="AjxException.CANCELED";
function AjxCookie(){
}
AjxCookie.prototype.toString=function(){
return "AjxCookie";
};
AjxCookie.getCookie=function(doc,name){
var arg=name+"=";
var alen=arg.length;
var clen=doc.cookie.length;
var _108=doc.cookie;
var i=0;
while(i<clen){
var j=i+alen;
if(_108.substring(i,j)==arg){
var _10b=_108.indexOf(";",j);
if(_10b==-1){
_10b=_108.length;
}
return unescape(_108.substring(j,_10b));
}
i=_108.indexOf(" ",i)+1;
if(i==0){
break;
}
}
return null;
};
AjxCookie.setCookie=function(doc,name,_10e,_10f,path,_111,_112){
doc.cookie=name+"="+escape(_10e)+((_10f)?"; expires="+_10f.toGMTString():"")+((path)?"; path="+path:"")+((_111)?"; domain="+_111:"")+((_112)?"; secure":"");
};
AjxCookie.deleteCookie=function(doc,name,path,_116){
doc.cookie=name+"="+((path)?"; path="+path:"")+((_116)?"; domain="+_116:"")+"; expires=Fri, 31 Dec 1999 23:59:59 GMT";
};
AjxCookie.areCookiesEnabled=function(doc){
var name="ZM_COOKIE_TEST";
var _119="Zimbra";
AjxCookie.setCookie(doc,name,_119);
var _11a=AjxCookie.getCookie(doc,name);
AjxCookie.deleteCookie(doc,name);
return _11a==_119;
};
function AjxSoapException(msg,code,_11d,_11e){
AjxException.call(this,msg,code,_11d,_11e);
}
AjxSoapException.prototype.toString=function(){
return "AjxSoapException";
};
AjxSoapException.prototype=new AjxException;
AjxSoapException.prototype.constructor=AjxSoapException;
AjxSoapException.INTERNAL_ERROR="INTERNAL_ERROR";
AjxSoapException.INVALID_PDU="INVALID_PDU";
AjxSoapException.ELEMENT_EXISTS="ELEMENT_EXISTS";
function AjxSoapFault(_11f){
if(arguments.length==0){
return;
}
var _120=_11f.prefix;
var _121=_120+":Code";
var _122=_120+":Reason";
var _123=_120+":Detail";
var len=_11f.childNodes.length;
for(var i=0;i<len;i++){
var _126=_11f.childNodes[i];
if(_126.nodeName==_121){
var _127=_126.firstChild.firstChild.nodeValue;
if(_127==(_120+":VersionMismatch")){
this.faultCode=AjxSoapFault.VERSION_MISMATCH;
}else{
if(_127==(_120+":MustUnderstand")){
this.faultCode=AjxSoapFault.MUST_UNDERSTAND;
}else{
if(_127==(_120+":DataEncodingUnknown")){
this.faultCode=AjxSoapFault.DATA_ENCODING_UNKNOWN;
}else{
if(_127==(_120+":Sender")){
this.faultCode=AjxSoapFault.SENDER;
}else{
if(_127==(_120+":Receiver")){
this.faultCode=AjxSoapFault.RECEIVER;
}else{
this.faultCode=AjxSoapFault.UNKNOWN;
}
}
}
}
}
}else{
if(_126.nodeName==_122){
this.reason=_126.firstChild.firstChild.nodeValue;
}else{
if(_126.nodeName==_123){
this.errorCode=_126.firstChild.firstChild.firstChild.nodeValue;
}
}
}
}
}
AjxSoapFault.prototype.toString=function(){
return "AjxSoapFault";
};
AjxSoapFault.SENDER=-1;
AjxSoapFault.RECEIVER=-2;
AjxSoapFault.VERSION_MISMATCH=-3;
AjxSoapFault.MUST_UNDERSTAND=-4;
AjxSoapFault.DATA_ENCODING_UNKNOWN=-5;
AjxSoapFault.UNKNOWN=-6;
function AjxSoapDoc(){
this._soapURI=AjxSoapDoc._SOAP_URI;
}
AjxSoapDoc.prototype.toString=function(){
return "AjxSoapDoc";
};
AjxSoapDoc._SOAP_URI="http://www.w3.org/2003/05/soap-envelope";
AjxSoapDoc._XMLNS_URI="http://www.w3.org/2000/xmlns";
AjxSoapDoc.create=function(_128,_129,_12a,_12b){
var sd=new AjxSoapDoc();
sd._xmlDoc=AjxXmlDoc.create();
var d=sd._xmlDoc.getDoc();
if(!_12b){
_12b=AjxSoapDoc._SOAP_URI;
}
sd._soapURI=_12b;
var _12e=d.createElementNS&&!AjxEnv.isSafari;
var _12f=_12e?d.createElementNS(_12b,"soap:Envelope"):d.createElement("soap:Envelope");
if(!_12e){
_12f.setAttribute("xmlns:soap",_12b);
}
d.appendChild(_12f);
var _130=_12e?d.createElementNS(_12b,"soap:Body"):d.createElement("soap:Body");
_12f.appendChild(_130);
sd._methodEl=_129&&_12e?d.createElementNS(_129,_128):d.createElement(_128);
if(_129!=null&&!_12e){
if(_12a==null){
sd._methodEl.setAttribute("xmlns",_129);
}else{
sd._methodEl.setAttribute("xmlns:"+_12a,_129);
}
}
_130.appendChild(sd._methodEl);
return sd;
};
AjxSoapDoc.createFromDom=function(doc){
var sd=new AjxSoapDoc();
sd._xmlDoc=AjxXmlDoc.createFromDom(doc);
sd._methodEl=sd._check(sd._xmlDoc);
return sd;
};
AjxSoapDoc.createFromXml=function(xml){
var sd=new AjxSoapDoc();
sd._xmlDoc=AjxXmlDoc.createFromXml(xml);
sd._methodEl=sd._check(sd._xmlDoc);
return sd;
};
AjxSoapDoc.element2FaultObj=function(el){
var _136=el.firstChild;
if(!AjxEnv.isSafari){
if(_136!=null&&_136.namespaceURI!=AjxSoapDoc._SOAP_URI||_136.nodeName!=(el.prefix+":Fault")){
return null;
}
}else{
if(_136!=null&&_136.nodeName!=(el.prefix+":Fault")){
return null;
}
}
return new AjxSoapFault(_136);
};
AjxSoapDoc.prototype.setMethodAttribute=function(name,_138){
this._methodEl.setAttribute(name,_138);
};
AjxSoapDoc.prototype.set=function(name,_13a,_13b,_13c){
var doc=this.getDoc();
var _13e=doc.createElementNS&&!AjxEnv.isSafari;
var p=name?(_13c&&_13e?doc.createElementNS(_13c,name):doc.createElement(name)):doc.createDocumentFragment();
if(_13c&&!_13e){
p.setAttribute("xmlns",_13c);
}
if(_13a!=null){
if(typeof _13a=="object"){
for(i in _13a){
this.set(i,_13a[i],p);
}
}else{
if(AjxEnv.isSafari){
_13a=AjxStringUtil.xmlEncode(_13a);
}
p.appendChild(doc.createTextNode(_13a));
}
}
if(!_13b){
_13b=this._methodEl;
}
return _13b.appendChild(p);
};
AjxSoapDoc.prototype.getMethod=function(){
return this._methodEl;
};
AjxSoapDoc.prototype.createHeaderElement=function(){
var d=this._xmlDoc.getDoc();
var _141=d.firstChild;
var _142=this.getHeader();
if(_142!=null){
throw new AjxSoapException("SOAP header already exists",AjxSoapException.ELEMENT_EXISTS,"AjxSoapDoc.prototype.createHeaderElement");
}
var _143=d.createElementNS&&!AjxEnv.isSafari;
_142=_143?d.createElementNS(this._soapURI,"soap:Header"):d.createElement("soap:Header");
_141.insertBefore(_142,_141.firstChild);
return _142;
};
AjxSoapDoc.prototype.getHeader=function(){
var d=this._xmlDoc.getDoc();
var _145=AjxEnv.isIE?(d.getElementsByTagName(d.firstChild.prefix+":Header")):(d.getElementsByTagNameNS(this._soapURI,"Header"));
return _145?_145[0]:null;
};
AjxSoapDoc.prototype.getBody=function(){
var d=this._xmlDoc.getDoc();
var _147=AjxEnv.isIE?(d.getElementsByTagName(d.firstChild.prefix+":Body")):(d.getElementsByTagNameNS(this._soapURI,"Body"));
return _147?_147[0]:null;
};
AjxSoapDoc.prototype.getByTagName=function(type){
if(type.indexOf(":")==-1){
type="soap:"+type;
}
var a=this.getDoc().getElementsByTagName(type);
if(a.length==1){
return a[0];
}else{
if(a.length>0){
return a;
}else{
return null;
}
}
};
AjxSoapDoc.prototype.ensureHeader=function(){
return (this.getHeader()||this.createHeaderElement());
};
AjxSoapDoc.prototype.getDoc=function(){
return this._xmlDoc.getDoc();
};
AjxSoapDoc.prototype.adoptNode=function(node){
if(AjxEnv.isFirefox3up||!AjxEnv.isFirefox){
try{
var doc=this.getDoc();
if(doc.adoptNode){
return doc.adoptNode(node,true);
}
}
catch(ex){
}
}
return node.parentNode.removeChild(node);
};
AjxSoapDoc.prototype.getXml=function(){
return AjxEnv.isSafari||AjxEnv.isOpera?(AjxXmlDoc.getXml(this._xmlDoc.getDoc())):this._xmlDoc.getDoc().xml;
};
AjxSoapDoc.prototype._check=function(_14c){
var doc=_14c.getDoc();
if(doc.childNodes.length!=1){
throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:1");
}
var el=doc.firstChild;
if(!AjxEnv.isSafari){
if(el.namespaceURI!=AjxSoapDoc._SOAP_URI||el.nodeName!=(el.prefix+":Envelope")||(el.childNodes.length<1||el.childNodes.length>2)){
throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:2");
}
}else{
if(el.nodeName!=(el.prefix+":Envelope")){
throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:2");
}
}
};
function AjxRpcRequest(id){
if(!AjxRpcRequest.__inited){
AjxRpcRequest.__init();
}
this.id=id;
this.__httpReq=AjxRpcRequest.__msxmlVers?new ActiveXObject(AjxRpcRequest.__msxmlVers):new XMLHttpRequest();
}
AjxRpcRequest.TIMEDOUT=-1000;
AjxRpcRequest.__inited=false;
AjxRpcRequest.__msxmlVers=null;
AjxRpcRequest.prototype.toString=function(){
return "AjxRpcRequest";
};
AjxRpcRequest.prototype.invoke=function(_150,_151,_152,_153,_154,_155){
var _156=(_153!=null);
this.__httpReq.open((_154)?"get":"post",_151,_156);
if(_156){
this.__callback=_153;
if(_155){
var _157=new AjxTimedAction(this,AjxRpcRequest.__handleTimeout,{callback:_153,req:this});
_153._timedActionId=AjxTimedAction.scheduleAction(_157,_155);
}
var _158=this;
this.__httpReq.onreadystatechange=function(ev){
AjxRpcRequest.__handleResponse(_158,_153);
};
}else{
this.__httpReq.onreadystatechange=function(ev){
};
}
if(_152){
for(var i in _152){
this.__httpReq.setRequestHeader(i,_152[i]);
}
}
this.__httpReq.send(_150);
if(_156){
return this.id;
}else{
if(this.__httpReq.status==200){
return {text:this.__httpReq.responseText,xml:this.__httpReq.responseXML,success:true};
}else{
return {text:this.__httpReq.responseText,xml:this.__httpReq.responseXML,success:false,status:this.__httpReq.status};
}
}
};
AjxRpcRequest.prototype.cancel=function(){
this.__httpReq.abort();
};
AjxRpcRequest.__handleTimeout=function(args){
args.req.cancel();
args.callback.run({text:null,xml:null,success:false,status:AjxRpcRequest.TIMEDOUT});
};
AjxRpcRequest.__handleResponse=function(req,_15e){
if(!req||!req.__httpReq){
_15e.run({text:null,xml:null,success:false,status:500});
return;
}
if(req.__httpReq.readyState==4){
if(_15e._timedActionId!==null){
AjxTimedAction.cancelAction(_15e._timedActionId);
}
var _15f=500;
try{
_15f=req.__httpReq.status;
}
catch(ex){
}
if(_15f==200){
_15e.run({text:req.__httpReq.responseText,xml:req.__httpReq.responseXML,success:true});
}else{
_15e.run({text:req.__httpReq.responseText,xml:req.__httpReq.responseXML,success:false,status:_15f});
}
if(req.__ctxt){
req.__ctxt.busy=false;
}
}
};
AjxRpcRequest.prototype.__setCtxt=function(ctxt){
this.__ctxt=ctxt;
};
AjxRpcRequest.__init=function(){
if(!window.XMLHttpRequest&&window.ActiveXObject){
var _161=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
for(var i=0;i<_161.length;i++){
try{
var x=new ActiveXObject(_161[i]);
AjxRpcRequest.__msxmlVers=_161[i];
break;
}
catch(ex){
}
}
if(!AjxRpcRequest.__msxmlVers){
throw new AjxException("MSXML not installed",AjxException.INTERNAL_ERROR,"AjxRpc._init");
}
}
AjxRpcRequest.__inited=true;
};
function AjxRpc(){
}
AjxRpc.__rpcCache=[];
AjxRpc.__RPC_CACHE_MAX=100;
AjxRpc.__RPC_REAP_COUNT=5;
AjxRpc.__RPC_REAP_AGE=300000;
AjxRpc.invoke=function(_164,_165,_166,_167,_168,_169){
var _16a=(_167!=null);
var _16b=AjxRpc.__getFreeRpcCtxt();
try{
var _16c=_16b.req.invoke(_164,_165,_166,_167,_168,_169);
}
catch(ex){
var _16d=new AjxException();
_16d.method="AjxRpc.prototype._invoke";
if(ex instanceof Error){
_16d.detail=ex.message;
_16d.code=AjxException.NETWORK_ERROR;
_16d.msg="Network error";
}else{
_16d.detail=ex.toString();
_16d.code=AjxException.UNKNOWN_ERROR;
_16d.msg="Unknown Error";
}
if(!_16a){
_16b.busy=false;
}
throw _16d;
}
if(!_16a){
_16b.busy=false;
}
return _16c;
};
AjxRpc.getRpcRequest=function(id){
for(var i=0;i<AjxRpc.__rpcCache.length;i++){
var _170=AjxRpc.__rpcCache[i];
if(_170.id==id){
return _170.req;
}
}
return null;
};
AjxRpc.__getFreeRpcCtxt=function(){
var _171=null;
for(var i=0;i<AjxRpc.__rpcCache.length;i++){
_171=AjxRpc.__rpcCache[i];
if(!_171.busy){
break;
}
}
if(i==AjxRpc.__rpcCache.length){
if(AjxRpc.__rpcCache.length==AjxRpc.__RPC_CACHE_MAX){
throw new AjxException("Out of RPC cache",AjxException.OUT_OF_RPC_CACHE,"AjxRpc.__getFreeRpcCtxt");
}else{
if(i>0&&(i%AjxRpc.__RPC_REAP_COUNT==0)){
AjxRpc.__reap();
}
}
var id="__RpcCtxt_"+i;
_171=new __RpcCtxt(id);
AjxRpc.__rpcCache.push(_171);
}
_171.busy=true;
_171.timestamp=(new Date()).getTime();
return _171;
};
AjxRpc.__reap=function(){
var time=(new Date()).getTime();
for(var i=0;i<AjxRpc.__rpcCache.length;i++){
var _176=AjxRpc.__rpcCache[i];
if(_176.timestamp+AjxRpc.__RPC_REAP_AGE<time){
_176.req.cancel();
_176.busy=false;
}
}
};
function __RpcCtxt(id){
this.id=id;
this.req=new AjxRpcRequest(id);
this.req.__setCtxt(this);
this.busy=false;
}
function AjxWindowOpener(){
}
AjxWindowOpener.HELPER_URL="";
AjxWindowOpener.PARAM_INSTANCE_ID="id";
AjxWindowOpener.PARAM_ASYNC="async";
AjxWindowOpener.openBlank=function(name,args,_17a,_17b){
return AjxWindowOpener.open(AjxWindowOpener.HELPER_URL,name,args,_17a,_17b);
};
AjxWindowOpener.open=function(url,name,args,_17f,_180){
var _181;
if(url&&url!=""){
var _180=_180===true;
var _182={callback:_17f};
var id=AjxCore.assignId(_182);
var _184=url&&url!=""?(url+"?id="+id+"&async="+_180):"";
_181=_182.window=window.open(_184,name,args);
}else{
_181=window.open("",name,args);
if(_17f){
var ta=new AjxTimedAction(_17f.obj,_17f);
AjxTimedAction.scheduleAction(ta,0);
}
}
return _181;
};
AjxWindowOpener.onWindowOpened=function(_186){
var _187=AjxCore.objectWithId(_186);
AjxCore.unassignId(_186);
if(!_187.window.closed&&_187.callback){
_187.callback.run();
}
};
function AjxVector(){
this._array=new Array();
}
AjxVector.prototype.toString=function(sep,_189){
if(_189!==true){
return this._array.join(sep);
}
var a=new Array();
for(var i=0;i<this._array.length;i++){
var x=this._array[i];
if(x!=undefined&&x!=null&&x!=""){
a.push(x);
}
}
return a.join(sep);
};
AjxVector.fromArray=function(list){
var vec=new AjxVector();
vec._array.length=0;
if(list instanceof Array){
vec._array=list;
}
return vec;
};
AjxVector.prototype.size=function(){
return this._array.length;
};
AjxVector.prototype.add=function(obj,_190){
if(_190==null||_190<0||_190>=this._array.length){
this._array.push(obj);
}else{
this._array.splice(_190,0,obj);
}
};
AjxVector.prototype.addList=function(list){
if(!list){
return;
}
if(list.length){
this._array=this._array.concat(list);
}else{
if(list.size&&list.size()){
this._array=this._array.concat(list._array);
}
}
};
AjxVector.prototype.remove=function(obj){
for(var i=0;i<this._array.length;i++){
if(this._array[i]==obj){
this._array.splice(i,1);
return true;
}
}
return false;
};
AjxVector.prototype.removeAt=function(_194){
if(_194>=this._array.length||_194<0){
return null;
}
var _195=this._array.splice(_194,1);
var ret=null;
if(_195){
ret=_195[0];
}
return ret;
};
AjxVector.prototype.removeAll=function(){
for(var i=0;i<this._array.length;i++){
this._array[i]=null;
}
this._array.length=0;
};
AjxVector.prototype.removeLast=function(){
return this._array.length>0?this._array.pop():null;
};
AjxVector.prototype.replace=function(_198,_199){
var _19a=this._array[_198];
this._array[_198]=_199;
return _19a;
};
AjxVector.prototype.replaceObject=function(obj,_19c){
for(var i=0;i<this._array.length;i++){
if(this._array[i]==obj){
this._array[i]=_19c;
return obj;
}
}
return null;
};
AjxVector.prototype.indexOf=function(obj){
if(obj==null){
return -1;
}
for(var i=0;i<this._array.length;i++){
if(this._array[i]==obj){
return i;
}
}
return -1;
};
AjxVector.prototype.indexOfLike=function(obj,_1a1){
var _1a2=_1a1.call(obj);
for(var i=0;i<this._array.length;i++){
var test=_1a1.call(this._array[i]);
if(test==_1a2){
return i;
}
}
return -1;
};
AjxVector.prototype.clone=function(){
var vec=new AjxVector();
vec.addList(this);
return vec;
};
AjxVector.prototype.contains=function(obj){
for(var i=0;i<this._array.length;i++){
if(this._array[i]==obj){
return true;
}
}
return false;
};
AjxVector.prototype.containsLike=function(obj,_1a9){
var _1aa=_1a9.call(obj);
for(var i=0;i<this._array.length;i++){
var test=_1a9.call(this._array[i]);
if(test==_1aa){
return true;
}
}
return false;
};
AjxVector.prototype.get=function(_1ad){
return _1ad>=this._array.length||_1ad<0?null:this._array[_1ad];
};
AjxVector.prototype.getArray=function(){
return this._array;
};
AjxVector.prototype.getLast=function(){
return this._array.length==0?null:this._array[this._array.length-1];
};
AjxVector.prototype.getNext=function(obj){
var idx=this.indexOf(obj);
if(idx==-1){
return null;
}
return this.get(++idx);
};
AjxVector.prototype.getPrev=function(obj){
var idx=this.indexOf(obj);
if(idx==-1){
return null;
}
return this.get(--idx);
};
AjxVector.prototype.sort=function(_1b2){
if(!_1b2){
_1b2=AjxVector._defaultArrayComparator;
}
this._array.sort(_1b2);
};
AjxVector.prototype.binarySearch=function(_1b3,_1b4){
if(!_1b4){
_1b4=AjxVector._defaultArrayComparator;
}
var l=0;
var arr=this._array;
var u=arr.length-1;
while(true){
if(u<l){
return -1;
}
var i=Math.floor((l+u)/2);
var _1b9=_1b4(_1b3,arr[i]);
if(_1b9<0){
u=i-1;
}else{
if(_1b9>0){
l=i+1;
}else{
return i;
}
}
}
};
AjxVector.prototype.merge=function(_1ba,list){
if(_1ba<0){
return;
}
var _1bc=list instanceof AjxVector?list.getArray():list;
var _1bd=this._array.length<(_1ba+_1bc.length)?this._array.length:_1ba+_1bc.length;
if(_1ba<this._array.length){
var _1be=0;
for(var i=_1ba;i<_1bd;i++){
this._array[i]=_1bc[_1be++];
}
if(_1be<_1bc.length){
this._array=this._array.concat(_1bc.slice(_1be));
}
}else{
this._array=this._array.concat(_1bc);
}
};
AjxVector._defaultArrayComparator=function(a,b){
return a<b?-1:(a>b?1:0);
};
function AjxStringUtil(){
}
AjxStringUtil.TRIM_RE=/^\s+|\s+$/g;
AjxStringUtil.COMPRESS_RE=/\s+/g;
AjxStringUtil.ELLIPSIS=" ... ";
AjxStringUtil.makeString=function(val){
return val?String(val):"";
};
AjxStringUtil.trim=function(str,_1c4,_1c5){
if(!str){
return "";
}
var _1c6=AjxStringUtil.TRIM_RE;
var _1c7=AjxStringUtil.COMPRESS_RE;
if(_1c5){
_1c6=new RegExp("^"+_1c5+"+|"+_1c5+"+$","g");
_1c7=new RegExp(_1c5+"+","g");
}else{
_1c5=" ";
}
str=str.replace(_1c6,"");
if(_1c4){
str=str.replace(_1c7,_1c5);
}
return str;
};
AjxStringUtil.repeat=function(str,num){
var text="";
for(var i=0;i<num;i++){
text+=str;
}
return text;
};
AjxStringUtil.getUnitsFromSizeString=function(_1cc){
var _1cd="px";
if(typeof (_1cc)=="string"){
var _1ce=Number(parseInt(_1cc,10)).toString();
if(_1cc.length>_1ce.length){
_1cd=_1cc.substr(_1ce.length,(_1cc.length-_1ce.length));
if(!(_1cd=="em"||_1cd=="ex"||_1cd=="px"||_1cd=="in"||_1cd=="cm"==_1cd=="mm"||_1cd=="pt"||_1cd=="pc"||_1cd=="%")){
_1cd="px";
}
}
}
return _1cd;
};
AjxStringUtil.split=function(str,dels){
if(!str){
return new Array();
}
var i=0;
dels=dels?dels:",";
var _1d2=new Object();
if(typeof dels=="string"){
_1d2[dels]=1;
}else{
for(i=0;i<dels.length;i++){
_1d2[dels[i]]=1;
}
}
var q=false;
var p=0;
var _1d5=0;
var _1d6;
var _1d7=new Array();
var j=0;
for(i=0;i<str.length;i++){
var c=str.charAt(i);
if(c=="\""){
q=!q;
}else{
if(c=="("){
p++;
}else{
if(c==")"){
p--;
}else{
if(_1d2[c]){
if(!q&&!p){
_1d6=str.substring(_1d5,i);
_1d7[j++]=_1d6;
_1d5=i+1;
}
}
}
}
}
}
_1d6=str.substring(_1d5,str.length);
_1d7[j++]=_1d6;
return _1d7;
};
AjxStringUtil.wordWrap=function(text,len,pre,eol,_1de,_1df){
if(!text){
return "";
}
len=len?len:80;
eol=eol?eol:"\n";
pre=pre?pre:"";
len-=pre.length;
var _1e0=new Array();
var c=0;
text=AjxStringUtil.trim(text,false);
text=text.replace(/[ \t]+\n/g,"\n");
if(_1df){
text=text.replace(/\b\n\b/g," ");
}
var _1e2=text.length;
for(var i=0,bk=0,sp=-1;i<_1e2;i++){
var ch=text.charAt(i);
if(ch.match(/[ \t]/)){
sp=i;
}
if(ch=="\n"){
_1e0[c++]=pre+text.substring(bk,i);
bk=i+1;
sp=-1;
}
if(i-bk>=len){
if(sp==-1){
if(_1de){
_1e0[c++]=pre+text.substring(bk,i);
bk=i;
sp=-1;
}
}else{
_1e0[c++]=pre+text.substring(bk,sp);
bk=sp+1;
sp=-1;
}
}
}
if(i>bk){
_1e0[c++]=pre+text.substring(bk,i);
}
return _1e0.join(eol)+eol;
};
AjxStringUtil.IS_PRINT_CODE=new Object();
var print_codes=[32,48,49,50,51,52,53,54,55,56,57,59,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,96,97,98,99,100,101,102,103,104,105,106,107,109,110,111,186,187,188,189,190,191,192,219,220,221,222];
var l=print_codes.length;
for(var i=0;i<l;i++){
AjxStringUtil.IS_PRINT_CODE[print_codes[i]]=true;
}
AjxStringUtil.isPrintKey=function(_1e5){
return AjxStringUtil.IS_PRINT_CODE[_1e5];
};
AjxStringUtil.SHIFT_CHAR={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:"\""};
AjxStringUtil.shiftChar=function(_1e6,_1e7){
return _1e7?AjxStringUtil.SHIFT_CHAR[_1e6]||String.fromCharCode(_1e6):String.fromCharCode(_1e6);
};
AjxStringUtil.diffPoint=function(str1,str2){
if(!(str1&&str2)){
return 0;
}
var len=Math.min(str1.length,str2.length);
var i=0;
while(i<len&&(str1.charAt(i)==str2.charAt(i))){
i++;
}
return i;
};
AjxStringUtil.resolve=function(str,_1ed){
return AjxMessageFormat.format(str,_1ed);
};
AjxStringUtil.urlEncode=function(str){
if(!str){
return "";
}
var func=window.encodeURL||window.encodeURI;
return func(str);
};
AjxStringUtil.urlComponentEncode=function(str){
if(!str){
return "";
}
var func=window.encodeURLComponent||window.encodeURIComponent;
return func(str);
};
AjxStringUtil.ENCODE_MAP={">":"&gt;","<":"&lt;","&":"&amp;"};
AjxStringUtil.htmlEncode=function(str,_1f3){
if(!str){
return "";
}
if(!AjxEnv.isSafari){
if(_1f3){
return str.replace(/[<>&]/g,function(_1f4){
return AjxStringUtil.ENCODE_MAP[_1f4];
}).replace(/  /g," &nbsp;");
}else{
return str.replace(/[<>&]/g,function(_1f5){
return AjxStringUtil.ENCODE_MAP[_1f5];
});
}
}else{
if(_1f3){
return str.replace(/[&]/g,"&amp;").replace(/  /g," &nbsp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;");
}else{
return str.replace(/[&]/g,"&amp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;");
}
}
};
AjxStringUtil.convertToHtml=function(str){
if(!str){
return "";
}
str=str.replace(/&/mg,"&amp;").replace(/  /mg," &nbsp;").replace(/^ /mg,"&nbsp;").replace(/\t/mg,"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").replace(/</mg,"&lt;").replace(/>/mg,"&gt;").replace(/\r?\n/mg,"<br />");
return str;
};
AjxStringUtil.SPACE_ENCODE_MAP={" ":"&nbsp;",">":"&gt;","<":"&lt;","&":"&amp;","\n":"<br>"};
AjxStringUtil.htmlEncodeSpace=function(str){
if(!str){
return "";
}
if(!AjxEnv.isSafari){
return str.replace(/[ <>&\n]/g,function(_1f8){
return AjxStringUtil.SPACE_ENCODE_MAP[_1f8];
});
}else{
return str.replace(/[&]/g,"&amp;").replace(/ /g,"&nbsp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;");
}
};
AjxStringUtil.nl2br=function(str){
if(!str){
return "";
}
return str.replace(/^ /mg,"&nbsp;").replace(/\t/mg,"<span style='white-space:pre'>\t</span>").replace(/\n/g,"<br>");
};
AjxStringUtil.xmlEncode=function(str){
if(str){
str=""+str;
return str.replace(/&/g,"&amp;").replace(/</g,"&lt;");
}
return "";
};
AjxStringUtil.xmlDecode=function(str){
return str?str.replace(/&amp;/g,"&").replace(/&lt;/g,"<"):"";
};
AjxStringUtil.xmlAttrEncode=function(str){
return str?str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\x22/g,"&quot;").replace(/\x27/g,"&apos;"):"";
};
AjxStringUtil.xmlAttrDecode=function(str){
return str?str.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&quot;/g,"\"").replace(/&apos;/g,"'"):"";
};
AjxStringUtil.regExEscape=function(str){
return str.replace(/(\W)/g,"\\$1");
};
AjxStringUtil._calcDIV=null;
AjxStringUtil.calcDIV=function(){
if(AjxStringUtil._calcDIV==null){
AjxStringUtil._calcDIV=document.createElement("div");
AjxStringUtil._calcDIV.style.zIndex=0;
AjxStringUtil._calcDIV.style.position=DwtControl.ABSOLUTE_STYLE;
AjxStringUtil._calcDIV.style.visibility="hidden";
document.body.appendChild(AjxStringUtil._calcDIV);
}
return AjxStringUtil._calcDIV;
};
AjxStringUtil.clip=function(_1ff,_200,_201){
var _202=AjxStringUtil.calcDIV();
if(arguments.length==3){
_202.className=_201;
}
_202.innerHTML=_1ff;
if(_202.offsetWidth<=_200){
return _1ff;
}
for(var i=_1ff.length-1;i>0;i--){
var _204=_1ff.substr(0,i);
_202.innerHTML=_204+AjxStringUtil.ELLIPSIS;
if(_202.offsetWidth<=_200){
return _204+AjxStringUtil.ELLIPSIS;
}
}
return _1ff;
};
AjxStringUtil.wrap=function(_205,_206,_207){
var _208=AjxStringUtil.calcDIV();
if(arguments.length==3){
_208.className=_207;
}
var _209="";
var _20a="";
textRows=_205.split("/n");
for(var _20b=0;_20b<textRows.length;_20b++){
if(_20b!=0){
_209+=_20a+"<br>";
_20a="";
}
htmlRows=textRows[_20b].split("<br>");
for(var _20c=0;_20c<htmlRows.length;_20c++){
if(_20c!=0){
_209+=_20a+"<br>";
_20a="";
}
words=htmlRows[_20c].split(" ");
var _20d=0;
while(_20d<words.length){
_208.innerHTML=_20a+" "+words[_20d];
var _20e=_208.offsetWidth;
if(_20e>_206){
_208.innerHTML=words[_20d];
_20e=_20e-_208.offsetWidth;
if((_20e>=_206)||(_208.offsetWidth<=_206)){
_209+=_20a+"<br>";
_20a="";
}else{
var _20f=true;
var _210=0;
while(_20f){
_210++;
_208.innerHTML=_20a+" "+words[_20d].substring(0,_210);
_20f=(_208.offsetWidth<=_206);
}
_210--;
_209+=_20a+words[_20d].substring(0,_210)+"<br>";
words[_20d]=words[_20d].substr(_210);
_20a="";
}
}else{
_20a+=" "+words[_20d];
_20d++;
}
}
}
}
_209+=_20a;
return _209;
};
AjxStringUtil.MSG_SEP_RE=new RegExp("^\\s*--+\\s*("+"Original Message"+"|"+"Forwarded Message"+")\\s*--+","i");
AjxStringUtil.SIG_RE=/^(- ?-+)|(__+)\r?$/;
AjxStringUtil.COLON_RE=/\S+:$/;
AjxStringUtil.PREFIX_RE=/^\s*(>|\|)/;
AjxStringUtil.BRACKET_RE=/^\s*\[.+\]\s*$/;
AjxStringUtil.LINE_RE=/^\s*_{30,}\s*$/;
AjxStringUtil.BLANK_RE=/^\s*$/;
AjxStringUtil.HDR_RE=/^\s*\w+:/;
AjxStringUtil.getTopLevel=function(text,eol){
eol=eol?eol:"\n";
text=AjxStringUtil._trimBlankLines(text,eol);
var _213=text.split(eol);
var len=_213.length;
var i=0,start=0;
var _216=new Array();
var _217=false;
while(i<len){
var _218=_217;
var skip=AjxStringUtil._linesToSkip(_213,i);
_217=(skip>0);
if(_218&&!_217){
start=i;
}else{
if(!_218&&_217&&i>start){
_216.push(AjxStringUtil._trimBlankLines(_213.slice(start,i).join(eol),eol)+eol);
}
}
i+=_217?skip:1;
}
if(!_217&&i>start){
_216.push(AjxStringUtil._trimBlankLines(_213.slice(start,i).join(eol),eol)+eol);
}
return _216;
};
AjxStringUtil._linesToSkip=function(_21a,i){
var len=_21a.length;
var skip=0;
var _21e=i;
if(AjxStringUtil.MSG_SEP_RE.test(_21a[i])){
skip=len-i;
}else{
if(AjxStringUtil.SIG_RE.test(_21a[i])){
skip=len-i;
}else{
if(AjxStringUtil.PREFIX_RE.test(_21a[i])){
while(i<_21a.length&&(AjxStringUtil.PREFIX_RE.test(_21a[i])||AjxStringUtil.BLANK_RE.test(_21a[i]))){
i++;
}
skip=i-_21e;
}else{
if(AjxStringUtil.COLON_RE.test(_21a[i])){
var idx=AjxStringUtil._nextNonBlankLineIndex(_21a,i+1);
var _220=(idx!=-1)?_21a[idx]:null;
if(_220&&AjxStringUtil.PREFIX_RE.test(_220)){
skip=idx-i;
}else{
if(idx!=-1){
idx=AjxStringUtil._nextNonBlankLineIndex(_21a,idx+1);
}
var _221=(idx!=-1)?_21a[idx]:null;
if(_221&&AjxStringUtil.BRACKET_RE.test(_220)&&AjxStringUtil.PREFIX_RE.test(_221)){
skip=idx-i;
}
}
}else{
if(AjxStringUtil.LINE_RE.test(_21a[i])){
var idx=AjxStringUtil._nextNonBlankLineIndex(_21a,i+1);
var _220=(idx!=-1)?_21a[idx]:null;
if(_220&&AjxStringUtil.HDR_RE.test(_220)){
skip=len-i;
}
}
}
}
}
}
return skip;
};
AjxStringUtil._nextNonBlankLineIndex=function(_222,i){
while(i<_222.length&&AjxStringUtil.BLANK_RE.test(_222[i])){
i++;
}
return ((i<_222.length)?i:-1);
};
AjxStringUtil._trimBlankLines=function(text,eol){
eol=eol?eol:"\n";
var _226=text.split(eol);
var len=_226.length;
var i=0;
while(i<len&&AjxStringUtil.BLANK_RE.test(_226[i])){
i++;
}
var j=len;
while(j>0&&AjxStringUtil.BLANK_RE.test(_226[j-1])){
j--;
}
if(i!=0||j!=len){
text=_226.slice(i,j).join(eol)+eol;
}
return text;
};
AjxStringUtil._NO_LIST=0;
AjxStringUtil._ORDERED_LIST=1;
AjxStringUtil._UNORDERED_LIST=2;
AjxStringUtil._INDENT="    ";
AjxStringUtil._NON_WHITESPACE=/\S+/;
AjxStringUtil._LF=/\n/;
AjxStringUtil.convertHtml2Text=function(_22a){
if(!_22a){
return null;
}
if(typeof _22a=="string"){
var _22b=document.createElement("SPAN");
_22b.innerHTML=_22a;
_22a=_22b;
}
var text=new Array();
var idx=0;
var ctxt=new Object();
this._traverse(_22a,text,idx,AjxStringUtil._NO_LIST,0,0,ctxt);
var _22f=text.join("");
return _22f;
};
AjxStringUtil._traverse=function(el,text,idx,_233,_234,_235,ctxt){
var _237=el.nodeName.toLowerCase();
if(_237=="#text"){
if(el.nodeValue.search(AjxStringUtil._NON_WHITESPACE)!=-1){
if(ctxt.lastNode=="ol"||ctxt.lastNode=="ul"){
text[idx++]="\n";
}
if(ctxt.isPreformatted){
text[idx++]=AjxStringUtil.trim(el.nodeValue)+" ";
}else{
text[idx++]=AjxStringUtil.trim(el.nodeValue.replace(AjxStringUtil._LF," "),true)+" ";
}
}
}else{
if(_237=="p"){
text[idx++]="\n\n";
}else{
if(_233==AjxStringUtil._NO_LIST&&(_237=="br"||_237=="hr")){
text[idx++]="\n";
}else{
if(_237=="ol"||_237=="ul"){
text[idx++]="\n";
if(el.parentNode.nodeName.toLowerCase()!="li"&&ctxt.lastNode!="br"&&ctxt.lastNode!="hr"){
text[idx++]="\n";
}
_233=(_237=="ol")?AjxStringUtil._ORDERED_LIST:AjxStringUtil._UNORDERED_LIST;
_234++;
_235=0;
}else{
if(_237=="li"){
for(var i=0;i<_234;i++){
text[idx++]=AjxStringUtil._INDENT;
}
if(_233==AjxStringUtil._ORDERED_LIST){
text[idx++]=_235+". ";
}else{
text[idx++]="\u2022 ";
}
}else{
if(_237=="img"){
if(el.alt&&el.alt!=""){
text[idx++]=el.alt;
}
}else{
if(_237=="tr"&&el.parentNode.firstChild!=el){
text[idx++]="\n";
}else{
if(_237=="td"&&el.parentNode.firstChild!=el){
text[idx++]="\t";
}else{
if(_237=="div"){
text[idx++]="\n";
}else{
if(_237=="blockquote"){
text[idx++]="\n\n";
}else{
if(_237=="pre"){
ctxt.isPreformatted=true;
}else{
if(_237=="#comment"||_237=="script"||_237=="select"||_237=="style"){
return idx;
}
}
}
}
}
}
}
}
}
}
}
}
var _239=el.childNodes;
var len=_239.length;
for(var i=0;i<len;i++){
var tmp=_239[i];
if(_237=="ol"&&tmp.nodeType==1&&tmp.tagName.toLowerCase()=="li"){
_235++;
}
idx=this._traverse(tmp,text,idx,_233,_234,_235,ctxt);
}
if(_237=="h1"||_237=="h2"||_237=="h3"||_237=="h4"||_237=="h5"||_237=="h6"){
text[idx++]="\n";
ctxt.list=false;
}else{
if(_237=="pre"){
ctxt.isPreformatted=false;
}else{
if(_237=="li"){
if(!ctxt.list){
text[idx++]="\n";
}
ctxt.list=false;
}else{
if(_237=="ol"||_237=="ul"){
ctxt.list=true;
}else{
if(_237!="#text"){
ctxt.list=false;
}
}
}
}
}
ctxt.lastNode=_237;
return idx;
};
AjxStringUtil.queryStringSet=function(qs,name,_23e){
qs=qs?qs:"";
if(qs.indexOf("?")==0){
qs=qs.substr(1);
}
var _23f=qs.split("&");
var _240=[];
var _241=false;
for(var i=0;i<_23f.length;i++){
if(_23f[i].indexOf(name)==0){
_241=true;
_240.push([name,_23e].join("="));
}else{
_240.push(_23f[i]);
}
}
if(!_241){
_240.push([name,_23e].join("="));
}
return "?"+_240.join("&");
};
AjxStringUtil.queryStringRemove=function(qs,name){
qs=qs?qs:"";
if(qs.indexOf("?")==0){
qs=qs.substr(1);
}
var _245=qs.split("&");
var _246=[];
for(var i=0;i<_245.length;i++){
if(_245[i].indexOf(name)!=0){
_246.push(_245[i]);
}
}
return "?"+_246.join("&");
};
AjxStringUtil.getAsString=function(o){
return !o?"":(typeof (o)=="object")?o.toString():o;
};
function AjxDebug(_249,name,_24b){
this._dbgName="AjxDebugWin_"+location.hostname.replace(/\./g,"_");
this._level=Number(_249);
this._showTime=_24b;
this._showTiming=false;
this._startTimePt=this._lastTimePt=0;
this._dbgWindowInited=false;
this._msgQueue=new Array();
AjxDebug._CONTENT_FRAME_ID=AjxDebug._CONTENT_FRAME_ID;
this._isPrevWinOpen=false;
this._enable(this._level!=AjxDebug.NONE);
}
AjxDebug.NONE=0;
AjxDebug.DBG1=1;
AjxDebug.DBG2=2;
AjxDebug.DBG3=3;
AjxDebug.MAX_OUT=25000;
AjxDebug._LINK_FRAME_ID="AjxDebug_LF";
AjxDebug._CONTENT_FRAME_ID="AjxDebug_CF";
AjxDebug._BUTTON_FRAME_ID="AjxDebug_BF";
AjxDebug._id=0;
AjxDebug._openErrors=0;
AjxDebug.prototype.toString=function(){
return "AjxDebug";
};
AjxDebug.prototype.setDebugLevel=function(_24c,_24d){
this._level=Number(_24c);
if(!_24d){
this._enable(_24c!=AjxDebug.NONE);
}
};
AjxDebug.prototype.getDebugLevel=function(){
return this._level;
};
AjxDebug.prototype.println=function(_24e,msg,_250){
try{
if(!this._isWriteable()){
return;
}
var args=this._handleArgs(arguments,_250);
if(!args){
return;
}
msg=args.join("");
this._add(this._timestamp()+msg+"<br>",null,null,null,_250);
}
catch(ex){
}
return;
};
AjxDebug.prototype.isDisabled=function(){
return !this._enabled;
};
AjxDebug.prototype.dumpObj=function(_252,obj,_254,_255){
if(!this._isWriteable()){
return;
}
var args=this._handleArgs(arguments,_255);
if(!args){
return;
}
obj=args[0];
if(!obj){
return;
}
this._showFuncs=args[1];
AjxDebug._visited=new AjxVector();
this._add(null,obj);
this._showFuncs=null;
};
AjxDebug.prototype.printRaw=function(_257,text,_259){
if(!this._isWriteable()){
return;
}
var args=this._handleArgs(arguments,_259);
if(!args){
return;
}
text=args[0];
this._add(null,text,false,true);
};
AjxDebug.prototype.printXML=function(_25b,text,_25d){
if(!this._isWriteable()){
return;
}
var args=this._handleArgs(arguments,_25d);
if(!args){
return;
}
text=args[0];
if(!text){
return;
}
if(AjxEnv.isSafari||text.length>AjxDebug.MAX_OUT){
this.printRaw(text);
return;
}
this._add(null,text,true,false);
};
AjxDebug.prototype.display=function(_25f,text){
if(!this._isWriteable()){
return;
}
var args=this._handleArgs(arguments);
if(!args){
return;
}
text=args[0];
text=text.replace(/\r?\n/g,"[crlf]");
text=text.replace(/ /g,"[space]");
text=text.replace(/\t/g,"[tab]");
this.printRaw(_25f,text);
};
AjxDebug.prototype.showTiming=function(on,msg){
this._showTiming=on;
if(on){
this._enable(true);
}
var _264=on?"on":"off";
var text="Turning timing info "+_264;
if(msg){
text=text+": "+msg;
}
var _266=new DebugMessage(text);
this._addMessage(_266);
this._startTimePt=this._lastTimePt=new Date().getTime();
};
AjxDebug.prototype.timePt=function(msg,_268){
if(!this._showTiming||!this._isWriteable()){
return;
}
if(_268){
this._startTimePt=this._lastTimePt=new Date().getTime();
}
var now=new Date().getTime();
var _26a=now-this._startTimePt;
var _26b=now-this._lastTimePt;
this._lastTimePt=now;
var _26c=_268?"<br/>":"";
msg=msg?" "+msg:"";
var text=[_26c,"[",_26a," / ",_26b,"]",msg].join("");
html="<div>"+text+"</div>";
extraType=typeof (text);
var _26e=new DebugMessage(html);
this._addMessage(_26e);
return _26b;
};
AjxDebug.prototype.getContentFrame=function(){
if(this._contentFrame){
return this._contentFrame;
}else{
if(this._debugWindow&&this._debugWindow.document){
return this._debugWindow.document.getElementById(AjxDebug._CONTENT_FRAME_ID);
}else{
return null;
}
}
};
AjxDebug.prototype.getLinkFrame=function(){
if(this._linkFrame){
return this._linkFrame;
}else{
if(this._debugWindow&&this._debugWindow.document){
return this._debugWindow.document.getElementById(AjxDebug._LINK_FRAME_ID);
}else{
return null;
}
}
};
AjxDebug.prototype._enable=function(_26f){
this._enabled=_26f;
if(_26f){
if(this._debugWindow==null||this._debugWindow.closed){
this._openDebugWindow();
}
}else{
if(this._debugWindow){
this._debugWindow.close();
this._debugWindow=null;
}
}
};
AjxDebug.prototype._isWriteable=function(){
return (!this.isDisabled()&&this._debugWindow&&!this._debugWindow.closed);
};
AjxDebug.prototype._getHtmlForObject=function(_270,_271,_272){
var html=new Array();
var idx=0;
if(AjxUtil.isUndefined(_270)){
html[idx++]="<span>Undefined</span>";
}else{
if(AjxUtil.isNull(_270)){
html[idx++]="<span>NULL</span>";
}else{
if(AjxUtil.isBoolean(_270)){
html[idx++]="<span>"+_270+"</span>";
}else{
if(AjxUtil.isNumber(_270)){
html[idx++]="<span>"+_270+"</span>";
}else{
if(_272){
html[idx++]=this._timestamp();
html[idx++]="<textarea rows='25' style='width:100%' readonly='true'>";
html[idx++]=_270;
html[idx++]="</textarea>";
html[idx++]="<p></p>";
}else{
if(_271){
var _275=new AjxDebugXmlDocument;
var doc=_275.create();
doc.loadXML(_270);
html[idx++]="<div style='border-width:2px; border-style:inset; width:100%; height:300px; overflow:auto'>";
html[idx++]=this._createXmlTree(doc,0);
html[idx++]="</div>";
}else{
html[idx++]="<div style='border-width:2px; border-style:inset; width:100%; height:300px; overflow:auto'>";
html[idx++]="<pre>";
html[idx++]=this._dump(_270,true);
html[idx++]="</div>";
html[idx++]="</pre>";
}
}
}
}
}
}
return html.join("");
};
AjxDebug.prototype._dump=function(obj,_278){
var _279=0;
var _27a=false;
var _27b=false;
if(arguments.length>2){
_279=arguments[2];
_27a=arguments[3];
_27b=arguments[4];
}
if(AjxUtil.isObject(obj)){
if(obj.toString()=="ZmAppCtxt"){
return "[ZmAppCtxt]";
}
if(AjxDebug._visited.contains(obj)){
return "[visited object]";
}else{
AjxDebug._visited.add(obj);
}
}
var _27c=AjxStringUtil.repeat(" ",_279);
var text="";
if(AjxUtil.isUndefined(obj)){
text+="[undefined]";
}else{
if(AjxUtil.isNull(obj)){
text+="[null]";
}else{
if(AjxUtil.isBoolean(obj)){
text+=obj?"true":"false";
}else{
if(AjxUtil.isString(obj)){
text+="\""+AjxDebug._escapeForHTML(obj)+"\"";
}else{
if(AjxUtil.isNumber(obj)){
text+=obj;
}else{
if(AjxUtil.isObject(obj)){
var _27e=AjxUtil.isArray(obj);
if(_27b){
text+=_27e?"[Array]":obj.toString();
}else{
_27b=!_278;
var keys=new Array();
for(var i in obj){
keys.push(i);
}
_27e?keys.sort(function(a,b){
return a-b;
}):keys.sort();
if(_27a){
text+=_27e?"[":"{";
}
var len=keys.length;
for(var i=0;i<len;i++){
var key=keys[i];
var _285=obj[key];
var _286=null;
if(_285==window||_285==document||(!AjxEnv.isIE&&_285 instanceof Node)){
_286=_285.toString();
}
if((typeof (_285)=="function")){
if(this._showFuncs){
_286="[function]";
}else{
continue;
}
}
if(i>0){
text+=",";
}
text+="\n"+_27c;
if(_286!=null){
text+=key+": "+_286;
}else{
text+=key+": "+this._dump(_285,_278,_279+2,true,_27b);
}
}
if(i>0){
text+="\n"+AjxStringUtil.repeat(" ",_279-1);
}
if(_27a){
text+=_27e?"]":"}";
}
}
}
}
}
}
}
}
return text;
};
AjxDebug.prototype._handleArgs=function(args,_288){
if(this._level==AjxDebug.NONE||this._showTiming){
return;
}
var _289=AjxDebug.DBG1;
if(args.length>1){
if(typeof args[0]=="number"&&typeof this._level=="number"){
_289=args[0];
if(_289>this._level){
return;
}
}else{
if(args[0]&&args[0]!=this._level){
return;
}
}
}
var _28a=new Array(args.length);
var len=(_288)?args.length-1:args.length;
for(var i=0;i<len;i++){
_28a[i]=args[i];
}
if(len>1){
_28a.shift();
}
return _28a;
};
AjxDebug.prototype._getCookieVal=function(_28d){
var myRE=_28d+"=([^;]+)";
var _28f=document.cookie.match(new RegExp(myRE));
var val=null;
if(_28f&&(_28f.length>0)){
var _291=_28f[_28f.length-1];
if(_291=="true"){
val=true;
}else{
if(_291=="false"){
val=false;
}else{
val=_291;
}
}
}
return val;
};
AjxDebug.prototype._openDebugWindow=function(){
this._enabled=true;
this._isPrevWinOpen=this._getCookieVal("AjxDebugWinOpen");
var args="width=600,height=400,resizable=yes,scrollbars=yes";
if(!this._isPrevWinOpen){
var _293=new AjxCallback(this,this._initWindow);
this._debugWindow=AjxWindowOpener.openBlank(this._dbgName,args,_293,true);
}else{
this._debugWindow=window.open("",this._dbgName,args);
this._initWindow();
}
};
AjxDebug.prototype._initWindow=function(){
if(this._debugWindow==null){
this._enabled=false;
return;
}
try{
this._document=this._debugWindow.document;
this._document.title="Debug";
if(!this._isPrevWinOpen){
this._document.write(["<html>","<head>","<script>","function blank() {return [","'<html><head><style type=\"text/css\">',","'P, TD, DIV, SPAN, SELECT, INPUT, TEXTAREA, BUTTON {',","'font-family: Tahoma, Arial, Helvetica, sans-serif;',","'font-size:11px;}',","'.Link {cursor: pointer;color:blue;text-decoration:underline;white-space:nowrap;width:100%;}',","'.Mark {color:white; background-color:black; width:100%;font-size:14px;font-weight:bold;}',","'.MarkLink {cursor: pointer;color:white;background-color:black;text-decoration:underline;font-weight:bold;white-space:nowrap;width:100%;}',","'.Run {color:black; background-color:red;width:100%;font-size:18px;font-weight:bold;}',","'.RunLink {cursor: pointer;color:black;background-color:red;text-decoration:underline;font-weight:bold;white-space:nowrap;width:100%;}',","'</style></head><body></body></html>'].join(\"\");}","</script>","</head>","<frameset cols='125, *'>","<frameset rows='*,40'>","<frame name='",AjxDebug._LINK_FRAME_ID,"' id='",AjxDebug._LINK_FRAME_ID,"' src='javascript:parent.parent.blank();'>","<frame name='",AjxDebug._BUTTON_FRAME_ID,"' id='",AjxDebug._BUTTON_FRAME_ID,"' src='javascript:parent.parent.blank();'>","</frameset>","<frame name='",AjxDebug._CONTENT_FRAME_ID,"' id='",AjxDebug._CONTENT_FRAME_ID,"' src='javascript:parent.blank();'>","</frameset>","</html>"].join(""));
var ta=new AjxTimedAction(this,AjxDebug.prototype._finishInitWindow);
AjxTimedAction.scheduleAction(ta,250);
}else{
this._contentFrame=this._document.getElementById(AjxDebug._CONTENT_FRAME_ID);
this._linkFrame=this._document.getElementById(AjxDebug._LINK_FRAME_ID);
this._createLinkNContent(this,"RunLink","NEW RUN","Run","NEW RUN");
if(AjxEnv.isIE){
this._debugWindow.attachEvent("onunload",AjxDebug.unloadHandler);
this._markBtn.onclick=AjxDebug._mark;
this._clearBtn.onclick=AjxDebug._clear;
}
this._dbgWindowInited=true;
this._showMessages();
}
}
catch(ex){
AjxDebug.deleteWindowCookie();
if(this._debugWindow){
this._debugWindow.close();
}
if(AjxDebug._openErrors<5){
AjxDebug._openErrors++;
this._openDebugWindow();
}
}
};
AjxDebug.prototype._finishInitWindow=function(){
try{
this._contentFrame=this._debugWindow.document.getElementById(AjxDebug._CONTENT_FRAME_ID);
this._linkFrame=this._debugWindow.document.getElementById(AjxDebug._LINK_FRAME_ID);
var _295=this._debugWindow.document.getElementById(AjxDebug._BUTTON_FRAME_ID);
var _296=_295.contentWindow.document;
var _297=_296.body;
var _298=this._markBtn=_296.createElement("button");
_298.innerHTML="Mark";
_298._dbg=this;
_298.onclick=AjxDebug._mark;
var _299=this._clearBtn=_296.createElement("button");
_299._contentFrameId=AjxDebug._CONTENT_FRAME_ID;
_299._linkFrameId=AjxDebug._LINK_FRAME_ID;
_299.innerHTML="Clear";
_299._dbg=this;
_299.onclick=AjxDebug._clear;
_297.appendChild(_298);
_297.appendChild(_296.createTextNode(" "));
_297.appendChild(_299);
}
catch(ex){
}
document.cookie="AjxDebugWinOpen=true";
if(!AjxEnv.isIE){
this._debugWindow.onunload=AjxDebug.unloadHandler;
window.addEventListener("unload",AjxDebug.myWindowUnloadHandler,true);
}else{
this._debugWindow.attachEvent("onunload",AjxDebug.unloadHandler);
window.attachEvent=AjxDebug.myWindowUnloadHandler;
}
this._dbgWindowInited=true;
this._showMessages();
};
AjxDebug.prototype._scrollToBottom=function(){
var _29a=this.getContentFrame().contentWindow.document.body;
var _29b=this.getLinkFrame().contentWindow.document.body;
_29a.scrollTop=_29a.scrollHeight;
_29b.scrollTop=_29b.scrollHeight;
};
AjxDebug.prototype._timestamp=function(){
return this._showTime?this._getTimeStamp()+": ":"";
};
AjxDebug.prototype.setShowTimestamps=function(show){
this._showTime=show;
};
AjxDebug.prototype._createXmlTree=function(node,_29e){
if(node==null){
return "";
}
var str="";
var len;
switch(node.nodeType){
case 1:
str+="<div style='color: blue; padding-left: 16px;'>&lt;<span style='color: DarkRed;'>"+node.nodeName+"</span>";
var _2a1=node.attributes;
len=_2a1.length;
for(var i=0;i<len;i++){
str+=this._createXmlAttribute(_2a1[i]);
}
if(!node.hasChildNodes()){
return str+"/&gt;</div>";
}
str+="&gt;<br />";
var cs=node.childNodes;
len=cs.length;
for(var i=0;i<len;i++){
str+=this._createXmlTree(cs[i],_29e+3);
}
str+="&lt;/<span style='color: DarkRed;'>"+node.nodeName+"</span>&gt;</div>";
break;
case 9:
var cs=node.childNodes;
len=cs.length;
for(var i=0;i<len;i++){
str+=this._createXmlTree(cs[i],_29e);
}
break;
case 3:
if(!/^\s*$/.test(node.nodeValue)){
var val=node.nodeValue.replace(/</g,"&lt;").replace(/>/g,"&gt;");
str+="<span style='color: WindowText; padding-left: 16px;'>"+val+"</span><br />";
}
break;
case 7:
str+="&lt;?"+node.nodeName;
var _2a1=node.attributes;
len=_2a1.length;
for(var i=0;i<len;i++){
str+=this._createXmlAttribute(_2a1[i]);
}
str+="?&gt;<br />";
break;
case 4:
str="<div style=''>&lt;![CDATA[<span style='color: WindowText; font-family: \"Courier New\"; white-space: pre; display: block; border-left: 1px solid Gray; padding-left: 16px;'>"+node.nodeValue+"</span>]"+"]></div>";
break;
case 8:
str="<div style='color: blue; padding-left: 16px;'>&lt;!--<span style='white-space: pre; font-family: \"Courier New\"; color: Gray; display: block;'>"+node.nodeValue+"</span>--></div>";
break;
case 10:
str="<div style='color: blue; padding-left: 16px'>&lt;!DOCTYPE "+node.name;
if(node.publicId){
str+=" PUBLIC \""+node.publicId+"\"";
if(node.systemId){
str+=" \""+node.systemId+"\"";
}
}else{
if(node.systemId){
str+=" SYSTEM \""+node.systemId+"\"";
}
}
str+="&gt;</div>";
break;
default:
this._inspect(node);
}
return str;
};
AjxDebug.prototype._createXmlAttribute=function(a){
return " <span style='color: red'>"+a.nodeName+"</span><span style='color: blue'>=\""+a.nodeValue+"\"</span>";
};
AjxDebug.prototype._inspect=function(obj){
var str="";
for(var k in obj){
str+="obj."+k+" = "+obj[k]+"\n";
}
window.alert(str);
};
AjxDebug.prototype._add=function(aMsg,_2aa,_2ab,_2ac,_2ad){
var _2ae=typeof (_2aa);
if(AjxUtil.isSpecified(_2aa)){
_2aa=this._getHtmlForObject(_2aa,_2ab,_2ac);
}
this._addMessage(new DebugMessage(aMsg,null,null,null,_2aa,_2ad));
};
AjxDebug.prototype._addMessage=function(aMsg){
this._msgQueue[this._msgQueue.length]=aMsg;
this._showMessages();
};
AjxDebug.prototype._showMessages=function(){
if(!this._dbgWindowInited){
return;
}
try{
if(this._msgQueue.length>0){
var msg;
var _2b1;
var _2b2;
var _2b3=this.getContentFrame().contentWindow.document;
var _2b4=this.getLinkFrame().contentWindow.document;
var len=this._msgQueue.length;
for(var i=0;i<len;++i){
var now=new Date();
msg=this._msgQueue[i];
_2b1=_2b3.createElement("div");
_2b1.innerHTML=[msg.message,msg.eHtml].join("");
if(msg.linkName){
_2b2=_2b4.createElement("div");
_2b2._targetId=_2b1.id=[AjxDebug._getNextId(),now.getMilliseconds()].join("");
_2b2._dbg=this;
_2b2.className="Link";
_2b2.onclick=AjxDebug._linkClicked;
_2b2.innerHTML=msg.linkName+" - ["+this._getTimeStamp(now)+"]";
_2b4.body.appendChild(_2b2);
}
_2b3.body.appendChild(_2b1);
}
}
this._msgQueue.length=0;
this._scrollToBottom();
}
catch(ex){
}
};
AjxDebug._linkClicked=function(){
var el=this._dbg._contentFrame.contentWindow.document.getElementById(this._targetId);
var y=0;
while(el){
y+=el.offsetTop;
el=el.offsetParent;
}
this._dbg._contentFrame.contentWindow.scrollTo(0,y);
};
AjxDebug._getNextId=function(){
return "AjxDebug_"+AjxDebug._id++;
};
AjxDebug.prototype._parseHtmlFragment=function(_2ba){
var div=this.getContentFrame().contentWindow.document.createElement("div");
div.innerHTML=_2ba;
return div;
};
AjxDebug.prototype._getTimeStamp=function(date){
if(!AjxDebug._timestampFormatter){
AjxDebug._timestampFormatter=new AjxDateFormat("HH:mm:ss.SSS");
}
date=date||new Date();
return AjxStringUtil.htmlEncode(AjxDebug._timestampFormatter.format(date),true);
};
AjxDebug._mark=function(){
this._dbg._createLinkNContent(this._dbg,"MarkLink","MARK","Mark","MARK");
};
AjxDebug.prototype._createLinkNContent=function(_2bd,_2be,_2bf,_2c0,_2c1){
var now=new Date();
var _2c3=[" - [",_2bd._getTimeStamp(now),"]"].join("");
var _2c4=_2bd._linkFrame.contentWindow.document;
var div=_2c4.createElement("div");
div.className=_2be;
div.innerHTML=_2bf+_2c3;
var id="Lnk_"+now.getMilliseconds();
div._targetId=id;
div._dbg=_2bd;
div.onclick=AjxDebug._linkClicked;
_2c4.body.appendChild(div);
var _2c7=_2bd._contentFrame.contentWindow.document;
div=_2c7.createElement("div");
div.className=_2c0;
div.id=id;
div.innerHTML=_2c1+_2c3;
div._dbg=_2bd;
_2c7.body.appendChild(_2c7.createElement("p"));
_2c7.body.appendChild(div);
_2c7.body.appendChild(_2c7.createElement("p"));
_2bd._scrollToBottom();
};
AjxDebug._clear=function(){
this._dbg._contentFrame.contentWindow.document.body.innerHTML="";
this._dbg._linkFrame.contentWindow.document.body.innerHTML="";
};
AjxDebug.myWindowUnloadHandler=function(){
if(!DBG._debugWindow){
return;
}
if(AjxEnv.isNav||AjxEnv.isSafari){
DBG._debugWindow.onunload=null;
}else{
DBG._debugWindow.detachEvent("onunload",AjxDebug.unloadHandler);
}
};
AjxDebug.unloadHandler=function(){
try{
window.AjxDebug.deleteWindowCookie();
}
catch(ex){
}
};
AjxDebug.deleteWindowCookie=function(){
var _2c8=new Date("Fri, 31 Dec 1999 23:59:59 GMT");
document.cookie="AjxDebugWinOpen=false;expires="+_2c8.toGMTString();
};
AjxDebug._escapeForHTML=function(str){
if(typeof (str)!="string"){
return str;
}
var s=str;
s=s.replace(/\&/g,"&amp;");
s=s.replace(/\</g,"&lt;");
s=s.replace(/\>/g,"&gt;");
s=s.replace(/\"/g,"&quot;");
s=s.replace(/\xA0/g,"&nbsp;");
return s;
};
DebugMessage=function(aMsg,_2cc,_2cd,_2ce,_2cf,_2d0){
this.message=(AjxUtil.isSpecified(aMsg))?aMsg:"";
this.type=_2cc?_2cc:null;
this.category=_2cd?_2cd:"";
this.time=_2ce?_2ce:(new Date().getTime());
this.eHtml=_2cf?_2cf:"";
this.linkName=_2d0;
};
function AjxDebugXmlDocument(){
}
function getDomDocumentPrefix(){
if(getDomDocumentPrefix.prefix){
return getDomDocumentPrefix.prefix;
}
var _2d1=["MSXML2","Microsoft","MSXML","MSXML3"];
var o;
var len=_2d1.length;
for(var i=0;i<len;i++){
try{
o=new ActiveXObject(_2d1[i]+".DomDocument");
return getDomDocumentPrefix.prefix=_2d1[i];
}
catch(ex){
}
}
throw new Error("Could not find an installed XML parser");
}
AjxDebugXmlDocument.prototype.create=function(){
try{
if(document.implementation&&document.implementation.createDocument){
var doc=document.implementation.createDocument("","",null);
if(doc.readyState==null){
doc.readyState=1;
doc.addEventListener("load",function(){
doc.readyState=4;
if(typeof doc.onreadystatechange=="function"){
doc.onreadystatechange();
}
},false);
}
return doc;
}
if(window.ActiveXObject){
return new ActiveXObject(getDomDocumentPrefix()+".DomDocument");
}
}
catch(ex){
}
throw new Error("Your browser does not support XmlDocument objects");
};
if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){
AjxDebugXmlDocument.prototype.loadXML=function(s){
var doc2=(new DOMParser()).parseFromString(s,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild);
}
var len=doc2.childNodes.length;
for(var i=0;i<len;i++){
this.appendChild(this.importNode(doc2.childNodes[i],true));
}
};
AjxDebugXmlDocument.prototype.__defineGetter__("xml",function(){
return (new XMLSerializer()).serializeToString(this);
});
}
function AjxXmlDoc(){
if(!AjxXmlDoc._inited){
AjxXmlDoc._init();
}
}
AjxXmlDoc.prototype.toString=function(){
return "AjxXmlDoc";
};
AjxXmlDoc._inited=false;
AjxXmlDoc._msxmlVers=null;
AjxXmlDoc.create=function(){
var _2da=new AjxXmlDoc();
var _2db=null;
if(AjxEnv.isIE){
_2db=new ActiveXObject(AjxXmlDoc._msxmlVers);
_2db.async=true;
if(AjxXmlDoc._msxmlVers=="MSXML2.DOMDocument.4.0"){
_2db.setProperty("SelectionLanguage","XPath");
_2db.setProperty("SelectionNamespaces","xmlns:zimbra='urn:zimbra' xmlns:mail='urn:zimbraMail' xmlns:account='urn:zimbraAccount'");
}
}else{
if(document.implementation&&document.implementation.createDocument){
_2db=document.implementation.createDocument("","",null);
}else{
throw new AjxException("Unable to create new Doc",AjxException.INTERNAL_ERROR,"AjxXmlDoc.create");
}
}
_2da._doc=_2db;
return _2da;
};
AjxXmlDoc.createFromDom=function(doc){
var _2dd=new AjxXmlDoc();
_2dd._doc=doc;
return _2dd;
};
AjxXmlDoc.createFromXml=function(xml){
var _2df=AjxXmlDoc.create();
_2df.loadFromString(xml);
return _2df;
};
AjxXmlDoc.getXml=function(node){
var ser=new XMLSerializer();
return ser.serializeToString(node);
};
AjxXmlDoc.prototype.getDoc=function(){
return this._doc;
};
AjxXmlDoc.prototype.loadFromString=function(str){
var doc=this._doc;
doc.loadXML(str);
if(AjxEnv.isIE){
if(doc.parseError.errorCode!=0){
throw new AjxException(doc.parseError.reason,AjxException.INVALID_PARAM,"AjxXmlDoc.loadFromString");
}
}
};
AjxXmlDoc.prototype.loadFromUrl=function(url){
this._doc.load(url);
};
AjxXmlDoc.prototype.toJSObject=function(_2e5,_2e6,_2e7){
function _node(){
this.__msh_content="";
}
_node.prototype.toString=function(){
return this.__msh_content;
};
function rec(i,o){
var tags={},t,n;
for(i=i.firstChild;i;i=i.nextSibling){
if(i.nodeType==1){
t=i.tagName;
if(_2e5){
t=t.replace(/^.*?:/,"");
}
if(_2e6){
t=t.toLowerCase();
}
n=new _node();
if(tags[t]){
if(tags[t]==1){
o[t]=[o[t]];
tags[t]=2;
}
o[t].push(n);
}else{
o[t]=n;
tags[t]=1;
}
if(_2e7){
if(i.attributes&&i.attributes.length){
for(var ix=0;ix<i.attributes.length;ix++){
attr=i.attributes[ix];
n[attr.name]=AjxUtil.isNumeric(attr.value)?attr.value:String(attr.value);
}
}
}
rec(i,n);
}else{
if(i.nodeType==3){
o.__msh_content+=i.nodeValue;
}
}
}
}
var o=new _node();
rec(this._doc.documentElement,o);
return o;
};
AjxXmlDoc.prototype.getElementsByTagNameNS=function(ns,tag){
var doc=this.getDoc();
return AjxEnv.isIE?doc.getElementsByTagName(ns+":"+tag):doc.getElementsByTagNameNS(ns,tag);
};
AjxXmlDoc.prototype.getFirstElementByTagNameNS=function(ns,tag){
return this.getElementsByTagNameNS(ns,tag)[0];
};
AjxXmlDoc._init=function(){
if(AjxEnv.isIE){
var _2f2=["MSXML4.DOMDocument","MSXML3.DOMDocument","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XmlDom"];
for(var i=0;i<_2f2.length;i++){
try{
new ActiveXObject(_2f2[i]);
AjxXmlDoc._msxmlVers=_2f2[i];
break;
}
catch(ex){
}
}
if(!AjxXmlDoc._msxmlVers){
throw new AjxException("MSXML not installed",AjxException.INTERNAL_ERROR,"AjxXmlDoc._init");
}
}else{
if(AjxEnv.isNav||AjxEnv.isOpera){
Document.prototype.loadXML=function(str){
var _2f5=new DOMParser();
var _2f6=_2f5.parseFromString(str,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild);
}
var len=_2f6.childNodes.length;
for(var i=0;i<len;i++){
var _2f9=this.importNode(_2f6.childNodes[i],true);
this.appendChild(_2f9);
}
};
if(AjxEnv.isNav){
_NodeGetXml=function(){
var ser=new XMLSerializer();
return ser.serializeToString(this);
};
Node.prototype.__defineGetter__("xml",_NodeGetXml);
}
}else{
if(AjxEnv.isSafari){
document.__proto__.loadXML=function(str){
var _2fc=new DOMParser();
var _2fd=_2fc.parseFromString(str,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild);
}
var len=_2fd.childNodes.length;
for(var i=0;i<len;i++){
var _300=this.importNode(_2fd.childNodes[i],true);
this.appendChild(_300);
}
};
}
}
}
AjxXmlDoc._inited=true;
};
function AjxImg(){
}
AjxImg.prototype=new Object;
AjxImg.prototype.constructor=null;
AjxImg._VIEWPORT_ID="AjxImg_VP";
AjxImg.setImage=function(_301,_302,_303){
var _304=AjxImg.getClassForImage(_302);
if(_303){
_301.className=_304;
}else{
if(_301.firstChild==null){
_301.innerHTML=_304?["<div class='",_304,"'></div>"].join(""):"<div></div>";
}else{
_301.firstChild.className=_304;
}
}
};
AjxImg.getClassForImage=function(_305){
return ["Img",_305].join("");
};
AjxImg.getImageClass=function(_306){
return _306.firstChild?_306.firstChild.className:_306.className;
};
AjxImg.getImageElement=function(_307){
return _307.firstChild?_307.firstChild:_307;
};
AjxImg.getParentElement=function(_308){
return _308.parentNode;
};
AjxImg.getImageHtml=function(_309,_30a,_30b,_30c){
_30b=_30b||"";
_30a=_30a?(["style='",_30a,"' "].join("")):"";
var pre=_30c?"<table style='display:inline' cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=bottom>":"";
var post=_30c?"</td></tr></table>":"";
if(_309){
return [pre,"<div class='","Img",_309,"' ",_30a," ",_30b,"></div>",post].join("");
}
return [pre,"<div ",_30a," ",_30b,"></div>",post].join("");
};
AjxImg.getImageSpanHtml=function(_30f,_310,_311,_312){
var _313=AjxImg.getClassForImage(_30f);
var html=[];
var i=0;
html[i++]="<span style='white-space:nowrap'>";
html[i++]="<span class='";
html[i++]=_313;
html[i++]=" inlineIcon'";
html[i++]=_310?([" style='",_310,"' "].join("")):"";
html[i++]=_311?([" ",_311].join("")):"";
html[i++]=">&nbsp;&nbsp;&nbsp;</span>";
html[i++]=(_312||"");
html[i++]="</span>";
return html.join("");
};
function AjxEvent(){
}
AjxEvent.prototype.toString=function(){
return "AjxEvent";
};
function AjxEventMgr(){
this._listeners=new Object();
}
AjxEventMgr.prototype.toString=function(){
return "AjxEventMgr";
};
AjxEventMgr.prototype.addListener=function(_316,_317){
var lv=this._listeners[_316];
if(lv==null){
lv=this._listeners[_316]=new AjxVector();
}
if(!lv.contains(_317)){
if(this._notifyingListeners){
lv=this._listeners[_316]=lv.clone();
}
lv.add(_317);
return true;
}
return false;
};
AjxEventMgr.prototype.notifyListeners=function(_319,_31a){
this._notifyingListeners=true;
var lv=this._listeners[_319];
if(lv!=null){
var a=lv.getArray();
var s=lv.size();
var _31e=null;
var c=null;
for(var i=0;i<s;i++){
c=a[i];
if(!(c&&((c instanceof AjxListener)||(typeof c=="function")))){
continue;
}
_31e=c.handleEvent?c.handleEvent(_31a):c(_31a);
if(_31e===false){
break;
}
}
}
this._notifyingListeners=false;
return _31e;
};
AjxEventMgr.prototype.isListenerRegistered=function(_321){
var lv=this._listeners[_321];
return (lv!=null&&lv.size()>0);
};
AjxEventMgr.prototype.removeListener=function(_323,_324){
var lv=this._listeners[_323];
if(lv!=null){
if(this._notifyingListeners){
lv=this._listeners[_323]=lv.clone();
}
lv.remove(_324);
return true;
}
return false;
};
AjxEventMgr.prototype.removeAll=function(_326){
var lv=this._listeners[_326];
if(lv!=null){
if(this._notifyingListeners){
lv=this._listeners[_326]=lv.clone();
}
lv.removeAll();
return true;
}
return false;
};
function AjxTimedAction(obj,func,args){
AjxCallback.call(this,obj,func,args);
this._tid=-1;
this._id=-1;
}
AjxTimedAction.prototype=new AjxCallback();
AjxTimedAction.prototype.constructor=AjxTimedAction;
AjxTimedAction.prototype.toString=function(){
return "AjxTimedAction";
};
AjxTimedAction._pendingActions={};
AjxTimedAction._nextActionId=0;
AjxTimedAction.scheduleAction=function(_32b,_32c){
if(_32b._tid){
AjxTimedAction.cancelAction(_32b._id);
}
var id=_32b._id=AjxTimedAction._nextActionId++;
AjxTimedAction._pendingActions[id]=_32b;
var _32e="AjxTimedAction._exec("+id+")";
_32b._tid=window.setTimeout(_32e,_32c?_32c:0);
return _32b._id;
};
AjxTimedAction.cancelAction=function(_32f){
var _330=AjxTimedAction._pendingActions[_32f];
if(_330){
window.clearTimeout(_330._tid);
delete AjxTimedAction._pendingActions[_32f];
delete _330._tid;
}
};
AjxTimedAction._exec=function(_331){
var _332=AjxTimedAction._pendingActions[_331];
delete AjxTimedAction._pendingActions[_331];
delete _332._tid;
_332.run();
};
function AjxInclude(_333,_334,_335,_336){
var head=document.getElementsByTagName("head")[0];
function loadNextScript(_338){
if(AjxEnv.isIE&&_338&&!/loaded|complete/.test(_338.readyState)){
return;
}
if(_338){
_338[AjxInclude.eventName]=null;
}
var _339=AjxInclude.dwhack_scripts.length>0?AjxInclude.dwhack_scripts:_333;
window.status="";
if(_339.length>0){
var _33a=_339.shift();
var orig=_33a;
if(!/^((https?|ftps?):\x2f\x2f|\x2f)/.test(_33a)){
if(_334){
_33a=_334+_33a;
}
if(cacheKillerVersion){
_33a+="?v="+cacheKillerVersion;
}
}else{
if(_336&&_33a.indexOf("/")!=0){
_33a=_336+AjxStringUtil.urlEncode(_33a);
}
}
var _338=document.createElement("script");
var _33c=AjxCallback.simpleClosure(loadNextScript,null,_338);
if(AjxEnv.isIE){
_338.attachEvent("onreadystatechange",_33c);
}else{
_338.addEventListener("load",_33c,true);
}
_338.type="text/javascript";
_338.src=_33a;
window.status="Loading script: "+orig;
head.appendChild(_338);
}else{
if(_333.length==0){
_338=null;
head=null;
if(_335){
_335.run();
}
}
}
}
loadNextScript(null);
}
AjxInclude.dwhack_scripts=[];
document.write=document.writeln=function(){
var a=[];
for(var i=0;i<arguments.length;++i){
a[i]=arguments[i];
}
var str=a.join("");
if(/<script[^>]+src=([\x22\x27])(.*?)\1/i.test(str)){
AjxInclude.dwhack_scripts.push(RegExp.$2);
}
};
if(AjxEnv.isIE){
AjxInclude._removeWriteln=function(){
document.write=document.writeln=null;
window.detachEvent("onunload",AjxInclude._removeWriteln);
};
window.attachEvent("onunload",AjxInclude._removeWriteln);
}
function AjxListener(obj,_341,args){
AjxCallback.call(this,obj,_341,args);
}
AjxListener.prototype=new AjxCallback();
AjxListener.prototype.constructor=AjxListener;
AjxListener.prototype.toString=function(){
return "AjxListener";
};
AjxListener.prototype.handleEvent=function(ev){
return this.run(ev);
};
function AjxFormat(_344){
this._pattern=_344;
this._segments=[];
}
AjxFormat.prototype.toString=function(){
var s=[];
s.push("pattern=\"",this._pattern,"\"");
if(this._segments.length>0){
s.push(", segments={ ");
for(var i=0;i<this._segments.length;i++){
if(i>0){
s.push(", ");
}
s.push(String(this._segments[i]));
}
s.push(" }");
}
return s.join("");
};
AjxFormat.prototype._pattern;
AjxFormat.prototype._segments;
AjxFormat.prototype.format=function(_347){
var s=[];
for(var i=0;i<this._segments.length;i++){
s.push(this._segments[i].format(_347));
}
return s.join("");
};
AjxFormat.prototype.parse=function(s){
var _34b=this._createParseObject();
var _34c=0;
for(var i=0;i<this._segments.length;i++){
var _34e=this._segments[i];
_34c=_34e.parse(_34b,s,_34c);
}
if(_34c<s.length){
throw new AjxFormat.ParsingException(this,null,"input too long");
}
return _34b;
};
AjxFormat.prototype.getSegments=function(){
return this._segments;
};
AjxFormat.prototype.toPattern=function(){
return this._pattern;
};
AjxFormat.prototype.clone=function(){
return new this.constructor(this._pattern);
};
AjxFormat.prototype._createParseObject=function(s){
throw new AjxFormat.ParsingException(this,null,"not implemented");
};
AjxFormat._zeroPad=function(s,_351,_352,_353){
s=typeof s=="string"?s:String(s);
if(s.length>=_351){
return s;
}
_352=_352||"0";
var a=[];
for(var i=s.length;i<_351;i++){
a.push(_352);
}
a[_353?"unshift":"push"](s);
return a.join("");
};
AjxFormat.FormatException=function(_356,_357){
this._format=_356;
this._message=_357;
};
AjxFormat.FormatException.prototype.toString=function(){
return this._message;
};
AjxFormat.FormatException.prototype._format;
AjxFormat.FormatException.prototype._message;
AjxFormat.FormattingException=function(_358,_359,_35a){
AjxFormat.FormatException.call(this,_358,_35a);
this._segment=_359;
};
AjxFormat.FormattingException.prototype=new AjxFormat.FormatException;
AjxFormat.FormattingException.prototype.constructor=AjxFormat.FormattingException;
AjxFormat.FormattingException.prototype._segment;
AjxFormat.ParsingException=function(_35b,_35c,_35d){
AjxFormat.FormatException.call(this,_35b,_35d);
this._segment=_35c;
};
AjxFormat.ParsingException.prototype=new AjxFormat.FormatException;
AjxFormat.ParsingException.prototype.constructor=AjxFormat.ParsingException;
AjxFormat.ParsingException.prototype._segment;
AjxFormat.Segment=function(_35e,s){
this._parent=_35e;
this._s=s;
};
AjxFormat.Segment.prototype.toString=function(){
return "segment: \""+this._s+"\"";
};
AjxFormat.Segment.prototype._parent;
AjxFormat.Segment.prototype._s;
AjxFormat.Segment.prototype.format=function(o){
return this._s;
};
AjxFormat.Segment.prototype.parse=function(o,s,i){
throw new AjxFormat.ParsingException(this._parent,this,"not implemented");
};
AjxFormat.Segment.prototype.getFormat=function(){
return this._parent;
};
AjxFormat.Segment.prototype.toSubPattern=function(){
return this._s;
};
AjxFormat.Segment.prototype._getFixedLength=function(){
var _364;
if(this._index+1<this._parent._segments.length){
var _365=this._parent._segments[this._index+1];
if(!(_365 instanceof AjxFormat.TextSegment)){
_364=this._s.length;
}
}
return _364;
};
AjxFormat.Segment._parseLiteral=function(_366,s,_368){
if(s.length-_368<_366.length){
throw new AjxFormat.ParsingException(this._parent,this,"input too short");
}
for(var i=0;i<_366.length;i++){
if(_366.charAt(i)!=s.charAt(_368+i)){
throw new AjxFormat.ParsingException(this._parent,this,"input doesn't match");
}
}
return _368+_366.length;
};
AjxFormat.Segment._parseLiterals=function(o,f,_36c,_36d,s,_36f){
for(var i=0;i<_36d.length;i++){
try{
var _371=_36d[i];
var _372=AjxFormat.Segment._parseLiteral(_371,s,_36f);
if(f){
var _373=o||window;
if(typeof f=="function"){
f.call(_373,i+_36c);
}else{
_373[f]=i+_36c;
}
}
return _372;
}
catch(e){
}
}
return -1;
};
AjxFormat.Segment._parseInt=function(o,f,_376,s,_378,_379,_37a){
var len=_379||s.length-_378;
var head=_378;
for(var i=0;i<len;i++){
if(!s.charAt(_378++).match(/\d/)){
_378--;
break;
}
}
var tail=_378;
if(head==tail){
throw new AjxFormat.ParsingException(this._parent,this,"number not present");
}
if(_379&&tail-head!=_379){
throw new AjxFormat.ParsingException(this._parent,this,"number too short");
}
var _37f=parseInt(s.substring(head,tail),_37a||10);
if(f){
var _380=o||window;
if(typeof f=="function"){
f.call(_380,_37f+_376);
}else{
_380[f]=_37f+_376;
}
}
return tail;
};
function AjxDateFormat(_381){
AjxFormat.call(this,_381);
if(typeof _381=="number"){
switch(_381){
case AjxDateFormat.SHORT:
_381=I18nMsg.formatDateShort;
break;
case AjxDateFormat.MEDIUM:
_381=I18nMsg.formatDateMedium;
break;
case AjxDateFormat.LONG:
_381=I18nMsg.formatDateLong;
break;
case AjxDateFormat.FULL:
_381=I18nMsg.formatDateFull;
break;
}
}
for(var i=0;i<_381.length;i++){
var c=_381.charAt(i);
if(c=="'"){
var head=i+1;
for(i++;i<_381.length;i++){
var c=_381.charAt(i);
if(c=="'"){
if(i+1<_381.length&&_381.charAt(i+1)=="'"){
_381=_381.substr(0,i)+_381.substr(i+1);
}else{
break;
}
}
}
if(i==_381.length){
throw new FormatException(this,"unterminated string literal");
}
var tail=i;
var _386=new AjxFormat.TextSegment(this,_381.substring(head,tail));
this._segments.push(_386);
continue;
}
var head=i;
while(i<_381.length){
c=_381.charAt(i);
if(AjxDateFormat._META_CHARS.indexOf(c)!=-1||c=="'"){
break;
}
i++;
}
var tail=i;
if(head!=tail){
var _386=new AjxFormat.TextSegment(this,_381.substring(head,tail));
this._segments.push(_386);
i--;
continue;
}
var head=i;
while(++i<_381.length){
if(_381.charAt(i)!=c){
break;
}
}
var tail=i--;
var _387=tail-head;
var _388=_381.substr(head,_387);
var _386=null;
switch(c){
case "G":
_386=new AjxDateFormat.EraSegment(this,_388);
break;
case "y":
_386=new AjxDateFormat.YearSegment(this,_388);
break;
case "M":
_386=new AjxDateFormat.MonthSegment(this,_388);
break;
case "w":
_386=new AjxDateFormat.WeekSegment(this,_388);
break;
case "W":
_386=new AjxDateFormat.WeekSegment(this,_388);
break;
case "D":
_386=new AjxDateFormat.DaySegment(this,_388);
break;
case "d":
_386=new AjxDateFormat.DaySegment(this,_388);
break;
case "F":
_386=new AjxDateFormat.WeekdaySegment(this,_388);
break;
case "E":
_386=new AjxDateFormat.WeekdaySegment(this,_388);
break;
case "a":
_386=new AjxDateFormat.AmPmSegment(this,_388);
break;
case "H":
_386=new AjxDateFormat.HourSegment(this,_388);
break;
case "k":
_386=new AjxDateFormat.HourSegment(this,_388);
break;
case "K":
_386=new AjxDateFormat.HourSegment(this,_388);
break;
case "h":
_386=new AjxDateFormat.HourSegment(this,_388);
break;
case "m":
_386=new AjxDateFormat.MinuteSegment(this,_388);
break;
case "s":
_386=new AjxDateFormat.SecondSegment(this,_388);
break;
case "S":
_386=new AjxDateFormat.SecondSegment(this,_388);
break;
case "z":
_386=new AjxDateFormat.TimezoneSegment(this,_388);
break;
case "Z":
_386=new AjxDateFormat.TimezoneSegment(this,_388);
break;
}
if(_386!=null){
_386._index=this._segments.length;
this._segments.push(_386);
}
}
}
AjxDateFormat.prototype=new AjxFormat;
AjxDateFormat.prototype.constructor=AjxDateFormat;
AjxDateFormat.prototype.toString=function(){
return "[AjxDateFormat: "+AjxFormat.prototype.toString.call(this)+"]";
};
AjxDateFormat.SHORT=0;
AjxDateFormat.MEDIUM=1;
AjxDateFormat.LONG=2;
AjxDateFormat.FULL=3;
AjxDateFormat.DEFAULT=AjxDateFormat.MEDIUM;
AjxDateFormat._META_CHARS="GyMwWDdFEaHkKhmsSzZ";
AjxDateFormat._dateFormats=[I18nMsg.formatDateShort,I18nMsg.formatDateMedium,I18nMsg.formatDateLong,I18nMsg.formatDateFull];
AjxDateFormat._timeFormats=[I18nMsg.formatTimeShort,I18nMsg.formatTimeMedium,I18nMsg.formatTimeLong,I18nMsg.formatTimeFull];
AjxDateFormat._DATE_FORMATTERS={};
AjxDateFormat._TIME_FORMATTERS={};
AjxDateFormat._DATETIME_FORMATTERS={};
AjxDateFormat.getDateInstance=function(_389){
_389=_389!=null?_389:AjxDateFormat.DEFAULT;
if(!AjxDateFormat._DATE_FORMATTERS[_389]){
AjxDateFormat._DATE_FORMATTERS[_389]=new AjxDateFormat(AjxDateFormat._dateFormats[_389]);
}
return AjxDateFormat._DATE_FORMATTERS[_389];
};
AjxDateFormat.getTimeInstance=function(_38a){
_38a=_38a!=null?_38a:AjxDateFormat.DEFAULT;
if(!AjxDateFormat._TIME_FORMATTERS[_38a]){
AjxDateFormat._TIME_FORMATTERS[_38a]=new AjxDateFormat(AjxDateFormat._timeFormats[_38a]);
}
return AjxDateFormat._TIME_FORMATTERS[_38a];
};
AjxDateFormat.getDateTimeInstance=function(_38b,_38c){
_38b=_38b!=null?_38b:AjxDateFormat.DEFAULT;
_38c=_38c!=null?_38c:AjxDateFormat.DEFAULT;
var _38d=_38b*10+_38c;
if(!AjxDateFormat._DATETIME_FORMATTERS[_38d]){
var _38e=I18nMsg.formatDateTime;
var _38f=[AjxDateFormat._dateFormats[_38b],AjxDateFormat._timeFormats[_38c]];
var _390=AjxMessageFormat.format(_38e,_38f);
AjxDateFormat._DATETIME_FORMATTERS[_38d]=new AjxDateFormat(_390);
}
return AjxDateFormat._DATETIME_FORMATTERS[_38d];
};
AjxDateFormat.format=function(_391,date){
return new AjxDateFormat(_391).format(date);
};
AjxDateFormat.parse=function(_393,_394){
return new AjxDateFormat(_393).parse(_394);
};
AjxDateFormat.prototype.parse=function(s){
var _396=null;
try{
_396=AjxFormat.prototype.parse.call(this,s);
var date=new Date(0,0,1,0,0,0,0);
if(_396.year!=null){
date.setFullYear(_396.year);
}
if(_396.month!=null){
date.setMonth(_396.month);
}
if(_396.dayofmonth!=null){
date.setDate(_396.dayofmonth);
}else{
if(_396.dayofyear!=null){
date.setMonth(0,_396.dayofyear);
}
}
if(_396.hours!=null){
date.setHours(_396.hours);
}
if(_396.minutes!=null){
date.setMinutes(_396.minutes);
}
if(_396.seconds!=null){
date.setSeconds(_396.seconds);
}
if(_396.milliseconds!=null){
date.setMilliseconds(_396.milliseconds);
}
if(_396.ampm!=null){
var _398=date.getHours();
if(_398==12&&_396.ampm==0){
_398=0;
}else{
if(_398!=12&&_396.ampm==1){
_398+=12;
}
}
date.setHours(_398);
}
_396=date;
}
catch(e){
}
return _396;
};
AjxDateFormat.prototype._createParseObject=function(){
return {year:null,month:null,dayofmonth:null,dayofyear:null,hours:null,minutes:null,seconds:null,milliseconds:null,ampm:null,era:null,timezone:null};
};
AjxFormat.TextSegment=function(_399,s){
AjxFormat.Segment.call(this,_399,s);
};
AjxFormat.TextSegment.prototype=new AjxFormat.Segment;
AjxFormat.TextSegment.prototype.constructor=AjxFormat.TextSegment;
AjxFormat.TextSegment.prototype.toString=function(){
return "text: \""+this._s+"\"";
};
AjxFormat.TextSegment.prototype.parse=function(o,s,_39d){
return AjxFormat.Segment._parseLiteral(this._s,s,_39d);
};
AjxDateFormat.DateSegment=function(_39e,s){
AjxFormat.Segment.call(this,_39e,s);
};
AjxDateFormat.DateSegment.prototype=new AjxFormat.Segment;
AjxDateFormat.DateSegment.prototype.constructor=AjxDateFormat.DateSegment;
AjxDateFormat.EraSegment=function(_3a0,s){
AjxDateFormat.DateSegment.call(this,_3a0,s);
};
AjxDateFormat.EraSegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.EraSegment.prototype.constructor=AjxDateFormat.EraSegment;
AjxDateFormat.EraSegment.prototype.toString=function(){
return "dateEra: \""+this._s+"\"";
};
AjxDateFormat.EraSegment.prototype.format=function(date){
return I18nMsg.eraAD;
};
AjxDateFormat.YearSegment=function(_3a3,s){
AjxDateFormat.DateSegment.call(this,_3a3,s);
};
AjxDateFormat.YearSegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.YearSegment.prototype.constructor=AjxDateFormat.YearSegment;
AjxDateFormat.YearSegment.prototype.toString=function(){
return "dateYear: \""+this._s+"\"";
};
AjxDateFormat.YearSegment.prototype.format=function(date){
var year=String(date.getFullYear());
return this._s.length<4?year.substr(year.length-2):AjxFormat._zeroPad(year,this._s.length);
};
AjxDateFormat.YearSegment.prototype.parse=function(_3a7,s,_3a9){
var _3aa=this._getFixedLength();
var _3ab=AjxFormat.Segment._parseInt(_3a7,"year",0,s,_3a9,_3aa);
if(_3ab-_3a9==2){
if(!AjxDateFormat._2digitStartYear){
AjxDateFormat._2digitStartYear=parseInt(AjxMsg.dateParsing2DigitStartYear);
}
var _3ac=AjxDateFormat._2digitStartYear;
var _3ad=parseInt(s.substr(_3a9,2));
var _3ae=(Math.floor(_3ac/100)+(_3ad<(_3ac%100)?1:0))*100;
var year=_3ae+_3ad;
_3a7.year=year;
}
return _3ab;
};
AjxDateFormat.MonthSegment=function(_3b0,s){
AjxDateFormat.DateSegment.call(this,_3b0,s);
};
AjxDateFormat.MonthSegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.MonthSegment.prototype.constructor=AjxDateFormat.MonthSegment;
AjxDateFormat.MonthSegment.prototype.toString=function(){
return "dateMonth: \""+this._s+"\"";
};
AjxDateFormat.MonthSegment.MONTHS={};
AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT]=[AjxMsg.monthJanShort,AjxMsg.monthFebShort,AjxMsg.monthMarShort,AjxMsg.monthAprShort,AjxMsg.monthMayShort,AjxMsg.monthJunShort,AjxMsg.monthJulShort,AjxMsg.monthAugShort,AjxMsg.monthSepShort,AjxMsg.monthOctShort,AjxMsg.monthNovShort,AjxMsg.monthDecShort];
AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM]=[I18nMsg.monthJanMedium,I18nMsg.monthFebMedium,I18nMsg.monthMarMedium,I18nMsg.monthAprMedium,I18nMsg.monthMayMedium,I18nMsg.monthJunMedium,I18nMsg.monthJulMedium,I18nMsg.monthAugMedium,I18nMsg.monthSepMedium,I18nMsg.monthOctMedium,I18nMsg.monthNovMedium,I18nMsg.monthDecMedium];
AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG]=[I18nMsg.monthJanLong,I18nMsg.monthFebLong,I18nMsg.monthMarLong,I18nMsg.monthAprLong,I18nMsg.monthMayLong,I18nMsg.monthJunLong,I18nMsg.monthJulLong,I18nMsg.monthAugLong,I18nMsg.monthSepLong,I18nMsg.monthOctLong,I18nMsg.monthNovLong,I18nMsg.monthDecLong];
AjxDateFormat.MonthSegment.prototype.format=function(date){
var _3b3=date.getMonth();
switch(this._s.length){
case 1:
return String(_3b3+1);
case 2:
return AjxFormat._zeroPad(_3b3+1,2);
case 3:
return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM][_3b3];
case 5:
return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT][_3b3];
}
return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG][_3b3];
};
AjxDateFormat.MonthSegment.prototype.parse=function(_3b4,s,_3b6){
var _3b7;
switch(this._s.length){
case 3:
_3b7=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
case 4:
_3b7=_3b7||AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
case 5:
_3b7=_3b7||AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
var _3b8=AjxFormat.Segment._parseLiterals(_3b4,"month",0,_3b7,s,_3b6);
if(_3b8==-1){
throw new AjxFormat.ParsingException(this._parent,this,"no match");
}
return _3b8;
}
var _3b9=this._getFixedLength();
return AjxFormat.Segment._parseInt(_3b4,"month",-1,s,_3b6,_3b9);
};
AjxDateFormat.WeekSegment=function(_3ba,s){
AjxDateFormat.DateSegment.call(this,_3ba,s);
};
AjxDateFormat.WeekSegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.WeekSegment.prototype.constructor=AjxDateFormat.WeekSegment;
AjxDateFormat.WeekSegment.prototype.toString=function(){
return "weekMonth: \""+this._s+"\"";
};
AjxDateFormat.WeekSegment.prototype.format=function(date){
var year=date.getYear();
var _3be=date.getMonth();
var day=date.getDate();
var _3c0=/w/.test(this._s);
var _3c1=new Date(year,_3c0?0:_3be,1);
var week=0;
while(true){
week++;
if(_3c1.getMonth()>_3be||(_3c1.getMonth()==_3be&&_3c1.getDate()>=day)){
break;
}
_3c1.setDate(_3c1.getDate()+7);
}
return AjxFormat._zeroPad(week,this._s.length);
};
AjxDateFormat.WeekSegment.prototype.parse=function(_3c3,s,_3c5){
var _3c6=this._getFixedLength();
return AjxFormat.Segment._parseInt(null,null,0,s,_3c5,_3c6);
};
AjxDateFormat.DaySegment=function(_3c7,s){
AjxDateFormat.DateSegment.call(this,_3c7,s);
};
AjxDateFormat.DaySegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.DaySegment.prototype.constructor=AjxDateFormat.DaySegment;
AjxDateFormat.DaySegment.prototype.toString=function(){
return "dateDay: \""+this._s+"\"";
};
AjxDateFormat.DaySegment.prototype.format=function(date){
var _3ca=date.getMonth();
var day=date.getDate();
if(/D/.test(this._s)&&_3ca>0){
var year=date.getYear();
do{
var _3cd=new Date(year,_3ca,1);
_3cd.setDate(0);
day+=_3cd.getDate();
_3ca--;
}while(_3ca>0);
}
return AjxFormat._zeroPad(day,this._s.length);
};
AjxDateFormat.DaySegment.prototype.parse=function(_3ce,s,_3d0){
var _3d1=this._getFixedLength();
var _3d2=/D/.test(this._s)?"dayofyear":"dayofmonth";
return AjxFormat.Segment._parseInt(_3ce,_3d2,0,s,_3d0,_3d1);
};
AjxDateFormat.WeekdaySegment=function(_3d3,s){
AjxDateFormat.DateSegment.call(this,_3d3,s);
};
AjxDateFormat.WeekdaySegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.WeekdaySegment.prototype.constructor=AjxDateFormat.WeekdaySegment;
AjxDateFormat.DaySegment.prototype.toString=function(){
return "dateDay: \""+this._s+"\"";
};
AjxDateFormat.WeekdaySegment.WEEKDAYS={};
AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT]=[AjxMsg.weekdaySunShort,AjxMsg.weekdayMonShort,AjxMsg.weekdayTueShort,AjxMsg.weekdayWedShort,AjxMsg.weekdayThuShort,AjxMsg.weekdayFriShort,AjxMsg.weekdaySatShort];
AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM]=[I18nMsg.weekdaySunMedium,I18nMsg.weekdayMonMedium,I18nMsg.weekdayTueMedium,I18nMsg.weekdayWedMedium,I18nMsg.weekdayThuMedium,I18nMsg.weekdayFriMedium,I18nMsg.weekdaySatMedium];
AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG]=[I18nMsg.weekdaySunLong,I18nMsg.weekdayMonLong,I18nMsg.weekdayTueLong,I18nMsg.weekdayWedLong,I18nMsg.weekdayThuLong,I18nMsg.weekdayFriLong,I18nMsg.weekdaySatLong];
AjxDateFormat.WeekdaySegment.prototype.format=function(date){
var _3d6=date.getDay();
if(/E/.test(this._s)){
var _3d7;
switch(this._s.length){
case 4:
_3d7=AjxDateFormat.LONG;
break;
case 5:
_3d7=AjxDateFormat.SHORT;
break;
default:
_3d7=AjxDateFormat.MEDIUM;
}
return AjxDateFormat.WeekdaySegment.WEEKDAYS[_3d7][_3d6];
}
return AjxFormat._zeroPad(_3d6,this._s.length);
};
AjxDateFormat.WeekdaySegment.prototype.parse=function(_3d8,s,_3da){
var _3db;
switch(this._s.length){
case 3:
_3db=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
case 4:
_3db=_3db||AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
case 5:
_3db=_3db||AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
var _3dc=AjxFormat.Segment._parseLiterals(null,null,0,_3db,s,_3da);
if(_3dc==-1){
throw new AjxFormat.ParsingException(this._parent,this,"no match");
}
return _3dc;
}
var _3dd=this._getFixedLength();
return AjxFormat.Segment._parseInt(null,null,0,s,_3da,_3dd);
};
AjxDateFormat.TimeSegment=function(_3de,s){
AjxFormat.Segment.call(this,_3de,s);
};
AjxDateFormat.TimeSegment.prototype=new AjxFormat.Segment;
AjxDateFormat.TimeSegment.prototype.constructor=AjxDateFormat.TimeSegment;
AjxDateFormat.HourSegment=function(_3e0,s){
AjxFormat.Segment.call(this,_3e0,s);
};
AjxDateFormat.HourSegment.prototype=new AjxDateFormat.TimeSegment;
AjxDateFormat.HourSegment.prototype.constructor=AjxDateFormat.HourSegment;
AjxDateFormat.HourSegment.prototype.toString=function(){
return "timeHour: \""+this._s+"\"";
};
AjxDateFormat.HourSegment.prototype.format=function(date){
var _3e3=date.getHours();
if(_3e3>12&&/[hK]/.test(this._s)){
_3e3-=12;
}else{
if(_3e3==0&&/[h]/.test(this._s)){
_3e3=12;
}
}
return AjxFormat._zeroPad(_3e3,this._s.length);
};
AjxDateFormat.HourSegment.prototype.parse=function(_3e4,s,_3e6){
var _3e7=this._getFixedLength();
return AjxFormat.Segment._parseInt(_3e4,"hours",0,s,_3e6,_3e7);
};
AjxDateFormat.MinuteSegment=function(_3e8,s){
AjxFormat.Segment.call(this,_3e8,s);
};
AjxDateFormat.MinuteSegment.prototype=new AjxDateFormat.TimeSegment;
AjxDateFormat.MinuteSegment.prototype.constructor=AjxDateFormat.MinuteSegment;
AjxDateFormat.MinuteSegment.prototype.toString=function(){
return "timeMinute: \""+this._s+"\"";
};
AjxDateFormat.MinuteSegment.prototype.format=function(date){
var _3eb=date.getMinutes();
return AjxFormat._zeroPad(_3eb,this._s.length);
};
AjxDateFormat.MinuteSegment.prototype.parse=function(_3ec,s,_3ee){
var _3ef=this._getFixedLength();
return AjxFormat.Segment._parseInt(_3ec,"minutes",0,s,_3ee,_3ef);
};
AjxDateFormat.SecondSegment=function(_3f0,s){
AjxFormat.Segment.call(this,_3f0,s);
};
AjxDateFormat.SecondSegment.prototype=new AjxDateFormat.TimeSegment;
AjxDateFormat.SecondSegment.prototype.constructor=AjxDateFormat.SecondSegment;
AjxDateFormat.SecondSegment.prototype.toString=function(){
return "timeSecond: \""+this._s+"\"";
};
AjxDateFormat.SecondSegment.prototype.format=function(date){
var _3f3=/s/.test(this._s)?date.getSeconds():date.getMilliseconds();
return AjxFormat._zeroPad(_3f3,this._s.length);
};
AjxDateFormat.SecondSegment.prototype.parse=function(_3f4,s,_3f6){
var _3f7=this._getFixedLength();
var _3f8=/s/.test(this._s)?"seconds":"milliseconds";
return AjxFormat.Segment._parseInt(_3f4,_3f8,0,s,_3f6,_3f7);
};
AjxDateFormat.AmPmSegment=function(_3f9,s){
AjxFormat.Segment.call(this,_3f9,s);
};
AjxDateFormat.AmPmSegment.prototype=new AjxDateFormat.TimeSegment;
AjxDateFormat.AmPmSegment.prototype.constructor=AjxDateFormat.AmPmSegment;
AjxDateFormat.AmPmSegment.prototype.toString=function(){
return "timeAmPm: \""+this._s+"\"";
};
AjxDateFormat.AmPmSegment.prototype.format=function(date){
var _3fc=date.getHours();
return _3fc<12?I18nMsg.periodAm:I18nMsg.periodPm;
};
AjxDateFormat.AmPmSegment.prototype.parse=function(_3fd,s,_3ff){
var _400=[I18nMsg.periodAm.toLowerCase(),I18nMsg.periodPm.toLowerCase(),I18nMsg.periodAm.toUpperCase(),I18nMsg.periodPm.toUpperCase()];
var _401=AjxFormat.Segment._parseLiterals(_3fd,"ampm",0,_400,s,_3ff);
if(_401==-1){
throw new AjxFormat.ParsingException(this._parent,this,"no match");
}
_3fd.ampm=_3fd.ampm%2;
return _401;
};
AjxDateFormat.TimezoneSegment=function(_402,s){
AjxFormat.Segment.call(this,_402,s);
};
AjxDateFormat.TimezoneSegment.prototype=new AjxDateFormat.TimeSegment;
AjxDateFormat.TimezoneSegment.prototype.constructor=AjxDateFormat.TimezoneSegment;
AjxDateFormat.TimezoneSegment.prototype.toString=function(){
return "timeTimezone: \""+this._s+"\"";
};
AjxDateFormat.TimezoneSegment.prototype.format=function(date){
var _405=date.timezone||AjxTimezone.DEFAULT;
if(/Z/.test(this._s)){
return AjxTimezone.getShortName(_405);
}
return this._s.length<4?AjxTimezone.getMediumName(_405):AjxTimezone.getLongName(_405);
};
function AjxMessageFormat(_406){
AjxFormat.call(this,_406);
for(var i=0;i<_406.length;i++){
var c=_406.charAt(i);
if(c=="'"){
if(i+1<_406.length&&_406.charAt(i+1)=="'"){
var _409=new AjxFormat.TextSegment(this,"'");
this._segments.push(_409);
i++;
continue;
}
var head=i+1;
for(i++;i<_406.length;i++){
var c=_406.charAt(i);
if(c=="'"){
if(i+1<_406.length&&_406.charAt(i+1)=="'"){
_406=_406.substr(0,i)+_406.substr(i+1);
}else{
break;
}
}
}
if(i==_406.length){
throw new AjxFormat.FormatException(this,"unterminated string literal");
}
var tail=i;
var _409=new AjxFormat.TextSegment(this,_406.substring(head,tail));
this._segments.push(_409);
continue;
}
var head=i;
while(i<_406.length){
c=_406.charAt(i);
if(c=="{"||c=="'"){
break;
}
i++;
}
var tail=i;
if(head!=tail){
var _409=new AjxFormat.TextSegment(this,_406.substring(head,tail));
this._segments.push(_409);
i--;
continue;
}
var head=i+1;
var _40c=0;
while(++i<_406.length){
var c=_406.charAt(i);
if(c=="{"){
_40c++;
}else{
if(c=="}"){
if(_40c==0){
break;
}
_40c--;
}
}
}
var tail=i;
var _40d=tail-head;
var _40e=_406.substr(head,_40d);
var _409=new AjxMessageFormat.MessageSegment(this,_40e);
if(_409!=null){
this._segments.push(_409);
}
}
}
AjxMessageFormat.prototype=new AjxFormat;
AjxMessageFormat.prototype.constructor=AjxMessageFormat;
AjxMessageFormat.prototype.toString=function(){
return "[AjxMessageFormat: "+AjxFormat.prototype.toString.call(this)+"]";
};
AjxMessageFormat.format=function(_40f,_410){
return new AjxMessageFormat(_40f).format(_410);
};
AjxMessageFormat.prototype.format=function(_411){
if(!(_411 instanceof Array)){
_411=[_411];
}
return AjxFormat.prototype.format.call(this,_411);
};
AjxMessageFormat.prototype.getFormats=function(){
var _412=[];
for(var i=0;i<this._segments.length;i++){
var _414=this._segments[i];
if(_414 instanceof AjxMessageFormat.MessageSegment){
_412.push(_414.getSegmentFormat());
}
}
return _412;
};
AjxMessageFormat.prototype.getFormatsByArgumentIndex=function(){
var _415=[];
for(var i=0;i<this._segments.length;i++){
var _417=this._segments[i];
if(_417 instanceof AjxMessageFormat.MessageSegment){
_415[_417.getIndex()]=_417.getSegmentFormat();
}
}
return _415;
};
AjxMessageFormat.MessageSegment=function(_418,s){
AjxFormat.Segment.call(this,_418,s);
var _41a=AjxMessageFormat.MessageSegment._split(s,",");
this._index=Number(_41a[0]);
this._type=_41a[1]||"string";
this._style=_41a[2];
if(this._type=="list"){
this._isList=true;
this._type=_41a[2]||"string";
this._style=_41a[3];
}
switch(this._type){
case "number":
switch(this._style){
case "integer":
this._formatter=AjxNumberFormat.getIntegerInstance();
break;
case "currency":
this._formatter=AjxNumberFormat.getCurrencyInstance();
break;
case "percent":
this._formatter=AjxNumberFormat.getPercentInstance();
break;
default:
this._formatter=this._style==null?AjxNumberFormat.getInstance():new AjxNumberFormat(this._style);
}
break;
case "date":
case "time":
var func=this._type=="date"?AjxDateFormat.getDateInstance:AjxDateFormat.getTimeInstance;
switch(this._style){
case "short":
this._formatter=func(AjxDateFormat.SHORT);
break;
case "medium":
this._formatter=func(AjxDateFormat.MEDIUM);
break;
case "long":
this._formatter=func(AjxDateFormat.LONG);
break;
case "full":
this._formatter=func(AjxDateFormat.FULL);
break;
default:
this._formatter=this._style==null?func(AjxDateFormat.DEFAULT):new AjxDateFormat(this._style);
}
break;
case "choice":
this._formatter=new AjxChoiceFormat(this._style);
break;
}
if(this._isList){
this._formatter=new AjxListFormat(this._formatter);
}
};
AjxMessageFormat.MessageSegment.prototype=new AjxFormat.Segment;
AjxMessageFormat.MessageSegment.prototype.constructor=AjxMessageFormat.MessageSegment;
AjxMessageFormat.MessageSegment.prototype.toString=function(){
var a=["message: \"",this._s,"\", index: ",this._index];
if(this._isList){
a.push(", list: ",this._isList);
}
if(this._type){
a.push(", type: ",this._type);
}
if(this._style){
a.push(", style: ",this._style);
}
if(this._formatter){
a.push(", formatter: ",this._formatter.toString());
}
return a.join("");
};
AjxMessageFormat.MessageSegment.prototype._index;
AjxMessageFormat.MessageSegment.prototype._type;
AjxMessageFormat.MessageSegment.prototype._style;
AjxMessageFormat.MessageSegment.prototype._isList=false;
AjxMessageFormat.MessageSegment.prototype._formatter;
AjxMessageFormat.MessageSegment.prototype.format=function(args){
var _41e=args[this._index];
if(this._formatter instanceof AjxChoiceFormat){
return this._formatter.format(args,this._index);
}
return this._formatter?this._formatter.format(_41e):String(_41e);
};
AjxMessageFormat.MessageSegment.prototype.getIndex=function(){
return this._index;
};
AjxMessageFormat.MessageSegment.prototype.getType=function(){
return this._type;
};
AjxMessageFormat.MessageSegment.prototype.getStyle=function(){
return this._style;
};
AjxMessageFormat.MessageSegment.prototype.getSegmentFormat=function(){
return this._formatter;
};
AjxMessageFormat.MessageSegment._split=function(s,_420){
var _421=[];
var head=0;
var tail;
var _424=0;
for(tail=0;tail<s.length;tail++){
var c=s.charAt(tail);
if(c=="{"){
_424++;
}else{
if(c=="}"){
_424--;
}else{
if(c==_420&&_424==0){
_421.push(s.substring(head,tail));
head=tail+1;
}
}
}
}
if(tail>head){
_421.push(s.substring(head,tail));
}
return _421;
};
function AjxNumberFormat(_426,_427){
AjxFormat.call(this,_426);
if(_426==""){
return;
}
var _428=_426.split(/;/);
var _426=_428[0];
var i=0;
var _42a=this.__parseStatic(_426,i);
i=_42a.offset;
var _42b=_42a.text!="";
if(_42b){
this._segments.push(new AjxFormat.TextSegment(this,_42a.text));
}
var _42c=i;
while(i<_426.length&&AjxNumberFormat._META_CHARS.indexOf(_426.charAt(i))!=-1){
i++;
}
var end=i;
var _42e=_426.substring(_42c,end);
var e=_42e.indexOf("E");
var _430=e!=-1?_42e.substring(e+1):null;
if(_430){
_42e=_42e.substring(0,e);
this._showExponent=true;
}
var dot=_42e.indexOf(".");
var _432=dot!=-1?_42e.substring(0,dot):_42e;
if(_432){
var _433=_432.lastIndexOf(",");
if(_433!=-1){
this._groupingOffset=_432.length-_433-1;
}
_432=_432.replace(/[^#0]/g,"");
var zero=_432.indexOf("0");
if(zero!=-1){
this._minIntDigits=_432.length-zero;
}
this._maxIntDigits=_432.length;
}
var _435=dot!=-1?_42e.substring(dot+1):null;
if(_435){
var zero=_435.lastIndexOf("0");
if(zero!=-1){
this._minFracDigits=zero+1;
}
this._maxFracDigits=_435.replace(/[^#0]/g,"").length;
}
this._segments.push(new AjxNumberFormat.NumberSegment(this,_42e));
var _42a=this.__parseStatic(_426,i);
i=_42a.offset;
if(_42a.text!=""){
this._segments.push(new AjxFormat.TextSegment(this,_42a.text));
}
if(_427){
return;
}
if(_428.length>1){
var _426=_428[1];
this._negativeFormatter=new AjxNumberFormat(_426,true);
}else{
var _436=new AjxNumberFormat("");
_436._segments=_436._segments.concat(this._segments);
var _437=_42b?1:0;
var _438=new AjxFormat.TextSegment(_436,I18nMsg.numberSignMinus);
_436._segments.splice(_437,0,_438);
this._negativeFormatter=_436;
}
}
AjxNumberFormat.prototype=new AjxFormat;
AjxNumberFormat.prototype.constructor=AjxNumberFormat;
AjxNumberFormat.prototype.toString=function(){
var _439=["[AjxNumberFormat: ","formatter=",AjxFormat.prototype.toString.call(this)];
if(this._negativeFormatter){
_439.push(", negativeFormatter=",this._negativeFormatter.toString());
}
_439.push("]");
return _439.join("");
};
AjxNumberFormat._NUMBER="number";
AjxNumberFormat._INTEGER="integer";
AjxNumberFormat._CURRENCY="currency";
AjxNumberFormat._PERCENT="percent";
AjxNumberFormat._META_CHARS="0#.,E";
AjxNumberFormat._FORMATTERS={};
AjxNumberFormat.prototype._groupingOffset=Number.MAX_VALUE;
AjxNumberFormat.prototype._maxIntDigits;
AjxNumberFormat.prototype._minIntDigits=1;
AjxNumberFormat.prototype._maxFracDigits;
AjxNumberFormat.prototype._minFracDigits;
AjxNumberFormat.prototype._isCurrency=false;
AjxNumberFormat.prototype._isPercent=false;
AjxNumberFormat.prototype._isPerMille=false;
AjxNumberFormat.prototype._showExponent=false;
AjxNumberFormat.prototype._negativeFormatter;
AjxNumberFormat.getInstance=function(){
if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._NUMBER]){
AjxNumberFormat._FORMATTERS[AjxNumberFormat._NUMBER]=new AjxNumberFormat(I18nMsg.formatNumber);
}
return AjxNumberFormat._FORMATTERS[AjxNumberFormat._NUMBER];
};
AjxNumberFormat.getNumberInstance=AjxNumberFormat.getInstance;
AjxNumberFormat.getCurrencyInstance=function(){
if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._CURRENCY]){
AjxNumberFormat._FORMATTERS[AjxNumberFormat._CURRENCY]=new AjxNumberFormat(I18nMsg.formatNumberCurrency);
}
return AjxNumberFormat._FORMATTERS[AjxNumberFormat._CURRENCY];
};
AjxNumberFormat.getIntegerInstance=function(){
if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._INTEGER]){
AjxNumberFormat._FORMATTERS[AjxNumberFormat._INTEGER]=new AjxNumberFormat(I18nMsg.formatNumberInteger);
}
return AjxNumberFormat._FORMATTERS[AjxNumberFormat._INTEGER];
};
AjxNumberFormat.getPercentInstance=function(){
if(!AjxNumberFormat._FORMATTERS[AjxNumberFormat._PERCENT]){
AjxNumberFormat._FORMATTERS[AjxNumberFormat._PERCENT]=new AjxNumberFormat(I18nMsg.formatNumberPercent);
}
return AjxNumberFormat._FORMATTERS[AjxNumberFormat._PERCENT];
};
AjxNumberFormat.format=function(_43a,_43b){
return new AjxNumberFormat(_43a).format(_43b);
};
AjxNumberFormat.prototype.format=function(_43c){
if(_43c<0&&this._negativeFormatter){
return this._negativeFormatter.format(_43c);
}
return AjxFormat.prototype.format.call(this,_43c);
};
AjxNumberFormat.prototype.__parseStatic=function(s,i){
var data=[];
while(i<s.length){
var c=s.charAt(i++);
if(AjxNumberFormat._META_CHARS.indexOf(c)!=-1){
i--;
break;
}
switch(c){
case "'":
var _441=i;
while(i<s.length&&s.charAt(i++)!="'"){
}
var end=i;
c=end-_441==0?"'":s.substring(_441,end);
break;
case "%":
c=I18nMsg.numberSignPercent;
this._isPercent=true;
break;
case "\u2030":
c=I18nMsg.numberSignPerMill;
this._isPerMille=true;
break;
case "\xa4":
c=s.charAt(i)=="\xa4"?I18nMsg.currencyCode:I18nMsg.currencySymbol;
this._isCurrency=true;
break;
}
data.push(c);
}
return {text:data.join(""),offset:i};
};
AjxNumberFormat.NumberSegment=function(_443,s){
AjxFormat.Segment.call(this,_443,s);
};
AjxNumberFormat.NumberSegment.prototype=new AjxFormat.Segment;
AjxNumberFormat.NumberSegment.prototype.constructor=AjxNumberFormat.NumberSegment;
AjxNumberFormat.NumberSegment.prototype.toString=function(){
return "number: \""+this._s+"\"";
};
AjxNumberFormat.NumberSegment.prototype.format=function(_445){
if(isNaN(_445)){
return I18nMsg.numberNaN;
}
if(_445===Number.NEGATIVE_INFINITY||_445===Number.POSITIVE_INFINITY){
return I18nMsg.numberInfinity;
}
if(typeof _445!="number"){
_445=Number(_445);
}
_445=Math.abs(_445);
if(this._parent._isPercent){
_445*=100;
}else{
if(this._parent._isPerMille){
_445*=1000;
}
}
var s=this._parent._showExponent?_445.toExponential(this._parent._maxFracDigits).toUpperCase().replace(/E\+/,"E"):_445.toFixed(this._parent._maxFracDigits||0);
s=this._normalize(s);
return s;
};
AjxNumberFormat.NumberSegment.prototype._normalize=function(s){
var _448=s.split(/([\.Ee])/);
var _449=_448.shift();
if(_449.length<this._parent._minIntDigits){
_449=AjxFormat._zeroPad(_449,this._parent._minIntDigits,I18nMsg.numberZero);
}
if(_449.length>this._parent._groupingOffset){
var a=[];
var i=_449.length-this._parent._groupingOffset;
while(i>0){
a.unshift(_449.substr(i,this._parent._groupingOffset));
a.unshift(I18nMsg.numberSeparatorGrouping);
i-=this._parent._groupingOffset;
}
a.unshift(_449.substring(0,i+this._parent._groupingOffset));
_449=a.join("");
}
var _44c="0";
var _44d;
while(_448.length>0){
switch(_448.shift()){
case ".":
_44c=_448.shift();
break;
case "E":
case "e":
_44d=_448.shift();
break;
default:
}
}
_44c=_44c.replace(/0+$/,"");
if(_44c.length<this._parent._minFracDigits){
_44c=AjxFormat._zeroPad(_44c,this._parent._minFracDigits,I18nMsg.numberZero,true);
}
var a=[_449];
if(_44c.length>0){
var _44e=this._parent._isCurrency?I18nMsg.numberSeparatorMoneyDecimal:I18nMsg.numberSeparatorDecimal;
a.push(_44e,_44c);
}
if(_44d){
a.push("E",_44d.replace(/^\+/,""));
}
return a.join("");
};
function AjxChoiceFormat(_44f){
AjxFormat.call(this,_44f);
var _450=_44f.split("|");
if(arguments.length==1){
this._limits=new Array(_450.length);
this._lessThan=new Array(_450.length);
this._formats=new Array(_450.length);
var _451=new RegExp("^([^#<\u2264]+)([#<\u2264])(.*)$");
for(var i=0;i<_450.length;i++){
var _453=_450[i];
var _454=_451.exec(_453);
var _455=_454[1];
var _456=_454[2];
var _457=_454[3];
if(_455=="\u221e"){
this._limits[i]=Number.POSITIVE_INFINITY;
}else{
if(_455=="-\u221e"){
this._limits[i]=Number.NEGATIVE_INFINITY;
}else{
this._limits[i]=parseFloat(_455);
}
}
this._lessThan[i]=_456=="#"||_456=="\u2264";
this._formats[i]=new AjxMessageFormat(_457);
}
}else{
this._limits=arguments[0];
this._lessThan=new Array(arguments[0].length);
this._formats=arguments[1];
this._pattern=[];
for(var i=0;i<this._formats.length;i++){
if(i>0){
this._pattern.push("|");
}
this._pattern.push(this._limits[i],"#",this._formats[i]);
this._lessThan[i]=false;
this._formats[i]=new AjxMessageFormat(this._formats[i]);
}
this._pattern=this._pattern.join("");
}
}
AjxChoiceFormat.prototype=new AjxFormat;
AjxChoiceFormat.prototype.constructor=AjxChoiceFormat;
AjxChoiceFormat.prototype.toString=function(){
return ["[AjxChoiceFormat: ","limits={ ",this._limits.join(", ")," }, ","formats={ ",this._formats.join(", ")," }, ","lessThan={ ",this._lessThan.join(", ")," }]"].join("");
};
AjxChoiceFormat.prototype._limits;
AjxChoiceFormat.prototype._lessThan;
AjxChoiceFormat.prototype._formats;
AjxChoiceFormat.prototype.getLimits=function(){
return this._limits;
};
AjxChoiceFormat.prototype.getFormats=function(){
return this._formats;
};
AjxChoiceFormat.prototype.format=function(_458,_459){
var num=_458 instanceof Array?_458[_459]:_458;
var _45b;
if(isNaN(num)||num<this._limits[0]){
_45b=this._formats[0];
}else{
for(var i=0;i<this._limits.length-1;i++){
var a=this._limits[i];
var b=this._limits[i+1];
var aGEb=num>=a;
var aLTb=this._lessThan[i+1]?num<b:num<=b;
if(aGEb&&aLTb){
_45b=this._formats[i];
break;
}
}
if(!_45b){
_45b=this._formats[this._formats.length-1];
}
}
return _45b.format(_458);
};
function AjxListFormat(_461,_462,_463){
AjxFormat.call(this,_461?_461.toPattern():"");
this._formatter=_461;
this._separator=_462||AjxMsg.listSeparator;
this._lastSeparator=_463||AjxMsg.listSeparatorLast;
}
AjxListFormat.prototype=new AjxFormat;
AjxListFormat.prototype.constructor=AjxListFormat;
AjxListFormat.prototype._formatter;
AjxListFormat.prototype._separator;
AjxListFormat.prototype._lastSeparator;
AjxListFormat.prototype.format=function(_464){
_464=_464 instanceof Array?_464:[_464];
var list=[];
for(var i=0;i<_464.length;i++){
if(i>0){
list.push(i<_464.length-1?this._separator:this._lastSeparator);
}
var item=_464[i];
list.push(this._formatter?this._formatter.format(item):String(item));
}
return list.join("");
};
function AjxDateUtil(){
}
AjxDateUtil.YEAR=1;
AjxDateUtil.MONTH=2;
AjxDateUtil.WEEK=3;
AjxDateUtil.DAY=4;
AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES=900000;
AjxDateUtil.MSEC_PER_HALF_HOUR=1800000;
AjxDateUtil.MSEC_PER_HOUR=3600000;
AjxDateUtil.MSEC_PER_DAY=24*AjxDateUtil.MSEC_PER_HOUR;
AjxDateUtil.WEEKDAY_SHORT=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
AjxDateUtil.WEEKDAY_MEDIUM=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
AjxDateUtil.WEEKDAY_LONG=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
AjxDateUtil.MONTH_SHORT=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
AjxDateUtil.MONTH_MEDIUM=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
AjxDateUtil.MONTH_LONG=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
AjxDateUtil.FREQ_TO_DISPLAY={SEC:[AjxMsg.second,AjxMsg.seconds],MIN:[AjxMsg.minute,AjxMsg.minutes],HOU:[AjxMsg.hour,AjxMsg.hours],DAI:[AjxMsg.day,AjxMsg.days],WEE:[AjxMsg.week,AjxMsg.weeks],MON:[AjxMsg.month,AjxMsg.months],YEA:[AjxMsg.year,AjxMsg.years]};
AjxDateUtil._daysPerMonth={0:31,1:29,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31};
AjxDateUtil._init=function(){
AjxDateUtil._dateFormat=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT).clone();
var _468=AjxDateUtil._dateFormat.getSegments();
for(var i=0;i<_468.length;i++){
if(_468[i] instanceof AjxDateFormat.YearSegment){
_468[i]=new AjxDateFormat.YearSegment(AjxDateUtil._dateFormat,"yyyy");
}
}
AjxDateUtil._dateTimeFormat=new AjxDateFormat(AjxDateUtil._dateFormat.toPattern()+" "+AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT));
AjxDateUtil._dateFormatNoYear=new AjxDateFormat(AjxMsg.formatDateMediumNoYear);
};
AjxDateUtil._init();
AjxDateUtil.validDate=function(y,m,d){
var date=new Date(y,m,d);
var year=y>999?date.getFullYear():date.getYear();
return date.getMonth()==m&&date.getDate()==d&&year==y;
};
AjxDateUtil.daysInMonth=function(y,m){
var date=new Date(y,m,1,12);
date.setMonth(date.getMonth()+1);
date.setDate(date.getDate()-1);
return date.getDate();
};
AjxDateUtil.isLeapYear=function(y){
return (new Date(y,1,29)).getMonth()==1;
};
AjxDateUtil.isLocale24Hour=function(){
var _473=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
var len=_473._segments.length;
for(var j=0;j<len;j++){
if(_473._segments[j]._s=="a"){
return false;
}
}
return true;
};
AjxDateUtil.roll=function(date,_477,_478){
var d=date.getDate();
if(_477==AjxDateUtil.MONTH){
date.setDate(1);
date.setMonth(date.getMonth()+_478);
var max=AjxDateUtil.daysInMonth(date.getFullYear(),date.getMonth());
date.setDate(Math.min(d,max));
}else{
if(_477==AjxDateUtil.YEAR){
date.setDate(1);
date.setFullYear(date.getFullYear()+_478);
var max=AjxDateUtil.daysInMonth(date.getFullYear(),date.getMonth());
date.setDate(Math.min(d,max));
}else{
if(_477==AjxDateUtil.WEEK){
date.setDate(date.getDate()+7*_478);
}else{
if(_477==AjxDateUtil.DAY){
date.setDate(date.getDate()+_478);
}else{
return date;
}
}
}
}
return date;
};
AjxDateUtil.computeDateDelta=function(_47b){
var _47c=(new Date()).getTime()-_47b;
if(_47c<0){
return null;
}
var _47d=Math.floor(_47c/(AjxDateUtil.MSEC_PER_DAY*365));
if(_47d!=0){
_47c-=_47d*AjxDateUtil.MSEC_PER_DAY*365;
}
var _47e=Math.floor(_47c/(AjxDateUtil.MSEC_PER_DAY*30.42));
if(_47e>0){
_47c-=Math.floor(_47e*AjxDateUtil.MSEC_PER_DAY*30.42);
}
var days=Math.floor(_47c/AjxDateUtil.MSEC_PER_DAY);
if(days>0){
_47c-=days*AjxDateUtil.MSEC_PER_DAY;
}
var _480=Math.floor(_47c/AjxDateUtil.MSEC_PER_HOUR);
if(_480>0){
_47c-=_480*AjxDateUtil.MSEC_PER_HOUR;
}
var mins=Math.floor(_47c/60000);
if(mins>0){
_47c-=mins*60000;
}
var secs=Math.floor(_47c/1000);
var _483="";
if(_47d>0){
_483=_47d+" ";
_483+=(_47d>1)?AjxMsg.years:AjxMsg.year;
if(_47d<=3&&_47e>0){
_483+=" "+_47e;
_483+=" "+((_47e>1)?AjxMsg.months:AjxMsg.months);
}
}else{
if(_47e>0){
_483=_47e+" ";
_483+=(_47e>1)?AjxMsg.months:AjxMsg.month;
if(_47e<=3&&days>0){
_483+=" "+days;
_483+=" "+((days>1)?AjxMsg.days:AjxMsg.day);
}
}else{
if(days>0){
_483=days+" ";
_483+=(days>1)?AjxMsg.days:AjxMsg.day;
if(days<=2&&_480>0){
_483+=" "+_480;
_483+=" "+((_480>1)?AjxMsg.hours:AjxMsg.hour);
}
}else{
if(_480>0){
_483=_480+" ";
_483+=(_480>1)?AjxMsg.hours:AjxMsg.hour;
if(_480<5&&mins>0){
_483+=" "+mins;
_483+=" "+((mins>1)?AjxMsg.minutes:AjxMsg.minute);
}
}else{
if(mins>0){
_483=mins+" ";
_483+=((mins>1)?AjxMsg.minutes:AjxMsg.minute);
if(mins<5&&secs>0){
_483+=" "+secs;
_483+=" "+((secs>1)?AjxMsg.seconds:AjxMsg.second);
}
}else{
_483=secs;
_483+=" "+((secs>1)?AjxMsg.seconds:AjxMsg.second);
}
}
}
}
}
_483+=" "+AjxMsg.ago;
return _483;
};
AjxDateUtil.simpleComputeDateStr=function(date,_485){
var _486=AjxDateUtil._dateFormat.format(date);
return _485?_485+_486:_486;
};
AjxDateUtil.simpleParseDateStr=function(_487){
return AjxDateUtil._dateFormat.parse(_487);
};
AjxDateUtil.simpleComputeDateTimeStr=function(date,_489){
var _48a=AjxDateUtil._dateTimeFormat.format(date);
return _489?_489+_48a:_48a;
};
AjxDateUtil.simpleParseDateTimeStr=function(_48b){
return AjxDateUtil._dateTimeFormat.parse(_48b);
};
AjxDateUtil.longComputeDateStr=function(date){
var _48d=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
return _48d.format(date);
};
AjxDateUtil.computeDateStr=function(now,_48f){
if(_48f==null){
return "";
}
var date=new Date(_48f);
if(now.getTime()-_48f<AjxDateUtil.MSEC_PER_DAY&&now.getDay()==date.getDay()){
return AjxDateUtil.computeTimeString(date);
}
if(now.getFullYear()==date.getFullYear()){
return AjxDateUtil._dateFormatNoYear.format(date);
}
return AjxDateUtil.simpleComputeDateStr(date);
};
AjxDateUtil.computeTimeString=function(date){
var _492=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
return _492.format(date);
};
AjxDateUtil.computeDateTimeString=function(date){
var _494=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG);
return _494.format(date);
};
AjxDateUtil._getHoursStr=function(date,pad,_497){
var _498=date.getHours();
if(!_497){
_498%=12;
if(_498==0){
_498=12;
}
}
return pad?AjxDateUtil._pad(_498):_498;
};
AjxDateUtil._getMinutesStr=function(date){
return AjxDateUtil._pad(date.getMinutes());
};
AjxDateUtil._getSecondsStr=function(date){
return AjxDateUtil._pad(date.getSeconds());
};
AjxDateUtil._getAMPM=function(date,_49c){
var _49d=date.getHours();
return (_49d<12)?(_49c?"AM":"am"):(_49c?"PM":"pm");
};
AjxDateUtil._getMonthName=function(date,_49f){
return _49f?AjxDateUtil.MONTH_MEDIUM[date.getMonth()]:AjxDateUtil.MONTH_LONG[date.getMonth()];
};
AjxDateUtil._getMonth=function(date,pad){
var _4a2=date.getMonth()+1;
if(pad){
return AjxDateUtil._pad(_4a2);
}else{
return _4a2;
}
};
AjxDateUtil._getDate=function(date,pad){
var _4a5=date.getDate();
return pad?AjxDateUtil._pad(_4a5):_4a5;
};
AjxDateUtil._getWeekday=function(date){
var _4a7=date.getDay();
return AjxDateUtil.WEEKDAY_LONG[_4a7];
};
AjxDateUtil._getFullYear=function(date){
return date.getFullYear();
};
AjxDateUtil.getTimeStr=function(date,_4aa){
var s=_4aa;
s=s.replace(/%d/g,AjxDateUtil._getDate(date,true));
s=s.replace(/%D/g,AjxDateUtil._getDate(date,false));
s=s.replace(/%w/g,AjxDateUtil._getWeekday(date));
s=s.replace(/%M/g,AjxDateUtil._getMonthName(date));
s=s.replace(/%t/g,AjxDateUtil._getMonthName(date,true));
s=s.replace(/%n/g,AjxDateUtil._getMonth(date,true));
s=s.replace(/%Y/g,AjxDateUtil._getFullYear(date));
s=s.replace(/%h/g,AjxDateUtil._getHoursStr(date,false,false));
s=s.replace(/%H/g,AjxDateUtil._getHoursStr(date,true,false));
s=s.replace(/%m/g,AjxDateUtil._getMinutesStr(date));
s=s.replace(/%s/g,AjxDateUtil._getSecondsStr(date));
s=s.replace(/%P/g,AjxDateUtil._getAMPM(date,true));
s=s.replace(/%p/g,AjxDateUtil._getAMPM(date,false));
return s;
};
AjxDateUtil.getRoundedMins=function(date,_4ad){
var mins=date.getMinutes();
if(mins!=0&&_4ad){
mins=(Math.ceil((mins/_4ad)))*_4ad;
}
return mins;
};
AjxDateUtil.roundTimeMins=function(date,_4b0){
var mins=date.getMinutes();
var _4b2=date.getHours();
if(mins!=0&&_4b0){
mins=(Math.ceil((mins/_4b0)))*_4b0;
if(mins==60){
mins=0;
_4b2++;
}
date.setMinutes(mins);
date.setHours(_4b2);
}
return date;
};
AjxDateUtil.isInRange=function(_4b3,_4b4,_4b5,_4b6){
return (_4b3<_4b6&&_4b4>_4b5);
};
AjxDateUtil.getSimpleDateFormat=function(){
return AjxDateUtil._dateFormat;
};
AjxDateUtil.getServerDate=function(date){
if(!AjxDateUtil._serverDateFormatter){
AjxDateUtil._serverDateFormatter=new AjxDateFormat("yyyyMMdd");
}
return AjxDateUtil._serverDateFormatter.format(date);
};
AjxDateUtil.getServerDateTime=function(date,_4b9){
var _4ba=date;
var _4bb=null;
if(_4b9){
if(!AjxDateUtil._serverDateTimeFormatterUTC){
AjxDateUtil._serverDateTimeFormatterUTC=new AjxDateFormat("yyyyMMdd'T'HHmmss'Z'");
}
_4bb=AjxDateUtil._serverDateTimeFormatterUTC;
_4ba=new Date(date.getTime());
_4ba.setMinutes(_4ba.getMinutes()+_4ba.getTimezoneOffset());
}else{
if(!AjxDateUtil._serverDateTimeFormatter){
AjxDateUtil._serverDateTimeFormatter=new AjxDateFormat("yyyyMMdd'T'HHmmss");
}
_4bb=AjxDateUtil._serverDateTimeFormatter;
}
return _4bb.format(_4ba);
};
AjxDateUtil.parseServerTime=function(_4bc,date){
if(_4bc.charAt(8)=="T"){
var hh=parseInt(_4bc.substr(9,2),10);
var mm=parseInt(_4bc.substr(11,2),10);
var ss=parseInt(_4bc.substr(13,2),10);
if(_4bc.charAt(15)=="Z"){
mm+=AjxTimezone.getOffset(AjxTimezone.DEFAULT,date);
}
date.setHours(hh,mm,ss,0);
}
return date;
};
AjxDateUtil.parseServerDateTime=function(_4c1){
if(_4c1==null){
return null;
}
var d=new Date();
var yyyy=parseInt(_4c1.substr(0,4),10);
var MM=parseInt(_4c1.substr(4,2),10);
var dd=parseInt(_4c1.substr(6,2),10);
d.setFullYear(yyyy);
d.setMonth(MM-1);
d.setMonth(MM-1);
d.setDate(dd);
AjxDateUtil.parseServerTime(_4c1,d);
return d;
};
AjxDateUtil._pad=function(n){
return n<10?("0"+n):n;
};
AjxSelectionManager=function(_4c7){
this._owner=_4c7;
};
AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS=0;
AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS=1;
AjxSelectionManager.SELECT_TO_ANCHOR=2;
AjxSelectionManager.DESELECT_ALL=3;
AjxSelectionManager.SELECT_ALL=4;
AjxSelectionManager.prototype.getItems=function(){
if(this._selectedItems==null){
this._selectedItems=this._createItemsCollection();
}
return this._selectedItems;
};
AjxSelectionManager.prototype.getLength=function(){
return this.getItems().length;
};
AjxSelectionManager.prototype.getAnchor=function(){
if(this._anchor==null){
var _4c8=this.getItems();
if(_4c8.length>0){
this._anchor=_4c8[0];
}
}
return this._anchor;
};
AjxSelectionManager.prototype.getCursor=function(){
if(this._cursor==null){
this._cursor=this.getAnchor();
}
return this._cursor;
};
AjxSelectionManager.prototype.isSelected=function(item){
return this.getItems().binarySearch(item)!=-1;
};
AjxSelectionManager.prototype.selectOneItem=function(item){
this.select(item,AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS);
};
AjxSelectionManager.prototype.toggleItem=function(item){
this.select(item,AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS);
};
AjxSelectionManager.prototype.selectFromAnchorToItem=function(item){
this.select(item,AjxSelectionManager.SELECT_TO_ANCHOR);
};
AjxSelectionManager.prototype.deselectAll=function(){
this.select(null,AjxSelectionManager.DESELECT_ALL);
};
AjxSelectionManager.prototype.selectAll=function(){
this.select(null,AjxSelectionManager.SELECT_ALL);
};
AjxSelectionManager.prototype.select=function(item,_4ce){
this._setAnchorAndCursor(item,_4ce);
var _4cf=this._selectedItems;
var _4d0=(_4cf==null)?0:_4cf.length;
this._selectedItems=null;
this._selectedItems=this._createItemsCollection();
var _4d1=this._owner.getItemCount();
var _4d2=false;
var _4d3=false;
var _4d4=false;
for(var i=0;i<_4d1;++i){
var _4d6=this._owner.getItem(i);
var _4d7=this._isItemOldSelection(_4d6,_4cf);
var _4d8=_4d7;
switch(_4ce){
case AjxSelectionManager.SELECT_TO_ANCHOR:
if(this._anchor==null){
this._anchor=_4d6;
}
var _4d9=(_4d6==this._anchor||_4d6==item);
var _4da=false;
if(!_4d4&&_4d9){
_4d4=true;
_4da=true;
}
_4d8=_4d4;
if((!_4da||this._anchor==item)&&_4d4&&_4d9){
_4d4=false;
}
break;
case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:
_4d8=(_4d6==item);
break;
case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:
if(_4d6==item){
_4d8=!_4d7;
}
break;
case AjxSelectionManager.DESELECT_ALL:
_4d8=false;
break;
case AjxSelectionManager.SELECT_ALL:
_4d8=true;
break;
}
if(_4d8){
this._selectedItems.add(_4d6);
_4d2=(this._selectedItems.length>1);
}
if(_4d8!=_4d7){
if(this._owner.itemSelectionChanged!=null){
this._owner.itemSelectionChanged(_4d6,i,_4d8);
}
_4d3=true;
}
}
_4d3=_4d3||(_4d0!=this._selectedItems.length);
if(_4d2){
this._selectedItems.sort();
}
if(_4d3&&this._owner.selectionChanged!=null){
this._owner.selectionChanged(item);
}
};
AjxSelectionManager.prototype.removeItem=function(item){
if(this._selectedItems){
var _4dc=this._selectedItems.binarySearch(item);
if(_4dc>-1){
this._selectedItems.removeAt(_4dc);
}
}
};
AjxSelectionManager.prototype._createItemsCollection=function(){
return new AjxVector();
};
AjxSelectionManager.prototype._isItemOldSelection=function(_4dd,_4de){
var ret=false;
if(_4de){
var _4e0=_4de.binarySearch(_4dd);
if(_4e0>-1){
_4de.removeAt(_4e0);
}
ret=(_4e0!=-1);
}
return ret;
};
AjxSelectionManager.prototype._setAnchorAndCursor=function(item,_4e2){
switch(_4e2){
case AjxSelectionManager.SELECT_TO_ANCHOR:
this._cursor=item;
break;
case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:
this._anchor=item;
this._cursor=item;
break;
case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:
this._anchor=item;
this._cursor=item;
break;
case AjxSelectionManager.DESELECT_ALL:
this._anchor=null;
this._cursor=null;
break;
case AjxSelectionManager.SELECT_ALL:
return;
}
};
function AjxPost(_4e3){
this._callback=null;
this._iframeId=_4e3;
}
AjxPost._reqIds=0;
AjxPost._outStandingRequests=new Object();
AjxPost.SC_CONTINUE=100;
AjxPost.SC_OK=200;
AjxPost.SC_ACCEPTED=202;
AjxPost.SC_NO_CONTENT=204;
AjxPost.SC_BAD_REQUEST=400;
AjxPost.SC_UNAUTHORIZED=401;
AjxPost.SC_REQUEST_TIMEOUT=408;
AjxPost.SC_CONFLICT=409;
AjxPost.SC_REQUEST_ENTITY_TOO_LARGE=413;
AjxPost.SC_INTERNAL_SERVER_ERROR=500;
AjxPost.SC_BAD_GATEWAY=502;
AjxPost.SC_SERVICE_UNAVAILABLE=503;
AjxPost.prototype.execute=function(_4e4,form,_4e6){
var tags=form.getElementsByTagName("input");
var _4e8=new Array();
for(var i=0;i<tags.length;i++){
if(tags[i].type=="file"){
_4e8.push(tags[i]);
}
}
for(var i=0;i<_4e8.length;i++){
var _4ea=document.createElement("input");
_4ea.type="hidden";
_4ea.name="filename"+(i+1);
_4ea.value=_4e8[i].value;
_4e8[i].parentNode.insertBefore(_4ea,_4e8[i]);
}
form.target=this._iframeId;
this._callback=_4e4;
var req=new AjxPostRequest(form);
var _4ec=new AjxTimedAction(this,this._onFailure,[req.id]);
var _4ed=_4e6?_4e6:5000;
AjxPost._outStandingRequests[req.id]=req;
try{
req.send(_4ec,_4ed);
}
catch(ex){
if(AjxEnv.isIE){
if(ex.number==-2147024891){
throw new AjxException(ZmMsg.uploadErrorAccessDenied,ex.number);
}
}
throw ex;
}
};
AjxPost.prototype._onFailure=function(_4ee){
var req=AjxPost._outStandingRequests[_4ee];
req.cancel();
delete AjxPost._outStandingRequests[_4ee];
if(this._callback){
this._callback.run([404]);
this._callback=null;
}
};
AjxPost.prototype.loaded=function(_4f0,_4f1,id){
var req=AjxPost._outStandingRequests[_4f1];
if(req&&!req.hasBeenCancelled()){
req.cancelTimeout();
}
delete AjxPost._outStandingRequests[_4f1];
if(this._callback){
this._callback.run(_4f0,id);
this._callback=null;
}
};
function AjxPostRequest(form){
this.id=AjxPost._reqIds++;
this._cancelled=false;
this._form=form;
var inp=form.elements.namedItem("requestId");
if(!inp){
inp=form.ownerDocument.createElement("input");
inp.type="hidden";
inp.name="requestId";
}
inp.value=this.id;
form.appendChild(inp);
}
AjxPostRequest.prototype.send=function(_4f6,_4f7){
this._form.submit();
};
AjxPostRequest.prototype.hasBeenCancelled=function(){
return this._cancelled;
};
AjxPostRequest.prototype.cancelTimeout=function(){
AjxTimedAction.cancelAction(this._timeoutId);
};
AjxPostRequest.prototype.cancel=function(){
this._cancelled=true;
};
function AjxBuffer(){
this.clear();
if(arguments.length>0){
arguments.join=this.buffer.join;
this.buffer[this.buffer.length]=arguments.join("");
}
}
AjxBuffer.prototype.toString=function(){
return this.buffer.join("");
};
AjxBuffer.prototype.join=function(_4f8){
if(_4f8==null){
_4f8="";
}
return this.buffer.join(_4f8);
};
AjxBuffer.prototype.append=function(){
arguments.join=this.buffer.join;
this.buffer[this.buffer.length]=arguments.join("");
};
AjxBuffer.prototype.join=function(str){
return this.buffer.join(str);
};
AjxBuffer.prototype.set=function(str){
this.buffer=[str];
};
AjxBuffer.prototype.clear=function(){
this.buffer=[];
};
AjxBuffer.concat=function(){
arguments.join=Array.prototype.join;
return arguments.join("");
};
AjxBuffer.append=AjxBuffer.concat;
function AjxCache(){
this._cache=new Object();
}
AjxCache.prototype.set=function(key,_4fc){
this._cache[key]=_4fc;
};
AjxCache.prototype.get=function(key){
return this._cache[key];
};
AjxCache.prototype.getByProperty=function(prop,_4ff){
var list=new Array();
for(var key in this._cache){
var obj=this._cache[key];
if(obj instanceof Object&&obj[prop]==_4ff){
list.push(obj);
}
}
return list;
};
AjxCache.prototype.clearAll=function(){
for(var key in this._cache){
this._cache[key]=null;
}
this._cache=new Object();
};
AjxCache.prototype.clear=function(key){
this._cache[key]=null;
};
AjxCache.prototype.clearByProperty=function(prop,_506){
for(var key in this._cache){
var obj=this._cache[key];
if(obj[prop]==_506){
this._cache[key]=null;
}
}
};
function AjxTimezoneData(){
}
AjxTimezoneData.TRANSITION_YEAR=2008;
AjxTimezoneData.TIMEZONE_RULES=[{serverId:"(GMT-12.00) International Date Line West",clientId:"Etc/GMT+12",standard:{offset:-720}},{serverId:"(GMT-11.00) Midway Island / Samoa",clientId:"Pacific/Midway",standard:{offset:-660}},{serverId:"(GMT-10.00) Hawaii",clientId:"Pacific/Honolulu",standard:{offset:-600}},{serverId:"(GMT-09.00) Alaska",clientId:"America/Anchorage",standard:{offset:-540,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,11,2]},daylight:{offset:-480,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-08.00) Pacific Time (US & Canada)",clientId:"America/Los_Angeles",standard:{offset:-480,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,11,2]},daylight:{offset:-420,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-08.00) Tijuana / Baja California",clientId:"America/Tijuana",standard:{offset:-480,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:-420,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT-07.00) Arizona",clientId:"America/Phoenix",standard:{offset:-420}},{serverId:"(GMT-07.00) Chihuahua / La Paz / Mazatlan - New",clientId:"America/Chihuahua",standard:{offset:-420,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:-360,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT-07.00) Chihuahua / La Paz / Mazatlan - Old",clientId:"America/Chihuahua",standard:{offset:-420,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:-360,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT-07.00) Mountain Time (US & Canada)",clientId:"America/Denver",standard:{offset:-420,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,11,2]},daylight:{offset:-360,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-06.00) Central America",clientId:"America/Guatemala",standard:{offset:-360}},{serverId:"(GMT-06.00) Central Time (US & Canada)",clientId:"America/Chicago",standard:{offset:-360,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,11,2]},daylight:{offset:-300,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-06.00) Guadalajara / Mexico City / Monterrey - New",clientId:"America/Mexico_City",standard:{offset:-360,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:-300,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT-06.00) Guadalajara / Mexico City / Monterrey - Old",clientId:"America/Mexico_City",standard:{offset:-360,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:-300,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT-06.00) Saskatchewan",clientId:"America/Guatemala",standard:{offset:-360}},{serverId:"(GMT-05.00) Bogota / Lima / Quito / Rio Branco",clientId:"America/Bogota",standard:{offset:-300}},{serverId:"(GMT-05.00) Eastern Time (US & Canada)",clientId:"America/New_York",standard:{offset:-300,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,11,2]},daylight:{offset:-240,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-05.00) Indiana (East)",clientId:"America/Jamaica",standard:{offset:-300}},{serverId:"(GMT-04.00) Atlantic Time (Canada)",clientId:"America/Glace_Bay",standard:{offset:-240,mon:11,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,11,2]},daylight:{offset:-180,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-04.00) Caracas / La Paz",clientId:"America/Caracas",standard:{offset:-240}},{serverId:"(GMT-04.00) Manaus",clientId:"America/Manaus",standard:{offset:-240,mon:2,week:-1,wkday:1,hour:0,min:0,sec:0,trans:[2008,2,24]},daylight:{offset:-180,mon:11,week:1,wkday:1,hour:0,min:0,sec:0,trans:[2008,11,2]}},{serverId:"(GMT-04.00) Santiago",clientId:"America/Santiago",standard:{offset:-240,mon:3,week:2,wkday:7,hour:23,min:59,sec:59,trans:[2008,3,8]},daylight:{offset:-180,mon:10,week:2,wkday:7,hour:23,min:59,sec:59,trans:[2008,10,11]}},{serverId:"(GMT-03.30) Newfoundland",clientId:"America/St_Johns",standard:{offset:-210,mon:11,week:1,wkday:1,hour:0,min:1,sec:0,trans:[2008,11,2]},daylight:{offset:-150,mon:3,week:2,wkday:1,hour:0,min:1,sec:0,trans:[2008,3,9]}},{serverId:"(GMT-03.00) Brasilia",clientId:"America/Sao_Paulo",standard:{offset:-180,mon:2,week:-1,wkday:1,hour:0,min:0,sec:0,trans:[2008,2,24]},daylight:{offset:-120,mon:11,week:1,wkday:1,hour:0,min:0,sec:0,trans:[2008,11,2]}},{serverId:"(GMT-03.00) Buenos Aires / Georgetown",clientId:"America/Argentina/Buenos_Aires",standard:{offset:-180}},{serverId:"(GMT-03.00) Greenland",clientId:"America/Godthab",standard:{offset:-180,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:-120,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT-03.00) Montevideo",clientId:"America/Montevideo",standard:{offset:-180,mon:3,week:2,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,9]},daylight:{offset:-120,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,5]}},{serverId:"(GMT-02.00) Mid-Atlantic",clientId:"Atlantic/South_Georgia",standard:{offset:-120,mon:9,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,9,28]},daylight:{offset:-60,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT-01.00) Azores",clientId:"Atlantic/Azores",standard:{offset:-60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:0,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT-01.00) Cape Verde Is.",clientId:"Atlantic/Cape_Verde",standard:{offset:-60}},{serverId:"(GMT) Casablanca / Monrovia / Reykjavik",clientId:"Africa/Casablanca",standard:{offset:0}},{serverId:"(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon / London",clientId:"Europe/London",standard:{offset:0,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:60,mon:3,week:-1,wkday:1,hour:1,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+01.00) Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna",clientId:"Europe/Berlin",standard:{offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+01.00) Belgrade / Bratislava / Budapest / Ljubljana / Prague",clientId:"Europe/Belgrade",standard:{offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+01.00) Brussels / Copenhagen / Madrid / Paris",clientId:"Europe/Brussels",standard:{offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+01.00) Sarajevo / Skopje / Warsaw / Zagreb",clientId:"Europe/Warsaw",standard:{offset:60,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:120,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+01.00) West Central Africa",clientId:"Africa/Algiers",standard:{offset:60}},{serverId:"(GMT+02.00) Amman",clientId:"Asia/Amman",standard:{offset:120,mon:9,week:-1,wkday:6,hour:1,min:0,sec:0,trans:[2008,9,26]},daylight:{offset:180,mon:3,week:-1,wkday:5,hour:0,min:0,sec:0,trans:[2008,3,27]}},{serverId:"(GMT+02.00) Athens / Bucharest / Istanbul",clientId:"Europe/Athens",standard:{offset:120,mon:10,week:-1,wkday:1,hour:4,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:180,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+02.00) Beirut",clientId:"Asia/Beirut",standard:{offset:120,mon:10,week:-1,wkday:7,hour:23,min:59,sec:59,trans:[2008,10,25]},daylight:{offset:180,mon:3,week:-1,wkday:1,hour:0,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+02.00) Cairo",clientId:"Africa/Cairo",standard:{offset:120,mon:9,week:-1,wkday:5,hour:23,min:59,sec:59,trans:[2008,9,25]},daylight:{offset:180,mon:4,week:-1,wkday:5,hour:23,min:59,sec:59,trans:[2008,4,24]}},{serverId:"(GMT+02.00) Harare / Pretoria",clientId:"Africa/Harare",standard:{offset:120}},{serverId:"(GMT+02.00) Helsinki / Kyiv / Riga / Sofia / Tallinn / Vilnius",clientId:"Europe/Helsinki",standard:{offset:120,mon:10,week:-1,wkday:1,hour:4,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:180,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+02.00) Jerusalem",clientId:"Asia/Jerusalem",standard:{offset:120,mon:9,week:3,wkday:1,hour:2,min:0,sec:0,trans:[2008,9,21]},daylight:{offset:180,mon:3,week:-1,wkday:6,hour:2,min:0,sec:0,trans:[2008,3,28]}},{serverId:"(GMT+02.00) Minsk",clientId:"Europe/Minsk",standard:{offset:120,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:180,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+02.00) Windhoek",clientId:"Africa/Windhoek",standard:{offset:120,mon:9,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,9,7]},daylight:{offset:60,mon:4,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT+03.00) Baghdad",clientId:"Asia/Baghdad",standard:{offset:180,mon:10,week:1,wkday:1,hour:4,min:0,sec:0,trans:[2008,10,5]},daylight:{offset:240,mon:4,week:1,wkday:1,hour:3,min:0,sec:0,trans:[2008,4,6]}},{serverId:"(GMT+03.00) Kuwait / Riyadh",clientId:"Asia/Kuwait",standard:{offset:180}},{serverId:"(GMT+03.00) Moscow / St. Petersburg / Volgograd",clientId:"Europe/Moscow",standard:{offset:180,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:240,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+03.00) Nairobi",clientId:"Africa/Nairobi",standard:{offset:180}},{serverId:"(GMT+03.00) Tbilisi",clientId:"Asia/Tbilisi",standard:{offset:180}},{serverId:"(GMT+03.30) Tehran",clientId:"Asia/Tehran",standard:{offset:210}},{serverId:"(GMT+04.00) Abu Dhabi / Muscat",clientId:"Asia/Muscat",standard:{offset:240}},{serverId:"(GMT+04.00) Baku",clientId:"Asia/Baku",standard:{offset:240,mon:10,week:-1,wkday:1,hour:5,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:300,mon:3,week:-1,wkday:1,hour:4,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+04.00) Yerevan",clientId:"Asia/Yerevan",standard:{offset:240,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:300,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+04.30) Kabul",clientId:"Asia/Kabul",standard:{offset:270}},{serverId:"(GMT+05.00) Ekaterinburg",clientId:"Asia/Yekaterinburg",standard:{offset:300,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:360,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+05.00) Islamabad / Karachi / Tashkent",clientId:"Asia/Karachi",standard:{offset:300}},{serverId:"(GMT+05.30) Chennai / Kolkata / Mumbai / New Delhi",clientId:"Asia/Calcutta",standard:{offset:330}},{serverId:"(GMT+05.30) Sri Jayawardenepura",clientId:"Asia/Colombo",standard:{offset:330}},{serverId:"(GMT+05.45) Kathmandu",clientId:"Asia/Katmandu",standard:{offset:345}},{serverId:"(GMT+06.00) Almaty / Novosibirsk",clientId:"Asia/Novosibirsk",standard:{offset:360,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:420,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+06.00) Astana / Dhaka",clientId:"Asia/Dhaka",standard:{offset:360}},{serverId:"(GMT+06.30) Yangon (Rangoon)",clientId:"Asia/Rangoon",standard:{offset:390}},{serverId:"(GMT+07.00) Bangkok / Hanoi / Jakarta",clientId:"Asia/Bangkok",standard:{offset:420}},{serverId:"(GMT+07.00) Krasnoyarsk",clientId:"Asia/Krasnoyarsk",standard:{offset:420,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:480,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+08.00) Beijing / Chongqing / Hong Kong / Urumqi",clientId:"Asia/Hong_Kong",standard:{offset:480}},{serverId:"(GMT+08.00) Irkutsk / Ulaan Bataar",clientId:"Asia/Irkutsk",standard:{offset:480,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:540,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+08.00) Kuala Lumpur / Singapore",clientId:"Asia/Kuala_Lumpur",standard:{offset:480}},{serverId:"(GMT+08.00) Perth",clientId:"Australia/Perth",standard:{offset:480,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,30]},daylight:{offset:540,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]}},{serverId:"(GMT+08.00) Taipei",clientId:"Asia/Taipei",standard:{offset:480}},{serverId:"(GMT+09.00) Osaka / Sapporo / Tokyo",clientId:"Asia/Tokyo",standard:{offset:540}},{serverId:"(GMT+09.00) Seoul",clientId:"Asia/Seoul",standard:{offset:540}},{serverId:"(GMT+09.00) Yakutsk",clientId:"Asia/Yakutsk",standard:{offset:540,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:600,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+09.30) Adelaide",clientId:"Australia/Adelaide",standard:{offset:570,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,30]},daylight:{offset:630,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]}},{serverId:"(GMT+09.30) Darwin",clientId:"Australia/Darwin",standard:{offset:570}},{serverId:"(GMT+10.00) Brisbane",clientId:"Australia/Brisbane",standard:{offset:600}},{serverId:"(GMT+10.00) Canberra / Melbourne / Sydney",clientId:"Australia/Sydney",standard:{offset:600,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,30]},daylight:{offset:660,mon:10,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,26]}},{serverId:"(GMT+10.00) Guam / Port Moresby",clientId:"Pacific/Guam",standard:{offset:600}},{serverId:"(GMT+10.00) Hobart",clientId:"Australia/Hobart",standard:{offset:600,mon:3,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,30]},daylight:{offset:660,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,5]}},{serverId:"(GMT+10.00) Vladivostok",clientId:"Asia/Vladivostok",standard:{offset:600,mon:10,week:-1,wkday:1,hour:3,min:0,sec:0,trans:[2008,10,26]},daylight:{offset:660,mon:3,week:-1,wkday:1,hour:2,min:0,sec:0,trans:[2008,3,30]}},{serverId:"(GMT+11.00) Magadan / Solomon Is. / New Caledonia",clientId:"Asia/Magadan",standard:{offset:660}},{serverId:"(GMT+12.00) Auckland / Wellington",clientId:"Pacific/Auckland",standard:{offset:720,mon:3,week:3,wkday:1,hour:3,min:0,sec:0,trans:[2008,3,16]},daylight:{offset:780,mon:10,week:1,wkday:1,hour:2,min:0,sec:0,trans:[2008,10,5]}},{serverId:"(GMT+12.00) Fiji / Kamchatka / Marshall Is.",clientId:"Pacific/Fiji",standard:{offset:720}},{serverId:"(GMT+13.00) Nuku'alofa",clientId:"Pacific/Tongatapu",standard:{offset:780}}];
function AjxTimezone(){
}
AjxTimezone.createMDayTransition=function(date,_50a){
return {offset:_50a!=null?_50a:date.getTimezoneOffset(),mon:date.getMonth()+1,mday:date.getDate(),hour:date.getHours(),min:date.getMinutes(),sec:date.getSeconds()};
};
AjxTimezone.createWkDayTransition=function(date,_50c){
var mon=date.getMonth()+1;
var _50e=date.getDate();
var week=Math.floor((_50e-1)/7);
var _510=new Date(new Date(date.getTime()).setMonth(mon,0)).getDate();
var last=_510-_50e<7;
return {offset:_50c!=null?_50c:date.getTimezoneOffset(),mon:mon,week:last?-1:week+1,wkday:date.getDay()+1,hour:date.getHours(),min:date.getMinutes(),sec:date.getSeconds()};
};
AjxTimezone.createTransitionDate=function(_512){
var date=new Date(AjxTimezoneData.TRANSITION_YEAR,_512.mon-1,1,12,0,0);
if(_512.mday){
date.setDate(_512.mday);
}else{
if(_512.week==-1){
date.setMonth(date.getMonth()+1,0);
for(var i=0;i<7;i++){
if(date.getDay()+1==_512.wkday){
break;
}
date.setDate(date.getDate()-1);
}
}else{
for(var i=0;i<7;i++){
if(date.getDay()+1==_512.wkday){
break;
}
date.setDate(date.getDate()+1);
}
date.setDate(date.getDate()+7*(_512.week-1));
}
}
var _515=[date.getFullYear(),date.getMonth()+1,date.getDate()];
return _515;
};
AjxTimezone.getServerId=function(_516){
return AjxTimezone._CLIENT2SERVER[_516]||_516;
};
AjxTimezone.getClientId=function(_517){
return AjxTimezone._SERVER2CLIENT[_517]||_517;
};
AjxTimezone.getShortName=function(_518){
var rule=AjxTimezone.getRule(_518);
if(!rule.shortName){
rule.shortName=["GMT",AjxTimezone._SHORT_NAMES[_518]].join("");
}
return rule.shortName;
};
AjxTimezone.getMediumName=function(_51a){
var rule=AjxTimezone.getRule(_51a);
if(!rule.mediumName){
rule.mediumName=["(",AjxTimezone.getShortName(_51a),") ",_51a].join("");
}
return rule.mediumName;
};
AjxTimezone.getLongName=AjxTimezone.getMediumName;
AjxTimezone.addRule=function(rule){
var _51d=rule.serverId;
var _51e=rule.clientId;
AjxTimezone._CLIENT2SERVER[_51e]=_51d;
AjxTimezone._SERVER2CLIENT[_51d]=_51e;
AjxTimezone._SHORT_NAMES[_51e]=AjxTimezone._generateShortName(rule.standard.offset);
AjxTimezone._CLIENT2RULE[_51e]=rule;
var _51f=rule.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
_51f.push(rule);
};
AjxTimezone.getRule=function(_520,tz){
var rule=AjxTimezone._CLIENT2RULE[_520];
if(!rule){
_520=AjxTimezone._SERVER2CLIENT[_520];
rule=AjxTimezone._CLIENT2RULE[_520];
}
if(!rule&&tz){
var _523=["standard","daylight"];
var _524=tz.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
for(var i=0;i<_524.length;i++){
rule=_524[i];
var _526=true;
outer:
for(var j=0;j<_523.length;j++){
var name=_523[j];
var _529=rule[name];
if(!_529){
continue;
}
for(var p in tz[name]){
if(tz[name][p]!=_529[p]){
_526=false;
break outer;
}
}
}
if(_526){
return rule;
}
}
return null;
}
return rule;
};
AjxTimezone.getOffset=function(_52b,date){
var rule=AjxTimezone.getRule(_52b);
var _52e=rule?rule.standard.offset:0;
if(rule&&rule.daylight){
var _52f=date.getMonth()+1;
var day=date.getDate();
var _531=rule.standard.trans;
var _532=rule.daylight.trans;
if((_52f==_532[1]&&day>=_532[2])||(_52f==_531[1]&&day<_531[2])||(_52f>_532[1]&&_52f<_531[1])){
_52e=rule.daylight.offset;
}
}
return _52e;
};
AjxTimezone.guessMachineTimezone=function(){
return AjxTimezone._guessMachineTimezone().clientId;
};
AjxTimezone.getAbbreviatedZoneChoices=function(){
if(AjxTimezone._ABBR_ZONE_OPTIONS){
var _533=AjxTimezone._ABBR_ZONE_OPTIONS.length;
var _534=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(_533!=_534){
AjxTimezone._ABBR_ZONE_OPTIONS=null;
}
}
if(!AjxTimezone._ABBR_ZONE_OPTIONS){
AjxTimezone._ABBR_ZONE_OPTIONS=[];
for(var _535 in AjxTimezone._CLIENT2SERVER){
var rule=AjxTimezone._CLIENT2RULE[_535];
var _537=rule.serverId;
var _538={displayValue:AjxTimezone.getMediumName(_535),selectedValue:_535,value:_537,standard:rule.standard,serverid:_537};
AjxTimezone._ABBR_ZONE_OPTIONS.push(_538);
}
AjxTimezone._ABBR_ZONE_OPTIONS.sort(AjxTimezone._BY_OFFSET);
}
return AjxTimezone._ABBR_ZONE_OPTIONS;
};
AjxTimezone.getZonePreferences=function(){
if(AjxTimezone._PREF_ZONE_DISPLAY){
var _539=AjxTimezone._PREF_ZONE_DISPLAY.length;
var _53a=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(_539!=_53a){
AjxTimezone._PREF_ZONE_DISPLAY=null;
AjxTimezone._PREF_ZONE_DISPLAY_DISPLAY=null;
}
}
if(!AjxTimezone._PREF_ZONE_DISPLAY){
AjxTimezone._PREF_ZONE_DISPLAY=[];
AjxTimezone.getAbbreviatedZoneChoices();
for(var i=0;i<AjxTimezone._ABBR_ZONE_OPTIONS.length;i++){
AjxTimezone._PREF_ZONE_DISPLAY.push(AjxTimezone._ABBR_ZONE_OPTIONS[i].displayValue);
}
}
return AjxTimezone._PREF_ZONE_DISPLAY;
};
AjxTimezone.getZonePreferencesOptions=function(){
if(AjxTimezone._PREF_ZONE_OPTIONS){
var _53c=AjxTimezone._PREF_ZONE_OPTIONS.length;
var _53d=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(_53c!=_53d){
AjxTimezone._PREF_ZONE_OPTIONS=null;
}
}
if(!AjxTimezone._PREF_ZONE_OPTIONS){
AjxTimezone._PREF_ZONE_OPTIONS=[];
AjxTimezone.getAbbreviatedZoneChoices();
for(var i=0;i<AjxTimezone._ABBR_ZONE_OPTIONS.length;i++){
AjxTimezone._PREF_ZONE_OPTIONS.push(AjxTimezone._ABBR_ZONE_OPTIONS[i].serverid);
}
}
return AjxTimezone._PREF_ZONE_OPTIONS;
};
AjxTimezone._BY_OFFSET=function(_53f,_540){
var _541=_53f.standard.offset-_540.standard.offset;
if(_541==0){
var _542=_53f.serverId;
var _543=_540.serverId;
if(_542<_543){
_541=-1;
}else{
if(_542>_543){
_541=1;
}
}
}
return _541;
};
AjxTimezone.GMT="Europe/London";
AjxTimezone.GMT_NO_DST="Africa/Casablanca";
AjxTimezone.AUTO_DETECTED="Auto-Detected";
AjxTimezone.DEFAULT;
AjxTimezone.DEFAULT_RULE;
AjxTimezone._CLIENT2SERVER={};
AjxTimezone._SERVER2CLIENT={};
AjxTimezone._SHORT_NAMES={};
AjxTimezone._CLIENT2RULE={};
AjxTimezone.STANDARD_RULES=[];
AjxTimezone.DAYLIGHT_RULES=[];
(function(){
for(var i=0;i<AjxTimezoneData.TIMEZONE_RULES.length;i++){
var rule=AjxTimezoneData.TIMEZONE_RULES[i];
var _546=rule.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
_546.push(rule);
}
})();
AjxTimezone._guessMachineTimezone=function(){
var dec1=new Date(AjxTimezoneData.TRANSITION_YEAR,11,1,0,0,0);
var jun1=new Date(AjxTimezoneData.TRANSITION_YEAR,5,1,0,0,0);
var _549=-dec1.getTimezoneOffset();
var _54a=-jun1.getTimezoneOffset();
var _54b=_549>_54a;
if(_54a==_549){
var _54c=AjxTimezone.STANDARD_RULES;
for(var i=0;i<_54c.length;++i){
var rule=_54c[i];
if(rule.standard.offset==_54a){
return rule;
}
}
}else{
var _54c=AjxTimezone.DAYLIGHT_RULES;
var dst=Math.max(_549,_54a);
var std=Math.min(_549,_54a);
for(var i=0;i<_54c.length;++i){
var rule=_54c[i];
if(rule.standard.offset==std&&rule.daylight.offset==dst){
var _551=rule.standard.trans;
var _552=rule.daylight.trans;
var s0=new Date(_551[0],_551[1]-1,_551[2]-1);
var s1=new Date(_551[0],_551[1]-1,_551[2]+2);
var d0=new Date(_552[0],_552[1]-1,_552[2]-1);
var d1=new Date(_552[0],_552[1]-1,_552[2]+2);
if(-s1.getTimezoneOffset()==std&&-d1.getTimezoneOffset()==dst&&-s0.getTimezoneOffset()==dst&&-d0.getTimezoneOffset()==std){
return rule;
}
}
}
}
return AjxTimezone._generateDefaultRule(_54b);
};
AjxTimezone._generateDefaultRule=function(_557){
if(_557==null){
var dec1=new Date(AjxTimezoneData.TRANSITION_YEAR,11,1,0,0,0);
var jun1=new Date(AjxTimezoneData.TRANSITION_YEAR,5,1,0,0,0);
var _55a=-dec1.getTimezoneOffset();
var _55b=-jun1.getTimezoneOffset();
_557=_55a>_55b;
}
var d=new Date();
d.setMonth(0,1);
d.setHours(0,0,0,0);
var d2=new Date();
d2.setHours(0,0,0,0);
var _55e=-d.getTimezoneOffset();
var _55f=_55e;
var _560=[];
for(var m=0;m<12;m++){
d2.setMonth(m+1,0);
var ld=d2.getDate();
for(var md=1;md<=ld;md++){
d.setMonth(m,md);
var _564=-d.getTimezoneOffset();
if(_564!=_55f){
var td=new Date(d.getTime());
td.setDate(md-1);
for(var h=0;h<24;h++){
td.setHours(h,0,0,0);
var _567=-td.getTimezoneOffset();
if(_567==_564){
break;
}
}
_560.push({date:td,hour:h});
_55f=_564;
break;
}
}
}
var _568=_55e;
var rule={clientId:AjxTimezone.AUTO_DETECTED,serverId:["(GMT",AjxTimezone._generateShortName(_568,true),") ",AjxTimezone.AUTO_DETECTED].join(""),autoDetected:true};
AjxTimezoneData.TIMEZONE_RULES.unshift(rule);
if(_560.length==0){
rule.standard={offset:_568};
AjxTimezone.STANDARD_RULES.unshift(rule);
}else{
var s2d=_560[_557?1:0].date;
var d2s=_560[_557?0:1].date;
rule.standard=AjxTimezone.createWkDayTransition(d2s);
rule.standard.hour=_560[_557?0:1].hour+1;
if(rule.standard.hour>23){
rule.standard.hour=23;
}
rule.standard.trans=[d2s.getFullYear(),d2s.getMonth()+1,d2s.getDate()];
d2s.setDate(d2s.getDate()+1);
rule.standard.offset=-d2s.getTimezoneOffset();
rule.daylight=AjxTimezone.createWkDayTransition(s2d);
rule.daylight.hour=_560[_557?1:0].hour-1;
if(rule.daylight.hour>23){
rule.daylight.hour=23;
}
rule.daylight.trans=[s2d.getFullYear(),s2d.getMonth()+1,s2d.getDate()];
s2d.setDate(s2d.getDate()+1);
rule.daylight.offset=-s2d.getTimezoneOffset();
AjxTimezone.DAYLIGHT_RULES.unshift(rule);
}
return rule;
};
AjxTimezone._generateShortName=function(_56c,_56d){
if(_56c==0){
return "";
}
var sign=_56c<0?"-":"+";
var _56f=Math.abs(_56c);
var _570=Math.floor(_56f/60);
var _571=_56f%60;
_570=_570<10?"0"+_570:_570;
_571=_571<10?"0"+_571:_571;
return [sign,_570,_56d?".":"",_571].join("");
};
AjxTimezone.DEFAULT_RULE=AjxTimezone._guessMachineTimezone();
(function(){
AjxTimezoneData.TIMEZONE_RULES.sort(AjxTimezone._BY_OFFSET);
for(var j=0;j<AjxTimezoneData.TIMEZONE_RULES.length;j++){
var rule=AjxTimezoneData.TIMEZONE_RULES[j];
AjxTimezone.addRule(rule);
}
})();
AjxTimezone.DEFAULT=AjxTimezone.getClientId(AjxTimezone.DEFAULT_RULE.serverId);
function AjxXslt(){
var doc=AjxXmlDoc.create();
if(AjxEnv.isIE){
var _575=null;
var vers=["MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.3.0"];
for(var i=0;i<vers.length;i++){
try{
_575=new ActiveXObject(vers[i]);
break;
}
catch(ex){
}
}
if(!_575){
throw new AjxException("FreeThreadedDOMDocument",AjxException.UNSUPPORTED,"AjxXslt");
}
_575.async=false;
doc._doc=_575;
}
this._doc=doc;
}
AjxXslt.prototype.toString=function(){
return "AjxXslt";
};
AjxXslt.createFromUrl=function(url){
var xslt=new AjxXslt();
xslt.loadUrl(url);
return xslt;
};
AjxXslt.createFromString=function(str){
var xslt=new AjxXslt();
xslt._doc.loadFromString(str);
xslt.createProcessor();
return xslt;
};
AjxXslt.prototype.createProcessor=function(){
var doc=this._doc.getDoc();
if(AjxEnv.isNav){
this._processor=new XSLTProcessor();
this._processor.importStylesheet(doc);
}else{
if(AjxEnv.isIE){
var err=doc.parseError;
if(err.errorCode!=0){
throw new AjxException(err.reason,AjxException.INVALID_PARAM,"AjxXslt.createProcessor");
}
var proc=null;
var vers=["MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate.3.0"];
for(var i=0;i<vers.length;i++){
try{
proc=new ActiveXObject(vers[i]);
break;
}
catch(ex){
}
}
if(!proc){
throw new AjxException("XSLTemplate",AjxException.UNSUPPORTED,"AjxXslt.createProcessor");
}
this._processor=proc;
this._processor.stylesheet=doc;
}
}
};
AjxXslt._finishedLoading=function(){
var xslt=this._xslt;
xslt.createProcessor();
};
AjxXslt.prototype.loadUrl=function(url){
var doc=this._doc;
if(AjxEnv.isNav){
var _584=doc.getDoc();
_584._xslt=this;
_584.addEventListener("load",AjxXslt._finishedLoading,false);
}
doc.loadFromUrl(url);
if(AjxEnv.isIE){
this.createProcessor();
}
};
AjxXslt.prototype.transformToDom=function(dom){
var ret;
if(AjxEnv.isIE){
ret=this.transformIE(dom);
}else{
if(AjxEnv.isNav){
return this.transformNav(dom);
}else{
return dom;
}
}
var doc=AjxXmlDoc.createFromXml(ret);
return doc.getDoc();
};
AjxXslt.prototype.transformToString=function(dom){
var ret;
if(AjxEnv.isIE){
return this.transformIE(dom);
}else{
if(AjxEnv.isNav){
ret=this.transformNav(dom);
}else{
return dom.documentElement.innerHTML;
}
}
if(!ret||!ret.documentElement){
throw new AjxException("XSL transformation failed.",AjxException.INVALID_PARAM,"AjxXslt.transformToString");
}
var elem=ret.documentElement;
if((elem instanceof HTMLElement)||(elem instanceof HTMLHtmlElement)){
return elem.innerHTML;
}else{
if(elem instanceof Element){
return elem.xml;
}
}
return dom.documentElement.innerHTML;
};
AjxXslt.prototype.transformIE=function(dom){
try{
var _58c=this._processor.createProcessor();
_58c.input=dom;
_58c.transform();
return _58c.output;
}
catch(exception){
throw new AjxException(exception.description,AjxException.INVALID_PARAM,"AjxXslt.transformIE");
}
};
AjxXslt.prototype.transformNav=function(dom){
return this._processor.transformToDocument(dom);
};
AjxXslt.prototype.transformNav2=function(dom){
this._fragment=document.implementation.createDocument("","",null);
return this._processor.transformToFragment(dom,this._fragment);
};
var AjxSHA1=function(){
var _58f=0;
var _590="";
var _591=8;
function hex_sha1(s){
return binb2hex(core_sha1(str2binb(s),s.length*_591));
}
function b64_sha1(s){
return binb2b64(core_sha1(str2binb(s),s.length*_591));
}
function str_sha1(s){
return binb2str(core_sha1(str2binb(s),s.length*_591));
}
function hex_hmac_sha1(key,data){
return binb2hex(core_hmac_sha1(key,data));
}
function b64_hmac_sha1(key,data){
return binb2b64(core_hmac_sha1(key,data));
}
function str_hmac_sha1(key,data){
return binb2str(core_hmac_sha1(key,data));
}
function sha1_vm_test(){
return hex_sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d";
}
function core_sha1(x,len){
x[len>>5]|=128<<(24-len%32);
x[((len+64>>9)<<4)+15]=len;
var w=Array(80);
var a=1732584193;
var b=-271733879;
var c=-1732584194;
var d=271733878;
var e=-1009589776;
for(var i=0;i<x.length;i+=16){
var olda=a;
var oldb=b;
var oldc=c;
var oldd=d;
var olde=e;
for(var j=0;j<80;j++){
if(j<16){
w[j]=x[i+j];
}else{
w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);
}
var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));
e=d;
d=c;
c=rol(b,30);
b=a;
a=t;
}
a=safe_add(a,olda);
b=safe_add(b,oldb);
c=safe_add(c,oldc);
d=safe_add(d,oldd);
e=safe_add(e,olde);
}
return Array(a,b,c,d,e);
}
function sha1_ft(t,b,c,d){
if(t<20){
return (b&c)|((~b)&d);
}
if(t<40){
return b^c^d;
}
if(t<60){
return (b&c)|(b&d)|(c&d);
}
return b^c^d;
}
function sha1_kt(t){
return (t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;
}
function core_hmac_sha1(key,data){
var bkey=str2binb(key);
if(bkey.length>16){
bkey=core_sha1(bkey,key.length*_591);
}
var ipad=Array(16),opad=Array(16);
for(var i=0;i<16;i++){
ipad[i]=bkey[i]^909522486;
opad[i]=bkey[i]^1549556828;
}
var hash=core_sha1(ipad.concat(str2binb(data)),512+data.length*_591);
return core_sha1(opad.concat(hash),512+160);
}
function safe_add(x,y){
var lsw=(x&65535)+(y&65535);
var msw=(x>>16)+(y>>16)+(lsw>>16);
return (msw<<16)|(lsw&65535);
}
function rol(num,cnt){
return (num<<cnt)|(num>>>(32-cnt));
}
function str2binb(str){
var bin=Array();
var mask=(1<<_591)-1;
for(var i=0;i<str.length*_591;i+=_591){
bin[i>>5]|=(str.charCodeAt(i/_591)&mask)<<(32-_591-i%32);
}
return bin;
}
function binb2str(bin){
var str="";
var mask=(1<<_591)-1;
for(var i=0;i<bin.length*32;i+=_591){
str+=String.fromCharCode((bin[i>>5]>>>(32-_591-i%32))&mask);
}
return str;
}
function binb2hex(_5c4){
var _5c5=_58f?"0123456789ABCDEF":"0123456789abcdef";
var str="";
for(var i=0;i<_5c4.length*4;i++){
str+=_5c5.charAt((_5c4[i>>2]>>((3-i%4)*8+4))&15)+_5c5.charAt((_5c4[i>>2]>>((3-i%4)*8))&15);
}
return str;
}
function binb2b64(_5c8){
var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str="";
for(var i=0;i<_5c8.length*4;i+=3){
var _5cc=(((_5c8[i>>2]>>8*(3-i%4))&255)<<16)|(((_5c8[i+1>>2]>>8*(3-(i+1)%4))&255)<<8)|((_5c8[i+2>>2]>>8*(3-(i+2)%4))&255);
for(var j=0;j<4;j++){
if(i*8+j*6>_5c8.length*32){
str+=_590;
}else{
str+=tab.charAt((_5cc>>6*(3-j))&63);
}
}
}
return str;
}
this.hex_sha1=hex_sha1;
this.b64_sha1=b64_sha1;
this.str_sha1=str_sha1;
this.hex_hmac_sha1=hex_hmac_sha1;
this.b64_hmac_sha1=b64_hmac_sha1;
this.str_hmac_sha1=str_hmac_sha1;
this.sha1_vm_test=sha1_vm_test;
};
AjxSHA1=new AjxSHA1();
function Dwt(){
}
Dwt.STATIC_STYLE="static";
Dwt.ABSOLUTE_STYLE="absolute";
Dwt.RELATIVE_STYLE="relative";
Dwt.NO_REPEAT="no-repeat";
Dwt.REPEAT="repeat";
Dwt.REPEAT_X="repeat-x";
Dwt.REPEAT_Y="repeat-y";
Dwt.DISPLAY_INLINE="inline";
Dwt.DISPLAY_BLOCK="block";
Dwt.DISPLAY_NONE="none";
Dwt.DISPLAY_TABLE_ROW=AjxEnv.isIE?Dwt.DISPLAY_BLOCK:"table-row";
Dwt.DISPLAY_TABLE_CELL=AjxEnv.isIE?Dwt.DISPLAY_BLOCK:"table-cell";
Dwt.CLIP=1;
Dwt.VISIBLE=2;
Dwt.SCROLL=3;
Dwt.FIXED_SCROLL=4;
Dwt.Z_HIDDEN=100;
Dwt.Z_CURTAIN=200;
Dwt.Z_VIEW=300;
Dwt.Z_MENU=500;
Dwt.Z_VEIL=600;
Dwt.Z_DIALOG=700;
Dwt.Z_DIALOG_MENU=750;
Dwt.Z_TOOLTIP=775;
Dwt.Z_DND=800;
Dwt.Z_BUSY=900;
Dwt.Z_SPLASH=1000;
Dwt.DEFAULT=-123456789;
Dwt.CLEAR=-20000;
Dwt.LOC_NOWHERE=-10000;
Dwt.DND_DROP_NONE=0;
Dwt.DND_DROP_COPY=1;
Dwt.DND_DROP_MOVE=2;
Dwt.KEY_OBJECT="_object_";
Dwt.KEY_ID="_id_";
Dwt.CARET_HACK_ENABLED=AjxEnv.isFirefox;
if(Dwt.CARET_HACK_ENABLED){
Dwt.CARET_HACK_BEGIN="<div style='overflow:auto;'>";
Dwt.CARET_HACK_END="</div>";
}else{
Dwt.CARET_HACK_BEGIN="";
Dwt.CARET_HACK_END="";
}
Dwt._Z_INC=1;
Dwt.__nextId=1;
Dwt.getDomObj=function(doc,id){
return doc.getElementById(id);
};
Dwt.getNextId=function(){
return "DWT"+Dwt.__nextId++;
};
Dwt.associateElementWithObject=function(_5d0,_5d1,_5d2){
_5d0[_5d2||"dwtObj"]=_5d1.__internalId=AjxCore.assignId(_5d1);
};
Dwt.disassociateElementFromObject=function(_5d3,_5d4,_5d5){
if(_5d3){
_5d3.removeAttribute(_5d5||"dwtObj");
}
if(_5d4.__internalId){
AjxCore.unassignId(_5d4.__internalId);
}
};
Dwt.getObjectFromElement=function(_5d6,_5d7){
return AjxCore.objectWithId(_5d6[_5d7||"dwtObj"]);
};
Dwt.findAncestor=function(_5d8,_5d9){
while(_5d8&&(Dwt.getAttr(_5d8,_5d9)==void 0)){
_5d8=_5d8.parentNode;
}
return _5d8;
};
Dwt.setHandler=function(_5da,_5db,func){
if(_5db==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
Dwt.clearHandler(_5da,_5db);
}
_5da[_5db]=func;
if(_5db==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
_5da.addEventListener("DOMMouseScroll",func,true);
}
};
Dwt.clearHandler=function(_5dd,_5de){
if(_5de==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
if(_5dd[_5de]){
var func=_5dd[_5de];
_5dd.removeEventListener("DOMMouseScroll",func,true);
}
}
_5dd[_5de]=null;
};
Dwt.getBackgroundRepeat=function(_5e0){
return DwtCssStyle.getProperty(_5e0,"background-repeat");
};
Dwt.setBackgroundRepeat=function(_5e1,_5e2){
_5e1.style.backgroundRepeat=_5e2;
};
Dwt.getBounds=function(_5e3,rect){
if(!Dwt.__tmpPoint){
Dwt.__tmpPoint=new DwtPoint(0,0);
}
var _5e5=Dwt.__tmpPoint;
Dwt.getLocation(_5e3,_5e5);
var locX=_5e5.x;
var locY=_5e5.y;
Dwt.getSize(_5e3,_5e5);
if(!rect){
return new DwtRectangle(locX,locY,_5e5.x,_5e5.y);
}else{
rect.set(locX,locY,_5e5.x,_5e5.y);
return rect;
}
};
Dwt.setBounds=function(_5e8,x,y,_5eb,_5ec){
Dwt.setLocation(_5e8,x,y);
Dwt.setSize(_5e8,_5eb,_5ec);
};
Dwt.getCursor=function(_5ed){
return DwtCssStyle.getProperty(_5ed,"cursor");
};
Dwt.setCursor=function(_5ee,_5ef){
_5ee.style.cursor=_5ef;
};
Dwt.getLocation=function(_5f0,_5f1){
var _5f1=(_5f1)?_5f1:new DwtPoint(0,0);
if(_5f0.style.position==Dwt.ABSOLUTE_STYLE){
_5f1.set(parseInt(DwtCssStyle.getProperty(_5f0,"left")),parseInt(DwtCssStyle.getProperty(_5f0,"top")));
return _5f1;
}else{
return Dwt.toWindow(_5f0,0,0,null,null,_5f1);
}
};
Dwt.setLocation=function(_5f2,x,y){
if(_5f2.style.position!=Dwt.ABSOLUTE_STYLE){
throw new DwtException("Static widgets may not be positioned",DwtException.INVALID_OP,"Dwt.setLocation");
}
if(x=Dwt.__checkPxVal(x)){
_5f2.style.left=x;
}
if(y=Dwt.__checkPxVal(y)){
_5f2.style.top=y;
}
};
Dwt.getPosition=function(_5f5){
return _5f5.style.position;
};
Dwt.setPosition=function(_5f6,_5f7){
_5f6.style.position=_5f7;
};
Dwt.getScrollStyle=function(_5f8){
var _5f9=DwtCssStyle.getProperty(_5f8,"overflow");
if(_5f9=="hidden"){
return Dwt.CLIP;
}else{
if(_5f9=="auto"){
return Dwt.SCROLL;
}else{
if(_5f9=="scroll"){
return Dwt.FIXED_SCROLL;
}else{
return Dwt.VISIBLE;
}
}
}
};
Dwt.setScrollStyle=function(_5fa,_5fb){
if(_5fb==Dwt.CLIP){
_5fa.style.overflow="hidden";
}else{
if(_5fb==Dwt.SCROLL){
_5fa.style.overflow="auto";
}else{
if(_5fb==Dwt.FIXED_SCROLL){
_5fa.style.overflow="scroll";
}else{
_5fa.style.overflow="visible";
}
}
}
};
Dwt.getSize=function(_5fc,_5fd){
var p;
if(!_5fd){
p=new DwtPoint(0,0);
}else{
p=_5fd;
p.set(0,0);
}
if(!_5fc){
return p;
}
if(_5fc.offsetWidth!=null){
p.x=_5fc.offsetWidth;
p.y=_5fc.offsetHeight;
}else{
if(_5fc.clip&&_5fc.clip.width!=null){
p.x=_5fc.clip.width;
p.y=_5fc.clip.height;
}else{
if(_5fc.style&&_5fc.style.pixelWidth!=null){
p.x=_5fc.style.pixelWidth;
p.y=_5fc.style.pixelHeight;
}
}
}
p.x=parseInt(p.x);
p.y=parseInt(p.y);
return p;
};
Dwt.setSize=function(_5ff,_600,_601){
if(!_5ff.style){
return;
}
if(_600==Dwt.CLEAR){
_5ff.style.width=null;
}else{
if(_600=Dwt.__checkPxVal(_600,true)){
_5ff.style.width=_600;
}
}
if(_601==Dwt.CLEAR){
_5ff.style.height=null;
}else{
if(_601=Dwt.__checkPxVal(_601,true)){
_5ff.style.height=_601;
}
}
};
Dwt.getHtmlExtent=function(html){
var div=AjxStringUtil.calcDIV();
div.innerHTML=html;
return Dwt.getSize(div);
};
Dwt.getAttr=function(_604,attr,_606){
if(!_606){
return _604&&_604.tagName?(_604.getAttribute(attr)||_604[attr]):null;
}else{
while(_604){
if(Dwt.getAttr(_604,attr)!=null){
return _604;
}
_604=_604.parentNode;
}
return null;
}
};
Dwt.getVisible=function(_607){
var disp=DwtCssStyle.getProperty(_607,"display");
return (disp!=Dwt.DISPLAY_NONE);
};
Dwt.setVisible=function(_609,_60a){
var _60b=_609.nodeName.match(/tr/i);
var _60c=_609.nodeName.match(/td|th/i);
var _60d=_60b?Dwt.DISPLAY_TABLE_ROW:(_60c?Dwt.DISPLAY_TABLE_CELL:Dwt.DISPLAY_BLOCK);
_609.style.display=_60a?_60d:Dwt.DISPLAY_NONE;
};
Dwt.getVisibility=function(_60e){
var vis=DwtCssStyle.getProperty(_60e,"visibility");
return (vis=="visible");
};
Dwt.setVisibility=function(_610,_611){
_610.style.visibility=_611?"visible":"hidden";
};
Dwt.setOpacity=function(_612,_613){
if(AjxEnv.isIE){
_612.style.filter="alpha(opacity="+_613+")";
}else{
_612.style.opacity=_613/100;
}
};
Dwt.getZIndex=function(_614){
return DwtCssStyle.getProperty(_614,"z-index");
};
Dwt.setZIndex=function(_615,idx){
_615.style.zIndex=idx;
};
Dwt.getDisplay=function(_617){
DwtCssStyle.getProperty(_617,"display");
};
Dwt.setDisplay=function(_618,_619){
_618.style.display=_619;
};
Dwt.getWindowSize=function(_61a){
var p=(!_61a)?new DwtPoint(0,0):_61a;
if(window.innerWidth){
p.x=window.innerWidth;
p.y=window.innerHeight;
}else{
if(AjxEnv.isIE6CSS){
p.x=document.body.parentElement.clientWidth;
p.y=document.body.parentElement.clientHeight;
}else{
if(document.body&&document.body.clientWidth){
p.x=document.body.clientWidth;
p.y=document.body.clientHeight;
}
}
}
return p;
};
Dwt.toWindow=function(_61c,x,y,_61f,_620,_621){
var p;
if(!_621){
p=new DwtPoint(x,y);
}else{
p=_621;
p.set(x,y);
}
var _623=_61c;
while(_623&&_623!=_61f){
p.x+=_623.offsetLeft;
p.y+=_623.offsetTop;
if(!_620){
var _624=AjxEnv.isOpera?_623.pageYOffset:_623.scrollTop;
if(_624){
p.y-=_624;
}
var _625=_623.parentNode;
while(_625!=_623.offsetParent&&_625!=_61f){
_624=AjxEnv.isOpera?_625.pageYOffset:_625.scrollTop;
if(_624){
p.y-=_624;
}
_625=_625.parentNode;
}
}
_623=_623.offsetParent;
}
return p;
};
Dwt.setStatus=function(text){
window.status=text;
};
Dwt.getTitle=function(){
return window.document.title;
};
Dwt.setTitle=function(text){
window.document.title=text;
};
Dwt.getIframeDoc=function(_628){
if(_628){
return AjxEnv.isIE?_628.contentWindow.document:_628.contentDocument;
}
return null;
};
Dwt.getIframeWindow=function(_629){
return _629.contentWindow;
};
Dwt.parseHtmlFragment=function(html,_62b){
if(!Dwt._div){
Dwt._div=document.createElement("div");
}
if(_62b){
html="<table style='table-layout:fixed'>"+html+"</table>";
}
Dwt._div.innerHTML=html;
return _62b?Dwt._div.firstChild.rows[0]:Dwt._div.firstChild;
};
Dwt.contains=function(_62c,_62d){
var _62e=false;
if(AjxEnv.isSafari){
return false;
}else{
if(_62c.compareDocumentPosition){
var _62f=_62c.compareDocumentPosition(_62d);
if((_62f==(document.DOCUMENT_POSITION_CONTAINED_BY|document.DOCUMENT_POSITION_FOLLOWING))){
_62e=true;
}
}else{
if(_62c.contains){
_62e=_62c.contains(_62d);
}
}
}
return _62e;
};
Dwt.removeChildren=function(_630){
while(_630.hasChildNodes()){
_630.removeChild(_630.firstChild);
}
};
Dwt.getCellIndex=function(cell){
if(AjxEnv.isSafari||AjxEnv.isOpera){
if(cell.tagName&&cell.tagName.toLowerCase()=="td"){
var _632=cell.parentNode.cells;
var len=_632.length;
for(var i=0;i<len;i++){
if(_632[i]==cell){
return i;
}
}
}
}else{
return cell.cellIndex;
}
return -1;
};
Dwt.delClass=function(el,del,add){
var a=el.className.split(/\s+/);
for(var i=a.length;--i>=0;){
if(a[i]==del){
a.splice(i,1);
}
}
if(add){
a.push(add);
}
el.className=a.join(" ");
};
Dwt.addClass=function(el,c){
Dwt.delClass(el,c,c);
};
Dwt.setSelectionRange=function(_63c,_63d,end){
if(AjxEnv.isGeckoBased){
_63c.setSelectionRange(_63d,end);
}else{
if(AjxEnv.isIE){
var _63f=_63c.createTextRange();
_63f.collapse(true);
_63f.moveStart("character",_63d);
_63f.moveEnd("character",end-_63d);
_63f.select();
}else{
_63c.select();
}
}
};
Dwt.getSelectionStart=function(_640){
if(AjxEnv.isGeckoBased){
return _640.selectionStart;
}else{
if(AjxEnv.isIE){
var _641=document.selection.createRange();
var _642=_641.compareEndPoints("StartToEnd",_641)==0;
if(!_642){
_641.collapse(true);
}
var b=_641.getBookmark();
return b.charCodeAt(2)-2;
}
}
return _640.value.length;
};
Dwt.getSelectionEnd=function(_644){
if(AjxEnv.isGeckoBased){
return _644.selectionEnd;
}else{
if(AjxEnv.isIE){
var _645=document.selection.createRange();
var _646=_645.compareEndPoints("StartToEnd",_645)==0;
if(!_646){
_645.collapse(false);
}
var b=_645.getBookmark();
return b.charCodeAt(2)-2;
}
}
return _644.value.length;
};
Dwt.setSelectionText=function(_648,text){
var _64a=Dwt.getSelectionStart(_648);
var end=Dwt.getSelectionEnd(_648);
var str=_648.value;
var val=[str.substr(0,_64a),text,str.substr(end)].join("");
if(typeof _648.setValue=="function"){
_648.setValue(val);
}else{
_648.value=val;
}
Dwt.setSelectionRange(_648,_64a,_64a+text.length);
};
Dwt.__checkPxVal=function(val,_64f){
if(val==Dwt.DEFAULT){
return false;
}
if(_64f&&val<0&&val!=Dwt.LOC_NOWHERE){
val=0;
}
if(typeof (val)=="number"){
val=val+"px";
}
return val;
};
Dwt.byId=function(id){
return (typeof id=="string"?document.getElementById(id):id);
};
Dwt.byTag=function(_651){
return document.getElementsByTagName(_651);
};
Dwt.show=function(it,_653){
Dwt.setVisible(Dwt.byId(it),_653!=false);
};
Dwt.hide=function(it){
Dwt.setVisible(Dwt.byId(it),false);
};
Dwt.toggle=function(it,show){
it=Dwt.byId(it);
if(show==null){
show=(Dwt.getVisible(it)!=true);
}
Dwt.setVisible(it,show);
};
function DwtException(msg,code,_659,_65a){
if(arguments.length===0){
return;
}
AjxException.call(this,msg,code,_659,_65a);
}
DwtException.prototype=new AjxException();
DwtException.prototype.constructor=DwtException;
DwtException.prototype.toString=function(){
return "DwtException";
};
DwtException.INVALIDPARENT=-1;
DwtException.INVALID_OP=-2;
DwtException.INTERNAL_ERROR=-3;
DwtException.INVALID_PARAM=-4;
function DwtDraggable(){
}
DwtDraggable.dragEl=null;
DwtDraggable.init=function(_65b,_65c,minX,maxX,minY,maxY,_661,_662,_663,_664,_665,_666,_667){
_65b.onmousedown=DwtDraggable.__start;
_65b.__hMode=_664?false:true;
_65b.__vMode=_665?false:true;
_65b.__root=(_65c&&_65c!=null)?_65c:_65b;
if(_65b.__hMode&&isNaN(parseInt(_65b.__root.style.left))){
_65b.__root.style.left="0px";
}
if(_65b.__vMode&&isNaN(parseInt(_65b.__root.style.top))){
_65b.__root.style.top="0px";
}
if(!_65b.__hMode&&isNaN(parseInt(_65b.__root.style.right))){
_65b.__root.style.right="0px";
}
if(!_65b.__vMode&&isNaN(parseInt(_65b.__root.style.bottom))){
_65b.__root.style.bottom="0px";
}
_65b.__minX=(typeof minX!="undefined")?minX:null;
_65b.__minY=(typeof minY!="undefined")?minY:null;
_65b.__maxX=(typeof maxX!="undefined")?maxX:null;
_65b.__maxY=(typeof maxY!="undefined")?maxY:null;
_65b.__xMapper=_666?_666:null;
_65b.__yMapper=_667?_667:null;
_65b.__root.onDragStart=_661;
_65b.__root.onDragEnd=_663;
_65b.__root.onDrag=_662;
};
DwtDraggable.setDragBoundaries=function(_668,minX,maxX,minY,maxY){
if(_668!=null){
if(minX!=null){
_668.__minX=minX;
}
if(maxX!=null){
_668.__maxX=maxX;
}
if(minY!=null){
_668.__minY=minY;
}
if(maxY!=null){
_668.__maxY=maxY;
}
}
};
DwtDraggable.__start=function(e){
var _66e=DwtDraggable.dragEl=this;
e=DwtDraggable.__fixE(e);
var x=parseInt(_66e.__hMode?_66e.__root.style.left:_66e.__root.style.right);
var y=parseInt(_66e.__vMode?_66e.__root.style.top:_66e.__root.style.bottom);
if(_66e.__root.onDragStart){
_66e.__root.onDragStart.run([x,y]);
}
_66e.__lastMouseX=e.clientX;
_66e.__lastMouseY=e.clientY;
if(_66e.__hMode){
if(_66e.__minX!=null){
_66e.__minMouseX=e.clientX-x+_66e.__minX;
}
if(_66e.__maxX!=null){
_66e.__maxMouseX=_66e.__minMouseX+_66e.__maxX-_66e.__minX;
}
}else{
if(_66e.__minX!=null){
_66e.__maxMouseX=-_66e.__minX+e.clientX+x;
}
if(_66e.__maxX!=null){
_66e.__minMouseX=-_66e.__maxX+e.clientX+x;
}
}
if(_66e.__vMode){
if(_66e.__minY!=null){
_66e.__minMouseY=e.clientY-y+_66e.__minY;
}
if(_66e.__maxY!=null){
_66e.__maxMouseY=_66e.__minMouseY+_66e.__maxY-_66e.__minY;
}
}else{
if(_66e.__minY!=null){
_66e.__maxMouseY=-_66e.__minY+e.clientY+y;
}
if(_66e.__maxY!=null){
_66e.__minMouseY=-_66e.__maxY+e.clientY+y;
}
}
document.onmousemove=DwtDraggable.__drag;
document.onmouseup=DwtDraggable.__end;
return false;
};
DwtDraggable.__drag=function(e){
e=DwtDraggable.__fixE(e);
var _672=DwtDraggable.dragEl;
var ey=e.clientY;
var ex=e.clientX;
var x=parseInt(_672.__hMode?_672.__root.style.left:_672.__root.style.right);
var y=parseInt(_672.__vMode?_672.__root.style.top:_672.__root.style.bottom);
var nx,ny;
if(!_672.__xMapper){
if(_672.__minX!=null){
ex=_672.__hMode?Math.max(ex,_672.__minMouseX):Math.min(ex,_672.__maxMouseX);
}
if(_672.__maxX!=null){
ex=_672.__hMode?Math.min(ex,_672.__maxMouseX):Math.max(ex,_672.__minMouseX);
}
nx=x+((ex-_672.__lastMouseX)*(_672.__hMode?1:-1));
}else{
nx=_672.__xMapper(x,ex);
}
if(!_672.__yMapper){
if(_672.__minY!=null){
ey=_672.__vMode?Math.max(ey,_672.__minMouseY):Math.min(ey,_672.__maxMouseY);
}
if(_672.__maxY!=null){
ey=_672.__vMode?Math.min(ey,_672.__maxMouseY):Math.max(ey,_672.__minMouseY);
}
ny=y+((ey-_672.__lastMouseY)*(_672.__vMode?1:-1));
}else{
ny=_672.__yMapper(y,ey);
}
DwtDraggable.dragEl.__root.style[_672.__hMode?"left":"right"]=nx+"px";
DwtDraggable.dragEl.__root.style[_672.__vMode?"top":"bottom"]=ny+"px";
DwtDraggable.dragEl.__lastMouseX=ex;
DwtDraggable.dragEl.__lastMouseY=ey;
if(DwtDraggable.dragEl.__root.onDrag){
DwtDraggable.dragEl.__root.onDrag.run([nx,ny]);
}
return false;
};
DwtDraggable.__end=function(){
document.onmousemove=null;
document.onmouseup=null;
if(DwtDraggable.dragEl.__root.onDragEnd){
DwtDraggable.dragEl.__root.onDragEnd.run([parseInt(DwtDraggable.dragEl.__root.style[DwtDraggable.dragEl.__hMode?"left":"right"]),parseInt(DwtDraggable.dragEl.__root.style[DwtDraggable.dragEl.__vMode?"top":"bottom"])]);
}
DwtDraggable.dragEl=null;
};
DwtDraggable.__fixE=function(e){
if(typeof e=="undefined"){
e=window.event;
}
if(typeof e.layerX=="undefined"){
e.layerX=e.offsetX;
}
if(typeof e.layerY=="undefined"){
e.layerY=e.offsetY;
}
return e;
};
function DwtDragTracker(){
}
DwtDragTracker.init=function(_679,_67a,_67b,_67c,_67d,_67e,_67f){
var ctxt=_679._dragTrackerContext={};
var _681=_679.getHtmlElement();
if(_67a){
_681.style.cursor=_67a;
}
ctxt.style=_67a;
ctxt.threshX=(_67b>0)?_67b:1;
ctxt.threshY=(_67c>0)?_67c:1;
ctxt.data={delta:{},userData:_67f};
ctxt.captureObj=new DwtMouseEventCapture(_679,null,DwtDragTracker._mouseOverHdlr,DwtDragTracker._mouseDownHdlr,DwtDragTracker._mouseMoveHdlr,DwtDragTracker._mouseUpHdlr,DwtDragTracker._mouseOutHdlr);
_679.setHandler(DwtEvent.ONMOUSEDOWN,DwtDragTracker._mouseDownHdlr);
_679.setHandler(DwtEvent.ONMOUSEOVER,DwtDragTracker._mouseOverHdlr);
_679.setHandler(DwtEvent.ONMOUSEOUT,DwtDragTracker._mouseOutHdlr);
ctxt.callbackFunc=_67d;
ctxt.callbackObj=_67e;
};
DwtDragTracker.STYLE_NONE="auto";
DwtDragTracker.STYLE_MOVE="move";
DwtDragTracker.STYLE_RESIZE_NORTHWEST="nw-resize";
DwtDragTracker.STYLE_RESIZE_NORTH="n-resize";
DwtDragTracker.STYLE_RESIZE_NORTHEAST="ne-resize";
DwtDragTracker.STYLE_RESIZE_WEST="w-resize";
DwtDragTracker.STYLE_RESIZE_EAST="e-resize";
DwtDragTracker.STYLE_RESIZE_SOUTHWEST="sw-resize";
DwtDragTracker.STYLE_RESIZE_SOUTH="s-resize";
DwtDragTracker.STYLE_RESIZE_SOUTHEAST="se-resize";
DwtDragTracker.STATE_START=1;
DwtDragTracker.STATE_DRAGGING=2;
DwtDragTracker.STATE_END=3;
DwtDragTracker._mouseOverHdlr=function(ev){
var _683=DwtShell.mouseEvent;
_683.setFromDhtmlEvent(ev);
_683._stopPropagation=true;
_683._returnValue=false;
_683.setToDhtmlEvent(ev);
return false;
};
DwtDragTracker._mouseDownHdlr=function(ev){
var _685=DwtShell.mouseEvent;
_685.setFromDhtmlEvent(ev);
if(_685.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(ev,true,false);
return false;
}
var _686=_685.dwtObj;
if(_686&&_686._dragTrackerContext){
var ctxt=_686._dragTrackerContext;
if(ctxt.callbackFunc!=null){
ctxt.captureObj.capture();
ctxt.data.startDoc={x:_685.docX,y:_685.docY};
ctxt.data.state=DwtDragTracker.STATE_START;
DwtDragTracker._doCallback(ctxt);
}
}
_685._stopPropagation=true;
_685._returnValue=false;
_685.setToDhtmlEvent(ev);
return false;
};
DwtDragTracker._doCallback=function(ctxt){
if(ctxt.callbackObj!=null){
ctxt.callbackFunc.call(ctxt.callbackObj,ctxt.data);
}else{
ctxt.callbackFunc(ctxt.data);
}
};
DwtDragTracker._mouseMoveHdlr=function(ev){
var _68a=DwtShell.mouseEvent;
_68a.setFromDhtmlEvent(ev);
var _68b=DwtMouseEventCapture.getTargetObj();
var ctxt=_68b._dragTrackerContext;
var data=ctxt.data;
data.delta.x=_68a.docX-data.startDoc.x;
data.delta.y=_68a.docY-data.startDoc.y;
if(Math.abs(data.delta.x)>=ctxt.threshX||Math.abs(data.delta.y)>=ctxt.threshY){
data.prevState=data.state;
data.state=DwtDragTracker.STATE_DRAGGING;
DwtDragTracker._doCallback(ctxt);
}
_68a._stopPropagation=true;
_68a._returnValue=false;
_68a.setToDhtmlEvent(ev);
return false;
};
DwtDragTracker._mouseUpHdlr=function(ev){
var _68f=DwtShell.mouseEvent;
_68f.setFromDhtmlEvent(ev);
if(_68f.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(ev,true,false);
return false;
}
var ctxt=DwtMouseEventCapture.getTargetObj()._dragTrackerContext;
if(ctxt){
if(ctxt.callbackFunc!=null){
DwtMouseEventCapture.getCaptureObj().release();
}
ctxt.data.state=DwtDragTracker.STATE_END;
DwtDragTracker._doCallback(ctxt);
}
_68f._stopPropagation=true;
_68f._returnValue=false;
_68f.setToDhtmlEvent(ev);
return false;
};
DwtDragTracker._mouseOutHdlr=function(ev){
var _692=DwtShell.mouseEvent;
_692.setFromDhtmlEvent(ev);
_692._stopPropagation=true;
_692._returnValue=false;
_692.setToDhtmlEvent(ev);
return false;
};
function DwtCssStyle(){
}
DwtCssStyle.SELECTED="selected";
DwtCssStyle.ACTIONED="actioned";
DwtCssStyle.MATCHED="matched";
DwtCssStyle.DND="dnd";
DwtCssStyle.ACTIVE="active";
DwtCssStyle.ACTIVATED="activated";
DwtCssStyle.TRIGGERED="triggered";
DwtCssStyle.TOGGLED="toggled";
DwtCssStyle.INACTIVE="inactive";
DwtCssStyle.DISABLED="disabled";
DwtCssStyle.FOCUSED="focused";
DwtCssStyle.getProperty=function(_693,_694){
var _695;
if(_693.ownerDocument==null){
for(var _696=_693.parentNode;_696.parentNode!=null;_696=_696.parentNode){
}
var doc=_696;
}else{
var doc=_693.ownerDocument;
}
if(doc.defaultView&&!AjxEnv.isSafari){
var _698=doc.defaultView.getComputedStyle(_693,"");
_695=_698.getPropertyValue(_694);
}else{
var _699=_694.split("-");
var _69a="";
var i;
var len=_699.length;
for(i=0;i<len;i++){
if(i!=0){
_69a+=_699[i].substring(0,1).toUpperCase();
}else{
_69a+=_699[i].substring(0,1);
}
_69a+=_699[i].substring(1);
}
if(_693.currentStyle){
_695=_693.currentStyle[_69a];
}else{
if(_693.style){
_695=_693.style[_69a];
}
}
}
return _695;
};
DwtCssStyle.getComputedStyleObject=function(_69d){
if(_69d.ownerDocument==null){
for(var _69e=_69d.parentNode;_69e.parentNode!=null;_69e=_69e.parentNode){
}
var doc=_69e;
}else{
var doc=_69d.ownerDocument;
}
if(doc.defaultView&&!AjxEnv.isSafari){
return doc.defaultView.getComputedStyle(_69d,"");
}else{
if(_69d.currentStyle){
return _69d.currentStyle;
}else{
if(_69d.style){
return _69d.style;
}
}
}
};
DwtCssStyle.removeProperty=function(el,prop){
if(prop instanceof Array){
for(var i=prop.length;--i>=0;){
DwtCssStyle.removeProperty(el,prop[i]);
}
}else{
if(AjxEnv.isIE){
el.style.removeAttribute(prop,true);
}else{
prop=prop.replace(/([A-Z])/g,"-$1");
el.style.removeProperty(prop);
}
}
};
function DwtPoint(x,y){
this.x=x;
this.y=y;
}
DwtPoint.prototype.toString=function(){
return "DwtPoint";
};
DwtPoint.prototype.set=function(x,y){
this.x=x;
this.y=y;
};
function DwtRectangle(x,y,_6a9,_6aa){
this.x=x;
this.y=y;
this.width=_6a9;
this.height=_6aa;
}
DwtRectangle.prototype.toString=function(){
return "DwtRectangle";
};
DwtRectangle.prototype.set=function(x,y,_6ad,_6ae){
this.x=x;
this.y=y;
};
function DwtUnits(){
}
DwtUnits.PIXEL_UNIT="px";
DwtUnits.CM_UNIT="cm";
DwtUnits.MM_UNIT="mm";
DwtUnits.INCH_UNIT="in";
DwtUnits.PCT_UNIT="%";
DwtUnits.POINT="pt";
DwtUnits.WIDTH_EM=AjxEnv.isIE?9:11;
DwtUnits.WIDTH_SEP=AjxEnv.isIE?6:8;
DwtUnits.WIDTH_ELLIPSIS=15;
function DwtEvent(_6af){
if(arguments.length==0){
return;
}
this.dwtObj=null;
}
DwtEvent.prototype.toString=function(){
return "DwtEvent";
};
DwtEvent.ONCHANGE="onchange";
DwtEvent.ONCLICK="onclick";
DwtEvent.ONCONTEXTMENU="oncontextmenu";
DwtEvent.ONDBLCLICK="ondblclick";
DwtEvent.ONFOCUS="onfocus";
DwtEvent.ONBLUR="onblur";
DwtEvent.ONKEYDOWN="onkeydown";
DwtEvent.ONKEYPRESS="onkeypress";
DwtEvent.ONKEYUP="onkeyup";
DwtEvent.ONMOUSEDOWN="onmousedown";
DwtEvent.ONMOUSEENTER="onmouseenter";
DwtEvent.ONMOUSELEAVE="onmouseleave";
DwtEvent.ONMOUSEMOVE="onmousemove";
DwtEvent.ONMOUSEOUT="onmouseout";
DwtEvent.ONMOUSEOVER="onmouseover";
DwtEvent.ONMOUSEUP="onmouseup";
DwtEvent.ONMOUSEWHEEL="onmousewheel";
DwtEvent.ONSELECTSTART="onselectstart";
DwtEvent.ACTION="ACTION";
DwtEvent.CONTROL="CONTROL";
DwtEvent.DATE_RANGE="DATE_RANGE";
DwtEvent.DISPOSE="DISPOSE";
DwtEvent.ENTER="ENTER";
DwtEvent.HOVEROVER="HOVEROVER";
DwtEvent.HOVEROUT="HOVEROUT";
DwtEvent.POPDOWN="POPDOWN";
DwtEvent.POPUP="POPUP";
DwtEvent.SELECTION="SELECTION";
DwtEvent.TREE="TREE";
DwtEvent.STATE_CHANGE="STATE_CHANGE";
DwtEvent.TAB="TAB";
DwtEvent.XFORMS_READY="xforms-ready";
DwtEvent.XFORMS_DISPLAY_UPDATED="xforms-display-updated";
DwtEvent.XFORMS_VALUE_CHANGED="xforms-value-changed";
DwtEvent.XFORMS_FORM_DIRTY_CHANGE="xforms-form-dirty-change";
DwtEvent.XFORMS_CHOICES_CHANGED="xforms-choices-changed";
DwtEvent.XFORMS_VALUE_ERROR="xforms-value-error";
DwtEvent.KEY_EVENTS=[DwtEvent.ONKEYDOWN,DwtEvent.ONKEYPRESS,DwtEvent.ONKEYUP];
DwtEvent.MOUSE_EVENTS=[DwtEvent.ONCONTEXTMENU,DwtEvent.ONDBLCLICK,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
function DwtEventManager(){
}
DwtEventManager._instance=new AjxEventMgr();
DwtEventManager._domEventToDwtMap={"ondblclick":DwtEvent.ONDBLCLICK,"onmousedown":DwtEvent.ONMOUSEDOWN,"onmouseup":DwtEvent.ONMOUSEUP,"onmousemove":DwtEvent.ONMOUSEMOVE,"onmouseout":DwtEvent.ONMOUSEOUT,"onmouseover":DwtEvent.ONMOUSEOVER,"onselectstart":DwtEvent.ONSELECTSTART,"onchange":DwtEvent.ONCHANGE};
DwtEventManager.addListener=function(_6b0,_6b1){
DwtEventManager._instance.addListener(_6b0,_6b1);
};
DwtEventManager.notifyListeners=function(_6b2,_6b3){
DwtEventManager._instance.notifyListeners(_6b2,_6b3);
};
DwtEventManager.removeListener=function(_6b4,_6b5){
DwtEventManager._instance.removeListener(_6b4,_6b5);
};
DwtEventManager.addGlobalListener=function(_6b6,_6b7,_6b8){
AjxCore.addListener(_6b6,_6b7,_6b8);
var _6b9=DwtEventManager._domEventToDwtMap[_6b7];
if(_6b9){
DwtEventManager.addListener(_6b9,_6b8);
}
};
function DwtDateRangeEvent(init){
if(arguments.length==0){
return;
}
DwtEvent.call(this,true);
this.reset();
}
DwtDateRangeEvent.prototype=new DwtEvent;
DwtDateRangeEvent.prototype.constructor=DwtDateRangeEvent;
DwtDateRangeEvent.prototype.toString=function(){
return "DwtDateRangeEvent";
};
DwtDateRangeEvent.prototype.reset=function(){
this.start=null;
this.end=null;
};
function DwtDisposeEvent(init){
if(arguments.length==0){
return;
}
DwtEvent.call(this,true);
}
DwtDisposeEvent.prototype=new DwtEvent;
DwtDisposeEvent.prototype.constructor=DwtDisposeEvent;
DwtDisposeEvent.prototype.toString=function(){
return "DwtDisposeEvent";
};
function DwtUiEvent(init){
if(arguments.length==0){
return;
}
DwtEvent.call(this,true);
this.reset();
}
DwtUiEvent.prototype=new DwtEvent;
DwtUiEvent.prototype.constructor=DwtUiEvent;
DwtUiEvent.prototype.toString=function(){
return "DwtUiEvent";
};
DwtUiEvent.prototype.reset=function(){
this.dwtObj=null;
this.altKey=false;
this.ctrlKey=false;
this.metaKey=false;
this.shiftKey=false;
this.target=null;
this.type=null;
this.docX=-1;
this.docY=-1;
this.elementX=-1;
this.elementY=-1;
this.ersatz=false;
this._stopPropagation=false;
this._returnValue=true;
this._dontCallPreventDefault=false;
};
DwtUiEvent.getEvent=function(ev,_6be){
ev=ev||window.event;
if(ev){
return ev;
}
if(_6be){
var pw=(_6be.ownerDocument||_6be.document||_6be).parentWindow;
return pw?pw.event:null;
}
};
DwtUiEvent.getTarget=function(ev){
ev=DwtUiEvent.getEvent(ev);
if(ev&&ev.target){
return ev.target.nodeType==3?ev.target.parentNode:ev.target;
}else{
if(ev&&ev.srcElement){
return ev.srcElement;
}else{
return null;
}
}
};
DwtUiEvent.getTargetWithProp=function(ev,prop){
var _6c3=DwtUiEvent.getTarget(ev);
while(_6c3){
if(Dwt.getAttr(_6c3,prop)!=null){
return _6c3;
}
_6c3=_6c3.parentNode;
}
return null;
};
DwtUiEvent.getTargetWithProps=function(ev,_6c5){
var _6c6=DwtUiEvent.getTarget(ev);
while(_6c6){
var okay=true;
for(var i in _6c5){
var val=Dwt.getAttr(_6c6,_6c5[i]);
if(val==null){
_6c6=_6c6.parentNode;
okay=false;
break;
}
}
if(okay){
return _6c6;
}
}
return null;
};
DwtUiEvent.getDwtObjFromEvent=function(ev){
var _6cb=DwtUiEvent.getTargetWithProp(ev,"dwtObj");
return _6cb?Dwt.getObjectFromElement(_6cb):null;
};
DwtUiEvent.getDwtObjWithProp=function(ev,prop){
var _6ce=DwtUiEvent.getTargetWithProps(ev,["dwtObj",prop]);
return _6ce?Dwt.getObjectFromElement(_6ce):null;
};
DwtUiEvent.copy=function(dest,src){
dest.altKey=src.altKey;
dest.ctrlKey=src.ctrlKey;
dest.metaKey=src.metaKey;
dest.shiftKey=src.shiftKey;
dest.target=src.target;
dest.type=src.type;
dest.dwtObj=src.dwtObj;
dest.docX=src.docX;
dest.docY=src.docY;
dest.elementX=src.elementX;
dest.elementY=src.elementY;
dest.ersatz=src.ersatz;
dest._stopPropagation=src._stopPropagation;
dest._returnValue=src._returnValue;
};
DwtUiEvent.prototype.setFromDhtmlEvent=function(ev){
ev=DwtUiEvent.getEvent(ev);
if(!ev){
return;
}
this.altKey=ev.altKey;
this.ctrlKey=ev.ctrlKey;
this.metaKey=ev.metaKey;
this.shiftKey=ev.shiftKey;
this.type=ev.type;
this.target=DwtUiEvent.getTarget(ev);
var _6d2=this.target;
while(_6d2!=null){
if(_6d2.dwtObj!=null){
this.dwtObj=Dwt.getObjectFromElement(_6d2);
break;
}
_6d2=_6d2.parentNode;
}
if(ev.pageX!=null){
this.docX=ev.pageX;
this.docY=ev.pageY;
}else{
if(ev.clientX!=null){
this.docX=ev.clientX+document.body.scrollLeft-document.body.clientLeft;
this.docY=ev.clientY+document.body.scrollTop-document.body.clientTop;
if(document.body.parentElement){
var _6d3=document.body.parentElement;
this.docX+=_6d3.scrollLeft-_6d3.clientLeft;
this.docY+=_6d3.scrollTop-_6d3.clientTop;
}
}
}
if(ev.offsetX!=null){
this.elementX=ev.offsetX;
this.elementY=ev.offsetY;
}else{
if(ev.layerX!=null){
this.elementX=ev.layerX;
this.elementY=ev.layerY;
}else{
this.elementX=Dwt.DEFAULT;
this.elementY=Dwt.DEFAULT;
}
}
this.ersatz=false;
return ev;
};
DwtUiEvent.prototype.setToDhtmlEvent=function(ev){
DwtUiEvent.setBehaviour(ev,this._stopPropagation,this._returnValue,this._dontCallPreventDefault);
};
DwtUiEvent.setBehaviour=function(ev,_6d6,_6d7,_6d8){
var _6d9=DwtUiEvent.getEvent(ev);
DwtUiEvent.setDhtmlBehaviour(_6d9,_6d6,_6d7,_6d8);
};
DwtUiEvent.setDhtmlBehaviour=function(_6da,_6db,_6dc,_6dd){
_6da=_6da||window.event;
if(_6da.stopPropagation!=null){
if(_6db){
_6da.stopPropagation();
}
if(!_6dc&&!_6dd){
_6da.preventDefault();
}
}else{
_6da.returnValue=_6dc;
_6da.cancelBubble=_6db;
}
};
function DwtControlEvent(){
this.reset();
}
DwtControlEvent.prototype=new DwtEvent;
DwtControlEvent.prototype.constructor=DwtControlEvent;
DwtControlEvent.prototype.toString=function(){
return "DwtControlEvent";
};
DwtControlEvent.prototype.reset=function(){
this.oldX=Dwt.DEFAULT;
this.oldY=Dwt.DEFAULT;
this.oldWidth=Dwt.DEFAULT;
this.oldHeight=Dwt.DEFAULT;
this.newX=Dwt.DEFAULT;
this.newY=Dwt.DEFAULT;
this.newWidth=Dwt.DEFAULT;
this.newHeight=Dwt.DEFAULT;
};
function DwtFocusEvent(init){
if(arguments.length==0){
return;
}
DwtEvent.call(this,true);
this.reset();
}
DwtFocusEvent.prototype=new DwtEvent;
DwtFocusEvent.prototype.constructor=DwtFocusEvent;
DwtFocusEvent.FOCUS=1;
DwtFocusEvent.BLUR=2;
DwtFocusEvent.prototype.toString=function(){
return "DwtFocusEvent";
};
DwtFocusEvent.prototype.reset=function(){
this.dwtObj=null;
this.state=DwtFocusEvent.FOCUS;
};
function DwtKeyEvent(){
DwtUiEvent.call(this,true);
this.reset(true);
}
DwtKeyEvent.KEY_END_OF_TEXT=3;
DwtKeyEvent.KEY_TAB=9;
DwtKeyEvent.KEY_RETURN=13;
DwtKeyEvent.KEY_ENTER=13;
DwtKeyEvent.KEY_ESCAPE=27;
DwtKeyEvent.prototype=new DwtUiEvent;
DwtKeyEvent.prototype.constructor=DwtKeyEvent;
DwtKeyEvent.prototype.toString=function(){
return "DwtKeyEvent";
};
DwtKeyEvent.isKeyEvent=function(ev){
return (ev.type.search(/^key/i)!=-1);
};
DwtKeyEvent.isKeyPressEvent=function(ev){
return (AjxEnv.isIE&&ev.type=="keydown")||(ev.type=="keypress");
};
DwtKeyEvent.prototype.reset=function(_6e1){
if(!_6e1){
DwtUiEvent.prototype.reset.call(this);
}
this.keyCode=0;
this.charCode=0;
};
DwtKeyEvent.prototype.setFromDhtmlEvent=function(ev){
ev=DwtUiEvent.prototype.setFromDhtmlEvent.call(this,ev);
this.charCode=(ev.charCode)?ev.charCode:ev.keyCode;
this.keyCode=ev.keyCode;
};
DwtKeyEvent.getCharCode=function(ev){
ev=DwtUiEvent.getEvent(ev);
return AjxEnv.isSafari?ev.keyCode:(ev.charCode||ev.keyCode);
};
DwtKeyEvent.copy=function(dest,src){
DwtUiEvent.copy(dest,src);
dest.charCode=src.charCode;
dest.keyCode=src.keyCode;
};
function DwtMouseEvent(){
DwtUiEvent.call(this,true);
this.reset(true);
}
DwtMouseEvent.prototype=new DwtUiEvent;
DwtMouseEvent.prototype.constructor=DwtMouseEvent;
DwtMouseEvent.prototype.toString=function(){
return "DwtMouseEvent";
};
DwtMouseEvent.NONE=0;
DwtMouseEvent.LEFT=1;
DwtMouseEvent.MIDDLE=2;
DwtMouseEvent.RIGHT=3;
DwtMouseEvent.prototype.reset=function(_6e6){
if(!_6e6){
DwtUiEvent.prototype.reset.call(this);
}
this.button=0;
this._populated=false;
};
DwtMouseEvent.prototype.setFromDhtmlEvent=function(ev){
ev=DwtUiEvent.prototype.setFromDhtmlEvent.call(this,ev);
if(ev.offsetX!=null){
if((ev.button&1)!=0){
this.button=DwtMouseEvent.LEFT;
}else{
if((ev.button&2)!=0){
this.button=DwtMouseEvent.RIGHT;
}else{
if((ev.button&4)!=0){
this.button=DwtMouseEvent.MIDDLE;
}else{
this.button=DwtMouseEvent.NONE;
}
}
}
}else{
if(ev.layerX!=null){
if(ev.which==1){
this.button=DwtMouseEvent.LEFT;
}else{
if(ev.which==2){
this.button=DwtMouseEvent.MIDDLE;
}else{
if(ev.which==3){
this.button=DwtMouseEvent.RIGHT;
}else{
this.button=DwtMouseEvent.NONE;
}
}
}
}
}
if(AjxEnv.isMac){
if(this.ctrlKey&&this.button==DwtMouseEvent.LEFT){
this.button=DwtMouseEvent.RIGHT;
this.ctrlKey=false;
}
if(this.altKey){
this.ctrlKey=true;
this.altKey=false;
}
}
};
function DwtMouseEventCapture(_6e8,id,_6ea,_6eb,_6ec,_6ed,_6ee,_6ef){
this.targetObj=_6e8;
this._id=id;
this._mouseOverHdlr=(_6ea!=null)?_6ea:DwtMouseEventCapture.emptyHdlr;
this._mouseDownHdlr=(_6eb!=null)?_6eb:DwtMouseEventCapture.emptyHdlr;
this._mouseMoveHdlr=(_6ec!=null)?_6ec:DwtMouseEventCapture.emptyHdlr;
this._mouseUpHdlr=(_6ed!=null)?_6ed:DwtMouseEventCapture.emptyHdlr;
this._mouseOutHdlr=(_6ee!=null)?_6ee:DwtMouseEventCapture.emptyHdlr;
this._hardCapture=(_6ef==null||_6ef==true)?true:false;
}
DwtMouseEventCapture._capturing=false;
DwtMouseEventCapture.getCaptureObj=function(){
return window._mouseEventCaptureObj;
};
DwtMouseEventCapture.getTargetObj=function(){
if(window._mouseEventCaptureObj!=null){
return window._mouseEventCaptureObj.targetObj;
}
return null;
};
DwtMouseEventCapture.getId=function(){
if(window._mouseEventCaptureObj!=null){
return window._mouseEventCaptureObj._id;
}
return null;
};
DwtMouseEventCapture.prototype.toString=function(){
return "DwtMouseEventCapture";
};
DwtMouseEventCapture.prototype.capturing=function(){
return DwtMouseEventCapture._capturing;
};
DwtMouseEventCapture.prototype.capture=function(){
if(window._mouseEventCaptureObj){
throw new DwtException("Mouse events already being captured",DwtException.INTERNAL_ERROR,"DwtMouseEventCapture.prototype.capture");
}
if(document.body!=null&&document.body.addEventListener!=null){
document.body.addEventListener("mouseover",this._mouseOverHdlr,true);
document.body.addEventListener("mousedown",this._mouseDownHdlr,true);
document.body.addEventListener("mousemove",this._mouseMoveHdlr,true);
document.body.addEventListener("mouseup",this._mouseUpHdlr,true);
document.body.addEventListener("mouseout",this._mouseOutHdlr,true);
}else{
this._savedMouseOverHdlr=document.onmouseover;
this._savedMouseDownHdlr=document.onmousedown;
this._savedMouseMoveHdlr=document.onmousemove;
this._savedMouseUpHdlr=document.onmouseup;
this._savedMouseOutHdlr=document.onmouseout;
document.onmouseover=this._mouseOverHdlr;
document.onmousedown=this._mouseDownHdlr;
document.onmousemove=this._mouseMoveHdlr;
document.onmouseup=this._mouseUpHdlr;
document.onmouseout=this._mouseOutHdlr;
}
if(this._hardCapture&&document.body&&document.body.setCapture){
document.body.setCapture();
}
window._mouseEventCaptureObj=this;
DwtMouseEventCapture._capturing=true;
};
DwtMouseEventCapture.prototype.release=function(){
if(window._mouseEventCaptureObj==null){
return;
}
var obj=window._shellCaptureObj;
if(document.body&&document.body.addEventListener){
document.body.removeEventListener("mouseover",this._mouseOverHdlr,true);
document.body.removeEventListener("mousedown",this._mouseDownHdlr,true);
document.body.removeEventListener("mousemove",this._mouseMoveHdlr,true);
document.body.removeEventListener("mouseup",this._mouseUpHdlr,true);
document.body.removeEventListener("mouseout",this._mouseOutHdlr,true);
}else{
document.onmouseover=this._savedMouseOverHdlr;
document.onmousedown=this._savedMouseDownHdlr;
document.onmousemove=this._savedMouseMoveHdlr;
document.onmouseup=this._savedMouseUpHdlr;
document.onmouseout=this._savedMouseOutHdlr;
}
if(this._hardCapture&&document.body&&document.body.releaseCapture){
document.body.releaseCapture();
}
window._mouseEventCaptureObj=null;
DwtMouseEventCapture._capturing=false;
};
DwtMouseEventCapture.emptyHdlr=function(ev){
var _6f2=DwtMouseEventCapture.getCaptureObj();
var _6f3=DwtShell.mouseEvent;
_6f3.setFromDhtmlEvent(ev);
if(_6f2._hardCapture){
_6f3._stopPropagation=true;
_6f3._returnValue=false;
_6f3.setToDhtmlEvent(ev);
return false;
}else{
_6f3._stopPropagation=false;
_6f3._returnValue=true;
_6f3.setToDhtmlEvent(ev);
return true;
}
};
function DwtListViewActionEvent(){
DwtMouseEvent.call(this);
this.reset(true);
}
DwtListViewActionEvent.prototype=new DwtMouseEvent;
DwtListViewActionEvent.prototype.constructor=DwtListViewActionEvent;
DwtListViewActionEvent.prototype.toString=function(){
return "DwtListViewActionEvent";
};
DwtListViewActionEvent.prototype.reset=function(_6f4){
if(!_6f4){
DwtMouseEvent.prototype.reset.call(this);
}
this.field=null;
this.item=null;
this.detail=null;
};
function DwtSelectionEvent(init){
if(arguments.length==0){
return;
}
DwtUiEvent.call(this,true);
this.reset(true);
}
DwtSelectionEvent.prototype=new DwtUiEvent;
DwtSelectionEvent.prototype.constructor=DwtSelectionEvent;
DwtSelectionEvent.prototype.toString=function(){
return "DwtSelectionEvent";
};
DwtSelectionEvent.prototype.reset=function(_6f6){
if(!_6f6){
DwtUiEvent.prototype.reset.call(this);
}
this.button=0;
this.detail=null;
this.item=null;
};
function DwtHtmlEditorStateEvent(init){
if(arguments.length==0){
return;
}
DwtEvent.call(this,true);
this.reset();
}
DwtHtmlEditorStateEvent.prototype=new DwtEvent;
DwtHtmlEditorStateEvent.prototype.constructor=DwtHtmlEditorStateEvent;
DwtHtmlEditorStateEvent.prototype.toString=function(){
return "DwtHtmlEditorStateEvent";
};
DwtHtmlEditorStateEvent.prototype.reset=function(){
this.isBold=null;
this.isItalic=null;
this.isUnderline=null;
this.isStrikeThru=null;
this.isSuperscript=null;
this.isSubscript=null;
this.isOrderedList=null;
this.isNumberedList=null;
this.fontName=null;
this.fontSize=null;
this.style=null;
this.backgroundColor=null;
this.color=null;
this.justification=null;
this.direction=null;
};
function DwtTreeEvent(){
DwtSelectionEvent.call(this,true);
}
DwtTreeEvent.prototype=new DwtSelectionEvent;
DwtTreeEvent.prototype.constructor=DwtTreeEvent;
DwtTreeEvent.prototype.toString=function(){
return "DwtTreeEvent";
};
DwtTreeEvent.prototype.setFromDhtmlEvent=function(ev,win){
ev=DwtSelectionEvent.prototype.setFromDhtmlEvent.call(this,ev);
};
function DwtHoverEvent(type,_6fb,_6fc,x,y){
if(arguments.length==0){
return;
}
DwtEvent.call(this,true);
this.type=type;
this.delay=_6fb;
this.object=_6fc;
this.x=AjxUtil.isUndefined(x)?-1:x;
this.y=AjxUtil.isUndefined(y)?-1:y;
}
DwtHoverEvent.prototype=new DwtEvent;
DwtHoverEvent.prototype.constructor=DwtHoverEvent;
DwtHoverEvent.prototype.reset=function(){
this.type=0;
this.delay=0;
this.object=null;
this.x=-1;
this.y=-1;
};
function DwtTabGroupEvent(){
this.tabGroup=null;
this.newFocusMember=null;
}
DwtTabGroupEvent.prototype.toString=function(){
return "DwtTabGroupEvent";
};
DwtTabGroupEvent.prototype.reset=function(){
this.tabGroup=null;
this.newFocusMember=null;
};
function DwtKeyMap(_6ff){
if(_6ff){
return;
}
this._map={};
this._args={};
this._load(this._map,AjxKeys,DwtKeyMap.MAP_NAME);
}
DwtKeyMap.deserialize=function(_700){
alert("DwtKeyMap.deserialize: NOT IMPLEMENTED");
};
DwtKeyMap.serialize=function(_701){
alert("DwtKeyMap.serialize: NOT IMPLEMENTED");
};
DwtKeyMap.MAP_NAME={};
DwtKeyMap.MAP_NAME["dialog"]="DwtDialog";
DwtKeyMap.MAP_NAME["button"]="DwtButton";
DwtKeyMap.MAP_NAME["list"]="DwtListView";
DwtKeyMap.MAP_NAME["menu"]="DwtMenu";
DwtKeyMap.MAP_NAME["toolbar"]="DwtToolBar";
DwtKeyMap.MAP_NAME["toolbarHorizontal"]="DwtToolBar-horiz";
DwtKeyMap.MAP_NAME["toolbarVertical"]="DwtToolBar-vert";
DwtKeyMap.MAP_NAME["tabView"]="DwtTabView";
DwtKeyMap.CTRL="Ctrl+";
DwtKeyMap.META="Meta+";
DwtKeyMap.ALT="Alt+";
DwtKeyMap.SHIFT="Shift+";
DwtKeyMap.ARROW_DOWN="ArrowDown";
DwtKeyMap.ARROW_LEFT="ArrowLeft";
DwtKeyMap.ARROW_RIGHT="ArrowRight";
DwtKeyMap.ARROW_UP="ArrowUp";
DwtKeyMap.BACKSPACE="Backspace";
DwtKeyMap.COMMA="Comma";
DwtKeyMap.SEMICOLON="Semicolon";
DwtKeyMap.DELETE="Del";
DwtKeyMap.END="End";
DwtKeyMap.ENTER="Enter";
DwtKeyMap.ESC="Esc";
DwtKeyMap.HOME="Home";
DwtKeyMap.PAGE_DOWN="PgDown";
DwtKeyMap.PAGE_UP="PgUp";
DwtKeyMap.SPACE="Space";
DwtKeyMap.BACKSLASH="Backslash";
DwtKeyMap.ACTION="ContextMenu";
DwtKeyMap.SELECT_CURRENT="SelectCurrent";
DwtKeyMap.ADD_SELECT_NEXT="AddNext";
DwtKeyMap.ADD_SELECT_PREV="AddPrevious";
DwtKeyMap.CANCEL="Cancel";
DwtKeyMap.DBLCLICK="DoubleClick";
DwtKeyMap.GOTO_TAB="GoToTab";
DwtKeyMap.NEXT="Next";
DwtKeyMap.NEXT_TAB="NextTab";
DwtKeyMap.PREV="Previous";
DwtKeyMap.PREV_TAB="PreviousTab";
DwtKeyMap.SELECT_ALL="SelectAll";
DwtKeyMap.SELECT="Select";
DwtKeyMap.SELECT_FIRST="SelectFirst";
DwtKeyMap.SELECT_LAST="SelectLast";
DwtKeyMap.SELECT_NEXT="SelectNext";
DwtKeyMap.SELECT_PREV="SelectPrevious";
DwtKeyMap.SUBMENU="SubMenu";
DwtKeyMap.PARENTMENU="ParentMenu";
DwtKeyMap.GOTO_TAB_RE=new RegExp(DwtKeyMap.GOTO_TAB+"(\\d+)");
DwtKeyMap.SEP=",";
DwtKeyMap.INHERIT="INHERIT";
DwtKeyMap.IS_DOC_KEY={};
DwtKeyMap.IS_DOC_KEY["description"]=true;
DwtKeyMap.IS_DOC_KEY["summary"]=true;
DwtKeyMap.IS_DOC_KEY["sort"]=true;
DwtKeyMap.IS_DOC_KEY["example"]=true;
DwtKeyMap.prototype.getMap=function(){
return this._map;
};
DwtKeyMap.prototype._load=function(map,keys,_704){
var _705=AjxEnv.platform.toLowerCase();
for(var _706 in keys){
var _707=_706.split(".");
var last=_707[_707.length-1];
if(last=="win"||last=="mac"||last=="linux"){
if(last==_705){
var _709=_707.slice(0,2).join(".");
keys[_709]=keys[_706];
}
keys[_706]=null;
}
}
for(var _706 in keys){
var _70a=keys[_706];
if(typeof keys[_706]!="string"){
continue;
}
var _707=_706.split(".");
var last=_707[_707.length-1];
if(DwtKeyMap.IS_DOC_KEY[last]){
continue;
}
var _70b=_704[_707[0]];
if(!this._checkMap(_70b)){
continue;
}
if(!map[_70b]){
map[_70b]={};
}
var _70c=_707[1];
if(!this._checkAction(_70b,_70c)){
continue;
}
var _70d=_70a.split(/\s*;\s*/);
for(var i=0;i<_70d.length;i++){
var ks=_70d[i];
if(_70c==DwtKeyMap.INHERIT){
var _710=ks.split(/\s*,\s*/);
var _711=[];
for(var p=0;p<_710.length;p++){
_711[p]=_704[_710[p]];
}
map[_70b][_70c]=_711.join(",");
}else{
map[_70b][ks]=_70c;
}
}
}
};
DwtKeyMap.prototype._checkMap=function(_713){
return true;
};
DwtKeyMap.prototype._checkAction=function(_714,_715){
return true;
};
function DwtKeyMapMgr(_716){
var map=this._map=_716.getMap();
this._args=_716._args;
this._fsas={};
for(var key in map){
this._fsas[key]=DwtKeyMapMgr.__buildFSA({},map[key],key);
}
}
DwtKeyMapMgr.NOT_A_TERMINAL=-999;
DwtKeyMapMgr.TAB_KEYCODE=9;
DwtKeyMapMgr._KEYCODES=[];
DwtKeyMapMgr.prototype.getActionCode=function(_719,_71a,_71b){
var _71c=this._fsas[_71a];
if(!_71c){
return null;
}
var _71d=_719.length;
var _71e=_71c;
var key;
for(var j=0;j<_71d&&_71e;j++){
key=_719[j];
if(!_71e[key]){
break;
}
if(j<_71d-1){
_71e=_71e[key].subMap;
}
}
if(!_71e){
return null;
}else{
if(_71e[key]){
var _721=_71e[key];
if(!_721.subMap||_71b){
return _721.actionCode;
}else{
return DwtKeyMapMgr.NOT_A_TERMINAL;
}
}else{
if(_71c.inherit&&_71c.inherit.length){
var _722=null;
var len=_71c.inherit.length;
for(var i=0;i<len;i++){
_722=this.getActionCode(_719,_71c.inherit[i],_71b);
if(_722!=null){
return _722;
}
}
return null;
}else{
return null;
}
}
}
};
DwtKeyMapMgr.prototype.keyCode2Char=function(_725){
return DwtKeyMapMgr._KEYCODES[_725];
};
DwtKeyMapMgr.prototype.getAction=function(_726,_727){
return this._map[_726][_727];
};
DwtKeyMapMgr.prototype.getKeySequences=function(_728,_729){
var _72a=[];
for(var ks in this._map[_728]){
if(this._map[_728][ks]==_729){
_72a.push(ks);
}
}
return _72a;
};
DwtKeyMapMgr.prototype.setMapping=function(_72c,_72d,_72e){
this._map[_72c][_72d]=_72e;
};
DwtKeyMapMgr.prototype.removeMapping=function(_72f,_730){
delete this._map[_72f][_730];
};
DwtKeyMapMgr.prototype.replaceMapping=function(_731,_732,_733){
var _734=this._map[_731][_732];
if(!_734){
return;
}
this.removeMapping(_731,_732);
this.setMapping(_731,_733,_734);
};
DwtKeyMapMgr.prototype.setArg=function(_735,_736,arg){
if(!this._args[_735]){
this._args[_735]={};
}
this._args[_735][_736]=arg;
};
DwtKeyMapMgr.prototype.getArg=function(_738,_739){
return this._args[_738]?this._args[_738][_739]:null;
};
DwtKeyMapMgr.prototype.reloadMap=function(_73a){
this._fsas[_73a]=DwtKeyMapMgr.__buildFSA({},this._map[_73a],_73a);
};
DwtKeyMapMgr._isAlphaUs=function(_73b){
return (_73b>64&&_73b<91);
};
DwtKeyMapMgr._isNumericUs=function(_73c){
return (_73c>47&&_73c<58);
};
DwtKeyMapMgr._isAlphanumericUs=function(_73d){
return (DwtKeyMapMgr._isNumericUs(_73d)||DwtKeyMapMgr._isAlphaUs(_73d));
};
DwtKeyMapMgr._isPunctuationUs=function(_73e){
switch(_73e){
case 186:
case 187:
case 188:
case 189:
case 190:
case 191:
case 192:
case 219:
case 220:
case 221:
case 222:
return true;
default:
return false;
}
};
DwtKeyMapMgr._isModifierUs=function(_73f){
switch(_73f){
case 16:
case 17:
case 18:
case 91:
return true;
default:
return false;
}
};
DwtKeyMapMgr.isUsableTextInputValueUs=function(_740,_741){
if(!DwtKeyMapMgr.__isInputElement(_741)){
return false;
}
if(DwtKeyMapMgr._isAlphanumericUs(_740)||DwtKeyMapMgr._isPunctuationUs(_740)){
return true;
}
switch(_740){
case 37:
case 39:
case 8:
case 45:
case 46:
case 35:
case 32:
return true;
case 13:
var tag=_741.tagName.toUpperCase();
return (tag!="INPUT");
default:
return false;
}
};
DwtKeyMapMgr.__isInputElement=function(_743){
var dm=_743.ownerDocument?_743.ownerDocument.designMode:null;
if(dm&&(dm.toLowerCase()=="on")){
return true;
}
var tag=_743.tagName.toUpperCase();
return (tag=="INPUT"||tag=="TEXTAREA");
};
DwtKeyMapMgr.__buildFSA=function(fsa,_747,_748){
for(var i in _747){
if(i==DwtKeyMap.INHERIT){
fsa.inherit=_747[i].split(/\s*,\s*/);
continue;
}
var _74a=i.split(DwtKeyMap.SEP);
var _74b=_74a.length;
var _74c=fsa;
for(var j=0;j<_74b;j++){
var key=_74a[j];
if(!_74c[key]){
_74c[key]={};
}
if(j==_74b-1){
_74c[key].actionCode=_747[i];
}else{
if(!_74c[key].subMap){
_74c[key].subMap={};
}
_74c=_74c[key].subMap;
}
}
}
return fsa;
};
(function(){
DwtKeyMapMgr._KEYCODES[18]=DwtKeyMap.ALT;
DwtKeyMapMgr._KEYCODES[40]=DwtKeyMap.ARROW_DOWN;
DwtKeyMapMgr._KEYCODES[37]=DwtKeyMap.ARROW_LEFT;
DwtKeyMapMgr._KEYCODES[39]=DwtKeyMap.ARROW_RIGHT;
DwtKeyMapMgr._KEYCODES[38]=DwtKeyMap.ARROW_UP;
DwtKeyMapMgr._KEYCODES[8]=DwtKeyMap.BACKSPACE;
DwtKeyMapMgr._KEYCODES[188]=DwtKeyMap.COMMA;
DwtKeyMapMgr._KEYCODES[186]=DwtKeyMap.SEMICOLON;
DwtKeyMapMgr._KEYCODES[59]=DwtKeyMap.SEMICOLON;
DwtKeyMapMgr._KEYCODES[17]=DwtKeyMap.CTRL;
DwtKeyMapMgr._KEYCODES[46]=DwtKeyMap.DELETE;
DwtKeyMapMgr._KEYCODES[35]=DwtKeyMap.END;
DwtKeyMapMgr._KEYCODES[13]=DwtKeyMap.ENTER;
DwtKeyMapMgr._KEYCODES[27]=DwtKeyMap.ESC;
DwtKeyMapMgr._KEYCODES[36]=DwtKeyMap.HOME;
DwtKeyMapMgr._KEYCODES[91]=DwtKeyMap.META;
DwtKeyMapMgr._KEYCODES[34]=DwtKeyMap.PAGE_DOWN;
DwtKeyMapMgr._KEYCODES[33]=DwtKeyMap.PAGE_UP;
DwtKeyMapMgr._KEYCODES[16]=DwtKeyMap.SHIFT;
DwtKeyMapMgr._KEYCODES[32]=DwtKeyMap.SPACE;
DwtKeyMapMgr._KEYCODES[9]=DwtKeyMap.TAB;
DwtKeyMapMgr._KEYCODES[220]=DwtKeyMap.BACKSLASH;
for(var i=112;i<124;i++){
DwtKeyMapMgr._KEYCODES[i]="F"+(i-111);
}
for(var i=65;i<91;i++){
DwtKeyMapMgr._KEYCODES[i]=String.fromCharCode(i);
}
for(var i=48;i<58;i++){
DwtKeyMapMgr._KEYCODES[i]=String.fromCharCode(i);
}
DwtKeyMapMgr._KEYCODES[222]="'";
DwtKeyMapMgr._KEYCODES[189]="-";
DwtKeyMapMgr._KEYCODES[190]=".";
DwtKeyMapMgr._KEYCODES[191]="/";
DwtKeyMapMgr._KEYCODES[186]=";";
DwtKeyMapMgr._KEYCODES[219]="[";
DwtKeyMapMgr._KEYCODES[221]="]";
DwtKeyMapMgr._KEYCODES[192]="`";
DwtKeyMapMgr._KEYCODES[187]="=";
DwtKeyMapMgr.isAlpha=DwtKeyMapMgr._isAlphaUs;
DwtKeyMapMgr.isNumeric=DwtKeyMapMgr._isNumericUs;
DwtKeyMapMgr.isAlphanumeric=DwtKeyMapMgr._isAlphanumericUs;
DwtKeyMapMgr.isPunctuation=DwtKeyMapMgr._isPunctuationUs;
DwtKeyMapMgr.isUsableTextInputValue=DwtKeyMapMgr.isUsableTextInputValueUs;
DwtKeyMapMgr.isModifier=DwtKeyMapMgr._isModifierUs;
})();
function DwtKeyMapMgrException(msg,code,_752,_753){
DwtException.call(this,msg,code,_752,detail);
this._keySeqStr=_753;
}
DwtKeyMapMgrException.prototype=new DwtException;
DwtKeyMapMgrException.prototype.constructor=DwtKeyMapMgrException;
DwtKeyMapMgrException.NON_TERM_HAS_ACTION=1;
DwtKeyMapMgrException.TERM_HAS_SUBMAP=2;
DwtException.prototype.toString=function(){
return "DwtKeyMapMgrException";
};
function DwtKeyboardMgr(){
this.__tabGrpStack=[];
this.__defaultHandlerStack=[];
this.__tabGroupChangeListenerObj=new AjxListener(this,this.__tabGrpChangeListener);
this.__kbEventStatus=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
this.__keyTimeout=750;
this.__currTabGroup=null;
this.__currDefaultHandler=null;
}
DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED=1;
DwtKeyboardMgr.__KEYSEQ_HANDLED=2;
DwtKeyboardMgr.__KEYSEQ_PENDING=3;
DwtKeyboardMgr.prototype.toString=function(){
return "DwtKeyboardMgr";
};
DwtKeyboardMgr.prototype.pushTabGroup=function(_754){
if(!this.__keyboardHandlingInited||!_754){
return;
}
this.__tabGrpStack.push(_754);
this.__currTabGroup=_754;
var _755=_754.getFocusMember();
if(!_755){
_755=_754.resetFocusMember(true);
}
if(!_755){
return;
}
_754.addFocusChangeListener(this.__tabGroupChangeListenerObj);
this.grabFocus(_755);
};
DwtKeyboardMgr.prototype.popTabGroup=function(_756){
if(!this.__keyboardHandlingInited){
return;
}
if(!_756){
return;
}
if(this.__tabGrpStack.length<=1){
return null;
}
if(_756&&this.__tabGrpStack[this.__tabGrpStack.length-1]!=_756){
var a=this.__tabGrpStack;
var len=a.length;
for(var i=len-1;i>=0;i--){
if(_756==a[i]){
a[i].dump();
break;
}
}
if(i<0){
return null;
}else{
if(i!=len-1){
a.splice(i,1);
return _756;
}
}
}
var _756=this.__tabGrpStack.pop();
_756.removeFocusChangeListener(this.__tabGroupChangeListenerObj);
var _75a=null;
if(this.__tabGrpStack.length>0){
_75a=this.__tabGrpStack[this.__tabGrpStack.length-1];
var _75b=_75a.getFocusMember();
if(!_75b){
_75b=_75a.resetFocusMember(true);
}
if(_75b){
this.grabFocus(_75b);
}
}
this.__currTabGroup=_75a;
return _756;
};
DwtKeyboardMgr.prototype.setTabGroup=function(_75c){
if(!this.__enabled||!this.__keyboardHandlingInited){
return;
}
var otg=this.popTabGroup();
this.pushTabGroup(_75c);
return otg;
};
DwtKeyboardMgr.prototype.pushDefaultHandler=function(_75e){
if(!this.__enabled||!this.__keyboardHandlingInited||!_75e){
return;
}
this.__defaultHandlerStack.push(_75e);
this.__currDefaultHandler=_75e;
};
DwtKeyboardMgr.prototype.popDefaultHandler=function(){
if(!this.__keyboardHandlingInited||(this.__defaultHandlerStack.length<=1)){
return;
}
var _75f=this.__defaultHandlerStack.pop();
this.__currDefaultHandler=this.__defaultHandlerStack[this.__defaultHandlerStack.length-1];
return _75f;
};
DwtKeyboardMgr.prototype.grabFocus=function(_760){
if(!this.__enabled){
return;
}
if(!this.__keyboardHandlingInited){
return;
}
if(!_760){
return;
}
if(this.__currTabGroup){
this.__currTabGroup.setFocusMember(_760,false,true);
}
this.__doGrabFocus(_760);
};
DwtKeyboardMgr.prototype.dwtControlHasFocus=function(_761){
if(!this.__enabled){
return false;
}
if(!this.__keyboardHandlingInited){
return false;
}
return (this.__dwtCtrlHasFocus&&this.__focusObj==_761);
};
DwtKeyboardMgr.prototype.registerDefaultKeyActionHandler=function(hdlr){
if(!this.__enabled){
return;
}
this.__defaultKeyActionHdlr=hdlr;
};
DwtKeyboardMgr.prototype.registerKeyMap=function(_763){
if(!this.__checkStatus()){
return;
}
this.__keyMapMgr=new DwtKeyMapMgr(_763);
};
DwtKeyboardMgr.prototype.setKeyTimeout=function(_764){
this.__keyTimeout=_764;
};
DwtKeyboardMgr.prototype.enable=function(_765){
this.__enabled=_765;
if(_765){
Dwt.setHandler(document,DwtEvent.ONKEYDOWN,DwtKeyboardMgr.__keyDownHdlr);
Dwt.setHandler(document,DwtEvent.ONKEYUP,DwtKeyboardMgr.__keyUpHdlr);
Dwt.setHandler(document,DwtEvent.ONKEYPRESS,DwtKeyboardMgr.__keyPressHdlr);
}else{
Dwt.clearHandler(document,DwtEvent.ONKEYDOWN);
Dwt.clearHandler(document,DwtEvent.ONKEYUP);
Dwt.clearHandler(document,DwtEvent.ONKEYPRESS);
}
};
DwtKeyboardMgr.prototype.isEnabled=function(){
return this.__enabled;
};
DwtKeyboardMgr.prototype.__initKeyboardHandling=function(){
var kbff=this._kbFocusField=document.createElement("input");
kbff.type="text";
kbff.tabIndex=0;
kbff.style.position=Dwt.ABSOLUTE_STYLE;
kbff.style.top=kbff.style.left=Dwt.LOC_NOWHERE;
kbff.onblur=DwtKeyboardMgr.__onBlurHdlr;
kbff.onfocus=DwtKeyboardMgr.__onFocusHdlr;
document.body.appendChild(kbff);
this.__killKeySeqTimedAction=new AjxTimedAction(this,this.__killKeySequenceAction);
this.__killKeySeqTimedActionId=-1;
this.__keySequence=[];
this.__keyboardHandlingInited=true;
};
DwtKeyboardMgr.prototype.__checkStatus=function(){
if(!this.__enabled){
return false;
}
if(!this.__keyboardHandlingInited){
this.__initKeyboardHandling();
}
return true;
};
DwtKeyboardMgr.prototype.__doGrabFocus=function(_767){
if(!_767){
return;
}
var _768=(_767 instanceof DwtInputField||_767 instanceof DwtHtmlEditor);
if(_768||!(_767 instanceof DwtControl)){
if(this.__focusObj instanceof DwtControl&&!this.__dwtInputCtrl){
this.__oldFocusObj=this.__focusObj;
}
this.__focusObj=_767;
this.__dwtInputCtrl=_768;
var el=_768?_767.getInputElement():_767;
if((!AjxEnv.isIE&&_767.focus)||(AjxEnv.isIE&&_767.focus&&!el.disabled&&Dwt.getVisible(el))){
try{
_767.focus();
}
catch(ex){
}
}
}else{
if(this.__dwtCtrlHasFocus&&(this.__focusObj instanceof DwtControl)){
DwtKeyboardMgr.__onBlurHdlr();
this.__dwtCtrlHasFocus=true;
}
this.__focusObj=_767;
this.__dwtInputCtrl=false;
if(this.__dwtCtrlHasFocus){
DwtKeyboardMgr.__onFocusHdlr();
}else{
this._kbFocusField.focus();
}
}
};
DwtKeyboardMgr.__onFocusHdlr=function(ev){
var _76b=DwtShell.getShell(window).getKeyboardMgr();
_76b.__dwtCtrlHasFocus=true;
var _76c=_76b.__focusObj;
if(_76c&&_76c.__doFocus&&(typeof _76c.__doFocus=="function")){
_76c.__doFocus();
}
};
DwtKeyboardMgr.__onBlurHdlr=function(ev){
var _76e=DwtShell.getShell(window).getKeyboardMgr();
var _76f=_76e.__oldFocusObj?_76e.__oldFocusObj:_76e.__focusObj;
if(_76f&&_76f.__doBlur&&(typeof _76f.__doBlur=="function")){
_76f.__doBlur();
}
_76e.__oldFocusObj=null;
_76e.__dwtCtrlHasFocus=false;
};
DwtKeyboardMgr.__keyUpHdlr=function(ev){
ev=DwtUiEvent.getEvent(ev,this);
var _771=DwtShell.getShell(window).getKeyboardMgr();
var kev=DwtShell.keyEvent;
kev.setFromDhtmlEvent(ev);
if(_771.__kbEventStatus!=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED){
return _771.__processKeyEvent(ev,kev,false);
}
};
DwtKeyboardMgr.__keyPressHdlr=function(ev){
ev=DwtUiEvent.getEvent(ev,this);
return DwtKeyboardMgr.__keyUpHdlr(ev);
};
DwtKeyboardMgr.__syncFocus=function(_774,obj){
if((obj!=_774._kbFocusField)&&_774.__dwtCtrlHasFocus){
DwtKeyboardMgr.__onBlurHdlr();
}
if(!_774.__dwtCtrlHasFocus){
if((obj!=_774.__focusObj)&&!_774.__dwtInputCtrl){
if(_774.__currTabGroup&&_774.__currTabGroup.setFocusMember(obj)){
_774.__focusObj=obj;
_774.__oldFocusObj=null;
}else{
return false;
}
}
}
return true;
};
DwtKeyboardMgr.__keyDownHdlr=function(ev){
ev=DwtUiEvent.getEvent(ev,this);
var _777=DwtShell.getShell(window);
var _778=_777.getKeyboardMgr();
var kev=DwtShell.keyEvent;
kev.setFromDhtmlEvent(ev);
var _77a=kev.keyCode;
_777.getToolTip().popdown();
var _77b=DwtKeyboardMgr.__syncFocus(_778,kev.target);
if(!_77b){
}
if(_77a==DwtKeyMapMgr.TAB_KEYCODE){
if(_778.__currTabGroup&&!kev.ctrlKey&&!kev.altKey){
if(!DwtMenu.menuShowing()){
if(_77b||_778.__currTabGroup.getFocusMember()){
if(!kev.shiftKey){
_778.__currTabGroup.getNextFocusMember(true);
}else{
_778.__currTabGroup.getPrevFocusMember(true);
}
}else{
_778.__currTabGroup.resetFocusMember(true);
}
}
return _778.__processKeyEvent(ev,kev,false,DwtKeyboardMgr.__KEYSEQ_HANDLED);
}else{
return _778.__processKeyEvent(ev,kev,true,DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED);
}
}else{
if(_778.__currTabGroup&&!_77b&&AjxEnv.isGecko&&kev.target instanceof HTMLHtmlElement){
_778.__currTabGroup.resetFocusMember(true);
}
}
if(_778.__dwtCtrlHasFocus){
_778._kbFocusField.value="";
}
if(DwtKeyMapMgr.isModifier(_77a)||(!_778.__dwtCtrlHasFocus&&_778.__killKeySeqTimedActionId==-1&&!kev.ctrlKey&&!kev.altKey&&DwtKeyMapMgr.isUsableTextInputValue(_77a,kev.target))){
return _778.__processKeyEvent(ev,kev,true,DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED);
}
if(_778.__killKeySeqTimedActionId!=-1){
AjxTimedAction.cancelAction(_778.__killKeySeqTimedActionId);
_778.__killKeySeqTimedActionId=-1;
}
var key="";
if(kev.metaKey){
key+=DwtKeyMap.META;
}
if(kev.ctrlKey){
key+=DwtKeyMap.CTRL;
}
if(kev.altKey){
key+=DwtKeyMap.ALT;
}
if(kev.shiftKey){
key+=DwtKeyMap.SHIFT;
}
_778.__keySequence[_778.__keySequence.length]=key+_778.__keyMapMgr.keyCode2Char(_77a);
var _77d=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
var obj=(_778.__dwtCtrlHasFocus)?_778.__focusObj:null;
if(obj&&(obj instanceof DwtControl)){
_77d=_778.__dispatchKeyEvent(obj,kev);
while((_77d==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)&&obj.parent&&obj.parent.getKeyMapName){
obj=obj.parent;
_77d=_778.__dispatchKeyEvent(obj,kev);
}
}
if((_77d==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)&&_778.__currDefaultHandler&&!(_778.__currTabGroup&&_778.__currTabGroup.isDefaultHandlingBlocked())){
_77d=_778.__dispatchKeyEvent(_778.__currDefaultHandler,kev);
}
_778.__kbEventStatus=_77d;
switch(_77d){
case DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED:
_778.__keySequence.length=0;
return _778.__processKeyEvent(ev,kev,true);
case DwtKeyboardMgr.__KEYSEQ_HANDLED:
_778.__keySequence.length=0;
case DwtKeyboardMgr.__KEYSEQ_PENDING:
return _778.__processKeyEvent(ev,kev,false);
}
};
DwtKeyboardMgr.prototype.__dispatchKeyEvent=function(hdlr,ev,_781){
var _782=hdlr.getKeyMapName?hdlr.getKeyMapName():null;
if(!_782){
return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
}
var _783=this.__keyMapMgr.getActionCode(this.__keySequence,_782,_781);
if(_783==DwtKeyMapMgr.NOT_A_TERMINAL){
this.__hdlr=hdlr;
this.__mapName=_782;
this.__ev=ev;
this.__killKeySeqTimedActionId=AjxTimedAction.scheduleAction(this.__killKeySeqTimedAction,this.__keyTimeout);
return DwtKeyboardMgr.__KEYSEQ_PENDING;
}else{
if(_783!=null){
if(!hdlr.handleKeyAction){
return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
}
return (hdlr.handleKeyAction(_783,ev))?DwtKeyboardMgr.__KEYSEQ_HANDLED:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
}else{
return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
}
}
};
DwtKeyboardMgr.prototype.__killKeySequenceAction=function(){
this.__dispatchKeyEvent(this.__hdlr,this.__mapName,this.__ev,true);
this.__killKeySeqTimedActionId=-1;
this.__keySequence.length=0;
};
DwtKeyboardMgr.prototype.__tabGrpChangeListener=function(ev){
this.__doGrabFocus(ev.newFocusMember);
};
DwtKeyboardMgr.prototype.__processKeyEvent=function(ev,kev,_787,_788){
if(_788){
this.__kbEventStatus=_788;
}
kev._stopPropagation=!_787;
kev._returnValue=_787;
kev.setToDhtmlEvent(ev);
return _787;
};
function DwtTabGroup(name,_78a){
this.__members=new AjxVector();
this.__parent=null;
this.__name=name;
this.__blockApplicationHandling=_78a;
this.__currFocusMember=null;
this.__evtMgr=new AjxEventMgr();
}
DwtTabGroup.NOT_ROOT_TABGROUP="NOT ROOT TAB GROUP";
DwtTabGroup.__changeEvt=new DwtTabGroupEvent();
DwtTabGroup.prototype.toString=function(){
return "DwtTabGroup";
};
DwtTabGroup.prototype.addFocusChangeListener=function(_78b){
this.__checkRoot();
this.__evtMgr.addListener(DwtEvent.STATE_CHANGE,_78b);
};
DwtTabGroup.prototype.removeFocusChangeListener=function(_78c){
this.__checkRoot();
this.__evtMgr.removeListener(DwtEvent.STATE_CHANGE,_78c);
};
DwtTabGroup.prototype.addMember=function(_78d,_78e){
if(!_78d){
return;
}
this.__members.add(_78d,_78e);
if(_78d instanceof DwtTabGroup){
_78d.newParent(this);
}
};
DwtTabGroup.prototype.addMemberAfter=function(_78f,_790){
this.addMember(_78f,this.__members.indexOf(_790)+1);
};
DwtTabGroup.prototype.addMemberBefore=function(_791,_792){
this.addMember(_791,this.__members.indexOf(_792));
};
DwtTabGroup.prototype.removeMember=function(_793,_794,_795){
return this.replaceMember(_793,null,_794,_795);
};
DwtTabGroup.prototype.replaceMember=function(_796,_797,_798,_799,_79a,_79b){
var tg=this.__getTabGroupForMember(_796);
if(!tg){
return null;
}
var root=this.__getRootTabGroup();
var _79e;
if(_79a){
_79e=_79a;
}else{
if(root.__currFocusMember==_796||((_796 instanceof DwtTabGroup)&&_796.contains(root.__currFocusMember))){
if(_797){
_79e=(_797 instanceof DwtTabGroup)?_797.getFirstMember():_797;
}else{
_79e=this.__getPrevMember(_796,_798);
if(!_79e){
_79e=this.__getNextMember(_796,_798);
}
}
}
}
if(_79e&&!_79b){
root.__currFocusMember=_79e;
if(!_799){
this.__notifyListeners(_79e);
}
}
return _797?this.__members.replaceObject(_796,_797):this.__members.remove(_796);
};
DwtTabGroup.prototype.contains=function(_79f){
return (this.__getTabGroupForMember(_79f));
};
DwtTabGroup.prototype.newParent=function(_7a0){
this.__parent=_7a0;
};
DwtTabGroup.prototype.getFirstMember=function(_7a1){
return this.__getLeftMostMember(_7a1);
};
DwtTabGroup.prototype.getLastMember=function(_7a2){
return this.__getRightMostMember(_7a2);
};
DwtTabGroup.prototype.getFocusMember=function(){
this.__checkRoot();
return this.__currFocusMember;
};
DwtTabGroup.prototype.setFocusMember=function(_7a3,_7a4,_7a5){
this.__checkRoot();
if(!this.__checkEnabled(_7a3,_7a4)){
return false;
}
var tg=this.__getTabGroupForMember(_7a3);
if(tg){
this.__currFocusMember=_7a3;
if(!_7a5){
this.__notifyListeners(this.__currFocusMember);
}
return true;
}
return false;
};
DwtTabGroup.prototype.getNextFocusMember=function(_7a7,_7a8){
this.__checkRoot();
return this.__setFocusMember(true,_7a7,_7a8);
};
DwtTabGroup.prototype.getPrevFocusMember=function(_7a9,_7aa){
this.__checkRoot();
return this.__setFocusMember(false,_7a9,_7aa);
};
DwtTabGroup.prototype.resetFocusMember=function(_7ab,_7ac){
this.__checkRoot();
var _7ad=this.__getLeftMostMember(_7ab);
if((_7ad!=this.__currFocusMember)&&!_7ac){
this.__notifyListeners(this.__currFocusMember);
}
this.__currFocusMember=_7ad;
return this.__currFocusMember;
};
DwtTabGroup.prototype.blockDefaultHandling=function(_7ae){
this.__blockDefaultHandling=blockDefaultHandling;
};
DwtTabGroup.prototype.isDefaultHandlingBlocked=function(_7af){
return this.__blockDefaultHandling;
};
DwtTabGroup.prototype.dump=function(_7b0){
this.__dump(this,_7b0);
};
DwtTabGroup.prototype.__getPrevMember=function(_7b1,_7b2){
var a=this.__members.getArray();
for(var i=this.__members.indexOf(_7b1)-1;i>-1;i--){
var _7b5=a[i];
if(!(_7b5 instanceof DwtTabGroup)){
if(this.__checkEnabled(_7b5,_7b2)){
return _7b5;
}
}else{
_7b5=_7b5.__getRightMostMember(_7b2);
if(_7b5&&this.__checkEnabled(_7b5,_7b2)){
return _7b5;
}
}
}
return this.__parent?this.__parent.__getPrevMember(this,_7b2):null;
};
DwtTabGroup.prototype.__checkEnabled=function(_7b6,_7b7){
if(!_7b7){
return true;
}
if(!_7b6||_7b6.noTab){
return false;
}
if(_7b6 instanceof DwtControl){
return (_7b6.getEnabled()&&_7b6.getVisible());
}else{
return !_7b6.disabled;
}
};
DwtTabGroup.prototype.__getNextMember=function(_7b8,_7b9){
var a=this.__members.getArray();
var sz=this.__members.size();
for(var i=this.__members.indexOf(_7b8)+1;i<sz;i++){
var _7bd=a[i];
if(!(_7bd instanceof DwtTabGroup)){
if(this.__checkEnabled(_7bd,_7b9)){
return _7bd;
}
}else{
_7bd=_7bd.__getLeftMostMember(_7b9);
if(_7bd&&this.__checkEnabled(_7bd,_7b9)){
return _7bd;
}
}
}
return this.__parent?this.__parent.__getNextMember(this,_7b9):null;
};
DwtTabGroup.prototype.__getRightMostMember=function(_7be){
var a=this.__members.getArray();
var _7c0=null;
for(var i=this.__members.size()-1;i>=0;i--){
_7c0=a[i];
if(!(_7c0 instanceof DwtTabGroup)){
if(this.__checkEnabled(_7c0,_7be)){
break;
}
}else{
_7c0=_7c0.__getRightMostMember(_7be);
if(_7c0&&this.__checkEnabled(_7c0,_7be)){
break;
}
}
}
return (_7c0&&this.__checkEnabled(_7c0,_7be))?_7c0:null;
};
DwtTabGroup.prototype.__getLeftMostMember=function(_7c2){
var sz=this.__members.size();
var a=this.__members.getArray();
var _7c5=null;
for(var i=0;i<sz;i++){
_7c5=a[i];
if(!(_7c5 instanceof DwtTabGroup)){
if(this.__checkEnabled(_7c5,_7c2)){
break;
}
}else{
_7c5=_7c5.__getLeftMostMember(_7c2);
if(_7c5&&this.__checkEnabled(_7c5,_7c2)){
break;
}
}
}
return (_7c5&&this.__checkEnabled(_7c5,_7c2))?_7c5:null;
};
DwtTabGroup.prototype.__notifyListeners=function(_7c7){
var _7c8=this.__getRootTabGroup();
if(_7c8.__evtMgr){
var evt=DwtTabGroup.__changeEvt;
evt.reset();
evt.tabGroup=this;
evt.newFocusMember=_7c7;
_7c8.__evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,evt);
}
};
DwtTabGroup.prototype.__getRootTabGroup=function(){
var root=this;
while(root.__parent){
root=root.__parent;
}
return root;
};
DwtTabGroup.prototype.__dump=function(tg,_7cc,_7cd){
_7cd=_7cd||0;
var _7ce="";
for(var i=0;i<_7cd;i++){
_7ce+="&nbsp;&nbsp;&nbsp;&nbsp;";
}
_7cc=_7cc||AjxDebug.DBG1;
_7ce+="&nbsp;&nbsp;&nbsp;&nbsp;";
var sz=tg.__members.size();
var a=tg.__members.getArray();
for(var i=0;i<sz;i++){
if(a[i] instanceof DwtTabGroup){
tg.__dump(a[i],_7cc,_7cd+1);
}else{
if(a[i] instanceof DwtControl){
}else{
}
}
}
};
DwtTabGroup.prototype.__setFocusMember=function(next,_7d3,_7d4){
if(!this.__currFocusMember){
return this.resetFocusMember(_7d3,_7d4);
}
var _7d5=this.__getTabGroupForMember(this.__currFocusMember);
if(!_7d5){
return null;
}
var m=(next)?_7d5.__getNextMember(this.__currFocusMember,_7d3):_7d5.__getPrevMember(this.__currFocusMember,_7d3);
if(!m){
m=(next)?this.__getLeftMostMember(_7d3):this.__getRightMostMember(_7d3);
if(m==this.__currFocusMember){
return null;
}
}
this.__currFocusMember=m;
if(!_7d4){
this.__notifyListeners(this.__currFocusMember);
}
return this.__currFocusMember;
};
DwtTabGroup.prototype.__getTabGroupForMember=function(_7d7){
if(!_7d7){
return null;
}
var sz=this.__members.size();
var a=this.__members.getArray();
var m;
for(var i=0;i<sz;i++){
m=a[i];
if(m==_7d7){
return this;
}else{
if(m instanceof DwtTabGroup&&(m=m.__getTabGroupForMember(_7d7))){
return m;
}
}
}
return null;
};
DwtTabGroup.prototype.__checkRoot=function(){
if(this.__parent){
throw DwtTabGroup.NOT_ROOT_TABGROUP;
}
};
function DwtDragEvent(){
this.operation=null;
this.srcControl=null;
this.action=null;
this.doIt=false;
this.srcData=null;
}
DwtDragEvent.DRAG_START=1;
DwtDragEvent.SET_DATA=2;
DwtDragEvent.DRAG_END=3;
function DwtDragSource(_7dc){
this.__supportedOps=_7dc;
this.__evtMgr=new AjxEventMgr();
}
DwtDragSource.__DRAG_LISTENER="DwtDragSource.__DRAG_LISTENER";
DwtDragSource.__dragEvent=new DwtDragEvent();
DwtDragSource.prototype.toString=function(){
return "DwtDragSource";
};
DwtDragSource.prototype.addDragListener=function(_7dd){
this.__evtMgr.addListener(DwtDragSource.__DRAG_LISTENER,_7dd);
};
DwtDragSource.prototype.removeDragListener=function(_7de){
this.__evtMgr.removeListener(DwtDragSource.__DRAG_LISTENER,_7de);
};
DwtDragSource.prototype._beginDrag=function(_7df,_7e0){
if(!(this.__supportedOps&_7df)){
return Dwt.DND_DROP_NONE;
}
DwtDragSource.__dragEvent.operation=_7df;
DwtDragSource.__dragEvent.srcControl=_7e0;
DwtDragSource.__dragEvent.action=DwtDragEvent.DRAG_START;
DwtDragSource.__dragEvent.srcData=null;
DwtDragSource.__dragEvent.doit=true;
this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
return DwtDragSource.__dragEvent.operation;
};
DwtDragSource.prototype._getData=function(){
DwtDragSource.__dragEvent.action=DwtDragEvent.SET_DATA;
this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
return DwtDragSource.__dragEvent.srcData;
};
DwtDragSource.prototype._endDrag=function(){
DwtDragSource.__dragEvent.action=DwtDragEvent.DRAG_END;
DwtDragSource.__dragEvent.doit=false;
this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
return DwtDragSource.__dragEvent.doit;
};
function DwtDropEvent(){
this.operation=null;
this.targetControl=null;
this.action=null;
this.srcData=null;
this.doIt=false;
}
DwtDropEvent.DRAG_ENTER=1;
DwtDropEvent.DRAG_LEAVE=2;
DwtDropEvent.DRAG_OP_CHANGED=3;
DwtDropEvent.DRAG_DROP=4;
function DwtDropTarget(_7e1){
this._evtMgr=new AjxEventMgr();
this.__hasMultiple=false;
this.__transferTypes=new Array();
if(_7e1){
if(_7e1 instanceof Array){
this.__transferTypes=_7e1;
}else{
var len=arguments.length;
for(var i=0;i<len;i++){
this.__transferTypes[i]=arguments[i];
}
this.__transferTypes.length=i;
}
}
}
DwtDropTarget.__DROP_LISTENER="DwtDropTarget.__DROP_LISTENER";
DwtDropTarget.__dropEvent=new DwtDropEvent();
DwtDropTarget.prototype.toString=function(){
return "DwtDropTarget";
};
DwtDropTarget.prototype.addDropListener=function(_7e4){
this._evtMgr.addListener(DwtDropTarget.__DROP_LISTENER,_7e4);
};
DwtDropTarget.prototype.removeDropListener=function(_7e5){
this._evtMgr.removeListener(DwtDropTarget.__DROP_LISTENER,_7e5);
};
DwtDropTarget.prototype.isValidTarget=function(_7e6){
if(_7e6 instanceof Array){
var len=_7e6.length;
for(var i=0;i<len;i++){
if(!this.__checkTarget(_7e6[i])){
return false;
}
}
return true;
}else{
return this.__checkTarget(_7e6);
}
};
DwtDropTarget.prototype.markAsMultiple=function(){
this.__hasMultiple=true;
};
DwtDropTarget.prototype.hasMultipleTargets=function(){
return this.__hasMultiple;
};
DwtDropTarget.prototype.getTransferTypes=function(){
return this.__transferTypes;
};
DwtDropTarget.prototype.setTransferTypes=function(_7e9){
var len=arguments.length;
for(var i=0;i<len;i++){
this.__transferTypes[i]=arguments[i];
}
this.__transferTypes.length=i;
};
DwtDropTarget.prototype._dragEnter=function(_7ec,_7ed,_7ee,ev,_7f0){
DwtDropTarget.__dropEvent.operation=_7ec;
DwtDropTarget.__dropEvent.targetControl=_7ed;
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_ENTER;
DwtDropTarget.__dropEvent.srcData=_7ee;
DwtDropTarget.__dropEvent.uiEvent=ev;
DwtDropTarget.__dropEvent.doIt=true;
DwtDropTarget.__dropEvent.dndIcon=_7f0;
this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
return DwtDropTarget.__dropEvent.doIt;
};
DwtDropTarget.prototype._dragLeave=function(){
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_LEAVE;
this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
};
DwtDropTarget.prototype._dragOpChanged=function(_7f1){
DwtDropTarget.__dropEvent.operation=_7f1;
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_OP_CHANGED;
this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
return DwtDropTarget.__dropEvent.doIt;
};
DwtDropTarget.prototype._drop=function(_7f2,ev){
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_DROP;
DwtDropTarget.__dropEvent.srcData=_7f2;
DwtDropTarget.__dropEvent.uiEvent=ev;
this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
return DwtDropTarget.__dropEvent.doIt;
};
DwtDropTarget.prototype.__checkTarget=function(item){
var len=this.__transferTypes.length;
for(var i=0;i<len;i++){
if(item instanceof this.__transferTypes[i]){
return true;
}
}
if(i==this.__transferTypes.length){
return false;
}
};
function DwtHoverMgr(){
this._hoverOverAction=new AjxTimedAction(this,this._notifyHoverOver);
this._hoverOutAction=new AjxTimedAction(this,this._notifyHoverOut);
}
DwtHoverMgr.prototype._hoverObject;
DwtHoverMgr.prototype._hoverOverDelay=750;
DwtHoverMgr.prototype._hoverOverData;
DwtHoverMgr.prototype._hoverOverAction;
DwtHoverMgr.prototype._hoverOverActionId=-1;
DwtHoverMgr.prototype._hoverOverListener;
DwtHoverMgr.prototype._hoverOutDelay=50;
DwtHoverMgr.prototype._hoverOutData;
DwtHoverMgr.prototype._hoverOutAction;
DwtHoverMgr.prototype._hoverOutActionId=-1;
DwtHoverMgr.prototype._hoverOutListener;
DwtHoverMgr.prototype._isHovering=false;
DwtHoverMgr.prototype.setHoverObject=function(_7f7){
this._hoverObject=_7f7;
};
DwtHoverMgr.prototype.getHoverObject=function(){
return this._hoverObject;
};
DwtHoverMgr.prototype.reset=function(){
this._hoverObject=null;
this._hoverOverDelay=DwtHoverMgr.prototype._hoverOverDelay;
this._hoverOverData=null;
if(this._hoverOverActionId!=-1){
AjxTimedAction.cancelAction(this._hoverOverActionId);
}
this._hoverOverActionId=-1;
this._hoverOverListener=null;
this._hoverOutDelay=DwtHoverMgr.prototype._hoverOutDelay;
this._hoverOutData=null;
if(this._hoverOutActionId!=-1){
AjxTimedAction.cancelAction(this._hoverOutActionId);
this._notifyHoverOut();
}
this._hoverOutActionId=-1;
this._hoverOutListener=null;
};
DwtHoverMgr.prototype.isHovering=function(){
return this._isHovering;
};
DwtHoverMgr.prototype.setHoverOverDelay=function(_7f8){
this._hoverOverDelay=_7f8;
};
DwtHoverMgr.prototype.setHoverOverData=function(data){
this._hoverOverData=data;
};
DwtHoverMgr.prototype.setHoverOverListener=function(_7fa){
this._hoverOverListener=_7fa;
};
DwtHoverMgr.prototype.setHoverOutDelay=function(_7fb){
this._hoverOutDelay=_7fb;
};
DwtHoverMgr.prototype.setHoverOutData=function(data){
this._hoverOutData=data;
};
DwtHoverMgr.prototype.setHoverOutListener=function(_7fd){
this._hoverOutListener=_7fd;
};
DwtHoverMgr.prototype.hoverOver=function(x,y){
if(this._hoverOverActionId!=-1){
AjxTimedAction.cancelAction(this._hoverOverActionId);
}
this._hoverOverAction.args=[x,y];
this._hoverOverActionId=AjxTimedAction.scheduleAction(this._hoverOverAction,this._hoverOverDelay);
};
DwtHoverMgr.prototype.hoverOut=function(){
if(this._hoverOverActionId!=-1){
AjxTimedAction.cancelAction(this._hoverOverActionId);
}
if(this._hoverOutActionId==-1){
if(this._hoverOutDelay>0){
this._hoverOutActionId=AjxTimedAction.scheduleAction(this._hoverOutAction,this._hoverOutDelay);
}else{
this._notifyHoverOut();
}
}
};
DwtHoverMgr.prototype._notifyHoverOver=function(){
this._hoverOverActionId=-1;
this._isHovering=true;
if(this._hoverOverListener!=null){
var x=this._hoverOverAction.args[0];
var y=this._hoverOverAction.args[1];
var _802=new DwtHoverEvent(DwtEvent.HOVEROVER,this._hoverOverDelay,this._hoverOverData,x,y);
this._hoverOverListener.handleEvent(_802);
}
};
DwtHoverMgr.prototype._notifyHoverOut=function(){
this._hoverOutActionId=-1;
this._isHovering=false;
if(this._hoverOutListener!=null){
var _803=new DwtHoverEvent(DwtEvent.HOVEROUT,this._hoverOutDelay,this._hoverOutData);
this._hoverOutListener.handleEvent(_803);
}
};
function DwtControl(_804,_805,_806,_807,id,_809){
if(arguments.length==0){
return;
}
this.parent=_804;
if(_804!=null&&!(_804 instanceof DwtComposite)){
throw new DwtException("Parent must be a subclass of Composite",DwtException.INVALIDPARENT,"DwtControl");
}
this.shell=null;
this._data=new Object();
this._eventMgr=new AjxEventMgr();
this._disposed=false;
if(_804==null){
return;
}
this._className=_805?_805:"DwtControl";
this.__posStyle=_806;
if(id!=null){
this._htmlElId=id;
}
this.__index=_809;
this._enabled=false;
this._dragging=null;
this._dndIcon;
this._hasFocus=false;
if(!_807){
this.__initCtrl();
}
this._hoverOverListener=new AjxListener(this,this.__handleHoverOver);
this._hoverOutListener=new AjxListener(this,this.__handleHoverOut);
}
DwtControl.STATIC_STYLE=Dwt.STATIC_STYLE;
DwtControl.ABSOLUTE_STYLE=Dwt.ABSOLUTE_STYLE;
DwtControl.RELATIVE_STYLE=Dwt.RELATIVE_STYLE;
DwtControl.CLIP=Dwt.CLIP;
DwtControl.VISIBLE=Dwt.VISIBLE;
DwtControl.SCROLL=Dwt.SCROLL;
DwtControl.FIXED_SCROLL=Dwt.FIXED_SCROLL;
DwtControl.DEFAULT=Dwt.DEFAULT;
DwtControl._NO_DRAG=1;
DwtControl._DRAGGING=2;
DwtControl._DRAG_REJECTED=3;
DwtControl.__DRAG_THRESHOLD=3;
DwtControl.__TOOLTIP_THRESHOLD=5;
DwtControl.__DND_HOVER_DELAY=750;
DwtControl.__controlEvent=new DwtControlEvent();
DwtControl.prototype.toString=function(){
return "DwtControl";
};
DwtControl.prototype.addControlListener=function(_80a){
this.addListener(DwtEvent.CONTROL,_80a);
};
DwtControl.prototype.removeControlListener=function(_80b){
this.removeListener(DwtEvent.CONTROL,_80b);
};
DwtControl.prototype.addDisposeListener=function(_80c){
this.addListener(DwtEvent.DISPOSE,_80c);
};
DwtControl.prototype.removeDisposeListener=function(_80d){
this.removeListener(DwtEvent.DISPOSE,_80d);
};
DwtControl.prototype.addListener=function(_80e,_80f){
return this._eventMgr.addListener(_80e,_80f);
};
DwtControl.prototype.removeListener=function(_810,_811){
return this._eventMgr.removeListener(_810,_811);
};
DwtControl.prototype.removeAllListeners=function(_812){
return this._eventMgr.removeAll(_812);
};
DwtControl.prototype.isListenerRegistered=function(_813){
return this._eventMgr.isListenerRegistered(_813);
};
DwtControl.prototype.notifyListeners=function(_814,_815){
return this._eventMgr.notifyListeners(_814,_815);
};
DwtControl.prototype.dispose=function(){
if(this._disposed){
return;
}
if(this.parent!=null){
this.parent.removeChild(this);
}
Dwt.disassociateElementFromObject(null,this);
this._disposed=true;
var ev=new DwtDisposeEvent();
ev.dwtObj=this;
this.notifyListeners(DwtEvent.DISPOSE,ev);
};
DwtControl.prototype.getDocument=function(){
return document;
};
DwtControl.prototype.getData=function(key){
return this._data[key];
};
DwtControl.prototype.setData=function(key,_819){
this._data[key]=_819;
};
DwtControl.prototype.isDisposed=function(){
return this._isDisposed;
};
DwtControl.prototype.isInitialized=function(){
return this.__ctrlInited;
};
DwtControl.prototype.focus=function(){
DwtShell.getShell(window).getKeyboardMgr().grabFocus(this);
};
DwtControl.prototype.hasFocus=function(){
return this._hasFocus;
};
DwtControl.prototype.handleKeyAction=function(_81a,ev){
return false;
};
DwtControl.prototype.reparent=function(_81c){
if(!this._checkState()){
return;
}
var _81d=this.getHtmlElement();
this.parent.removeChild(this);
DwtComposite._pendingElements[this._htmlElId]=_81d;
_81c.addChild(this);
this.parent=_81c;
};
DwtControl.prototype.reparentHtmlElement=function(_81e){
if(typeof _81e=="string"){
_81e=document.getElementById(_81e);
}
_81e.appendChild(this.getHtmlElement());
};
DwtControl.prototype.setHandler=function(_81f,_820){
if(!this._checkState()){
return;
}
var _821=this.getHtmlElement();
Dwt.setHandler(_821,_81f,_820);
};
DwtControl.prototype.clearHandler=function(_822){
if(!this._checkState()){
return;
}
var _823=this.getHtmlElement();
Dwt.clearHandler(_823,_822);
};
DwtControl.prototype.getBounds=function(){
if(!this._checkState()){
return;
}
return Dwt.getBounds(this.getHtmlElement());
};
DwtControl.prototype.setBounds=function(x,y,_826,_827){
if(!this._checkState()){
return;
}
var _828=this.getHtmlElement();
if(this.isListenerRegistered(DwtEvent.CONTROL)){
this.__controlEvent.reset();
var bds=Dwt.getBounds(_828);
this.__controlEvent.oldX=bds.x;
this.__controlEvent.oldY=bds.y;
this.__controlEvent.oldWidth=bds.width;
this.__controlEvent.oldHeight=bds.height;
Dwt.setBounds(_828,x,y,_826,_827);
bds=Dwt.getBounds(_828);
this.__controlEvent.newX=bds.x;
this.__controlEvent.newY=bds.y;
this.__controlEvent.newWidth=bds.width;
this.__controlEvent.newHeight=bds.height;
this.__controlEvent.requestedWidth=_826;
this.__controlEvent.requestedHeight=_827;
this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent);
}else{
Dwt.setBounds(_828,x,y,_826,_827);
}
return this;
};
DwtControl.prototype.getClassName=function(){
return this._className;
};
DwtControl.prototype.setClassName=function(_82a){
if(!this._checkState()){
return;
}
this._className=_82a;
this.getHtmlElement().className=_82a;
};
DwtControl.prototype.getCursor=function(){
if(!this._checkState()){
return;
}
return Dwt.getCursor(this.getHtmlElement());
};
DwtControl.prototype.setCursor=function(_82b){
if(!this._checkState()){
return;
}
Dwt.setCursor(this.getHtmlElement(),_82b);
};
DwtControl.prototype.getDragSource=function(){
return this._dragSource;
};
DwtControl.prototype.setDragSource=function(_82c){
this._dragSource=_82c;
if(_82c!=null&&this._ctrlCaptureObj==null){
this._ctrlCaptureObj=new DwtMouseEventCapture(this,"DwtControl",DwtControl.__mouseOverHdlr,DwtControl.__mouseDownHdlr,DwtControl.__mouseMoveHdlr,DwtControl.__mouseUpHdlr,DwtControl.__mouseOutHdlr);
this._dndHoverAction=new AjxTimedAction(null,this.__dndDoHover);
}
};
DwtControl.prototype.getDropTarget=function(){
return this._dropTarget;
};
DwtControl.prototype.setDropTarget=function(_82d){
this._dropTarget=_82d;
};
DwtControl.prototype.getEnabled=function(){
if(!this._checkState()){
return;
}
return this._enabled;
};
DwtControl.prototype.setEnabled=function(_82e,_82f){
if(!this._checkState()){
return;
}
if(_82e!=this._enabled){
this._enabled=_82e;
if(_82f){
this.getHtmlElement().disabled=!_82e;
}
}
};
DwtControl.prototype.getHtmlElement=function(){
if(!this._checkState()){
return;
}
var _830=document.getElementById(this._htmlElId);
if(_830==null){
_830=DwtComposite._pendingElements[this._htmlElId];
}else{
if(!_830._rendered){
delete DwtComposite._pendingElements[this._htmlElId];
_830._rendered=true;
}
}
return _830;
};
DwtControl.prototype.setHtmlElementId=function(id){
if(this._disposed){
return;
}
if(this.__ctrlInited){
var _832=this.getHtmlElement();
if(!_832._rendered){
delete DwtComposite._pendingElements[this._htmlElId];
DwtComposite._pendingElements[id]=_832;
}
_832.id=id;
}
this._htmlElId=id;
};
DwtControl.prototype.getX=function(){
if(!this._checkState()){
return;
}
return Dwt.getLocation(this.getHtmlElement()).x;
};
DwtControl.prototype.getXW=function(){
if(!this._checkState()){
return;
}
var _833=this.getBounds();
return _833.x+_833.width;
};
DwtControl.prototype.getY=function(){
if(!this._checkState()){
return;
}
return Dwt.getLocation(this.getHtmlElement()).y;
};
DwtControl.prototype.getYH=function(){
if(!this._checkState()){
return;
}
var _834=this.getBounds();
return _834.y+_834.height;
};
DwtControl.prototype.getLocation=function(){
if(!this._checkState()){
return;
}
return Dwt.getLocation(this.getHtmlElement());
};
DwtControl.prototype.setLocation=function(x,y){
if(!this._checkState()){
return;
}
if(this.isListenerRegistered(DwtEvent.CONTROL)){
var _837=this.getHtmlElement();
this.__controlEvent.reset();
var loc=Dwt.getLocation(_837);
this.__controlEvent.oldX=loc.x;
this.__controlEvent.oldY=loc.y;
Dwt.setLocation(_837,x,y);
loc=Dwt.getLocation(_837);
this.__controlEvent.newX=loc.x;
this.__controlEvent.newY=loc.y;
this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent);
}else{
Dwt.setLocation(this.getHtmlElement(),x,y);
}
return this;
};
DwtControl.prototype.getScrollStyle=function(){
if(!this._checkState()){
return;
}
return Dwt.getScrollStyle(this.getHtmlElement());
};
DwtControl.prototype.setScrollStyle=function(_839){
if(!this._checkState()){
return;
}
Dwt.setScrollStyle(this.getHtmlElement(),_839);
};
DwtControl.prototype.getW=function(){
if(!this._checkState()){
return;
}
return Dwt.getSize(this.getHtmlElement()).x;
};
DwtControl.prototype.getH=function(){
if(!this._checkState()){
return;
}
return Dwt.getSize(this.getHtmlElement()).y;
};
DwtControl.prototype.getSize=function(){
if(!this._checkState()){
return;
}
return Dwt.getSize(this.getHtmlElement());
};
DwtControl.prototype.setSize=function(_83a,_83b){
if(!this._checkState()){
return;
}
if(this.isListenerRegistered(DwtEvent.CONTROL)){
var _83c=this.getHtmlElement();
this.__controlEvent.reset();
var sz=Dwt.getSize(_83c);
this.__controlEvent.oldWidth=sz.x;
this.__controlEvent.oldHeight=sz.y;
Dwt.setSize(_83c,_83a,_83b);
sz=Dwt.getSize(_83c);
this.__controlEvent.newWidth=sz.x;
this.__controlEvent.newHeight=sz.y;
this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent);
}else{
Dwt.setSize(this.getHtmlElement(),_83a,_83b);
}
return this;
};
DwtControl.prototype.getToolTipContent=function(){
if(this._disposed){
return;
}
return this.__toolTipContent;
};
DwtControl.prototype.setToolTipContent=function(text){
if(this._disposed){
return;
}
this.__toolTipContent=text;
};
DwtControl.prototype.getVisible=function(){
if(!this._checkState()){
return;
}
return Dwt.getVisible(this.getHtmlElement());
};
DwtControl.prototype.setVisible=function(_83f){
if(!this._checkState()){
return;
}
Dwt.setVisible(this.getHtmlElement(),_83f);
};
DwtControl.prototype.setVisibility=function(_840){
if(!this._checkState()){
return;
}
Dwt.setVisibility(this.getHtmlElement(),_840);
};
DwtControl.prototype.getVisibility=function(){
if(!this._checkState()){
return;
}
return Dwt.getVisiblility(this.getHtmlElement());
};
DwtControl.prototype.getZIndex=function(){
if(!this._checkState()){
return;
}
return Dwt.getZIndex(this.getHtmlElement());
};
DwtControl.prototype.setZIndex=function(idx){
if(!this._checkState()){
return;
}
Dwt.setZIndex(this.getHtmlElement(),idx);
};
DwtControl.prototype.zShow=function(show){
this.setZIndex(show?Dwt.Z_VIEW:Dwt.Z_HIDDEN);
};
DwtControl.prototype.setDisplay=function(_843){
if(!this._checkState()){
return;
}
Dwt.setDisplay(this.getHtmlElement(),_843);
};
DwtControl.prototype.preventSelection=function(_844){
return !this.__isInputEl(_844);
};
DwtControl.prototype.preventContextMenu=function(_845){
return _845?(!this.__isInputEl(_845)):true;
};
DwtControl.prototype.setContent=function(_846){
if(_846){
this.getHtmlElement().innerHTML=_846;
}
};
DwtControl.prototype.clearContent=function(){
this.getHtmlElement().innerHTML="";
};
DwtControl.prototype.appendElement=function(_847){
var el=AjxUtil.isString(_847)?document.getElementById(_847):_847;
if(el){
el.appendChild(this.getHtmlElement(),el);
}
};
DwtControl.prototype.replaceElement=function(_849,_84a,_84b){
var oel=AjxUtil.isString(_849)?document.getElementById(_849):_849;
if(oel){
var nel=this.getHtmlElement();
oel.parentNode.replaceChild(nel,oel);
this._replaceElementHook(oel,nel,_84a,_84b);
}
};
DwtControl.prototype._replaceElementHook=function(oel,nel,_850,_851){
if((_850==null||_850)&&oel.className){
Dwt.addClass(nel,oel.className);
}
if(_851==null||_851){
var _852=oel.getAttribute("style");
if(_852){
nel.setAttribute("style",[nel.getAttribute("style"),_852].join(";"));
}
}
};
DwtControl.prototype.applyCaretHack=function(){
if(Dwt.CARET_HACK_ENABLED){
var _853=this.shell.getHtmlElement();
var _854=this.getHtmlElement();
var _855=_854;
while(_855.parentNode&&(_855.parentNode!=_853)){
_855=_855.parentNode;
}
if(_855){
var _856=_855.nextSibling;
_853.removeChild(_855);
_853.insertBefore(_855,_856);
}
}
};
DwtControl.prototype._blur=function(){
};
DwtControl.prototype._focus=function(){
};
DwtControl.prototype._focusByMouseUpEvent=function(){
if(this.getEnabled()){
this.focus();
}
};
DwtControl.prototype._focusByMouseDownEvent=function(){
this._focusByMouseUpEvent();
};
DwtControl.prototype._getDnDIcon=function(_857){
return null;
};
DwtControl.prototype._setDnDIconState=function(_858){
this._dndIcon.className=(_858)?"DropAllowed":"DropNotAllowed";
};
DwtControl.__junkIconId=0;
DwtControl.prototype._destroyDnDIcon=function(icon){
if(icon!=null){
if(icon.parentNode){
icon.parentNode.removeChild(icon);
}else{
icon.style.zIndex=-100;
icon.id="DwtJunkIcon"+DwtControl.__junkIconId++;
icon=void 0;
}
}
};
DwtControl.prototype._isValidDragObject=function(ev){
return true;
};
DwtControl.prototype._dragEnter=function(ev){
};
DwtControl.prototype._dragOver=function(ev){
};
DwtControl.prototype._dragHover=function(ev){
};
DwtControl.prototype._dragLeave=function(ev){
};
DwtControl.prototype._drop=function(ev){
};
DwtControl.prototype._setKeyPressEventHdlr=function(_860){
this._setEventHdlrs([DwtEvent.ONKEYPRESS],_860);
};
DwtControl.prototype._setMouseEventHdlrs=function(_861){
this._setEventHdlrs(DwtEvent.MOUSE_EVENTS,_861);
};
DwtControl.prototype._setEventHdlrs=function(_862,_863){
if(!this._checkState()){
return;
}
var _864=this.getHtmlElement();
for(var i=0;i<_862.length;i++){
if(_863!==true){
Dwt.setHandler(_864,_862[i],DwtControl.__HANDLER[_862[i]]);
}else{
Dwt.clearHandler(_864,_862[i]);
}
}
};
DwtControl.prototype._getStopPropagationValForMouseEv=function(ev){
return true;
};
DwtControl.prototype._getEventReturnValForMouseEv=function(ev){
return false;
};
DwtControl.prototype._checkState=function(){
if(this._disposed){
return false;
}
if(!this.__ctrlInited){
this.__initCtrl();
}
return true;
};
DwtControl.__keyPressHdlr=function(ev){
var obj=obj?obj:DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
if(obj.__toolTipContent!=null){
var _86a=DwtShell.getShell(window);
var _86b=_86a.getHoverMgr();
_86b.setHoverOutListener(obj._hoverOutListener);
_86b.hoverOut();
obj.__tooltipClosed=false;
}
};
DwtControl.prototype.__doBlur=function(){
this._hasFocus=false;
if(this.isListenerRegistered(DwtEvent.ONBLUR)){
var ev=DwtShell.focusEvent;
ev.dwtObj=this;
ev.state=DwtFocusEvent.BLUR;
obj.notifyListeners(DwtEvent.ONBLUR,mouseEv);
}
this._blur();
};
DwtControl.prototype.__doFocus=function(){
this._hasFocus=true;
if(this.isListenerRegistered(DwtEvent.ONFOCUS)){
var ev=DwtShell.focusEvent;
ev.dwtObj=this;
ev.state=DwtFocusEvent.FOCUS;
obj.notifyListeners(DwtEvent.ONFOCUS,mouseEv);
}
this._focus();
};
DwtControl.__dblClickHdlr=function(ev){
return DwtControl.__mouseEvent(ev,DwtEvent.ONDBLCLICK);
};
DwtControl.__mouseOverHdlr=function(ev){
var _870=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
if(_870!=null){
ev=DwtUiEvent.getEvent(ev);
ev._stopPropagation=true;
return false;
}
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
var _872=DwtShell.mouseEvent;
if(obj._dragging==DwtControl._NO_DRAG){
_872.setFromDhtmlEvent(ev);
if(obj.isListenerRegistered(DwtEvent.ONMOUSEOVER)){
obj.notifyListeners(DwtEvent.ONMOUSEOVER,_872);
}
if(obj.__toolTipContent!=null){
var _873=DwtShell.getShell(window);
var _874=_873.getHoverMgr();
if((_874.getHoverObject()!=this||!_874.isHovering())&&!DwtMenu.menuShowing()){
_874.reset();
_874.setHoverObject(this);
_874.setHoverOverData(obj);
_874.setHoverOverDelay(DwtToolTip.TOOLTIP_DELAY);
_874.setHoverOverListener(obj._hoverOverListener);
_874.hoverOver(_872.docX,_872.docY);
}
}
}
_872._stopPropagation=true;
_872._returnValue=false;
_872.setToDhtmlEvent(ev);
return false;
};
DwtControl.__mouseDownHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
obj._focusByMouseDownEvent();
if(obj.__toolTipContent!=null){
var _877=DwtShell.getShell(window);
var _878=_877.getHoverMgr();
_878.setHoverOutListener(obj._hoverOutListener);
_878.hoverOut();
}
var _879=DwtShell.mouseEvent;
_879.setFromDhtmlEvent(ev);
if(obj._dragSource!=null&&_879.button==DwtMouseEvent.LEFT&&obj._isValidDragObject(_879)){
try{
obj._ctrlCaptureObj.capture();
}
catch(ex){
}
obj._dragOp=(_879.ctrlKey)?Dwt.DND_DROP_COPY:Dwt.DND_DROP_MOVE;
obj.__dragStartX=_879.docX;
obj.__dragStartY=_879.docY;
}
return DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEDOWN,obj,_879);
};
DwtControl.__mouseMoveHdlr=function(ev){
var _87b=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
var obj=(_87b)?_87b.targetObj:DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
if(obj.__dndHoverActionId!=-1){
AjxTimedAction.cancelAction(obj.__dndHoverActionId);
obj.__dndHoverActionId=-1;
}
var _87d=DwtShell.mouseEvent;
_87d.setFromDhtmlEvent(ev);
if(_87d.docX<0||_87d.docY<0){
_87d._stopPropagation=true;
_87d._returnValue=false;
_87d.setToDhtmlEvent(ev);
return false;
}
if(obj._dragSource==null||_87b==null||(obj!=null&&obj._dragging==DwtControl._NO_DRAG&&Math.abs(obj.__dragStartX-_87d.docX)<DwtControl.__DRAG_THRESHOLD&&Math.abs(obj.__dragStartY-_87d.docY)<DwtControl.__DRAG_THRESHOLD)){
if(obj.__toolTipContent!=null){
var _87e=DwtShell.getShell(window);
var _87f=_87e.getHoverMgr();
if(!_87f.isHovering()&&!obj.__tooltipClosed&&!DwtMenu.menuShowing()){
_87f.hoverOver(_87d.docX,_87d.docY);
}else{
var _880=obj.__lastTooltipX?Math.abs(_87d.docX-obj.__lastTooltipX):null;
var _881=obj.__lastTooltipY?Math.abs(_87d.docY-obj.__lastTooltipY):null;
if((_880!=null&&_880>DwtControl.__TOOLTIP_THRESHOLD)||(_881!=null&&_881>DwtControl.__TOOLTIP_THRESHOLD)){
_87f.setHoverOutListener(obj._hoverOutListener);
_87f.hoverOut();
obj.__tooltipClosed=true;
}
}
}
return DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEMOVE,obj,_87d);
}else{
if(obj._dragging==DwtControl._NO_DRAG){
obj._dragOp=obj._dragSource._beginDrag(obj._dragOp,obj);
if(obj._dragOp!=Dwt.DND_DROP_NONE){
obj._dragging=DwtControl._DRAGGING;
obj._dndIcon=obj._getDnDIcon(obj._dragOp);
if(obj._dndIcon==null){
obj._dragging=DwtControl._DRAG_REJECTED;
}
}else{
obj._dragging=DwtControl._DRAG_REJECTED;
}
}
if(obj._dragging!=DwtControl._DRAG_REJECTED){
var _882=_87d.dwtObj;
if(_882){
obj._dndHoverAction.args=[_882];
obj.__dndHoverActionId=AjxTimedAction.scheduleAction(obj._dndHoverAction,DwtControl.__DND_HOVER_DELAY);
}
if(_882&&_882._dropTarget&&_882!=obj){
if(_882!=obj.__lastDestDwtObj||_882._dropTarget.hasMultipleTargets()){
if(_882._dropTarget._dragEnter(obj._dragOp,_882,obj._dragSource._getData(),_87d,obj._dndIcon)){
obj._setDnDIconState(true);
obj.__dropAllowed=true;
_882._dragEnter(_87d);
}else{
obj._setDnDIconState(false);
obj.__dropAllowed=false;
}
}else{
if(obj.__dropAllowed){
_882._dragOver(_87d);
}
}
}else{
obj._setDnDIconState(false);
}
if(obj.__lastDestDwtObj&&obj.__lastDestDwtObj!=_882&&obj.__lastDestDwtObj._dropTarget&&obj.__lastDestDwtObj!=obj){
obj.__lastDestDwtObj._dragLeave(_87d);
obj.__lastDestDwtObj._dropTarget._dragLeave();
}
obj.__lastDestDwtObj=_882;
Dwt.setLocation(obj._dndIcon,_87d.docX+2,_87d.docY+2);
}else{
DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEMOVE,obj,_87d);
}
_87d._stopPropagation=true;
_87d._returnValue=false;
_87d.setToDhtmlEvent(ev);
return false;
}
};
DwtControl.__mouseUpHdlr=function(ev){
var _884=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
var obj=(_884)?_884.targetObj:DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
if(obj.__dndHoverActionId!=-1){
AjxTimedAction.cancelAction(obj.__dndHoverActionId);
obj.__dndHoverActionId=-1;
}
if(!obj._dragSource||!_884){
return DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEUP,obj);
}else{
_884.release();
var _886=DwtShell.mouseEvent;
_886.setFromDhtmlEvent(ev);
if(obj._dragging!=DwtControl._DRAGGING){
obj._dragging=DwtControl._NO_DRAG;
return DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEUP,obj,_886);
}else{
obj.__lastDestDwtObj=null;
var _887=_886.dwtObj;
if(_887!=null&&_887._dropTarget!=null&&obj.__dropAllowed&&_887!=obj){
_887._drop(_886);
_887._dropTarget._drop(obj._dragSource._getData(),_886);
obj._dragSource._endDrag();
obj._destroyDnDIcon(obj._dndIcon);
obj._dragging=DwtControl._NO_DRAG;
}else{
obj.__dragEndX=_886.docX;
obj.__dragEndY=_886.docY;
if(obj.__badDropAction==null){
obj.__badDropAction=new AjxTimedAction(obj,obj.__badDropEffect);
}
var m=(obj.__dragEndY-obj.__dragStartY)/(obj.__dragEndX-obj.__dragStartX);
obj.__badDropAction.args=[m,obj.__dragStartY-(m*obj.__dragStartX),(obj.__dragStartX-obj.__dragEndX<0)?-1:1];
AjxTimedAction.scheduleAction(obj.__badDropAction,0);
}
_886._stopPropagation=true;
_886._returnValue=false;
_886.setToDhtmlEvent(ev);
return false;
}
}
};
DwtControl.__mouseOutHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
if(obj.__toolTipContent!=null){
var _88b=DwtShell.getShell(window);
var _88c=_88b.getHoverMgr();
_88c.setHoverOutListener(obj._hoverOutListener);
_88c.hoverOut();
obj.__tooltipClosed=false;
}
return DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEOUT,obj);
};
DwtControl.__mouseWheelHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
return DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEWHEEL,obj);
};
DwtControl.__selectStartHdlr=function(ev){
return DwtControl.__mouseEvent(ev,DwtEvent.ONSELECTSTART);
};
DwtControl.__contextMenuHdlr=function(ev){
if(AjxEnv.isSafari){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _892=obj?obj.preventContextMenu():true;
if(_892){
DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEDOWN);
DwtControl.__mouseEvent(ev,DwtEvent.ONMOUSEUP);
return;
}
}
return DwtControl.__mouseEvent(ev,DwtEvent.ONCONTEXTMENU);
};
DwtControl.__mouseEvent=function(ev,_894,obj,_896){
var obj=obj?obj:DwtUiEvent.getDwtObjFromEvent(ev);
if(!obj){
return false;
}
if(!_896){
_896=DwtShell.mouseEvent;
_896.setFromDhtmlEvent(ev);
}
var tn=_896.target.tagName.toLowerCase();
if(tn!="input"&&tn!="textarea"){
_896._stopPropagation=obj._getStopPropagationValForMouseEv(_896);
_896._returnValue=obj._getEventReturnValForMouseEv(_896);
}else{
_896._stopPropagation=false;
_896._returnValue=true;
}
DwtEventManager.notifyListeners(_894,_896);
if(obj.isListenerRegistered&&obj.isListenerRegistered(_894)){
obj.notifyListeners(_894,_896);
}
_896.setToDhtmlEvent(ev);
return _896._returnValue;
};
DwtControl.__HANDLER=new Object();
DwtControl.__HANDLER[DwtEvent.ONCONTEXTMENU]=DwtControl.__contextMenuHdlr;
DwtControl.__HANDLER[DwtEvent.ONDBLCLICK]=DwtControl.__dblClickHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEDOWN]=DwtControl.__mouseDownHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEENTER]=DwtControl.__mouseOverHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSELEAVE]=DwtControl.__mouseOutHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEMOVE]=DwtControl.__mouseMoveHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEOUT]=DwtControl.__mouseOutHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEOVER]=DwtControl.__mouseOverHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEUP]=DwtControl.__mouseUpHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEWHEEL]=DwtControl.__mouseWheelHdlr;
DwtControl.__HANDLER[DwtEvent.ONSELECTSTART]=DwtControl.__selectStartHdlr;
DwtControl.__HANDLER[DwtEvent.ONKEYPRESS]=DwtControl.__keyPressHdlr;
DwtControl.prototype.__initCtrl=function(){
this.shell=this.parent.shell||this.parent;
var _898=document.createElement("div");
this._htmlElId=_898.id=(this._htmlElId==null)?Dwt.getNextId():this._htmlElId;
DwtComposite._pendingElements[this._htmlElId]=_898;
Dwt.associateElementWithObject(_898,this);
if(this.__posStyle==null||this.__posStyle==DwtControl.STATIC_STYLE){
_898.style.position=DwtControl.STATIC_STYLE;
}else{
_898.style.position=this.__posStyle;
}
_898.className=this._className;
_898.style.overflow="visible";
this._enabled=true;
this.__controlEvent=DwtControl.__controlEvent;
this._dragging=DwtControl._NO_DRAG;
this.__ctrlInited=true;
this.parent.addChild(this,this.__index);
};
DwtControl.prototype.__dndDoHover=function(_899){
_899._dragHover();
};
DwtControl.prototype.__badDropEffect=function(m,c,d){
var _89d=(Math.abs(m)<=1);
var _89e=_89d?this.__dragStartX-this.__dragEndX:this.__dragStartY-this.__dragEndY;
if(_89e*d>0){
if(_89d){
this.__dragEndX+=(30*d);
this._dndIcon.style.top=m*this.__dragEndX+c;
this._dndIcon.style.left=this.__dragEndX;
}else{
this.__dragEndY+=(30*d);
this._dndIcon.style.top=this.__dragEndY;
this._dndIcon.style.left=(this.__dragEndY-c)/m;
}
AjxTimedAction.scheduleAction(this.__badDropAction,0);
}else{
this._destroyDnDIcon(this._dndIcon);
this._dragging=DwtControl._NO_DRAG;
}
};
DwtControl.prototype.__handleHoverOver=function(_89f){
if(this._eventMgr.isListenerRegistered(DwtEvent.HOVEROVER)){
this._eventMgr.notifyListeners(DwtEvent.HOVEROVER,_89f);
}
if(this.__toolTipContent!=null){
var _8a0=DwtShell.getShell(window);
var _8a1=_8a0.getToolTip();
_8a1.setContent(this.__toolTipContent);
_8a1.popup(_89f.x,_89f.y);
this.__lastTooltipX=_89f.x;
this.__lastTooltipY=_89f.y;
this.__tooltipClosed=false;
}
};
DwtControl.prototype.__handleHoverOut=function(_8a2){
if(this._eventMgr.isListenerRegistered(DwtEvent.HOVEROUT)){
this._eventMgr.notifyListeners(DwtEvent.HOVEROUT,_8a2);
}
var _8a3=DwtShell.getShell(window);
var _8a4=_8a3.getToolTip();
_8a4.popdown();
this.__lastTooltipX=null;
this.__lastTooltipY=null;
};
DwtControl.prototype.__isInputEl=function(_8a5){
var _8a6=false;
if(!_8a5||!_8a5.tagName){
return _8a6;
}
var _8a7=_8a5.tagName.toLowerCase();
var type=_8a7=="input"?_8a5.type.toLowerCase():null;
if(_8a7=="textarea"||(type&&(type=="text"||type=="password"))){
_8a6=true;
}
return _8a6;
};
function DwtComposite(_8a9,_8aa,_8ab,_8ac,id,_8ae){
if(arguments.length==0){
return;
}
_8aa=_8aa||"DwtComposite";
DwtControl.call(this,_8a9,_8aa,_8ab,_8ac,id,_8ae);
this._children=new AjxVector();
}
DwtComposite.prototype=new DwtControl;
DwtComposite.prototype.constructor=DwtComposite;
DwtComposite._pendingElements=new Object();
DwtComposite.prototype.toString=function(){
return "DwtComposite";
};
DwtComposite.prototype.dispose=function(){
if(this._disposed){
return;
}
var _8af=this._children.getArray();
while(_8af.length>0){
_8af[0].dispose();
}
DwtControl.prototype.dispose.call(this);
};
DwtComposite.prototype.getChildren=function(){
return this._children.getArray().slice(0);
};
DwtComposite.prototype.getNumChildren=function(){
return this._children.size();
};
DwtComposite.prototype.removeChildren=function(){
var a=this._children.getArray();
while(a.length>0){
a[0].dispose();
}
};
DwtComposite.prototype.clear=function(){
this.removeChildren();
this.getHtmlElement().innerHTML="";
};
DwtComposite.prototype.addChild=function(_8b1,_8b2){
this._children.add(_8b1,_8b2);
var _8b3=_8b1._removedEl?_8b1._removedEl:_8b1.getHtmlElement();
if(this instanceof DwtShell&&this.isVirtual()){
document.body.appendChild(_8b3);
}else{
var _8b4=this.getHtmlElement();
if(_8b2&&(_8b2<_8b4.childNodes.length)){
_8b4.insertBefore(_8b3,_8b4.childNodes[_8b2]);
}else{
_8b4.appendChild(_8b3);
}
}
if(_8b1._removedEl){
_8b1._removedEl=null;
}
};
DwtComposite.prototype.removeChild=function(_8b5,_8b6){
if(_8b5.isInitialized()){
this._children.remove(_8b5);
var _8b7=_8b5.getHtmlElement();
if(_8b7&&_8b7.parentNode){
var el=_8b7.parentNode.removeChild(_8b7);
if(_8b6){
_8b5._removedEl=el;
}
}
}
};
DwtComposite.prototype._setAllowSelection=function(){
if(!this._allowSelection){
this._allowSelection=true;
this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
this.addListener(DwtEvent.ONCONTEXTMENU,new AjxListener(this,this._contextMenuListener));
}
};
DwtComposite.prototype.preventSelection=function(_8b9){
return this._allowSelection?false:DwtControl.prototype.preventSelection.call(this,_8b9);
};
DwtComposite.prototype.preventContextMenu=function(_8ba){
if(!this._allowSelection){
return DwtControl.prototype.preventContextMenu.apply(this,arguments);
}
if(AjxEnv.isSafari){
return true;
}else{
var _8bb=_8ba.id.indexOf("OBJ_")==0;
var _8bc=false;
if(document.selection){
_8bc=document.selection.type=="Text";
}else{
if(getSelection()){
_8bc=getSelection().toString().length>0;
}
}
return _8bc&&!_8bb?false:true;
}
};
DwtComposite.prototype._focusByMouseUpEvent=function(){
if(!this._allowSelection){
DwtControl.prototype._focusByMouseUpEvent.apply(this,arguments);
}
};
DwtComposite.prototype._mouseDownListener=function(ev){
if(ev.button==DwtMouseEvent.LEFT){
ev._stopPropagation=false;
ev._returnValue=true;
}
};
DwtComposite.prototype._contextMenuListener=function(ev){
ev._stopPropagation=false;
ev._returnValue=true;
};
function DwtShell(_8bf,_8c0,_8c1,_8c2,_8c3){
if(window._dwtShell!=null){
throw new DwtException("DwtShell already exists for window",DwtException.INVALID_OP,"DwtShell");
}
_8bf=_8bf||"DwtShell";
DwtComposite.call(this,null,_8bf);
this.__ctrlInited=true;
window._dwtShell=AjxCore.assignId(this);
if((_8c1!=null)&&(document.domain!="localhost")){
window.onbeforeunload=_8c1;
}
document.body.style.margin=0;
if(_8c0!=null&&!_8c0){
if(AjxEnv.isIE){
document.body.onscroll=DwtShell.__onBodyScroll;
}
document.body.style.overflow="hidden";
}
document.body.onselect=DwtShell._preventDefaultSelectPrt;
document.body.onselectstart=DwtShell._preventDefaultSelectPrt;
document.body.oncontextmenu=DwtShell._preventDefaultPrt;
window.onresize=DwtShell._resizeHdlr;
var _8c4=document.createElement("div");
this._htmlElId=_8c4.id=Dwt.getNextId();
_8c4.className=_8bf;
_8c4.style.width=_8c4.style.height="100%";
if(_8c4.style.overflow){
_8c4.style.overflow=null;
}
try{
if(_8c2){
document.body.removeChild(_8c2);
}
}
catch(ex){
}
document.body.appendChild(_8c4);
if(_8c2){
var _8c5=new DwtControl(this,null,Dwt.ABSOLUTE_STYLE);
_8c5.getHtmlElement().appendChild(_8c2);
_8c5.setSize("100%","100%");
_8c5.zShow(true);
}
Dwt.associateElementWithObject(_8c4,this);
this.shell=this;
this._createBusyOverlay(_8c4);
this._veilOverlay=document.createElement("div");
this._veilOverlay.className=(!AjxEnv.isLinux)?"VeilOverlay":"VeilOverlay-linux";
this._veilOverlay.style.position="absolute";
this._veilOverlay.style.cursor=AjxEnv.isIE6up?"not-allowed":"wait";
Dwt.setBounds(this._veilOverlay,0,0,"100%","100%");
Dwt.setZIndex(this._veilOverlay,Dwt.Z_HIDDEN);
this._veilOverlay.veilZ=new Array();
this._veilOverlay.veilZ.push(Dwt.Z_HIDDEN);
this._veilOverlay.dialogZ=new Array();
this._veilOverlay.activeDialogs=new Array();
this._veilOverlay.innerHTML="<table cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td>&nbsp;</td></tr></table>";
_8c4.appendChild(this._veilOverlay);
if(_8c3){
this._curtainOverlay=document.createElement("div");
this._curtainOverlay.className="CurtainOverlay";
this._curtainOverlay.style.position="absolute";
Dwt.setBounds(this._curtainOverlay,0,0,"100%","100%");
Dwt.setZIndex(this._curtainOverlay,Dwt.Z_CURTAIN);
this._curtainOverlay.innerHTML="<table cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td>&nbsp;</td></tr></table>";
_8c4.appendChild(this._curtainOverlay);
}
this._uiEvent=new DwtUiEvent(true);
this._currWinSize=Dwt.getWindowSize();
this._toolTip=new DwtToolTip(this);
this._hoverMgr=new DwtHoverMgr();
this._keyboardMgr=new DwtKeyboardMgr();
}
DwtShell.prototype=new DwtComposite;
DwtShell.prototype.constructor=DwtShell;
DwtShell.CANCEL_BUTTON=-1;
DwtShell.controlEvent=new DwtControlEvent();
DwtShell.focusEvent=new DwtFocusEvent();
DwtShell.keyEvent=new DwtKeyEvent();
DwtShell.mouseEvent=new DwtMouseEvent();
DwtShell.selectionEvent=new DwtSelectionEvent(true);
DwtShell.treeEvent=new DwtTreeEvent();
DwtShell.prototype.toString=function(){
return "DwtShell";
};
DwtShell.getShell=function(win){
return AjxCore.objectWithId(win._dwtShell);
};
DwtShell.prototype.getKeyboardMgr=function(){
return this._keyboardMgr;
};
DwtShell.prototype.setBusy=function(busy,id,_8c9,_8ca,_8cb){
if(busy){
this._setBusyCount++;
}else{
if(this._setBusyCount>0){
this._setBusyCount--;
}
}
if(!this._setBusy&&(this._setBusyCount>0)){
Dwt.setCursor(this._busyOverlay,"wait");
Dwt.setVisible(this._busyOverlay,true);
this._setBusy=true;
if(this._keyboardMgr.isEnabled()){
this._keyboardMgr.enable(false);
this._kbnavDisabled=true;
}
}else{
if(this._setBusy&&(this._setBusyCount<=0)){
Dwt.setCursor(this._busyOverlay,"default");
Dwt.setVisible(this._busyOverlay,false);
this._setBusy=false;
if(this._kbnavDisabled){
this._keyboardMgr.enable(true);
this._kbnavDisabled=false;
}
}
}
if(busy&&_8c9){
if(_8ca&&_8ca>0){
this._busyActionId[id]=AjxTimedAction.scheduleAction(this._busyTimedAction,_8ca);
}else{
this._showBusyDialogAction(id);
}
if(_8cb){
this._cancelBusyCallback=_8cb;
this._busyDialog.setButtonEnabled(DwtShell.CANCEL_BUTTON,true);
}else{
this._busyDialog.setButtonEnabled(DwtShell.CANCEL_BUTTON,false);
}
}else{
if(this._busyActionId[id]&&(this._busyActionId[id]!=-1)){
AjxTimedAction.cancelAction(this._busyActionId[id]);
this._busyActionId[id]=-1;
}
if(this._busyDialog.isPoppedUp){
this._busyDialog.popdown();
}
}
};
DwtShell.prototype.getBusy=function(){
return this._setBusy;
};
DwtShell.prototype.setBusyDialogText=function(text){
this._busyDialogTxt.innerHTML=(text)?text:"";
};
DwtShell.prototype.setBusyDialogTitle=function(_8cd){
this._busyDialog.setTitle((_8cd)?_8cd:AjxMsg.workInProgress);
};
DwtShell.prototype.getHoverMgr=function(){
return this._hoverMgr;
};
DwtShell.prototype.getToolTip=function(){
return this._toolTip;
};
DwtShell.prototype.getH=function(_8ce){
return (!this._virtual)?Dwt.getSize(this.getHtmlElement(),_8ce).y:Dwt.getSize(document.body,_8ce).y;
};
DwtShell.prototype.getW=function(_8cf){
return (!this._virtual)?Dwt.getSize(this.getHtmlElement(),_8cf).x:Dwt.getSize(document.body,_8cf).x;
};
DwtShell.prototype.getSize=function(_8d0){
return (!this._virtual)?Dwt.getSize(this.getHtmlElement(),_8d0):Dwt.getSize(document.body,_8d0);
};
DwtShell.prototype.getLocation=function(){
return (!this._virtual)?Dwt.getLocation(this.getHtmlElement()):Dwt.getLocation(document.body);
};
DwtShell.prototype.getX=function(){
return (!this._virtual)?Dwt.getLocation(this.getHtmlElement()).x:Dwt.getLocation(document.body).x;
};
DwtShell.prototype.getY=function(){
return (!this._virtual)?Dwt.getLocation(this.getHtmlElement()).y:Dwt.getLocation(document.body).y;
};
DwtShell.prototype.getBounds=function(_8d1){
return (!this._virtual)?Dwt.getBounds(this.getHtmlElement(),_8d1):Dwt.getBounds(document.body,_8d1);
};
DwtShell.prototype.setVirtual=function(){
this._virtual=true;
this.setVisible(false);
};
DwtShell.prototype.isVirtual=function(){
return this._virtual;
};
DwtShell.prototype._showBusyDialogAction=function(id){
this._busyDialog.popup();
this._busyActionId[id]=-1;
};
DwtShell.prototype._createBusyOverlay=function(_8d3){
this._busyOverlay=document.createElement("div");
this._busyOverlay.className=(!AjxEnv.isLinux)?"BusyOverlay":"BusyOverlay-linux";
this._busyOverlay.style.position="absolute";
Dwt.setBounds(this._busyOverlay,0,0,"100%","100%");
Dwt.setZIndex(this._busyOverlay,Dwt.Z_VEIL);
this._busyOverlay.innerHTML="<table cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td>&nbsp;</td></tr></table>";
_8d3.appendChild(this._busyOverlay);
Dwt.setVisible(this._busyOverlay,false);
var _8d4=new DwtDialog_ButtonDescriptor(DwtShell.CANCEL_BUTTON,AjxMsg.cancelRequest,DwtDialog.ALIGN_CENTER);
this._busyDialog=new DwtDialog(this,"DwtShellbusyDialog",AjxMsg.workInProgress,DwtDialog.NO_BUTTONS,[_8d4],Dwt.BUSY+10);
this._busyDialog.registerCallback(DwtShell.CANCEL_BUTTON,this._busyCancelButtonListener,this);
var _8d5=Dwt.getNextId();
var html=["<table class='DialogContent'><tr>","<td><div class='WaitIcon'></div></td><td class='MsgText' id='",_8d5,"'>&nbsp;</td>","</tr></table>"].join("");
this._busyDialog.setContent(html);
this._busyDialogTxt=document.getElementById(_8d5);
this._busyTimedAction=new AjxTimedAction(this,this._showBusyDialogAction);
this._busyActionId={};
this._setBusyCount=0;
this._setBusy=false;
};
DwtShell.prototype._busyCancelButtonListener=function(ev){
this._cancelBusyCallback.run();
this._busyDialog.popdown();
};
DwtShell._preventDefaultSelectPrt=function(ev){
var evt=AjxCore.objectWithId(window._dwtShell)._uiEvent;
evt.setFromDhtmlEvent(ev);
if(evt.dwtObj&&evt.dwtObj instanceof DwtControl&&!evt.dwtObj.preventSelection(evt.target)){
evt._stopPropagation=false;
evt._returnValue=true;
}else{
evt._stopPropagation=true;
evt._returnValue=false;
}
evt.setToDhtmlEvent(ev);
return !evt._stopPropagation;
};
DwtShell._preventDefaultPrt=function(ev){
ev=DwtUiEvent.getEvent(ev);
var _8db=ev.target?ev.target:ev.srcElement;
var evt=AjxCore.objectWithId(window._dwtShell)._uiEvent;
evt.setFromDhtmlEvent(ev);
evt._stopPropagation=true;
evt._returnValue=false;
if(evt.dwtObj&&evt.dwtObj instanceof DwtControl&&!evt.dwtObj.preventContextMenu(evt.target)){
evt._stopPropagation=false;
evt._returnValue=true;
}else{
if(_8db!=null&&typeof (_8db)=="object"){
if((_8db.tagName=="A"||_8db.tagName=="a")&&_8db.href){
evt._stopPropagation=false;
evt._returnValue=true;
}
}
}
evt.setToDhtmlEvent(ev);
return evt._returnValue;
};
DwtShell._resizeHdlr=function(ev){
var _8de=AjxCore.objectWithId(window._dwtShell);
if(_8de.isListenerRegistered(DwtEvent.CONTROL)){
var evt=DwtShell.controlEvent;
evt.reset();
evt.oldWidth=_8de._currWinSize.x;
evt.oldHeight=_8de._currWinSize.y;
_8de._currWinSize=Dwt.getWindowSize();
evt.newWidth=_8de._currWinSize.x;
evt.newHeight=_8de._currWinSize.y;
_8de.notifyListeners(DwtEvent.CONTROL,evt);
}else{
_8de._currWinSize=Dwt.getWindowSize();
}
};
DwtShell.__onBodyScroll=function(){
document.body.scrollTop=0;
document.body.scrollLeft=0;
};
function DwtColorPicker(_8e0,_8e1,_8e2,_8e3){
if(arguments.length==0){
return;
}
_8e1=_8e1||"DwtColorPicker";
DwtControl.call(this,_8e0,_8e1,_8e2);
this._noFillLabel=_8e3;
this._createColorTable();
this._registerEventHdlrs();
}
DwtColorPicker.prototype=new DwtControl;
DwtColorPicker.prototype.constructor=DwtColorPicker;
DwtColorPicker._RGB_RE=/rgb\(([0-9]{1,3}), ([0-9]{1,3}), ([0-9]{1,3})\)/;
DwtColorPicker._HEX_RE=/\#([0-9FCfc]{2})([0-9FCfc]{2})([0-9FCfc]{2})/;
DwtColorPicker.prototype.toString=function(){
return "DwtColorPicker";
};
DwtColorPicker.prototype.addSelectionListener=function(_8e4){
this.addListener(DwtEvent.SELECTION,_8e4);
};
DwtColorPicker.prototype.removeSelectionListener=function(_8e5){
this.removeListener(DwtEvent.SELECTION,_8e5);
};
DwtColorPicker.prototype.dispose=function(){
if(this._disposed){
return;
}
Dwt.disassociateElementFromObject(this.getHtmlElement().firstChild,this);
DwtControl.prototype.dispose.call(this);
};
DwtColorPicker.prototype._registerEventHdlrs=function(){
var _8e6=this.getHtmlElement().firstChild;
Dwt.associateElementWithObject(_8e6,this);
var rows=_8e6.rows;
var _8e8=rows.length;
for(var i=0;i<_8e8;i++){
var _8ea=rows[i].cells;
var _8eb=_8ea.length;
for(var j=0;j<_8eb;j++){
var cell=_8ea[j];
Dwt.setHandler(cell,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
Dwt.setHandler(cell,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr);
if(AjxEnv.isIE){
Dwt.setHandler(cell,DwtEvent.ONMOUSEOVER,DwtColorPicker._mouseOverHdlr);
Dwt.setHandler(cell,DwtEvent.ONMOUSEOUT,DwtColorPicker._mouseOutHdlr);
}else{
Dwt.setHandler(cell,DwtEvent.ONMOUSEENTER,DwtColorPicker._mouseOverHdlr);
Dwt.setHandler(cell,DwtEvent.ONMOUSELEAVE,DwtColorPicker._mouseOutHdlr);
}
if(cell.className!="NoFill"){
cell.style.border="2px outset "+cell.style.backgroundColor;
}
}
}
};
DwtColorPicker.prototype._createColorTable=function(){
this._tdId=Dwt.getNextId();
var html=new Array(150);
var i=0;
html[i++]="<table cellpadding='0' cellspacing='0' border='0' align='center'>";
if(this._noFillLabel){
html[i++]="<tr><td colspan='10' class='NoFill'>"+this._noFillLabel+"</td></tr>";
}
html[i++]="<tr>";
html[i++]="<td id='"+this._tdId+"#FFFFFF' style='background-color:#FFFFFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFCCCC' style='background-color:#FFCCCC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFCC99' style='background-color:#FFCC99' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFFF99' style='background-color:#FFFF99' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFFFCC' style='background-color:#FFFFCC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#99FF99' style='background-color:#99FF99' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#99FFFF' style='background-color:#99FFFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CCFFFF' style='background-color:#CCFFFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CCCCFF' style='background-color:#CCCCFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFCCFF' style='background-color:#FFCCFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr><tr>";
html[i++]="<td id='"+this._tdId+"#CCCCCC' style='background-color:#CCCCCC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FF6666' style='background-color:#FF6666' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FF9966' style='background-color:#FF9966' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFFF66' style='background-color:#FFFF66' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFFF33' style='background-color:#FFFF33' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#66FF99' style='background-color:#66FF99' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#33FFFF' style='background-color:#33FFFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#66FFFF' style='background-color:#66FFFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#9999FF' style='background-color:#9999FF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FF99FF' style='background-color:#FF99FF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr><tr>";
html[i++]="<td id='"+this._tdId+"#C0C0C0' style='background-color:#C0C0C0' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FF0000' style='background-color:#FF0000' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FF9900' style='background-color:#FF9900' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFCC66' style='background-color:#FFCC66' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFFF00' style='background-color:#FFFF00' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#33FF33' style='background-color:#33FF33' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#66CCCC' style='background-color:#66CCCC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#33CCFF' style='background-color:#33CCFF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#6666CC' style='background-color:#6666CC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CC66CC' style='background-color:#CC66CC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr><tr>";
html[i++]="<td id='"+this._tdId+"#999999' style='background-color:#999999' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CC0000' style='background-color:#CC0000' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FF6600' style='background-color:#FF6600' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFCC33' style='background-color:#FFCC33' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#FFCC00' style='background-color:#FFCC00' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#33CC00' style='background-color:#33CC00' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#00CCCC' style='background-color:#00CCCC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#3366FF' style='background-color:#3366FF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#6633FF' style='background-color:#6633FF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CC33CC' style='background-color:#CC33CC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr><tr>";
html[i++]="<td id='"+this._tdId+"#666666' style='background-color:#666666' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#990000' style='background-color:#990000' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CC6600' style='background-color:#CC6600' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#CC9933' style='background-color:#CC9933' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#999900' style='background-color:#999900' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#009900' style='background-color:#009900' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#339999' style='background-color:#339999' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#3333FF' style='background-color:#3333FF' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#6600CC' style='background-color:#6600CC' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#993399' style='background-color:#993399' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr><tr>";
html[i++]="<td id='"+this._tdId+"#333333' style='background-color:#333333' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#660000' style='background-color:#660000' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#993300' style='background-color:#993300' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#996633' style='background-color:#996633' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#666600' style='background-color:#666600' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#006600' style='background-color:#006600' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#336666' style='background-color:#336666' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#000099' style='background-color:#000099' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#333399' style='background-color:#333399' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#663366' style='background-color:#663366' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr><tr>";
html[i++]="<td id='"+this._tdId+"#000000' style='background-color:#000000' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#330000' style='background-color:#330000' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#663300' style='background-color:#663300' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#663333' style='background-color:#663333' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#333300' style='background-color:#333300' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#003300' style='background-color:#003300' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#003333' style='background-color:#003333' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#000066' style='background-color:#000066' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#330099' style='background-color:#330099' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="<td id='"+this._tdId+"#330033' style='background-color:#330033' width='12' height='14'><img height='1' width='1'/></td>";
html[i++]="</tr></table>";
this.getHtmlElement().innerHTML=html.join("");
};
DwtColorPicker._mouseOverHdlr=function(ev){
var _8f1=DwtShell.mouseEvent;
_8f1.setFromDhtmlEvent(ev);
var _8f2=_8f1.target;
if(_8f2.nodeName.toLowerCase()=="img"){
_8f2=_8f2.parentNode;
}
if(_8f1.dwtObj._downTdId==_8f2.id){
var tmp=_8f2.style.backgroundColor;
_8f2.style.backgroundColor=_8f1.dwtObj._swappedColor;
_8f1.dwtObj._swappedColor=tmp;
_8f2.style.borderStyle="inset";
_8f2.style.borderColor=tmp;
}
this._stopPropagation=true;
this._returnValue=false;
_8f1.setToDhtmlEvent(ev);
return false;
};
DwtColorPicker._mouseOutHdlr=function(ev){
var _8f5=DwtShell.mouseEvent;
_8f5.setFromDhtmlEvent(ev);
var _8f6=_8f5.target;
if(_8f6.nodeName.toLowerCase()=="img"){
_8f6=_8f6.parentNode;
}
if(_8f5.dwtObj._downTdId==_8f6.id){
var tmp=_8f6.style.backgroundColor;
_8f6.style.backgroundColor=_8f5.dwtObj._swappedColor;
_8f5.dwtObj._swappedColor=tmp;
_8f6.style.borderStyle="outset";
_8f6.style.borderColor=tmp;
_8f5.dwtObj._downTdId=null;
}
this._stopPropagation=true;
this._returnValue=false;
_8f5.setToDhtmlEvent(ev);
return false;
};
DwtColorPicker._mouseDownHdlr=function(ev){
var _8f9=DwtShell.mouseEvent;
_8f9.setFromDhtmlEvent(ev);
var _8fa=_8f9.target;
if(_8fa.nodeName.toLowerCase()=="img"){
_8fa=_8fa.parentNode;
}
var _8fb=_8f9.target.style.backgroundColor;
var rgb;
var r,g,b;
_8f9.dwtObj._downTdId=_8fa.id;
_8f9.dwtObj._swappedColor=_8fb;
_8fa.style.borderStyle="inset";
if(_8fa.className!="NoFill"){
if(_8fb.substr(0,1)=="#"){
rgb=_8fb.match(DwtColorPicker._HEX_RE);
rgb[1]=DwtColorPicker._hexConv(rgb[1]);
rgb[2]=DwtColorPicker._hexConv(rgb[2]);
rgb[3]=DwtColorPicker._hexConv(rgb[3]);
}else{
rgb=_8fb.match(DwtColorPicker._RGB_RE);
}
r=Math.max(Math.floor(rgb[1]-(rgb[1]*0.25)),0);
g=Math.max(Math.floor(rgb[2]-(rgb[2]*0.25)),0);
b=Math.max(Math.floor(rgb[3]-(rgb[3]*0.25)),0);
_8fb="rgb("+r+","+g+","+b+")";
_8fa.style.backgroundColor=_8fb;
}
_8f9._stopPropagation=true;
_8f9._returnValue=false;
_8f9.setToDhtmlEvent(ev);
return false;
};
DwtColorPicker._hexConv=function(_8fe){
if(_8fe=="00"){
return 0;
}else{
if(_8fe=="33"){
return 51;
}else{
if(_8fe=="66"){
return 102;
}else{
if(_8fe=="99"){
return 153;
}else{
if(_8fe.toUpperCase()=="CC"){
return 204;
}else{
if(_8fe.toUpperCase()=="FF"){
return 255;
}else{
if(_8fe.toUpperCase()=="C0"){
return 192;
}
}
}
}
}
}
}
};
DwtColorPicker._mouseUpHdlr=function(ev){
var _900=DwtShell.mouseEvent;
_900.setFromDhtmlEvent(ev);
var me=_900.dwtObj;
var _902=_900.target;
if(_902.nodeName.toLowerCase()=="img"){
_902=_902.parentNode;
}
if(me._downTdId==_902.id){
_902.style.borderStyle="outset";
_902.style.borderColor=_900.dwtObj._swappedColor;
_902.style.backgroundColor=_900.dwtObj._swappedColor;
}
if(me._downTdId==_902.id){
if(me.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu();
}
if(me.isListenerRegistered(DwtEvent.SELECTION)){
var _903=DwtShell.selectionEvent;
DwtUiEvent.copy(_903,_900);
_903.item=me;
_903.detail=_900.target.id.substr(_900.target.id.indexOf("#"));
me.notifyListeners(DwtEvent.SELECTION,_903);
}
}
me._downTdId=null;
_900._stopPropagation=true;
_900._returnValue=false;
_900.setToDhtmlEvent(ev);
return false;
};
function DwtBaseDialog(_904,_905,_906,_907,mode,loc,view,_90b){
if(arguments.length==0){
return;
}
if(!(_904 instanceof DwtShell)){
throw new DwtException("DwtBaseDialog parent must be a DwtShell",DwtException.INVALIDPARENT,"DwtDialog");
}
_905=_905||"DwtBaseDialog";
this._title=_906||"";
DwtComposite.call(this,_904,_905,DwtControl.ABSOLUTE_STYLE);
this._shell=_904;
this._zIndex=_907||Dwt.Z_DIALOG;
this._mode=mode||DwtBaseDialog.MODAL;
this._loc=new DwtPoint();
if(loc){
this._loc.x=loc.x;
this._loc.y=loc.y;
}else{
this._loc.x=this._loc.y=Dwt.LOC_NOWHERE;
}
this._tabGroup=new DwtTabGroup(this.toString(),true);
this._createHtml();
if(view!=null){
this.setView(view);
}
var _90c=this.getHtmlElement();
var _90d=_90b?_90b:(_90c.id+"_handle");
this._initializeDragging(_90d);
this.setZIndex(Dwt.Z_HIDDEN);
this._positionDialog(DwtBaseDialog.__nowhereLoc);
}
DwtBaseDialog.prototype=new DwtComposite;
DwtBaseDialog.prototype.constructor=DwtBaseDialog;
DwtBaseDialog.prototype._borderStyle="DwtDialog";
DwtBaseDialog.MODELESS=1;
DwtBaseDialog.MODAL=2;
DwtBaseDialog.__nowhereLoc=new DwtPoint(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
DwtBaseDialog.prototype.toString=function(){
return "DwtBaseDialog";
};
DwtBaseDialog.prototype.addPopupListener=function(_90e){
this.addListener(DwtEvent.POPUP,_90e);
};
DwtBaseDialog.prototype.removePopupListener=function(_90f){
this.removeListener(DwtEvent.POPUP,_90f);
};
DwtBaseDialog.prototype.addPopdownListener=function(_910){
this.addListener(DwtEvent.POPDOWN,_910);
};
DwtBaseDialog.prototype.removePopdownListener=function(_911){
this.removeListener(DwtEvent.POPDOWN,_911);
};
DwtBaseDialog.prototype._initializeDragging=function(_912){
var _913=document.getElementById(_912);
if(_913){
var p=Dwt.getSize(AjxCore.objectWithId(window._dwtShell).getHtmlElement());
var _915=document.getElementById(this._htmlElId);
var size=this.getSize();
var _917=new AjxCallback(this,this._dragEnd);
var _918=new AjxCallback(this,this._duringDrag);
var _919=new AjxCallback(this,this._dragStart);
DwtDraggable.init(_913,_915,0,document.body.offsetWidth-10,0,document.body.offsetHeight-10,_919,_918,_917);
}
};
DwtBaseDialog.prototype.popup=function(loc){
if(this._poppedUp){
return;
}
this.applyCaretHack();
this.cleanup(true);
var _91b=this._zIndex;
if(this._mode==DwtBaseDialog.MODAL){
_91b=this._setModalEffect(_91b);
}
this._shell._veilOverlay.activeDialogs.push(this);
if(loc){
this._loc.x=loc.x;
this._loc.y=loc.y;
this._positionDialog(loc);
}else{
this._positionDialog();
}
this.setZIndex(_91b);
this._poppedUp=true;
var _91c=this._shell.getKeyboardMgr();
_91c.pushTabGroup(this._tabGroup);
_91c.pushDefaultHandler(this);
this._tabGroup.resetFocusMember(true);
this.notifyListeners(DwtEvent.POPUP,this);
};
DwtBaseDialog.prototype.focus=function(){
if(this.isListenerRegistered(DwtEvent.ONFOCUS)){
this.notifyListeners(DwtEvent.ONFOCUS);
}else{
if(this._focusElementId){
var _91d=document.getElementById(this._focusElementId);
if(_91d){
_91d.focus();
}
}
}
};
DwtBaseDialog.prototype.isPoppedUp=function(){
return this._poppedUp;
};
DwtBaseDialog.prototype.popdown=function(){
if(this._poppedUp){
this._poppedUp=false;
this.cleanup(false);
var _91e=this._zIndex;
this.setZIndex(Dwt.Z_HIDDEN);
this._positionDialog(DwtBaseDialog.__nowhereLoc);
if(this._mode==DwtBaseDialog.MODAL){
this._undoModality(_91e);
}else{
this._shell._veilOverlay.activeDialogs.pop();
}
var _91f=this._shell.getKeyboardMgr();
_91f.popTabGroup(this._tabGroup);
_91f.popDefaultHandler();
this.notifyListeners(DwtEvent.POPDOWN,this);
}
};
DwtBaseDialog.prototype.setView=function(_920){
this.reset();
if(_920){
this._getContentDiv().appendChild(_920.getHtmlElement());
}
};
DwtBaseDialog.prototype.reset=function(){
this._loc.x=this._loc.y=Dwt.LOC_NOWHERE;
};
DwtBaseDialog.prototype.cleanup=function(_921){
var _922=this._getInputFields();
if(_922){
var len=_922.length;
for(var i=0;i<len;i++){
_922[i].disabled=!_921;
if(_921){
_922[i].value="";
}
}
}
};
DwtBaseDialog.prototype.setContent=function(text){
var d=this._getContentDiv();
if(d){
d.innerHTML=text;
}
};
DwtBaseDialog.prototype._getContentDiv=function(){
return this._contentDiv;
};
DwtBaseDialog.prototype.addEnterListener=function(_927){
this.addListener(DwtEvent.ENTER,_927);
};
DwtBaseDialog.getActiveDialog=function(){
var _928=null;
var _929=DwtShell.getShell(window);
if(_929){
var len=_929._veilOverlay.activeDialogs.length;
if(len>0){
_928=_929._veilOverlay.activeDialogs[len-1];
}
}
return _928;
};
DwtBaseDialog.prototype._getContentHtml=function(){
return "<div id='"+this._contentId+"'></div>";
};
DwtBaseDialog.prototype._createHtml=function(){
var id=this._htmlElId;
this._titleHandleId=id+"_title";
this._titleCellId=id+"_title_cell";
this._contentId=id+"_contents";
var subs={id:this._htmlElId,title:this._title,titleTextId:this._titleCellId,titleId:this._titleHandleId,icon:"",closeIcon1:"",closeIcon2:""};
var html=AjxTemplate.expand("ajax.dwt.templates.Widgets#"+this._borderStyle,subs);
this.getHtmlElement().innerHTML=html;
var _92e=document.getElementById(id+"_container");
_92e.innerHTML=this._getContentHtml();
this._contentDiv=document.getElementById(this._contentId);
};
DwtBaseDialog.prototype._setModalEffect=function(){
var _92f=this._shell._veilOverlay.dialogZ;
var _930=null;
var _931,veilZ;
if(_92f.length){
_930=_92f[_92f.length-1];
}
if(_930){
_931=_930+2;
veilZ=_930+1;
}else{
_931=this._zIndex;
veilZ=Dwt.Z_VEIL;
}
this._shell._veilOverlay.veilZ.push(veilZ);
this._shell._veilOverlay.dialogZ.push(_931);
Dwt.setZIndex(this._shell._veilOverlay,veilZ);
return _931;
};
DwtBaseDialog.prototype._undoModality=function(_932){
var _933=this._shell._veilOverlay.veilZ;
_933.pop();
var _934=_933[_933.length-1];
Dwt.setZIndex(this._shell._veilOverlay,_934);
this._shell._veilOverlay.dialogZ.pop();
this._shell._veilOverlay.activeDialogs.pop();
if(this._shell._veilOverlay.activeDialogs.length>0){
this._shell._veilOverlay.activeDialogs[0].focus();
}
};
DwtBaseDialog.prototype._positionDialog=function(loc){
var _936=this._shell.getSize();
var _937=this.getSize();
var x,y;
if(loc==null){
x=Math.round((_936.x-_937.x)/2);
y=Math.round((_936.y-_937.y)/2);
}else{
x=loc.x;
y=loc.y;
}
if((x+_937.x)>_936.x){
x=_936.x-_937.x;
}
if((y+_937.y)>_936.y){
y=_936.y-_937.y;
}
this.setLocation(x,y);
};
DwtBaseDialog.prototype._getInputFields=function(){
};
DwtBaseDialog.prototype._dragStart=function(x,y){
if(AjxEnv.isNav){
this._currSize=this.getSize();
DwtDraggable.setDragBoundaries(DwtDraggable.dragEl,0,document.body.offsetWidth-this._currSize.x,0,document.body.offsetHeight-this._currSize.y);
}
};
DwtBaseDialog.prototype._dragEnd=function(x,y){
this._loc.x=x;
this._loc.y=y;
};
DwtBaseDialog.prototype._duringDrag=function(x,y){
};
DwtBaseDialog.prototype._doesContainElement=function(_93f){
return Dwt.contains(this.getHtmlElement(),_93f);
};
function DwtDialog(_940,_941,_942,_943,_944,_945,mode,loc){
if(arguments.length==0){
return;
}
_941=_941||"DwtDialog";
this._title=_942||"";
if(!_943){
_943=[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON];
}else{
if(_943==DwtDialog.NO_BUTTONS){
_943=null;
}
}
this._buttonList=new Array();
if(_943||_944){
this._buttonDesc=new Object();
if(_943&&_943.length){
this._enterButtonId=_943[0];
for(var i=0;i<_943.length;i++){
var _949=_943[i];
this._buttonList.push(_949);
this._buttonDesc[_949]=new DwtDialog_ButtonDescriptor(_949,AjxMsg[DwtDialog.MSG_KEY[_949]],this.getAlignmentForButton(_949));
}
this._resetCallbacks();
}
if(_944&&_944.length){
if(!this._enterButtonId){
this._enterButtonId=_944[0];
}
for(var i=0;i<_944.length;i++){
var _949=_944[i].id;
this._buttonList.push(_949);
this._buttonDesc[_949]=_944[i];
}
}
}
this._titleCellId=Dwt.getNextId();
this._contentId=Dwt.getNextId();
this._buttonElementId=new Object();
for(var i=0;i<this._buttonList.length;i++){
this._buttonElementId[this._buttonList[i]]=Dwt.getNextId();
}
DwtBaseDialog.call(this,_940,_941,this._title,_945,mode,loc);
this._titleCell=document.getElementById(this._titleCellId);
this._contentDiv=document.getElementById(this._contentId);
this._button=new Object();
for(var i=0;i<this._buttonList.length;i++){
var _949=this._buttonList[i];
var b=this._button[_949]=new DwtButton(this);
b.setText(this._buttonDesc[_949].label);
b.buttonId=_949;
b.addSelectionListener(new AjxListener(this,this._buttonListener));
this._tabGroup.addMember(b);
document.getElementById(this._buttonElementId[_949]).appendChild(b.getHtmlElement());
}
this._initializeDragging(this._titleHandleId);
}
DwtDialog.prototype=new DwtBaseDialog;
DwtDialog.prototype.constructor=DwtDialog;
function DwtDialog_ButtonDescriptor(id,_94c,_94d,_94e,_94f){
this.id=id;
this.label=_94c;
this.align=_94d;
this.callback=_94e;
this.cellTemplate=_94f;
}
DwtDialog.prototype.getAlignmentForButton=function(id){
return DwtDialog.ALIGN[id];
};
DwtDialog.ALIGN_LEFT=1;
DwtDialog.ALIGN_RIGHT=2;
DwtDialog.ALIGN_CENTER=3;
DwtDialog.CANCEL_BUTTON=1;
DwtDialog.OK_BUTTON=2;
DwtDialog.DISMISS_BUTTON=3;
DwtDialog.NO_BUTTON=4;
DwtDialog.YES_BUTTON=5;
DwtDialog.LAST_BUTTON=5;
DwtDialog.NO_BUTTONS=256;
DwtDialog.ALL_BUTTONS=[DwtDialog.CANCEL_BUTTON,DwtDialog.OK_BUTTON,DwtDialog.DISMISS_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.YES_BUTTON];
DwtDialog.MSG_KEY=new Object();
DwtDialog.MSG_KEY[DwtDialog.CANCEL_BUTTON]="cancel";
DwtDialog.MSG_KEY[DwtDialog.OK_BUTTON]="ok";
DwtDialog.MSG_KEY[DwtDialog.DISMISS_BUTTON]="dismiss";
DwtDialog.MSG_KEY[DwtDialog.NO_BUTTON]="no";
DwtDialog.MSG_KEY[DwtDialog.YES_BUTTON]="yes";
DwtDialog.ALIGN=new Object();
DwtDialog.ALIGN[DwtDialog.CANCEL_BUTTON]=DwtDialog.ALIGN_RIGHT;
DwtDialog.ALIGN[DwtDialog.OK_BUTTON]=DwtDialog.ALIGN_RIGHT;
DwtDialog.ALIGN[DwtDialog.DISMISS_BUTTON]=DwtDialog.ALIGN_RIGHT;
DwtDialog.ALIGN[DwtDialog.NO_BUTTON]=DwtDialog.ALIGN_RIGHT;
DwtDialog.ALIGN[DwtDialog.YES_BUTTON]=DwtDialog.ALIGN_RIGHT;
DwtDialog.MODELESS=DwtBaseDialog.MODELESS;
DwtDialog.MODAL=DwtBaseDialog.MODAL;
DwtDialog.prototype.toString=function(){
return "DwtDialog";
};
DwtDialog.prototype.popdown=function(){
DwtBaseDialog.prototype.popdown.call(this);
this.resetButtonStates();
};
DwtDialog.prototype.reset=function(){
this._resetCallbacks();
this.resetButtonStates();
DwtBaseDialog.prototype.reset.call(this);
};
DwtDialog.prototype.resetButtonStates=function(){
for(b in this._button){
this._button[b].setEnabled(true);
this._button[b].setActivated(false);
}
};
DwtDialog.prototype.getButton=function(_951){
return this._button[_951];
};
DwtDialog.prototype.setButtonEnabled=function(_952,_953){
this._button[_952].setEnabled(_953);
};
DwtDialog.prototype.setButtonVisible=function(_954,_955){
this._button[_954].setVisible(_955);
};
DwtDialog.prototype.getButtonEnabled=function(_956){
return this._button[_956].getEnabled();
};
DwtDialog.prototype.registerCallback=function(_957,func,obj,args){
this._buttonDesc[_957].callback=new AjxCallback(obj,func,args);
};
DwtDialog.prototype.unregisterCallback=function(_95b){
this._buttonDesc[_95b].callback=null;
};
DwtDialog.prototype.setButtonListener=function(_95c,_95d){
this._button[_95c].removeSelectionListeners();
this._button[_95c].addSelectionListener(_95d);
};
DwtDialog.prototype.setTitle=function(_95e){
this._title=_95e;
this._titleCell.innerHTML=_95e;
};
DwtDialog.prototype.associateEnterWithButton=function(id){
this._enterButtonId=id;
};
DwtDialog.prototype.getKeyMapName=function(){
return "DwtDialog";
};
DwtDialog.prototype.handleKeyAction=function(_960,ev){
switch(_960){
case DwtKeyMap.ENTER:
this.notifyListeners(DwtEvent.ENTER,ev);
break;
case DwtKeyMap.CANCEL:
this.popdown();
break;
default:
return false;
}
return true;
};
DwtDialog.prototype._getContentHtml=function(){
var html=new Array();
var idx=0;
if(AjxEnv.isNav){
html[idx++]="<input type='button' id='";
html[idx++]=this._focusElementId=Dwt.getNextId();
html[idx++]="' style='height:0px; width:0px; display:none;'>";
}
html[idx++]=DwtBaseDialog.prototype._getContentHtml.call(this);
idx=this._addButtonsHtml(html,idx);
return html.join("");
};
DwtDialog.prototype._getSeparatorTemplate=function(){
return "<div class=horizSep></div>";
};
DwtDialog.prototype._getButtonsContainerStartTemplate=function(){
return "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>";
};
DwtDialog.prototype._getButtonsAlignStartTemplate=function(){
return "<td align=\"{0}\"><table cellspacing='5' cellpadding='0' border='0'><tr>";
};
DwtDialog.prototype._getButtonsAlignEndTemplate=function(){
return "</tr></table></td>";
};
DwtDialog.prototype._getButtonsCellTemplate=function(){
return "<td id=\"{0}\"></td>";
};
DwtDialog.prototype._getButtonsContainerEndTemplate=function(){
return "</tr></table>";
};
DwtDialog.prototype._addButtonsHtml=function(html,idx){
if(this._buttonList&&this._buttonList.length){
var _966=new Array();
var _967=new Array();
var _968=new Array();
for(var i=0;i<this._buttonList.length;i++){
var _96a=this._buttonList[i];
switch(this._buttonDesc[_96a].align){
case DwtDialog.ALIGN_RIGHT:
_967.push(_96a);
break;
case DwtDialog.ALIGN_LEFT:
_966.push(_96a);
break;
case DwtDialog.ALIGN_CENTER:
_968.push(_96a);
break;
}
}
html[idx++]=this._getSeparatorTemplate();
html[idx++]=this._getButtonsContainerStartTemplate();
if(_966.length){
html[idx++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["left"]);
for(var i=0;i<_966.length;i++){
var _96a=_966[i];
var _96b=this._buttonDesc[_96a].cellTemplate?this._buttonDesc[_96a].cellTemplate:this._getButtonsCellTemplate();
html[idx++]=AjxMessageFormat.format(_96b,[this._buttonElementId[_96a]]);
}
html[idx++]=this._getButtonsAlignEndTemplate();
}
if(_968.length){
html[idx++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["center"]);
for(var i=0;i<_968.length;i++){
var _96a=_968[i];
var _96b=this._buttonDesc[_96a].cellTemplate?this._buttonDesc[_96a].cellTemplate:this._getButtonsCellTemplate();
html[idx++]=AjxMessageFormat.format(_96b,[this._buttonElementId[_96a]]);
}
html[idx++]=this._getButtonsAlignEndTemplate();
}
if(_967.length){
html[idx++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["right"]);
for(var i=0;i<_967.length;i++){
var _96a=_967[i];
var _96b=this._buttonDesc[_96a].cellTemplate?this._buttonDesc[_96a].cellTemplate:this._getButtonsCellTemplate();
html[idx++]=AjxMessageFormat.format(_96b,[this._buttonElementId[_96a]]);
}
html[idx++]=this._getButtonsAlignEndTemplate();
}
html[idx++]=this._getButtonsContainerEndTemplate();
}
return idx;
};
DwtDialog.prototype._buttonListener=function(ev,args){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _96f=obj.buttonId;
this._runCallbackForButtonId(_96f,args);
};
DwtDialog.prototype._runCallbackForButtonId=function(id,args){
var _972=this._buttonDesc[id].callback;
if(!_972){
return;
}
args=(args instanceof Array)?args:[args];
_972.run.apply(_972,args);
};
DwtDialog.prototype._runEnterCallback=function(args){
if(this._enterButtonId&&this.getButtonEnabled(this._enterButtonId)){
this._runCallbackForButtonId(this._enterButtonId,args);
}
};
DwtDialog.prototype._resetCallbacks=function(){
for(var i=0;i<DwtDialog.ALL_BUTTONS.length;i++){
var id=DwtDialog.ALL_BUTTONS[i];
if(this._buttonDesc[id]){
this._buttonDesc[id].callback=new AjxCallback(this,this.popdown);
}
}
};
function DwtLabel(_976,_977,_978,_979,id,_97b){
if(arguments.length==0){
return;
}
_978=_978?_978:"DwtLabel";
DwtControl.call(this,_976,_978,_979,false,id,_97b);
this._style=_977?_977:(DwtLabel.IMAGE_LEFT|DwtLabel.ALIGN_CENTER);
this._row=null;
this._textCell=null;
this._textBackground=null;
this._textForeground=null;
this._imageCell=null;
this.__createTable();
}
DwtLabel.prototype=new DwtControl;
DwtLabel.prototype.constructor=DwtLabel;
DwtLabel.IMAGE_LEFT=1;
DwtLabel.IMAGE_RIGHT=2;
DwtLabel.ALIGN_LEFT=4;
DwtLabel.ALIGN_RIGHT=8;
DwtLabel.ALIGN_CENTER=16;
DwtLabel._LAST_STYLE=16;
DwtLabel.prototype.toString=function(){
return "DwtLabel";
};
DwtLabel.prototype.setEnabled=function(_97c){
if(_97c!=this._enabled){
DwtControl.prototype.setEnabled.call(this,_97c);
if(_97c){
this.__setImage(this.__imageInfo);
if(this._textCell!=null){
this._textCell.className="Text";
}
}else{
if(this.__disabledImageInfo){
this.__setImage(this.__disabledImageInfo);
}
if(this._textCell){
this._textCell.className="DisabledText";
}
}
}
};
DwtLabel.prototype.getImage=function(){
return this.__imageInfo;
};
DwtLabel.prototype.setImage=function(_97d){
this.__imageInfo=_97d;
if(this._enabled||(!this._enabled&&this.__disabledImageInfo)){
this.__setImage(_97d);
}
};
DwtLabel.prototype.setDisabledImage=function(_97e){
this.__disabledImageInfo=_97e;
if(!this._enabled&&_97e){
this.__setImage(_97e);
}
};
DwtLabel.prototype.getText=function(){
return (this.__text!=null)?this.__text.data:null;
};
DwtLabel.prototype.setText=function(text){
if(text==null||text==""){
if(this._textCell!=null){
var _980=Dwt.getCellIndex(this._textCell);
this._row.deleteCell(_980);
}
}else{
if(this.__text==null){
this.__text=document.createTextNode(text);
}
this.__text.data=text;
var idx;
if(this._textCell==null){
if(this._style&DwtLabel.IMAGE_RIGHT){
idx=0;
}else{
idx=(this._imageCell!=null)?1:0;
}
this._textCell=this._row.insertCell(idx);
this._textCell.className=this._enabled?"Text":"DisabledText";
if(this._textBackground){
this._textCell.style.backgroundColor=this._textBackground;
}
if(this._textForeground){
this._textCell.style.color=this._textForeground;
}
this.__doAlign();
this._textCell.noWrap=true;
this._textCell.style.verticalAlign="middle";
this._textCell.appendChild(this.__text);
}
}
};
DwtLabel.prototype.setTextBackground=function(_982){
this._textBackground=_982;
if(this._textCell){
this._textCell.style.backgroundColor=_982;
}
};
DwtLabel.prototype.setTextForeground=function(_983){
this._textForeground=_983;
if(this._textCell){
this._textCell.style.color=_983;
}
};
DwtLabel.prototype.setAlign=function(_984){
this._style=_984;
if(this._textCell){
this._row.removeChild(this._textCell);
this._textCell=null;
this.setText(this.__text.data);
}
if(this._imageCell){
this._row.removeChild(this._imageCell);
this._imageCell=null;
this.__setImage(this.__imageInfo);
}
};
DwtLabel.prototype.__createTable=function(){
this.__table=document.createElement("table");
this.__table.border=0;
if(this._style&DwtLabel.ALIGN_RIGHT){
this.__table.align="right";
}else{
if(!(this._style&DwtLabel.ALIGN_LEFT)){
this.__table.align="center";
this.__table.width=AjxEnv.isIE?"95%":"100%";
}
}
this._row=this.__table.insertRow(0);
this.getHtmlElement().appendChild(this.__table);
};
DwtLabel.prototype.__setImage=function(_985){
if(!_985){
if(this._imageCell){
var _986=Dwt.getCellIndex(this._imageCell);
this._row.deleteCell(_986);
this._imageCell=null;
}
}else{
var idx;
if(!this._imageCell){
if(this._style&DwtLabel.IMAGE_LEFT){
idx=0;
}else{
idx=this._textCell?1:0;
}
this._imageCell=this._row.insertCell(idx);
this._imageCell.className="Icon";
this.__doAlign();
}
AjxImg.setImage(this._imageCell,_985);
}
};
DwtLabel.prototype.__doAlign=function(){
if(this._style&DwtLabel.ALIGN_CENTER){
if(this._imageCell!=null&&this._textCell!=null){
if(this._style&DwtLabel.IMAGE_LEFT){
this._imageCell.align="right";
this._textCell.align="left";
}else{
this._imageCell.align="left";
this._textCell.align="right";
}
}else{
if(this._imageCell!=null){
this._imageCell.align="center";
}else{
if(this._textCell!=null){
this._textCell.align="center";
}
}
}
}
};
function DwtCheckbox(_988,_989,_98a,_98b,id,_98d){
if(arguments.length==0){
return;
}
_98a=_98a?_98a:"DwtCheckbox";
DwtControl.call(this,_988,_98a,_98b,false,id,_98d);
this.__createHtml();
}
DwtCheckbox.prototype=new DwtControl;
DwtCheckbox.prototype.constructor=DwtCheckbox;
DwtCheckbox.prototype.toString=function(){
return "DwtCheckbox";
};
DwtCheckbox.TEXT_LEFT=1;
DwtCheckbox.TEXT_RIGHT=2;
DwtCheckbox.DEFAULT_PLACEMENT=DwtCheckbox.TEXT_RIGHT;
DwtCheckbox.prototype._textPlacement=DwtCheckbox.DEFAULT_PLACEMENT;
DwtCheckbox.prototype._selected=false;
DwtCheckbox.prototype.addSelectionListener=function(_98e){
this.addListener(DwtEvent.SELECTION,_98e);
};
DwtCheckbox.prototype.removeSelectionListener=function(_98f){
this.removeListener(DwtEvent.SELECTION,_98f);
};
DwtCheckbox.prototype.setEnabled=function(_990){
if(_990!=this._enabled){
DwtControl.prototype.setEnabled.call(this,_990);
this._inputEl.disabled=!_990;
if(this._textCell){
this._textCell.className=_990?"Text":"DisabledText";
}
}
};
DwtCheckbox.prototype.setSelected=function(_991){
if(this._selected!=_991){
this._selected=_991;
this._inputEl.checked=_991;
}
};
DwtCheckbox.prototype.isSelected=function(){
return this._selected;
};
DwtCheckbox.prototype.setText=function(text){
if(this._text!=text){
this._text=text;
if(!this._textEl){
this.__createHtml();
}else{
if(text){
this._textEl.innerHTML=text;
}
}
}
};
DwtCheckbox.prototype.getText=function(){
return this._text;
};
DwtCheckbox.prototype.getInputElement=function(){
return this._inputEl;
};
DwtCheckbox.prototype._replaceElementHook=function(oel,nel,_995,_996){
nel=this.getInputElement();
DwtControl.prototype._replaceElementHook.call(this,oel,nel,_995,_996);
if(oel.id){
nel.id=oel.id;
}
};
DwtCheckbox.prototype.__createHtml=function(){
var oel=this._inputEl;
var _998="ajax.dwt.templates.Widgets#checkbox";
if(this._text){
_998+=this._textPlacement==DwtCheckbox.TEXT_LEFT?"-text-left":"-text-right";
}
var id=oel?oel.id:this._htmlElId;
this.getHtmlElement().innerHTML=AjxTemplate.expand(_998,id);
this._inputEl=document.getElementById(id+"_input");
this._inputEl.checked=this._selected;
if(oel){
var _99a=oel.className;
if(_99a){
Dwt.addClass(this._inputEl,_99a);
}
var _99b=oel.getAttribute("style");
if(_99b){
this._inputEl.setAttribute([this._inputEl.getAttribute("style"),_99b].join(";"));
}
}
Dwt.setHandler(this._inputEl,DwtEvent.ONCLICK,DwtCheckbox.__handleClick);
Dwt.associateElementWithObject(this._inputEl,this);
this._textEl=document.getElementById(id+"_text");
if(this._text){
this._textEl.innerHTML=this._text;
}
};
DwtCheckbox.__handleClick=function(evt){
var _99d=DwtUiEvent.getEvent(evt);
var _99e=DwtUiEvent.getTarget(_99d);
var _99f=DwtShell.selectionEvent;
DwtUiEvent.copy(_99f,_99d);
_99f.item=this;
_99f.detail=_99e.checked;
var _9a0=Dwt.getObjectFromElement(_99e);
_9a0.setSelected(_99e.checked);
_9a0.notifyListeners(DwtEvent.SELECTION,_99f);
};
function DwtRadioButtonGroup(_9a1,_9a2){
this._values={};
this._eventMgr=new AjxEventMgr();
for(var id in _9a1){
this.addRadio(id,_9a1[id],id==_9a2);
}
if(_9a2){
this.setSelectedId(_9a2);
}
}
DwtRadioButtonGroup.toString=function(){
return "DwtRadioButtonGroup";
};
DwtRadioButtonGroup.prototype.addRadio=function(id,_9a5,_9a6){
this._values[id]=_9a5;
var _9a7=document.getElementById(id);
Dwt.setHandler(_9a7,DwtEvent.ONCLICK,DwtRadioButtonGroup.__handleClick);
Dwt.associateElementWithObject(_9a7,this);
_9a7.checked=_9a6?true:false;
if(_9a6){
this._selectedId=id;
}
};
DwtRadioButtonGroup.prototype.setSelectedId=function(id){
if(id!=this._selectedId){
document.getElementById(id).checked=true;
this._selectedId=id;
var _9a9=DwtShell.selectionEvent;
_9a9.reset();
this._notifySelection(_9a9);
}
};
DwtRadioButtonGroup.prototype.setSelectedValue=function(_9aa){
var id=this._valueToId(_9aa);
this.setSelectedId(id);
};
DwtRadioButtonGroup.prototype.getSelectedId=function(){
return this._selectedId;
};
DwtRadioButtonGroup.prototype.getSelectedValue=function(){
return this._values[this._selectedId];
};
DwtRadioButtonGroup.prototype.addSelectionListener=function(_9ac){
return this._eventMgr.addListener(DwtEvent.SELECTION,_9ac);
};
DwtRadioButtonGroup.prototype._valueToId=function(_9ad){
for(var id in this._values){
if(this._values[id]==_9ad){
return id;
}
}
return null;
};
DwtRadioButtonGroup.prototype._notifySelection=function(_9af){
_9af.item=this;
_9af.detail={id:this._selectedId,value:this._values[this._selectedId]};
this._eventMgr.notifyListeners(DwtEvent.SELECTION,_9af);
};
DwtRadioButtonGroup.prototype._handleClick=function(_9b0,_9b1){
var id=_9b1.id;
if(id!=this._selectedId){
this._selectedId=id;
var _9b3=DwtShell.selectionEvent;
DwtUiEvent.copy(_9b3,_9b0);
this._notifySelection(_9b3);
}
};
DwtRadioButtonGroup.__handleClick=function(_9b4){
_9b4=DwtUiEvent.getEvent(_9b4);
var _9b5=DwtUiEvent.getTarget(_9b4);
var _9b6=Dwt.getObjectFromElement(_9b5);
_9b6._handleClick(_9b4,_9b5);
};
function DwtListView(_9b7,_9b8,_9b9,_9ba,_9bb){
if(arguments.length==0){
return;
}
_9b8=_9b8||"DwtListView";
DwtComposite.call(this,_9b7,_9b8,_9b9);
if(_9ba){
var _9bc=this.getHtmlElement();
this._listColDiv=document.createElement("div");
this._listColDiv.id=Dwt.getNextId();
this._listColDiv.className="DwtListView-ColHeader";
_9bc.appendChild(this._listColDiv);
this._listDiv=document.createElement("div");
this._listDiv.id=Dwt.getNextId();
this._listDiv.className="DwtListView-Rows";
_9bc.appendChild(this._listDiv);
this._bSortAsc=false;
this._currentColId=null;
this._sortingEnabled=true;
}else{
this.setScrollStyle(DwtControl.SCROLL);
}
this._setMouseEventHdlrs();
this._listenerMouseOver=new AjxListener(this,this._mouseOverListener);
this._listenerMouseOut=new AjxListener(this,this._mouseOutListener);
this._listenerMouseDown=new AjxListener(this,this._mouseDownListener);
this._listenerMouseUp=new AjxListener(this,this._mouseUpListener);
this._listenerMouseMove=new AjxListener(this,this._mouseMoveListener);
this._listenerDoubleClick=new AjxListener(this,this._doubleClickListener);
this.addListener(DwtEvent.ONMOUSEOVER,this._listenerMouseOver);
this.addListener(DwtEvent.ONMOUSEOUT,this._listenerMouseOut);
this.addListener(DwtEvent.ONMOUSEDOWN,this._listenerMouseDown);
this.addListener(DwtEvent.ONMOUSEUP,this._listenerMouseUp);
this.addListener(DwtEvent.ONMOUSEMOVE,this._listenerMouseMove);
this.addListener(DwtEvent.ONDBLCLICK,this._listenerDoubleClick);
this._evtMgr=new AjxEventMgr();
this._selectedItems=new AjxVector();
this._selAnchor=null;
this._kbAnchor=null;
this._selEv=new DwtSelectionEvent(true);
this._actionEv=new DwtListViewActionEvent(true);
this._stateChangeEv=new DwtEvent(true);
this._headerList=_9ba;
this._noMaximize=_9bb;
this._parentEl=this._headerList?this._listDiv:this.getHtmlElement();
this._list=null;
this._offset=0;
this._headerColCreated=false;
this._firstSelIndex=-1;
this._tmpPoint=new DwtPoint(0,0);
this.setMultiSelect(true);
}
DwtListView.ITEM_SELECTED=1;
DwtListView.ITEM_DESELECTED=2;
DwtListView.ITEM_DBL_CLICKED=3;
DwtListView._LAST_REASON=3;
DwtListView._TOOLTIP_DELAY=250;
DwtListView.HEADERITEM_HEIGHT=23;
DwtListView.HEADERITEM_ARROW="arr--";
DwtListView.HEADER_ID="crr--";
DwtListView.HEADERITEM_LABEL="drr--";
DwtListView.TYPE_HEADER_ITEM="1";
DwtListView.TYPE_LIST_ITEM="2";
DwtListView.TYPE_HEADER_SASH="3";
DwtListView.DEFAULT_LIMIT=25;
DwtListView.MAX_REPLENISH_THRESHOLD=10;
DwtListView.MIN_COLUMN_WIDTH=10;
DwtListView.COL_MOVE_THRESHOLD=3;
DwtListView._STYLE_CLASS="_sc";
DwtListView._SELECTED_STYLE_CLASS="_ssc";
DwtListView._SELECTED_DIS_STYLE_CLASS="_sdsc";
DwtListView._KBFOCUS_CLASS="_kfc";
DwtListView.prototype=new DwtComposite;
DwtListView.prototype.constructor=DwtListView;
DwtListView.prototype.toString=function(){
return "DwtListView";
};
DwtListView.prototype.setEnabled=function(_9bd){
DwtComposite.prototype.setEnabled.call(this,_9bd);
this.removeListener(DwtEvent.ONMOUSEOVER,this._listenerMouseOver);
this.removeListener(DwtEvent.ONMOUSEOUT,this._listenerMouseOut);
this.removeListener(DwtEvent.ONMOUSEDOWN,this._listenerMouseDown);
this.removeListener(DwtEvent.ONMOUSEUP,this._listenerMouseUp);
this.removeListener(DwtEvent.ONMOUSEMOVE,this._listenerMouseMove);
this.removeListener(DwtEvent.ONDBLCLICK,this._listenerDoubleClick);
if(_9bd){
this.addListener(DwtEvent.ONMOUSEOVER,this._listenerMouseOver);
this.addListener(DwtEvent.ONMOUSEOUT,this._listenerMouseOut);
this.addListener(DwtEvent.ONMOUSEDOWN,this._listenerMouseDown);
this.addListener(DwtEvent.ONMOUSEUP,this._listenerMouseUp);
this.addListener(DwtEvent.ONMOUSEMOVE,this._listenerMouseMove);
this.addListener(DwtEvent.ONDBLCLICK,this._listenerDoubleClick);
}
var _9be=this.getSelectedItems();
if(_9be){
var _9bf=_9be.getArray();
for(var i=0;i<_9bf.length;i++){
var _9c1=_9bf[i];
_9c1.className=_9bd?Dwt.getAttr(_9c1,DwtListView._SELECTED_STYLE_CLASS):Dwt.getAttr(_9c1,DwtListView._SELECTED_DIS_STYLE_CLASS);
}
}
};
DwtListView.prototype.createHeaderHtml=function(_9c2){
if(!this._headerList||this._headerColCreated){
return;
}
var idx=0;
var _9c4=new Array();
this._headerTableId=DwtListView.HEADER_ID+Dwt.getNextId();
_9c4[idx++]="<table id='";
_9c4[idx++]=this._headerTableId;
_9c4[idx++]="' cellpadding=0 cellspacing=0 border=0 height=100%";
_9c4[idx++]=this._noMaximize?">":" width=100%>";
_9c4[idx++]="<tr>";
var _9c5=this._headerList.length;
for(i=0;i<_9c5;i++){
var _9c6=this._headerList[i];
if(!_9c6._visible){
continue;
}
_9c4[idx++]="<td id='";
_9c4[idx++]=_9c6._id;
_9c4[idx++]="' class='";
_9c4[idx++]=_9c6._id==this._currentColId?"DwtListView-Column DwtListView-ColumnActive'":"DwtListView-Column'";
if(_9c6._width){
_9c4[idx++]=" width=";
_9c4[idx++]=_9c6._width;
if(_9c6._widthUnits){
_9c4[idx++]=_9c6._widthUnits;
}
}
_9c4[idx++]=">";
_9c4[idx++]="<div";
var _9c7=null;
if(_9c6._width&&_9c6._width!="auto"){
_9c7=_9c6._width+2;
if(_9c6._widthUnits){
_9c7+=_9c6._widthUnits;
}
}
if(!!_9c7){
_9c4[idx++]=" style='overflow: hidden; width: ";
_9c4[idx++]=_9c7;
_9c4[idx++]="'>";
}else{
_9c4[idx++]=">";
}
_9c4[idx++]="<table border=0 cellpadding=0 cellspacing=0 width=100%><tr>";
if(_9c6._iconInfo){
_9c4[idx++]="<td><center>";
_9c4[idx++]=AjxImg.getImageHtml(_9c6._iconInfo);
_9c4[idx++]="</center></td>";
}
if(_9c6._label){
_9c4[idx++]="<td id='";
_9c4[idx++]=DwtListView.HEADERITEM_LABEL;
_9c4[idx++]=_9c6._id;
_9c4[idx++]="'>&nbsp;";
_9c4[idx++]=_9c6._label;
_9c4[idx++]="</td>";
}
if(_9c6._sortable){
var _9c8=this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow";
this._currentColId=_9c6._id;
_9c4[idx++]="<td width=10 id='";
_9c4[idx++]=DwtListView.HEADERITEM_ARROW;
_9c4[idx++]=_9c6._id;
_9c4[idx++]="'>";
_9c4[idx++]=_9c6._sortable==_9c2?AjxImg.getImageHtml(_9c8):AjxImg.getImageHtml(_9c8,"visibility:hidden");
_9c4[idx++]="</td>";
}
if(i<(_9c5-1)){
_9c4[idx++]="<td width=4>";
_9c4[idx++]="<table align=right border=0 cellpadding=0 cellspacing=0 width=2 height=100%><tr>";
_9c4[idx++]="<td class='DwtListView-Sash'><div style='width: 1px; height: ";
_9c4[idx++]=(DwtListView.HEADERITEM_HEIGHT-2);
_9c4[idx++]="px; background-color: #8A8A8A'></div></td>";
_9c4[idx++]="<td class='DwtListView-Sash'><div style='width: 1px; height: ";
_9c4[idx++]=(DwtListView.HEADERITEM_HEIGHT-2);
_9c4[idx++]="px; background-color: #FFFFFF'></div></td>";
_9c4[idx++]="</tr></table>";
_9c4[idx++]="</td>";
}
_9c4[idx++]="</tr></table>";
_9c4[idx++]="</div></td>";
}
_9c4[idx++]="</tr></table>";
this._listColDiv.innerHTML=_9c4.join("");
for(var j=0;j<this._headerList.length;j++){
var cell=document.getElementById(this._headerList[j]._id);
if(cell==null){
continue;
}
var _9cb=this._headerList[j]._sortable;
if(_9cb&&_9cb==_9c2){
cell.className="DwtListView-Column DwtListView-ColumnActive";
}
var _9cc=this._headerList[j]._resizeable;
if(_9cc){
var _9cd=cell.firstChild.firstChild.rows[0].lastChild;
if(_9cd){
_9cd._type=DwtListView.TYPE_HEADER_SASH;
_9cd._itemIndex=j+"--sash";
}
}
cell._isSortable=_9cb!=null;
cell._isResizeable=_9cc;
cell._type=DwtListView.TYPE_HEADER_ITEM;
cell._itemIndex=j;
}
this._headerColCreated=true;
};
DwtListView.prototype.getColIndexForId=function(_9ce){
if(this._headerList){
for(var i=0;i<this._headerList.length;i++){
if(this._headerList[i]._id.indexOf(_9ce)!=-1){
return i;
}
}
}
return -1;
};
DwtListView.prototype.set=function(list,_9d1){
this._selectedItems.removeAll();
this.enableSorting(true);
this._resetList();
this._list=list;
this._now=new Date();
this.setUI(_9d1);
};
DwtListView.prototype.setUI=function(_9d2,_9d3){
this.removeAll();
this.createHeaderHtml(_9d2);
this._renderList(this._list,_9d3);
};
DwtListView.prototype._renderList=function(list,_9d5){
if(list instanceof AjxVector&&list.size()){
var size=list.size();
for(var i=0;i<size;i++){
var item=list.get(i);
var div=this._createItemHtml(item,this._now);
if(div){
if(div instanceof Array){
for(var j=0;j<div.length;j++){
this._addRow(div[j]);
}
}else{
this._addRow(div);
}
}
}
}else{
if(!_9d5){
this._setNoResultsHtml();
}
}
};
DwtListView.prototype.addItems=function(_9db){
if(AjxUtil.isArray(_9db)){
if(!this._list){
this._list=new AjxVector();
}
if(this._list.size()==0){
this._resetList();
}
var _9dc=this._list.size();
var vec=AjxVector.fromArray(_9db);
this._renderList(vec);
this._list.addList(_9db);
}
};
DwtListView.prototype.addItem=function(item,_9df,_9e0){
if(!this._list){
this._list=new AjxVector();
}
if(this._list.size()==0){
this._resetList();
}
this._list.add(item,_9df);
var div=this._createItemHtml(item,this._now);
if(div){
if(div instanceof Array){
for(var j=0;j<div.length;j++){
this._addRow(div[j]);
}
}else{
this._addRow(div,_9df);
}
}
if(!_9e0&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv);
}
};
DwtListView.prototype.removeItem=function(item,_9e4){
var _9e5=this._getElFromItem(item);
this._selectedItems.remove(_9e5);
this._parentEl.removeChild(_9e5);
this._list.remove(item);
if(!_9e4&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv);
}
};
DwtListView.prototype.removeLastItem=function(_9e6){
var last=this._list.get(this._list.size()-1);
this._list.remove(last);
this._parentEl.removeChild(this._getElFromItem(last));
if(!_9e6&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv);
}
};
DwtListView.prototype.redrawItem=function(item){
var odiv=this._getElFromItem(item);
if(odiv){
var ndiv=this._createItemHtml(item,true);
this.associateItemWithElement(item,ndiv);
odiv.parentNode.replaceChild(ndiv,odiv);
var _9eb=this.getSelectedItems().getArray();
for(var i=0;i<_9eb.length;i++){
var _9ed=_9eb[i];
if(_9ed===item){
this.setSelectedItems([].concat(_9eb));
break;
}
}
}
};
DwtListView.prototype.reIndexColumn=function(_9ee,_9ef){
if(this._headerList==null){
return;
}
var len=this._headerList.length;
if(_9ee<0||_9ef<0||_9ee>=len||_9ef>=len||_9ee==_9ef){
return;
}
var temp=this._headerList.splice(_9ee,1);
this._headerList.splice(_9ef,0,temp[0]);
this._relayout();
};
DwtListView.prototype.reSizeColumn=function(_9f2,_9f3){
if(_9f3==this._headerList._width||_9f3<DwtListView.MIN_COLUMN_WIDTH){
return;
}
this._headerList[_9f2]._width=_9f3;
this._relayout();
};
DwtListView.prototype._resetColWidth=function(){
if(this._headerList==null){
return;
}
var _9f4=this._headerList.length-1;
var _9f5=null;
while(_9f5==null&&_9f4>=0){
if(this._headerList[_9f4]._visible){
_9f5=_9f4;
}
_9f4--;
}
var _9f6=this._headerList[_9f5];
var _9f7=document.getElementById(_9f6._id);
var div=_9f7.firstChild;
var _9f9=16;
var _9fa=this._listColDiv.clientWidth;
var _9fb=this._listDiv.clientWidth;
if(_9fa!=_9fb){
_9f7.style.width=div.style.width=_9f6._width!=null&&_9f6._width!="auto"?(_9f6._width+_9f9):(_9f7.clientWidth+_9f9);
}else{
_9f7.style.width=div.style.width=(_9f6._width||"");
}
};
DwtListView.prototype.size=function(){
return this._list?this._list.size():0;
};
DwtListView.prototype.setMultiSelect=function(_9fc){
this._multiSelectEnabled=_9fc;
};
DwtListView.prototype.isMultiSelectEnabled=function(){
return this._multiSelectEnabled;
};
DwtListView.prototype._getPropagationForEvent=function(){
if(AjxEnv.isSafari){
return false;
}else{
return DwtControl.prototype._getPropagationForEvent.call(this);
}
};
DwtListView.prototype._getReturnValueForEvent=function(){
if(AjxEnv.isSafari){
return true;
}else{
return DwtControl.prototype._getReturnValueForEvent.call(this);
}
};
DwtListView.prototype._addRow=function(row,_9fe){
var len=this._parentEl.childNodes.length;
if(_9fe!=null&&len>0&&_9fe!=len){
this._parentEl.insertBefore(row,this._parentEl.childNodes[_9fe]);
}else{
this._parentEl.appendChild(row);
}
};
DwtListView.prototype._createItemHtml=function(item,now,_a02){
var div=document.createElement("DIV");
div.id=Dwt.getNextId();
var _a04=AjxBuffer.concat(this._className,"Row");
div[DwtListView._STYLE_CLASS]=AjxBuffer.concat("Row ",_a04);
div[DwtListView._SELECTED_STYLE_CLASS]=AjxBuffer.concat("Row-",DwtCssStyle.SELECTED," ",_a04);
div[DwtListView._SELECTED_DIS_STYLE_CLASS]=AjxBuffer.concat("Row-",DwtCssStyle.SELECTED,"-",DwtCssStyle.DISABLED," ",_a04);
div.className=div[DwtListView._STYLE_CLASS];
if(typeof (item)=="object"){
div.innerHTML=AjxStringUtil.htmlEncode(item.toString());
}else{
div.innerHTML=AjxStringUtil.htmlEncode(String(item));
}
this.associateItemWithElement(item,div,DwtListView.TYPE_LIST_ITEM);
return div;
};
DwtListView.prototype._setNoResultsHtml=function(){
var _a05=new Array(3);
var idx=0;
_a05[idx++]="<table width='100%' cellspacing='0' cellpadding='1'><tr><td class='NoResults'><br>";
_a05[idx++]=AjxMsg.noResults;
_a05[idx++]="</td></tr></table>";
var div=document.createElement("div");
div.innerHTML=_a05.join("");
this._addRow(div);
};
DwtListView.prototype.addSelectionListener=function(_a08){
this._evtMgr.addListener(DwtEvent.SELECTION,_a08);
};
DwtListView.prototype.removeSelectionListener=function(_a09){
this._evtMgr.removeListener(DwtEvent.SELECTION,_a09);
};
DwtListView.prototype.addActionListener=function(_a0a){
this._evtMgr.addListener(DwtEvent.ACTION,_a0a);
};
DwtListView.prototype.removeActionListener=function(_a0b){
this._evtMgr.removeListener(DwtEvent.ACTION,_a0b);
};
DwtListView.prototype.addStateChangeListener=function(_a0c){
this._evtMgr.addListener(DwtEvent.STATE_CHANGE,_a0c);
};
DwtListView.prototype.removeStateChangeListener=function(_a0d){
this._evtMgr.removeListener(DwtEvent.STATE_CHANGE,_a0d);
};
DwtListView.prototype.removeAll=function(_a0e){
this._parentEl.innerHTML="";
this._selectedItems.removeAll();
this._selAnchor=this._kbAnchor=null;
if(!_a0e&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv);
}
};
DwtListView.prototype.deselectAll=function(){
var a=this._selectedItems.getArray();
var sz=this._selectedItems.size();
for(var i=0;i<sz;i++){
a[i].className=Dwt.getAttr(a[i],DwtListView._STYLE_CLASS);
}
this._selectedItems.removeAll();
this._selAnchor=null;
if(this._kbAnchor!=null&&this.hasFocus()){
this._kbAnchor.className+=" "+Dwt.getAttr(this._kbAnchor,DwtListView._KBFOCUS_CLASS);
}
};
DwtListView.prototype.getDnDSelection=function(){
if(this._dndSelection instanceof AjxVector){
return this.getSelection();
}else{
return AjxCore.objectWithId(this._dndSelection);
}
};
DwtListView.prototype.getSelection=function(){
var a=new Array();
if(this._rightSelItems){
a.push(AjxCore.objectWithId(Dwt.getAttr(this._rightSelItems,"_itemIndex")));
}else{
var sa=this._selectedItems.getArray();
var _a14=this._selectedItems.size();
for(var i=0;i<_a14;i++){
a[i]=AjxCore.objectWithId(Dwt.getAttr(sa[i],"_itemIndex"));
}
}
return a;
};
DwtListView.prototype.getSelectedItems=function(){
return this._selectedItems;
};
DwtListView.prototype.setSelection=function(item,_a17){
var el=this._getElFromItem(item);
if(el){
var i;
this._deselectAllSelectedItems();
this._unmarkKbAnchorElement(true);
this._selectedItems.add(el);
this._selAnchor=this._kbAnchor=el;
el.className=this.getEnabled()?Dwt.getAttr(el,DwtListView._SELECTED_STYLE_CLASS):Dwt.getAttr(el,DwtListView._SELECTED_DIS_STYLE_CLASS);
if(this.hasFocus()){
el.className+=" "+Dwt.getAttr(el,DwtListView._KBFOCUS_CLASS);
}
this._firstSelIndex=this._list&&this._list.size()>0?this._list.indexOf(item):-1;
if(!_a17&&this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
var _a1a=new DwtSelectionEvent(true);
_a1a.button=DwtMouseEvent.LEFT;
_a1a.target=el;
_a1a.item=AjxCore.objectWithId(Dwt.getAttr(el,"_itemIndex"));
_a1a.detail=DwtListView.ITEM_SELECTED;
this._evtMgr.notifyListeners(DwtEvent.SELECTION,_a1a);
}
}
};
DwtListView.prototype._deselectAllSelectedItems=function(){
var a=this._selectedItems.getArray();
var sz=this._selectedItems.size();
for(i=0;i<sz;i++){
a[i].className=Dwt.getAttr(a[i],DwtListView._STYLE_CLASS);
if(this._kbAnchor==a[i]&&this.hasFocus()){
a[i].className+=" "+Dwt.getAttr(a[i],DwtListView._KBFOCUS_CLASS);
}
}
this._selectedItems.removeAll();
};
DwtListView.prototype.setSelectedItems=function(_a1d){
this._deselectAllSelectedItems();
var i,sz,el;
sz=_a1d.length;
for(i=0;i<sz;++i){
el=this._getElFromItem(_a1d[i]);
if(el){
el.className=this.getEnabled()?Dwt.getAttr(el,DwtListView._SELECTED_STYLE_CLASS):Dwt.getAttr(el,DwtListView._SELECTED_DIS_STYLE_CLASS);
if(this._kbAnchor==el&&this.hasFocus()){
el.className+=" "+Dwt.getAttr(el,DwtListView._KBFOCUS_CLASS);
}
this._selectedItems.add(el);
}
}
};
DwtListView.prototype.getSelectionCount=function(){
return this._rightSelItems?1:this._selectedItems.size();
};
DwtListView.prototype.handleActionPopdown=function(){
if(this._rightSelItems){
this._rightSelItems.className=Dwt.getAttr(this._rightSelItems,DwtListView._STYLE_CLASS);
this._rightSelItems=null;
}
};
DwtListView.prototype._getItemId=function(item){
return item?([this._getViewPrefix(),item.id].join("")):null;
};
DwtListView.prototype._getHeaderTableId=function(){
return this._headerList?this._headerTableId:null;
};
DwtListView.prototype._getElFromItem=function(item){
var _a21=this._parentEl.childNodes;
var len=_a21.length;
var _a23=this._getItemId(item);
for(var i=0;i<len;i++){
if(_a21[i].id==_a23){
return _a21[i];
}
}
return null;
};
DwtListView.prototype._getItemIndex=function(item){
var list=this._list;
var len=list.size();
for(var i=0;i<len;++i){
if(list.get(i).id==item.id){
return i;
}
}
};
DwtListView.prototype.getItemFromElement=function(_a29){
var _a2a=Dwt.getAttr(_a29,"_itemIndex");
if(_a2a!==void 0){
if(Dwt.getAttr(_a29,"_type")==DwtListView.TYPE_LIST_ITEM){
return AjxCore.objectWithId(_a2a);
}
}
return null;
};
DwtListView.prototype._getViewPrefix=function(){
return "";
};
DwtListView.prototype.associateItemWithElement=function(item,_a2c,type,_a2e){
_a2c.id=_a2e||this._getItemId(item);
_a2c._itemIndex=AjxCore.assignId(item);
_a2c._type=type;
};
DwtListView.prototype._isValidDragObject=function(ev){
var div=ev.target;
div=Dwt.findAncestor(div,"_itemIndex");
return (div!=null);
};
DwtListView.prototype.dragSelect=function(row){
if(this._dragHighlight!=null){
var _a32=document.getElementById(this._dragHighlight);
if(!row||row.id!=_a32.id){
this._updateDragSelection(_a32,false);
}
}
if(!row||Dwt.getAttr(row,"_type")!=DwtListView.TYPE_LIST_ITEM){
return;
}
if(row.id!=this._dragHighlight){
this._dragHighlight=row.id;
this._updateDragSelection(row,true);
}
};
DwtListView.prototype.dragDeselect=function(row){
if(this._dragHighlight){
var _a34=document.getElementById(this._dragHighlight);
this._updateDragSelection(_a34,false);
this._dragHighlight=null;
}
};
DwtListView.prototype._updateDragSelection=function(row,_a36){
if(!_a36){
row.className=row._dwtListViewOldClassName;
}else{
row._dwtListViewOldClassName=row.className;
row.className=row.className+"-drag";
}
};
DwtListView.prototype._mouseOverAction=function(_a37,div){
var type=Dwt.getAttr(div,"_type");
if((type==DwtListView.TYPE_HEADER_ITEM)&&this._sortingEnabled&&div._isSortable&&this._headerClone==null){
div.className="DwtListView-Column DwtListView-ColumnHover";
}else{
if(type==DwtListView.TYPE_HEADER_SASH){
div.style.cursor=AjxEnv.isIE?"col-resize":"e-resize";
}else{
if(type==DwtListView.TYPE_LIST_ITEM){
if(div._hoverStyleClass==null||div==this._rightSelItems){
div.hoverSet=false;
}else{
var _a3a=this._selectedItems.getArray();
div.hoverSet=true;
for(var i=0;i<_a3a.length;i++){
if(div==_a3a[i]){
div.hoverSet=false;
break;
}
}
}
if(div.hoverSet){
div.className+=" "+div._hoverStyleClass;
}
}
}
}
return true;
};
DwtListView.prototype._mouseOutAction=function(_a3c,div){
var type=Dwt.getAttr(div,"_type");
if(type==DwtListView.TYPE_HEADER_ITEM&&this._headerClone==null){
div.className=div.id!=this._currentColId?"DwtListView-Column":"DwtListView-Column DwtListView-ColumnActive";
}else{
if(type==DwtListView.TYPE_HEADER_SASH){
div.style.cursor="auto";
}else{
if(type==DwtListView.TYPE_LIST_ITEM){
if(div._hoverStyleClass&&div.hoverSet){
div.className=Dwt.getAttr(div,DwtListView._STYLE_CLASS);
}
}
}
}
return true;
};
DwtListView.prototype._mouseOverListener=function(ev){
var div=ev.target;
div=Dwt.findAncestor(div,"_itemIndex");
if(!div){
return;
}
this._mouseOverAction(ev,div);
};
DwtListView.prototype._mouseOutListener=function(ev){
var div=ev.target;
div=Dwt.findAncestor(div,"_itemIndex");
if(!div){
return;
}
this.setToolTipContent(null);
this._mouseOutAction(ev,div);
};
DwtListView.prototype._mouseMoveListener=function(ev){
if(this._clickDiv==null){
return;
}
var type=Dwt.getAttr(this._clickDiv,"_type");
if(type==DwtListView.TYPE_HEADER_ITEM){
this._handleColHeaderMove(ev);
}else{
if(type==DwtListView.TYPE_HEADER_SASH){
this._handleColHeaderResize(ev);
}
}
};
DwtListView.prototype._mouseUpAction=function(_a45,div){
return true;
};
DwtListView.prototype._mouseDownListener=function(ev){
var div=ev.target;
div=Dwt.findAncestor(div,"_itemIndex");
if(div==null){
this._dndSelection=null;
}else{
this._clickDiv=div;
if(Dwt.getAttr(div,"_type")!=DwtListView.TYPE_LIST_ITEM){
this._dndSelection=null;
}else{
this._dndSelection=(this._selectedItems.contains(div))?this._selectedItems:Dwt.getAttr(div,"_itemIndex");
}
}
};
DwtListView.prototype._mouseUpListener=function(ev){
var div=ev.target;
div=Dwt.findAncestor(div,"_itemIndex");
var _a4b=this._handleColHeaderDrop(ev);
var _a4c=this._handleColSashDrop(ev);
if(!div||div!=this._clickDiv||_a4b||_a4c){
delete this._clickDiv;
return;
}
delete this._clickDiv;
var type=Dwt.getAttr(div,"_type");
if(this._headerList&&type==DwtListView.TYPE_HEADER_ITEM){
if(div._isSortable&&this._sortingEnabled&&ev.button==DwtMouseEvent.LEFT){
this._columnClicked(div,ev);
}else{
if(ev.button==DwtMouseEvent.RIGHT){
var _a4e=this._getActionMenuForColHeader();
if(_a4e&&_a4e instanceof DwtMenu){
_a4e.popup(0,ev.docX,ev.docY);
}
}
}
}else{
if(type==DwtListView.TYPE_LIST_ITEM){
if(ev.button==DwtMouseEvent.LEFT||ev.button==DwtMouseEvent.RIGHT){
this._itemClicked(div,ev);
}
if(!this._mouseUpAction(ev,div)){
return;
}
}
}
};
DwtListView.prototype._doubleClickAction=function(_a4f,div){
return true;
};
DwtListView.prototype._doubleClickListener=function(ev){
var div=ev.target;
div=Dwt.findAncestor(div,"_itemIndex");
if(!div){
return;
}
if(Dwt.getAttr(div,"_type")==DwtListView.TYPE_LIST_ITEM){
if(!this._doubleClickAction(ev,div)){
return;
}
if(this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
DwtUiEvent.copy(this._selEv,ev);
this._selEv.item=this.getItemFromElement(div);
this._selEv.detail=DwtListView.ITEM_DBL_CLICKED;
this._evtMgr.notifyListeners(DwtEvent.SELECTION,this._selEv);
}
}
};
DwtListView.prototype.emulateDblClick=function(item){
var div=document.getElementById(this._getItemId(item));
if(div){
this._emulateDblClick(div);
}
};
DwtListView.prototype._emulateDblClick=function(_a55){
var mev=DwtShell.mouseEvent;
mev.reset();
mev.target=_a55;
mev.button=DwtMouseEvent.LEFT;
mev.ersatz=true;
this._itemClicked(_a55,mev);
this._doubleClickListener(mev);
};
DwtListView.prototype._selectItem=function(next,_a58){
if(!this.size()){
return;
}
var _a59;
if(this._kbAnchor){
_a59=this._getSiblingElement(this._kbAnchor,next);
}else{
_a59=this._parentEl.firstChild;
}
this._scrollList(_a59);
this._emulateSingleClick(_a59,DwtMouseEvent.LEFT,false,_a58);
};
DwtListView.prototype._getSiblingElement=function(_a5a,next){
var el=next?_a5a.nextSibling:_a5a.previousSibling;
return el?el:_a5a;
};
DwtListView.prototype._scrollList=function(_a5d){
var _a5e=_a5d.parentNode;
var _a5f=this._tmpPoint;
var _a60=Dwt.getLocation(_a5d,_a5f).y;
var _a61=Dwt.getLocation(_a5e,_a5f).y;
var diff=_a60-(_a5e.scrollTop+_a61);
if(diff<0){
_a5e.scrollTop+=diff;
}else{
var _a63=Dwt.getSize(_a5e,_a5f).y;
var _a64=Dwt.getSize(_a5d,_a5f).y;
diff=(_a60+_a64)-(_a61+_a63+_a5e.scrollTop);
if(diff>0){
_a5e.scrollTop+=diff;
}
}
};
DwtListView.prototype._emulateSingleClick=function(_a65,_a66,ctrl,_a68,alt,docX,docY){
this._clickDiv=Dwt.findAncestor(_a65,"_itemIndex");
var mev=DwtShell.mouseEvent;
mev.reset();
mev.target=_a65;
mev.button=_a66;
mev.docX=docX;
mev.docY=docY;
mev.shiftKey=_a68;
mev.altKey=alt;
mev.ctrlKey=ctrl;
mev.ersatz=true;
this._mouseUpListener(mev);
};
DwtListView.prototype._setKbFocusElement=function(next){
if(!this._list){
return;
}
var orig=this._kbAnchor;
if(this._kbAnchor){
this._kbAnchor=this._getSiblingElement(this._kbAnchor,next);
}else{
this._kbAnchor=this._parentEl.firstChild;
}
if(this._kbAnchor!=orig){
var _a6f=Dwt.getAttr(orig,DwtListView._SELECTED_STYLE_CLASS);
if(orig.className.indexOf(_a6f)!=-1){
orig.className=_a6f;
}else{
orig.className=Dwt.getAttr(orig,DwtListView._STYLE_CLASS);
}
this._kbAnchor.className+=" "+Dwt.getAttr(this._kbAnchor,DwtListView._KBFOCUS_CLASS);
}
this._scrollList(this._kbAnchor);
};
DwtListView.prototype._itemSelected=function(_a70,ev){
if(this._allowLeftSelection(_a70,ev,(ev)?ev.button:null)){
this._unmarkKbAnchorElement(true);
var _a72=this._selectedItems.size();
var a=this._selectedItems.getArray();
for(var i=0;i<_a72;i++){
a[i].className=Dwt.getAttr(a[i],DwtListView._STYLE_CLASS);
}
this._selectedItems.removeAll();
this._selectedItems.add(_a70);
this._selAnchor=this._kbAnchor=_a70;
_a70.className=Dwt.getAttr(_a70,DwtListView._SELECTED_STYLE_CLASS);
if(this.hasFocus()){
_a70.className+=" "+Dwt.getAttr(_a70,DwtListView._KBFOCUS_CLASS);
}
this._firstSelIndex=this._list?this._list.indexOf(AjxCore.objectWithId(Dwt.getAttr(_a70,"_itemIndex"))):-1;
}
};
DwtListView.prototype._itemClicked=function(_a75,ev){
if(this._rightSelItems){
this._rightSelItems.className=Dwt.getAttr(this._rightSelItems,DwtListView._STYLE_CLASS);
this._rightSelItems=null;
}
var _a77=this._selectedItems.size();
if((!ev.shiftKey&&!ev.ctrlKey)||!this.isMultiSelectEnabled()){
if(ev.button==DwtMouseEvent.LEFT||ev.button==DwtMouseEvent.RIGHT){
this._selEv.detail=DwtListView.ITEM_SELECTED;
}
var _a78=this._selectedItems.contains(_a75);
if(ev.button==DwtMouseEvent.LEFT){
this._itemSelected(_a75,ev);
}else{
if(ev.button==DwtMouseEvent.RIGHT&&!_a78){
this._rightSelItems=_a75;
_a75.className=Dwt.getAttr(_a75,DwtListView._SELECTED_STYLE_CLASS)+"-right";
if(this._kbAnchor==_a75){
_a75.className=" "+Dwt.getAttr(_a75,DwtListView._KBFOCUS_CLASS);
}
}
}
_a75.hoverSet=false;
}else{
if(ev.ctrlKey){
if(this._selectedItems.contains(_a75)){
this._selectedItems.remove(_a75);
_a75.className=Dwt.getAttr(_a75,DwtListView._STYLE_CLASS);
this._selEv.detail=DwtListView.ITEM_DESELECTED;
}else{
this._selectedItems.add(_a75);
_a75.className=Dwt.getAttr(_a75,DwtListView._SELECTED_STYLE_CLASS);
_a75.hoverSet=false;
this._selEv.detail=DwtListView.ITEM_SELECTED;
}
if(this._kbAnchor!=_a75){
var _a79=this._kbAnchor;
var _a7a=Dwt.getAttr(_a79,DwtListView._SELECTED_STYLE_CLASS);
if(_a79&&_a79.className&&_a79.className.indexOf(_a7a)!=-1){
_a79.className=_a7a;
}else{
if(_a79){
_a79.className=Dwt.getAttr(_a79,DwtListView._STYLE_CLASS);
}
}
}
this._selAnchor=this._kbAnchor=_a75;
this._kbAnchor.className+=" "+Dwt.getAttr(this._kbAnchor,DwtListView._KBFOCUS_CLASS);
}else{
if(this._selAnchor==null){
return;
}
var _a7b=this._getChildren()||_a75.parentNode.childNodes;
var _a7c=_a7b.length;
var _a7d;
var _a7e=0;
for(var i=0;i<_a7c;i++){
_a7d=_a7b[i];
if(_a7d==this._rightSelItems){
this._rightSelItems=null;
}
if(_a7d==_a75){
_a7e++;
}
var _a80=Dwt.getAttr(_a7d,DwtListView._SELECTED_STYLE_CLASS);
if(_a7d==this._selAnchor){
_a7e++;
if(_a7d.className.indexOf(_a80)==-1){
this._selectedItems.add(_a7d);
}
_a7d.className=_a80;
continue;
}
if(_a7e!=1&&_a7d.className.indexOf(_a80)!=-1&&_a7d!=_a75){
_a7d.className=Dwt.getAttr(_a7d,DwtListView._STYLE_CLASS);
this._selectedItems.remove(_a7d);
}else{
if(_a7e==1||_a7d==_a75){
if(_a7d.className.indexOf(_a80)==-1){
_a7d.hoverSet=false;
this._selectedItems.add(_a7d);
}
_a7d.className=_a80;
}
}
}
this._kbAnchor=_a75;
this._kbAnchor.className+=" "+Dwt.getAttr(this._kbAnchor,DwtListView._KBFOCUS_CLASS);
var _a81=this._selectedItems.size();
if(_a77<_a81){
this._selEv.detail=DwtListView.ITEM_SELECTED;
}else{
if(_a77>_a81){
this._selEv.detail=DwtListView.ITEM_DESELECTED;
}else{
return;
}
}
}
}
if(ev.button==DwtMouseEvent.LEFT&&this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
if(this._setListEvent(ev,this._selEv,_a75)){
this._evtMgr.notifyListeners(DwtEvent.SELECTION,this._selEv);
}
}else{
if(ev.button==DwtMouseEvent.RIGHT&&this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
if(this._setListEvent(ev,this._actionEv,_a75)){
this._evtMgr.notifyListeners(DwtEvent.ACTION,this._actionEv);
}
}
}
};
DwtListView.prototype._setListEvent=function(ev,_a83,_a84){
DwtUiEvent.copy(_a83,ev);
_a83.item=AjxCore.objectWithId(Dwt.getAttr(_a84,"_itemIndex"));
return true;
};
DwtListView.prototype._columnClicked=function(_a85,ev){
var list=this.getList();
if(!list){
return;
}
var size=list.size();
if(!size){
return;
}
var item=this._headerList[Dwt.getAttr(_a85,"_itemIndex")];
this._bSortAsc=item._id==this._currentColId?!this._bSortAsc:this._getDefaultSortbyForCol(item);
this._setSortedColStyle(item._id);
if(size>=1){
this._sortColumn(item,this._bSortAsc);
}
};
DwtListView.prototype._sortColumn=function(_a8a,_a8b){
};
DwtListView.prototype._getActionMenuForColHeader=function(){
return null;
};
DwtListView.prototype._getDefaultSortbyForCol=function(_a8c){
return true;
};
DwtListView.prototype._allowLeftSelection=function(_a8d,ev,_a8f){
return true;
};
DwtListView.prototype._setSortedColStyle=function(_a90){
if(this._currentColId!=null&&_a90!=this._currentColId){
oldArrowId=DwtListView.HEADERITEM_ARROW+this._currentColId;
oldArrowCell=document.getElementById(oldArrowId);
if(oldArrowCell&&oldArrowCell.firstChild){
var _a91=(AjxImg._mode==AjxImg.SINGLE_IMG)?oldArrowCell.firstChild:oldArrowCell.firstChild.firstChild;
if(_a91){
_a91.style.visibility="hidden";
}
}
var _a92=document.getElementById(this._currentColId);
if(_a92){
_a92.className="DwtListView-Column";
}
}
this._currentColId=_a90;
var _a93=DwtListView.HEADERITEM_ARROW+_a90;
var _a94=document.getElementById(_a93);
if(_a94){
AjxImg.setImage(_a94,this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow");
var _a91=(AjxImg._mode==AjxImg.SINGLE_IMG)?_a94.firstChild:_a94.firstChild.firstChild;
if(_a91){
_a91.style.visibility="visible";
}
}
var _a95=document.getElementById(_a90);
if(_a95){
_a95.className="DwtListView-Column DwtListView-ColumnActive";
}
};
DwtListView.prototype._resetList=function(){
this._resetModelList();
this._resetListView();
};
DwtListView.prototype._resetModelList=function(){
if(this._list&&this._list.size()){
this._list.removeAll();
}
};
DwtListView.prototype._resetListView=function(){
var cDiv;
while(this._parentEl.hasChildNodes()){
cDiv=this._parentEl.removeChild(this._parentEl.firstChild);
AjxCore.unassignId(Dwt.getAttr(cDiv,"_itemIndex"));
}
this._selectedItems.removeAll();
this._rightSelItems=null;
};
DwtListView.prototype._destroyDnDIcon=function(icon){
var _a98=Dwt.getAttr(icon,"_itemIndex");
if(_a98){
AjxCore.unassignId(_a98);
}
DwtControl.prototype._destroyDnDIcon.call(this,icon);
};
DwtListView.prototype._handleColHeaderMove=function(ev){
if(this._headerClone==null){
if(this._headerColX==null){
this._headerColX=ev.docX;
return;
}else{
var _a9a=Math.abs(this._headerColX-ev.docX);
if(_a9a<DwtListView.COL_MOVE_THRESHOLD){
return;
}
}
this._headerClone=document.createElement("div");
var size=Dwt.getSize(this._clickDiv);
var _a9c=AjxEnv.isIE?size.x:size.x-3;
var _a9d=AjxEnv.isIE?size.y:size.y-5;
Dwt.setSize(this._headerClone,_a9c,_a9d);
Dwt.setPosition(this._headerClone,Dwt.ABSOLUTE_STYLE);
Dwt.setZIndex(this._headerClone,Dwt.Z_DND);
Dwt.setLocation(this._headerClone,Dwt.DEFAULT,ev.docY);
this._headerClone.className=this._clickDiv.className+" DndIcon";
this._headerClone.innerHTML=this._clickDiv.innerHTML;
this._clickDiv.className="DwtListView-Column DwtListView-ColumnEmpty";
this._headerClone.style.borderTop="1px solid #777777";
var _a9e=document.getElementById(DwtListView.HEADERITEM_LABEL+this._clickDiv.id);
if(_a9e){
_a9e.style.color="white";
}
this.shell.getHtmlElement().appendChild(this._headerClone);
}else{
var _a9f=Dwt.findAncestor(ev.target,"_itemIndex");
if(_a9f&&Dwt.getAttr(_a9f,"_type")==DwtListView.TYPE_HEADER_ITEM){
if(this._headerCloneTarget&&this._headerCloneTarget==this._clickDiv){
this._headerCloneTarget=null;
}else{
if(this._headerCloneTarget!=_a9f){
this._headerCloneTarget=_a9f;
}
}
}else{
this._headerCloneTarget=null;
}
}
Dwt.setLocation(this._headerClone,ev.docX+2);
};
DwtListView.prototype._handleColHeaderResize=function(ev){
if(this._headerSash==null){
this._headerSash=document.createElement("div");
Dwt.setSize(this._headerSash,Dwt.DEFAULT,this.getSize().y);
Dwt.setPosition(this._headerSash,Dwt.ABSOLUTE_STYLE);
Dwt.setZIndex(this._headerSash,Dwt.Z_DND);
Dwt.setLocation(this._headerSash,Dwt.DEFAULT,0);
this._headerSash.className="DwtListView-ColumnSash";
this.getHtmlElement().appendChild(this._headerSash);
this._headerSashX=ev.docX;
}
var _aa1=this._getParentForColResize();
var loc=Dwt.toWindow(_aa1.getHtmlElement(),0,0);
Dwt.setLocation(this._headerSash,ev.docX-loc.x);
};
DwtListView.prototype._handleColHeaderDrop=function(ev){
this._headerColX=null;
if(this._headerClone==null||ev.button==DwtMouseEvent.RIGHT){
return false;
}
if(this._headerCloneTarget){
var _aa4=Dwt.getAttr(this._clickDiv,"_itemIndex");
var _aa5=Dwt.getAttr(this._headerCloneTarget,"_itemIndex");
this.reIndexColumn(_aa4,_aa5);
}
this._clickDiv.className=this._clickDiv.id!=this._currentColId?"DwtListView-Column":"DwtListView-Column DwtListView-ColumnActive";
wasDraggingCol=true;
var _aa6=this._headerClone.parentNode;
if(_aa6){
_aa6.removeChild(this._headerClone);
}else{
}
delete this._headerClone;
if(Dwt.getAttr(this._clickDiv,"_type")!=DwtListView.TYPE_HEADER_ITEM){
var _aa7=this._getSortableFromColId(this._currentColId);
this._headerColCreated=false;
this.createHeaderHtml(_aa7);
}else{
var _aa8=document.getElementById(DwtListView.HEADERITEM_LABEL+this._clickDiv.id);
if(_aa8){
_aa8.style.color="black";
}
}
this._resetColWidth();
return true;
};
DwtListView.prototype._handleColSashDrop=function(ev){
if(this._headerSash==null||ev.button==DwtMouseEvent.RIGHT){
return false;
}
var _aaa=ev.docX-this._headerSashX;
var _aab=Dwt.getAttr(this._clickDiv,"_itemIndex");
var _aac=_aab.indexOf("--sash");
var _aad=parseInt(_aab.substring(0,_aac));
if(_aad>=0&&_aad<this._headerList.length){
var _aae=null;
if(this._headerList[_aad]._width){
_aae=this._headerList[_aad]._width+_aaa;
}else{
var _aaf=this._headerList[_aad+1];
if(_aaf&&_aaf._width&&_aaf._resizeable){
var cell=document.getElementById(_aaf._id);
_aae=cell?Dwt.getSize(cell).x+_aaa:null;
}
}
this.reSizeColumn(_aad,_aae);
}else{
}
var _ab1=this._headerSash.parentNode;
if(_ab1){
_ab1.removeChild(this._headerSash);
}
delete this._headerSash;
this._resetColWidth();
return true;
};
DwtListView.prototype._relayout=function(){
this._headerColCreated=false;
var _ab2=this._getSortableFromColId(this._currentColId);
var sel=this.getSelection()[0];
this.setUI(_ab2);
this.setSelection(sel,true);
};
DwtListView.prototype._getSortableFromColId=function(_ab4){
var _ab5=null;
for(var i=0;i<this._headerList.length;i++){
if(this._headerList[i]._id==_ab4){
_ab5=this._headerList[i]._sortable;
break;
}
}
return _ab5;
};
DwtListView.prototype._getParentForColResize=function(){
return this;
};
DwtListView.prototype.setSize=function(_ab7,_ab8){
DwtComposite.prototype.setSize.call(this,_ab7,_ab8);
this._sizeChildren(_ab8);
};
DwtListView.prototype.setBounds=function(x,y,_abb,_abc){
DwtComposite.prototype.setBounds.call(this,x,y,_abb,_abc);
this._sizeChildren(_abc);
};
DwtListView.prototype._sizeChildren=function(_abd){
if(this._listDiv&&(_abd!=Dwt.DEFAULT)){
Dwt.setSize(this._listDiv,Dwt.DEFAULT,_abd-DwtListView.HEADERITEM_HEIGHT);
}
};
DwtListView.prototype._getChildren=function(){
return null;
};
DwtListView.prototype.setSortByAsc=function(_abe,_abf){
if(!this._headerList){
return;
}
this._bSortAsc=_abf;
var _ac0=null;
for(var i=0;i<this._headerList.length;i++){
if(this._headerList[i]._sortable&&this._headerList[i]._sortable==_abe){
_ac0=this._headerList[i]._id;
break;
}
}
if(_ac0){
this._setSortedColStyle(_ac0);
}
};
DwtListView.prototype.enableSorting=function(_ac2){
this._sortingEnabled=_ac2;
};
DwtListView.prototype.getOffset=function(){
return this._offset;
};
DwtListView.prototype.setOffset=function(_ac3){
this._offset=_ac3;
};
DwtListView.prototype.getNewOffset=function(_ac4){
var _ac5=this.getLimit();
var _ac6=_ac4?this._offset+_ac5:this._offset-_ac5;
if(_ac6<0){
_ac6=0;
}
return _ac6;
};
DwtListView.prototype.getLimit=function(){
return DwtListView.DEFAULT_LIMIT;
};
DwtListView.prototype.getReplenishThreshold=function(){
return DwtListView.MAX_REPLENISH_THRESHOLD;
};
DwtListView.prototype.getList=function(){
return this._list;
};
DwtListView.prototype.replenish=function(list){
this._list.addList(list);
var size=list.size();
for(var i=0;i<size;i++){
var item=list.get(i);
var div=this._createItemHtml(item,this._now);
if(div){
this._addRow(div);
}
}
};
DwtListView.prototype._focus=function(){
if(this._kbAnchor!=null){
this._kbAnchor.className+=" "+Dwt.getAttr(this._kbAnchor,DwtListView._KBFOCUS_CLASS);
}
};
DwtListView.prototype._blur=function(){
this._unmarkKbAnchorElement();
};
DwtListView.prototype._unmarkKbAnchorElement=function(_acc){
if(this._kbAnchor!=null){
if(this._selectedItems.contains(this._kbAnchor)){
this._kbAnchor.className=Dwt.getAttr(this._kbAnchor,DwtListView._SELECTED_STYLE_CLASS);
}else{
this._kbAnchor.className=Dwt.getAttr(this._kbAnchor,DwtListView._STYLE_CLASS);
}
}
if(_acc){
this._kbAnchor=null;
}
};
DwtListView.prototype.getKeyMapName=function(){
return "DwtListView";
};
DwtListView.prototype.handleKeyAction=function(_acd,ev){
switch(_acd){
case DwtKeyMap.SELECT:
this._emulateSingleClick(this._kbAnchor,DwtMouseEvent.LEFT);
break;
case DwtKeyMap.SELECT_CURRENT:
this._emulateSingleClick(this._kbAnchor,DwtMouseEvent.LEFT,true);
break;
case DwtKeyMap.SELECT_NEXT:
this._selectItem(true);
break;
case DwtKeyMap.SELECT_PREV:
this._selectItem(false);
break;
case DwtKeyMap.ADD_SELECT_NEXT:
this._selectItem(true,true);
break;
case DwtKeyMap.ADD_SELECT_PREV:
this._selectItem(false,true);
break;
case DwtKeyMap.SELECT_ALL:
if(this._list&&this._list.size()){
this.setSelectedItems(this._list.getArray());
}
break;
case DwtKeyMap.SELECT_FIRST:
var a=this._list.getArray();
if(a&&a.length>1){
this.setSelection(a[0]);
}
this._scrollList(this._kbAnchor);
break;
case DwtKeyMap.SELECT_LAST:
var a=this._list.getArray();
if(a&&a.length>1){
this.setSelection(a[a.length-1]);
}
this._scrollList(this._kbAnchor);
break;
case DwtKeyMap.PREV:
this._setKbFocusElement(false);
break;
case DwtKeyMap.NEXT:
this._setKbFocusElement(true);
break;
case DwtKeyMap.DBLCLICK:
this.emulateDblClick(this.getItemFromElement(this._kbAnchor));
break;
case DwtKeyMap.ACTION:
if(this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
var p=Dwt.toWindow(this._kbAnchor,0,0);
var s=Dwt.getSize(this._kbAnchor);
this._emulateSingleClick(this._kbAnchor,DwtMouseEvent.RIGHT,false,false,false,p.x+s.x/4,p.y+s.y/2);
}
break;
default:
return false;
}
return true;
};
function DwtListHeaderItem(id,_ad3,_ad4,_ad5,_ad6,_ad7,_ad8,name){
this._id=id+Dwt.getNextId();
this._label=_ad3;
this._iconInfo=_ad4;
var w=parseInt(_ad5);
this._widthUnits=null;
if(isNaN(w)||!w){
this._width="auto";
}else{
if(String(w).toString()==String(_ad5).toString()){
this._width=w;
}else{
this._width=parseInt(String(_ad5).substr(0,String(w).length));
this._widthUnits=AjxStringUtil.getUnitsFromSizeString(_ad5);
}
}
this._sortable=_ad6;
this._resizeable=_ad7;
this._visible=(_ad8!==false);
this._name=name||_ad3;
}
function DwtButton(_adb,_adc,_add,_ade,_adf,id,_ae1){
if(arguments.length==0){
return;
}
_add=_add||"DwtButton";
DwtLabel.call(this,_adb,_adc,_add,_ade,id,_ae1);
this._origClassName=_add;
this._origClassNameFocused=_add+DwtButton.__KBFOCUS_STR;
this._disabledClassName=this._className+"-"+DwtCssStyle.DISABLED;
if(_adc&DwtButton.ALWAYS_FLAT){
this._activatedClassName=this._className;
this._triggeredClassName=this._className;
this._toggledClassName=this._className;
}else{
this._activatedClassName=this._className+"-"+DwtCssStyle.ACTIVATED;
this._triggeredClassName=this._className+"-"+DwtCssStyle.TRIGGERED;
this._toggledClassName=this._className+"-"+DwtCssStyle.TOGGLED;
}
var _ae2=[DwtEvent.ONCONTEXTMENU,DwtEvent.ONDBLCLICK,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART];
if(AjxEnv.isIE){
_ae2.push(DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE);
}else{
_ae2.push(DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT);
}
this._setEventHdlrs(_ae2);
this._mouseOverListenerObj=new AjxListener(this,DwtButton.prototype._mouseOverListener);
this._mouseOutListenerObj=new AjxListener(this,DwtButton.prototype._mouseOutListener);
this._mouseDownListenerObj=new AjxListener(this,DwtButton.prototype._mouseDownListener);
this._mouseUpListenerObj=new AjxListener(this,DwtButton.prototype._mouseUpListener);
this._addMouseListeners();
this._dropDownEvtMgr=new AjxEventMgr();
this._toggled=false;
this._actionTiming=_adf?_adf:DwtButton.ACTION_MOUSEUP;
this.__preventMenuFocus=null;
}
DwtButton.prototype=new DwtLabel;
DwtButton.prototype.constructor=DwtButton;
DwtButton.TOGGLE_STYLE=DwtLabel._LAST_STYLE*2;
DwtButton.ALWAYS_FLAT=DwtLabel._LAST_STYLE*4;
DwtButton.ACTION_MOUSEUP=1;
DwtButton.ACTION_MOUSEDOWN=2;
DwtButton.__KBFOCUS_STR="-"+DwtCssStyle.FOCUSED;
DwtButton.prototype.toString=function(){
return "DwtButton";
};
DwtButton.prototype.addSelectionListener=function(_ae3){
this.addListener(DwtEvent.SELECTION,_ae3);
};
DwtButton.prototype.removeSelectionListener=function(_ae4){
this.removeListener(DwtEvent.SELECTION,_ae4);
};
DwtButton.prototype.removeSelectionListeners=function(){
this.removeAllListeners(DwtEvent.SELECTION);
};
DwtButton.prototype.addDropDownSelectionListener=function(_ae5){
return this._dropDownEvtMgr.addListener(DwtEvent.SELECTION,_ae5);
};
DwtButton.prototype.removeDropDownSelectionListener=function(_ae6){
this._dropDownEvtMgr.removeListener(DwtEvent.SELECTION,_ae6);
};
DwtButton.prototype.setDropDownImages=function(_ae7,_ae8,_ae9,_aea){
this._dropDownImg=_ae7;
this._dropDownDisImg=_ae8;
this._dropDownHovImg=_ae9;
this._dropDownDepImg=_aea;
};
DwtButton.prototype._addMouseListeners=function(){
this.addListener(DwtEvent.ONMOUSEOVER,this._mouseOverListenerObj);
this.addListener(DwtEvent.ONMOUSEOUT,this._mouseOutListenerObj);
this.addListener(DwtEvent.ONMOUSEDOWN,this._mouseDownListenerObj);
this.addListener(DwtEvent.ONMOUSEUP,this._mouseUpListenerObj);
};
DwtButton.prototype._removeMouseListeners=function(){
this.removeListener(DwtEvent.ONMOUSEOVER,this._mouseOverListenerObj);
this.removeListener(DwtEvent.ONMOUSEOUT,this._mouseOutListenerObj);
this.removeListener(DwtEvent.ONMOUSEDOWN,this._mouseDownListenerObj);
this.removeListener(DwtEvent.ONMOUSEUP,this._mouseUpListenerObj);
};
DwtButton.prototype.setEnabled=function(_aeb){
if(_aeb!=this._enabled){
DwtLabel.prototype.setEnabled.call(this,_aeb);
if(_aeb){
this.__setClassName(this._origClassName);
this._addMouseListeners();
if(this._menu){
this._setupDropDownCellMouseHandlers();
AjxImg.setImage(this._dropDownCell,this._dropDownImg);
}
}else{
this.__setClassName(this._disabledClassName);
this._removeMouseListeners();
if(this._menu){
this._removeDropDownCellMouseHandlers();
AjxImg.setImage(this._dropDownCell,this._dropDownDisImg);
}
}
}
};
DwtButton.prototype.setHoverImage=function(_aec){
this._hoverImageInfo=_aec;
};
DwtButton.prototype.setMenu=function(_aed,_aee,_aef){
this._menu=_aed;
this._shouldToggleMenu=(_aee===true);
this._followIconStyle=_aef;
if(this._menu){
if(!this._dropDownCell){
var idx=(this._imageCell)?1:0;
if(this._textCell){
idx++;
}
this._dropDownCell=this._row.insertCell(idx);
this._dropDownCell.id=Dwt.getNextId();
this._dropDownCell.className="dropDownCell";
if(this._dropDownImg==null){
this._dropDownImg="SelectPullDownArrow";
}
if(this._dropDownDisImg==null){
this._dropDownDisImg="SelectPullDownArrowDis";
}
if(this._dropDownHovImg==null){
this._dropDownHovImg="SelectPullDownArrowHover";
}
AjxImg.setImage(this._dropDownCell,this._dropDownImg);
if(this._enabled){
this._setupDropDownCellMouseHandlers();
}
}
if(!(this._menu instanceof AjxCallback)){
this._menu.setAssociatedElementId(this._dropDownCell.id);
}
if((this.__preventMenuFocus!=null)&&(this._menu instanceof DwtMenu)){
this._menu.dontStealFocus(this.__preventMenuFocus);
}
}else{
if(this._dropDownCell){
this._row.deleteCell(Dwt.getCellIndex(this._dropDownCell));
this._dropDownCell=null;
}
}
};
DwtButton.prototype._setupDropDownCellMouseHandlers=function(){
Dwt.setHandler(this._dropDownCell,DwtEvent.ONMOUSEDOWN,DwtButton._dropDownCellMouseDownHdlr);
Dwt.setHandler(this._dropDownCell,DwtEvent.ONMOUSEUP,DwtButton._dropDownCellMouseUpHdlr);
};
DwtButton.prototype._removeDropDownCellMouseHandlers=function(){
Dwt.clearHandler(this._dropDownCell,DwtEvent.ONMOUSEDOWN);
Dwt.clearHandler(this._dropDownCell,DwtEvent.ONMOUSEUP);
};
DwtButton.prototype.getMenu=function(){
if(this._menu instanceof AjxCallback){
var _af1=this._menu;
this.setMenu(_af1.run());
if((this.__preventMenuFocus!=null)&&(this._menu instanceof DwtMenu)){
this._menu.dontStealFocus(this.__preventMenuFocus);
}
}
return this._menu;
};
DwtButton.prototype.resetClassName=function(){
this.__setClassName(this._origClassName);
};
DwtButton.prototype.setActionTiming=function(_af2){
this._actionTiming=_af2;
};
DwtButton.prototype.setActivated=function(_af3){
if(_af3){
this.__setClassName(this._activatedClassName);
}else{
this.__setClassName(this._origClassName);
}
};
DwtButton.prototype.setEnabledImage=function(_af4){
this._enabledImageInfo=_af4;
this.setImage(_af4);
};
DwtButton.prototype.setDepressedImage=function(_af5){
this._depressedImageInfo=_af5;
};
DwtButton.prototype.setToggled=function(_af6){
if((this._style&DwtButton.TOGGLE_STYLE)&&this._toggled!=_af6){
this._toggled=_af6;
this.__setClassName((_af6)?this._toggledClassName:this._origClassName);
}
};
DwtButton.prototype.isToggled=function(){
return this._toggled;
};
DwtButton.prototype.popup=function(){
var menu=this.getMenu();
if(!menu){
return;
}
var p=menu.parent;
var pb=p.getBounds();
var ws=menu.shell.getSize();
var s=menu.getSize();
var _afc=p.getHtmlElement();
var ptw=Dwt.toWindow(_afc,0,0);
var _afe=(_afc.style.borderLeftWidth=="")?0:parseInt(_afc.style.borderLeftWidth);
var x=ptw.x+_afe;
var _b00=(_afc.style.borderTopWidth=="")?0:parseInt(_afc.style.borderTopWidth);
_b00+=(_afc.style.borderBottomWidth=="")?0:parseInt(_afc.style.borderBottomWidth);
var y=ptw.y+pb.height+_b00;
x=((x+s.x)>=ws.x)?x-(x+s.x-ws.x):x;
menu.popup(0,x,y);
};
DwtButton.prototype.getKeyMapName=function(){
return "DwtButton";
};
DwtButton.prototype.handleKeyAction=function(_b02,ev){
switch(_b02){
case DwtKeyMap.SELECT:
this._emulateSingleClick();
break;
case DwtKeyMap.SUBMENU:
var menu=this.getMenu();
if(!menu){
return false;
}
this._emulateDropDownClick();
menu.setSelectedItem(0);
break;
}
return true;
};
DwtButton.prototype._emulateSingleClick=function(){
this.trigger();
var _b05=this.getHtmlElement();
var p=Dwt.toWindow(_b05);
var mev=DwtShell.mouseEvent;
mev.reset();
mev.target=_b05;
mev.button=DwtMouseEvent.LEFT;
mev.docX=p.x;
mev.docY=p.y;
if(this._actionTiming==DwtButton.ACTION_MOUSEDOWN){
this._mouseDownListener(mev);
}else{
this._mouseUpListener(mev);
}
};
DwtButton.prototype._emulateDropDownClick=function(){
var _b08=this._dropDownCell;
var p=Dwt.toWindow(_b08);
var mev=DwtShell.mouseEvent;
mev.reset();
mev.target=_b08;
mev.button=DwtMouseEvent.LEFT;
mev.docX=p.x;
mev.docY=p.y;
DwtButton._dropDownCellMouseDownHdlr(mev);
};
DwtButton.prototype._focusByMouseUpEvent=function(){
};
DwtButton.prototype._focus=function(){
this.__setClassName(this.getClassName());
};
DwtButton.prototype._blur=function(){
this.__setClassName(this.getClassName());
};
DwtButton.prototype._toggleMenu=function(){
if(this._shouldToggleMenu){
if(!this._menu.isPoppedup()){
this.popup();
this._menuUp=true;
}else{
this._menu.popdown();
this._menuUp=false;
}
}else{
this.popup();
}
};
DwtButton.prototype._mouseOverListener=function(ev){
if(this._hoverImageInfo){
this.setImage(this._hoverImageInfo);
}
this.__setClassName(this._activatedClassName);
if(this._dropDownCell&&this._dropDownHovImg&&!this.noMenuBar&&this.isListenerRegistered(DwtEvent.SELECTION)){
AjxImg.setImage(this._dropDownCell,this._dropDownHovImg);
}
ev._topPropagation=true;
};
DwtButton.prototype._mouseDownListener=function(ev){
if(ev.button!=DwtMouseEvent.LEFT){
return;
}
if(this._dropDownCell&&this._dropDownDepImg){
AjxImg.setImage(this._dropDownCell,this._dropDownDepImg);
}
switch(this._actionTiming){
case DwtButton.ACTION_MOUSEDOWN:
this.trigger();
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var _b0d=DwtShell.selectionEvent;
DwtUiEvent.copy(_b0d,ev);
_b0d.item=this;
_b0d.detail=typeof this.__detail=="undefined"?0:this.__detail;
this.notifyListeners(DwtEvent.SELECTION,_b0d);
}else{
if(this._menu){
this._toggleMenu();
}
}
break;
case DwtButton.ACTION_MOUSEUP:
this.trigger();
break;
}
};
DwtButton.prototype.trigger=function(){
if(this._depressedImageInfo){
this.setImage(this._depressedImageInfo);
}
this.__setClassName(this._triggeredClassName);
this.isTriggered=true;
};
DwtButton.prototype.deactivate=function(){
if(this._hoverImageInfo){
this.setImage(this._hoverImageInfo);
}
if(this._style&DwtButton.TOGGLE_STYLE){
this._toggled=!this._toggled;
}
this.__setClassName((!this._toggled)?this._activatedClassName:this._toggledClassName);
};
DwtButton.prototype.dontStealFocus=function(val){
if(val==null){
val=true;
}
if(this._menu instanceof DwtMenu){
this._menu.dontStealFocus(val);
}
this.__preventMenuFocus=val;
};
DwtButton.prototype._mouseUpListener=function(ev){
if(ev.button!=DwtMouseEvent.LEFT){
return;
}
if(this._dropDownCell&&this._dropDownHovImg&&!this.noMenuBar){
AjxImg.setImage(this._dropDownCell,this._dropDownHovImg);
}
switch(this._actionTiming){
case DwtButton.ACTION_MOUSEDOWN:
this.deactivate();
break;
case DwtButton.ACTION_MOUSEUP:
var el=this.getHtmlElement();
if(this.isTriggered){
this.deactivate();
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var _b11=DwtShell.selectionEvent;
DwtUiEvent.copy(_b11,ev);
_b11.item=this;
_b11.detail=typeof this.__detail=="undefined"?0:this.__detail;
this.notifyListeners(DwtEvent.SELECTION,_b11);
}else{
if(this._menu){
this._toggleMenu();
}
}
}
break;
}
};
DwtButton.prototype._setMouseOutClassName=function(){
this.__setClassName((this._toggled)?this._toggledClassName:this._origClassName);
};
DwtButton.prototype._mouseOutListener=function(ev){
if(this._hoverImageInfo){
this.setImage(this._enabledImageInfo);
}
this._setMouseOutClassName();
this.isTriggered=false;
if(this._dropDownCell){
AjxImg.setImage(this._dropDownCell,this._dropDownImg);
}
};
DwtButton._dropDownCellMouseDownHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _b15=DwtShell.mouseEvent;
_b15.setFromDhtmlEvent(ev);
if(_b15.button==DwtMouseEvent.LEFT){
if(this._depImg){
AjxImg.setImage(this,this._depImg);
}
DwtEventManager.notifyListeners(DwtEvent.ONMOUSEDOWN,_b15);
if(obj._menu instanceof AjxCallback){
obj.popup();
}
if(obj._dropDownEvtMgr.isListenerRegistered(DwtEvent.SELECTION)){
var _b16=DwtShell.selectionEvent;
DwtUiEvent.copy(_b16,_b15);
_b16.item=obj;
obj._dropDownEvtMgr.notifyListeners(DwtEvent.SELECTION,_b16);
}else{
if(_b15.button==DwtMouseEvent.LEFT){
obj._toggleMenu();
}
}
}
_b15._stopPropagation=true;
_b15._returnValue=false;
_b15.setToDhtmlEvent(ev);
return false;
};
DwtButton._dropDownCellMouseUpHdlr=function(ev){
var _b18=DwtShell.mouseEvent;
_b18.setFromDhtmlEvent(ev);
if(_b18.button==DwtMouseEvent.LEFT){
if(this._hovImg&&!this.noMenuBar){
AjxImg.setImage(this,this._hovImg);
}
}
_b18._stopPropagation=true;
_b18._returnValue=false;
_b18.setToDhtmlEvent(ev);
return false;
};
DwtButton.prototype.__setClassName=function(_b19){
if(this.hasFocus()){
if(_b19==this._origClassName){
_b19+=DwtButton.__KBFOCUS_STR;
}
}else{
if(_b19==this._origClassNameFocused){
_b19=this._origClassName;
}
}
this.setClassName(_b19);
};
function DwtMenuItem(_b1a,_b1b,_b1c,_b1d,_b1e,_b1f){
_b1e=_b1e||"DwtMenuItem";
DwtComposite.call(this,_b1a,_b1e,_b1f);
if(!(_b1a instanceof DwtMenu)){
throw new DwtException("Parent must be a DwtMenu object",DwtException.INVALIDPARENT,"DwtMenuItem");
}
this._style=_b1b?_b1b:DwtMenuItem.CASCADE_STYLE;
if(_b1a._style==DwtMenu.BAR_STYLE&&this._style!=DwtMenuItem.PUSH_STYLE){
throw new DwtException("DwtMenuItemInit: invalid style",DwtException.INVALID_PARAM,"DwtMenuItem");
}
this._setMouseEventHdlrs();
this._origClassName=_b1e;
this._selectedClassName=_b1e+"-"+DwtCssStyle.SELECTED;
this._triggeredClassName=_b1e+"-"+DwtCssStyle.TRIGGERED;
this._iconAreaClassName=_b1e+"-IconArea";
this._iconAreaSelClassname=this._iconAreaClassName+"-"+DwtCssStyle.SELECTED;
this._checkedAreaClassName=_b1e+"-CheckedArea";
this._checkedAreaSelClassname=this._checkedAreaClassName+"-"+DwtCssStyle.SELECTED;
this._table=document.createElement("table");
this._table.cellSpacing=this._table.cellPadding=0;
this._table.border=0;
this._table.borderCollapse="separate";
this._row=this._table.insertRow(0);
switch(this._style){
case DwtMenuItem.SEPARATOR_STYLE:
this._createSeparatorStyle();
break;
case DwtMenuItem.PUSH_STYLE:
this._createPushStyle();
break;
case DwtMenuItem.RADIO_STYLE:
case DwtMenuItem.CHECK_STYLE:
this._createCheckedStyle(_b1c);
break;
case DwtMenuItem.SELECT_STYLE:
this._createSelectStyle();
break;
default:
this._createCascadeStyle();
}
this._mouseOverListenerObj=new AjxListener(this,DwtMenuItem.prototype._mouseOverListener);
this._mouseOutListenerObj=new AjxListener(this,DwtMenuItem.prototype._mouseOutListener);
this._mouseUpListenerObj=new AjxListener(this,DwtMenuItem.prototype._mouseUpListener);
this._mouseDownListenerObj=new AjxListener(this,DwtMenuItem.prototype._mouseDownListener);
this.addListener(DwtEvent.ONMOUSEOVER,this._mouseOverListenerObj);
this.addListener(DwtEvent.ONMOUSEOUT,this._mouseOutListenerObj);
this.addListener(DwtEvent.ONMOUSEUP,this._mouseUpListenerObj);
this.addListener(DwtEvent.ONMOUSEDOWN,this._mouseDownListenerObj);
this.getHtmlElement().appendChild(this._table);
if(_b1a._addItem){
_b1a._addItem(this,_b1d);
}
this.setCursor("pointer");
this._menu=null;
this._menuDisposeListener=new AjxListener(this,DwtMenuItem.prototype._menuDisposed);
}
DwtMenuItem.prototype=new DwtComposite;
DwtMenuItem.prototype.constructor=DwtMenuItem;
DwtMenuItem.prototype.toString=function(){
return "DwtMenuItem";
};
DwtMenuItem.CHECKED=1;
DwtMenuItem.UNCHECKED=2;
DwtMenuItem.NO_STYLE=0;
DwtMenuItem.CHECK_STYLE=1;
DwtMenuItem.RADIO_STYLE=2;
DwtMenuItem.SEPARATOR_STYLE=3;
DwtMenuItem.CASCADE_STYLE=4;
DwtMenuItem.PUSH_STYLE=5;
DwtMenuItem.SELECT_STYLE=6;
DwtMenuItem._IMAGECELL_DIM="22px";
DwtMenuItem._CASCADE_DIM="16px";
DwtMenuItem._CHECKEDCELL_DIM="13px";
DwtMenuItem._FILLCELL_DIM="7px";
DwtMenuItem._SEPAARATOR_DIM="1px";
DwtMenuItem._MENU_POPUP_DELAY=250;
DwtMenuItem._MENU_POPDOWN_DELAY=250;
DwtMenuItem.create=function(_b20,_b21,text,_b23,_b24,_b25,_b26,idx,_b28,_b29){
var mi=new DwtMenuItem(_b20,_b25,_b26,idx,_b28,_b29);
if(_b21){
mi.setImage(_b21);
}
if(text){
mi.setText(text);
}
if(_b23){
mi.setDisabledImage(_b23);
}
mi.setEnabled(_b24!==false);
return mi;
};
DwtMenuItem.prototype.addSelectionListener=function(_b2b){
this.addListener(DwtEvent.SELECTION,_b2b);
};
DwtMenuItem.prototype.removeSelectionListener=function(_b2c){
this.removeListener(DwtEvent.SELECTION,_b2c);
};
DwtMenuItem.prototype.getChecked=function(){
return this._itemChecked;
};
DwtMenuItem.prototype.setChecked=function(_b2d,_b2e){
this._setChecked(_b2d,null,_b2e);
};
DwtMenuItem.prototype._setChecked=function(_b2f,ev,_b31){
if((this._style==DwtMenuItem.CHECK_STYLE||this._style==DwtMenuItem.RADIO_STYLE)&&this._itemChecked!=_b2f){
this._itemChecked=_b2f;
if(_b2f){
if(this._style==DwtMenuItem.CHECK_STYLE){
AjxImg.setImage(this._checkedCell,"MenuCheck");
}else{
AjxImg.setImage(this._checkedCell,"MenuRadio");
this.parent._radioItemSelected(this,_b31);
}
var gp=this.parent.parent?this.parent.parent:null;
if(gp&&(gp instanceof DwtButton)&&(gp._followIconStyle==this._style)){
gp.setImage(this._imageInfo);
}
}else{
AjxImg.setImage(this._checkedCell,"Blank_9");
}
if(_b31){
return;
}
var _b33=DwtShell.selectionEvent;
if(ev){
DwtUiEvent.copy(_b33,ev);
}else{
_b33.reset();
}
_b33.item=this;
_b33.detail=(_b2f)?DwtMenuItem.CHECKED:DwtMenuItem.UNCHECKED;
this.notifyListeners(DwtEvent.SELECTION,_b33);
}
};
DwtMenuItem.prototype.setEnabled=function(_b34){
if(_b34!=this._enabled){
DwtControl.prototype.setEnabled.call(this,_b34);
if(_b34){
this.addListener(DwtEvent.ONMOUSEOVER,this._mouseOverListenerObj);
this.addListener(DwtEvent.ONMOUSEOUT,this._mouseOutListenerObj);
this.addListener(DwtEvent.ONMOUSEUP,this._mouseUpListenerObj);
this.addListener(DwtEvent.ONMOUSEDOWN,this._mouseDownListenerObj);
if(this._imageInfo){
this._setImage(this._imageInfo);
}
if(this._textCell){
this._textCell.className="Text";
}
}else{
this.removeListener(DwtEvent.ONMOUSEOVER,this._mouseOverListenerObj);
this.removeListener(DwtEvent.ONMOUSEOUT,this._mouseOutListenerObj);
this.removeListener(DwtEvent.ONMOUSEUP,this._mouseUpListenerObj);
this.removeListener(DwtEvent.ONMOUSEDOWN,this._mouseDownListenerObj);
if(this._disabledImageInfo){
this._setImage(this._disabledImageInfo);
}
if(this._textCell){
this._textCell.className="DisabledText";
}
}
}
};
DwtMenuItem.prototype.getDisabledImage=function(){
return this._disabledImage;
};
DwtMenuItem.prototype.setDisabledImage=function(_b35){
this._disabledImageInfo=_b35;
if(!this._enabled&&_b35){
this._setImage(_b35);
}
};
DwtMenuItem.prototype.getImage=function(){
return this._imageInfo;
};
DwtMenuItem.prototype.setImage=function(_b36){
this._imageInfo=_b36;
if(this._enabled||(!this._enabled&&!this._disabledImageInfo)){
this._setImage(_b36);
}
};
DwtMenuItem.prototype._setImage=function(_b37){
if(this._imageInfo==null){
return;
}
if(this._iconCell==null){
this._addIconCell();
this.parent._menuItemHasIcon();
}
if(this._style!=DwtMenuItem.SEPARATOR_STYLE){
AjxImg.setImage(this._iconCell,_b37);
}
};
DwtMenuItem.prototype.getMenu=function(){
if(this._menu instanceof AjxCallback){
var _b38=this._menu;
this.setMenu(_b38.run());
}
return this._menu;
};
DwtMenuItem.prototype.setMenu=function(_b39){
if((this.parent instanceof DwtMenu)&&(this.parent.__preventMenuFocus!=null)&&(_b39 instanceof DwtMenu)){
_b39.dontStealFocus(this.parent.__preventMenuFocus);
}
if(this._menu==_b39){
return;
}
if(this._menu&&!(this._menu instanceof AjxCallback)){
this._menu.removeDisposeListener(this._menuDisposeListener);
}
if(this._style==DwtMenuItem.CASCADE_STYLE||this._style==DwtMenuItem.CHECK_STYLE||this._style==DwtMenuItem.RADIO_STYLE){
if(_b39){
if(!this._menu){
this.parent._submenuItemAdded();
}
AjxImg.setImage(this._cascCell,"Cascade");
}else{
if(!_b39){
if(this._menu){
this.parent._submenuItemRemoved();
}
if(this._cascCell){
AjxImg.setImage(this._cascCell,"Blank_16");
}
}
}
}
this._menu=_b39;
if(_b39&&!(_b39 instanceof AjxCallback)){
_b39.addDisposeListener(this._menuDisposeListener);
}
};
DwtMenuItem.prototype.setSize=function(_b3a,_b3b){
DwtComposite.prototype.setSize.call(this,_b3a,_b3b);
if(_b3a!=DwtControl.DEFAULT){
_b3a=(typeof (_b3a)=="number")?_b3a+"px":_b3a;
this._table.style.width=_b3a;
}
if(_b3b!=DwtControl.DEFAULT){
_b3b=(typeof (_b3b)=="number")?_b3b+"px":_b3b;
this._table.style.height=_b3b;
}
};
DwtMenuItem.prototype.getText=function(){
if((this._style==DwtMenuItem.SEPARATOR_STYLE)!=0){
return null;
}
return this._textCell.innerHTML;
};
DwtMenuItem.prototype.getStyle=function(){
return this._style;
};
DwtMenuItem.prototype.setText=function(text){
if((this._style==DwtMenuItem.SEPARATOR_STYLE)!=0){
return;
}
this._textCell.innerHTML=text;
};
DwtMenuItem.prototype._createSeparatorStyle=function(){
var _b3d=this._className+"-Separator";
this._table.style.width="100%";
fillCell=this._row.insertCell(0);
fillCell.innerHTML="<div class='"+_b3d+"'></div>";
};
DwtMenuItem.prototype._createPushStyle=function(){
var i=0;
this._textCell=this._row.insertCell(i++);
this._textCell.className="Text";
if(this.parent._menuHasItemsWithIcons()){
this._addIconCell();
}
};
DwtMenuItem.prototype._createSelectStyle=function(){
this._table.style.width="100%";
this._textCell=this._row.insertCell(-1);
this._textCell.className="Text";
};
DwtMenuItem.prototype._createCascadeStyle=function(){
this._table.style.width="100%";
var i=0;
this._textCell=this._row.insertCell(i++);
this._textCell.className="Text";
if(this.parent._menuHasSubmenus()){
this._submenuItemAdded();
}
if(this.parent._menuHasCheckedItems()){
this._checkItemAdded();
}
if(this.parent._menuHasItemsWithIcons()){
this._addIconCell();
}
};
DwtMenuItem.prototype._createCheckedStyle=function(_b40){
this._createCascadeStyle();
this._checkItemAdded();
this._radioGroupId=(_b40!=null)?_b40:0;
this._itemChecked=false;
};
DwtMenuItem.prototype._checkItemAdded=function(_b41){
if(this._checkedCell==null){
this._checkedCell=this._row.insertCell(0);
this._checkedCell.noWrap=true;
this._checkedCell.align="center";
this._checkedCell.width=DwtMenuItem._CHECKEDCELL_DIM;
this._checkedCell.height=(this._style!=DwtMenuItem.SEPARATOR_STYLE)?DwtMenuItem._CHECKEDCELL_DIM:DwtMenuItem._SEPAARATOR_DIM;
if(_b41==null){
_b41=this._checkedAreaClassName;
}
this._checkedCell.className=_b41;
}
};
DwtMenuItem.prototype._checkedItemsRemoved=function(){
this._row.deleteCell(0);
this._checkedCell=null;
};
DwtMenuItem.prototype._submenuItemAdded=function(){
if(this._style!=DwtMenuItem.SEPARATOR_STYLE){
if(this._cascCell==null){
this._cascCell=this._row.insertCell(-1);
this._cascCell.noWrap=true;
this._cascCell.style.width=DwtMenuItem._CASCADE_DIM;
this._cascCell.style.height=(this._style!=DwtMenuItem.SEPARATOR_STYLE)?DwtMenuItem._CASCADE_DIM:DwtMenuItem._SEPAARATOR_DIM;
}
}
};
DwtMenuItem.prototype._submenuItemRemoved=function(){
if(this._style!=DwtMenuItem.SEPARATOR_STYLE){
this._row.deleteCell(this._row.cells.length-1);
this._cascCell=null;
}
};
DwtMenuItem.prototype._addIconCell=function(){
if(this._iconCell==null){
var i=(!this._checkedCell)?0:1;
this._iconCell=this._row.insertCell(i++);
this._iconCell.noWrap=true;
this._iconCell.align="center";
this._iconCell.width=DwtMenuItem._IMAGECELL_DIM;
this._iconCell.height=(this._style!=DwtMenuItem.SEPARATOR_STYLE)?DwtMenuItem._IMAGECELL_DIM:DwtMenuItem._SEPAARATOR_DIM;
this._iconCell.className=this._iconAreaClassName;
}
};
DwtMenuItem.prototype._menuDisposed=function(ev){
this.setMenu(null);
};
DwtMenuItem.prototype._popupMenu=function(_b44,_b45){
var menu=this.getMenu();
var pp=this.parent.parent;
var pb=this.getBounds();
var ws=menu.shell.getSize();
var s=menu.getSize();
var x;
var y;
var _b4d;
var _b4e;
var _b4f=pp.getHtmlElement();
if(pp._style==DwtMenu.BAR_STYLE){
_b4d=(_b4f.style.borderLeftWidth=="")?0:parseInt(_b4f.style.borderLeftWidth);
x=pb.x+_b4d;
_b4e=(_b4f.style.borderTopWidth=="")?0:parseInt(_b4f.style.borderTopWidth);
_b4e+=(_b4f.style.borderBottomWidth=="")?0:parseInt(_b4f.style.borderBottonWidth);
y=pb.y+pb.height+_b4e;
x=((x+s.x)>=ws.x)?x-(x+s.x-ws.x):x;
}else{
_b4d=(_b4f.style.borderLeftWidth=="")?0:parseInt(_b4f.style.borderLeftWidth);
_b4d+=(_b4f.style.borderRightWidth=="")?0:parseInt(_b4f.style.borderRightWidth);
x=pb.x+pb.width+_b4d;
_b4e=(_b4f.style.borderTopWidth=="")?0:parseInt(_b4f.style.borderTopWidth);
y=pb.y+_b4e;
x=((x+s.x)>=ws.x)?pb.x-s.x-_b4d:x;
}
menu.popup(_b44,x,y,_b45);
};
DwtMenuItem.prototype._popdownMenu=function(){
this._deselect(0);
};
DwtMenuItem.prototype._deselect=function(msec){
if(this._style==DwtMenuItem.CASCADE_STYLE||this._style==DwtMenuItem.CHECK_STYLE||this._style==DwtMenuItem.RADIO_STYLE){
if(this._iconCell){
this._iconCell.className=this._iconAreaClassName;
}
if(this._checkedCell){
this._checkedCell.className=this._checkedAreaClassName;
}
msec=(msec==null)?DwtMenuItem._MENU_POPDOWN_DELAY:msec;
}
var menu=this.getMenu();
if(menu){
menu.popdown(msec);
}
this.setClassName(this._origClassName);
this.setCursor("pointer");
this._isSelected=false;
};
DwtMenuItem.prototype._isMenuPoppedup=function(){
var menu=this.getMenu();
return (menu&&menu.isPoppedup())?true:false;
};
DwtMenuItem.prototype._mouseOverListener=function(ev){
if(this.parent.__selectedId!=this._htmlElId&&this._menu){
this._deselect(0);
}
this.parent.__selectedId=this._htmlElId;
if(this._style==DwtMenuItem.SEPARATOR_STYLE){
return;
}
var _b54=this.parent.__currentItem;
if(_b54&&_b54._isSelected){
_b54._deselect();
}
var _b55=this.parent._getActiveItem();
if(_b55){
_b55._deselect();
}
this.parent.setCurrentItem(this);
if(this._style==DwtMenuItem.CASCADE_STYLE||this._style==DwtMenuItem.CHECK_STYLE||this._style==DwtMenuItem.RADIO_STYLE){
if(this._iconCell){
this._iconCell.className=this._iconAreaSelClassName;
}
if(this._checkedCell){
this._checkedCell.className=this._checkedAreaSelClassName;
}
if(this._menu&&!ev.ersatz){
this._popupMenu(DwtMenuItem._MENU_POPUP_DELAY);
}
this.setSelectedStyle();
}else{
if(this._style==DwtMenuItem.PUSH_STYLE||this._style==DwtMenuItem.SELECT_STYLE){
if(_b55&&this._menu&&!ev.ersatz){
this._popupMenu(0);
this.setSelectedStyle();
}else{
this.setSelectedStyle();
}
}
}
ev._stopPropagation=true;
};
DwtMenuItem.prototype.setSelectedStyle=function(){
this.setClassName(this._selectedClassName);
this._isSelected=true;
};
DwtMenuItem.prototype.setTriggeredStyle=function(){
this.setCursor("wait");
this.setClassName(this._triggeredClassName);
};
DwtMenuItem.prototype._mouseOutListener=function(ev){
if(this._style==DwtMenuItem.SEPARATOR_STYLE){
return;
}
var menu=this.getMenu();
if(menu==null||!menu.isPoppedup()){
this._deselect();
}
};
DwtMenuItem.prototype._mouseDownListener=function(ev){
if(ev.button!=DwtMouseEvent.LEFT){
return;
}
this.setTriggeredStyle();
};
DwtMenuItem.prototype._mouseUpListener=function(ev){
if(ev.button!=DwtMouseEvent.LEFT){
return;
}
if(this._style==DwtMenuItem.CHECK_STYLE){
this._deselect();
this._setChecked(!this._itemChecked,ev);
DwtMenu.closeActiveMenu();
}else{
if(this._style==DwtMenuItem.RADIO_STYLE){
if(!this._itemChecked){
this._setChecked(!this._itemChecked,ev);
if(this._menu){
this._popupMenu(0);
}else{
DwtMenu.closeActiveMenu();
}
}else{
if(this._menu){
this._popupMenu(0);
}else{
DwtMenu.closeActiveMenu();
var _b5a=DwtShell.selectionEvent;
if(ev){
DwtUiEvent.copy(_b5a,ev);
}else{
_b5a.reset();
}
_b5a.item=this;
_b5a.detail=(this._itemChecked)?DwtMenuItem.CHECKED:DwtMenuItem.UNCHECKED;
this.notifyListeners(DwtEvent.SELECTION,_b5a);
}
}
}else{
if(this._style!=DwtMenuItem.PUSH_STYLE){
if(this._menu){
this._popupMenu(0);
}else{
if(this.isListenerRegistered(DwtEvent.SELECTION)){
this._deselect();
var _b5a=DwtShell.selectionEvent;
DwtUiEvent.copy(_b5a,ev);
_b5a.item=_b5a.dwtObj;
_b5a.detail=0;
this.notifyListeners(DwtEvent.SELECTION,_b5a);
DwtMenu.closeActiveMenu();
}else{
this._deselect();
DwtMenu.closeActiveMenu();
}
}
}else{
if(this._style==DwtMenuItem.PUSH_STYLE){
if(this._menu){
if(!this._isMenuPoppedup()){
this._popupMenu(0);
}else{
this._deselect(0);
}
}
}
}
}
}
return true;
};
function DwtMenu(_b5b,_b5c,_b5d,_b5e,_b5f){
if(arguments.length==0){
return;
}
if(_b5b){
if(_b5b instanceof DwtMenuItem||_b5b instanceof DwtButton){
if(_b5c==DwtMenu.GENERIC_WIDGET_STYLE){
this._style=DwtMenu.GENERIC_WIDGET_STYLE;
}else{
this._style=DwtMenu.DROPDOWN_STYLE;
}
}else{
this._style=_b5c||DwtMenu.POPUP_STYLE;
}
if(!_b5e){
_b5e=(this._style==DwtMenu.BAR_STYLE)?DwtControl.STATIC_STYLE:DwtControl.ABSOLUTE_STYLE;
}
}
_b5d=_b5d||"DwtMenu";
DwtComposite.call(this,(_b5b instanceof DwtShell)?_b5b:_b5b.shell,_b5d,_b5e);
this.parent=_b5b;
if(_b5b==null){
return;
}
this._dialog=_b5f;
var _b60=this.getHtmlElement();
Dwt.setLocation(_b60,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
if(this._style!=DwtMenu.COLOR_PICKER_STYLE&&this._style!=DwtMenu.CALENDAR_PICKER_STYLE&&this._style!=DwtMenu.GENERIC_WIDGET_STYLE){
this._table=document.createElement("table");
this._table.border=this._table.cellPadding=this._table.cellSpacing=0;
_b60.appendChild(this._table);
this._table.backgroundColor=DwtCssStyle.getProperty(_b60,"background-color");
}
if(_b5c!=DwtMenu.BAR_STYLE){
this.setZIndex(Dwt.Z_HIDDEN);
this._isPoppedup=false;
}else{
DwtMenu._activeMenuIds.add(_b60.id);
this._isPoppedup=true;
}
this._popdownAction=new AjxTimedAction(this,this._doPopdown);
this._popdownActionId=-1;
this._popupAction=new AjxTimedAction(this,this._doPopup);
this._popupActionId=-1;
if((this.parent instanceof DwtMenuItem&&this.parent.parent._style==DwtMenu.BAR_STYLE)||!(this.parent instanceof DwtMenuItem)){
this._outsideListener=new AjxListener(this,this._outsideMouseDownListener);
}
this._numCheckedStyleItems=0;
this._menuItemsHaveIcons=false;
this._menuItemsWithSubmenus=0;
this.__currentItem=null;
this.__preventMenuFocus=false;
this._menuCapObj=new DwtMouseEventCapture(this,"DwtMenu",null,DwtMenu._capMouseDownHdlr,null,null,null,false);
this._tabGroup=new DwtTabGroup(this.toString(),true);
this._tabGroup.addMember(this);
}
DwtMenu.prototype=new DwtComposite;
DwtMenu.prototype.constructor=DwtMenu;
DwtMenu.prototype.toString=function(){
return "DwtMenu";
};
DwtMenu.BAR_STYLE=1;
DwtMenu.POPUP_STYLE=2;
DwtMenu.DROPDOWN_STYLE=3;
DwtMenu.COLOR_PICKER_STYLE=4;
DwtMenu.CALENDAR_PICKER_STYLE=5;
DwtMenu.GENERIC_WIDGET_STYLE=6;
DwtMenu._activeMenuUp=false;
DwtMenu._activeMenuIds=new AjxVector();
DwtMenu.prototype.addPopupListener=function(_b61){
this.addListener(DwtEvent.POPUP,_b61);
};
DwtMenu.prototype.removePopupListener=function(_b62){
this.removeListener(DwtEvent.POPUP,_b62);
};
DwtMenu.prototype.addPopdownListener=function(_b63){
this.addListener(DwtEvent.POPDOWN,_b63);
};
DwtMenu.prototype.removePopdownListener=function(_b64){
this.removeListener(DwtEvent.POPDOWN,_b64);
};
DwtMenu.prototype.getItem=function(_b65){
return this._children.get(_b65);
};
DwtMenu.prototype.getItemById=function(key,id){
var _b68=this.getItems();
for(var i=0;i<_b68.length;i++){
var _b6a=_b68[i].getData(key);
if(_b6a==id){
return _b68[i];
}
}
return null;
};
DwtMenu.prototype.getItemCount=function(){
return this._children.size();
};
DwtMenu.prototype.getItems=function(){
return this._children.getArray();
};
DwtMenu.prototype.getSelectedItem=function(_b6b){
var a=this._children.getArray();
for(var i=0;i<a.length;i++){
var mi=a[i];
if((!_b6b||(mi._style==_b6b))&&mi.getChecked()){
return mi;
}
}
return null;
};
DwtMenu.prototype.isPoppedup=function(){
return this._isPoppedup;
};
DwtMenu.prototype.popup=function(msec,x,y,_b72){
if(this._style==DwtMenu.BAR_STYLE){
return;
}
if(this._popdownActionId!=-1){
AjxTimedAction.cancelAction(this._popdownActionId);
this._popdownActionId=-1;
}else{
if(this._isPoppedup||(this._popupActionId!=-1&&msec&&msec>0)){
return;
}else{
if(this._popupActionId!=-1){
AjxTimedAction.cancelAction(this._popupActionId);
this._popupActionId=-1;
}
}
if(!msec){
this._doPopup(x,y,_b72);
}else{
this._popupAction.args=[x,y,_b72];
this._popupActionId=AjxTimedAction.scheduleAction(this._popupAction,msec);
}
}
};
DwtMenu.prototype.popdown=function(msec){
if(this._style==DwtMenu.BAR_STYLE){
return;
}
if(this._popupActionId!=-1){
AjxTimedAction.cancelAction(this._popupActionId);
this._popupActionId=-1;
}else{
if(!this._isPoppedup||this._popdownActionId!=-1){
return;
}
if(msec==null||msec==0){
this._doPopdown();
}else{
this._popdownActionId=AjxTimedAction.scheduleAction(this._popdownAction,msec);
}
}
};
DwtMenu.prototype.getKeyMapName=function(){
return "DwtMenu";
};
DwtMenu.prototype.handleKeyAction=function(_b74,ev){
switch(this._style){
case DwtMenu.BAR_STYLE:
case DwtMenu.POPUP_STYLE:
case DwtMenu.DROPDOWN_STYLE:
break;
default:
return false;
}
switch(_b74){
case DwtKeyMap.SELECT_NEXT:
case DwtKeyMap.SELECT_PREV:
this.setSelectedItem(_b74==DwtKeyMap.SELECT_NEXT);
break;
case DwtKeyMap.SELECT:
var mev=DwtShell.mouseEvent;
this._setMouseEvent(mev,true,this.__currentItem,DwtMouseEvent.LEFT,false,false,false,0,0);
this.__currentItem._mouseUpListener(mev);
break;
case DwtKeyMap.SUBMENU:
if(this.__currentItem&&this.__currentItem._menu){
this.__currentItem._popupMenu(0,true);
}
break;
case DwtKeyMap.PARENTMENU:
if(this.parent instanceof DwtMenuItem){
this.popdown(0);
}
break;
case DwtKeyMap.CANCEL:
this.popdown(0);
break;
default:
return false;
}
return true;
};
DwtMenu.prototype.setCurrentItem=function(_b77){
this.__currentItem=_b77;
};
DwtMenu.prototype._setMouseEvent=function(mev,_b79,_b7a,_b7b,ctrl,_b7d,alt,docX,docY){
mev.reset();
mev.target=_b7a.getHtmlElement();
mev.button=_b7b;
mev.docX=docX;
mev.docY=docY;
mev.shiftKey=_b7d;
mev.altKey=alt;
mev.ctrlKey=ctrl;
mev.dwtObj=_b7a;
mev.ersatz=_b79;
};
DwtMenu.prototype._focus=function(){
};
DwtMenu.prototype._blur=function(){
};
DwtMenu.prototype.setAssociatedObj=function(_b81){
this._associatedObj=_b81;
};
DwtMenu.prototype.setAssociatedElementId=function(id){
this._associatedElId=id;
};
DwtMenu.prototype.checkItem=function(_b83,_b84,_b85){
var _b86=this._children.getArray();
for(var i=0;i<_b86.length;i++){
var item=_b86[i];
if(item._style!=DwtMenuItem.CHECK_STYLE&&item._style!=DwtMenuItem.RADIO_STYLE){
continue;
}
var val=item.getData(_b83);
if(val==_b84){
item.setChecked(true,_b85);
}
}
};
DwtMenu.prototype.setSelectedItem=function(_b8a){
var _b8b=this.__currentItem;
if(typeof (_b8a)=="boolean"){
_b8b=!_b8b?this._children.get(0):_b8a?this._children.getNext(_b8b):this._children.getPrev(_b8b);
}else{
_b8b=this._children.get(_b8a);
}
while(_b8b&&(_b8b.getStyle()==DwtMenuItem.SEPARATOR_STYLE||!_b8b.getEnabled())){
_b8b=(_b8a===false)?this._children.getPrev(_b8b):this._children.getNext(_b8b);
}
if(!_b8b){
return;
}
var mev=DwtShell.mouseEvent;
if(this.__currentItem){
this._setMouseEvent(mev,true,this.__currentItem,null,false,false,false,0,0);
this.__currentItem._mouseOutListener(mev);
}
this._setMouseEvent(mev,true,_b8b,null,false,false,false,0,0);
_b8b._mouseOverListener(mev);
};
DwtMenu.prototype.clearExternallySelectedItems=function(){
if(this._externallySelected!=null){
this._externallySelected._deselect();
this._externallySelected=null;
}
};
DwtMenu.prototype.removeChild=function(_b8d){
if(this._style==DwtMenu.BAR_STYLE){
var cell=_b8d.getHtmlElement().parentNode;
this._table.rows[0].deleteCell(Dwt.getCellIndex(cell));
}else{
var sz=this._children.size();
if(sz>1&&(_b8d._style==DwtMenuItem.CHECK_STYLE||_b8d._style==DwtMenuItem.RADIO_STYLE)){
if(this._numCheckedStyleItems==1){
var a=this._children.getArray();
for(var i=0;i<sz;i++){
if(a[i]!=_b8d){
a[i]._checkedItemsRemoved();
}
}
}
this._numCheckedStyleItems--;
}
if(sz>1&&_b8d.getMenu()){
this._submenuItemRemoved();
}
var el=_b8d.getHtmlElement();
if(el){
this._table.deleteRow(el.parentNode.parentNode.rowIndex);
}
}
this._children.remove(_b8d);
};
DwtMenu.prototype.addChild=function(_b93){
if((_b93 instanceof DwtColorPicker)||(_b93 instanceof DwtCalendar)||(this._style==DwtMenu.GENERIC_WIDGET_STYLE)){
this._addItem(_b93);
}
};
DwtMenu.prototype._addItem=function(item,_b95){
if(this._style==DwtMenu.COLOR_PICKER_STYLE||this._style==DwtMenu.CALENDAR_PICKER_STYLE||this._style==DwtMenu.GENERIC_WIDGET_STYLE){
if(this._children.size()>0||!(item.parent instanceof DwtMenu)||((this._style==DwtMenu.COLOR_PICKER_STYLE&&!(item instanceof DwtColorPicker))||(this._style==DwtMenu.CALENDAR_PICKER_STYLE&&!(item instanceof DwtCalendar))||(this._style==DwtMenu.GENERIC_WIDGET_STYLE&&!(item instanceof DwtControl)))){
throw new DwtException("Invalid child",DwtException.INVALID_PARAM,"DwtMenu.prototype._addItem");
}
this._children.add(item);
item.reparentHtmlElement(this.getHtmlElement());
}else{
var row;
var col;
if(this._style==DwtMenu.BAR_STYLE){
var rows=this._table.rows;
row=(rows.length!=0)?rows[0]:this._table.insertRow(0);
if(_b95==null||_b95>row.cells.length){
_b95=rows.cells.length;
}
col=row.insertCell(_b95);
col.align="center";
col.vAlign="middle";
var spc=row.insertCell(-1);
spc.nowrap=true;
spc.width="7px";
}else{
if(item._style==DwtMenuItem.CHECK_STYLE||item._style==DwtMenuItem.RADIO_STYLE){
if(this._numCheckedStyleItems==0){
var sz=this._children.size();
if(sz>0){
var a=this._children.getArray();
for(var i=0;i<sz;i++){
if(a[i]._style!=DwtMenuItem.CHECK_STYLE&&a[i]._style!=DwtMenuItem.RADIO_STYLE){
a[i]._checkItemAdded();
}
}
}
}
this._numCheckedStyleItems++;
}
if(_b95==null||_b95>this._table.rows.length){
_b95=-1;
}
row=this._table.insertRow(_b95);
col=row.insertCell(0);
}
col.noWrap=true;
col.appendChild(item.getHtmlElement());
this._children.add(item,_b95);
}
};
DwtMenu.prototype._radioItemSelected=function(_b9d,_b9e){
var _b9f=_b9d._radioGroupId;
var sz=this._children.size();
var a=this._children.getArray();
for(var i=0;i<sz;i++){
if(a[i]!=_b9d&&a[i]._style==DwtMenuItem.RADIO_STYLE&&a[i]._radioGroupId==_b9f&&a[i]._itemChecked){
a[i].setChecked(false,_b9e);
break;
}
}
};
DwtMenu.prototype._menuHasCheckedItems=function(){
return (this._numCheckedStyleItems>0);
};
DwtMenu.prototype._menuHasSubmenus=function(){
return (this._menuItemsWithSubmenus>0);
};
DwtMenu.prototype._menuHasItemsWithIcons=function(){
return this._menuItemsHaveIcons;
};
DwtMenu.prototype._menuItemHasIcon=function(item){
if(!this._menuItemsHaveIcons){
var sz=this._children.size();
if(sz>0){
var a=this._children.getArray();
for(var i=0;i<sz;i++){
if(a[i]!=item){
a[i]._addIconCell();
}
}
}
}
this._menuItemsHaveIcons=true;
};
DwtMenu.prototype._submenuItemAdded=function(){
if(this._menuItemsWithSubmenus==0){
var sz=this._children.size();
var a=this._children.getArray();
for(var i=0;i<sz;i++){
a[i]._submenuItemAdded();
}
}
this._menuItemsWithSubmenus++;
};
DwtMenu.prototype._submenuItemRemoved=function(){
if(this._menuItemsWithSubmenus==1){
var sz=this._children.size();
var a=this._children.getArray();
for(var i=0;i<sz;i++){
a[i]._submenuItemRemoved();
}
}
this._menuItemsWithSubmenus--;
};
DwtMenu.prototype.dontStealFocus=function(val){
if(val==null){
val=true;
}
this.__preventMenuFocus=!!val;
};
DwtMenu.prototype._doPopup=function(x,y,_bb0){
var ws=this.shell.getSize();
var s=this.getSize();
ws.y-=10+AjxEnv.isIE?20:0;
if(((this._style==DwtMenu.POPUP_STYLE||(this._style==DwtMenu.DROPDOWN_STYLE&&this.parent instanceof DwtMenuItem))&&s.y>=ws.y)||(this._style==DwtMenu.DROPDOWN_STYLE&&y+s.y>=ws.y)){
var _bb3=ws.y;
var newY=null;
if(this._style==DwtMenu.DROPDOWN_STYLE&&!(this.parent instanceof DwtMenuItem)){
_bb3=ws.y-y;
var _bb5=this.parent.getBounds().y;
var _bb6=_bb3;
if(_bb3<50||(s.y>_bb6&&s.y<_bb5&&_bb5/_bb6>2)){
_bb3=_bb5;
newY=_bb5;
}
}
var rows=this._table.rows;
var _bb8=rows.length;
var _bb9=s.y;
for(var i=_bb8-1;i>=0;i--){
var row=rows[i];
_bb9-=AjxEnv.isSafari?15:Dwt.getSize(row).y;
if(_bb9<_bb3){
break;
}
}
var _bbc=i+1;
for(var j=_bbc;j<_bb8;j++){
var row=rows[(j-_bbc)%_bbc];
var cell=row.insertCell(-1);
cell.className="DwtMenuCascadeCell";
var _bbf=rows[j].cells[0].firstChild;
while(_bbf!=null){
cell.appendChild(_bbf);
_bbf=_bbf.nextSibling;
}
}
for(j=rows.length-1;j>=_bbc;j--){
this._table.deleteRow(_bbc);
}
var _bc0=_bb8%_bbc;
if(_bc0>0){
for(var j=_bc0;j<_bbc;j++){
var row=rows[j];
var cell=row.insertCell(-1);
cell.className="DwtMenuCascadeCell";
cell.empty=true;
cell.innerHTML="&nbsp;";
}
}
s=this.getSize();
if(newY){
y=newY-s.y;
}
}
var newX=((x+s.x)>=ws.x)?x-(x+s.x-ws.x):x;
var newY=((y+s.y)>=ws.y)?y-(y+s.y-ws.y):y;
this.setLocation(newX,newY);
this.notifyListeners(DwtEvent.POPUP,this);
var _bc2=this.shell.getToolTip();
if(_bc2){
_bc2.popdown();
}
var _bc3=this._dialog?Dwt.Z_DIALOG_MENU:Dwt.Z_MENU;
this.setZIndex(_bc3);
this._popupActionId=-1;
this._isPoppedup=true;
if(this._outsideListener){
this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEWHEEL]);
this.shell.addListener(DwtEvent.ONMOUSEDOWN,this._outsideListener);
this.shell.addListener(DwtEvent.ONMOUSEWHEEL,this._outsideListener);
}
if(!DwtMenu._activeMenu){
DwtMenu._activeMenu=this;
DwtMenu._activeMenuUp=true;
DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,DwtMenu._outsideMouseDownListener);
DwtEventManager.addListener(DwtEvent.ONMOUSEWHEEL,DwtMenu._outsideMouseDownListener);
}
DwtMenu._activeMenuIds.add(this._htmlElId);
DwtMenu._activeMenuIds.sort();
if(!this._menuCapObj.capturing()){
this._menuCapObj.capture();
this._capturing=true;
}else{
this._capturing=false;
}
if(AjxEnv.isGeckoBased&&this._table){
var _bc4=this.getHtmlElement();
_bc4.style.width=s.x+"px";
}
if(!this.__preventMenuFocus){
DwtShell.getShell(window).getKeyboardMgr().pushTabGroup(this._tabGroup);
}
if(_bb0){
this.handleKeyAction(DwtKeyMap.SELECT_NEXT);
}
};
DwtMenu.prototype.getSize=function(_bc5){
if(this._table){
return Dwt.getSize(this._table,_bc5);
}
return DwtComposite.prototype.getSize.call(this,_bc5);
};
DwtMenu.prototype._doPopdown=function(){
var a=this._children.getArray();
var s=this._children.size();
for(var i=0;i<s;i++){
if((a[i] instanceof DwtMenuItem)&&a[i]._style!=DwtMenuItem.SEPARATOR_STYLE){
a[i]._popdownMenu();
}
}
this.setZIndex(Dwt.Z_HIDDEN);
this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this.notifyListeners(DwtEvent.POPDOWN,this);
if(this._outsideListener){
this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEWHEEL],true);
this.shell.removeListener(DwtEvent.ONMOUSEDOWN,this._outsideListener);
this.shell.removeListener(DwtEvent.ONMOUSEWHEEL,this._outsideListener);
}
if(DwtMenu._activeMenu==this){
DwtMenu._activeMenu=null;
DwtMenu._activeMenuUp=false;
DwtEventManager.removeListener(DwtEvent.ONMOUSEDOWN,DwtMenu._outsideMouseDownListener);
DwtEventManager.removeListener(DwtEvent.ONMOUSEWHEEL,DwtMenu._outsideMouseDownListener);
}
DwtMenu._activeMenuIds.remove(this._htmlElId);
this._popdownActionId=-1;
this._isPoppedup=false;
if(this._capturing){
this._menuCapObj.release();
this._capturing=false;
}
if((this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE)&&this._table.rows.length&&this._table.rows[0].cells.length){
var _bc9=this._table.rows[0].cells.length;
var _bca=this._table.rows.length;
for(var i=1;i<_bc9;i++){
for(var j=0;j<_bca;j++){
var cell=this._table.rows[j].cells[i];
if(!cell.empty){
var _bcd=cell.firstChild;
var row=this._table.insertRow(this._table.rows.length);
var cell=row.insertCell(0);
while(_bcd!=null){
cell.appendChild(_bcd);
_bcd=_bcd.nextSibling;
}
}
}
}
for(var j=0;j<_bca;j++){
var row=this._table.rows[j];
for(var i=row.cells.length-1;i>0;i--){
row.deleteCell(i);
}
}
}
this.__currentItem=null;
DwtShell.getShell(window).getKeyboardMgr().popTabGroup(this._tabGroup);
};
DwtMenu.prototype._getActiveItem=function(){
var a=this._children.getArray();
var s=this._children.size();
for(var i=0;i<s;i++){
if(a[i]._isMenuPoppedup()){
return a[i];
}
}
return null;
};
DwtMenu._outsideMouseDownListener=function(ev){
if(DwtMenu._activeMenuUp){
var menu=DwtMenu._activeMenu;
var _bd4=DwtUiEvent.getDwtObjFromEvent(ev);
if(menu._associatedObj&&menu._associatedObj==_bd4){
return false;
}
var id=menu._htmlElId;
var _bd6=DwtUiEvent.getTarget(ev);
while(_bd6!=null){
if(_bd6.id&&_bd6.id!=""&&(_bd6.id==id||_bd6.id==menu._associatedElId||DwtMenu._activeMenuIds.binarySearch(_bd6.id)!=-1)){
return false;
}
_bd6=_bd6.parentNode;
}
menu.popdown();
}
ev._stopPropagation=false;
ev._returnValue=true;
return true;
};
DwtMenu._capMouseDownHdlr=function(ev){
var menu=DwtMouseEventCapture.getTargetObj();
var _bd9=DwtShell.mouseEvent;
_bd9.setFromDhtmlEvent(ev);
DwtMenu._outsideMouseDownListener(_bd9);
DwtUiEvent.setBehaviour(ev,false,true);
return true;
};
DwtMenu.menuShowing=function(){
return DwtMenu._activeMenuUp;
};
DwtMenu.closeActiveMenu=function(){
if(DwtMenu._activeMenuUp){
DwtMenu._activeMenu.popdown();
}
};
function DwtMessageDialog(_bda,_bdb,_bdc,_bdd){
if(arguments.length==0){
return;
}
this._msgCellId=Dwt.getNextId();
_bdc=_bdc?_bdc:[DwtDialog.OK_BUTTON];
DwtDialog.call(this,_bda,_bdb,null,_bdc,_bdd);
this.setContent(this._contentHtml());
this._msgCell=document.getElementById(this._msgCellId);
this.addEnterListener(new AjxListener(this,this._enterListener));
}
DwtMessageDialog.prototype=new DwtDialog;
DwtMessageDialog.prototype.constructor=DwtMessageDialog;
DwtMessageDialog.CRITICAL_STYLE=1;
DwtMessageDialog.INFO_STYLE=2;
DwtMessageDialog.WARNING_STYLE=3;
DwtMessageDialog.TITLE=new Object();
DwtMessageDialog.TITLE[DwtMessageDialog.CRITICAL_STYLE]=AjxMsg.criticalMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.INFO_STYLE]=AjxMsg.infoMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.WARNING_STYLE]=AjxMsg.warningMsg;
DwtMessageDialog.ICON=new Object();
DwtMessageDialog.ICON[DwtMessageDialog.CRITICAL_STYLE]="Critical_32";
DwtMessageDialog.ICON[DwtMessageDialog.INFO_STYLE]="Information_32";
DwtMessageDialog.ICON[DwtMessageDialog.WARNING_STYLE]="Warning_32";
DwtMessageDialog.prototype.toString=function(){
return "DwtMessageDialog";
};
DwtMessageDialog.prototype.setMessage=function(_bde,_bdf,_be0){
_bdf=_bdf?_bdf:DwtMessageDialog.INFO_STYLE;
_be0=_be0?_be0:DwtMessageDialog.TITLE[_bdf];
this.setTitle(_be0);
if(_bde){
var html=new Array();
var i=0;
html[i++]="<table cellspacing=0 cellpadding=0 border=0><tr>";
html[i++]="<td valign='top'>";
html[i++]=AjxImg.getImageHtml(DwtMessageDialog.ICON[_bdf]);
html[i++]="</td><td class='DwtMsgArea'>";
html[i++]=_bde;
html[i++]="</td></tr></table>";
this._msgCell.innerHTML=html.join("");
}else{
this._msgCell.innerHTML="";
}
};
DwtMessageDialog.prototype.reset=function(){
this._msgCell.innerHTML="";
DwtDialog.prototype.reset.call(this);
};
DwtMessageDialog.prototype.handleKeyAction=function(_be3,ev){
switch(_be3){
case DwtKeyMap.CANCEL:
var _be3=(this._button[DwtDialog.CANCEL_BUTTON])?_be3:DwtKeyMap.ENTER;
default:
DwtDialog.prototype.handleKeyAction.call(this,_be3,ev);
}
return true;
};
DwtMessageDialog.prototype._contentHtml=function(){
return "<div id='"+this._msgCellId+"' class='DwtMsgDialog'></div>";
};
DwtMessageDialog.prototype._enterListener=function(ev){
this._runEnterCallback();
};
function DwtHtmlEditor(_be6,_be7,_be8,_be9,mode,_beb){
if(arguments.length==0){
return;
}
this.setBlankIframeSrc(_beb);
_be7=_be7||"DwtHtmlEditor";
DwtComposite.call(this,_be6,_be7,_be8);
this._mode=mode==DwtHtmlEditor.HTML&&this.isHtmlEditingSupported()?mode:DwtHtmlEditor.TEXT;
this.__eventClosure=AjxCallback.simpleClosure(this.__eventClosure,this);
if(!_be9){
_be9=this._mode==DwtHtmlEditor.HTML?"<html><head></head><body></body></html>":"";
}
this._pendingContent=_be9;
this._htmlModeInited=false;
this._initialize();
}
DwtHtmlEditor.prototype=new DwtComposite();
DwtHtmlEditor.prototype.constructor=DwtHtmlEditor;
DwtHtmlEditor.HTML=1;
DwtHtmlEditor.TEXT=2;
DwtHtmlEditor.H1=1;
DwtHtmlEditor.H2=2;
DwtHtmlEditor.H3=3;
DwtHtmlEditor.H4=4;
DwtHtmlEditor.H5=5;
DwtHtmlEditor.H6=6;
DwtHtmlEditor.PARAGRAPH=7;
DwtHtmlEditor.ADDRESS=8;
DwtHtmlEditor.PREFORMATTED=9;
DwtHtmlEditor._STYLES=["","<h1>","<h2>","<h3>","<h4>","<h5>","<h6>","<p>","<address>","<pre>"];
DwtHtmlEditor.BOLD_STYLE="bold";
DwtHtmlEditor.ITALIC_STYLE="italic";
DwtHtmlEditor.UNDERLINE_STYLE="underline";
DwtHtmlEditor.STRIKETHRU_STYLE="strikethrough";
DwtHtmlEditor.SUBSCRIPT_STYLE="subscript";
DwtHtmlEditor.SUPERSCRIPT_STYLE="superscript";
DwtHtmlEditor.JUSTIFY_LEFT="justifyleft";
DwtHtmlEditor.JUSTIFY_CENTER="justifycenter";
DwtHtmlEditor.JUSTIFY_RIGHT="justifyright";
DwtHtmlEditor.JUSTIFY_FULL="justifyfull";
DwtHtmlEditor.OUTDENT="outdent";
DwtHtmlEditor.INDENT="indent";
DwtHtmlEditor.HORIZ_RULE="inserthorizontalrule";
DwtHtmlEditor.ORDERED_LIST="insertorderedlist";
DwtHtmlEditor.UNORDERED_LIST="insertunorderedlist";
DwtHtmlEditor.IMAGE="insertimage";
DwtHtmlEditor.DIRECTION_R2L;
DwtHtmlEditor.DIRECTION_L2R;
DwtHtmlEditor.BORDER_TOP=0;
DwtHtmlEditor.BORDER_MIDDLE=1;
DwtHtmlEditor.BORDER_BOTTOM=2;
DwtHtmlEditor.BORDER_LEFT=3;
DwtHtmlEditor.BORDER_CENTER=4;
DwtHtmlEditor.BORDER_RIGHT=5;
DwtHtmlEditor._ARIAL_RE=/arial|helvetica|sans-serif/;
DwtHtmlEditor._TIMES_RE=/times|serif/;
DwtHtmlEditor._VERDANA_RE=/verdana/;
DwtHtmlEditor._COURIER_RE=/courier|mono/;
DwtHtmlEditor._H1_RE=/Heading 1|h1/;
DwtHtmlEditor._H2_RE=/Heading 2|h2/;
DwtHtmlEditor._H3_RE=/Heading 2|h3/;
DwtHtmlEditor._H4_RE=/Heading 2|h4/;
DwtHtmlEditor._H5_RE=/Heading 2|h5/;
DwtHtmlEditor._H6_RE=/Heading 2|h6/;
DwtHtmlEditor._PARAGRAPH_RE=/Normal|p/;
DwtHtmlEditor._ADDRESS_RE=/Address|address/;
DwtHtmlEditor._PREFORMATTED_RE=/Formatted|pre/;
DwtHtmlEditor._FONT_NAME="fontname";
DwtHtmlEditor._FONT_SIZE="fontsize";
DwtHtmlEditor._FONT_COLOR="forecolor";
DwtHtmlEditor._FONT_HILITE="hilitecolor";
DwtHtmlEditor._FONT_HILITE_IE="backcolor";
DwtHtmlEditor._FORMAT_BLOCK="formatblock";
DwtHtmlEditor._INITDELAY=50;
DwtHtmlEditor._BLOCK_ELEMENTS={address:1,body:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,iframe:1,li:1,ol:1,p:1,pre:1,quote:1,table:1,tbody:1,td:1,textarea:1,tfoot:1,thead:1,tr:1,ul:1};
DwtHtmlEditor._KEY2CMDS={"b":DwtHtmlEditor.BOLD_STYLE,"i":DwtHtmlEditor.ITALIC_STYLE,"u":DwtHtmlEditor.UNDERLINE_STYLE,"s":DwtHtmlEditor.STRIKETHRU_STYLE,"l":DwtHtmlEditor.JUSTIFY_LEFT,"e":DwtHtmlEditor.JUSTIFY_CENTER,"r":DwtHtmlEditor.JUSTIFY_RIGHT,"j":DwtHtmlEditor.JUSTIFY_FULL,"1":DwtHtmlEditor._STYLES[1],"2":DwtHtmlEditor._STYLES[1],"3":DwtHtmlEditor._STYLES[3],"4":DwtHtmlEditor._STYLES[4],"5":DwtHtmlEditor._STYLES[5],"6":DwtHtmlEditor._STYLES[6],"0":"DUMP"};
DwtHtmlEditor.prototype.focus=function(){
if(!AjxEnv.isIE&&this._mode==DwtHtmlEditor.TEXT){
document.getElementById(this._textAreaId).focus();
}else{
try{
this._getIframeWin().focus();
if(AjxEnv.isIE){
if(this._currInsPt){
if(this._currInsPt.text.length<=1){
this._currInsPt.collapse(false);
}
this._currInsPt.select();
}
}
}
catch(ex){
}
}
};
DwtHtmlEditor.prototype.moveCaretToTop=function(){
if(this._mode==DwtHtmlEditor.TEXT){
var _bec=document.getElementById(this._textAreaId);
if(_bec.createTextRange){
var _bed=_bec.createTextRange();
_bed.collapse(true);
_bed.select();
}else{
if(_bec.setSelectionRange){
_bec.setSelectionRange(0,0);
}
}
}else{
this._moveCaretToTopHtml(true);
}
};
DwtHtmlEditor.prototype._moveCaretToTopHtml=function(_bee){
var body=this._getIframeDoc().body;
var _bf0=false;
if(AjxEnv.isIE){
if(body){
body.createTextRange().collapse(true);
_bf0=true;
}
}else{
var _bf1=this._getSelection();
if(_bf1){
_bf1.collapse(body,0);
_bf0=true;
}
}
if(!_bf0&&_bee){
var _bf2=new AjxTimedAction(this,this._moveCaretToTopHtml);
AjxTimedAction.scheduleAction(_bf2,DwtHtmlEditor._INITDELAY+1);
}
};
DwtHtmlEditor.prototype.addStateChangeListener=function(_bf3){
this.addListener(DwtEvent.STATE_CHANGE,_bf3);
};
DwtHtmlEditor.prototype.removeStateChangeListener=function(_bf4){
this.removeListener(DwtEvent.STATE_CHANGE,_bf4);
};
DwtHtmlEditor.prototype.clear=function(){
this.setContent("");
};
DwtHtmlEditor.prototype.enable=function(_bf5){
if(this._textAreaId!=null){
document.getElementById(this._textAreaId).disabled=!_bf5;
}
if(this._iFrameId!=null){
document.getElementById(this._iFrameId).disabled=!_bf5;
}
};
DwtHtmlEditor.prototype.setBlankIframeSrc=function(src){
this._blankIframeSrc=src;
};
DwtHtmlEditor.prototype.isHtmlEditingSupported=function(){
return (!AjxEnv.isGeckoBased&&!AjxEnv.isIE)?false:true;
};
DwtHtmlEditor.prototype.getContent=function(){
if(this._mode==DwtHtmlEditor.HTML){
var _bf7=this._getIframeDoc();
var html=_bf7&&_bf7.body?(this._getIframeDoc().body.innerHTML):"";
return this._embedHtmlContent(html);
}else{
return document.getElementById(this._textAreaId).value;
}
};
DwtHtmlEditor.prototype._embedHtmlContent=function(html){
return ["<html><body>",html,"</body></html>"].join("");
};
DwtHtmlEditor.prototype.setContent=function(_bfa){
if(AjxEnv.isIE){
this._currInsPt=null;
}
if(this._mode==DwtHtmlEditor.HTML){
if(this._htmlModeInited){
this._pendingContent=_bfa?((_bfa instanceof AjxVector)?_bfa[0]:_bfa):"";
this._setContentOnTimer();
}else{
var ta=new AjxTimedAction(this,this.setContent,[_bfa]);
AjxTimedAction.scheduleAction(ta,DwtHtmlEditor._INITDELAY+1);
}
}else{
document.getElementById(this._textAreaId).value=(_bfa||"");
}
};
DwtHtmlEditor.prototype.insertElement=function(_bfc){
this._execCommand(_bfc);
};
DwtHtmlEditor.prototype.insertText=function(text){
var node=this._getIframeDoc().createTextNode(text);
this._insertNodeAtSelection(node);
};
DwtHtmlEditor.prototype.insertImage=function(src){
this._execCommand(DwtHtmlEditor.IMAGE,src);
};
DwtHtmlEditor.prototype.insertTable=function(rows,cols,_c02,_c03,_c04,_c05){
if(this._mode!=DwtHtmlEditor.HTML){
return;
}
var doc=this._getIframeDoc();
var _c07=doc.createElement("table");
_c07.className="DwtHtmlEditor-Table";
if(_c02!=null){
_c07.style.width=_c02;
}else{
_c07.style.width="100%";
}
_c07.style.textAlign="left";
_c07.style.verticalAlign="middle";
if(_c05!=null){
_c07.align=_c05.toLowerCase();
}
if(_c03!=null){
_c07.cellSpacing=_c03;
}else{
_c07.cellSpacing=0;
}
if(_c04!=null){
_c07.cellPadding=_c04;
}else{
_c07.cellPadding=0;
}
if(!AjxEnv.isIE){
_c07.style.border="1px solid #000";
}
_c07.style.borderCollapse="collapse";
var _c08;
_c08=Math.floor(100/cols)+"%";
var _c09=doc.createElement("tbody");
_c07.appendChild(_c09);
for(var i=0;i<rows;i++){
var tr=doc.createElement("tr");
_c09.appendChild(tr);
for(var j=0;j<cols;j++){
var td=doc.createElement("td");
if(i==0&&_c08){
td.style.width=_c08;
}
if(AjxEnv.isGeckoBased){
td.appendChild(doc.createElement("br"));
}else{
if(AjxEnv.isIE){
td.innerHTML="&nbsp;";
}
}
if(AjxEnv.isIE){
td.style.border="1px solid #000";
}else{
td.style.borderTop=td.style.borderLeft="1px solid #000";
}
tr.appendChild(td);
}
}
var p=doc.createElement("br");
var df=doc.createDocumentFragment();
df.appendChild(p);
df.appendChild(_c07);
df.appendChild(p.cloneNode(true));
this._insertNodeAtSelection(df);
this.selectNodeContents(_c07.rows[0].cells[0],true);
return _c07;
};
DwtHtmlEditor.prototype.applyTableProperties=function(_c10,_c11){
var doc=this._getIframeDoc();
var _c13=[];
for(var i in _c11){
var val=AjxStringUtil.trim(_c11[i].toString());
var _c16=val!="";
switch(i){
case "caption":
var _c17=_c10.getElementsByTagName("caption");
_c17=_c17.length>0?_c17[0]:null;
if(_c16&&!_c17){
_c17=doc.createElement("caption");
_c10.insertBefore(_c17,_c10.firstChild);
}
if(!_c16&&_c17){
_c17.parentNode.removeChild(_c17);
}
if(_c17){
_c17.innerHTML=val;
}
break;
case "summary":
case "align":
case "cellSpacing":
case "cellPadding":
if(!_c16){
_c10.removeAttribute(i,0);
}else{
_c10[i]=val;
}
break;
case "borderWidth":
case "borderStyle":
case "borderColor":
_c10.style[i]=val;
_c13.push([i,val]);
break;
default:
_c10.style[i]=val;
break;
}
}
if(_c13.length>0){
var tds=_c10.getElementsByTagName("td");
for(var i=tds.length;--i>=0;){
var td=tds[i];
for(var j=_c13.length;--j>=0;){
td.style[_c13[j][0]]=_c13[j][1];
}
}
}
if(AjxEnv.isGeckoBased){
this._forceRedraw();
}
};
DwtHtmlEditor.prototype.applyCellProperties=function(_c1b,_c1c,_c1d){
var _c1e=true;
for(var _c1f=_c1c.length;--_c1f>=0;){
var row=_c1c[_c1f];
var _c21=(_c1f==0);
var _c22=true;
for(var _c23=row.length;--_c23>=0;){
var _c24=(_c23==0);
var td=row[_c23];
if(_c1d.backgroundColor!=null){
td.style.backgroundColor=_c1d.backgroundColor;
}
if(_c1d.color!=null){
td.style.color=_c1d.color;
}
if(_c1d.textAlign!=null){
td.style.textAlign=_c1d.textAlign;
}
if(_c1d.verticalAlign!=null){
td.style.verticalAlign=_c1d.verticalAlign;
}
if(_c1d.width!=null){
if(_c1d.width){
td.style.width=_c1d.width+"px";
}else{
td.style.width="";
}
}
if(_c1d.height!=null){
if(_c1d.height){
td.style.height=_c1d.height+"px";
}else{
td.style.height="";
}
}
if(_c1d.vertPadding!=null){
if(_c1d.vertPadding){
td.style.paddingTop=td.style.paddingBottom=_c1d.vertPadding+"px";
}else{
td.style.paddingTop=td.style.paddingBottom="";
}
}
if(_c1d.horizPadding!=null){
if(_c1d.horizPadding){
td.style.paddingLeft=td.style.paddingRight=_c1d.horizPadding+"px";
}else{
td.style.paddingLeft=td.style.paddingRight="";
}
}
var _c26=_c1d.borders,b;
b=_c26[DwtHtmlEditor.BORDER_TOP];
if(b!=null&&_c21){
td.style.borderTop=b.width+" "+b.style+" "+b.color;
}
b=_c26[DwtHtmlEditor.BORDER_MIDDLE];
if(b!=null){
b=b.width+" "+b.style+" "+b.color;
if(!_c1e){
td.style.borderBottom=b;
}
if(!_c21){
td.style.borderTop=b;
}
}
b=_c26[DwtHtmlEditor.BORDER_BOTTOM];
if(b!=null&&_c1e){
td.style.borderBottom=b.width+" "+b.style+" "+b.color;
}
b=_c26[DwtHtmlEditor.BORDER_LEFT];
if(b!=null&&_c24){
td.style.borderLeft=b.width+" "+b.style+" "+b.color;
}
b=_c26[DwtHtmlEditor.BORDER_CENTER];
if(b!=null){
b=b.width+" "+b.style+" "+b.color;
if(!_c22){
td.style.borderRight=b;
}
if(!_c24){
td.style.borderLeft=b;
}
}
b=_c26[DwtHtmlEditor.BORDER_RIGHT];
if(b!=null&&_c22){
td.style.borderRight=b.width+" "+b.style+" "+b.color;
}
_c22=false;
}
_c1e=false;
}
if(AjxEnv.isGeckoBased){
this._forceRedraw();
}
};
DwtHtmlEditor.prototype._insertNodeAtSelection=function(node){
this.focus();
if(!AjxEnv.isIE){
var _c28=this._getRange();
this._getIframeWin().getSelection().removeAllRanges();
try{
_c28.deleteContents();
_c28.insertNode(node);
_c28.selectNodeContents(node);
}
catch(e){
}
}else{
var sel=this._getRange();
var _c28=sel.createRange();
var id="FOO-"+Dwt.getNextId();
try{
_c28.pasteHTML("<span id='"+id+"'></span>");
}
catch(ex){
_c28.collapse(false);
_c28.pasteHTML("<span id='"+id+"'></span>");
}
var el=this._getIframeDoc().getElementById(id);
el.parentNode.insertBefore(node,el);
el.parentNode.removeChild(el);
}
};
DwtHtmlEditor.prototype.setMode=function(mode,_c2d){
if(mode==this._mode||(mode!=DwtHtmlEditor.HTML&&mode!=DwtHtmlEditor.TEXT)){
return;
}
this._mode=mode;
if(mode==DwtHtmlEditor.HTML){
var _c2e=document.getElementById(this._textAreaId);
var _c2f;
var idoc=this._getIframeDoc();
if(this._iFrameId!=null&&idoc){
idoc.body.innerHTML=(_c2d)?AjxStringUtil.convertToHtml(_c2e.value):_c2e.value;
_c2f=document.getElementById(this._iFrameId);
}else{
var _c31=(_c2d)?AjxStringUtil.convertToHtml(_c2e.value):_c2e.value;
_c31=["<html><head></head><body>",_c31,"</body></html>"].join("");
_c2f=this._initHtmlMode(_c31);
}
Dwt.setVisible(_c2e,false);
Dwt.setVisible(_c2f,true);
if(AjxEnv.isGeckoBased){
this._enableDesignMode(this._getIframeDoc());
}
}else{
var _c2e=this._textAreaId!=null?document.getElementById(this._textAreaId):this._initTextMode(true);
var _c31=(!this._pendingContent)?this._getIframeDoc().innerHTML:(this._pendingContent||"");
_c2e.value=(_c2d)?this._convertHtml2Text():this._getIframeDoc().innerHTML;
Dwt.setVisible(document.getElementById(this._iFrameId),false);
Dwt.setVisible(_c2e,true);
}
};
DwtHtmlEditor.prototype.setTextDirection=function(_c32){
if(this._mode!=DwtHtmlEditor.HTML){
return;
}
var dir=(_c32==DwtHtmlEditor.DIRECTION_R2L)?"rtl":"ltr";
var el=this._getParentElement();
while(el&&!DwtHtmlEditor._BLOCK_ELEMENTS[el.nodeName.toLowerCase()]){
el=el.parentNode;
}
if(el){
el.style.direction=el.style.direction==dir?"":dir;
}
};
DwtHtmlEditor.prototype.setFont=function(_c35,_c36,size,_c38,_c39){
if(_c35){
this._execCommand(DwtHtmlEditor._FONT_NAME,_c35);
}
if(_c36){
this._execCommand(_c36);
}
if(size){
this._execCommand(DwtHtmlEditor._FONT_SIZE,size);
}
if(_c38){
this._execCommand(DwtHtmlEditor._FONT_COLOR,_c38);
}
if(_c39){
this._execCommand((AjxEnv.isIE)?DwtHtmlEditor._FONT_HILITE_IE:DwtHtmlEditor._FONT_HILITE,_c39);
}
};
DwtHtmlEditor.prototype.setJustification=function(_c3a){
this._execCommand(_c3a);
};
DwtHtmlEditor.prototype.setIndent=function(_c3b){
this._execCommand(_c3b);
};
DwtHtmlEditor.prototype.setStyle=function(_c3c){
this._execCommand(DwtHtmlEditor._FORMAT_BLOCK,DwtHtmlEditor._STYLES[_c3c]);
};
DwtHtmlEditor.prototype.setSize=function(_c3d,_c3e){
DwtComposite.prototype.setSize.call(this,_c3d,_c3e);
var _c3f=this.getHtmlElement();
if(this._iFrameId!=null){
var _c40=document.getElementById(this._iFrameId);
_c40.width=_c3f.style.width;
_c40.height=_c3f.style.height;
}else{
var _c41=document.getElementById(this._textAreaId);
_c41.style.width=_c3f.style.width;
_c41.style.height=_c3f.style.height;
}
};
DwtHtmlEditor.prototype.getIframe=function(){
return document.getElementById(this._iFrameId);
};
DwtHtmlEditor.prototype.getInputElement=function(){
var id=(this._mode==DwtHtmlEditor.HTML)?this._iFrameId:this._textAreaId;
return document.getElementById(id);
};
DwtHtmlEditor.prototype._initialize=function(){
if(this._mode==DwtHtmlEditor.HTML){
this._initHtmlMode(this._pendingContent);
}else{
this._initTextMode();
}
};
DwtHtmlEditor.prototype._initTextMode=function(_c43){
var _c44=this.getHtmlElement();
this._textAreaId="textarea_"+Dwt.getNextId();
var _c45=document.createElement("textarea");
_c45.className="DwtHtmlEditorTextArea";
_c45.id=this._textAreaId;
_c44.appendChild(_c45);
if(!_c43){
_c45.value=this._pendingContent;
this._pendingContent=null;
}
return _c45;
};
DwtHtmlEditor.prototype._initHtmlMode=function(_c46){
var _c47=this._createIFrameEl();
this._keyEvent=new DwtKeyEvent();
this._stateEvent=new DwtHtmlEditorStateEvent();
this._stateEvent.dwtObj=this;
this._updateStateAction=new AjxTimedAction(this,this._updateState);
this._pendingContent=_c46||"";
var _c48=new AjxTimedAction(this,this._finishHtmlModeInit);
AjxTimedAction.scheduleAction(_c48,DwtHtmlEditor._INITDELAY);
return _c47;
};
DwtHtmlEditor.prototype._createIFrameEl=function(){
var _c49=this.getHtmlElement();
this._iFrameId="iframe_"+Dwt.getNextId();
var _c4a=document.createElement("iframe");
_c4a.id=this._iFrameId;
_c4a.className="DwtHtmlEditorIFrame";
_c4a.setAttribute("border","0",false);
_c4a.setAttribute("frameborder","0",false);
_c4a.setAttribute("vspace","0",false);
_c4a.setAttribute("autocomplete","off",false);
if(AjxEnv.isIE&&location.protocol=="https:"){
_c4a.src=this._blankIframeSrc||"";
}
_c49.appendChild(_c4a);
return _c4a;
};
DwtHtmlEditor.prototype._initializeContent=function(_c4b){
var _c4c="<html><head></head><body>"+(_c4b||"")+"</body></html>";
var doc=this._getIframeDoc();
try{
doc.write(_c4c);
}
finally{
doc.close();
}
};
DwtHtmlEditor.prototype._finishHtmlModeInit=function(_c4e){
var doc=this._getIframeDoc();
try{
doc.body.innerHTML=this._pendingContent||"";
}
catch(ex){
return;
}
this._enableDesignMode(doc);
this._updateState();
this._htmlModeInited=true;
if(AjxEnv.isIE){
doc.open();
doc.write(this._pendingContent||"");
doc.close();
}
this._registerEditorEventHandlers(document.getElementById(this._iFrameId),doc);
};
DwtHtmlEditor.prototype._focus=function(){
this.focus();
};
DwtHtmlEditor.prototype._getIframeDoc=function(){
return this._iFrameId?Dwt.getIframeDoc(document.getElementById(this._iFrameId)):null;
};
DwtHtmlEditor.prototype._getIframeWin=function(){
return Dwt.getIframeWindow(document.getElementById(this._iFrameId));
};
DwtHtmlEditor.prototype._getParentElement=function(){
if(AjxEnv.isIE){
var _c50=this._getIframeDoc();
var _c51=_c50.selection;
var _c52=_c51.createRange();
if(_c51.type=="None"||_c51.type=="Text"){
return _c51.createRange().parentElement();
}else{
if(_c51.type=="Control"){
return _c51.createRange().item(0);
}else{
return _c50.body;
}
}
}else{
try{
var _c52=this._getRange();
var p=_c52.commonAncestorContainer;
if(!_c52.collapsed&&_c52.startContainer==_c52.endContainer&&_c52.startOffset-_c52.endOffset<=1&&_c52.startContainer.hasChildNodes()){
p=_c52.startContainer.childNodes[_c52.startOffset];
}
while(p.nodeType==3){
p=p.parentNode;
}
return p;
}
catch(e){
return null;
}
}
};
DwtHtmlEditor.prototype.getNearestElement=function(_c54){
try{
var p=this._getParentElement();
_c54=_c54.toLowerCase();
while(p&&p.nodeName.toLowerCase()!=_c54){
p=p.parentNode;
}
return p;
}
catch(ex){
return null;
}
};
DwtHtmlEditor.prototype.selectNodeContents=function(node,pos,_c58){
var _c59;
var _c5a=(typeof pos=="boolean");
if(AjxEnv.isIE){
_c59=this._getIframeDoc().body.createTextRange();
_c59.moveToElementText(node);
(_c5a)&&_c59.collapse(pos);
_c59.select();
}else{
var sel=this._getSelection();
_c59=this._getIframeDoc().createRange();
if(_c58){
_c59.selectNode(node);
}else{
_c59.selectNodeContents(node);
}
(_c5a)&&_c59.collapse(pos);
sel.removeAllRanges();
sel.addRange(_c59);
}
};
DwtHtmlEditor.prototype._forceRedraw=function(){
var body=this._getIframeDoc().body;
body.style.display="none";
var self=this;
setTimeout(function(){
body.style.display="";
self.focus();
self=null;
},10);
};
DwtHtmlEditor.prototype.getSelectedCells=function(){
var _c5e=null;
var sel=this._getSelection();
var _c60,i=0;
var rows=[];
var row=null;
if(!AjxEnv.isIE){
try{
while(_c60=sel.getRangeAt(i++)){
var td=_c60.startContainer.childNodes[_c60.startOffset];
if(td.parentNode!=row){
row=td.parentNode;
_c5e&&rows.push(_c5e);
_c5e=[];
}
if(td.tagName&&/^td$/i.test(td.tagName)){
_c5e.push(td);
}
}
}
catch(ex){
}
rows.push(_c5e);
}else{
_c60=sel.createRange();
var _c64=_c60.duplicate();
_c60.collapse(true);
while(_c64.compareEndPoints("EndToStart",_c60)>=0){
var td=_c60.parentElement();
while(td&&td.nodeName.toLowerCase()!="td"){
td=td.parentNode;
}
if(td){
if(td.parentNode!=row){
row=td.parentNode;
_c5e&&rows.push(_c5e);
_c5e=[];
}
_c5e.push(td);
_c60.moveToElementText(td);
_c60.collapse(false);
}
if(_c60.move("character",1)==0){
break;
}
}
_c64.select();
rows.push(_c5e);
}
if(rows.length==0||!rows[0]||rows[0].length==0){
_c5e=this.getNearestElement("td");
if(_c5e){
rows=[[_c5e]];
}
}
return rows;
};
DwtHtmlEditor.prototype._splitCells=function(td){
var _c66=td;
while(_c66&&_c66.nodeName.toLowerCase()!="table"){
_c66=_c66.parentNode;
}
var _c67=AjxEnv.isGeckoBased?"<br />":"";
function splitRow(td){
var n=td.rowSpan;
var nc=td.colSpan;
td.rowSpan=1;
tr=td.parentNode;
var itr=tr.rowIndex;
var trs=tr.parentNode.rows;
var _c6d=td.cellIndex;
while(--n>0){
tr=trs[++itr];
var otd=td.cloneNode(false);
otd.removeAttribute("rowspan");
otd.colSpan=td.colSpan;
otd.innerHTML=_c67;
tr.insertBefore(otd,tr.cells[_c6d]);
}
}
function splitCol(td){
var nc=td.colSpan;
td.colSpan=1;
tr=td.parentNode;
var ref=td.nextSibling;
while(--nc>0){
var otd=td.cloneNode(false);
otd.removeAttribute("colspan");
otd.rowSpan=td.rowSpan;
otd.innerHTML=_c67;
tr.insertBefore(otd,ref);
}
}
function splitCell(td){
var nc=td.colSpan;
splitCol(td);
var _c75=td.parentNode.cells;
var _c76=td.cellIndex;
while(nc-->0){
splitRow(_c75[_c76++]);
}
}
splitCell(td);
};
DwtHtmlEditor.prototype.doTableOperation=function(cmd,_c78){
var _c79=_c78.table||this.getNearestElement("table");
var td=_c78.td||this.getNearestElement("td");
var _c7b,rowIndex,tr;
if(td){
_c7b=td.cellIndex;
tr=td.parentNode;
rowIndex=tr.rowIndex;
}else{
_c7b=0;
tr=this.getNearestElement("tr");
if(tr){
rowIndex=tr.rowIndex;
}
}
var _c7c=_c78.cells;
while(true){
switch(cmd){
case "insertRowAbove":
DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(td));
break;
case "insertRowUnder":
DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(td,true));
break;
case "insertColumnBefore":
DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(td));
break;
case "insertColumnAfter":
DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(td,true));
break;
case "deleteRow":
for(var i=0;i<_c7c.length;++i){
var td=DwtHtmlEditor.table_deleteRow(_c7c[i][0]);
if(td){
this.selectNodeContents(td,true);
this.focus();
}
}
break;
case "deleteColumn":
for(var i=0;i<_c7c[0].length;++i){
var td=DwtHtmlEditor.table_deleteCol(_c7c[0][i]);
if(td){
this.selectNodeContents(td,true);
this.focus();
}
}
break;
case "mergeCells":
td=_c7c[0][0];
var html=[td.innerHTML.replace(/<br>$/i,"")];
for(var i=0;i<_c7c.length;++i){
var row=_c7c[i];
for(var j=0;j<row.length;++j){
if(i||j){
html.push(row[j].innerHTML.replace(/<br>$/i,""));
row[j].parentNode.removeChild(row[j]);
}
}
}
td.colSpan=_c7c[0].length;
td.rowSpan=_c7c.length;
html=html.join(" ");
if(AjxEnv.isGeckoBased){
html+="<br/>";
}
td.innerHTML=html;
this.selectNodeContents(td,true);
break;
case "splitCells":
this._splitCells(td);
break;
case "deleteTable":
if(!AjxEnv.isIE){
this.selectNodeContents(_c79,null,true);
this.deleteSelectedNodes();
}else{
_c79.parentNode.removeChild(_c79);
}
break;
}
break;
}
if(AjxEnv.isGeckoBased){
this._forceRedraw();
}
this._updateState();
};
DwtHtmlEditor.prototype._getRange=function(){
var _c81=this._getIframeDoc();
if(AjxEnv.isIE){
return _c81.selection;
}else{
this.focus();
var _c82=this._getIframeWin().getSelection();
if(_c82!=null){
try{
return _c82.getRangeAt(0);
}
catch(e){
return _c81.createRange();
}
}else{
return _c81.createRange();
}
}
};
DwtHtmlEditor.prototype.deleteSelectedNodes=function(){
var sel=this._getSelection();
if(AjxEnv.isGeckoBased){
sel.deleteFromDocument();
}else{
sel.clear();
}
};
DwtHtmlEditor.prototype._getSelection=function(){
if(AjxEnv.isIE){
return this._getIframeDoc().selection;
}else{
return this._getIframeWin().getSelection();
}
};
DwtHtmlEditor.prototype.__eventClosure=function(ev){
return this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:ev);
};
DwtHtmlEditor.prototype._registerEditorEventHandlers=function(_c85,_c86){
var _c87=["mouseup","keydown","keypress","drag","mousedown","contextmenu"];
for(var i=0;i<_c87.length;++i){
if(AjxEnv.isIE){
_c86.attachEvent("on"+_c87[i],this.__eventClosure);
}else{
_c86.addEventListener(_c87[i],this.__eventClosure,true);
}
}
};
DwtHtmlEditor.prototype._handleEditorEvent=function(ev){
var _c8a=true;
if(ev.type=="mousedown"){
DwtMenu._outsideMouseDownListener(ev);
}
if(ev.type=="contextmenu"){
var _c8b=DwtShell.mouseEvent;
_c8b.setFromDhtmlEvent(ev);
var pos=Dwt.getLocation(document.getElementById(this._iFrameId));
if(!AjxEnv.isIE){
var doc=this._getIframeDoc();
var sl=doc.documentElement.scrollLeft||doc.body.scrollLeft;
var st=doc.documentElement.scrollTop||doc.body.scrollTop;
pos.x-=sl;
pos.y-=st;
}
_c8b.docX+=pos.x;
_c8b.docY+=pos.y;
DwtControl.__mouseEvent(ev,DwtEvent.ONCONTEXTMENU,this,_c8b);
_c8a=_c8b._returnValue;
}
var cmd=null;
if(DwtKeyEvent.isKeyPressEvent(ev)){
var ke=this._keyEvent;
ke.setFromDhtmlEvent(ev);
if(ke.ctrlKey){
var key=String.fromCharCode(ke.charCode).toLowerCase();
var _c93=null;
switch(key){
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
cmd=DwtHtmlEditor._FORMAT_BLOCK;
_c93=DwtHtmlEditor._KEY2CMDS[key];
break;
case "0":
try{
this.setMode((this._mode==DwtHtmlEditor.HTML)?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML,true);
}
catch(e){
}
ke._stopPropagation=true;
ke._returnValue=false;
ke.setToDhtmlEvent(ev);
_c8a=false;
break;
default:
cmd=DwtHtmlEditor._KEY2CMDS[key];
break;
}
}
}
if(cmd){
this._execCommand(cmd,_c93);
ke._stopPropagation=true;
ke._returnValue=false;
ke.setToDhtmlEvent(ev);
_c8a=false;
}else{
if(ev.type=="keydown"){
_c8a=DwtKeyboardMgr.__keyDownHdlr(ev);
}
}
if(AjxEnv.isIE){
var _c94=this._getIframeDoc();
this._currInsPt=_c94.selection.createRange();
if(_c94.selection.type=="None"){
this._currInsPt.collapse(false);
}
}
if(this._stateUpdateActionId!=null){
AjxTimedAction.cancelAction(this._stateUpdateActionId);
}
this._stateUpdateActionId=AjxTimedAction.scheduleAction(this._updateStateAction,100);
return _c8a;
};
DwtHtmlEditor.prototype._updateState=function(){
if(this._mode!=DwtHtmlEditor.HTML){
return;
}
this._stateUpdateActionId=null;
var ev=this._stateEvent;
ev.reset();
var _c96=this._getIframeDoc();
try{
ev.isBold=_c96.queryCommandState(DwtHtmlEditor.BOLD_STYLE);
ev.isItalic=_c96.queryCommandState(DwtHtmlEditor.ITALIC_STYLE);
ev.isUnderline=_c96.queryCommandState(DwtHtmlEditor.UNDERLINE_STYLE);
ev.isStrikeThru=_c96.queryCommandState(DwtHtmlEditor.STRIKETHRU_STYLE);
ev.isSuperscript=_c96.queryCommandState(DwtHtmlEditor.SUPERSCRIPT_STYLE);
ev.isSubscript=_c96.queryCommandState(DwtHtmlEditor.SUBSCRIPT_STYLE);
ev.isOrderedList=_c96.queryCommandState(DwtHtmlEditor.ORDERED_LIST);
ev.isUnorderedList=_c96.queryCommandState(DwtHtmlEditor.UNORDERED_LIST);
var _c97=_c96.queryCommandValue(DwtHtmlEditor._FONT_NAME);
if(_c97){
_c97=_c97.toLowerCase();
if(_c97.search(DwtHtmlEditor._VERDANA_RE)!=-1){
ev.fontFamily=3;
}else{
if(_c97.search(DwtHtmlEditor._ARIAL_RE)!=-1){
ev.fontFamily=0;
}else{
if(_c97.search(DwtHtmlEditor._TIMES_RE)!=-1){
ev.fontFamily=1;
}else{
if(_c97.search(DwtHtmlEditor._COURIER_RE)!=-1){
ev.fontFamily=2;
}else{
ev.fontFamily=null;
}
}
}
}
}else{
ev.fontFamily=null;
}
ev.fontSize=_c96.queryCommandValue(DwtHtmlEditor._FONT_SIZE);
ev.backgroundColor=_c96.queryCommandValue((AjxEnv.isIE)?"backcolor":"hilitecolor");
ev.color=_c96.queryCommandValue("forecolor");
if(AjxEnv.isIE){
ev.backgroundColor="#"+DwtButtonColorPicker.toHex(ev.backgroundColor,6).replace(/(..)(..)(..)/,"$3$2$1");
ev.color="#"+DwtButtonColorPicker.toHex(ev.color,6).replace(/(..)(..)(..)/,"$3$2$1");
}
ev.justification=null;
ev.direction=null;
var _c98=_c96.queryCommandValue(DwtHtmlEditor._FORMAT_BLOCK);
if(_c98){
if(_c98.search(DwtHtmlEditor._H1_RE)!=-1){
ev.style=DwtHtmlEditor.H1;
}else{
if(_c98.search(DwtHtmlEditor._H2_RE)!=-1){
ev.style=DwtHtmlEditor.H2;
}else{
if(_c98.search(DwtHtmlEditor._H3_RE)!=-1){
ev.style=DwtHtmlEditor.H3;
}else{
if(_c98.search(DwtHtmlEditor._H4_RE)!=-1){
ev.style=DwtHtmlEditor.H4;
}else{
if(_c98.search(DwtHtmlEditor._H5_RE)!=-1){
ev.style=DwtHtmlEditor.H5;
}else{
if(_c98.search(DwtHtmlEditor._H6_RE)!=-1){
ev.style=DwtHtmlEditor.H6;
}else{
if(_c98.search(DwtHtmlEditor._PARAGRAPH_RE)!=-1){
ev.style=DwtHtmlEditor.PARAGRAPH;
}else{
if(_c98.search(DwtHtmlEditor._ADDRESS_RE)!=-1){
ev.style=DwtHtmlEditor.ADDRESS;
}else{
if(_c98.search(DwtHtmlEditor._PREFORMATTED_RE)!=-1){
ev.style=DwtHtmlEditor.PREFORMATTED;
}
}
}
}
}
}
}
}
}
}
if(_c96.queryCommandState(DwtHtmlEditor.JUSTIFY_LEFT)){
ev.justification=DwtHtmlEditor.JUSTIFY_LEFT;
}else{
if(_c96.queryCommandState(DwtHtmlEditor.JUSTIFY_CENTER)){
ev.justification=DwtHtmlEditor.JUSTIFY_CENTER;
}else{
if(_c96.queryCommandState(DwtHtmlEditor.JUSTIFY_RIGHT)){
ev.justification=DwtHtmlEditor.JUSTIFY_RIGHT;
}else{
if(_c96.queryCommandState(DwtHtmlEditor.JUSTIFY_FULL)){
ev.justification=DwtHtmlEditor.JUSTIFY_FULL;
}
}
}
}
if(this.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this.notifyListeners(DwtEvent.STATE_CHANGE,ev);
}
}
catch(ex){
if(AjxEnv.isGeckoBased){
this._enableDesignMode(_c96);
}
}
};
DwtHtmlEditor.prototype._enableDesignMode=function(_c99){
if(!_c99){
return;
}
try{
_c99.designMode="on";
if(AjxEnv.isGeckoBased&&(AjxEnv.isLinux||AjxEnv.isMac)){
this._registerEditorEventHandlers(document.getElementById(this._iFrameId),_c99);
}
}
catch(ex){
if(AjxEnv.isGeckoBased){
var ta=new AjxTimedAction(this,this._enableDesignMode,[_c99]);
AjxTimedAction.scheduleAction(ta,10);
return true;
}else{
return false;
}
}
};
DwtHtmlEditor.prototype._onContentInitialized=function(){
};
DwtHtmlEditor.prototype._setContentOnTimer=function(){
var _c9b=this._getIframeDoc();
try{
_c9b.body.innerHTML=this._pendingContent;
if(AjxEnv.isGeckoBased){
this._enableDesignMode(_c9b);
}
this._onContentInitialized();
}
catch(ex){
var ta=new AjxTimedAction(this,this._setContentOnTimer);
AjxTimedAction.scheduleAction(ta,10);
return true;
}
};
DwtHtmlEditor.prototype._execCommand=function(_c9d,_c9e){
if(this._mode!=DwtHtmlEditor.HTML){
return;
}
try{
this.focus();
this._getIframeDoc().execCommand(_c9d,false,_c9e);
}
catch(e){
this._enableDesignMode(this._getIframeDoc());
}
this._updateState();
};
DwtHtmlEditor.prototype._convertHtml2Text=function(){
var _c9f=this._getIframeDoc();
return _c9f&&_c9f.body?AjxStringUtil.convertHtml2Text(_c9f.body):"";
};
DwtHtmlEditor.table_analyzeCells=function(_ca0){
var _ca1=_ca0.parentNode.parentNode;
while(_ca1&&!/table/i.test(_ca1.tagName)){
_ca1=_ca1.parentNode;
}
var _ca2={};
var rows=_ca1.rows;
for(var i=0;i<rows.length;++i){
var _ca5=rows[i].cells;
var _ca6=0;
for(var j=0;j<_ca5.length;){
var td=_ca5[j];
var cs=td.colSpan||1;
var rs=(td.rowSpan||1)-1;
var tmp=_ca2[_ca6];
if(tmp){
if(--tmp.rs==0){
_ca2[_ca6]=null;
}
_ca6+=tmp.cs;
}
td.ZmIndex=_ca6;
if(++j<_ca5.length){
if(rs){
_ca2[_ca6]={cs:cs,rs:rs};
}
_ca6+=cs;
}
}
}
return _ca1;
};
DwtHtmlEditor.table_getCellAt=function(tr,_cad){
var _cae=tr.cells;
var last=null,next=null;
for(var i=0;i<_cae.length;++i){
var td=_cae[i];
var cs=(td.colSpan||1)-1;
if(td.ZmIndex<=_cad&&td.ZmIndex+cs>=_cad){
var rs=(td.rowSpan||1)-1;
return {td:td,cs:cs,rs:rs};
}else{
if(td.ZmIndex<_cad){
last=td;
}else{
if(td.ZmIndex+cs>_cad&&!next){
next=td;
}
}
}
}
return {last:last,next:next};
};
DwtHtmlEditor.table_getPrevCellAt=function(tr,_cb5){
var _cb6=tr.parentNode;
while(_cb6&&!/table/i.test(_cb6.tagName)){
_cb6=_cb6.parentNode;
}
var rows=_cb6.rows;
for(var i=tr.rowIndex;--i>=0;){
var info=DwtHtmlEditor.table_getCellAt(rows[i],_cb5);
if(info.td){
info.dist=tr.rowIndex-i;
return info;
}
}
return null;
};
DwtHtmlEditor.table_fixCells=function(_cba){
for(var i=0;i<_cba.length;++i){
var td=_cba[i];
if(AjxEnv.isIE){
td.innerHTML="&nbsp;";
}else{
if(AjxEnv.isGeckoBased){
td.innerHTML="<br/>";
}
}
}
};
DwtHtmlEditor.table_insertCol=function(td,_cbe){
var _cbf=DwtHtmlEditor.table_analyzeCells(td);
var rows=_cbf.rows;
var _cc1=td.ZmIndex;
if(_cbe){
_cc1+=td.colSpan-1;
}
var _cc2=[];
var rs=0;
for(var i=0;i<rows.length;++i){
var tr=rows[i];
var info=DwtHtmlEditor.table_getCellAt(tr,_cc1);
var cc=info.td;
var _cc8=null;
if(cc){
if(cc.ZmIndex==_cc1&&!_cbe){
_cc8=tr.insertCell(cc.cellIndex);
}else{
if(cc.ZmIndex+info.cs==_cc1&&_cbe){
_cc8=tr.insertCell(cc.cellIndex+1);
}
}
if(_cc8){
rs=info.rs;
}else{
cc.colSpan=info.cs+2;
}
}else{
if(rs>0){
if(info.last){
_cc8=tr.insertCell(info.last.cellIndex+1);
}else{
if(info.next){
_cc8=tr.insertCell(info.next.cellIndex);
}
}
--rs;
}
}
if(_cc8){
_cc2.push(_cc8);
}
}
return _cc2;
};
DwtHtmlEditor.table_insertRow=function(td,_cca){
var tr=td.parentNode;
var _ccc=DwtHtmlEditor.table_analyzeCells(td);
var _ccd=tr.rowIndex;
if(_cca){
_ccd+=td.rowSpan;
tr=_ccc.rows[_ccd-1];
}
td=_ccc.rows[0].cells[_ccc.rows[0].cells.length-1];
var max=td.ZmIndex+td.colSpan;
var _ccf=_ccc.insertRow(_ccd);
var _cd0=[];
var _cd1=tr.cells;
var _cd2;
for(var i=0;i<max;++i){
var info=DwtHtmlEditor.table_getCellAt(tr,i);
if(info.td){
if(!_cca||!info.rs){
for(var j=0;j<=info.cs;++j){
_cd0.push(_ccf.insertCell(-1));
}
}else{
if(info.rs){
info.td.rowSpan=info.rs+2;
}
}
}else{
info=DwtHtmlEditor.table_getPrevCellAt(tr,i);
if(_cca&&info.rs==info.dist){
for(var j=0;j<=info.cs;++j){
_cd0.push(_ccf.insertCell(-1));
}
}else{
info.td.rowSpan=info.rs+2;
}
}
i+=info.cs;
}
return _cd0;
};
DwtHtmlEditor.table_deleteCol=function(td){
var _cd7=DwtHtmlEditor.table_analyzeCells(td);
var rows=_cd7.rows;
var _cd9=td.ZmIndex;
var tr=td.parentNode;
var _cdb;
try{
_cdb=tr.cells[td.cellIndex+1];
if(!_cdb){
_cdb=tr.cells[td.cellIndex-1];
}
}
catch(ex){
_cdb=null;
}
for(var i=0;i<rows.length;++i){
var tr=rows[i];
var info=DwtHtmlEditor.table_getCellAt(tr,_cd9);
if(info.td){
if(info.cs){
info.td.colSpan=info.cs;
}else{
tr.removeChild(info.td);
if(tr.cells.length==0){
tr.parentNode.removeChild(tr);
}
}
i+=info.rs;
}
}
if(_cd7.rows.length==0){
_cd7.parentNode.removeChild(_cd7);
}
return _cdb;
};
DwtHtmlEditor.table_deleteRow=function(td){
var tr=td.parentNode;
var _ce0=DwtHtmlEditor.table_analyzeCells(td);
td=_ce0.rows[0].cells[_ce0.rows[0].cells.length-1];
var max=td.ZmIndex+td.colSpan;
var _ce2;
for(var i=max;--i>=0;){
var info=DwtHtmlEditor.table_getCellAt(tr,i);
if(info.td){
if(info.rs){
_ce2=_ce0.rows[tr.rowIndex+1];
var tmp=DwtHtmlEditor.table_getCellAt(_ce2,i);
td=null;
if(tmp.last){
td=_ce2.insertCell(tmp.last.cellIndex+1);
}else{
if(tmp.next){
td=_ce2.insertCell(tmp.next.cellIndex);
}
}
if(td){
if(info.cs>0){
td.colSpan=info.cs+1;
}
if(info.rs>1){
td.rowSpan=info.rs;
}
}
}
tr.removeChild(info.td);
}else{
info=DwtHtmlEditor.table_getPrevCellAt(tr,i);
if(info){
if(info.rs){
info.td.rowSpan=info.rs;
i-=info.cs;
}
}
}
}
try{
_ce2=_ce0.rows[tr.rowIndex+1];
if(!_ce2){
_ce2=_ce0.rows[tr.rowIndex-1];
}
}
catch(ex){
_ce2=null;
}
tr.parentNode.removeChild(tr);
if(_ce0.rows.length==0){
_ce0.parentNode.removeChild(_ce0);
}
if(_ce2){
return _ce2.cells[0];
}
};
function DwtInputField(_ce6){
if(arguments.length==0){
return;
}
this._origClassName=_ce6.className?_ce6.className:"DwtInputField";
this._errorClassName=this._origClassName+"-Error";
this._hintClassName=this._origClassName+"-hint";
this._disabledClassName=this._origClassName+"-disabled";
this._errorHintClassName=this._origClassName+"-errorhint";
DwtControl.call(this,_ce6.parent,_ce6.className,_ce6.posStyle);
this._inputEventHandlers={};
this._type=_ce6.type?_ce6.type:DwtInputField.STRING;
this._rows=_ce6.rows?_ce6.rows:1;
this._size=_ce6.size;
this._errorIconStyle=_ce6.errorIconStyle?_ce6.errorIconStyle:_ce6.validator?DwtInputField.ERROR_ICON_RIGHT:DwtInputField.ERROR_ICON_NONE;
this._validationStyle=_ce6.validationStyle?_ce6.validationStyle:DwtInputField.ONEXIT_VALIDATION;
this._hasError=false;
this._hintIsVisible=false;
this._hint=_ce6.hint;
var _ce7=Dwt.getNextId();
var _ce8=Dwt.getNextId();
var _ce9=this.getHtmlElement();
var _cea=_ce6.skipCaretHack;
var _ceb=_cea?"":Dwt.CARET_HACK_BEGIN;
var _cec=_cea?"":Dwt.CARET_HACK_END;
if(this._errorIconStyle==DwtInputField.ERROR_ICON_NONE){
if(_ce6.rows&&_ce6.rows>1){
var _ced=[_ceb,"<textarea id='",_ce7,"' rows=",_ce6.rows];
var i=_ced.length;
if(_ce6.size){
_ced[i++]=" cols=";
_ced[i++]=_ce6.size;
}
_ced[i++]="></textarea>";
_ced[i++]=_cec;
_ce9.innerHTML=_ced.join("");
}else{
_ce9.innerHTML=[_ceb,"<input id='",_ce7,"'>",_cec].join("");
}
}else{
var _ced=["<table cellspacing='0' cellpadding='0'><tr>"];
var i=1;
if(this._errorIconStyle==DwtInputField.ERROR_ICON_LEFT){
_ced[i++]=["<td style='padding-right:2px;'id='",_ce8,"'></td>"].join("");
}
_ced[i++]=["<td>",_ceb,"<input id='",_ce7,"'>",_cec,"</td>"].join("");
if(this._errorIconStyle==DwtInputField.ERROR_ICON_RIGHT){
_ced[i++]=["<td style='padding-left:2px;' id='",_ce8,"'></td>"].join("");
}
_ced[i++]="</tr></table>";
_ce9.innerHTML=_ced.join("");
if(this._errorIconStyle!=DwtInputField.ERROR_ICON_NONE){
this._errorIconTd=document.getElementById(_ce8);
this._errorIconTd.vAlign="middle";
this._errorIconTd.innerHTML=DwtInputField._NOERROR_ICON_HTML;
}
}
if(this._rows>1){
this._inputField=document.getElementById(_ce7);
Dwt.associateElementWithObject(this._inputField,this);
this._inputField.onkeyup=DwtInputField._keyUpHdlr;
this._inputField.onblur=DwtInputField._blurHdlr;
this._inputField.onfocus=DwtInputField._focusHdlr;
if(_ce6.size){
this._inputField.size=_ce6.size;
}
if(_ce6.maxLen){
this._inputField.maxLength=this._maxLen=_ce6.maxLen;
}
this._inputField.value=_ce6.initialValue||"";
}else{
var _cef=document.getElementById(_ce7);
var _cf0=this.__createInputEl(_ce6);
_cef.parentNode.replaceChild(_cf0,_cef);
}
this.setValidatorFunction(_ce6.validatorCtxtObj,_ce6.validator);
this._setMouseEventHdlrs(false);
this._setKeyPressEventHdlr(false);
if(_ce6.required!=null){
this.setRequired(_ce6.required);
}
}
DwtInputField.prototype=new DwtControl;
DwtInputField.prototype.constructor=DwtInputField;
DwtInputField.ERROR_ICON_LEFT=1;
DwtInputField.ERROR_ICON_RIGHT=2;
DwtInputField.ERROR_ICON_NONE=3;
DwtInputField.CONTINUAL_VALIDATION=1;
DwtInputField.ONEXIT_VALIDATION=2;
DwtInputField.MANUAL_VALIDATION=3;
DwtInputField.NUMBER=1;
DwtInputField.INTEGER=2;
DwtInputField.FLOAT=3;
DwtInputField.STRING=4;
DwtInputField.PASSWORD=5;
DwtInputField.DATE=6;
DwtInputField._ERROR_ICON_HTML=AjxImg.getImageHtml("ClearSearch");
DwtInputField._NOERROR_ICON_HTML=AjxImg.getImageHtml("Blank_9");
DwtInputField.prototype.toString=function(){
return "DwtInputField";
};
DwtInputField.prototype.setHandler=function(_cf1,_cf2){
if(!this._checkState()){
return;
}
this._inputEventHandlers[_cf1]=_cf2;
Dwt.setHandler(this.getInputElement(),_cf1,_cf2);
};
DwtInputField.prototype.setInputType=function(type){
if(type!=this._type&&this._rows==1){
this._type=type;
if(AjxEnv.isIE){
var _cf4=this._inputField;
var _cf5=this.__createInputEl();
_cf4.parentNode.replaceChild(_cf5,_cf4);
}else{
this._inputField.type=this._type!=DwtInputField.PASSWORD?"text":"password";
}
}
};
DwtInputField.prototype.__createInputEl=function(_cf6){
var _cf7=this._inputField;
if(_cf7){
for(var _cf8 in this._inputEventHandlers){
_cf7.removeAttribute(_cf8);
}
Dwt.disassociateElementFromObject(_cf7,this);
}
var type=this._type!=DwtInputField.PASSWORD?"text":"password";
var _cfa=document.createElement(AjxEnv.isIE?["<INPUT type='",type,"'>"].join(""):"INPUT");
if(!AjxEnv.isIE){
_cfa.type=type;
}
this._inputField=_cfa;
var size=_cf6?_cf6.size:_cf7.size;
var _cfc=_cf6?_cf6.maxLen:_cf7.maxLength;
_cfa.autocomplete="off";
if(size){
_cfa.size=size;
}
if(_cfc){
_cfa.maxLength=_cfc;
}
_cfa.value=(_cf6?_cf6.initialValue:_cf7.value)||"";
_cfa.readonly=_cf7?_cf7.readonly:false;
Dwt.associateElementWithObject(_cfa,this);
_cfa.onkeyup=DwtInputField._keyUpHdlr;
_cfa.onblur=DwtInputField._blurHdlr;
_cfa.onfocus=DwtInputField._focusHdlr;
for(var _cf8 in this._inputEventHandlers){
_cfa[_cf8]=this._inputEventHandlers[_cf8];
}
return _cfa;
};
DwtInputField.prototype.setValidatorFunction=function(obj,_cfe){
if(_cfe){
this._validator=_cfe;
this._validatorObj=obj;
}else{
switch(this._type){
case DwtInputField.NUMBER:
this._validator=DwtInputField.validateNumber;
break;
case DwtInputField.INTEGER:
this._validator=DwtInputField.validateInteger;
break;
case DwtInputField.FLOAT:
this._validator=DwtInputField.validateFloat;
break;
case DwtInputField.STRING:
case DwtInputField.PASSWORD:
this._validator=DwtInputField.validateString;
break;
case DwtInputField.DATE:
this._validator=DwtInputField.validateDate;
break;
default:
this._validator=DwtInputField.validateAny;
}
}
};
DwtInputField.prototype.setValidatorRegExp=function(_cff,_d00){
this._validator=_cff;
this._validatorObj=null;
this._errorString=_d00||"";
};
DwtInputField.prototype.setValidationCallback=function(_d01){
this._validationCallback=_d01;
};
DwtInputField.prototype.getInputElement=function(){
return this._inputField;
};
DwtInputField.prototype.getValue=function(){
return this._hintIsVisible?"":this._inputField.value;
};
DwtInputField.prototype.setValue=function(_d02,_d03){
this._inputField.value=_d02;
if(!_d03){
_d02=this._validateInput(_d02);
if(_d02!=null){
this._inputField.value=_d02;
}
}
if(this._hintIsVisible&&_d02){
this._hideHint(_d02);
}else{
if(!_d02){
this._showHint();
}
}
};
DwtInputField.prototype.setHint=function(hint){
var _d05=this._hint;
this._hint=hint;
if(this._hintIsVisible){
this.getInputElement().value=hint;
if(!hint){
this._hintIsVisible=false;
this._updateClassName();
}
}else{
this._showHint();
}
};
DwtInputField.prototype.setValidNumberRange=function(min,max){
this._minNumVal=min;
this._maxNumVal=max;
var _d08=this._validateInput(this.getValue());
if(_d08!=null){
this.setValue(_d08);
}
};
DwtInputField.prototype.setValidStringLengths=function(_d09,_d0a){
this._minLen=_d09||0;
if(_d0a!=null){
this._inputField.maxLength=_d0a;
this._maxLen=_d0a;
}
};
DwtInputField.prototype.setNumberPrecision=function(_d0b){
this._decimals=_d0b;
};
DwtInputField.prototype.setReadOnly=function(_d0c){
this._inputField.setAttribute("readonly",(_d0c==null?true:_d0c));
};
DwtInputField.prototype.setRequired=function(_d0d){
var _d0e=_d0d==null?true:_d0d;
if(this._required!=_d0e){
this._required=_d0e;
this.validate();
}
};
DwtInputField.prototype.getEnabled=function(){
return !this.getInputElement().disabled;
};
DwtInputField.prototype.setEnabled=function(_d0f){
DwtControl.prototype.setEnabled.call(this,_d0f);
this.getInputElement().disabled=!_d0f;
this._validateInput(this.getValue());
};
DwtInputField.prototype.focus=function(){
if(this.getEnabled()){
this._hasFocus=true;
this.getInputElement().focus();
}
};
DwtInputField.prototype.blur=function(){
this.getInputElement().blur();
};
DwtInputField.prototype.setVisible=function(_d10){
Dwt.setVisible(this.getInputElement(),_d10);
};
DwtInputField.prototype.isValid=function(){
if(!this.getEnabled()){
return this.getValue();
}
try{
if(typeof this._validator=="function"){
return this._validatorObj?this._validator.call(this._validatorObj,this.getValue(),this):this._validator(this.getValue());
}else{
return this._validator.test(this._inputField.value);
}
}
catch(ex){
if(typeof ex=="string"){
return null;
}else{
throw ex;
}
}
};
DwtInputField.prototype.validate=function(){
var _d11=this._validateInput(this.getValue());
if(_d11!=null){
this.setValue(_d11);
return true;
}else{
return false;
}
};
DwtInputField.validateNumber=function(_d12){
var n=new Number(_d12);
if(isNaN(n)||(Math.round(n)!=n)){
throw AjxMsg.notAnInteger;
}
return DwtInputField.validateFloat.call(this,_d12);
};
DwtInputField.validateInteger=function(_d14){
var n=new Number(_d14);
if(isNaN(n)||(Math.round(n)!=n)||(n.toString()!=_d14)){
throw AjxMsg.notAnInteger;
}
if(this._minNumVal&&_d14<this._minNumVal){
throw AjxMessageFormat.format(AjxMsg.numberLessThanMin,this._minNumVal);
}
if(this._maxNumVal&&_d14>this._maxNumVal){
throw AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this._maxNumVal);
}
return _d14;
};
DwtInputField.validateFloat=function(_d16){
if(this._required&&_d16==""){
throw AjxMsg.valueIsRequired;
}
var n=new Number(_d16);
if(isNaN(n)){
throw AjxMsg.notANumber;
}
if(this._minNumVal&&_d16<this._minNumVal){
throw AjxMessageFormat.format(AjxMsg.numberLessThanMin,this._minNumVal);
}
if(this._maxNumVal&&_d16>this._maxNumVal){
throw AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this._maxNumVal);
}
if(this._decimals!=null){
var str=n.toString();
var pos=str.indexOf(".");
if(pos==-1){
pos=str.length;
}
_d16=n.toPrecision(pos+this._decimals);
}else{
_d16=n.toString();
}
return _d16;
};
DwtInputField.validateString=function(_d1a){
if(this._required&&_d1a==""){
throw AjxMsg.valueIsRequired;
}
if(this._minLen!=null&&_d1a.length<this._minLen){
throw AjxMessageFormat.format(AjxMsg.stringTooShort,this._minLen);
}
if(this._maxLen!=null&&_d1a.length>this._maxLen){
throw AjxMessageFormat.format(AjxMsg.stringTooLong,this._maxLen);
}
return _d1a;
};
DwtInputField.validateDate=function(_d1b){
if(this._required&&_d1b==""){
throw AjxMsg.valueIsRequired;
}
if(AjxDateUtil.simpleParseDateStr(_d1b)==null){
throw AjxMsg.invalidDatetimeString;
}
return _d1b;
};
DwtInputField.validateAny=function(_d1c){
if(this._required&&_d1c==""){
throw AjxMsg.valueIsRequired;
}
return _d1c;
};
DwtInputField.prototype._validateRegExp=function(_d1d){
if(this._required&&_d1d==""){
throw AjxMsg.valueIsRequired;
}
if(this._regExp&&!this._regExp.test(_d1d)){
throw this._errorString;
}
return _d1d;
};
DwtInputField._keyUpHdlr=function(ev){
var _d1f=DwtShell.keyEvent;
_d1f.setFromDhtmlEvent(ev);
var obj=_d1f.dwtObj;
var _d21=_d1f.keyCode;
var obj=_d1f.dwtObj;
if(obj.notifyListeners(DwtEvent.ONKEYUP,_d1f)){
return true;
}
var val=null;
if((_d21==13||_d21==9)&&obj._validationStyle==DwtInputField.ONEXIT_VALIDATION){
val=obj._validateInput(obj.getValue());
}else{
if(obj._validationStyle==DwtInputField.CONTINUAL_VALIDATION){
val=obj._validateInput(obj.getValue());
}
}
if(val!=null&&val!=obj.getValue()){
obj.setValue(val);
}
return true;
};
DwtInputField._blurHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
if(obj){
obj._hasFocus=false;
if(obj._validationStyle==DwtInputField.ONEXIT_VALIDATION){
var val=obj._validateInput(obj.getValue());
if(val!=null){
obj.setValue(val);
}
}
if(!obj._hintIsVisible&&obj._hint){
obj._showHint();
}
}
};
DwtInputField._focusHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
if(obj){
if(obj._hintIsVisible){
obj._hideHint("");
}
}
};
DwtInputField.prototype._hideHint=function(_d28){
this.getInputElement().value=_d28;
this._hintIsVisible=false;
this._updateClassName();
};
DwtInputField.prototype._showHint=function(){
if(this._hint){
var _d29=this.getInputElement();
if(!_d29.value){
_d29.value=this._hint;
this._hintIsVisible=true;
this._updateClassName();
}
}
};
DwtInputField.prototype._updateClassName=function(){
var _d2a;
if(!this.getEnabled()){
_d2a=this._disabledClassName;
}else{
if(this._hasError){
if(this._hintIsVisible&&!this._hasFocus){
_d2a=this._errorHintClassName;
}else{
_d2a=this._errorClassName;
}
}else{
if(this._hintIsVisible&&!this._hasFocus){
_d2a=this._hintClassName;
}else{
_d2a=this._origClassName;
}
}
}
this.getHtmlElement().className=_d2a;
};
DwtInputField.prototype._validateInput=function(_d2b){
var _d2c=true;
var _d2d;
var _d2e;
if(!this.getEnabled()){
_d2d=this.getValue();
}else{
try{
if(typeof this._validator=="function"){
_d2d=_d2b=this._validatorObj?this._validator.call(this._validatorObj,_d2b,this):this._validator(_d2b);
}else{
if(!this._validator.test(_d2b)){
_d2e=this._errorString;
}
}
}
catch(ex){
if(typeof ex=="string"){
_d2e=ex;
}else{
throw ex;
}
}
}
if(_d2e){
this._hasError=true;
if(this._errorIconTd){
this._errorIconTd.innerHTML=DwtInputField._ERROR_ICON_HTML;
}
this.setToolTipContent(_d2e);
_d2c=false;
_d2d=null;
}else{
this._hasError=false;
if(this._errorIconTd){
this._errorIconTd.innerHTML=DwtInputField._NOERROR_ICON_HTML;
}
this.setToolTipContent(null);
_d2c=true;
}
this._updateClassName();
if(this._validationCallback){
this._validationCallback.run(this,_d2c,_d2b);
}
return _d2d;
};
DwtInputField.prototype._focusByMouseUpEvent=function(){
if(this.getEnabled()){
this._hasFocus=true;
}
};
DwtInputField.prototype._replaceElementHook=function(oel,nel,_d31,_d32){
nel=this.getInputElement();
DwtControl.prototype._replaceElementHook.call(this,oel,nel,_d31,_d32);
if(oel.id){
nel.id=oel.id;
}
};
function DwtSash(_d33,_d34,_d35,_d36,_d37){
_d35=_d35?_d35:"DwtSash";
_d37=_d37?_d37:DwtControl.ABSOLUTE_STYLE;
DwtControl.call(this,_d33,_d35,_d37);
var _d38=this.getHtmlElement();
var _d39="ajax.dwt.templates.Widgets#";
if(_d34==null||_d34!=DwtSash.HORIZONTAL_STYLE){
this._style=DwtSash.VERTICAL_STYLE;
_d38.style.cursor=AjxEnv.isIE?"row-resize":"s-resize";
_d38.innerHTML=AjxTemplate.expand(_d39+"DwtVerticalSash");
}else{
this._style=DwtSash.HORIZONTAL_STYLE;
_d38.style.cursor=AjxEnv.isIE?"col-resize":"w-resize";
_d38.innerHTML=AjxTemplate.expand(_d39+"DwtHorizontalSash");
}
this._threshold=(_d36>0)?_d36:1;
this._captureObj=new DwtMouseEventCapture(this,"DwtSash",DwtSash._mouseOverHdlr,DwtSash._mouseDownHdlr,DwtSash._mouseMoveHdlr,DwtSash._mouseUpHdlr,DwtSash._mouseOutHdlr);
this.setHandler(DwtEvent.ONMOUSEDOWN,DwtSash._mouseDownHdlr);
this.setHandler(DwtEvent.ONMOUSEOVER,DwtSash._mouseOverHdlr);
this.setHandler(DwtEvent.ONMOUSEOUT,DwtSash._mouseOutHdlr);
this.setZIndex(Dwt.Z_VIEW);
}
DwtSash.prototype=new DwtControl;
DwtSash.prototype.constructor=DwtSash;
DwtSash.prototype.toString=function(){
return "DwtSash";
};
DwtSash.HORIZONTAL_STYLE=1;
DwtSash.VERTICAL_STYLE=2;
DwtSash.prototype.registerCallback=function(_d3a,_d3b){
this._callbackFunc=_d3a;
this._callbackObj=_d3b;
};
DwtSash._mouseOverHdlr=function(ev){
var _d3d=DwtShell.mouseEvent;
_d3d.setFromDhtmlEvent(ev);
_d3d._stopPropagation=true;
_d3d._returnValue=false;
_d3d.setToDhtmlEvent(ev);
return false;
};
DwtSash._mouseDownHdlr=function(ev){
var _d3f=DwtShell.mouseEvent;
_d3f.setFromDhtmlEvent(ev);
if(_d3f.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(ev,true,false);
return false;
}
var sash=_d3f.dwtObj;
if(sash._callbackFunc!=null){
sash._captureObj.capture();
sash._startCoord=(sash._style==DwtSash.HORIZONTAL_STYLE)?_d3f.docX:_d3f.docY;
}
_d3f._stopPropagation=true;
_d3f._returnValue=false;
_d3f.setToDhtmlEvent(ev);
return false;
};
DwtSash._mouseMoveHdlr=function(ev){
var _d42=DwtShell.mouseEvent;
_d42.setFromDhtmlEvent(ev);
var _d43=0;
var sash=DwtMouseEventCapture.getTargetObj();
if(sash._style==DwtSash.HORIZONTAL_STYLE){
if(_d42.docX>0&&_d42.docX!=sash._startCoord){
_d43=_d42.docX-sash._startCoord;
}
}else{
if(_d42.docY>0&&_d42.docY!=sash._startCoord){
_d43=_d42.docY-sash._startCoord;
}
}
if(Math.abs(_d43)>=sash._threshold){
if(sash._callbackObj!=null){
_d43=sash._callbackFunc.call(sash._callbackObj,_d43);
}else{
_d43=sash._callbackFunc(_d43);
}
sash._startCoord+=_d43;
if(_d43!=0&&sash.getHtmlElement().style.position==Dwt.ABSOLUTE_STYLE){
if(sash._style==DwtSash.HORIZONTAL_STYLE){
sash.setLocation(sash.getLocation().x+_d43,Dwt.DEFAULT);
}else{
sash.setLocation(Dwt.DEFAULT,sash.getLocation().y+_d43);
}
}
}
_d42._stopPropagation=true;
_d42._returnValue=false;
_d42.setToDhtmlEvent(ev);
return false;
};
DwtSash._mouseUpHdlr=function(ev){
var _d46=DwtShell.mouseEvent;
_d46.setFromDhtmlEvent(ev);
if(_d46.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(ev,true,false);
return false;
}
if(DwtMouseEventCapture.getTargetObj()._callbackFunc!=null){
DwtMouseEventCapture.getCaptureObj().release();
}
_d46._stopPropagation=true;
_d46._returnValue=false;
_d46.setToDhtmlEvent(ev);
return false;
};
DwtSash._mouseOutHdlr=function(ev){
var _d48=DwtShell.mouseEvent;
_d48.setFromDhtmlEvent(ev);
_d48._stopPropagation=true;
_d48._returnValue=false;
_d48.setToDhtmlEvent(ev);
return false;
};
function DwtToolBar(_d49,_d4a,_d4b,_d4c,_d4d,_d4e,_d4f){
if(arguments.length==0){
return;
}
_d4a=_d4a?_d4a:"DwtToolBar";
DwtComposite.call(this,_d49,_d4a,_d4b);
this._style=_d4f||DwtToolBar.HORIZ_STYLE;
this._table=document.createElement("table");
this._table.border=0;
this._table.cellPadding=_d4d||0;
this._table.cellSpacing=_d4c||0;
this._table.width=_d4e||"";
this.getHtmlElement().appendChild(this._table);
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
this._numFillers=0;
this._curFocusIndex=0;
var _d50=(this._style==DwtToolBar.HORIZ_STYLE)?"horiz":"vert";
this._keyMapName=["DwtToolBar",_d50].join("-");
}
DwtToolBar.prototype=new DwtComposite;
DwtToolBar.prototype.constructor=DwtToolBar;
DwtToolBar.HORIZ_STYLE=1;
DwtToolBar.VERT_STYLE=2;
DwtToolBar.ELEMENT=1;
DwtToolBar.SPACER=2;
DwtToolBar.SEPARATOR=3;
DwtToolBar.FILLER=4;
DwtToolBar.DEFAULT_SPACER=10;
DwtToolBar.prototype.toString=function(){
return "DwtToolBar";
};
DwtToolBar.prototype.__itemPaddingRight=AjxEnv.isIE?"4px":"0px";
DwtToolBar.prototype.getItem=function(_d51){
return this._children.get(_d51);
};
DwtToolBar.prototype.getItemCount=function(){
return this._children.size();
};
DwtToolBar.prototype.getItems=function(){
return this._children.toArray();
};
DwtToolBar.prototype.addSpacer=function(size,_d53){
var el=this._createSpacerElement();
var _d55=this._style==DwtToolBar.HORIZ_STYLE?"width":"height";
el.style[_d55]=size?size:DwtToolBar.DEFAULT_SPACER;
this._addItem(DwtToolBar.SPACER,el,_d53);
return el;
};
DwtToolBar.prototype._createSpacerElement=function(){
return document.createElement("div");
};
DwtToolBar.prototype.addSeparator=function(_d56,_d57){
var el=this._createSeparatorElement();
el.className=_d56;
this._addItem(DwtToolBar.SEPARATOR,el,_d57);
return el;
};
DwtToolBar.prototype._createSeparatorElement=DwtToolBar.prototype._createSpacerElement;
DwtToolBar.prototype._createFillerElement=DwtToolBar.prototype._createSpacerElement;
DwtToolBar.prototype.addFiller=function(_d59,_d5a){
var el=this._createFillerElement();
if(_d59){
el.className=_d59;
}
this._addItem(DwtToolBar.FILLER,el,_d5a);
return el;
};
DwtToolBar.prototype.addChild=function(_d5c,_d5d){
this._children.add(_d5c,_d5d);
var _d5e=_d5c._removedEl?_d5c._removedEl:_d5c.getHtmlElement();
this._addItem(DwtToolBar.ELEMENT,_d5e,_d5d);
};
DwtToolBar.prototype._addItem=function(type,_d60,_d61){
var row,col;
if(this._style==DwtToolBar.HORIZ_STYLE){
row=(this._table.rows.length!=0)?this._table.rows[0]:this._table.insertRow(0);
row.align="center";
row.vAlign="middle";
var _d63=_d61||row.cells.length;
col=row.insertCell(_d63);
col.align="center";
col.vAlign="middle";
col.noWrap=true;
col.style.paddingRight=this.__itemPaddingRight;
if(type==DwtToolBar.FILLER){
this._numFillers++;
var perc=Math.floor(100/this._numFillers);
col.style.width=[perc,"%"].join("");
}else{
if(!AjxEnv.isGeckoBased){
col.style.width="1px";
}
}
col.appendChild(_d60);
}else{
var _d65=_d61||-1;
row=this._table.insertRow(_d65);
row.align="center";
row.vAlign="middle";
col=row.insertCell(0);
col.align="center";
col.vAlign="middle";
col.noWrap=true;
if(type==DwtToolBar.FILLER){
this._numFillers++;
var perc=Math.floor(100/this._numFillers);
col.style.height=[perc,"%"].join("");
}
col.appendChild(_d60);
}
};
DwtToolBar.prototype._focus=function(item){
var kbm=this.shell.getKeyboardMgr();
if(kbm.isEnabled()){
var kmm=kbm.__keyMapMgr;
if(this._style==DwtToolBar.HORIZ_STYLE){
kmm.removeMapping("DwtButton","ArrowRight");
kmm.setMapping("DwtButton","ArrowDown",DwtKeyMap.SUBMENU);
}else{
kmm.removeMapping("DwtButton","ArrowDown");
kmm.setMapping("DwtButton","ArrowRight",DwtKeyMap.SUBMENU);
}
kmm.reloadMap("DwtButton");
}
item=item?item:this._getFocusItem(this._curFocusIndex);
if(item){
item._hasFocus=true;
item._focus();
}
};
DwtToolBar.prototype._blur=function(item){
item=item?item:this._getFocusItem(this._curFocusIndex);
if(item){
item._hasFocus=false;
item._blur();
}
};
DwtToolBar.prototype._getFocusItem=function(_d6a){
var item=this.getItem(_d6a);
if(!item||(item instanceof DwtToolBar)){
return null;
}
if(item.getEnabled&&!item.getEnabled()){
return null;
}
if(item.getVisible&&!item.getVisible()){
return null;
}
return item;
};
DwtToolBar.prototype._moveFocus=function(back){
var _d6d=this._curFocusIndex;
var _d6e=this.getItemCount()-1;
var item=null;
while(!item&&_d6d>=0&&_d6d<=_d6e){
_d6d=back?_d6d-1:_d6d+1;
item=this._getFocusItem(_d6d);
}
if(item){
this._blur();
this._curFocusIndex=_d6d;
this._focus(item);
}
};
DwtToolBar.prototype.getKeyMapName=function(){
return this._keyMapName;
};
DwtToolBar.prototype.handleKeyAction=function(_d70,ev){
var item=this.getItem(this._curFocusIndex);
var _d73=this.getItemCount();
if(_d73<2){
return true;
}
switch(_d70){
case DwtKeyMap.PREV:
if(this._curFocusIndex>0){
this._moveFocus(true);
}
break;
case DwtKeyMap.NEXT:
if(this._curFocusIndex<(_d73-1)){
this._moveFocus();
}
break;
default:
if(item){
return item.handleKeyAction(_d70,ev);
}
}
return true;
};
function DwtToolTip(_d74,_d75,_d76){
if(arguments.length==0){
return;
}
this.shell=_d74;
this._dialog=_d76;
this._poppedUp=false;
this._div=document.createElement("div");
this._div.className=_d75||"DwtToolTip";
this._div.style.position=DwtControl.ABSOLUTE_STYLE;
this.shell.getHtmlElement().appendChild(this._div);
Dwt.setZIndex(this._div,Dwt.Z_HIDDEN);
Dwt.setLocation(this._div,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
var _d77="ajax.dwt.templates.Widgets#"+this._borderStyle;
this._div.innerHTML=AjxTemplate.expand(_d77,"tooltip");
var _d78=AjxTemplate.getParams(_d77);
this._borderWidth=Number(_d78.width);
this._borderHeight=Number(_d78.height);
this._contentDiv=document.getElementById("tooltipContents");
}
DwtToolTip.prototype.toString=function(){
return "DwtToolTip";
};
DwtToolTip.TOOLTIP_DELAY=750;
DwtToolTip.prototype._borderStyle="DwtToolTip";
DwtToolTip.prototype.getContent=function(){
return this._div.innerHTML;
};
DwtToolTip.prototype.setContent=function(_d79,_d7a){
this._content=_d79;
if(_d7a){
this._contentDiv.innerHTML=this._content;
}
};
DwtToolTip.prototype.popup=function(x,y,_d7d){
if(this._content!=null){
if(!_d7d){
this._contentDiv.innerHTML=this._content;
}
var _d7e=this._div;
var _d7f="tooltip";
var clip=true;
var _d81=this._dialog;
this._positionElement(_d7e,x,y,_d7f,clip,_d81);
this._poppedUp=true;
}
};
DwtToolTip.prototype.popdown=function(){
if(this._content!=null&&this._poppedUp){
Dwt.setLocation(this._div,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this._poppedUp=false;
}
};
DwtToolTip.prototype._positionElement=function(_d82,_d83,_d84,_d85,clip,_d87){
var _d88=5;
var _d89=8;
var _d8a=8;
var _d8b=document.getElementById(_d85+"TopPointer");
_d8b.style.display="block";
var size=Dwt.getSize(_d8b),topPointerWidth=size.x,topPointerHeight=size.y;
var _d8d=document.getElementById(_d85+"BottomPointer");
_d8d.style.display="block";
var size=Dwt.getSize(_d8d);
bottomPointerWidth=size.x,bottomPointerHeight=size.y;
var _d8e=_d8b;
var _d8f=DwtShell.getShell(window).getSize(),wdWidth=_d8f.x,wdHeight=_d8f.y;
var _d90=Dwt.getSize(_d82),popupWidth=_d90.x,popupHeight=_d90.y;
var _d91=this._borderHeight,bottomBorderHeight=this._borderHeight,leftBorderWidth=this._borderWidth,rightBorderWidth=this._borderWidth;
var _d92=_d83-popupWidth/2-_d89,popupY;
var _d93,pointerX,pointerWidth;
if(_d84+_d8a+topPointerHeight-_d91+popupHeight<wdHeight-_d88){
_d8d.style.display="none";
popupY=_d84+_d8a+topPointerHeight-_d91;
_d93=_d91-topPointerHeight;
pointerWidth=topPointerWidth;
_d8e=_d8b;
}else{
_d8b.style.display="none";
popupY=_d84-_d8a-bottomPointerHeight+bottomBorderHeight-popupHeight;
_d93=popupHeight-bottomBorderHeight;
pointerWidth=bottomPointerWidth;
_d8e=_d8d;
}
var _d94=document.getElementById(_d85+"Contents");
if(popupWidth-leftBorderWidth-rightBorderWidth<pointerWidth){
_d94.width=pointerWidth;
_d94.style.width=String(pointerWidth)+"px";
}else{
_d94.width="auto";
_d94.style.width="auto";
}
if(_d92<_d88){
_d92=_d88;
}else{
if(_d92+popupWidth>wdWidth-_d88){
_d92=wdWidth-_d88-popupWidth;
}
}
pointerX=_d83-_d92-pointerWidth/2;
if(pointerX+pointerWidth>popupWidth-rightBorderWidth){
pointerX=popupWidth-rightBorderWidth-pointerWidth;
}
if(pointerX<leftBorderWidth){
pointerX=leftBorderWidth;
}
_d8e.style.left=pointerX;
_d8e.style.top=_d93;
Dwt.setLocation(_d82,_d92,popupY);
var _d95=_d87?_d87.getZIndex()+Dwt._Z_INC:Dwt.Z_TOOLTIP;
Dwt.setZIndex(_d82,_d95);
};
function DwtTreeItem(_d96,_d97,text,_d99,_d9a,_d9b,_d9c){
if(_d96 instanceof DwtTree){
this._tree=_d96;
}else{
if(_d96 instanceof DwtTreeItem){
this._tree=_d96._tree;
}else{
throw new DwtException("DwtTreeItem parent must be a DwtTree or DwtTreeItem",DwtException.INVALIDPARENT,"DwtTreeItem");
}
}
this._origClassName=_d9b?_d9b:"DwtTreeItem";
this._textClassName=this._origClassName+"-Text";
this._selectedClassName=this._origClassName+"-"+DwtCssStyle.SELECTED;
this._actionedClassName=this._origClassName+"-"+DwtCssStyle.ACTIONED;
this._dragOverClassName=this._origClassName+"-DragOver";
DwtComposite.call(this,_d96,null,_d9c,true);
this._imageInfoParam=_d99;
this._textParam=text;
this._deferred=(_d9a!==false);
this._itemChecked=false;
this._initialized=false;
this._selectionEnabled=true;
this._actionEnabled=true;
if(this._tree._isCheckedStyle()){
this.enableSelection(false);
this._selectedClassName=this._origClassName;
}
if(_d96 instanceof DwtTree||(_d96._initialized&&(!_d96._deferred||_d96._expanded))){
this._initialize(_d97);
}else{
_d96._addDeferredChild(this,_d97);
this._index=_d97;
}
}
DwtTreeItem.prototype=new DwtComposite;
DwtTreeItem.prototype.constructor=DwtTreeItem;
DwtTreeItem.prototype.toString=function(){
return "DwtTreeItem";
};
DwtTreeItem._NODECELL_DIM="16px";
DwtTreeItem.prototype.getChecked=function(){
return this._itemChecked;
};
DwtTreeItem.prototype.setChecked=function(_d9d,_d9e){
if((this._itemChecked!=_d9d)||_d9e){
this._itemChecked=_d9d;
if(this._checkBox!=null&&(this._checkBoxCell&&Dwt.getVisible(this._checkBoxCell))){
this._checkBox.checked=_d9d;
if(this._checkBox._ieHack){
if(_d9d){
var _d9f=document.createElement("<INPUT type='checkbox' checked>");
Dwt.setHandler(_d9f,DwtEvent.ONMOUSEDOWN,DwtTreeItem._checkBoxMouseDownHdlr);
Dwt.setHandler(_d9f,DwtEvent.ONMOUSEUP,DwtTreeItem._checkBoxMouseUpHdlr);
this._checkBox.parentNode.replaceChild(_d9f,this._checkBox);
this._checkBox=_d9f;
}else{
this._checkBox._ieHack=false;
}
}
}
}
};
DwtTreeItem.prototype.getExpanded=function(){
return this._expanded;
};
DwtTreeItem.prototype.setExpanded=function(_da0,_da1){
if(_da0){
var p=this.parent;
while(p instanceof DwtTreeItem&&!p._expanded){
p.setExpanded(true);
p=p.parent;
}
this._realizeDeferredChildren();
}
if(this.getNumChildren()){
if(_da0&&_da1){
if(!this._expanded){
this._expand(_da0);
}
var a=this.getChildren();
for(var i=0;i<a.length;i++){
if(a[i] instanceof DwtTreeItem){
a[i].setExpanded(_da0,_da1);
}
}
}else{
if(this._expanded!=_da0){
this._expand(_da0);
}
}
}
};
DwtTreeItem.prototype.getItemCount=function(){
return this._children.size();
};
DwtTreeItem.prototype.getItems=function(){
return this._children.getArray();
};
DwtTreeItem.prototype.getImage=function(){
return this._imageInfo;
};
DwtTreeItem.prototype.setImage=function(_da5){
if(this._initialized){
AjxImg.setImage(this._imageCell,_da5);
this._imageInfo=_da5;
}else{
this._imageInfoParam=_da5;
}
};
DwtTreeItem.prototype.setDndImage=function(_da6){
this._dndImageInfo=_da6;
};
DwtTreeItem.prototype.getSelected=function(){
return this._selected;
};
DwtTreeItem.prototype.getActioned=function(){
return this._actioned;
};
DwtTreeItem.prototype.getText=function(){
return this._text;
};
DwtTreeItem.prototype.setText=function(text){
if(this._initialized){
if(!text){
text.data="";
}
this._text=this._textCell.innerHTML=text;
}else{
this._textParam=text;
}
};
DwtTreeItem.prototype.setDndText=function(text){
this._dndText=text;
};
DwtTreeItem.prototype.showCheckBox=function(show){
if(this._checkBoxCell){
Dwt.setVisible(this._checkBoxCell,show);
}
};
DwtTreeItem.prototype.showExpansionIcon=function(show){
if(this._nodeCell){
Dwt.setVisible(this._nodeCell,show);
}
};
DwtTreeItem.prototype.enableSelection=function(_dab){
this._selectionEnabled=_dab;
};
DwtTreeItem.prototype.enableAction=function(_dac){
this._actionEnabled=_dac;
};
DwtTreeItem.prototype.addSeparator=function(_dad){
var _dae=new DwtTreeItemSeparator(this);
this._children.add(_dae,_dad);
};
DwtTreeItem.prototype.setVisible=function(_daf,_db0,_db1){
if(_db0&&!_db1){
Dwt.setVisible(this._itemDiv,_daf);
}else{
if(_db1&&!_db0){
Dwt.setVisible(this._childDiv,_daf);
}else{
DwtComposite.prototype.setVisible.call(this,_daf);
}
}
};
DwtTreeItem.prototype.removeChild=function(_db2){
if(_db2._initialized){
this._tree._deselect(_db2);
this._childDiv.removeChild(_db2.getHtmlElement());
}
this._children.remove(_db2);
if(this._children.size()==0){
if(this._expanded){
this._expanded=false;
}
if(this._initialized){
AjxImg.setImage(this._nodeCell,"Blank_16");
var _db3=AjxImg.getImageElement(this._nodeCell);
if(_db3){
Dwt.clearHandler(_db3,DwtEvent.ONMOUSEDOWN);
}
}
}
};
DwtTreeItem.prototype._initialize=function(_db4){
this._setMouseEventHdlrs();
this._itemDiv=document.createElement("div");
this._itemDiv.className=this._origClassName;
this.getHtmlElement().appendChild(this._itemDiv);
this._table=document.createElement("table");
this._table.cellSpacing=this._table.cellPadding=0;
this._table.border=0;
this._itemDiv.appendChild(this._table);
this._row=this._table.insertRow(0);
var i=0;
nodeCell=this._row.insertCell(i++);
nodeCell.style.width=nodeCell.style.height=DwtTreeItem._NODECELL_DIM;
nodeCell.align="center";
nodeCell.noWrap=true;
this._nodeCell=nodeCell;
if(this._children.size()>0){
AjxImg.setImage(this._nodeCell,"NodeCollapsed");
var _db6=AjxImg.getImageElement(this._nodeCell);
if(_db6){
Dwt.setHandler(_db6,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
Dwt.setHandler(_db6,DwtEvent.ONMOUSEUP,DwtTreeItem._nodeIconMouseUpHdlr);
}
}else{
AjxImg.setImage(this._nodeCell,"Blank_16");
}
if(this._tree._isCheckedStyle()){
this._checkBoxCell=this._row.insertCell(i++);
this._checkBoxCell.noWrap=true;
this._checkBox=document.createElement("input");
this._checkBox.type="checkbox";
if(AjxEnv.isIE){
this._checkBox._ieHack=true;
}
this._checkBoxCell.appendChild(this._checkBox);
Dwt.setHandler(this._checkBox,DwtEvent.ONMOUSEDOWN,DwtTreeItem._checkBoxMouseDownHdlr);
Dwt.setHandler(this._checkBox,DwtEvent.ONMOUSEUP,DwtTreeItem._checkBoxMouseUpHdlr);
this._checkBox.checked=this._itemChecked;
}
this._imageCell=this._row.insertCell(i++);
this._imageCell.className="imageCell";
this._imageCell.noWrap=true;
if(this._imageInfoParam){
AjxImg.setImage(this._imageCell,this._imageInfoParam);
this._imageInfo=this._imageInfoParam;
}
this._textCell=this._row.insertCell(i);
this._textCell.className=this._textClassName;
this._textCell.noWrap=true;
if(this._textParam){
this._textCell.innerHTML=this._text=this._textParam;
}
this._expanded=this._selected=this._actioned=false;
this._gotMouseDownLeft=this._gotMouseDownRight=false;
this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
this.addListener(DwtEvent.ONDBLCLICK,new AjxListener(this,this._doubleClickListener));
this.parent._addItem(this,_db4);
this._initialized=true;
};
DwtTreeItem.prototype._addDeferredChild=function(_db7,_db8){
if(this._initialized&&this._children.size()==0){
AjxImg.setImage(this._nodeCell,"NodeCollapsed");
var _db9=AjxImg.getImageElement(this._nodeCell);
if(_db9){
Dwt.setHandler(_db9,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
Dwt.setHandler(_db9,DwtEvent.ONMOUSEUP,DwtTreeItem._nodeIconMouseUpHdlr);
}
}
this._children.add(_db7,_db8);
};
DwtTreeItem.prototype.addChild=function(_dba){
};
DwtTreeItem.prototype._addItem=function(item,_dbc){
if(!this._children.contains(item)){
this._children.add(item,_dbc);
}
if(this._childDiv==null){
this._childDiv=document.createElement("div");
if(this.parent!=this._tree){
this._childDiv.className="DwtTreeItemChildDiv";
}else{
this._childDiv.className="DwtTreeItemLevel1ChildDiv";
}
this.getHtmlElement().appendChild(this._childDiv);
if(!this._expanded){
this._childDiv.style.display="none";
}
}
if(AjxImg.getImageClass(this._nodeCell)==AjxImg.getClassForImage("Blank_16")){
if(this._expanded){
AjxImg.setImage(this._nodeCell,"NodeExpanded");
}else{
AjxImg.setImage(this._nodeCell,"NodeCollapsed");
}
var _dbd=AjxImg.getImageElement(this._nodeCell);
if(_dbd){
Dwt.setHandler(_dbd,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
}
}
var _dbe=this._childDiv;
var _dbf=_dbe.childNodes.length;
if(_dbc==null||_dbc>=_dbf||_dbf==0){
_dbe.appendChild(item.getHtmlElement());
}else{
_dbe.insertBefore(item.getHtmlElement(),_dbe.childNodes[_dbc]);
}
};
DwtTreeItem.prototype._getDnDIcon=function(){
var icon=document.createElement("div");
Dwt.setPosition(icon,Dwt.ABSOLUTE_STYLE);
var _dc1=document.createElement("table");
icon.appendChild(_dc1);
_dc1.cellSpacing=_dc1.cellPadding=0;
var row=_dc1.insertRow(0);
var i=0;
var c=row.insertCell(i++);
c.noWrap=true;
if(this._dndImageInfo){
AjxImg.setImage(c,this._dndImageInfo);
}else{
if(this._imageInfo){
AjxImg.setImage(c,this._imageInfo);
}
}
c=row.insertCell(i);
c.noWrap=true;
c.className=this._origClassName;
if(this._dndText){
c.innerHTML=this._dndText;
}else{
if(this._text){
c.innerHTML=this._text;
}
}
this.shell.getHtmlElement().appendChild(icon);
Dwt.setZIndex(icon,Dwt.Z_DND);
return icon;
};
DwtTreeItem.prototype._dragEnter=function(){
this._preDragClassName=this._textCell.className;
this._textCell.className=this._dragOverClassName;
};
DwtTreeItem.prototype._dragHover=function(){
if(this.getNumChildren()>0&&!this.getExpanded()){
this.setExpanded(true);
}
};
DwtTreeItem.prototype._dragLeave=function(){
if(this._preDragClassName){
this._textCell.className=this._preDragClassName;
}
};
DwtTreeItem.prototype._drop=function(){
if(this._preDragClassName){
this._textCell.className=this._preDragClassName;
}
};
DwtTreeItem._nodeIconMouseDownHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _dc7=DwtShell.mouseEvent;
_dc7.setFromDhtmlEvent(ev);
if(_dc7.button==DwtMouseEvent.LEFT){
obj._expand(!obj._expanded,ev);
}else{
if(_dc7.button==DwtMouseEvent.RIGHT){
_dc7.dwtObj._tree._itemActioned(_dc7.dwtObj,_dc7);
}
}
_dc7._stopPropagation=true;
_dc7._returnValue=false;
_dc7.setToDhtmlEvent(ev);
return false;
};
DwtTreeItem._nodeIconMouseUpHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _dca=DwtShell.mouseEvent;
_dca._stopPropagation=true;
_dca._returnValue=false;
_dca.setToDhtmlEvent(ev);
return false;
};
DwtTreeItem.prototype._expand=function(_dcb,ev){
if(!_dcb){
this._expanded=false;
this._childDiv.style.display="none";
AjxImg.setImage(this._nodeCell,"NodeCollapsed");
this._tree._itemCollapsed(this,ev);
}else{
this._realizeDeferredChildren();
this._expanded=true;
this._childDiv.style.display="block";
AjxImg.setImage(this._nodeCell,"NodeExpanded");
this._tree._itemExpanded(this,ev);
}
};
DwtTreeItem.prototype._realizeDeferredChildren=function(){
var a=this._children.getArray();
for(var i=0;i<a.length;i++){
if(!a[i]._initialized){
if(a[i]._isSeparator){
var div=a[i].div=document.createElement("div");
div.className="vSpace";
this._childDiv.appendChild(div);
a[i]._initialized=true;
}else{
a[i]._initialize(a[i]._index);
}
}
}
};
DwtTreeItem.prototype._isChildOf=function(item){
var test=this.parent;
while(test&&test!=this._tree){
if(test==item){
return true;
}
test=test.parent;
}
return false;
};
DwtTreeItem.prototype._setSelected=function(_dd2){
if(this._selected!=_dd2){
this._selected=_dd2;
if(!this._initialized){
this._initialize();
}
if(_dd2&&this._selectionEnabled){
this._textCell.className=this._selectedClassName;
return true;
}else{
this._textCell.className=this._textClassName;
return false;
}
}
};
DwtTreeItem.prototype._setActioned=function(_dd3){
if(this._actioned!=_dd3){
this._actioned=_dd3;
if(!this._initialized){
this._initialize();
}
if(_dd3&&this._actionEnabled&&!this._selected){
this._textCell.className=this._actionedClassName;
return true;
}else{
if(!_dd3){
this._textCell.className=this._textClassName;
return false;
}
}
}
};
DwtTreeItem.prototype._mouseDownListener=function(ev){
if(ev.target==this._childDiv){
return;
}
if(ev.button==DwtMouseEvent.LEFT&&this._selectionEnabled){
this._gotMouseDownLeft=true;
}else{
if(ev.button==DwtMouseEvent.RIGHT&&this._actionEnabled){
this._gotMouseDownRight=true;
}
}
};
DwtTreeItem.prototype._mouseOutListener=function(ev){
if(ev.target==this._childDiv){
return;
}
this._gotMouseDownLeft=false;
this._gotMouseDownRight=false;
};
DwtTreeItem.prototype._mouseUpListener=function(ev){
if(ev.target==this._childDiv){
return;
}
if(ev.button==DwtMouseEvent.LEFT&&this._gotMouseDownLeft){
this._tree._itemClicked(this,ev);
}else{
if(ev.button==DwtMouseEvent.RIGHT&&this._gotMouseDownRight){
this._tree._itemActioned(this,ev);
}
}
};
DwtTreeItem.prototype._doubleClickListener=function(ev){
if(ev.target==this._childDiv){
return;
}
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _dd9=DwtShell.mouseEvent;
_dd9.setFromDhtmlEvent(ev);
if(_dd9.button==DwtMouseEvent.LEFT||_dd9.button==DwtMouseEvent.NONE){
_dd9.dwtObj._tree._itemDblClicked(_dd9.dwtObj,_dd9);
}
};
DwtTreeItem._checkBoxMouseDownHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _ddc=DwtShell.mouseEvent;
_ddc.setFromDhtmlEvent(ev);
_ddc._stopPropagation=true;
_ddc._returnValue=false;
_ddc.setToDhtmlEvent(ev);
return false;
};
DwtTreeItem._checkBoxMouseUpHdlr=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
var _ddf=DwtShell.mouseEvent;
_ddf.setFromDhtmlEvent(ev);
if(_ddf.button==DwtMouseEvent.LEFT){
_ddf.dwtObj._itemChecked=!_ddf.dwtObj._itemChecked;
_ddf.dwtObj._tree._itemChecked(_ddf.dwtObj,_ddf);
}else{
if(_ddf.button==DwtMouseEvent.RIGHT){
_ddf.dwtObj._tree._itemActioned(_ddf.dwtObj,_ddf);
}
}
};
function DwtTreeItemSeparator(_de0){
this.parent=_de0;
this._isSeparator=true;
this._initialized=false;
}
DwtTreeItemSeparator.prototype.dispose=function(){
DwtComposite.prototype.removeChild.call(this.parent,this);
};
DwtTreeItemSeparator.prototype.isInitialized=function(){
return this._initialized;
};
DwtTreeItemSeparator.prototype.getHtmlElement=function(){
return this.div;
};
function DwtTree(_de1,_de2,_de3,_de4){
if(arguments.length==0){
return;
}
_de3=_de3||"DwtTree";
DwtComposite.call(this,_de1,_de3,_de4);
if(_de2==null){
this._style=DwtTree.SINGLE_STYLE;
}else{
if(_de2==DwtTree.CHECKEDITEM_STYLE){
_de2|=DwtTree.SINGLE_STYLE;
}
this._style=_de2;
}
this._selectedItems=new AjxVector();
this._selEv=new DwtSelectionEvent(true);
}
DwtTree.prototype=new DwtComposite;
DwtTree.prototype.constructor=DwtTree;
DwtTree.prototype.toString=function(){
return "DwtTree";
};
DwtTree.SINGLE_STYLE=1;
DwtTree.MULTI_STYLE=2;
DwtTree.CHECKEDITEM_STYLE=4;
DwtTree.ITEM_SELECTED=0;
DwtTree.ITEM_DESELECTED=1;
DwtTree.ITEM_CHECKED=2;
DwtTree.ITEM_ACTIONED=3;
DwtTree.ITEM_DBL_CLICKED=4;
DwtTree.ITEM_EXPANDED=1;
DwtTree.ITEM_COLLAPSED=2;
DwtTree.prototype.getStyle=function(){
return this._style;
};
DwtTree.prototype.addSelectionListener=function(_de5){
this.addListener(DwtEvent.SELECTION,_de5);
};
DwtTree.prototype.removeSelectionListener=function(_de6){
this.removeListener(DwtEvent.SELECTION,_de6);
};
DwtTree.prototype.addTreeListener=function(_de7){
this.addListener(DwtEvent.TREE,_de7);
};
DwtTree.prototype.removeTreeListener=function(_de8){
this.removeListener(DwtEvent.TREE,_de8);
};
DwtTree.prototype.getItemCount=function(){
return this._children.size();
};
DwtTree.prototype.getItems=function(){
return this._children.getArray();
};
DwtTree.prototype.deselectAll=function(){
var a=this._selectedItems.getArray();
var sz=this._selectedItems.size();
for(var i=0;i<sz;i++){
a[i]._setSelected(false);
}
if(sz>0){
this._notifyListeners(DwtEvent.SELECTION,this._selectedItems.getArray(),DwtTree.ITEM_DESELECTED,null,this._selEv);
}
this._selectedItems.removeAll();
};
DwtTree.prototype.getSelection=function(){
return this._selectedItems.getArray();
};
DwtTree.prototype.setSelection=function(_dec,_ded){
var a=this._selectedItems.getArray();
var sz=this._selectedItems.size();
var da;
var j=0;
var _df2=false;
for(var i=0;i<sz;i++){
if(a[i]==_dec){
_df2=true;
}else{
a[i]._setSelected(false);
this._selectedItems.remove(a[i]);
if(da==null){
da=new Array();
}
da[j++]=a[i];
}
}
if(da&&!_ded){
this._notifyListeners(DwtEvent.SELECTION,da,DwtTree.ITEM_DESELECTED,null,this._selEv);
}
if(_df2){
return;
}
this._selectedItems.add(_dec);
var _df4=_dec.parent;
while(_df4 instanceof DwtTreeItem){
_df4.setExpanded(true);
_df4=_df4.parent;
}
if(_dec._setSelected(true)&&!_ded){
this._notifyListeners(DwtEvent.SELECTION,[_dec],DwtTree.ITEM_SELECTED,null,this._selEv);
}
};
DwtTree.prototype.getSelectionCount=function(){
return this._selectedItems.size();
};
DwtTree.prototype.addChild=function(_df5){
};
DwtTree.prototype.addSeparator=function(){
var sep=document.createElement("div");
sep.className="vSpace";
this.getHtmlElement().appendChild(sep);
};
DwtTree.prototype._addItem=function(item,_df8){
this._children.add(item,_df8);
var _df9=this.getHtmlElement();
var _dfa=_df9.childNodes.length;
if(_df8==null||_df8>_dfa){
_df9.appendChild(item.getHtmlElement());
}else{
_df9.insertBefore(item.getHtmlElement(),_df9.childNodes[_df8]);
}
};
DwtTree.prototype.removeChild=function(_dfb){
this._children.remove(_dfb);
this._selectedItems.remove(_dfb);
this.getHtmlElement().removeChild(_dfb.getHtmlElement());
};
DwtTree.prototype.setCheckboxes=function(_dfc){
if(!this._isCheckedStyle()||!AjxEnv.isIE){
return;
}
if(_dfc&&_dfc._isSeparator){
return;
}
var _dfd;
if(_dfc){
_dfc.setChecked(_dfc.getChecked(),true);
_dfd=_dfc.getItems();
}else{
_dfd=this.getItems();
}
for(var i=0;i<_dfd.length;i++){
this.setCheckboxes(_dfd[i]);
}
};
DwtTree.prototype._deselect=function(item){
if(this._selectedItems.contains(item)){
this._selectedItems.remove(item);
item._setSelected(false);
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_DESELECTED,null,this._selEv);
}
};
DwtTree.prototype._isCheckedStyle=function(){
return ((this._style&DwtTree.CHECKEDITEM_STYLE)!=0);
};
DwtTree.prototype._itemActioned=function(item,ev){
if(this._actionedItem){
this._actionedItem._setActioned(false);
this._notifyListeners(DwtEvent.SELECTION,[this._actionedItem],DwtTree.ITEM_DESELECTED,ev,this._selEv);
}
this._actionedItem=item;
item._setActioned(true);
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_ACTIONED,ev,this._selEv);
};
DwtTree.prototype._itemChecked=function(item,ev){
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_CHECKED,ev,this._selEv);
};
DwtTree.prototype._itemClicked=function(item,ev){
var i;
var a=this._selectedItems.getArray();
var _e08=this._selectedItems.size();
if(this._style&DwtTree.SINGLE_STYLE||(!ev.shiftKey&&!ev.ctrlKey)){
if(_e08>0){
for(i=0;i<_e08;i++){
a[i]._setSelected(false);
}
this._notifyListeners(DwtEvent.SELECTION,this._selectedItems.getArray(),DwtTree.ITEM_DESELECTED,ev,this._selEv);
this._selectedItems.removeAll();
}
this._selectedItems.add(item);
if(item._setSelected(true)){
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_SELECTED,ev,this._selEv);
}
}else{
if(ev.ctrlKey){
if(this._selectedItems.contains(item)){
this._selectedItems.remove(item);
item._setSelected(false);
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_DESELECTED,ev,this._selEv);
}else{
this._selectedItems.add(item);
if(item._setSelected(true)){
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_SELECTED,ev,this._selEv);
}
}
}else{
}
}
};
DwtTree.prototype._itemDblClicked=function(item,ev){
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_DBL_CLICKED,ev,this._selEv);
};
DwtTree.prototype._itemExpanded=function(item,ev){
this._notifyListeners(DwtEvent.TREE,[item],DwtTree.ITEM_EXPANDED,ev,DwtShell.treeEvent);
};
DwtTree.prototype._itemCollapsed=function(item,ev){
var i;
if(ev){
this._notifyListeners(DwtEvent.TREE,[item],DwtTree.ITEM_COLLAPSED,ev,DwtShell.treeEvent);
}
var _e10=false;
var a=this._selectedItems.getArray();
var _e12=this._selectedItems.size();
var da;
var j=0;
for(i=0;i<_e12;i++){
if(a[i]._isChildOf(item)){
_e10=true;
if(da==null){
da=new Array();
}
da[j++]=a[i];
a[i]._setSelected(false);
this._selectedItems.remove(a[i]);
}
}
if(da){
this._notifyListeners(DwtEvent.SELECTION,da,DwtTree.ITEM_DESELECTED,ev,this._selEv);
}
if(_e10&&!this._selectedItems.contains(item)){
this._selectedItems.add(item);
if(item._setSelected(true)){
this._notifyListeners(DwtEvent.SELECTION,[item],DwtTree.ITEM_SELECTED,ev,this._selEv);
}
}
};
DwtTree.prototype._notifyListeners=function(_e15,_e16,_e17,_e18,_e19){
if(this.isListenerRegistered(_e15)){
if(_e18){
DwtUiEvent.copy(_e19,_e18);
}
_e19.items=_e16;
if(_e16.length==1){
_e19.item=_e16[0];
}
_e19.detail=_e17;
this.notifyListeners(_e15,_e19);
}
};
function DwtCalendar(_e1a,_e1b,_e1c,_e1d,_e1e,_e1f,_e20,_e21){
if(arguments.length==0){
return;
}
_e1b=_e1b||"DwtCalendar";
DwtComposite.call(this,_e1a,_e1b,_e1c);
this._skipNotifyOnPage=false;
this._hidePrevNextMo=_e20;
this._readOnly=_e21;
this._uuid=Dwt.getNextId();
var cn=this._origDayClassName=_e1b+"Day";
this._todayClassName=" "+_e1b+"Day-today";
this._selectedDayClassName=" "+cn+"-"+DwtCssStyle.SELECTED;
this._activatedDayClassName=" "+cn+"-"+DwtCssStyle.ACTIVATED;
this._triggeredDayClassName=" "+cn+"-"+DwtCssStyle.TRIGGERED;
this._hiliteClassName=" "+cn+"-hilited";
this._greyClassName=" "+cn+"-grey";
if(!this._readOnly){
this._installListeners();
}
this._selectionMode=DwtCalendar.DAY;
this._init();
this._weekDays=new Array(7);
this._workingDays=(_e1f==null)?DwtCalendar._DEF_WORKING_DAYS:_e1f;
this.setFirstDayOfWeek((_e1d==null)?DwtCalendar.SUN:_e1d);
this._forceRollOver=(_e1e)?_e1e:true;
}
DwtCalendar.prototype=new DwtComposite;
DwtCalendar.prototype.constructor=DwtCalendar;
DwtCalendar.SUN=0;
DwtCalendar.MON=1;
DwtCalendar.TUE=2;
DwtCalendar.WED=3;
DwtCalendar.THU=4;
DwtCalendar.FRI=5;
DwtCalendar.SAT=6;
DwtCalendar.DAY=1;
DwtCalendar.WEEK=2;
DwtCalendar.WORK_WEEK=3;
DwtCalendar.MONTH=4;
DwtCalendar.RANGE_CHANGE="DwtCalendar.RANGE_CHANGE";
DwtCalendar._FULL_WEEK=[1,1,1,1,1,1,1];
DwtCalendar._DEF_WORKING_DAYS=[0,1,1,1,1,1,0];
DwtCalendar._DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];
DwtCalendar._NO_MONTH=-2;
DwtCalendar._PREV_MONTH=-1;
DwtCalendar._THIS_MONTH=0;
DwtCalendar._NEXT_MONTH=1;
DwtCalendar._NORMAL=1;
DwtCalendar._ACTIVATED=2;
DwtCalendar._TRIGGERED=3;
DwtCalendar._SELECTED=4;
DwtCalendar._DESELECTED=5;
DwtCalendar.DATE_SELECTED=1;
DwtCalendar.DATE_DESELECTED=2;
DwtCalendar.DATE_DBL_CLICKED=3;
DwtCalendar._LAST_DAY_CELL_IDX=41;
DwtCalendar._BUTTON_CLASS="DwtCalendarButton";
DwtCalendar._BUTTON_ACTIVATED_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.ACTIVATED;
DwtCalendar._BUTTON_TRIGGERED_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.TRIGGERED;
DwtCalendar._TITLE_CLASS="DwtCalendarTitle";
DwtCalendar._TITLE_ACTIVATED_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.ACTIVATED;
DwtCalendar._TITLE_TRIGGERED_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.TRIGGERED;
DwtCalendar.prototype.toString=function(){
return "DwtCalendar";
};
DwtCalendar.prototype.addSelectionListener=function(_e23){
this.addListener(DwtEvent.SELECTION,_e23);
};
DwtCalendar.prototype.removeSelectionListener=function(_e24){
this.removeListener(DwtEvent.SELECTION,_e24);
};
DwtCalendar.prototype.addActionListener=function(_e25){
this.addListener(DwtEvent.ACTION,_e25);
};
DwtCalendar.prototype.removeActionListener=function(_e26){
this.removeListener(DwtEvent.ACTION,_e26);
};
DwtCalendar.prototype.addDateRangeListener=function(_e27){
this.addListener(DwtEvent.DATE_RANGE,_e27);
};
DwtCalendar.prototype.removeDateRangeListener=function(_e28){
this.removeListener(DwtEvent.DATE_RANGE,_e28);
};
DwtCalendar.prototype.setSkipNotifyOnPage=function(skip){
this._skipNotifyOnPage=skip;
};
DwtCalendar.prototype.getSkipNotifyOnPage=function(){
return this._skipNotifyOnPage;
};
DwtCalendar.prototype.setDate=function(date,_e2b,_e2c,_e2d){
_e2c=(_e2c==null)?this._forceRollOver:_e2c;
var _e2e=new Date(date.getTime());
var _e2f=this._date;
var _e30=false;
var _e31=false;
var _e32;
if(this._date2CellId!=null){
var idx=(_e2e.getFullYear()*10000)+(_e2e.getMonth()*100)+_e2e.getDate();
var _e32=this._date2CellId[idx];
if(_e32){
if(_e32==this._selectedCellId){
_e31=true;
}
var cell=document.getElementById(_e32);
if(cell._dayType==DwtCalendar._THIS_MONTH){
_e31=true;
}else{
if(_e2c){
_e31=_e30=true;
}else{
_e31=true;
}
}
}else{
_e31=_e30=true;
}
}else{
_e31=_e30=true;
}
if(_e31){
if(this._date){
_e2e.setHours(this._date.getHours(),this._date.getMinutes(),this._date.getSeconds(),0);
}
this._date=_e2e;
if(!_e30&&!this._readOnly){
this._setSelectedDate();
this._setToday();
}
}
if(_e30){
this._layout();
}
if(_e31&&!_e2b){
var type=_e2d?DwtCalendar.DATE_DBL_CLICKED:DwtCalendar.DATE_SELECTED;
this._notifyListeners(DwtEvent.SELECTION,type,this._date);
}
return true;
};
DwtCalendar.prototype.isSelected=function(_e36){
if(_e36==this._selectedDayElId){
return true;
}else{
if(this._selectionMode!=DwtCalendar.DAY){
var _e37=this._getDayCellIndex(_e36);
if(Math.floor(_e37/7)==Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)&&this._currWorkingDays[_e37%7]){
return true;
}
}
}
return false;
};
DwtCalendar.prototype.getForceRollOver=function(){
return this._forceRollOver;
};
DwtCalendar.prototype.setForceRollOver=function(_e38){
if(_e38==null){
return;
}
if(this._forceRollOver!=_e38){
this._forceRollOver=_e38;
this._layout();
}
};
DwtCalendar.prototype.getSelectionMode=function(){
return this._selectionMode;
};
DwtCalendar.prototype.setSelectionMode=function(_e39){
if(this._selectionMode==_e39){
return;
}
this._selectionMode=_e39;
if(_e39==DwtCalendar.WEEK){
this._currWorkingDays=DwtCalendar._FULL_WEEK;
}else{
if(_e39==DwtCalendar.WORK_WEEK){
this._currWorkingDays=this._workingDays;
}
}
this._layout();
};
DwtCalendar.prototype.setWorkingWeek=function(_e3a){
this._workingDays=this._currWorkingDays=_e3a;
if(this._selectionMode==DwtCalendar.WORK_WEEK){
this._layout();
}
};
DwtCalendar.prototype.setHilite=function(_e3b,_e3c,_e3d){
if(this._date2CellId==null){
return;
}
var cell;
var _e3f;
if(_e3d){
for(_e3f in this._date2CellId){
cell=document.getElementById(this._date2CellId[_e3f]);
if(cell._isHilited){
cell._isHilited=false;
this._setClassName(cell,DwtCalendar._NORMAL);
}
}
}
var _e40;
for(var i in _e3b){
_e3f=_e3b[i];
_e40=this._date2CellId[_e3f.getFullYear()*10000+_e3f.getMonth()*100+_e3f.getDate()];
if(_e40){
cell=document.getElementById(_e40);
if(cell._isHilited!=_e3c){
cell._isHilited=_e3c;
this._setClassName(cell,DwtCalendar._NORMAL);
}
}
}
};
DwtCalendar.prototype.getDate=function(){
return this._date;
};
DwtCalendar.prototype.setFirstDayOfWeek=function(_e42){
for(var i=0;i<7;i++){
if(i<_e42){
this._weekDays[i]=6-(_e42-i-1);
}else{
this._weekDays[i]=i-_e42;
}
var _e44=document.getElementById(this._getDOWCellId(i));
_e44.innerHTML=AjxDateUtil.WEEKDAY_SHORT[(_e42+i)%7];
}
this._layout();
};
DwtCalendar.prototype.getDateRange=function(){
return this._range;
};
DwtCalendar.prototype._getDayCellId=function(_e45){
return "c:"+_e45+":"+this._uuid;
};
DwtCalendar.prototype._getDayCellIndex=function(_e46){
return _e46.substring(2,_e46.indexOf(":",3));
};
DwtCalendar.prototype._getDOWCellId=function(_e47){
return "w:"+_e47+":"+this._uuid;
};
DwtCalendar.prototype._getDaysInMonth=function(mo,yr){
if(mo!=1){
return DwtCalendar._DAYS_IN_MONTH[mo];
}else{
if(yr%4!=0||(yr%100==0&&yr%400!=0)){
return 28;
}else{
return 29;
}
}
};
DwtCalendar.prototype._installListeners=function(){
this._setMouseEventHdlrs();
this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
this.addListener(DwtEvent.ONDBLCLICK,new AjxListener(this,this._doubleClickListener));
};
DwtCalendar.prototype._notifyListeners=function(_e4a,type,_e4c,ev){
if(!this.isListenerRegistered(_e4a)){
return;
}
var _e4e=DwtShell.selectionEvent;
if(ev){
DwtUiEvent.copy(_e4e,ev);
}else{
_e4e.reset();
}
_e4e.item=this;
_e4e.detail=_e4c;
_e4e.type=type;
this.notifyListeners(_e4a,_e4e);
};
DwtCalendar.prototype._layout=function(){
if(this._date==null){
return false;
}
if(!this._calWidgetInited){
this._init();
}
var date=new Date(this._date.getTime());
date.setDate(1);
var year=date.getFullYear();
var _e51=date.getMonth();
var _e52=date.getDay();
var _e53=this._getDaysInMonth(_e51,year);
var day=1;
var _e55=1;
this._date2CellId=new Object();
this._selectedDayElId=null;
if(!this._hidePrevNextMo){
if(_e51!=0){
var _e56=this._getDaysInMonth(_e51-1,year)-this._weekDays[_e52]+1;
var _e57=year;
var _e58=_e51-1;
if(_e51!=11){
var _e59=_e51+1;
var _e5a=year;
}else{
var _e59=0;
var _e5a=year+1;
}
}else{
var _e56=this._getDaysInMonth(11,year-1)-this._weekDays[_e52]+1;
var _e57=year-1;
var _e58=11;
var _e59=1;
var _e5a=year;
}
}
for(var i=0;i<6;i++){
for(var j=0;j<7;j++){
var _e5d=document.getElementById(this._getDayCellId(i*7+j));
if(_e5d._isHilited==null){
_e5d._isHilited=false;
}
if(day<=_e53){
if(i!=0||j>=this._weekDays[_e52]){
this._date2CellId[(year*10000)+(_e51*100)+day]=_e5d.id;
_e5d._day=day;
_e5d._month=_e51;
_e5d._year=year;
_e5d.innerHTML=day++;
_e5d._dayType=DwtCalendar._THIS_MONTH;
if(this._readOnly){
_e5d.style.fontFamily="Arial";
_e5d.style.fontSize="10px";
}
}else{
if(this._hidePrevNextMo){
_e5d.innerHTML="";
}else{
this._date2CellId[(_e57*10000)+(_e58*100)+_e56]=_e5d.id;
_e5d._day=_e56;
_e5d._month=_e58;
_e5d._year=_e57;
_e5d.innerHTML=_e56++;
_e5d._dayType=DwtCalendar._PREV_MONTH;
}
}
}else{
if(!this._hidePrevNextMo){
this._date2CellId[(_e5a*10000)+(_e59*100)+_e55]=_e5d.id;
_e5d._day=_e55;
_e5d._month=_e59;
_e5d._year=_e5a;
_e5d.innerHTML=_e55++;
_e5d._dayType=DwtCalendar._NEXT_MONTH;
}
}
this._setClassName(_e5d,DwtCalendar._NORMAL);
}
}
this._setTitle(_e51,year);
if(!this._readOnly){
this._setSelectedDate();
this._setToday();
}
this._setRange();
};
DwtCalendar.prototype._setRange=function(){
var cell=document.getElementById(this._getDayCellId(0));
var _e5f=new Date(cell._year,cell._month,cell._day,0,0,0,0);
cell=document.getElementById(this._getDayCellId(DwtCalendar._LAST_DAY_CELL_IDX));
var _e60=this._getDaysInMonth(cell._month,cell._year);
var end;
if(cell._day<_e60){
end=new Date(cell._year,cell._month,cell._day+1,0,0,0,0);
}else{
if(cell._month<11){
end=new Date(cell._year,cell._month+1,1,0,0,0,0);
}else{
end=new Date(cell._year+1,0,1,0,0,0,0);
}
}
if(this._range==null){
this._range=new Object();
}else{
if(this._range.start.getTime()==_e5f.getTime()&&this._range.end.getTime()==end.getTime()){
return false;
}
}
this._range.start=_e5f;
this._range.end=end;
if(!this.isListenerRegistered(DwtEvent.DATE_RANGE)){
return;
}
if(!this._dateRangeEvent){
this._dateRangeEvent=new DwtDateRangeEvent(true);
}
this._dateRangeEvent.item=this;
this._dateRangeEvent.start=_e5f;
this._dateRangeEvent.end=end;
this.notifyListeners(DwtEvent.DATE_RANGE,this._dateRangeEvent);
};
DwtCalendar.prototype._setToday=function(){
var cell;
var _e63=new Date();
var _e64=_e63.getDate();
if(!this._todayDay||this._todayDay!=_e64){
if(this._todayCellId!=null){
cell=document.getElementById(this._todayCellId);
cell._isToday=false;
this._setClassName(cell,DwtCalendar._NORMAL);
}
this._todayCellId=this._date2CellId[(_e63.getFullYear()*10000)+(_e63.getMonth()*100)+_e64];
if(this._todayCellId!=null){
cell=document.getElementById(this._todayCellId);
cell._isToday=true;
this._setClassName(cell,DwtCalendar._NORMAL);
}
}
};
DwtCalendar.prototype._setSelectedDate=function(){
var day=this._date.getDate();
var _e66=this._date.getMonth();
var year=this._date.getFullYear();
var cell;
if(this._selectedDayElId){
cell=document.getElementById(this._selectedDayElId);
this._setClassName(cell,DwtCalendar._DESELECTED);
}
var _e69=this._date2CellId[(year*10000)+(_e66*100)+day];
cell=document.getElementById(_e69);
this._selectedDayElId=_e69;
this._setClassName(cell,DwtCalendar._SELECTED);
};
DwtCalendar.prototype._setCellClassName=function(cell,_e6b,mode){
if(cell._dayType!=DwtCalendar._THIS_MONTH){
_e6b+=this._greyClassName;
}
if(this._selectionMode==DwtCalendar.DAY&&cell.id==this._selectedDayElId&&mode!=DwtCalendar._DESELECTED){
_e6b+=this._selectedDayClassName;
}else{
if(this._selectionMode!=DwtCalendar.DAY&&mode!=DwtCalendar._DESELECTED&&this._selectedDayElId!=null){
var idx=this._getDayCellIndex(cell.id);
if(Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)==Math.floor(idx/7)&&this._currWorkingDays[idx%7]){
_e6b+=this._selectedDayClassName;
}
}
}
if(cell._isHilited){
_e6b+=this._hiliteClassName;
}
if(cell._isToday){
_e6b+=this._todayClassName;
}
return _e6b;
};
DwtCalendar.prototype._setClassName=function(cell,mode){
var _e70="";
if(mode==DwtCalendar._NORMAL){
_e70=this._origDayClassName;
}else{
if(mode==DwtCalendar._ACTIVATED){
_e70=this._activatedDayClassName;
}else{
if(mode==DwtCalendar._TRIGGERED){
_e70=this._triggeredDayClassName;
}else{
if(this._selectionMode!=DwtCalendar.DAY&&(mode==DwtCalendar._SELECTED||mode==DwtCalendar._DESELECTED)){
var _e71=Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)*7;
for(var i=0;i<7;i++){
_e70=this._origDayClassName;
var _e73=document.getElementById(this._getDayCellId(_e71++));
_e73.className=this._setCellClassName(_e73,_e70,mode);
}
return;
}
}
}
}
cell.className=this._setCellClassName(cell,_e70,mode);
};
DwtCalendar.prototype._setTitle=function(_e74,year){
var cell=document.getElementById(this._monthCell);
var _e77=DwtCalendar.getMonthFormatter();
var date=new Date(year,_e74);
cell.innerHTML=_e77.format(date);
};
DwtCalendar.prototype._init=function(){
var html=new Array(100);
var idx=0;
this._monthCell="t:"+this._uuid;
html[idx++]="<table width=100% cellspacing='0' cellpadding='0' style='border-collapse:collapse;'>";
html[idx++]="<tr><td class=DwtCalendarTitlebar>";
html[idx++]="<table width='100%' cellspacing='0' cellpadding='0'>";
html[idx++]="<tr>";
html[idx++]="<td class='";
html[idx++]=DwtCalendar._BUTTON_CLASS;
html[idx++]="' id='b:py:";
html[idx++]=this._uuid;
html[idx++]="'>";
html[idx++]=AjxImg.getImageHtml("FastRevArrowSmall",null,["id='b:py:img:",this._uuid,"'"].join(""));
html[idx++]="</td>";
html[idx++]="<td class='";
html[idx++]=DwtCalendar._BUTTON_CLASS;
html[idx++]="' id='b:pm:";
html[idx++]=this._uuid;
html[idx++]="'>";
html[idx++]=AjxImg.getImageHtml("RevArrowSmall",null,["id='b:pm:img:",this._uuid,"'"].join(""));
html[idx++]="</td>";
html[idx++]="<td align='center' class='DwtCalendarTitleCell' nowrap'><span class='";
html[idx++]=DwtCalendar._TITLE_CLASS;
html[idx++]="' id='";
html[idx++]=this._monthCell;
html[idx++]="'>&nbsp;</span></td>";
html[idx++]="<td class='";
html[idx++]=DwtCalendar._BUTTON_CLASS;
html[idx++]="' id='b:nm:";
html[idx++]=this._uuid;
html[idx++]="'>";
html[idx++]=AjxImg.getImageHtml("FwdArrowSmall",null,["id='b:nm:img:",this._uuid,"'"].join(""));
html[idx++]="</td>";
html[idx++]="<td class='";
html[idx++]=DwtCalendar._BUTTON_CLASS;
html[idx++]="' id='b:ny:";
html[idx++]=this._uuid;
html[idx++]="'>";
html[idx++]=AjxImg.getImageHtml("FastFwdArrowSmall",null,["id='b:ny:img:",this._uuid,"'"].join(""));
html[idx++]="</td>";
html[idx++]="</tr>";
html[idx++]="</table>";
html[idx++]="</td></tr>";
html[idx++]="<tr><td>";
html[idx++]="<table cellspacing='0' cellpadding='1' width='100%'>";
html[idx++]="<tr>";
for(var i=0;i<7;i++){
html[idx++]="<td class='DwtCalendarDow' width='";
html[idx++]=(i<5?"14%":"15%");
html[idx++]="' id='";
html[idx++]=this._getDOWCellId(i);
html[idx++]="'>&nbsp;</td>";
}
html[idx++]="</tr>";
for(var i=0;i<6;i++){
html[idx++]=AjxEnv.isLinux?"<tr style='line-height:12px'>":"<tr>";
for(var j=0;j<7;j++){
html[idx++]="<td id='";
html[idx++]=this._getDayCellId(i*7+j);
html[idx++]="'>&nbsp;</td>";
}
html[idx++]="</tr>";
}
html[idx++]="</td></tr></table></table>";
this.getHtmlElement().innerHTML=html.join("");
if(!this._readOnly){
document.getElementById("b:py:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastRevArrowSmall");
document.getElementById("b:pm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("RevArrowSmall");
document.getElementById("b:nm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FwdArrowSmall");
document.getElementById("b:ny:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastFwdArrowSmall");
}
this._calWidgetInited=true;
};
DwtCalendar.prototype.setMouseOverDayCallback=function(_e7d){
this._mouseOverDayCB=_e7d;
};
DwtCalendar.prototype.getDndDate=function(){
var _e7e=this._lastDndCell;
if(_e7e){
return new Date(_e7e._year,_e7e._month,_e7e._day);
}else{
return null;
}
};
DwtCalendar._tmpDate=new Date();
DwtCalendar._tmpDate.setHours(0,0,0,0);
DwtCalendar.prototype._mouseOverListener=function(ev){
var _e80=ev.target;
if(_e80.id.charAt(0)=="c"){
this._setClassName(_e80,DwtCalendar._ACTIVATED);
if(this._mouseOverDayCB){
DwtCalendar._tmpDate.setFullYear(_e80._year,_e80._month,_e80._day);
this._mouseOverDayCB.run(this,DwtCalendar._tmpDate);
}
}else{
if(_e80.id.charAt(0)=="t"){
return;
_e80.className=DwtCssStyle.ACTIVATED;
}else{
if(_e80.id.charAt(0)=="b"){
var img;
if(_e80.firstChild==null){
img=_e80;
AjxImg.getParentElement(_e80).className=DwtCalendar._BUTTON_ACTIVATED_CLASS;
}else{
_e80.className=DwtCalendar._BUTTON_ACTIVATED_CLASS;
img=AjxImg.getImageElement(_e80);
}
img.className=img._origClassName;
}else{
if(_e80.id.charAt(0)=="w"){
}
}
}
}
ev._stopPropagation=true;
};
DwtCalendar.prototype._mouseOutListener=function(ev){
this.setToolTipContent(null);
var _e83=ev.target;
if(_e83.id.charAt(0)=="c"){
this._setClassName(_e83,DwtCalendar._NORMAL);
}else{
if(_e83.id.charAt(0)=="t"){
return;
_e83.className=DwtCalendar._TITLE_CLASS;
}else{
if(_e83.id.charAt(0)=="b"){
var img;
_e83.className=DwtCalendar._BUTTON_CLASS;
if(_e83.firstChild==null){
img=_e83;
AjxImg.getParentElement(_e83).className=DwtCalendar._BUTTON_CLASS;
}else{
_e83.className=DwtCalendar._BUTTON_CLASS;
img=AjxImg.getImageElement(_e83);
}
img.className=img._origClassName;
}else{
if(_e83.id.charAt(0)=="w"){
}
}
}
}
};
DwtCalendar.prototype._mouseDownListener=function(ev){
if(ev.button==DwtMouseEvent.LEFT){
var _e86=ev.target;
if(_e86.id.charAt(0)=="c"){
this._setClassName(_e86,DwtCalendar._TRIGGERED);
}else{
if(_e86.id.charAt(0)=="t"){
_e86.className=DwtCalendar._TITLE_TRIGGERED_CLASS;
}else{
if(_e86.id.charAt(0)=="b"){
var img;
if(_e86.firstChild==null){
img=_e86;
AjxImg.getParentElement(_e86).className=DwtCalendar._BUTTON_TRIGGERED_CLASS;
}else{
_e86.className=DwtCalendar._BUTTON_TRIGGERED_CLASS;
img=AjxImg.getImageElement(_e86);
}
img.className=img._origClassName;
}else{
if(_e86.id.charAt(0)=="w"){
}
}
}
}
}
};
DwtCalendar.prototype._mouseUpListener=function(ev){
var _e89=ev.target;
if(ev.button==DwtMouseEvent.LEFT){
if(_e89.id.charAt(0)=="c"){
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu();
}
if(this.setDate(new Date(_e89._year,_e89._month,_e89._day))){
return;
}
this._setClassName(_e89,DwtCalendar._ACTIVATED);
}else{
if(_e89.id.charAt(0)=="b"){
var img;
if(_e89.firstChild==null){
img=_e89;
AjxImg.getParentElement(_e89).className=DwtCalendar._BUTTON_ACTIVATED_CLASS;
}else{
_e89.className=DwtCalendar._BUTTON_ACTIVATED_CLASS;
img=AjxImg.getImageElement(_e89);
}
img.className=img._origClassName;
if(img.id.indexOf("py")!=-1){
this._prevYear();
}else{
if(img.id.indexOf("pm")!=-1){
this._prevMonth();
}else{
if(img.id.indexOf("nm")!=-1){
this._nextMonth();
}else{
this._nextYear();
}
}
}
}else{
if(_e89.id.charAt(0)=="t"){
_e89.className=DwtCalendar._TITLE_ACTIVATED_CLASS;
this.setDate(new Date(),this._skipNotifyOnPage);
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu();
}
}
}
}
}else{
if(ev.button==DwtMouseEvent.RIGHT&&_e89.id.charAt(0)=="c"){
this._notifyListeners(DwtEvent.ACTION,0,new Date(_e89._year,_e89._month,_e89._day),ev);
}
}
};
DwtCalendar.prototype._doubleClickListener=function(ev){
var _e8c=ev.target;
if(this._selectionEvent){
this._selectionEvent.type=DwtCalendar.DATE_DBL_CLICKED;
}
if(_e8c.id.charAt(0)=="c"){
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu();
}
this.setDate(new Date(_e8c._year,_e8c._month,_e8c._day),false,false,true);
}
};
DwtCalendar.prototype._prevMonth=function(ev){
var d=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(d,AjxDateUtil.MONTH,-1),this._skipNotifyOnPage);
};
DwtCalendar.prototype._nextMonth=function(ev){
var d=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(d,AjxDateUtil.MONTH,1),this._skipNotifyOnPage);
};
DwtCalendar.prototype._prevYear=function(ev){
var d=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(d,AjxDateUtil.YEAR,-1),this._skipNotifyOnPage);
};
DwtCalendar.prototype._nextYear=function(ev){
var d=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(d,AjxDateUtil.YEAR,1),this._skipNotifyOnPage);
};
DwtCalendar.getDateFormatter=function(){
if(!DwtCalendar._dateFormatter){
DwtCalendar._dateFormatter=new AjxDateFormat(AjxMsg.formatCalDate);
}
return DwtCalendar._dateFormatter;
};
DwtCalendar.getDateLongFormatter=function(){
if(!DwtCalendar._dateLongFormatter){
DwtCalendar._dateLongFormatter=new AjxDateFormat(AjxMsg.formatCalDateLong);
}
return DwtCalendar._dateLongFormatter;
};
DwtCalendar.getDateFullFormatter=function(){
if(!DwtCalendar._dateFullFormatter){
DwtCalendar._dateFullFormatter=new AjxDateFormat(AjxMsg.formatCalDateFull);
}
return DwtCalendar._dateFullFormatter;
};
DwtCalendar.getHourFormatter=function(){
if(!DwtCalendar._hourFormatter){
DwtCalendar._hourFormatter=new AjxMessageFormat(AjxMsg.formatCalHour);
}
return DwtCalendar._hourFormatter;
};
DwtCalendar.getDayFormatter=function(){
if(!DwtCalendar._dayFormatter){
DwtCalendar._dayFormatter=new AjxDateFormat(AjxMsg.formatCalDay);
}
return DwtCalendar._dayFormatter;
};
DwtCalendar.getMonthFormatter=function(){
if(!DwtCalendar._monthFormatter){
DwtCalendar._monthFormatter=new AjxDateFormat(AjxMsg.formatCalMonth);
}
return DwtCalendar._monthFormatter;
};
DwtCalendar.prototype._dragEnter=function(ev){
};
DwtCalendar.prototype._dragHover=function(ev){
};
DwtCalendar.prototype._dragOver=function(ev){
var _e98=ev.target;
if(_e98.id.charAt(0)=="c"){
this._setClassName(_e98,DwtCalendar._ACTIVATED);
this._lastDndCell=_e98;
}else{
this._lastDndCell=null;
}
};
DwtCalendar.prototype._dragLeave=function(ev){
};
function DwtPropertyPage(_e9a,_e9b,_e9c){
if(arguments.length==0){
return;
}
var _e9d=_e9b||"DwtPropertyPage";
DwtComposite.call(this,_e9a,_e9b,_e9c);
this._fieldIds=new Object();
this._fildDivIds=new Object();
this._isDirty=false;
}
DwtPropertyPage.prototype=new DwtComposite;
DwtPropertyPage.prototype.constructor=DwtPropertyPage;
DwtPropertyPage.prototype.toString=function(){
return "DwtPropertyPage";
};
DwtPropertyPage.prototype.setDirty=function(isD){
this._isDirty=isD;
};
DwtPropertyPage.prototype.isDirty=function(){
return this._isDirty;
};
DwtPropertyPage.prototype._installOnKeyUpHandler=function(_e9f,func){
if(!_e9f){
return;
}
var e=null;
e=document.getElementById(this._fieldIds[_e9f]);
if(e){
Dwt.setHandler(e,DwtEvent.ONKEYUP,func?func:this._onKeyUp);
e._view=this;
e._field=_e9f;
}
};
DwtPropertyPage.prototype._installOnClickHandler=function(_ea2,func){
if(!_ea2){
return;
}
var e=document.getElementById(this._fieldIds[_ea2]);
if(e){
Dwt.setHandler(e,DwtEvent.ONCLICK,func?func:this._onClick);
e._view=this;
e._field=_ea2;
}
};
DwtPropertyPage.prototype._onClick=function(ev){
this._view.setDirty(true);
return true;
};
DwtPropertyPage.prototype._onKeyUp=function(ev){
this._view.setDirty(true);
return true;
};
DwtPropertyPage.prototype._installOnChangeHandler=function(_ea7,func){
if(!_ea7){
return;
}
var e=null;
e=document.getElementById(this._fieldIds[_ea7]);
if(e){
Dwt.setHandler(e,DwtEvent.ONCHANGE,func?func:this._onChange);
e._view=this;
e._field=_ea7;
}
};
DwtPropertyPage._onChange=function(ev){
this._view.setDirty(true);
return true;
};
DwtPropertyPage.prototype._onChange2=function(ev){
this.setDirty(true);
return true;
};
DwtPropertyPage.prototype._addDwtSelectEntryRow=function(_eac,_ead,html,idx,_eb0){
var _eb1="30ex";
if(_eb0){
_eb1=_eb0;
}
html[idx++]="<tr valign='center'>";
idx=this._addDwtSelectEntryCell(_eac,_ead,html,idx,_eb1);
html[idx++]="</tr>";
return idx;
};
DwtPropertyPage.prototype._addDwtSelectEntryCell=function(_eb2,_eb3,html,idx,_eb6){
var id=Dwt.getNextId();
this._fieldIds[_eb2]=id;
if(_eb3){
html[idx++]="<td align='left' style='width:"+_eb6+"'>";
html[idx++]=AjxStringUtil.htmlEncode(_eb3)+":";
html[idx++]="</td>";
}
html[idx++]="<td align='left'>";
html[idx++]="<div id='"+id+"'></div></td>";
return idx;
};
DwtPropertyPage.prototype._addBoolEntryRow=function(_eb8,_eb9,html,idx,_ebc){
html[idx++]="<tr valign='center'>";
idx=this._addBoolEntryCell(_eb8,_eb9,html,idx,_ebc);
html[idx++]="</tr>";
return idx;
};
DwtPropertyPage.prototype._addBoolEntryCell=function(_ebd,_ebe,html,idx,_ec1){
var id=Dwt.getNextId();
this._fieldIds[_ebd]=id;
var _ec3="20ex";
if(_ec1){
_ec3=_ec1;
}
if(_ebe){
html[idx++]="<td style='width:"+_ec3+";' align='left'>";
html[idx++]=AjxStringUtil.htmlEncode(_ebe)+":";
html[idx++]="</td>";
}
html[idx++]="<td align='left'>";
html[idx++]="<input type='checkbox' id='"+id+"'>";
html[idx++]="</td>";
return idx;
};
DwtPropertyPage.prototype._addTextAreaEntryRow=function(_ec4,_ec5,html,idx,_ec8){
var _ec9="on";
if(_ec8){
_ec9="off";
}
var id=Dwt.getNextId();
this._fieldIds[_ec4]=id;
html[idx++]="<tr valign='center'>";
html[idx++]="<td align='left' style='width:60ex;'>";
html[idx++]=AjxStringUtil.htmlEncode(_ec5)+":";
html[idx++]="</td></tr>";
html[idx++]="<tr valign='center'><td align='left' style='width:60ex;'><textarea wrap='"+_ec9+"' rows='8' cols ='60' id='";
html[idx++]=id;
html[idx++]="'/></textarea></td></tr>";
return idx;
};
DwtPropertyPage.prototype._addEntryRow=function(_ecb,_ecc,html,idx,type,_ed0,_ed1,_ed2,_ed3){
html[idx++]="<tr valign='center'>";
idx=this._addEntryCell(_ecb,_ecc,html,idx,type,_ed0,_ed1,_ed2,_ed3);
html[idx++]="</tr>";
return idx;
};
DwtPropertyPage.prototype._addEntryCell=function(_ed4,_ed5,html,idx,type,_ed9,_eda,_edb,_edc){
if(type==null){
type="text";
}
if(_ed9==null){
_ed9=35;
}
var _edd="20ex";
if(_edb){
_edd=_edb;
}
var id=Dwt.getNextId();
this._fieldIds[_ed4]=id;
if(_ed5){
html[idx++]="<td align='left' style='width:"+_edd+";'>";
html[idx++]=AjxStringUtil.htmlEncode(_ed5)+":";
html[idx++]="</td>";
}
html[idx++]="<td ";
if(_edc){
html[idx++]="class='redAsteric' ";
}
html[idx++]="\talign='left'><input autocomplete='off' size='"+_ed9+"' type='"+type+"' id='";
html[idx++]=id;
html[idx++]="'";
if(_edc){
html[idx++]="/>*";
}else{
html[idx++]="/>&nbsp;";
}
if(_eda!=null){
html[idx++]=_eda;
}
html[idx++]="</td>";
return idx;
};
DwtPropertyPage.prototype._createHTML=function(){
};
function DwtTabView(_edf,_ee0,_ee1){
if(arguments.length==0){
return;
}
var _ee2=_ee0||"DwtTabView";
var _ee3=DwtControl.ABSOLUTE_STYLE;
if((_ee1!==void 0)&&(_ee1!==null)){
_ee3=_ee1;
}
DwtComposite.call(this,_edf,_ee2,_ee3);
this._stateChangeEv=new DwtEvent(true);
this._tabs=new Array();
this._tabIx=1;
this._pageDiv=document.createElement("div");
this._pageDiv.className=_ee2;
this._pageDiv.style.position=DwtControl.STATIC_STYLE;
this._tabBar=new DwtTabBar(this);
this._createHTML();
}
DwtTabView.prototype=new DwtComposite;
DwtTabView.prototype.constructor=DwtTabView;
DwtTabView.prototype.toString=function(){
return "DwtTabView";
};
DwtTabView.Z_ACTIVE_TAB=Dwt.Z_VIEW+10;
DwtTabView.Z_HIDDEN_TAB=Dwt.Z_HIDDEN;
DwtTabView.Z_TAB_PANEL=Dwt.Z_VIEW+20;
DwtTabView.Z_CURTAIN=Dwt.Z_CURTAIN;
DwtTabView.prototype.addStateChangeListener=function(_ee4){
this._eventMgr.addListener(DwtEvent.STATE_CHANGE,_ee4);
};
DwtTabView.prototype.removeStateChangeListener=function(_ee5){
this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,_ee5);
};
DwtTabView.prototype.addTab=function(_ee6,_ee7){
var _ee8=this._tabIx++;
this._tabs[_ee8]={title:_ee6,button:this._tabBar.addButton(_ee8,_ee6)};
this.setTabView(_ee8,_ee7);
if(_ee8==1){
if(_ee7 instanceof AjxCallback){
_ee7=_ee7.run(_ee8);
}
if(_ee7){
_ee7.showMe();
}
this._currentTabKey=_ee8;
this.switchToTab(_ee8);
}else{
if(_ee7&&!(_ee7 instanceof AjxCallback)){
_ee7.hideMe();
Dwt.setVisible(_ee7.getHtmlElement(),false);
}
}
this._tabBar.addSelectionListener(_ee8,new AjxListener(this,DwtTabView.prototype._tabButtonListener));
return _ee8;
};
DwtTabView.prototype.getCurrentTab=function(){
return this._currentTabKey;
};
DwtTabView.prototype.getNumTabs=function(){
return (this._tabs.length-1);
};
DwtTabView.prototype.getTab=function(_ee9){
if(this._tabs&&this._tabs[_ee9]){
return this._tabs[_ee9];
}else{
return null;
}
};
DwtTabView.prototype.getTabTitle=function(_eea){
return this._tabs&&this._tabs[_eea]?this._tabs[_eea]["title"]:null;
};
DwtTabView.prototype.getTabButton=function(_eeb){
return this._tabs&&this._tabs[_eeb]?this._tabs[_eeb]["button"]:null;
};
DwtTabView.prototype.setTabView=function(_eec,_eed){
var tab=this.getTab(_eec);
tab.view=_eed;
if(_eed&&!(_eed instanceof AjxCallback)){
this._pageDiv.appendChild(_eed.getHtmlElement());
_eed._tabKey=_eec;
}
};
DwtTabView.prototype.getTabView=function(_eef){
var tab=this.getTab(_eef);
var _ef1=tab&&tab.view;
if(_ef1 instanceof AjxCallback){
var _ef2=_ef1;
_ef1=_ef2.run(_eef);
this.setTabView(_eef,_ef1);
var size=this._getTabSize();
_ef1.setSize(size.x,size.y);
}
return _ef1;
};
DwtTabView.prototype.switchToTab=function(_ef4){
if(this._tabs&&this._tabs[_ef4]){
this._showTab(_ef4);
this._tabBar.openTab(_ef4);
}
if(this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv);
}
};
DwtTabView.prototype.setBounds=function(x,y,_ef7,_ef8){
DwtComposite.prototype.setBounds.call(this,x,y,_ef7,_ef8);
this._resetTabSizes(_ef7,_ef8);
};
DwtTabView.prototype.getActiveView=function(){
return this._tabs[this._currentTabKey].view;
};
DwtTabView.prototype.getKeyMapName=function(){
return "DwtTabView";
};
DwtTabView.prototype.resetKeyBindings=function(){
var kbm=this.shell.getKeyboardMgr();
if(kbm.isEnabled()){
var kmm=kbm.__keyMapMgr;
var num=this.getNumTabs();
var seqs=kmm.getKeySequences("DwtTabView","GoToTab");
for(var k=0;k<seqs.length;k++){
var ks=seqs[k];
for(var i=1;i<=num;i++){
var _f00=ks.replace(/NNN/,i);
kmm.setMapping("DwtTabView",_f00,"GoToTab"+i);
}
}
kmm.reloadMap("DwtTabView");
}
};
DwtTabView.prototype.handleKeyAction=function(_f01){
switch(_f01){
case DwtKeyMap.NEXT_TAB:
var _f02=this.getCurrentTab();
if(_f02<this.getNumTabs()){
this.switchToTab(_f02+1);
}
break;
case DwtKeyMap.PREV_TAB:
var _f02=this.getCurrentTab();
if(_f02>1){
this.switchToTab(_f02-1);
}
break;
default:
var m=_f01.match(DwtKeyMap.GOTO_TAB_RE);
if(m&&m.length){
var idx=m[1];
if((idx<=this.getNumTabs())&&(idx!=this.getCurrentTab())){
this.switchToTab(idx);
}
}else{
return false;
}
}
return true;
};
DwtTabView.prototype._resetTabSizes=function(_f05,_f06){
if(this._tabs&&this._tabs.length){
for(var _f07 in this._tabs){
var _f08=this._tabs[_f07].view;
if(_f08&&!(_f08 instanceof AjxCallback)){
_f08.resetSize(_f05,_f06);
}
}
}
};
DwtTabView.prototype._getTabSize=function(){
var size=this.getSize();
var _f0a=size.x||this.getHtmlElement().clientWidth;
var _f0b=size.y||this.getHtmlElement().clientHeight;
var _f0c=this._tabBar.getSize();
var _f0d=_f0c.y||this._tabBar.getHtmlElement().clientHeight;
var _f0e=_f0a;
var _f0f=_f0b-_f0d;
return new DwtPoint(_f0e,_f0f);
};
DwtTabView.prototype._createHTML=function(){
this._table=document.createElement("table");
this.getHtmlElement().appendChild(this._table);
this._table.width="100%";
this._table.border=this._table.cellPadding=this._table.cellSpacing=0;
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
var row1=this._table.insertRow(-1);
row1.align="left";
row1.vAlign="middle";
var col1=row1.insertCell(-1);
col1.align="left";
col1.vAlign="middle";
col1.noWrap=true;
col1.width="100%";
col1.className="DwtTabTable";
col1.appendChild(this._tabBar.getHtmlElement());
var row2=this._table.insertRow(-1);
row2.align="left";
row2.vAlign="middle";
var col2=row2.insertCell(-1);
col2.align="left";
col2.vAlign="middle";
col2.noWrap=true;
col2.appendChild(this._pageDiv);
};
DwtTabView.prototype.addChild=function(_f14){
this._children.add(_f14);
};
DwtTabView.prototype._showTab=function(_f15){
if(this._tabs&&this._tabs[_f15]){
this._currentTabKey=_f15;
this._hideAllTabs();
var _f16=this.getTabView(_f15);
this.applyCaretHack();
Dwt.setVisible(_f16.getHtmlElement(),true);
_f16.showMe();
}
};
DwtTabView.prototype._hideAllTabs=function(){
if(this._tabs&&this._tabs.length){
for(var _f17 in this._tabs){
var _f18=this._tabs[_f17].view;
if(_f18&&!(_f18 instanceof AjxCallback)){
_f18.hideMe();
Dwt.setVisible(_f18.getHtmlElement(),false);
}
}
}
};
DwtTabView.prototype._tabButtonListener=function(ev){
if(ev.item instanceof DwtButton){
this.switchToTab(ev.item.getData("tabKey"));
}else{
if(ev&&ev.target){
var elem=ev.target;
while(elem.tagName!="TABLE"&&elem.offsetParent){
elem=elem.offsetParent;
}
var _f1b=elem.getAttribute("tabKey");
if((_f1b!==void 0)&&(_f1b!==null)){
this.switchToTab(_f1b);
}
}
}
};
function DwtTabViewPage(_f1c,_f1d,_f1e){
if(arguments.length==0){
return;
}
var _f1f=_f1d||"DwtTabViewPage";
var ps=_f1e||DwtControl.ABSOLUTE_STYLE;
this._rendered=true;
DwtPropertyPage.call(this,_f1c,_f1f,ps);
}
DwtTabViewPage.prototype=new DwtPropertyPage;
DwtTabViewPage.prototype.constructor=DwtTabViewPage;
DwtTabViewPage.prototype.toString=function(){
return "DwtTabViewPage";
};
DwtTabViewPage.prototype.showMe=function(){
this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
if(this.parent.getHtmlElement().offsetHeight>80){
this.getHtmlElement().style.height=this.parent.getHtmlElement().offsetHeight-80;
}else{
var _f21=parseInt(this.parent.getHtmlElement().style.height);
var _f22=AjxStringUtil.getUnitsFromSizeString(this.parent.getHtmlElement().style.height);
if(_f21>80){
this.getHtmlElement().style.height=(Number(_f21-80).toString()+_f22);
}
}
if(this.parent.getHtmlElement().offsetWidth>0){
this.getHtmlElement().style.width=this.parent.getHtmlElement().offsetWidth;
}else{
this.getHtmlElement().style.width=this.parent.getHtmlElement().style.width;
}
};
DwtTabViewPage.prototype.hideMe=function(){
this.setZIndex(DwtTabView.Z_HIDDEN_TAB);
};
DwtTabViewPage.prototype.resetSize=function(_f23,_f24){
if(this._rendered){
this.setSize(_f23,_f24);
}
};
function DwtTabBar(_f25,_f26,_f27){
if(arguments.length==0){
return;
}
this._buttons=new Array();
this._tbuttons=new Array();
this._btnStyle=_f27?_f27:"DwtTabButton";
this._btnImage=null;
this._currentTabKey=1;
var _f28=_f26?_f26:"DwtTabBar";
DwtToolBar.call(this,_f25,_f28,DwtControl.STATIC_STYLE);
this.addSpacer(null,0);
this.addFiller(null,1);
}
DwtTabBar.prototype=new DwtToolBar;
DwtTabBar.prototype.constructor=DwtTabBar;
DwtTabBar.prototype.toString=function(){
return "DwtTabBar";
};
DwtTabBar.prototype.getCurrentTab=function(){
return this._currentTabKey;
};
DwtTabBar.prototype.addSpacer=function(size,_f2a){
var el=DwtToolBar.prototype.addSpacer.apply(this,arguments);
el.parentNode.style.verticalAlign="bottom";
return el;
};
DwtTabBar.prototype.addFiller=function(_f2c,_f2d){
var el=DwtToolBar.prototype.addFiller.apply(this,arguments);
el.parentNode.style.verticalAlign="bottom";
return el;
};
DwtTabBar.prototype.addStateChangeListener=function(_f2f){
this._eventMgr.addListener(DwtEvent.STATE_CHANGE,_f2f);
};
DwtTabBar.prototype.removeStateChangeListener=function(_f30){
this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,_f30);
};
DwtTabBar.prototype.addSelectionListener=function(_f31,_f32){
this._buttons[_f31].addSelectionListener(_f32);
this._tbuttons[_f31].table.setAttribute("tabKey",_f31);
this._tbuttons[_f31].leftImg.setAttribute("tabKey",_f31);
this._tbuttons[_f31].rightImg.setAttribute("tabKey",_f31);
this._tbuttons[_f31].leftTopImg.setAttribute("tabKey",_f31);
this._tbuttons[_f31].rightTopImg.setAttribute("tabKey",_f31);
this._tbuttons[_f31].topImg.setAttribute("tabKey",_f31);
this._tbuttons[_f31]._bottomRow.setAttribute("tabKey",_f31);
this._tbuttons[_f31].addListener(DwtEvent.ONMOUSEUP,_f32);
};
DwtTabBar.prototype.removeSelectionListener=function(_f33,_f34){
this._buttons[_f33].removeSelectionListener(_f34);
};
DwtTabBar.prototype.addButton=function(_f35,_f36){
var tb=this._tbuttons[_f35]=new DwtTabButton(this);
var b=this._buttons[_f35]=new DwtButton(tb,null,this._btnStyle,DwtControl.RELATIVE_STYLE);
var be=b.getHtmlElement();
be.style.position="relative";
be.style.top="-3px";
this._buttons[_f35].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
this._tbuttons[_f35].addListener(DwtEvent.ONMOUSEUP,(new AjxListener(this,DwtTabBar._setActiveTab)));
if(this._btnImage!=null){
b.setImage(this._btnImage);
}
if(_f36!=null){
b.setText(_f36);
}
b.setEnabled(true);
b.setData("tabKey",_f35);
if(parseInt(_f35)==1){
tb.setOpen();
}
return b;
};
DwtTabBar.prototype.getButton=function(_f3a){
if(this._buttons[_f3a]){
return this._buttons[_f3a];
}else{
return null;
}
};
DwtTabBar.prototype.openTab=function(tabK){
this._currentTabKey=tabK;
var cnt=this._tbuttons.length;
for(var ix=0;ix<cnt;ix++){
if(ix==tabK){
continue;
}
if(this._tbuttons[ix]){
this._tbuttons[ix].setClosed();
}
}
if(this._tbuttons[tabK]){
this._tbuttons[tabK].setOpen();
}
var _f3e=parseInt(tabK)+1;
if(this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv);
}
};
DwtTabBar.prototype.__itemPaddingRight="0px";
DwtTabBar.prototype._addItem=function(type,_f40,_f41){
if(!AjxUtil.isNumber(_f41)){
var el=this.getHtmlElement().firstChild;
_f41=this._style==DwtToolBar.HORIZ_STYLE?(el.rows[0].cells.length-1):(el.rows.length-1);
}
DwtToolBar.prototype._addItem.call(this,type,_f40,_f41);
};
DwtTabBar.prototype._createSpacerElement=function(){
var _f43=document.createElement("table");
_f43.width="100%";
_f43.cellSpacing=_f43.cellPadding=0;
var row1=_f43.insertRow(_f43.rows.length);
var row2=_f43.insertRow(_f43.rows.length);
var row3=_f43.insertRow(_f43.rows.length);
var _f47=row3.insertCell(row3.cells.length);
AjxImg.setImage(_f47,"TabSpacer__H",true);
return _f43;
};
DwtTabBar.prototype._createFillerElement=DwtTabBar.prototype._createSpacerElement;
DwtTabBar._setActiveTab=function(ev){
var tabK=null;
if(ev&&ev.item){
tabK=ev.item.getData("tabKey");
}else{
if(ev&&ev.target){
var elem=ev.target;
while(elem.tagName!="TABLE"&&elem.offsetParent){
elem=elem.offsetParent;
}
tabK=elem.getAttribute("tabKey");
if(tabK==null){
return false;
}
}else{
return false;
}
}
this.openTab(tabK);
};
function DwtTabButton(_f4b){
if(arguments.length==0){
return;
}
this._isClosed=true;
DwtComposite.call(this,_f4b,"DwtTabButton");
this._inactiveClassName="DwtTabButton-inactive";
this._activeClassName="DwtTabButton-active";
this._createHtml();
this._setMouseEventHdlrs();
this._mouseOverListener=new AjxListener(this,DwtTabButton.prototype._mouseOverListener);
this._mouseOutListener=new AjxListener(this,DwtTabButton.prototype._mouseOutListener);
this.addListener(DwtEvent.ONMOUSEOVER,this._mouseOverListener);
this.addListener(DwtEvent.ONMOUSEOUT,this._mouseOutListener);
this._mouseOutAction=new AjxTimedAction(this,this._handleMouseOut);
this._mouseOutActionId=-1;
}
DwtTabButton.prototype=new DwtComposite;
DwtTabButton.prototype.constructor=DwtTabButton;
DwtTabButton.prototype.toString=function(){
return "DwtTabButton";
};
DwtTabButton.prototype._createHtml=function(){
this.table=document.createElement("table");
this.table.border=this.table.cellPadding=this.table.cellSpacing=0;
this.table.align="center";
this.table.width="100%";
this._topRow=this.table.insertRow(-1);
this._middleRow=this.table.insertRow(-1);
this._bottomRow=this.table.insertRow(-1);
this._leftTopCell=this._topRow.insertCell(-1);
this._centerTopCell=this._topRow.insertCell(-1);
this._rightTopCell=this._topRow.insertCell(-1);
this._leftMiddleCell=this._middleRow.insertCell(-1);
this._centerMiddleCell=this._middleRow.insertCell(-1);
this._rightMiddleCell=this._middleRow.insertCell(-1);
this._leftBottomCell=this._bottomRow.insertCell(-1);
this._centerBottomCell=this._bottomRow.insertCell(-1);
this._rightBottomCell=this._bottomRow.insertCell(-1);
this._leftTopCell.className="DwtTabButtonTL";
this._centerTopCell.className="DwtTabButtonTM";
this._rightTopCell.className="DwtTabButtonTR";
this._leftBottomCell.className="DwtTabButtonBL";
this._centerBottomCell.className="DwtTabButtonBM";
this._rightBottomCell.className="DwtTabButtonBR";
this.leftTopImg=document.createElement("div");
this.topImg=document.createElement("div");
this.rightTopImg=document.createElement("div");
AjxImg.setImage(this.leftTopImg,"Tab_TL",true);
AjxImg.setImage(this.topImg,"Tab_T__H",true);
AjxImg.setImage(this.rightTopImg,"Tab_TR",true);
this._leftTopCell.appendChild(this.leftTopImg);
this._centerTopCell.appendChild(this.topImg);
this._rightTopCell.appendChild(this.rightTopImg);
this.leftImg=this._leftMiddleCell;
this.centerImg=this._centerMiddleCell;
this.rightImg=this._rightMiddleCell;
AjxImg.setImage(this.leftImg,"Tab_L__V",true);
AjxImg.setImage(this.centerImg,"Tab__BG",true);
AjxImg.setImage(this.rightImg,"Tab_R__V",true);
this.leftBottomImg=document.createElement("div");
this.bottomImg=document.createElement("div");
this.rightBottomImg=document.createElement("div");
AjxImg.setImage(this.leftBottomImg,"Tab_BL",true);
AjxImg.setImage(this.bottomImg,"Tab_B__H",true);
AjxImg.setImage(this.rightBottomImg,"Tab_BR",true);
this._leftBottomCell.appendChild(this.leftBottomImg);
this._centerBottomCell.appendChild(this.bottomImg);
this._rightBottomCell.appendChild(this.rightBottomImg);
this.getHtmlElement().appendChild(this.table);
this.table.className=this._inactiveClassName;
};
DwtTabButton.prototype.setOpen=function(){
this.table.className=this._activeClassName;
this.setTabImageState("TabSel");
this._isClosed=false;
};
DwtTabButton.prototype.setClosed=function(){
this.table.className=this._inactiveClassName;
this.setTabImageState("Tab");
this._isClosed=true;
};
DwtTabButton.prototype.addChild=function(_f4c){
this._centerMiddleCell.appendChild(_f4c.getHtmlElement());
_f4c.addListener(DwtEvent.ONMOUSEOVER,this._mouseOverListener);
_f4c.addListener(DwtEvent.ONMOUSEOUT,this._mouseOutListener);
};
DwtTabButton.prototype._mouseOverListener=function(ev){
if(this._mouseOutActionId!=-1){
AjxTimedAction.cancelAction(this._mouseOutActionId);
this._mouseOutActionId=-1;
}
if(this._isClosed){
this.setTabImageState("TabHover");
}
};
DwtTabButton.prototype._mouseOutListener=function(ev){
if(AjxEnv.isIE){
this._mouseOutActionId=AjxTimedAction.scheduleAction(this._mouseOutAction,1);
}else{
this._handleMouseOut();
}
};
DwtTabButton.prototype._handleMouseOut=function(){
this._mouseOutActionId=-1;
if(this._isClosed){
this.setTabImageState("Tab");
}
};
DwtTabButton.prototype.setTabImageState=function(_f4f){
AjxImg.setImage(this.leftTopImg,_f4f+"_TL",true);
AjxImg.setImage(this.topImg,_f4f+"_T__H",true);
AjxImg.setImage(this.rightTopImg,_f4f+"_TR",true);
AjxImg.setImage(this.leftImg,_f4f+"_L__V",true);
AjxImg.setImage(this._centerMiddleCell,_f4f+"__BG",true);
AjxImg.setImage(this.rightImg,_f4f+"_R__V",true);
AjxImg.setImage(this.leftBottomImg,_f4f+"_BL",true);
AjxImg.setImage(this.bottomImg,_f4f+"_B__H",true);
AjxImg.setImage(this.rightBottomImg,_f4f+"_BR",true);
};
function DwtWizardDialog(_f50,_f51,_f52,w,h){
if(arguments.length==0){
return;
}
var _f55=_f51||"DwtDialog";
var _f56=new DwtDialog_ButtonDescriptor(DwtWizardDialog.NEXT_BUTTON,AjxMsg._next,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goNext));
var _f57=new DwtDialog_ButtonDescriptor(DwtWizardDialog.PREV_BUTTON,AjxMsg._prev,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goPrev));
var _f58=new DwtDialog_ButtonDescriptor(DwtWizardDialog.FINISH_BUTTON,AjxMsg._finish,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.finishWizard));
DwtDialog.call(this,_f50,_f55,null,[DwtDialog.CANCEL_BUTTON],[_f57,_f56,_f58]);
if(!w){
this._contentW="80ex";
}else{
this._contentW=w;
}
if(!h){
this._contentH="100ex";
}else{
this._contentH=h;
}
this._pages=new Array();
this._pageIx=1;
this._currentPage=1;
this._progressDiv=document.createElement("div");
this._progressDiv.style.position=DwtControl.STATIC_STYLE;
this._pageDiv=document.createElement("div");
this._pageDiv.className="DwtWizardDialogPageDiv";
this._pageDiv.style.width=this._contentW;
this._pageDiv.style.height=this._contentH;
this._progressBar=new DwtWizProgressBar(this);
this._createContentHtml();
this.setTitle(_f52);
}
DwtWizardDialog.prototype=new DwtDialog;
DwtWizardDialog.prototype.constructor=DwtWizardDialog;
DwtWizardDialog.Z_ACTIVE_PAGE=Dwt.Z_VIEW+10;
DwtWizardDialog.Z_HIDDEN_PAGE=Dwt.Z_HIDDEN;
DwtWizardDialog.Z_TAB_PANEL=Dwt.Z_VIEW+20;
DwtWizardDialog.Z_CURTAIN=Dwt.Z_CURTAIN;
DwtWizardDialog.NEXT_BUTTON=12;
DwtWizardDialog.PREV_BUTTON=11;
DwtWizardDialog.FINISH_BUTTON=13;
DwtWizardDialog.prototype.toString=function(){
return "DwtWizardDialog";
};
DwtWizardDialog.prototype.popdown=function(){
DwtDialog.prototype.popdown.call(this);
this._hideAllPages();
};
DwtWizardDialog.prototype.goPage=function(_f59){
if(this._pages&&this._pages[_f59]){
this._currentPage=_f59;
this._showPage(_f59);
this._progressBar.showStep(_f59);
this._pages[_f59].setActive();
}
};
DwtWizardDialog.prototype.goNext=function(){
var _f5a=this._currentPage+1;
if(this._pages&&this._pages[this._currentPage]){
this._pages[this._currentPage].switchToNextPage(_f5a);
}
};
DwtWizardDialog.prototype.goPrev=function(){
var _f5b=this._currentPage-1;
if(this._pages&&this._pages[this._currentPage]){
this._pages[this._currentPage].switchToPrevPage(_f5b);
}
};
DwtWizardDialog.prototype.finishWizard=function(){
this.popdown();
};
DwtWizardDialog.prototype.getPage=function(_f5c){
if(this._pages&&this._pages[_f5c]){
return this._pages[_f5c];
}else{
return null;
}
};
DwtWizardDialog.prototype.addPage=function(_f5d,_f5e){
var _f5f=this._pageIx++;
this._pages[_f5f]=_f5d;
this._progressBar.addStep(_f5f,_f5e);
this._pageDiv.appendChild(this._pages[_f5f].getHtmlElement());
if(_f5f==1){
this._pages[_f5f].setZIndex(DwtWizardDialog.Z_ACTIVE_PAGE);
}else{
this._pages[_f5f].setZIndex(DwtWizardDialog.Z_HIDDEN_PAGE);
Dwt.setVisible(this._pages[_f5f].getHtmlElement(),false);
}
return _f5f;
};
DwtWizardDialog.prototype._createContentHtml=function(){
this._table=document.createElement("table");
this._table.border=0;
this._table.width=this._contentW;
this._table.cellPadding=this._table.cellSpacing=0;
Dwt.associateElementWithObject(this._table,this);
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
var row1;
var col1;
row1=this._table.insertRow(0);
row1.align="left";
row1.vAlign="middle";
col1=row1.insertCell(row1.cells.length);
col1.align="left";
col1.vAlign="middle";
col1.noWrap=true;
col1.width="100%";
col1.className="DwtTabTable";
col1.appendChild(this._progressBar.getHtmlElement());
var _f62;
var _f63;
_f62=this._table.insertRow(1);
_f62.align="center";
_f62.vAlign="middle";
_f63=_f62.insertCell(_f62.cells.length);
_f63.align="left";
_f63.vAlign="middle";
_f63.noWrap=true;
_f63.style.width=this._contentW;
var _f64=document.createElement("div");
_f64.className="horizSep";
_f64.style.width=this._contentW;
_f64.style.height="5px";
_f63.appendChild(_f64);
var row2;
var col2;
row2=this._table.insertRow(2);
row2.align="left";
row2.vAlign="middle";
col2=row2.insertCell(row2.cells.length);
col2.align="left";
col2.vAlign="middle";
col2.noWrap=true;
col2.width=this._contentW;
col2.appendChild(this._pageDiv);
this._contentDiv.appendChild(this._table);
};
DwtWizardDialog.prototype.addChild=function(_f67){
this._children.add(_f67);
};
DwtWizardDialog.prototype._showPage=function(_f68){
if(this._pages&&this._pages[_f68]){
this._hideAllPages();
this._pages[_f68].showMe();
Dwt.setVisible(this._pages[_f68].getHtmlElement(),true);
}
};
DwtWizardDialog.prototype._hideAllPages=function(){
if(this._pages&&this._pages.length){
for(var _f69 in this._pages){
if(this._pages[_f69]){
this._pages[_f69].hideMe();
Dwt.setVisible(this._pages[_f69].getHtmlElement(),false);
}
}
}
};
function DwtWizardPage(_f6a,_f6b){
if(arguments.length==0){
return;
}
var _f6c=_f6b||"DwtDialog";
DwtPropertyPage.call(this,_f6a,_f6b,DwtControl.ABSOLUTE_STYLE);
}
DwtWizardPage.prototype=new DwtTabViewPage;
DwtWizardPage.prototype.constructor=DwtWizardPage;
DwtWizardPage.prototype.toString=function(){
return "DwtWizardPage";
};
DwtWizardPage.prototype.setActive=function(){
};
DwtWizardPage.prototype.switchToNextPage=function(_f6d){
this.parent.goPage(_f6d);
};
DwtWizardPage.prototype.switchToPrevPage=function(_f6e){
this.parent.goPage(_f6e);
};
DwtWizardPage.prototype.showMe=function(){
this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
this.getHtmlElement().style.height=this.parent._contentH;
this.getHtmlElement().style.width=this.parent._contentW;
};
function DwtWizProgressBar(_f6f){
if(arguments.length==0){
return;
}
DwtComposite.call(this,_f6f,"DwtWizProgressBar",DwtControl.STATIC_STYLE);
this._table=document.createElement("table");
this._table.border=0;
this._table.cellPadding=0;
this._table.cellSpacing=0;
this.getHtmlElement().appendChild(this._table);
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
this._stepsNumber=0;
this._steps=new Array();
this._lblHeader=new DwtStepLabel(this);
this._lblHeader.setText("Step 0 of 0");
this._lblHeader.setActive(true);
}
DwtWizProgressBar.prototype=new DwtComposite;
DwtWizProgressBar.prototype.constructor=DwtWizProgressBar;
DwtWizProgressBar.prototype.toString=function(){
return "DwtWizProgressBar";
};
DwtWizProgressBar.prototype.showStep=function(_f70){
var _f71="Step "+_f70+" of "+this._stepsNumber;
if(this._steps[_f70]){
_f71=_f71+": "+this._steps[_f70];
}
this._lblHeader.setText(_f71);
};
DwtWizProgressBar.prototype.addStep=function(_f72,_f73){
this._steps[_f72]=_f73;
return (++this._stepsNumber);
};
DwtWizProgressBar.prototype.addChild=function(_f74){
this._children.add(_f74);
var row;
var col;
this._table.width="100%";
row=(this._table.rows.length!=0)?this._table.rows[0]:this._table.insertRow(0);
row.align="center";
row.vAlign="middle";
col=row.insertCell(row.cells.length);
col.align="center";
col.vAlign="middle";
col.noWrap=true;
col.appendChild(_f74.getHtmlElement());
};
function DwtStepLabel(_f77){
DwtLabel.call(this,_f77,DwtLabel.ALIGN_CENTER,"DwtStepLabel");
}
DwtStepLabel.prototype=new DwtLabel;
DwtStepLabel.prototype.constructor=DwtStepLabel;
DwtStepLabel.prototype.toString=function(){
return "DwtStepLabel";
};
DwtStepLabel.prototype.setActive=function(_f78){
if(_f78){
this._textCell.className="DwtStepLabelActive";
}else{
this._textCell.className="DwtStepLabelInactive";
}
};
function DwtSelect(_f79,_f7a,_f7b,_f7c){
var _f7d=_f7b||"DwtSelectComposite";
var _f7e=_f7c||Dwt.STATIC_STYLE;
DwtComposite.call(this,_f79,_f7d,_f7e);
this._origClassName=this._className;
this._heightClassName=this._className+"Height";
this._menuClassName=this._className+"Menu";
this._menuTableId=false;
this._currentSelectionId=-1;
this._options=new AjxVector();
this._optionValuesToIndices=new Object();
this._selectedValue=this._selectedOption=null;
this.disabled=false;
this._menuListenerObject=new AjxListener(this,this._menuListener);
this._render(_f7a);
}
DwtSelect.prototype=new DwtComposite;
DwtSelect.prototype.constructor=DwtSelect;
DwtSelect.prototype.toString=function(){
return "DwtSelect";
};
DwtSelect.prototype.getButton=function(){
return this._button;
};
DwtSelect.prototype.setText=function(text){
this._button.setText(text);
};
DwtSelect.prototype.setToolTipContent=function(text){
this._button.setToolTipContent(text);
};
DwtSelect.prototype.getToolTipContent=function(){
return this._button.getToolTipContent();
};
DwtSelect.prototype.setImage=function(_f81){
this._button.setImage(_f81);
};
DwtSelect.prototype.setAlign=function(_f82){
this._button.setAlign(_f82);
};
DwtSelect._objectIds=[null];
DwtSelect._assignId=function(_f83){
var myId=DwtSelect._objectIds.length;
DwtSelect._objectIds[myId]=_f83;
return myId;
};
DwtSelect._getObjectWithId=function(anId){
return DwtSelect._objectIds[anId];
};
DwtSelect._unassignId=function(anId){
DwtSelect._objectIds[anId]=null;
};
DwtSelect.getObjectFromElement=function(_f87){
return _f87&&_f87.dwtObj?AjxCore.objectWithId(_f87.dwtObj):null;
};
DwtSelect.prototype.dispose=function(){
DwtControl.prototype.dispose.call(this);
if(this._internalObjectId){
DwtSelect._unassignId(this._internalObjectId);
}
};
DwtSelect.prototype._render=function(_f88){
var _f89=Dwt.getNextId();
this._menuTableId=Dwt.getNextId();
var _f8a=this._selectedValue?this._selectedValue:"";
var html=["<div class='",this._heightClassName,"'style='overflow:hidden;'>","<table border=0 cellpadding=0 cellspacing=0>","<tr><td id='",_f89,"'></td></tr>","<tr><td>","<table id='",this._menuTableId,"' class='",this._menuClassName,"' border=0 cellpadding=0 cellspacing=0>","</table>","</td></tr> ","</table>","</div>"];
var _f8c=this.getHtmlElement();
_f8c.innerHTML=html.join("");
this._button=new DwtButton(this,DwtLabel.ALIGN_LEFT);
this._button.reparentHtmlElement(_f89);
this._button.setDropDownImages("SelectPullDownArrow","SelectPullDownArrowDis","SelectPullDownArrowHover","SelectPullDownArrowSel");
this._button.getHtmlElement().style.minWidth=0;
this._button.setMenu(this._menuListenerObject,false);
if(_f88){
for(var i=0;i<_f88.length;++i){
this.addOption(_f88[i]);
}
}
};
DwtSelect.prototype.addOption=function(_f8e,_f8f,_f90){
var opt=null;
var val=null;
if(typeof (_f8e)=="string"){
val=_f90!=null?_f90:_f8e;
opt=new DwtSelectOption(val,_f8f,_f8e,this,null,null);
}else{
if(_f8e instanceof DwtSelectOption){
opt=_f8e;
if(_f90){
opt.setValue(_f90);
}
_f8f=opt.isSelected();
}else{
if(_f8e instanceof DwtSelectOptionData||_f8e.value){
val=_f90!=null?_f90:_f8e.value;
opt=new DwtSelectOption(val,_f8e.isSelected,_f8e.displayValue,this,null,null,_f8e.selectedValue);
_f8f=Boolean(_f8e.isSelected);
}else{
return -1;
}
}
}
this._options.add(opt);
if(this._options.size()==1||_f8f){
this._setSelectedOption(opt);
}
var _f93=document.getElementById(this._menuTableId);
var row=_f93.insertRow(-1);
var cell=row.insertCell(-1);
cell.className="DwtMenuItem";
cell.innerHTML=["<div class='Text'>",AjxStringUtil.htmlEncode(opt.getDisplayValue()),"</div>"].join("");
this._button.setMenu(this._menuListenerObject,false);
this._optionValuesToIndices[opt.getValue()]=this._options.size()-1;
return (this._options.size()-1);
};
DwtSelect.prototype.rename=function(_f96,name){
var _f98=this.getOptionWithValue(_f96);
_f98._displayValue=name;
if(this.__selectedOption&&(this.__selectedOption._value==_f96)){
this.setText(name);
}
this._button.setMenu(this._menuListenerObject,false);
};
DwtSelect.prototype.clearOptions=function(){
var opts=this._options.getArray();
for(var i=0;i<opts.length;++i){
opts[i]=null;
}
this._options.removeAll();
this._optionValuesToIndices=null;
this._optionValuesToIndices=new Array();
this._selectedValue=null;
this._selectedOption=null;
this._currentSelectionId=-1;
};
DwtSelect.prototype.setName=function(name){
this._name=name;
};
DwtSelect.prototype.getName=function(){
return this._name;
};
DwtSelect.prototype.getEnabled=function(){
return this._button.getEnabled();
};
DwtSelect.prototype.setEnabled=function(_f9c,_f9d){
this._button.setEnabled(_f9c,_f9d);
};
DwtSelect.prototype.disable=function(){
this._button.setEnabled(false);
};
DwtSelect.prototype.enable=function(){
this._button.setEnabled(true);
};
DwtSelect.prototype._disableSelectionIE=function(){
return false;
};
DwtSelect.prototype._disableSelection=function(){
var func=function(){
window.getSelection().removeAllRanges();
};
window.setTimeout(func,5);
};
DwtSelect.prototype.setSelectedValue=function(_f9f){
var _fa0=this._optionValuesToIndices[_f9f];
if((_fa0!==void 0)&&(_fa0!==null)){
this.setSelected(_fa0);
}
};
DwtSelect.prototype.setSelected=function(_fa1){
var _fa2=this.getOptionWithHandle(_fa1);
this.setSelectedOption(_fa2);
};
DwtSelect.prototype.getOptionWithHandle=function(_fa3){
return this._options.get(_fa3);
};
DwtSelect.prototype.getIndexForValue=function(_fa4){
return this._optionValuesToIndices[_fa4];
};
DwtSelect.prototype.getOptionWithValue=function(_fa5){
var _fa6=this._optionValuesToIndices[_fa5];
var _fa7=null;
if((_fa6!==void 0)&&(_fa6!==null)){
_fa7=this.getOptionWithHandle(_fa6);
}
return _fa7;
};
DwtSelect.prototype.setSelectedOption=function(_fa8){
if(_fa8){
this._setSelectedOption(_fa8);
}
};
DwtSelect.prototype.getValue=function(){
return this._selectedValue;
};
DwtSelect.prototype.getSelectedOption=function(){
return this._selectedOption;
};
DwtSelect.prototype.getSelectedIndex=function(){
return this.getIndexForValue(this.getValue());
};
DwtSelect.prototype.getWidth=function(){
return DwtControl.prototype.getSize.call(this).x;
};
DwtSelect.prototype.addChangeListener=function(_fa9){
this.addListener(DwtEvent.ONCHANGE,_fa9);
};
DwtSelect.prototype.size=function(){
return this._options.size();
};
DwtSelect.prototype._menuListener=function(){
var menu=new DwtMenu(this,DwtMenu.DROPDOWN_STYLE,"DwtSelectMenu",null,true);
this._button.setMenu(menu,true);
menu.setAssociatedObj(this);
for(var i=0,len=this._options.size();i<len;++i){
var mi=new DwtMenuItem(menu,DwtMenuItem.SELECT_STYLE);
var _fad=this._options.get(i);
var text=_fad.getDisplayValue();
if(text){
mi.setText(AjxStringUtil.htmlEncode(text));
}
var _faf=_fad.getImage();
if(_faf){
mi.setImage(_faf);
_fad._imageWidth=Dwt.getSize(AjxImg.getImageElement(mi._iconCell)).x;
}
mi.addSelectionListener(new AjxListener(this,this._handleOptionSelection));
mi._optionIndex=i;
_fad.setItem(mi);
}
var size=this._button.getSize();
menu.getHtmlElement().style.width=size.x;
var el=this.getHtmlElement();
return menu;
};
DwtSelect.prototype._handleOptionSelection=function(ev){
var _fb3=ev.item;
var _fb4=_fb3._optionIndex;
var opt=this._options.get(_fb4);
var _fb6=this.getValue();
this._setSelectedOption(opt);
var args=new Object();
args.selectObj=this;
args.newValue=opt.getValue();
args.oldValue=_fb6;
var _fb8=DwtUiEvent.getEvent(ev);
_fb8._args=args;
this.notifyListeners(DwtEvent.ONCHANGE,_fb8);
};
DwtSelect.prototype._clearOptionSelection=function(){
if(this._currentSelectionId!=-1){
var _fb9=DwtSelect._getObjectWithId(this._currentSelectionId);
_fb9.deSelect();
}
};
DwtSelect.prototype._setSelectedOption=function(_fba){
var _fbb=_fba.getSelectedValue()||_fba.getDisplayValue();
var _fbc=_fba.getImage();
if(this._selectedOption!=_fba){
if(_fbb){
this.setText(_fbb);
}
if(_fbc){
this.setImage(_fbc);
}
this._selectedValue=_fba._value;
this._selectedOption=_fba;
}
this._updateSelection(_fba);
};
DwtSelect.prototype._updateSelection=function(_fbd){
var _fbe=null;
if(this._currentSelectionId!=-1){
_fbe=DwtSelect._getObjectWithId(this._currentSelectionId);
}
if(_fbe){
_fbe.deSelect();
}
if(_fbd){
_fbd.select();
this._currentSelectionId=_fbd.getIdentifier();
}
};
DwtSelect.prototype._setDisabledStyle=function(){
this.setClassName(this._className+" disabled");
};
DwtSelect.prototype._setEnabledStyle=function(){
this.setClassName(this._origClassName);
};
function DwtSelectOptionData(_fbf,_fc0,_fc1,_fc2){
if(_fbf==null||_fc0==null){
return null;
}
this.value=_fbf;
this.displayValue=_fc0;
this.isSelected=_fc1;
this.selectedValue=_fc2;
}
function DwtSelectOption(_fc3,_fc4,_fc5,_fc6,_fc7,_fc8,_fc9){
this._value=_fc3;
this._selected=_fc4;
this._displayValue=_fc5;
this._image=_fc8;
this._selectedValue=_fc9;
this._internalObjectId=DwtSelect._assignId(this);
}
DwtSelectOption.prototype.setItem=function(_fca){
this._menuItem=_fca;
};
DwtSelectOption.prototype.getItem=function(_fcb){
return this._menuItem;
};
DwtSelectOption.prototype.getDisplayValue=function(){
return this._displayValue;
};
DwtSelectOption.prototype.getImage=function(){
return this._image;
};
DwtSelectOption.prototype.getSelectedValue=function(){
return this._selectedValue;
};
DwtSelectOption.prototype.getValue=function(){
return this._value;
};
DwtSelectOption.prototype.setValue=function(_fcc){
this._value=_fcc;
};
DwtSelectOption.prototype.select=function(){
this._selected=true;
};
DwtSelectOption.prototype.deSelect=function(){
this._selected=false;
};
DwtSelectOption.prototype.isSelected=function(){
return this._selected;
};
DwtSelectOption.prototype.getIdentifier=function(){
return this._internalObjectId;
};
function DwtAlert(_fcd,_fce,_fcf){
if(arguments.length==0){
return;
}
_fcf=_fcf||DwtControl.STATIC_STYLE;
DwtControl.call(this,_fcd,null,_fcf);
this._alertClass=_fce;
this._alertStyle=DwtAlert.INFORMATION;
this._createHTML();
}
DwtAlert.prototype=new DwtControl;
DwtAlert.prototype.constructor=DwtAlert;
DwtAlert.INFORMATION=0;
DwtAlert.WARNING=1;
DwtAlert.CRITICAL=2;
DwtAlert._ICONS=[AjxImg.getClassForImage("Information_32"),AjxImg.getClassForImage("Warning_32"),AjxImg.getClassForImage("Critical_32")];
DwtAlert._CLASSES=["DwtAlertInfo","DwtAlertWarn","DwtAlertCrit"];
DwtAlert.prototype._alertClass;
DwtAlert.prototype._alertStyle;
DwtAlert.prototype._alertTitle;
DwtAlert.prototype._alertContent;
DwtAlert.prototype._alertDiv;
DwtAlert.prototype._iconDiv;
DwtAlert.prototype._titleDiv;
DwtAlert.prototype._contentDiv;
DwtAlert.prototype.setStyle=function(_fd0){
this._alertStyle=_fd0||DwtAlert.INFORMATION;
this._iconDiv.className="DwtAlertIcon "+DwtAlert._ICONS[this._alertStyle];
this._alertDiv.className="DwtAlert "+(this._alertClass||DwtAlert._CLASSES[this._alertStyle]);
};
DwtAlert.prototype.getStyle=function(){
return this._alertStyle;
};
DwtAlert.prototype.setIconVisible=function(_fd1){
var _fd2=_fd1?"block":"none";
this._iconDiv.parentNode.style.display=_fd2;
};
DwtAlert.prototype.getIconVisible=function(){
return this._iconDiv.style.display=="block";
};
DwtAlert.prototype.setTitle=function(_fd3){
this._alertTitle=_fd3;
this._titleDiv.innerHTML=_fd3||"";
};
DwtAlert.prototype.getTitle=function(){
return this._alertTitle;
};
DwtAlert.prototype.setContent=function(_fd4){
this._alertContent=_fd4;
this._contentDiv.innerHTML=_fd4||"";
};
DwtAlert.prototype.getContent=function(){
return this._alertContent;
};
DwtAlert.prototype._createHTML=function(){
var _fd5=this.getHtmlElement().id;
var _fd6=_fd5+"_icon";
var _fd7=_fd5+"_title";
var _fd8=_fd5+"_content";
this._alertDiv=document.createElement("TABLE");
this._alertDiv.width="90%";
this._alertDiv.cellPadding=0;
this._alertDiv.cellSpacing=0;
this._alertDiv.className="DwtAlert "+(this._alertClass||DwtAlert._CLASSES[this._alertStyle]);
this._iconDiv=document.createElement("DIV");
this._iconDiv.id=_fd6;
this._iconDiv.className="DwtAlertIcon "+DwtAlert._ICONS[this._alertStyle];
var row1=this._alertDiv.insertRow(0);
var _fda=row1.insertCell(0);
_fda.width="1%";
_fda.appendChild(this._iconDiv);
var _fdb=document.createElement("TABLE");
_fdb.cellPadding=0;
_fdb.cellSpacing=0;
this._titleDiv=_fdb.insertRow(0).insertCell(0);
this._titleDiv.id=_fd7;
this._titleDiv.className="DwtAlertTitle";
this._contentDiv=_fdb.insertRow(1).insertCell(0);
this._contentDiv.id=_fd8;
this._contentDiv.className="DwtAlertContent";
var _fdc=row1.insertCell(1);
_fdc.width="99%";
_fdc.appendChild(_fdb);
var _fdd=this.getHtmlElement();
_fdd.style.align="center";
_fdd.appendChild(this._alertDiv);
};
function DwtText(_fde,_fdf,_fe0){
if(arguments.length==0){
return;
}
_fdf=_fdf||"DwtText";
DwtControl.call(this,_fde,_fdf,_fe0);
}
DwtText.prototype=new DwtControl;
DwtText.prototype.constructor=DwtText;
DwtText.prototype.toString=function(){
return "DwtText";
};
DwtText.prototype.setText=function(text){
if(!this._textNode){
this._textNode=document.createTextNode(text);
this.getHtmlElement().appendChild(this._textNode);
}else{
this._textNode.data=text;
}
};
DwtText.prototype.getText=function(){
return this._textNode.data;
};
DwtText.prototype.getTextNode=function(){
return this._textNode;
};
function DwtIframe(_fe2){
var _fe3=_fe2.posStyle?_fe2.posStyle:DwtControl.STATIC_STYLE;
DwtControl.call(this,_fe2.parent,_fe2.className||"DwtIframe",_fe3,false);
this._styles=_fe2.styles;
this._noscroll=_fe2.noscroll;
this._iframeID=Dwt.getNextId();
this._processHtmlCallback=_fe2.processHtmlCallback;
this._hidden=_fe2.hidden;
this._createFrame(_fe2.html);
if(_fe2.useKbMgmt){
var _fe4=this.getIframe();
var idoc=Dwt.getIframeDoc(_fe4);
var doc=AjxEnv.isIE?idoc:_fe4.contentWindow;
Dwt.setHandler(doc,DwtEvent.ONKEYDOWN,DwtKeyboardMgr.__keyDownHdlr);
Dwt.setHandler(doc,DwtEvent.ONKEYUP,DwtKeyboardMgr.__keyUpHdlr);
Dwt.setHandler(doc,DwtEvent.ONKEYPRESS,DwtKeyboardMgr.__keyPressHdlr);
}
}
DwtIframe.prototype=new DwtControl;
DwtIframe.prototype.constructor=DwtIframe;
DwtIframe.prototype.getIframe=function(){
return document.getElementById(this._iframeID);
};
DwtIframe.prototype.getDocument=function(){
return this.getIframe().contentWindow.document;
};
DwtIframe.prototype._rawEventHandler=function(ev){
var _fe8=this.getIframe();
var win=_fe8.contentWindow;
if(AjxEnv.isIE){
ev=win.event;
}
var dw;
if(/mouse|context|click|select/i.test(ev.type)){
dw=new DwtMouseEvent(true);
}else{
dw=new DwtUiEvent(true);
}
dw.setFromDhtmlEvent(ev);
var type=dw.type.toLowerCase();
if(!/^on/.test(type)){
type="on"+type;
}
var pos=this.getLocation();
if(!AjxEnv.isIE){
var doc=win.document;
var sl=doc.documentElement.scrollLeft||doc.body.scrollLeft;
var st=doc.documentElement.scrollTop||doc.body.scrollTop;
pos.x-=sl;
pos.y-=st;
}
dw.docX+=pos.x;
dw.docY+=pos.y;
dw.elementX+=pos.x;
dw.elementY+=pos.y;
var _ff0=DwtMouseEventCapture.getCaptureObj();
if(AjxEnv.isIE||AjxEnv.isSafari||!_ff0){
DwtEventManager.notifyListeners(type,dw);
this.parent.notifyListeners(type,dw);
}else{
var fake=document.createEvent("MouseEvents");
fake.initMouseEvent(ev.type,true,true,document.defaultView,0,ev.screenX,ev.screenY,dw.docX,dw.docY,ev.ctrlKey,ev.altKey,ev.shiftKey,ev.metaKey,ev.button,ev.relatedTarget);
document.body.dispatchEvent(fake);
}
dw.setToDhtmlEvent(ev);
return dw._returnValue;
};
DwtIframe._forwardEvents=[DwtEvent.ONCHANGE,DwtEvent.ONCLICK,DwtEvent.ONDBLCLICK,DwtEvent.ONFOCUS,DwtEvent.ONKEYDOWN,DwtEvent.ONKEYPRESS,DwtEvent.ONKEYUP,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEOUT,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART];
DwtIframe.prototype._createFrame=function(html){
var self=this;
function rawHandlerProxy(ev){
return self._rawEventHandler(ev);
}
(function(){
var _ff5,tmp=[],i=0,idoc;
tmp[i++]="<iframe";
if(self._noscroll){
tmp[i++]=" scrolling='no'";
}
if(self._hidden){
tmp[i++]=" style='visibility:hidden'";
}
tmp[i++]=" frameborder='0' width='100%' id='";
tmp[i++]=self._iframeID;
tmp[i++]="' src='javascript:\"\";'></iframe>";
self.setContent(tmp.join(""));
html=html.replace(/(<style[^>]*>)[\s\t\u00A0]*(.*?)[\s\t\u00A0]*<\x2fstyle>/mgi,function(s,p1,p2){
return p1+p2.replace(/@import.*?(;|[\s\t\u00A0]*$)/gi,"")+"</style>";
});
_ff5=self.getIframe();
idoc=Dwt.getIframeDoc(_ff5);
idoc.open();
if(AjxEnv.isSafari){
idoc.write("<html><head></head>");
}
if(self._styles){
idoc.write(["<style type='text/css'>",self._styles,"</style>"].join(""));
}
idoc.write(html);
idoc.close();
if(self._processHtmlCallback){
self._processHtmlCallback.run(idoc);
}
tmp=idoc.documentElement.style;
tmp.margin=tmp.padding=idoc.body.style.margin="0";
Dwt.associateElementWithObject(idoc,self);
tmp=DwtIframe._forwardEvents;
if(!AjxEnv.isIE){
idoc=_ff5.contentWindow;
}
for(i=tmp.length;--i>=0;){
idoc[tmp[i]]=rawHandlerProxy;
}
})();
};
function DwtPropertySheet(_ff9,_ffa,_ffb,_ffc){
if(arguments.length==0){
return;
}
_ffa=_ffa||"DwtPropertySheet";
DwtComposite.call(this,_ff9,_ffa,_ffb);
this._labelSide=_ffc||DwtPropertySheet.DEFAULT;
this._propertyIdCount=0;
this._propertyList=[];
this._propertyMap={};
this._tableEl=document.createElement("TABLE");
this._tableEl.border=0;
this._tableEl.cellSpacing=3;
this._tableEl.cellPadding=0;
var _ffd=this.getHtmlElement();
_ffd.appendChild(this._tableEl);
}
DwtPropertySheet.prototype=new DwtComposite;
DwtPropertySheet.prototype.constructor=DwtPropertySheet;
DwtPropertySheet.prototype.toString=function(){
return "DwtPropertySheet";
};
DwtPropertySheet.RIGHT="right";
DwtPropertySheet.LEFT="left";
DwtPropertySheet.DEFAULT=DwtPropertySheet.LEFT;
DwtPropertySheet.prototype._labelSide;
DwtPropertySheet.prototype._labelCssClass="Label";
DwtPropertySheet.prototype._valueCssClass="Field";
DwtPropertySheet.prototype._tableEl;
DwtPropertySheet.prototype._propertyIdCount;
DwtPropertySheet.prototype._propertyList;
DwtPropertySheet.prototype._propertyMap;
DwtPropertySheet.prototype.addProperty=function(_ffe,_fff,_1000){
var index=this._tableEl.rows.length;
var row=this._tableEl.insertRow(index);
row.vAlign="top";
if(this._labelSide==DwtPropertySheet.LEFT){
this._insertLabel(row,_ffe,_1000);
this._insertValue(row,_fff,_1000);
}else{
this._insertValue(row,_fff,_1000);
this._insertLabel(row,_ffe,_1000);
}
var id=this._propertyIdCount++;
var _1004={id:id,index:index,row:row,visible:true};
this._propertyList.push(_1004);
this._propertyMap[id]=_1004;
return id;
};
DwtPropertySheet.prototype._insertLabel=function(row,label,_1007){
var _1008=row.insertCell(-1);
_1008.className=this._labelCssClass;
if(this._labelSide!=DwtPropertySheet.LEFT){
_1008.width="100%";
_1008.style.textAlign="left";
}
_1008.innerHTML=label;
if(_1007){
var _1009=this._tableEl.ownerDocument.createElement("SUP");
_1009.innerHTML="*";
_1008.insertBefore(_1009,_1008.firstChild);
}
};
DwtPropertySheet.prototype._insertValue=function(row,value,_100c){
var _100d=row.insertCell(-1);
_100d.className=this._valueCssClass;
if(value instanceof DwtControl){
_100d.appendChild(value.getHtmlElement());
}else{
if(value.nodeType==AjxUtil.ELEMENT_NODE){
_100d.appendChild(value);
}else{
_100d.innerHTML=String(value);
}
}
};
DwtPropertySheet.prototype.removeProperty=function(id){
var prop=this._propertyMap[id];
if(prop.visible){
var _1010=prop.index;
var _1011=this.__getTableIndex(_1010);
var row=this._tableEl.rows[_1011];
row.parentNode.removeChild(row);
}
prop.row=null;
for(var i=index+1;i<this._propertyList.length;i++){
var prop=this._propertyList[i];
prop.index--;
}
this._propertyList.splice(index,1);
delete this._propertyMap[id];
};
DwtPropertySheet.prototype.setPropertyVisible=function(id,_1015){
var prop=this._propertyMap[id];
if(prop.visible!=_1015){
prop.visible=_1015;
var _1017=prop.index;
if(_1015){
var _1018=this.__getTableIndex(_1017);
var row=this._tableEl.insertRow(_1018);
DwtPropertySheet.__moveChildNodes(prop.row,row);
prop.row=row;
}else{
var row=prop.row;
row.parentNode.removeChild(row);
}
}
};
DwtPropertySheet.prototype.__getTableIndex=function(_101a){
var _101b=0;
for(var i=0;i<_101a;i++){
var prop=this._propertyList[i];
if(prop.visible){
_101b++;
}
}
return _101b;
};
DwtPropertySheet.__moveChildNodes=function(_101e,_101f){
if(_101e===_101f){
return;
}
var _1020=_101e.firstChild;
while(_1020!=null){
_101f.appendChild(_1020);
_1020=_101e.firstChild;
}
};
function DwtGrouper(_1021,_1022,_1023){
if(arguments.length==0){
return;
}
_1022=_1022||"DwtGrouper";
_1023=_1023||DwtControl.STATIC_STYLE;
DwtComposite.call(this,_1021,null,_1023);
this._labelEl=document.createElement("LEGEND");
this._insetEl=document.createElement("DIV");
this._borderEl=document.createElement("FIELDSET");
this._borderEl.appendChild(this._labelEl);
this._borderEl.appendChild(this._insetEl);
var _1024=this.getHtmlElement();
_1024.appendChild(this._borderEl);
}
DwtGrouper.prototype=new DwtComposite;
DwtGrouper.prototype.constructor=DwtGrouper;
DwtGrouper.prototype._borderEl;
DwtGrouper.prototype._labelEl;
DwtGrouper.prototype._insetEl;
DwtGrouper.prototype.setLabel=function(_1025){
Dwt.setVisible(this._labelEl,Boolean(_1025));
this._labelEl.style.display="";
this._labelEl.innerHTML=_1025?_1025:"";
};
DwtGrouper.prototype.setContent=function(_1026){
var _1027=this._insetEl;
_1027.innerHTML=_1026;
};
DwtGrouper.prototype.setElement=function(_1028){
var _1029=this._insetEl;
Dwt.removeChildren(_1029);
_1029.appendChild(_1028);
};
DwtGrouper.prototype.setView=function(_102a){
this.setElement(_102a.getHtmlElement());
};
DwtGrouper.prototype.getInsetHtmlElement=function(){
return this._insetEl;
};
function DwtProgressBar(_102b,_102c,_102d){
if(arguments.length==0){
return;
}
_102d=_102d||DwtControl.STATIC_STYLE;
DwtComposite.call(this,_102b,null,_102d);
this._maxValue=100;
this._value=0;
this._quotabarDiv=null;
this._quotausedDiv=null;
this._progressBgColor=null;
this._progressCssClass="quotaused";
this._wholeBgColor=null;
this._wholeCssClass="quotabar";
this._createHTML();
}
DwtProgressBar.prototype=new DwtComposite;
DwtProgressBar.prototype.constructor=DwtProgressBar;
DwtProgressBar.prototype.setProgressBgColor=function(val){
this._progressBgColor=val;
};
DwtProgressBar.prototype.setWholeBgColor=function(val){
this._wholeBgColor=val;
};
DwtProgressBar.prototype.setProgressCssClass=function(val){
this._progressCssClass=val;
};
DwtProgressBar.prototype.setWholeCssClass=function(val){
this._wholeCssClass=val;
};
DwtProgressBar.prototype.setProgressCssStyle=function(val){
this._progressCssStyle=val;
};
DwtProgressBar.prototype.setWholeCssStyle=function(val){
this._wholeCssStyle=val;
};
DwtProgressBar.prototype.setValue=function(val){
this._value=parseInt(val);
var _1035;
if(this._value==this._maxValue){
_1035=100;
}else{
_1035=Math.min(Math.round((this._value/this._maxValue)*100),100);
}
if(isNaN(_1035)){
_1035="0";
}
if(!this._quotabarDiv){
this._quotabarDiv=document.createElement("div");
if(this._wholeCssClass){
this._quotabarDiv.className=this._wholeCssClass;
}
if(this._wholeBgColor){
this._quotabarDiv.backgroundColor=this._wholeBgColor;
}
this._cell.appendChild(this._quotabarDiv);
}
if(!this._quotausedDiv){
this._quotausedDiv=document.createElement("div");
if(this._progressCssClass){
this._quotausedDiv.className=this._progressCssClass;
}
if(this._progressBgColor){
this._quotausedDiv.style.backgroundColor=this._progressBgColor;
}
this._quotabarDiv.appendChild(this._quotausedDiv);
}
this._quotausedDiv.style.width=_1035+"%";
};
DwtProgressBar.prototype.setValueByPercent=function(_1036){
this.setMaxValue(100);
this.setValue(_1036.replace(/\%/gi,""));
};
DwtProgressBar.prototype.getValue=function(){
return this._value;
};
DwtProgressBar.prototype.getMaxValue=function(){
return this._maxValue;
};
DwtProgressBar.prototype.setMaxValue=function(val){
this._maxValue=parseInt(val);
};
DwtProgressBar.prototype.setLabel=function(text,_1039){
var _103a=document.createTextNode(text);
var _103b=_1039?-1:0;
var _103c=this._row.insertCell(_103b);
_103c.appendChild(_103a);
};
DwtProgressBar.prototype._createHTML=function(){
this._table=document.createElement("table");
this._table.border=this._table.cellpadding=this._table.cellspacing=0;
this._row=this._table.insertRow(-1);
this._cell=this._row.insertCell(-1);
this.getHtmlElement().appendChild(this._table);
};
function DwtPropertyEditor(_103d,_103e,_103f,_1040,_1041){
if(arguments.length>0){
if(!_103f){
_103f="DwtPropertyEditor";
}
DwtComposite.call(this,_103d,_103f,_1040,_1041);
this._useDwtInputField=_103e!=null?_103e:true;
this._schema=null;
this._init();
}
}
DwtPropertyEditor.MSG_TIMEOUT=4000;
DwtPropertyEditor.MSG={mustMatch:"This field does not match validators: REGEXP",mustNotMatch:"This field matches anti-validators: REGEXP"};
DwtPropertyEditor.prototype=new DwtComposite;
DwtPropertyEditor.prototype.constructor=DwtPropertyEditor;
DwtPropertyEditor.prototype.toString=function(){
return "DwtPropertyEditor";
};
DwtPropertyEditor.prototype._init=function(){
var div=document.createElement("div");
div.id=this._relDivId=Dwt.getNextId();
div.style.position="relative";
var table=document.createElement("table");
table.id=this._tableId=Dwt.getNextId();
table.cellSpacing=table.cellPadding=0;
table.appendChild(document.createElement("tbody"));
div.appendChild(table);
this.getHtmlElement().appendChild(div);
this.maxLabelWidth=0;
this.maxFieldWidth=0;
this._setMouseEventHdlrs();
this._onMouseDown=new AjxListener(this,this._onMouseDown);
this.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown);
};
DwtPropertyEditor.prototype.getRelDiv=function(){
return document.getElementById(this._relDivId);
};
DwtPropertyEditor.prototype.getTable=function(){
return document.getElementById(this._tableId);
};
DwtPropertyEditor.prototype._onMouseDown=function(event){
var _1045=event.target;
var tag=_1045.tagName.toLowerCase();
if(tag=="input"){
event._stopPropagation=false;
event._returnValue=true;
return true;
}
if(this._currentInputField&&!this._currentInputField.onblur()){
event._stopPropagation=true;
event._returnValue=false;
return false;
}
try{
while(_1045&&tag!="tr"){
_1045=_1045.parentNode;
tag=_1045.tagName.toLowerCase();
}
if(_1045&&_1045.__msh_doMouseDown){
_1045.__msh_doMouseDown(event);
}
}
catch(ex){
}
};
DwtPropertyEditor.prototype.getProperties=function(){
if(this._currentInputField){
this._currentInputField.onblur();
}
function rec(_1047){
var prop={},tmp,n=_1047.length;
for(var i=0;i<n;++i){
tmp=_1047[i];
if(tmp.type=="struct"){
prop[tmp.name]=rec(tmp.children);
}else{
prop[tmp.name]=tmp.value;
}
}
return prop;
}
return rec(this._schema);
};
DwtPropertyEditor.prototype.validateData=function(){
var valid=true;
function rec(_104b){
var tmp,n=_104b.length;
for(var i=0;i<n;++i){
tmp=_104b[i];
if(tmp.type=="struct"){
rec(tmp.children);
}else{
if(!tmp._validate()){
valid=false;
}
}
}
}
rec(this._schema);
return valid;
};
DwtPropertyEditor.prototype.initProperties=function(_104e,_104f){
if(_104f==null){
this._schema=_104e;
_104f=null;
}
for(var i=0;i<_104e.length;++i){
this._createProperty(_104e[i],_104f);
}
};
DwtPropertyEditor.prototype._createProperty=function(prop,_1052){
var level=_1052?_1052._level+1:0;
var tr=this.getTable().firstChild.appendChild(document.createElement("tr"));
prop._parent=_1052;
prop._level=level;
prop._rowElId=tr.id=Dwt.getNextId();
prop._propertyEditor=this;
for(var i in DwtPropertyEditor._prop_functions){
prop[i]=DwtPropertyEditor._prop_functions[i];
}
prop._init();
tr.className="level-"+level;
if(prop.visible===false){
tr.className+=" invisible";
}
if(prop.readonly){
tr.className+=" readonly";
}
if(prop.type!="struct"){
tr.className+=" "+prop.type;
var _1056=document.createElement("td");
_1056.className="label";
tr.appendChild(_1056);
var html=AjxStringUtil.htmlEncode(prop.label||prop.name);
if(prop.required){
html+="<span class='DwtPropertyEditor-required'>*</span>";
}
_1056.innerHTML=html;
var _1058=document.createElement("td");
_1058.className="field";
tr.appendChild(_1058);
switch(prop.type){
case "boolean":
this._createCheckbox(prop,_1058);
break;
case "enum":
this._createDropDown(prop,_1058);
break;
case "date":
this._createCalendar(prop,_1058);
break;
default:
if(this._useDwtInputField){
this._createInputField(prop,_1058);
}else{
_1058.innerHTML=prop._makeDisplayValue();
tr.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(prop._edit,prop);
}
break;
}
prop._fieldCellId=_1058.id=Dwt.getNextId();
if(_1056.offsetWidth>this.maxLabelWidth){
this.maxLabelWidth=_1056.offsetWidth;
}
if(_1058.offsetWidth>this.maxFieldWidth){
this.maxFieldWidth=_1058.offsetWidth;
}
}else{
var td=document.createElement("td");
td.colSpan=2;
tr.appendChild(td);
td.className="label";
tr.className+=" expander-collapsed";
td.innerHTML=["<div>",AjxStringUtil.htmlEncode(prop.label),"</div>"].join("");
this.initProperties(prop.children,prop);
tr.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(prop._toggle,prop);
}
if(level>0){
tr.style.display="none";
_1052._hidden=true;
}
};
DwtPropertyEditor.prototype.setFixedLabelWidth=function(w){
try{
this.getTable().rows[0].cells[0].style.width=(w||this.maxLabelWidth)+"px";
}
catch(ex){
}
};
DwtPropertyEditor.prototype.setFixedFieldWidth=function(w){
try{
this.getTable().rows[0].cells[1].style.width=(w||this.maxFieldWidth)+"px";
}
catch(ex){
}
};
DwtPropertyEditor.prototype._setCurrentMsgDiv=function(div){
this._currentMsgDiv=div;
this._currentMsgDivTimer=setTimeout(DwtPropertyEditor.simpleClosure(this._clearMsgDiv,this),DwtPropertyEditor.MSG_TIMEOUT);
};
DwtPropertyEditor.prototype._clearMsgDiv=function(){
try{
this._stopMsgDivTimer();
}
catch(ex){
}
var div=this._currentMsgDiv;
if(div){
div.parentNode.removeChild(div);
this._currentMsgDiv=div=null;
this._currentMsgDivTimer=null;
}
};
DwtPropertyEditor.prototype._stopMsgDivTimer=function(){
if(this._currentMsgDivTimer){
clearTimeout(this._currentMsgDivTimer);
this._currentMsgDivTimer=null;
}
};
DwtPropertyEditor.prototype.addChild=function(child){
if(!this._currentFieldCell){
DwtComposite.prototype.addChild.call(this,child);
}else{
this._children.add(child);
this._currentFieldCell.appendChild(child.getHtmlElement());
}
};
DwtPropertyEditor.prototype._createCheckbox=function(prop,_1060){
var _1061=document.createElement("input");
_1061._prop=prop;
_1061.id=prop.name;
_1061.type="checkbox";
if(prop.value=="true"){
_1061.checked=prop.value;
}
_1061.addEventListener("click",prop._onCheckboxChange,false);
this._children.add(_1061);
_1060.appendChild(_1061);
};
DwtPropertyEditor.prototype._createDropDown=function(prop,_1063){
this._currentFieldCell=_1063;
var item,sel,i=0,options=[],items=prop.item;
while(item=items[i]){
options[i++]=new DwtSelectOption(item.value,item.value==prop.value,item.label);
}
prop._select=sel=new DwtSelect(this,options);
sel.addChangeListener(new AjxListener(prop,prop._onSelectChange));
sel.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown);
this._currentFieldCell=null;
};
DwtPropertyEditor.prototype._createCalendar=function(prop,_1066){
this._currentFieldCell=_1066;
var btn=new DwtButton(this);
this._currentFieldCell=null;
btn.setText(prop._makeDisplayValue());
var menu=new DwtMenu(btn,DwtMenu.CALENDAR_PICKER_STYLE);
menu.setAssociatedObj(btn);
var cal=new DwtCalendar(menu);
var date=new Date();
date.setTime(prop.value);
cal.setDate(date);
cal.setSize(150,"auto");
cal.addSelectionListener(new AjxListener(prop,prop._onCalendarSelect));
btn.setMenu(menu);
prop._dateButton=btn;
prop._dateCalendar=cal;
};
DwtPropertyEditor.DWT_INPUT_FIELD_TYPES={"string":DwtInputField.STRING,"password":DwtInputField.PASSWORD,"integer":DwtInputField.INTEGER,"number":DwtInputField.FLOAT};
DwtPropertyEditor.prototype._createInputField=function(prop,_106c){
this._currentFieldCell=_106c;
var type=DwtPropertyEditor.DWT_INPUT_FIELD_TYPES[prop.type]||DwtInputField.STRING;
var field=new DwtInputField({parent:this,type:type,initialValue:prop.value,maxLen:prop.maxLength});
if(type==DwtInputField.INTEGER||type==DwtInputField.FLOAT){
field.setValidNumberRange(prop.minValue||null,prop.maxValue||null);
if(prop.decimals!=null){
field.setNumberPrecision(prop.decimals);
}
}
if(type==DwtInputField.STRING||type==DwtInputField.PASSWORD){
field.setValidStringLengths(prop.minLength,prop.maxLength);
}
if(prop.required){
field.setRequired();
}
this._currentFieldCell=null;
prop._inputField=field;
field.setValue(prop.value);
if(prop.readonly){
field.setReadOnly(true);
}
field.setValidationCallback(new AjxCallback(prop,prop._onDwtInputFieldValidated));
};
DwtPropertyEditor._prop_functions={_init:function(){
this.type!=null||(this.type="string");
this.value!=null||(this.value="");
this._initialVal=this.value;
if(this.type=="date"){
if(!this.value){
this.value=new Date().getTime();
}
if(!this.format){
this.format=AjxDateUtil.getSimpleDateFormat().toPattern();
}
}
},_modified:function(){
return this._initialVal!=this.value;
},_getRowEl:function(){
return document.getElementById(this._rowElId);
},_makeDisplayValue:function(){
var val=this._getValue();
switch(this.type){
case "password":
val=val.replace(/./g,"*");
break;
case "date":
var date=new Date();
date.setTime(val);
val=AjxDateFormat.format(this.format,date);
break;
}
if(val==""){
val="<br />";
}else{
val=AjxStringUtil.htmlEncode(String(val));
}
return val;
},_display:function(_1071){
var c=this.children,d=_1071?"":"none";
if(c){
var i=c.length;
while(--i>=0){
c[i]._getRowEl().style.display=d;
if(!_1071){
c[i]._display(false);
}
}
this._hidden=!_1071;
var tr=this._getRowEl();
tr.className=tr.className.replace(/expander-[^\s]+/,_1071?"expander-expanded":"expander-collapsed");
}
},_toggle:function(){
this._display(this._hidden);
},_edit:function(){
if(this.readonly){
return;
}
switch(this.type){
case "string":
case "number":
case "integer":
case "password":
setTimeout(DwtPropertyEditor.simpleClosure(this._createInputField,this),50);
break;
}
},_createInputField:function(){
var pe=this._propertyEditor;
var td=document.getElementById(this._fieldCellId);
var _1077=pe.getRelDiv();
var input=document.createElement("input");
input.className="DwtPropertyEditor-input "+this.type;
input.setAttribute("autocomplete","off");
input.type=this.type=="password"?"password":"text";
var left=td.offsetLeft,top=td.offsetTop;
if(AjxEnv.isGeckoBased){
--left;
--top;
}
input.style.left=left+"px";
input.style.top=top+"px";
input.style.width=td.offsetWidth+1+"px";
input.style.height=td.offsetHeight+1+"px";
input.value=this._getValue();
_1077.appendChild(input);
input.focus();
input.onblur=DwtPropertyEditor.simpleClosure(this._saveInput,this);
input.onkeydown=DwtPropertyEditor.simpleClosure(this._inputKeyPress,this);
this._propertyEditor._currentInputField=this._inputField=input;
if(!AjxEnv.isGeckoBased){
input.select();
}else{
input.setSelectionRange(0,input.value.length);
}
},_getValue:function(){
return this.value||"";
},_checkValue:function(val){
var empty=val=="";
if(empty){
if(!this.required){
return val;
}
this._displayMsg(AjxMsg.valueIsRequired);
return null;
}
if(this.maxLength!=null&&val.length>this.maxLength){
this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooLong,this.maxLength));
return null;
}
if(this.minLength!=null&&val.length<this.minLength){
this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooShort,this.minLength));
return null;
}
if(this.mustMatch&&!this.mustMatch.test(val)){
this._displayMsg(this.msg_mustMatch||DwtPropertyEditor.MSG.mustMatch.replace(/REGEXP/,this.mustMatch.toString()));
return null;
}
if(this.mustNotMatch&&this.mustNotMatch.test(val)){
this._displayMsg(this.msg_mustNotMatch||DwtPropertyEditor.MSG.mustNotMatch.replace(/REGEXP/,this.mustNotMatch.toString()));
return null;
}
switch(this.type){
case "integer":
case "number":
var n=new Number(val);
if(isNaN(n)){
this._displayMsg(AjxMsg.notANumber);
return null;
}
if(this.type=="integer"&&Math.round(n)!=n){
this._displayMsg(AjxMsg.notAnInteger);
return null;
}
if(this.minValue!=null&&n<this.minValue){
this._displayMsg(AjxMessageFormat.format(AjxMsg.numberLessThanMin,this.minValue));
return null;
}
if(this.maxValue!=null&&n>this.maxValue){
this._displayMsg(AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this.maxValue));
return null;
}
val=n;
if(this.type=="number"&&this.decimals!=null){
var str=val.toString();
var pos=str.indexOf(".");
if(pos==-1){
pos=str.length;
}
val=val.toPrecision(pos+this.decimals);
}
break;
}
return val;
},_displayMsg:function(msg){
var x,y,w,h;
var pe=this._propertyEditor;
var div=pe._currentMsgDiv;
if(!div){
div=document.createElement("div");
div.className="DwtPropertyEditor-ErrorMsg";
pe.getRelDiv().appendChild(div);
}else{
pe._stopMsgDivTimer();
}
div.style.visibility="hidden";
div.innerHTML=AjxStringUtil.htmlEncode(msg);
var table=pe.getTable();
w=table.offsetWidth;
if(!AjxEnv.isIE){
w-=12;
}
x=table.offsetLeft;
div.style.left=x+"px";
div.style.width=w+"px";
h=div.offsetHeight;
var td=document.getElementById(this._fieldCellId);
y=td.offsetTop+td.offsetHeight;
if(y+h>table.offsetTop+table.offsetHeight){
y=td.offsetTop-h;
}
div.style.top=y+"px";
div.style.visibility="";
pe._setCurrentMsgDiv(div);
},_saveInput:function(){
var input=this._inputField;
var val=this._checkValue(input.value);
if(val!=null){
this._setValue(val);
input.onblur=input.onkeyup=input.onkeydown=input.onkeypress=null;
var td=document.getElementById(this._fieldCellId);
td.innerHTML=this._makeDisplayValue();
this._inputField=null;
this._propertyEditor._currentInputField=null;
this._propertyEditor._clearMsgDiv();
input.parentNode.removeChild(input);
return true;
}else{
if(input.className.indexOf(" DwtPropertyEditor-input-error")==-1){
input.className+=" DwtPropertyEditor-input-error";
}
input.focus();
return false;
}
},_inputKeyPress:function(ev){
ev||(ev=window.event);
var input=this._inputField;
if(ev.keyCode==13){
this._saveInput();
}else{
if(ev.keyCode==27){
input.value=this._getValue();
this._saveInput();
}else{
this._propertyEditor._clearMsgDiv();
input.className=input.className.replace(/ DwtPropertyEditor-input-error/,"");
}
}
},_onCheckboxChange:function(){
this._prop._setValue(this.checked?"true":"false");
},_onSelectChange:function(){
this._setValue(this._select.getValue());
},_onCalendarSelect:function(){
this._setValue(this._dateCalendar.getDate().getTime());
this._dateButton.setText(this._makeDisplayValue());
},_onDwtInputFieldValidated:function(_108a,_108b,value){
if(_108b){
this._setValue(value);
}
},_setValue:function(val){
this.value=val;
var tr=this._getRowEl();
tr.className=tr.className.replace(/ dirty/,"");
if(this._modified()){
tr.className+=" dirty";
}
},_validate:function(){
if(this._inputField){
if(this._inputField instanceof DwtInputField){
return this._inputField.validate();
}else{
return this._inputField.onblur();
}
}else{
return true;
}
}};
DwtPropertyEditor.simpleClosure=function(func,obj){
return function(){
return func.call(obj,arguments[0]);
};
};
function DwtConfirmDialog(_1091,_1092){
if(arguments.length==0){
return;
}
var _1093=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.CANCEL_BUTTON];
DwtDialog.call(this,_1091,_1092,AjxMsg.confirmTitle,_1093);
this._questionDiv=document.createElement("DIV");
this._questionDiv.className="DwtConfirmDialogQuestion";
this._contentDiv.appendChild(this._questionDiv);
this.registerCallback(DwtDialog.YES_BUTTON,this._handleYesButton,this);
this.registerCallback(DwtDialog.NO_BUTTON,this._handleNoButton,this);
this.registerCallback(DwtDialog.CANCEL_BUTTON,this._handleCancelButton,this);
}
DwtConfirmDialog.prototype=new DwtDialog;
DwtConfirmDialog.prototype.constructor=DwtConfirmDialog;
DwtConfirmDialog.prototype.toString=function(){
return "DwtConfirmDialog";
};
DwtConfirmDialog.prototype._questionDiv;
DwtConfirmDialog.prototype._yesCallback;
DwtConfirmDialog.prototype._noCallback;
DwtConfirmDialog.prototype._cancelCallback;
DwtConfirmDialog.prototype.popup=function(_1094,_1095,_1096,_1097,loc){
this._questionDiv.innerHTML=_1094||"";
this._yesCallback=_1095;
this._noCallback=_1096;
this._cancelCallback=_1097;
this.setButtonVisible(DwtDialog.CANCEL_BUTTON,Boolean(_1096));
DwtDialog.prototype.popup.call(this,loc);
};
DwtConfirmDialog.prototype.popdown=function(){
this._yesCallback=this._noCallback=this._cancelCallback=null;
DwtDialog.prototype.popdown.call(this);
};
DwtConfirmDialog.prototype._handleYesButton=function(ev){
if(this._yesCallback){
this._yesCallback.run(ev);
}
this.popdown();
};
DwtConfirmDialog.prototype._handleNoButton=function(ev){
if(this._noCallback){
this._noCallback.run(ev);
}
this.popdown();
};
DwtConfirmDialog.prototype._handleCancelButton=function(ev){
if(this._cancelCallback){
this._cancelCallback.run(ev);
}
this.popdown();
};
DwtConfirmDialog.prototype._getSeparatorTemplate=function(){
return "";
};
function DwtChooser(_109c){
if(arguments.length==0){
return;
}
DwtComposite.call(this,_109c.parent,_109c.className);
this._slvClassName=_109c.slvClassName;
this._tlvClassName=_109c.tlvClassName;
this._layoutStyle=_109c.layoutStyle?_109c.layoutStyle:DwtChooser.HORIZ_STYLE;
this._selectStyle=_109c.selectStyle?_109c.selectStyle:DwtChooser.MULTI_SELECT;
this._mode=_109c.listStyle?_109c.listStyle:DwtChooser.MODE_MOVE;
this._noDuplicates=(_109c.noDuplicates!==false);
this._singleHeight=_109c.singleHeight?_109c.singleHeight:45;
this._listSize=_109c.listSize;
this._sourceEmptyOk=_109c.sourceEmptyOk;
this._allButtons=_109c.allButtons;
this._hasTextField=_109c.hasTextField;
this._handleButtonInfo(_109c.buttonInfo);
this._mode=_109c.mode?_109c.mode:this._hasMultiButtons?DwtChooser.MODE_COPY:DwtChooser.MODE_MOVE;
this._createHtml();
this._initialize();
var _109d=_109c.parent.getSize();
var _109e=_109c.listWidth||_109d.x;
var _109f=_109c.listHeight||_109d.y;
if(_109e&&_109f){
this.resize(_109e,_109f);
}
}
DwtChooser.prototype=new DwtComposite;
DwtChooser.prototype.constructor=DwtChooser;
DwtChooser.HORIZ_STYLE=1;
DwtChooser.VERT_STYLE=2;
DwtChooser.SINGLE_SELECT=1;
DwtChooser.MULTI_SELECT=2;
DwtChooser.MODE_COPY=1;
DwtChooser.MODE_MOVE=2;
DwtChooser.REMOVE_BTN_ID="__remove__";
DwtChooser.ADD_ALL_BTN_ID="__addAll__";
DwtChooser.REMOVE_ALL_BTN_ID="__removeAll__";
DwtChooser.prototype.toString=function(){
return "DwtChooser";
};
DwtChooser.prototype.setItems=function(items,view,_10a2){
view=view?view:DwtChooserListView.SOURCE;
this._reset(view);
this.addItems(items,view,true);
this._selectFirst(view);
if(_10a2){
this._reset((view==DwtChooserListView.SOURCE)?DwtChooserListView.TARGET:DwtChooserListView.SOURCE);
}
};
DwtChooser.prototype.getItems=function(view){
view=view?view:DwtChooserListView.TARGET;
if(view==DwtChooserListView.SOURCE){
return this.sourceListView.getList().clone();
}else{
if(this._hasMultiButtons){
var data={};
for(var i in this._data){
data[i]=this._data[i].clone();
}
return data;
}else{
return this._data[this._buttonInfo[0].id].clone();
}
}
};
DwtChooser.prototype.addItems=function(items,view,_10a8,id){
view=view?view:DwtChooserListView.SOURCE;
var list=(items instanceof AjxVector)?items.getArray():(items instanceof Array)?items:[items];
if(view==DwtChooserListView.SOURCE){
for(var i=0;i<list.length;i++){
this._addToSource(list[i],null,_10a8);
}
}else{
var data;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.targetListView._resetList();
list=(list.length>0)?[list[0]]:list;
}
for(var i=0;i<list.length;i++){
this._addToTarget(list[i],id,_10a8);
}
}
if(view==DwtChooserListView.SOURCE){
var list=this.sourceListView.getList();
this._sourceSize=list?list.size():0;
}
};
DwtChooser.prototype.removeItems=function(list,view,_10af){
list=(list instanceof AjxVector)?list.getArray():(list instanceof Array)?list:[list];
for(var i=0;i<list.length;i++){
(view==DwtChooserListView.SOURCE)?this._removeFromSource(list[i],_10af):this._removeFromTarget(list[i],_10af);
}
};
DwtChooser.prototype.transfer=function(list,id,_10b3){
id=id?id:this._activeButtonId;
this._setActiveButton(id);
if(this._mode==DwtChooser.MODE_MOVE){
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
var tlist=this.targetListView.getList();
if(tlist&&tlist.size()){
this.remove(tlist,true);
}
}
this.removeItems(list,DwtChooserListView.SOURCE,true);
}
this.addItems(list,DwtChooserListView.TARGET,_10b3);
this.sourceListView.deselectAll();
};
DwtChooser.prototype.remove=function(list,_10b6){
list=(list instanceof AjxVector)?list.getArray():(list instanceof Array)?list:[list];
if(this._mode==DwtChooser.MODE_MOVE){
for(var i=0;i<list.length;i++){
var index=this._getInsertionIndex(this.sourceListView,list[i]);
this.sourceListView.addItem(list[i],index,true);
}
this._sourceSize=list?list.length:0;
}
this.removeItems(list,DwtChooserListView.TARGET);
};
DwtChooser.prototype.setSelectStyle=function(style,_10ba){
if(style==this._selectStyle){
return;
}
this._selectStyle=style;
if(this._defLabel){
var _10bb=this._button[this._buttonInfo[0].id];
_10bb.setText((style==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add);
}
if(!_10ba){
var curSz=this.getSize();
this.resize(curSz.x,curSz.y);
}
if(this._allButtons){
this._addAllButton.setVisible(style==DwtChooser.MULTI_SELECT);
this._removeAllButton.setVisible(style==DwtChooser.MULTI_SELECT);
this._enableButtons();
}
if(style==DwtChooser.SINGLE_SELECT){
var list=this.targetListView.getList();
var a=list?list.clone().getArray():null;
if(a&&a.length){
this._reset(DwtChooserListView.TARGET);
this.addItems(a[0],DwtChooserListView.TARGET,true);
this.targetListView.deselectAll();
if(a.length>1&&this._mode==DwtChooser.MODE_MOVE){
this.addItems(a.slice(1),DwtChooserListView.SOURCE,true);
}
this._enableButtons();
}
}
this.sourceListView.setMultiSelect(style==DwtChooser.MULTI_SELECT);
this.targetListView.setMultiSelect(style==DwtChooser.MULTI_SELECT);
};
DwtChooser.prototype.reset=function(view){
this._reset(view);
this._setActiveButton(this._buttonInfo[0].id);
this._enableButtons();
if(this._hasTextField){
this._textField.setValue("");
}
};
DwtChooser.prototype._reset=function(view){
if(!view||view==DwtChooserListView.SOURCE){
this.sourceListView._resetList();
}
if(!view||view==DwtChooserListView.TARGET){
this.targetListView._resetList();
for(var i in this._data){
this._data[i].removeAll();
}
}
};
DwtChooser.prototype.addStateChangeListener=function(_10c2){
this.targetListView.addStateChangeListener(_10c2);
};
DwtChooser.prototype.removeStateChangeListener=function(_10c3){
this.targetListView.removeStateChangeListener(_10c3);
};
DwtChooser.prototype.getSourceListView=function(){
return document.getElementById(this._sourceListViewDivId);
};
DwtChooser.prototype.getButtons=function(){
return document.getElementById(this._buttonsDivId);
};
DwtChooser.prototype.getTargetListView=function(){
return document.getElementById(this._targetListViewDivId);
};
DwtChooser.prototype.getTextField=function(){
return this._textField;
};
DwtChooser.prototype._createHtml=function(){
this._sourceListViewDivId=Dwt.getNextId();
this._targetListViewDivId=Dwt.getNextId();
this._buttonsDivId=Dwt.getNextId();
this._removeButtonDivId=Dwt.getNextId();
if(this._allButtons){
this._addAllButtonDivId=Dwt.getNextId();
this._removeAllButtonDivId=Dwt.getNextId();
}
if(this._hasTextField){
this._textFieldTdId=Dwt.getNextId();
}
var html=[];
var idx=0;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
html[idx++]="<table cellspacing=0 cellpadding=0 border=0>";
html[idx++]="<tr>";
html[idx++]="<td id='";
html[idx++]=this._sourceListViewDivId;
html[idx++]="'></td>";
html[idx++]="<td valign='middle' id='";
html[idx++]=this._buttonsDivId;
html[idx++]="'>";
if(this._allButtons){
html[idx++]="<div id='";
html[idx++]=this._addAllButtonDivId;
html[idx++]="'></div><br>";
}
for(var i=0;i<this._buttonInfo.length;i++){
var id=this._buttonInfo[i].id;
html[idx++]="<div id='";
html[idx++]=this._buttonDivId[id];
html[idx++]="'></div><br>";
}
html[idx++]="<br><div id='";
html[idx++]=this._removeButtonDivId;
html[idx++]="'></div>";
if(this._allButtons){
html[idx++]="<br><div id='";
html[idx++]=this._removeAllButtonDivId;
html[idx++]="'></div><br>";
}
html[idx++]="</td>";
html[idx++]="<td id='";
html[idx++]=this._targetListViewDivId;
html[idx++]="'></td>";
html[idx++]="</tr>";
if(this._hasTextField){
html[idx++]="<tr><td>";
html[idx++]="<table border=0 width=100%><tr><td style='white-space:nowrap; width:1%'>";
html[idx++]=AjxMsg.add;
html[idx++]=":</td><td id='";
html[idx++]=this._textFieldTdId;
html[idx++]="'></td></tr></table>";
html[idx++]="</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
}
html[idx++]="</table>";
}else{
html[idx++]="<div id='";
html[idx++]=this._sourceListViewDivId;
html[idx++]="'></div>";
html[idx++]="<div align='center' id='";
html[idx++]=this._buttonsDivId;
html[idx++]="'>";
html[idx++]="<table><tr>";
if(this._allButtons){
html[idx++]="<td id='";
html[idx++]=this._addAllButtonDivId;
html[idx++]="'></td>";
}
for(var i=0;i<this._buttonInfo.length;i++){
var id=this._buttonInfo[i].id;
html[idx++]="<td id='";
html[idx++]=this._buttonDivId[id];
html[idx++]="'></td>";
}
html[idx++]="<td id='";
html[idx++]=this._removeButtonDivId;
html[idx++]="'></td>";
if(this._allButtons){
html[idx++]="<td id='";
html[idx++]=this._removeAllButtonDivId;
html[idx++]="'></td>";
}
html[idx++]="</tr></table></div>";
html[idx++]="<div id='";
html[idx++]=this._targetListViewDivId;
html[idx++]="'></div>";
}
this.getHtmlElement().innerHTML=html.join("");
};
DwtChooser.prototype._handleButtonInfo=function(_10c8){
if(!_10c8){
this._defLabel=(this._selectStyle==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add;
_10c8=[{label:this._defLabel}];
}
this._buttonInfo=_10c8;
this._buttonDivId={};
this._buttonId={};
if(this._buttonInfo.length==1){
if(!this._buttonInfo[0].id){
this._buttonInfo[0].id=Dwt.getNextId();
}
this._activeButtonId=this._buttonInfo[0].id;
}
for(var i=0;i<this._buttonInfo.length;i++){
var id=this._buttonInfo[i].id;
this._buttonDivId[id]=Dwt.getNextId();
this._buttonId[id]=Dwt.getNextId();
}
this._hasMultiButtons=(this._buttonInfo.length>1);
};
DwtChooser.prototype._initialize=function(){
var _10cb=new AjxListener(this,this._transferButtonListener);
this._button={};
this._buttonIndex={};
this._data={};
for(var i=0;i<this._buttonInfo.length;i++){
var id=this._buttonInfo[i].id;
this._button[id]=this._setupButton(id,this._buttonId[id],this._buttonDivId[id],this._buttonInfo[i].label);
this._button[id].addSelectionListener(_10cb);
this._buttonIndex[id]=i;
this._data[id]=new AjxVector();
}
this.sourceListView=this._createSourceListView();
this._addListView(this.sourceListView,this._sourceListViewDivId);
this.sourceListView.addSelectionListener(new AjxListener(this,this._sourceListener));
this.targetListView=this._createTargetListView();
this._addListView(this.targetListView,this._targetListViewDivId);
this.targetListView.addSelectionListener(new AjxListener(this,this._targetListener));
this._removeButtonId=Dwt.getNextId();
this._removeButton=this._setupButton(DwtChooser.REMOVE_BTN_ID,this._removeButtonId,this._removeButtonDivId,AjxMsg.remove);
this._removeButton.addSelectionListener(new AjxListener(this,this._removeButtonListener));
if(this._allButtons){
this._addAllButtonId=Dwt.getNextId();
this._addAllButton=this._setupButton(DwtChooser.ADD_ALL_BTN_ID,this._addAllButtonId,this._addAllButtonDivId,AjxMsg.addAll);
this._addAllButton.addSelectionListener(new AjxListener(this,this._addAllButtonListener));
this._removeAllButtonId=Dwt.getNextId();
this._removeAllButton=this._setupButton(DwtChooser.REMOVE_ALL_BTN_ID,this._removeAllButtonId,this._removeAllButtonDivId,AjxMsg.removeAll);
this._removeAllButton.addSelectionListener(new AjxListener(this,this._removeAllButtonListener));
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this._addAllButton.setVisible(false);
this._removeAllButton.setVisible(false);
}
}
if(this._hasTextField){
var _10ce={parent:this,type:DwtInputField.STRING};
this._textField=new DwtInputField(_10ce);
this._textField.reparentHtmlElement(this._textFieldTdId);
this._textField.getInputElement()._chooserId=AjxCore.assignId(this);
this._textField.setHandler(DwtEvent.ONKEYUP,DwtChooser._onKeyUp);
Dwt.setSize(this._textField.getInputElement(),"100%",Dwt.DEFAULT);
}
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.sourceListView.setMultiSelect(false);
this.targetListView.setMultiSelect(false);
}
};
DwtChooser.prototype._createSourceListView=function(){
return new DwtChooserListView(this,DwtChooserListView.SOURCE,this._slvClassName);
};
DwtChooser.prototype._createTargetListView=function(){
return new DwtChooserListView(this,DwtChooserListView.TARGET,this._tlvClassName);
};
DwtChooser.prototype._addListView=function(_10cf,_10d0){
var _10d1=document.getElementById(_10d0);
_10d1.appendChild(_10cf.getHtmlElement());
_10cf.setUI(null,true);
_10cf._initialized=true;
};
DwtChooser.prototype.resize=function(width,_10d3){
if(!width||!_10d3){
return;
}
if(width==Dwt.DEFAULT&&_10d3==Dwt.DEFAULT){
return;
}
var _10d4=document.getElementById(this._buttonsDivId);
var btnSz=Dwt.getSize(_10d4);
var w,sh,th;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
w=this._listSize?this._listSize:(width==Dwt.DEFAULT)?width:Math.floor(((width-btnSz.x)/2)-12);
sh=th=_10d3;
}else{
w=width;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
sh=this._listSize?this._listSize:(_10d3==Dwt.DEFAULT)?_10d3:_10d3-btnSz.y-this._singleHeight-30;
th=(_10d3==Dwt.DEFAULT)?_10d3:_10d3-btnSz.y-sh-30;
}else{
sh=th=this._listSize?this._listSize:(_10d3==Dwt.DEFAULT)?_10d3:Math.floor(((_10d3-btnSz.y)/2)-12);
}
}
this.sourceListView.setSize(w,sh);
this.targetListView.setSize(w,th);
};
DwtChooser.prototype._setupButton=function(id,_10d8,_10d9,label){
var _10db=new DwtButton(this);
_10db.setText(label);
_10db.id=_10d8;
_10db.setHtmlElementId(_10d8);
_10db._activeClassName=_10db._origClassName+"-"+DwtCssStyle.ACTIVE;
_10db._nonActiveClassName=_10db._origClassName;
_10db._buttonId=id;
var _10dc=document.getElementById(_10d9);
_10dc.appendChild(_10db.getHtmlElement());
return _10db;
};
DwtChooser.prototype._sourceListener=function(ev){
if(ev.detail==DwtListView.ITEM_DBL_CLICKED){
this.transfer(this.sourceListView.getSelection(),this._activeButtonId);
this.sourceListView.deselectAll();
}else{
if(this._activeButtonId==DwtChooser.REMOVE_BTN_ID){
var id=this._lastActiveTransferButtonId?this._lastActiveTransferButtonId:this._buttonInfo[0].id;
this._setActiveButton(id);
}
}
this.targetListView.deselectAll();
this._enableButtons();
};
DwtChooser.prototype._targetListener=function(ev){
if(ev.detail==DwtListView.ITEM_DBL_CLICKED){
this.remove(this.targetListView.getSelection());
}else{
this._setActiveButton(DwtChooser.REMOVE_BTN_ID);
this.sourceListView.deselectAll();
this._enableButtons();
}
};
DwtChooser.prototype._transferButtonListener=function(ev){
var _10e1=DwtUiEvent.getDwtObjFromEvent(ev);
var id=_10e1._buttonId;
var sel=this.sourceListView.getSelection();
if(sel&&sel.length){
this.transfer(sel,id);
var list=this.sourceListView.getList();
if(list&&list.size()){
this._selectFirst(DwtChooserListView.SOURCE);
}else{
this._enableButtons();
}
}else{
var email=this._getEmailFromText();
if(email){
this.transfer([email],id);
}else{
this._setActiveButton(id);
}
}
};
DwtChooser.prototype._removeButtonListener=function(ev){
this.remove(this.targetListView.getSelection());
var list=this.targetListView.getList();
if(list&&list.size()){
this._selectFirst(DwtChooserListView.TARGET);
}else{
this._enableButtons();
}
};
DwtChooser.prototype._addAllButtonListener=function(ev){
this.transfer(this.sourceListView.getList().clone());
this._selectFirst(DwtChooserListView.TARGET);
};
DwtChooser.prototype._removeAllButtonListener=function(ev){
this.remove(this.targetListView.getList().clone());
this._selectFirst(DwtChooserListView.SOURCE);
};
DwtChooser.prototype._enableButtons=function(_10ea,_10eb){
var _10ec=this.sourceListView.getList();
var _10ed=this.targetListView.getList();
var _10ee=(_10ea||(this.sourceListView.getSelectionCount()>0));
for(var i=0;i<this._buttonInfo.length;i++){
var id=this._buttonInfo[i].id;
this._button[id].setEnabled(_10ee);
}
var _10f1=(_10eb||(this.targetListView.getSelectionCount()>0));
this._removeButton.setEnabled(_10f1);
if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){
var _10f2=_10ec?_10ec.size():0;
var _10f3=_10ed?_10ed.size():0;
this._addAllButton.setEnabled(_10f2>0);
this._removeAllButton.setEnabled(_10f3>0);
}
};
DwtChooser.prototype._selectFirst=function(view,index){
var _10f6=(view==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView;
var list=_10f6.getList();
if(list&&list.size()>0){
_10f6.setSelection(list.get(0));
}
};
DwtChooser.prototype._setActiveButton=function(id){
if(!this._hasMultiButtons){
return;
}
if(id!=this._activeButtonId){
var _10f9=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId];
if(_10f9){
var _10fa=Dwt.getObjectFromElement(document.getElementById(_10f9));
if(_10fa){
_10fa._origClassName=_10fa._nonActiveClassName;
_10fa.setClassName(_10fa._origClassName);
}
}
_10f9=(id==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[id];
var _10fb=Dwt.getObjectFromElement(document.getElementById(_10f9));
if(_10fb){
_10fb._origClassName=_10fb._activeClassName;
_10fb.setClassName(_10fb._origClassName);
}
this._activeButtonId=id;
if(id!=DwtChooser.REMOVE_BTN_ID){
this._lastActiveTransferButtonId=id;
}
}
};
DwtChooser.prototype._isDuplicate=function(item,list){
return list.contains(item);
};
DwtChooser.prototype._addToSource=function(item,index,_1100){
if(!item){
return;
}
if(!item._chooserIndex){
var list=this.sourceListView.getList();
item._chooserIndex=list?list.size()+1:1;
}
this.sourceListView.addItem(item,index,_1100);
};
DwtChooser.prototype._addToTarget=function(item,id,_1104){
if(!item){
return;
}
id=id?id:this._activeButtonId;
if(this._noDuplicates&&this._data[id]&&this._isDuplicate(item,this._data[id])){
return;
}
var list=this.targetListView.getList();
if(list&&list.contains(item)&&item.clone){
var _1106=item.clone();
_1106.id=Dwt.getNextId();
item=_1106;
}
var idx=null;
if(this._hasMultiButtons){
var list=[];
for(var i=0;i<this._buttonInfo.length;i++){
list=list.concat(this._data[this._buttonInfo[i].id].getArray());
}
var _1109=this._buttonIndex[id];
for(idx=0;idx<list.length;idx++){
var _110a=this._buttonIndex[list[idx]._buttonId];
if(_110a>_1109){
break;
}
}
}
item._buttonId=id;
this._data[id].add(item);
if(!item.id){
item.id=Dwt.getNextId();
}
this.targetListView.addItem(item,idx,_1104);
};
DwtChooser.prototype._removeFromSource=function(item,_110c){
if(!item){
return;
}
var list=this.sourceListView.getList();
if(!list){
return;
}
if(!list.contains(item)){
return;
}
this.sourceListView.removeItem(item,_110c);
};
DwtChooser.prototype._removeFromTarget=function(item,_110f){
if(!item){
return;
}
var list=this.targetListView.getList();
if(!list){
return;
}
if(!list.contains(item)){
return;
}
this._data[item._buttonId].remove(item);
this.targetListView.removeItem(item,_110f);
};
DwtChooser.prototype._getInsertionIndex=function(view,item){
var list=view.getList();
if(!list){
return null;
}
var a=list.getArray();
for(var i=0;i<a.length;i++){
if(item._chooserIndex&&a[i]._chooserIndex&&(a[i]._chooserIndex>=item._chooserIndex)){
return i;
}
}
return null;
};
DwtChooser.prototype._getEmailFromText=function(){
var text=this._textField.getValue();
var email=ZmEmailAddress.parse(text);
if(email){
email.id=Dwt.getNextId();
return email;
}
};
DwtChooser._onKeyUp=function(ev){
var el=DwtUiEvent.getTarget(ev);
var _111a=AjxCore.objectWithId(el._chooserId);
var key=DwtKeyEvent.getCharCode(ev);
if(key==3||key==13){
var email=_111a._getEmailFromText();
if(email){
_111a.transfer([email],_111a._activeButtonId);
el.value="";
}
}
_111a._enableButtons(el.value.length);
};
function DwtChooserListView(_111d,type,_111f){
if(arguments.length==0){
return;
}
_111f=_111f?_111f:"DwtChooserListView";
DwtListView.call(this,_111d,_111f,null,this._getHeaderList(_111d));
this.type=type;
this._chooserParent=_111d.parent;
}
DwtChooserListView.SOURCE=1;
DwtChooserListView.TARGET=2;
DwtChooserListView.prototype=new DwtListView;
DwtChooserListView.prototype.constructor=DwtChooserListView;
DwtChooserListView.prototype._getHeaderList=function(){
};
DwtChooserListView.prototype.toString=function(){
return "DwtChooserListView";
};
DwtChooserListView.prototype.setUI=function(_1120,_1121){
_1121=_1121?_1121:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk);
DwtListView.prototype.setUI.call(this,_1120,_1121);
};
DwtChooserListView.prototype._createItemHtml=function(item,now,_1124){
var div=document.createElement("div");
div[DwtListView._STYLE_CLASS]="Row";
div[DwtListView._SELECTED_STYLE_CLASS]=[div[DwtListView._STYLE_CLASS],"-",DwtCssStyle.SELECTED].join("");
div.className=div[DwtListView._STYLE_CLASS];
var _1126=(typeof item=="string")?String(item):item.toString();
div.innerHTML=AjxStringUtil.htmlEncode(_1126);
if(!item.id){
item.id=Dwt.getNextId();
}
this.associateItemWithElement(item,div,DwtListView.TYPE_LIST_ITEM);
return div;
};
DwtChooserListView.prototype._itemClicked=function(_1127,ev){
if(!ev.shiftKey&&!ev.ctrlKey&&ev.button==DwtMouseEvent.RIGHT){
return;
}else{
DwtListView.prototype._itemClicked.call(this,_1127,ev);
}
};
DwtChooserListView.prototype._sortColumn=function(_1129,_112a){
this._chooserParent.search(_1129,_112a);
};
function DwtGridSizePicker(_112b,title){
if(arguments.length==0){
return;
}
DwtControl.call(this,_112b,"DwtGridSizePicker");
this._title=title;
if(_112b instanceof DwtMenu){
_112b.addPopdownListener(new AjxListener(this,this._reset));
}
this._reset();
}
DwtGridSizePicker.prototype=new DwtControl;
DwtGridSizePicker.prototype.constructor=DwtGridSizePicker;
DwtGridSizePicker.prototype.addSelectionListener=function(_112d){
this.addListener(DwtEvent.SELECTION,_112d);
};
DwtGridSizePicker.prototype.removeSelectionListener=function(_112e){
this.removeListener(DwtEvent.SELECTION,_112e);
};
DwtGridSizePicker.prototype._createGrid=function(){
var el=this.getHtmlElement();
var html=["<table cellpadding='0' border='0' cellspacing='0'>","<tr class='info'><td colspan='",this.maxCols,"'>",this._title,"</td></tr>"];
var row=["<tr class='grid'>"];
for(var i=0;i<this.maxCols;++i){
row.push("<td unselectable='unselectable'></td>");
}
row.push("</tr>");
row=row.join("");
for(var i=0;i<this.maxRows;++i){
html.push(row);
}
html.push("</table>");
html=html.join("");
el.innerHTML=html;
el.onmouseover=DwtGridSizePicker._onMouseOver;
el.onmouseup=DwtGridSizePicker._onSelect;
};
DwtGridSizePicker.prototype._reset=function(){
this._endRow=-1;
this._endCol=-1;
this.maxRows=7;
this.maxCols=7;
this._createGrid();
};
DwtGridSizePicker._onSelect=function(ev){
if(AjxEnv.isIE){
ev=window.event;
}
DwtUiEvent.getDwtObjFromEvent(ev)._onSelect(ev);
};
DwtGridSizePicker.prototype._onSelect=function(ev){
if(AjxEnv.isIE){
ev=window.event;
}
var dwtev=new DwtUiEvent();
dwtev.setFromDhtmlEvent(ev);
var _1136=dwtev.target;
if(_1136.tagName.toLowerCase()=="td"){
var row=_1136.parentNode.rowIndex;
if(row>0){
var col=_1136.cellIndex;
var selev=DwtShell.selectionEvent;
selev.item=this;
selev.detail={rows:row,cols:col+1};
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu();
}
this.notifyListeners(DwtEvent.SELECTION,selev);
}
}
};
DwtGridSizePicker.prototype._onMouseOut=function(ev){
if(AjxEnv.isIE){
ev=window.event;
}
var dwtev=new DwtUiEvent();
dwtev.setFromDhtmlEvent(ev);
var tgt=dwtev.target;
var table=this.getHtmlElement().firstChild;
try{
while(tgt&&tgt!==table){
tgt=tgt.parentNode;
}
}
catch(ex){
tgt=null;
}
if(!tgt){
this._endRow=this._endCol=-1;
this._update();
}
};
DwtGridSizePicker._onMouseOver=function(ev){
if(AjxEnv.isIE){
ev=window.event;
}
DwtUiEvent.getDwtObjFromEvent(ev)._onMouseOver(ev);
};
DwtGridSizePicker.prototype._onMouseOver=function(ev){
var dwtev=new DwtUiEvent(true);
dwtev.setFromDhtmlEvent(ev);
var _1141=dwtev.target;
if(this._updateTimeout){
clearTimeout(this._updateTimeout);
}
this._updateTimeout=setTimeout(AjxCallback.simpleClosure(this._updateOnTimeout,this,_1141),10);
dwtev.setToDhtmlEvent(ev);
};
DwtGridSizePicker.prototype._addRow=function(){
var table=this.getHtmlElement().firstChild;
var tr=table.insertRow(-1);
tr.className="grid";
for(var i=0;i<this.maxCols;++i){
var td=tr.insertCell(-1);
td.unselectable=true;
}
++this.maxRows;
};
DwtGridSizePicker.prototype._addCol=function(){
var table=this.getHtmlElement().firstChild;
var rows=table.rows;
for(var i=1;i<=this.maxRows;++i){
var tr=rows[i];
var td=tr.insertCell(-1);
td.unselectable=true;
}
++table.rows[0].cells[0].colSpan;
++this.maxCols;
};
DwtGridSizePicker.prototype._updateOnTimeout=function(_114b){
var clear=true,row,col;
if(_114b.tagName.toLowerCase()=="td"){
row=_114b.parentNode.rowIndex;
if(row>0){
col=this._endCol=_114b.cellIndex;
this._endRow=_114b.parentNode.rowIndex-1;
clear=false;
}
}
if(clear){
this._endRow=this._endCol=-1;
}
this._update();
if(!clear){
if(row==this.maxRows){
this._addRow();
}
if(col==this.maxCols-1){
this._addCol();
}
}
};
DwtGridSizePicker.prototype._update=function(){
var _114d=this._endRow;
var _114e=this._endCol;
var table=this.getHtmlElement().firstChild;
var _1150=table.rows[0].cells[0];
this._rows=_114d+1;
this._cols=_114e+1;
if(this._rows>0&&this._cols>0){
_1150.innerHTML=this._rows+" x "+this._cols;
}else{
_1150.innerHTML=this._title;
}
for(var i=0;i<this.maxRows;++i){
var row=table.rows[i+1];
for(var j=0;j<this.maxCols;++j){
var cell=row.cells[j];
var clear=(i>this._endRow)||(j>this._endCol);
if(clear){
Dwt.delClass(cell,"Hovered");
}else{
Dwt.addClass(cell,"Hovered");
}
}
}
};
function DwtSpinner(_1156){
if(arguments.length==0){
return;
}
DwtControl.call(this,_1156.parent,_1156.className,_1156.posStyle);
this._maxValue=_1156.max!=null?_1156.max:null;
this._minValue=_1156.min!=null?_1156.min:null;
this._fieldSize=_1156.size!=null?_1156.size:3;
this._origValue=_1156.value||0;
this._maxLen=_1156.maxLen||null;
this._step=_1156.step||1;
this._decimals="decimals" in _1156?_1156.decimals:0;
this._align=_1156.align||null;
this._skipCaretHack=_1156.skipCaretHack;
this._timerFunc=AjxCallback.simpleClosure(this._timerFunc,this);
this._btnPressCapture=new DwtMouseEventCapture(this,"DwtSpinner",null,null,null,AjxCallback.simpleClosure(this._stopCapture,this),null,true);
this._createElements();
}
DwtSpinner.prototype=new DwtControl;
DwtSpinner.prototype.constructor=DwtSpinner;
DwtSpinner.INIT_TIMER=250;
DwtSpinner.SLOW_TIMER=125;
DwtSpinner.FAST_TIMER=33;
DwtSpinner.prototype._createElements=function(){
var div=this.getHtmlElement();
var id=Dwt.getNextId();
this._idField=id;
this._idUpButton=id+"-up";
this._idDownButton=id+"-down";
var _1159=this._skipCaretHack?"":Dwt.CARET_HACK_BEGIN;
var _115a=this._skipCaretHack?"":Dwt.CARET_HACK_END;
var html=["<table class='DwtSpinner' cellspacing='0' cellpadding='0'>","<tr><td rowspan='2' class='DwtSpinner-inputCell'>",_1159,"<input id='",id,"' autocomplete='off' />",_115a,"</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>"];
div.innerHTML=html.join("");
var b1=this._getUpButton();
b1.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Up");
var b2=this._getDownButton();
b2.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Down");
var input=this.getInputElement();
if(this._maxLen){
input.maxLength=this._maxLen;
}
if(this._fieldSize){
input.size=this._fieldSize;
}
if(this._align){
input.style.textAlign=this._align;
}
if(this._origValue!=null){
this.setValue(this._origValue);
}
input.onblur=AjxCallback.simpleClosure(this.setValue,this,null);
input[(AjxEnv.isIE||AjxEnv.isOpera)?"onkeydown":"onkeypress"]=AjxCallback.simpleClosure(this.__onKeyPress,this);
};
DwtSpinner.prototype._getValidValue=function(val){
var n=parseFloat(val);
if(isNaN(n)||n==null){
n=this._lastValidValue;
}
if(n==null){
n=this._minValue||0;
}
if(this._minValue!=null&&n<this._minValue){
n=this._minValue;
}
if(this._maxValue!=null&&n>this._maxValue){
n=this._maxValue;
}
n=parseFloat(n);
if(this._decimals!=null){
n=n.toFixed(this._decimals);
}
this._lastValidValue=n;
return n;
};
DwtSpinner.prototype.getInputElement=function(){
return document.getElementById(this._idField);
};
DwtSpinner.prototype._getUpButton=function(){
return document.getElementById(this._idUpButton);
};
DwtSpinner.prototype._getDownButton=function(){
return document.getElementById(this._idDownButton);
};
DwtSpinner.prototype._getButton=function(_1161){
switch(_1161){
case "Up":
return this._getUpButton();
case "Down":
return this._getDownButton();
}
};
DwtSpinner.prototype._setBtnState=function(dir,_1163){
var btn=this._getButton(dir);
if(_1163){
Dwt.addClass(btn,"DwtSpinner-"+dir+"-disabled");
btn.firstChild.className="Img"+dir+"ArrowSmallDis";
}else{
Dwt.delClass(btn,"DwtSpinner-"+dir+"-disabled");
btn.firstChild.className="Img"+dir+"ArrowSmall";
}
};
DwtSpinner.prototype.getValue=function(){
return parseFloat(this._getValidValue(this.getInputElement().value));
};
DwtSpinner.prototype.setValue=function(val){
if(val==null){
val=this.getInputElement().value;
}
val=this._getValidValue(val);
this.getInputElement().value=val;
val=parseFloat(val);
this._setBtnState("Down",this._minValue!=null&&this._minValue==val);
this._setBtnState("Up",this._maxValue!=null&&this._maxValue==val);
};
DwtSpinner.prototype.setEnabled=function(_1166){
DwtControl.prototype.setEnabled.call(this,_1166);
this.getInputElement().disabled=!_1166;
var table=this.getHtmlElement().firstChild;
if(!_1166){
Dwt.addClass(table,"DwtSpinner-disabled");
}else{
Dwt.delClass(table,"DwtSpinner-disabled");
}
};
DwtSpinner.prototype._rotateVal=function(_1168){
var val=this.getValue();
switch(_1168){
case "Up":
val+=this._step;
break;
case "Down":
val-=this._step;
break;
}
this.setValue(val);
};
DwtSpinner.prototype._btnPressed=function(_116a){
if(!this.getEnabled()){
return;
}
Dwt.addClass(this._getButton(_116a),"DwtSpinner-"+_116a+"-pressed");
this._direction=_116a;
this._rotateVal(_116a);
this._btnPressCapture.capture();
this._timerSteps=0;
this._timer=setTimeout(this._timerFunc,DwtSpinner.INIT_TIMER);
};
DwtSpinner.prototype._timerFunc=function(){
var v1=this.getValue();
this._rotateVal(this._direction);
var v2=this.getValue();
this._timerSteps++;
var _116d=this._timerSteps>4?DwtSpinner.FAST_TIMER:DwtSpinner.SLOW_TIMER;
if(v1!=v2){
this._timer=setTimeout(this._timerFunc,_116d);
}else{
this._stopCapture();
}
};
DwtSpinner.prototype._stopCapture=function(){
if(this._timer){
clearTimeout(this._timer);
}
this._timer=null;
this._timerSteps=null;
var _116e=this._direction;
Dwt.delClass(this._getButton(_116e),"DwtSpinner-"+_116e+"-pressed");
this._direction=null;
this._btnPressCapture.release();
var input=this.getInputElement();
input.focus();
Dwt.setSelectionRange(input,0,input.value.length);
};
DwtSpinner.prototype.__onKeyPress=function(ev){
if(AjxEnv.isIE){
ev=window.event;
}
var dir=null;
switch(ev.keyCode){
case 38:
dir="Up";
break;
case 40:
dir="Down";
break;
}
if(dir){
this._rotateVal(dir);
var input=this.getInputElement();
Dwt.setSelectionRange(input,0,input.value.length);
}
};
DwtSpinner.prototype.focus=function(){
this.getInputElement().focus();
};
DwtSpinner.prototype.select=function(){
var input=this.getInputElement();
input.focus();
Dwt.setSelectionRange(input,0,input.value.length);
};
function DwtButtonColorPicker(_1174,style,_1176,_1177,id,index,_117a){
DwtButton.call(this,_1174,style,_1176,_1177,DwtButton.ACTION_MOUSEUP,id,index);
var m=new DwtMenu(this,DwtMenu.COLOR_PICKER_STYLE,null,null,true);
this.setMenu(m);
var cp=new DwtColorPicker(m,null,null,_117a);
cp.addSelectionListener(new AjxListener(this,this._colorPicked));
this.__color="";
}
DwtButtonColorPicker.prototype=new DwtButton;
DwtButtonColorPicker.prototype.constructor=DwtButtonColorPicker;
DwtButtonColorPicker._RGB_RE=/rgb\(([0-9]{1,3}),\s*([0-9]{1,3}),\s*([0-9]{1,3})\)/;
DwtButtonColorPicker._hexdigits=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
DwtButtonColorPicker.toHex=function(n,pad){
var _117f=[];
while(n){
var d=DwtButtonColorPicker._hexdigits[n&15];
_117f.push(d);
n=n>>4;
}
if(pad!=null){
pad-=_117f.length;
while(pad-->0){
_117f.push("0");
}
}
_117f.reverse();
return _117f.join("");
};
DwtButtonColorPicker.prototype._colorPicked=function(ev){
var color=ev.detail;
this.__color=this.__detail=color;
if(this.__colorDisplay){
this.__colorDisplay.firstChild.style.backgroundColor=color;
}
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var selEv=DwtShell.selectionEvent;
selEv.item=this;
selEv.detail=color;
this.notifyListeners(DwtEvent.SELECTION,selEv);
}
};
DwtButtonColorPicker.prototype.showColorDisplay=function(_1184){
var row=this._row,idx=0;
if(this._textCell){
idx=Dwt.getCellIndex(this._textCell);
}else{
if(this._imageCell){
idx=Dwt.getCellIndex(this._imageCell)+1;
}
}
var div=this.__colorDisplay=row.insertCell(idx);
div.innerHTML="<div unselectable class='DwtButtonColorPicker-display'>&nbsp;</div>";
if(!_1184){
div=div.firstChild;
div.onmouseover=DwtButtonColorPicker.__colorDisplay_onMouseOver;
div.onmouseout=DwtButtonColorPicker.__colorDisplay_onMouseOut;
div.onmousedown=DwtButtonColorPicker.__colorDisplay_onMouseDown;
}
};
DwtButtonColorPicker.prototype.getColor=function(){
return this.__color;
};
DwtButtonColorPicker.prototype.setColor=function(color){
var rgb=color.match(DwtButtonColorPicker._RGB_RE);
if(rgb){
color="#"+DwtButtonColorPicker.toHex(parseInt(rgb[1]),2)+DwtButtonColorPicker.toHex(parseInt(rgb[2]),2)+DwtButtonColorPicker.toHex(parseInt(rgb[3]),2);
}
this.__color=color;
if(this.__colorDisplay){
this.__colorDisplay.firstChild.style.backgroundColor=color;
}
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseOver=function(ev,div){
if(!this.getEnabled()){
return;
}
Dwt.addClass(div,"ImgDisable");
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseOut=function(ev,div){
if(!this.getEnabled()){
return;
}
Dwt.delClass(div,"ImgDisable");
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseDown=function(ev,div){
if(!this.getEnabled()){
return;
}
var dwtev=DwtShell.mouseEvent;
dwtev.setFromDhtmlEvent(ev);
this.__color=this.__detail=div.style.backgroundColor="";
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var selEv=DwtShell.selectionEvent;
selEv.item=this;
selEv.detail="";
this.notifyListeners(DwtEvent.SELECTION,selEv);
}
dwtev._stopPropagation=true;
dwtev._returnValue=false;
dwtev.setToDhtmlEvent(ev);
return false;
};
DwtButtonColorPicker.__colorDisplay_onMouseOver=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
obj.__colorDisplay_onMouseOver(ev,this);
};
DwtButtonColorPicker.__colorDisplay_onMouseOut=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
obj.__colorDisplay_onMouseOut(ev,this);
};
DwtButtonColorPicker.__colorDisplay_onMouseDown=function(ev){
var obj=DwtUiEvent.getDwtObjFromEvent(ev);
obj.__colorDisplay_onMouseDown(ev,this);
};
function DwtMessageComposite(_1197,_1198,_1199){
if(arguments.length==0){
return;
}
_1198=_1198||"DwtMessageComposite";
DwtComposite.call(this,_1197,_1198,_1199);
}
DwtMessageComposite.prototype=new DwtComposite;
DwtMessageComposite.prototype.constructor=DwtMessageComposite;
DwtMessageComposite.prototype.toString=function(){
return "DwtMessageComposite";
};
DwtMessageComposite.prototype._formatter;
DwtMessageComposite.prototype._controls;
DwtMessageComposite.prototype.setFormat=function(_119a,_119b,_119c){
this._formatter=new AjxMessageFormat(_119a);
this._controls={};
var id=this._htmlElId;
var a=["<table border='0'><tr valign='center'>"];
var _119f=this._formatter.getSegments();
var cells={};
var hints={};
for(var i=0;i<_119f.length;i++){
var _11a3=_119f[i];
var _11a4=_11a3 instanceof AjxMessageFormat.MessageSegment;
var cid=[id,i].join("_");
a.push("<td id='",cid,"' class='",(_11a4?"MessageControl"+_11a3.getIndex():""),"'>");
if(_11a4){
var _11a6=_119b?_119b.run(this,_11a3,i):null;
if(!_11a6){
_11a6=new DwtInputField({parent:this});
}
cells[cid]=_11a6.getHtmlElement();
hints[cid]=_119c&&_119c.run(this,_11a3,i);
var _11a7=_11a3.getIndex();
this._controls[_11a7]=this._controls[_11a7]||_11a6;
}else{
a.push(_11a3.toSubPattern());
}
a.push("</td>");
}
a.push("</tr></table>");
var el=this.getHtmlElement();
var count=el.childNodes.length;
var _11aa=document.createElement("DIV");
_11aa.className=id+"_container";
el.appendChild(_11aa);
_11aa.innerHTML=a.join("");
for(var cid in cells){
var cell=cells[cid];
var _11ac=document.getElementById(cid);
_11ac.appendChild(cell);
for(var p in hints[cid]){
_11ac[p]=hints[cid][p];
}
}
};
DwtMessageComposite.prototype.format=function(){
var args=[];
for(var _11af in this._controls){
args[_11af]=this._controls[_11af].getValue();
}
return this._formatter.format(args);
};
function ZmBatchCommand(_11b0,_11b1){
this._appCtxt=_11b0;
this._continue=(_11b1===false)?"stop":"continue";
this.curId=0;
this._cmds=[];
this._soapDocs=[];
this._respCallbacks=[];
this._errorCallbacks=[];
this._execFrames=[];
}
ZmBatchCommand.prototype.toString=function(){
return "ZmBatchCommand";
};
ZmBatchCommand.prototype.add=function(cmd){
this._cmds.push(cmd);
};
ZmBatchCommand.prototype.size=function(){
return this.curId;
};
ZmBatchCommand.prototype.run=function(_11b3){
for(var i=0;i<this._cmds.length;i++){
var cmd=this._cmds[i];
cmd.run(this);
this.curId++;
}
if(AjxEnv.isSafari){
this.runSafari(_11b3);
return;
}
var _11b6=AjxSoapDoc.create("BatchRequest","urn:zimbra");
_11b6.setMethodAttribute("onerror",this._continue);
var size=this.size();
for(var i=0;i<size;i++){
var _11b8=this._soapDocs[i];
var reqEl=_11b8.getMethod();
reqEl.setAttribute("id",i);
var node=_11b6.adoptNode(reqEl);
_11b6.getMethod().appendChild(node);
}
var _11bb=new AjxCallback(this,this._handleResponseRun,[_11b3]);
this._appCtxt.getAppController().sendRequest({soapDoc:_11b6,asyncMode:true,callback:_11bb});
};
ZmBatchCommand.prototype.runSafari=function(_11bc){
this._responseCount=0;
var _11bd=new AjxCallback(this,this._handleResponseRunSafari,[_11bc]);
var size=this.size();
for(var i=0;i<size;i++){
var _11c0=this._soapDocs[i];
var reqEl=_11c0.getMethod();
reqEl.setAttribute("id",i);
this._appCtxt.getAppController().sendRequest({soapDoc:_11c0,asyncMode:true,callback:_11bd});
}
};
ZmBatchCommand.prototype._handleResponseRun=function(_11c2,_11c3){
var _11c4=_11c3.getResponse();
if(!_11c4.BatchResponse){
return;
}
for(var _11c5 in _11c4.BatchResponse){
this._processResponse(_11c5,_11c4.BatchResponse[_11c5]);
}
if(_11c2){
_11c2.run(_11c3);
}
};
ZmBatchCommand.prototype._handleResponseRunSafari=function(_11c6,_11c7){
var resp=_11c7.getResponse();
for(var i in resp){
this._processResponse(i,resp[i]);
}
var size=this.size();
if(++this._responseCount==size&&_11c6){
_11c6.run(_11c7);
}
};
ZmBatchCommand.prototype.addRequestParams=function(_11cb,_11cc,_11cd,_11ce){
this._soapDocs[this.curId]=_11cb;
this._respCallbacks[this.curId]=_11cc;
this._errorCallbacks[this.curId]=_11cd;
this._execFrames[this.curId]=_11ce;
};
ZmBatchCommand.prototype.addNewRequestParams=function(_11cf,_11d0,_11d1,_11d2){
this.addRequestParams(_11cf,_11d0,_11d1,_11d2);
this.curId++;
};
ZmBatchCommand.prototype._processResponse=function(_11d3,_11d4){
if(!(_11d4 instanceof Array)){
_11d4=[_11d4];
}
for(var i=0;i<_11d4.length;i++){
var resp=_11d4[i];
var data={};
data[_11d3]=resp;
var id=resp.id;
if(_11d3=="Fault"){
var _11d9=this._execFrames[id];
if(this._errorCallbacks[id]){
var ex=ZmCsfeCommand.faultToEx(resp,"ZmBatchCommand.prototype.run");
var _11db=this._errorCallbacks[id].run(ex);
if(!_11db&&_11d9){
this._appCtxt.getAppController()._handleException(ex,_11d9);
}
}else{
if(_11d9){
this._appCtxt.getAppController()._handleException(ex,_11d9);
}
}
}else{
if(this._respCallbacks[id]){
var _11dc=new ZmCsfeResult(data);
this._respCallbacks[id].run(_11dc,resp);
}
}
}
};
function ZmCsfeCommand(){
}
ZmCsfeCommand._COOKIE_NAME="ZM_AUTH_TOKEN";
ZmCsfeCommand.serverUri=null;
ZmCsfeCommand._sessionId=null;
ZmCsfeCommand.getAuthToken=function(){
return AjxCookie.getCookie(document,ZmCsfeCommand._COOKIE_NAME);
};
ZmCsfeCommand.setCookieName=function(_11dd){
ZmCsfeCommand._COOKIE_NAME=_11dd;
};
ZmCsfeCommand.setServerUri=function(uri){
ZmCsfeCommand.serverUri=uri;
};
ZmCsfeCommand.setAuthToken=function(_11df,_11e0,_11e1){
if(_11e0!=null){
var exp=null;
if(_11e0>0){
exp=new Date();
var _11e3=parseInt(_11e0);
exp.setTime(exp.getTime()+_11e3);
}
AjxCookie.setCookie(document,ZmCsfeCommand._COOKIE_NAME,_11df,exp,"/");
}else{
AjxCookie.deleteCookie(document,ZmCsfeCommand._COOKIE_NAME,"/");
}
if(_11e1){
ZmCsfeCommand.setSessionId(_11e1);
}
};
ZmCsfeCommand.clearAuthToken=function(){
AjxCookie.deleteCookie(document,ZmCsfeCommand._COOKIE_NAME,"/");
};
ZmCsfeCommand.getSessionId=function(){
return ZmCsfeCommand._sessionId;
};
ZmCsfeCommand.setSessionId=function(_11e4){
var id=(_11e4 instanceof Array)?_11e4[0].id:_11e4;
ZmCsfeCommand._sessionId=parseInt(id);
};
ZmCsfeCommand.faultToEx=function(fault,_11e7){
var _11e8=AjxStringUtil.getAsString(fault.Code.Value);
var _11e9=AjxStringUtil.getAsString(fault.Detail.Error.Code);
var msg=AjxStringUtil.getAsString(fault.Reason.Text);
return new ZmCsfeException(msg,_11e9,_11e7,_11e8,fault.Detail.Error.a);
};
ZmCsfeCommand.prototype.invoke=function(_11eb){
if(!_11eb.soapDoc){
return;
}
var _11ec=_11eb.soapDoc;
var hdr=_11ec.createHeaderElement();
var _11ee=_11ec.set("context",null,hdr,"urn:zimbra");
var ua=_11ec.set("userAgent",null,_11ee);
var name=["ZimbraWebClient - ",AjxEnv.browser," (",AjxEnv.platform,")"].join("");
ua.setAttribute("name",name);
ua.setAttribute("version",ZmCsfeCommand.clientVersion);
if(_11eb.noSession){
_11ec.set("nosession",null,_11ee);
}
var _11f1=ZmCsfeCommand.getSessionId();
if(_11f1){
var si=_11ec.set("sessionId",null,_11ee);
si.setAttribute("id",_11f1);
}
if(_11eb.targetServer){
_11ec.set("targetServer",_11eb.targetServer,_11ee);
}
if(_11eb.highestNotifySeen){
var _11f3=_11ec.set("notify",null,_11ee);
_11f3.setAttribute("seq",_11eb.highestNotifySeen);
}
if(_11eb.changeToken){
var ct=_11ec.set("change",null,_11ee);
ct.setAttribute("token",_11eb.changeToken);
ct.setAttribute("type","new");
}
if(_11eb.accountId){
var acc=_11ec.set("account",_11eb.accountId,_11ee);
acc.setAttribute("by","id");
}else{
if(_11eb.accountName){
var acc=_11ec.set("account",_11eb.accountName,_11ee);
acc.setAttribute("by","name");
}
}
if(!_11eb.noAuthToken){
var _11f6=ZmCsfeCommand.getAuthToken();
if(!_11f6){
throw new ZmCsfeException("AuthToken required",ZmCsfeException.NO_AUTH_TOKEN,"ZmCsfeCommand.invoke");
}
_11ec.set("authToken",_11f6,_11ee);
}
if(!_11eb.useXml){
var js=_11ec.set("format",null,_11ee);
js.setAttribute("type","js");
}
var _11f8=_11eb.asyncMode;
var _11f9=_11ec.getMethod().nodeName;
var _11fa;
try{
var uri=_11eb.serverUri||ZmCsfeCommand.serverUri;
if(_11eb.logRequest){
uri=uri+_11ec._methodEl.nodeName;
}
var _11fc=_11ec.getXml();
if(AjxEnv.isSafari&&!AjxEnv.isSafariNightly){
_11fc=_11fc.replace("soap=","xmlns:soap=");
}
this._st=new Date();
if(_11f8){
_11fa=new AjxCallback(this,this._runCallback,_11eb.callback);
this._rpcId=AjxRpc.invoke(_11fc,uri,{"Content-Type":"application/soap+xml; charset=utf-8"},_11fa);
}else{
var _11fd=AjxRpc.invoke(_11fc,uri,{"Content-Type":"application/soap+xml; charset=utf-8"});
if(!_11eb.returnXml){
return this._getResponseData(_11fd,false);
}else{
return _11fd;
}
}
}
catch(ex){
if(!(ex&&(ex instanceof ZmCsfeException||ex instanceof AjxSoapException||ex instanceof AjxException))){
var newEx=new ZmCsfeException();
newEx.method="ZmCsfeCommand.invoke";
newEx.detail=ex?ex.toString():"undefined exception";
newEx.code=ZmCsfeException.UNKNOWN_ERROR;
newEx.msg="Unknown Error";
ex=newEx;
}
if(_11f8){
_11fa.run(new ZmCsfeResult(ex,true));
}else{
throw ex;
}
}
};
ZmCsfeCommand.prototype._getResponseData=function(_11ff,_1200){
this._en=new Date();
var _1201=new ZmCsfeResult();
var _1202=false;
var _1203=null;
if(typeof (_11ff.text)=="string"&&_11ff.text.indexOf("{")==0){
_1203=_11ff.text;
}else{
try{
_1202=true;
if(!(_11ff.text||(_11ff.xml&&(typeof _11ff.xml)=="string"))){
throw new ZmCsfeException("Csfe service error",ZmCsfeException.NETWORK_ERROR,"ZmCsfeCommand.prototype.invoke","Empty HTTP response");
}
_1203=(AjxEnv.isIE||_11ff.xml==null)?AjxSoapDoc.createFromXml(_11ff.text):AjxSoapDoc.createFromDom(_11ff.xml);
}
catch(ex){
if(_1200){
_1201.set(ex,true);
return _1201;
}else{
throw ex;
}
}
if(!_1203){
var ex=new ZmCsfeException("Csfe service error",ZmCsfeException.SOAP_ERROR,"ZmCsfeCommand.prototype.invoke","Bad XML response doc");
if(_1200){
_1201.set(ex,true);
return _1201;
}else{
throw ex;
}
}
}
var _1205="Response";
if(_1203&&_1203.match){
var m=_1203.match(/\{"?Body"?:\{"?(\w+)"?:/);
if(m&&m.length){
_1205=m[1];
}
}
var data={};
if(_1202){
data=_1203._xmlDoc.toJSObject(true,false,true);
}else{
try{
eval("data="+_1203);
}
catch(ex){
if(_1200){
_1201.set(ex,true);
return _1201;
}else{
throw ex;
}
}
}
var fault=data.Body.Fault;
if(fault){
var ex=ZmCsfeCommand.faultToEx(fault,"ZmCsfeCommand.prototype.invoke");
if(_1200){
_1201.set(ex,true,data.Header);
return _1201;
}else{
throw ex;
}
}else{
if(!_11ff.success){
var ex=new ZmCsfeException("Csfe service error",ZmCsfeException.CSFE_SVC_ERROR,"ZmCsfeCommand.prototype.invoke","HTTP response status "+_11ff.status);
if(_1200){
_1201.set(ex,true);
return _1201;
}else{
throw ex;
}
}else{
if(_1200){
_1201.set(data);
}
}
}
if(data.Header&&data.Header.context&&data.Header.context.sessionId){
ZmCsfeCommand.setSessionId(data.Header.context.sessionId);
}
return _1200?_1201:data;
};
ZmCsfeCommand.prototype._runCallback=function(_1209,_120a){
if(!_120a){
return;
}
var _120b;
if(_120a instanceof ZmCsfeResult){
_120b=_120a;
}else{
_120b=this._getResponseData(_120a,true);
}
this._en=new Date();
if(!_1209){
return;
}
if(_1209){
_1209.run(_120b);
}
};
ZmCsfeCommand.prototype.cancel=function(){
if(!this._rpcId){
return;
}
var req=AjxRpc.getRpcRequest(this._rpcId);
if(req){
req.cancel();
}
};
ZmCsfeCommand.invoke=function(_120d,_120e,_120f,_1210,_1211,_1212,_1213){
var hdr=_120d.createHeaderElement();
var _1215=_120d.set("context",null,hdr,"urn:zimbra");
if(_1212){
_120d.set("nosession",null,_1215);
}
var _1216=ZmCsfeCommand.getSessionId();
if(_1216){
var si=_120d.set("sessionId",null,_1215);
si.setAttribute("id",_1216);
}
if(_1210){
_120d.set("targetServer",_1210,_1215);
}
if(_1213){
var ct=_120d.set("change",null,_1215);
ct.setAttribute("token",_1213);
ct.setAttribute("type","new");
}
if(!_120e){
var _1219=ZmCsfeCommand.getAuthToken();
if(!_1219){
throw new ZmCsfeException("AuthToken required",ZmCsfeException.NO_AUTH_TOKEN,"ZmCsfeCommand.invoke");
}
_120d.set("authToken",_1219,_1215);
}
if(!_1211){
var js=_120d.set("format",null,_1215);
js.setAttribute("type","js");
}
var _121b=false;
try{
var uri=_120f||ZmCsfeCommand.serverUri;
var _121d=AjxEnv.isSafari&&!AjxEnv.isSafariNightly?_120d.getXml().replace("soap=","xmlns:soap="):_120d.getXml();
var _st=new Date();
var _121f=AjxRpc.invoke(_121d,uri,{"Content-Type":"application/soap+xml; charset=utf-8"});
var _en=new Date();
var _1221=null;
if(typeof (_121f.text)=="string"&&_121f.text.indexOf("{")==0){
_1221=_121f.text;
}else{
_121b=true;
_1221=(AjxEnv.isIE||_121f.xml==null)?AjxSoapDoc.createFromXml(_121f.text):AjxSoapDoc.createFromDom(_121f.xml);
}
}
catch(ex){
if(ex instanceof AjxSoapException){
throw ex;
}else{
if(ex instanceof AjxException){
throw ex;
}else{
var newEx=new ZmCsfeException();
newEx.method="ZmCsfeCommand.invoke";
newEx.detail=ex.toString();
newEx.code=ZmCsfeException.UNKNOWN_ERROR;
newEx.msg="Unknown Error";
throw newEx;
}
}
}
var resp;
if(_121b){
var body=_1221.getBody();
var fault=AjxSoapDoc.element2FaultObj(body);
if(fault){
throw new ZmCsfeException("Csfe service error",fault.errorCode,"ZmCsfeCommand.invoke",fault.reason);
}
if(_1211){
return body;
}
resp="{";
var hdr=_1221.getHeader();
if(hdr){
resp+=AjxUtil.xmlToJs(hdr)+",";
}
resp+=AjxUtil.xmlToJs(body);
resp+="}";
}else{
resp=_1221;
}
var data=new Object();
eval("data="+resp);
var fault=data.Body.Fault;
if(fault){
throw new ZmCsfeException(fault.Reason.Text,fault.Detail.Error.Code,"ZmCsfeCommand.invoke",fault.Code.Value);
}
if(data.Header&&data.Header.context&&data.Header.context.sessionId){
ZmCsfeCommand.setSessionId(data.Header.context.sessionId);
}
return data;
};
function ZmCsfeException(msg,code,_1229,_122a,data){
AjxException.call(this,msg,code,_1229,_122a);
if(data){
this.data={};
for(var i=0;i<data.length;i++){
var item=data[i];
var key=item.n;
if(!this.data[key]){
this.data[key]=[];
}
this.data[key].push(item._content);
}
}
}
ZmCsfeException.prototype=new AjxException;
ZmCsfeException.prototype.constructor=ZmCsfeException;
ZmCsfeException.prototype.toString=function(){
return "ZmCsfeException";
};
ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_INVALID="invalid";
ZmCsfeException.MAIL_SEND_ADDRESS_FAILURE_UNSENT="unsent";
ZmCsfeException._codeToMsg={};
ZmCsfeException.define=function(name,code,msg){
ZmCsfeException[name]=code;
ZmCsfeException._codeToMsg[code]=msg;
};
ZmCsfeException.getErrorMsg=function(code,args){
return args?AjxMessageFormat.format(ZmCsfeException._codeToMsg[code],args):ZmCsfeException._codeToMsg[code];
};
ZmCsfeException.prototype.getErrorMsg=function(args){
return ZmCsfeException.getErrorMsg(this.code,args);
};
ZmCsfeException.prototype.getData=function(key){
return this.data?this.data[key]:null;
};
ZmCsfeException.define("CSFE_SVC_ERROR","CSFE_SVC_ERROR",ZMsg.errorService);
ZmCsfeException.define("NETWORK_ERROR","NETWORK_ERROR",ZMsg.errorNetwork);
ZmCsfeException.define("NO_AUTH_TOKEN","NO_AUTH_TOKEN");
ZmCsfeException.define("SOAP_ERROR","SOAP_ERROR",ZMsg.errorNetwork);
ZmCsfeException.define("SVC_ALREADY_IN_PROGRESS","service.ALREADY_IN_PROGRESS");
ZmCsfeException.define("SVC_AUTH_EXPIRED","service.AUTH_EXPIRED");
ZmCsfeException.define("SVC_AUTH_REQUIRED","service.AUTH_REQUIRED");
ZmCsfeException.define("SVC_FAILURE","service.FAILURE",ZMsg.errorService);
ZmCsfeException.define("SVC_INVALID_REQUEST","service.INVALID_REQUEST");
ZmCsfeException.define("SVC_PARSE_ERROR","service.PARSE_ERROR",ZMsg.errorParse);
ZmCsfeException.define("SVC_PERM_DENIED","service.PERM_DENIED",ZMsg.errorPermission);
ZmCsfeException.define("SVC_RESOURCE_UNREACHABLE","service.RESOURCE_UNREACHABLE");
ZmCsfeException.define("SVC_UNKNOWN_DOCUMENT","service.UNKNOWN_DOCUMENT",ZMsg.errorUnknownDoc);
ZmCsfeException.define("SVC_WRONG_HOST","service.WRONG_HOST");
ZmCsfeException.define("SVC_TEMPORARILY_UNAVAILABLE","service.TEMPORARILY_UNAVAILABLE");
ZmCsfeException.define("ACCT_AUTH_FAILED","account.AUTH_FAILED");
ZmCsfeException.define("ACCT_CHANGE_PASSWORD","account.CHANGE_PASSWORD",ZMsg.errorPassChange);
ZmCsfeException.define("ACCT_EXISTS","account.ACCOUNT_EXISTS");
ZmCsfeException.define("ACCT_INVALID_PASSWORD","account.INVALID_PASSWORD",ZMsg.errorInvalidPass);
ZmCsfeException.define("ACCT_INVALID_PREF_NAME","account.INVALID_PREF_NAME",ZMsg.errorInvalidPrefName);
ZmCsfeException.define("ACCT_INVALID_PREF_VALUE","account.INVALID_PREF_VALUE",ZMsg.errorInvalidPrefValue);
ZmCsfeException.define("ACCT_MAINTENANCE_MODE","account.MAINTENANCE_MODE",ZMsg.errorMaintenanceMode);
ZmCsfeException.define("ACCT_NO_SUCH_ACCOUNT","account.NO_SUCH_ACCOUNT",ZMsg.errorNoSuchAcct);
ZmCsfeException.define("NO_SUCH_DISTRIBUTION_LIST","account.NO_SUCH_DISTRIBUTION_LIST");
ZmCsfeException.define("ACCT_NO_SUCH_SAVED_SEARCH","account.NO_SUCH_SAVED_SEARCH",ZMsg.errorNoSuchSavedSearch);
ZmCsfeException.define("ACCT_NO_SUCH_TAG","account.ACCT_NO_SUCH_TAG",ZMsg.errorNoSuchTag);
ZmCsfeException.define("ACCT_PASS_CHANGE_TOO_SOON","account.PASSWORD_CHANGE_TOO_SOON",ZMsg.errorPassChangeTooSoon);
ZmCsfeException.define("ACCT_PASS_LOCKED","account.PASSWORD_LOCKED",ZMsg.errorPassLocked);
ZmCsfeException.define("ACCT_PASS_RECENTLY_USED","account.PASSWORD_RECENTLY_USED",ZMsg.errorPassRecentlyUsed);
ZmCsfeException.define("DOMAIN_NOT_EMPTY","account.DOMAIN_NOT_EMPTY");
ZmCsfeException.define("DISTRIBUTION_LIST_EXISTS","account.DISTRIBUTION_LIST_EXISTS");
ZmCsfeException.define("IDENTITY_EXISTS","account.IDENTITY_EXISTS");
ZmCsfeException.define("TOO_MANY_IDENTITIES","account.TOO_MANY_IDENTITIES",ZMsg.errorTooManyIdentities);
ZmCsfeException.define("COS_EXISTS","account.COS_EXISTS");
ZmCsfeException.define("DOMAIN_EXISTS","account.DOMAIN_EXISTS");
ZmCsfeException.define("TOO_MANY_SEARCH_RESULTS","account.TOO_MANY_SEARCH_RESULTS");
ZmCsfeException.define("NO_SUCH_DOMAIN","account.NO_SUCH_DOMAIN");
ZmCsfeException.define("MAIL_ALREADY_EXISTS","mail.ALREADY_EXISTS",ZMsg.errorAlreadyExists);
ZmCsfeException.define("MODIFY_CONFLICT","mail.MODIFY_CONFLICT",ZMsg.errorModifyConflict);
ZmCsfeException.define("MAIL_INVALID_NAME","mail.INVALID_NAME",ZMsg.errorInvalidName);
ZmCsfeException.define("MAIL_MAINTENANCE_MODE","mail.MAINTENANCE_MODE",ZMsg.errorMaintenanceMode);
ZmCsfeException.define("MAIL_NO_SUCH_CONV","mail.NO_SUCH_CONV",ZMsg.errorNoSuchConv);
ZmCsfeException.define("MAIL_NO_SUCH_FOLDER","mail.NO_SUCH_FOLDER",ZMsg.errorNoSuchFolder);
ZmCsfeException.define("MAIL_NO_SUCH_ITEM","mail.NO_SUCH_ITEM",ZMsg.errorNoSuchItem);
ZmCsfeException.define("MAIL_NO_SUCH_MSG","mail.NO_SUCH_MSG",ZMsg.errorNoSuchMsg);
ZmCsfeException.define("MAIL_NO_SUCH_PART","mail.NO_SUCH_PART",ZMsg.errorNoSuchPart);
ZmCsfeException.define("MAIL_NO_SUCH_TAG","mail.NO_SUCH_TAG",ZMsg.errorNoSuchTag);
ZmCsfeException.define("MAIL_QUERY_PARSE_ERROR","mail.QUERY_PARSE_ERROR",ZMsg.errorQueryParse);
ZmCsfeException.define("MAIL_QUOTA_EXCEEDED","mail.QUOTA_EXCEEDED",ZMsg.errorQuotaExceeded);
ZmCsfeException.define("MAIL_SEND_ABORTED_ADDRESS_FAILURE","mail.SEND_ABORTED_ADDRESS_FAILURE",ZMsg.mailSendAddressFailure);
ZmCsfeException.define("MAIL_SEND_FAILURE","mail.SEND_FAILURE",ZMsg.mailSendFailure);
ZmCsfeException.define("MAIL_TOO_MANY_CONTACTS","mail.TOO_MANY_CONTACTS",ZMsg.errorTooManyContacts);
ZmCsfeException.define("MAIL_TOO_MANY_TERMS","mail.TOO_MANY_QUERY_TERMS_EXPANDED",ZMsg.errorTooManyTerms);
ZmCsfeException.define("MAIL_UNABLE_TO_IMPORT_CONTACTS","mail.UNABLE_TO_IMPORT_CONTACTS",ZMsg.errorUnableToImport);
ZmCsfeException.define("VOLUME_NO_SUCH_PATH","volume.NO_SUCH_PATH");
ZmCsfeException.define("LICENSE_ERROR","service.LICENSE_ERROR");
function ZmCsfeResult(data,_1237,_1238){
this.set(data,_1237,_1238);
}
ZmCsfeResult.prototype.set=function(data,_123a,_123b){
this._data=data;
this._isException=(_123a===true);
this._header=_123b;
};
ZmCsfeResult.prototype.getResponse=function(){
if(this._isException){
throw this._data;
}else{
return this._data;
}
};
ZmCsfeResult.prototype.getException=function(){
return this._isException?this._data:null;
};
ZmCsfeResult.prototype.isException=function(){
return this._isException;
};
ZmCsfeResult.prototype.getHeader=function(){
return this._header;
};
function ZmBaseSplashScreen(shell,_123d,_123e){
if(arguments.length==0){
return;
}
if(!(shell instanceof DwtShell)){
throw new AjxException("Parent must be a DwtShell",AjxException.INVALIDPARENT,"ZSplashScreen");
}
_123e=_123e||"ZSplashScreen";
DwtControl.call(this,shell,_123e,Dwt.ABSOLUTE_STYLE);
this.__createContents();
}
ZmBaseSplashScreen.prototype=new DwtControl;
ZmBaseSplashScreen.prototype.constructor=ZmBaseSplashScreen;
ZmBaseSplashScreen.prototype.getHtml=function(){
};
ZmBaseSplashScreen.prototype.setVisible=function(_123f){
if(_123f==this.getVisible()){
return;
}
if(_123f){
this.__createContents();
}
DwtControl.prototype.setVisible.call(this,_123f);
if(!_123f){
this.getHtmlElement().innerHTML="";
}
};
ZmBaseSplashScreen.prototype.__createContents=function(){
var _1240=this.getHtmlElement();
_1240.style.zIndex=Dwt.Z_SPLASH;
var _1241=document.createElement("table");
_1241.border=_1241.cellSpacing=_1241.cellPadding=0;
Dwt.setSize(_1241,"100%","100%");
var row=_1241.insertRow(0);
var cell=row.insertCell(0);
cell.vAlign="middle";
cell.align="center";
cell.innerHTML=this.getHtml();
_1240.appendChild(_1241);
_1240.style.cursor="wait";
};
function ZmErrorDialog(_1244,_1245,msgs){
if(arguments.length===0){
return;
}
this._appCtxt=_1245;
this._strNav=this._getNavigatorInfo();
this._subjPfx=this._getSubjectPrefix();
var _1247=new DwtDialog_ButtonDescriptor(ZmErrorDialog.REPORT_BUTTON,msgs.report,DwtDialog.ALIGN_LEFT);
var _1248=new DwtDialog_ButtonDescriptor(ZmErrorDialog.DETAIL_BUTTON,null,DwtDialog.ALIGN_LEFT);
DwtMessageDialog.call(this,_1244,null,null,[_1247,_1248]);
this._detailCell=document.getElementById(this._detailCellId);
var _1249=this._button[ZmErrorDialog.DETAIL_BUTTON];
_1249.setImage("SelectPullDownArrow");
Dwt.setSize(_1249.getHtmlElement(),22,(AjxEnv.isIE?21:19));
_1249.getHtmlElement().style.overflow="hidden";
var _124a=this._button[ZmErrorDialog.REPORT_BUTTON];
_124a.getHtmlElement().style.width="100px";
this.registerCallback(ZmErrorDialog.REPORT_BUTTON,this._reportCallback,this);
this.registerCallback(ZmErrorDialog.DETAIL_BUTTON,this._showDetail,this);
}
ZmErrorDialog.prototype=new DwtMessageDialog;
ZmErrorDialog.prototype.constructor=ZmErrorDialog;
ZmErrorDialog.REPORT_BUTTON=++DwtDialog.LAST_BUTTON;
ZmErrorDialog.DETAIL_BUTTON=++DwtDialog.LAST_BUTTON;
ZmErrorDialog.REPORT_URL="//www.zimbra.com/e/";
ZmErrorDialog.prototype.toString=function(){
return "ZmErrorDialog";
};
ZmErrorDialog.prototype.reset=function(){
this.setDetailString();
DwtMessageDialog.prototype.reset.call(this);
};
ZmErrorDialog.prototype.setMessage=function(_124b,_124c,style,title){
DwtMessageDialog.prototype.setMessage.call(this,_124b,style,title);
this.setDetailString(_124c);
};
ZmErrorDialog.prototype.setDetailString=function(text){
if(!(this._buttonElementId[ZmErrorDialog.DETAIL_BUTTON])){
return;
}
this._detailStr=text;
if(text){
this._button[ZmErrorDialog.DETAIL_BUTTON].setVisible(true);
if(this._detailCell&&this._detailCell.innerHTML!==""){
this._detailCell.innerHTML=this._getDetailHtml();
}
}else{
this._button[ZmErrorDialog.DETAIL_BUTTON].setVisible(false);
if(this._detailCell){
this._detailCell.innerHTML="";
}
}
};
ZmErrorDialog.prototype.popdown=function(){
DwtMessageDialog.prototype.popdown.call(this);
this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,true);
};
ZmErrorDialog.prototype._getContentHtml=function(){
this._detailCellId=Dwt.getNextId();
var html=[];
var idx=0;
html[idx++]=DwtMessageDialog.prototype._getContentHtml.call(this);
html[idx++]="<div id='";
html[idx++]=this._detailCellId;
html[idx++]="'></div>";
return html.join("");
};
ZmErrorDialog.prototype._getDetailHtml=function(){
return ["<div class='vSpace'></div><table cellspacing=0 cellpadding=0 width='100%'>","<tr><td><textarea readonly rows='10'>",this._detailStr,"</textarea></td></tr></table>"].join("");
};
ZmErrorDialog.prototype._getNavigatorInfo=function(){
var _1252=[];
var idx=0;
_1252[idx++]="\n\n";
_1252[idx++]="href: ";
_1252[idx++]=location.href;
_1252[idx++]="\n";
for(var i in navigator){
if(typeof navigator[i]=="function"){
continue;
}
if(typeof navigator[i]=="unknown"){
continue;
}
_1252[idx++]=i+": "+navigator[i]+"\n";
}
return _1252.join("");
};
ZmErrorDialog.prototype._getSubjectPrefix=function(){
var _1255=[];
var idx=0;
_1255[idx++]="ER: ";
if(AjxEnv.isIE){
_1255[idx++]="IE ";
}else{
if(AjxEnv.isFirefox){
_1255[idx++]="FF ";
}else{
if(AjxEnv.isMozilla){
_1255[idx++]="MOZ ";
}else{
if(AjxEnv.isSafari){
_1255[idx++]="SAF ";
}else{
if(AjxEnv.isOpera){
_1255[idx++]="OPE ";
}else{
_1255[idx++]="UKN ";
}
}
}
}
}
if(AjxEnv.isWindows){
_1255[idx++]="WIN ";
}else{
if(AjxEnv.isLinux){
_1255[idx++]="LNX ";
}else{
if(AjxEnv.isMac){
_1255[idx++]="MAC ";
}else{
_1255[idx++]="UNK ";
}
}
}
_1255[idx++]=this._appCtxt.get(ZmSetting.CLIENT_VERSION)+" ";
return _1255.join("");
};
ZmErrorDialog.prototype._getUserPrefs=function(){
var _1257=this._appCtxt.getCurrentSearch();
var _1258=[];
var idx=0;
_1258[idx++]="\n\n";
_1258[idx++]="username: ";
_1258[idx++]=this._appCtxt.get(ZmSetting.USERNAME);
_1258[idx++]="\n";
if(_1257){
_1258[idx++]="currentSearch: ";
_1258[idx++]=_1257.query;
_1258[idx++]="\n";
}
for(var i in ZmSetting.INIT){
if(ZmSetting.INIT[i][0]){
_1258[idx++]=ZmSetting.INIT[i][0];
_1258[idx++]=": ";
_1258[idx++]=(""+ZmSetting.INIT[i][3]);
_1258[idx++]="\n";
}
}
return _1258.join("");
};
ZmErrorDialog.prototype._reportCallback=function(){
if(!this._iframe||AjxEnv.isIE){
this._iframe=document.createElement("iframe");
this._iframe.style.width=this._iframe.style.height=0;
this._iframe.style.visibility="hidden";
var _125b=this._getContentDiv();
_125b.appendChild(this._iframe);
}
var _125c=this._getUserPrefs();
var _125d=Dwt.getNextId();
var html=[];
var idx=0;
var _1260=this._subjPfx+this._detailStr.substring(0,40);
var _1261=(location.protocol=="https:")?"https:":"http:";
html[idx++]="<html><head></head><body><form id='";
html[idx++]=_125d;
html[idx++]="' method='POST' action='";
html[idx++]=_1261;
html[idx++]=ZmErrorDialog.REPORT_URL;
html[idx++]="'>";
html[idx++]="<textarea name='details'>";
html[idx++]=this._detailStr;
html[idx++]="version - ";
html[idx++]=this._appCtxt.get(ZmSetting.CLIENT_VERSION);
html[idx++]="\n";
html[idx++]="release - ";
html[idx++]=this._appCtxt.get(ZmSetting.CLIENT_RELEASE);
html[idx++]="\n";
html[idx++]="date - ";
html[idx++]=this._appCtxt.get(ZmSetting.CLIENT_DATETIME);
html[idx++]="</textarea>";
html[idx++]="<textarea name='navigator'>";
html[idx++]=this._strNav;
html[idx++]="</textarea>";
html[idx++]="<textarea name='prefs'>";
html[idx++]=_125c;
html[idx++]="</textarea>";
html[idx++]="<textarea name='subject'>";
html[idx++]=_1260;
html[idx++]="</textarea>";
html[idx++]="</form></body></html>";
var idoc=Dwt.getIframeDoc(this._iframe);
idoc.open();
idoc.write(html.join(""));
idoc.close();
var form=idoc.getElementById(_125d);
if(form){
form.submit();
}
this.popdown();
};
ZmErrorDialog.prototype._showDetail=function(){
if(this._detailCell){
if(this._detailCell.innerHTML===""){
this._button[ZmErrorDialog.DETAIL_BUTTON].setImage("SelectPullUpArrow");
this._detailCell.innerHTML=this._getDetailHtml();
}else{
this._button[ZmErrorDialog.DETAIL_BUTTON].setImage("SelectPullDownArrow");
this._detailCell.innerHTML="";
}
}
};
ZLoginFactory=function(){
};
ZLoginFactory.USER_ID="ZLoginUserName";
ZLoginFactory.PASSWORD_ID="ZLoginPassword";
ZLoginFactory.REMEMBER_ME_ID="rememberMe";
ZLoginFactory.REMEMBER_ME_CONTAINER_ID="ZLoginRememberMeContainer";
ZLoginFactory.NEW_PASSWORD_ID="newpass1";
ZLoginFactory.NEW_PASSWORD_TR_ID="ZLoginNewPassword1Tr";
ZLoginFactory.PASSWORD_CONFIRM_TR_ID="ZLoginNewPassword2Tr";
ZLoginFactory.PASSWORD_CONFIRM_ID="newpass2";
ZLoginFactory.LOGIN_BUTTON_ID="ZLoginButton";
ZLoginFactory.HIDDEN_BUTTON_ID="ZLoginHiddenButton";
ZLoginFactory.TEXT_TYPE=0;
ZLoginFactory.CHECKBOX_TYPE=1;
ZLoginFactory.BUTTON_TYPE=2;
ZLoginFactory.TAB_ORDER=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_ID,ZLoginFactory.PASSWORD_CONFIRM_ID,ZLoginFactory.REMEMBER_ME_ID,ZLoginFactory.LOGIN_BUTTON_ID];
ZLoginFactory.VISIBILITY=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_TR_ID,ZLoginFactory.PASSWORD_CONFIRM_TR_ID,ZLoginFactory.REMEMBER_ME_CONTAINER_ID,ZLoginFactory.LOGIN_BUTTON_ID];
ZLoginFactory.TAB_TYPE=[ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.CHECKBOX_TYPE,ZLoginFactory.BUTTON_TYPE];
ZLoginFactory.copyDefaultParams=function(msgs){
return {showPanelBorder:true,companyURL:msgs["splashScreenCompanyURL"]||"",shortVersion:"",longVersion:"",appName:msgs["splashScreenAppName"]||"",productName:"",showError:false,errorMsg:"",showAbout:false,aboutMsg:"",showLoading:false,loadingMsg:msgs["splashScreenLoading"]||"",showForm:false,showUserField:false,userNameMsg:msgs["username"]?msgs["username"]+":":"",showPasswordField:false,passwordMsg:msgs["password"]?msgs["password"]+":":"",showNewPasswordFields:false,newPassword1Msg:msgs["newPassword"]+":"||"",newPassword2Msg:msgs["confirm"]+":"||"",showLicenseMsg:false,licenseMsg:"",showRememberMeCheckbox:false,rememberMeMsg:msgs["rememberMe"]||"",showLogOff:false,logOffMsg:msgs["loginAsDiff"]||"",logOffAction:"",showButton:false,loginAction:"ZmLogin.handleLogin();",buttonName:msgs["login"]||"",copyrightText:msgs["splashScreenCopyright"]||""};
};
ZLoginFactory.getLoginPanel=function(){
var _1265=this.get("ZLoginPanel");
if(!_1265){
_1265=this.get("ZLoginPanelInvisible");
}
return _1265;
};
ZLoginFactory.showErrorMsg=function(msg){
this.setHTML("ZLoginErrorMsg",msg);
this.show("ZLoginErrorPanel");
this._flickerErrorMessagePanel();
};
ZLoginFactory.hideErrorMsg=function(){
this.hide("ZLoginErrorPanel");
};
ZLoginFactory.getErrorMsgPanel=function(){
return this.get("ZLoginErrorPanel");
};
ZLoginFactory.showAboutMsg=function(msg){
this.setHTML("ZLoginAboutPanel",msg);
this.show("ZLoginAboutPanel");
};
ZLoginFactory.hideAboutMsg=function(){
this.hide("ZLoginAboutPanel");
};
ZLoginFactory.getAboutMsg=function(){
return this.get("ZLoginAboutPanel");
};
ZLoginFactory.showLoadingMsg=function(msg){
this.setHTML("ZLoginLoadingMsg",msg);
this.show("ZLoginAboutPanel");
};
ZLoginFactory.hideLoadingMsg=function(){
this.hide("ZLoginAboutPanel");
};
ZLoginFactory.getLoadingMsg=function(){
return this.get("ZLoginAboutPanel");
};
ZLoginFactory.showForm=function(){
this.show("ZLoginFormPanel");
};
ZLoginFactory.hideForm=function(){
this.hide("ZLoginFormPanel");
};
ZLoginFactory.getForm=function(){
return this.get("ZLoginFormPanel");
};
ZLoginFactory.showUserField=function(name){
this.setValue(ZLoginFactory.USER_ID,name);
this.show(ZLoginFactory.USER_ID);
};
ZLoginFactory.hideUserField=function(){
this.hide(ZLoginFactory.USER_ID);
};
ZLoginFactory.getUserField=function(){
return this.get(ZLoginFactory.USER_ID);
};
ZLoginFactory.showPasswordField=function(msg){
this.show(ZLoginFactory.PASSWORD_ID);
};
ZLoginFactory.hidePasswordField=function(){
this.hide(ZLoginFactory.PASSWORD_ID);
};
ZLoginFactory.getPasswordField=function(){
return this.get(ZLoginFactory.PASSWORD_ID);
};
ZLoginFactory.showNewPasswordFields=function(){
this.show(ZLoginFactory.NEW_PASSWORD_TR_ID);
this.show(ZLoginFactory.PASSWORD_CONFIRM_TR_ID);
};
ZLoginFactory.hideNewPasswordFields=function(){
this.hide(ZLoginFactory.NEW_PASSWORD_TR_ID);
this.hide(ZLoginFactory.PASSWORD_CONFIRM_TR_ID);
};
ZLoginFactory.areNewPasswordFieldsShown=function(){
return this.isShown(ZLoginFactory.NEW_PASSWORD_TR_ID);
};
ZLoginFactory.getNewPasswordField=function(){
return this.get(ZLoginFactory.NEW_PASSWORD_ID);
};
ZLoginFactory.getPasswordConfirmField=function(){
return this.get(ZLoginFactory.PASSWORD_CONFIRM_ID);
};
ZLoginFactory.showRememberMeCheckbox=function(){
this.show(ZLoginFactory.REMEMBER_ME_CONTAINER_ID);
};
ZLoginFactory.hideRememberMeCheckbox=function(){
this.hide(ZLoginFactory.REMEMBER_ME_CONTAINER_ID);
};
ZLoginFactory.showLogOff=function(){
this.show("ZLoginLogOffContainer");
};
ZLoginFactory.hideLogOff=function(){
this.hide("ZLoginLogOffContainer");
};
ZLoginFactory.setLoginButtonName=function(name){
this.setHTML("ZLoginButtonText",name);
};
ZLoginFactory.setLoginButtonAction=function(_126c){
var el=document.getElementById(ZLoginFactory.LOGIN_BUTTON_ID);
if(el){
el.onclick=_126c;
}
};
ZLoginFactory.getLoginButton=function(){
return this.get(ZLoginFactory.LOGIN_BUTTON_ID);
};
ZLoginFactory.getLoginDialogHTML=function(_126e){
var html=["<div ",(_126e.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(\"",_126e.companyURL,"\", \"_blank\")'></div></td>","<td valign=top id='ZLoginShortVersion'>",_126e.shortVersion,"</td>","</tr></table>","<div id='ZLoginAppName'>",_126e.appName,"</div>","<div id='ZLoginProductName'>",_126e.productName,"</div>","<div id='ZLoginLongVersion'>",_126e.longVersion,"</div>","</div>","</td>","</tr>","</table>","</center></td>","</tr>","<tr><td id='ZLoginBodyContainer'>","<div id='ZLoginErrorPanel' ",(_126e.showError?"":"style='display:none'"),">","<table>","<tr><td valign='top' width='40'><img id='errorIcon' src='/zimbra/img/loRes/dwt/Critical_32.gif' width=32 height=32></td>","<td width='*' id='ZLoginErrorMsg' class='errorText'>",_126e.errorMsg,"</td>","</tr>","</table>","</div>","","<div id='ZLoginAboutPanel' ",(_126e.showAbout?"":"style='display:none'"),">",_126e.aboutMsg,"</div>","<div id='ZLoginLoadingPanel' ",(_126e.showLoading?"":"style='display:none'"),">","<table><tr><td></td><td id='ZLoginLoadingMsg'>",_126e.loadingMsg,"</td></tr></table>","</div>","<div id='ZLoginFormPanel' ",(_126e.showForm?"":"style='display:none'"),">","<table class='zLoginTable' width='100%' cellpadding=4>","<tr id='ZLoginUserTr'",(_126e.showUserField?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",_126e.userNameMsg,"</td>","<td class='zLoginFieldContainer' colspan=2>",Dwt.CARET_HACK_BEGIN,"<input id='",ZLoginFactory.USER_ID,"' class='zLoginField' autocomplete=OFF type=text tabIndex=1>",Dwt.CARET_HACK_END,"</td>","</tr>","<tr id='ZLoginPasswordTr' ",(_126e.showPasswordField?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",_126e.passwordMsg,"</td>","<td class='zLoginFieldContainer' colspan=2>",Dwt.CARET_HACK_BEGIN,"<input id='",ZLoginFactory.PASSWORD_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>",Dwt.CARET_HACK_END,"</td>","</tr>","<tr id='",ZLoginFactory.NEW_PASSWORD_TR_ID,"' ",(_126e.showNewPasswordFields?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",_126e.newPassword1Msg,"</td>","<td class='zLoginFieldContainer' colspan=2>",Dwt.CARET_HACK_BEGIN,"<input id='",ZLoginFactory.NEW_PASSWORD_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>",Dwt.CARET_HACK_END,"</td>","</tr>","<tr id='",ZLoginFactory.PASSWORD_CONFIRM_TR_ID,"' ",(_126e.showNewPasswordFields?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",_126e.newPassword2Msg,"</td>","<td class='zLoginFieldContainer' colspan=2>",Dwt.CARET_HACK_BEGIN,"<input id='",ZLoginFactory.PASSWORD_CONFIRM_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>",Dwt.CARET_HACK_END,"</td>","</tr>","<tr id='ZLoginLicenseMsgContainer' ",(_126e.showLicenseMsg?"":"style='display:none'"),">","<td colspan=3 id='ZLoginLicenseMsg'>",_126e.licenseMsg,"</td>","</tr>","<tr><td class='zLoginLabelContainer'>&nbsp;</td>","<td class='zLoginFieldContainer' id='",ZLoginFactory.REMEMBER_ME_CONTAINER_ID,"' ",(_126e.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'>",_126e.rememberMeMsg,"</td>","</tr>","</table>","</td>","<td class='zLoginFieldContainer' id='ZLoginLogOffContainer' ",(_126e.showLogOff?"":"style='display:none'"),">","<a href='' onclick='javascript:"+_126e.logOffAction+";'>"+_126e.logOffMsg+"</a>","</td>","<td class='zLoginButtonContainer' align='right'",(_126e.showButton?"":"style='display:none'"),">","<div id='",ZLoginFactory.LOGIN_BUTTON_ID,"' class='DwtButton'","onclick='",_126e.loginAction,";return false'","onmouseover='javascript:this.className=\"DwtButton-activated\"'","onmouseout='javascript:this.className=\"DwtButton\"'","onmousedown='javascript:this.className=\"DwtButton-triggered\";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'>",_126e.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'>",_126e.clientLevelNotice,"</td>","</tr>","<tr><td id='ZLoginLicenseContainer'>",_126e.copyrightText,"</td>","</tr>","</table>","</td>","</tr>","</table>","</div>"].join("");
return html;
};
ZLoginFactory.setHTML=function(id,_1271){
var el=document.getElementById(id);
if(el&&_1271!=null){
el.innerHTML=_1271;
}
};
ZLoginFactory.setValue=function(id,_1274){
var el=document.getElementById(id);
if(el&&_1274!=null){
el.value=_1274;
}
};
ZLoginFactory.show=function(id,_1277){
var el=document.getElementById(id);
if(el){
el.style.display="";
}
};
ZLoginFactory.isShown=function(id){
var el=document.getElementById(id);
return el?(el.style.display!="none"):false;
};
ZLoginFactory.hide=function(id){
var el=document.getElementById(id);
if(el){
el.style.display="none";
}
};
ZLoginFactory.get=function(id){
return document.getElementById(id);
};
ZLoginFactory.handleKeyPress=function(ev){
ev=ev||window.event;
if(ev==null){
return true;
}
var _127f=ev.target?ev.target:ev.srcElement;
if(!_127f){
return true;
}
var _1280=ev.keyCode;
var _1281=false;
if(_1280==13){
if(_127f.id==ZLoginFactory.USER_ID||_127f.id=="newpass1"){
_1281=true;
}else{
var _1282=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID).onclick;
if(_1282){
_1282.call(_127f);
}
ZLoginFactory._cancelEvent(ev);
return false;
}
}
if(_1281||(_1280==9)){
var _1283=ZLoginFactory.TAB_ORDER.length-1;
for(var i=0;i<ZLoginFactory.TAB_ORDER.length;i++){
if(ZLoginFactory.TAB_ORDER[i]==_127f.id){
_1283=i;
break;
}
}
var _1285=!ev.shiftKey;
var _1286=ZLoginFactory._getTabToIndex(_1283,_1285);
var _1287=ZLoginFactory.TAB_ORDER[_1286];
var _1288=ZLoginFactory.TAB_TYPE[_1286];
ZLoginFactory._onFocusChange(_1288,_1287,_127f);
ZLoginFactory._cancelEvent(ev);
}
};
ZLoginFactory._cancelEvent=function(ev){
if(ev.stopPropagation){
ev.stopPropagation();
}
if(ev.preventDefault){
ev.preventDefault();
}
ev.cancelBubble=true;
ev.returnValue=false;
};
ZLoginFactory._onFocusChange=function(type,id,_128c){
if((type!=ZLoginFactory.BUTTON_TYPE)&&!AjxEnv.isIE){
ZLoginFactory._loginButtonBlur();
}
if(type==ZLoginFactory.TEXT_TYPE){
var edit=ZLoginFactory.get(id);
edit.focus();
edit.select();
}else{
if(type==ZLoginFactory.CHECKBOX_TYPE){
var _128e=ZLoginFactory.get(id);
_128e.focus();
}else{
var _128f=ZLoginFactory.get(id);
if(AjxEnv.isIE){
_128f.focus();
}else{
ZLoginFactory._loginButtonFocus(_128f);
_128c.blur();
document.getElementById(ZLoginFactory.HIDDEN_BUTTON_ID).focus();
}
}
}
};
ZLoginFactory._getTabToIndex=function(_1290,_1291){
var _1292=_1290;
do{
var _1293;
if(_1291){
_1292=(_1292==(ZLoginFactory.TAB_ORDER.length-1))?0:_1292+1;
}else{
_1292=(_1292==0)?(ZLoginFactory.TAB_ORDER.length-1):_1292-1;
}
var id=ZLoginFactory.TAB_ORDER[_1292];
var _1295=ZLoginFactory.VISIBILITY[_1292];
var _1296=ZLoginFactory.get(id);
if(ZLoginFactory.isShown(_1295)&&!ZLoginFactory.get(id).disabled){
return _1292;
}
}while(_1292!=_1290);
return 0;
};
ZLoginFactory._loginButtonFocus=function(_1297){
_1297.className="DwtButton-focused";
};
ZLoginFactory._loginButtonBlur=function(_1298){
var _1298=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID);
_1298.className="DwtButton";
};
ZLoginFactory._flickerErrorMessagePanel=function(){
ZLoginFactory.getErrorMsgPanel().style.visibility="hidden";
window.setTimeout(ZLoginFactory._showErrorMessagePanel,8);
};
ZLoginFactory._showErrorMessagePanel=function(){
ZLoginFactory.getErrorMsgPanel().style.visibility="visible";
};
function ZmEvent(type){
this.type=type;
this.event=null;
this.source=null;
this._details={};
}
ZmEvent.L_MODIFY=1;
ZmEvent.L_PICKER=2;
var i=1;
ZmEvent.S_FOLDER=i++;
ZmEvent.S_TAG=i++;
ZmEvent.S_CONV=i++;
ZmEvent.S_MSG=i++;
ZmEvent.S_ATT=i++;
ZmEvent.S_CONTACT=i++;
ZmEvent.S_GROUP=i++;
ZmEvent.S_APPT=i++;
ZmEvent.S_NOTE=i++;
ZmEvent.S_PAGE=i++;
ZmEvent.S_DOCUMENT=i++;
ZmEvent.S_NOTEBOOK=i++;
ZmEvent.S_PICKER=i++;
ZmEvent.S_SEARCH=i++;
ZmEvent.S_SETTING=i++;
ZmEvent.S_ZIMLET=i++;
ZmEvent.S_FILTER=i++;
ZmEvent.S_CHAT=i++;
ZmEvent.S_ROSTER=i++;
ZmEvent.S_ROSTER_ITEM=i++;
ZmEvent.S_ROSTER_TREE_ITEM=i++;
ZmEvent.S_ROSTER_TREE_GROUP=i++;
ZmEvent.S_RESOURCE=i++;
ZmEvent.S_MOUNTPOINT=i++;
ZmEvent.S_DATA_SOURCE=i++;
ZmEvent.S_IDENTITY=i++;
ZmEvent.S_ACCOUNT=i++;
ZmEvent.S_COS=i++;
ZmEvent.S_DOMAIN=i++;
ZmEvent.S_SERVER=i++;
ZmEvent.S_GLOBALCONFIG=i++;
ZmEvent.S_STATUS=i++;
ZmEvent.S_MAX=i-1;
i=1;
ZmEvent.E_CREATE=i++;
ZmEvent.E_DELETE=i++;
ZmEvent.E_MODIFY=i++;
ZmEvent.E_LOAD=i++;
ZmEvent.E_REMOVE=i++;
ZmEvent.E_REMOVE_ALL=i++;
ZmEvent.E_MOVE=i++;
ZmEvent.E_FLAGS=i++;
ZmEvent.E_TAGS=i++;
ZmEvent.E_CALENDARS=i++;
ZmEvent.E_ZIMLETS=i++;
ZmEvent.prototype.toString=function(){
return "ZmEvent";
};
ZmEvent.prototype.set=function(event,_129b){
this.event=event;
this.source=_129b;
};
ZmEvent.prototype.setDetail=function(field,value){
this._details[field]=value;
};
ZmEvent.prototype.getDetail=function(field){
return this._details[field];
};
ZmEvent.prototype.getItems=function(){
var items=this._details["items"];
return items?items:[];
};
ZmEvent.prototype.setDetails=function(_12a0){
this._details=_12a0?_12a0:{};
};
ZmEvent.prototype.getDetails=function(){
return this._details;
};
function ZmModel(type){
if(arguments.length==0){
return;
}
this._evt=new ZmEvent(type);
this._evtMgr=new AjxEventMgr();
}
ZmModel.prototype.toString=function(){
return "ZmModel";
};
ZmModel.prototype.addChangeListener=function(_12a2){
return this._evtMgr.addListener(ZmEvent.L_MODIFY,_12a2);
};
ZmModel.prototype.removeChangeListener=function(_12a3){
return this._evtMgr.removeListener(ZmEvent.L_MODIFY,_12a3);
};
ZmModel.prototype.removeAllChangeListeners=function(){
return this._evtMgr.removeAll(ZmEvent.L_MODIFY);
};
ZmModel.prototype._notify=function(event,_12a5){
if(this._evtMgr.isListenerRegistered(ZmEvent.L_MODIFY)){
this._evt.set(event,this);
this._evt.setDetails(_12a5);
this._evtMgr.notifyListeners(ZmEvent.L_MODIFY,this._evt);
}
};
function ZmSetting(id,name,type,_12a9,_12aa,_12ab){
if(arguments.length==0){
return;
}
ZmModel.call(this,ZmEvent.S_SETTING);
this.id=id;
this.name=name;
this.type=type;
this.dataType=_12a9?_12a9:ZmSetting.D_STRING;
this.defaultValue=_12aa;
this.settings=_12ab;
if(this.dataType==ZmSetting.D_HASH){
this.value={};
this.defaultValue={};
}else{
if(this.dataType==ZmSetting.D_LIST){
this.value=[];
this.defaultValue=[];
}else{
this.value=null;
}
}
}
ZmSetting.prototype=new ZmModel;
ZmSetting.prototype.constructor=ZmSetting;
ZmSetting.CAL_DAY="day";
ZmSetting.CAL_MONTH="month";
ZmSetting.CAL_WEEK="week";
ZmSetting.CAL_WORK_WEEK="workWeek";
ZmSetting.CAL_SCHEDULE="schedule";
ZmSetting.COMPOSE_FONT_COLOR="#000000";
ZmSetting.COMPOSE_FONT_FAM="Times New Roman";
ZmSetting.COMPOSE_FONT_SIZE="12pt";
ZmSetting.COMPOSE_TEXT="text";
ZmSetting.COMPOSE_HTML="html";
ZmSetting.CV_CARDS="cards";
ZmSetting.CV_LIST="list";
ZmSetting.DEDUPE_NONE="dedupeNone";
ZmSetting.DEDUPE_SECOND="secondCopyifOnToOrCC";
ZmSetting.DEDUPE_INBOX="moveSentMessageToInbox";
ZmSetting.DEDUPE_ALL="dedupeAll";
ZmSetting.GROUP_BY_CONV="conversation";
ZmSetting.GROUP_BY_MESSAGE="message";
ZmSetting.INCLUDE_NONE="includeNone";
ZmSetting.INCLUDE="includeBody";
ZmSetting.INCLUDE_PREFIX="includeBodyWithPrefix";
ZmSetting.INCLUDE_ATTACH="includeAsAttachment";
ZmSetting.INCLUDE_SMART="includeSmart";
ZmSetting.LICENSE_BAD="bad";
ZmSetting.LICENSE_GOOD="good";
ZmSetting.LICENSE_GRACE="inGracePeriod";
ZmSetting.SIG_INTERNET="internet";
ZmSetting.SIG_OUTLOOK="outlook";
var i=1;
ZmSetting.AC_TIMER_INTERVAL=i++;
ZmSetting.ASYNC_MODE=i++;
ZmSetting.BRANCH=i++;
ZmSetting.CLIENT_DATETIME=i++;
ZmSetting.CLIENT_RELEASE=i++;
ZmSetting.CLIENT_VERSION=i++;
ZmSetting.CONFIG_PATH=i++;
ZmSetting.CSFE_MSG_FETCHER_URI=i++;
ZmSetting.CSFE_SERVER_URI=i++;
ZmSetting.CSFE_UPLOAD_URI=i++;
ZmSetting.CSFE_EXPORT_URI=i++;
ZmSetting.FORCE_CAL_OFF=i++;
ZmSetting.HELP_URI=i++;
ZmSetting.LOGO_URI=i++;
ZmSetting.LOG_REQUEST=i++;
ZmSetting.TIMEOUT=i++;
ZmSetting.USE_XML=i++;
ZmSetting.SKIN_APP_BOTTOM_TOOLBAR_ID=i++;
ZmSetting.SKIN_APP_CHOOSER_ID=i++;
ZmSetting.SKIN_APP_MAIN_ID=i++;
ZmSetting.SKIN_APP_TOP_TOOLBAR_ID=i++;
ZmSetting.SKIN_CURRENT_APP_ID=i++;
ZmSetting.SKIN_LOGO_ID=i++;
ZmSetting.SKIN_SASH_ID=i++;
ZmSetting.SKIN_SEARCH_BUILDER_ID=i++;
ZmSetting.SKIN_SEARCH_BUILDER_TOOLBAR_ID=i++;
ZmSetting.SKIN_SEARCH_BUILDER_TR_ID=i++;
ZmSetting.SKIN_SEARCH_ID=i++;
ZmSetting.SKIN_SHELL_ID=i++;
ZmSetting.SKIN_STATUS_ID=i++;
ZmSetting.SKIN_TREE_ID=i++;
ZmSetting.SKIN_TREE_FOOTER_ID=i++;
ZmSetting.SKIN_USER_INFO_ID=i++;
ZmSetting.SKIN_QUOTA_INFO_ID=i++;
ZmSetting.ALLOW_ANY_FROM_ADDRESS=i++;
ZmSetting.ALLOW_FROM_ADDRESSES=i++;
ZmSetting.AVAILABLE_SKINS=i++;
ZmSetting.BROWSE_ENABLED=i++;
ZmSetting.CALENDAR_ENABLED=i++;
ZmSetting.CHANGE_PASSWORD_ENABLED=i++;
ZmSetting.CONTACTS_ENABLED=i++;
ZmSetting.CONVERSATIONS_ENABLED=i++;
ZmSetting.DISPLAY_NAME=i++;
ZmSetting.FILTERS_ENABLED=i++;
ZmSetting.GAL_AUTOCOMPLETE_ENABLED=i++;
ZmSetting.GAL_ENABLED=i++;
ZmSetting.HTML_COMPOSE_ENABLED=i++;
ZmSetting.IDENTITIES_ENABLED=i++;
ZmSetting.IDLE_SESSION_TIMEOUT=i++;
ZmSetting.IM_ENABLED=i++;
ZmSetting.INITIAL_SEARCH_ENABLED=i++;
ZmSetting.MAIL_ALIASES=i++;
ZmSetting.MAIL_ENABLED=i++;
ZmSetting.MAX_CONTACTS=i++;
ZmSetting.MIN_POLLING_INTERVAL=i++;
ZmSetting.NOTEBOOK_ENABLED=i++;
ZmSetting.NOTIF_FEATURE_ENABLED=i++;
ZmSetting.OPTIONS_ENABLED=i++;
ZmSetting.POP_ACCOUNTS_ENABLED=i++;
ZmSetting.PWD_MAX_LENGTH=i++;
ZmSetting.PWD_MIN_LENGTH=i++;
ZmSetting.QUOTA=i++;
ZmSetting.SAVED_SEARCHES_ENABLED=i++;
ZmSetting.SHARING_ENABLED=i++;
ZmSetting.SKIN_CHANGE_ENABLED=i++;
ZmSetting.TAGGING_ENABLED=i++;
ZmSetting.VACATION_MSG_FEATURE_ENABLED=i++;
ZmSetting.VIEW_ATTACHMENT_AS_HTML=i++;
ZmSetting.LICENSE_STATUS=i++;
ZmSetting.QUOTA_USED=i++;
ZmSetting.TOKEN_LIFETIME=i++;
ZmSetting.USERID=i++;
ZmSetting.USERNAME=i++;
ZmSetting.ATT_VIEW_ENABLED=i++;
ZmSetting.EVAL_ENABLED=i++;
ZmSetting.FEED_ENABLED=i++;
ZmSetting.HELP_ENABLED=i++;
ZmSetting.MAIL_FORWARDING_ENABLED=i++;
ZmSetting.MIXED_VIEW_ENABLED=i++;
ZmSetting.NOTES_ENABLED=i++;
ZmSetting.PREFS_ENABLED=i++;
ZmSetting.PRINT_ENABLED=i++;
ZmSetting.REPLY_MENU_ENABLED=i++;
ZmSetting.FORWARD_MENU_ENABLED=i++;
ZmSetting.SAVE_DRAFT_ENABLED=i++;
ZmSetting.SEARCH_ENABLED=i++;
ZmSetting.SKI_HACK_ENABLED=i++;
ZmSetting.SPAM_ENABLED=i++;
ZmSetting.USER_FOLDERS_ENABLED=i++;
ZmSetting.AUTO_ADD_ADDRESS=i++;
ZmSetting.CONTACTS_PER_PAGE=i++;
ZmSetting.CONTACTS_VIEW=i++;
ZmSetting.EXPORT=i++;
ZmSetting.GAL_AUTOCOMPLETE=i++;
ZmSetting.GAL_AUTOCOMPLETE_SESSION=i++;
ZmSetting.IMPORT=i++;
ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL=i++;
ZmSetting.CAL_FIRST_DAY_OF_WEEK=i++;
ZmSetting.CAL_REMINDER_WARNING_TIME=i++;
ZmSetting.CAL_SHOW_TIMEZONE=i++;
ZmSetting.CAL_USE_QUICK_ADD=i++;
ZmSetting.CALENDAR_INITIAL_VIEW=i++;
ZmSetting.DEFAULT_CALENDAR_TIMEZONE=i++;
ZmSetting.PASSWORD=i++;
ZmSetting.SEARCH_INCLUDES_SPAM=i++;
ZmSetting.SEARCH_INCLUDES_TRASH=i++;
ZmSetting.SHOW_SEARCH_STRING=i++;
ZmSetting.SKIN_NAME=i++;
ZmSetting.SORTING_PREF=i++;
ZmSetting.COMPOSE_AS_FORMAT=i++;
ZmSetting.COMPOSE_INIT_FONT_COLOR=i++;
ZmSetting.COMPOSE_INIT_FONT_FAMILY=i++;
ZmSetting.COMPOSE_INIT_FONT_SIZE=i++;
ZmSetting.COMPOSE_SAME_FORMAT=i++;
ZmSetting.DEDUPE_MSG_TO_SELF=i++;
ZmSetting.FORWARD_INCLUDE_ORIG=i++;
ZmSetting.GROUP_MAIL_BY=i++;
ZmSetting.INITIAL_GROUP_MAIL_BY=i++;
ZmSetting.INITIAL_SEARCH=i++;
ZmSetting.MAIL_LOCAL_DELIVERY_DISABLED=i++;
ZmSetting.MAIL_FORWARDING_ADDRESS=i++;
ZmSetting.NEW_WINDOW_COMPOSE=i++;
ZmSetting.NOTIF_ADDRESS=i++;
ZmSetting.NOTIF_ENABLED=i++;
ZmSetting.PAGE_SIZE=i++;
ZmSetting.POLLING_INTERVAL=i++;
ZmSetting.READING_PANE_ENABLED=i++;
ZmSetting.REPLY_INCLUDE_ORIG=i++;
ZmSetting.REPLY_PREFIX=i++;
ZmSetting.REPLY_TO_ADDRESS=i++;
ZmSetting.SAVE_TO_SENT=i++;
ZmSetting.SENT_FOLDER_NAME=i++;
ZmSetting.SHORTCUTS=i++;
ZmSetting.SHOW_BCC=i++;
ZmSetting.SHOW_FRAGMENTS=i++;
ZmSetting.SIGNATURE=i++;
ZmSetting.SIGNATURE_ENABLED=i++;
ZmSetting.SIGNATURE_STYLE=i++;
ZmSetting.USE_KEYBOARD_SHORTCUTS=i++;
ZmSetting.VACATION_MSG=i++;
ZmSetting.VACATION_MSG_ENABLED=i++;
ZmSetting.VIEW_AS_HTML=i++;
ZmSetting.MAX_INDEX=i-1;
delete i;
ZmSetting.T_CONFIG=1;
ZmSetting.T_PREF=2;
ZmSetting.T_COS=3;
ZmSetting.D_STRING=1;
ZmSetting.D_INT=2;
ZmSetting.D_BOOLEAN=3;
ZmSetting.D_LDAP_TIME=4;
ZmSetting.D_HASH=5;
ZmSetting.D_LIST=6;
ZmSetting.INIT={};
ZmSetting.INIT[ZmSetting.AC_TIMER_INTERVAL]=[null,ZmSetting.T_CONFIG,ZmSetting.D_INT,300];
ZmSetting.INIT[ZmSetting.ASYNC_MODE]=[null,ZmSetting.T_CONFIG,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.BRANCH]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"FRANK"];
ZmSetting.INIT[ZmSetting.CLIENT_DATETIME]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"20080128-1434"];
ZmSetting.INIT[ZmSetting.CLIENT_RELEASE]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"20080128142638"];
ZmSetting.INIT[ZmSetting.CLIENT_VERSION]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"4.5.11_GA_1751.RHEL5"];
ZmSetting.INIT[ZmSetting.CONFIG_PATH]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,appContextPath+"/js/zimbraMail/config"];
ZmSetting.INIT[ZmSetting.CSFE_MSG_FETCHER_URI]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.CSFE_SERVER_URI]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.CSFE_UPLOAD_URI]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.CSFE_EXPORT_URI]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.FORCE_CAL_OFF]=[null,ZmSetting.T_CONFIG,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.HELP_URI]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,appContextPath+"/help/Zimbra_User_Help.htm"];
ZmSetting.INIT[ZmSetting.LOG_REQUEST]=[null,ZmSetting.T_CONFIG,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.LOGO_URI]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"http://www.zimbra.com"];
ZmSetting.INIT[ZmSetting.TIMEOUT]=[null,ZmSetting.T_CONFIG,ZmSetting.D_INT,30];
ZmSetting.INIT[ZmSetting.USE_XML]=[null,ZmSetting.T_CONFIG,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SKIN_APP_BOTTOM_TOOLBAR_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_app_bottom_toolbar"];
ZmSetting.INIT[ZmSetting.SKIN_APP_CHOOSER_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_app_chooser"];
ZmSetting.INIT[ZmSetting.SKIN_APP_MAIN_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_app_main"];
ZmSetting.INIT[ZmSetting.SKIN_APP_TOP_TOOLBAR_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_app_top_toolbar"];
ZmSetting.INIT[ZmSetting.SKIN_CURRENT_APP_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_current_app"];
ZmSetting.INIT[ZmSetting.SKIN_LOGO_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_logo"];
ZmSetting.INIT[ZmSetting.SKIN_SASH_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_tree_app_sash"];
ZmSetting.INIT[ZmSetting.SKIN_SEARCH_BUILDER_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_search_builder"];
ZmSetting.INIT[ZmSetting.SKIN_SEARCH_BUILDER_TOOLBAR_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_search_builder_toolbar"];
ZmSetting.INIT[ZmSetting.SKIN_SEARCH_BUILDER_TR_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_tr_search_builder"];
ZmSetting.INIT[ZmSetting.SKIN_SEARCH_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_search"];
ZmSetting.INIT[ZmSetting.SKIN_SHELL_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_outer"];
ZmSetting.INIT[ZmSetting.SKIN_STATUS_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_status"];
ZmSetting.INIT[ZmSetting.SKIN_TREE_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_tree"];
ZmSetting.INIT[ZmSetting.SKIN_TREE_FOOTER_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_tree_footer"];
ZmSetting.INIT[ZmSetting.SKIN_USER_INFO_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_username"];
ZmSetting.INIT[ZmSetting.SKIN_QUOTA_INFO_ID]=[null,ZmSetting.T_CONFIG,ZmSetting.D_STRING,"skin_container_quota"];
ZmSetting.INIT[ZmSetting.ALLOW_ANY_FROM_ADDRESS]=["zimbraAllowAnyFromAddress",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.ALLOW_FROM_ADDRESSES]=["zimbraAllowFromAddress",ZmSetting.T_COS,ZmSetting.D_LIST];
ZmSetting.INIT[ZmSetting.AVAILABLE_SKINS]=[null,ZmSetting.T_COS,ZmSetting.D_LIST];
ZmSetting.INIT[ZmSetting.BROWSE_ENABLED]=["zimbraFeatureAdvancedSearchEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CALENDAR_ENABLED]=["zimbraFeatureCalendarEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CHANGE_PASSWORD_ENABLED]=["zimbraFeatureChangePasswordEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CONTACTS_ENABLED]=["zimbraFeatureContactsEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CONVERSATIONS_ENABLED]=["zimbraFeatureConversationsEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.DISPLAY_NAME]=["displayName",ZmSetting.T_COS,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.FILTERS_ENABLED]=["zimbraFeatureFiltersEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.GAL_AUTOCOMPLETE_ENABLED]=["zimbraFeatureGalAutoCompleteEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.GAL_ENABLED]=["zimbraFeatureGalEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.HTML_COMPOSE_ENABLED]=["zimbraFeatureHtmlComposeEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.IDENTITIES_ENABLED]=["zimbraFeatureIdentitiesEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.IDLE_SESSION_TIMEOUT]=["zimbraMailIdleSessionTimeout",ZmSetting.T_COS,ZmSetting.D_LDAP_TIME,0];
ZmSetting.INIT[ZmSetting.IM_ENABLED]=["zimbraFeatureIMEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.INITIAL_SEARCH_ENABLED]=["zimbraFeatureInitialSearchPreferenceEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.MAIL_ALIASES]=["zimbraMailAlias",ZmSetting.T_COS,ZmSetting.D_LIST];
ZmSetting.INIT[ZmSetting.MAIL_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.MAIL_FORWARDING_ENABLED]=["zimbraFeatureMailForwardingEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.MAX_CONTACTS]=["zimbraContactMaxNumEntries",ZmSetting.T_COS,ZmSetting.D_INT,0];
ZmSetting.INIT[ZmSetting.MIN_POLLING_INTERVAL]=["zimbraMailMinPollingInterval",ZmSetting.T_COS,ZmSetting.D_LDAP_TIME,120];
ZmSetting.INIT[ZmSetting.NOTEBOOK_ENABLED]=["zimbraFeatureNotebookEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.NOTIF_FEATURE_ENABLED]=["zimbraFeatureNewMailNotificationEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.OPTIONS_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.POP_ACCOUNTS_ENABLED]=["zimbraFeaturePop3DataSourceEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.PWD_MAX_LENGTH]=["zimbraPasswordMaxLength",ZmSetting.T_COS,ZmSetting.D_INT,64];
ZmSetting.INIT[ZmSetting.PWD_MIN_LENGTH]=["zimbraPasswordMinLength",ZmSetting.T_COS,ZmSetting.D_INT,6];
ZmSetting.INIT[ZmSetting.QUOTA]=["zimbraMailQuota",ZmSetting.T_COS,ZmSetting.D_INT,0];
ZmSetting.INIT[ZmSetting.SAVED_SEARCHES_ENABLED]=["zimbraFeatureSavedSearchesEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SHARING_ENABLED]=["zimbraFeatureSharingEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.SKIN_CHANGE_ENABLED]=["zimbraFeatureSkinChangeEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.TAGGING_ENABLED]=["zimbraFeatureTaggingEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.VACATION_MSG_FEATURE_ENABLED]=["zimbraFeatureOutOfOfficeReplyEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.VIEW_ATTACHMENT_AS_HTML]=["zimbraFeatureViewInHtmlEnabled",ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.LICENSE_STATUS]=[null,ZmSetting.T_COS,ZmSetting.D_STRING,ZmSetting.LICENSE_GOOD];
ZmSetting.INIT[ZmSetting.QUOTA_USED]=[null,ZmSetting.T_COS,ZmSetting.D_INT];
ZmSetting.INIT[ZmSetting.TOKEN_LIFETIME]=[null,ZmSetting.T_COS,ZmSetting.D_INT];
ZmSetting.INIT[ZmSetting.USERNAME]=[null,ZmSetting.T_COS,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.USERID]=["zimbraId",ZmSetting.T_COS,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.ATT_VIEW_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.EVAL_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.FEED_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.HELP_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.MIXED_VIEW_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.NOTES_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.PREFS_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.PRINT_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.REPLY_MENU_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.FORWARD_MENU_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.SAVE_DRAFT_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.SEARCH_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.SKI_HACK_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SPAM_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.USER_FOLDERS_ENABLED]=[null,ZmSetting.T_COS,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.AUTO_ADD_ADDRESS]=["zimbraPrefAutoAddAddressEnabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CONTACTS_PER_PAGE]=["zimbraPrefContactsPerPage",ZmSetting.T_PREF,ZmSetting.D_INT,25];
ZmSetting.INIT[ZmSetting.CONTACTS_VIEW]=["zimbraPrefContactsInitialView",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.CV_LIST];
ZmSetting.INIT[ZmSetting.EXPORT]=[null,ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.GAL_AUTOCOMPLETE]=["zimbraPrefGalAutoCompleteEnabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.GAL_AUTOCOMPLETE_SESSION]=[null,ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.IMPORT]=[null,ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL]=["zimbraPrefCalendarAlwaysShowMiniCal",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CAL_FIRST_DAY_OF_WEEK]=["zimbraPrefCalendarFirstDayOfWeek",ZmSetting.T_PREF,ZmSetting.D_INT,0];
ZmSetting.INIT[ZmSetting.CAL_REMINDER_WARNING_TIME]=["zimbraPrefCalendarApptReminderWarningTime",ZmSetting.T_PREF,ZmSetting.D_INT,0];
ZmSetting.INIT[ZmSetting.CAL_SHOW_TIMEZONE]=["zimbraPrefUseTimeZoneListInCalendar",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.CAL_USE_QUICK_ADD]=["zimbraPrefCalendarUseQuickAdd",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.CALENDAR_INITIAL_VIEW]=["zimbraPrefCalendarInitialView",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.CAL_DAY];
ZmSetting.INIT[ZmSetting.DEFAULT_CALENDAR_TIMEZONE]=["zimbraPrefTimeZoneId",ZmSetting.T_PREF,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.PASSWORD]=[null,ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.SEARCH_INCLUDES_SPAM]=["zimbraPrefIncludeSpamInSearch",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SEARCH_INCLUDES_TRASH]=["zimbraPrefIncludeTrashInSearch",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SHOW_SEARCH_STRING]=["zimbraPrefShowSearchString",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SKIN_NAME]=["zimbraPrefSkin",ZmSetting.T_PREF,ZmSetting.D_STRING,"sand"];
ZmSetting.INIT[ZmSetting.SORTING_PREF]=[null,ZmSetting.T_PREF,ZmSetting.D_HASH];
ZmSetting.INIT[ZmSetting.COMPOSE_AS_FORMAT]=["zimbraPrefComposeFormat",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.COMPOSE_TEXT];
ZmSetting.INIT[ZmSetting.COMPOSE_INIT_FONT_COLOR]=["zimbraPrefHtmlEditorDefaultFontColor",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.COMPOSE_FONT_COLOR];
ZmSetting.INIT[ZmSetting.COMPOSE_INIT_FONT_FAMILY]=["zimbraPrefHtmlEditorDefaultFontFamily",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.COMPOSE_FONT_FAM];
ZmSetting.INIT[ZmSetting.COMPOSE_INIT_FONT_SIZE]=["zimbraPrefHtmlEditorDefaultFontSize",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.COMPOSE_FONT_SIZE];
ZmSetting.INIT[ZmSetting.COMPOSE_SAME_FORMAT]=["zimbraPrefForwardReplyInOriginalFormat",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.DEDUPE_MSG_TO_SELF]=["zimbraPrefDedupeMessagesSentToSelf",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.DEDUPE_NONE];
ZmSetting.INIT[ZmSetting.FORWARD_INCLUDE_ORIG]=["zimbraPrefForwardIncludeOriginalText",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.INCLUDE];
ZmSetting.INIT[ZmSetting.INITIAL_GROUP_MAIL_BY]=["zimbraPrefGroupMailBy",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.GROUP_BY_MESSAGE];
ZmSetting.INIT[ZmSetting.GROUP_MAIL_BY]=[null,ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.GROUP_BY_MESSAGE];
ZmSetting.INIT[ZmSetting.INITIAL_SEARCH]=["zimbraPrefMailInitialSearch",ZmSetting.T_PREF,ZmSetting.D_STRING,"in:inbox"];
ZmSetting.INIT[ZmSetting.MAIL_FORWARDING_ADDRESS]=["zimbraPrefMailForwardingAddress",ZmSetting.T_PREF,ZmSetting.D_STRING];
ZmSetting.INIT[ZmSetting.MAIL_LOCAL_DELIVERY_DISABLED]=["zimbraPrefMailLocalDeliveryDisabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.NEW_WINDOW_COMPOSE]=["zimbraPrefComposeInNewWindow",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.NOTIF_ENABLED]=["zimbraPrefNewMailNotificationEnabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.NOTIF_ADDRESS]=["zimbraPrefNewMailNotificationAddress",ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.PAGE_SIZE]=["zimbraPrefMailItemsPerPage",ZmSetting.T_PREF,ZmSetting.D_INT,25];
ZmSetting.INIT[ZmSetting.POLLING_INTERVAL]=["zimbraPrefMailPollingInterval",ZmSetting.T_PREF,ZmSetting.D_LDAP_TIME,300];
ZmSetting.INIT[ZmSetting.READING_PANE_ENABLED]=["zimbraPrefReadingPaneEnabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.REPLY_INCLUDE_ORIG]=["zimbraPrefReplyIncludeOriginalText",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.INCLUDE];
ZmSetting.INIT[ZmSetting.REPLY_PREFIX]=["zimbraPrefForwardReplyPrefixChar",ZmSetting.T_PREF,ZmSetting.D_STRING,">"];
ZmSetting.INIT[ZmSetting.REPLY_TO_ADDRESS]=["zimbraPrefReplyToAddress",ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.SAVE_TO_SENT]=["zimbraPrefSaveToSent",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.SENT_FOLDER_NAME]=["zimbraPrefSentMailFolder",ZmSetting.T_PREF,ZmSetting.D_STRING,"sent"];
ZmSetting.INIT[ZmSetting.SHOW_BCC]=[null,ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SHOW_FRAGMENTS]=["zimbraPrefShowFragments",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SIGNATURE]=["zimbraPrefMailSignature",ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.SIGNATURE_ENABLED]=["zimbraPrefMailSignatureEnabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SIGNATURE_STYLE]=["zimbraPrefMailSignatureStyle",ZmSetting.T_PREF,ZmSetting.D_STRING,ZmSetting.SIG_OUTLOOK];
ZmSetting.INIT[ZmSetting.USE_KEYBOARD_SHORTCUTS]=["zimbraPrefUseKeyboardShortcuts",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,true];
ZmSetting.INIT[ZmSetting.VACATION_MSG]=["zimbraPrefOutOfOfficeReply",ZmSetting.T_PREF];
ZmSetting.INIT[ZmSetting.VACATION_MSG_ENABLED]=["zimbraPrefOutOfOfficeReplyEnabled",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.VIEW_AS_HTML]=["zimbraPrefMessageViewHtmlPreferred",ZmSetting.T_PREF,ZmSetting.D_BOOLEAN,false];
ZmSetting.INIT[ZmSetting.SHORTCUTS]=["zimbraPrefShortcuts",ZmSetting.T_PREF,ZmSetting.D_STRING];
ZmSetting.getName=function(id){
return ZmSetting.INIT[id]?ZmSetting.INIT[id][0]:null;
};
ZmSetting.isPref=function(id){
var name=ZmSetting.getName(id);
return name?(name.indexOf("zimbraPref")==0):false;
};
ZmSetting.prototype.toString=function(){
return this.name+": "+this.value;
};
ZmSetting.prototype.getValue=function(key){
if(this.value!=null){
return key?this.value[key]:this.value;
}else{
if(this.defaultValue!=null){
return key?this.defaultValue[key]:this.defaultValue;
}else{
return null;
}
}
};
ZmSetting.prototype.getDefaultValue=function(key){
return key?this.defaultValue[key]:this.defaultValue;
};
ZmSetting.prototype.setValue=function(value,key,_12b3,_12b4){
if(this.dataType==ZmSetting.D_STRING){
this.value=value;
}else{
if(this.dataType==ZmSetting.D_INT){
this.value=parseInt(value);
if(isNaN(this.value)){
this.value=value;
}
}else{
if(this.dataType==ZmSetting.D_BOOLEAN){
if(typeof (value)=="string"){
this.value=(value.toLowerCase()=="true");
}else{
this.value=value;
}
}else{
if(this.dataType==ZmSetting.D_LDAP_TIME){
var _12b5=(value.toLowerCase)?_12b5=(value.toLowerCase()).charAt(value.length-1):null;
var num=parseInt(value);
if(_12b5=="d"){
this.value=num*24*60*60;
}else{
if(_12b5=="h"){
this.value=num*60*60;
}else{
if(_12b5=="m"){
this.value=num*60;
}else{
this.value=num;
}
}
}
}else{
if(this.dataType==ZmSetting.D_HASH){
if(key){
this.value[key]=value;
}
}else{
if(this.dataType==ZmSetting.D_LIST){
if(value instanceof Array){
this.value=value;
}else{
this.value.push(value);
}
}
}
}
}
}
}
if(_12b3){
if(key){
this.defaultValue[key]=this.value[key];
}else{
this.defaultValue=this.value;
}
}
if(!this.name&&!_12b4){
this._notify(ZmEvent.E_MODIFY);
}
};
ZmSetting.prototype.notifyModify=function(obj){
if(this.id==ZmSetting.QUOTA_USED&&obj._name=="mbx"){
this.setValue(obj.s);
this._notify(ZmEvent.E_MODIFY);
}
};
function ZmSettings(_12b8){
ZmModel.call(this,ZmEvent.S_SETTING);
this._appCtxt=_12b8;
this._settings={};
this._nameToId={};
this._initialize();
this._setDefaults();
this.userSettingsLoaded=false;
}
ZmSettings.prototype=new ZmModel;
ZmSettings.prototype.constructor=ZmSettings;
ZmSettings.get=function(id){
var args=ZmSetting.INIT[id];
return args?args[3]:null;
};
ZmSettings.prototype.get=function(id,key){
if(!this._settings[id]){
return null;
}
return this._settings[id].getValue(key);
};
ZmSettings.prototype.getSetting=function(id){
return this._settings[id];
};
ZmSettings.prototype.createFromDom=function(node){
var _12bf=node.childNodes;
for(i=0;i<_12bf.length;i++){
var child=_12bf[i];
var name=child.getAttribute("name");
var value=child.firstChild.nodeValue;
var _12c3=this._settings[this._nameToId[name]];
if(_12c3){
_12c3.setValue(value);
}else{
}
}
};
ZmSettings.prototype.createFromJs=function(list){
if(list==null){
return;
}
for(i=0;i<list.length;i++){
var obj=list[i];
var _12c6=this._settings[this._nameToId[obj.name]];
if(_12c6){
_12c6.setValue(obj._content);
}else{
}
}
};
ZmSettings.prototype.loadUserSettings=function(_12c7,_12c8){
var _12c9=AjxSoapDoc.create("GetInfoRequest","urn:zimbraAccount");
var _12ca=new AjxCallback(this,this._handleResponseLoadUserSettings,_12c7);
this._appCtxt.getAppController().sendRequest({soapDoc:_12c9,asyncMode:true,callback:_12ca,errorCallback:_12c8});
};
ZmSettings.prototype._handleResponseLoadUserSettings=function(_12cb,_12cc){
var _12cd=_12cc.getResponse();
var obj=_12cd.GetInfoResponse;
if(obj.name){
this._settings[ZmSetting.USERNAME].setValue(obj.name);
}
if(obj.lifetime){
this._settings[ZmSetting.TOKEN_LIFETIME].setValue(obj.lifetime);
}
if(obj.used){
this._settings[ZmSetting.QUOTA_USED].setValue(obj.used);
}
if(obj.prefs&&obj.prefs.pref){
this.createFromJs(obj.prefs.pref);
}
if(obj.attrs&&obj.attrs.attr){
this.createFromJs(obj.attrs.attr);
}
if(obj.license){
this._settings[ZmSetting.LICENSE_STATUS].setValue(obj.license.status);
}
this._settings[ZmSetting.GROUP_MAIL_BY].setValue(this.get(ZmSetting.INITIAL_GROUP_MAIL_BY),null,true);
if((this.get(ZmSetting.GROUP_MAIL_BY)==ZmSetting.GROUP_BY_CONV)&&!this.get(ZmSetting.CONVERSATIONS_ENABLED)){
this._settings[ZmSetting.GROUP_MAIL_BY].setValue(ZmSetting.GROUP_BY_MESSAGE,null,true);
}
this._settings[ZmSetting.REPLY_TO_ADDRESS].defaultValue=this.get(ZmSetting.USERNAME);
if(!this.get(ZmSetting.SEARCH_ENABLED)){
this._settings[ZmSetting.BROWSE_ENABLED].setValue(false,null,true);
}
if(this.get(ZmSetting.FORCE_CAL_OFF)){
this._settings[ZmSetting.CALENDAR_ENABLED].setValue(false,null,true);
}
if(AjxEnv.isSafari){
this._settings[ZmSetting.HTML_COMPOSE_ENABLED].setValue(false);
}
if(obj.zimlets&&obj.zimlets.zimlet){
this._appCtxt.getZimletMgr().loadZimlets(obj.zimlets.zimlet,obj.props.prop);
}
var _12cf=this._appCtxt.getApp(ZmZimbraMail.PREFERENCES_APP);
var _12d0=_12cf.getIdentityCollection();
_12d0.initialize(obj.identities);
var _12d1=_12cf.getDataSourceCollection();
_12d1.initialize(obj.dataSources);
this.userSettingsLoaded=true;
if(_12cb){
_12cb.run(_12cc);
}
};
ZmSettings.prototype.loadAvailableSkins=function(_12d2){
var _12d3=AjxSoapDoc.create("GetAvailableSkinsRequest","urn:zimbraAccount");
var _12d4=new AjxCallback(this,this._handleResponseLoadAvailableSkins,[_12d2]);
this._appCtxt.getAppController().sendRequest({soapDoc:_12d3,asyncMode:true,callback:_12d4});
};
ZmSettings.prototype._handleResponseLoadAvailableSkins=function(_12d5,_12d6){
var resp=_12d6.getResponse().GetAvailableSkinsResponse;
var skins=resp.skin;
for(var i=0;i<skins.length;i++){
var name=skins[i].name;
this._settings[ZmSetting.AVAILABLE_SKINS].setValue(name);
}
if(_12d5){
_12d5.run();
}
};
ZmSettings.prototype.save=function(list,_12dc,_12dd){
if(!(list&&list.length)){
return;
}
var _12de=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
var _12df=false;
for(var i=0;i<list.length;i++){
var _12e1=list[i];
if(_12e1.type!=ZmSetting.T_PREF){
continue;
}
if(!_12e1.name){
continue;
}
var value=_12e1.getValue();
if(_12e1.dataType==ZmSetting.D_BOOLEAN){
value=value?"TRUE":"FALSE";
}
var node=_12de.set("pref",value);
node.setAttribute("name",_12e1.name);
_12df=true;
}
if(_12df){
var _12e4=new AjxCallback(this,this._handleResponseSave,[list,_12dc]);
if(_12dd){
_12dd.addNewRequestParams(_12de,_12e4,null,"ModifyPrefsRequest");
}else{
this._appCtxt.getAppController().sendRequest({soapDoc:_12de,asyncMode:true,callback:_12e4});
}
}
};
ZmSettings.prototype._handleResponseSave=function(list,_12e6,_12e7){
var resp=_12e7.getResponse();
if(resp.ModifyPrefsResponse){
for(var i=0;i<list.length;i++){
var _12ea=list[i];
_12ea.origValue=_12ea.value;
if(_12ea.id==ZmSetting.SKIN_NAME){
ZmLogin.setSkinCookie(_12ea.getValue());
}
_12ea._notify(ZmEvent.E_MODIFY);
}
}
if(_12e6){
_12e6.run(_12e7);
}
};
ZmSettings.prototype.getGroupMailBy=function(){
var _12eb=this.get(ZmSetting.PREFS_ENABLED)?this.get(ZmSetting.GROUP_MAIL_BY):null;
if(!_12eb){
}
return _12eb?ZmPref.GROUP_MAIL_BY_ITEM[_12eb]:ZmItem.MSG;
};
ZmSettings.prototype._initialize=function(){
for(var id=1;id<=ZmSetting.MAX_INDEX;id++){
var args=ZmSetting.INIT[id];
if(!args){
continue;
}
var _12ee=new ZmSetting(id,args[0],args[1],args[2],args[3],this);
this._settings[id]=_12ee;
if(args[0]){
this._nameToId[args[0]]=id;
}
}
};
ZmSettings.prototype._setDefaults=function(){
var value;
var _12f0=(location.port==""||location.port=="80");
var _12f1=_12f0?"":":"+location.port;
value=_12f1+"/service/soap/";
if(location.search&&location.search.indexOf("host=")!=-1){
value+=location.search;
}
this._settings[ZmSetting.CSFE_SERVER_URI].setValue(value,null,false,true);
value=_12f1+"/service/home/~/?auth=co&";
this._settings[ZmSetting.CSFE_MSG_FETCHER_URI].setValue(value,null,false,true);
value=_12f1+"/service/upload";
this._settings[ZmSetting.CSFE_UPLOAD_URI].setValue(value,null,false,true);
value=_12f1+"/service/home/~/?auth=co&id={0}&fmt=csv";
this._settings[ZmSetting.CSFE_EXPORT_URI].setValue(value,null,false,true);
if(this._appCtxt){
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_DESC,ZmController.CONVLIST_VIEW,true,true);
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_DESC,ZmController.CONV_VIEW,true,true);
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.DATE_DESC,ZmController.TRAD_VIEW,true,true);
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmController.CONTACT_SRC_VIEW,true,true);
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmController.CONTACT_TGT_VIEW,true,true);
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmController.CONTACT_SIMPLE_VIEW,true,true);
this._settings[ZmSetting.SORTING_PREF].setValue(ZmSearch.NAME_ASC,ZmController.CONTACT_CARDS_VIEW,true,true);
}
};
ZmSettings.prototype._loadShortcuts=function(){
var kbm=this._appCtxt.getKeyboardMgr();
var maps={};
var kmm=kbm.__keyMapMgr;
var _12f5=this.get(ZmSetting.SHORTCUTS);
if(!_12f5||!kmm){
return;
}
var _12f6=_12f5.split("|");
var len=_12f6.length;
for(var i=0;i<len;i++){
var sc=ZmShortcut.parse(_12f6[i]);
kmm.setMapping(sc.mapName,sc.keySequence,sc.action);
kmm.setArg(sc.mapName,sc.action,sc.arg);
maps[sc.mapName]=true;
}
for(var map in maps){
kmm.reloadMap(map);
}
};
ZmLogin=function(){
};
ZmLogin.lastGoodUserNameCookie="ls_last_username";
ZmLogin.lastGoodMailServerCookie="ls_last_server";
ZmLogin.skinCookie="ZM_SKIN";
ZmLogin.skinCookieLifetime=63072000000;
ZmLogin.CSFE_SERVER_URI=location.port=="80"?"/service/soap/":":"+location.port+"/service/soap/";
ZmLogin.DEFAULT_SKIN="sand";
ZmLogin.FETCH=[ZmSetting.SKIN_NAME,ZmSetting.MAIL_ENABLED,ZmSetting.CALENDAR_ENABLED,ZmSetting.CONTACTS_ENABLED,ZmSetting.OPTIONS_ENABLED,ZmSetting.IM_ENABLED,ZmSetting.NOTEBOOK_ENABLED];
ZmLogin.handleOnload=function(ev,_12fc){
if(!_12fc&&!ZmLogin.isSupportedBrowser()){
ZmLogin.showUnsupported();
}else{
if(ZmLogin.shouldReAuth()){
var _12fd=null;
if(!AjxCookie.areCookiesEnabled(document)){
_12fd=ZmMsg.errorCookiesDisabled;
}
ZmLogin.showPanel(_12fd);
}
}
};
ZmLogin.isSupportedBrowser=function(){
return AjxEnv.isIE6up||AjxEnv.isMozilla1_4up||AjxEnv.isFirefox1up||AjxEnv.isSafari;
};
ZmLogin.isAlmostSupportedBrowser=function(){
return AjxEnv.isOpera;
};
ZmLogin.showUnsupported=function(){
var _12fe=ZLoginFactory.copyDefaultParams(ZmMsg);
_12fe.showError=true;
_12fe.errorMsg=AjxMessageFormat.format(ZmMsg.errorBrowserUnsupported,[navigator.appName,navigator.appVersion]);
_12fe.showAbout=true;
if(ZmLogin.isAlmostSupportedBrowser()){
_12fe.aboutMsg=AjxMessageFormat.format(ZmMsg.almostSupportedBrowserTip,["ZmLogin.handleOnload(null, true);"]);
}else{
_12fe.aboutMsg=ZmMsg.unsupportedBrowserTip;
}
_12fe.clientLevelNotice=AjxMessageFormat.format(ZmMsg.clientLoginNotice,[appContextPath+"/h/"]);
var html=[];
var idx=0;
html[idx++]="<table border=0 cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td align='center' valign='center'>";
html[idx++]=ZLoginFactory.getLoginDialogHTML(_12fe);
html[idx++]="</td></tr></table>";
document.body.innerHTML=html.join("");
};
ZmLogin.shouldReAuth=function(){
ZmLogin.setServerUri();
var _1301=ZmCsfeCommand.getAuthToken();
if(_1301){
var _1302=AjxCookie.getCookie(document,ZmLogin.lastGoodMailServerCookie);
try{
ZmLogin.submitNoOpRequest();
ZmLogin.handleSuccess(_1301,null,_1302);
return false;
}
catch(ex){
}
}
return true;
};
ZmLogin.showPanel=function(_1303){
var html=[];
var idx=0;
html[idx++]="<table border=0 cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td align='center' valign='center'>";
var _1306=ZLoginFactory.copyDefaultParams(ZmMsg);
_1306.showForm=true;
_1306.showUserField=true;
_1306.showPasswordField=true;
_1306.showLicenseMsg=true;
_1306.showRememberMeCheckbox=true;
_1306.showButton=true;
if(_1303){
_1306.errorMsg=_1303;
_1306.showError=true;
}
_1306.clientLevelNotice=AjxMessageFormat.format(ZmMsg.clientLoginNotice,[appContextPath+"/h/"]);
html[idx++]=ZLoginFactory.getLoginDialogHTML(_1306);
html[idx++]="</td></tr></table>";
document.body.innerHTML=html.join("");
ZmLogin._registerKeyPress();
ZmLogin._setUserNameAndFocus();
};
ZmLogin._registerKeyPress=function(){
if(AjxEnv.isIE){
var el=ZLoginFactory.getLoginPanel();
el["onkeydown"]=ZLoginFactory.handleKeyPress;
}else{
window["onkeypress"]=ZLoginFactory.handleKeyPress;
}
};
ZmLogin._setUserNameAndFocus=function(){
var _1308=AjxCookie.getCookie(document,ZmLogin.lastGoodUserNameCookie);
var _1309=null;
if(_1308&&_1308!=""){
ZLoginFactory.showUserField(_1308);
_1309=ZLoginFactory.getPasswordField();
}else{
_1309=ZLoginFactory.getUserField();
}
_1309.focus();
};
ZmLogin._setErrorMessage=function(msg,_130b){
ZLoginFactory.showErrorMsg(msg);
if(!_130b){
ZLoginFactory.getUserField().focus();
}
};
ZmLogin.setServerUri=function(){
var value=location.protocol+"//"+location.hostname+ZmLogin.CSFE_SERVER_URI;
if(location.search&&location.search.indexOf("host=")!=-1){
value+=location.search;
}
ZmCsfeCommand.setServerUri(value);
};
ZmLogin.submitNoOpRequest=function(){
var _130d=AjxSoapDoc.create("NoOpRequest","urn:zimbraMail");
var _130e=new ZmCsfeCommand();
_130e.invoke({soapDoc:_130d,asyncMode:true});
};
ZmLogin.submitAuthRequest=function(uname,pword){
try{
var _1311=AjxSoapDoc.create("AuthRequest","urn:zimbraAccount");
}
catch(ex){
if(AjxEnv.isIE&&(ex.code==AjxException.INTERNAL_ERROR)){
ZmLogin._setErrorMessage(ZmMsg.errorNoActiveX);
}
return;
}
var el=_1311.set("account",uname);
el.setAttribute("by","name");
_1311.set("password",pword);
_1311.set("virtualHost",location.hostname);
var prefs=[],attrs=[];
if(ZmLogin.FETCH.length){
for(var i=0;i<ZmLogin.FETCH.length;i++){
var id=ZmLogin.FETCH[i];
var _1316=ZmSetting.getName(id);
if(_1316){
ZmSetting.isPref(id)?prefs.push(_1316):attrs.push(_1316);
}
}
if(prefs.length){
var _1317=_1311.set("prefs");
for(var i=0;i<prefs.length;i++){
var _1318=_1311.set("pref",null,_1317);
_1318.setAttribute("name",prefs[i]);
}
}
if(attrs.length){
var _1319=_1311.set("attrs");
for(var i=0;i<attrs.length;i++){
var _131a=_1311.set("attr",null,_1319);
_131a.setAttribute("name",attrs[i]);
}
}
}
var _131b=new ZmCsfeCommand();
var _131c=new AjxCallback(null,ZmLogin._handleResponseSubmitAuthRequest,[uname,pword]);
_131b.invoke({soapDoc:_1311,noAuthToken:true,noSession:true,asyncMode:true,callback:_131c});
};
ZmLogin._handleResponseSubmitAuthRequest=function(uname,pword,_131f){
var _1320;
try{
_1320=_131f.getResponse();
}
catch(ex){
if(ex.code==ZmCsfeException.ACCT_AUTH_FAILED||ex.code==ZmCsfeException.NO_SUCH_ACCOUNT){
ZmLogin._setErrorMessage(ZmMsg.loginError);
}else{
if(ex.code==ZmCsfeException.SOAP_ERROR||ex.code==ZmCsfeException.NETWORK_ERROR){
var msg=ZmMsg.errorNetwork+" "+ZmMsg.errorTryAgain+" "+ZmMsg.errorContact;
ZmLogin._setErrorMessage(msg);
}else{
if(ex.code==ZmCsfeException.ACCT_CHANGE_PASSWORD){
var _1322=document.getElementById(ZLoginFactory.USER_ID);
var _1323=document.getElementById(ZLoginFactory.PASSWORD_ID);
_1322.disabled=_1323.disabled=true;
ZmLogin.showChangePass(ex);
}else{
if(ex.code==ZmCsfeException.ACCT_MAINTENANCE_MODE){
var msg=ZmMsg.errorMaintenanceMode+" "+ZmMsg.errorContact;
ZmLogin._setErrorMessage(msg);
}else{
var msg=ZmMsg.errorApplication+" "+ZmMsg.errorTryAgain+" "+ZmMsg.errorContact;
ZmLogin._setErrorMessage(msg+" ("+ex.code+")");
}
}
}
}
return;
}
var resp=_1320.Body.AuthResponse;
ZmLogin._authToken=resp.authToken;
ZmLogin._authTokenLifetime=resp.lifetime;
var _1325=resp.refer;
var _1326=new ZmSettings();
var prefs=!resp.prefs?null:(resp.prefs instanceof Array)?resp.prefs[0].pref:resp.prefs.pref;
if(prefs&&prefs.length){
_1326.createFromJs(prefs);
}
var attrs=!resp.attrs?null:(resp.attrs instanceof Array)?resp.attrs[0].attr:resp.attrs.attr;
if(attrs&&attrs.length){
_1326.createFromJs(attrs);
}
var match=location.search?location.search.match(/\bredirect=([01])/):null;
var _132a=match?match[1]:null;
if(_132a=="0"||(location.hostname=="localhost")||(location.hostname&&location.hostname.match(/^\d+\.\d+\.\d+\.\d+$/))){
if(_132a!="1"){
_1325=location.hostname;
}
}
var _132b=document.getElementById(ZLoginFactory.REMEMBER_ME_ID).checked;
ZmLogin.handleSuccess(ZmLogin._authToken,ZmLogin._authTokenLifetime,_1325,uname,pword,_132b,_1326);
ZmLogin._authToken=ZmLogin._authTokenLifetime=null;
};
ZmLogin.accountPat=/((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))/;
ZmLogin.addrPat=/(((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))\@((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*\[(\s*(([^\[\]\\])|(\\([^\x0A\x0D])))+)*\s*\]\s*)))/;
ZmLogin._prelimCheck=function(str){
var _132d=str.indexOf("@");
var _132e=str.lastIndexOf(".");
return ((_132d!=-1)&&(_132e!=-1)&&(_132e>_132d));
};
ZmLogin.isValid=function(str){
str=AjxStringUtil.trim(str);
var _1330=ZmLogin._prelimCheck(str);
return (_1330&&(str.match(ZmLogin.addrPat)!=null));
};
ZmLogin.isValidUsername=function(uname){
return uname.match(ZmLogin.accountPat)||ZmLogin.isValid(uname);
};
ZmLogin.handleLogin=function(){
var _1332=document.getElementById(ZLoginFactory.USER_ID);
var _1333=document.getElementById(ZLoginFactory.PASSWORD_ID);
var uname=_1332.value;
var pword=_1333.value;
if(_1332.disabled&&_1333.disabled){
ZmLogin.handleChangePass(uname,pword);
return;
}
if(!uname||!pword){
ZmLogin._setErrorMessage(ZmMsg.enterUsername);
return;
}
if(!ZmLogin.isValidUsername(uname)){
ZmLogin._setErrorMessage(ZmMsg.badUsername);
return;
}
ZmLogin.submitAuthRequest(uname,pword);
};
ZmLogin.handleSuccess=function(_1336,_1337,_1338,uname,_133a,_133b,_133c){
if(uname){
AjxCookie.setCookie(document,ZmLogin.lastGoodUserNameCookie,uname,null,"/");
}
if(_1338){
AjxCookie.setCookie(document,ZmLogin.lastGoodMailServerCookie,_1338,null,"/");
}
if(window.initMode!=""&&(window.initMode!=location.protocol)){
AjxDebug.deleteWindowCookie();
}
if(_133c){
ZmLogin.setSkinCookie(_133c.get(ZmSetting.SKIN_NAME)||ZmLogin.DEFAULT_SKIN);
}
ZmLogin._postAuthToServer(_1338,_1336,_1337,_133b);
};
ZmLogin.handleChangePass=function(uname,_133e){
var _133f=ZLoginFactory.getNewPasswordField();
var _1340=ZLoginFactory.getPasswordConfirmField();
var _1341=AjxStringUtil.trim(_133f.value);
var _1342=AjxStringUtil.trim(_1340.value);
if(!_1341||!_1342){
ZmLogin._setErrorMessage(ZmMsg.enterNewPassword,true);
return;
}
if(_1341!=_1342){
ZmLogin._setErrorMessage(ZmMsg.bothNewPasswordsMustMatch,true);
return;
}
var _1343=AjxSoapDoc.create("ChangePasswordRequest","urn:zimbraAccount");
var el=_1343.set("account",uname);
el.setAttribute("by","name");
_1343.set("oldPassword",_133e);
_1343.set("password",_1341);
_1343.set("virtualHost",location.hostname);
var resp=null;
try{
var _1346=new ZmCsfeCommand();
resp=_1346.invoke({soapDoc:_1343,noAuthToken:true,noSession:true}).Body.ChangePasswordResponse;
}
catch(ex){
if(ex.code=="account.PASSWORD_RECENTLY_USED"||ex.code=="account.PASSWORD_CHANGE_TOO_SOON"){
var msg=ex.code==ZmCsfeException.ACCT_PASS_RECENTLY_USED?ZmMsg.errorPassRecentlyUsed:(ZmMsg.errorPassChangeTooSoon+" "+ZmMsg.errorContact);
ZmLogin._setErrorMessage(msg);
_133f.value=_1340.value="";
_133f.focus();
}else{
if(ex.code=="account.PASSWORD_LOCKED"){
var _1348=document.getElementById("passTable");
_1348.deleteRow(2);
_1348.deleteRow(2);
var _1349=document.getElementById(ZLoginFactory.USER_ID);
var _134a=document.getElementById(ZLoginFactory.PASSWORD_ID);
_1349.disabled=_134a.disabled=false;
_134a.value="";
_134a.focus();
ZmLogin._setErrorMessage(ZmMsg.errorPassLocked);
}else{
if(ex.code=="account.INVALID_PASSWORD"){
ZmLogin._setErrorMessage(ZmMsg.errorInvalidPass);
_133f.focus();
}
}
}
}
if(resp){
ZmLogin.submitAuthRequest(uname,_1341);
}
};
ZmLogin.showChangePass=function(ex){
ZmLogin._setErrorMessage(ZmMsg.errorPassChange,true);
ZLoginFactory.showNewPasswordFields();
ZLoginFactory.getNewPasswordField().focus();
};
ZmLogin._postAuthToServer=function(_134c,_134d,_134e,_134f){
var form=document.createElement("form");
document.body.appendChild(form);
var html=[];
var i=0;
html[i++]="<input type='hidden' name='authToken' value='"+_134d+"'>";
if(_134f){
html[i++]="<input type='hidden' name='rememberMe' value='"+_134f+"'>";
}
if(_134e){
html[i++]="<input type='hidden' name='atl' value='"+_134e+"'>";
}
form.innerHTML=html.join("");
form.action=ZmLogin.getAuthUrl(_134c);
form.method="post";
form.submit();
};
ZmLogin.getAuthUrl=function(_1353){
var ms=_1353?_1353:location.hostname;
return (location.protocol+"//"+ms+((location.port==80)?"":":"+location.port)+appContextPath+"/auth/"+window.location.search);
};
ZmLogin.setSkinCookie=function(skin){
var exp=new Date();
exp.setTime(exp.getTime()+ZmLogin.skinCookieLifetime);
AjxCookie.setCookie(document,ZmLogin.skinCookie,skin,exp,"/");
};
AjxTemplate.register("ajax.dwt.templates.Widgets#checkbox",function(name,_1358,data,_135a){
var _135b=Boolean(_135a);
data=(typeof data=="string"?{id:data}:data)||{};
_135a=_135a||[];
var _i=_135a.length;
_135a[_i++]="\n";
_135a[_i++]="    <input id='";
_135a[_i++]=data["id"];
_135a[_i++]="_input' type='checkbox'>";
return _135b?_135a.length:_135a.join("");
},{"id":"checkbox"});
AjxTemplate.register("ajax.dwt.templates.Widgets",AjxTemplate.getTemplate("ajax.dwt.templates.Widgets#checkbox"),AjxTemplate.getParams("ajax.dwt.templates.Widgets#checkbox"));
AjxTemplate.register("ajax.dwt.templates.Widgets#checkbox-text-left",function(name,_135e,data,_1360){
var _1361=Boolean(_1360);
data=(typeof data=="string"?{id:data}:data)||{};
_1360=_1360||[];
var _i=_1360.length;
_1360[_i++]="\n";
_1360[_i++]="    <label id='";
_1360[_i++]=data["id"];
_1360[_i++]="_text' for='";
_1360[_i++]=data["id"];
_1360[_i++]="_input' style='text-align:right'></label>\n";
_1360[_i++]="    <input id='";
_1360[_i++]=data["id"];
_1360[_i++]="_input' type='checkbox'>";
return _1361?_1360.length:_1360.join("");
},{"id":"checkbox-text-left"});
AjxTemplate.register("ajax.dwt.templates.Widgets#checkbox-text-right",function(name,_1364,data,_1366){
var _1367=Boolean(_1366);
data=(typeof data=="string"?{id:data}:data)||{};
_1366=_1366||[];
var _i=_1366.length;
_1366[_i++]="\n";
_1366[_i++]="    <input id='";
_1366[_i++]=data["id"];
_1366[_i++]="_input' type='checkbox'>\n";
_1366[_i++]="    <label id='";
_1366[_i++]=data["id"];
_1366[_i++]="_text' for='";
_1366[_i++]=data["id"];
_1366[_i++]="_input' style='text-align:right'></label>";
return _1367?_1366.length:_1366.join("");
},{"id":"checkbox-text-right"});
AjxTemplate.register("ajax.dwt.templates.Widgets#DwtDialog",function(name,_136a,data,_136c){
var _136d=Boolean(_136c);
data=(typeof data=="string"?{id:data}:data)||{};
_136c=_136c||[];
var _i=_136c.length;
_136c[_i++]="\n";
_136c[_i++]="    <div class='DwtDialog WindowOuterContainer'>\n";
_136c[_i++]="        <table cellspacing=0 cellpadding=0 style='cursor:move;'>\n";
_136c[_i++]="            <tr id='";
_136c[_i++]=data["id"];
_136c[_i++]="_title'>\n";
_136c[_i++]="                <td class='minWidth'>";
_136c[_i++]=data["icon"];
_136c[_i++]="</td>\n";
_136c[_i++]="                <td id='";
_136c[_i++]=data["id"];
_136c[_i++]="_title_cell' class='DwtDialogTitle'>";
_136c[_i++]=data["title"];
_136c[_i++]="</td>\n";
_136c[_i++]="                <td class='minWidth'><div class='";
_136c[_i++]=data["closeIcon2"];
_136c[_i++]="'></div></td>\n";
_136c[_i++]="                <td class='minWidth'><div class='";
_136c[_i++]=data["closeIcon1"];
_136c[_i++]="'></div></td>\n";
_136c[_i++]="            </tr>\n";
_136c[_i++]="            <tr>\n";
_136c[_i++]="                <td id='";
_136c[_i++]=data["id"];
_136c[_i++]="_container' class='DwtDialogBody WindowInnerContainer' colspan='3' style='cursor:default;'></td>\n";
_136c[_i++]="            </tr>\n";
_136c[_i++]="        </table>\n";
_136c[_i++]="    </div>";
return _136d?_136c.length:_136c.join("");
},{"width":"20","height":"32","id":"DwtDialog"});
AjxTemplate.register("ajax.dwt.templates.Widgets#DwtSemiModalDialog",function(name,_1370,data,_1372){
var _1373=Boolean(_1372);
data=(typeof data=="string"?{id:data}:data)||{};
_1372=_1372||[];
var _i=_1372.length;
_1372[_i++]="\n";
_1372[_i++]="    <div class='DwtDialog LightWindowOuterContainer'>\n";
_1372[_i++]="        <table class='full_size' cellspacing=0 cellpadding=0 style='cursor:move;'>\n";
_1372[_i++]="            <tr id='";
_1372[_i++]=data["id"];
_1372[_i++]="_title'>\n";
_1372[_i++]="                <td class='minWidth'>";
_1372[_i++]=data["icon"];
_1372[_i++]="</td>\n";
_1372[_i++]="                <td id='";
_1372[_i++]=data["id"];
_1372[_i++]="_title_cell' class='DwtDialogTitle' width='*'>";
_1372[_i++]=data["title"];
_1372[_i++]="</td>\n";
_1372[_i++]="                <td id='";
_1372[_i++]=data["id"];
_1372[_i++]="_close' class='minWidth'></td>\n";
_1372[_i++]="            </tr>\n";
_1372[_i++]="            <tr>\n";
_1372[_i++]="                <td id='";
_1372[_i++]=data["id"];
_1372[_i++]="_container' class='DwtDialogBody LIghtWindowInnerContainer full_size' colspan='3'></td>\n";
_1372[_i++]="            </tr>\n";
_1372[_i++]="        </table>\n";
_1372[_i++]="    </div>";
return _1373?_1372.length:_1372.join("");
},{"width":"20","height":"32","id":"DwtSemiModalDialog"});
AjxTemplate.register("ajax.dwt.templates.Widgets#DwtToolTip",function(name,_1376,data,_1378){
var _1379=Boolean(_1378);
data=(typeof data=="string"?{id:data}:data)||{};
_1378=_1378||[];
var _i=_1378.length;
_1378[_i++]="\n";
_1378[_i++]="    <div class='DwtToolTip LightWindowOuterContainer'>\n";
_1378[_i++]="        <div id='";
_1378[_i++]=data["id"];
_1378[_i++]="TopPointer' class='DwtToolTipTopPointer'>\n";
_1378[_i++]="            <center>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:1px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:3px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:5px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:7px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:9px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:11px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:13px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:15px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:17px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:19px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:21px;'>&nbsp;</div>\n";
_1378[_i++]="            </center>\n";
_1378[_i++]="        </div>\n";
_1378[_i++]="        <div id='";
_1378[_i++]=data["id"];
_1378[_i++]="Contents' class='DwtToolTipBody'></div>\n";
_1378[_i++]="        <div id='";
_1378[_i++]=data["id"];
_1378[_i++]="BottomPointer' class='DwtToolTipBottomPointer'>\n";
_1378[_i++]="            <center>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:21px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:19px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:17px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:15px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:13px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:11px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:9px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:7px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:5px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:3px;'>&nbsp;</div>\n";
_1378[_i++]="                <div class='DwtToolTipPointerRow' style='width:1px;'>&nbsp;</div>\n";
_1378[_i++]="            </center>\n";
_1378[_i++]="        </div>\n";
_1378[_i++]="    </div>";
return _1379?_1378.length:_1378.join("");
},{"width":"5","height":"5","id":"DwtToolTip"});
AjxTemplate.register("ajax.dwt.templates.Widgets#DwtVerticalSash",function(name,_137c,data,_137e){
var _137f=Boolean(_137e);
data=(typeof data=="string"?{id:data}:data)||{};
_137e=_137e||[];
var _i=_137e.length;
_137e[_i++]="\n";
_137e[_i++]="\t<div class='DwtVerticalSash'>\n";
_137e[_i++]="        <center>\n";
_137e[_i++]="            <table cellspacing=0 width=20><tr>\n";
_137e[_i++]="                <td class='DwtVerticalSashContents'>&deg;</td>\n";
_137e[_i++]="                <td class='DwtVerticalSashContents'>&deg;</td>\n";
_137e[_i++]="                <td class='DwtVerticalSashContents'>&deg;</td>\n";
_137e[_i++]="                <td class='DwtVerticalSashContents'>&deg;</td>\n";
_137e[_i++]="                <td class='DwtVerticalSashContents'>&deg;</td>\n";
_137e[_i++]="            </tr></table>\n";
_137e[_i++]="        </center>\n";
_137e[_i++]="    </div>";
return _137f?_137e.length:_137e.join("");
},{"width":"0","height":"0","id":"DwtVerticalSash"});
AjxTemplate.register("ajax.dwt.templates.Widgets#DwtHorizontalSash",function(name,_1382,data,_1384){
var _1385=Boolean(_1384);
data=(typeof data=="string"?{id:data}:data)||{};
_1384=_1384||[];
var _i=_1384.length;
_1384[_i++]="\n";
_1384[_i++]="    <div class='DwtHorizontalSash'>\n";
_1384[_i++]="        <table cellspacing=0 cellpadding=1 height='90%'>\n";
_1384[_i++]="            <tr><td height='50%' class='DwtHorizonalSashContents'>&nbsp;</td></tr>\n";
_1384[_i++]="            <tr><td class='DwtHorizonalSashContents'>&deg;</td></tr>\n";
_1384[_i++]="            <tr><td class='DwtHorizonalSashContents'>&deg;</td></tr>\n";
_1384[_i++]="            <tr><td class='DwtHorizonalSashContents'>&deg;</td></tr>\n";
_1384[_i++]="            <tr><td class='DwtHorizonalSashContents'>&deg;</td></tr>\n";
_1384[_i++]="            <tr><td class='DwtHorizonalSashContents'>&deg;</td></tr>\n";
_1384[_i++]="            <tr><td height='50%' class='DwtHorizonalSashContents'>&nbsp;</td></tr>\n";
_1384[_i++]="        </table>\n";
_1384[_i++]="    </div>";
return _1385?_1384.length:_1384.join("");
},{"width":"0","height":"0","id":"DwtHorizontalSash"});

