
/* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
if(AjxPackage.define("Ajax")){
if(AjxPackage.define("ajax.core.AjxCore")){
AjxCore=function(){};
AjxCore._objectIds=[null];
AjxCore.assignId=function(e){
var t=AjxCore._objectIds.length;
AjxCore._objectIds[t]=e;
return t
};
AjxCore.unassignId=function(e){
AjxCore._objectIds[e]=null
};
AjxCore.objectWithId=function(e){
return AjxCore._objectIds[e]
};
AjxCore.addListener=function(a,e,t){
a=AjxCore._getEventSource(a);
var o=AjxCore._getListenerStruct(a,e,true);
o.list[o.list.length]=t
};
AjxCore.setEventHandler=function(a,e,t){
a=AjxCore._getEventSource(a);
var o=AjxCore._getListenerStruct(a,e,true);
o.single=t
};
AjxCore.removeListener=function(n,t,o){
n=AjxCore._getEventSource(n);
var s=AjxCore._getListenerStruct(n,t);
if(s){
var r=s.list;
var e=r.length;
for(var a=0;
a<e;
a++){
if(r[a]==o){
r[a]=null
}}}};
AjxCore.removeAllListeners=function(o,t){
o=AjxCore._getEventSource(o);
var n=AjxCore._getListenerStruct(o,t);
if(n){
var s=n.list;
var e=s.length;
for(var a=0;
a<e;
a++){
s[a]=null
}}
AjxCore.unassignId(n.id)
};
AjxCore.notifyListeners=function(a,e,t){
a=AjxCore._getEventSource(a);
var o=AjxCore._getListenerStruct(a,e);
if(o){
a[e](t)
}};
AjxCore._getEventSource=function(e){
if(typeof(e)=="string"){
e=document.getElementById(e)
}
return e
};
AjxCore.getListenerStruct=function(t,e){
return AjxCore._getListenerStruct(t,e)
};
AjxCore._getListenerStruct=function(a,e,t){
var o=null;
if(a[e]){
var n=a[e]._lsListenerStructId;
o=AjxCore.objectWithId(n)
}else{
if(t){
o=AjxCore._setupListener(a,e)
}}
return o
};
AjxCore._setupListener=function(a,e,n){
var o=new Object();
o.list=new Array();
o.single=null;
var n=o.id=AjxCore.assignId(o);
var t=AjxCore._createListenerClosure(n);
a[e]=t;
a[e]._lsListenerStructId=n;
return o
};
AjxCore._createListenerClosure=function(id){
var closure=function(arg1){
var listenerStruct=AjxCore.objectWithId(id);
var listenerList=listenerStruct.list;
var len=listenerList.length;
for(var i=0;
i<len;
i++){
var callback=listenerList[i];
if(callback){
if(typeof(callback)=="string"){
eval(callback)
}else{
if(callback.handleEvent){
callback.handleEvent(arg1,this)
}else{
callback(arg1,this)
}}}}
if(listenerStruct.single){
var callback=listenerStruct.single;
if(typeof(callback)=="string"){
eval(callback)
}else{
return callback.handleEvent?callback.handleEvent(arg1,this):callback(arg1,this)
}}};
return closure
};
AjxCore.addOnloadListener=function(e){
if(window.onload&&(!window.onload._lsListenerStructId)){
var t=window.onload;
window.onload=null;
AjxCore.addListener(window,"onload",t)
}
AjxCore.addListener(window,"onload",e)
};
AjxCore.addOnunloadListener=function(e){
if(window.onunload&&(!window.onunload._lsListenerStructId)){
var t=window.onunload;
window.onunload=null;
AjxCore.addListener(window,"onunload",t)
}
AjxCore.addListener(window,"onunload",e)
}
}
if(AjxPackage.define("ajax.util.AjxUtil")){
AjxUtil=function(){};
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(e){
return((e!==void 0)&&(e!==null))
};
AjxUtil.isUndefined=function(e){
return(e===void 0)
};
AjxUtil.isNull=function(e){
return(e===null)
};
AjxUtil.isBoolean=function(e){
return(typeof(e)=="boolean")
};
AjxUtil.isString=function(e){
return(typeof(e)=="string")
};
AjxUtil.isNumber=function(e){
return(typeof(e)=="number")
};
AjxUtil.isObject=function(e){
return((typeof(e)=="object")&&(e!==null))
};
AjxUtil.isArray=function(e){
return AjxUtil.isInstance(e,Array)
};
AjxUtil.isFunction=function(e){
return(typeof(e)=="function")
};
AjxUtil.isDate=function(e){
return AjxUtil.isInstance(e,Date)
};
AjxUtil.isLifeTime=function(e){
return AjxUtil.LIFETIME_FIELD.test(e)
};
AjxUtil.isNumeric=function(e){
return(!isNaN(parseFloat(e))&&AjxUtil.FLOAT_RE.test(e)&&!AjxUtil.NOTFLOAT_RE.test(e))
};
AjxUtil.isLong=function(e){
return(AjxUtil.isNumeric(e)&&!AjxUtil.NOTINT_RE.test(e))
};
AjxUtil.isNonNegativeLong=function(e){
return(AjxUtil.isNumeric(e)&&AjxUtil.isLong(e)&&(parseFloat(e)>=0))
};
AjxUtil.isInt=function(e){
return(AjxUtil.isNumeric(e)&&!AjxUtil.NOTINT_RE.test(e))
};
AjxUtil.isPositiveInt=function(e){
return(AjxUtil.isNumeric(e)&&AjxUtil.isInt(e)&&(parseInt(e)>0))
};
AjxUtil.isEmpty=function(e){
return(AjxUtil.isNull(e)||AjxUtil.isUndefined(e)||(e==="")||(AjxUtil.isArray(e)&&(e.length==0)))
};
AjxUtil.IP_ADDRESS_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?$/;
AjxUtil.IP_ADDRESS_WITH_PORT_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?:\d{1,5}$/;
AjxUtil.SUBNET_RE=/^\d{1,3}(\.\d{1,3}){3}(\.\d{1,3}\.\d{1,3})?\/\d{1,2}$/;
AjxUtil.DOMAIN_NAME_SHORT_RE=/^[A-Za-z0-9\-]{2,}$/;
AjxUtil.DOMAIN_NAME_FULL_RE=/^[A-Za-z0-9\-]{1,}(\.[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.SHORT_URL_RE=/^[A-Za-z0-9]{2,}:\/\/[A-Za-z0-9\-]+(\.[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(e){
return AjxUtil.IP_ADDR_RE.test(e)
};
AjxUtil.isDomain=function(e){
return AjxUtil.DOMAIN_RE.test(e)
};
AjxUtil.isHostName=function(e){
return AjxUtil.HOST_NAME_RE.test(e)
};
AjxUtil.isDomainName=function(t,e){
return e?AjxUtil.DOMAIN_NAME_SHORT_RE.test(t):AjxUtil.DOMAIN_NAME_FULL_RE.test(t)
};
AjxUtil.isEmailAddress=function(t,e){
return e?AjxUtil.EMAIL_SHORT_RE.test(t):AjxUtil.EMAIL_FULL_RE.test(t)
};
AjxUtil.isValidEmailNonReg=function(e){
return((e.indexOf("@")>0)&&(e.lastIndexOf("@")==e.indexOf("@"))&&(e.indexOf(".@")<0))
};
AjxUtil.SIZE_GIGABYTES="GB";
AjxUtil.SIZE_MEGABYTES="MB";
AjxUtil.SIZE_KILOBYTES="KB";
AjxUtil.SIZE_BYTES="B";
AjxUtil.formatSize=function(n,o,s){
if(o==null){
o=true
}
if(s==null){
s=20
}
var t=AjxMsg.sizeBytes;
var a=AjxMsg.SIZE_BYTES;
if(n>=1073741824){
t=AjxMsg.sizeGigaBytes;
a=AjxUtil.SIZE_GIGABYTES
}else{
if(n>=1048576){
t=AjxMsg.sizeMegaBytes;
a=AjxUtil.SIZE_MEGABYTES
}else{
if(n>1023){
t=AjxMsg.sizeKiloBytes;
a=AjxUtil.SIZE_KILOBYTES
}}}
var e=AjxUtil.formatSizeForUnits(n,a,o,s);
return AjxMessageFormat.format(AjxMsg.formatSizeAndUnits,[e,t])
};
AjxUtil.formatSizeForUnits=function(o,t,e,s){
if(t==null){
t=AjxUtil.SIZE_BYTES
}
if(e==null){
e=true
}
if(s==null){
s=20
}
switch(t){
case AjxUtil.SIZE_GIGABYTES:o/=1073741824;
break;
case AjxUtil.SIZE_MEGABYTES:o/=1048576;
break;
case AjxUtil.SIZE_KILOBYTES:o/=1024;
break
}
var n=I18nMsg.formatNumber.replace(/\..*$/,"");
n=n.replace(/,/,"");
if(!e&&s){
n=n+=".";
for(var a=0;
a<s;
a++){
n+="#"
}}
return AjxNumberFormat.format(n,o)
};
AjxUtil.parseSize=function(t,o){
if(typeof t!=_STRING_){
t=t.toString()
}
var n=parseFloat(t.replace(/^\s*/,""));
var a=/[GMK]?B$/i;
var e=a.exec(t);
if(e){
o=e[0].toUpperCase()
}
switch(o){
case AjxUtil.SIZE_GIGABYTES:n*=1073741824;
break;
case AjxUtil.SIZE_MEGABYTES:n*=1048576;
break;
case AjxUtil.SIZE_KILOBYTES:n*=1024;
break
}
return n
};
AjxUtil.isInstance=function(e,t){
return !!(e&&e.constructor&&(e.constructor===t))
};
AjxUtil.assert=function(e,t){
if(!e&&AjxUtil.onassert){
AjxUtil.onassert(t)
}};
AjxUtil.onassert=function(t){
var c=new Object();
c.message=t;
var d=new Array();
if(AjxEnv.isIE5_5up){
var o=arguments.caller;
while(o){
d[d.length]=o.callee;
o=o.caller
}}else{
try{
var o=arguments.callee.caller;
while(o){
d[d.length]=o;
if(d.length>2){
break
}
o=o.caller
}}
catch(h){}}
c.stack=d;
var r="";
var a=170;
for(var n=1;
n<d.length;
n++){
if(n>1){
r+="\n"
}
if(n<11){
var s=d[n].toString();
if(s.length>a){
s=s.substr(0,a)+"...";
s=s.replace(/\n/g,"")
}
r+=n+": "+s
}else{
r+="("+(d.length-11)+" frames follow)";
break
}}
alert("assertion:\n\n"+t+"\n\n---- Call Stack ---\n"+r);
throw c
};
AjxUtil.ELEMENT_NODE=1;
AjxUtil.TEXT_NODE=3;
AjxUtil.DOCUMENT_NODE=9;
AjxUtil.getInnerText=function(e){
if(AjxEnv.isIE){
return e.innerText
}
function t(s){
if(s){
if(s.nodeType==3){
return s.data
}
if(s.nodeType==1){
if(/^br$/i.test(s.tagName)){
return"\r\n"
}
var o="";
for(var a=s.firstChild;
a;
a=a.nextSibling){
o+=t(a)
}
return o
}}
return""
}
return t(e)
};
AjxUtil.createProxy=function(a,r){
var n;
var t=function(){};
t.prototype=a;
if(a instanceof Array){
n=new Array();
var o=a.length;
for(var e=0;
e<o;
e++){
n[e]=a[e]
}}else{
n=new t
}
if(r){
for(var s in a){
if(typeof a[s]=="object"&&a[s]!==null){
n[s]=AjxUtil.createProxy(a[s],r-1)
}}}
n._object_=a;
return n
};
AjxUtil.collapseList=function(a){
var t=[];
for(var e=0;
e<a.length;
e++){
if(a[e]){
t.push(a[e])
}}
return t
};
AjxUtil.arrayAsHash=function(r,o){
var s={};
var a=typeof o=="function"&&o;
var n=o||true;
for(var t=0;
t<r.length;
t++){
var e=r[t];
s[e]=a?a(e,s,t,r):n
}
return s
};
AjxUtil.arrayAdd=function(a,t,e){
if(e==null||e<0||e>=a.length){
a.push(t)
}else{
a.splice(e,0,t)
}};
AjxUtil.arrayRemove=function(a,t){
for(var e=0;
e<a.length;
e++){
if(a[e]==t){
a.splice(e,1);
return true
}}
return false
};
AjxUtil.indexOf=function(n,t,e){
if(n){
for(var a=0;
a<n.length;
a++){
var o=n[a];
if((e&&o===t)||(!e&&o==t)){
return a
}}}
return -1
};
AjxUtil.keys=function(t,e){
var a=[];
for(var o in t){
if(e&&!e(o,t)){
continue
}
a.push(o)
}
return a
};
AjxUtil.values=function(a,t){
var e=[];
for(var o in a){
if(t&&!t(o,a)){
continue
}
e.push(a[o])
}
return e
};
AjxUtil.map=function(o,a){
var e=new Array(o.length);
for(var t=0;
t<o.length;
t++){
e[t]=a?a(o[t]):o[t]
}
return e
};
AjxUtil.uniq=function(a){
var e={};
for(var t=0;
t<a.length;
t++){
e[a[t]]=true
}
return AjxUtil.keys(e)
};
AjxUtil.concat=function(t){
var a=[];
for(var e=0;
e<arguments.length;
e++){
a.push.apply(a,arguments[e])
}
return a
};
AjxUtil.union=function(e){
var t=[];
return AjxUtil.uniq(t.concat.apply(t,arguments))
};
AjxUtil.intersection=function(t){
var o=AjxUtil.concat.apply(this,arguments);
var e=AjxUtil.arrayAsHash(o,AjxUtil.__intersection_count);
for(var a in e){
if(e[a]==1){
delete e[a]
}}
return AjxUtil.keys(e)
};
AjxUtil.__intersection_count=function(t,a,e,o){
return a[t]!=null?a[t]+1:1
};
AjxUtil.complement=function(o,t){
var a=AjxUtil.arrayAsHash(o);
var e=AjxUtil.arrayAsHash(t);
for(var n in e){
if(n in a){
delete e[n]
}}
return AjxUtil.keys(e)
};
AjxUtil.getFirstElement=function(n,o,a,t){
for(var s=n.firstChild;
s;
s=s.nextSibling){
if(s.nodeType!=AjxUtil.ELEMENT_NODE){
continue
}
if(o&&s.nodeName!=o){
continue
}
if(a){
var e=s.getAttributeNode(a);
if(e.nodeName!=a){
continue
}
if(t&&e.nodeValue!=t){
continue
}}
return s
}
return null
};
AjxUtil.formatUrl=function(s){
s=s||{};
var a=[];
var o=0;
if(!s.relative){
var n=s.protocol||location.protocol;
if(n.indexOf(":")==-1){
n=n+":"
}
a[o++]=n;
a[o++]="//";
a[o++]=s.host||location.hostname;
var t=Number(s.port||location.port);
if(t&&((n==ZmSetting.PROTO_HTTP&&t!=ZmSetting.HTTP_DEFAULT_PORT)||(n==ZmSetting.PROTO_HTTPS&&t!=ZmSetting.HTTPS_DEFAULT_PORT))){
a[o++]=":";
a[o++]=t
}}
a[o++]=s.path||location.pathname;
var e="";
if(s.qsArgs){
e=AjxStringUtil.queryStringSet(s.qsArgs,s.qsReset)
}else{
e=s.qsReset?"":location.search
}
a[o++]=e;
return a.join("")
};
AjxUtil.byNumber=function(t,e){
return Number(t)-Number(e)
};
AjxUtil.LOG={};
AjxUtil.enableLogType=function(t,e){
if(e){
AjxUtil.LOG[t]=[];
AjxUtil.LOG[t].push("Log type: "+t)
}else{
AjxUtil.LOG[t]=null
}};
AjxUtil.log=function(e,t){
if(!AjxUtil.LOG[e]){
return
}
AjxUtil.LOG[e].push(t)
};
AjxUtil.mergeArrays=function(h,n,e){
if(!e){
e=function(u,d){
if(u>d){
return 1
}
if(u<d){
return -1
}
if(u==d){
return 0
}}
}
var c=[];
var o=h.length;
for(var t=0;
t<o;
t++){
c.push(h[t])
}
var s=[];
var a=n.length;
for(var t=0;
t<a;
t++){
s.push(n[t])
}
var r=[];
while(c.length>0&&s.length>0){
if(e(c[0],r[r.length-1])==0){
c.shift();
continue
}
if(e(s[0],r[r.length-1])==0){
s.shift();
continue
}
if(e(c[0],s[0])<0){
r.push(c.shift())
}else{
if(e(c[0],s[0])==0){
r.push(c.shift());
s.shift()
}else{
r.push(s.shift())
}}}
while(c.length>0){
if(e(c[0],r[r.length-1])==0){
c.shift();
continue
}
r.push(c.shift())
}
while(s.length>0){
if(e(s[0],r[r.length-1])==0){
s.shift();
continue
}
r.push(s.shift())
}
return r
};
AjxUtil.arraySubstract=function(h,n,e){
if(!e){
e=function(u,d){
if(u>d){
return 1
}
if(u<d){
return -1
}
if(u==d){
return 0
}}
}
var c=[];
var o=h.length;
for(var t=0;
t<o;
t++){
c.push(h[t])
}
var s=[];
var a=n.length;
for(var t=0;
t<a;
t++){
s.push(n[t])
}
s.sort(e);
c.sort(e);
var r=[];
while(c.length>0&&s.length>0){
if(e(c[0],s[0])==0){
c.shift();
s.shift();
continue
}
if(e(c[0],s[0])<0){
r.push(c.shift());
continue
}
if(e(c[0],s[0])>0){
s.shift();
continue
}}
while(c.length>0){
r.push(c.shift())
}
return r
};
AjxUtil.getHashKeys=function(a){
var t=[];
for(var e in a){
t.push(e)
}
t.sort();
return t
};
AjxUtil.arrayCompare=function(t,e){
if((!t||!e)&&(t!=e)){
return false
}
if(t.length!=e.length){
return false
}
for(var a=0;
a<t.length;
a++){
if(t[a]!=e[a]){
return false
}}
return true
};
AjxUtil.hashCompare=function(r,s){
var a=AjxUtil.getHashKeys(r);
var t=AjxUtil.getHashKeys(s);
if(!AjxUtil.arrayCompare(a,t)){
return false
}
for(var n=0,e=a.length;
n<e;
n++){
var o=a[n];
if(r[o]!=s[o]){
return false
}}
return true
};
AjxUtil.hashCopy=function(t){
var a={};
for(var e in t){
a[e]=t[e]
}
return a
};
AjxUtil.hashUpdate=function(o,a,e){
for(var t in a){
if(e||!(t in o)){
o[t]=a[t]
}}
return o
};
AjxUtil.toArray=function(e){
var t=Boolean(e&&(e.length!=null)&&e.splice&&e.slice);
return t?e:(e===undefined)?[]:[e]
}
}
if(AjxPackage.define("ajax.core.AjxException")){
AjxException=function(a,t,o,e){
if(arguments.length==0){
return
}
this.msg=a;
this.code=t;
this.method=o;
this.detail=e
};
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"
}
if(AjxPackage.define("ajax.util.AjxCookie")){
AjxCookie=function(){};
AjxCookie.prototype.toString=function(){
return"AjxCookie"
};
AjxCookie.getCookie=function(h,t){
var c=t+"=";
var o=c.length;
var r=h.cookie.length;
var a=h.cookie;
var s=0;
while(s<r){
var n=s+o;
if(a.substring(s,n)==c){
var e=a.indexOf(";",n);
if(e==-1){
e=a.length
}
return unescape(a.substring(n,e))
}
s=a.indexOf(" ",s)+1;
if(s==0){
break
}}
return null
};
AjxCookie.setCookie=function(r,t,o,e,s,a,n){
r.cookie=t+"="+escape(o)+((e)?"; expires="+e.toGMTString():"")+((s)?"; path="+s:"")+((a)?"; domain="+a:"")+((n)?"; secure":"")
};
AjxCookie.deleteCookie=function(o,e,a,t){
o.cookie=e+"="+((a)?"; path="+a:"")+((t)?"; domain="+t:"")+"; expires=Fri, 31 Dec 1999 23:59:59 GMT"
};
AjxCookie.areCookiesEnabled=function(o){
var e="ZM_COOKIE_TEST";
var a="Zimbra";
AjxCookie.setCookie(o,e,a);
var t=AjxCookie.getCookie(o,e);
AjxCookie.deleteCookie(o,e);
return t==a
}
}
if(AjxPackage.define("ajax.soap.AjxSoapException")){
AjxSoapException=function(a,t,o,e){
AjxException.call(this,a,t,o,e)
};
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"
}
if(AjxPackage.define("ajax.soap.AjxSoapFault")){
AjxSoapFault=function(t){
if(arguments.length==0){
return
}
var r=t.prefix;
var s=r+":Code";
var n=r+":Reason";
var a=r+":Detail";
var h=t.childNodes.length;
for(var o=0;
o<h;
o++){
var e=t.childNodes[o];
if(e.nodeName==s){
var c=e.firstChild.firstChild.nodeValue;
if(c==(r+":VersionMismatch")){
this.faultCode=AjxSoapFault.VERSION_MISMATCH
}else{
if(c==(r+":MustUnderstand")){
this.faultCode=AjxSoapFault.MUST_UNDERSTAND
}else{
if(c==(r+":DataEncodingUnknown")){
this.faultCode=AjxSoapFault.DATA_ENCODING_UNKNOWN
}else{
if(c==(r+":Sender")){
this.faultCode=AjxSoapFault.SENDER
}else{
if(c==(r+":Receiver")){
this.faultCode=AjxSoapFault.RECEIVER
}else{
this.faultCode=AjxSoapFault.UNKNOWN
}}}}}}else{
if(e.nodeName==n){
this.reason=e.firstChild.firstChild.nodeValue
}else{
if(e.nodeName==a){
this.errorCode=e.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
}
if(AjxPackage.define("ajax.soap.AjxSoapDoc")){
AjxSoapDoc=function(){
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(e,a,h,r){
var s=new AjxSoapDoc();
s._xmlDoc=AjxXmlDoc.create();
var n=s._xmlDoc.getDoc();
if(!r){
r=AjxSoapDoc._SOAP_URI
}
s._soapURI=r;
var t=n.createElementNS&&!AjxEnv.isSafari;
var o=t?n.createElementNS(r,"soap:Envelope"):n.createElement("soap:Envelope");
if(!t){
o.setAttribute("xmlns:soap",r)
}
n.appendChild(o);
var c=t?n.createElementNS(r,"soap:Body"):n.createElement("soap:Body");
o.appendChild(c);
s._methodEl=a&&t?n.createElementNS(a,e):n.createElement(e);
if(a!=null&&!t){
if(h==null){
s._methodEl.setAttribute("xmlns",a)
}else{
s._methodEl.setAttribute("xmlns:"+h,a)
}}
c.appendChild(s._methodEl);
return s
};
AjxSoapDoc.createFromDom=function(t){
var e=new AjxSoapDoc();
e._xmlDoc=AjxXmlDoc.createFromDom(t);
e._methodEl=e._check(e._xmlDoc);
return e
};
AjxSoapDoc.createFromXml=function(e){
var t=new AjxSoapDoc();
t._xmlDoc=AjxXmlDoc.createFromXml(e);
t._methodEl=t._check(t._xmlDoc);
return t
};
AjxSoapDoc.element2FaultObj=function(t){
var e=t.firstChild;
if(!AjxEnv.isSafari){
if(e!=null&&e.namespaceURI!=AjxSoapDoc._SOAP_URI||e.nodeName!=(t.prefix+":Fault")){
return null
}}else{
if(e!=null&&e.nodeName!=(t.prefix+":Fault")){
return null
}}
return new AjxSoapFault(e)
};
AjxSoapDoc.prototype.setMethodAttribute=function(e,t){
this._methodEl.setAttribute(e,t)
};
AjxSoapDoc.prototype.set=function(t,c,d,n){
var h=this.getDoc();
var e=h.createElementNS&&!AjxEnv.isSafari;
var a=t?(n&&e?h.createElementNS(n,t):h.createElement(t)):h.createDocumentFragment();
if(n&&!e){
a.setAttribute("xmlns",n)
}
if(c!=null){
if(typeof c=="object"){
for(var r in c){
var o=c[r];
if(r.charAt(0)=="!"){
a.setAttribute(r.substr(1),o)
}else{
if(o instanceof Array){
for(var s=0;
s<o.length;
++s){
this.set(r,o[s],a)
}}else{
this.set(r,o,a)
}}}}else{
a.appendChild(h.createTextNode(c))
}}
if(!d){
d=this._methodEl
}
return d.appendChild(a)
};
AjxSoapDoc.prototype.getMethod=function(){
return this._methodEl
};
AjxSoapDoc.prototype.createHeaderElement=function(){
var a=this._xmlDoc.getDoc();
var t=a.firstChild;
var o=this.getHeader();
if(o!=null){
throw new AjxSoapException("SOAP header already exists",AjxSoapException.ELEMENT_EXISTS,"AjxSoapDoc.prototype.createHeaderElement")
}
var e=a.createElementNS&&!AjxEnv.isSafari;
o=e?a.createElementNS(this._soapURI,"soap:Header"):a.createElement("soap:Header");
t.insertBefore(o,t.firstChild);
return o
};
AjxSoapDoc.prototype.getHeader=function(){
var t=this._xmlDoc.getDoc();
var e=AjxEnv.isIE?(t.getElementsByTagName(t.firstChild.prefix+":Header")):(t.getElementsByTagNameNS(this._soapURI,"Header"));
return e?e[0]:null
};
AjxSoapDoc.prototype.getBody=function(){
var t=this._xmlDoc.getDoc();
var e=AjxEnv.isIE?(t.getElementsByTagName(t.firstChild.prefix+":Body")):(t.getElementsByTagNameNS(this._soapURI,"Body"));
return e?e[0]:null
};
AjxSoapDoc.prototype.getByTagName=function(t){
if(t.indexOf(":")==-1){
t="soap:"+t
}
var e=this.getDoc().getElementsByTagName(t);
if(e.length==1){
return e[0]
}else{
if(e.length>0){
return e
}else{
return null
}}};
AjxSoapDoc.prototype.ensureHeader=function(){
return(this.getHeader()||this.createHeaderElement())
};
AjxSoapDoc.prototype.getDoc=function(){
return this._xmlDoc.getDoc()
};
AjxSoapDoc.prototype.adoptNode=function(t){
if(AjxEnv.isFirefox3up||!AjxEnv.isFirefox){
try{
var a=this.getDoc();
if(a.adoptNode){
return a.adoptNode(t,true)
}}
catch(e){}}
return t.parentNode.removeChild(t)
};
AjxSoapDoc.prototype.getXml=function(){
return AjxEnv.isSafari||AjxEnv.isOpera?(AjxXmlDoc.getXml(this._xmlDoc.getDoc())):AjxXmlDoc.replaceInvalidChars(this._xmlDoc.getDoc().xml)
};
AjxSoapDoc.prototype._check=function(t){
var a=t.getDoc();
if(a.childNodes.length!=1){
throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:1")
}
var e=a.firstChild;
if(!AjxEnv.isSafari){
if(e.namespaceURI!=AjxSoapDoc._SOAP_URI||e.nodeName!=(e.prefix+":Envelope")||(e.childNodes.length<1||e.childNodes.length>2)){
throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:2")
}}else{
if(e.nodeName!=(e.prefix+":Envelope")){
throw new AjxSoapException("Invalid SOAP PDU",AjxSoapException.INVALID_PDU,"AjxSoapDoc.createFromXml:2")
}}}
}
if(AjxPackage.define("ajax.net.AjxRpcRequest")){
AjxRpcRequest=function(e){
if(!AjxRpcRequest.__inited){
AjxRpcRequest.__init()
}
this.id=e;
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(a,t,s,d,h,r){
var e=(d!=null);
this.__httpReq.open((h)?"get":"post",t,e);
if(e){
if(r){
var o=new AjxTimedAction(this,this.__handleTimeout,[d]);
d._timedActionId=AjxTimedAction.scheduleAction(o,r)
}
var c=this;
this.__httpReq.onreadystatechange=function(u){
if(window.AjxRpcRequest){
AjxRpcRequest.__handleResponse(c,d)
}}
}else{
this.__httpReq.onreadystatechange=function(u){}
}
if(s){
for(var n in s){
this.__httpReq.setRequestHeader(n,s[n])
}}
this.__httpReq.send(a);
if(e){
return this.id
}else{
if(this.__httpReq.status==200||this.__httpReq.status==201){
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(){
AjxRpc.freeRpcCtxt(this);
this.__httpReq.abort()
};
AjxRpcRequest.prototype.__handleTimeout=function(e){
this.cancel();
e.run({
text:null,xml:null,success:false,status:AjxRpcRequest.TIMEDOUT}
)
};
AjxRpcRequest.__handleResponse=function(a,o){
if(!a||!a.__httpReq){
a.cancel();
o.run({
text:null,xml:null,success:false,status:500}
);
return
}
if(a.__httpReq.readyState==4){
if(o._timedActionId!==null){
AjxTimedAction.cancelAction(o._timedActionId)
}
var e=500;
try{
e=a.__httpReq.status
}
catch(t){}
if(e==200||e==201){
o.run({
text:a.__httpReq.responseText,xml:a.__httpReq.responseXML,success:true,reqId:a.id}
)
}else{
o.run({
text:a.__httpReq.responseText,xml:a.__httpReq.responseXML,success:false,status:e,reqId:a.id}
)
}
a.cancel()
}};
AjxRpcRequest.__init=function(){
if(!window.XMLHttpRequest&&window.ActiveXObject){
var t=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
for(var o=0;
o<t.length;
o++){
try{
var e=new ActiveXObject(t[o]);
AjxRpcRequest.__msxmlVers=t[o];
break
}
catch(a){}}
if(!AjxRpcRequest.__msxmlVers){
throw new AjxException("MSXML not installed",AjxException.INTERNAL_ERROR,"AjxRpc._init")
}}
AjxRpcRequest.__inited=true
}
}
if(AjxPackage.define("ajax.net.AjxRpc")){
AjxRpc=function(){};
AjxRpc.__rpcCache=[];
AjxRpc.__rpcOutstanding={};
AjxRpc.__RPC_CACHE_MAX=50;
AjxRpc.__RPC_COUNT=0;
AjxRpc.__RPC_REAP_AGE=300000;
AjxRpc.invoke=function(a,t,s,u,d,c){
var e=(u!=null);
var n=AjxRpc.__getFreeRpcCtxt();
try{
var o=n.invoke(a,t,s,u,d,c)
}
catch(r){
var h=new AjxException();
h.method="AjxRpc.prototype._invoke";
if(r instanceof Error){
h.detail=r.message;
h.code=AjxException.NETWORK_ERROR;
h.msg="Network error"
}else{
h.detail=r.toString();
h.code=AjxException.UNKNOWN_ERROR;
h.msg="Unknown Error"
}
if(!e){
AjxRpc.freeRpcCtxt(n)
}
throw h
}
if(!e){
AjxRpc.freeRpcCtxt(n)
}
return o
};
AjxRpc.freeRpcCtxt=function(e){
if(AjxRpc.__rpcOutstanding[e.id]){
AjxRpc.__rpcCache.push(e);
delete AjxRpc.__rpcOutstanding[e.id]
}};
AjxRpc.getRpcRequestById=function(e){
return(AjxRpc.__rpcOutstanding[e])
};
AjxRpc.__getFreeRpcCtxt=function(){
var e;
if(AjxRpc.__rpcCache.length>0){
e=AjxRpc.__rpcCache.pop()
}else{
if(AjxRpc.__RPC_COUNT<AjxRpc.__RPC_CACHE_MAX){
var t="__RpcCtxt_"+AjxRpc.__RPC_COUNT;
e=new AjxRpcRequest(t);
AjxRpc.__RPC_COUNT++
}else{
e=AjxRpc.__reap();
if(!e){
throw new AjxException("Out of RPC cache",AjxException.OUT_OF_RPC_CACHE,"AjxRpc.__getFreeRpcCtxt")
}}}
AjxRpc.__rpcOutstanding[e.id]=e;
e.timestamp=(new Date()).getTime();
return e
};
AjxRpc.__reap=function(){
var e;
var a=(new Date()).getTime();
for(var t in AjxRpc.__rpcOutstanding){
e=AjxRpc.__rpcOutstanding[t];
if(e.timestamp+AjxRpc.__RPC_REAP_AGE<a){
e.cancel();
delete AjxRpc.__rpcOutstanding[t];
return e
}}
return null
}
}
if(AjxPackage.define("ajax.util.AjxVector")){
AjxVector=function(){
this._array=new Array()
};
AjxVector.prototype.toString=function(n,t){
if(t!==true){
return this._array.join(n)
}
var o=new Array();
for(var s=0;
s<this._array.length;
s++){
var e=this._array[s];
if(e!=undefined&&e!=null&&e!=""){
o.push(e)
}}
return o.join(n)
};
AjxVector.fromArray=function(t){
var e=new AjxVector();
e._array.length=0;
if(t instanceof Array){
e._array=t
}
return e
};
AjxVector.prototype.size=function(){
return this._array.length
};
AjxVector.prototype.add=function(a,e,t){
if(t&&this.contains(a)){
return
}
AjxUtil.arrayAdd(this._array,a,e)
};
AjxVector.prototype.addList=function(a){
if(!a){
return
}
if(a.length){
this._array=this._array.concat(a)
}else{
if(a.size&&a.size()){
if(AjxEnv.isIE&&(!(a._array instanceof Array))){
var t=[];
for(var e=0;
e<a._array.length;
e++){
t.push(a._array[e])
}
a._array=t
}
this._array=this._array.concat(a._array)
}}};
AjxVector.prototype.remove=function(e){
return AjxUtil.arrayRemove(this._array,e)
};
AjxVector.prototype.removeAt=function(t){
if(t>=this._array.length||t<0){
return null
}
var a=this._array.splice(t,1);
var e=null;
if(a){
e=a[0]
}
return e
};
AjxVector.prototype.removeAll=function(){
for(var e=0;
e<this._array.length;
e++){
this._array[e]=null
}
this._array.length=0
};
AjxVector.prototype.removeLast=function(){
return this._array.length>0?this._array.pop():null
};
AjxVector.prototype.reverse=function(){
this._array.reverse()
};
AjxVector.prototype.replace=function(a,t){
var e=this._array[a];
this._array[a]=t;
return e
};
AjxVector.prototype.replaceObject=function(a,e){
for(var t=0;
t<this._array.length;
t++){
if(this._array[t]==a){
this._array[t]=e;
return a
}}
return null
};
AjxVector.prototype.indexOf=function(t){
if(t==null){
return -1
}
for(var e=0;
e<this._array.length;
e++){
if(this._array[e]==t){
return e
}}
return -1
};
AjxVector.prototype.indexOfLike=function(o,a){
var t=a.call(o);
for(var e=0;
e<this._array.length;
e++){
var n=a.call(this._array[e]);
if(n==t){
return e
}}
return -1
};
AjxVector.prototype.clone=function(){
var e=new AjxVector();
e.addList(this);
return e
};
AjxVector.prototype.contains=function(t){
for(var e=0;
e<this._array.length;
e++){
if(this._array[e]==t){
return true
}}
return false
};
AjxVector.prototype.containsLike=function(o,a){
var t=a.call(o);
for(var e=0;
e<this._array.length;
e++){
var n=a.call(this._array[e]);
if(n==t){
return true
}}
return false
};
AjxVector.prototype.get=function(e){
return e>=this._array.length||e<0?null:this._array[e]
};
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(t){
var e=this.indexOf(t);
if(e==-1){
return null
}
return this.get(++e)
};
AjxVector.prototype.getPrev=function(t){
var e=this.indexOf(t);
if(e==-1){
return null
}
return this.get(--e)
};
AjxVector.prototype.sort=function(e){
if(!e){
e=AjxVector._defaultArrayComparator
}
this._array.sort(e)
};
AjxVector.prototype.binarySearch=function(s,r){
if(!r){
r=AjxVector._defaultArrayComparator
}
var a=0;
var e=this._array;
var o=e.length-1;
while(true){
if(o<a){
return -1
}
var n=Math.floor((a+o)/2);
var t=r(s,e[n]);
if(t<0){
o=n-1
}else{
if(t>0){
a=n+1
}else{
return n
}}}};
AjxVector.prototype.merge=function(n,o){
if(n<0){
return
}
var s=o instanceof AjxVector?o.getArray():o;
var e=this._array.length<(n+s.length)?this._array.length:n+s.length;
if(n<this._array.length){
var a=0;
for(var t=n;
t<e;
t++){
this._array[t]=s[a++]
}
if(a<s.length){
this._array=this._array.concat(s.slice(a))
}}else{
this._array=this._array.concat(s)
}};
AjxVector._defaultArrayComparator=function(t,e){
return t<e?-1:(t>e?1:0)
};
AjxVector.prototype.foreach=function(o,n){
var e=this.size(),t=0,a;
if(typeof o=="function"){
while(--e>=0){
o.call(n,this.get(t),t++)
}}else{
while(--e>=0){
a=this.get(t++);
if(a!=null){
a[o].call(a)
}}}};
AjxVector.prototype.map=function(n,s){
var e=[],t=this.size(),o;
if(typeof n=="function"){
while(--t>=0){
e[t]=n.call(s,this.get(t),t)
}}else{
if(n instanceof AjxCallback){
while(--t>=0){
e[t]=n.run(this.get(t),t)
}}else{
while(--t>=0){
o=this.get(t);
if(o!=null){
if(typeof o[n]=="function"){
e.unshift(o[n].call(o))
}else{
e.unshift(o[n])
}}}}}
return AjxVector.fromArray(e)
};
AjxVector.prototype.join=function(e){
return this._array.join(e)
};
AjxVector.prototype.sub=function(s,r){
var t=[],e=this.size(),o=0,n;
while(--e>=0){
n=this.get(o++);
if(!s.call(r,n,o)){
t.push(n)
}}
return AjxVector.fromArray(t)
}
}
if(AjxPackage.define("ajax.util.AjxStringUtil")){
AjxStringUtil=function(){};
AjxStringUtil.TRIM_RE=/^\s+|\s+$/g;
AjxStringUtil.COMPRESS_RE=/\s+/g;
AjxStringUtil.ELLIPSIS=" ... ";
AjxStringUtil.makeString=function(e){
return e?String(e):""
};
AjxStringUtil.capitalize=function(e){
return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()
};
AjxStringUtil.toMixed=function(s,e,o){
if(!s||(typeof s!="string")){
return""
}
e=e||/\s+/;
var a=s.split(e);
var n=[];
n.push(o?a[0].toLowerCase():a[0].substring(0,1).toUpperCase()+a[0].substring(1).toLowerCase());
for(var t=1;
t<a.length;
t++){
n.push(a[t].substring(0,1).toUpperCase()+a[t].substring(1).toLowerCase())
}
return n.join("")
};
AjxStringUtil.trim=function(n,e,o){
if(!n){
return""
}
var a=AjxStringUtil.TRIM_RE;
var t=AjxStringUtil.COMPRESS_RE;
if(o){
a=new RegExp("^"+o+"+|"+o+"+$","g");
t=new RegExp(o+"+","g")
}else{
o=" "
}
n=n.replace(a,"");
if(e){
n=n.replace(t,o)
}
return n
};
AjxStringUtil.repeat=function(o,e){
var a="";
for(var t=0;
t<e;
t++){
a+=o
}
return a
};
AjxStringUtil.getUnitsFromSizeString=function(t){
var a="px";
if(typeof(t)=="string"){
var e=Number(parseInt(t,10)).toString();
if(t.length>e.length){
a=t.substr(e.length,(t.length-e.length));
if(!(a=="em"||a=="ex"||a=="px"||a=="in"||a=="cm"==a=="mm"||a=="pt"||a=="pc"||a=="%")){
a="px"
}}}
return a
};
AjxStringUtil.split=function(d,o){
if(!d){
return[]
}
var s=0;
o=o?o:",";
var m=new Object();
if(typeof o=="string"){
m[o]=1
}else{
for(s=0;
s<o.length;
s++){
m[o[s]]=1
}}
var e=false;
var a=0;
var t=0;
var u;
var r=[];
var n=0;
for(s=0;
s<d.length;
s++){
var h=d.charAt(s);
if(h=='"'){
e=!e
}else{
if(h=="("){
a++
}else{
if(h==")"){
a--
}else{
if(m[h]){
if(!e&&!a){
u=d.substring(t,s);
r[n++]=u;
t=s+1
}}}}}}
u=d.substring(t,d.length);
r[n++]=u;
return r
};
AjxStringUtil.wordWrap=function(M){
if(!(M&&M.text)){
return""
}
var g=M.text;
var y=M.before||"",t=M.after||"";
if(M.htmlMode){
return[y,g,t].join("")
}
var C=M.len||80;
var q=M.pre||"";
var n="\n";
g=AjxStringUtil.trim(g);
g=g.replace(/\n\r/g,n);
var e=g.split(n);
var x=[];
for(var T=0,F=e.length;
T<F;
T++){
var c=AjxStringUtil.trim(e[T]);
var j=c.match(/^([\s>\|]+)/);
var O=j?j[1]:"";
if(O){
c=c.substr(O.length)
}
c=c.replace(/\s+/g," ");
var r=c.split(" ");
if(r&&r[0]&&r[0].length){
var z=AjxStringUtil.MSG_SEP_RE.test(c)||AjxStringUtil.COLON_RE.test(c)||AjxStringUtil.HDR_RE.test(c)||AjxStringUtil.SIG_RE.test(c);
for(var d=0,f=r.length;
d<f;
d++){
var s=M.preserveReturns&&(d==f-1);
x.push({
w:r[d],p:O,special:(z&&d==0),lastWord:s}
)
}}else{
x.push({
para:true,p:O}
)
}}
var B=M.len||72;
var o=M.pre||"";
var u=o.length;
var h="",a=0,r=[],v=null;
for(var W=0,C=x.length;
W<C;
W++){
var D=x[W];
var d=D.w,k=D.p;
var A=r.length?1:0;
var S=(v===null)?0:v.length;
if(D.para){
if(r.length){
h+=o+(v||"")+r.join(" ")+n
}
h+=o+k+n;
r=[];
a=0;
v=null
}else{
if((u+S+a+A+d.length<=B)&&(k==v||v===null)&&!D.special){
r.push(d);
a+=d.length+A;
v=k;
if(D.lastWord&&x[W+1]){
x[W+1].special=true
}}else{
if(r.length){
h+=o+(v||"")+r.join(" ")+n
}
r=[d];
a=d.length;
v=k
}}}
if(r.length){
h+=o+v+r.join(" ")+n
}
return[y,h,t].join("")
};
AjxStringUtil.IS_PRINT_CODE={};
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(e){
return AjxStringUtil.IS_PRINT_CODE[e]
};
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(e,t){
return t?AjxStringUtil.SHIFT_CHAR[e]||String.fromCharCode(e):String.fromCharCode(e)
};
AjxStringUtil.diffPoint=function(o,a){
if(!(o&&a)){
return 0
}
var e=Math.min(o.length,a.length);
var t=0;
while(t<e&&(o.charAt(t)==a.charAt(t))){
t++
}
return t
};
AjxStringUtil.resolve=function(t,e){
return AjxMessageFormat.format(t,e)
};
AjxStringUtil.urlEncode=function(t){
if(!t){
return""
}
var e=window.encodeURL||window.encodeURI;
return e(t)
};
AjxStringUtil.urlComponentEncode=function(t){
if(!t){
return""
}
var e=window.encodeURLComponent||window.encodeURIComponent;
return e(t)
};
AjxStringUtil.urlDecode=function(t){
if(!t){
return""
}
var e=window.decodeURL||window.decodeURI;
return e(t)
};
AjxStringUtil.urlComponentDecode=function(n){
if(!n){
return""
}
var a=window.decodeURLComponent||window.decodeURIComponent;
var t;
try{
t=a(n)
}
catch(o){
t=unescape(n)
}
return t||n
};
AjxStringUtil.ENCODE_MAP={
">":"&gt;","<":"&lt;","&":"&amp;"};
AjxStringUtil.htmlEncode=function(t,e){
if(!t){
return""
}
if(!AjxEnv.isSafari||AjxEnv.isSafariNightly){
if(e){
return t.replace(/[<>&]/g,function(a){
return AjxStringUtil.ENCODE_MAP[a]
}
).replace(/  /g," &nbsp;")
}else{
return t.replace(/[<>&]/g,function(a){
return AjxStringUtil.ENCODE_MAP[a]
}
)
}}else{
if(e){
return t.replace(/[&]/g,"&amp;").replace(/  /g," &nbsp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;")
}else{
return t.replace(/[&]/g,"&amp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;")
}}};
AjxStringUtil.htmlDecode=function(t,e){
if(e){
t=t.replace(/&nbsp;/g," ")
}
return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")
};
AjxStringUtil.stripTags=function(t,e){
if(!t){
return""
}
if(e){
t=t.replace(/(<(\w+)[^>]*>).*(<\/\2[^>]*>)/,"$1$3")
}
return t.replace(/<\/?[^>]+>/gi,"")
};
AjxStringUtil.convertToHtml=function(e){
if(!e){
return""
}
e=e.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 e
};
AjxStringUtil.SPACE_ENCODE_MAP={
" ":"&nbsp;",">":"&gt;","<":"&lt;","&":"&amp;","\n":"<br>"};
AjxStringUtil.htmlEncodeSpace=function(e){
if(!e){
return""
}
return e.replace(/[&]/g,"&amp;").replace(/ /g,"&nbsp;").replace(/[<]/g,"&lt;").replace(/[>]/g,"&gt;")
};
AjxStringUtil.nl2br=function(e){
if(!e){
return""
}
return e.replace(/^ /mg,"&nbsp;").replace(/\t/mg,"<span style='white-space:pre'>\t</span>").replace(/\n/g,"<br>")
};
AjxStringUtil.xmlEncode=function(e){
if(e){
e=""+e;
return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")
}
return""
};
AjxStringUtil.xmlDecode=function(e){
return e?e.replace(/&amp;/g,"&").replace(/&lt;/g,"<"):""
};
AjxStringUtil.xmlAttrEncode=function(e){
return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\x22/g,"&quot;").replace(/\x27/g,"&apos;"):""
};
AjxStringUtil.xmlAttrDecode=function(e){
return e?e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&apos;/g,"'"):""
};
AjxStringUtil.__RE_META={
" ":" ","\n":"\\n","\r":"\\r","\t":"\\t"};
AjxStringUtil.__reMetaEscape=function(t,e){
return AjxStringUtil.__RE_META[e]||"\\"+e
};
AjxStringUtil.regExEscape=function(e){
return e.replace(/(\W)/g,AjxStringUtil.__reMetaEscape)
};
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(e,s,n){
var o=AjxStringUtil.calcDIV();
if(arguments.length==3){
o.className=n
}
o.innerHTML=e;
if(o.offsetWidth<=s){
return e
}
for(var a=e.length-1;
a>0;
a--){
var t=e.substr(0,a);
o.innerHTML=t+AjxStringUtil.ELLIPSIS;
if(o.offsetWidth<=s){
return t+AjxStringUtil.ELLIPSIS
}}
return e
};
AjxStringUtil.clipByLength=function(a,t){
var e=a.length;
return(e<=t)?a:[a.substr(0,t/2),"...",a.substring(e-((t/2)-3),e)].join("")
};
AjxStringUtil.wrap=function(s,r,h){
var f=AjxStringUtil.calcDIV();
if(arguments.length==3){
f.className=h
}
var c="";
var n="";
var e=s.split("/n");
for(var o=0;
o<e.length;
o++){
if(o!=0){
c+=n+"<br>";
n=""
}
htmlRows=e[o].split("<br>");
for(var u=0;
u<htmlRows.length;
u++){
if(u!=0){
c+=n+"<br>";
n=""
}
words=htmlRows[u].split(" ");
var m=0;
while(m<words.length){
f.innerHTML=n+" "+words[m];
var a=f.offsetWidth;
if(a>r){
f.innerHTML=words[m];
a=a-f.offsetWidth;
if((a>=r)||(f.offsetWidth<=r)){
c+=n+"<br>";
n=""
}else{
var d=true;
var t=0;
while(d){
t++;
f.innerHTML=n+" "+words[m].substring(0,t);
d=(f.offsetWidth<=r)
}
t--;
c+=n+words[m].substring(0,t)+"<br>";
words[m]=words[m].substr(t);
n=""
}}else{
n+=" "+words[m];
m++
}}}}
c+=n;
return c
};
AjxStringUtil.MSG_SEP_RE=new RegExp("^\\s*--+\\s*("+AjxMsg.origMsg+"|"+AjxMsg.forwardedMessage+")\\s*--+","i");
AjxStringUtil.SIG_RE=/^(- ?-+)|(__+)\r?$/;
AjxStringUtil.COLON_RE=/\S+:$/;
AjxStringUtil.PREFIX_RE=/^\s*(&gt;|>|\|)/;
AjxStringUtil.BRACKET_RE=/^\s*\[.+\]\s*$/;
AjxStringUtil.LINE_RE=/^\s*_{30,}\s*$/;
AjxStringUtil.BLANK_RE=/^\s*$/;
AjxStringUtil.SPLIT_RE=/\r\n|\r|\n/;
AjxStringUtil.HDR_RE=/^\s*\w+:/;
AjxStringUtil.HTML_BLANK_RE=/^\s*(<br\s*\/?>)*\s*$/i;
AjxStringUtil.HTML_BR_RE=/<br\s*\/?>/gi;
AjxStringUtil.HTML_BODY_RE=/<body(\s|>)/i;
AjxStringUtil.HTML_QUOTE_PRE_RE=/^\s*<blockquote/i;
AjxStringUtil.HTML_QUOTE_POST_RE=/^\s*<\/blockquote>/i;
AjxStringUtil.HTML_QUOTE_COLOR="rgb(16, 16, 255)";
AjxStringUtil.getTopLevel=function(f,h,t){
var e=/<br|<div/i.test(f);
var c=e?AjxStringUtil.HTML_BR_RE:AjxStringUtil.SPLIT_RE;
var h=e?"<br>":"\n";
f=AjxStringUtil._trimBlankLines(f,c,h,e);
var p=f.split(c);
var s=p.length;
var o=0,a=0;
var n=[];
var r=false;
while(o<s){
var m=r;
var u=AjxStringUtil._linesToSkip(p,o,t);
r=(u>0);
if(m&&!r){
a=o
}else{
if(!m&&r&&o>a){
var d=AjxStringUtil._trimBlankLines(p.slice(a,o).join(h),c,h,t);
if(d&&d.length){
n.push(d)
}}}
o+=r?u:1
}
if(!r&&o>a){
var d=AjxStringUtil._trimBlankLines(p.slice(a,o).join(h),c,h,t);
if(d&&d.length){
n.push(d)
}}
return n
};
AjxStringUtil._linesToSkip=function(c,a,e){
var o=c.length;
var h=0;
var t=a;
var d=e?AjxStringUtil.stripTags(c[a]):c[a];
if(AjxStringUtil.MSG_SEP_RE.test(d)){
h=o-a
}else{
if(AjxStringUtil.PREFIX_RE.test(d)){
while(a<c.length&&(AjxStringUtil.PREFIX_RE.test(d)||AjxStringUtil.BLANK_RE.test(d))){
a++;
d=e?AjxStringUtil.stripTags(c[a]):c[a]
}
h=a-t
}else{
if(AjxStringUtil.HTML_QUOTE_PRE_RE.test(d)&&d.indexOf(AjxStringUtil.HTML_QUOTE_COLOR)!=-1){
while(a<c.length&&(!AjxStringUtil.HTML_QUOTE_POST_RE.test(d))){
a++;
d=c[a]
}
if(a<c.length){
c[a]=c[a].replace(AjxStringUtil.HTML_QUOTE_POST_RE,"")
}
h=a-t
}else{
if(AjxStringUtil.COLON_RE.test(d)){
var s=AjxStringUtil._nextNonBlankLineIndex(c,a+1,e);
var r=(s==-1)?null:e?AjxStringUtil.stripTags(c[s]):c[s];
if(r&&AjxStringUtil.PREFIX_RE.test(r)){
h=s-a
}else{
if(s!=-1){
s=AjxStringUtil._nextNonBlankLineIndex(c,s+1,e)
}
var n=(s==-1)?null:e?AjxStringUtil.stripTags(c[s]):c[s];
if(n&&AjxStringUtil.BRACKET_RE.test(r)&&AjxStringUtil.PREFIX_RE.test(n)){
h=s-a
}}}else{
if(AjxStringUtil.LINE_RE.test(d)){
var s=AjxStringUtil._nextNonBlankLineIndex(c,a+1,e);
var r=(s==-1)?null:e?AjxStringUtil.stripTags(c[s]):c[s];
if(r&&AjxStringUtil.HDR_RE.test(r)){
h=o-a
}}else{
if(AjxStringUtil.SIG_RE.test(d)){
h=o-a
}}}}}}
return h
};
AjxStringUtil._nextNonBlankLineIndex=function(e,t,a){
while(t<e.length&&AjxStringUtil.BLANK_RE.test(a?AjxStringUtil.stripTags(e[t]):e[t])){
t++
}
return((t<e.length)?t:-1)
};
AjxStringUtil._trimBlankLines=function(r,s,n,e){
var c=r.split(s);
var o=c.length;
var h=e?AjxStringUtil.HTML_BLANK_RE:AjxStringUtil.BLANK_RE;
var a=0;
while(a<o&&h.test(c[a])){
a++
}
var t=o;
while(t>0&&h.test(c[t-1])){
t--
}
if(a!=0||t!=o){
r=c.slice(a,t).join(n)+n
}
if(e&&AjxStringUtil.HTML_BODY_RE.test(r)){
r=r.replace(/<body\s*[^>]*>(<br\s*\/?>)+/i,"<body>");
r=r.replace(/(<br\s*\/?>)+<\/body>/i,"</body>")
}
return r
};
AjxStringUtil._NO_LIST=0;
AjxStringUtil._ORDERED_LIST=1;
AjxStringUtil._UNORDERED_LIST=2;
AjxStringUtil._INDENT="    ";
AjxStringUtil._NON_WHITESPACE=/\S+/;
AjxStringUtil._LF=/\n/;
AjxStringUtil.convertHtml2Text=function(a){
if(!a){
return null
}
if(typeof a=="string"){
var o=document.createElement("SPAN");
o.innerHTML=a;
a=o
}
var n=[];
var t=0;
var e={};
this._traverse(a,n,t,AjxStringUtil._NO_LIST,0,0,e);
return n.join("")
};
AjxStringUtil._traverse=function(e,m,d,c,r,n,s){
var h=e.nodeName.toLowerCase();
if(h=="#text"){
if(e.nodeValue.search(AjxStringUtil._NON_WHITESPACE)!=-1){
if(s.lastNode=="ol"||s.lastNode=="ul"){
m[d++]="\n"
}
if(s.isPreformatted){
m[d++]=AjxStringUtil.trim(e.nodeValue)+" "
}else{
m[d++]=AjxStringUtil.trim(e.nodeValue.replace(AjxStringUtil._LF," "),true)+" "
}}}else{
if(h=="p"){
m[d++]="\n\n"
}else{
if(c==AjxStringUtil._NO_LIST&&(h=="br"||h=="hr")){
m[d++]="\n"
}else{
if(h=="ol"||h=="ul"){
m[d++]="\n";
if(e.parentNode.nodeName.toLowerCase()!="li"&&s.lastNode!="br"&&s.lastNode!="hr"){
m[d++]="\n"
}
c=(h=="ol")?AjxStringUtil._ORDERED_LIST:AjxStringUtil._UNORDERED_LIST;
r++;
n=0
}else{
if(h=="li"){
for(var a=0;
a<r;
a++){
m[d++]=AjxStringUtil._INDENT
}
if(c==AjxStringUtil._ORDERED_LIST){
m[d++]=n+". "
}else{
m[d++]="\u2022 "
}}else{
if(h=="img"){
if(e.alt&&e.alt!=""){
m[d++]=e.alt
}}else{
if(h=="tr"&&e.parentNode.firstChild!=e){
m[d++]="\n"
}else{
if(h=="td"&&e.parentNode.firstChild!=e){
m[d++]="\t"
}else{
if(h=="div"){
m[d++]="\n"
}else{
if(h=="blockquote"){
m[d++]="\n\n"
}else{
if(h=="pre"){
s.isPreformatted=true
}else{
if(h=="#comment"||h=="script"||h=="select"||h=="style"){
return d
}}}}}}}}}}}}
var u=e.childNodes;
var o=u.length;
for(var a=0;
a<o;
a++){
var t=u[a];
if(t.nodeType==1&&t.tagName.toLowerCase()=="li"){
n++
}
d=this._traverse(t,m,d,c,r,n,s)
}
if(h=="h1"||h=="h2"||h=="h3"||h=="h4"||h=="h5"||h=="h6"){
m[d++]="\n";
s.list=false
}else{
if(h=="pre"){
s.isPreformatted=false
}else{
if(h=="li"){
if(!s.list){
m[d++]="\n"
}
s.list=false
}else{
if(h=="ol"||h=="ul"){
s.list=true
}else{
if(h!="#text"){
s.list=false
}}}}}
s.lastNode=h;
return d
};
AjxStringUtil.queryStringSet=function(r,c){
var h=c?"":location.search;
if(h.indexOf("?")==0){
h=h.substr(1)
}
var s=h.split("&");
var a={};
for(var o=0;
o<s.length;
o++){
var n=s[o].split("=");
a[n[0]]=n[1]
}
for(var e in r){
a[e]=r[e]
}
var t=[];
var o=0;
for(var e in a){
if(e){
t[o++]=[e,a[e]].join("=")
}}
return"?"+t.join("&")
};
AjxStringUtil.queryStringRemove=function(e,a){
e=e?e:"";
if(e.indexOf("?")==0){
e=e.substr(1)
}
var n=e.split("&");
var t=[];
for(var o=0;
o<n.length;
o++){
if(n[o].indexOf(a)!=0){
t.push(n[o])
}}
return"?"+t.join("&")
};
AjxStringUtil.getAsString=function(e){
return !e?"":(typeof(e)=="object")?e.toString():e
};
AjxStringUtil.isWhitespace=function(e){
return(e.charCodeAt(0)<=32)
};
AjxStringUtil.isDigit=function(t){
var e=t.charCodeAt(0);
return(e>=48&&e<=57)
};
AjxStringUtil.compareRight=function(n,t){
var s=0;
var h=0;
var r=0;
var o;
var e;
for(;
(h<n.length||r<t.length);
h++,r++){
o=n.charAt(h);
e=t.charAt(r);
if(!AjxStringUtil.isDigit(o)&&!AjxStringUtil.isDigit(e)){
return s
}else{
if(!AjxStringUtil.isDigit(o)){
return -1
}else{
if(!AjxStringUtil.isDigit(e)){
return +1
}else{
if(o<e){
if(s==0){
s=-1
}}else{
if(o>e){
if(s==0){
s=+1
}}}}}}}};
AjxStringUtil.natCompare=function(c,h){
var r=0,n=0;
var t=0,e=0;
var s,o;
while(r<c.length||n<h.length){
t=e=0;
s=c.charAt(r);
o=h.charAt(n);
while(AjxStringUtil.isWhitespace(s)||s=="0"){
t=(s=="0")?(t+1):0;
s=c.charAt(++r)
}
while(AjxStringUtil.isWhitespace(o)||o=="0"){
e=(o=="0")?(e+1):0;
o=h.charAt(++n)
}
if(AjxStringUtil.isDigit(s)&&AjxStringUtil.isDigit(o)){
var d=AjxStringUtil.compareRight(c.substring(r),h.substring(n));
if(d&&d!=0){
return d
}}
if(s==0&&o==0){
return t-e
}
if(s<o){
return -1
}else{
if(s>o){
return +1
}}
++r;
++n
}};
AjxStringUtil.clipFile=function(s,t){
var a=s.lastIndexOf(".");
var e=a?(a+1):s.length;
if(e<=t){
return s
}else{
var n=s.substr(0,a);
var o=s.substr(a+1,s.length-1);
return[n.substr(0,t/2),"...",n.substring(e-((t/2)-3),e),".",(o?o:"")].join("")
}};
AjxStringUtil.URL_PARSE_RE=new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)?((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?");
AjxStringUtil.parseURL=function(a){
var n=["source","protocol","authority","domain","port","path","directoryPath","fileName","query","anchor"];
var o=AjxStringUtil.URL_PARSE_RE.exec(a);
var t={};
for(var e=0;
e<n.length;
e++){
t[n[e]]=(o[e]?o[e]:"")
}
if(t.directoryPath.length>0){
t.directoryPath=t.directoryPath.replace(/\/?$/,"/")
}
return t
};
AjxStringUtil.parseQueryString=function(s){
var a=s||(""+window.location);
var t=a.indexOf("?");
if(t==-1){
return null
}
var e=a.substring(t+1).replace(/#.*$/,"");
var n=e.split("&");
var h={};
for(var o=0;
o<n.length;
o++){
var r=n[o].split("=");
h[r[0]]=r[1]
}
return h
};
AjxStringUtil._SPECIAL_CHARS=/["\\\x00-\x1f]/g;
AjxStringUtil._CHARS={
"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
AjxStringUtil.objToString=function(n){
var p=typeof n,h,c,r,s,m,f,d,e=[];
var u=function(o){
if(!AjxStringUtil._CHARS[o]){
var t=o.charCodeAt();
AjxStringUtil._CHARS[o]="\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16)
}
return AjxStringUtil._CHARS[o]
};
var g=function(t){
return'"'+t.replace(AjxStringUtil._SPECIAL_CHARS,u)+'"'
};
if(p==="string"){
return g(n)
}
if(p==="boolean"||n instanceof Boolean){
return String(n)
}
if(p==="number"||n instanceof Number){
return isFinite(n)?String(n):"null"
}
if(AjxUtil.isArray(n)||(p==="object"&&n.length)){
for(h=e.length-1;
h>=0;
--h){
if(e[h]===n){
return"null"
}}
e[e.length]=n;
d=[];
for(h=n.length-1;
h>=0;
--h){
d[h]=AjxStringUtil.objToString(n[h])
}
e.pop();
return"["+d.join(",")+"]"
}
if(p==="object"&&n){
for(h=e.length-1;
h>=0;
--h){
if(e[h]===n){
return"null"
}}
e[e.length]=n;
d=[];
r=0;
for(s in n){
if(typeof s==="string"&&n.hasOwnProperty(s)){
m=n[s];
f=typeof m;
if(f!=="undefined"&&f!=="function"){
d[r++]=g(s)+":"+AjxStringUtil.objToString(m)
}}}
e.pop();
return"{"+d.join(",")+"}"
}
return"null"
};
AjxStringUtil.prettyPrint=function(o,a,e,t){
AjxStringUtil._visited=new AjxVector();
var n=AjxStringUtil._prettyPrint(o,a,e,t);
AjxStringUtil._visited=null;
return n
};
AjxStringUtil._visited=null;
AjxStringUtil._prettyPrint=function(r,e,u,t){
var p=0;
var n=false;
var w=false;
if(arguments.length>4){
p=arguments[4];
n=arguments[5];
w=arguments[6]
}
if(AjxUtil.isObject(r)){
var d=r.toString();
if(t&&t[d]){
return"["+d+"]"
}
if(AjxStringUtil._visited.contains(r)){
return"[visited object]"
}else{
AjxStringUtil._visited.add(r)
}}
var a=AjxStringUtil.repeat(" ",p);
var g="";
if(r===undefined){
g+="[undefined]"
}else{
if(r===null){
g+="[null]"
}else{
if(AjxUtil.isBoolean(r)){
g+=r?"true":"false"
}else{
if(AjxUtil.isString(r)){
g+='"'+AjxStringUtil._escapeForHTML(r)+'"'
}else{
if(AjxUtil.isNumber(r)){
g+=r
}else{
if(AjxUtil.isObject(r)){
var h=AjxUtil.isArray(r);
if(w){
g+=h?"[Array]":r.toString()
}else{
w=!e;
var y=new Array();
for(var s in r){
y.push(s)
}
if(h){
y.sort(function(k,v){
return k-v
}
)
}else{
y.sort()
}
if(n){
g+=h?"[":"{"
}
var c=y.length;
for(var s=0;
s<c;
s++){
var f=y[s];
var o=r[f];
var m=null;
if(o==window||o==document||(!AjxEnv.isIE&&o instanceof Node)){
m=o.toString()
}
if((typeof(o)=="function")){
if(u){
m="[function]"
}else{
continue
}}
if(s>0){
g+=","
}
g+="\n"+a;
if(m!=null){
g+=f+": "+m
}else{
g+=f+": "+this._prettyPrint(o,e,u,t,p+2,true,w)
}}
if(s>0){
g+="\n"+AjxStringUtil.repeat(" ",p-1)
}
if(n){
g+=h?"]":"}"
}}}}}}}}
return g
};
AjxStringUtil._escapeForHTML=function(t){
if(typeof(t)!="string"){
return t
}
var e=t;
e=e.replace(/\&/g,"&amp;");
e=e.replace(/\</g,"&lt;");
e=e.replace(/\>/g,"&gt;");
e=e.replace(/\"/g,"&quot;");
e=e.replace(/\xA0/g,"&nbsp;");
return e
}
}
if(AjxPackage.define("ajax.debug.AjxDebug")){
AjxDebug=function(a,t,e){
this._dbgName="AjxDebugWin_"+location.hostname.replace(/\./g,"_");
this._level=Number(a);
this._showTime=e;
this._showTiming=false;
this._startTimePt=this._lastTimePt=0;
this._dbgWindowInited=false;
this._msgQueue=[];
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._CONTENT_FRAME_ID="AjxDebug_CF";
AjxDebug._LINK_FRAME_ID="AjxDebug_LF";
AjxDebug._BOTTOM_FRAME_ID="AjxDebug_BFI";
AjxDebug._BOTTOM_FRAME_NAME="AjxDebug_BFN";
AjxDebug.prototype.toString=function(){
return"AjxDebug"
};
AjxDebug.prototype.setTitle=function(e){
if(this._document&&!AjxEnv.isIE){
this._document.title=e
}};
AjxDebug.prototype.setDebugLevel=function(t,e){
this._level=/^[\d]+$/.test(t)?Number(t):t;
if(!e){
this._enable(t!=AjxDebug.NONE)
}};
AjxDebug.prototype.getDebugLevel=function(){
return this._level
};
AjxDebug.prototype.println=function(n,o,a){
if(!this._isWriteable()){
return
}
try{
var e=this._handleArgs(arguments,a);
if(!e){
return
}
o=e.join("");
this._add(this._timestamp()+o+"<br>",null,null,null,a)
}
catch(t){}};
AjxDebug.prototype.isDisabled=function(){
return !this._enabled
};
AjxDebug.prototype.dumpObj=function(n,a,e,o){
if(!this._isWriteable()){
return
}
var t=this._handleArgs(arguments,o);
if(!t){
return
}
a=t[0];
if(!a){
return
}
e=t[1];
this._add(null,a,false,false,null,e)
};
AjxDebug.prototype.printRaw=function(o,a,t){
if(!this._isWriteable()){
return
}
var e=this._handleArgs(arguments,t);
if(!e){
return
}
this._add(null,e[0],false,true)
};
AjxDebug.prototype.printXML=function(o,a,t){
if(!this._isWriteable()){
return
}
var e=this._handleArgs(arguments,t);
if(!e){
return
}
a=e[0];
if(!a){
return
}
if(a.length>AjxDebug.MAX_OUT){
this.printRaw(a);
return
}
this._add(null,a,true,false)
};
AjxDebug.prototype.display=function(a,t){
if(!this._isWriteable()){
return
}
var e=this._handleArgs(arguments);
if(!e){
return
}
t=e[0];
t=t.replace(/\r?\n/g,"[crlf]");
t=t.replace(/ /g,"[space]");
t=t.replace(/\t/g,"[tab]");
this.printRaw(a,t)
};
AjxDebug.prototype.showTiming=function(t,n){
this._showTiming=t;
if(t){
this._enable(true)
}
var a=t?"on":"off";
var o="Turning timing info "+a;
if(n){
o=o+": "+n
}
var e=new DebugMessage(o);
this._addMessage(e);
this._startTimePt=this._lastTimePt=new Date().getTime()
};
AjxDebug.prototype.timePt=function(h,a){
if(!this._showTiming||!this._isWriteable()){
return
}
if(a){
this._startTimePt=this._lastTimePt=new Date().getTime()
}
var n=new Date().getTime();
var e=n-this._startTimePt;
var t=n-this._lastTimePt;
this._lastTimePt=n;
var o=a?"<br/>":"";
h=h?" "+h:"";
var r=[o,"[",e," / ",t,"]",h].join("");
var s="<div>"+r+"</div>";
this._addMessage(new DebugMessage(s));
return t
};
AjxDebug.prototype.getContentFrame=function(){
if(this._contentFrame){
return this._contentFrame
}
if(this._debugWindow&&this._debugWindow.document){
return this._debugWindow.document.getElementById(AjxDebug._CONTENT_FRAME_ID)
}
return null
};
AjxDebug.prototype.getLinkFrame=function(e){
if(this._linkFrame){
return this._linkFrame
}
if(this._debugWindow&&this._debugWindow.document){
return this._debugWindow.document.getElementById(AjxDebug._LINK_FRAME_ID)
}
if(!e){
this._openDebugWindow();
return this.getLinkFrame(true)
}
return null
};
AjxDebug.prototype._enable=function(e){
this._enabled=e;
if(e){
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._isPaused&&!this.isDisabled()&&this._debugWindow&&!this._debugWindow.closed)
};
AjxDebug.prototype._getHtmlForObject=function(e,t,n,o,s){
var a=[];
var h=0;
if(e===undefined){
a[h++]="<span>Undefined</span>"
}else{
if(e===null){
a[h++]="<span>NULL</span>"
}else{
if(AjxUtil.isBoolean(e)){
a[h++]="<span>"+e+"</span>"
}else{
if(AjxUtil.isNumber(e)){
a[h++]="<span>"+e+"</span>"
}else{
if(n){
a[h++]=this._timestamp();
a[h++]="<textarea rows='25' style='width:100%' readonly='true'>";
a[h++]=e;
a[h++]="</textarea><p></p>"
}else{
if(t){
var c=new AjxDebugXmlDocument;
var r=c.create();
if(r&&("loadXML" in r)){
r.loadXML(e);
a[h++]="<div style='border-width:2px; border-style:inset; width:100%; height:300px; overflow:auto'>";
a[h++]=this._createXmlTree(r,0);
a[h++]="</div>"
}else{
a[h++]="<span>Unable to create XmlDocument to show XML</span>"
}}else{
a[h++]="<div style='border-width:2px; border-style:inset; width:100%; height:300px; overflow:auto'><pre>";
a[h++]=this._dump(e,true,s);
a[h++]="</div></pre>"
}}}}}}
return a.join("")
};
AjxDebug.prototype._dump=function(a,t,e){
return AjxStringUtil.prettyPrint(a,t,e,{
ZmAppCtxt:true}
)
};
AjxDebug.prototype._handleArgs=function(o,a){
if(this._level==AjxDebug.NONE||this._showTiming){
return
}
var t=AjxDebug.DBG1;
if(o.length>1){
if(typeof o[0]=="number"&&typeof this._level=="number"){
t=o[0];
if(t>this._level){
return
}}else{
if(o[0]&&o[0]!=this._level){
return
}}}
var s=new Array(o.length);
var e=(a)?o.length-1:o.length;
for(var n=0;
n<e;
n++){
s[n]=o[n]
}
if(e>1){
s.shift()
}
return s
};
AjxDebug.prototype._openDebugWindow=function(o){
var t=AjxEnv.isIE?"_blank":this._dbgName;
this._debugWindow=window.open("",t,"width=600,height=400,resizable=yes,scrollbars=yes");
if(this._debugWindow==null){
this._enabled=false;
return
}
this._enabled=true;
this._isPrevWinOpen=this._debugWindow.debug;
this._debugWindow.debug=true;
try{
this._document=this._debugWindow.document;
this.setTitle("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;}',","'.Content {display:block;margin:0.25em 0em;}',","'.Link {cursor: pointer;color:blue;text-decoration:underline;white-space:nowrap;width:100%;}',","'.Run {color:black; background-color:red;width:100%;font-size:18px;font-weight:bold;}',","'.RunLink {display:block;color:black;background-color:red;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._BOTTOM_FRAME_NAME,"' id='",AjxDebug._BOTTOM_FRAME_ID,"' src='javascript:parent.parent.blank();' scrolling=no frameborder=0>","</frameset>","<frame name='",AjxDebug._CONTENT_FRAME_ID,"' id='",AjxDebug._CONTENT_FRAME_ID,"' src='javascript:parent.blank();'>","</frameset>","</html>");
this._document.close();
var e=new AjxTimedAction(this,AjxDebug.prototype._finishInitWindow);
AjxTimedAction.scheduleAction(e,1500)
}else{
this._finishInitWindow();
this._contentFrame=this._document.getElementById(AjxDebug._CONTENT_FRAME_ID);
this._linkFrame=this._document.getElementById(AjxDebug._LINK_FRAME_ID);
this._createLinkNContent("RunLink","NEW RUN","Run","NEW RUN");
this._attachHandlers();
this._dbgWindowInited=true;
this._showMessages()
}}
catch(a){
if(this._debugWindow){
this._debugWindow.close()
}
this._openDebugWindow(true)
}};
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 n=this._debugWindow.document.getElementById(AjxDebug._BOTTOM_FRAME_ID);
var o=n.contentWindow.document;
var a=[];
var t=0;
a[t++]="<table><tr><td><button id='";
a[t++]=AjxDebug._BOTTOM_FRAME_ID;
a[t++]="_clear'>Clear</button></td><td><button id='";
a[t++]=AjxDebug._BOTTOM_FRAME_ID;
a[t++]="_pause'>Pause</button></td></tr></table>";
o.body.innerHTML=a.join("")
}
catch(e){}
if(o){
this._clearBtn=o.getElementById(AjxDebug._BOTTOM_FRAME_ID+"_clear");
this._pauseBtn=o.getElementById(AjxDebug._BOTTOM_FRAME_ID+"_pause")
}
this._attachHandlers();
this._dbgWindowInited=true;
this._showMessages()
};
AjxDebug.prototype._attachHandlers=function(){
var e=AjxCallback.simpleClosure(this._unloadHandler,this);
if(AjxEnv.isIE){
this._unloadHandler=e;
this._debugWindow.attachEvent("onunload",e)
}else{
this._debugWindow.onunload=e
}
if(this._clearBtn){
this._clearBtn.onclick=AjxCallback.simpleClosure(this._clear,this)
}
if(this._pauseBtn){
this._pauseBtn.onclick=AjxCallback.simpleClosure(this._pause,this)
}};
AjxDebug.prototype._scrollToBottom=function(){
var t=this.getContentFrame();
var e=t?t.contentWindow.document.body:null;
var o=this.getLinkFrame();
var a=o?o.contentWindow.document.body:null;
if(e&&a){
e.scrollTop=e.scrollHeight;
a.scrollTop=a.scrollHeight
}};
AjxDebug.prototype._timestamp=function(){
return this._showTime?this._getTimeStamp()+": ":""
};
AjxDebug.prototype.setShowTimestamps=function(e){
this._showTime=e
};
AjxDebug.prototype._createXmlTree=function(s,t){
if(s==null){
return""
}
var h="";
var e;
switch(s.nodeType){
case 1:h+="<div style='color: blue; padding-left: 16px;'>&lt;<span style='color: DarkRed;'>"+s.nodeName+"</span>";
var a=s.attributes;
e=a.length;
for(var o=0;
o<e;
o++){
h+=this._createXmlAttribute(a[o])
}
if(!s.hasChildNodes()){
return h+"/&gt;</div>"
}
h+="&gt;<br />";
var n=s.childNodes;
e=n.length;
for(var o=0;
o<e;
o++){
h+=this._createXmlTree(n[o],t+3)
}
h+="&lt;/<span style='color: DarkRed;'>"+s.nodeName+"</span>&gt;</div>";
break;
case 9:var n=s.childNodes;
e=n.length;
for(var o=0;
o<e;
o++){
h+=this._createXmlTree(n[o],t)
}
break;
case 3:if(!/^\s*$/.test(s.nodeValue)){
var r=s.nodeValue.replace(/</g,"&lt;").replace(/>/g,"&gt;");
h+="<span style='color: WindowText; padding-left: 16px;'>"+r+"</span><br />"
}
break;
case 7:h+="&lt;?"+s.nodeName;
var a=s.attributes;
e=a.length;
for(var o=0;
o<e;
o++){
h+=this._createXmlAttribute(a[o])
}
h+="?&gt;<br />";
break;
case 4:h="<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;'>"+s.nodeValue+"</span>]]></div>";
break;
case 8:h="<div style='color: blue; padding-left: 16px;'>&lt;!--<span style='white-space: pre; font-family: \"Courier New\"; color: Gray; display: block;'>"+s.nodeValue+"</span>--></div>";
break;
case 10:h="<div style='color: blue; padding-left: 16px'>&lt;!DOCTYPE "+s.name;
if(s.publicId){
h+=' PUBLIC "'+s.publicId+'"';
if(s.systemId){
h+=' "'+s.systemId+'"'
}}else{
if(s.systemId){
h+=' SYSTEM "'+s.systemId+'"'
}}
h+="&gt;</div>";
break;
default:this._inspect(s)
}
return h
};
AjxDebug.prototype._createXmlAttribute=function(e){
return[" <span style='color: red'>",e.nodeName,"</span><span style='color: blue'>=\"",e.nodeValue,'"</span>'].join("")
};
AjxDebug.prototype._inspect=function(t){
var a="";
for(var e in t){
a+="obj."+e+" = "+t[e]+"\n"
}
window.alert(a)
};
AjxDebug.prototype._add=function(t,a,r,s,n,e){
var o=new Date();
if(a){
a=this._getHtmlForObject(a,r,s,o,e)
}
this._addMessage(new DebugMessage(t,null,null,o,a,n))
};
AjxDebug.prototype._addMessage=function(e){
this._msgQueue[this._msgQueue.length]=e;
this._showMessages()
};
AjxDebug.prototype._showMessages=function(){
if(!this._dbgWindowInited){
return
}
try{
if(this._msgQueue.length>0){
var e=this.getContentFrame();
var o=this.getLinkFrame();
if(!e||!o){
return
}
var a;
var d=e.contentWindow.document;
var r=o.contentWindow.document;
var s=this._msgQueue.length;
for(var n=0;
n<s;
++n){
var t=new Date();
a=this._msgQueue[n];
var u=a.linkName;
var c=[a.message,a.eHtml].join("");
this._createLinkNContent("Link",u,"Content",c)
}}
this._msgQueue.length=0;
this._scrollToBottom()
}
catch(h){}};
AjxDebug.prototype._getTimeStamp=function(e){
if(!AjxDebug._timestampFormatter){
AjxDebug._timestampFormatter=new AjxDateFormat("HH:mm:ss.SSS")
}
e=e||new Date();
return AjxStringUtil.htmlEncode(AjxDebug._timestampFormatter.format(e),true)
};
AjxDebug.prototype._createLinkNContent=function(r,f,o,c){
var n=this.getLinkFrame();
if(!n){
return
}
var a=new Date();
var s=["[",this._getTimeStamp(a),"]"].join("");
var t="Lnk_"+a.getTime();
if(f){
var h=n.contentWindow.document;
var m=h.createElement("DIV");
m.className=r;
m.innerHTML=[f,s].join(" - ");
m._targetId=t;
m._dbg=this;
m.onclick=AjxDebug._linkClicked;
var u=h.body;
u.appendChild(m)
}
var d=this.getContentFrame().contentWindow.document;
var e=d.createElement("DIV");
e.className=o;
e.id=t;
e.innerHTML=c;
d.body.appendChild(e);
this._scrollToBottom()
};
AjxDebug._linkClicked=function(){
var t=this._dbg.getContentFrame();
var e=t.contentWindow.document.getElementById(this._targetId);
var a=0;
while(e){
a+=e.offsetTop;
e=e.offsetParent
}
t.contentWindow.scrollTo(0,a)
};
AjxDebug.prototype._clear=function(){
this.getContentFrame().contentWindow.document.body.innerHTML="";
this.getLinkFrame().contentWindow.document.body.innerHTML=""
};
AjxDebug.prototype._pause=function(){
this._isPaused=!this._isPaused;
this._pauseBtn.innerHTML=this._isPaused?"Resume":"Pause"
};
AjxDebug.prototype._unloadHandler=function(){
if(!this._debugWindow){
return
}
if(AjxEnv.isIE){
this._debugWindow.detachEvent("onunload",this._unloadHandler)
}else{
this._debugWindow.onunload=null
}};
DebugMessage=function(e,t,n,o,a,s){
this.message=e||"";
this.type=t||null;
this.category=n||"";
this.time=o||(new Date().getTime());
this.eHtml=a||"";
this.linkName=s
}
}
if(AjxPackage.define("ajax.debug.AjxDebugXmlDocument")){
AjxDebugXmlDocument=function(){};
getDomDocumentPrefix=function(){
if(getDomDocumentPrefix.prefix){
return getDomDocumentPrefix.prefix
}
var n=["MSXML2","Microsoft","MSXML","MSXML3"];
var s;
var e=n.length;
for(var a=0;
a<e;
a++){
try{
s=new ActiveXObject(n[a]+".DomDocument");
return getDomDocumentPrefix.prefix=n[a]
}
catch(t){}}
throw new Error("Could not find an installed XML parser")
};
AjxDebugXmlDocument.prototype.create=function(){
try{
if(document.implementation&&document.implementation.createDocument){
var t=document.implementation.createDocument("","",null);
if(t.readyState==null){
t.readyState=1;
t.addEventListener("load",function(){
t.readyState=4;
if(typeof t.onreadystatechange=="function"){
t.onreadystatechange()
}}
,false)
}
return t
}
if(window.ActiveXObject){
return new ActiveXObject(getDomDocumentPrefix()+".DomDocument")
}}
catch(e){}
throw new Error("Your browser does not support XmlDocument objects")
};
if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){
if(AjxEnv.isSafari){
Document.prototype.loadXML=function(a){
var o=(new DOMParser()).parseFromString(a,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild)
}
var e=o.childNodes.length;
for(var t=0;
t<e;
t++){
this.appendChild(this.importNode(o.childNodes[t],true))
}};
Document.prototype.__defineGetter__("xml",function(){
return(new XMLSerializer()).serializeToString(this)
}
)
}else{
AjxDebugXmlDocument.prototype.loadXML=function(a){
var o=(new DOMParser()).parseFromString(a,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild)
}
var e=o.childNodes.length;
for(var t=0;
t<e;
t++){
this.appendChild(this.importNode(o.childNodes[t],true))
}};
AjxDebugXmlDocument.prototype.__defineGetter__("xml",function(){
return(new XMLSerializer()).serializeToString(this)
}
)
}}}
if(AjxPackage.define("ajax.xml.AjxXmlDoc")){
AjxXmlDoc=function(){
if(!AjxXmlDoc._inited){
AjxXmlDoc._init()
}};
AjxXmlDoc.prototype.toString=function(){
return"AjxXmlDoc"
};
AjxXmlDoc.INVALID_CHARS_RE=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/g;
AjxXmlDoc.REC_AVOID_CHARS_RE=/[\u007F-\u0084\u0086-\u009F\uFDD0-\uFDDF]/g;
AjxXmlDoc._inited=false;
AjxXmlDoc._msxmlVers=null;
AjxXmlDoc.create=function(){
var t=new AjxXmlDoc();
var e=null;
if(AjxEnv.isIE){
e=new ActiveXObject(AjxXmlDoc._msxmlVers);
e.async=true;
if(AjxXmlDoc._msxmlVers=="MSXML2.DOMDocument.4.0"){
e.setProperty("SelectionLanguage","XPath");
e.setProperty("SelectionNamespaces","xmlns:zimbra='urn:zimbra' xmlns:mail='urn:zimbraMail' xmlns:account='urn:zimbraAccount'")
}}else{
if(document.implementation&&document.implementation.createDocument){
e=document.implementation.createDocument("","",null)
}else{
throw new AjxException("Unable to create new Doc",AjxException.INTERNAL_ERROR,"AjxXmlDoc.create")
}}
t._doc=e;
return t
};
AjxXmlDoc.createFromDom=function(t){
var e=new AjxXmlDoc();
e._doc=t;
return e
};
AjxXmlDoc.createFromXml=function(e){
var t=AjxXmlDoc.create();
t.loadFromString(e);
return t
};
AjxXmlDoc.replaceInvalidChars=function(e){
AjxXmlDoc.INVALID_CHARS_RE.lastIndex=0;
return e.replace(AjxXmlDoc.INVALID_CHARS_RE,"?")
};
AjxXmlDoc.getXml=function(t){
var e=new XMLSerializer();
return AjxXmlDoc.replaceInvalidChars(e.serializeToString(t))
};
AjxXmlDoc.prototype.getDoc=function(){
return this._doc
};
AjxXmlDoc.prototype.loadFromString=function(t){
var e=this._doc;
e.loadXML(t);
if(AjxEnv.isIE){
if(e.parseError.errorCode!=0){
throw new AjxException(e.parseError.reason,AjxException.INVALID_PARAM,"AjxXmlDoc.loadFromString")
}}};
AjxXmlDoc.prototype.loadFromUrl=function(e){
this._doc.load(e)
};
AjxXmlDoc.prototype.toJSObject=function(a,t,e){
_node=function(){
this.__msh_content=""
};
_node.prototype.toString=function(){
return this.__msh_content
};
rec=function(c,d){
var r={}
,h,u;
for(c=c.firstChild;
c;
c=c.nextSibling){
if(c.nodeType==1){
h=c.tagName;
if(a){
h=h.replace(/^.*?:/,"")
}
if(t){
h=h.toLowerCase()
}
u=new _node();
if(r[h]){
if(r[h]==1){
d[h]=[d[h]];
r[h]=2
}
d[h].push(u)
}else{
d[h]=u;
r[h]=1
}
if(e){
if(c.attributes&&c.attributes.length){
for(var s=0;
s<c.attributes.length;
s++){
attr=c.attributes[s];
u[attr.name]=AjxUtil.isNumeric(attr.value)?attr.value:String(attr.value)
}}}
rec(c,u)
}else{
if(c.nodeType==3){
d.__msh_content+=c.nodeValue
}}}};
var n=new _node();
rec(this._doc.documentElement,n);
return n
};
AjxXmlDoc.prototype.getElementsByTagNameNS=function(t,e){
var a=this.getDoc();
return AjxEnv.isIE?a.getElementsByTagName(t+":"+e):a.getElementsByTagNameNS(t,e)
};
AjxXmlDoc.prototype.getFirstElementByTagNameNS=function(t,e){
return this.getElementsByTagNameNS(t,e)[0]
};
AjxXmlDoc.prototype.getElementsByTagName=function(e){
var t=this.getDoc();
return t.getElementsByTagName(e)
};
AjxXmlDoc._init=function(){
if(AjxEnv.isIE){
var e=["MSXML4.DOMDocument","MSXML3.DOMDocument","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XmlDom"];
for(var a=0;
a<e.length;
a++){
try{
new ActiveXObject(e[a]);
AjxXmlDoc._msxmlVers=e[a];
break
}
catch(t){}}
if(!AjxXmlDoc._msxmlVers){
throw new AjxException("MSXML not installed",AjxException.INTERNAL_ERROR,"AjxXmlDoc._init")
}}else{
if(AjxEnv.isNav||AjxEnv.isOpera||AjxEnv.isSafari){
Document.prototype.loadXML=function(c){
var h=new DOMParser();
var n=h.parseFromString(c,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild)
}
var o=n.childNodes.length;
for(var s=0;
s<o;
s++){
var r=this.importNode(n.childNodes[s],true);
this.appendChild(r)
}};
if(AjxEnv.isNav){
_NodeGetXml=function(){
var o=new XMLSerializer();
return o.serializeToString(this)
};
Node.prototype.__defineGetter__("xml",_NodeGetXml)
}}}
AjxXmlDoc._inited=true
};
AjxXmlDoc.prototype.set=function(e,o,t){
var n=this._doc.createElement(e);
if(o!=null){
var a=this._doc.createTextNode("");
n.appendChild(a);
a.nodeValue=o
}
if(t==null){
this.root.appendChild(n)
}else{
t.appendChild(n)
}
return n
};
AjxXmlDoc.prototype.getDocXml=function(){
if(AjxEnv.isSafari){
return AjxXmlDoc.getXml(this.getDoc())
}else{
return AjxXmlDoc.replaceInvalidChars(this.getDoc().xml)
}};
AjxXmlDoc.createRoot=function(a){
var e=AjxXmlDoc.create();
var t=e.getDoc();
e.root=t.createElement(a);
t.appendChild(e.root);
return e
};
AjxXmlDoc.createElement=function(t,o){
var e=AjxXmlDoc.create();
var n=e.getDoc();
e.root=n.createElement(t);
if(o!=null){
var a=n.createTextNode("");
e.root.appendChild(a);
a.nodeValue=o
}
n.appendChild(e.root);
return e
};
AjxXmlDoc.prototype.appendChild=function(e){
this.root.appendChild(e.root)
}
}
if(AjxPackage.define("ajax.xml.AjxSerializer")){
AjxSerializer=function(){
if(arguments.length==0){
return
}};
AjxSerializer.prototype.serialize=function(e){
throw"NOT IMPLEMENTED"
};
AjxJsonSerializer=function(e){
AjxSerializer.call(this,null);
this._minimize=Boolean(e)
};
AjxJsonSerializer.prototype=new AjxSerializer;
AjxJsonSerializer.prototype.constructor=AjxJsonSerializer;
AjxJsonSerializer.E_ATTRS="_attrs";
AjxJsonSerializer.A_CONTENT="_content";
AjxJsonSerializer.A_NAMESPACE="_jsns";
AjxJsonSerializer.prototype.serialize=function(r){
var t={};
var p=0;
var u=null;
for(var o=r.firstChild;
o;
o=o.nextSibling){
var m=o.nodeType;
if(m==1){
var e=o.nodeName;
if(!t[e]){
t[e]=[];
p++
}
t[e].push(o);
continue
}
if(m==3||m==4){
if(!u){
u=[]
}
u.push(o.nodeValue);
continue
}}
var y={};
var s=0;
if(r.attributes){
for(var c=0;
c<r.attributes.length;
c++){
var d=r.attributes[c];
var e=d.nodeName;
var g=this.quote(d.nodeValue);
if(t[e]){
y[e]=g;
s++
}else{
t[e]=g;
p++
}}}
u=u&&u.join("");
if(u&&u.match(/^\s*$/)){
u=null
}
if(u){
u=this.quote(u);
if(s==0&&p==0){
return u
}}
if(u==null&&p==0&&s==0){
return"{}"
}
var f=["{"];
if(u){
f.push(this.quote(AjxJsonSerializer.A_CONTENT),":",u);
if(s>0||p>0){
f.push(",")
}}
if(s>0){
f.push(this.quote(AjxJsonSerializer.E_ATTRS),": { ");
var c=0;
for(var e in y){
if(c>0){
f.push(",")
}
f.push(this.quote(e),":",y[e]);
c++
}
f.push("}");
if(p>0){
f.push(", ")
}}
var h=0;
for(var e in t){
if(h>0){
f.push(",")
}
var n=t[e];
if(typeof n=="string"){
f.push(this.quote(e),":",n);
h++;
continue
}
f.push(this.quote(e),":");
if(!this._minimize||n.length>1){
f.push("[")
}
for(var c=0;
c<n.length;
c++){
if(c>0){
f.push(",")
}
f.push(this.serialize(n[c]))
}
if(!this._minimize||n.length>1){
f.push("]")
}
h++
}
f.push("}");
return f.join("")
};
AjxJsonSerializer.prototype.quote=function(e){
return['"',this.escape(e),'"'].join("")
};
AjxJsonSerializer.prototype.escape=function(e){
return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")
}
}
if(AjxPackage.define("ajax.core.AjxImg")){
AjxImg=function(){};
AjxImg.prototype=new Object;
AjxImg.prototype.constructor=null;
AjxImg._VIEWPORT_ID="AjxImg_VP";
AjxImg.DISABLED=true;
AjxImg.RE_COLOR=/^(.*?),color=(.*)$/;
AjxImg.setImage=function(a,g,f,o){
var u,c=g.match(AjxImg.RE_COLOR);
if(c){
g=c&&c[1];
u=c&&c[2]
}
var e=AjxImg.getClassForImage(g,o);
if(f){
a.className=e;
return
}
var w=e+"Overlay";
var n=e+"Mask";
if(u&&window.AjxImgData&&AjxImgData[w]&&AjxImgData[n]){
u=(u.match(/^\d$/)?ZmOrganizer.COLOR_VALUES[u]:u)||ZmOrganizer.COLOR_VALUES[ZmOrganizer.ORG_DEFAULT_COLOR];
var y=AjxImgData[w],p=AjxImgData[n];
if(AjxEnv.isIE){
var v="";
var s=["width:",y.w,";","height:",y.h,";"].join("");
var k=["top:",p.t,";","left:",p.l,";"].join("");
if(typeof document.documentMode!="undefined"){
v=["clip:rect(",(-1*p.t)-1,"px, ",y.w-1,"px, ",(p.t*-1)+y.h-1,"px, ",y.l,"px);"].join("")
}
a.innerHTML=["<div style='position:relative;overflow:hidden;",s,"'>","<div style='overflow:hidden;position:relative;",s,"'>","<img src='",p.f,"' ","style='filter:mask(color=",u,");position:absolute;",k,v,"'>","</div>","<div class='",w,"' style='",s,";position:absolute;top:",y.t,";left:",y.l,"'></div>","</div>"].join("");
return
}
if(!y[u]){
var h=y.w,r=y.h;
var t=document.createElement("CANVAS");
t.width=h;
t.height=r;
var d=t.getContext("2d");
d.save();
d.clearRect(0,0,h,r);
d.save();
d.drawImage(document.getElementById(n),p.l,p.t);
d.globalCompositeOperation="source-out";
d.fillStyle=u;
d.fillRect(0,0,h,r);
d.restore();
d.drawImage(document.getElementById(w),y.l,y.t);
d.restore();
y[u]=t.toDataURL()
}
a.innerHTML=["<img src='",y[u],"'>"].join("");
return
}
if(a.firstChild==null){
a.innerHTML=e?"<div class='"+e+"'></div>":"<div></div>";
return
}
a.firstChild.className=e
};
AjxImg.setDisabledImage=function(t,a,e){
return AjxImg.setImage(t,a,e,true)
};
AjxImg.getClassForImage=function(a,t){
var e="Img"+a;
if(t){
e+=" ZDisabledImage"
}
return e
};
AjxImg.getImageClass=function(e){
return e.firstChild?e.firstChild.className:e.className
};
AjxImg.getImageElement=function(e){
return e.firstChild?e.firstChild:e
};
AjxImg.getParentElement=function(e){
return e.parentNode
};
AjxImg.getImageHtml=function(o,s,e,a){
e=e||"";
s=s?(["style='",s,"' "].join("")):"";
var n=a?"<table style='display:inline' cellpadding=0 cellspacing=0 border=0><tr><td align=center valign=bottom>":"";
var t=a?"</td></tr></table>":"";
if(o){
return[n,"<div class='","Img",o,"' ",s," ",e,"></div>",t].join("")
}
return[n,"<div ",s," ",e,"></div>",t].join("")
};
AjxImg.getImageSpanHtml=function(s,r,e,t){
var n=AjxImg.getClassForImage(s);
var o=[];
var a=0;
o[a++]="<span style='white-space:nowrap'>";
o[a++]="<span class='";
o[a++]=n;
o[a++]=" inlineIcon'";
o[a++]=r?([" style='",r,"' "].join("")):"";
o[a++]=e?([" ",e].join("")):"";
o[a++]=">&nbsp;&nbsp;&nbsp;</span>";
o[a++]=(t||"");
o[a++]="</span>";
return o.join("")
}
}
if(AjxPackage.define("ajax.core.AjxColor")){
AjxColor=function(a,t,e){
if(arguments.length==0){
return
}
this.r=a;
this.g=t;
this.b=e
};
AjxColor.prototype.toString=function(){
return AjxColor.color(this.r,this.g,this.b)
};
AjxColor.components=function(t){
var e=AjxColor.__RE.exec(t);
return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null
};
AjxColor.color=function(a,t,e){
return["#",AjxColor.__pad(Number(Math.round(a)).toString(16),2),AjxColor.__pad(Number(Math.round(t)).toString(16),2),AjxColor.__pad(Number(Math.round(e)).toString(16),2)].join("")
};
AjxColor.lighten=function(e,a){
var t=AjxColor.components(e);
return t?AjxColor.color(AjxColor.__lighten(t[0],a),AjxColor.__lighten(t[1],a),AjxColor.__lighten(t[2],a)):""
};
AjxColor.darken=function(e,a){
var t=AjxColor.components(e);
return t?AjxColor.color(AjxColor.__darken(t[0],a),AjxColor.__darken(t[1],a),AjxColor.__darken(t[2],a)):""
};
AjxColor.deepen=function(e,a){
var s=AjxColor.components(e);
var t=0;
for(var o=1;
o<s.length;
o++){
if(s[o]>s[t]){
t=o
}}
for(var o=0;
o<s.length;
o++){
var n=s[o]/s[t];
s[o]=Math.floor(s[o]*n*(a||1))
}
return AjxColor.color(s[0],s[1],s[2])
};
AjxColor.__RE=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i;
AjxColor.__pad=function(n,a,o){
if(!o){
o="0"
}
var t=String(n);
for(var e=t.length;
e<a;
e++){
t=o+t
}
return t
};
AjxColor.__lighten=function(e,t){
return Math.max(0,Math.min(255,e+(255-e)*t))
};
AjxColor.__darken=function(e,t){
return Math.max(0,Math.min(255,e+(1-e)*t))
}
}
if(AjxPackage.define("ajax.events.AjxEvent")){
AjxEvent=function(){
this.data=null
};
AjxEvent.HISTORY="HISTORY";
AjxEvent.prototype.toString=function(){
return"AjxEvent"
}
}
if(AjxPackage.define("ajax.events.AjxEventMgr")){
AjxEventMgr=function(){
this._listeners=new Object()
};
AjxEventMgr.prototype.toString=function(){
return"AjxEventMgr"
};
AjxEventMgr.prototype.addListener=function(t,a,e){
var o=this._listeners[t];
if(o==null){
o=this._listeners[t]=new AjxVector()
}
if(!o.contains(a)){
if(this._notifyingListeners){
o=this._listeners[t]=o.clone()
}
o.add(a,e);
return true
}
return false
};
AjxEventMgr.prototype.notifyListeners=function(o,r){
this._notifyingListeners=true;
var d=this._listeners[o];
if(d!=null){
var e=d.getArray();
var n=d.size();
var h=null;
var u=null;
for(var t=0;
t<n;
t++){
u=e[t];
if(!(u&&((u instanceof AjxListener)||(typeof u=="function")))){
continue
}
h=u.handleEvent?u.handleEvent(r):u(r);
if(h===false){
break
}}}
this._notifyingListeners=false;
return h
};
AjxEventMgr.prototype.isListenerRegistered=function(e){
var t=this._listeners[e];
return(t!=null&&t.size()>0)
};
AjxEventMgr.prototype.removeListener=function(e,t){
var a=this._listeners[e];
if(a!=null){
if(this._notifyingListeners){
a=this._listeners[e]=a.clone()
}
a.remove(t);
return true
}
return false
};
AjxEventMgr.prototype.removeAll=function(e){
var t=this._listeners[e];
if(t!=null){
if(this._notifyingListeners){
t=this._listeners[e]=t.clone()
}
t.removeAll();
return true
}
return false
}
}
if(AjxPackage.define("ajax.util.AjxTimedAction")){
AjxTimedAction=function(a,t,e){
AjxCallback.call(this,a,t,e);
this._tid=-1;
this._id=-1;
this._runResult=null
};
AjxTimedAction.prototype=new AjxCallback();
AjxTimedAction.prototype.constructor=AjxTimedAction;
AjxTimedAction.MAX_TIMEOUT=20*24*60*60*1000;
AjxTimedAction.prototype.toString=function(){
return"AjxTimedAction"
};
AjxTimedAction.prototype.getRunResult=function(){
return this._runResult
};
AjxTimedAction._pendingActions={};
AjxTimedAction._nextActionId=1;
AjxTimedAction.scheduleAction=function(a,t){
if(!a){
return
}
if(a._tid&&a._tid!=-1){
AjxTimedAction.cancelAction(a._id)
}
t=t||0;
if(t>AjxTimedAction.MAX_TIMEOUT){
if(window.DBG){}
t=AjxTimedAction.MAX_TIMEOUT
}
var o=a._id=AjxTimedAction._nextActionId++;
AjxTimedAction._pendingActions[o]=a;
var e="AjxTimedAction._exec("+o+")";
a._tid=window.setTimeout(e,t);
return a._id
};
AjxTimedAction.cancelAction=function(t){
var e=AjxTimedAction._pendingActions[t];
if(e){
window.clearTimeout(e._tid);
delete AjxTimedAction._pendingActions[t];
delete e._tid
}};
AjxTimedAction._exec=function(t){
var e=AjxTimedAction._pendingActions[t];
if(e){
delete AjxTimedAction._pendingActions[t];
delete e._tid;
e._runResult=e.run()
}}
}
if(AjxPackage.define("ajax.net.AjxInclude")){
AjxInclude=function(o,s,n,a){
var t=document.getElementsByTagName("head")[0];
function e(h){
if(AjxEnv.isIE&&h&&!/loaded|complete/.test(h.readyState)){
return
}
if(h){
h[AjxInclude.eventName]=null
}
var r=AjxInclude.dwhack_scripts.length>0?AjxInclude.dwhack_scripts:o;
window.status="";
if(r.length>0){
var d=r.shift();
var u=d;
if(!/^((https?|ftps?):\x2f\x2f|\x2f)/.test(d)){
if(s){
d=s+d
}
if(cacheKillerVersion){
d+="?v="+cacheKillerVersion
}}else{
if(a&&d.indexOf("/")!=0){
d=a+AjxStringUtil.urlEncode(d)
}}
var h=document.createElement("script");
var c=AjxCallback.simpleClosure(e,null,h);
if(AjxEnv.isIE){
h.attachEvent("onreadystatechange",c);
h.attachEvent("onerror",c)
}else{
h.addEventListener("load",c,true);
h.addEventListener("error",c,true)
}
h.type="text/javascript";
h.src=d;
window.status="Loading script: "+u;
t.appendChild(h)
}else{
if(o.length==0){
h=null;
t=null;
if(n){
n.run()
}}}}
e(null)
};
AjxInclude.dwhack_scripts=[];
document.write=document.writeln=function(){
var e=[];
for(var t=0;
t<arguments.length;
++t){
e[t]=arguments[t]
}
var o=e.join("");
if(/<script[^>]+src=([\x22\x27])(.*?)\1/i.test(o)){
AjxInclude.dwhack_scripts.push(RegExp.$2)
}};
if(AjxEnv.isIE){
AjxInclude._removeWriteln=function(){
document.write=document.writeln=null;
window.detachEvent("onunload",AjxInclude._removeWriteln)
};
window.attachEvent("onunload",AjxInclude._removeWriteln)
}}
if(AjxPackage.define("ajax.events.AjxListener")){
AjxListener=function(t,a,e){
AjxCallback.call(this,t,a,e)
};
AjxListener.prototype=new AjxCallback();
AjxListener.prototype.constructor=AjxListener;
AjxListener.prototype.toString=function(){
return"AjxListener"
};
AjxListener.prototype.handleEvent=function(e){
return this.run(e)
}
}
if(AjxPackage.define("ajax.util.AjxText")){
AjxFormat=function(e){
this._pattern=e;
this._segments=[]
};
AjxFormat.prototype.toString=function(){
var t=[];
t.push('pattern="',this._pattern,'"');
if(this._segments.length>0){
t.push(", segments={ ");
for(var e=0;
e<this._segments.length;
e++){
if(e>0){
t.push(", ")
}
t.push(String(this._segments[e]))
}
t.push(" }")
}
return t.join("")
};
AjxFormat.prototype._pattern;
AjxFormat.prototype._segments;
AjxFormat.initialize=function(){
AjxDateFormat.initialize();
AjxNumberFormat.initialize()
};
AjxFormat.prototype.format=function(e){
var a=[];
for(var t=0;
t<this._segments.length;
t++){
a.push(this._segments[t].format(e))
}
return a.join("")
};
AjxFormat.prototype.parse=function(o){
var t=this._createParseObject();
var e=0;
for(var a=0;
a<this._segments.length;
a++){
var n=this._segments[a];
e=n.parse(t,o,e)
}
if(e<o.length){
throw new AjxFormat.ParsingException(this,null,"input too long")
}
return t
};
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(e){
throw new AjxFormat.ParsingException(this,null,"not implemented")
};
AjxFormat._zeroPad=function(n,r,t,h){
n=typeof n=="string"?n:String(n);
if(n.length>=r){
return n
}
t=t||"0";
var e=[];
for(var o=n.length;
o<r;
o++){
e.push(t)
}
e[h?"unshift":"push"](n);
return e.join("")
};
AjxFormat.FormatException=function(t,e){
this._format=t;
this._message=e
};
AjxFormat.FormatException.prototype.toString=function(){
return this._message
};
AjxFormat.FormatException.prototype._format;
AjxFormat.FormatException.prototype._message;
AjxFormat.FormattingException=function(a,t,e){
AjxFormat.FormatException.call(this,a,e);
this._segment=t
};
AjxFormat.FormattingException.prototype=new AjxFormat.FormatException;
AjxFormat.FormattingException.prototype.constructor=AjxFormat.FormattingException;
AjxFormat.FormattingException.prototype._segment;
AjxFormat.ParsingException=function(a,t,e){
AjxFormat.FormatException.call(this,a,e);
this._segment=t
};
AjxFormat.ParsingException.prototype=new AjxFormat.FormatException;
AjxFormat.ParsingException.prototype.constructor=AjxFormat.ParsingException;
AjxFormat.ParsingException.prototype._segment;
AjxFormat.Segment=function(t,e){
this._parent=t;
this._s=e
};
AjxFormat.Segment.prototype.toString=function(){
return'segment: "'+this._s+'"'
};
AjxFormat.Segment.prototype._parent;
AjxFormat.Segment.prototype._s;
AjxFormat.Segment.prototype.format=function(e){
return this._s
};
AjxFormat.Segment.prototype.parse=function(a,t,e){
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 e;
if(this._index+1<this._parent._segments.length){
var t=this._parent._segments[this._index+1];
if(!(t instanceof AjxFormat.TextSegment)){
e=this._s.length
}}
return e
};
AjxFormat.Segment._parseLiteral=function(o,a,e){
if(a.length-e<o.length){
throw new AjxFormat.ParsingException(this._parent,this,"input too short")
}
for(var t=0;
t<o.length;
t++){
if(o.charAt(t)!=a.charAt(e+t)){
throw new AjxFormat.ParsingException(this._parent,this,"input doesn't match")
}}
return e+o.length
};
AjxFormat.Segment._parseLiterals=function(a,h,m,t,g,c){
for(var r=0;
r<t.length;
r++){
try{
var p=t[r];
var n=AjxFormat.Segment._parseLiteral(p,g,c);
if(h){
var u=a||window;
if(typeof h=="function"){
h.call(u,r+m)
}else{
u[h]=r+m
}}
return n
}
catch(d){}}
return -1
};
AjxFormat.Segment._parseInt=function(t,n,g,y,r,e,m){
var h=e||y.length-r;
var u=r;
for(var a=0;
a<h;
a++){
if(!y.charAt(r++).match(/\d/)){
r--;
break
}}
var d=r;
if(u==d){
throw new AjxFormat.ParsingException(this._parent,this,"number not present")
}
if(e&&d-u!=e){
throw new AjxFormat.ParsingException(this._parent,this,"number too short")
}
var p=parseInt(y.substring(u,d),m||10);
if(n){
var c=t||window;
if(typeof n=="function"){
n.call(c,p+g)
}else{
c[n]=p+g
}}
return d
};
AjxDateFormat=function(s){
AjxFormat.call(this,s);
if(typeof s=="number"){
switch(s){
case AjxDateFormat.SHORT:s=I18nMsg.formatDateShort;
break;
case AjxDateFormat.MEDIUM:s=I18nMsg.formatDateMedium;
break;
case AjxDateFormat.LONG:s=I18nMsg.formatDateLong;
break;
case AjxDateFormat.FULL:s=I18nMsg.formatDateFull;
break
}}
for(var a=0;
a<s.length;
a++){
var h=s.charAt(a);
if(h=="'"){
var t=a+1;
for(a++;
a<s.length;
a++){
var h=s.charAt(a);
if(h=="'"){
if(a+1<s.length&&s.charAt(a+1)=="'"){
s=s.substr(0,a)+s.substr(a+1)
}else{
break
}}}
if(a==s.length){}
var e=a;
var n=new AjxFormat.TextSegment(this,s.substring(t,e));
this._segments.push(n);
continue
}
var t=a;
while(a<s.length){
h=s.charAt(a);
if(AjxDateFormat._META_CHARS.indexOf(h)!=-1||h=="'"){
break
}
a++
}
var e=a;
if(t!=e){
var n=new AjxFormat.TextSegment(this,s.substring(t,e));
this._segments.push(n);
a--;
continue
}
var t=a;
while(++a<s.length){
if(s.charAt(a)!=h){
break
}}
var e=a--;
var o=e-t;
var r=s.substr(t,o);
var n=null;
switch(h){
case"G":n=new AjxDateFormat.EraSegment(this,r);
break;
case"y":n=new AjxDateFormat.YearSegment(this,r);
break;
case"M":n=new AjxDateFormat.MonthSegment(this,r);
break;
case"w":n=new AjxDateFormat.WeekSegment(this,r);
break;
case"W":n=new AjxDateFormat.WeekSegment(this,r);
break;
case"D":n=new AjxDateFormat.DaySegment(this,r);
break;
case"d":n=new AjxDateFormat.DaySegment(this,r);
break;
case"F":n=new AjxDateFormat.WeekdaySegment(this,r);
break;
case"E":n=new AjxDateFormat.WeekdaySegment(this,r);
break;
case"a":n=new AjxDateFormat.AmPmSegment(this,r);
break;
case"H":n=new AjxDateFormat.HourSegment(this,r);
break;
case"k":n=new AjxDateFormat.HourSegment(this,r);
break;
case"K":n=new AjxDateFormat.HourSegment(this,r);
break;
case"h":n=new AjxDateFormat.HourSegment(this,r);
break;
case"m":n=new AjxDateFormat.MinuteSegment(this,r);
break;
case"s":n=new AjxDateFormat.SecondSegment(this,r);
break;
case"S":n=new AjxDateFormat.SecondSegment(this,r);
break;
case"z":n=new AjxDateFormat.TimezoneSegment(this,r);
break;
case"Z":n=new AjxDateFormat.TimezoneSegment(this,r);
break
}
if(n!=null){
n._index=this._segments.length;
this._segments.push(n)
}}};
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.getDateInstance=function(e){
e=e!=null?e:AjxDateFormat.DEFAULT;
if(!AjxDateFormat._DATE_FORMATTERS[e]){
AjxDateFormat._DATE_FORMATTERS[e]=new AjxDateFormat(AjxDateFormat._dateFormats[e])
}
return AjxDateFormat._DATE_FORMATTERS[e]
};
AjxDateFormat.getTimeInstance=function(e){
e=e!=null?e:AjxDateFormat.DEFAULT;
if(!AjxDateFormat._TIME_FORMATTERS[e]){
AjxDateFormat._TIME_FORMATTERS[e]=new AjxDateFormat(AjxDateFormat._timeFormats[e])
}
return AjxDateFormat._TIME_FORMATTERS[e]
};
AjxDateFormat.getDateTimeInstance=function(e,t){
e=e!=null?e:AjxDateFormat.DEFAULT;
t=t!=null?t:AjxDateFormat.DEFAULT;
var o=e*10+t;
if(!AjxDateFormat._DATETIME_FORMATTERS[o]){
var n=I18nMsg.formatDateTime;
var s=[AjxDateFormat._dateFormats[e],AjxDateFormat._timeFormats[t]];
var a=AjxMessageFormat.format(n,s);
AjxDateFormat._DATETIME_FORMATTERS[o]=new AjxDateFormat(a)
}
return AjxDateFormat._DATETIME_FORMATTERS[o]
};
AjxDateFormat.format=function(t,e){
return new AjxDateFormat(t).format(e)
};
AjxDateFormat.parse=function(t,e){
return new AjxDateFormat(t).parse(e)
};
AjxDateFormat.initialize=function(){
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.MonthSegment.initialize();
AjxDateFormat.WeekdaySegment.initialize()
};
AjxDateFormat.prototype.parse=function(n){
var o=null;
try{
o=AjxFormat.prototype.parse.call(this,n);
var a=new Date(0,0,1,0,0,0,0);
if(o.year!=null){
a.setFullYear(o.year)
}
if(o.month!=null){
a.setMonth(o.month)
}
if(o.dayofmonth!=null){
a.setDate(o.dayofmonth)
}else{
if(o.dayofyear!=null){
a.setMonth(0,o.dayofyear)
}}
if(o.hours!=null){
a.setHours(o.hours)
}
if(o.minutes!=null){
a.setMinutes(o.minutes)
}
if(o.seconds!=null){
a.setSeconds(o.seconds)
}
if(o.milliseconds!=null){
a.setMilliseconds(o.milliseconds)
}
if(o.ampm!=null){
var t=a.getHours();
if(t==12&&o.ampm==0){
t=0
}else{
if(t!=12&&o.ampm==1){
t+=12
}}
a.setHours(t)
}
o=a
}
catch(r){}
return o
};
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(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(a,t,e){
return AjxFormat.Segment._parseLiteral(this._s,t,e)
};
AjxDateFormat.DateSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
AjxDateFormat.DateSegment.prototype=new AjxFormat.Segment;
AjxDateFormat.DateSegment.prototype.constructor=AjxDateFormat.DateSegment;
AjxDateFormat.EraSegment=function(t,e){
AjxDateFormat.DateSegment.call(this,t,e)
};
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(e){
return I18nMsg.eraAD
};
AjxDateFormat.YearSegment=function(t,e){
AjxDateFormat.DateSegment.call(this,t,e)
};
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(e){
var t=String(e.getFullYear());
return this._s.length<4?t.substr(t.length-2):AjxFormat._zeroPad(t,this._s.length)
};
AjxDateFormat.YearSegment.prototype.parse=function(a,d,n){
var e=this._getFixedLength();
var t=AjxFormat.Segment._parseInt(a,"year",0,d,n,e);
if(t-n==2){
if(!AjxDateFormat._2digitStartYear){
AjxDateFormat._2digitStartYear=parseInt(AjxMsg.dateParsing2DigitStartYear)
}
var h=AjxDateFormat._2digitStartYear;
var c=parseInt(d.substr(n,2),10);
var o=(Math.floor(h/100)+(c<(h%100)?1:0))*100;
var r=o+c;
a.year=r
}
return t
};
AjxDateFormat.MonthSegment=function(t,e){
AjxDateFormat.DateSegment.call(this,t,e)
};
AjxDateFormat.MonthSegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.MonthSegment.prototype.constructor=AjxDateFormat.MonthSegment;
AjxDateFormat.MonthSegment.prototype.toString=function(){
return'dateMonth: "'+this._s+'"'
};
AjxDateFormat.MonthSegment.initialize=function(){
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(e){
var t=e.getMonth();
switch(this._s.length){
case 1:return String(t+1);
case 2:return AjxFormat._zeroPad(t+1,2);
case 3:return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM][t];
case 5:return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT][t]
}
return AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG][t]
};
AjxDateFormat.MonthSegment.prototype.parse=function(a,n,t){
var e;
switch(this._s.length){
case 3:e=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
case 4:e=e||AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
case 5:e=e||AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
var o=AjxFormat.Segment._parseLiterals(a,"month",0,e,n,t);
if(o==-1){
throw new AjxFormat.ParsingException(this._parent,this,"no match")
}
return o
}
var r=this._getFixedLength();
return AjxFormat.Segment._parseInt(a,"month",-1,n,t,r)
};
AjxDateFormat.WeekSegment=function(t,e){
AjxDateFormat.DateSegment.call(this,t,e)
};
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(t){
var o=t.getYear();
var s=t.getMonth();
var e=t.getDate();
var r=/w/.test(this._s);
var n=new Date(o,r?0:s,1);
var a=0;
while(true){
a++;
if(n.getMonth()>s||(n.getMonth()==s&&n.getDate()>=e)){
break
}
n.setDate(n.getDate()+7)
}
return AjxFormat._zeroPad(a,this._s.length)
};
AjxDateFormat.WeekSegment.prototype.parse=function(t,a,e){
var o=this._getFixedLength();
return AjxFormat.Segment._parseInt(null,null,0,a,e,o)
};
AjxDateFormat.DaySegment=function(t,e){
AjxDateFormat.DateSegment.call(this,t,e)
};
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(t){
var n=t.getMonth();
var e=t.getDate();
if(/D/.test(this._s)&&n>0){
var a=t.getYear();
do{
var o=new Date(a,n,1);
o.setDate(0);
e+=o.getDate();
n--
}
while(n>0)
}
return AjxFormat._zeroPad(e,this._s.length)
};
AjxDateFormat.DaySegment.prototype.parse=function(t,o,e){
var n=this._getFixedLength();
var a=/D/.test(this._s)?"dayofyear":"dayofmonth";
return AjxFormat.Segment._parseInt(t,a,0,o,e,n)
};
AjxDateFormat.WeekdaySegment=function(t,e){
AjxDateFormat.DateSegment.call(this,t,e)
};
AjxDateFormat.WeekdaySegment.prototype=new AjxDateFormat.DateSegment;
AjxDateFormat.WeekdaySegment.prototype.constructor=AjxDateFormat.WeekdaySegment;
AjxDateFormat.DaySegment.prototype.toString=function(){
return'dateDay: "'+this._s+'"'
};
AjxDateFormat.WeekdaySegment.initialize=function(){
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(e){
var a=e.getDay();
if(/E/.test(this._s)){
var t;
switch(this._s.length){
case 4:t=AjxDateFormat.LONG;
break;
case 5:t=AjxDateFormat.SHORT;
break;
default:t=AjxDateFormat.MEDIUM
}
return AjxDateFormat.WeekdaySegment.WEEKDAYS[t][a]
}
return AjxFormat._zeroPad(a,this._s.length)
};
AjxDateFormat.WeekdaySegment.prototype.parse=function(a,n,t){
var e;
switch(this._s.length){
case 3:e=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
case 4:e=e||AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
case 5:e=e||AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
var o=AjxFormat.Segment._parseLiterals(null,null,0,e,n,t);
if(o==-1){
throw new AjxFormat.ParsingException(this._parent,this,"no match")
}
return o
}
var r=this._getFixedLength();
return AjxFormat.Segment._parseInt(null,null,0,n,t,r)
};
AjxDateFormat.TimeSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
AjxDateFormat.TimeSegment.prototype=new AjxFormat.Segment;
AjxDateFormat.TimeSegment.prototype.constructor=AjxDateFormat.TimeSegment;
AjxDateFormat.HourSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(t){
var e=t.getHours();
if(e>12&&/[hK]/.test(this._s)){
e-=12
}else{
if(e==0&&/[h]/.test(this._s)){
e=12
}}
return AjxFormat._zeroPad(e,this._s.length)
};
AjxDateFormat.HourSegment.prototype.parse=function(t,a,e){
var o=this._getFixedLength();
return AjxFormat.Segment._parseInt(t,"hours",0,a,e,o)
};
AjxDateFormat.MinuteSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(e){
var t=e.getMinutes();
return AjxFormat._zeroPad(t,this._s.length)
};
AjxDateFormat.MinuteSegment.prototype.parse=function(t,a,e){
var o=this._getFixedLength();
return AjxFormat.Segment._parseInt(t,"minutes",0,a,e,o)
};
AjxDateFormat.SecondSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(e){
var t=/s/.test(this._s)?e.getSeconds():e.getMilliseconds();
return AjxFormat._zeroPad(t,this._s.length)
};
AjxDateFormat.SecondSegment.prototype.parse=function(t,o,e){
var n=this._getFixedLength();
var a=/s/.test(this._s)?"seconds":"milliseconds";
return AjxFormat.Segment._parseInt(t,a,0,o,e,n)
};
AjxDateFormat.AmPmSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(t){
var e=t.getHours();
return e<12?I18nMsg.periodAm:I18nMsg.periodPm
};
AjxDateFormat.AmPmSegment.prototype.parse=function(t,o,e){
var n=[I18nMsg.periodAm.toLowerCase(),I18nMsg.periodPm.toLowerCase(),I18nMsg.periodAm.toUpperCase(),I18nMsg.periodPm.toUpperCase()];
var a=AjxFormat.Segment._parseLiterals(t,"ampm",0,n,o,e);
if(a==-1){
throw new AjxFormat.ParsingException(this._parent,this,"no match")
}
t.ampm=t.ampm%2;
return a
};
AjxDateFormat.TimezoneSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(t){
var e=t.timezone||AjxTimezone.DEFAULT;
if(/Z/.test(this._s)){
return AjxTimezone.getShortName(e)
}
return this._s.length<4?AjxTimezone.getMediumName(e):AjxTimezone.getLongName(e)
};
AjxMessageFormat=function(s){
if(!s){
return""
}
AjxFormat.call(this,s);
for(var t=0;
t<s.length;
t++){
var r=s.charAt(t);
if(r=="'"){
if(t+1<s.length&&s.charAt(t+1)=="'"){
var a=new AjxFormat.TextSegment(this,"'");
this._segments.push(a);
t++;
continue
}
var h=t+1;
for(t++;
t<s.length;
t++){
var r=s.charAt(t);
if(r=="'"){
if(t+1<s.length&&s.charAt(t+1)=="'"){
s=s.substr(0,t)+s.substr(t+1)
}else{
break
}}}
if(t==s.length){}
var n=t;
var a=new AjxFormat.TextSegment(this,s.substring(h,n));
this._segments.push(a);
continue
}
var h=t;
while(t<s.length){
r=s.charAt(t);
if(r=="{"||r=="'"){
break
}
t++
}
var n=t;
if(h!=n){
var a=new AjxFormat.TextSegment(this,s.substring(h,n));
this._segments.push(a);
t--;
continue
}
var h=t+1;
var e=0;
while(++t<s.length){
var r=s.charAt(t);
if(r=="{"){
e++
}else{
if(r=="}"){
if(e==0){
break
}
e--
}}}
var n=t;
var o=n-h;
var d=s.substr(h,o);
var a=new AjxMessageFormat.MessageSegment(this,d);
if(a!=null){
this._segments.push(a)
}}};
AjxMessageFormat.prototype=new AjxFormat;
AjxMessageFormat.prototype.constructor=AjxMessageFormat;
AjxMessageFormat.prototype.toString=function(){
return"[AjxMessageFormat: "+AjxFormat.prototype.toString.call(this)+"]"
};
AjxMessageFormat.format=function(e,t){
return new AjxMessageFormat(e).format(t)
};
AjxMessageFormat.prototype.format=function(e){
if(!(e instanceof Array)){
e=[e]
}
return AjxFormat.prototype.format.call(this,e)
};
AjxMessageFormat.prototype.getFormats=function(){
var e=[];
for(var t=0;
t<this._segments.length;
t++){
var a=this._segments[t];
if(a instanceof AjxMessageFormat.MessageSegment){
e.push(a.getSegmentFormat())
}}
return e
};
AjxMessageFormat.prototype.getFormatsByArgumentIndex=function(){
var e=[];
for(var t=0;
t<this._segments.length;
t++){
var a=this._segments[t];
if(a instanceof AjxMessageFormat.MessageSegment){
e[a.getIndex()]=a.getSegmentFormat()
}}
return e
};
AjxMessageFormat.MessageSegment=function(o,e){
AjxFormat.Segment.call(this,o,e);
var a=AjxMessageFormat.MessageSegment._split(e,",");
this._index=Number(a[0]);
this._type=a[1]||"string";
this._style=a[2];
if(this._type=="list"){
this._isList=true;
this._type=a[2]||"string";
this._style=a[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 t=this._type=="date"?AjxDateFormat.getDateInstance:AjxDateFormat.getTimeInstance;
switch(this._style){
case"short":this._formatter=t(AjxDateFormat.SHORT);
break;
case"medium":this._formatter=t(AjxDateFormat.MEDIUM);
break;
case"long":this._formatter=t(AjxDateFormat.LONG);
break;
case"full":this._formatter=t(AjxDateFormat.FULL);
break;
default:this._formatter=this._style==null?t(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 e=['message: "',this._s,'", index: ',this._index];
if(this._isList){
e.push(", list: ",this._isList)
}
if(this._type){
e.push(", type: ",this._type)
}
if(this._style){
e.push(", style: ",this._style)
}
if(this._formatter){
e.push(", formatter: ",this._formatter.toString())
}
return e.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(t){
var e=t[this._index];
if(this._formatter instanceof AjxChoiceFormat){
return this._formatter.format(t,this._index)
}
return this._formatter?this._formatter.format(e):String(e)
};
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(o,e){
var n=[];
var a=0;
var t;
var r=0;
for(t=0;
t<o.length;
t++){
var h=o.charAt(t);
if(h=="{"){
r++
}else{
if(h=="}"){
r--
}else{
if(h==e&&r==0){
n.push(o.substring(a,t));
a=t+1
}}}}
if(t>a){
n.push(o.substring(a,t))
}
return n
};
AjxNumberFormat=function(y,w){
AjxFormat.call(this,y);
if(y==""){
return
}
var a=y.split(/;/);
var y=a[0];
var p=0;
var m=this.__parseStatic(y,p);
p=m.offset;
var s=m.text!="";
if(s){
this._segments.push(new AjxFormat.TextSegment(this,m.text))
}
var r=p;
while(p<y.length&&AjxNumberFormat._META_CHARS.indexOf(y.charAt(p))!=-1){
p++
}
var n=p;
var t=y.substring(r,n);
var v=t.indexOf("E");
var d=v!=-1?t.substring(v+1):null;
if(d){
t=t.substring(0,v);
this._showExponent=true
}
var u=t.indexOf(".");
var k=u!=-1?t.substring(0,u):t;
if(k){
var x=k.lastIndexOf(",");
if(x!=-1){
this._groupingOffset=k.length-x-1
}
k=k.replace(/[^#0]/g,"");
var c=k.indexOf("0");
if(c!=-1){
this._minIntDigits=k.length-c
}
this._maxIntDigits=k.length
}
var g=u!=-1?t.substring(u+1):null;
if(g){
var c=g.lastIndexOf("0");
if(c!=-1){
this._minFracDigits=c+1
}
this._maxFracDigits=g.replace(/[^#0]/g,"").length
}
this._segments.push(new AjxNumberFormat.NumberSegment(this,t));
var m=this.__parseStatic(y,p);
p=m.offset;
if(m.text!=""){
this._segments.push(new AjxFormat.TextSegment(this,m.text))
}
if(w){
return
}
if(a.length>1){
var y=a[1];
this._negativeFormatter=new AjxNumberFormat(y,true)
}else{
var f=new AjxNumberFormat("");
f._segments=f._segments.concat(this._segments);
var h=s?1:0;
var o=new AjxFormat.TextSegment(f,I18nMsg.numberSignMinus);
f._segments.splice(h,0,o);
this._negativeFormatter=f
}};
AjxNumberFormat.prototype=new AjxFormat;
AjxNumberFormat.prototype.constructor=AjxNumberFormat;
AjxNumberFormat.prototype.toString=function(){
var e=["[AjxNumberFormat: ","formatter=",AjxFormat.prototype.toString.call(this)];
if(this._negativeFormatter){
e.push(", negativeFormatter=",this._negativeFormatter.toString())
}
e.push("]");
return e.join("")
};
AjxNumberFormat._NUMBER="number";
AjxNumberFormat._INTEGER="integer";
AjxNumberFormat._CURRENCY="currency";
AjxNumberFormat._PERCENT="percent";
AjxNumberFormat._META_CHARS="0#.,E";
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(t,e){
return new AjxNumberFormat(t).format(e)
};
AjxNumberFormat.initialize=function(){
AjxNumberFormat._FORMATTERS={}
};
AjxNumberFormat.prototype.format=function(e){
if(e<0&&this._negativeFormatter){
return this._negativeFormatter.format(e)
}
return AjxFormat.prototype.format.call(this,e)
};
AjxNumberFormat.prototype.__parseStatic=function(a,t){
var o=[];
while(t<a.length){
var r=a.charAt(t++);
if(AjxNumberFormat._META_CHARS.indexOf(r)!=-1){
t--;
break
}
switch(r){
case"'":var n=t;
while(t<a.length&&a.charAt(t++)!="'"){}
var e=t;
r=e-n==0?"'":a.substring(n,e);
break;
case"%":r=I18nMsg.numberSignPercent;
this._isPercent=true;
break;
case"\u2030":r=I18nMsg.numberSignPerMill;
this._isPerMille=true;
break;
case"\u00a4":r=a.charAt(t)=="\u00a4"?I18nMsg.currencyCode:I18nMsg.currencySymbol;
this._isCurrency=true;
break
}
o.push(r)
}
return{
text:o.join(""),offset:t}
};
AjxNumberFormat.NumberSegment=function(t,e){
AjxFormat.Segment.call(this,t,e)
};
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(t){
if(isNaN(t)){
return I18nMsg.numberNaN
}
if(t===Number.NEGATIVE_INFINITY||t===Number.POSITIVE_INFINITY){
return I18nMsg.numberInfinity
}
if(typeof t!="number"){
t=Number(t)
}
t=Math.abs(t);
if(this._parent._isPercent){
t*=100
}else{
if(this._parent._isPerMille){
t*=1000
}}
var e=this._parent._showExponent?t.toExponential(this._parent._maxFracDigits).toUpperCase().replace(/E\+/,"E"):t.toFixed(this._parent._maxFracDigits||0);
e=this._normalize(e);
return e
};
AjxNumberFormat.NumberSegment.prototype._normalize=function(r){
var o=r.split(/[\.Ee]/);
var h=o.shift();
if(h.length<this._parent._minIntDigits){
h=AjxFormat._zeroPad(h,this._parent._minIntDigits,I18nMsg.numberZero)
}
if(h.length>this._parent._groupingOffset){
var t=[];
var n=h.length-this._parent._groupingOffset;
while(n>0){
t.unshift(h.substr(n,this._parent._groupingOffset));
t.unshift(I18nMsg.numberSeparatorGrouping);
n-=this._parent._groupingOffset
}
t.unshift(h.substring(0,n+this._parent._groupingOffset));
h=t.join("")
}
var c="0";
var d;
if(r.match(/\./)){
c=o.shift()
}else{
if(r.match(/\e/)||r.match(/\E/)){
d=o.shift()
}}
c=c.replace(/0+$/,"");
if(c.length<this._parent._minFracDigits){
c=AjxFormat._zeroPad(c,this._parent._minFracDigits,I18nMsg.numberZero,true)
}
var t=[h];
if(c.length>0){
var e=this._parent._isCurrency?I18nMsg.numberSeparatorMoneyDecimal:I18nMsg.numberSeparatorDecimal;
t.push(e,c)
}
if(d){
t.push("E",d.replace(/^\+/,""))
}
return t.join("")
};
AjxChoiceFormat=function(s){
AjxFormat.call(this,s);
var c=s.split("|");
if(arguments.length==1){
this._limits=new Array(c.length);
this._lessThan=new Array(c.length);
this._formats=new Array(c.length);
var r=new RegExp("^([^#<\u2264]+)([#<\u2264])(.*)$");
for(var a=0;
a<c.length;
a++){
var t=c[a];
var o=r.exec(t);
var e=o[1];
var n=o[2];
var h=o[3];
if(e=="\u221E"){
this._limits[a]=Number.POSITIVE_INFINITY
}else{
if(e=="-\u221E"){
this._limits[a]=Number.NEGATIVE_INFINITY
}else{
this._limits[a]=parseFloat(e)
}}
this._lessThan[a]=n=="#"||n=="\u2264";
this._formats[a]=new AjxMessageFormat(h)
}}else{
this._limits=arguments[0];
this._lessThan=new Array(arguments[0].length);
this._formats=arguments[1];
this._pattern=[];
for(var a=0;
a<this._formats.length;
a++){
if(a>0){
this._pattern.push("|")
}
this._pattern.push(this._limits[a],"#",this._formats[a]);
this._lessThan[a]=false;
this._formats[a]=new AjxMessageFormat(this._formats[a])
}
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(e,n){
var o=e instanceof Array?e[n]:e;
var c;
if(isNaN(o)||o<this._limits[0]){
c=this._formats[0]
}else{
for(var t=0;
t<this._limits.length-1;
t++){
var h=this._limits[t];
var r=this._limits[t+1];
var d=o>=h;
var s=this._lessThan[t+1]?o<r:o<=r;
if(d&&s){
c=this._formats[t];
break
}}
if(!c){
c=this._formats[this._formats.length-1]
}}
return c.format(e)
};
AjxListFormat=function(e,a,t){
AjxFormat.call(this,e?e.toPattern():"");
this._formatter=e;
this._separator=a||AjxMsg.listSeparator;
this._lastSeparator=t||AjxMsg.listSeparatorLast
};
AjxListFormat.prototype=new AjxFormat;
AjxListFormat.prototype.constructor=AjxListFormat;
AjxListFormat.prototype._formatter;
AjxListFormat.prototype._separator;
AjxListFormat.prototype._lastSeparator;
AjxListFormat.prototype.format=function(o){
o=o instanceof Array?o:[o];
var a=[];
for(var e=0;
e<o.length;
e++){
if(e>0){
a.push(e<o.length-1?this._separator:this._lastSeparator)
}
var t=o[e];
a.push(this._formatter?this._formatter.format(t):String(t))
}
return a.join("")
};
AjxFormat.initialize()
}
if(AjxPackage.define("ajax.util.AjxDateUtil")){
AjxDateUtil=function(){};
AjxDateUtil.YEAR=1;
AjxDateUtil.MONTH=2;
AjxDateUtil.WEEK=3;
AjxDateUtil.DAY=4;
AjxDateUtil.TWO_WEEKS=5;
AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES=900000;
AjxDateUtil.MSEC_PER_HALF_HOUR=1800000;
AjxDateUtil.MSEC_PER_HOUR=3600000;
AjxDateUtil.MSEC_PER_DAY=24*AjxDateUtil.MSEC_PER_HOUR;
AjxDateUtil.WEEKDAY_SHORT=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
AjxDateUtil.WEEKDAY_MEDIUM=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
AjxDateUtil.WEEKDAY_LONG=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
AjxDateUtil.MONTH_SHORT=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
AjxDateUtil.MONTH_MEDIUM=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
AjxDateUtil.MONTH_LONG=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
AjxDateUtil._daysPerMonth={
0:31,1:29,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31};
AjxDateUtil.WEEK_ONE_JAN_DATE=1;
AjxDateUtil._init=function(){
AjxDateUtil._dateFormat=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT).clone();
var e=AjxDateUtil._dateFormat.getSegments();
for(var t=0;
t<e.length;
t++){
if(e[t] instanceof AjxDateFormat.YearSegment){
e[t]=new AjxDateFormat.YearSegment(AjxDateUtil._dateFormat,"yyyy")
}}
AjxDateUtil._dateTimeFormat=new AjxDateFormat(AjxDateUtil._dateFormat.toPattern()+" "+AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT));
AjxDateUtil._dateFormatNoYear=new AjxDateFormat(AjxMsg.formatDateMediumNoYear)
};
AjxDateUtil._init();
AjxDateUtil.validDate=function(n,e,o){
var t=new Date(n,e,o);
var a=n>999?t.getFullYear():t.getYear();
return t.getMonth()==e&&t.getDate()==o&&a==n
};
AjxDateUtil.daysInMonth=function(a,e){
var t=new Date(a,e,1,12);
t.setMonth(t.getMonth()+1);
t.setDate(t.getDate()-1);
return t.getDate()
};
AjxDateUtil.isLeapYear=function(e){
return(new Date(e,1,29)).getMonth()==1
};
AjxDateUtil.isLocale24Hour=function(){
var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
var e=t._segments.length;
for(var a=0;
a<e;
a++){
if(t._segments[a]._s=="a"){
return false
}}
return true
};
AjxDateUtil.roll=function(t,a,n){
var o=t.getDate();
if(a==AjxDateUtil.MONTH){
t.setDate(1);
t.setMonth(t.getMonth()+n);
var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
t.setDate(Math.min(o,e))
}else{
if(a==AjxDateUtil.YEAR){
t.setDate(1);
t.setFullYear(t.getFullYear()+n);
var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
t.setDate(Math.min(o,e))
}else{
if(a==AjxDateUtil.WEEK){
t.setDate(t.getDate()+7*n)
}else{
if(a==AjxDateUtil.DAY){
t.setDate(t.getDate()+n)
}else{
if(a==AjxDateUtil.TWO_WEEKS){
t.setDate(t.getDate()+14*n)
}else{
return t
}}}}}
return t
};
AjxDateUtil.computeDateDelta=function(e){
var t=(new Date()).getTime()-e;
var a=AjxDateUtil.computeDuration(t);
return a?(a+" "+AjxMsg.ago):null
};
AjxDateUtil.computeDuration=function(a,c){
if(a<0){
return null
}
var n=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*365));
if(n!=0){
a-=n*AjxDateUtil.MSEC_PER_DAY*365
}
var t=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*30.42));
if(t>0){
a-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
}
var h=Math.floor(a/AjxDateUtil.MSEC_PER_DAY);
if(h>0){
a-=h*AjxDateUtil.MSEC_PER_DAY
}
var s=Math.floor(a/AjxDateUtil.MSEC_PER_HOUR);
if(s>0){
a-=s*AjxDateUtil.MSEC_PER_HOUR
}
var e=Math.floor(a/60000);
if(e>0){
a-=e*60000
}
var o=Math.floor(a/1000);
var r=c?AjxDurationFormatConcise:AjxDurationFormatVerbose;
if(n>0){
return r.formatYears(n,t)
}else{
if(t>0){
return r.formatMonths(t,h)
}else{
if(h>0){
return r.formatDays(h,s)
}else{
if(s>0){
return r.formatHours(s,e)
}else{
if(e>0){
return r.formatMinutes(e,o)
}else{
return r.formatSeconds(o)
}}}}}};
AjxDateUtil.simpleComputeDateStr=function(t,a){
var e=AjxDateUtil._dateFormat.format(t);
return a?a+e:e
};
AjxDateUtil.simpleParseDateStr=function(e){
return AjxDateUtil._dateFormat.parse(e)
};
AjxDateUtil.simpleComputeDateTimeStr=function(t,a){
var e=AjxDateUtil._dateTimeFormat.format(t);
return a?a+e:e
};
AjxDateUtil.simpleParseDateTimeStr=function(e){
return AjxDateUtil._dateTimeFormat.parse(e)
};
AjxDateUtil.longComputeDateStr=function(e){
var t=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
return t.format(e)
};
AjxDateUtil.computeDateStr=function(a,t){
if(t==null){
return""
}
var e=new Date(t);
if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
return AjxDateUtil.computeTimeString(e)
}
if(a.getFullYear()==e.getFullYear()){
return AjxDateUtil._dateFormatNoYear.format(e)
}
return AjxDateUtil.simpleComputeDateStr(e)
};
AjxDateUtil.computeWordyDateStr=function(a,t){
if(t==null){
return""
}
var e=new Date(t);
if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
if(!AjxDateUtil._wordyDateToday){
AjxDateUtil._wordyDateToday=new AjxDateFormat(AjxMsg.formatWordyDateToday)
}
return AjxDateUtil._wordyDateToday.format(e)
}else{
if((a.getTime()-t)<(2*AjxDateUtil.MSEC_PER_DAY)&&(a.getDay()-1)==e.getDay()){
if(!AjxDateUtil._wordyDateYesterday){
AjxDateUtil._wordyDateYesterday=new AjxDateFormat(AjxMsg.formatWordyDateYesterday)
}
return AjxDateUtil._wordyDateYesterday.format(e)
}else{
if(!AjxDateUtil._wordyDate){
AjxDateUtil._wordyDate=new AjxDateFormat(AjxMsg.formatWordyDate)
}
return AjxDateUtil._wordyDate.format(e)
}}};
AjxDateUtil.computeTimeString=function(e){
var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
return t.format(e)
};
AjxDateUtil.computeDateTimeString=function(e){
var t=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG);
return t.format(e)
};
AjxDateUtil._getHoursStr=function(t,a,e){
var o=t.getHours();
if(!e){
o%=12;
if(o==0){
o=12
}}
return a?AjxDateUtil._pad(o):o
};
AjxDateUtil._getMinutesStr=function(e){
return AjxDateUtil._pad(e.getMinutes())
};
AjxDateUtil._getSecondsStr=function(e){
return AjxDateUtil._pad(e.getSeconds())
};
AjxDateUtil._getAMPM=function(t,a){
var e=t.getHours();
return(e<12)?(a?"AM":"am"):(a?"PM":"pm")
};
AjxDateUtil._getMonthName=function(e,t){
return t?AjxDateUtil.MONTH_MEDIUM[e.getMonth()]:AjxDateUtil.MONTH_LONG[e.getMonth()]
};
AjxDateUtil._getMonth=function(e,a){
var t=e.getMonth()+1;
if(a){
return AjxDateUtil._pad(t)
}else{
return t
}};
AjxDateUtil._getDate=function(e,t){
var a=e.getDate();
return t?AjxDateUtil._pad(a):a
};
AjxDateUtil._getWeekday=function(e){
var t=e.getDay();
return AjxDateUtil.WEEKDAY_LONG[t]
};
AjxDateUtil._getWeekdayMedium=function(e){
var t=e.getDay();
return AjxDateUtil.WEEKDAY_MEDIUM[t]
};
AjxDateUtil._getFullYear=function(e){
return e.getFullYear()
};
AjxDateUtil.getFirstDayOfWeek=function(o,e){
e=e||0;
var t=o.getDay();
var a=(t-e+7)%7;
o.setDate(o.getDate()-a);
return o
};
AjxDateUtil.getWeekNumber=function(y,d,j,k){
d=d||0;
j=j||AjxDateUtil.WEEK_ONE_JAN_DATE;
y=y||new Date();
y.setHours(12,0,0,0);
var n=y,q,h;
if(n.getDay()===d){
q=n
}else{
q=AjxDateUtil.getFirstDayOfWeek(n,d)
}
var m=q.getFullYear(),c=q.getTime();
h=new Date(q.getTime()+6*AjxDateUtil.MSEC_PER_DAY);
var e;
if(!k){
if(m!==h.getFullYear()&&h.getDate()>=j){
e=1
}else{
var s=(new Date(m,0,j));
s.setHours(12,0,0,0);
var o=AjxDateUtil.getFirstDayOfWeek(s,d);
var p=Math.round((n.getTime()-o.getTime())/AjxDateUtil.MSEC_PER_DAY);
var t=p%7;
var x=(p-t)/7;
e=x+1
}
return e
}else{
var w=new Date(y.getFullYear(),0,1);
var f=w.getDay()-1;
f=(f>=0?f:f+7);
var a=Math.floor((y.getTime()-w.getTime()-(y.getTimezoneOffset()-w.getTimezoneOffset())*60000)/AjxDateUtil.MSEC_PER_DAY)+1;
if(f<4){
e=Math.floor((a+f-1)/7)+1;
if(e>52){
var v=new Date(y.getFullYear()+1,0,1);
var g=v.getDay()-1;
g=g>=0?g:g+7;
e=g<4?1:53
}}else{
e=Math.floor((a+f-1)/7);
if(e==0){
var r=new Date(y.getFullYear()-1,0,1);
var u=r.getDay()-1;
u=(u>=0?u:u+7);
e=(u==3||(AjxDateUtil.isLeapYear(r.getFullYear())&&u==2))?53:52
}}
return e
}};
AjxDateUtil.getTimeStr=function(e,a){
var t=a;
t=t.replace(/%d/g,AjxDateUtil._getDate(e,true));
t=t.replace(/%D/g,AjxDateUtil._getDate(e,false));
t=t.replace(/%w/g,AjxDateUtil._getWeekday(e));
t=t.replace(/%M/g,AjxDateUtil._getMonthName(e));
t=t.replace(/%t/g,AjxDateUtil._getMonthName(e,true));
t=t.replace(/%n/g,AjxDateUtil._getMonth(e,true));
t=t.replace(/%Y/g,AjxDateUtil._getFullYear(e));
t=t.replace(/%h/g,AjxDateUtil._getHoursStr(e,false,false));
t=t.replace(/%H/g,AjxDateUtil._getHoursStr(e,true,false));
t=t.replace(/%m/g,AjxDateUtil._getMinutesStr(e));
t=t.replace(/%s/g,AjxDateUtil._getSecondsStr(e));
t=t.replace(/%P/g,AjxDateUtil._getAMPM(e,true));
t=t.replace(/%p/g,AjxDateUtil._getAMPM(e,false));
return t
};
AjxDateUtil.getRoundedMins=function(e,a){
var t=e.getMinutes();
if(t!=0&&a){
t=(Math.ceil((t/a)))*a
}
return t
};
AjxDateUtil.roundTimeMins=function(t,o){
var a=t.getMinutes();
var e=t.getHours();
if(a!=0&&o){
a=(Math.ceil((a/o)))*o;
if(a==60){
a=0;
e++
}
t.setMinutes(a);
t.setHours(e)
}
return t
};
AjxDateUtil.isInRange=function(o,t,a,e){
return(o<e&&t>a)
};
AjxDateUtil.getSimpleDateFormat=function(){
return AjxDateUtil._dateFormat
};
AjxDateUtil.getServerDate=function(e){
if(!AjxDateUtil._serverDateFormatter){
AjxDateUtil._serverDateFormatter=new AjxDateFormat("yyyyMMdd")
}
return AjxDateUtil._serverDateFormatter.format(e)
};
AjxDateUtil.getServerDateTime=function(t,o){
var e=t;
var a=null;
if(o){
if(!AjxDateUtil._serverDateTimeFormatterUTC){
AjxDateUtil._serverDateTimeFormatterUTC=new AjxDateFormat("yyyyMMdd'T'HHmmss'Z'")
}
a=AjxDateUtil._serverDateTimeFormatterUTC;
e=new Date(t.getTime());
e.setMinutes(e.getMinutes()+e.getTimezoneOffset())
}else{
if(!AjxDateUtil._serverDateTimeFormatter){
AjxDateUtil._serverDateTimeFormatter=new AjxDateFormat("yyyyMMdd'T'HHmmss")
}
a=AjxDateUtil._serverDateTimeFormatter
}
return a.format(e)
};
AjxDateUtil.parseServerTime=function(o,e){
if(o.charAt(8)=="T"){
var a=parseInt(o.substr(9,2),10);
var n=parseInt(o.substr(11,2),10);
var t=parseInt(o.substr(13,2),10);
if(o.charAt(15)=="Z"){
n+=AjxTimezone.getOffset(AjxTimezone.DEFAULT,e)
}
e.setHours(a,n,t,0)
}
return e
};
AjxDateUtil.parseServerDateTime=function(t){
if(t==null){
return null
}
var a=new Date();
var n=parseInt(t.substr(0,4),10);
var o=parseInt(t.substr(4,2),10);
var e=parseInt(t.substr(6,2),10);
a.setFullYear(n);
a.setMonth(o-1);
a.setMonth(o-1);
a.setDate(e);
AjxDateUtil.parseServerTime(t,a);
return a
};
AjxDateUtil._pad=function(e){
return e<10?("0"+e):e
};
AjxDurationFormatVerbose=function(){};
AjxDurationFormatVerbose.formatYears=function(a,e){
var t=a+" ";
t+=(a>1)?AjxMsg.years:AjxMsg.year;
if(a<=3&&e>0){
t+=" "+e;
t+=" "+((e>1)?AjxMsg.months:AjxMsg.months)
}
return t
};
AjxDurationFormatVerbose.formatMonths=function(e,a){
var t=e+" ";
t+=(e>1)?AjxMsg.months:AjxMsg.month;
if(e<=3&&a>0){
t+=" "+a;
t+=" "+((a>1)?AjxMsg.days:AjxMsg.day)
}
return t
};
AjxDurationFormatVerbose.formatDays=function(a,e){
var t=a+" ";
t+=(a>1)?AjxMsg.days:AjxMsg.day;
if(a<=2&&e>0){
t+=" "+e;
t+=" "+((e>1)?AjxMsg.hours:AjxMsg.hour)
}
return t
};
AjxDurationFormatVerbose.formatHours=function(e,a){
var t=e+" ";
t+=(e>1)?AjxMsg.hours:AjxMsg.hour;
if(e<5&&a>0){
t+=" "+a;
t+=" "+((a>1)?AjxMsg.minutes:AjxMsg.minute)
}
return t
};
AjxDurationFormatVerbose.formatMinutes=function(a,t){
var e=a+" ";
e+=((a>1)?AjxMsg.minutes:AjxMsg.minute);
if(a<5&&t>0){
e+=" "+t;
e+=" "+((t>1)?AjxMsg.seconds:AjxMsg.second)
}
return e
};
AjxDurationFormatVerbose.formatSeconds=function(e){
return(e+" "+((e>1)?AjxMsg.seconds:AjxMsg.second))
};
AjxDurationFormatConcise=function(){};
AjxDurationFormatConcise.formatYears=function(t,e){
return this._format(t,e)
};
AjxDurationFormatConcise.formatMonths=function(e,t){
return this._format(e,t)
};
AjxDurationFormatConcise.formatDays=function(t,e){
return this._format(t,e)
};
AjxDurationFormatConcise.formatHours=function(e,t){
return this._format(e,t)
};
AjxDurationFormatConcise.formatMinutes=function(t,e){
return this._format(t,e)
};
AjxDurationFormatConcise.formatSeconds=function(e){
return this._format(0,e)
};
AjxDurationFormatConcise._format=function(o,t){
var n=0;
var e=[];
e[n++]=o;
e[n++]=":";
if(t<10){
e[n++]="0"
}
e[n++]=t;
return e.join("")
};
AjxDateUtil.SUNDAY=0;
AjxDateUtil.MONDAY=1;
AjxDateUtil.TUESDAY=2;
AjxDateUtil.WEDNESDAY=3;
AjxDateUtil.THURSDAY=4;
AjxDateUtil.FRIDAY=5;
AjxDateUtil.SATURDAY=6;
AjxDateUtil.getDateForNextDay=function(t,n,o){
o=o||1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForNextWeekday(a,n);
if(e<o-1){
a.setDate(a.getDate()+1)
}}
return a
};
AjxDateUtil.getDateForNextWorkWeekDay=function(t,o){
o=o?o:1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForNextWorkWeekday(a);
if(e<o-1){
a.setDate(a.getDate()+1)
}}
return a
};
AjxDateUtil.getDateForThisDay=function(e,a,t){
if(t<0){
return AjxDateUtil.getDateForPrevDay(e,a,-t)
}else{
return AjxDateUtil.getDateForNextDay(e,a,t)
}};
AjxDateUtil.getDateForThisWorkWeekDay=function(e,t){
if(t<0){
return AjxDateUtil.getDateForPrevWorkWeekDay(e,-t)
}else{
return AjxDateUtil.getDateForNextWorkWeekDay(e,t)
}};
AjxDateUtil.getDateForPrevDay=function(t,n,o){
o=o||1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForPrevWeekday(a,n);
if(e<o-1){
a.setDate(a.getDate()-1)
}}
return a
};
AjxDateUtil.getDateForPrevWorkWeekDay=function(t,o){
o=o||1;
var a=new Date(t);
for(var e=0;
e<o;
e++){
a=AjxDateUtil._getDateForPrevWorkWeekday(a);
if(e<o-1){
a.setDate(a.getDate()-1)
}}
return a
};
AjxDateUtil._getDateForNextWeekday=function(a,n){
var e=new Date(a);
var t=a.getDay();
if(t==n){
return e
}
var o=(n-t);
if(o>0){
e.setDate(a.getDate()+o)
}else{
e.setDate(a.getDate()+(7+o))
}
return e
};
AjxDateUtil._getDateForNextWorkWeekday=function(a){
var e=new Date(a);
var t=a.getDay();
if(t==AjxDateUtil.SUNDAY){
e.setDate(a.getDate()+1)
}else{
if(t==AjxDateUtil.SATURDAY){
e.setDate(a.getDate()+2)
}}
return e
};
AjxDateUtil._getDateForPrevWeekday=function(a,n){
var e=new Date(a);
var t=a.getDay();
if(t==n){
return e
}
var o=(t-n);
if(o>0){
e.setDate(a.getDate()-o)
}else{
e.setDate(a.getDate()-(7+o))
}
return e
};
AjxDateUtil._getDateForPrevWorkWeekday=function(a){
var e=new Date(a);
var t=a.getDay();
if(t==AjxDateUtil.SUNDAY){
e.setDate(a.getDate()-2)
}else{
if(t==AjxDateUtil.SATURDAY){
e.setDate(a.getDate()-1)
}}
return e
};
AjxDateUtil.calculate=function(f,n){
if(!AjxDateUtil.__calculate_initialized){
AjxDateUtil.__calculate_initialized=true;
AjxDateUtil.__calculate_init()
}
var e=n||new Date;
f=f.replace(/^\s*|\s*$/,"").replace(/\s*=\s*/g,"=").replace(/\s*,\s*/g,",");
var p=f.split(/\s+/g);
var y,r,o,h,u,d,g,t;
for(var c=0;
c<p.length;
c++){
y=p[c];
if(y.match(AjxDateUtil.RE_COMMENT)){
break
}
if(y.match(AjxDateUtil.RE_NOW)){
n=new Date(e.getTime());
continue
}
if(r=y.match(AjxDateUtil.RE_ADD_NUMBER)){
o=r[1];
h=AjxDateUtil.__calculate_parseInt(r[2]);
u=p[++c];
d=o=="+"?h:h*-1;
AjxDateUtil.__calculate_add(n,u,d);
continue
}
if(r=y.match(AjxDateUtil.RE_ADD_WEEKORD)){
o=r[1];
g=r[2];
t=p[++c];
d=o=="+"?h:h*-1;
AjxDateUtil.__calculate_add_ordinal(n,u,d);
continue
}
if(r=y.match(AjxDateUtil.RE_SET)){
AjxDateUtil.__calculate_set(n,r[1],r[2]);
continue
}
n=AjxDateFormat.parse("yyyyy-MM-dd",y);
if(!n&&(n=AjxDateFormat.parse("yyyy-MM-dd'T'hh:mm:ss'Z'",y))){
n.setMinutes(n.getMinutes()-n.getTimezoneOffset())
}
if(!n){
n=AjxDateFormat.parse("yyyy-MM-dd'T'HH:mm:ss",y)
}
if(!n){
throw'invalid date pattern: "'+y+'"'
}}
return n
};
AjxDateUtil.S_DAYNAME=[AjxMsg["calc.dayname.sunday"],AjxMsg["calc.dayname.monday"],AjxMsg["calc.dayname.tuesday"],AjxMsg["calc.dayname.wednesday"],AjxMsg["calc.dayname.thursday"],AjxMsg["calc.dayname.friday"],AjxMsg["calc.dayname.saturday"]].join("|");
AjxDateUtil.S_MONTHNAME=[AjxMsg["calc.monthname.january"],AjxMsg["calc.monthname.february"],AjxMsg["calc.monthname.march"],AjxMsg["calc.monthname.april"],AjxMsg["calc.monthname.may"],AjxMsg["calc.monthname.june"],AjxMsg["calc.monthname.july"],AjxMsg["calc.monthname.august"],AjxMsg["calc.monthname.september"],AjxMsg["calc.monthname.october"],AjxMsg["calc.monthname.november"],AjxMsg["calc.monthname.december"]].join("|");
AjxDateUtil.S_WEEKORD=[AjxMsg["calc.ordinal.first"],AjxMsg["calc.ordinal.second"],AjxMsg["calc.ordinal.third"],AjxMsg["calc.ordinal.fourth"],AjxMsg["calc.ordinal.fifth"],AjxMsg["calc.ordinal.last"]].join("|");
AjxMsg["calc.now"]="now";
AjxMsg["calc.date"]="date";
AjxMsg["calc.duration.year"]="year|years";
AjxMsg["calc.duration.month"]="month|months";
AjxMsg["calc.duration.day"]="day|days";
AjxMsg["calc.duration.hour"]="hour|hours";
AjxMsg["calc.duration.minute"]="min|mins|minute|minutes";
AjxMsg["calc.duration.second"]="sec|secs|second|seconds";
AjxMsg["calc.duration.millisecond"]="milli|millis|millisecond|milliseconds";
AjxDateUtil.S_DURATION=[AjxMsg["calc.duration.year"],AjxMsg["calc.duration.month"],AjxMsg["calc.duration.day"],AjxMsg["calc.duration.hour"],AjxMsg["calc.duration.minute"],AjxMsg["calc.duration.second"],AjxMsg["calc.duration.millisecond"]].join("|");
AjxDateUtil.__calculate_init=function(){
AjxDateUtil.WEEKDAYS={};
var t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];
for(var o=0;
o<t.length;
o++){
var n=AjxMsg["calc.dayname."+t[o]].split("|");
for(var a=0;
a<n.length;
a++){
AjxDateUtil.WEEKDAYS[n[a].toLowerCase()]=o
}}
AjxDateUtil.MONTHNAME2MONTHNUM={};
var e=["january","february","march","april","may","june","july","august","september","october","november","december"];
for(var o=0;
o<e.length;
o++){
var s=AjxMsg["calc.monthname."+e[o]].split("|");
for(var a=0;
a<s.length;
a++){
AjxDateUtil.MONTHNAME2MONTHNUM[s[a].toLowerCase()]=o
}}
AjxDateUtil.RE_YEAR=new RegExp("^("+AjxMsg["calc.duration.year"]+")$","i");
AjxDateUtil.RE_MONTH=new RegExp("^("+AjxMsg["calc.duration.month"]+")$","i");
AjxDateUtil.RE_WEEK=new RegExp("^("+AjxMsg["calc.duration.week"]+")$","i");
AjxDateUtil.RE_DAY=new RegExp("^("+AjxMsg["calc.duration.day"]+")$","i");
AjxDateUtil.RE_HOUR=new RegExp("^("+AjxMsg["calc.duration.hour"]+")$","i");
AjxDateUtil.RE_MINUTE=new RegExp("^("+AjxMsg["calc.duration.minute"]+")$","i");
AjxDateUtil.RE_SECOND=new RegExp("^("+AjxMsg["calc.duration.second"]+")$","i");
AjxDateUtil.RE_MILLISECOND=new RegExp("^("+AjxMsg["calc.duration.millisecond"]+")$","i");
AjxDateUtil.RE_DATE=new RegExp("^("+AjxMsg["calc.date"]+")$","i");
AjxDateUtil.RE_DAYNAME=new RegExp("^("+AjxDateUtil.S_DAYNAME+")$","i");
AjxDateUtil.RE_MONTHNAME=new RegExp("^("+AjxDateUtil.S_MONTHNAME+")$","i");
AjxDateUtil.RE_WEEKORD=new RegExp("^("+AjxDateUtil.S_WEEKORD+")$","i");
AjxDateUtil.RE_COMMENT=/^#/;
AjxDateUtil.RE_NOW=new RegExp("^("+AjxMsg["calc.now"]+")$","i");
AjxDateUtil.RE_ADD_NUMBER=new RegExp("^([+\\-])(\\d+)$","i");
AjxDateUtil.RE_ADD_WEEKORD=new RegExp("^([+\\-])("+AjxDateUtil.S_WEEKORD+")$","i");
AjxDateUtil.RE_SET=new RegExp("^("+AjxDateUtil.S_DURATION+"|"+AjxMsg["calc.date"]+")=(.*)$","i")
};
AjxDateUtil.__calculate_normalizeFullWidthDigit=function(t){
var e="0".charCodeAt(0)+t.charCodeAt(0)-"\uff10".charCodeAt(0);
return String.fromCharCode(e)
};
AjxDateUtil.__calculate_replaceFullWidthDigit=function(e,t){
return AjxDateUtil.__calculate_normalizeFullWidthDigit(t)
};
AjxDateUtil.__calculate_parseInt=function(e){
e=e.replace(/([\uFF10-\uFF19])/g,AjxDateUtil.__calculate_normalizeFullWidthDigit);
return parseInt(e,10)
};
AjxDateUtil.__calculate_add=function(a,n,o){
if(n.match(AjxDateUtil.RE_YEAR)){
a.setFullYear(a.getFullYear()+o);
return
}
if(n.match(AjxDateUtil.RE_MONTH)){
var s=a.getMonth();
a.setMonth(s+o);
if(Math.abs(s+o)%12!=a.getMonth()){
a.setDate(0)
}
return
}
if(n.match(AjxDateUtil.RE_WEEK)){
a.setDate(a.getDate()+o*7);
return
}
if(n.match(AjxDateUtil.RE_DAY)){
a.setDate(a.getDate()+o);
return
}
if(n.match(AjxDateUtil.RE_HOUR)){
a.setHours(a.getHours()+o);
return
}
if(n.match(AjxDateUtil.RE_MINUTE)){
a.setMinutes(a.getMinutes()+o);
return
}
if(n.match(AjxDateUtil.RE_SECOND)){
a.setSeconds(a.getSeconds()+o);
return
}
if(n.match(AjxDateUtil.RE_MILLISECOND)){
a.setMilliseconds(a.getMilliseconds()+o);
return
}
if(n.match(AjxDateUtil.RE_MONTHNAME)){
var e=AjxDateUtil.MONTHNAME2MONTHNUM[n.toLowerCase()];
if(e<a.getMonth()){
o+=o>0?0:1
}else{
if(e>a.getMonth()){
o+=o>0?-1:0
}}
a.setFullYear(a.getFullYear()+o,e,1);
return
}
if(n.match(AjxDateUtil.RE_DAYNAME)){
var t=AjxDateUtil.WEEKDAYS[n.toLowerCase()];
if(t<a.getDay()){
o+=o>0?0:1
}else{
if(t>a.getDay()){
o+=o>0?-1:0
}}
a.setDate(a.getDate()+(t-a.getDay())+7*o);
return
}
throw"unknown type: "+n
};
AjxDateUtil.__calculate_add_ordinal=function(){
throw"TODO: not implemented"
};
AjxDateUtil.__calculate_set=function(t,a,o){
var e=o.split(/,/);
if(a.match(AjxDateUtil.RE_YEAR)){
e[0]=AjxDateUtil.__calculate_fullYear(e[0]);
if(e[1]!=null){
e[1]=AjxDateUtil.__calculate_month(e[1])
}
if(e[2]!=null){
e[2]=parseInt(e[2],10)
}
t.setFullYear.apply(t,e);
return
}
if(a.match(AjxDateUtil.RE_MONTH)){
e[0]=AjxDateUtil.__calculate_month(e[0]);
if(e[1]!=null){
e[1]=parseInt(e[1],10)
}
t.setMonth.apply(t,e);
return
}
if(a.match(AjxDateUtil.RE_DATE)){
e[0]=parseInt(e[0],10);
t.setDate.apply(t,e);
return
}
if(a.match(AjxDateUtil.RE_HOUR)){
e[0]=parseInt(e[0],10);
if(e[1]!=null){
e[1]=parseInt(e[1],10)
}
if(e[2]!=null){
e[2]=parseInt(e[2],10)
}
if(e[3]!=null){
e[3]=parseInt(e[3],10)
}
t.setHours.apply(t,e);
return
}
if(a.match(AjxDateUtil.RE_MINUTE)){
e[0]=parseInt(e[0],10);
if(e[1]!=null){
e[1]=parseInt(e[1],10)
}
if(e[2]!=null){
e[2]=parseInt(e[2],10)
}
t.setMinutes.apply(t,e);
return
}
if(a.match(AjxDateUtil.RE_SECOND)){
e[0]=parseInt(e[0],10);
if(e[1]!=null){
e[1]=parseInt(e[1],10)
}
t.setSeconds.apply(t,e);
return
}
if(a.match(AjxDateUtil.RE_MILLISECOND)){
t.setMilliseconds.apply(t,e);
return
}
throw"unknown type: "+a
};
AjxDateUtil.__calculate_fullYear=function(e){
if(e.length==2){
var t=new Date;
t.setYear(parseInt(e,10));
e=String(t.getFullYear()).substr(0,2)+e
}
return parseInt(e,10)
};
AjxDateUtil.__calculate_month=function(t){
var e=AjxDateUtil.MONTHNAME2MONTHNUM[t.toLowerCase()];
return e!=null?e:parseInt(t,10)-1
};
AjxDateUtil.__calculate_day=function(t){
var e=AjxDateUtil.WEEKDAYS[t.toLowerCase()];
return e!=null?e:parseInt(t,10)
}
}
if(AjxPackage.define("ajax.util.AjxSelectionManager")){
AjxSelectionManager=function(e){
this._owner=e
};
AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS=0;
AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS=1;
AjxSelectionManager.SELECT_TO_ANCHOR=2;
AjxSelectionManager.DESELECT_ALL=3;
AjxSelectionManager.SELECT_ALL=4;
AjxSelectionManager.prototype.getItems=function(){
if(this._selectedItems==null){
this._selectedItems=this._createItemsCollection()
}
return this._selectedItems
};
AjxSelectionManager.prototype.getLength=function(){
return this.getItems().length
};
AjxSelectionManager.prototype.getAnchor=function(){
if(this._anchor==null){
var e=this.getItems();
if(e.length>0){
this._anchor=e[0]
}}
return this._anchor
};
AjxSelectionManager.prototype.getCursor=function(){
if(this._cursor==null){
this._cursor=this.getAnchor()
}
return this._cursor
};
AjxSelectionManager.prototype.isSelected=function(e){
return this.getItems().binarySearch(e)!=-1
};
AjxSelectionManager.prototype.selectOneItem=function(e){
this.select(e,AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS)
};
AjxSelectionManager.prototype.toggleItem=function(e){
this.select(e,AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS)
};
AjxSelectionManager.prototype.selectFromAnchorToItem=function(e){
this.select(e,AjxSelectionManager.SELECT_TO_ANCHOR)
};
AjxSelectionManager.prototype.deselectAll=function(){
this.select(null,AjxSelectionManager.DESELECT_ALL)
};
AjxSelectionManager.prototype.selectAll=function(){
this.select(null,AjxSelectionManager.SELECT_ALL)
};
AjxSelectionManager.prototype.select=function(p,s){
this._setAnchorAndCursor(p,s);
var f=this._selectedItems;
var n=(f==null)?0:f.length;
this._selectedItems=null;
this._selectedItems=this._createItemsCollection();
var e=this._owner.getItemCount();
var m=false;
var o=false;
var d=false;
for(var h=0;
h<e;
++h){
var c=this._owner.getItem(h);
var u=this._isItemOldSelection(c,f);
var t=u;
switch(s){
case AjxSelectionManager.SELECT_TO_ANCHOR:if(this._anchor==null){
this._anchor=c
}
var a=(c==this._anchor||c==p);
var r=false;
if(!d&&a){
d=true;
r=true
}
t=d;
if((!r||this._anchor==p)&&d&&a){
d=false
}
break;
case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:t=(c==p);
break;
case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:if(c==p){
t=!u
}
break;
case AjxSelectionManager.DESELECT_ALL:t=false;
break;
case AjxSelectionManager.SELECT_ALL:t=true;
break
}
if(t){
this._selectedItems.add(c);
m=(this._selectedItems.length>1)
}
if(t!=u){
if(this._owner.itemSelectionChanged!=null){
this._owner.itemSelectionChanged(c,h,t)
}
o=true
}}
o=o||(n!=this._selectedItems.length);
if(m){
this._selectedItems.sort()
}
if(o&&this._owner.selectionChanged!=null){
this._owner.selectionChanged(p)
}};
AjxSelectionManager.prototype.removeItem=function(t){
if(this._selectedItems){
var e=this._selectedItems.binarySearch(t);
if(e>-1){
this._selectedItems.removeAt(e)
}}};
AjxSelectionManager.prototype._createItemsCollection=function(){
return new AjxVector()
};
AjxSelectionManager.prototype._isItemOldSelection=function(t,o){
var e=false;
if(o){
var a=o.binarySearch(t);
if(a>-1){
o.removeAt(a)
}
e=(a!=-1)
}
return e
};
AjxSelectionManager.prototype._setAnchorAndCursor=function(e,t){
switch(t){
case AjxSelectionManager.SELECT_TO_ANCHOR:this._cursor=e;
break;
case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:this._anchor=e;
this._cursor=e;
break;
case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:this._anchor=e;
this._cursor=e;
break;
case AjxSelectionManager.DESELECT_ALL:this._anchor=null;
this._cursor=null;
break;
case AjxSelectionManager.SELECT_ALL:return
}}
}
if(AjxPackage.define("ajax.net.AjxPost")){
AjxPost=function(e){
this._callback=null;
this._iframeId=e
};
AjxPost._reqIds=0;
AjxPost._outStandingRequests=new Object();
AjxPost.SC_CONTINUE=100;
AjxPost.SC_OK=200;
AjxPost.SC_ACCEPTED=202;
AjxPost.SC_NO_CONTENT=204;
AjxPost.SC_BAD_REQUEST=400;
AjxPost.SC_UNAUTHORIZED=401;
AjxPost.SC_REQUEST_TIMEOUT=408;
AjxPost.SC_CONFLICT=409;
AjxPost.SC_REQUEST_ENTITY_TOO_LARGE=413;
AjxPost.SC_INTERNAL_SERVER_ERROR=500;
AjxPost.SC_BAD_GATEWAY=502;
AjxPost.SC_SERVICE_UNAVAILABLE=503;
AjxPost.prototype.execute=function(d,e,c){
var u=e.getElementsByTagName("input");
var n=new Array();
for(var a=0;
a<u.length;
a++){
var m=u[a];
if(m.type=="file"){
n.push(m);
continue
}
if(m.name&&m.name.match(/^filename\d+$/)){
m.parentNode.removeChild(m);
a--;
continue
}}
for(var a=0;
a<n.length;
a++){
var o=document.createElement("input");
o.type="hidden";
o.name="filename"+(a+1);
o.value=n[a].value;
n[a].parentNode.insertBefore(o,n[a])
}
e.target=this._iframeId;
this._callback=d;
var h=new AjxPostRequest(e);
var t=new AjxTimedAction(this,this._onFailure,[h.id]);
var r=c?c:5000;
AjxPost._outStandingRequests[h.id]=h;
try{
h.send(t,r)
}
catch(s){
if(AjxEnv.isIE){
if(s.number==-2147024891){
throw new AjxException(ZmMsg.uploadErrorAccessDenied,s.number)
}}
throw s
}};
AjxPost.prototype._onFailure=function(t){
var e=AjxPost._outStandingRequests[t];
e.cancel();
delete AjxPost._outStandingRequests[t];
if(this._callback){
this._callback.run([404]);
this._callback=null
}};
AjxPost.prototype.loaded=function(e,a,o){
var t=AjxPost._outStandingRequests[a];
if(t&&!t.hasBeenCancelled()){
t.cancelTimeout()
}
delete AjxPost._outStandingRequests[a];
if(this._callback){
this._callback.run(e,o);
this._callback=null
}};
AjxPostRequest=function(t){
this.id=AjxPost._reqIds++;
this._cancelled=false;
this._form=t;
var e=t.elements.namedItem("requestId");
if(!e){
e=t.ownerDocument.createElement("input");
e.type="hidden";
e.name="requestId"
}
e.value=this.id;
t.appendChild(e)
};
AjxPostRequest.prototype.send=function(t,e){
this._form.submit()
};
AjxPostRequest.prototype.hasBeenCancelled=function(){
return this._cancelled
};
AjxPostRequest.prototype.cancelTimeout=function(){
AjxTimedAction.cancelAction(this._timeoutId)
};
AjxPostRequest.prototype.cancel=function(){
this._cancelled=true
}
}
if(AjxPackage.define("ajax.util.AjxBuffer")){
AjxBuffer=function(){
this.clear();
if(arguments.length>0){
arguments.join=this.buffer.join;
this.buffer[this.buffer.length]=arguments.join("")
}};
AjxBuffer.prototype.toString=function(){
return this.buffer.join("")
};
AjxBuffer.prototype.join=function(e){
if(e==null){
e=""
}
return this.buffer.join(e)
};
AjxBuffer.prototype.append=function(){
arguments.join=this.buffer.join;
this.buffer[this.buffer.length]=arguments.join("")
};
AjxBuffer.prototype.join=function(e){
return this.buffer.join(e)
};
AjxBuffer.prototype.set=function(e){
this.buffer=[e]
};
AjxBuffer.prototype.clear=function(){
this.buffer=[]
};
AjxBuffer.concat=function(){
arguments.join=Array.prototype.join;
return arguments.join("")
};
AjxBuffer.append=AjxBuffer.concat
}
if(AjxPackage.define("ajax.util.AjxTimezone")){
AjxTimezone=function(){};
AjxTimezone.getTransition=function(o,a){
var t=[a||new Date().getFullYear(),o.mon,1];
if(o.mday){
t[2]=o.mday
}else{
if(o.wkday){
var e=new Date(a,o.mon-1,1,o.hour,o.min,o.sec);
if(o.week==-1){
var s=new Date(new Date(e.getTime()).setMonth(o.mon,0));
var n=s.getDate();
var h=s.getDay()+1;
var r=h>=o.wkday?h-o.wkday:7-o.wkday-h;
t[2]=n-r
}else{
var h=e.getDay()+1;
var r=o.wkday==h?1:0;
t[2]=o.wkday+7*(o.week-r)-h+1
}}}
return t
};
AjxTimezone.createMDayTransition=function(e,a){
if(e instanceof Date){
a=a!=null?a:e.getTimezoneOffset();
e=[e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()]
}
var t={
offset:a,trans:e};
return AjxTimezone.addMDayTransition(t)
};
AjxTimezone.addMDayTransition=function(t){
var e=t.trans;
t.mon=e[1];
t.mday=e[2];
t.hour=e[3];
t.min=e[4];
t.sec=e[5];
return t
};
AjxTimezone.createWkDayTransition=function(e,a){
if(e instanceof Date){
a=a!=null?a:e.getTimezoneOffset();
e=[e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()]
}
var t={
offset:a,trans:e};
return AjxTimezone.addWkDayTransition(t)
};
AjxTimezone.addWkDayTransition=function(n){
var a=n.trans;
var o=a[1];
var h=a[2];
var t=Math.floor((h-1)/7);
var e=new Date(a[0],a[1]-1,a[2],12,0,0);
var r=new Date(new Date(e.getTime()).setMonth(o-1,0)).getDate();
var s=r-h<7;
n.mon=o;
n.week=s?-1:t+1;
n.wkday=e.getDay()+1;
n.hour=a[3];
n.min=a[4];
n.sec=a[5];
return n
};
AjxTimezone.createTransitionDate=function(o){
var e=new Date(AjxTimezoneData.TRANSITION_YEAR,o.mon-1,1,12,0,0);
if(o.mday){
e.setDate(o.mday)
}else{
if(o.week==-1){
e.setMonth(e.getMonth()+1,0);
for(var a=0;
a<7;
a++){
if(e.getDay()+1==o.wkday){
break
}
e.setDate(e.getDate()-1)
}}else{
for(var a=0;
a<7;
a++){
if(e.getDay()+1==o.wkday){
break
}
e.setDate(e.getDate()+1)
}
e.setDate(e.getDate()+7*(o.week-1))
}}
var t=[e.getFullYear(),e.getMonth()+1,e.getDate()];
return t
};
AjxTimezone.getZonePreferences=function(){
if(AjxTimezone._PREF_ZONE_DISPLAY){
var a=AjxTimezone._PREF_ZONE_DISPLAY.length;
var t=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(a!=t){
AjxTimezone._PREF_ZONE_DISPLAY=null
}}
if(!AjxTimezone._PREF_ZONE_DISPLAY){
AjxTimezone._PREF_ZONE_DISPLAY=[];
AjxTimezone.getAbbreviatedZoneChoices();
for(var e=0;
e<AjxTimezone._ABBR_ZONE_OPTIONS.length;
e++){
AjxTimezone._PREF_ZONE_DISPLAY.push(AjxTimezone._ABBR_ZONE_OPTIONS[e].displayValue)
}}
return AjxTimezone._PREF_ZONE_DISPLAY
};
AjxTimezone.getZonePreferencesOptions=function(){
if(AjxTimezone._PREF_ZONE_OPTIONS){
var a=AjxTimezone._PREF_ZONE_OPTIONS.length;
var t=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(a!=t){
AjxTimezone._PREF_ZONE_OPTIONS=null
}}
if(!AjxTimezone._PREF_ZONE_OPTIONS){
AjxTimezone._PREF_ZONE_OPTIONS=[];
AjxTimezone.getAbbreviatedZoneChoices();
for(var e=0;
e<AjxTimezone._ABBR_ZONE_OPTIONS.length;
e++){
AjxTimezone._PREF_ZONE_OPTIONS.push(AjxTimezone._ABBR_ZONE_OPTIONS[e].serverid)
}}
return AjxTimezone._PREF_ZONE_OPTIONS
};
AjxTimezone.getServerId=function(e){
return AjxTimezone._CLIENT2SERVER[e]||e
};
AjxTimezone.getClientId=function(e){
return AjxTimezone._SERVER2CLIENT[e]||e
};
AjxTimezone.getShortName=function(e){
var t=AjxTimezone.getRule(e);
if(!t.shortName){
t.shortName=["GMT",AjxTimezone._SHORT_NAMES[e]].join("")
}
return t.shortName
};
AjxTimezone.getMediumName=function(e){
var t=AjxTimezone.getRule(e);
if(!t.mediumName){
t.mediumName=AjxMsg[e]||["(",AjxTimezone.getShortName(e),") ",e].join("")
}
return t.mediumName
};
AjxTimezone.getLongName=AjxTimezone.getMediumName;
AjxTimezone.addRule=function(a){
var t=a.serverId;
var e=a.clientId;
AjxTimezone._CLIENT2SERVER[e]=t;
AjxTimezone._SERVER2CLIENT[t]=e;
AjxTimezone._SHORT_NAMES[e]=AjxTimezone._generateShortName(a.standard.offset);
AjxTimezone._CLIENT2RULE[e]=a;
var o=a.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
o.push(a)
};
AjxTimezone.getRule=function(e,o){
var d=AjxTimezone._CLIENT2RULE[e];
if(!d){
e=AjxTimezone._SERVER2CLIENT[e];
d=AjxTimezone._CLIENT2RULE[e]
}
if(!d&&o){
var c=["standard","daylight"];
var u=o.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
for(var s=0;
s<u.length;
s++){
d=u[s];
var m=true;
for(var n=0;
n<c.length;
n++){
var t=c[n];
var r=d[t];
if(!r){
continue
}
var h=false;
for(var a in o[t]){
if(o[t][a]!=r[a]){
m=false;
h=true;
break
}}
if(h){
break
}}
if(m){
return d
}}
return null
}
return d
};
AjxTimezone.getOffset=function(e,n){
var f=AjxTimezone.getRule(e||AjxTimezone.DEFAULT);
if(f&&f.daylight){
var u=n.getFullYear();
var r=f.standard,t=f.daylight;
var d=AjxTimezone.getTransition(r,u);
var g=AjxTimezone.getTransition(t,u);
var c=n.getMonth()+1,m=n.getDate();
var s=d[1],p=d[2];
var h=g[1],o=g[2];
var a=false;
if(h<s){
a=c>h&&c<s;
a=a||(c==h&&m>=o);
a=a||(c==s&&m<p)
}else{
a=c<h||c>s;
a=a||(c==h&&m<o);
a=a||(c==s&&m>=p)
}
return a?t.offset:r.offset
}
return f?f.standard.offset:-(new Date().getTimezoneOffset())
};
AjxTimezone.guessMachineTimezone=function(){
return AjxTimezone._guessMachineTimezone().clientId
};
AjxTimezone.getAbbreviatedZoneChoices=function(){
if(AjxTimezone._ABBR_ZONE_OPTIONS){
var n=AjxTimezone._ABBR_ZONE_OPTIONS.length;
var o=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(n!=o){
AjxTimezone._ABBR_ZONE_OPTIONS=null
}}
if(!AjxTimezone._ABBR_ZONE_OPTIONS){
AjxTimezone._ABBR_ZONE_OPTIONS=[];
for(var e in AjxTimezone._CLIENT2SERVER){
var s=AjxTimezone._CLIENT2RULE[e];
var t=s.serverId;
var a={
displayValue:AjxTimezone.getMediumName(e),value:t,standard:s.standard,serverid:t,clientId:e};
AjxTimezone._ABBR_ZONE_OPTIONS.push(a)
}
AjxTimezone._ABBR_ZONE_OPTIONS.sort(AjxTimezone._BY_OFFSET)
}
return AjxTimezone._ABBR_ZONE_OPTIONS
};
AjxTimezone.getMatchingTimezoneChoices=function(){
if(AjxTimezone._MATCHING_ZONE_OPTIONS){
var s=AjxTimezone._MATCHING_ZONE_OPTIONS.length;
var n=AjxTimezone.STANDARD_RULES.length+AjxTimezone.DAYLIGHT_RULES.length;
if(s!=n){
AjxTimezone._MATCHING_ZONE_OPTIONS=null
}}
if(!AjxTimezone._MATCHING_ZONE_OPTIONS){
AjxTimezone._MATCHING_ZONE_OPTIONS=[];
for(var a in AjxTimezone.MATCHING_RULES){
var r=AjxTimezone.MATCHING_RULES[a];
var e=r.clientId;
var t=r.serverId;
if(e==AjxTimezone.AUTO_DETECTED){
continue
}
var o={
displayValue:AjxTimezone.getMediumName(e),value:t,standard:r.standard,serverid:t,clientId:e};
AjxTimezone._MATCHING_ZONE_OPTIONS.push(o)
}
AjxTimezone._MATCHING_ZONE_OPTIONS.sort(AjxTimezone._BY_OFFSET)
}
return AjxTimezone._MATCHING_ZONE_OPTIONS
};
AjxTimezone._BY_OFFSET=function(a,t){
var n=a.standard.offset-t.standard.offset;
if(n==0){
var e=a.serverId;
var o=t.serverId;
if(e<o){
n=-1
}else{
if(e>o){
n=1
}}}
return n
};
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 e=0;
e<AjxTimezoneData.TIMEZONE_RULES.length;
e++){
var t=AjxTimezoneData.TIMEZONE_RULES[e];
var a=t.daylight?AjxTimezone.DAYLIGHT_RULES:AjxTimezone.STANDARD_RULES;
a.push(t)
}}
)();
AjxTimezone._guessMachineTimezone=function(p){
var m=new Date(AjxTimezoneData.TRANSITION_YEAR,11,1,0,0,0);
var k=new Date(AjxTimezoneData.TRANSITION_YEAR,5,1,0,0,0);
var t=-m.getTimezoneOffset();
var y=-k.getTimezoneOffset();
AjxTimezone.MATCHING_RULES=[];
AjxTimezone.TIMEZONE_CONFLICT=false;
var d=[];
var s={};
var r=[];
var g=false;
if(y==t){
var f=AjxTimezone.STANDARD_RULES;
for(var w=0;
w<f.length;
++w){
var h=f[w];
if(h.standard.offset==y){
if(!s[h.serverId]){
d.push(h);
s[h.serverId]=true
}
AjxTimezone.MATCHING_RULES.push(h)
}}}else{
var f=AjxTimezone.DAYLIGHT_RULES;
var j=Math.max(t,y);
var x=Math.min(t,y);
var o=new Date();
var v=-o.getTimezoneOffset();
for(var w=0;
w<f.length;
++w){
var h=f[w];
if(h.standard.offset==x&&h.daylight.offset==j){
var c=h.standard.trans;
var u=h.daylight.trans;
var n=new Date(c[0],c[1]-1,c[2]-1);
var a=new Date(c[0],c[1]-1,c[2]+2);
var e=new Date(u[0],u[1]-1,u[2]-1);
var q=new Date(u[0],u[1]-1,u[2]+2);
if(-a.getTimezoneOffset()==x&&-q.getTimezoneOffset()==j&&-n.getTimezoneOffset()==j&&-e.getTimezoneOffset()==x){
if(!s[h.serverId]){
d.push(h);
s[h.serverId]=true
}
g=true
}}
if(h.standard.offset==v||h.daylight.offset==v){
AjxTimezone.MATCHING_RULES.push(h)
}}}
if((d.length>0)&&p!=null){
var f=d;
for(var w in f){
if(f[w].serverId==p){
return f[w]
}}}
if(d.length>0){
AjxTimezone.TIMEZONE_CONFLICT=(d.length>1);
return d[0]
}
if((AjxTimezone.MATCHING_RULES.length>0)&&p!=null){
var f=AjxTimezone.MATCHING_RULES;
for(var w in f){
if(f[w].serverId==p){
return f[w]
}}}
return AjxTimezone._generateDefaultRule()
};
AjxTimezone._generateDefaultRule=function(){
var d=0;
var a=1;
var o=2;
var r=3;
var n=4;
function u(f,m,k,x){
var g=m.getTime();
var v=new Date();
v.setTime(f.getTime());
var w=new Date();
w.setTime(v.getTime());
var q=f.getTimezoneOffset()*-1;
if(!x){
x={
clientId:AjxTimezone.AUTO_DETECTED,autoDetected:true}
}
while(v.getTime()<=g){
if(k==d){
v.setUTCMonth(v.getUTCMonth()+1)
}else{
if(k==a){
v.setUTCDate(v.getUTCDate()+1)
}else{
if(k==o){
v.setUTCHours(v.getUTCHours()+1)
}else{
if(k==r){
v.setUTCMinutes(v.getUTCMinutes()+1)
}else{
if(k==n){
v.setUTCSeconds(v.getUTCSeconds()+1)
}else{
return x
}}}}}
var p=v.getTimezoneOffset()*-1;
if(p!=q){
if(k<n){
x=u(w,v,k+1,x)
}else{
var j=new Date();
j.setUTCFullYear(w.getFullYear(),w.getMonth(),w.getDate());
j.setUTCHours(w.getHours(),w.getMinutes(),w.getSeconds()+1);
var y=x[q<p?"daylight":"standard"]={
offset:p,trans:[j.getUTCFullYear(),j.getUTCMonth()+1,j.getUTCDate(),j.getUTCHours(),j.getUTCMinutes(),j.getUTCSeconds()]};
AjxTimezone.addWkDayTransition(y);
return x
}}
w.setTime(v.getTime());
q=p
}
return x
}
var t=new Date();
var e=new Date();
var h=t.getFullYear();
t.setUTCFullYear(h,t.getMonth(),t.getDate()-1);
t.setUTCHours(0,0,0,0);
e.setTime(t.getTime());
e.setUTCFullYear(h+1,t.getMonth(),t.getDate()+1);
var c=u(t,e,d);
if(!c.daylight||!c.standard){
c.standard={
offset:t.getTimezoneOffset()*-1};
delete c.daylight
}
c.serverId=["(GMT",AjxTimezone._generateShortName(c.standard.offset,true),") ",AjxTimezone.AUTO_DETECTED].join("");
if(c.daylight&&c.daylight.offset<c.standard.offset){
var s=c.daylight;
c.daylight=c.standard;
c.standard=s
}
return c
};
AjxTimezone._generateShortName=function(s,n){
if(s==0){
return""
}
var t=s<0?"-":"+";
var a=Math.abs(s);
var e=Math.floor(a/60);
var o=a%60;
e=e<10?"0"+e:e;
o=o<10?"0"+o:o;
return[t,e,n?".":"",o].join("")
};
AjxTimezone.DEFAULT_RULE=AjxTimezone._guessMachineTimezone();
(function(){
AjxTimezoneData.TIMEZONE_RULES.sort(AjxTimezone._BY_OFFSET);
for(var e=0;
e<AjxTimezoneData.TIMEZONE_RULES.length;
e++){
var t=AjxTimezoneData.TIMEZONE_RULES[e];
AjxTimezone.addRule(t)
}}
)();
AjxTimezone.DEFAULT=AjxTimezone.getClientId(AjxTimezone.DEFAULT_RULE.serverId)
}
if(AjxPackage.define("ajax.xslt.AjxXslt")){
AjxXslt=function(){
var o=AjxXmlDoc.create();
if(AjxEnv.isIE){
var n=null;
var e=["MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.3.0"];
for(var a=0;
a<e.length;
a++){
try{
n=new ActiveXObject(e[a]);
break
}
catch(t){}}
if(!n){
throw new AjxException("FreeThreadedDOMDocument",AjxException.UNSUPPORTED,"AjxXslt")
}
n.async=false;
o._doc=n
}
this._doc=o
};
AjxXslt.prototype.toString=function(){
return"AjxXslt"
};
AjxXslt.createFromUrl=function(e){
var t=new AjxXslt();
t.loadUrl(e);
return t
};
AjxXslt.createFromString=function(t){
var e=new AjxXslt();
e._doc.loadFromString(t);
e.createProcessor();
return e
};
AjxXslt.prototype.createProcessor=function(){
var s=this._doc.getDoc();
if(AjxEnv.isNav){
this._processor=new XSLTProcessor();
this._processor.importStylesheet(s)
}else{
if(AjxEnv.isIE){
var n=s.parseError;
if(n.errorCode!=0){
throw new AjxException(n.reason,AjxException.INVALID_PARAM,"AjxXslt.createProcessor")
}
var e=null;
var t=["MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate.3.0"];
for(var o=0;
o<t.length;
o++){
try{
e=new ActiveXObject(t[o]);
break
}
catch(a){}}
if(!e){
throw new AjxException("XSLTemplate",AjxException.UNSUPPORTED,"AjxXslt.createProcessor")
}
this._processor=e;
this._processor.stylesheet=s
}}};
AjxXslt._finishedLoading=function(){
var e=this._xslt;
e.createProcessor()
};
AjxXslt.prototype.loadUrl=function(e){
var a=this._doc;
if(AjxEnv.isNav){
var t=a.getDoc();
t._xslt=this;
t.addEventListener("load",AjxXslt._finishedLoading,false)
}
a.loadFromUrl(e);
if(AjxEnv.isIE){
this.createProcessor()
}};
AjxXslt.prototype.transformToDom=function(a){
var e;
if(AjxEnv.isIE){
e=this.transformIE(a)
}else{
if(AjxEnv.isNav){
return this.transformNav(a)
}else{
return a
}}
var t=AjxXmlDoc.createFromXml(e);
return t.getDoc()
};
AjxXslt.prototype.transformToString=function(a){
var e;
if(AjxEnv.isIE){
return this.transformIE(a)
}else{
if(AjxEnv.isNav){
e=this.transformNav(a)
}else{
return a.documentElement.innerHTML
}}
if(!e||!e.documentElement){
throw new AjxException("XSL transformation failed.",AjxException.INVALID_PARAM,"AjxXslt.transformToString")
}
var t=e.documentElement;
if((t instanceof HTMLElement)||(t instanceof HTMLHtmlElement)){
return t.innerHTML
}else{
if(t instanceof Element){
return AjxXmlDoc.replaceInvalidChars(t.xml)
}}
return a.documentElement.innerHTML
};
AjxXslt.prototype.transformIE=function(t){
try{
var a=this._processor.createProcessor();
a.input=t;
a.transform();
return a.output
}
catch(e){
throw new AjxException(e.description,AjxException.INVALID_PARAM,"AjxXslt.transformIE")
}};
AjxXslt.prototype.transformNav=function(e){
return this._processor.transformToDocument(e)
};
AjxXslt.prototype.transformNav2=function(e){
this._fragment=document.implementation.createDocument("","",null);
return this._processor.transformToFragment(e,this._fragment)
}
}
if(AjxPackage.define("ajax.util.AjxSHA1")){
var AjxSHA1=function(){
var g=0;
var x="";
var a=8;
function d(q){
return c(n(k(q),q.length*a))
}
function h(q){
return f(n(k(q),q.length*a))
}
function o(q){
return w(n(k(q),q.length*a))
}
function t(q,j){
return c(s(q,j))
}
function r(q,j){
return f(s(q,j))
}
function m(q,j){
return w(s(q,j))
}
function e(){
return d("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"
}
function n(H,C){
H[C>>5]|=128<<(24-C%32);
H[((C+64>>9)<<4)+15]=C;
var I=Array(80);
var R=1732584193;
var M=-271733879;
var F=-1732584194;
var S=271733878;
var D=-1009589776;
for(var A=0;
A<H.length;
A+=16){
var B=R;
var W=M;
var O=F;
var T=S;
var q=D;
for(var z=0;
z<80;
z++){
if(z<16){
I[z]=H[A+z]
}else{
I[z]=p(I[z-3]^I[z-8]^I[z-14]^I[z-16],1)
}
var Y=y(y(p(R,5),v(z,M,F,S)),y(y(D,I[z]),u(z)));
D=S;
S=F;
F=p(M,30);
M=R;
R=Y
}
R=y(R,B);
M=y(M,W);
F=y(F,O);
S=y(S,T);
D=y(D,q)
}
return Array(R,M,F,S,D)
}
function v(j,q,T,z){
if(j<20){
return(q&T)|((~q)&z)
}
if(j<40){
return q^T^z
}
if(j<60){
return(q&T)|(q&z)|(T&z)
}
return q^T^z
}
function u(q){
return(q<20)?1518500249:(q<40)?1859775393:(q<60)?-1894007588:-899497514
}
function s(z,A){
var O=k(z);
if(O.length>16){
O=n(O,z.length*a)
}
var q=Array(16),T=Array(16);
for(var j=0;
j<16;
j++){
q[j]=O[j]^909522486;
T[j]=O[j]^1549556828
}
var W=n(q.concat(k(A)),512+A.length*a);
return n(T.concat(W),512+160)
}
function y(q,T){
var z=(q&65535)+(T&65535);
var j=(q>>16)+(T>>16)+(z>>16);
return(j<<16)|(z&65535)
}
function p(q,j){
return(q<<j)|(q>>>(32-j))
}
function k(T){
var z=Array();
var q=(1<<a)-1;
for(var j=0;
j<T.length*a;
j+=a){
z[j>>5]|=(T.charCodeAt(j/a)&q)<<(32-a-j%32)
}
return z
}
function w(z){
var T="";
var q=(1<<a)-1;
for(var j=0;
j<z.length*32;
j+=a){
T+=String.fromCharCode((z[j>>5]>>>(32-a-j%32))&q)
}
return T
}
function c(z){
var j=g?"0123456789ABCDEF":"0123456789abcdef";
var T="";
for(var q=0;
q<z.length*4;
q++){
T+=j.charAt((z[q>>2]>>((3-q%4)*8+4))&15)+j.charAt((z[q>>2]>>((3-q%4)*8))&15)
}
return T
}
function f(O){
var T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var W="";
for(var z=0;
z<O.length*4;
z+=3){
var A=(((O[z>>2]>>8*(3-z%4))&255)<<16)|(((O[z+1>>2]>>8*(3-(z+1)%4))&255)<<8)|((O[z+2>>2]>>8*(3-(z+2)%4))&255);
for(var q=0;
q<4;
q++){
if(z*8+q*6>O.length*32){
W+=x
}else{
W+=T.charAt((A>>6*(3-q))&63)
}}}
return W
}
this.hex_sha1=d;
this.b64_sha1=h;
this.str_sha1=o;
this.hex_hmac_sha1=t;
this.b64_hmac_sha1=r;
this.str_hmac_sha1=m;
this.sha1_vm_test=e
};
AjxSHA1=new AjxSHA1()
}
if(AjxPackage.define("ajax.util.AjxEmailAddress")){
AjxEmailAddress=function(e,o,t,a,n){
this.address=e;
this.name=this._setName(t);
this.dispName=a;
this.type=o||AjxEmailAddress.TO;
this.isGroup=n;
this.isAjxEmailAddress=true
};
AjxEmailAddress.FROM="FROM";
AjxEmailAddress.TO="TO";
AjxEmailAddress.CC="CC";
AjxEmailAddress.BCC="BCC";
AjxEmailAddress.REPLY_TO="REPLY_TO";
AjxEmailAddress.SENDER="SENDER";
AjxEmailAddress.READ_RECEIPT="READ_RECEIPT";
AjxEmailAddress.TYPE_STRING={};
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.FROM]="from";
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.TO]="to";
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.CC]="cc";
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.BCC]="bcc";
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.REPLY_TO]="replyTo";
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.SENDER]="sender";
AjxEmailAddress.TYPE_STRING[AjxEmailAddress.READ_RECEIPT]="readReceipt";
AjxEmailAddress.fromSoapType={};
AjxEmailAddress.fromSoapType.f=AjxEmailAddress.FROM;
AjxEmailAddress.fromSoapType.t=AjxEmailAddress.TO;
AjxEmailAddress.fromSoapType.c=AjxEmailAddress.CC;
AjxEmailAddress.fromSoapType.b=AjxEmailAddress.BCC;
AjxEmailAddress.fromSoapType.r=AjxEmailAddress.REPLY_TO;
AjxEmailAddress.fromSoapType.s=AjxEmailAddress.SENDER;
AjxEmailAddress.fromSoapType.n=AjxEmailAddress.READ_RECEIPT;
AjxEmailAddress.toSoapType={};
AjxEmailAddress.toSoapType[AjxEmailAddress.FROM]="f";
AjxEmailAddress.toSoapType[AjxEmailAddress.TO]="t";
AjxEmailAddress.toSoapType[AjxEmailAddress.CC]="c";
AjxEmailAddress.toSoapType[AjxEmailAddress.BCC]="b";
AjxEmailAddress.toSoapType[AjxEmailAddress.REPLY_TO]="r";
AjxEmailAddress.toSoapType[AjxEmailAddress.SENDER]="s";
AjxEmailAddress.toSoapType[AjxEmailAddress.READ_RECEIPT]="n";
AjxEmailAddress.SEPARATOR="; ";
AjxEmailAddress.DELIMS=[";",",","\n"," "];
AjxEmailAddress.IS_DELIM={};
for(var i=0;
i<AjxEmailAddress.DELIMS.length;
i++){
AjxEmailAddress.IS_DELIM[AjxEmailAddress.DELIMS[i]]=true
}
AjxEmailAddress.addrAnglePat=/(\s*<(((\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*)))>\s*)/;
AjxEmailAddress.addrAngleQuotePat=/(\s*<'(((\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*)))'>\s*)/;
AjxEmailAddress.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*)))/;
AjxEmailAddress.addrPat1=/(^|"|\s)(((\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*)))/;
AjxEmailAddress.accountPat=/((\s*([^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+(\.[^\x00-\x1F\x7F()<>\[\]:;@\,."\s]+)*)\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))/;
AjxEmailAddress.commentPat=/\((.*)\)/g;
AjxEmailAddress.phrasePat=/(((\s*[^\x00-\x1F\x7F()<>\[\]:;@\"\s]+\s*)|(\s*"(([^\\"])|(\\([^\x0A\x0D])))+"\s*))+)/;
AjxEmailAddress.boundAddrPat=/(\s*<?(((\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*)))>?\s*)$/;
AjxEmailAddress.parse=function(o){
var n,e;
var o=AjxStringUtil.trim(o);
var t=AjxEmailAddress._prelimCheck(o);
if(!(t&&o.match(AjxEmailAddress.addrPat))){
return null
}
var a=o.match(AjxEmailAddress.addrAngleQuotePat)||o.match(AjxEmailAddress.addrAnglePat);
if(a&&a.length){
n=a[2];
o=o.replace(AjxEmailAddress.addrAnglePat,"")
}else{
a=o.match(AjxEmailAddress.addrPat1);
if(a&&a.length){
n=o.match(AjxEmailAddress.addrPat);
n=(n&&n.length&&n[0]!="")?AjxStringUtil.trim(n[0]):a[0];
o=o.replace(AjxEmailAddress.addrPat,"")
}}
a=o.match(AjxEmailAddress.phrasePat);
if(a){
e=AjxStringUtil.trim(AjxStringUtil.trim(a[0]),false,'"')
}
return new AjxEmailAddress(n,null,e)
};
AjxEmailAddress.parseEmailString=function(a,u,m){
var n=new AjxVector();
var t=new AjxVector();
var f=new AjxVector();
var h=AjxEmailAddress.split(a);
for(var r=0;
r<h.length;
r++){
var c=AjxStringUtil.trim(h[r]);
if(c){
var d=AjxEmailAddress.parse(c);
if(!d&&!m){
var p=c;
var s=p.match(AjxEmailAddress.addrAnglePat);
if(s&&s.length){
var e=p.replace(AjxEmailAddress.addrAnglePat,"");
var o=['"',e,'" ',s[0]].join("");
d=AjxEmailAddress.parse(o);
if(d){
d.name=e
}}}
if(d){
d.type=u;
n.add(d);
f.add(d)
}else{
t.add(c);
f.add(new AjxEmailAddress(c))
}}}
return{
good:n,bad:t,all:f}
};
AjxEmailAddress.isValid=function(t){
t=AjxStringUtil.trim(t);
var e=AjxEmailAddress._prelimCheck(t);
return(e&&(t.match(AjxEmailAddress.addrPat)!=null))
};
AjxEmailAddress._prelimCheck=function(a){
var e=a.indexOf("@");
var t=a.lastIndexOf(".");
return((e!=-1)&&(t!=-1)&&(t>e))
};
AjxEmailAddress.split=function(g){
g=AjxStringUtil.trim(g);
var p=[];
var y=0,m=0;
var w="",s="";
var r=false;
while(y<g.length){
var a=g.charAt(y);
if((a=='"'||a=="(")&&w!="\\"){
r=true;
s=a;
m=y;
y++;
while(r&&y<g.length){
var a=g.charAt(y);
if(((s=='"'&&a=='"')||(s=="("&&a==")"))&&(w!="\\")){
p.push({
start:m,end:y}
);
r=false
}
y++;
w=a
}}else{
y++
}
w=a
}
if(p.length){
AjxEmailAddress.IS_DELIM[" "]=false
}
m=0;
var u=[];
while(m<g.length){
var t=g.substring(m,g.length);
y=0;
var n=t.length;
while((n==t.length)&&(y<t.length)){
var a=t.charAt(y);
if(AjxEmailAddress.IS_DELIM[a]){
var o=false;
if(a!="\n"){
for(var c=0;
c<p.length;
c++){
var d=p[c];
var e=m+y;
o=(e>=d.start&&e<=d.end);
if(o){
break
}}}
if(!o){
var h=true;
var f=t.substring(0,y);
if(a==","||a==" "){
h=f.match(AjxEmailAddress.boundAddrPat)
}
if(h){
u.push(f);
n=y;
m+=f.length+1
}}
a=g.charAt(m);
while((m<g.length)&&AjxEmailAddress.IS_DELIM[a]){
m++;
a=g.charAt(m)
}
y++
}else{
y++
}}
if(n==t.length){
u.push(t);
m+=t.length+1
}}
AjxEmailAddress.IS_DELIM[" "]=true;
return u
};
AjxEmailAddress.prototype.toString=function(){
if(this.name&&!this.isGroup){
var e=this.name.replace(/\\+"/g,'"');
e=e.replace(/"/g,'\\"');
return['"',e,'" <',this.address,">"].join("")
}else{
return this.address
}};
AjxEmailAddress.prototype.getAddress=function(){
return this.address
};
AjxEmailAddress.prototype.setAddress=function(e){
this.address=e
};
AjxEmailAddress.prototype.getType=function(){
return this.type
};
AjxEmailAddress.prototype.setType=function(e){
this.type=e
};
AjxEmailAddress.prototype.getTypeAsString=function(){
return AjxEmailAddress.TYPE_STRING[this.type]
};
AjxEmailAddress.prototype.getName=function(){
return this.name
};
AjxEmailAddress.prototype.getDispName=function(){
return this.dispName
};
AjxEmailAddress.prototype.clone=function(){
var e=new AjxEmailAddress(this.address,this.type,this.name,this.dispName);
e.icon=this.icon;
return e
};
AjxEmailAddress.copy=function(e){
var t=new AjxEmailAddress(e.address,e.type,e.name,e.dispName);
t.icon=e.icon;
return t
};
AjxEmailAddress.prototype._setName=function(e){
if(!e){
return""
}
if(e&&e.charAt(0)=="'"&&e.charAt(e.length-1)=="'"){
e=e.substring(1,e.length-1)
}
return e
}
}
if(AjxPackage.define("ajax.util.AjxHistoryMgr")){
AjxHistoryMgr=function(){
this.currentLocation=null;
this.listener=null;
this.iframe=null;
this.ignoreLocationChange=null;
this.WAIT_TIME=AjxEnv.isIE?400:200;
this.currentWaitTime=0;
this.ieAtomicLocationChange=null;
this._eventMgr=new AjxEventMgr();
this._evt=new AjxEvent();
this._initialize()
};
AjxHistoryMgr.BLANK_FILE="blankHistory.html";
AjxHistoryMgr.IFRAME_ID="DhtmlHistoryFrame";
AjxHistoryMgr.LOCATION_CHECK_INTERVAL=100;
AjxHistoryMgr.prototype.addListener=function(e){
return this._eventMgr.addListener(AjxEvent.HISTORY,e)
};
AjxHistoryMgr.prototype.removeListener=function(e){
return this._eventMgr.removeListener(AjxEvent.HISTORY,e)
};
AjxHistoryMgr.prototype.add=function(a){
var e=this;
var t=function(){
if(e.currentWaitTime>0){
e.currentWaitTime=e.currentWaitTime-e.WAIT_TIME
}
a=e._removeHash(a);
if(AjxEnv.isIE){
if(document.getElementById(a)){
throw new DwtException("AjxHistoryMgr: location has same ID as DOM element")
}}
e.ignoreLocationChange=true;
this.ieAtomicLocationChange=true;
e.currentLocation=a;
window.location.hash=a;
if(AjxEnv.isIE){
e.iframe.src=AjxHistoryMgr.BLANK_FILE+"?"+a
}
this.ieAtomicLocationChange=false
};
window.setTimeout(t,this.currentWaitTime);
this.currentWaitTime=this.currentWaitTime+e.WAIT_TIME
};
AjxHistoryMgr.prototype.getCurrentLocation=function(){
return this._removeHash(window.location.hash)
};
AjxHistoryMgr.prototype._initialize=function(){
var e=this.getCurrentLocation();
this.currentLocation=e;
if(AjxEnv.isIE){
var n=[];
var o=0;
n[o++]="<iframe style='border: 0px; width: 1px; ";
n[o++]="height: 1px; position: absolute; bottom: 0px; ";
n[o++]="right: 0px; visibility: visible;' ";
n[o++]="id='"+AjxHistoryMgr.IFRAME_ID+"' ";
n[o++]="src='"+AjxHistoryMgr.BLANK_FILE+"?"+e+"'>";
n[o++]="</iframe>";
var s=document.createElement("div");
document.body.appendChild(s);
s.innerHTML=n.join("")
}
if(AjxEnv.isIE){
this.iframe=document.getElementById(AjxHistoryMgr.IFRAME_ID)
}
var t=this;
var a=function(){
t._checkLocation()
};
setInterval(a,AjxHistoryMgr.LOCATION_CHECK_INTERVAL)
};
AjxHistoryMgr.prototype._checkLocation=function(){
if(!AjxEnv.isIE&&this.ignoreLocationChange){
this.ignoreLocationChange=false;
return
}
if(!AjxEnv.isIE&&this.ieAtomicLocationChange){
return
}
var e=this.getCurrentLocation();
if(e==this.currentLocation){
return
}
this.ieAtomicLocationChange=true;
if(AjxEnv.isIE&&this._getIFrameHash()!=e){
this.iframe.src=AjxHistoryMgr.BLANK_FILE+"?"+e
}else{
if(AjxEnv.isIE){
return
}}
this.currentLocation=e;
this.ieAtomicLocationChange=false;
this._evt.data=e;
this._eventMgr.notifyListeners(AjxEvent.HISTORY,this._evt)
};
AjxHistoryMgr.prototype._getIFrameHash=function(){
var e=document.getElementById(AjxHistoryMgr.IFRAME_ID);
var a=e.contentWindow.document;
var t=new String(a.location.search);
if(t.length==1&&t.charAt(0)=="?"){
t=""
}else{
if(t.length>=2&&t.charAt(0)=="?"){
t=t.substring(1)
}}
return t
};
AjxHistoryMgr.prototype._removeHash=function(e){
if(e==null||e==undefined){
return null
}else{
if(e==""){
return""
}else{
if(e.length==1&&e.charAt(0)=="#"){
return""
}else{
if(e.length>1&&e.charAt(0)=="#"){
return e.substring(1)
}else{
return e
}}}}};
AjxHistoryMgr.prototype.iframeLoaded=function(e){
if(this.ignoreLocationChange){
this.ignoreLocationChange=false;
return
}
var t=new String(e.search);
if(t.length==1&&t.charAt(0)=="?"){
t=""
}else{
if(t.length>=2&&t.charAt(0)=="?"){
t=t.substring(1)
}}
window.location.hash=t;
this._evt.data=t;
this._eventMgr.notifyListeners(AjxEvent.HISTORY,this._evt)
}
}
if(AjxPackage.define("ajax.dwt.core.Dwt")){
Dwt=function(){};
Dwt.STATIC_STYLE="static";
Dwt.ABSOLUTE_STYLE="absolute";
Dwt.RELATIVE_STYLE="relative";
Dwt.FIXED_STYLE="fixed";
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.SCROLL_Y=5;
Dwt.SCROLL_X=6;
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_TOAST=950;
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.SCROLLBAR_WIDTH=22;
Dwt.KEY_OBJECT="_object_";
Dwt.KEY_ID="_id_";
Dwt._Z_INC=1;
Dwt.__nextId={};
Dwt.getNextId=function(e){
if(arguments.length==0){
e="DWT"
}
if(!Dwt.__nextId[e]){
Dwt.__nextId[e]=1
}
return e+Dwt.__nextId[e]++
};
Dwt.associateElementWithObject=function(a,e,t){
a[t||"dwtObj"]=e.__internalId=AjxCore.assignId(e)
};
Dwt.disassociateElementFromObject=function(a,e,t){
if(a){
a.removeAttribute(t||"dwtObj")
}
if(e.__internalId){
AjxCore.unassignId(e.__internalId)
}};
Dwt.getObjectFromElement=function(t,e){
return AjxCore.objectWithId(t[e||"dwtObj"])
};
Dwt.findAncestor=function(t,e){
while(t&&(Dwt.getAttr(t,e)==null)){
t=t.parentNode
}
return t
};
Dwt.setHandler=function(a,t,e){
if(t==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
Dwt.clearHandler(a,t)
}
a[t]=e;
if(t==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
a.addEventListener("DOMMouseScroll",e,true)
}};
Dwt.clearHandler=function(a,t){
if(t==DwtEvent.ONMOUSEWHEEL&&AjxEnv.isGeckoBased){
if(a[t]){
var e=a[t];
a.removeEventListener("DOMMouseScroll",e,true)
}}
a[t]=null
};
Dwt.getBackgroundRepeat=function(e){
return DwtCssStyle.getProperty(e,"background-repeat")
};
Dwt.setBackgroundRepeat=function(t,e){
t.style.backgroundRepeat=e
};
Dwt.getBounds=function(n,a){
var o=DwtPoint.tmp;
Dwt.getLocation(n,o);
var t=o.x;
var e=o.y;
Dwt.getSize(n,o);
if(!a){
return new DwtRectangle(t,e,o.x,o.y)
}else{
a.set(t,e,o.x,o.y);
return a
}};
Dwt.setBounds=function(o,t,n,a,e){
Dwt.setLocation(o,t,n);
Dwt.setSize(o,a,e)
};
Dwt.getCursor=function(e){
return DwtCssStyle.getProperty(e,"cursor")
};
Dwt.setCursor=function(t,e){
t.style.cursor=e
};
Dwt.getLocation=function(t,e){
e=e||new DwtPoint(0,0);
if(t.style.position==Dwt.ABSOLUTE_STYLE){
e.set(parseInt(DwtCssStyle.getProperty(t,"left")),parseInt(DwtCssStyle.getProperty(t,"top")));
return e
}else{
return Dwt.toWindow(t,0,0,null,null,e)
}};
Dwt.setLocation=function(a,t,o){
var e=a.style.position;
if(e!=Dwt.ABSOLUTE_STYLE&&e!=Dwt.RELATIVE_STYLE&&e!=Dwt.FIXED_STYLE){
throw new DwtException("Static widgets may not be positioned",DwtException.INVALID_OP,"Dwt.setLocation")
}
if(t=Dwt.__checkPxVal(t)){
a.style.left=t
}
if(o=Dwt.__checkPxVal(o)){
a.style.top=o
}};
Dwt.getPosition=function(e){
return e.style.position
};
Dwt.setPosition=function(t,e){
t.style.position=e
};
Dwt.getScrollStyle=function(a){
var o=DwtCssStyle.getProperty(a,"overflow");
if(o=="hidden"){
return Dwt.CLIP
}else{
if(o=="auto"){
return Dwt.SCROLL
}else{
if(o=="scroll"){
return Dwt.FIXED_SCROLL
}else{
var t=DwtCssStyle.getProperty(a,"overflowX");
var e=DwtCssStyle.getProperty(a,"overflowY");
if(o==""){
if(t=="scroll"){
return Dwt.SCROLL_X
}else{
if(e=="scroll"){
return Dwt.SCROLL_Y
}}}
return Dwt.VISIBLE
}}}};
Dwt.setScrollStyle=function(t,e){
if(e==Dwt.CLIP){
t.style.overflow="hidden"
}else{
if(e==Dwt.SCROLL){
t.style.overflow="auto"
}else{
if(e==Dwt.FIXED_SCROLL){
t.style.overflow="scroll"
}else{
if(e==Dwt.SCROLL_Y){
t.style.overflowX="hidden";
t.style.overflowY="auto"
}else{
if(e==Dwt.SCROLL_X){
t.style.overflowY="hidden";
t.style.overflowX="auto"
}else{
t.style.overflow="visible"
}}}}}};
Dwt.getSize=function(a,e){
var t;
if(!e){
t=new DwtPoint(0,0)
}else{
t=e;
t.set(0,0)
}
if(!a){
return t
}
t.x=a.offsetWidth;
if(t.x!=null){
t.y=a.offsetHeight
}else{
if(a.clip&&a.clip.width!=null){
t.x=a.clip.width;
t.y=a.clip.height;
t.x=parseInt(t.x);
t.y=parseInt(t.y)
}else{
if(a.style&&a.style.pixelWidth!=null){
t.x=a.style.pixelWidth;
t.y=a.style.pixelHeight;
t.x=parseInt(t.x);
t.y=parseInt(t.y)
}}}
return t
};
Dwt.setSize=function(a,t,e){
if(!a.style){
return
}
if(t==Dwt.CLEAR){
a.style.width=null
}else{
if(t=Dwt.__checkPxVal(t,true)){
a.style.width=t
}}
if(e==Dwt.CLEAR){
a.style.height=null
}else{
if(e=Dwt.__checkPxVal(e,true)){
a.style.height=e
}}};
Dwt.getHtmlExtent=function(e){
var t=AjxStringUtil.calcDIV();
t.innerHTML=e;
return Dwt.getSize(t)
};
Dwt.toDocumentFragment=function(a,s){
var n=AjxStringUtil.calcDIV();
n.innerHTML=a;
var t=document.createDocumentFragment();
var e=s&&document.getElementById(s);
if(e){
t.appendChild(e)
}else{
for(var o=n.firstChild;
o;
o=n.firstChild){
t.appendChild(o)
}}
return t
};
Dwt.getAttr=function(a,e,t){
if(!t){
return a&&a.tagName?(a.getAttribute(e)||a[e]):null
}else{
while(a){
if(Dwt.getAttr(a,e)!=null){
return a
}
a=a.parentNode
}
return null
}};
Dwt.getVisible=function(t){
var e=DwtCssStyle.getProperty(t,"display");
return(e!=Dwt.DISPLAY_NONE)
};
Dwt.setVisible=function(t,a){
if(a){
if(t.nodeName.match(/tr/i)){
t.style.display=Dwt.DISPLAY_TABLE_ROW
}else{
if(t.nodeName.match(/td|th/i)){
t.style.display=Dwt.DISPLAY_TABLE_CELL
}else{
t.style.display=t.getAttribute("x-display")||Dwt.DISPLAY_BLOCK
}}}else{
var e=DwtCssStyle.getComputedStyleObject(t).display;
if(e!="none"){
t.setAttribute("x-display",e)
}
t.style.display=Dwt.DISPLAY_NONE
}};
Dwt.getVisibility=function(t){
var e=DwtCssStyle.getProperty(t,"visibility");
return(e=="visible")
};
Dwt.setVisibility=function(e,t){
e.style.visibility=t?"visible":"hidden"
};
Dwt.__MSIE_OPACITY_RE=/alpha\(opacity=(\d+)\)/;
Dwt.getOpacity=function(a){
if(AjxEnv.isIE){
var t=a.style.filter;
var e=Dwt.__MSIE_OPACITY_RE.exec(t)||[t,"100"];
return Number(e[1])
}
return Number(a.style.opacity||1)*100
};
Dwt.setOpacity=function(t,e){
if(AjxEnv.isIE){
t.style.filter="alpha(opacity="+e+")"
}else{
t.style.opacity=e/100
}};
Dwt.getZIndex=function(e){
return DwtCssStyle.getProperty(e,"z-index")
};
Dwt.setZIndex=function(t,e){
t.style.zIndex=e
};
Dwt.getDisplay=function(e){
DwtCssStyle.getProperty(e,"display")
};
Dwt.setDisplay=function(t,e){
t.style.display=e
};
Dwt.getWindowSize=function(e){
var t=(!e)?new DwtPoint(0,0):e;
if(window.innerWidth){
t.x=window.innerWidth;
t.y=window.innerHeight
}else{
if(AjxEnv.isIE6CSS){
t.x=document.body.parentElement.clientWidth;
t.y=document.body.parentElement.clientHeight
}else{
if(document.body&&document.body.clientWidth){
t.x=document.body.clientWidth;
t.y=document.body.clientHeight
}}}
return t
};
Dwt.toWindow=function(o,r,s,d,h,c){
var t;
if(!c){
t=new DwtPoint(r,s)
}else{
t=c;
t.set(r,s)
}
var e=o;
while(e&&e!=d){
t.x+=e.offsetLeft-e.scrollLeft;
t.y+=e.offsetTop;
if(!h){
var a=AjxEnv.isOpera?e.pageYOffset:e.scrollTop;
if(a){
t.y-=a
}
var n=e.parentNode;
while(n!=e.offsetParent&&n!=d){
a=AjxEnv.isOpera?n.pageYOffset:n.scrollTop;
if(a){
t.y-=a
}
n=n.parentNode
}}
e=e.offsetParent
}
return t
};
Dwt.getInsets=function(o){
var t=DwtCssStyle.getComputedStyleObject(o);
var a=parseInt(t.borderLeftWidth)||0;
var h=parseInt(t.borderTopWidth)||0;
var c=parseInt(t.borderRightWidth)||0;
var s=parseInt(t.borderBottomWidth)||0;
var n=parseInt(t.paddingLeft)||0;
var d=parseInt(t.paddingTop)||0;
var e=parseInt(t.paddingRight)||0;
var r=parseInt(t.paddingBottom)||0;
return{
left:a+n,top:h+d,right:c+e,bottom:s+r}
};
Dwt.insetBounds=function(t,e){
if(isNaN(t.x)||isNaN(e.left)){
return t
}
t.x+=e.left;
t.y+=e.top;
t.width-=e.left+e.right;
t.height-=e.top+e.bottom;
return t
};
Dwt.setStatus=function(e){
window.status=e
};
Dwt.getTitle=function(){
return window.document.title
};
Dwt.setTitle=function(e){
window.document.title=e
};
Dwt.getIframeDoc=function(e){
if(e){
return AjxEnv.isIE?e.contentWindow.document:e.contentDocument
}
return null
};
Dwt.getIframeWindow=function(e){
return e.contentWindow
};
Dwt.parseHtmlFragment=function(o,a){
if(!Dwt._div){
Dwt._div=document.createElement("div")
}
if(a){
o="<table style='table-layout:fixed'>"+o+"</table>"
}
Dwt._div.innerHTML=o;
if(a){
var e=document.createDocumentFragment();
var n=Dwt._div.firstChild.rows;
for(var t=n.length-1;
t>=0;
t--){
e.appendChild(n[0])
}
return e.childNodes.length>1?e:e.firstChild
}
return Dwt._div.firstChild
};
Dwt.contains=function(a,t){
var o=false;
if(a.compareDocumentPosition){
var e=a.compareDocumentPosition(t);
if((e==(document.DOCUMENT_POSITION_CONTAINED_BY|document.DOCUMENT_POSITION_FOLLOWING))){
o=true
}}else{
if(a.contains){
o=a.contains(t)
}}
return o
};
Dwt.removeChildren=function(e){
while(e.hasChildNodes()){
e.removeChild(e.firstChild)
}};
Dwt.getCellIndex=function(t){
if(AjxEnv.isOpera){
if(t.tagName&&t.tagName.toLowerCase()=="td"){
var a=t.parentNode.cells;
var e=a.length;
for(var o=0;
o<e;
o++){
if(a[o]==t){
return o
}}}}else{
return t.cellIndex
}
return -1
};
Dwt.delClass=function(a,e,o){
if(a==null){
return
}
if(typeof e=="string"){
e=Dwt._DELCLASS_CACHE[e]||(Dwt._DELCLASS_CACHE[e]=new RegExp("\\b"+e+"\\b","ig"))
}
var t=a.className||"";
t=t.replace(e," ");
a.className=o?t+" "+o:t
};
Dwt._DELCLASS_CACHE={};
Dwt.addClass=function(e,t){
Dwt.delClass(e,t,t)
};
Dwt.condClass=function(o,n,t,e){
if(!!n){
if(e){
Dwt.delClass(o,e)
}
Dwt.addClass(o,t)
}else{
Dwt.delClass(o,t);
if(e){
Dwt.addClass(o,e)
}}};
Dwt.setSelectionRange=function(a,o,e){
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
a.setSelectionRange(o,e)
}else{
if(AjxEnv.isIE){
var t=a.createTextRange();
t.collapse(true);
t.moveStart("character",o);
t.moveEnd("character",e-o);
t.select()
}else{
a.select()
}}};
Dwt.getSelectionStart=function(o){
if(AjxEnv.isGeckoBased){
return o.selectionStart
}else{
if(AjxEnv.isIE){
var a=document.selection.createRange();
var t=a.compareEndPoints("StartToEnd",a)==0;
if(!t){
a.collapse(true)
}
var e=a.getBookmark();
return e.charCodeAt(2)-2
}}
return o.value.length
};
Dwt.getSelectionEnd=function(o){
if(AjxEnv.isGeckoBased){
return o.selectionEnd
}else{
if(AjxEnv.isIE){
var a=document.selection.createRange();
var t=a.compareEndPoints("StartToEnd",a)==0;
if(!t){
a.collapse(false)
}
var e=a.getBookmark();
return e.charCodeAt(2)-2
}}
return o.value.length
};
Dwt.setSelectionText=function(t,n){
var s=Dwt.getSelectionStart(t);
var e=Dwt.getSelectionEnd(t);
var o=t.value;
var a=[o.substr(0,s),n,o.substr(e)].join("");
if(typeof t.setValue=="function"){
t.setValue(a)
}else{
t.value=a
}
Dwt.setSelectionRange(t,s,s+n.length)
};
Dwt.instanceOf=function(t,e){
if(typeof t=="string"){
return window[t]&&(t==e||window[t].prototype instanceof window[e])
}
return(window[e]&&t instanceof window[e])
};
Dwt.getParams=function(e,o){
if(!(e&&e.length)){
return
}
if(e.length>1||e[0]._eventMgr){
var a={};
for(var t=0;
t<e.length;
t++){
a[o[t]]=e[t]
}
return a
}else{
if(e.length==1){
return e[0]
}else{
return{}
}}};
Dwt.__checkPxVal=function(t,e){
if(t==Dwt.DEFAULT){
return false
}
if(e&&t<0&&t!=Dwt.LOC_NOWHERE){
t=0
}
if(typeof(t)=="number"){
t=t+"px"
}
return t
};
Dwt.byId=function(e){
return(typeof e=="string"?document.getElementById(e):e)
};
Dwt.byTag=function(e){
return document.getElementsByTagName(e)
};
Dwt.show=function(e){
Dwt.setVisible(Dwt.byId(e),true)
};
Dwt.hide=function(e){
Dwt.setVisible(Dwt.byId(e),false)
};
Dwt.toggle=function(t,e){
t=Dwt.byId(t);
if(e==null){
e=(Dwt.getVisible(t)!=true)
}
Dwt.setVisible(t,e)
};
Dwt.setText=function(e,t){
e.appendChild(document.createTextNode(t))
};
Dwt.populateText=function(){
if(arguments.length==0){
return
}
var a,e=0,t=arguments.length;
while(e<t){
a=document.getElementById(arguments[e]);
if(a){
Dwt.setText(a,arguments[e+1])
}
e+=2
}};
Dwt.setInnerHtml=function(t,e){
t.innerHTML=e
};
Dwt.setFavIcon=function(r){
if(AjxEnv.isIE){
return
}
var e=null;
if(Dwt._favIconId){
e=document.getElementById(Dwt._favIconId)
}else{
var h=document.getElementsByTagName("head")[0];
var t=h.getElementsByTagName("link");
for(var o=0;
o<t.length;
o++){
var s=t[o];
if(s.rel.toUpperCase()=="SHORTCUT ICON"){
if(!s.id){
s.id=Dwt._favIconId=Dwt.getNextId()
}
e=s;
break
}}}
if(e){
e.href=r;
var n=e.parentNode;
n.removeChild(e);
n.appendChild(e)
}else{
var a=document.createElement("link");
a.id=Dwt._favIconId=Dwt.getNextId();
a.rel="SHORTCUT ICON";
a.href=r;
h=h||document.getElementsByTagName("head")[0];
h.appendChild(a)
}};
Dwt.enableDesignMode=function(a,e){
if(!AjxEnv.isIE){
a.designMode=e?"on":"off"
}else{
var t=a.body;
if(!t||t.contentEditable===undefined){
a.designMode=e?"on":"off"
}else{
t.contentEditable=e?true:false
}}};
Dwt.ffScrollbarCheck=function(a){
if(AjxEnv.isFirefox3_6up||AjxEnv.isDesktop2up){
var e=a.target;
if(e&&(e.clientHeight!=e.scrollHeight||e.clientWidth!=e.scrollWidth)){
a._dontCallPreventDefault=true;
a._stopPropagation=false;
a._returnValue=true;
return true
}}
return false
}
}
if(AjxPackage.define("ajax.dwt.core.DwtId")){
DwtId=function(){};
DwtId.SEP="__";
DwtId.WIDGET_LIST_VIEW="zl";
DwtId.WIDGET_HDR="zlh";
DwtId.WIDGET_HDR_TABLE="zlht";
DwtId.WIDGET_HDR_ICON="zlhi";
DwtId.WIDGET_HDR_LABEL="zlhl";
DwtId.WIDGET_HDR_ARROW="zlha";
DwtId.WIDGET_HDR_SASH="zlhs";
DwtId.WIDGET_ITEM="zli";
DwtId.WIDGET_ITEM_ROW="zlir";
DwtId.WIDGET_ITEM_CELL="zlic";
DwtId.WIDGET_ITEM_FIELD="zlif";
DwtId.LIST_VIEW_HEADERS="headers";
DwtId.LIST_VIEW_ROWS="rows";
DwtId.IFRAME="iframe";
DwtId.DND_PLUS_ID="z__roundPlus";
DwtId._makeId=function(){
var a=[];
for(var t=0;
t<arguments.length;
t++){
var e=arguments[t];
if(e!=null&&e!=""){
a.push(e)
}}
return a.join(DwtId.SEP)
};
DwtId.getListViewId=function(t,e){
return DwtId._makeId(DwtId.WIDGET_LIST_VIEW,t,e)
};
DwtId.getListViewHdrId=function(t,e,a){
return DwtId._makeId(t,e,a)
};
DwtId.getListViewItemId=function(t,e,o,a){
return DwtId._makeId(t,e,o,a)
};
DwtId.getIframeId=function(e){
return DwtId._makeId(e,DwtId.IFRAME)
}
}
if(AjxPackage.define("ajax.dwt.core.DwtException")){
DwtException=function(a,t,o,e){
if(arguments.length===0){
return
}
AjxException.call(this,a,t,o,e)
};
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
}
if(AjxPackage.define("ajax.dwt.core.DwtDraggable")){
DwtDraggable=function(){};
DwtDraggable.dragEl=null;
DwtDraggable.init=function(o,f,s,t,n,e,h,u,m,c,r,d,a){
o.onmousedown=DwtDraggable.__start;
o.__hMode=c?false:true;
o.__vMode=r?false:true;
o.__root=(f&&f!=null)?f:o;
if(o.__hMode&&isNaN(parseInt(o.__root.style.left))){
o.__root.style.left="0px"
}
if(o.__vMode&&isNaN(parseInt(o.__root.style.top))){
o.__root.style.top="0px"
}
if(!o.__hMode&&isNaN(parseInt(o.__root.style.right))){
o.__root.style.right="0px"
}
if(!o.__vMode&&isNaN(parseInt(o.__root.style.bottom))){
o.__root.style.bottom="0px"
}
o.__minX=(typeof s!="undefined")?s:null;
o.__minY=(typeof n!="undefined")?n:null;
o.__maxX=(typeof t!="undefined")?t:null;
o.__maxY=(typeof e!="undefined")?e:null;
o.__xMapper=d?d:null;
o.__yMapper=a?a:null;
o.__root.onDragStart=h;
o.__root.onDragEnd=m;
o.__root.onDrag=u
};
DwtDraggable.setDragBoundaries=function(t,e,o,n,a){
if(t!=null){
if(e!=null){
t.__minX=e
}
if(o!=null){
t.__maxX=o
}
if(n!=null){
t.__minY=n
}
if(a!=null){
t.__maxY=a
}}};
DwtDraggable.__start=function(o){
var a=DwtDraggable.dragEl=this;
o=DwtDraggable.__fixE(o);
var t=parseInt(a.__hMode?a.__root.style.left:a.__root.style.right);
var n=parseInt(a.__vMode?a.__root.style.top:a.__root.style.bottom);
if(a.__root.onDragStart){
a.__root.onDragStart.run([t,n])
}
a.__lastMouseX=o.clientX;
a.__lastMouseY=o.clientY;
if(a.__hMode){
if(a.__minX!=null){
a.__minMouseX=o.clientX-t+a.__minX
}
if(a.__maxX!=null){
a.__maxMouseX=a.__minMouseX+a.__maxX-a.__minX
}}else{
if(a.__minX!=null){
a.__maxMouseX=-a.__minX+o.clientX+t
}
if(a.__maxX!=null){
a.__minMouseX=-a.__maxX+o.clientX+t
}}
if(a.__vMode){
if(a.__minY!=null){
a.__minMouseY=o.clientY-n+a.__minY
}
if(a.__maxY!=null){
a.__maxMouseY=a.__minMouseY+a.__maxY-a.__minY
}}else{
if(a.__minY!=null){
a.__maxMouseY=-a.__minY+o.clientY+n
}
if(a.__maxY!=null){
a.__minMouseY=-a.__maxY+o.clientY+n
}}
document.onmousemove=DwtDraggable.__drag;
document.onmouseup=DwtDraggable.__end;
return false
};
DwtDraggable.__drag=function(r){
r=DwtDraggable.__fixE(r);
var o=DwtDraggable.dragEl;
var n=r.clientY;
var s=r.clientX;
var a=parseInt(o.__hMode?o.__root.style.left:o.__root.style.right);
var c=parseInt(o.__vMode?o.__root.style.top:o.__root.style.bottom);
var t,h;
if(!o.__xMapper){
if(o.__minX!=null){
s=o.__hMode?Math.max(s,o.__minMouseX):Math.min(s,o.__maxMouseX)
}
if(o.__maxX!=null){
s=o.__hMode?Math.min(s,o.__maxMouseX):Math.max(s,o.__minMouseX)
}
t=a+((s-o.__lastMouseX)*(o.__hMode?1:-1))
}else{
t=o.__xMapper(a,s)
}
if(!o.__yMapper){
if(o.__minY!=null){
n=o.__vMode?Math.max(n,o.__minMouseY):Math.min(n,o.__maxMouseY)
}
if(o.__maxY!=null){
n=o.__vMode?Math.min(n,o.__maxMouseY):Math.max(n,o.__minMouseY)
}
h=c+((n-o.__lastMouseY)*(o.__vMode?1:-1))
}else{
h=o.__yMapper(c,n)
}
DwtDraggable.dragEl.__root.style[o.__hMode?"left":"right"]=t+"px";
DwtDraggable.dragEl.__root.style[o.__vMode?"top":"bottom"]=h+"px";
DwtDraggable.dragEl.__lastMouseX=s;
DwtDraggable.dragEl.__lastMouseY=n;
if(DwtDraggable.dragEl.__root.onDrag){
DwtDraggable.dragEl.__root.onDrag.run([t,h])
}
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(t){
if(typeof t=="undefined"){
t=window.event
}
if(typeof t.layerX=="undefined"){
t.layerX=t.offsetX
}
if(typeof t.layerY=="undefined"){
t.layerY=t.offsetY
}
return t
}
}
if(AjxPackage.define("ajax.dwt.core.DwtDragTracker")){
DwtDragTracker=function(){};
DwtDragTracker.init=function(n,t,r,s,c,e,a){
var h=n._dragTrackerContext={};
var o=n.getHtmlElement();
if(t){
o.style.cursor=t
}
h.style=t;
h.threshX=(r>0)?r:1;
h.threshY=(s>0)?s:1;
h.data={
delta:{}
,userData:a};
h.captureObj=new DwtMouseEventCapture({
targetObj:n,mouseOverHdlr:DwtDragTracker._mouseOverHdlr,mouseDownHdlr:DwtDragTracker._mouseDownHdlr,mouseMoveHdlr:DwtDragTracker._mouseMoveHdlr,mouseUpHdlr:DwtDragTracker._mouseUpHdlr,mouseOutHdlr:DwtDragTracker._mouseOutHdlr}
);
n.setHandler(DwtEvent.ONMOUSEDOWN,DwtDragTracker._mouseDownHdlr);
n.setHandler(DwtEvent.ONMOUSEOVER,DwtDragTracker._mouseOverHdlr);
n.setHandler(DwtEvent.ONMOUSEOUT,DwtDragTracker._mouseOutHdlr);
h.callbackFunc=c;
h.callbackObj=e
};
DwtDragTracker.STYLE_NONE="auto";
DwtDragTracker.STYLE_MOVE="move";
DwtDragTracker.STYLE_RESIZE_NORTHWEST="nw-resize";
DwtDragTracker.STYLE_RESIZE_NORTH="n-resize";
DwtDragTracker.STYLE_RESIZE_NORTHEAST="ne-resize";
DwtDragTracker.STYLE_RESIZE_WEST="w-resize";
DwtDragTracker.STYLE_RESIZE_EAST="e-resize";
DwtDragTracker.STYLE_RESIZE_SOUTHWEST="sw-resize";
DwtDragTracker.STYLE_RESIZE_SOUTH="s-resize";
DwtDragTracker.STYLE_RESIZE_SOUTHEAST="se-resize";
DwtDragTracker.STATE_START=1;
DwtDragTracker.STATE_DRAGGING=2;
DwtDragTracker.STATE_END=3;
DwtDragTracker._mouseOverHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtDragTracker._mouseDownHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
if(t.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(a,true,false);
return false
}
var o=t.dwtObj;
if(o&&o._dragTrackerContext){
var e=o._dragTrackerContext;
if(e.callbackFunc!=null){
e.oldCapture=DwtMouseEventCapture.getCaptureObj();
if(e.oldCapture){
e.oldCapture.release()
}
e.captureObj.capture();
e.data.startDoc={
x:t.docX,y:t.docY};
e.data.state=DwtDragTracker.STATE_START;
DwtDragTracker._doCallback(e,t)
}}
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtDragTracker._doCallback=function(e,t){
e.data.mouseEv=t;
if(e.callbackObj!=null){
e.callbackFunc.call(e.callbackObj,e.data)
}else{
e.callbackFunc(e.data)
}
e.data.mouseEv=null
};
DwtDragTracker._mouseMoveHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a);
var n=DwtMouseEventCapture.getTargetObj();
var e=n._dragTrackerContext;
var o=e.data;
o.delta.x=t.docX-o.startDoc.x;
o.delta.y=t.docY-o.startDoc.y;
if(Math.abs(o.delta.x)>=e.threshX||Math.abs(o.delta.y)>=e.threshY){
o.prevState=o.state;
o.state=DwtDragTracker.STATE_DRAGGING;
DwtDragTracker._doCallback(e,t)
}
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtDragTracker._mouseUpHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a);
if(t.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(a,true,false);
return false
}
var e=DwtMouseEventCapture.getTargetObj()._dragTrackerContext;
if(e){
if(e.callbackFunc!=null){
DwtMouseEventCapture.getCaptureObj().release()
}
if(e.oldCapture){
e.oldCapture.capture();
e.oldCapture=null
}
e.data.state=DwtDragTracker.STATE_END;
DwtDragTracker._doCallback(e,t)
}
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtDragTracker._mouseOutHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
}
}
if(AjxPackage.define("ajax.dwt.graphics.DwtCssStyle")){
DwtCssStyle=function(){};
DwtCssStyle.HOVER="hover";
DwtCssStyle.ACTIVE="active";
DwtCssStyle.SELECTED="selected";
DwtCssStyle.DISABLED="disabled";
DwtCssStyle.FOCUSED="focused";
DwtCssStyle.ACTIONED="actioned";
DwtCssStyle.MATCHED="matched";
DwtCssStyle.DRAG_OVER="dragOver";
DwtCssStyle.DROPPABLE="droppable";
DwtCssStyle.NOT_DROPPABLE="notDroppable";
DwtCssStyle.DRAG_PROXY="dragProxy";
DwtCssStyle.LINUX="linux";
DwtCssStyle.getProperty=function(t,a){
var d;
if(t.ownerDocument==null){
for(var c=t.parentNode;
c.parentNode!=null;
c=c.parentNode){}
var h=c
}else{
var h=t.ownerDocument
}
if(h.defaultView&&!AjxEnv.isSafari){
var e=h.defaultView.getComputedStyle(t,"");
d=e.getPropertyValue(a)
}else{
var r=a.split("-");
var n="";
var o;
var s=r.length;
for(o=0;
o<s;
o++){
if(o!=0){
n+=r[o].substring(0,1).toUpperCase()
}else{
n+=r[o].substring(0,1)
}
n+=r[o].substring(1)
}
if(t.currentStyle){
d=t.currentStyle[n]
}else{
if(t.style){
d=t.style[n]
}}}
return d
};
DwtCssStyle.getComputedStyleObject=function(o){
if(o.ownerDocument==null){
for(var t=o.parentNode;
t.parentNode!=null;
t=t.parentNode){}
var a=t
}else{
var a=o.ownerDocument
}
if(a.defaultView){
var e=a.defaultView.getComputedStyle(o,null);
if(!e&&o.style){
o.style.display="";
e=a.defaultView.getComputedStyle(o,null)
}
return e||{}
}else{
if(o.currentStyle){
return o.currentStyle
}else{
if(o.style){
return o.style
}}}};
DwtCssStyle.removeProperty=function(t,a){
if(a instanceof Array){
for(var e=a.length;
--e>=0;
){
DwtCssStyle.removeProperty(t,a[e])
}}else{
if(AjxEnv.isIE){
t.style.removeAttribute(a,true)
}else{
a=a.replace(/([A-Z])/g,"-$1");
t.style.removeProperty(a)
}}}
}
if(AjxPackage.define("ajax.dwt.graphics.DwtPoint")){
DwtPoint=function(e,t){
this.x=e||0;
this.y=t||0
};
DwtPoint.tmp=new DwtPoint(0,0);
DwtPoint.prototype.toString=function(){
return"DwtPoint"
};
DwtPoint.prototype.set=function(e,t){
this.x=e;
this.y=t
}
}
if(AjxPackage.define("ajax.dwt.graphics.DwtRectangle")){
DwtRectangle=function(t,o,a,e){
this.x=t;
this.y=o;
this.width=a;
this.height=e
};
DwtRectangle.prototype.toString=function(){
return"DwtRectangle"
};
DwtRectangle.prototype.set=function(t,o,a,e){
this.x=t;
this.y=o
}
}
if(AjxPackage.define("ajax.dwt.graphics.DwtUnits")){
DwtUnits=function(){};
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
}
if(AjxPackage.define("ajax.dwt.events.DwtEvent")){
DwtEvent=function(e){
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.ONSCROLL="onscroll";
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.XFORMS_INSTANCE_CHANGED="xforms-instance-cahnged";
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]
}
if(AjxPackage.define("ajax.dwt.events.DwtEventManager")){
DwtEventManager=function(){};
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(e,t){
DwtEventManager._instance.addListener(e,t)
};
DwtEventManager.notifyListeners=function(e,t){
DwtEventManager._instance.notifyListeners(e,t)
};
DwtEventManager.removeListener=function(e,t){
DwtEventManager._instance.removeListener(e,t)
}
}
if(AjxPackage.define("ajax.dwt.events.DwtDateRangeEvent")){
DwtDateRangeEvent=function(e){
if(arguments.length==0){
return
}
DwtEvent.call(this,true);
this.reset()
};
DwtDateRangeEvent.prototype=new DwtEvent;
DwtDateRangeEvent.prototype.constructor=DwtDateRangeEvent;
DwtDateRangeEvent.prototype.toString=function(){
return"DwtDateRangeEvent"
};
DwtDateRangeEvent.prototype.reset=function(){
this.start=null;
this.end=null
}
}
if(AjxPackage.define("ajax.dwt.events.DwtDisposeEvent")){
DwtDisposeEvent=function(e){
if(arguments.length==0){
return
}
DwtEvent.call(this,true)
};
DwtDisposeEvent.prototype=new DwtEvent;
DwtDisposeEvent.prototype.constructor=DwtDisposeEvent;
DwtDisposeEvent.prototype.toString=function(){
return"DwtDisposeEvent"
}
}
if(AjxPackage.define("ajax.dwt.events.DwtUiEvent")){
DwtUiEvent=function(e){
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(t,a){
t=t||window.event;
if(t){
return t
}
if(a){
var e=(a.ownerDocument||a.document||a).parentWindow;
return e?e.event:null
}};
DwtUiEvent.getTarget=function(e,t){
e=DwtUiEvent.getEvent(e);
if(!e){
return null
}
if(!t){
if(e.target){
return(e.target.nodeType==3)?e.target.parentNode:e.target
}else{
if(e.srcElement){
return e.srcElement
}}}else{
if(e.relatedTarget){
return e.relatedTarget
}else{
if(e.toElement){
return e.toElement
}else{
if(e.fromElement){
return e.fromElement
}}}}
return null
};
DwtUiEvent.getTargetWithProp=function(e,o,a){
var t=DwtUiEvent.getTarget(e,a);
while(t){
if(Dwt.getAttr(t,o)!=null){
return t
}
t=t.parentNode
}
return null
};
DwtUiEvent.getTargetWithProps=function(o,a){
var n=DwtUiEvent.getTarget(o);
while(n){
var t=true;
for(var e in a){
var s=Dwt.getAttr(n,a[e]);
if(s==null){
n=n.parentNode;
t=false;
break
}}
if(t){
return n
}}
return null
};
DwtUiEvent.copy=function(e,t){
e.altKey=t.altKey;
e.ctrlKey=t.ctrlKey;
e.metaKey=t.metaKey;
e.shiftKey=t.shiftKey;
e.target=t.target;
e.type=t.type;
e.dwtObj=t.dwtObj;
e.docX=t.docX;
e.docY=t.docY;
e.elementX=t.elementX;
e.elementY=t.elementY;
e.ersatz=t.ersatz;
e._stopPropagation=t._stopPropagation;
e._returnValue=t._returnValue
};
DwtUiEvent.prototype.setFromDhtmlEvent=function(t,a){
t=DwtUiEvent.getEvent(t);
if(!t){
return
}
this.altKey=t.altKey;
this.ctrlKey=t.ctrlKey;
this.metaKey=t.metaKey;
this.shiftKey=t.shiftKey;
this.type=t.type;
this.target=DwtUiEvent.getTarget(t);
this.dwtObj=(a===true)?DwtControl.getTargetControl(t):a;
if(t.pageX!=null){
this.docX=t.pageX;
this.docY=t.pageY
}else{
if(t.clientX!=null){
this.docX=t.clientX+document.body.scrollLeft-document.body.clientLeft;
this.docY=t.clientY+document.body.scrollTop-document.body.clientTop;
if(document.body.parentElement){
var e=document.body.parentElement;
this.docX+=e.scrollLeft-e.clientLeft;
this.docY+=e.scrollTop-e.clientTop
}}}
if(t.offsetX!=null){
this.elementX=t.offsetX;
this.elementY=t.offsetY
}else{
if(t.layerX!=null){
this.elementX=t.layerX;
this.elementY=t.layerY
}else{
this.elementX=Dwt.DEFAULT;
this.elementY=Dwt.DEFAULT
}}
this.ersatz=false;
return t
};
DwtUiEvent.prototype.setToDhtmlEvent=function(e){
DwtUiEvent.setBehaviour(e,this._stopPropagation,this._returnValue,this._dontCallPreventDefault)
};
DwtUiEvent.setBehaviour=function(n,e,t,a){
var o=DwtUiEvent.getEvent(n);
DwtUiEvent.setDhtmlBehaviour(o,e,t,a)
};
DwtUiEvent.setDhtmlBehaviour=function(o,e,t,a){
o=o||window.event;
if(o.stopPropagation!=null){
if(e){
o.stopPropagation()
}
if(!t&&!a){
o.preventDefault()
}}else{
o.returnValue=t;
o.cancelBubble=e
}};
DwtUiEvent.getDwtObjFromEvent=function(e,a){
var t=DwtUiEvent.getTargetWithProp(e,"dwtObj",a);
return t?Dwt.getObjectFromElement(t):null
};
DwtUiEvent.getDwtObjWithProp=function(e,a){
var t=DwtUiEvent.getTargetWithProps(e,["dwtObj",a]);
return t?Dwt.getObjectFromElement(t):null
}
}
if(AjxPackage.define("ajax.dwt.events.DwtControlEvent")){
DwtControlEvent=function(){
this.reset()
};
DwtControlEvent.prototype=new DwtEvent;
DwtControlEvent.prototype.constructor=DwtControlEvent;
DwtControlEvent.RESIZE=1;
DwtControlEvent.MOVE=2;
DwtControlEvent.prototype.toString=function(){
return"DwtControlEvent"
};
DwtControlEvent.prototype.reset=function(e){
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;
this.type=e||null
}
}
if(AjxPackage.define("ajax.dwt.events.DwtFocusEvent")){
DwtFocusEvent=function(e){
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
}
}
if(AjxPackage.define("ajax.dwt.events.DwtKeyEvent")){
DwtKeyEvent=function(){
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.MAC_FF_CODE={};
DwtKeyEvent.MAC_FF_CODE["~"]=192;
DwtKeyEvent.MAC_FF_CODE["!"]=49;
DwtKeyEvent.MAC_FF_CODE["@"]=50;
DwtKeyEvent.MAC_FF_CODE["#"]=51;
DwtKeyEvent.MAC_FF_CODE["$"]=52;
DwtKeyEvent.MAC_FF_CODE["%"]=53;
DwtKeyEvent.MAC_FF_CODE["^"]=54;
DwtKeyEvent.MAC_FF_CODE["&"]=55;
DwtKeyEvent.MAC_FF_CODE["*"]=56;
DwtKeyEvent.MAC_FF_CODE["("]=57;
DwtKeyEvent.MAC_FF_CODE[")"]=48;
DwtKeyEvent.MAC_FF_CODE["-"]=189;
DwtKeyEvent.MAC_FF_CODE._=189;
DwtKeyEvent.MAC_FF_CODE["+"]=187;
DwtKeyEvent.MAC_FF_CODE["|"]=220;
DwtKeyEvent.MAC_FF_CODE[":"]=186;
DwtKeyEvent.MAC_FF_CODE["<"]=188;
DwtKeyEvent.MAC_FF_CODE[">"]=190;
DwtKeyEvent.MAC_FF_CODE["?"]=191;
DwtKeyEvent.prototype=new DwtUiEvent;
DwtKeyEvent.prototype.constructor=DwtKeyEvent;
DwtKeyEvent.prototype.toString=function(){
return"DwtKeyEvent"
};
DwtKeyEvent.isKeyEvent=function(e){
return(e.type.search(/^key/i)!=-1)
};
DwtKeyEvent.isKeyPressEvent=function(e){
return(AjxEnv.isIE&&e.type=="keydown")||(e.type=="keypress")
};
DwtKeyEvent.prototype.reset=function(e){
if(!e){
DwtUiEvent.prototype.reset.call(this)
}
this.keyCode=0;
this.charCode=0
};
DwtKeyEvent.prototype.isCommand=function(e){
return AjxEnv.isMac&&this.metaKey||this.ctrlKey
};
DwtKeyEvent.prototype.setFromDhtmlEvent=function(e,t){
e=DwtUiEvent.prototype.setFromDhtmlEvent.apply(this,arguments);
this.charCode=e.charCode||e.keyCode;
this.keyCode=e.keyCode
};
DwtKeyEvent.getCharCode=function(t){
t=DwtUiEvent.getEvent(t);
var e=AjxEnv.isSafari?t.keyCode:(t.charCode||t.keyCode);
if(e==0&&AjxEnv.isMac&&AjxEnv.isGeckoBased&&t.type=="keyup"&&DwtKeyEvent._geckoCode){
e=DwtKeyEvent._geckoCode
}
return e
};
DwtKeyEvent.copy=function(e,t){
DwtUiEvent.copy(e,t);
e.charCode=t.charCode;
e.keyCode=t.keyCode
};
DwtKeyEvent.geckoCheck=function(t){
t=DwtUiEvent.getEvent(t);
if(t.type=="keypress"){
DwtKeyEvent._geckoCode=null;
if(AjxEnv.isMac&&AjxEnv.isGeckoBased){
var e=String.fromCharCode(t.charCode);
DwtKeyEvent._geckoCode=DwtKeyEvent.MAC_FF_CODE[e]
}}}
}
if(AjxPackage.define("ajax.dwt.events.DwtMouseEvent")){
DwtMouseEvent=function(){
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(e){
if(!e){
DwtUiEvent.prototype.reset.call(this)
}
this.button=0
};
DwtMouseEvent.prototype.setFromDhtmlEvent=function(e,t){
e=DwtUiEvent.prototype.setFromDhtmlEvent.apply(this,arguments);
if(e.which){
switch(e.which){
case 1:this.button=DwtMouseEvent.LEFT;
break;
case 2:this.button=DwtMouseEvent.MIDDLE;
break;
case 3:this.button=DwtMouseEvent.RIGHT;
break;
default:this.button=DwtMouseEvent.NONE
}}else{
if(e.button){
if((e.button&1)!=0){
this.button=DwtMouseEvent.LEFT
}else{
if((e.button&2)!=0){
this.button=DwtMouseEvent.RIGHT
}else{
if((e.button&4)!=0){
this.button=DwtMouseEvent.MIDDLE
}else{
this.button=DwtMouseEvent.NONE
}}}}}
if(AjxEnv.isMac&&this.button){
if(this.ctrlKey&&(this.button==DwtMouseEvent.LEFT||this.button==DwtMouseEvent.RIGHT)){
this.button=DwtMouseEvent.RIGHT;
this.ctrlKey=false
}
if(this.altKey){
this.ctrlKey=true;
this.altKey=false
}}}
}
if(AjxPackage.define("ajax.dwt.events.DwtMouseEventCapture")){
DwtMouseEventCapture=function(e){
e=Dwt.getParams(arguments,DwtMouseEventCapture.PARAMS);
this.targetObj=e.targetObj;
this._id=e.id;
this._mouseOverHdlr=e.mouseOverHdlr||DwtMouseEventCapture.emptyHdlr;
this._mouseDownHdlr=e.mouseDownHdlr||DwtMouseEventCapture.emptyHdlr;
this._mouseMoveHdlr=e.mouseMoveHdlr||DwtMouseEventCapture.emptyHdlr;
this._mouseUpHdlr=e.mouseUpHdlr||DwtMouseEventCapture.emptyHdlr;
this._mouseOutHdlr=e.mouseOutHdlr||DwtMouseEventCapture.emptyHdlr;
this._mouseWheelHdlr=e.mouseWheelHdlr||DwtMouseEventCapture.emptyHdlr;
this._hardCapture=(e.hardCapture!==false)
};
DwtMouseEventCapture.PARAMS=["targetObj","id","mouseOverHdlr","mouseDownHdlr","mouseMoveHdlr","mouseUpHdlr","mouseOutHdlr","mouseWheelHdlr","hardCapture"];
DwtMouseEventCapture._capturing=false;
DwtMouseEventCapture.getCaptureObj=function(){
return window._mouseEventCaptureObj
};
DwtMouseEventCapture.getTargetObj=function(){
return window._mouseEventCaptureObj?window._mouseEventCaptureObj.targetObj:null
};
DwtMouseEventCapture.getId=function(){
return window._mouseEventCaptureObj?window._mouseEventCaptureObj._id:null
};
DwtMouseEventCapture.prototype.toString=function(){
return"DwtMouseEventCapture"
};
DwtMouseEventCapture.prototype.capturing=function(){
return DwtMouseEventCapture._capturing
};
DwtMouseEventCapture.prototype.capture=function(){
if(window._mouseEventCaptureObj){
window._mouseEventCaptureObj.release()
}
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);
document.body.addEventListener("DOMMouseScroll",this._mouseWheelHdlr,true)
}else{
this._savedMouseOverHdlr=document.onmouseover;
this._savedMouseDownHdlr=document.onmousedown;
this._savedMouseMoveHdlr=document.onmousemove;
this._savedMouseUpHdlr=document.onmouseup;
this._savedMouseOutHdlr=document.onmouseout;
this._savedMouseWheelHdlr=document.onmousewheel;
document.onmouseover=this._mouseOverHdlr;
document.onmousedown=this._mouseDownHdlr;
document.onmousemove=this._mouseMoveHdlr;
document.onmouseup=this._mouseUpHdlr;
document.onmouseout=this._mouseOutHdlr;
document.onmousewheel=this._mouseWheelHdlr
}
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 e=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);
document.body.removeEventListener("DOMMouseScroll",this._mouseWheelHdlr,true)
}else{
document.onmouseover=this._savedMouseOverHdlr;
document.onmousedown=this._savedMouseDownHdlr;
document.onmousemove=this._savedMouseMoveHdlr;
document.onmouseup=this._savedMouseUpHdlr;
document.onmouseout=this._savedMouseOutHdlr;
document.onmousewheel=this._savedMouseWheelHdlr
}
if(this._hardCapture&&document.body&&document.body.releaseCapture){
document.body.releaseCapture()
}
window._mouseEventCaptureObj=null;
DwtMouseEventCapture._capturing=false
};
DwtMouseEventCapture.emptyHdlr=function(t){
var a=DwtMouseEventCapture.getCaptureObj();
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
if(a._hardCapture){
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
}else{
e._stopPropagation=false;
e._returnValue=true;
e.setToDhtmlEvent(t);
return true
}}
}
if(AjxPackage.define("ajax.dwt.events.DwtListViewActionEvent")){
DwtListViewActionEvent=function(){
DwtMouseEvent.call(this);
this.reset(true)
};
DwtListViewActionEvent.prototype=new DwtMouseEvent;
DwtListViewActionEvent.prototype.constructor=DwtListViewActionEvent;
DwtListViewActionEvent.prototype.toString=function(){
return"DwtListViewActionEvent"
};
DwtListViewActionEvent.prototype.reset=function(e){
if(!e){
DwtMouseEvent.prototype.reset.call(this)
}
this.field=null;
this.item=null;
this.detail=null
}
}
if(AjxPackage.define("ajax.dwt.events.DwtSelectionEvent")){
DwtSelectionEvent=function(e){
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(e){
if(!e){
DwtUiEvent.prototype.reset.call(this)
}
this.button=0;
this.detail=null;
this.item=null
}
}
if(AjxPackage.define("ajax.dwt.events.DwtHtmlEditorStateEvent")){
DwtHtmlEditorStateEvent=function(e){
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
}
}
if(AjxPackage.define("ajax.dwt.events.DwtTreeEvent")){
DwtTreeEvent=function(){
DwtSelectionEvent.call(this,true)
};
DwtTreeEvent.prototype=new DwtSelectionEvent;
DwtTreeEvent.prototype.constructor=DwtTreeEvent;
DwtTreeEvent.prototype.toString=function(){
return"DwtTreeEvent"
};
DwtTreeEvent.prototype.setFromDhtmlEvent=function(e,t){
e=DwtSelectionEvent.prototype.setFromDhtmlEvent.apply(this,arguments)
}
}
if(AjxPackage.define("ajax.dwt.events.DwtHoverEvent")){
DwtHoverEvent=function(o,a,t,e,n){
if(arguments.length==0){
return
}
DwtEvent.call(this,true);
this.type=o;
this.delay=a;
this.object=t;
this.x=e||-1;
this.y=n||-1
};
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
}
}
if(AjxPackage.define("ajax.dwt.keyboard.DwtTabGroupEvent")){
DwtTabGroupEvent=function(){
this.tabGroup=null;
this.newFocusMember=null
};
DwtTabGroupEvent.prototype.toString=function(){
return"DwtTabGroupEvent"
};
DwtTabGroupEvent.prototype.reset=function(){
this.tabGroup=null;
this.newFocusMember=null
}
}
if(AjxPackage.define("ajax.dwt.keyboard.DwtKeyMap")){
DwtKeyMap=function(e){
if(e){
return
}
this._map={};
this._args={};
this._checkedMap={};
this._repeat={};
this._load(this._map,AjxKeys);
DwtKeyMap.MOD_ORDER[DwtKeyMap.ALT]=1;
DwtKeyMap.MOD_ORDER[DwtKeyMap.CTRL]=2;
DwtKeyMap.MOD_ORDER[DwtKeyMap.META]=3;
DwtKeyMap.MOD_ORDER[DwtKeyMap.SHIFT]=4
};
DwtKeyMap.deserialize=function(e){
alert("DwtKeyMap.deserialize: NOT IMPLEMENTED")
};
DwtKeyMap.serialize=function(e){
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.editor="DwtHtmlEditor";
DwtKeyMap.MAP_NAME.toolbar="DwtToolBar";
DwtKeyMap.MAP_NAME.toolbarHorizontal="DwtToolBar-horiz";
DwtKeyMap.MAP_NAME.toolbarVertical="DwtToolBar-vert";
DwtKeyMap.MAP_NAME.tabView="DwtTabView";
DwtKeyMap.MAP_NAME.tree="DwtTreeItem";
DwtKeyMap.MAP_NAME_R={};
(function(){
for(var e in DwtKeyMap.MAP_NAME){
DwtKeyMap.MAP_NAME_R[DwtKeyMap.MAP_NAME[e]]=e
}}
)();
DwtKeyMap.IS_MODIFIER={};
DwtKeyMap.MOD_ORDER={};
DwtKeyMap.ARROW_DOWN="ArrowDown";
DwtKeyMap.ARROW_LEFT="ArrowLeft";
DwtKeyMap.ARROW_RIGHT="ArrowRight";
DwtKeyMap.ARROW_UP="ArrowUp";
DwtKeyMap.BACKSLASH="Backslash";
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.TAB="Tab";
DwtKeyMap.ACTION="ContextMenu";
DwtKeyMap.SELECT_CURRENT="SelectCurrent";
DwtKeyMap.ADD_SELECT_NEXT="AddNext";
DwtKeyMap.ADD_SELECT_PREV="AddPrevious";
DwtKeyMap.CANCEL="Cancel";
DwtKeyMap.COLLAPSE="Collapse";
DwtKeyMap.DBLCLICK="DoubleClick";
DwtKeyMap.EXPAND="Expand";
DwtKeyMap.GOTO_TAB="GoToTab";
DwtKeyMap.HEADER1="Header1";
DwtKeyMap.HEADER2="Header2";
DwtKeyMap.HEADER3="Header3";
DwtKeyMap.HEADER4="Header4";
DwtKeyMap.HEADER5="Header5";
DwtKeyMap.HEADER6="Header6";
DwtKeyMap.JUSTIFY_CENTER="CenterJustify";
DwtKeyMap.JUSTIFY_LEFT="LeftJustify";
DwtKeyMap.JUSTIFY_RIGHT="RightJustify";
DwtKeyMap.NEXT="Next";
DwtKeyMap.NEXT_TAB="NextTab";
DwtKeyMap.NO="No";
DwtKeyMap.PARENTMENU="ParentMenu";
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.SWITCH_MODE="SwitchMode";
DwtKeyMap.TEXT_BOLD="Bold";
DwtKeyMap.TEXT_ITALIC="Italic";
DwtKeyMap.TEXT_UNDERLINE="Underline";
DwtKeyMap.TEXT_STRIKETHRU="Strikethru";
DwtKeyMap.YES="Yes";
DwtKeyMap.GOTO_TAB_RE=new RegExp(DwtKeyMap.GOTO_TAB+"(\\d+)");
DwtKeyMap.JOIN="+";
DwtKeyMap.SEP=",";
DwtKeyMap.INHERIT="INHERIT";
DwtKeyMap.prototype.getMap=function(){
return this._map
};
DwtKeyMap.prototype._load=function(q,d,g){
g=g||{};
var w=AjxEnv.platform.toLowerCase();
for(var c in d){
var f=c.split(".");
var h=f[f.length-1];
if(h=="win"||h=="mac"||h=="linux"){
if(h==w){
var k=f.slice(0,f.length-1).join(".");
d[k]=d[c]
}
d[c]=null
}}
for(var c in d){
var s=AjxStringUtil.trim(d[c]);
if(!s||(typeof d[c]!="string")){
continue
}
var f=c.split(".");
var e=f[f.length-1];
var a=(f.length==2);
var y=a?null:f[1];
if(f[0]=="keys"){
this._processKeyDef(y,e,s);
continue
}
if(e!=DwtKeyMap.INHERIT&&e!="keycode"){
continue
}
var m=DwtKeyMap.MAP_NAME[f[0]]||g[f[0]];
if((this._checkedMap[m]===false)||(!this._checkedMap[m]&&!this._checkMap(m))){
continue
}
if(!q[m]){
q[m]={}
}
if(!this._checkAction(m,y)){
continue
}
var o=s.split(/\s*;\s*/);
for(var v=0;
v<o.length;
v++){
var j=this._canonicalize(o[v]);
if(e==DwtKeyMap.INHERIT){
var x=j.split(/\s*,\s*/);
var t=[];
for(var u=0;
u<x.length;
u++){
t[u]=DwtKeyMap.MAP_NAME[x[u]]||g[x[u]]
}
q[m][f[1]]=t.join(",")
}else{
if(e=="keycode"){
q[m][j]=y
}}}
var n=[f[0],y,"repeat"].join(".");
var r=d[n];
if(r&&r.toLowerCase()!="false"){
if(!this._repeat[m]){
this._repeat[m]={}
}
this._repeat[m][y]=true
}}};
DwtKeyMap.prototype._checkMap=function(t){
var e=true;
this._checkedMap[t]=e;
return e
};
DwtKeyMap.prototype._checkAction=function(e,t){
return true
};
DwtKeyMap.prototype._processKeyDef=function(e,a,t){
if(!e||!a||!t){
return
}
if(a=="display"){
DwtKeyMap[e.toUpperCase()]=t
}else{
if(a=="keycode"){
DwtKeyMap.IS_MODIFIER[t]=true
}}};
DwtKeyMap.prototype._canonicalize=function(r){
var n=r.split(DwtKeyMap.SEP);
var e=[];
for(var a=0;
a<n.length;
a++){
var t=n[a];
var s=t.split(DwtKeyMap.JOIN);
if(s.length>2){
var o=s.slice(0,s.length-1);
o.sort(function(u,c){
var d=DwtKeyMap.MOD_ORDER[u]||0;
var h=DwtKeyMap.MOD_ORDER[c]||0;
return Number(d-h)
}
);
o.push(s[s.length-1]);
e.push(o.join(DwtKeyMap.JOIN))
}else{
e.push(t)
}}
return e.join(",")
}
}
if(AjxPackage.define("ajax.dwt.keyboard.DwtKeyMapMgr")){
DwtKeyMapMgr=function(a){
var t=this._map=a.getMap();
this._repeat=a._repeat;
this._args=a._args;
this._fsas={};
for(var e in t){
this._fsas[e]=DwtKeyMapMgr.__buildFSA({}
,t[e],e)
}};
DwtKeyMapMgr.NOT_A_TERMINAL=-999;
DwtKeyMapMgr.TAB_KEYCODE=9;
DwtKeyMapMgr.prototype.toString=function(){
return"DwtKeyMapMgr"
};
DwtKeyMapMgr.prototype.getActionCode=function(a,r,h){
var e=this._fsas[r];
if(!e){
return null
}
var s=a.length;
var d=e;
var c;
for(var t=0;
t<s&&d;
t++){
c=a[t];
if(!d||!d[c]){
break
}
if(t<s-1){
d=d[c].subMap
}}
if(d&&d[c]){
var n=d[c];
if(!n.subMap||h){
var o=this.__getInheritedActionCode(a,e,h);
return o==DwtKeyMapMgr.NOT_A_TERMINAL?DwtKeyMapMgr.NOT_A_TERMINAL:(n.actionCode||o)
}else{
return DwtKeyMapMgr.NOT_A_TERMINAL
}}else{
return this.__getInheritedActionCode(a,e,h)
}};
DwtKeyMapMgr.prototype.getAction=function(t,e){
return this._map[t][e]
};
DwtKeyMapMgr.prototype.getKeySequences=function(t,a){
var e=[];
for(var o in this._map[t]){
if(this._map[t][o]==a){
e.push(o)
}}
return e
};
DwtKeyMapMgr.prototype.setMapping=function(t,e,a){
this._map[t][e]=a
};
DwtKeyMapMgr.prototype.removeMapping=function(t,e){
delete this._map[t][e]
};
DwtKeyMapMgr.prototype.replaceMapping=function(a,e,t){
var o=this._map[a][e];
if(!o){
return
}
this.removeMapping(a,e);
this.setMapping(a,t,o)
};
DwtKeyMapMgr.prototype.setArg=function(t,a,e){
if(!this._args[t]){
this._args[t]={}
}
this._args[t][a]=e
};
DwtKeyMapMgr.prototype.removeArg=function(e,t){
delete this._args[e][t]
};
DwtKeyMapMgr.prototype.getArg=function(e,t){
return this._args[e]?this._args[e][t]:null
};
DwtKeyMapMgr.prototype.reloadMap=function(e){
this._fsas[e]=DwtKeyMapMgr.__buildFSA({}
,this._map[e],e)
};
DwtKeyMapMgr.prototype.getAncestors=function(o,n){
n=n||[];
var e=this._fsas[o];
var t=e&&e.inherit;
if(t&&t.length){
for(var a=0;
a<t.length;
a++){
n.push(t[a]);
n=this.getAncestors(t[a],n)
}}
return n
};
DwtKeyMapMgr.isInputElement=function(a){
if(!a){
return false
}
var t=a.ownerDocument?a.ownerDocument.designMode:null;
if(t&&(t.toLowerCase()=="on")){
return true
}
var e=a.tagName.toUpperCase();
return(e=="INPUT"||e=="TEXTAREA")
};
DwtKeyMapMgr.prototype.repeats=function(t,e){
return this._repeat[t]&&this._repeat[t][e]
};
DwtKeyMapMgr.__buildFSA=function(c,e,n){
for(var a in e){
if(a==DwtKeyMap.INHERIT){
c.inherit=e[a].split(/\s*,\s*/);
continue
}
var o=a.split(DwtKeyMap.SEP);
var s=o.length;
var h=c;
for(var t=0;
t<s;
t++){
var r=o[t];
if(!h[r]){
h[r]={}
}
if(t==s-1){
h[r].actionCode=e[a]
}else{
if(!h[r].subMap){
h[r].subMap={}
}
h=h[r].subMap
}}}
return c
};
DwtKeyMapMgr.prototype.__getInheritedActionCode=function(s,t,n){
if(t.inherit&&t.inherit.length){
var o=null;
var e=t.inherit.length;
for(var a=0;
a<e;
a++){
o=this.getActionCode(s,t.inherit[a],n);
if(o!=null){
return o
}}}
return null
};
DwtKeyMapMgr.hasModifier=function(e){
return(e.altKey||e.ctrlKey||e.metaKey)
}
}
if(AjxPackage.define("ajax.dwt.keyboard.DwtKeyboardMgr")){
DwtKeyboardMgr=function(e){
DwtKeyboardMgr.__shell=e;
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;
this._clearRepeatAction=new AjxTimedAction(null,function(){
DwtKeyboardMgr.__keyCode=null
}
);
this._clearRepeatActionId=-1
};
DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED=1;
DwtKeyboardMgr.__KEYSEQ_HANDLED=2;
DwtKeyboardMgr.__KEYSEQ_PENDING=3;
DwtKeyboardMgr.__KEYSEQ_REPEAT=4;
DwtKeyboardMgr.FOCUS_FIELD_ID="kbff";
DwtKeyboardMgr.isPossibleInputShortcut=function(e){
var t=DwtUiEvent.getTarget(e);
return(!DwtKeyMap.IS_MODIFIER[e.keyCode]&&(e.keyCode==27||DwtKeyMapMgr.hasModifier(e))||(t&&t.nodeName.toUpperCase()=="INPUT"&&(e.keyCode==13||e.keyCode==3)))
};
DwtKeyboardMgr.prototype.toString=function(){
return"DwtKeyboardMgr"
};
DwtKeyboardMgr.prototype.pushTabGroup=function(t){
if(!this.__keyboardHandlingInited||!t){
return
}
this.__tabGrpStack.push(t);
this.__currTabGroup=t;
var e=t.getFocusMember();
if(!e){
e=t.resetFocusMember(true)
}
if(!e){
return
}
t.addFocusChangeListener(this.__tabGroupChangeListenerObj);
this.grabFocus(e)
};
DwtKeyboardMgr.prototype.popTabGroup=function(r){
if(!this.__keyboardHandlingInited){
return
}
if(!r){
return
}
if(this.__tabGrpStack.length<=1){
return null
}
if(r&&this.__tabGrpStack[this.__tabGrpStack.length-1]!=r){
var t=this.__tabGrpStack;
var e=t.length;
for(var s=e-1;
s>=0;
s--){
if(r==t[s]){
t[s].dump();
break
}}
if(s<0){
return null
}else{
if(s!=e-1){
t.splice(s,1);
return r
}}}
var r=this.__tabGrpStack.pop();
r.removeFocusChangeListener(this.__tabGroupChangeListenerObj);
var n=null;
if(this.__tabGrpStack.length>0){
n=this.__tabGrpStack[this.__tabGrpStack.length-1];
var o=n.getFocusMember();
if(!o){
o=n.resetFocusMember(true)
}
if(o){
this.grabFocus(o)
}}
this.__currTabGroup=n;
return r
};
DwtKeyboardMgr.prototype.setTabGroup=function(t){
if(!this.__enabled||!this.__keyboardHandlingInited){
return
}
var e=this.popTabGroup();
this.pushTabGroup(t);
return e
};
DwtKeyboardMgr.prototype.pushDefaultHandler=function(e){
if(!this.__enabled||!this.__keyboardHandlingInited||!e){
return
}
this.__defaultHandlerStack.push(e);
this.__currDefaultHandler=e
};
DwtKeyboardMgr.prototype.popDefaultHandler=function(){
if(!this.__keyboardHandlingInited||(this.__defaultHandlerStack.length<=1)){
return
}
var e=this.__defaultHandlerStack.pop();
this.__currDefaultHandler=this.__defaultHandlerStack[this.__defaultHandlerStack.length-1];
return e
};
DwtKeyboardMgr.prototype.grabFocus=function(e){
if(!this.__enabled){
return
}
if(!this.__keyboardHandlingInited){
return
}
if(!e){
return
}
if(this.__currTabGroup){
this.__currTabGroup.setFocusMember(e,false,true)
}
this.__doGrabFocus(e)
};
DwtKeyboardMgr.prototype.inputGotFocus=function(e){
this.__focusObj=e;
this.__dwtInputCtrl=true;
this.__dwtCtrlHasFocus=false;
if(this.__currTabGroup){
this.__currTabGroup.setFocusMember(e.getTabGroupMember(),false,true)
}};
DwtKeyboardMgr.prototype.getFocusObj=function(e){
return this.__focusObj
};
DwtKeyboardMgr.prototype.dwtControlHasFocus=function(e){
if(!this.__enabled){
return false
}
if(!this.__keyboardHandlingInited){
return false
}
return(this.__dwtCtrlHasFocus&&this.__focusObj==e)
};
DwtKeyboardMgr.prototype.registerDefaultKeyActionHandler=function(e){
if(!this.__enabled){
return
}
this.__defaultKeyActionHdlr=e
};
DwtKeyboardMgr.prototype.registerKeyMap=function(e){
if(!this.__checkStatus()){
return
}
this.__keyMapMgr=new DwtKeyMapMgr(e)
};
DwtKeyboardMgr.prototype.setKeyTimeout=function(e){
this.__keyTimeout=e
};
DwtKeyboardMgr.prototype.clearKeySeq=function(){
this.__killKeySeqTimedActionId=-1;
this.__keySequence.length=0
};
DwtKeyboardMgr.prototype.enable=function(e){
this.__enabled=e;
if(e){
this.__checkStatus();
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 e=this._kbFocusField=document.createElement("textarea");
e.id=DwtKeyboardMgr.FOCUS_FIELD_ID;
e.tabIndex=0;
e.style.position=Dwt.ABSOLUTE_STYLE;
e.style.top=e.style.left=Dwt.LOC_NOWHERE;
e.onblur=DwtKeyboardMgr.__onBlurHdlr;
e.onfocus=DwtKeyboardMgr.__onFocusHdlr;
document.body.appendChild(e);
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(e){
if(!e){
return
}
var o=(Dwt.instanceOf(e,"DwtInputField")||Dwt.instanceOf(e,"DwtHtmlEditor")||Dwt.instanceOf(e,"DwtCheckbox")||Dwt.instanceOf(e,"DwtRadioButton")||Dwt.instanceOf(e,"ZmAdvancedHtmlEditor"));
if(o||!(e instanceof DwtControl)){
if(this.__focusObj instanceof DwtControl&&!this.__dwtInputCtrl){
this.__oldFocusObj=this.__focusObj
}
this.__focusObj=e;
this.__dwtInputCtrl=o;
var a=o?e.getInputElement():e;
if((!AjxEnv.isIE&&e.focus)||(AjxEnv.isIE&&e.focus&&!a.disabled&&Dwt.getVisible(a))){
try{
e.focus()
}
catch(t){}}}else{
if(this.__dwtCtrlHasFocus&&(this.__focusObj instanceof DwtControl)){
DwtKeyboardMgr.__onBlurHdlr();
this.__dwtCtrlHasFocus=true
}
this.__focusObj=e;
this.__dwtInputCtrl=false;
if(this.__dwtCtrlHasFocus){
DwtKeyboardMgr.__onFocusHdlr()
}else{
DwtKeyboardMgr.__onFocusHdlr();
this._kbFocusField.focus()
}}};
DwtKeyboardMgr.__onFocusHdlr=function(t){
var a=DwtKeyboardMgr.__shell.getKeyboardMgr();
a.__dwtCtrlHasFocus=true;
var e=a.__focusObj;
if(e&&e.__doFocus){
e.__doFocus()
}};
DwtKeyboardMgr.__onBlurHdlr=function(t){
var a=DwtKeyboardMgr.__shell.getKeyboardMgr();
var e=a.__oldFocusObj||a.__focusObj;
if(e&&e.__doBlur){
e.__doBlur()
}
a.__oldFocusObj=null;
a.__dwtCtrlHasFocus=false
};
DwtKeyboardMgr.__keyUpHdlr=function(e){
e=DwtUiEvent.getEvent(e);
DwtKeyboardMgr.__keyCode=null;
if(this._clearRepeatActionId!=-1){
AjxTimedAction.cancelAction(this._clearRepeatActionId);
this._clearRepeatActionId=-1
}
if(AjxEnv.isMac&&AjxEnv.isGeckoBased&&e.keyCode==0){
return DwtKeyboardMgr.__keyDownHdlr(e)
}else{
return DwtKeyboardMgr.__handleKeyEvent(e)
}};
DwtKeyboardMgr.__keyPressHdlr=function(e){
e=DwtUiEvent.getEvent(e);
if(DwtKeyboardMgr.__keyCode&&AjxEnv.isGeckoBased){
return DwtKeyboardMgr.__keyDownHdlr(e)
}else{
return DwtKeyboardMgr.__handleKeyEvent(e)
}};
DwtKeyboardMgr.__handleKeyEvent=function(e){
if(DwtKeyboardMgr.__shell._blockInput){
return false
}
if(e.type=="keypress"){
DwtKeyEvent.geckoCheck(e)
}
e=DwtUiEvent.getEvent(e,this);
var a=DwtKeyboardMgr.__shell.getKeyboardMgr();
var t=DwtShell.keyEvent;
t.setFromDhtmlEvent(e);
if(a.__kbEventStatus!=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED){
return a.__processKeyEvent(e,t,false)
}};
DwtKeyboardMgr.__syncFocus=function(t,e){
if((e!=t._kbFocusField)&&t.__dwtCtrlHasFocus){
t._kbFocusField.focus()
}
if(!t.__dwtCtrlHasFocus){
if((e!=t.__focusObj)&&!t.__dwtInputCtrl){
if(t.__currTabGroup&&t.__currTabGroup.setFocusMember(e)){
t.__focusObj=e;
t.__oldFocusObj=null
}else{
return false
}}}
return true
};
DwtKeyboardMgr.__keyDownHdlr=function(r){
if(DwtKeyboardMgr.__shell._blockInput){
return false
}
r=DwtUiEvent.getEvent(r,this);
var e=DwtKeyboardMgr.__shell.getKeyboardMgr();
if(!e||!e.__checkStatus()){
return false
}
var d=DwtShell.keyEvent;
d.setFromDhtmlEvent(r);
var c=DwtKeyboardMgr.__keyCode||DwtKeyEvent.getCharCode(r);
var h=(DwtKeyboardMgr.__keyCode!=null);
DwtKeyboardMgr.__shell.getToolTip().popdown();
var o=DwtKeyboardMgr.__syncFocus(e,d.target);
if(!o){}
if(c==DwtKeyMapMgr.TAB_KEYCODE){
if(e.__currTabGroup&&!DwtKeyMapMgr.hasModifier(d)){
if(!DwtMenu.menuShowing()){
if(o||e.__currTabGroup.getFocusMember()){
if(!d.shiftKey){
e.__currTabGroup.getNextFocusMember(true)
}else{
e.__currTabGroup.getPrevFocusMember(true)
}}else{
e.__currTabGroup.resetFocusMember(true)
}}
return e.__processKeyEvent(r,d,false,DwtKeyboardMgr.__KEYSEQ_HANDLED)
}else{
return e.__processKeyEvent(r,d,true,DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)
}}else{
if(e.__currTabGroup&&!o&&AjxEnv.isGecko&&d.target instanceof HTMLHtmlElement){
e.__currTabGroup.resetFocusMember(true)
}}
if(e.__dwtCtrlHasFocus){
e._kbFocusField.value=""
}
if(DwtKeyMap.IS_MODIFIER[c]||(!e.__dwtCtrlHasFocus&&(e.__killKeySeqTimedActionId==-1)&&DwtKeyMapMgr.isInputElement(d.target)&&!DwtKeyboardMgr.isPossibleInputShortcut(d))){
return e.__processKeyEvent(r,d,true,DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)
}
if(e.__killKeySeqTimedActionId!=-1){
AjxTimedAction.cancelAction(e.__killKeySeqTimedActionId);
e.__killKeySeqTimedActionId=-1
}
var t=[];
if(d.altKey){
t.push(DwtKeyMap.ALT)
}
if(d.ctrlKey){
t.push(DwtKeyMap.CTRL)
}
if(d.metaKey){
t.push(DwtKeyMap.META)
}
if(d.shiftKey){
t.push(DwtKeyMap.SHIFT)
}
t.push(c);
e.__keySequence[e.__keySequence.length]=t.join(DwtKeyMap.JOIN);
var s=DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED;
var a=e.__focusObj;
if(a&&(a.handleKeyAction)&&(e.__dwtCtrlHasFocus||e.__dwtInputCtrl||(a.hasFocus&&a.hasFocus()))){
s=e.__dispatchKeyEvent(a,d,false,h);
while((s==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)&&a.parent&&a.parent.getKeyMapName){
a=a.parent;
s=e.__dispatchKeyEvent(a,d,false,h)
}}
if((s==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED)&&e.__currDefaultHandler&&!(e.__currTabGroup&&e.__currTabGroup.isDefaultHandlingBlocked())){
s=e.__dispatchKeyEvent(e.__currDefaultHandler,d,false,h)
}
e.__kbEventStatus=s;
var n=(s==DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED);
if(s!=DwtKeyboardMgr.__KEYSEQ_PENDING){
e.clearKeySeq()
}
if(s==DwtKeyboardMgr.__KEYSEQ_REPEAT){
DwtKeyboardMgr.__keyCode=c;
e._clearRepeatActionId=AjxTimedAction.scheduleAction(e._clearRepeatAction,150)
}
return e.__processKeyEvent(r,d,n)
};
DwtKeyboardMgr.prototype.__dispatchKeyEvent=function(s,r,o,a){
if(s&&s.handleKeyEvent){
var h=s.handleKeyEvent(r);
return h?DwtKeyboardMgr.__KEYSEQ_HANDLED:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
}
var n=(s&&s.getKeyMapName)?s.getKeyMapName():null;
if(!n){
return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
}
var t=this.__keyMapMgr.getActionCode(this.__keySequence,n,o);
if(t==DwtKeyMapMgr.NOT_A_TERMINAL){
this.__hdlr=s;
this.__mapName=n;
this.__ev=r;
this.__killKeySeqTimedActionId=AjxTimedAction.scheduleAction(this.__killKeySeqTimedAction,this.__keyTimeout);
return DwtKeyboardMgr.__KEYSEQ_PENDING
}else{
if(t!=null){
if(!s.handleKeyAction){
return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
}
if(!a&&this.__keyMapMgr.repeats(n,t)){
if(AjxEnv.isGeckoBased){
return DwtKeyboardMgr.__KEYSEQ_REPEAT
}else{
var e=s.handleKeyAction(t,r);
return e?DwtKeyboardMgr.__KEYSEQ_REPEAT:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
}}
var e=s.handleKeyAction(t,r);
return e?DwtKeyboardMgr.__KEYSEQ_HANDLED:DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
}else{
return DwtKeyboardMgr.__KEYSEQ_NOT_HANDLED
}}};
DwtKeyboardMgr.prototype.__killKeySequenceAction=function(){
this.__dispatchKeyEvent(this.__hdlr,this.__ev,true);
this.clearKeySeq()
};
DwtKeyboardMgr.prototype.__tabGrpChangeListener=function(e){
this.__doGrabFocus(e.newFocusMember)
};
DwtKeyboardMgr.prototype.__processKeyEvent=function(a,o,e,t){
if(t){
this.__kbEventStatus=t
}
o._stopPropagation=!e;
o._returnValue=e;
o.setToDhtmlEvent(a);
return e
}
}
if(AjxPackage.define("ajax.dwt.keyboard.DwtTabGroup")){
DwtTabGroup=function(t,e){
this.__members=new AjxVector();
this.__parent=null;
this.__name=t;
this.__blockApplicationHandling=e;
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.getName=function(){
return this.__name
};
DwtTabGroup.prototype.addFocusChangeListener=function(e){
this.__checkRoot();
this.__evtMgr.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabGroup.prototype.removeFocusChangeListener=function(e){
this.__checkRoot();
this.__evtMgr.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabGroup.prototype.addMember=function(n,a){
if(!n){
return
}
var t=(n instanceof Array)?n:[n];
for(var o=0,e=t.length;
o<e;
o++){
this.__members.add(t[o],a);
if(t[o] instanceof DwtTabGroup){
t[o].newParent(this)
}}};
DwtTabGroup.prototype.addMemberAfter=function(e,t){
this.addMember(e,this.__members.indexOf(t)+1)
};
DwtTabGroup.prototype.addMemberBefore=function(e,t){
this.addMember(e,this.__members.indexOf(t))
};
DwtTabGroup.prototype.removeMember=function(a,e,t){
return this.replaceMember(a,null,e,t)
};
DwtTabGroup.prototype.removeAllMembers=function(){
this.__members.removeAll()
};
DwtTabGroup.prototype.replaceMember=function(n,s,c,r,e,o){
var t=this.__getTabGroupForMember(n);
if(!t){
this.addMember(s);
return null
}
var h=this.__getRootTabGroup();
var a;
if(e){
a=e
}else{
if(h.__currFocusMember==n||((n instanceof DwtTabGroup)&&n.contains(h.__currFocusMember))){
if(s){
a=(s instanceof DwtTabGroup)?s.getFirstMember():s
}else{
a=this.__getPrevMember(n,c);
if(!a){
a=this.__getNextMember(n,c)
}}}}
if(a&&!o){
h.__currFocusMember=a;
if(!r){
this.__notifyListeners(a)
}}
return s?this.__members.replaceObject(n,s):this.__members.remove(n)
};
DwtTabGroup.prototype.contains=function(e){
return(Boolean(this.__getTabGroupForMember(e)))
};
DwtTabGroup.prototype.newParent=function(e){
this.__parent=e
};
DwtTabGroup.prototype.getFirstMember=function(e){
return this.__getLeftMostMember(e)
};
DwtTabGroup.prototype.getTabGroupMemberByName=function(t){
var e=this.__members.getArray();
for(var a=0;
a<e.length;
a++){
var o=e[a];
if(o instanceof DwtTabGroup&&o.getName()==t){
return o
}}};
DwtTabGroup.prototype.getLastMember=function(e){
return this.__getRightMostMember(e)
};
DwtTabGroup.prototype.getFocusMember=function(){
this.__checkRoot();
return this.__currFocusMember
};
DwtTabGroup.prototype.setFocusMember=function(o,e,t){
this.__checkRoot();
if(!this.__checkEnabled(o,e)){
return false
}
var a=this.__getTabGroupForMember(o);
if(a){
this.__currFocusMember=o;
if(!t){
this.__notifyListeners(this.__currFocusMember)
}
return true
}
return false
};
DwtTabGroup.prototype.getNextFocusMember=function(e,t){
this.__checkRoot();
return this.__setFocusMember(true,e,t)
};
DwtTabGroup.prototype.getPrevFocusMember=function(e,t){
this.__checkRoot();
return this.__setFocusMember(false,e,t)
};
DwtTabGroup.prototype.resetFocusMember=function(t,a){
this.__checkRoot();
var e=this.__getLeftMostMember(t);
if((e!=this.__currFocusMember)&&!a){
this.__notifyListeners(this.__currFocusMember)
}
this.__currFocusMember=e;
return this.__currFocusMember
};
DwtTabGroup.prototype.blockDefaultHandling=function(e){
this.__blockDefaultHandling=blockDefaultHandling
};
DwtTabGroup.prototype.isDefaultHandlingBlocked=function(e){
return this.__blockDefaultHandling
};
DwtTabGroup.prototype.dump=function(e){
if(!window.AjxDebug&&window.DBG){
return
}
this.__dump(this,e)
};
DwtTabGroup.prototype.size=function(){
return this.__members.size()
};
DwtTabGroup.prototype.__getPrevMember=function(s,t){
var e=this.__members.getArray();
for(var o=this.__members.indexOf(s)-1;
o>-1;
o--){
var n=e[o];
if(!(n instanceof DwtTabGroup)){
if(this.__checkEnabled(n,t)){
return n
}}else{
n=n.__getRightMostMember(t);
if(n&&this.__checkEnabled(n,t)){
return n
}}}
return this.__parent?this.__parent.__getPrevMember(this,t):null
};
DwtTabGroup.prototype.__checkEnabled=function(t,e){
if(!e){
return true
}
if(!t||t.noTab){
return false
}
if(t instanceof DwtControl){
return(t.getEnabled()&&t.getVisible())
}else{
return !t.disabled&&Dwt.getVisible(t)
}};
DwtTabGroup.prototype.__getNextMember=function(r,t){
var e=this.__members.getArray();
var s=this.__members.size();
for(var n=this.__members.indexOf(r)+1;
n<s;
n++){
var o=e[n];
if(!(o instanceof DwtTabGroup)){
if(this.__checkEnabled(o,t)){
return o
}}else{
o=o.__getLeftMostMember(t);
if(o&&this.__checkEnabled(o,t)){
return o
}}}
return this.__parent?this.__parent.__getNextMember(this,t):null
};
DwtTabGroup.prototype.__getRightMostMember=function(t){
var e=this.__members.getArray();
var n=null;
for(var o=this.__members.size()-1;
o>=0;
o--){
n=e[o];
if(!(n instanceof DwtTabGroup)){
if(this.__checkEnabled(n,t)){
break
}}else{
n=n.__getRightMostMember(t);
if(n&&this.__checkEnabled(n,t)){
break
}}}
return(n&&this.__checkEnabled(n,t))?n:null
};
DwtTabGroup.prototype.__getLeftMostMember=function(t){
var n=this.__members.size();
var e=this.__members.getArray();
var s=null;
for(var o=0;
o<n;
o++){
s=e[o];
if(!(s instanceof DwtTabGroup)){
if(this.__checkEnabled(s,t)){
break
}}else{
s=s.__getLeftMostMember(t);
if(s&&this.__checkEnabled(s,t)){
break
}}}
return(s&&this.__checkEnabled(s,t))?s:null
};
DwtTabGroup.prototype.__notifyListeners=function(t){
var a=this.__getRootTabGroup();
if(a.__evtMgr){
var e=DwtTabGroup.__changeEvt;
e.reset();
e.tabGroup=this;
e.newFocusMember=t;
a.__evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,e)
}};
DwtTabGroup.prototype.__getRootTabGroup=function(){
var e=this;
while(e.__parent){
e=e.__parent
}
return e
};
DwtTabGroup.prototype.__dump=function(n,t,h){
h=h||0;
var r="";
for(var o=0;
o<h;
o++){
r+="&nbsp;&nbsp;&nbsp;&nbsp;"
}
t=t||AjxDebug.DBG1;
r+="&nbsp;&nbsp;&nbsp;&nbsp;";
var s=n.__members.size();
var e=n.__members.getArray();
for(var o=0;
o<s;
o++){
if(e[o] instanceof DwtTabGroup){
n.__dump(e[o],t,h+1)
}else{
if(e[o].toString){}else{}}}};
DwtTabGroup.prototype.__setFocusMember=function(n,t,a){
if(!this.__currFocusMember){
return this.resetFocusMember(t,a)
}
var o=this.__getTabGroupForMember(this.__currFocusMember);
if(!o){
return null
}
var e=(n)?o.__getNextMember(this.__currFocusMember,t):o.__getPrevMember(this.__currFocusMember,t);
if(!e){
e=(n)?this.__getLeftMostMember(t):this.__getRightMostMember(t);
if(e==this.__currFocusMember){
return null
}}
this.__currFocusMember=e;
if(!a){
this.__notifyListeners(this.__currFocusMember)
}
return this.__currFocusMember
};
DwtTabGroup.prototype.__getTabGroupForMember=function(s){
if(!s){
return null
}
var n=this.__members.size();
var t=this.__members.getArray();
var e;
for(var o=0;
o<n;
o++){
e=t[o];
if(e==s){
return this
}else{
if(e instanceof DwtTabGroup&&(e=e.__getTabGroupForMember(s))){
return e
}}}
return null
};
DwtTabGroup.prototype.__checkRoot=function(){
if(this.__parent){
throw DwtTabGroup.NOT_ROOT_TABGROUP
}}
}
if(AjxPackage.define("ajax.dwt.dnd.DwtDragEvent")){
DwtDragEvent=function(){
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;
DwtDragEvent.DRAG_CANCEL=4
}
if(AjxPackage.define("ajax.dwt.dnd.DwtDragSource")){
DwtDragSource=function(e){
this.__supportedOps=e;
this.__evtMgr=new AjxEventMgr()
};
DwtDragSource.__DRAG_LISTENER="DwtDragSource.__DRAG_LISTENER";
DwtDragSource.__dragEvent=new DwtDragEvent();
DwtDragSource.prototype.toString=function(){
return"DwtDragSource"
};
DwtDragSource.prototype.addDragListener=function(e){
this.__evtMgr.addListener(DwtDragSource.__DRAG_LISTENER,e)
};
DwtDragSource.prototype.removeDragListener=function(e){
this.__evtMgr.removeListener(DwtDragSource.__DRAG_LISTENER,e)
};
DwtDragSource.prototype._beginDrag=function(e,t){
if(!(this.__supportedOps&e)){
return Dwt.DND_DROP_NONE
}
DwtDragSource.__dragEvent.operation=e;
DwtDragSource.__dragEvent.srcControl=t;
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
};
DwtDragSource.prototype._cancelDrag=function(){
DwtDragSource.__dragEvent.action=DwtDragEvent.DRAG_CANCEL;
DwtDragSource.__dragEvent.doit=false;
this.__evtMgr.notifyListeners(DwtDragSource.__DRAG_LISTENER,DwtDragSource.__dragEvent);
return DwtDragSource.__dragEvent.doit
}
}
if(AjxPackage.define("ajax.dwt.dnd.DwtDropEvent")){
DwtDropEvent=function(){
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
}
if(AjxPackage.define("ajax.dwt.dnd.DwtDropTarget")){
DwtDropTarget=function(t){
this._evtMgr=new AjxEventMgr();
this.__hasMultiple=false;
this._types={};
if(typeof t=="string"){
t=[t]
}
if(t&&t.length){
for(var e=0;
e<t.length;
e++){
this.addTransferType(t[e])
}}};
DwtDropTarget.__DROP_LISTENER="DwtDropTarget.__DROP_LISTENER";
DwtDropTarget.__dropEvent=new DwtDropEvent();
DwtDropTarget.prototype.toString=function(){
return"DwtDropTarget"
};
DwtDropTarget.prototype.addDropListener=function(e){
this._evtMgr.addListener(DwtDropTarget.__DROP_LISTENER,e)
};
DwtDropTarget.prototype.removeDropListener=function(e){
this._evtMgr.removeListener(DwtDropTarget.__DROP_LISTENER,e)
};
DwtDropTarget.prototype.isValidTarget=function(t){
if(t instanceof Array){
var e=t.length;
for(var a=0;
a<e;
a++){
if(!this.__checkTarget(t[a])){
return false
}}
return true
}else{
return this.__checkTarget(t)
}};
DwtDropTarget.prototype.markAsMultiple=function(){
this.__hasMultiple=true
};
DwtDropTarget.prototype.hasMultipleTargets=function(){
return this.__hasMultiple
};
DwtDropTarget.prototype.getTransferTypes=function(){
return this._types
};
DwtDropTarget.prototype.addTransferType=function(e){
this._types[e]=null
};
DwtDropTarget.prototype._dragEnter=function(e,a,n,t,o){
DwtDropTarget.__dropEvent.operation=e;
DwtDropTarget.__dropEvent.targetControl=a;
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_ENTER;
DwtDropTarget.__dropEvent.srcData=n;
DwtDropTarget.__dropEvent.uiEvent=t;
DwtDropTarget.__dropEvent.doIt=true;
DwtDropTarget.__dropEvent.dndProxy=o;
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(e){
DwtDropTarget.__dropEvent.operation=e;
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_OP_CHANGED;
this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
return DwtDropTarget.__dropEvent.doIt
};
DwtDropTarget.prototype._drop=function(t,e){
DwtDropTarget.__dropEvent.action=DwtDropEvent.DRAG_DROP;
DwtDropTarget.__dropEvent.srcData=t;
DwtDropTarget.__dropEvent.uiEvent=e;
this._evtMgr.notifyListeners(DwtDropTarget.__DROP_LISTENER,DwtDropTarget.__dropEvent);
return DwtDropTarget.__dropEvent.doIt
};
DwtDropTarget.prototype.__checkTarget=function(item){
if(this._types){
for(var i in this._types){
var ctor;
if(this._types[i]){
ctor=this._types[i]
}else{
ctor=this._types[i]=eval(i)
}
if(ctor&&(typeof ctor=="function")&&(item instanceof ctor)){
return true
}}
return false
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtHoverMgr")){
DwtHoverMgr=function(){
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(e){
this._hoverObject=e
};
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(e){
this._hoverOverDelay=e
};
DwtHoverMgr.prototype.setHoverOverData=function(e){
this._hoverOverData=e
};
DwtHoverMgr.prototype.setHoverOverListener=function(e){
this._hoverOverListener=e
};
DwtHoverMgr.prototype.setHoverOutDelay=function(e){
this._hoverOutDelay=e
};
DwtHoverMgr.prototype.setHoverOutData=function(e){
this._hoverOutData=e
};
DwtHoverMgr.prototype.setHoverOutListener=function(e){
this._hoverOutListener=e
};
DwtHoverMgr.prototype.hoverOver=function(e,t){
this._isHovering=true;
if(this._hoverOverActionId!=-1){
AjxTimedAction.cancelAction(this._hoverOverActionId)
}
this._hoverOverAction.args=[e,t];
this._hoverOverActionId=AjxTimedAction.scheduleAction(this._hoverOverAction,this._hoverOverDelay)
};
DwtHoverMgr.prototype.hoverOut=function(){
this._isHovering=false;
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;
if(this._hoverOverListener!=null){
var e=this._hoverOverAction.args[0];
var a=this._hoverOverAction.args[1];
var t=new DwtHoverEvent(DwtEvent.HOVEROVER,this._hoverOverDelay,this._hoverOverData,e,a);
this._hoverOverListener.handleEvent(t)
}};
DwtHoverMgr.prototype._notifyHoverOut=function(){
this._hoverOutActionId=-1;
if(this._hoverOutListener!=null){
var e=new DwtHoverEvent(DwtEvent.HOVEROUT,this._hoverOutDelay,this._hoverOutData);
this._hoverOutListener.handleEvent(e)
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtControl")){
DwtControl=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtControl.PARAMS);
var e=this.parent=t.parent;
if(e&&!(e instanceof DwtComposite)){
throw new DwtException("Parent must be a subclass of Composite",DwtException.INVALIDPARENT,"DwtControl")
}
this.shell=null;
this._data={};
this._eventMgr=new AjxEventMgr();
this._disposed=false;
if(!e){
return
}
this._className=t.className||"DwtControl";
this.__posStyle=t.posStyle;
if(t.id){
this._htmlElId=t.id
}
this.__index=t.index;
this.__parentElement=t.parentElement;
this._enabled=false;
this._dragging=null;
this._dndProxy=null;
this._hasFocus=false;
if(!t.deferred){
this.__initCtrl()
}
this._hoverOverListener=new AjxListener(this,this.__handleHoverOver);
this._hoverOutListener=new AjxListener(this,this.__handleHoverOut);
this._dblClickIsolation=false;
this._ignoreInternalOverOut=false;
this.TEMPLATE=t.template||this.TEMPLATE
};
DwtControl.PARAMS=["parent","className","posStyle","deferred","id","index","template"];
DwtControl.ALL_BY_ID={};
DwtControl.prototype.toString=function(){
return"DwtControl"
};
DwtControl.NORMAL="";
DwtControl.ACTIVE="ZActive";
DwtControl.FOCUSED="ZFocused";
DwtControl.DISABLED="ZDisabled";
DwtControl.HOVER="ZHover";
DwtControl.SELECTED="ZSelected";
DwtControl.DEFAULT="ZDefault";
DwtControl.ERROR="ZError";
DwtControl._RE_STATES=new RegExp("\\b("+[DwtControl.ACTIVE,DwtControl.FOCUSED,DwtControl.DISABLED,DwtControl.HOVER,DwtControl.SELECTED,DwtControl.DEFAULT,DwtControl.ERROR].join("|")+")\\b","g");
DwtControl.STATIC_STYLE=Dwt.STATIC_STYLE;
DwtControl.ABSOLUTE_STYLE=Dwt.ABSOLUTE_STYLE;
DwtControl.RELATIVE_STYLE=Dwt.RELATIVE_STYLE;
DwtControl.FIXED_STYLE=Dwt.FIXED_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.__DBL_CLICK_TIMEOUT=300;
DwtControl.prototype._displayState="";
DwtControl.prototype.addControlListener=function(e){
this.addListener(DwtEvent.CONTROL,e)
};
DwtControl.prototype.removeControlListener=function(e){
this.removeListener(DwtEvent.CONTROL,e)
};
DwtControl.prototype.addDisposeListener=function(e){
this.addListener(DwtEvent.DISPOSE,e)
};
DwtControl.prototype.removeDisposeListener=function(e){
this.removeListener(DwtEvent.DISPOSE,e)
};
DwtControl.prototype.addListener=function(t,a,e){
return this._eventMgr.addListener(t,a,e)
};
DwtControl.prototype.removeListener=function(e,t){
return this._eventMgr.removeListener(e,t)
};
DwtControl.prototype.removeAllListeners=function(e){
return this._eventMgr.removeAll(e)
};
DwtControl.prototype.isListenerRegistered=function(e){
return this._eventMgr.isListenerRegistered(e)
};
DwtControl.prototype.notifyListeners=function(e,t){
return this._eventMgr.notifyListeners(e,t)
};
DwtControl.prototype.dispose=function(){
if(this._disposed){
return
}
if(this.parent!=null&&this.parent instanceof DwtComposite){
this.parent.removeChild(this)
}
this._elRef=null;
if(DwtControl.ALL_BY_ID){
DwtControl.ALL_BY_ID[this._htmlElId]=null;
delete DwtControl.ALL_BY_ID[this._htmlElId]
}
this._disposed=true;
var e=new DwtDisposeEvent();
e.dwtObj=this;
this.notifyListeners(DwtEvent.DISPOSE,e)
};
DwtControl.prototype.getDocument=function(){
return document
};
DwtControl.prototype.getTabGroupMember=function(){
return this
};
DwtControl.prototype.getData=function(e){
return this._data[e]
};
DwtControl.prototype.setData=function(e,t){
this._data[e]=t
};
DwtControl.prototype.isDisposed=function(){
return this._isDisposed
};
DwtControl.prototype.isInitialized=function(){
return this.__ctrlInited
};
DwtControl.prototype.focus=function(){
DwtShell.getShell(window).getKeyboardMgr().grabFocus(this);
this.__doFocus()
};
DwtControl.prototype.blur=function(){
this.__doBlur()
};
DwtControl.prototype.hasFocus=function(){
return this._hasFocus
};
DwtControl.prototype.handleKeyAction=function(e,t){
return false
};
DwtControl.prototype.reparent=function(t,e){
if(!this._checkState()){
return
}
var a=this.getHtmlElement();
this.parent.removeChild(this,true);
DwtComposite._pendingElements[this._htmlElId]=a;
t.addChild(this,e);
this.parent=t
};
DwtControl.prototype.reparentHtmlElement=function(a,e){
if(typeof a=="string"){
a=document.getElementById(a)
}
if(!a){
return
}
var t=this.getHtmlElement();
if(e==null){
a.appendChild(t)
}else{
if(typeof e=="object"){
a.insertBefore(t,e)
}else{
if(a.childNodes[e]){
a.insertBefore(t,a.childNodes[e])
}else{
a.appendChild(t)
}}}};
DwtControl.prototype.setHandler=function(t,e){
if(!this._checkState()){
return
}
var a=this.getHtmlElement();
Dwt.setHandler(a,t,e)
};
DwtControl.prototype.clearHandler=function(e){
if(!this._checkState()){
return
}
var t=this.getHtmlElement();
Dwt.clearHandler(t,e)
};
DwtControl.prototype.getBounds=function(){
if(!this._checkState()){
return
}
return Dwt.getBounds(this.getHtmlElement())
};
DwtControl.prototype.setBounds=function(a,s,o,t){
if(!this._checkState()){
return
}
var n=this.getHtmlElement();
if(this.isListenerRegistered(DwtEvent.CONTROL)){
this.__controlEvent.reset(DwtControlEvent.RESIZE|DwtControlEvent.MOVE);
var e=Dwt.getBounds(n);
this.__controlEvent.oldX=e.x;
this.__controlEvent.oldY=e.y;
this.__controlEvent.oldWidth=e.width;
this.__controlEvent.oldHeight=e.height;
this.setLocation(a,s);
this.setSize(o,t);
e=Dwt.getBounds(n);
this.__controlEvent.newX=e.x;
this.__controlEvent.newY=e.y;
this.__controlEvent.newWidth=e.width;
this.__controlEvent.newHeight=e.height;
this.__controlEvent.requestedWidth=o;
this.__controlEvent.requestedHeight=t;
this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent)
}else{
this.setLocation(a,s);
this.setSize(o,t)
}
return this
};
DwtControl.prototype.getClassName=function(){
return this._className
};
DwtControl.prototype.setClassName=function(t){
if(!this._checkState()){
return
}
this._className=t;
var e=this.getHtmlElement();
e.className=t;
Dwt.addClass(e,this._displayState)
};
DwtControl.prototype.addClassName=function(e){
Dwt.addClass(this.getHtmlElement(),e)
};
DwtControl.prototype.delClassName=function(e,t){
Dwt.delClass(this.getHtmlElement(),e,t)
};
DwtControl.prototype.condClassName=function(a,e,t){
Dwt.condClass(this.getHtmlElement(),a,e,t)
};
DwtControl.prototype.setDisplayState=function(o){
if(!this._enabled){
o=DwtControl.DISABLED
}
if(arguments.length>1){
var e=[];
for(var t=0;
t<arguments.length;
t++){
e.push(arguments[t])
}
o=e.join(" ")
}
if(this._displayState!=o){
this._displayState=o;
Dwt.delClass(this.getHtmlElement(),DwtControl._RE_STATES,o)
}};
DwtControl.prototype.showAlert=function(e){
if(e&&!this._alert){
this.delClassName(null,"ZAlert")
}else{
if(!e&&this._alert){
this.delClassName("ZAlert",null)
}}
this._alert=e
};
DwtControl.prototype.isAlertShown=function(){
return this._alert
};
DwtControl.prototype._createHtmlFromTemplate=function(e,a){
this.getHtmlElement().innerHTML=AjxTemplate.expand(e,a);
var o=AjxTemplate.getParams(e);
var t=o&&o["class"];
if(t){
t=[this._className,t].join(" ");
this.setClassName(t)
}};
DwtControl.prototype.getCursor=function(){
if(!this._checkState()){
return
}
return Dwt.getCursor(this.getHtmlElement())
};
DwtControl.prototype.setCursor=function(e){
if(!this._checkState()){
return
}
Dwt.setCursor(this.getHtmlElement(),e)
};
DwtControl.prototype.getDragSource=function(){
return this._dragSource
};
DwtControl.prototype.setDragSource=function(e){
this._dragSource=e;
if(e!=null&&this._ctrlCaptureObj==null){
this._ctrlCaptureObj=new DwtMouseEventCapture({
targetObj:this,id:"DwtControl",mouseOverHdlr:DwtControl.__mouseOverHdlr,mouseDownHdlr:DwtControl.__mouseDownHdlr,mouseMoveHdlr:DwtControl.__mouseMoveHdlr,mouseUpHdlr:DwtControl.__mouseUpHdlr,mouseOutHdlr:DwtControl.__mouseOutHdlr}
);
this._dndHoverAction=new AjxTimedAction(null,this.__dndDoHover)
}};
DwtControl.prototype.getDropTarget=function(){
return this._dropTarget
};
DwtControl.prototype.setDropTarget=function(e){
this._dropTarget=e
};
DwtControl.prototype.getEnabled=function(){
if(!this._checkState()){
return
}
return this._enabled
};
DwtControl.prototype.setEnabled=function(e,t){
if(!this._checkState()){
return
}
if(e!=this._enabled){
this._enabled=e;
this.setDisplayState(e?DwtControl.NORMAL:DwtControl.DISABLED);
if(t){
this.getHtmlElement().disabled=!e
}}};
DwtControl.prototype.getHTMLElId=function(){
return this._htmlElId
};
DwtControl.prototype.getHtmlElement=function(){
if(!this._checkState()){
return
}
var e=this._elRef||document.getElementById(this._htmlElId);
if(e==null){
e=DwtComposite._pendingElements[this._htmlElId]
}else{
if(!e._rendered){
delete DwtComposite._pendingElements[this._htmlElId];
e._rendered=true
}}
return this._elRef=e
};
DwtControl.fromElement=function(e){
return DwtControl.ALL_BY_ID&&DwtControl.ALL_BY_ID[e.id]
};
DwtControl.fromElementId=function(e){
return DwtControl.ALL_BY_ID&&DwtControl.ALL_BY_ID[e]
};
DwtControl.findControl=function(t){
while(t){
try{
if(t.id&&DwtControl.ALL_BY_ID&&DwtControl.ALL_BY_ID[t.id]){
return DwtControl.ALL_BY_ID[t.id]
}}
catch(e){
return null
}
t=t.parentNode
}
return null
};
DwtControl.getTargetControl=function(e,a){
var t=DwtUiEvent.getTarget(e,a);
return t?DwtControl.findControl(t):null
};
DwtControl.prototype.setHtmlElementId=function(t){
if(this._disposed){
return
}
if(this.__ctrlInited){
var e=this.getHtmlElement();
if(!e._rendered){
delete DwtComposite._pendingElements[this._htmlElId];
DwtComposite._pendingElements[t]=e
}else{
delete DwtControl.ALL_BY_ID[this._htmlElId];
DwtControl.ALL_BY_ID[t]=this
}
e.id=t
}
this._htmlElId=t
};
DwtControl.prototype.getX=function(){
if(!this._checkState()){
return
}
return Dwt.getLocation(this.getHtmlElement()).x
};
DwtControl.prototype.getXW=function(){
if(!this._checkState()){
return
}
var e=this.getBounds();
return e.x+e.width
};
DwtControl.prototype.getY=function(){
if(!this._checkState()){
return
}
return Dwt.getLocation(this.getHtmlElement()).y
};
DwtControl.prototype.getYH=function(){
if(!this._checkState()){
return
}
var e=this.getBounds();
return e.y+e.height
};
DwtControl.prototype.getLocation=function(){
if(!this._checkState()){
return
}
return Dwt.getLocation(this.getHtmlElement())
};
DwtControl.prototype.setLocation=function(e,o){
if(!this._checkState()){
return
}
if(this.isListenerRegistered(DwtEvent.CONTROL)){
var t=this.getHtmlElement();
this.__controlEvent.reset(DwtControlEvent.MOVE);
var a=Dwt.getLocation(t);
this.__controlEvent.oldX=a.x;
this.__controlEvent.oldY=a.y;
Dwt.setLocation(t,e,o);
a=Dwt.getLocation(t);
this.__controlEvent.newX=a.x;
this.__controlEvent.newY=a.y;
this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent)
}else{
Dwt.setLocation(this.getHtmlElement(),e,o)
}
return this
};
DwtControl.prototype.getScrollStyle=function(){
if(!this._checkState()){
return
}
return Dwt.getScrollStyle(this.getHtmlElement())
};
DwtControl.prototype.setScrollStyle=function(e){
if(!this._checkState()){
return
}
Dwt.setScrollStyle(this.getHtmlElement(),e)
};
DwtControl.prototype.setPosition=function(e){
if(!this._checkState()){
return
}
if(e==DwtControl.STATIC_STYLE||e==DwtControl.ABSOLUTE_STYLE||e==DwtControl.RELATIVE_STYLE){
this.__posStyle=e;
Dwt.setPosition(this.getHtmlElement(),e)
}};
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(t,e){
if(!this._checkState()){
return
}
if(this.isListenerRegistered(DwtEvent.CONTROL)){
var o=this.getHtmlElement();
this.__controlEvent.reset(DwtControlEvent.RESIZE);
var a=Dwt.getSize(o);
this.__controlEvent.oldWidth=a.x;
this.__controlEvent.oldHeight=a.y;
Dwt.setSize(o,t,e);
a=Dwt.getSize(o);
this.__controlEvent.newWidth=a.x;
this.__controlEvent.newHeight=a.y;
this.notifyListeners(DwtEvent.CONTROL,this.__controlEvent)
}else{
Dwt.setSize(this.getHtmlElement(),t,e)
}
return this
};
DwtControl.prototype.getToolTipContent=function(e){
if(this._disposed){
return
}
return this.__toolTipContent
};
DwtControl.prototype.setToolTipContent=function(e){
if(this._disposed){
return
}
this.__toolTipContent=e
};
DwtControl.prototype.getVisible=function(){
if(!this._checkState()){
return
}
return Dwt.getVisible(this.getHtmlElement())
};
DwtControl.prototype.setVisible=function(e){
if(!this._checkState()){
return
}
Dwt.setVisible(this.getHtmlElement(),e)
};
DwtControl.prototype.setVisibility=function(e){
if(!this._checkState()){
return
}
Dwt.setVisibility(this.getHtmlElement(),e)
};
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(e){
if(!this._checkState()){
return
}
Dwt.setZIndex(this.getHtmlElement(),e)
};
DwtControl.prototype.zShow=function(e){
this.setZIndex(e?Dwt.Z_VIEW:Dwt.Z_HIDDEN)
};
DwtControl.prototype.setDisplay=function(e){
if(!this._checkState()){
return
}
Dwt.setDisplay(this.getHtmlElement(),e)
};
DwtControl.prototype.preventSelection=function(e){
return !this.__isInputEl(e)
};
DwtControl.prototype.preventContextMenu=function(e){
return e?(!this.__isInputEl(e)):true
};
DwtControl.prototype.setContent=function(e){
if(e){
this.getHtmlElement().innerHTML=e
}};
DwtControl.prototype.clearContent=function(){
this.getHtmlElement().innerHTML=""
};
DwtControl.prototype.appendElement=function(t){
var e=AjxUtil.isString(t)?document.getElementById(t):t;
if(e){
e.appendChild(this.getHtmlElement(),e)
}};
DwtControl.prototype.replaceElement=function(o,e,n){
var t=AjxUtil.isString(o)?document.getElementById(o):o;
if(t){
var a=this.getHtmlElement();
t.parentNode.replaceChild(a,t);
this._replaceElementHook(t,a,e,n)
}};
DwtControl.prototype._replaceElementHook=function(t,o,e,n){
if((e==null||e)&&t.className){
Dwt.addClass(o,t.className)
}
if(n==null||n){
var a=t.getAttribute("style");
if(a){
o.setAttribute("style",[o.getAttribute("style"),a].join(";"))
}}};
DwtControl.prototype._blur=function(){};
DwtControl.prototype._focus=function(){};
DwtControl.prototype._focusByMouseUpEvent=function(e){
if(this.getEnabled()){
this.focus()
}};
DwtControl.prototype._focusByMouseDownEvent=function(e){
this._focusByMouseUpEvent(e)
};
DwtControl.prototype._getDragProxy=function(e){
return null
};
DwtControl.prototype._setDragProxyState=function(e){
Dwt.condClass(this._dndProxy,e,DwtCssStyle.DROPPABLE,DwtCssStyle.NOT_DROPPABLE)
};
DwtControl.__junkIconId=0;
DwtControl.prototype._destroyDragProxy=function(e){
if(e){
if(e.parentNode){
e.parentNode.removeChild(e)
}else{
e.style.zIndex=-100;
e.id="DwtJunkIcon"+DwtControl.__junkIconId++;
e=null
}}};
DwtControl.prototype._isValidDragObject=function(e){
return true
};
DwtControl.prototype._dragEnter=function(e){};
DwtControl.prototype._dragOver=function(e){};
DwtControl.prototype._dragHover=function(e){};
DwtControl.prototype._dragLeave=function(e){};
DwtControl.prototype._drop=function(e){};
DwtControl.prototype._setKeyPressEventHdlr=function(e){
this._setEventHdlrs([DwtEvent.ONKEYPRESS],e)
};
DwtControl.prototype._setMouseEventHdlrs=function(e){
this._setEventHdlrs(DwtEvent.MOUSE_EVENTS,e)
};
DwtControl.prototype._setEventHdlrs=function(a,e){
if(!this._checkState()){
return
}
var o=this.getHtmlElement();
for(var t=0;
t<a.length;
t++){
if(e!==true){
Dwt.setHandler(o,a[t],DwtControl.__HANDLER[a[t]])
}else{
Dwt.clearHandler(o,a[t])
}}};
DwtControl.prototype._setMouseEvents=function(){
var e=[DwtEvent.ONCONTEXTMENU,DwtEvent.ONDBLCLICK,DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEMOVE,DwtEvent.ONMOUSEUP,DwtEvent.ONSELECTSTART];
if(AjxEnv.isIE){
e.push(DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE)
}else{
e.push(DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT)
}
this._setEventHdlrs(e)
};
DwtControl.prototype._setMouseEvent=function(t,e){
t.reset();
e.ersatz=true;
DwtUiEvent.copy(t,e);
t.button=e.button
};
DwtControl.prototype._getStopPropagationValForMouseEv=function(e){
return true
};
DwtControl.prototype._getEventReturnValForMouseEv=function(e){
return false
};
DwtControl.prototype._checkState=function(){
if(this._disposed){
return false
}
if(!this.__ctrlInited){
this.__initCtrl()
}
return true
};
DwtControl.prototype._position=function(o){
this._checkState();
var a=this.shell.getSize();
var t=this.getSize();
var e,n;
if(!o){
e=Math.round((a.x-t.x)/2);
n=Math.round((a.y-t.y)/2)
}else{
e=o.x;
n=o.y
}
if((e+t.x)>a.x){
e=a.x-t.x
}
if((n+t.y)>a.y){
n=a.y-t.y
}
this.setLocation(e,n)
};
DwtControl._scrollIntoView=function(a,t){
var e=Dwt.toWindow(a,0,0,null,null,DwtPoint.tmp).y;
var r=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y+t.scrollTop;
var s=e-r;
if(s<0){
t.scrollTop+=s
}else{
var n=Dwt.getSize(t,DwtPoint.tmp).y;
var o=Dwt.getSize(a,DwtPoint.tmp).y;
s=(e+o)-(r+n);
if(s>0){
t.scrollTop+=s
}}};
DwtControl._dndScrollCallback=function(a,r){
var t=a.container;
if(!t){
return
}
var u=r.dwtObj&&r.dwtObj._dndScrollId;
if(r.type=="mouseup"||!u||(a.id&&u!=a.id)){
if(t._dndScrollActionId!=-1){
AjxTimedAction.cancelAction(t._dndScrollActionId);
t._dndScrollActionId=-1
}
return
}
t._scrollAmt=0;
if(t.clientHeight<t.scrollHeight){
var o=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y;
var m=o+t.scrollTop;
var h=t.scrollTop;
var c=r.docY-m;
var n=(t.clientWidth<t.scrollWidth)?a.threshold+Dwt.SCROLLBAR_WIDTH:a.threshold;
var s=(c<=n)?-1*a.amount:0;
if(s==0){
var e=Dwt.getSize(t,DwtPoint.tmp).y;
var d=m+e;
c=d-r.docY;
s=(c<=n)?a.amount:0
}
t._scrollAmt=s;
if(s){
if(!t._dndScrollAction){
t._dndScrollAction=new AjxTimedAction(null,DwtControl._dndScroll,[a]);
t._dndScrollActionId=-1
}
if(t._dndScrollActionId==-1){
t._dndScrollActionId=AjxTimedAction.scheduleAction(t._dndScrollAction,0)
}}else{
if(t._dndScrollActionId!=-1){
AjxTimedAction.cancelAction(t._dndScrollActionId);
t._dndScrollActionId=-1
}}}};
DwtControl._dndScroll=function(n){
var t=n.container;
var o=Dwt.toWindow(t,0,0,null,null,DwtPoint.tmp).y;
var a=Dwt.getSize(t,DwtPoint.tmp).y;
var e=t.scrollTop;
if((t._scrollAmt<0&&e>0)||(t._scrollAmt>0&&(e+a<t.scrollHeight))){
t.scrollTop+=t._scrollAmt;
t._dndScrollActionId=AjxTimedAction.scheduleAction(t._dndScrollAction,n.interval)
}};
DwtControl.__keyPressHdlr=function(a){
var o=o?o:DwtControl.getTargetControl(a);
if(!o){
return false
}
if(o.__hasToolTipContent()){
var t=DwtShell.getShell(window);
var e=t.getHoverMgr();
e.setHoverOutListener(o._hoverOutListener);
e.hoverOut();
o.__tooltipClosed=false
}};
DwtControl.prototype.__hasToolTipContent=function(){
if(this._disposed){
return false
}
return Boolean(this.__toolTipContent||(this.getToolTipContent!=DwtControl.prototype.getToolTipContent))
};
DwtControl.prototype.__doBlur=function(){
this._hasFocus=false;
if(this.isListenerRegistered(DwtEvent.ONBLUR)){
var e=DwtShell.focusEvent;
e.dwtObj=this;
e.state=DwtFocusEvent.BLUR;
obj.notifyListeners(DwtEvent.ONBLUR,mouseEv)
}
this._blur()
};
DwtControl.prototype.__doFocus=function(){
this._hasFocus=true;
if(this.isListenerRegistered(DwtEvent.ONFOCUS)){
var e=DwtShell.focusEvent;
e.dwtObj=this;
e.state=DwtFocusEvent.FOCUS;
obj.notifyListeners(DwtEvent.ONFOCUS,mouseEv)
}
this._focus()
};
DwtControl.__dblClickHdlr=function(e){
var t=DwtControl.getTargetControl(e);
if(t&&t._dblClickIsolation){
t._clickPending=false;
AjxTimedAction.cancelAction(t._dblClickActionId)
}
return DwtControl.__mouseEvent(e,DwtEvent.ONDBLCLICK)
};
DwtControl.__mouseOverHdlr=function(s,n){
var h=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
if(h!=null){
s=DwtUiEvent.getEvent(s);
s._stopPropagation=true;
return false
}
var r=DwtControl.getTargetControl(s);
if(!r){
return false
}
n=n||DwtEvent.ONMOUSEOVER;
if((n==DwtEvent.ONMOUSEOVER)&&r._ignoreInternalOverOut){
var e=DwtControl.getTargetControl(s,true);
if(r==e){
return false
}}
var o=DwtShell.mouseEvent;
if(r._dragging==DwtControl._NO_DRAG){
o.setFromDhtmlEvent(s,r);
if(r.isListenerRegistered(n)){
r.notifyListeners(n,o)
}
if(r.__hasToolTipContent()){
var a=DwtShell.getShell(window);
var t=a.getHoverMgr();
if((!t.isHovering()||t.getHoverObject()!=r)&&!DwtMenu.menuShowing()){
t.reset();
t.setHoverObject(r);
t.setHoverOverData(o);
t.setHoverOverDelay(DwtToolTip.TOOLTIP_DELAY);
t.setHoverOverListener(r._hoverOverListener);
t.hoverOver(o.docX,o.docY)
}}}
o._stopPropagation=true;
o._returnValue=false;
o.setToDhtmlEvent(s);
return false
};
DwtControl.__mouseEnterHdlr=function(e){
return DwtControl.__mouseOverHdlr(e,DwtEvent.ONMOUSEENTER)
};
DwtControl.__mouseDownHdlr=function(n){
var s=DwtControl.getTargetControl(n);
if(!s){
return false
}
n=DwtUiEvent.getEvent(n);
var o=DwtShell.mouseEvent;
o.setFromDhtmlEvent(n,s);
if(o.button==DwtMouseEvent.LEFT){
s._focusByMouseDownEvent(n)
}
if(s.__hasToolTipContent()){
var a=DwtShell.getShell(window);
var t=a.getHoverMgr();
t.setHoverOutListener(s._hoverOutListener);
t.hoverOut()
}
if(s._dragSource&&(o.button==DwtMouseEvent.LEFT)&&s._isValidDragObject(o)){
try{
s._ctrlCaptureObj.capture()
}
catch(e){}
s._dragOp=(o.ctrlKey)?Dwt.DND_DROP_COPY:Dwt.DND_DROP_MOVE;
s.__dragStartX=o.docX;
s.__dragStartY=o.docY
}
return DwtControl.__mouseEvent(n,DwtEvent.ONMOUSEDOWN,s,o)
};
DwtControl.__mouseMoveHdlr=function(r){
var n=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
var o=n?n.targetObj:DwtControl.getTargetControl(r);
if(!o){
return false
}
if(o.__dndHoverActionId!=-1){
AjxTimedAction.cancelAction(o.__dndHoverActionId);
o.__dndHoverActionId=-1
}
var h=DwtShell.mouseEvent;
h.setFromDhtmlEvent(r,n?true:o);
if(h.docX<0||h.docY<0){
h._stopPropagation=true;
h._returnValue=false;
h.setToDhtmlEvent(r);
return false
}
if(o._dragSource==null||n==null||(o!=null&&o._dragging==DwtControl._NO_DRAG&&Math.abs(o.__dragStartX-h.docX)<DwtControl.__DRAG_THRESHOLD&&Math.abs(o.__dragStartY-h.docY)<DwtControl.__DRAG_THRESHOLD)){
if(o.__hasToolTipContent()){
var s=DwtShell.getShell(window);
var e=s.getHoverMgr();
if(!e.isHovering()&&!o.__tooltipClosed&&!DwtMenu.menuShowing()){
e.hoverOver(h.docX,h.docY)
}else{
var a=o.__lastTooltipX?Math.abs(h.docX-o.__lastTooltipX):null;
var t=o.__lastTooltipY?Math.abs(h.docY-o.__lastTooltipY):null;
if((a!=null&&a>DwtControl.__TOOLTIP_THRESHOLD)||(t!=null&&t>DwtControl.__TOOLTIP_THRESHOLD)){
e.setHoverOutListener(o._hoverOutListener);
e.hoverOut();
o.__tooltipClosed=true
}}}
return DwtControl.__mouseEvent(r,DwtEvent.ONMOUSEMOVE,o,h)
}else{
if(o._dragging==DwtControl._NO_DRAG){
o._dragOp=o._dragSource._beginDrag(o._dragOp,o);
if(o._dragOp!=Dwt.DND_DROP_NONE){
o._dragging=DwtControl._DRAGGING;
o._dndProxy=o._getDragProxy(o._dragOp);
Dwt.addClass(o._dndProxy,"DwtDragProxy");
if(o._dndProxy==null){
o._dragging=DwtControl._DRAG_REJECTED
}}else{
o._dragging=DwtControl._DRAG_REJECTED
}}
if(o._dragging!=DwtControl._DRAG_REJECTED){
var c=h.dwtObj;
if(c){
o._dndHoverAction.args=[c];
o.__dndHoverActionId=AjxTimedAction.scheduleAction(o._dndHoverAction,DwtControl.__DND_HOVER_DELAY)
}
if(c&&c._dropTarget&&c!=o){
if(c!=o.__lastDestDwtObj||c._dropTarget.hasMultipleTargets()){
if(c._dropTarget._dragEnter(o._dragOp,c,o._dragSource._getData(),h,o._dndProxy)){
o._setDragProxyState(true);
o.__dropAllowed=true;
c._dragEnter(h)
}else{
o._setDragProxyState(false);
o.__dropAllowed=false
}}else{
if(o.__dropAllowed){
c._dragOver(h)
}}}else{
o._setDragProxyState(false)
}
if(o.__lastDestDwtObj&&o.__lastDestDwtObj!=c&&o.__lastDestDwtObj._dropTarget&&o.__lastDestDwtObj!=o){
if(c&&!c._dndScrollCallback&&o.__lastDestDwtObj._dndScrollCallback){
o.__lastDestDwtObj._dndScrollCallback.run(h)
}
o.__lastDestDwtObj._dragLeave(h);
o.__lastDestDwtObj._dropTarget._dragLeave()
}
o.__lastDestDwtObj=c;
if((c!=o)&&c&&c._dndScrollCallback){
c._dndScrollCallback.run(h)
}
Dwt.setLocation(o._dndProxy,h.docX+2,h.docY+2)
}else{
DwtControl.__mouseEvent(r,DwtEvent.ONMOUSEMOVE,o,h)
}
h._stopPropagation=true;
h._returnValue=false;
h.setToDhtmlEvent(r);
return false
}};
DwtControl.__mouseUpHdlr=function(t){
var n=(DwtMouseEventCapture.getId()=="DwtControl")?DwtMouseEventCapture.getCaptureObj():null;
var o=n?n.targetObj:DwtControl.getTargetControl(t);
if(!o){
return false
}
if(o.__dndHoverActionId!=-1){
AjxTimedAction.cancelAction(o.__dndHoverActionId);
o.__dndHoverActionId=-1
}
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t,n?true:o);
if(!o._dragSource||!n){
return DwtControl.__processMouseUpEvent(t,o,e)
}else{
n.release();
if(o._dragging!=DwtControl._DRAGGING){
o._dragging=DwtControl._NO_DRAG;
return DwtControl.__processMouseUpEvent(t,o,e)
}else{
o.__lastDestDwtObj=null;
var a=e.dwtObj;
if(a&&a._dropTarget&&o.__dropAllowed&&a!=o){
a._drop(e);
a._dropTarget._drop(o._dragSource._getData(),e);
o._dragSource._endDrag();
o._destroyDragProxy(o._dndProxy);
o._dragging=DwtControl._NO_DRAG
}else{
DwtControl.__badDrop(o,e)
}
if(a&&a._dndScrollCallback){
a._dndScrollCallback.run(e)
}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
}}};
DwtControl.__badDrop=function(a,t){
a._dragSource._cancelDrag();
a.__dragEndX=t.docX;
a.__dragEndY=t.docY;
if(a.__badDropAction==null){
a.__badDropAction=new AjxTimedAction(a,a.__badDropEffect)
}
var e=(a.__dragEndY-a.__dragStartY)/(a.__dragEndX-a.__dragStartX);
a.__badDropAction.args=[e,a.__dragStartY-(e*a.__dragStartX),(a.__dragStartX-a.__dragEndX<0)?-1:1];
AjxTimedAction.scheduleAction(a.__badDropAction,0)
};
DwtControl.__processMouseUpEvent=function(a,o,t){
if(o._dblClickIsolation&&t&&(t.button==DwtMouseEvent.LEFT)){
if(o._clickPending){
return false
}else{
o._clickPending=true;
var e=new AjxTimedAction(null,DwtControl.__timedClick,[a,o,t]);
o._dblClickActionId=AjxTimedAction.scheduleAction(e,DwtControl.__DBL_CLICK_TIMEOUT);
DwtUiEvent.setBehaviour(a,true,false);
o._st=new Date();
return false
}}else{
o._clickPending=false;
return DwtControl.__mouseEvent(a,DwtEvent.ONMOUSEUP,o,t)
}};
DwtControl.__timedClick=function(t,a,e){
a._clickPending=false;
DwtControl.__mouseEvent(t,DwtEvent.ONMOUSEUP,a,e)
};
DwtControl.__mouseOutHdlr=function(n,o){
var s=DwtControl.getTargetControl(n);
if(!s){
return false
}
o=o||DwtEvent.ONMOUSEOUT;
if((o==DwtEvent.ONMOUSEOUT)&&s._ignoreInternalOverOut){
var e=DwtControl.getTargetControl(n,true);
if(s==e){
return false
}}
if(s.__hasToolTipContent()){
var a=DwtShell.getShell(window);
var t=a.getHoverMgr();
t.setHoverOutListener(s._hoverOutListener);
t.hoverOut();
s.__tooltipClosed=false
}
return DwtControl.__mouseEvent(n,o||DwtEvent.ONMOUSEOUT,s)
};
DwtControl.__mouseLeaveHdlr=function(e){
return DwtControl.__mouseOutHdlr(e,DwtEvent.ONMOUSELEAVE)
};
DwtControl.__mouseWheelHdlr=function(e){
var t=DwtControl.getTargetControl(e);
if(!t){
return false
}
return DwtControl.__mouseEvent(e,DwtEvent.ONMOUSEWHEEL,t)
};
DwtControl.__selectStartHdlr=function(e){
return DwtControl.__mouseEvent(e,DwtEvent.ONSELECTSTART)
};
DwtControl.__contextMenuHdlr=function(t){
if(AjxEnv.isSafari){
var a=DwtControl.getTargetControl(t);
var e=a?a.preventContextMenu():true;
if(e){
DwtControl.__mouseEvent(t,DwtEvent.ONMOUSEDOWN);
return DwtControl.__mouseEvent(t,DwtEvent.ONMOUSEUP)
}}
return DwtControl.__mouseEvent(t,DwtEvent.ONCONTEXTMENU)
};
DwtControl.__mouseEvent=function(o,t,n,a){
var n=n?n:DwtControl.getTargetControl(o);
if(!n){
return false
}
if(!a){
a=DwtShell.mouseEvent;
a.setFromDhtmlEvent(o,n)
}
var e=a.target.tagName.toLowerCase();
if(e!="input"&&e!="textarea"&&e!="a"){
a._stopPropagation=true;
a._returnValue=false
}else{
a._stopPropagation=false;
a._returnValue=true
}
DwtEventManager.notifyListeners(t,a);
if(n.isListenerRegistered&&n.isListenerRegistered(t)){
n.notifyListeners(t,a)
}
a.setToDhtmlEvent(o);
return a._returnValue
};
DwtControl.__HANDLER={};
DwtControl.__HANDLER[DwtEvent.ONCONTEXTMENU]=DwtControl.__contextMenuHdlr;
DwtControl.__HANDLER[DwtEvent.ONDBLCLICK]=DwtControl.__dblClickHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEDOWN]=DwtControl.__mouseDownHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSEENTER]=DwtControl.__mouseEnterHdlr;
DwtControl.__HANDLER[DwtEvent.ONMOUSELEAVE]=DwtControl.__mouseLeaveHdlr;
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;
this._htmlElId=this.__internalId=this._htmlElId||Dwt.getNextId();
var e=this._elRef=this._createElement(this._htmlElId);
e.id=this._htmlElId;
if(DwtControl.ALL_BY_ID){
if(DwtControl.ALL_BY_ID[this._htmlElId]){
this._htmlElId=e.id=this.__internalId=DwtId._makeId(this._htmlElId,Dwt.getNextId())
}
DwtControl.ALL_BY_ID[this._htmlElId]=this
}
DwtComposite._pendingElements[this._htmlElId]=e;
if(this.__posStyle==null||this.__posStyle==DwtControl.STATIC_STYLE){
e.style.position=DwtControl.STATIC_STYLE
}else{
e.style.position=this.__posStyle
}
e.className=this._className;
e.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._createElement=function(e){
return document.createElement("DIV")
};
DwtControl.prototype.__dndDoHover=function(e){
e._dragHover()
};
DwtControl.prototype.__badDropEffect=function(e,n,a){
var t=(Math.abs(e)<=1);
var o=t?this.__dragStartX-this.__dragEndX:this.__dragStartY-this.__dragEndY;
if(o*a>0&&!(this.__dragEndY==this.__dragStartY||this.__dragEndX==this.__dragStartX)){
if(t){
this.__dragEndX+=(30*a);
this._dndProxy.style.top=e*this.__dragEndX+n;
this._dndProxy.style.left=this.__dragEndX
}else{
this.__dragEndY+=(30*a);
this._dndProxy.style.top=this.__dragEndY;
this._dndProxy.style.left=(this.__dragEndY-n)/e
}
AjxTimedAction.scheduleAction(this.__badDropAction,0)
}else{
this._destroyDragProxy(this._dndProxy);
this._dragging=DwtControl._NO_DRAG
}};
DwtControl.prototype.__handleHoverOver=function(o){
if(this._eventMgr.isListenerRegistered(DwtEvent.HOVEROVER)){
this._eventMgr.notifyListeners(DwtEvent.HOVEROVER,o)
}
var a=o&&o.object;
var n=this.getToolTipContent(a);
var t,s;
if(!n){
t=""
}else{
if(typeof(n)=="string"){
t=n
}else{
if(n instanceof AjxCallback){
s=n
}else{
if(typeof(n)=="object"){
t=n.content;
s=n.callback
}}}}
if(!t&&s&&n.loading){
t=AjxMsg.loading
}
if(t){
this.__showToolTip(o,t)
}
if(s){
var e=new AjxCallback(this,this.__showToolTip,[o]);
AjxTimedAction.scheduleAction(new AjxTimedAction(null,function(){
s.run(e)
}
),0)
}};
DwtControl.prototype.__showToolTip=function(a,t){
if(!t){
return
}
var e=DwtShell.getShell(window);
var o=e.getToolTip();
o.setContent(t);
o.popup(a.x,a.y);
this.__lastTooltipX=a.x;
this.__lastTooltipY=a.y;
this.__tooltipClosed=false
};
DwtControl.prototype.__handleHoverOut=function(t){
if(this._eventMgr.isListenerRegistered(DwtEvent.HOVEROUT)){
this._eventMgr.notifyListeners(DwtEvent.HOVEROUT,t)
}
var e=DwtShell.getShell(window);
var a=e.getToolTip();
a.popdown();
this.__lastTooltipX=null;
this.__lastTooltipY=null
};
DwtControl.prototype.__isInputEl=function(a){
var o=false;
if(!a||!a.tagName){
return o
}
var e=a.tagName.toLowerCase();
var t=e=="input"?a.type.toLowerCase():null;
if(e=="textarea"||(t&&(t=="text"||t=="password"))){
o=true
}
return o
};
DwtControl.ON_UNLOAD=function(){
var t=DwtControl.ALL_BY_ID,e;
for(e in t){
t[e]._elRef=null
}
DwtControl.ALL_BY_ID=null
};
if(AjxEnv.isIE){
window.attachEvent("onunload",DwtControl.ON_UNLOAD)
}else{
window.addEventListener("unload",DwtControl.ON_UNLOAD,false)
}}
if(AjxPackage.define("ajax.dwt.widgets.DwtComposite")){
DwtComposite=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtComposite.PARAMS);
e.className=e.className||"DwtComposite";
DwtControl.call(this,e);
this._children=new AjxVector()
};
DwtComposite.PARAMS=DwtControl.PARAMS.concat();
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 e=this._children.getArray();
while(e.length>0){
e[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 e=this._children.getArray();
while(e.length>0){
e[0].dispose()
}};
DwtComposite.prototype.clear=function(){
this.removeChildren();
this.getHtmlElement().innerHTML=""
};
DwtComposite.prototype.addChild=function(a,e){
this._children.add(a,e);
var t=a.getHtmlElement();
t.setAttribute("parentId",this._htmlElId);
if(this instanceof DwtShell&&this.isVirtual()){
document.body.appendChild(t)
}else{
a.reparentHtmlElement(a.__parentElement||this.getHtmlElement(),e);
a.__parentElement=null
}};
DwtComposite.prototype.removeChild=function(a){
if(a.isInitialized()){
this._children.remove(a);
var t=a.getHtmlElement();
if(t){
t.removeAttribute("parentId");
if(t.parentNode){
var e=t.parentNode.removeChild(t)
}}}};
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(e){
return this._allowSelection?false:DwtControl.prototype.preventSelection.call(this,e)
};
DwtComposite.prototype.preventContextMenu=function(a){
if(!this._allowSelection){
return DwtControl.prototype.preventContextMenu.apply(this,arguments)
}
var e=a?(a.id.indexOf("OBJ_")==0):false;
var t=false;
if(document.selection){
t=document.selection.type=="Text"
}else{
if(getSelection()){
t=getSelection().toString().length>0
}}
return(t&&!e)?false:true
};
DwtComposite.prototype._focusByMouseUpEvent=function(){
if(!this._allowSelection){
DwtControl.prototype._focusByMouseUpEvent.apply(this,arguments)
}};
DwtComposite.prototype._mouseDownListener=function(e){
if(e.button==DwtMouseEvent.LEFT){
e._stopPropagation=true;
e._returnValue=true
}};
DwtComposite.prototype._contextMenuListener=function(e){
e._stopPropagation=false;
e._returnValue=true
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtShell")){
DwtShell=function(n){
if(window._dwtShellId){
throw new DwtException("DwtShell already exists for window",DwtException.INVALID_OP,"DwtShell")
}
var a=n.className||"DwtShell";
DwtComposite.call(this,{
className:a}
);
this.__ctrlInited=true;
document.body.style.margin=0;
if(!n.docBodyScrollable){
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 o=document.createElement("div");
this._htmlElId=window._dwtShellId=o.id=n.id||Dwt.getNextId();
DwtControl.ALL_BY_ID[this._htmlElId]=this;
o.className=a;
o.style.width=o.style.height="100%";
if(o.style.overflow){
o.style.overflow=null
}
try{
if(n.userShell){
document.body.removeChild(n.userShell)
}}
catch(t){}
document.body.appendChild(o);
if(n.userShell){
var e=new DwtControl({
parent:this,posStyle:Dwt.ABSOLUTE_STYLE}
);
e.getHtmlElement().appendChild(n.userShell);
e.setSize("100%","100%");
e.zShow(true)
}
this.shell=this;
this._createBusyOverlay(o);
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>";
o.appendChild(this._veilOverlay);
if(n.useCurtain){
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>";
o.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(this)
};
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._GLOBAL_SELECTION="GlobalSelection";
DwtShell.prototype.toString=function(){
return"DwtShell"
};
DwtShell.getShell=function(e){
return DwtControl.fromElementId(e._dwtShellId)
};
DwtShell.prototype.getKeyboardMgr=function(){
return this._keyboardMgr
};
DwtShell.prototype.setBusy=function(o,n,t,a,e){
if(o){
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=this._blockInput=true
}else{
if(this._setBusy&&(this._setBusyCount<=0)){
Dwt.setCursor(this._busyOverlay,"default");
Dwt.setVisible(this._busyOverlay,false);
this._setBusy=this._blockInput=false
}}
if(o&&t){
if(a&&a>0){
this._busyActionId[n]=AjxTimedAction.scheduleAction(this._busyTimedAction,a)
}else{
this._showBusyDialogAction(n)
}
this._cancelBusyCallback=e;
if(this._busyDialog){
this._busyDialog.setButtonEnabled(DwtShell.CANCEL_BUTTON,(e!=null))
}}else{
if(this._busyActionId[n]&&(this._busyActionId[n]!=-1)){
AjxTimedAction.cancelAction(this._busyActionId[n]);
this._busyActionId[n]=-1
}
if(this._busyDialog&&this._busyDialog.isPoppedUp){
this._busyDialog.popdown()
}}};
DwtShell.prototype.getBusy=function(){
return this._setBusy
};
DwtShell.prototype.setBusyDialogText=function(e){
this._busyDialogText=e;
if(this._busyDialogTxt){
this._busyDialogTxt.innerHTML=(e)?e:""
}};
DwtShell.prototype.setBusyDialogTitle=function(e){
this._busyDialogTitle=e;
if(this._busyDialog){
this._busyDialog.setTitle((e)?e:AjxMsg.workInProgress)
}};
DwtShell.prototype.getHoverMgr=function(){
return this._hoverMgr
};
DwtShell.prototype.getToolTip=function(){
return this._toolTip
};
DwtShell.prototype.getH=function(e){
return(!this._virtual)?Dwt.getSize(this.getHtmlElement(),e).y:Dwt.getSize(document.body,e).y
};
DwtShell.prototype.getW=function(e){
return(!this._virtual)?Dwt.getSize(this.getHtmlElement(),e).x:Dwt.getSize(document.body,e).x
};
DwtShell.prototype.getSize=function(e){
return(!this._virtual)?Dwt.getSize(this.getHtmlElement(),e):Dwt.getSize(document.body,e)
};
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(e){
return(!this._virtual)?Dwt.getBounds(this.getHtmlElement(),e):Dwt.getBounds(document.body,e)
};
DwtShell.prototype.setVirtual=function(){
this._virtual=true;
this.setVisible(false)
};
DwtShell.prototype.addFocusListener=function(e){
if(!this._hasFocusHandler){
var t=document;
if(typeof t.onfocusin!="undefined"){
t.attachEvent("onfocusin",DwtShell.__focusHdlr)
}else{
window.addEventListener("focus",DwtShell.__focusHdlr,false)
}
this._hasFocusHandler=true
}
this.addListener(DwtEvent.ONFOCUS,e)
};
DwtShell.prototype.addBlurListener=function(e){
if(!this._hasBlurHandler){
var t=document;
if(typeof t.onfocusout!="undefined"){
t.attachEvent("onfocusout",DwtShell.__blurHdlr)
}else{
window.addEventListener("blur",DwtShell.__blurHdlr,false)
}
this._hasBlurHandler=true
}
this.addListener(DwtEvent.ONBLUR,e)
};
DwtShell.prototype.addGlobalSelectionListener=function(e){
this.addListener(DwtShell._GLOBAL_SELECTION,e)
};
DwtShell.prototype.removeGlobalSelectionListener=function(e){
this.removeListener(DwtShell._GLOBAL_SELECTION,e)
};
DwtShell.prototype.notifyGlobalSelection=function(e){
this.notifyListeners(DwtShell._GLOBAL_SELECTION,e)
};
DwtShell.prototype.isVirtual=function(){
return this._virtual
};
DwtShell.prototype._showBusyDialogAction=function(t){
var e=this._getBusyDialog();
e.popup();
this._busyActionId[t]=-1
};
DwtShell.prototype._createBusyOverlay=function(e){
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>";
e.appendChild(this._busyOverlay);
Dwt.setVisible(this._busyOverlay,false);
this._busyTimedAction=new AjxTimedAction(this,this._showBusyDialogAction);
this._busyActionId={};
this._setBusyCount=0;
this._setBusy=false
};
DwtShell.prototype._getBusyDialog=function(a){
if(!this._busyDialog){
var o=new DwtDialog_ButtonDescriptor(DwtShell.CANCEL_BUTTON,AjxMsg.cancelRequest,DwtDialog.ALIGN_CENTER);
this._busyDialog=new DwtDialog({
parent:this,className:"DwtShellBusyDialog",title:AjxMsg.workInProgress,standardButtons:DwtDialog.NO_BUTTONS,extraButtons:[o],zIndex:Dwt.BUSY+10}
);
this._busyDialog.registerCallback(DwtShell.CANCEL_BUTTON,this._busyCancelButtonListener,this);
var t=Dwt.getNextId();
var e=["<table class='DialogContent'><tr>","<td><div class='WaitIcon'></div></td><td class='MsgText' id='",t,"'>&nbsp;</td>","</tr></table>"].join("");
this._busyDialog.setContent(e);
this._busyDialogTxt=document.getElementById(t);
if(this._busyDialogText){
this._busyDialogTxt.innerHTML=this._busyDialogText
}
if(this._busyDialogTitle){
this._busyDialog.setTitle(this._busyDialogTitle)
}
this._busyDialog.setButtonEnabled(DwtShell.CANCEL_BUTTON,(this._cancelBusyCallback!=null))
}
return this._busyDialog
};
DwtShell.prototype._busyCancelButtonListener=function(e){
this._cancelBusyCallback.run();
if(this._busyDialog){
this._busyDialog.popdown()
}};
DwtShell._preventDefaultSelectPrt=function(t){
var e=DwtControl.fromElementId(window._dwtShellId)._uiEvent;
e.setFromDhtmlEvent(t,true);
if(e.dwtObj&&e.dwtObj instanceof DwtControl&&!e.dwtObj.preventSelection(e.target)){
e._stopPropagation=false;
e._returnValue=true
}else{
e._stopPropagation=true;
e._returnValue=false
}
e.setToDhtmlEvent(t);
return !e._stopPropagation
};
DwtShell._preventDefaultPrt=function(t){
t=DwtUiEvent.getEvent(t);
var a=t.target?t.target:t.srcElement;
var e=DwtControl.fromElementId(window._dwtShellId)._uiEvent;
e.setFromDhtmlEvent(t,true);
e._stopPropagation=true;
e._returnValue=false;
if(e.dwtObj&&e.dwtObj instanceof DwtControl&&!e.dwtObj.preventContextMenu(e.target)){
e._stopPropagation=false;
e._returnValue=true
}else{
if(a!=null&&typeof(a)=="object"){
if((a.tagName=="A"||a.tagName=="a")&&a.href){
e._stopPropagation=false;
e._returnValue=true
}}}
e.setToDhtmlEvent(t);
return e._returnValue
};
DwtShell._resizeHdlr=function(a){
var t=DwtControl.fromElementId(window._dwtShellId);
if(t.isListenerRegistered(DwtEvent.CONTROL)){
var e=DwtShell.controlEvent;
e.reset();
e.oldWidth=t._currWinSize.x;
e.oldHeight=t._currWinSize.y;
t._currWinSize=Dwt.getWindowSize();
e.newWidth=t._currWinSize.x;
e.newHeight=t._currWinSize.y;
t.notifyListeners(DwtEvent.CONTROL,e)
}else{
t._currWinSize=Dwt.getWindowSize()
}};
DwtShell.__onBodyScroll=function(){
document.body.scrollTop=0;
document.body.scrollLeft=0
};
DwtShell.__focusHdlr=function(){
var t=DwtShell.focusEvent;
var e=DwtShell.getShell(window);
t.dwtObj=e;
t.state=DwtFocusEvent.FOCUS;
e.notifyListeners(DwtEvent.ONFOCUS,t)
};
DwtShell.__blurHdlr=function(){
var t=DwtShell.focusEvent;
var e=DwtShell.getShell(window);
t.dwtObj=e;
t.state=DwtFocusEvent.BLUR;
e.notifyListeners(DwtEvent.ONBLUR,t)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtColorPicker")){
DwtColorPicker=function(a,t,e,o,n){
if(arguments.length==0){
return
}
t=t||"DwtColorPicker";
DwtControl.call(this,{
parent:a,className:t,posStyle:e}
);
this._noFillLabel=o;
this._allowColorInput=n;
this._createColorTable();
this._registerEventHdlrs()
};
DwtColorPicker.prototype=new DwtControl;
DwtColorPicker.prototype.constructor=DwtColorPicker;
DwtColorPicker._RGB_RE=/rgb\(([0-9]{1,3}), ([0-9]{1,3}), ([0-9]{1,3})\)/;
DwtColorPicker._HEX_RE=/\#([0-9FCfc]{2})([0-9FCfc]{2})([0-9FCfc]{2})/;
DwtColorPicker._HEX_COMPLETE_RE=/\#([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})/;
DwtColorPicker.prototype.toString=function(){
return"DwtColorPicker"
};
DwtColorPicker.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtColorPicker.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtColorPicker.prototype.dispose=function(){
if(this._disposed){
return
}
DwtControl.prototype.dispose.call(this)
};
DwtColorPicker.prototype._registerEventHdlrs=function(){
var s=this.getHtmlElement().firstChild;
var r=s.rows;
var h=r.length;
for(var o=0;
o<h;
o++){
var a=r[o].cells;
var n=a.length;
for(var t=0;
t<n;
t++){
var e=a[t];
if(r[o].className=="ColorInput"){
if(e.className=="ColorInputField"){}else{
if(e.className=="SetInputColor"){
Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr)
}}}else{
Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr);
if(!AjxEnv.isIE){
Dwt.setHandler(e,DwtEvent.ONMOUSEOVER,DwtColorPicker._mouseOverHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEOUT,DwtColorPicker._mouseOutHdlr)
}else{
Dwt.setHandler(e,DwtEvent.ONMOUSEENTER,DwtColorPicker._mouseOverHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSELEAVE,DwtColorPicker._mouseOutHdlr)
}
if(e.className!="NoFill"){
e.style.border="2px outset "+e.style.backgroundColor
}}}}};
DwtColorPicker.prototype._createColorTable=function(){
this._tdId=Dwt.getNextId();
var t=new Array(150);
var e=0;
t[e++]="<table cellpadding='0' cellspacing='0' border='0' align='center'>";
if(this._noFillLabel){
t[e++]="<tr><td colspan='10' class='NoFill'>"+this._noFillLabel+"</td></tr>"
}
t[e++]="<tr>";
t[e++]="<td id='"+this._tdId+"#FFFFFF' style='background-color:#FFFFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCCCC' style='background-color:#FFCCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC99' style='background-color:#FFCC99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF99' style='background-color:#FFFF99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFFCC' style='background-color:#FFFFCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#99FF99' style='background-color:#99FF99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#99FFFF' style='background-color:#99FFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CCFFFF' style='background-color:#CCFFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CCCCFF' style='background-color:#CCCCFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCCFF' style='background-color:#FFCCFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#CCCCCC' style='background-color:#CCCCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF6666' style='background-color:#FF6666' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF9966' style='background-color:#FF9966' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF66' style='background-color:#FFFF66' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF33' style='background-color:#FFFF33' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#66FF99' style='background-color:#66FF99' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33FFFF' style='background-color:#33FFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#66FFFF' style='background-color:#66FFFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#9999FF' style='background-color:#9999FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF99FF' style='background-color:#FF99FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#C0C0C0' style='background-color:#C0C0C0' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF0000' style='background-color:#FF0000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF9900' style='background-color:#FF9900' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC66' style='background-color:#FFCC66' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFFF00' style='background-color:#FFFF00' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33FF33' style='background-color:#33FF33' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#66CCCC' style='background-color:#66CCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33CCFF' style='background-color:#33CCFF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#6666CC' style='background-color:#6666CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC66CC' style='background-color:#CC66CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#999999' style='background-color:#999999' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC0000' style='background-color:#CC0000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FF6600' style='background-color:#FF6600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC33' style='background-color:#FFCC33' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#FFCC00' style='background-color:#FFCC00' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#33CC00' style='background-color:#33CC00' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#00CCCC' style='background-color:#00CCCC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#3366FF' style='background-color:#3366FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#6633FF' style='background-color:#6633FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC33CC' style='background-color:#CC33CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#666666' style='background-color:#666666' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#990000' style='background-color:#990000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC6600' style='background-color:#CC6600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#CC9933' style='background-color:#CC9933' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#999900' style='background-color:#999900' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#009900' style='background-color:#009900' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#339999' style='background-color:#339999' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#3333FF' style='background-color:#3333FF' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#6600CC' style='background-color:#6600CC' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#993399' style='background-color:#993399' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#333333' style='background-color:#333333' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#660000' style='background-color:#660000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#993300' style='background-color:#993300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#996633' style='background-color:#996633' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#666600' style='background-color:#666600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#006600' style='background-color:#006600' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#336666' style='background-color:#336666' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#000099' style='background-color:#000099' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#333399' style='background-color:#333399' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#663366' style='background-color:#663366' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="</tr><tr>";
t[e++]="<td id='"+this._tdId+"#000000' style='background-color:#000000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#330000' style='background-color:#330000' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#663300' style='background-color:#663300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#663333' style='background-color:#663333' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#333300' style='background-color:#333300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#003300' style='background-color:#003300' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#003333' style='background-color:#003333' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#000066' style='background-color:#000066' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#330099' style='background-color:#330099' width='12' height='14'><img height='1' width='1'/></td>";
t[e++]="<td id='"+this._tdId+"#330033' style='background-color:#330033' width='12' height='14'><img height='1' width='1'/></td>";
if(this._allowColorInput){
t[e++]="<tr><td></td></tr></tr><tr class='ColorInput'>";
t[e++]="<td colspan=6 id='"+this._tdId+".ColorInputField' class='ColorInputField'><input type=text size=15 maxlength=6 ></input></td><td colspan=4 id='"+this._tdId+".SetInputColor' class='SetInputColor'>"+AjxMsg.setColor+"</td>"
}
t[e++]="</tr></table>";
this.getHtmlElement().innerHTML=t.join("")
};
DwtColorPicker._mouseOverHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
var o=t.target;
if(o.nodeName.toLowerCase()=="img"){
o=o.parentNode
}
if(t.dwtObj._downTdId==o.id){
var e=o.style.backgroundColor;
o.style.backgroundColor=t.dwtObj._swappedColor;
t.dwtObj._swappedColor=e;
o.style.borderStyle="inset";
o.style.borderColor=e
}
this._stopPropagation=true;
this._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtColorPicker._mouseOutHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
var o=t.target;
if(o.nodeName.toLowerCase()=="img"){
o=o.parentNode
}
if(t.dwtObj._downTdId==o.id){
var e=o.style.backgroundColor;
o.style.backgroundColor=t.dwtObj._swappedColor;
t.dwtObj._swappedColor=e;
o.style.borderStyle="outset";
o.style.borderColor=e;
t.dwtObj._downTdId=null
}
this._stopPropagation=true;
this._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtColorPicker._mouseDownHdlr=function(h){
var s=DwtShell.mouseEvent;
s.setFromDhtmlEvent(h,true);
var c=s.target;
if(c.nodeName.toLowerCase()=="img"){
c=c.parentNode
}
var a=s.target.style.backgroundColor;
var t;
var n,o,e;
s.dwtObj._downTdId=c.id;
s.dwtObj._swappedColor=a;
c.style.borderStyle="inset";
if((c.className!="NoFill")&&(c.className!="SetInputColor")){
if(a.substr(0,1)=="#"){
t=a.match(DwtColorPicker._HEX_RE);
t[1]=DwtColorPicker._hexConv(t[1]);
t[2]=DwtColorPicker._hexConv(t[2]);
t[3]=DwtColorPicker._hexConv(t[3])
}else{
t=a.match(DwtColorPicker._RGB_RE)
}
n=Math.max(Math.floor(t[1]-(t[1]*0.25)),0);
o=Math.max(Math.floor(t[2]-(t[2]*0.25)),0);
e=Math.max(Math.floor(t[3]-(t[3]*0.25)),0);
a="rgb("+n+","+o+","+e+")";
c.style.backgroundColor=a
}
s._stopPropagation=true;
s._returnValue=false;
s.setToDhtmlEvent(h);
return false
};
DwtColorPicker._hexConv=function(e){
if(e=="00"){
return 0
}else{
if(e=="33"){
return 51
}else{
if(e=="66"){
return 102
}else{
if(e=="99"){
return 153
}else{
if(e.toUpperCase()=="CC"){
return 204
}else{
if(e.toUpperCase()=="FF"){
return 255
}else{
if(e.toUpperCase()=="C0"){
return 192
}}}}}}}};
DwtColorPicker._mouseUpHdlr=function(a){
var t=DwtShell.mouseEvent;
t.setFromDhtmlEvent(a,true);
var e=t.dwtObj;
var n=t.target;
if(n.nodeName.toLowerCase()=="img"){
n=n.parentNode
}
if(e._downTdId==n.id){
n.style.borderStyle="outset";
n.style.borderColor=t.dwtObj._swappedColor;
n.style.backgroundColor=t.dwtObj._swappedColor
}
if(e._downTdId==n.id){
if(e.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
if(e.isListenerRegistered(DwtEvent.SELECTION)){
var o=DwtShell.selectionEvent;
DwtUiEvent.copy(o,t);
o.item=e;
if(n.id==(e._tdId+".SetInputColor")){
o.detail=e.getInputColor()
}else{
o.detail=t.target.id.substr(t.target.id.indexOf("#"))
}
e.notifyListeners(DwtEvent.SELECTION,o)
}}
e._downTdId=null;
t._stopPropagation=true;
t._returnValue=false;
t.setToDhtmlEvent(a);
return false
};
DwtColorPicker.prototype.getInputColor=function(){
var e=document.getElementById(this._tdId+".ColorInputField").firstChild;
var t="#"+e.value;
if(t.match(DwtColorPicker._HEX_COMPLETE_RE)!=null){
return t
}else{
return""
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtBaseDialog")){
DwtBaseDialog=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtBaseDialog.PARAMS);
var e=t.parent;
if(!(e instanceof DwtShell)){
throw new DwtException("DwtBaseDialog parent must be a DwtShell",DwtException.INVALIDPARENT,"DwtDialog")
}
t.className=t.className||"DwtBaseDialog";
t.posStyle=DwtControl.ABSOLUTE_STYLE;
this._title=t.title||"";
DwtComposite.call(this,t);
this._shell=e;
this._zIndex=t.zIndex||Dwt.Z_DIALOG;
this._mode=t.mode||DwtBaseDialog.MODAL;
this._loc=new DwtPoint();
if(t.loc){
this._loc.x=t.loc.x;
this._loc.y=t.loc.y
}else{
this._loc.x=this._loc.y=Dwt.LOC_NOWHERE
}
this._tabGroup=new DwtTabGroup(this.toString(),true);
this._dragHandleId=t.dragHandleId||this._htmlElId+"_handle";
this._createHtml();
this._initializeDragging(this._dragHandleId);
if(t.view){
this.setView(t.view)
}
this.setZIndex(Dwt.Z_HIDDEN);
this._position(DwtBaseDialog.__nowhereLoc)
};
DwtBaseDialog.PARAMS=["parent","className","title","zIndex","mode","loc","view","dragHandleId"];
DwtBaseDialog.prototype=new DwtComposite;
DwtBaseDialog.prototype.constructor=DwtBaseDialog;
DwtBaseDialog.prototype.toString=function(){
return"DwtBaseDialog"
};
DwtBaseDialog.MODELESS=1;
DwtBaseDialog.MODAL=2;
DwtBaseDialog.__nowhereLoc=new DwtPoint(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
DwtBaseDialog.prototype.TEMPLATE="dwt.Widgets#DwtBaseDialog";
DwtBaseDialog.prototype.CONTROLS_TEMPLATE=null;
DwtBaseDialog.prototype.addPopupListener=function(e){
this.addListener(DwtEvent.POPUP,e)
};
DwtBaseDialog.prototype.removePopupListener=function(e){
this.removeListener(DwtEvent.POPUP,e)
};
DwtBaseDialog.prototype.addPopdownListener=function(e){
this.addListener(DwtEvent.POPDOWN,e)
};
DwtBaseDialog.prototype.removePopdownListener=function(e){
this.removeListener(DwtEvent.POPDOWN,e)
};
DwtBaseDialog.prototype.popup=function(t){
if(this._poppedUp){
return
}
this.cleanup(true);
var e=this._zIndex;
if(this._mode==DwtBaseDialog.MODAL){
e=this._setModalEffect(e)
}
this._shell._veilOverlay.activeDialogs.push(this);
if(t){
this._loc.x=t.x;
this._loc.y=t.y
}
this._position(t);
this._resetTabFocus();
this.setZIndex(e);
this._poppedUp=true;
var a=this._shell.getKeyboardMgr();
a.pushTabGroup(this._tabGroup);
a.pushDefaultHandler(this);
this.notifyListeners(DwtEvent.POPUP,this)
};
DwtBaseDialog.prototype._resetTabFocus=function(){
this._tabGroup.resetFocusMember(true)
};
DwtBaseDialog.prototype.focus=function(){
if(this.isListenerRegistered(DwtEvent.ONFOCUS)){
this.notifyListeners(DwtEvent.ONFOCUS)
}else{
if(this._focusElementId){
var e=document.getElementById(this._focusElementId);
if(e){
e.focus()
}}}};
DwtBaseDialog.prototype.isPoppedUp=function(){
return this._poppedUp
};
DwtBaseDialog.prototype.popdown=function(){
if(this._poppedUp){
this._poppedUp=false;
this.cleanup(false);
var e=this._zIndex;
this.setZIndex(Dwt.Z_HIDDEN);
this._position(DwtBaseDialog.__nowhereLoc);
if(this._mode==DwtBaseDialog.MODAL){
this._undoModality(e)
}else{
this._shell._veilOverlay.activeDialogs.pop()
}
var t=this._shell.getKeyboardMgr();
t.popTabGroup(this._tabGroup);
t.popDefaultHandler();
this.notifyListeners(DwtEvent.POPDOWN,this)
}};
DwtBaseDialog.prototype.setView=function(e){
this.reset();
if(e){
this._getContentDiv().appendChild(e.getHtmlElement())
}};
DwtBaseDialog.prototype.reset=function(){
this._loc.x=this._loc.y=Dwt.LOC_NOWHERE
};
DwtBaseDialog.prototype.cleanup=function(t){
var o=this._getInputFields();
if(o){
var e=o.length;
for(var a=0;
a<e;
a++){
o[a].disabled=!t;
if(t){
o[a].value=""
}}}};
DwtBaseDialog.prototype.setTitle=function(e){
if(this._titleEl){
this._titleEl.innerHTML=e||""
}};
DwtBaseDialog.prototype.setContent=function(t){
var e=this._getContentDiv();
if(e){
e.innerHTML=t||""
}};
DwtBaseDialog.prototype._getContentDiv=function(){
return this._contentEl
};
DwtBaseDialog.prototype.addEnterListener=function(e){
this.addListener(DwtEvent.ENTER,e)
};
DwtBaseDialog.getActiveDialog=function(){
var t=null;
var a=DwtShell.getShell(window);
if(a){
var e=a._veilOverlay.activeDialogs.length;
if(e>0){
t=a._veilOverlay.activeDialogs[e-1]
}}
return t
};
DwtBaseDialog.prototype._initializeDragging=function(h){
var r=document.getElementById(h);
if(r){
var s=DwtControl.fromElementId(window._dwtShellId);
if(s){
var e=Dwt.getSize(s.getHtmlElement());
var a=document.getElementById(this._htmlElId);
var c=this.getSize();
var n=new AjxCallback(this,this._dragEnd);
var o=new AjxCallback(this,this._duringDrag);
var t=new AjxCallback(this,this._dragStart);
DwtDraggable.init(r,a,0,document.body.offsetWidth-10,0,document.body.offsetHeight-10,t,o,n)
}}};
DwtBaseDialog.prototype._getContentHtml=function(){
return""
};
DwtBaseDialog.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtBaseDialog.prototype._createHtmlFromTemplate=function(e,t){
t.dragId=this._dragHandleId;
t.title=this._title;
t.icon="";
t.closeIcon1="";
t.closeIcon2="";
t.controlsTemplateId=this.CONTROLS_TEMPLATE;
DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
this._titleBarEl=document.getElementById(t.id+"_titlebar");
this._titleEl=document.getElementById(t.id+"_title");
this._contentEl=document.getElementById(t.id+"_content");
this.setContent(this._getContentHtml())
};
DwtBaseDialog.prototype._setModalEffect=function(){
var a=this._shell._veilOverlay.dialogZ;
var o=null;
var t,e;
if(a.length){
o=a[a.length-1]
}
if(o){
t=o+2;
e=o+1
}else{
t=this._zIndex;
e=Dwt.Z_VEIL
}
this._shell._veilOverlay.veilZ.push(e);
this._shell._veilOverlay.dialogZ.push(t);
Dwt.setZIndex(this._shell._veilOverlay,e);
return t
};
DwtBaseDialog.prototype._undoModality=function(a){
var e=this._shell._veilOverlay.veilZ;
e.pop();
var t=e[e.length-1];
Dwt.setZIndex(this._shell._veilOverlay,t);
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._getInputFields=function(){};
DwtBaseDialog.prototype._dragStart=function(e,t){
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(e,t){
this._loc.x=e;
this._loc.y=t
};
DwtBaseDialog.prototype._duringDrag=function(e,t){};
DwtBaseDialog.prototype._doesContainElement=function(e){
return Dwt.contains(this.getHtmlElement(),e)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtDialog")){
DwtDialog=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtDialog.PARAMS);
t.className=t.className||"DwtDialog";
this._title=t.title=t.title||"";
var a=t.standardButtons;
var c=t.extraButtons;
if(!a){
a=[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON]
}else{
if(a==DwtDialog.NO_BUTTONS){
a=null
}else{
if(a&&!a.length){
a=[a]
}}}
this._buttonList=[];
var u={};
u[DwtDialog.ALIGN_LEFT]=[];
u[DwtDialog.ALIGN_CENTER]=[];
u[DwtDialog.ALIGN_RIGHT]=[];
if(a||c){
this._buttonDesc={};
if(a&&a.length){
this._initialEnterButtonId=this._enterButtonId=a[0];
for(var o=0;
o<a.length;
o++){
var h=a[o];
this._buttonList.push(h);
var r=DwtDialog.ALIGN[h];
if(r){
u[r].push(h)
}
this._buttonDesc[h]=new DwtDialog_ButtonDescriptor(h,AjxMsg[DwtDialog.MSG_KEY[h]],r)
}
this._resetCallbacks()
}
if(c&&c.length){
if(!this._enterButtonId){
this._initialEnterButtonId=this._enterButtonId=c[0]
}
for(var o=0;
o<c.length;
o++){
var h=c[o].id;
this._buttonList.push(h);
var r=c[o].align;
if(r){
u[r].push(h)
}
this._buttonDesc[h]=c[o]
}}}
this._buttonElementId={};
for(var o=0;
o<this._buttonList.length;
o++){
this._buttonElementId[this._buttonList[o]]=Dwt.getNextId()
}
DwtBaseDialog.call(this,t);
this._button={};
for(var o=0;
o<this._buttonList.length;
o++){
var h=this._buttonList[o];
var d=this._button[h]=new DwtButton({
parent:this}
);
d.setText(this._buttonDesc[h].label);
d.buttonId=h;
d.addSelectionListener(new AjxListener(this,this._buttonListener));
var e=document.getElementById(this._buttonElementId[h]);
if(e){
e.appendChild(d.getHtmlElement())
}}
var s=u[DwtDialog.ALIGN_LEFT].concat(u[DwtDialog.ALIGN_CENTER],u[DwtDialog.ALIGN_RIGHT]);
for(var o=0;
o<s.length;
o++){
var n=this._button[s[o]];
this._tabGroup.addMember(n)
}};
DwtDialog.PARAMS=["parent","className","title","standardButtons","extraButtons","zIndex","mode","loc"];
DwtDialog.prototype=new DwtBaseDialog;
DwtDialog.prototype.constructor=DwtDialog;
DwtDialog.prototype.toString=function(){
return"DwtDialog"
};
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={};
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={};
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.CONTROLS_TEMPLATE="dwt.Widgets#DwtDialogControls";
DwtDialog.prototype.popdown=function(){
DwtBaseDialog.prototype.popdown.call(this);
this.resetButtonStates()
};
DwtDialog.prototype.popup=function(e,t){
this._focusButtonId=t;
DwtBaseDialog.prototype.popup.call(this,e)
};
DwtDialog.prototype._resetTabFocus=function(){
if(this._focusButtonId){
var e=this.getButton(this._focusButtonId);
this._tabGroup.setFocusMember(e,true)
}else{
DwtBaseDialog.prototype._resetTabFocus.call(this)
}};
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].setHovered(false)
}
this.associateEnterWithButton(this._initialEnterButtonId)
};
DwtDialog.prototype.getButton=function(e){
return this._button[e]
};
DwtDialog.prototype.setButtonEnabled=function(t,e){
this._button[t].setEnabled(e)
};
DwtDialog.prototype.setButtonVisible=function(e,t){
this._button[e].setVisible(t)
};
DwtDialog.prototype.getButtonEnabled=function(e){
return this._button[e].getEnabled()
};
DwtDialog.prototype.registerCallback=function(t,a,o,e){
this._buttonDesc[t].callback=(a instanceof AjxCallback)?a:(new AjxCallback(o,a,e))
};
DwtDialog.prototype.unregisterCallback=function(e){
this._buttonDesc[e].callback=null
};
DwtDialog.prototype.setButtonListener=function(e,t){
this._button[e].removeSelectionListeners();
this._button[e].addSelectionListener(t)
};
DwtDialog.prototype.setEnterListener=function(e){
this.removeAllListeners(DwtEvent.ENTER);
this.addEnterListener(e)
};
DwtDialog.prototype.associateEnterWithButton=function(e){
this._enterButtonId=e
};
DwtDialog.prototype.getKeyMapName=function(){
return"DwtDialog"
};
DwtDialog.prototype.handleKeyAction=function(e,t){
switch(e){
case DwtKeyMap.ENTER:this.notifyListeners(DwtEvent.ENTER,t);
break;
case DwtKeyMap.CANCEL:var a=false;
a=a||this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
a=a||this._runCallbackForButtonId(DwtDialog.NO_BUTTON);
a=a||this._runCallbackForButtonId(DwtDialog.DISMISS_BUTTON);
this.popdown();
return true;
case DwtKeyMap.YES:if(this._buttonDesc[DwtDialog.YES_BUTTON]){
this._runCallbackForButtonId(DwtDialog.YES_BUTTON)
}
break;
case DwtKeyMap.NO:if(this._buttonDesc[DwtDialog.NO_BUTTON]){
this._runCallbackForButtonId(DwtDialog.NO_BUTTON)
}
break;
default:return false
}
return true
};
DwtDialog.prototype._createHtmlFromTemplate=function(a,n){
DwtBaseDialog.prototype._createHtmlFromTemplate.call(this,a,n);
var o=n.id+"_focus";
if(document.getElementById(o)){
this._focusElementId=o
}
this._buttonsEl=document.getElementById(n.id+"_buttons");
if(this._buttonsEl){
var t=[];
var e=0;
this._addButtonsHtml(t,e);
this._buttonsEl.innerHTML=t.join("")
}};
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(s,t){
if(this._buttonList&&this._buttonList.length){
var a=new Array();
var e=new Array();
var n=new Array();
for(var o=0;
o<this._buttonList.length;
o++){
var r=this._buttonList[o];
switch(this._buttonDesc[r].align){
case DwtDialog.ALIGN_RIGHT:e.push(r);
break;
case DwtDialog.ALIGN_LEFT:a.push(r);
break;
case DwtDialog.ALIGN_CENTER:n.push(r);
break
}}
s[t++]=this._getButtonsContainerStartTemplate();
if(a.length){
s[t++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["left"]);
for(var o=0;
o<a.length;
o++){
var r=a[o];
var h=this._buttonDesc[r].cellTemplate?this._buttonDesc[r].cellTemplate:this._getButtonsCellTemplate();
s[t++]=AjxMessageFormat.format(h,[this._buttonElementId[r]])
}
s[t++]=this._getButtonsAlignEndTemplate()
}
if(n.length){
s[t++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["center"]);
for(var o=0;
o<n.length;
o++){
var r=n[o];
var h=this._buttonDesc[r].cellTemplate?this._buttonDesc[r].cellTemplate:this._getButtonsCellTemplate();
s[t++]=AjxMessageFormat.format(h,[this._buttonElementId[r]])
}
s[t++]=this._getButtonsAlignEndTemplate()
}
if(e.length){
s[t++]=AjxMessageFormat.format(this._getButtonsAlignStartTemplate(),["right"]);
for(var o=0;
o<e.length;
o++){
var r=e[o];
var h=this._buttonDesc[r].cellTemplate?this._buttonDesc[r].cellTemplate:this._getButtonsCellTemplate();
s[t++]=AjxMessageFormat.format(h,[this._buttonElementId[r]])
}
s[t++]=this._getButtonsAlignEndTemplate()
}
s[t++]=this._getButtonsContainerEndTemplate()
}
return t
};
DwtDialog.prototype._buttonListener=function(a,e){
var o=DwtControl.getTargetControl(a);
var t=(o&&o.buttonId)||this._enterButtonId;
if(t){
this._runCallbackForButtonId(t,e)
}};
DwtDialog.prototype._runCallbackForButtonId=function(o,e){
var t=this._buttonDesc[o];
var a=t&&t.callback;
if(!a){
return false
}
e=(e instanceof Array)?e:[e];
a.run.apply(a,e);
return true
};
DwtDialog.prototype._runEnterCallback=function(e){
if(this._enterButtonId&&this.getButtonEnabled(this._enterButtonId)){
this._runCallbackForButtonId(this._enterButtonId,e)
}};
DwtDialog.prototype._resetCallbacks=function(){
if(this._buttonDesc){
for(var e=0;
e<DwtDialog.ALL_BUTTONS.length;
e++){
var t=DwtDialog.ALL_BUTTONS[e];
if(this._buttonDesc[t]){
this._buttonDesc[t].callback=new AjxCallback(this,this.popdown)
}}}};
DwtDialog_ButtonDescriptor=function(n,e,o,a,t){
this.id=n;
this.label=e;
this.align=o;
this.callback=a;
this.cellTemplate=t
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtLabel")){
DwtLabel=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtLabel.PARAMS);
e.className=e.className||"DwtLabel";
DwtControl.call(this,e);
this._style=e.style||(DwtLabel.IMAGE_LEFT|DwtLabel.ALIGN_CENTER);
this._textBackground=null;
this._textForeground=null;
this._createHtml()
};
DwtLabel.PARAMS=["parent","style","className","posStyle","id","index"];
DwtLabel.prototype=new DwtControl;
DwtLabel.prototype.constructor=DwtLabel;
DwtLabel.prototype.toString=function(){
return"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.TEMPLATE="dwt.Widgets#ZLabel";
DwtLabel.prototype.dispose=function(){
delete this._dropDownEl;
delete this._iconEl;
delete this._textEl;
DwtControl.prototype.dispose.call(this)
};
DwtLabel.prototype.setEnabled=function(e){
if(e!=this._enabled){
DwtControl.prototype.setEnabled.call(this,e);
this.__setImage(this.__imageInfo)
}};
DwtLabel.prototype.getImage=function(){
return this.__imageInfo
};
DwtLabel.prototype.setImage=function(e){
this.__imageInfo=e;
this.__setImage(e)
};
DwtLabel.prototype.setDisabledImage=function(e){};
DwtLabel.prototype.getText=function(){
return(this.__text!=null)?this.__text:null
};
DwtLabel.prototype.setText=function(e){
if(!this._textEl){
return
}
if(e==null||e==""){
this.__text=null;
this._textEl.innerHTML=""
}else{
this.__text=e;
this._textEl.innerHTML=e
}};
DwtLabel.prototype.setTextBackground=function(e){
this._textBackground=e;
if(this._textEl){
this._textEl.style.backgroundColor=e
}};
DwtLabel.prototype.setTextForeground=function(e){
this._textForeground=e;
if(this._textEl){
this._textEl.style.color=e
}};
DwtLabel.prototype.setAlign=function(e){
this._style=e;
this.__setImage(this.__imageInfo)
};
DwtLabel.prototype.isStyle=function(e){
return this._style&e
};
DwtLabel.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtLabel.prototype._createHtmlFromTemplate=function(e,t){
DwtControl.prototype._createHtmlFromTemplate.call(this,e,t);
this._textEl=document.getElementById(t.id+"_title")
};
DwtLabel.prototype._getIconEl=function(){
var e=(this._style&DwtLabel.IMAGE_RIGHT?"right":"left");
return this._iconEl||(this._iconEl=document.getElementById(this._htmlElId+"_"+e+"_icon"))
};
DwtLabel.prototype.__setImage=function(t){
var e=this._getIconEl();
if(e){
if(t){
AjxImg.setImage(e,t,null,!this._enabled);
var a=(this._style&DwtLabel.IMAGE_RIGHT?"ZHasRightIcon":"ZHasLeftIcon");
Dwt.addClass(this.getHtmlElement(),a)
}else{
e.innerHTML=""
}}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtCheckbox")){
DwtCheckbox=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtCheckbox.PARAMS);
e.className=e.className||"DwtCheckbox";
DwtControl.call(this,e);
this._textPosition=DwtCheckbox.DEFAULT_POSITION;
this._initName=e.name;
this._initValue=e.value;
this._initChecked=e.checked;
this._createHtml()
};
DwtCheckbox.prototype=new DwtControl;
DwtCheckbox.prototype.constructor=DwtCheckbox;
DwtCheckbox.prototype.toString=function(){
return"DwtCheckbox"
};
DwtCheckbox.PARAMS=["parent","style","name","checked","className","posStyle","id","index","value"];
DwtCheckbox.TEXT_LEFT="left";
DwtCheckbox.TEXT_RIGHT="right";
DwtCheckbox.DEFAULT_POSITION=DwtCheckbox.TEXT_RIGHT;
DwtCheckbox.prototype.TEMPLATE="dwt.Widgets#DwtCheckbox";
DwtCheckbox.prototype.getTabGroupMember=function(){
return this._inputEl
};
DwtCheckbox.prototype.focus=function(){
if(this._inputEl){
this._inputEl.focus();
DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
}};
DwtCheckbox.prototype.blur=function(){
if(this._inputEl){
this._inputEl.blur()
}};
DwtCheckbox.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtCheckbox.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtCheckbox.prototype.setEnabled=function(e){
if(e!=this._enabled){
DwtControl.prototype.setEnabled.call(this,e);
this._inputEl.disabled=!e;
var t=e?"Text":"DisabledText";
if(this._textElLeft){
this._textElLeft.className=t
}
if(this._textElRight){
this._textElRight.className=t
}}};
DwtCheckbox.prototype.setSelected=function(e){
if(this._inputEl&&this._inputEl.checked!=e){
this._inputEl.checked=e
}};
DwtCheckbox.prototype.isSelected=function(){
return this._inputEl&&this._inputEl.checked
};
DwtCheckbox.prototype.setText=function(e){
if(this._textEl&&this._text!=e){
this._text=e;
this._textEl.innerHTML=e||""
}};
DwtCheckbox.prototype.getText=function(){
return this._text
};
DwtCheckbox.prototype.setTextPosition=function(e){
this._textEl=e==DwtCheckbox.TEXT_LEFT?this._textElLeft:this._textElRight;
if(this._textPosition!=e){
this._textPosition=e;
if(this._textElLeft){
this._textElLeft.innerHTML=""
}
if(this._textElRight){
this._textElRight.innerHTML=""
}
this.setText(this._text)
}};
DwtCheckbox.prototype.getTextPosition=function(){
return this._textPosition
};
DwtCheckbox.prototype.setValue=function(t){
var e=this._inputEl||this;
if(e.value!=t){
e.value=t
}};
DwtCheckbox.prototype.getValue=function(){
var e=this._inputEl||this;
return e.value!=null?e.value:this.getText()
};
DwtCheckbox.prototype.getInputElement=function(){
return this._inputEl
};
DwtCheckbox.prototype._replaceElementHook=function(t,a,e,o){
a=this.getInputElement();
DwtControl.prototype._replaceElementHook.call(this,t,a,e,o);
if(t.id){
this.setHtmlElementId(t.id+"_control");
a.id=t.id;
if(this._textEl){
this._textEl.setAttribute("for",t.id)
}}};
DwtCheckbox.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtCheckbox.prototype._createHtmlFromTemplate=function(t,a){
a.name=this._initName||this._htmlElId;
a.value=this._initValue;
a.checked=Boolean(this._initChecked)?"checked":"";
DwtControl.prototype._createHtmlFromTemplate.call(this,t,a);
this._inputEl=document.getElementById(a.id+"_input");
if(this._inputEl){
var e=DwtShell.getShell(window).getKeyboardMgr();
var o=AjxCallback.simpleClosure(e.grabFocus,e,this.getTabGroupMember());
Dwt.setHandler(this._inputEl,DwtEvent.ONFOCUS,o);
Dwt.setHandler(this._inputEl,DwtEvent.ONCLICK,DwtCheckbox.__handleClick)
}
this._textElLeft=document.getElementById(a.id+"_text_left");
this._textElRight=document.getElementById(a.id+"_text_right");
this.setTextPosition(this._textPosition)
};
DwtCheckbox.__handleClick=function(e){
var t=DwtUiEvent.getEvent(e);
var n=DwtUiEvent.getTarget(t);
var o=DwtShell.selectionEvent;
DwtUiEvent.copy(o,t);
o.item=this;
o.detail=n.checked;
var a=DwtControl.findControl(n);
a.setSelected(n.checked);
a.notifyListeners(DwtEvent.SELECTION,o)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButton")){
DwtRadioButton=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtRadioButton.PARAMS);
e.className=e.className||"DwtRadioButton";
DwtCheckbox.call(this,e)
};
DwtRadioButton.PARAMS=DwtCheckbox.PARAMS;
DwtRadioButton.prototype=new DwtCheckbox;
DwtRadioButton.prototype.constructor=DwtRadioButton;
DwtRadioButton.prototype.toString=function(){
return"DwtRadioButton"
};
DwtRadioButton.prototype.TEMPLATE="dwt.Widgets#DwtRadioButton"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtListView")){
DwtListView=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtListView.PARAMS);
t.className=t.className||"DwtListView";
DwtComposite.call(this,t);
this._view=t.view||Dwt.getNextId();
if(t.headerList){
var e=this.getHtmlElement();
this._listColDiv=document.createElement("div");
this._listColDiv.id=DwtId.getListViewId(this._view,DwtId.LIST_VIEW_HEADERS);
this._listColDiv.className="DwtListView-ColHeader";
e.appendChild(this._listColDiv);
this._listDiv=document.createElement("div");
this._listDiv.id=DwtId.getListViewId(this._view,DwtId.LIST_VIEW_ROWS);
this._listDiv.className="DwtListView-Rows";
e.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=t.headerList;
this._noMaximize=t.noMaximize;
this._parentEl=this._headerList?this._listDiv:this.getHtmlElement();
this._list=null;
this.offset=0;
this.headerColCreated=false;
this.multiSelectEnabled=true;
this.firstSelIndex=-1;
this._data={};
this._rowClass=[this._className,DwtListView.ROW_CLASS].join("");
var a=this._normalClass=DwtListView.ROW_CLASS;
this._selectedClass=[a,DwtCssStyle.SELECTED].join("-");
this._disabledSelectedClass=[this._selectedClass,DwtCssStyle.DISABLED].join("-");
this._kbFocusClass=[a,DwtCssStyle.FOCUSED].join("-");
this._dndClass=[a,DwtCssStyle.DRAG_PROXY].join("-");
this._rightClickClass=[this._selectedClass,DwtCssStyle.ACTIONED].join("-");
this._styleRe=this._getStyleRegex()
};
DwtListView.prototype=new DwtComposite;
DwtListView.prototype.constructor=DwtListView;
DwtListView.PARAMS=["parent","className","posStyle","headerList","noMaximize"];
DwtListView.ITEM_SELECTED=1;
DwtListView.ITEM_DESELECTED=2;
DwtListView.ITEM_DBL_CLICKED=3;
DwtListView._LAST_REASON=3;
DwtListView._TOOLTIP_DELAY=250;
DwtListView.HEADERITEM_HEIGHT=24;
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=20;
DwtListView.COL_MOVE_THRESHOLD=3;
DwtListView.ROW_CLASS="Row";
DwtListView.ROW_CLASS_ODD="RowEven";
DwtListView.ROW_CLASS_EVEN="RowOdd";
DwtListView._STYLE_CLASS="_sc";
DwtListView._SELECTED_STYLE_CLASS="_ssc";
DwtListView._SELECTED_DIS_STYLE_CLASS="_sdsc";
DwtListView._KBFOCUS_CLASS="_kfc";
DwtListView.prototype.toString=function(){
return"DwtListView"
};
DwtListView.prototype.dispose=function(){
this._listColDiv=null;
this._listDiv=null;
this._parentEl=null;
this._clickDiv=null;
this._selectedItems=null;
DwtComposite.prototype.dispose.call(this)
};
DwtListView.prototype.setEnabled=function(e){
DwtComposite.prototype.setEnabled.call(this,e);
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(e){
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 a=this.getSelectedItems();
if(a){
var o=a.getArray();
for(var t=0;
t<o.length;
t++){
Dwt.delClass(o[t],this._styleRe,e?this._selectedClass:this._disabledSelectedClass)
}}};
DwtListView.prototype.createHeaderHtml=function(u){
if(!this._headerList||this.headerColCreated){
return
}
this._headerHash={};
this._headerIdHash={};
var m=0;
var p=[];
p[m++]="<table id='";
p[m++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_TABLE,this._view);
p[m++]="' cellpadding=0 cellspacing=0 border=0 height=100%";
p[m++]=this._noMaximize?">":" width=100%>";
p[m++]="<tr>";
var o=this._headerList.length;
for(var s=0;
s<o;
s++){
var c=this._headerList[s];
var d=c._field;
c._index=s;
var t=c._id=DwtId.getListViewHdrId(DwtId.WIDGET_HDR,this._view,d);
this._headerHash[d]=c;
this._headerIdHash[t]=c;
if(c._variable){
this._variableHeaderCol=c
}
if(c._visible){
m=this._createHeader(p,m,c,s,o,t,u)
}}
p[m++]="</tr></table>";
this._listColDiv.innerHTML=p.join("");
var e=0,h;
for(var n=0;
n<this._headerList.length;
n++){
var c=this._headerList[n];
var f=document.getElementById(c._id);
if(!f){
continue
}
if(c._sortable&&c._field==u){
f.className="DwtListView-Column DwtListView-ColumnActive"
}
if(c._resizeable){
var r=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_SASH,this._view,c._field);
var a=document.getElementById(r);
if(a){
this.associateItemWithElement(c,a,DwtListView.TYPE_HEADER_SASH,r,{
index:n}
)
}
e++;
h=c
}
this.associateItemWithElement(c,f,DwtListView.TYPE_HEADER_ITEM,c._id,{
index:n}
)
}
if(e==1){
h._resizeable=false
}
this.headerColCreated=true
};
DwtListView.prototype._createHeader=function(m,u,h,n,o,t,d){
var c=h._field;
m[u++]="<td id='";
m[u++]=t;
m[u++]="' class='";
m[u++]=(t==this._currentColId)?"DwtListView-Column DwtListView-ColumnActive'":"DwtListView-Column'";
if(h._width){
m[u++]=" width=";
m[u++]=h._width;
if(h._widthUnits){
m[u++]=h._widthUnits
}}
m[u++]=">";
m[u++]="<div";
var s=null;
if(h._width&&h._width!="auto"){
if(AjxEnv.isIE){
s=h._width
}else{
s=h._width+2
}
if(h._widthUnits){
s+=h._widthUnits
}}
if(!!s){
m[u++]=" style='overflow: hidden; width: ";
m[u++]=s;
m[u++]="'>"
}else{
m[u++]=">"
}
m[u++]="<table border=0 cellpadding=0 cellspacing=0 width=100%><tr>";
if(h._iconInfo){
var r=["id='",DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ICON,this._view,c),"'"].join("");
m[u++]="<td><center>";
m[u++]=AjxImg.getImageHtml(h._iconInfo,null,r);
m[u++]="</center></td>"
}
if(h._label){
m[u++]="<td id='";
m[u++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,c);
m[u++]="' class='DwtListHeaderItem-label'>";
m[u++]=h._label;
m[u++]="</td>"
}
if(h._sortable&&!h._noSortArrow){
var e=this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow";
m[u++]="<td align=right style='padding-right:2px' width=100% id='";
m[u++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,c);
m[u++]="'>";
var a=(c==d);
m[u++]=AjxImg.getImageHtml(e,a?null:"visibility:hidden");
m[u++]="</td>";
if(a){
this._currentColId=t
}}
if(n<(o-1)){
m[u++]="<td width=4>";
m[u++]="<table align=right border=0 cellpadding=0 cellspacing=0 width=2 height=100%><tr>";
m[u++]="<td class='DwtListView-Sash'><div style='width: 1px; height: ";
m[u++]=(DwtListView.HEADERITEM_HEIGHT-2);
m[u++]="px; background-color: #8A8A8A'></div></td><td id='";
m[u++]=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_SASH,this._view,c);
m[u++]="' class='DwtListView-Sash'><div style='width: 1px; height: ";
m[u++]=(DwtListView.HEADERITEM_HEIGHT-2);
m[u++]="px; background-color: #FFFFFF'></div></td></tr></table>";
m[u++]="</td>"
}
m[u++]="</tr></table>";
m[u++]="</div></td>";
return u
};
DwtListView.prototype.getItemIndex=function(a){
var o=this._list;
if(o){
var e=o.size();
for(var t=0;
t<e;
++t){
if(o.get(t).id==a.id){
return t
}}}
return null
};
DwtListView.prototype.setSize=function(t,e){
DwtComposite.prototype.setSize.call(this,t,e);
this._sizeChildren(e)
};
DwtListView.prototype.size=function(){
return this._list?this._list.size():0
};
DwtListView.prototype.set=function(a,t,e){
if(this._selectedItems){
this._selectedItems.removeAll()
}
this._rightSelItem=null;
this.sortingEnabled=true;
this._resetList();
this._list=a;
this.setUI(t,e)
};
DwtListView.prototype.setUI=function(t,e){
this.removeAll();
this.createHeaderHtml(t);
this._renderList(this._list,e)
};
DwtListView.prototype._renderList=function(r,s,a){
if(r instanceof AjxVector&&r.size()){
var t=new Date();
var d=r.size();
var h=[];
for(var n=0;
n<d;
n++){
var c=r.get(n);
var e=this._createItemHtml(c,{
now:t}
,!a,n);
if(e){
if(e instanceof Array){
for(var o=0;
o<e.length;
o++){
this._addRow(e[o])
}}else{
if(e.tagName||a){
this._addRow(e)
}else{
h.push(e)
}}}}
if(h.length){
this._parentEl.innerHTML=h.join("")
}}else{
if(!s){
this._setNoResultsHtml()
}}};
DwtListView.prototype.addItems=function(e){
if(AjxUtil.isArray(e)){
if(!this._list){
this._list=new AjxVector()
}
if(this._list.size()==0){
this._resetList()
}
this._renderList(AjxVector.fromArray(e),null,true);
this._list.addList(e)
}};
DwtListView.prototype.addItem=function(n,t,a,o){
if(!this._list){
this._list=new AjxVector()
}
if(this._list.size()==0){
this._resetList()
}
this._list.add(n,(o!=null)?o:t);
var s=this._createItemHtml(n);
if(s){
if(s instanceof Array){
for(var e=0;
e<s.length;
e++){
this._addRow(s[e])
}}else{
this._addRow(s,t)
}}
if(!a&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}};
DwtListView.prototype.removeItem=function(a,t,o){
var e=this._getElFromItem(a);
if(!e){
return
}
var n=this._getRowIndex(a);
this._selectedItems.remove(e);
if(this._rightSelItem==e){
this._rightSelItem=null
}
if(this._kbAnchor==e){
this._kbAnchor=null
}
this._parentEl.removeChild(e);
if(this._list){
this._list.remove(a)
}
var s=e.id;
if(this._data[s]){
this._data[s]=null;
delete this._data[s]
}
if(!o){
this._fixAlternation(n)
}
if(!t&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}};
DwtListView.prototype.redrawItem=function(o){
var n=this._getElFromItem(o);
if(n){
var s=this._createItemHtml(o);
n.parentNode.replaceChild(s,n);
var a=this.getSelectedItems().getArray();
for(var t=0;
t<a.length;
t++){
var e=a[t];
if(e===o){
this.setSelectedItems([].concat(a));
break
}}}};
DwtListView.prototype.addSelectionListener=function(e){
this._evtMgr.addListener(DwtEvent.SELECTION,e)
};
DwtListView.prototype.removeSelectionListener=function(e){
this._evtMgr.removeListener(DwtEvent.SELECTION,e)
};
DwtListView.prototype.addActionListener=function(e){
this._evtMgr.addListener(DwtEvent.ACTION,e)
};
DwtListView.prototype.removeActionListener=function(e){
this._evtMgr.removeListener(DwtEvent.ACTION,e)
};
DwtListView.prototype.addStateChangeListener=function(e){
this._evtMgr.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtListView.prototype.removeStateChangeListener=function(e){
this._evtMgr.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtListView.prototype.removeAll=function(e){
if(this._parentEl){
this._parentEl.innerHTML=""
}
if(this._selectedItems){
this._selectedItems.removeAll()
}
this._rightSelItem=this._selAnchor=this._kbAnchor=null;
if(!e&&this._evtMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._evtMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}};
DwtListView.prototype.selectAll=function(){
if(this._list&&this._list.size()){
this.setSelectedItems(this._list.getArray())
}};
DwtListView.prototype.deselectAll=function(){
var e=this._selectedItems.getArray();
var o=this._selectedItems.size();
for(var t=0;
t<o;
t++){
Dwt.delClass(e[t],this._styleRe)
}
this._selectedItems.removeAll();
this._rightSelItem=this._selAnchor=null;
if(this._kbAnchor!=null&&this.hasFocus()){
Dwt.addClass(this._kbAnchor,this._kbFocusClass)
}};
DwtListView.prototype.getDnDSelection=function(){
if(this._dndSelection instanceof AjxVector){
return this.getSelection()
}else{
return this.getItemFromElement(this._dndSelection)
}};
DwtListView.prototype.getSelection=function(){
var t=[];
if(this._rightSelItem){
t.push(this.getItemFromElement(this._rightSelItem))
}else{
if(this._selectedItems){
var e=this._selectedItems.getArray();
var n=this._selectedItems.size();
for(var o=0;
o<n;
o++){
t[o]=this.getItemFromElement(e[o])
}}}
return t
};
DwtListView.prototype.getSelectedItems=function(){
return this._selectedItems
};
DwtListView.prototype.setSelection=function(a,e){
if(!a){
return
}
var t=this._getElFromItem(a);
if(t){
if((this._selectedItems.size()==1)&&(this._selectedItems.get(0)==t)){
return
}
this.deselectAll();
this._unmarkKbAnchorElement(true);
this._selAnchor=this._kbAnchor=t;
this.selectItem(a,this.getEnabled());
this.firstSelIndex=(this._list&&this._list.size()>0)?this._list.indexOf(a):-1;
this._scrollList(t);
if(!e&&this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
var o=new DwtSelectionEvent(true);
o.button=DwtMouseEvent.LEFT;
o.target=t;
o.item=this.getItemFromElement(t);
o.detail=DwtListView.ITEM_SELECTED;
o.ersatz=true;
this._evtMgr.notifyListeners(DwtEvent.SELECTION,o)
}}};
DwtListView.prototype.setMultiSelection=function(e,n,a){
if(n){
this._selectedItems.remove(e);
Dwt.delClass(e,this._styleRe);
this._selEv.detail=DwtListView.ITEM_DESELECTED
}else{
this._selectedItems.add(e,null,true);
Dwt.delClass(e,this._styleRe,this._selectedClass);
this._selEv.detail=DwtListView.ITEM_SELECTED
}
if(this._kbAnchor&&this._kbAnchor!=e){
var o=this._kbAnchor;
var t=this._selectedClass;
if(o.className.indexOf(t)!=-1){
Dwt.delClass(o,this._styleRe,t)
}else{
Dwt.delClass(o,this._styleRe)
}}
this._selAnchor=this._kbAnchor=e;
Dwt.addClass(this._kbAnchor,this._kbFocusClass)
};
DwtListView.prototype.setSelectedItems=function(a){
this.deselectAll();
var o=a.length,e=this.getEnabled();
for(var t=0;
t<o;
++t){
this.selectItem(a[t],e)
}};
DwtListView.prototype.selectItem=function(a,t){
var e=this._getElFromItem(a);
if(e){
Dwt.delClass(e,this._styleRe,t?this._selectedClass:this._disabledSelectedClass);
if(this._kbAnchor==e&&this.hasFocus()){
Dwt.addClass(e,this._kbFocusClass)
}
this._selectedItems.add(e)
}};
DwtListView.prototype.getSelectionCount=function(){
return this._rightSelItem?1:this._selectedItems.size()
};
DwtListView.prototype.handleActionPopdown=function(){
this._clearRightSel()
};
DwtListView.prototype.associateItemWithElement=function(o,t,a,s,n){
s=s||this._getItemId(o);
if(t){
t.id=s
}
a=a||DwtListView.TYPE_LIST_ITEM;
this._data[s]={
item:o,id:s,type:a};
if(n){
for(var e in n){
this._data[s][e]=n[e]
}}
return s
};
DwtListView.prototype.getItemFromElement=function(e){
return this._getItemData(e,"item")
};
DwtListView.prototype.findItem=function(e){
if(!e){
return
}
var t=this.findItemDiv(e);
return this._getItemData(t,"item")
};
DwtListView.prototype.findItemDiv=function(e){
if(!e){
return
}
while(e&&(e.id!=this._htmlElId)){
if(e.id&&this._data[e.id]){
return e
}
e=e.parentNode
}
return null
};
DwtListView.prototype.getTargetItem=function(e){
return this.findItem(DwtUiEvent.getTarget(e))
};
DwtListView.prototype.getTargetItemDiv=function(e){
return this.findItemDiv(DwtUiEvent.getTarget(e))
};
DwtListView.prototype.dragSelect=function(t){
if(this._dragHighlight){
var e=document.getElementById(this._dragHighlight);
if(!t||t.id!=e.id){
this._updateDragSelection(e,false)
}}
if(!t){
return
}
if(this._getItemData(t,"type")!=DwtListView.TYPE_LIST_ITEM){
return
}
if(t.id!=this._dragHighlight){
this._dragHighlight=t.id;
this._updateDragSelection(t,true)
}};
DwtListView.prototype.dragDeselect=function(t){
if(this._dragHighlight){
var e=document.getElementById(this._dragHighlight);
this._updateDragSelection(e,false);
this._dragHighlight=null
}};
DwtListView.prototype.scrollToTop=function(){
this._listDiv.scrollTop=0
};
DwtListView.prototype.setSortByAsc=function(a,t){
if(!this._headerList){
return
}
this._bSortAsc=t;
var o=null;
for(var e=0;
e<this._headerList.length;
e++){
if(this._headerList[e]._sortable&&this._headerList[e]._field==a){
o=this._headerList[e]._id;
break
}}
if(o){
this._setSortedColStyle(o)
}};
DwtListView.prototype.getNewOffset=function(t){
var e=this.getLimit();
var a=t?(this.offset+e):(this.offset-e);
return(a<0)?0:a
};
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(o){
this._list.addList(o);
var t=o.size();
for(var e=0;
e<t;
e++){
var a=o.get(e);
var n=this._createItemHtml(a);
if(n){
this._addRow(n)
}}};
DwtListView.prototype.getKeyMapName=function(){
return"DwtListView"
};
DwtListView.prototype.handleKeyAction=function(n,h){
switch(n){
case DwtKeyMap.SELECT:this._emulateSingleClick({
target:this._kbAnchor,button:DwtMouseEvent.LEFT,kbNavEvent:true}
);
break;
case DwtKeyMap.SELECT_CURRENT:this._emulateSingleClick({
target:this._kbAnchor,button:DwtMouseEvent.LEFT,ctrlKey:true,kbNavEvent:true}
);
break;
case DwtKeyMap.SELECT_NEXT:this._selectItem(true,false,true);
break;
case DwtKeyMap.SELECT_PREV:this._selectItem(false,false,true);
break;
case DwtKeyMap.ADD_SELECT_NEXT:this._selectItem(true,true,true);
break;
case DwtKeyMap.ADD_SELECT_PREV:this._selectItem(false,true,true);
break;
case DwtKeyMap.PREV:this._setKbFocusElement(false);
break;
case DwtKeyMap.NEXT:this._setKbFocusElement(true);
break;
case DwtKeyMap.DBLCLICK:if(!this._kbAnchor){
break
}
var t=false;
var d=this.getSelectedItems().getArray();
for(var o=0;
o<d.length;
o++){
if(d[o]==this._kbAnchor){
t=true;
break
}}
if(t){
this.emulateDblClick(this.getItemFromElement(this._kbAnchor),true)
}else{
this._emulateSingleClick({
target:this._kbAnchor,button:DwtMouseEvent.LEFT,kbNavEvent:true}
)
}
break;
case DwtKeyMap.SELECT_ALL:this.selectAll();
break;
case DwtKeyMap.SELECT_FIRST:case DwtKeyMap.SELECT_LAST:var u=(n==DwtKeyMap.SELECT_FIRST)?this._getFirstItem():this._getLastItem();
if(u){
this.setSelection(u);
this._scrollList(this._kbAnchor)
}
break;
case DwtKeyMap.ACTION:if(this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
var e=Dwt.toWindow(this._kbAnchor,0,0);
var m=Dwt.getSize(this._kbAnchor);
var c=e.x+m.x/4;
var r=e.y+m.y/2;
this._emulateSingleClick({
target:this._kbAnchor,button:DwtMouseEvent.RIGHT,docX:c,docY:r,kbNavEvent:true}
)
}
break;
default:return false
}
return true
};
DwtListView.prototype.setMultiSelect=function(e){
this.multiSelectEnabled=e
};
DwtListView.prototype.isMultiSelectEnabled=function(){
return this.multiSelectEnabled
};
DwtListView.prototype.setListDivHeight=function(a){
if(this._listDiv&&this._listColDiv){
var t=Dwt.getSize(this._listColDiv).y;
var e=a-t;
Dwt.setSize(this._listDiv,Dwt.DEFAULT,e)
}};
DwtListView.prototype._getStyleRegex=function(){
return new RegExp("\\b("+[this._disabledSelectedClass,this._selectedClass,this._kbFocusClass,this._dndClass,this._rightClickClass].join("|")+")\\b","g")
};
DwtListView.prototype._addRow=function(a,t){
if(!a||!this._parentEl){
return
}
var e=this._parentEl.childNodes.length;
if(t!=null&&e>0&&t!=e){
this._parentEl.insertBefore(a,this._parentEl.childNodes[t])
}else{
this._parentEl.appendChild(a)
}
this._fixAlternation((t!=null)?t:e)
};
DwtListView.prototype._fixAlternation=function(e){
var n=this._parentEl.childNodes;
if(!(n&&n.length)){
return
}
if(!(this._list&&this._list.size())){
return
}
var o=n[e];
if(!o){
return
}
var a=Boolean(e%2);
this._setAlternatingRowClass(o,a);
var t=o.nextSibling;
while(t){
a=!a;
this._setAlternatingRowClass(t,a);
t=t.nextSibling
}};
DwtListView.prototype._setAlternatingRowClass=function(o,e){
var t=e?DwtListView.ROW_CLASS_ODD:DwtListView.ROW_CLASS_EVEN;
var a=e?DwtListView.ROW_CLASS_EVEN:DwtListView.ROW_CLASS_ODD;
Dwt.delClass(o,t,a)
};
DwtListView.prototype._createItemHtml=function(d,a,s,n){
a=a||{};
this._addParams(d,a,c,h);
var e;
var c=[];
var h=0;
if(s){
h=this._getDivHtml(d,a,c,h,n)
}else{
e=a.div||this._getDiv(d,a)
}
h=this._getTable(c,h,a);
h=this._getRow(c,h,d,a);
var t=a.headerList||this._headerList;
if(t&&t.length){
for(var o=0;
o<t.length;
o++){
if(!t[o]._visible){
continue
}
var r=t[o]._field;
h=this._getCell(c,h,d,r,o,a)
}}else{
h=this._getCell(c,h,d,null,null,a)
}
c[h++]="</tr></table>";
if(s){
c[h++]="</div>";
return c.join("")
}
e.innerHTML=c.join("");
return e
};
DwtListView.prototype._addParams=function(e,t){};
DwtListView.prototype._getDiv=function(e,t){
var o=document.createElement("div");
if(t.isDragProxy&&AjxEnv.isMozilla){
o.style.overflow="visible"
}
o.className=this._getDivClass(t.divClass||this._normalClass,e,t);
if(t.isDragProxy){
Dwt.setPosition(o,Dwt.ABSOLUTE_STYLE)
}
var a=t.isDragProxy?this._getItemId(e)+"_dnd":null;
this.associateItemWithElement(e,o,null,a);
return o
};
DwtListView.prototype._getDivHtml=function(n,s,t,e,o){
t[e++]="<div class='";
t[e++]=this._getDivClass(this._normalClass,n,s);
t[e++]=" ";
t[e++]=(o%2)?DwtListView.ROW_CLASS_EVEN:DwtListView.ROW_CLASS_ODD;
t[e++]="'";
var a=[];
if(s.isDragProxy&&AjxEnv.isMozilla){
a.push("overflow:visible")
}
if(s.isDragProxy){
a.push("position:absolute")
}
if(a.length){
t[e++]=" style='";
t[e++]=a.join(";");
t[e++]="'"
}
var r=s.isDragProxy?this._getItemId(n)+"_dnd":null;
t[e++]=" id='";
t[e++]=this.associateItemWithElement(n,null,null,r);
t[e++]="'>";
return e
};
DwtListView.prototype._getDivClass=function(t,e,a){
return a.isDragProxy?([t," ",t,"-",DwtCssStyle.DRAG_PROXY].join("")):t
};
DwtListView.prototype._getTable=function(t,e,a){
t[e++]="<table cellpadding=0 cellspacing=0 border=0 width=";
t[e++]=!a.isDragProxy?"100%>":(this.getSize().x+">");
return e
};
DwtListView.prototype._getRow=function(t,e,o,s){
var n=this._getRowId(o,s)||Dwt.getNextId();
var a=this._getRowClass(o,s);
t[e++]=n?["<tr id='",n,"'"].join(""):"<tr";
t[e++]=a?([" class='",a,"'>"].join("")):">";
return e
};
DwtListView.prototype._getRowClass=function(e,t){
return null
};
DwtListView.prototype._getRowId=function(e,t){
return null
};
DwtListView.prototype._getCell=function(p,f,y,u,n,o){
var a=this._getCellId(y,u,o);
var m=a?[" id=","'",a,"'"].join(""):"";
var t=this._getCellWidth(n,o);
var h=t?([" width=",t].join("")):(" width='100%'");
var c=this._getCellClass(y,u,o);
var s=c?[" class=",c].join(""):"";
var g=this._getCellAlign(n,o);
var d=g?[" align=",g].join(""):"";
var e=(this._getCellAttrText(y,u,o))||"";
var r=[m,h,s,d,e].join(" ");
p[f++]="<td";
p[f++]=r?(" "+r):"";
p[f++]=">";
f=this._getCellContents(p,f,y,u,n,o);
p[f++]="</td>";
return f
};
DwtListView.prototype._getCellWidth=function(o,a){
if(o==null){
return null
}
var e=a.headerList||this._headerList;
var t=e[o]._width;
if(t){
if(AjxEnv.isIE){
return(t+2)
}
if(AjxEnv.isSafari){
return(t+5)
}
return t
}
return null
};
DwtListView.prototype._getCellAlign=function(a,t){
if(a==null){
return null
}
var e=t.headerList||this._headerList;
return e[a]._align
};
DwtListView.prototype._getCellId=function(e,t,a){
return null
};
DwtListView.prototype._getCellClass=function(e,t,a){
return null
};
DwtListView.prototype._getCellAttrText=function(e,t,a){
return null
};
DwtListView.prototype._getCellContents=function(t,e,a,o,s,n){
t[e++]=a.toString?a.toString():a;
return e
};
DwtListView.prototype._getFieldId=function(e,t){
return DwtId.getListViewItemId(DwtId.WIDGET_ITEM_FIELD,this._view,e.id,t)
};
DwtListView.prototype._getElement=function(e,t){
return document.getElementById(this._getFieldId(e,t))
};
DwtListView.prototype._getDragProxy=function(o){
var n=this.getDnDSelection();
if(!n){
return null
}
var r;
var e;
var t;
this._dndImg=null;
if(!(n instanceof Array)||n.length==1){
var c=(n instanceof Array)?n[0]:n;
r=this._createItemHtml(c,{
now:new Date(),isDragProxy:true}
);
this._setItemData(r,"origClassName",r.className);
Dwt.setPosition(r,Dwt.ABSOLUTE_STYLE);
t="position:absolute;top:18;left:-11;visibility:hidden"
}else{
r=document.createElement("div");
r.className="DragProxy";
Dwt.setPosition(r,Dwt.ABSOLUTE_STYLE);
AjxImg.setImage(r,"DndMultiYes_48");
this._dndImg=r;
e=document.createElement("div");
Dwt.setPosition(e,Dwt.ABSOLUTE_STYLE);
var h=this.allSelected?ZmMsg.all:n.length;
e.innerHTML="<table><tr><td class='DragProxyTextLabel'>"+h+"</td></tr></table>";
r.appendChild(e);
t="position:absolute;top:30;left:0;visibility:hidden";
Dwt.setBounds(r,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE,43+32-16,36+32-20)
}
var a=AjxImg.getImageHtml("RoundPlus",t,"id="+DwtId.DND_PLUS_ID);
if(!this._noDndPlusImage){
r.appendChild(Dwt.parseHtmlFragment(a))
}
this.shell.getHtmlElement().appendChild(r);
if(e){
var s=Dwt.getSize(e);
Dwt.setLocation(e,16+(32-s.x)/2,19+(32-s.y)/2)
}
Dwt.setZIndex(r,Dwt.Z_DND);
return r
};
DwtListView.prototype._setDragProxyState=function(t){
if(this._dndImg){
AjxImg.setImage(this._dndImg,t?"DndMultiYes_48":"DndMultiNo_48")
}else{
if(this._dndProxy){
var a=t?DwtCssStyle.DROPPABLE:DwtCssStyle.NOT_DROPPABLE;
var e=this._getItemData(this._dndProxy,"origClassName");
this._dndProxy.className=[e,a].join(" ")
}}};
DwtListView.prototype._setNoResultsHtml=function(){
var t=document.createElement("div");
var e={
message:this._getNoResultsMessage(),type:this.type};
t.innerHTML=AjxTemplate.expand("dwt.Widgets#DwtListView-NoResults",e);
this._addRow(t)
};
DwtListView.prototype._getNoResultsMessage=function(){
return AjxMsg.noResults
};
DwtListView.prototype._clearRightSel=function(){
if(this._rightSelItem){
Dwt.delClass(this._rightSelItem,this._styleRe);
this._rightSelItem=null
}};
DwtListView.prototype._getItemId=function(e){
return DwtId.getListViewItemId(DwtId.WIDGET_ITEM,this._view,(e&&e.id)?e.id:Dwt.getNextId())
};
DwtListView.prototype._getElFromItem=function(e){
return Dwt.byId(this._getItemId(e))
};
DwtListView.prototype._getRowIndex=function(t){
var o=this._getItemId(t);
var a=this._parentEl.childNodes;
for(var e=0;
e<a.length;
e++){
if(a[e].id==o){
return e
}}
return null
};
DwtListView.prototype._getItemData=function(e,a,o){
o=o||(e?e.id:null);
var t=this._data[o];
return t?t[a]:null
};
DwtListView.prototype._setItemData=function(e,o,a,n){
n=n||(e?e.id:null);
var t=this._data[n];
if(t){
t[o]=a
}};
DwtListView.prototype._isValidDragObject=function(e){
return(this.getTargetItemDiv(e)!=null)
};
DwtListView.prototype._updateDragSelection=function(t,e){
if(!e){
t.className=this._getItemData(t,"origClassName")
}else{
this._setItemData(t,"origClassName",t.className);
Dwt.delClass(t,this._styleRe,this._dndClass)
}};
DwtListView.prototype._mouseOverAction=function(t,o){
var e=this._getItemData(o,"type");
if(e==DwtListView.TYPE_HEADER_ITEM){
var a=this.getItemFromElement(o);
if(a&&this.sortingEnabled&&a._sortable&&!this._headerClone){
o.className="DwtListView-Column DwtListView-ColumnHover"
}}else{
if(e==DwtListView.TYPE_HEADER_SASH){
o.style.cursor=AjxEnv.isIE?"col-resize":"e-resize"
}}
return true
};
DwtListView.prototype._mouseOutAction=function(t,a){
var e=this._getItemData(a,"type");
if(e==DwtListView.TYPE_HEADER_ITEM&&!this._headerClone){
a.className=(a.id!=this._currentColId)?"DwtListView-Column":"DwtListView-Column DwtListView-ColumnActive"
}else{
if(e==DwtListView.TYPE_HEADER_SASH){
a.style.cursor="auto"
}}
return true
};
DwtListView.prototype._mouseOverListener=function(e){
var t=this.getTargetItemDiv(e);
if(!t){
return
}
this._mouseOverAction(e,t)
};
DwtListView.prototype._mouseOutListener=function(e){
var t=this.getTargetItemDiv(e);
if(!t){
return
}
this.setToolTipContent(null);
this._mouseOutAction(e,t)
};
DwtListView.prototype._mouseMoveListener=function(t){
if(!this._clickDiv){
return
}
var e=this._getItemData(this._clickDiv,"type");
if(e==DwtListView.TYPE_HEADER_ITEM){
this._handleColHeaderMove(t)
}else{
if(e==DwtListView.TYPE_HEADER_SASH){
this._handleColHeaderResize(t)
}}};
DwtListView.prototype._mouseDownListener=function(e){
var t=this.getTargetItemDiv(e);
if(!t){
this._dndSelection=null
}else{
this._clickDiv=t;
if(this._getItemData(t,"type")!=DwtListView.TYPE_LIST_ITEM){
this._dndSelection=null
}else{
this._dndSelection=(this._selectedItems.contains(t))?this._selectedItems:t
}}
this._mouseDownAction(e,t)
};
DwtListView.prototype._mouseUpListener=function(a){
var s=this.getTargetItemDiv(a);
var n=this._handleColHeaderDrop(a);
var e=this._handleColSashDrop(a);
if(!s||s!=this._clickDiv||n||e){
delete this._clickDiv;
this._mouseUpAction(a,s);
return
}
delete this._clickDiv;
var t=this._getItemData(s,"type");
if(this._headerList&&t==DwtListView.TYPE_HEADER_ITEM){
if(a.button==DwtMouseEvent.LEFT){
this._columnClicked(s,a)
}else{
if(a.button==DwtMouseEvent.RIGHT){
var o=this._getActionMenuForColHeader();
if(o&&o instanceof DwtMenu){
o.popup(0,a.docX,a.docY)
}}}}else{
if(t==DwtListView.TYPE_LIST_ITEM){
if(a.button==DwtMouseEvent.LEFT||a.button==DwtMouseEvent.RIGHT){
this._itemClicked(s,a)
}}}
this._mouseUpAction(a,s)
};
DwtListView.prototype._mouseDownAction=function(e,t){};
DwtListView.prototype._mouseUpAction=function(e,t){};
DwtListView.prototype._doubleClickAction=function(e,t){
return true
};
DwtListView.prototype._doubleClickListener=function(t){
var a=this.getTargetItemDiv(t);
if(!a){
return
}
var e=this._getItemData(a,"type");
if(e==DwtListView.TYPE_LIST_ITEM){
if(!this._doubleClickAction(t,a)){
return
}
if(this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
DwtUiEvent.copy(this._selEv,t);
this._selEv.item=this.getItemFromElement(a);
this._selEv.detail=DwtListView.ITEM_DBL_CLICKED;
this._evtMgr.notifyListeners(DwtEvent.SELECTION,this._selEv)
}}};
DwtListView.prototype.emulateDblClick=function(e,t){
var o=document.getElementById(this._getItemId(e));
if(o){
var a=new DwtMouseEvent();
this._setMouseEvent(a,{
target:o,button:DwtMouseEvent.LEFT}
);
a.kbNavEvent=t;
this._itemClicked(o,a);
this._doubleClickListener(a)
}};
DwtListView.prototype._selectItem=function(a,e,o){
if(!this.size()){
return
}
var t=(this._kbAnchor)?this._getSiblingElement(this._kbAnchor,a):this._parentEl.firstChild;
this._scrollList(t);
this._emulateSingleClick({
target:t,button:DwtMouseEvent.LEFT,shiftKey:e,kbNavEvent:o}
)
};
DwtListView.prototype._getSiblingElement=function(e,a){
if(!e){
return null
}
var t=a?e.nextSibling:e.previousSibling;
while(this._hasHiddenRows&&t&&!Dwt.getVisible(t)){
t=a?t.nextSibling:t.previousSibling
}
return(!t||(this._hasHiddenRows&&!Dwt.getVisible(t)))?e:t
};
DwtListView.prototype._scrollList=function(e){
DwtControl._scrollIntoView(e,e.parentNode)
};
DwtListView.prototype._emulateSingleClick=function(e){
this._clickDiv=this.findItemDiv(e.target);
var t=new DwtMouseEvent();
this._setMouseEvent(t,e);
t.kbNavEvent=e.kbNavEvent;
this.notifyListeners(DwtEvent.ONMOUSEUP,t)
};
DwtListView.prototype._setKbFocusElement=function(e){
if(!this._list){
return
}
var a=this._kbAnchor;
if(this._kbAnchor){
this._kbAnchor=this._getSiblingElement(this._kbAnchor,e)
}else{
this._kbAnchor=this._parentEl.firstChild
}
if(this._kbAnchor!=a){
if(a){
var t=this._selectedClass;
if(a.className.indexOf(t)!=-1){
Dwt.delClass(a,this._styleRe,t)
}else{
Dwt.delClass(a,this._styleRe)
}}
Dwt.addClass(this._kbAnchor,this._kbFocusClass)
}
if(this._kbAnchor){
this._scrollList(this._kbAnchor)
}};
DwtListView.prototype._itemSelected=function(e,a){
if(this._allowLeftSelection(e,a,a&&a.button)){
this._unmarkKbAnchorElement(true);
this.deselectAll();
this._selectedItems.add(e);
this._selAnchor=this._kbAnchor=e;
Dwt.delClass(e,this._styleRe,this._selectedClass);
if(this.hasFocus()){
Dwt.addClass(e,this._kbFocusClass)
}
var t=this.getItemFromElement(e);
this.firstSelIndex=(this._list&&t)?this._list.indexOf(t):-1
}};
DwtListView.prototype._itemClicked=function(s,u){
if(this._rightSelItem){
Dwt.delClass(this._rightSelItem,this._styleRe);
this._rightSelItem=null
}
var n=this._selectedItems.size();
var a=this._selectedItems.contains(s);
if((!u.shiftKey&&!u.ctrlKey)||!this.multiSelectEnabled){
if(u.button==DwtMouseEvent.LEFT||u.button==DwtMouseEvent.RIGHT){
this._selEv.detail=DwtListView.ITEM_SELECTED
}
if(u.button==DwtMouseEvent.LEFT){
this._itemSelected(s,u)
}else{
if(u.button==DwtMouseEvent.RIGHT&&!a&&this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
this._rightSelItem=s;
Dwt.delClass(s,this._styleRe,this._rightClickClass);
if(this._kbAnchor==s){
Dwt.addClass(s,this._kbFocusClass)
}}}}else{
if(u.ctrlKey){
this.setMultiSelection(s,a,u)
}else{
if(!this._selAnchor){
return
}
var r=this._getChildren()||s.parentNode.childNodes;
var c=r.length;
var o;
var e=0;
for(var h=0;
h<c;
h++){
o=r[h];
if(o==this._rightSelItem){
this._rightSelItem=null
}
if(o==s){
e++
}
var t=this._selectedClass;
if(o==this._selAnchor){
e++;
if(o.className.indexOf(t)==-1){
this._selectedItems.add(o)
}
Dwt.delClass(o,this._styleRe,t);
continue
}
if(e!=1&&o.className.indexOf(t)!=-1&&o!=s){
Dwt.delClass(o,this._styleRe);
this._selectedItems.remove(o)
}else{
if(e==1||o==s){
if(o.className.indexOf(t)==-1){
this._selectedItems.add(o)
}
Dwt.delClass(o,this._styleRe,t)
}}}
this._kbAnchor=s;
Dwt.addClass(this._kbAnchor,this._kbFocusClass);
var d=this._selectedItems.size();
if(n<d){
this._selEv.detail=DwtListView.ITEM_SELECTED
}else{
if(n>d){
this._selEv.detail=DwtListView.ITEM_DESELECTED
}else{
return
}}}}
if(u.button==DwtMouseEvent.LEFT&&this._evtMgr.isListenerRegistered(DwtEvent.SELECTION)){
if(this._setListEvent(u,this._selEv,s)){
this._evtMgr.notifyListeners(DwtEvent.SELECTION,this._selEv)
}}else{
if(u.button==DwtMouseEvent.RIGHT&&this._evtMgr.isListenerRegistered(DwtEvent.ACTION)){
if(this._setListEvent(u,this._actionEv,s)){
this._evtMgr.notifyListeners(DwtEvent.ACTION,this._actionEv)
}}}};
DwtListView.prototype._setListEvent=function(t,a,e){
DwtUiEvent.copy(a,t);
a.kbNavEvent=t.kbNavEvent;
a.item=this.findItem(e);
return true
};
DwtListView.prototype._columnClicked=function(o,t){
var n=this.getItemFromElement(o);
if(!(n._sortable&&this.sortingEnabled)){
return
}
var a=this.getList();
var e=a?a.size():null;
if(!e){
return
}
this._bSortAsc=(n._id==this._currentColId)?!this._bSortAsc:this._getDefaultSortbyForCol(n);
this._setSortedColStyle(n._id);
if(e>=1){
this._sortColumn(n,this._bSortAsc)
}};
DwtListView.prototype._sortColumn=function(e,t){};
DwtListView.prototype._getActionMenuForColHeader=function(){
return null
};
DwtListView.prototype._getDefaultSortbyForCol=function(e){
return true
};
DwtListView.prototype._allowLeftSelection=function(t,a,e){
return true
};
DwtListView.prototype._setSortedColStyle=function(e){
if(this._currentColId&&(e!=this._currentColId)){
var s=this._headerIdHash[this._currentColId];
if(s&&!s._noSortArrow){
var r=s._field;
var h=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,r);
var o=document.getElementById(h);
if(o&&o.firstChild){
var t=(AjxImg._mode==AjxImg.SINGLE_IMG)?o.firstChild:o.firstChild.firstChild;
if(t){
t.style.visibility="hidden"
}}}
var d=document.getElementById(this._currentColId);
if(d){
d.className="DwtListView-Column"
}}
this._currentColId=e;
var s=this._headerIdHash[this._currentColId];
if(!s._noSortArrow){
var r=s._field;
var c=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_ARROW,this._view,r);
var a=document.getElementById(c);
if(a){
AjxImg.setImage(a,this._bSortAsc?"ColumnUpArrow":"ColumnDownArrow");
var t=(AjxImg._mode==AjxImg.SINGLE_IMG)?a.firstChild:a.firstChild.firstChild;
if(t){
t.style.visibility="visible"
}}}
var n=document.getElementById(e);
if(n){
n.className="DwtListView-Column DwtListView-ColumnActive"
}};
DwtListView.prototype._resetList=function(){
if(this._list&&this._list.size()){
this._list.removeAll()
}
this._resetListView()
};
DwtListView.prototype._resetListView=function(){
var e;
while(this._parentEl&&this._parentEl.hasChildNodes()){
var e=this._parentEl.removeChild(this._parentEl.firstChild);
this._data[e.id]=null
}
if(this._selectedItems){
this._selectedItems.removeAll()
}
this._rightSelItem=null
};
DwtListView.prototype._destroyDragProxy=function(e){
this._data[e.id]=null;
DwtControl.prototype._destroyDragProxy.call(this,e)
};
DwtListView.prototype._handleColHeaderMove=function(r){
if(!this._headerClone){
if(!this._headerColX){
this._headerColX=r.docX;
return
}else{
var n=Math.abs(this._headerColX-r.docX);
if(n<DwtListView.COL_MOVE_THRESHOLD){
return
}}
this._headerClone=document.createElement("div");
var u=Dwt.getSize(this._clickDiv);
var t=AjxEnv.isIE?u.x:u.x-3;
var d=AjxEnv.isIE?u.y:u.y-5;
Dwt.setSize(this._headerClone,t,d);
Dwt.setPosition(this._headerClone,Dwt.ABSOLUTE_STYLE);
Dwt.setZIndex(this._headerClone,Dwt.Z_DND);
Dwt.setLocation(this._headerClone,Dwt.DEFAULT,r.docY);
this._headerClone.className=this._clickDiv.className+" DragProxy";
this._headerClone.innerHTML=this._clickDiv.innerHTML;
this._clickDiv.className="DwtListView-Column DwtListView-ColumnEmpty";
this._headerClone.style.borderTop="1px solid #777777";
var h=this._headerIdHash[this._clickDiv.id];
var c=h._field;
var o=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,c);
var a=document.getElementById(o);
if(a){
a.style.color="#FFFFFF"
}
this.shell.getHtmlElement().appendChild(this._headerClone)
}else{
var e=this.getTargetItemDiv(r);
var s=this._getItemData(e,"type");
if(s==DwtListView.TYPE_HEADER_ITEM){
if(this._headerCloneTarget&&(this._headerCloneTarget==this._clickDiv)){
this._headerCloneTarget=null
}else{
if(this._headerCloneTarget!=e){
this._headerCloneTarget=e
}}}else{
this._headerCloneTarget=null
}}
if(this._headerClone){
Dwt.setLocation(this._headerClone,r.docX+2)
}};
DwtListView.prototype._handleColHeaderResize=function(t){
if(!this._headerSash){
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);
var a=this._getHeaderSashLocation();
this._headerSashFudgeX=a.x;
Dwt.setLocation(this._headerSash,Dwt.DEFAULT,a.y);
this._headerSash.className="DwtListView-ColumnSash";
this.getHtmlElement().appendChild(this._headerSash);
this._headerSashX=t.docX
}
var e=this._getParentForColResize();
var o=Dwt.toWindow(e.getHtmlElement(),0,0);
Dwt.setLocation(this._headerSash,(t.docX-o.x)+this._headerSashFudgeX)
};
DwtListView.prototype._getHeaderSashLocation=function(){
if(!this._tmpPoint){
this._tmpPoint=new DwtPoint()
}
this._tmpPoint.x=0;
this._tmpPoint.y=0;
return this._tmpPoint
};
DwtListView.prototype._handleColHeaderDrop=function(h){
this._headerColX=null;
if(this._headerClone==null||h.button==DwtMouseEvent.RIGHT){
return false
}
if(this._headerCloneTarget){
var e=this._getItemData(this._clickDiv,"index");
var a=this._getItemData(this._headerCloneTarget,"index");
this._reIndexColumn(e,a)
}
this._clickDiv.className=(this._clickDiv.id!=this._currentColId)?"DwtListView-Column":"DwtListView-Column DwtListView-ColumnActive";
var d=this._headerClone.parentNode;
if(d){
d.removeChild(this._headerClone)
}
delete this._headerClone;
var s=this._data[this._clickDiv.id];
if(s.type!=DwtListView.TYPE_HEADER_ITEM){
var c=this._headerIdHash[this._currentColId];
var r=c._sortable?c._field:null;
this.headerColCreated=false;
this.createHeaderHtml(r)
}else{
var c=this._headerIdHash[this._clickDiv.id];
var o=DwtId.getListViewHdrId(DwtId.WIDGET_HDR_LABEL,this._view,c._field);
var t=document.getElementById(o);
if(t){
t.style.color="#000000"
}}
for(var n=0;
n<this._headerList.length;
n++){
this._headerList[n]._width=this._calcRelativeWidth(n)
}
this._resetColWidth();
return true
};
DwtListView.prototype._reIndexColumn=function(o,a){
if(!this._headerList){
return
}
var e=this._headerList.length;
if(o<0||a<0||o>=e||a>=e||o==a){
return
}
var t=this._headerList.splice(o,1);
this._headerList.splice(a,0,t[0]);
this._relayout()
};
DwtListView.prototype._handleColSashDrop=function(o){
if(this._headerSash==null||o.button==DwtMouseEvent.RIGHT){
return false
}
var a=this._headerSash.parentNode;
if(a){
a.removeChild(this._headerSash)
}
delete this._headerSash;
for(var t=0;
t<this._headerList.length;
t++){
this._headerList[t]._width=this._calcRelativeWidth(t)
}
var s=this._getItemData(this._clickDiv,"index");
if(s==null){
return false
}
var h=o.docX-this._headerSashX;
var r=this._headerList[s];
var n=this._variableHeaderCol;
if(r==n){
var e=this._getNextResizeableColumnIndex(n._index);
if(e!=null){
n=this._headerList[e]
}else{
return false
}}else{
if(!n){
var e=this._getNextResizeableColumnIndex(r._index);
if(e!=null){
n=this._headerList[e]
}else{
return false
}}}
r._width=Math.max(r._width+h,DwtListView.MIN_COLUMN_WIDTH);
n._width=Math.max(this._calcRelativeWidth(n._index)-h,DwtListView.MIN_COLUMN_WIDTH);
var e=this._getNextResizeableColumnIndex(-1,[r._index,n._index]);
if(e!=null){
this._headerList[e]._width="auto"
}
this._relayout();
this._resetColWidth();
return true
};
DwtListView.prototype._calcRelativeWidth=function(a){
var t=this._headerList[a];
if(!t._width||(t._width&&t._width=="auto")){
var e=document.getElementById(t._id);
return(e)?(e.clientWidth-(AjxEnv.isIE?4:5)):null
}
return t._width
};
DwtListView.prototype._resetColWidth=function(){
if(!this.headerColCreated){
return
}
var s=this._getLastColumnIndex();
if(s){
var a=this._headerList[s];
var t=document.getElementById(a._id);
if(t){
var r=t.firstChild;
var e=16;
var n=this._listColDiv.clientWidth;
var o=this._listDiv.clientWidth;
if(n!=o){
t.style.width=r.style.width=(a._width!=null&&a._width!="auto")?(a._width+e):(t.clientWidth+e)
}else{
t.style.width=r.style.width=(a._width||"")
}}}};
DwtListView.prototype._getLastColumnIndex=function(){
var t=null;
if(this._headerList){
var e=this._headerList.length-1;
while(t==null&&e>=0){
if(this._headerList[e]._visible){
t=e
}
e--
}}
return t
};
DwtListView.prototype._getNextResizeableColumnIndex=function(o,e){
e=e?AjxUtil.arrayAsHash(e):{};
e[o]=true;
if(this._headerList){
for(var a=o+1;
a<this._headerList.length;
a++){
var t=this._headerList[a];
if(e[a]){
continue
}
if(t._visible&&t._resizeable){
return a
}}
for(var a=0;
a<o;
a++){
if(e[a]){
continue
}
var t=this._headerList[a];
if(t._visible&&t._resizeable){
return a
}}}
return null
};
DwtListView.prototype._relayout=function(){
this.headerColCreated=false;
var a=this._headerIdHash[this._currentColId];
var e=(a&&a._sortable)?a._field:null;
this.setUI(e);
var t=this.getSelection()[0];
this.setSelection(t,true)
};
DwtListView.prototype._getParentForColResize=function(){
return this
};
DwtListView.prototype._sizeChildren=function(e){
if(this.headerColCreated&&this._listDiv&&(e!=Dwt.DEFAULT)){
Dwt.setSize(this._listDiv,Dwt.DEFAULT,e-DwtListView.HEADERITEM_HEIGHT);
return true
}else{
return false
}};
DwtListView.prototype._getChildren=function(){
return null
};
DwtListView.prototype._focus=function(){
if(this.size()==0){
return
}
if(this._kbAnchor){
Dwt.addClass(this._kbAnchor,this._kbFocusClass)
}else{
this._setKbFocusElement()
}};
DwtListView.prototype._blur=function(){
this._unmarkKbAnchorElement()
};
DwtListView.prototype._unmarkKbAnchorElement=function(e){
if(this._kbAnchor){
if(this._selectedItems.contains(this._kbAnchor)){
Dwt.delClass(this._kbAnchor,this._styleRe,this._selectedClass)
}else{
Dwt.delClass(this._kbAnchor,this._styleRe)
}}
if(e){
this._kbAnchor=null
}};
DwtListView.prototype._getFirstItem=function(){
var e=this._list.getArray();
if(e&&e.length>1){
return e[0]
}
return null
};
DwtListView.prototype._getLastItem=function(){
var e=this._list.getArray();
if(e&&e.length>1){
return e[e.length-1]
}
return null
};
DwtListHeaderItem=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtListView.PARAMS);
this._field=t.field;
this._label=t.text;
this._iconInfo=t.icon;
this._sortable=t.sortable;
this._noSortArrow=t.noSortArrow;
this._resizeable=t.resizeable;
this._visible=(t.visible!==false);
this._name=t.name||t.text;
this._align=t.align;
this._noRemove=t.noRemove;
var e=parseInt(t.width);
if(isNaN(e)||!e){
this._width="auto";
this._variable=true;
this._resizeable=true
}else{
if(String(e)==String(t.width)){
this._width=e
}else{
this._width=parseInt(String(t.width).substr(0,String(e).length));
this._widthUnits=AjxStringUtil.getUnitsFromSizeString(t.width)
}}};
DwtListHeaderItem.PARAMS=["id","text","icon","width","sortable","resizeable","visible","name","align","noRemove","view"];
DwtListHeaderItem.sortCompare=function(t,e){
return t._index<e._index?-1:(t._index>e._index?1:0)
};
DwtListHeaderItem.prototype.toString=function(){
return"DwtListHeaderItem"
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtButton")){
DwtButton=function(a){
if(arguments.length==0){
return
}
a=Dwt.getParams(arguments,DwtButton.PARAMS);
a.className=a.className||"ZButton";
DwtLabel.call(this,a);
var t=a.parent;
if(!t._hasSetMouseEvents||AjxEnv.isIE){
this._setMouseEvents()
}
var e;
if(t._hasSetMouseEvents){
e=AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[]
}else{
e=AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
e=e.concat([DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP])
}
if(e&&e.length){
this._setEventHdlrs(e)
}
this._listeners=a.listeners||DwtButton._listeners;
this._addMouseListeners();
this._ignoreInternalOverOut=true;
this._dropDownEvtMgr=new AjxEventMgr();
this._selected=false;
this._actionTiming=a.actionTiming||DwtButton.ACTION_MOUSEUP;
this.__preventMenuFocus=null
};
DwtButton.prototype=new DwtLabel;
DwtButton.prototype.constructor=DwtButton;
DwtButton.prototype.toString=function(){
return"DwtButton"
};
DwtButton.PARAMS=["parent","style","className","posStyle","actionTiming","id","index","listeners"];
DwtButton.TOGGLE_STYLE=DwtLabel._LAST_STYLE*2;
DwtButton.ALWAYS_FLAT=DwtLabel._LAST_STYLE*4;
DwtButton._LAST_STYLE=DwtButton.ALWAYS_FLAT;
DwtButton.ACTION_MOUSEUP=1;
DwtButton.ACTION_MOUSEDOWN=2;
DwtButton.NOTIFY_WINDOW=500;
DwtButton.prototype.TEMPLATE="dwt.Widgets#ZButton";
DwtButton.prototype.dispose=function(){
if((this._menu instanceof DwtMenu)&&(this._menu.parent==this)){
this._menu.dispose();
this._menu=null
}
DwtLabel.prototype.dispose.call(this)
};
DwtButton.prototype.addSelectionListener=function(t,e){
this.addListener(DwtEvent.SELECTION,t,e)
};
DwtButton.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtButton.prototype.removeSelectionListeners=function(){
this.removeAllListeners(DwtEvent.SELECTION)
};
DwtButton.prototype.addDropDownSelectionListener=function(e){
return this._dropDownEvtMgr.addListener(DwtEvent.SELECTION,e)
};
DwtButton.prototype.removeDropDownSelectionListener=function(e){
this._dropDownEvtMgr.removeListener(DwtEvent.SELECTION,e)
};
DwtButton.prototype._dropDownImg="SelectPullDownArrow";
DwtButton.prototype._dropDownDepImg="SelectPullDownArrow";
DwtButton.prototype._dropDownHovImg="SelectPullDownArrowHover";
DwtButton.prototype.setDropDownImages=function(t,a,o,e){
this._dropDownImg=t;
this._dropDownHovImg=o;
this._dropDownDepImg=e
};
DwtButton.prototype._addEventListeners=function(a,t){
for(var e=0;
e<t.length;
e++){
this.addListener(event,a[event])
}};
DwtButton.prototype._removeEventListeners=function(a,t){
for(var e=0;
e<t.length;
e++){
this.removeListener(event,a[event])
}};
DwtButton.prototype._addMouseListeners=function(){
var t=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP];
t=t.concat(AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT]);
for(var e=0;
e<t.length;
e++){
this.addListener(t[e],this._listeners[t[e]])
}};
DwtButton.prototype._removeMouseListeners=function(){
var t=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP];
t=t.concat(AjxEnv.isIE?[DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE]:[DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT]);
for(var e=0;
e<t.length;
e++){
this.removeListener(t[e],this._listeners[t[e]])
}};
DwtButton.prototype.setDisplayState=function(t,e){
if(this._selected&&t!=DwtControl.SELECTED&&!e){
t=[DwtControl.SELECTED,t].join(" ")
}
DwtLabel.prototype.setDisplayState.call(this,t)
};
DwtButton.prototype.setEnabled=function(t){
if(t!=this._enabled){
DwtLabel.prototype.setEnabled.call(this,t);
if(t){
var a=(AjxEnv.isIE)?this.getHtmlElement().firstChild:null;
if(a){
var e=a.className;
a.className="";
a.className=e
}
this._addMouseListeners();
if(this._menu){
this._setDropDownCellMouseHandlers(true);
if(this._dropDownEl){
AjxImg.setImage(this._dropDownEl,this._dropDownImg)
}}}else{
this._removeMouseListeners();
if(this._menu){
this._setDropDownCellMouseHandlers(false);
if(this._dropDownEl){
AjxImg.setDisabledImage(this._dropDownEl,this._dropDownImg)
}}}}};
DwtButton.prototype.setImage=function(e){
DwtLabel.prototype.setImage.call(this,e);
this._setMinWidth()
};
DwtButton.prototype.setText=function(e){
DwtLabel.prototype.setText.call(this,e);
this._setMinWidth()
};
DwtButton.prototype._setMinWidth=function(){
if(this.getText()!=null){
Dwt.addClass(this.getHtmlElement(),"ZHasText")
}else{
Dwt.delClass(this.getHtmlElement(),"ZHasText")
}};
DwtButton.prototype.setHoverImage=function(e){
this._hoverImageInfo=e
};
DwtButton.prototype.setMenu=function(n,a,o,t){
this._menu=n;
this._shouldToggleMenu=(a===true);
this._followIconStyle=o;
this._popupAbove=t;
if(this._menu){
if(this._dropDownEl){
var e=(this._imageCell)?1:0;
if(this._textCell){
e++
}
Dwt.addClass(this.getHtmlElement(),"ZHasDropDown");
AjxImg.setImage(this._dropDownEl,this._dropDownImg);
if(this._enabled){
this._setDropDownCellMouseHandlers(true)
}
if(!(this._menu instanceof AjxCallback)){
this._menu.setAssociatedElementId(this._dropDownEl.id)
}}
if((this.__preventMenuFocus!=null)&&(this._menu instanceof DwtMenu)){
this._menu.dontStealFocus(this.__preventMenuFocus)
}}else{
if(this._dropDownEl){
Dwt.delClass(this.getHtmlElement(),"ZHasDropDown");
this._dropDownEl.innerHTML=""
}}};
DwtButton.prototype._setDropDownCellMouseHandlers=function(e){
this._dropDownEventsEnabled=e
};
DwtButton.prototype.getMenu=function(e){
if(this._menu instanceof AjxCallback){
if(e){
return null
}
var t=this._menu;
this.setMenu(t.run(this),this._shouldToggleMenu,this._followIconStyle,this._popupAbove);
if((this.__preventMenuFocus!=null)&&(this._menu instanceof DwtMenu)){
this._menu.dontStealFocus(this.__preventMenuFocus)
}}
if(this._menu){
this.getHtmlElement().setAttribute("menuId",this._menu._htmlElId)
}
return this._menu
};
DwtButton.prototype.resetClassName=function(){
this.setDisplayState(DwtControl.NORMAL)
};
DwtButton.prototype.setActionTiming=function(e){
this._actionTiming=e
};
DwtButton.prototype.setHovered=function(e){
this.setDisplayState(e?DwtControl.HOVER:DwtControl.NORMAL)
};
DwtButton.prototype.setEnabledImage=function(e){
this._enabledImageInfo=e;
this.setImage(e)
};
DwtButton.prototype.setDepressedImage=function(e){
this._depressedImageInfo=e
};
DwtButton.prototype.setSelected=function(e){
if(this._selected!=e){
this._selected=e;
this.setDisplayState(e?DwtControl.SELECTED:DwtControl.NORMAL)
}};
DwtButton.prototype.isToggled=function(){
return this._selected
};
DwtButton.prototype.popup=function(o){
o=o||this.getMenu();
if(!o){
return
}
var d=o.parent;
var s=d.getBounds();
var c=o.shell.getSize();
var e=o.getSize();
var u=d.getHtmlElement();
var a=Dwt.toWindow(u,0,0);
var t=(u.style.borderLeftWidth=="")?0:parseInt(u.style.borderLeftWidth);
var h=a.x+t;
h=((h+e.x)>=c.x)?c.x-e.x:h;
var r;
if(this._popupAbove){
r=a.y-e.y
}else{
var n=(u.style.borderTopWidth=="")?0:parseInt(u.style.borderTopWidth);
n+=(u.style.borderBottomWidth=="")?0:parseInt(u.style.borderBottomWidth);
r=a.y+s.height+n
}
o.popup(0,h,r)
};
DwtButton.prototype.getKeyMapName=function(){
return"DwtButton"
};
DwtButton.prototype.handleKeyAction=function(e,t){
switch(e){
case DwtKeyMap.SELECT:this._emulateSingleClick();
break;
case DwtKeyMap.SUBMENU:var a=this.getMenu();
if(!a){
return false
}
this._emulateDropDownClick();
a.setSelectedItem(0);
break
}
return true
};
DwtButton.prototype._emulateSingleClick=function(){
this.trigger();
var e=this.getHtmlElement();
var t=Dwt.toWindow(e);
var a=new DwtMouseEvent();
this._setMouseEvent(a,{
dwtObj:this,target:e,button:DwtMouseEvent.LEFT,docX:t.x,docY:t.y}
);
if(this._actionTiming==DwtButton.ACTION_MOUSEDOWN){
this.notifyListeners(DwtEvent.ONMOUSEDOWN,a)
}else{
this.notifyListeners(DwtEvent.ONMOUSEUP,a)
}};
DwtButton.prototype._emulateDropDownClick=function(){
var e=this._dropDownEl;
if(!e){
return
}
var t=Dwt.toWindow(e);
var a=new DwtMouseEvent();
this._setMouseEvent(a,{
dwtObj:this,target:e,button:DwtMouseEvent.LEFT,docX:t.x,docY:t.y}
);
DwtButton._dropDownCellMouseDownHdlr(a)
};
DwtButton.prototype._focusByMouseUpEvent=function(){
if(!(this.parent&&(this.parent instanceof DwtToolBar)&&this.parent.noFocus)){
DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
}};
DwtButton.prototype._focus=function(){
this.setDisplayState(DwtControl.FOCUSED)
};
DwtButton.prototype._blur=function(){
this.setDisplayState(DwtControl.NORMAL)
};
DwtButton.prototype._toggleMenu=function(){
if(this._shouldToggleMenu){
var e=this.getMenu();
if(!e.isPoppedUp()){
this.popup();
this._menuUp=true
}else{
e.popdown();
this._menuUp=false;
this.deactivate()
}}else{
this.popup()
}};
DwtButton.prototype._isDropDownEvent=function(t){
if(this._dropDownEventsEnabled&&this._dropDownEl){
var e=t.docX;
var a=Dwt.toWindow(this._dropDownEl,0,0,window).x;
if(e>=a){
return true
}}
return false
};
DwtButton.prototype.trigger=function(){
if(this._depressedImageInfo){
this.setImage(this._depressedImageInfo)
}
this.setDisplayState(DwtControl.ACTIVE,true);
this.isActive=true
};
DwtButton.prototype.deactivate=function(){
this._showHoverImage(true);
if(this._style&DwtButton.TOGGLE_STYLE){
this._selected=!this._selected
}
this.setDisplayState(DwtControl.HOVER)
};
DwtButton.prototype.dontStealFocus=function(e){
if(e==null){
e=true
}
if(this._menu instanceof DwtMenu){
this._menu.dontStealFocus(e)
}
this.__preventMenuFocus=e
};
DwtButton.prototype._showHoverImage=function(t){
if(this._hoverImageInfo){
var e=this._getIconEl();
if(e){
var a=t?this._hoverImageInfo:this.__imageInfo;
e.firstChild.className=AjxImg.getClassForImage(a)
}}};
DwtButton.prototype._handleClick=function(t){
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var e=(new Date()).getTime();
if(!this._lastNotify||(e-this._lastNotify>DwtButton.NOTIFY_WINDOW)){
var a=DwtShell.selectionEvent;
DwtUiEvent.copy(a,t);
a.item=this;
a.detail=(typeof this.__detail=="undefined")?0:this.__detail;
this.notifyListeners(DwtEvent.SELECTION,a);
this._lastNotify=e;
this.shell.notifyGlobalSelection(a)
}}else{
if(this._menu){
this._toggleMenu()
}}};
DwtButton.prototype._setMouseOutClassName=function(){
this.setDisplayState(DwtControl.NORMAL)
};
DwtButton.prototype._createHtmlFromTemplate=function(e,t){
DwtLabel.prototype._createHtmlFromTemplate.call(this,e,t);
this._dropDownEl=document.getElementById(t.id+"_dropdown")
};
DwtButton._dropDownCellMouseDownHdlr=function(t){
var a=DwtControl.getTargetControl(t);
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t,a);
if(e.button==DwtMouseEvent.LEFT){
if(this._depImg){
AjxImg.setImage(this,this._depImg)
}}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtButton._dropDownCellMouseUpHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
if(e.button==DwtMouseEvent.LEFT){
if(this._hovImg&&!this.noMenuBar){
AjxImg.setImage(this,this._hovImg)
}
DwtEventManager.notifyListeners(DwtEvent.ONMOUSEDOWN,e);
var o=DwtControl.getTargetControl(t);
if(o){
if(o.getMenu()&&o.getMenu().isPoppedUp()){
o.getMenu().popdown()
}else{
if(o._menu instanceof AjxCallback){
o.popup()
}
if(o._dropDownEvtMgr.isListenerRegistered(DwtEvent.SELECTION)){
var a=DwtShell.selectionEvent;
DwtUiEvent.copy(a,e);
a.item=o;
o._dropDownEvtMgr.notifyListeners(DwtEvent.SELECTION,a)
}else{
o._toggleMenu()
}}}}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtButton._mouseOverListener=function(t){
var e=t.dwtObj;
if(!e){
return false
}
e._showHoverImage(true);
e.setDisplayState(DwtControl.HOVER);
var a=e._dropDownEl;
if(e._menu&&a&&e._dropDownHovImg&&!e.noMenuBar&&e.isListenerRegistered(DwtEvent.SELECTION)){
AjxImg.setImage(a,e._dropDownHovImg)
}
t._stopPropagation=true
};
DwtButton._mouseOutListener=function(t){
var e=t.dwtObj;
if(!e){
return false
}
e._showHoverImage(false);
e._setMouseOutClassName();
e.isActive=false;
var a=e._dropDownEl;
if(e._menu&&a){
AjxImg.setImage(a,e._dropDownImg)
}};
DwtButton._mouseDownListener=function(t){
var e=t.dwtObj;
if(!e){
return false
}
if(e._isDropDownEvent(t)){
return DwtButton._dropDownCellMouseDownHdlr(t)
}
if(t.button!=DwtMouseEvent.LEFT){
return
}
var a=e._dropDownEl;
if(e._menu&&a&&e._dropDownDepImg){
AjxImg.setImage(a,e._dropDownDepImg)
}
switch(e._actionTiming){
case DwtButton.ACTION_MOUSEDOWN:e.trigger();
e._handleClick(t);
break;
case DwtButton.ACTION_MOUSEUP:e.trigger();
break
}};
DwtButton._mouseUpListener=function(a){
var e=a.dwtObj;
if(!e){
return false
}
if(e._isDropDownEvent(a)){
return DwtButton._dropDownCellMouseUpHdlr(a)
}
if(a.button!=DwtMouseEvent.LEFT){
return
}
var o=e._dropDownEl;
if(e._menu&&o&&e._dropDownHovImg&&!e.noMenuBar){
AjxImg.setImage(o,e._dropDownHovImg)
}
switch(e._actionTiming){
case DwtButton.ACTION_MOUSEDOWN:e.deactivate();
break;
case DwtButton.ACTION_MOUSEUP:var t=e.getHtmlElement();
if(e.isActive){
e.deactivate();
e._handleClick(a)
}
break
}};
DwtButton._listeners={};
DwtButton._listeners[DwtEvent.ONMOUSEOVER]=new AjxListener(null,DwtButton._mouseOverListener);
DwtButton._listeners[DwtEvent.ONMOUSEOUT]=new AjxListener(null,DwtButton._mouseOutListener);
DwtButton._listeners[DwtEvent.ONMOUSEDOWN]=new AjxListener(null,DwtButton._mouseDownListener);
DwtButton._listeners[DwtEvent.ONMOUSEUP]=new AjxListener(null,DwtButton._mouseUpListener);
DwtButton._listeners[DwtEvent.ONMOUSEENTER]=new AjxListener(null,DwtButton._mouseOverListener);
DwtButton._listeners[DwtEvent.ONMOUSELEAVE]=new AjxListener(null,DwtButton._mouseOutListener)
}
if(AjxPackage.define("ajax.dwt.widgets.DwtMenuItem")){
DwtMenuItem=function(a){
if(arguments.length==0){
return
}
a=Dwt.getParams(arguments,DwtMenuItem.PARAMS);
var t=a.parent;
if(!(t instanceof DwtMenu)){
throw new DwtException("Parent must be a DwtMenu object",DwtException.INVALIDPARENT,"DwtMenuItem")
}
var e=a.style=a.style||DwtMenuItem.NO_STYLE;
if(t._style==DwtMenu.BAR_STYLE&&e!=DwtMenuItem.PUSH_STYLE){
throw new DwtException("DwtMenuItemInit: invalid style",DwtException.INVALID_PARAM,"DwtMenuItem")
}
e&=~DwtLabel.IMAGE_RIGHT;
e|=DwtButton.ALWAYS_FLAT|DwtLabel.IMAGE_LEFT;
a.className=(e&DwtMenuItem.SEPARATOR_STYLE)?"ZMenuItemSeparator":(a.className||"ZMenuItem");
a.listeners=DwtMenuItem._listeners;
DwtButton.call(this,a);
this.setDropDownImages("Cascade","Cascade","Cascade","Cascade");
this._radioGroupId=a.radioGroupId;
if(t._addItem){
t._addItem(this,a.index)
}
if(!(e&DwtMenuItem.SEPARATOR_STYLE)){
this.addSelectionListener(new AjxListener(this,this.__handleItemSelect))
}};
DwtMenuItem.PARAMS=["parent","style","radioGroupId","index","className","posStyle"];
DwtMenuItem.prototype=new DwtButton;
DwtMenuItem.prototype.constructor=DwtMenuItem;
DwtMenuItem.prototype.toString=function(){
return"DwtMenuItem"
};
DwtMenuItem.CHECKED=1;
DwtMenuItem.UNCHECKED=2;
DwtMenuItem.NO_STYLE=0;
DwtMenuItem.CHECK_STYLE=DwtButton._LAST_STYLE*2;
DwtMenuItem.RADIO_STYLE=DwtButton._LAST_STYLE*4;
DwtMenuItem.SEPARATOR_STYLE=DwtButton._LAST_STYLE*8;
DwtMenuItem.CASCADE_STYLE=DwtButton._LAST_STYLE*16;
DwtMenuItem.PUSH_STYLE=DwtButton._LAST_STYLE*32;
DwtMenuItem.SELECT_STYLE=DwtButton._LAST_STYLE*64;
DwtMenuItem._LAST_STYLE=DwtMenuItem.SELECT_STYLE;
DwtMenuItem._MENU_POPUP_DELAY=250;
DwtMenuItem._MENU_POPDOWN_DELAY=250;
DwtMenuItem.prototype.TEMPLATE="dwt.Widgets#ZMenuItem";
DwtMenuItem.prototype.SEPARATOR_TEMPLATE="dwt.Widgets#ZMenuItemSeparator";
DwtMenuItem.prototype.BLANK_CHECK_TEMPLATE="dwt.Widgets#ZMenuItemBlankCheck";
DwtMenuItem.prototype.BLANK_ICON_TEMPLATE="dwt.Widgets#ZMenuItemBlankIcon";
DwtMenuItem.prototype.BLANK_CASCADE_TEMPLATE="dwt.Widgets#ZMenuItemBlankCascade";
DwtMenuItem.prototype.dispose=function(){
delete this._checkEl;
DwtButton.prototype.dispose.call(this)
};
DwtMenuItem.create=function(t){
var e=new DwtMenuItem(t);
if(t.imageInfo){
e.setImage(t.imageInfo)
}
if(t.text){
e.setText(t.text)
}
e.setEnabled(t.enabled!==false);
return e
};
DwtMenuItem.prototype.getChecked=function(){
return this._itemChecked
};
DwtMenuItem.prototype.setChecked=function(t,e){
this._setChecked(t,null,e);
this.parent._checkItemAdded(this)
};
DwtMenuItem.prototype.setImage=function(e){
DwtButton.prototype.setImage.call(this,e);
this.parent._iconItemAdded(this)
};
DwtMenuItem.prototype.setText=function(e){
DwtButton.prototype.setText.call(this,e);
if(this.parent.isPoppedUp()){
this.parent.render()
}};
DwtMenuItem.prototype.setMenu=function(a,e,t){
DwtButton.prototype.setMenu.call(this,a,e,t);
this.parent._submenuItemAdded(this)
};
DwtMenuItem.prototype.setHoverDelay=function(e){
this._hoverDelay=e
};
DwtMenuItem.prototype.setShortcut=function(e){
if(e&&this._dropDownEl){
this._dropDownEl.innerHTML=e
}};
DwtMenuItem.prototype._createHtml=function(e){
var t=(this._style&DwtMenuItem.SEPARATOR_STYLE)?this.SEPARATOR_TEMPLATE:this.TEMPLATE;
DwtButton.prototype._createHtml.call(this,e||t)
};
DwtMenuItem.prototype._createHtmlFromTemplate=function(e,t){
DwtButton.prototype._createHtmlFromTemplate.call(this,e,t);
this._checkEl=document.getElementById(t.id+"_check")
};
DwtMenuItem.prototype._setChecked=function(s,n,t){
var e=this._style&DwtMenuItem.CHECK_STYLE;
var o=this._style&DwtMenuItem.RADIO_STYLE;
if((e||o)&&this._itemChecked!=s){
this._itemChecked=s;
if(this._checkEl){
this._checkEl.innerHTML="";
var a=s?(e?"MenuCheck":"MenuRadio"):"Blank_9";
AjxImg.setImage(this._checkEl,a);
if(s){
if(o){
this.parent._radioItemSelected(this,t)
}}}}};
DwtMenuItem.prototype._checkItemAdded=function(e){};
DwtMenuItem.prototype._checkedItemsRemoved=function(){};
DwtMenuItem.prototype._submenuItemAdded=function(){
if(this._style&DwtMenuItem.SEPARATOR_STYLE){
return
}
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._dropDownEl){
this._dropDownEl.innerHTML=""
}};
DwtMenuItem.prototype._popupMenu=function(n,m){
var e=this.getMenu();
var t=this.parent.parent;
var d=this.getBounds();
var r=e.shell.getSize();
var f=e.getSize();
var u;
var h;
var o;
var c;
var a=t.getHtmlElement();
if(t._style==DwtMenu.BAR_STYLE){
o=(a.style.borderLeftWidth=="")?0:parseInt(a.style.borderLeftWidth);
u=d.x+o;
c=(a.style.borderTopWidth=="")?0:parseInt(a.style.borderTopWidth);
c+=(a.style.borderBottomWidth=="")?0:parseInt(a.style.borderBottonWidth);
h=d.y+d.height+c;
u=((u+f.x)>=r.x)?u-(u+f.x-r.x):u
}else{
o=(a.style.borderLeftWidth=="")?0:parseInt(a.style.borderLeftWidth);
o+=(a.style.borderRightWidth=="")?0:parseInt(a.style.borderRightWidth);
u=d.x+d.width+o;
c=(a.style.borderTopWidth=="")?0:parseInt(a.style.borderTopWidth);
h=d.y+c;
u=((u+f.x)>=r.x)?d.x-f.x-o:u
}
e.popup(n,u,h,m)
};
DwtMenuItem.prototype._popdownMenu=function(){
var e=this.getMenu();
if(e){
e.popdown()
}};
DwtMenuItem.prototype._isMenuPoppedUp=function(){
var e=this.getMenu();
return(e&&e.isPoppedUp())
};
DwtMenuItem.prototype.__handleItemSelect=function(e){
this.setDisplayState(DwtControl.NORMAL);
if(this.isStyle(DwtMenuItem.CHECK_STYLE)){
this._setChecked(!this._itemChecked,null,true);
e.detail=this.getChecked()?DwtMenuItem.CHECKED:DwtMenuItem.UNCHECKED
}else{
if(this.isStyle(DwtMenuItem.RADIO_STYLE)){
this._setChecked(true,true);
this.parent._radioItemSelected(this,true);
e.detail=this.getChecked()?DwtMenuItem.CHECKED:DwtMenuItem.UNCHECKED
}else{
if(this.isStyle(DwtMenuItem.PUSH_STYLE)){
if(this._menu){
if(this._isMenuPoppedUp()){
DwtMenu.closeActiveMenu()
}else{
this._popupMenu()
}}
return
}}}
if(!this.isStyle(DwtMenuItem.CASCADE_STYLE)){
if(!this._menu||!this._menu.isPoppedUp||!this._menu.isPoppedUp()){
DwtMenu.closeActiveMenu()
}}};
DwtMenuItem._mouseOverListener=function(a){
var e=a.dwtObj;
if(!e){
return false
}
var o=e.parent;
if(o._hoveredItem){
var t=new DwtMouseEvent();
t.dwtObj=o._hoveredItem;
DwtButton._mouseOutListener(t)
}
if(e._style&DwtMenuItem.SEPARATOR_STYLE){
return false
}
DwtButton._mouseOverListener(a,e);
o._hoveredItem=e;
o._popdownSubmenus();
if(e._menu&&!a.ersatz){
e._popupMenu(e._hoverDelay)
}};
DwtMenuItem._mouseOutListener=function(a){
var t=a.dwtObj;
var e=t&&t.getMenu();
if(e&&e.isPoppedUp()){
return
}
DwtButton._mouseOutListener(a);
if(t){
t.parent._hoveredItem=null
}};
DwtMenuItem._listeners={};
DwtMenuItem._listeners[DwtEvent.ONMOUSEOVER]=new AjxListener(null,DwtMenuItem._mouseOverListener);
DwtMenuItem._listeners[DwtEvent.ONMOUSEOUT]=new AjxListener(null,DwtMenuItem._mouseOutListener);
DwtMenuItem._listeners[DwtEvent.ONMOUSEDOWN]=new AjxListener(null,DwtButton._mouseDownListener);
DwtMenuItem._listeners[DwtEvent.ONMOUSEUP]=new AjxListener(null,DwtButton._mouseUpListener);
DwtMenuItem._listeners[DwtEvent.ONMOUSEENTER]=new AjxListener(null,DwtMenuItem._mouseOverListener);
DwtMenuItem._listeners[DwtEvent.ONMOUSELEAVE]=new AjxListener(null,DwtButton._mouseOutListener)
}
if(AjxPackage.define("ajax.dwt.widgets.DwtMenu")){
DwtMenu=function(n){
if(arguments.length==0){
return
}
n=Dwt.getParams(arguments,DwtMenu.PARAMS);
this._origStyle=n.style;
var a=n.parent;
if(a){
if(a instanceof DwtMenuItem||a instanceof DwtButton){
if(n.style==DwtMenu.GENERIC_WIDGET_STYLE){
this._style=n.style
}else{
this._style=DwtMenu.DROPDOWN_STYLE
}}else{
this._style=n.style||DwtMenu.POPUP_STYLE
}
if(!n.posStyle){
n.posStyle=(this._style==DwtMenu.BAR_STYLE)?DwtControl.STATIC_STYLE:DwtControl.ABSOLUTE_STYLE
}}
n.className=n.className||"DwtMenu";
this._cascade=n.cascade==null||n.cascade;
n.parent=(a instanceof DwtShell)?a:a.shell;
DwtComposite.call(this,n);
this.parent=a;
var e=(this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE);
if(e&&!this._cascade){
this.setScrollStyle(DwtControl.SCROLL)
}
if(!a){
return
}
var t=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
this._setEventHdlrs(t);
this._hasSetMouseEvents=true;
var o=this.getHtmlElement();
if(n.posStyle!=DwtControl.STATIC_STYLE){
Dwt.setLocation(o,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;
this._table.className="DwtMenuTable";
o.appendChild(this._table);
this._table.backgroundColor=DwtCssStyle.getProperty(o,"background-color")
}
if(n.style!=DwtMenu.BAR_STYLE){
this.setZIndex(Dwt.Z_HIDDEN);
this._isPoppedUp=false
}else{
DwtMenu._activeMenuIds.add(o.id,null,true);
this._isPoppedUp=true
}
this._popdownAction=new AjxTimedAction(this,this._doPopdown);
this._popdownActionId=-1;
this._popupAction=new AjxTimedAction(this,this._doPopup);
this._popupActionId=-1;
if(AjxEnv.isIE){
if((this.parent instanceof DwtMenuItem&&this.parent.parent._style==DwtMenu.BAR_STYLE)||!(this.parent instanceof DwtMenuItem)){
this._outsideListener=new AjxListener(null,DwtMenu._outsideMouseDownListener)
}}
this._menuItemsHaveChecks=false;
this._menuItemsHaveIcons=false;
this._menuItemsWithSubmenus=0;
this.__currentItem=null;
this.__preventMenuFocus=false;
this._menuCapObj=new DwtMouseEventCapture({
targetObj:this,id:"DwtMenu",mouseDownHdlr:DwtMenu._capMouseDownHdlr,mouseWheelHdlr:DwtMenu._capMouseWheelHdlr,hardCapture:false}
);
this._tabGroup=new DwtTabGroup(this.toString(),true);
this._tabGroup.addMember(this)
};
DwtMenu.PARAMS=["parent","style","className","posStyle","cascade"];
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.HAS_ICON="ZHasIcon";
DwtMenu.HAS_CHECK="ZHasCheck";
DwtMenu.HAS_SUBMENU="ZHasSubMenu";
DwtMenu._activeMenuUp=false;
DwtMenu._activeMenuIds=new AjxVector();
DwtMenu._activeMenus=new AjxVector();
DwtMenu.prototype.dispose=function(){
this._table=null;
DwtComposite.prototype.dispose.call(this);
if(!(this.parent instanceof DwtShell)){
this.shell.removeChild(this)
}};
DwtMenu.prototype.addPopupListener=function(e){
this.addListener(DwtEvent.POPUP,e)
};
DwtMenu.prototype.removePopupListener=function(e){
this.removeListener(DwtEvent.POPUP,e)
};
DwtMenu.prototype.addPopdownListener=function(e){
this.addListener(DwtEvent.POPDOWN,e)
};
DwtMenu.prototype.removePopdownListener=function(e){
this.removeListener(DwtEvent.POPDOWN,e)
};
DwtMenu.prototype.getItem=function(e){
return this._children.get(e)
};
DwtMenu.prototype.getItemById=function(a,n){
var e=this.getItems();
for(var t=0;
t<e.length;
t++){
var o=e[t].getData(a);
if(o==n){
return e[t]
}}
return null
};
DwtMenu.prototype.getItemCount=function(){
return this._children.size()
};
DwtMenu.prototype.getItems=function(){
return this._children.getArray()
};
DwtMenu.prototype.getSelectedItem=function(n){
var e=this._children.getArray();
for(var o=0;
o<e.length;
o++){
var t=e[o];
if((n==null||(t._style&&n!=0))&&t.getChecked()){
return t
}}
return null
};
DwtMenu.prototype.isPoppedUp=function(){
return this._isPoppedUp
};
DwtMenu.prototype.popup=function(a,e,o,t){
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&&a&&a>0)){
return
}else{
if(this._popupActionId!=-1){
AjxTimedAction.cancelAction(this._popupActionId);
this._popupActionId=-1
}}
if(!a){
this._doPopup(e,o,t)
}else{
this._popupAction.args=[e,o,t];
this._popupActionId=AjxTimedAction.scheduleAction(this._popupAction,a)
}}};
DwtMenu.prototype.popdown=function(e){
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(e==null||e==0){
this._doPopdown()
}else{
this._popdownActionId=AjxTimedAction.scheduleAction(this._popdownAction,e)
}}};
DwtMenu.prototype.render=function(m,d){
var p=this.shell.getSize();
var q=this.getSize();
p.y-=10+(AjxEnv.isIE?20:0);
p.x-=28;
var t=(this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE);
var w=this._cascade;
if(t&&w){
var z=p.y;
var T=null;
var u=this._table.rows;
var a=u.length;
var g=q.y;
var c=z-25;
for(var k=a-1;
k>=0;
k--){
g-=Dwt.getSize(u[k]).y;
if(g<c){
break
}}
var h=k+1;
for(var v=h;
v<a;
v++){
var r=u[(v-h)%h];
var e=r.insertCell(-1);
e.className="DwtMenuCascadeCell";
var s=u[v].cells[0].firstChild;
while(s!=null){
e.appendChild(s);
s=s.nextSibling
}}
for(v=u.length-1;
v>=h;
v--){
this._table.deleteRow(h)
}
var n=a%h;
if(n>0){
for(var v=n;
v<h;
v++){
var r=u[v];
var e=r.insertCell(-1);
e.className="DwtMenuCascadeCell";
e.empty=true;
e.innerHTML="&nbsp;"
}}
q=this.getSize();
if(T){
d=T-q.y
}}else{
if(t&&!w){
if(d+q.y>p.y){
q.y=p.y-d
}}}
var O=m+q.x>=p.x?p.x-q.x:m;
var T=t&&d+q.y>=p.y?p.y-q.y:d;
this.setLocation(O,T);
var A="auto";
var o=(t&&w)||d+q.y<p.y-5?"auto":p.y-d-5;
this.setSize(A,o);
if((AjxEnv.isGeckoBased||AjxEnv.isSafari||(this._origStyle==DwtMenu.CALENDAR_PICKER_STYLE))&&this._table){
var f=this.getHtmlElement();
f.style.width=(q.x+(t&&!w?10:0))+"px"
}};
DwtMenu.prototype.getKeyMapName=function(){
return"DwtMenu"
};
DwtMenu.prototype.handleKeyAction=function(e,t){
switch(this._style){
case DwtMenu.BAR_STYLE:case DwtMenu.POPUP_STYLE:case DwtMenu.DROPDOWN_STYLE:break;
default:return false
}
switch(e){
case DwtKeyMap.SELECT_NEXT:case DwtKeyMap.SELECT_PREV:this.setSelectedItem(e==DwtKeyMap.SELECT_NEXT);
break;
case DwtKeyMap.SELECT:if(this.__currentItem){
this.__currentItem._emulateSingleClick()
}
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:if(this.__currentItem){
var a=new DwtMouseEvent();
this._setMouseEvent(a,{
dwtObj:this.__currentItem}
);
this.notifyListeners(DwtEvent.ONMOUSEOUT,a);
this.__currentItem=null
}
this.popdown(0);
break;
default:return false
}
return true
};
DwtMenu.prototype._focus=function(){};
DwtMenu.prototype._blur=function(){};
DwtMenu.prototype.setAssociatedObj=function(e){
this._associatedObj=e
};
DwtMenu.prototype.setAssociatedElementId=function(e){
this._associatedElId=e
};
DwtMenu.prototype.checkItem=function(s,n,a){
var e=this._children.getArray();
for(var t=0;
t<e.length;
t++){
var o=e[t];
if(!(o.isStyle(DwtMenuItem.CHECK_STYLE)||o.isStyle(DwtMenuItem.RADIO_STYLE))){
continue
}
var r=o.getData(s);
if(r==n){
o.setChecked(true,a)
}}};
DwtMenu.prototype.setSelectedItem=function(t){
var e=this.__currentItem;
if(typeof(t)=="boolean"){
e=!e?this._children.get(0):t?this._children.getNext(e):this._children.getPrev(e)
}else{
e=this._children.get(t)
}
while(e&&(e.isStyle(DwtMenuItem.SEPARATOR_STYLE)||!e.getEnabled()||!e.getVisible())){
e=(t===false)?this._children.getPrev(e):this._children.getNext(e)
}
if(!e){
return
}
var a=new DwtMouseEvent();
if(this.__currentItem){
this._setMouseEvent(a,{
dwtObj:this.__currentItem}
);
this.__currentItem.notifyListeners(DwtEvent.ONMOUSEOUT,a)
}
this._setMouseEvent(a,{
dwtObj:e}
);
e.notifyListeners(DwtEvent.ONMOUSEOVER,a);
this.__currentItem=e
};
DwtMenu.prototype.clearExternallySelectedItems=function(){
if(this._externallySelected!=null){
this._externallySelected._deselect();
this._externallySelected=null
}};
DwtMenu.prototype.removeChild=function(a){
if(this._table){
if(this._style==DwtMenu.BAR_STYLE){
var e=a.getHtmlElement().parentNode;
this._table.rows[0].deleteCell(Dwt.getCellIndex(e))
}else{
var t=a.getHtmlElement();
if(t){
this._table.deleteRow(t.parentNode.parentNode.rowIndex)
}}}
this._children.remove(a)
};
DwtMenu.prototype.addChild=function(e){
DwtComposite.prototype.addChild.apply(this,arguments);
if(Dwt.instanceOf(e,"DwtColorPicker")||Dwt.instanceOf(e,"DwtCalendar")||(this._style==DwtMenu.GENERIC_WIDGET_STYLE)){
this._addItem(e)
}};
DwtMenu.prototype._addItem=function(o,t){
if(this._style==DwtMenu.COLOR_PICKER_STYLE||this._style==DwtMenu.CALENDAR_PICKER_STYLE||this._style==DwtMenu.GENERIC_WIDGET_STYLE){
return
}
var s;
var e;
if(this._style==DwtMenu.BAR_STYLE){
var n=this._table.rows;
s=(n.length!=0)?n[0]:this._table.insertRow(0);
if(t==null||t>s.cells.length){
t=n.cells.length
}
e=s.insertCell(t);
e.align="center";
e.vAlign="middle";
var a=s.insertCell(-1);
a.nowrap=true;
a.width="7px"
}else{
if(o.isStyle&&(o.isStyle(DwtMenuItem.CHECK_STYLE)||o.isStyle(DwtMenuItem.RADIO_STYLE))){
this._checkItemAdded()
}
if(t==null||t>this._table.rows.length){
t=-1
}
s=this._table.insertRow(t);
e=s.insertCell(0)
}
e.noWrap=true;
e.appendChild(o.getHtmlElement())
};
DwtMenu.prototype._radioItemSelected=function(r,n){
var t=r._radioGroupId;
var s=this._children.size();
var e=this._children.getArray();
for(var o=0;
o<s;
o++){
if(e[o]!=r&&e[o].isStyle(DwtMenuItem.RADIO_STYLE)&&e[o]._radioGroupId==t&&e[o]._itemChecked){
e[o].setChecked(false,n);
break
}}};
DwtMenu.prototype._menuHasCheckedItems=function(){
return this._menuItemsHaveChecks
};
DwtMenu.prototype._menuHasItemsWithIcons=function(){
return this._menuItemsHaveIcons
};
DwtMenu.prototype._menuHasSubmenus=function(){
return(this._menuItemsWithSubmenus>0)
};
DwtMenu.prototype._iconItemAdded=function(e){
if(!this._menuItemsHaveIcons){
Dwt.addClass(this.getHtmlElement(),DwtMenu.HAS_ICON)
}
this._menuItemsHaveIcons=true
};
DwtMenu.prototype._checkItemAdded=function(e){
if(!this._menuItemsHaveChecks){
Dwt.addClass(this.getHtmlElement(),DwtMenu.HAS_CHECK)
}
this._menuItemsHaveChecks=true
};
DwtMenu.prototype._submenuItemAdded=function(){
Dwt.addClass(this.getHtmlElement(),DwtMenu.HAS_SUBMENU);
this._menuItemsWithSubmenus++
};
DwtMenu.prototype._submenuItemRemoved=function(){
if(this._menuItemsWithSubmenus==1){
var o=this._children.size();
var e=this._children.getArray();
for(var t=0;
t<o;
t++){
e[t]._submenuItemRemoved()
}}
this._menuItemsWithSubmenus--;
if(this._menuItemsWithSubmenus==0){
Dwt.delClass(this.getHtmlElement(),DwtMenu.HAS_SUBMENU)
}};
DwtMenu.prototype._popdownSubmenus=function(){
var o=this._children.size();
var e=this._children.getArray();
for(var t=0;
t<o;
t++){
e[t]._popdownMenu()
}};
DwtMenu.prototype.dontStealFocus=function(e){
if(e==null){
e=true
}
this.__preventMenuFocus=!!e
};
DwtMenu.prototype._doPopup=function(e,r,n){
this.render(e,r);
var t=(this._style==DwtMenu.POPUP_STYLE||this._style==DwtMenu.DROPDOWN_STYLE);
var a=this._cascade;
this.setScrollStyle(t&&a?Dwt.CLIP:Dwt.SCROLL);
this.notifyListeners(DwtEvent.POPUP,this);
var o=this.shell.getToolTip();
if(o){
o.popdown()
}
var s=DwtBaseDialog.getActiveDialog()?Dwt.Z_DIALOG_MENU:Dwt.Z_MENU;
this.setZIndex(s);
this._popupActionId=-1;
this._isPoppedUp=true;
if(AjxEnv.isIE&&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;
if(AjxEnv.isIE){
DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,DwtMenu._outsideMouseDownListener);
DwtEventManager.addListener(DwtEvent.ONMOUSEWHEEL,DwtMenu._outsideMouseDownListener)
}}
DwtMenu._activeMenuIds.add(this._htmlElId,null,true);
DwtMenu._activeMenuIds.sort();
DwtMenu._activeMenus.add(this,null,true);
if(!this._menuCapObj.capturing()){
this._menuCapObj.capture();
this._capturing=true
}else{
this._capturing=false
}
if(!this.__preventMenuFocus){
DwtShell.getShell(window).getKeyboardMgr().pushTabGroup(this._tabGroup)
}
if(n){
this.handleKeyAction(DwtKeyMap.SELECT_NEXT)
}};
DwtMenu.prototype.getSize=function(e){
if(this._table){
return Dwt.getSize(this._table,e)
}
return DwtComposite.prototype.getSize.call(this,e)
};
DwtMenu.prototype._doPopdown=function(){
var c=this._children.getArray();
var m=this._children.size();
for(var n=0;
n<m;
n++){
if((c[n] instanceof DwtMenuItem)&&!(c[n].isStyle(DwtMenuItem.SEPARATOR_STYLE))){
c[n]._popdownMenu()
}}
this.setZIndex(Dwt.Z_HIDDEN);
this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this.notifyListeners(DwtEvent.POPDOWN,this);
if(AjxEnv.isIE&&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;
if(AjxEnv.isIE){
DwtEventManager.removeListener(DwtEvent.ONMOUSEDOWN,DwtMenu._outsideMouseDownListener);
DwtEventManager.removeListener(DwtEvent.ONMOUSEWHEEL,DwtMenu._outsideMouseDownListener)
}}
DwtMenu._activeMenuIds.remove(this._htmlElId);
DwtMenu._activeMenus.remove(this);
this._popdownActionId=-1;
this._isPoppedUp=false;
if(this._capturing&&(DwtMouseEventCapture.getId()=="DwtMenu")){
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 t=this._table.rows[0].cells.length;
var r=this._table.rows.length;
for(var n=1;
n<t;
n++){
for(var o=0;
o<r;
o++){
var d=this._table.rows[o].cells[n];
if(!d.empty){
var e=d.firstChild;
var u=this._table.insertRow(this._table.rows.length);
var d=u.insertCell(0);
while(e!=null){
d.appendChild(e);
e=e.nextSibling
}}}}
for(var o=0;
o<r;
o++){
var u=this._table.rows[o];
for(var n=u.cells.length-1;
n>0;
n--){
u.deleteCell(n)
}}}
this.__currentItem=null;
if(this._hoveredItem){
var h=new DwtMouseEvent();
h.dwtObj=this._hoveredItem;
DwtButton._mouseOutListener(h)
}
DwtShell.getShell(window).getKeyboardMgr().popTabGroup(this._tabGroup)
};
DwtMenu.prototype._getActiveItem=function(){
var e=this._children.getArray();
var o=this._children.size();
for(var t=0;
t<o;
t++){
if(e[t]._isMenuPoppedUp()){
return e[t]
}}
return null
};
DwtMenu._outsideMouseDownListener=function(a){
if(DwtMenu._activeMenuUp){
var n=DwtMenu._activeMenu;
var e=DwtControl.getTargetControl(a);
if(n._associatedObj&&n._associatedObj==e){
return false
}
var s=n._htmlElId;
var o=DwtUiEvent.getTarget(a);
while(o!=null){
if(o.id&&o.id!=""&&(o.id==s||o.id==n._associatedElId||DwtMenu._activeMenuIds.binarySearch(o.id)!=-1)){
return false
}
o=o.parentNode
}
n.popdown();
var t=null;
do{
t=DwtMenu._activeMenus.getLast();
if(t!=null&&t instanceof DwtMenu){
t.popdown()
}}
while(t!=null)
}
a._stopPropagation=false;
a._returnValue=true;
return true
};
DwtMenu._capMouseDownHdlr=function(t){
var a=DwtMouseEventCapture.getTargetObj();
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
DwtMenu._outsideMouseDownListener(e);
DwtUiEvent.setBehaviour(t,false,true);
return true
};
DwtMenu._capMouseWheelHdlr=function(e){
return DwtMenu._capMouseDownHdlr(e)
};
DwtMenu.menuShowing=function(){
return DwtMenu._activeMenuUp
};
DwtMenu.closeActiveMenu=function(){
if(DwtMenu._activeMenuUp){
DwtMenu._activeMenu.popdown()
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtMessageDialog")){
DwtMessageDialog=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtMessageDialog.PARAMS);
this._msgCellId=Dwt.getNextId();
e.standardButtons=e.buttons||[DwtDialog.OK_BUTTON];
DwtDialog.call(this,e);
this.setContent(this._contentHtml());
this._msgCell=document.getElementById(this._msgCellId);
this.addEnterListener(new AjxListener(this,this._enterListener))
};
DwtMessageDialog.PARAMS=["parent","className","buttons","extraButtons"];
DwtMessageDialog.prototype=new DwtDialog;
DwtMessageDialog.prototype.constructor=DwtMessageDialog;
DwtMessageDialog.CRITICAL_STYLE=1;
DwtMessageDialog.INFO_STYLE=2;
DwtMessageDialog.WARNING_STYLE=3;
DwtMessageDialog.TITLE={};
DwtMessageDialog.TITLE[DwtMessageDialog.CRITICAL_STYLE]=AjxMsg.criticalMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.INFO_STYLE]=AjxMsg.infoMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.WARNING_STYLE]=AjxMsg.warningMsg;
DwtMessageDialog.ICON={};
DwtMessageDialog.ICON[DwtMessageDialog.CRITICAL_STYLE]="Critical_32";
DwtMessageDialog.ICON[DwtMessageDialog.INFO_STYLE]="Information_32";
DwtMessageDialog.ICON[DwtMessageDialog.WARNING_STYLE]="Warning_32";
DwtMessageDialog.prototype.toString=function(){
return"DwtMessageDialog"
};
DwtMessageDialog.prototype.setMessage=function(a,o,n){
o=o||DwtMessageDialog.INFO_STYLE;
n=n||DwtMessageDialog.TITLE[o];
this.setTitle(n);
if(a){
var t=[];
var e=0;
t[e++]="<table cellspacing=0 cellpadding=0 border=0><tr><td valign='top'>";
t[e++]=AjxImg.getImageHtml(DwtMessageDialog.ICON[o]);
t[e++]="</td><td class='DwtMsgArea'>";
t[e++]=a;
t[e++]="</td></tr></table>";
this._msgCell.innerHTML=t.join("")
}else{
this._msgCell.innerHTML=""
}};
DwtMessageDialog.prototype.setSize=function(t,e){
var a=document.getElementById(this._msgCellId);
if(a&&(t||e)){
Dwt.setSize(a,t,e)
}};
DwtMessageDialog.prototype.reset=function(){
this._msgCell.innerHTML="";
DwtDialog.prototype.reset.call(this)
};
DwtMessageDialog.prototype.handleKeyAction=function(e,t){
if((e==DwtKeyMap.CANCEL)&&!this._button[DwtDialog.CANCEL_BUTTON]){
e=DwtKeyMap.ENTER
}
switch(e){
case DwtKeyMap.CANCEL:this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
break;
default:DwtDialog.prototype.handleKeyAction.call(this,e,t);
break
}
return true
};
DwtMessageDialog.prototype._contentHtml=function(){
return"<div id='"+this._msgCellId+"' class='DwtMsgDialog'></div>"
};
DwtMessageDialog.prototype._enterListener=function(e){
this._runEnterCallback()
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtHtmlEditor")){
DwtHtmlEditor=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtHtmlEditor.PARAMS);
this.setBlankIframeSrc(e.blankIframeSrc);
e.className=e.className||"DwtHtmlEditor";
DwtComposite.call(this,e);
this._mode=(e.mode==DwtHtmlEditor.HTML&&this.isHtmlEditingSupported())?e.mode:DwtHtmlEditor.TEXT;
this.__eventClosure=AjxCallback.simpleClosure(this.__eventClosure,this);
this._pendingContent=e.content||"";
this._htmlModeInited=false;
this._initialize()
};
DwtHtmlEditor.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
DwtHtmlEditor.prototype=new DwtComposite();
DwtHtmlEditor.prototype.constructor=DwtHtmlEditor;
DwtHtmlEditor.HTML="text/html";
DwtHtmlEditor.TEXT="text/plain";
DwtHtmlEditor.H1=1;
DwtHtmlEditor.H2=2;
DwtHtmlEditor.H3=3;
DwtHtmlEditor.H4=4;
DwtHtmlEditor.H5=5;
DwtHtmlEditor.H6=6;
DwtHtmlEditor.PARAGRAPH=7;
DwtHtmlEditor.ADDRESS=8;
DwtHtmlEditor.PREFORMATTED=9;
DwtHtmlEditor._STYLES=["","<h1>","<h2>","<h3>","<h4>","<h5>","<h6>","<p>","<address>","<pre>"];
DwtHtmlEditor.BOLD_STYLE="bold";
DwtHtmlEditor.ITALIC_STYLE="italic";
DwtHtmlEditor.UNDERLINE_STYLE="underline";
DwtHtmlEditor.STRIKETHRU_STYLE="strikethrough";
DwtHtmlEditor.SUBSCRIPT_STYLE="subscript";
DwtHtmlEditor.SUPERSCRIPT_STYLE="superscript";
DwtHtmlEditor.JUSTIFY_LEFT="justifyleft";
DwtHtmlEditor.JUSTIFY_CENTER="justifycenter";
DwtHtmlEditor.JUSTIFY_RIGHT="justifyright";
DwtHtmlEditor.JUSTIFY_FULL="justifyfull";
DwtHtmlEditor.OUTDENT="outdent";
DwtHtmlEditor.INDENT="indent";
DwtHtmlEditor.HORIZ_RULE="inserthorizontalrule";
DwtHtmlEditor.ORDERED_LIST="insertorderedlist";
DwtHtmlEditor.UNORDERED_LIST="insertunorderedlist";
DwtHtmlEditor.IMAGE="insertimage";
DwtHtmlEditor.BORDER_TOP=0;
DwtHtmlEditor.BORDER_MIDDLE=1;
DwtHtmlEditor.BORDER_BOTTOM=2;
DwtHtmlEditor.BORDER_LEFT=3;
DwtHtmlEditor.BORDER_CENTER=4;
DwtHtmlEditor.BORDER_RIGHT=5;
DwtHtmlEditor._H1_RE=/Heading 1|h1/;
DwtHtmlEditor._H2_RE=/Heading 2|h2/;
DwtHtmlEditor._H3_RE=/Heading 2|h3/;
DwtHtmlEditor._H4_RE=/Heading 2|h4/;
DwtHtmlEditor._H5_RE=/Heading 2|h5/;
DwtHtmlEditor._H6_RE=/Heading 2|h6/;
DwtHtmlEditor._PARAGRAPH_RE=/Normal|p/;
DwtHtmlEditor._ADDRESS_RE=/Address|address/;
DwtHtmlEditor._PREFORMATTED_RE=/Formatted|pre/;
DwtHtmlEditor._FONT_NAME="fontname";
DwtHtmlEditor._FONT_SIZE="fontsize";
DwtHtmlEditor._FONT_COLOR="forecolor";
DwtHtmlEditor._FONT_HILITE="hilitecolor";
DwtHtmlEditor._FONT_HILITE_IE="backcolor";
DwtHtmlEditor._FORMAT_BLOCK="formatblock";
DwtHtmlEditor._INITDELAY=50;
DwtHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
DwtHtmlEditor._BLOCK_ELEMENTS={
address:1,body:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,iframe:1,li:1,ol:1,p:1,pre:1,quote:1,table:1,tbody:1,td:1,textarea:1,tfoot:1,thead:1,tr:1,ul:1};
DwtHtmlEditor._ACTION_CODE_TO_CMD={};
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_BOLD]=DwtHtmlEditor.BOLD_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_ITALIC]=DwtHtmlEditor.ITALIC_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_UNDERLINE]=DwtHtmlEditor.UNDERLINE_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_STRIKETHRU]=DwtHtmlEditor.STRIKETHRU_STYLE;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_LEFT]=DwtHtmlEditor.JUSTIFY_LEFT;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_CENTER]=DwtHtmlEditor.JUSTIFY_CENTER;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_RIGHT]=DwtHtmlEditor.JUSTIFY_RIGHT;
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER1]=DwtHtmlEditor._STYLES[1];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER2]=DwtHtmlEditor._STYLES[2];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER3]=DwtHtmlEditor._STYLES[3];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER4]=DwtHtmlEditor._STYLES[4];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER5]=DwtHtmlEditor._STYLES[5];
DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER6]=DwtHtmlEditor._STYLES[6];
DwtHtmlEditor.INIT_HTML=["<html><head><title>ZWC</title></head><body><p>",AjxEnv.isGeckoBased?"<br type='_moz' />":"","</p></body></html>"].join("");
DwtHtmlEditor.prototype.focus=function(){
if(!AjxEnv.isIE&&this._mode==DwtHtmlEditor.TEXT){
document.getElementById(this._textAreaId).focus()
}else{
try{
if(!this._htmlModeInited){
setTimeout(AjxCallback.simpleClosure(this.focus,this),DwtHtmlEditor._INITDELAY);
return
}
this._getIframeWin().focus();
if(AjxEnv.isIE){
if(this._currInsPt){
if(this._currInsPt.text.length<=1){
this._currInsPt.collapse(false)
}
this._currInsPt.select()
}}}
catch(e){}}};
DwtHtmlEditor.prototype.moveCaretToTop=function(){
if(this._mode==DwtHtmlEditor.TEXT){
var t=document.getElementById(this._textAreaId);
if(t.createTextRange){
var e=t.createTextRange();
e.collapse(true);
e.select()
}else{
if(t.setSelectionRange){
t.setSelectionRange(0,0)
}}}else{
this._moveCaretToTopHtml(true)
}};
DwtHtmlEditor.prototype._moveCaretToTopHtml=function(t){
var e=this._getIframeDoc().body;
var n=false;
if(AjxEnv.isIE){
if(e){
e.createTextRange().collapse(true);
n=true
}}else{
var a=this._getSelection();
if(a){
a.collapse(e,0);
n=true
}}
if(!n&&t){
var o=new AjxTimedAction(this,this._moveCaretToTopHtml);
AjxTimedAction.scheduleAction(o,DwtHtmlEditor._INITDELAY+1)
}};
DwtHtmlEditor.prototype.addStateChangeListener=function(e){
this.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtHtmlEditor.prototype.removeStateChangeListener=function(e){
this.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtHtmlEditor.prototype.clear=function(){
this.setContent("")
};
DwtHtmlEditor.prototype.enable=function(e){
if(this._textAreaId!=null){
document.getElementById(this._textAreaId).disabled=!e
}
if(this._iFrameId!=null){
document.getElementById(this._iFrameId).disabled=!e
}};
DwtHtmlEditor.prototype.setBlankIframeSrc=function(e){
this._blankIframeSrc=e
};
DwtHtmlEditor.prototype.isHtmlEditingSupported=function(){
return(!!(AjxEnv.isGeckoBased||AjxEnv.isIE||AjxEnv.isSafari3up))
};
DwtHtmlEditor.prototype.getContent=function(){
if(this._mode==DwtHtmlEditor.HTML){
var a=this._getIframeDoc();
var e=a&&a.body?(this._getIframeDoc().body.innerHTML):"";
return this._embedHtmlContent(e)
}else{
var t=document.getElementById(this._textAreaId);
return t&&t.value
}};
DwtHtmlEditor.prototype._embedHtmlContent=function(e){
return["<html><body>",e,"</body></html>"].join("")
};
DwtHtmlEditor.prototype.setContent=function(e){
if(AjxEnv.isIE){
this._currInsPt=null
}
if(this._mode==DwtHtmlEditor.HTML){
this._pendingContent=e||"";
if(this._htmlModeInited){
this._setContentOnTimer()
}}else{
document.getElementById(this._textAreaId).value=(e||"")
}};
DwtHtmlEditor.prototype.insertElement=function(e){
this._execCommand(e)
};
DwtHtmlEditor.prototype.insertText=function(a,e){
var t=this._getIframeDoc().createTextNode(a);
this._insertNodeAtSelection(t,e)
};
DwtHtmlEditor.prototype.insertImage=function(s,r,a,e){
if(r){
var o=this._getIframeDoc();
var t=o.createElement("img");
t.src=s;
if(a){
t.width=a
}else{
t.removeAttribute("width")
}
if(e){
t.height=e
}else{
t.removeAttribute("height")
}
var n=o.createDocumentFragment();
n.appendChild(t);
this._insertNodeAtSelection(n)
}else{
this._execCommand(DwtHtmlEditor.IMAGE,s)
}};
DwtHtmlEditor.prototype.insertTable=function(w,m,a,t,h,u){
if(this._mode!=DwtHtmlEditor.HTML){
return
}
var g=this._getIframeDoc();
var y=g.createElement("table");
y.style.borderRight="1px solid #000";
y.style.borderLeft="1px solid #000";
y.style.borderTop="1px solid #000";
y.style.borderBottom="1px solid #000";
if(a!=null){
y.style.width=a
}else{
y.style.width="100%"
}
y.style.textAlign="left";
y.style.verticalAlign="middle";
if(u!=null){
y.align=u.toLowerCase()
}
if(t!=null){
y.cellSpacing=t
}else{
y.cellSpacing=0
}
if(h!=null){
y.cellPadding=h
}else{
y.cellPadding=0
}
if(!AjxEnv.isIE){
y.style.border="1px solid #000"
}
y.style.borderCollapse="collapse";
var c;
c=Math.floor(100/m)+"%";
var r=g.createElement("tbody");
y.appendChild(r);
for(var s=0;
s<w;
s++){
var d=g.createElement("tr");
r.appendChild(d);
for(var n=0;
n<m;
n++){
var o=g.createElement("td");
if(s==0&&c){
o.style.width=c
}
if(AjxEnv.isGeckoBased){
o.appendChild(g.createElement("br"))
}else{
if(AjxEnv.isIE){
o.innerHTML="&nbsp;"
}}
if(AjxEnv.isIE){
o.style.border="1px solid #000"
}else{
o.style.borderTop=o.style.borderLeft="1px solid #000"
}
d.appendChild(o)
}}
var e=g.createElement("br");
var f=g.createDocumentFragment();
f.appendChild(e);
f.appendChild(y);
f.appendChild(e.cloneNode(true));
this._insertNodeAtSelection(f);
this.selectNodeContents(y.rows[0].cells[0],true);
return y
};
DwtHtmlEditor.prototype.applyTableProperties=function(d,h){
var c=this._getIframeDoc();
var r=[];
for(var s in h){
var e=AjxStringUtil.trim(h[s].toString());
var t=e!="";
switch(s){
case"caption":var u=d.getElementsByTagName("caption");
u=u.length>0?u[0]:null;
if(t&&!u){
u=c.createElement("caption");
d.insertBefore(u,d.firstChild)
}
if(!t&&u){
u.parentNode.removeChild(u)
}
if(u){
u.innerHTML=e
}
break;
case"summary":case"align":case"cellSpacing":case"cellPadding":if(!t){
d.removeAttribute(s,0)
}else{
d[s]=e
}
break;
case"borderWidth":case"borderStyle":case"borderColor":d.style[s]=e;
r.push([s,e]);
break;
default:d.style[s]=e;
break
}}
if(r.length>0){
var n=d.getElementsByTagName("td");
for(var s=n.length;
--s>=0;
){
var a=n[s];
for(var o=r.length;
--o>=0;
){
a.style[r[o][0]]=r[o][1]
}}}
if(AjxEnv.isGeckoBased){
this._forceRedraw()
}};
DwtHtmlEditor.prototype.applyCellProperties=function(u,m,s){
var r=true;
for(var a=m.length;
--a>=0;
){
var f=m[a];
var n=(a==0);
var d=true;
for(var t=f.length;
--t>=0;
){
var c=(t==0);
var e=f[t];
if(s.backgroundColor!=null){
e.style.backgroundColor=s.backgroundColor
}
if(s.color!=null){
e.style.color=s.color
}
if(s.textAlign!=null){
e.style.textAlign=s.textAlign
}
if(s.verticalAlign!=null){
e.style.verticalAlign=s.verticalAlign
}
if(s.width!=null){
if(s.width){
e.style.width=s.width+"px"
}else{
e.style.width=""
}}
if(s.height!=null){
if(s.height){
e.style.height=s.height+"px"
}else{
e.style.height=""
}}
if(s.vertPadding!=null){
if(s.vertPadding){
e.style.paddingTop=e.style.paddingBottom=s.vertPadding+"px"
}else{
e.style.paddingTop=e.style.paddingBottom=""
}}
if(s.horizPadding!=null){
if(s.horizPadding){
e.style.paddingLeft=e.style.paddingRight=s.horizPadding+"px"
}else{
e.style.paddingLeft=e.style.paddingRight=""
}}
var o=s.borders,h;
h=o[DwtHtmlEditor.BORDER_TOP];
if(h!=null&&n){
e.style.borderTop=h.width+" "+h.style+" "+h.color
}
h=o[DwtHtmlEditor.BORDER_MIDDLE];
if(h!=null){
h=h.width+" "+h.style+" "+h.color;
if(!r){
e.style.borderBottom=h
}
if(!n){
e.style.borderTop=h
}}
h=o[DwtHtmlEditor.BORDER_BOTTOM];
if(h!=null&&r){
e.style.borderBottom=h.width+" "+h.style+" "+h.color
}
h=o[DwtHtmlEditor.BORDER_LEFT];
if(h!=null&&c){
e.style.borderLeft=h.width+" "+h.style+" "+h.color
}
h=o[DwtHtmlEditor.BORDER_CENTER];
if(h!=null){
h=h.width+" "+h.style+" "+h.color;
if(!d){
e.style.borderRight=h
}
if(!c){
e.style.borderLeft=h
}}
h=o[DwtHtmlEditor.BORDER_RIGHT];
if(h!=null&&d){
e.style.borderRight=h.width+" "+h.style+" "+h.color
}
d=false
}
r=false
}
if(AjxEnv.isGeckoBased){
this._forceRedraw()
}};
DwtHtmlEditor.prototype._insertHTML=function(a){
var o=this._getSelection();
var e=this._createRange(o);
if(AjxEnv.isIE){
if(this.insertRange){
this.insertRange.pasteHTML(a)
}else{
e.pasteHTML(a)
}}else{
var s=this._getIframeDoc();
var t=s.createDocumentFragment();
var n=s.createElement("div");
n.innerHTML=a;
while(n.firstChild){
t.appendChild(n.firstChild)
}
this._insertNodeAtSelection(t)
}};
DwtHtmlEditor.prototype._insertNodeAtSelection=function(s,t){
this.focus();
if(!AjxEnv.isIE){
var a=this._getRange();
var r=this._getIframeWin().getSelection();
r.removeAllRanges();
try{
a.deleteContents();
a.insertNode(s);
a.selectNode(s);
if(t){
r.addRange(a)
}}
catch(h){}}else{
var r=this._getRange();
var a=r.createRange();
var c="FOO-"+Dwt.getNextId();
try{
a.pasteHTML("<span id='"+c+"'></span>")
}
catch(o){
a.collapse(false);
a.pasteHTML("<span id='"+c+"'></span>")
}
var n=this._getIframeDoc().getElementById(c);
n.parentNode.insertBefore(s,n);
n.parentNode.removeChild(n)
}};
DwtHtmlEditor.prototype.isHtmlModeInited=function(){
return this._htmlModeInited
};
DwtHtmlEditor.prototype.setMode=function(s,o){
if(s==this._mode||(s!=DwtHtmlEditor.HTML&&s!=DwtHtmlEditor.TEXT)){
return
}
var t=this._getIframeDoc();
this._mode=s;
if(s==DwtHtmlEditor.HTML){
var n=document.getElementById(this._textAreaId);
var e;
if(this._iFrameId){
t.body.innerHTML=o?AjxStringUtil.convertToHtml(n.value):n.value;
e=document.getElementById(this._iFrameId)
}else{
var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
e=this._initHtmlMode(a)
}
Dwt.setVisible(n,false);
Dwt.setVisible(e,true);
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
this._enableDesignMode(t)
}}else{
var n=this._textAreaId?document.getElementById(this._textAreaId):this._initTextMode(true);
n.value=o?this._convertHtml2Text():t.innerHTML;
Dwt.setVisible(document.getElementById(this._iFrameId),false);
Dwt.setVisible(n,true)
}};
DwtHtmlEditor.prototype.getMode=function(){
return this._mode
};
DwtHtmlEditor.prototype.setFont=function(n,o,a,e,t){
if(n){
this._execCommand(DwtHtmlEditor._FONT_NAME,n)
}
if(o){
this._execCommand(o)
}
if(a){
this._execCommand(DwtHtmlEditor._FONT_SIZE,a)
}
if(e){
this._execCommand(DwtHtmlEditor._FONT_COLOR,e)
}
if(t){
this._execCommand((AjxEnv.isIE)?DwtHtmlEditor._FONT_HILITE_IE:DwtHtmlEditor._FONT_HILITE,t)
}};
DwtHtmlEditor.prototype.setJustification=function(e){
this._execCommand(e)
};
DwtHtmlEditor.prototype.setIndent=function(e){
this._execCommand(e)
};
DwtHtmlEditor.prototype.setStyle=function(e){
this._execCommand(DwtHtmlEditor._FORMAT_BLOCK,DwtHtmlEditor._STYLES[e])
};
DwtHtmlEditor.prototype.setSize=function(a,t){
DwtComposite.prototype.setSize.call(this,a,t);
var o=this.getHtmlElement();
if(this._iFrameId!=null){
var e=document.getElementById(this._iFrameId);
e.width=o.style.width;
e.height=o.style.height
}else{
var n=document.getElementById(this._textAreaId);
n.style.width=o.style.width;
n.style.height=o.style.height
}};
DwtHtmlEditor.prototype.getIframe=function(){
return document.getElementById(this._iFrameId)
};
DwtHtmlEditor.prototype.getInputElement=function(){
var e=(this._mode==DwtHtmlEditor.HTML)?this._iFrameId:this._textAreaId;
return document.getElementById(e)
};
DwtHtmlEditor.prototype._initialize=function(){
if(this._mode==DwtHtmlEditor.HTML){
this._initHtmlMode(this._pendingContent)
}else{
this._initTextMode()
}};
DwtHtmlEditor.prototype.TEXTAREA_CLASSNAME="DwtHtmlEditorTextArea";
DwtHtmlEditor.prototype._initTextMode=function(t){
var e=this.getHtmlElement();
this._textAreaId="textarea_"+Dwt.getNextId();
var a=document.createElement("textarea");
a.className=this.TEXTAREA_CLASSNAME;
a.id=this._textAreaId;
e.appendChild(a);
if(!t){
a.value=this._pendingContent;
this._pendingContent=null
}
return a
};
DwtHtmlEditor.prototype._initHtmlMode=function(a){
this._pendingContent=a||"";
this._keyEvent=new DwtKeyEvent();
this._stateEvent=new DwtHtmlEditorStateEvent();
this._stateEvent.dwtObj=this;
this._updateStateAction=new AjxTimedAction(this,this._updateState);
var o=this.getHtmlElement();
this._iFrameId="iframe_"+Dwt.getNextId();
var t=document.createElement("iframe");
t.id=this._iFrameId;
t.className="DwtHtmlEditorIFrame";
t.setAttribute("border","0",false);
t.setAttribute("frameborder","0",false);
t.setAttribute("vspace","0",false);
t.setAttribute("autocomplete","off",false);
var e=AjxCallback.simpleClosure(this._finishHtmlModeInit,this);
setTimeout(e,DwtHtmlEditor._INITDELAY);
t.src=this._blankIframeSrc||"";
o.appendChild(t);
return t
};
DwtHtmlEditor.prototype._finishHtmlModeInit=function(){
var a=this._getIframeDoc();
try{
if(AjxEnv.isSafari&&a.body==null){
a.open();
a.write("<html><head></head><body></body></html>");
a.close()
}}
catch(t){
return
}
if(AjxEnv.isGeckoBased){
a.open();
a.write(DwtHtmlEditor.INIT_HTML);
a.close()
}
function e(o){
this._enableDesignMode(o);
this._setContentOnTimer();
this._updateState();
this._htmlModeInited=true;
this._registerEditorEventHandlers(document.getElementById(this._iFrameId),o)
}
if(AjxEnv.isIE){
setTimeout(AjxCallback.simpleClosure(e,this,a),DwtHtmlEditor._INITDELAY)
}else{
e.call(this,a)
}};
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 s=this._getIframeDoc();
var a=s.selection;
var t=a.createRange();
if(a.type=="None"||a.type=="Text"){
return a.createRange().parentElement()
}
if(a.type=="Control"){
return a.createRange().item(0)
}
return s.body
}else{
try{
var t=this._getRange();
var n=t.commonAncestorContainer;
if(!t.collapsed&&t.startContainer==t.endContainer&&t.startOffset-t.endOffset<=1&&t.startContainer.hasChildNodes()){
n=t.startContainer.childNodes[t.startOffset]
}
while(n.nodeType==3){
n=n.parentNode
}
return n
}
catch(o){
return null
}}};
DwtHtmlEditor.prototype.getNearestElement=function(t){
try{
var a=this._getParentElement();
t=t.toLowerCase();
while(a&&a.nodeName.toLowerCase()!=t){
a=a.parentNode
}
return a
}
catch(e){
return null
}};
DwtHtmlEditor.prototype.selectNodeContents=function(a,s,e){
var t;
var n=(typeof s=="boolean");
if(AjxEnv.isIE){
t=this._getIframeDoc().body.createTextRange();
t.moveToElementText(a);
(n)&&t.collapse(s);
t.select()
}else{
var o=this._getSelection();
t=this._getIframeDoc().createRange();
if(e){
t.selectNode(a)
}else{
t.selectNodeContents(a)
}
(n)&&t.collapse(s);
o.removeAllRanges();
o.addRange(t)
}};
DwtHtmlEditor.prototype._forceRedraw=function(){
var e=this._getIframeDoc().body;
e.style.display="none";
var t=this;
setTimeout(function(){
e.style.display="";
t.focus();
t=null
}
,10)
};
DwtHtmlEditor.prototype.getSelectedCells=function(){
var r=null;
var e=this._getSelection();
var n,o=0;
var c=[];
var h=null;
if(!AjxEnv.isIE){
try{
while(n=e.getRangeAt(o++)){
var t=n.startContainer.childNodes[n.startOffset];
if(t){
if(t.parentNode!=h){
h=t.parentNode;
r&&c.push(r);
r=[]
}
if(t.tagName&&/^td$/i.test(t.tagName)){
r.push(t)
}}}}
catch(s){}
c.push(r)
}else{
n=e.createRange();
var a=n.duplicate();
n.collapse(true);
while(a.compareEndPoints("EndToStart",n)>=0){
var t=n.parentElement();
while(t&&t.nodeName.toLowerCase()!="td"){
t=t.parentNode
}
if(t){
if(t.parentNode!=h){
h=t.parentNode;
r&&c.push(r);
r=[]
}
r.push(t);
n.moveToElementText(t);
n.collapse(false)
}
if(n.move("character",1)==0){
break
}}
a.select();
c.push(r)
}
if(c.length==0||!c[0]||c[0].length==0){
r=this.getNearestElement("td");
if(r){
c=[[r]]
}}
return c
};
DwtHtmlEditor.prototype._splitCells=function(s){
var o=s;
while(o&&o.nodeName.toLowerCase()!="table"){
o=o.parentNode
}
var e=AjxEnv.isGeckoBased?"<br />":"";
function t(f){
var m=f.rowSpan;
var u=f.colSpan;
f.rowSpan=1;
tr=f.parentNode;
var c=tr.rowIndex;
var r=tr.parentNode.rows;
var h=f.cellIndex;
while(--m>0){
tr=r[++c];
var d=f.cloneNode(false);
d.removeAttribute("rowspan");
d.colSpan=f.colSpan;
d.innerHTML=e;
tr.insertBefore(d,tr.cells[h])
}}
function n(d){
var c=d.colSpan;
d.colSpan=1;
tr=d.parentNode;
var h=d.nextSibling;
while(--c>0){
var r=d.cloneNode(false);
r.removeAttribute("colspan");
r.rowSpan=d.rowSpan;
r.innerHTML=e;
tr.insertBefore(r,h)
}}
function a(d){
var c=d.colSpan;
n(d);
var r=d.parentNode.cells;
var h=d.cellIndex;
while(c-->0){
t(r[h++])
}}
a(s)
};
DwtHtmlEditor.prototype.doTableOperation=function(e,a){
var d=a.table||this.getNearestElement("table");
var t=a.td||this.getNearestElement("td");
var h,c,r;
if(t){
h=t.cellIndex;
r=t.parentNode;
c=r.rowIndex
}else{
h=0;
r=this.getNearestElement("tr");
if(r){
c=r.rowIndex
}}
var u=a.cells;
while(true){
switch(e){
case"insertRowAbove":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t));
break;
case"insertRowUnder":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t,true));
break;
case"insertColumnBefore":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t));
break;
case"insertColumnAfter":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t,true));
break;
case"deleteRow":for(var n=0;
n<u.length;
++n){
var t=DwtHtmlEditor.table_deleteRow(u[n][0]);
if(t){
this.selectNodeContents(t,true);
this.focus()
}}
break;
case"deleteColumn":for(var n=0;
n<u[0].length;
++n){
var t=DwtHtmlEditor.table_deleteCol(u[0][n]);
if(t){
this.selectNodeContents(t,true);
this.focus()
}}
break;
case"mergeCells":t=u[0][0];
var s=[t.innerHTML.replace(/<br>$/i,"")];
for(var n=0;
n<u.length;
++n){
var m=u[n];
for(var o=0;
o<m.length;
++o){
if(n||o){
s.push(m[o].innerHTML.replace(/<br>$/i,""));
m[o].parentNode.removeChild(m[o])
}}}
t.colSpan=u[0].length;
t.rowSpan=u.length;
s=s.join(" ");
if(AjxEnv.isGeckoBased){
s+="<br/>"
}
t.innerHTML=s;
this.selectNodeContents(t,true);
break;
case"splitCells":this._splitCells(t);
break;
case"deleteTable":if(!AjxEnv.isIE){
this.selectNodeContents(d,null,true);
this.deleteSelectedNodes()
}else{
d.parentNode.removeChild(d)
}
break
}
break
}
if(AjxEnv.isGeckoBased){
this._forceRedraw()
}
this._updateState()
};
DwtHtmlEditor.prototype._getRange=function(){
var o=this._getIframeDoc();
if(AjxEnv.isIE){
return o.selection
}else{
this.focus();
var t=this._getIframeWin().getSelection();
if(t!=null){
try{
return t.getRangeAt(0)
}
catch(a){
return o.createRange()
}}else{
return o.createRange()
}}};
DwtHtmlEditor.prototype._createRange=function(t){
var o=this._getIframeDoc();
if(AjxEnv.isIE){
return t.createRange()
}else{
this.focus();
if(t!=null){
try{
return t.getRangeAt(0)
}
catch(a){
return o.createRange()
}}else{
return o.createRange()
}}};
DwtHtmlEditor.prototype.deleteSelectedNodes=function(){
var e=this._getSelection();
if(AjxEnv.isGeckoBased){
e.deleteFromDocument()
}else{
e.clear()
}};
DwtHtmlEditor.prototype._getSelection=function(){
if(AjxEnv.isIE){
return this._getIframeDoc().selection
}else{
return this._getIframeWin().getSelection()
}};
DwtHtmlEditor.prototype.__eventClosure=function(e){
return this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e)
};
DwtHtmlEditor.prototype._registerEditorEventHandlers=function(e,o){
var a=["mouseup","drag","mousedown","keydown"];
if(!AjxEnv.isIE7up){
a.push("keypress")
}
for(var t=0;
t<a.length;
++t){
this._registerEditorEventHandler(o,a[t])
}};
DwtHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
if(AjxEnv.isIE){
t.attachEvent("on"+e,this.__eventClosure)
}else{
t.addEventListener(e,this.__eventClosure,true)
}};
DwtHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
if(AjxEnv.isIE){
t.detachEvent("on"+e,this.__eventClosure)
}else{
t.removeEventListener(e,this.__eventClosure,true)
}};
DwtHtmlEditor.prototype._handleEditorEvent=function(m){
var o=true;
if(m.type=="mousedown"){
DwtMenu._outsideMouseDownListener(m)
}
if(m.type=="mouseup"){
var t=DwtShell.getShell(window).getKeyboardMgr();
if(AjxEnv.isIE){
t.__focusObj=this
}else{
t.grabFocus(this)
}}
if(m.type=="contextmenu"){
var p=DwtShell.mouseEvent;
p.setFromDhtmlEvent(m);
var u=Dwt.getLocation(document.getElementById(this._iFrameId));
if(!AjxEnv.isIE){
var f=this._getIframeDoc();
var s=f.documentElement.scrollLeft||f.body.scrollLeft;
var y=f.documentElement.scrollTop||f.body.scrollTop;
u.x-=s;
u.y-=y
}
p.docX+=u.x;
p.docY+=u.y;
DwtControl.__mouseEvent(m,DwtEvent.ONCONTEXTMENU,this,p);
o=p._returnValue
}
var n=null;
if(DwtKeyEvent.isKeyPressEvent(m)){
var c=this._keyEvent;
c.setFromDhtmlEvent(m);
if(AjxEnv.isGeckoBased&&m.keyCode==13){
this._stateEvent._ignoreCommandState=true;
var e=this._getRange(),a=e.startContainer,d=/^h[1-6]$/i;
if((a.nodeType==3&&d.test(a.parentNode.tagName))||d.test(a.tagName)){
var g=this;
setTimeout(function(){
var w=g._getIframeDoc();
w.body.style.display="none";
w.body.style.display="";
var r=g._getSelection();
r.removeAllRanges();
r.addRange(e)
}
,5)
}}}
if(m.type=="keydown"){
if(m.keyCode==9){
if(AjxEnv.isIE){
this._handleIETabKey(!m.shiftKey);
c._stopPropagation=true;
c._returnValue=false;
c.setToDhtmlEvent(m);
o=false
}}else{
if(DwtKeyboardMgr.isPossibleInputShortcut(m)){
o=DwtKeyboardMgr.__keyDownHdlr(m)
}}}
if(AjxEnv.isIE){
var h=this._getIframeDoc();
this._currInsPt=h.selection.createRange();
if(h.selection.type=="None"){
this._currInsPt.collapse(false)
}}
if(this._stateUpdateActionId!=null){
AjxTimedAction.cancelAction(this._stateUpdateActionId)
}
this._stateUpdateActionId=AjxTimedAction.scheduleAction(this._updateStateAction,100);
if(window.DwtIdleTimer){
DwtIdleTimer.resetIdle()
}
return o
};
DwtHtmlEditor.prototype.getKeyMapName=function(){
return"DwtHtmlEditor"
};
DwtHtmlEditor.prototype.handleKeyAction=function(t,a){
var n="",o="";
if(t==DwtKeyMap.SWITCH_MODE){
try{
this.setMode((this._mode==DwtHtmlEditor.HTML)?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML,true)
}
catch(s){}}else{
if(t.indexOf("Header")==0){
n=DwtHtmlEditor._FORMAT_BLOCK;
o=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
}else{
n=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
}}
if(n){
this._execCommand(n,o);
return true
}
return false
};
DwtHtmlEditor.prototype._handleIETabKey=function(s){
var c=this._getIframeDoc();
var o=this._getParentElement();
var d=o.parentNode;
var u=o.tagName.toLowerCase();
if(u=="p"||u=="body"){
if(s){
this._insertHTML("&nbsp;&nbsp;&nbsp;")
}}else{
if(u=="li"){
this._execCommand((s)?"Indent":"Outdent","")
}else{
try{
var t=this._getAllAncestors();
var r=this._locateNode(t,"td");
if(r!=null){
o=r;
d=o.parentNode;
u=o.tagName.toLowerCase();
if(u=="td"){
var e=(s?o.nextSibling:o.previousSibling);
if(e!=null){
this._setCursor(e)
}else{
e=(s)?d.nextSibling:d.previousSibling;
if(e==null){
if(!s){
return
}
DwtHtmlEditor.table_insertRow(o,s);
e=d.nextSibling
}
if(e!=null){
var n=e.childNodes;
if(n!=null&&n.length>0){
var a=(s)?(0):(n.length-1);
this._setCursor(n[a])
}}}}}}
catch(h){}}}};
DwtHtmlEditor.prototype._setCursor=function(a){
var s=this._getIframeDoc();
var e=s.body;
var t;
if(AjxEnv.isIE){
t=e.createTextRange();
t.moveToElementText(a);
t.collapse(0);
t.select()
}else{
t=s.createRange();
t.selectNodeContents(a);
t.collapse(false);
var n=this._getIframeWin().contentWindow;
var o=n.getSelection();
o.addRange(t);
o.collapseToEnd()
}};
DwtHtmlEditor.prototype._locateNode=function(t,e){
if(t&&e){
for(var a=0;
a<t.length;
a++){
if(t[a].tagName.toLowerCase()==e.toLowerCase()){
return t[a]
}}}
return null
};
DwtHtmlEditor.prototype._getAllAncestors=function(){
var a=this._getParentElement();
var e=[];
while(a&&(a.nodeType==1)&&(a.tagName.toLowerCase()!="body")){
e.push(a);
a=a.parentNode
}
var t=this._getIframeDoc();
if(t.body!=null){
e.push(t.body)
}
return e
};
DwtHtmlEditor.prototype._updateState=function(){
if(this._mode!=DwtHtmlEditor.HTML){
return
}
this._stateUpdateActionId=null;
var a=this._stateEvent;
if(!a._ignoreCommandState){
a.reset()
}
var n=this._getIframeDoc();
try{
if(!a._ignoreCommandState){
a.isBold=n.queryCommandState(DwtHtmlEditor.BOLD_STYLE);
a.isItalic=n.queryCommandState(DwtHtmlEditor.ITALIC_STYLE);
a.isUnderline=n.queryCommandState(DwtHtmlEditor.UNDERLINE_STYLE);
a.isStrikeThru=n.queryCommandState(DwtHtmlEditor.STRIKETHRU_STYLE);
a.isSuperscript=n.queryCommandState(DwtHtmlEditor.SUPERSCRIPT_STYLE);
a.isSubscript=n.queryCommandState(DwtHtmlEditor.SUBSCRIPT_STYLE);
a.isOrderedList=n.queryCommandState(DwtHtmlEditor.ORDERED_LIST);
a.isUnorderedList=n.queryCommandState(DwtHtmlEditor.UNORDERED_LIST)
}else{
a._ignoreCommandState=null
}
a.fontFamily=n.queryCommandValue(DwtHtmlEditor._FONT_NAME);
var o=n.queryCommandValue(DwtHtmlEditor._FONT_SIZE);
if(o==""){
o=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE))+1)
}
a.fontSize=o;
a.backgroundColor=n.queryCommandValue((AjxEnv.isIE)?"backcolor":"hilitecolor");
a.color=n.queryCommandValue("forecolor");
if(AjxEnv.isIE){
a.backgroundColor="#"+DwtButtonColorPicker.toHex(a.backgroundColor,6).replace(/(..)(..)(..)/,"$3$2$1");
a.color="#"+DwtButtonColorPicker.toHex(a.color,6).replace(/(..)(..)(..)/,"$3$2$1")
}
a.justification=null;
a.direction=null;
var t=n.queryCommandValue(DwtHtmlEditor._FORMAT_BLOCK);
if(t){
if(t.search(DwtHtmlEditor._H1_RE)!=-1){
a.style=DwtHtmlEditor.H1
}else{
if(t.search(DwtHtmlEditor._H2_RE)!=-1){
a.style=DwtHtmlEditor.H2
}else{
if(t.search(DwtHtmlEditor._H3_RE)!=-1){
a.style=DwtHtmlEditor.H3
}else{
if(t.search(DwtHtmlEditor._H4_RE)!=-1){
a.style=DwtHtmlEditor.H4
}else{
if(t.search(DwtHtmlEditor._H5_RE)!=-1){
a.style=DwtHtmlEditor.H5
}else{
if(t.search(DwtHtmlEditor._H6_RE)!=-1){
a.style=DwtHtmlEditor.H6
}else{
if(t.search(DwtHtmlEditor._PARAGRAPH_RE)!=-1){
a.style=DwtHtmlEditor.PARAGRAPH
}else{
if(t.search(DwtHtmlEditor._ADDRESS_RE)!=-1){
a.style=DwtHtmlEditor.ADDRESS
}else{
if(t.search(DwtHtmlEditor._PREFORMATTED_RE)!=-1){
a.style=DwtHtmlEditor.PREFORMATTED
}}}}}}}}}}
if(n.queryCommandState(DwtHtmlEditor.JUSTIFY_LEFT)){
a.justification=DwtHtmlEditor.JUSTIFY_LEFT
}else{
if(n.queryCommandState(DwtHtmlEditor.JUSTIFY_CENTER)){
a.justification=DwtHtmlEditor.JUSTIFY_CENTER
}else{
if(n.queryCommandState(DwtHtmlEditor.JUSTIFY_RIGHT)){
a.justification=DwtHtmlEditor.JUSTIFY_RIGHT
}else{
if(n.queryCommandState(DwtHtmlEditor.JUSTIFY_FULL)){
a.justification=DwtHtmlEditor.JUSTIFY_FULL
}}}}
if(this.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this.notifyListeners(DwtEvent.STATE_CHANGE,a)
}}
catch(e){
if(AjxEnv.isGeckoBased){
this._enableDesignMode(n)
}}};
DwtHtmlEditor.prototype._enableDesignMode=function(a){
if(!a){
return
}
try{
Dwt.enableDesignMode(a,true);
if(AjxEnv.isGeckoBased&&(AjxEnv.isLinux||AjxEnv.isMac)){
this._registerEditorEventHandlers(document.getElementById(this._iFrameId),a)
}}
catch(t){
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
var e=new AjxTimedAction(this,this._enableDesignMode,[a]);
AjxTimedAction.scheduleAction(e,10);
return true
}else{
return false
}}};
DwtHtmlEditor.prototype._onContentInitialized=function(){
this._pendingContent=null
};
DwtHtmlEditor.prototype._setContentOnTimer=function(){
var a=this._getIframeDoc();
try{
if(this._pendingContent!=null){
a.body.innerHTML=this._pendingContent
}
if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
this._enableDesignMode(a)
}
this._onContentInitialized()
}
catch(t){
var e=new AjxTimedAction(this,this._setContentOnTimer);
AjxTimedAction.scheduleAction(e,10);
return true
}};
DwtHtmlEditor.prototype._execCommand=function(o,t){
if(this._mode!=DwtHtmlEditor.HTML){
return
}
try{
this.focus();
this._getIframeDoc().execCommand(o,false,t)
}
catch(a){
this._enableDesignMode(this._getIframeDoc())
}
this._updateState()
};
DwtHtmlEditor.prototype._convertHtml2Text=function(){
var e=this._getIframeDoc();
return(e&&e.body)?AjxStringUtil.convertHtml2Text(e.body):""
};
DwtHtmlEditor.prototype.insertLink=function(c){
var h=this._getIframeDoc();
var r=(AjxEnv.isIE&&h&&h.body)?(h.body.innerHTML):"";
if(AjxEnv.isIE&&r==""){
var e=h.createElement("a");
e.href=c.url;
if(c.title){
e.title=c.title
}
var s=h.createTextNode(c.text);
e.appendChild(s);
h.body.appendChild(e);
return e
}else{
if(c.text){
this.insertText(c.text,true)
}
var t="javascript:"+Dwt.getNextId();
this._execCommand("createlink",t);
var e=h.getElementsByTagName("a");
var n;
for(var o=e.length;
--o>=0;
){
if(e[o].href==t){
n=e[o];
break
}}
n.href=c.url;
if(c.title){
n.title=c.title
}
return n
}};
DwtHtmlEditor.prototype.getLinkProps=function(){
var e=this.getNearestElement("a");
if(e){
this.selectNodeContents(e)
}
var t=this._getRange();
var o={
text:AjxEnv.isIE?t.text:t.toString()};
if(e){
o.url=e.href;
o.title=e.title
}
return o
};
DwtHtmlEditor.table_analyzeCells=function(c){
var d=c.parentNode.parentNode;
while(d&&!/table/i.test(d.tagName)){
d=d.parentNode
}
var h={};
var m=d.rows;
for(var n=0;
n<m.length;
++n){
var u=m[n].cells;
var r=0;
for(var a=0;
a<u.length;
){
var e=u[a];
var s=e.colSpan||1;
var t=(e.rowSpan||1)-1;
var o=h[r];
if(o){
if(--o.rs==0){
h[r]=null
}
r+=o.cs
}
e.ZmIndex=r;
if(++a<u.length){
if(t){
h[r]={
cs:s,rs:t}
}
r+=s
}}}
return d
};
DwtHtmlEditor.table_getCellAt=function(r,s){
var c=r.cells;
var h=null,o=null;
for(var a=0;
a<c.length;
++a){
var e=c[a];
var n=(e.colSpan||1)-1;
if(e.ZmIndex<=s&&e.ZmIndex+n>=s){
var t=(e.rowSpan||1)-1;
return{
td:e,cs:n,rs:t}
}else{
if(e.ZmIndex<s){
h=e
}else{
if(e.ZmIndex+n>s&&!o){
o=e
}}}}
return{
last:h,next:o}
};
DwtHtmlEditor.table_getPrevCellAt=function(n,e){
var a=n.parentNode;
while(a&&!/table/i.test(a.tagName)){
a=a.parentNode
}
var o=a.rows;
for(var t=n.rowIndex;
--t>=0;
){
var s=DwtHtmlEditor.table_getCellAt(o[t],e);
if(s.td){
s.dist=n.rowIndex-t;
return s
}}
return null
};
DwtHtmlEditor.table_fixCells=function(e){
for(var t=0;
t<e.length;
++t){
var a=e[t];
if(AjxEnv.isIE){
a.innerHTML="&nbsp;"
}else{
if(AjxEnv.isGeckoBased){
a.innerHTML="<br/>"
}}}};
DwtHtmlEditor.table_insertCol=function(n,t){
var u=DwtHtmlEditor.table_analyzeCells(n);
var m=u.rows;
var c=n.ZmIndex;
if(t){
c+=n.colSpan-1
}
var h=[];
var s=0;
for(var r=0;
r<m.length;
++r){
var d=m[r];
var a=DwtHtmlEditor.table_getCellAt(d,c);
var o=a.td;
var e=null;
if(o){
if(o.ZmIndex==c&&!t){
e=d.insertCell(o.cellIndex)
}else{
if(o.ZmIndex+a.cs==c&&t){
e=d.insertCell(o.cellIndex+1)
}}
if(e){
s=a.rs
}else{
o.colSpan=a.cs+2
}}else{
if(s>0){
if(a.last){
e=d.insertCell(a.last.cellIndex+1)
}else{
if(a.next){
e=d.insertCell(a.next.cellIndex)
}}
--s
}}
if(e){
h.push(e)
}}
return h
};
DwtHtmlEditor.table_insertRow=function(o,t){
var c=o.parentNode;
var f=DwtHtmlEditor.table_analyzeCells(o);
var h=c.rowIndex;
if(t){
h+=o.rowSpan;
c=f.rows[h-1]
}
o=f.rows[0].cells[f.rows[0].cells.length-1];
var d=o.ZmIndex+o.colSpan;
var u=f.insertRow(h);
var r=[];
var m=c.cells;
var e;
for(var s=0;
s<d;
++s){
var a=DwtHtmlEditor.table_getCellAt(c,s);
if(a.td){
if(!t||!a.rs){
for(var n=0;
n<=a.cs;
++n){
r.push(u.insertCell(-1))
}}else{
if(a.rs){
a.td.rowSpan=a.rs+2
}}}else{
a=DwtHtmlEditor.table_getPrevCellAt(c,s);
if(t&&a.rs==a.dist){
for(var n=0;
n<=a.cs;
++n){
r.push(u.insertCell(-1))
}}else{
a.td.rowSpan=a.rs+2
}}
s+=a.cs
}
return r
};
DwtHtmlEditor.table_deleteCol=function(a){
var c=DwtHtmlEditor.table_analyzeCells(a);
var d=c.rows;
var n=a.ZmIndex;
var h=a.parentNode;
var s;
try{
s=h.cells[a.cellIndex+1];
if(!s){
s=h.cells[a.cellIndex-1]
}}
catch(r){
s=null
}
var e=[];
for(var o=0;
o<d.length;
++o){
var h=d[o];
var t=DwtHtmlEditor.table_getCellAt(h,n);
if(t.td){
if(t.cs){
t.td.colSpan=t.cs
}else{
h.removeChild(t.td);
if(h.cells.length==0){
e.push(h)
}}
o+=t.rs
}}
for(var o=e.length;
--o>=0;
){
h=e[o];
h.parentNode.removeChild(h)
}
if(c.rows.length==0){
c.parentNode.removeChild(c)
}
return s
};
DwtHtmlEditor.table_deleteRow=function(t){
var s=t.parentNode;
var c=DwtHtmlEditor.table_analyzeCells(t);
t=c.rows[0].cells[c.rows[0].cells.length-1];
var r=t.ZmIndex+t.colSpan;
var h;
for(var a=r;
--a>=0;
){
var e=DwtHtmlEditor.table_getCellAt(s,a);
if(e.td){
if(e.rs){
h=c.rows[s.rowIndex+1];
var o=DwtHtmlEditor.table_getCellAt(h,a);
t=null;
if(o.last){
t=h.insertCell(o.last.cellIndex+1)
}else{
if(o.next){
t=h.insertCell(o.next.cellIndex)
}}
if(t){
if(e.cs>0){
t.colSpan=e.cs+1
}
if(e.rs>1){
t.rowSpan=e.rs
}}}
s.removeChild(e.td)
}else{
e=DwtHtmlEditor.table_getPrevCellAt(s,a);
if(e){
if(e.rs){
e.td.rowSpan=e.rs;
a-=e.cs
}}}}
try{
h=c.rows[s.rowIndex+1];
if(!h){
h=c.rows[s.rowIndex-1]
}}
catch(n){
h=null
}
s.parentNode.removeChild(s);
if(c.rows.length==0){
c.parentNode.removeChild(c)
}
if(h){
return h.cells[0]
}};
DwtHtmlEditor.prototype.searchnReplace=function(a){
var n=this._getIframeWin();
n.focus();
var h=this._getIframeDoc();
var o=h.body;
var s=this._getSelectedText();
if(o.innerHTML==""){
return true
}
str1=a.searchstring;
str2=s;
if(a.replacemode=="current"){
str1=str1.toString();
str2=str2.toString();
if(!a.casesensitive){
str1=str1.toLowerCase();
str2=str2.toLowerCase()
}
if(str1==str2){
this.replaceSel(a.searchstring,a.replacestring);
a.replacemode="none"
}}
if(AjxEnv.isIE){
var e=this.lastSearchRng?this.lastSearchRng:this.range_findnreplace;
var t=0;
if(a.wholeword){
t=t|2
}
if(a.casesensitive){
t=t|4
}
if(!e.findText){
alert("This operation is currently not supported by this browser.");
return true
}
if(a.replacemode=="all"){
if(AjxEnv.isIE){
this.focus()
}
var r=new RegExp(a.searchstring,((a.casesensitive)?"":"i")+"g");
var c=this.replaceNodeContent(o,r,a.replacestring,"all",0);
return true
}
if(e.findText(a.searchstring,a.backwards?-1:1,t)){
e.scrollIntoView();
e.select();
e.collapse(a.backwards);
this.lastSearchRng=e;
if(AjxEnv.isIE&&(a.replacemode=="current")){
this.replaceSel(a.searchstring,a.replacestring)
}}else{
rng1=o.createTextRange();
rng1.findText(a.searchstring,a.backwards?-1:1,t);
rng1.scrollIntoView();
if(rng1.text.toLowerCase()==a.searchstring.toLowerCase()){
rng1.select()
}
rng1.collapse(false);
this.lastSearchRng=rng1;
if(AjxEnv.isIE&&(a.replacemode=="current")){
this.replaceSel(a.searchstring,a.replacestring)
}}}else{
if(a.replacemode=="all"){
var r=new RegExp(a.searchstring,(a.casesensitive?"":"i")+"g");
var c=this.replaceNodeContent(o,r,a.replacestring,"all",0);
return true
}
if(!n.find(a.searchstring,a.casesensitive,a.backwards,a.wrap,a.wholeword,false,false)){
while(n.find(a.searchstring,a.casesensitive,true,a.wrap,a.wholeword,false,false)){}}}};
DwtHtmlEditor.prototype.replaceSel=function(e,s){
if(s==null){
return
}
var n=this._getIframeWin();
var o=n.document;
var t;
if(!AjxEnv.isIE){
var a=n.getSelection();
t=a.getRangeAt(0)
}else{
t=n.document.selection.createRange()
}
if(!AjxEnv.isIE){
if(s.indexOf(e)==-1){
t.deleteContents();
t.insertNode(t.createContextualFragment(s));
t.collapse(false)
}}else{
if(t.item){
t.item(0).outerHTML=s
}else{
t.pasteHTML(s)
}}};
DwtHtmlEditor.prototype._getSelectedText=function(){
var a=this._getIframeWin();
var t=this._getIframeDoc();
var e="";
if(a.getSelection){
e=a.getSelection()
}else{
if(t.getSelection){
e=t.getSelection()
}else{
if(t.selection){
e=t.selection.createRange().text
}}}
return e
};
DwtHtmlEditor.prototype.replaceNodeContent=function(a,r,o,h,t){
for(var n=0;
n<a.childNodes.length;
n++){
var s=a.childNodes[n];
if(s.nodeType==3){
var e=s.nodeValue.replace(r,o);
if(s.nodeValue!=e){
s.nodeValue=e;
t++;
if(h!="all"){
return t
}}}
this.replaceNodeContent(s,r,o,h,t);
if((h!="all")&&(t>0)){
return t
}}
return t
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtInputField")){
DwtInputField=function(h){
if(arguments.length==0){
return
}
this._origClassName=h.className?h.className:"DwtInputField";
this._errorClassName=this._origClassName+"-Error";
this._hintClassName=this._origClassName+"-hint";
this._disabledClassName=this._origClassName+"-disabled";
this._errorHintClassName=this._origClassName+"-errorhint";
DwtComposite.call(this,h);
this._inputEventHandlers={};
this._type=h.type?h.type:DwtInputField.STRING;
this._rows=h.rows?h.rows:1;
this._size=h.size;
this._errorIconStyle=h.errorIconStyle?h.errorIconStyle:h.validator?DwtInputField.ERROR_ICON_RIGHT:DwtInputField.ERROR_ICON_NONE;
this._validationStyle=h.validationStyle?h.validationStyle:DwtInputField.ONEXIT_VALIDATION;
this._hasError=false;
this._hintIsVisible=false;
this._hint=h.hint;
var r=h.inputID||Dwt.getNextId();
var s=Dwt.getNextId();
var n=this.getHtmlElement();
if(this._errorIconStyle==DwtInputField.ERROR_ICON_NONE){
if(h.forceMultiRow||(h.rows&&h.rows>1)){
var e=["<textarea id='",r,"' rows=",h.rows];
var o=e.length;
if(h.forceMultiRow||h.size){
e[o++]=" cols=";
e[o++]=h.size||1
}
if(h.wrap){
e[o++]=" wrap=";
e[o++]=h.wrap
}
e[o++]="></textarea>";
n.innerHTML=e.join("")
}else{
n.innerHTML=["<input id='",r,"'>"].join("")
}}else{
var e=["<table cellspacing='0' cellpadding='0'><tr>"];
var o=1;
if(this._errorIconStyle==DwtInputField.ERROR_ICON_LEFT){
e[o++]=["<td style='padding-right:2px;'id='",s,"'></td>"].join("")
}
e[o++]=["<td>","<input id='",r,"'>","</td>"].join("");
if(this._errorIconStyle==DwtInputField.ERROR_ICON_RIGHT){
e[o++]=["<td style='padding-left:2px;' id='",s,"'></td>"].join("")
}
e[o++]="</tr></table>";
n.innerHTML=e.join("");
if(this._errorIconStyle!=DwtInputField.ERROR_ICON_NONE){
this._errorIconTd=document.getElementById(s);
this._errorIconTd.vAlign="middle";
this._errorIconTd.innerHTML=DwtInputField._NOERROR_ICON_HTML
}}
this._tabGroup=new DwtTabGroup(this._htmlElId);
if(h.forceMultiRow||this._rows>1){
this._inputField=document.getElementById(r);
this._inputField.onkeyup=DwtInputField._keyUpHdlr;
this._inputField.onblur=DwtInputField._blurHdlr;
this._inputField.onfocus=DwtInputField._focusHdlr;
if(h.size){
this._inputField.size=h.size
}
if(h.maxLen){
this._inputField.maxLength=this._maxLen=h.maxLen
}
this._inputField.value=h.initialValue||"";
this._tabGroup.addMember(this._inputField)
}else{
var t=document.getElementById(r);
var a=this.__createInputEl(h);
if(AjxEnv.isCamino){
t.parentNode.style.overflow="hidden"
}
t.parentNode.replaceChild(a,t)
}
this.setValidatorFunction(h.validatorCtxtObj,h.validator);
this._setMouseEventHdlrs(false);
this._setKeyPressEventHdlr(false);
if(h.required!=null){
this.setRequired(h.required)
}};
DwtInputField.prototype=new DwtComposite;
DwtInputField.prototype.constructor=DwtInputField;
DwtInputField.prototype.toString=function(){
return"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.dispose=function(){
this._errorIconTd=null;
this._inputField=null;
DwtComposite.prototype.dispose.call(this)
};
DwtInputField.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtInputField.prototype.setHandler=function(t,e){
if(!this._checkState()){
return
}
this._inputEventHandlers[t]=e;
Dwt.setHandler(this.getInputElement(),t,e)
};
DwtInputField.prototype.setInputType=function(a){
if(a!=this._type&&this._rows==1){
this._type=a;
if(AjxEnv.isIE){
var e=this._inputField;
var t=this.__createInputEl();
e.parentNode.replaceChild(t,e)
}else{
this._inputField.type=this._type!=DwtInputField.PASSWORD?"text":"password"
}}};
DwtInputField.prototype.setValidatorFunction=function(t,e){
if(e){
this._validator=e;
this._validatorObj=t
}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(e,t){
this._validator=e;
this._validatorObj=null;
this._errorString=t||""
};
DwtInputField.prototype.setValidationCallback=function(e){
this._validationCallback=e
};
DwtInputField.prototype.getInputElement=function(){
return this._inputField
};
DwtInputField.prototype.getValue=function(){
return this._hintIsVisible?"":this._inputField.value
};
DwtInputField.prototype.setValue=function(t,e){
t=t||"";
this._inputField.value=t;
if(!e){
t=this._validateInput(t);
if(t!=null){
this._inputField.value=t
}}
if(this._hintIsVisible&&t){
this._hideHint(t)
}else{
if(!t){
this._showHint()
}}};
DwtInputField.prototype.setHint=function(t){
var e=this._hint;
this._hint=t;
if(this._hintIsVisible){
this.getInputElement().value=t;
if(!t){
this._hintIsVisible=false;
this._updateClassName()
}}else{
if(this._inputField.value==""){
this._showHint()
}}};
DwtInputField.prototype.setValidNumberRange=function(t,e){
this._minNumVal=t;
this._maxNumVal=e;
var a=this._validateInput(this.getValue());
if(a!=null){
this.setValue(a)
}};
DwtInputField.prototype.setValidStringLengths=function(t,e){
this._minLen=t||0;
if(e!=null){
this._inputField.maxLength=e;
this._maxLen=e
}};
DwtInputField.prototype.setNumberPrecision=function(e){
this._decimals=e
};
DwtInputField.prototype.setReadOnly=function(e){
this._inputField.setAttribute("readonly",(e==null?true:e))
};
DwtInputField.prototype.setRequired=function(t){
var e=t==null?true:t;
if(this._required!=e){
this._required=e;
this.validate()
}};
DwtInputField.prototype.getEnabled=function(){
return !this.getInputElement().disabled
};
DwtInputField.prototype.setEnabled=function(e){
DwtControl.prototype.setEnabled.call(this,e);
this.getInputElement().disabled=!e;
this._validateInput(this.getValue())
};
DwtInputField.prototype.focus=function(){
if(this.getEnabled()){
this._hasFocus=true;
this.getInputElement().focus();
DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
}};
DwtInputField.prototype.blur=function(){
this.getInputElement().blur()
};
DwtInputField.prototype.setVisible=function(e){
DwtComposite.prototype.setVisible.apply(this,arguments);
Dwt.setVisible(this.getInputElement(),e)
};
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(e){
if(typeof e=="string"){
return null
}else{
throw e
}}};
DwtInputField.prototype.validate=function(){
var e=this._validateInput(this.getValue());
if(e!=null){
this.setValue(e);
return true
}else{
return false
}};
DwtInputField.validateNumber=function(e){
var t=new Number(e);
if(isNaN(t)||(Math.round(t)!=t)){
throw AjxMsg.notAnInteger
}
return DwtInputField.validateFloat.call(this,e)
};
DwtInputField.validateInteger=function(e){
var t=new Number(e);
if(isNaN(t)||(Math.round(t)!=t)||(t.toString()!=e)){
throw AjxMsg.notAnInteger
}
if(this._minNumVal&&e<this._minNumVal){
throw AjxMessageFormat.format(AjxMsg.numberLessThanMin,this._minNumVal)
}
if(this._maxNumVal&&e>this._maxNumVal){
throw AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this._maxNumVal)
}
return e
};
DwtInputField.validateFloat=function(e){
if(this._required&&e==""){
throw AjxMsg.valueIsRequired
}
var o=new Number(e);
if(isNaN(o)){
throw AjxMsg.notANumber
}
if(this._minNumVal&&e<this._minNumVal){
throw AjxMessageFormat.format(AjxMsg.numberLessThanMin,this._minNumVal)
}
if(this._maxNumVal&&e>this._maxNumVal){
throw AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this._maxNumVal)
}
if(this._decimals!=null){
var t=o.toString();
var a=t.indexOf(".");
if(a==-1){
a=t.length
}
e=o.toPrecision(a+this._decimals)
}else{
e=o.toString()
}
return e
};
DwtInputField.validateString=function(e){
if(this._required&&e==""){
throw AjxMsg.valueIsRequired
}
if(this._minLen!=null&&e.length<this._minLen){
throw AjxMessageFormat.format(AjxMsg.stringTooShort,this._minLen)
}
if(this._maxLen!=null&&e.length>this._maxLen){
throw AjxMessageFormat.format(AjxMsg.stringTooLong,this._maxLen)
}
return e
};
DwtInputField.validateDate=function(e){
if(this._required&&e==""){
throw AjxMsg.valueIsRequired
}
if(AjxDateUtil.simpleParseDateStr(e)==null){
throw AjxMsg.invalidDatetimeString
}
return e
};
DwtInputField.validateEmail=function(e){
if(this._required&&e==""){
throw AjxMsg.valueIsRequired
}
if(!AjxEmailAddress.isValid(e)){
throw AjxMsg.invalidEmailAddr
}
return e
};
DwtInputField.validateAny=function(e){
if(this._required&&e==""){
throw AjxMsg.valueIsRequired
}
return e
};
DwtInputField.prototype._validateRegExp=function(e){
if(this._required&&e==""){
throw AjxMsg.valueIsRequired
}
if(this._regExp&&!this._regExp.test(e)){
throw this._errorString
}
return e
};
DwtInputField._keyUpHdlr=function(t){
var e=DwtShell.keyEvent;
e.setFromDhtmlEvent(t,true);
var o=e.dwtObj;
var a=e.keyCode;
if(o.notifyListeners(DwtEvent.ONKEYUP,e)){
return true
}
var n=null;
if((a==13||a==9)&&o._validationStyle==DwtInputField.ONEXIT_VALIDATION){
n=o._validateInput(o.getValue())
}else{
if(o._validationStyle==DwtInputField.CONTINUAL_VALIDATION){
n=o._validateInput(o.getValue())
}}
if(n!=null&&n!=o.getValue()){
o.setValue(n)
}
return true
};
DwtInputField._blurHdlr=function(e){
var t=DwtControl.getTargetControl(e);
if(t){
t._hasFocus=false;
if(t._validationStyle==DwtInputField.ONEXIT_VALIDATION){
var a=t._validateInput(t.getValue());
if(a!=null){
t.setValue(a)
}}
if(!t._hintIsVisible&&t._hint){
t._showHint()
}}};
DwtInputField._focusHdlr=function(e){
var t=DwtControl.getTargetControl(e);
if(t){
var a=DwtShell.getShell(window).getKeyboardMgr().inputGotFocus(t);
if(t._hintIsVisible){
t._hideHint("")
}}};
DwtInputField.prototype._hideHint=function(t){
var e=this.getInputElement();
e.value=t;
e.title=this._hint||"";
this._hintIsVisible=false;
this._updateClassName()
};
DwtInputField.prototype._showHint=function(){
if(this._hint){
var e=this.getInputElement();
if(!e.value){
e.title="";
e.value=this._hint;
this._hintIsVisible=true;
this._updateClassName()
}}};
DwtInputField.prototype._updateClassName=function(){
var e;
if(!this.getEnabled()){
e=this._disabledClassName
}else{
if(this._hasError){
if(this._hintIsVisible&&!this._hasFocus){
e=this._errorHintClassName
}else{
e=this._errorClassName
}}else{
if(this._hintIsVisible&&!this._hasFocus){
e=this._hintClassName
}else{
e=this._origClassName
}}}
this.getHtmlElement().className=e
};
DwtInputField.prototype._validateInput=function(a){
var n=true;
var o;
var t;
if(!this.getEnabled()){
o=this.getValue()
}else{
try{
if(typeof this._validator=="function"){
o=a=this._validatorObj?this._validator.call(this._validatorObj,a,this):this._validator(a)
}else{
if(!this._validator.test(a)){
t=this._errorString
}}}
catch(e){
if(typeof e=="string"){
t=e
}else{
throw e
}}}
if(t){
this._hasError=true;
if(this._errorIconTd){
this._errorIconTd.innerHTML=DwtInputField._ERROR_ICON_HTML
}
this.setToolTipContent(t);
n=false;
o=null
}else{
this._hasError=false;
if(this._errorIconTd){
this._errorIconTd.innerHTML=DwtInputField._NOERROR_ICON_HTML
}
this.setToolTipContent(null);
n=true
}
this._updateClassName();
if(this._validationCallback){
this._validationCallback.run(this,n,a)
}
return o
};
DwtInputField.prototype._focusByMouseUpEvent=function(){
if(this.getEnabled()){
this._hasFocus=true
}};
DwtInputField.prototype._replaceElementHook=function(t,a,e,o){
a=this.getInputElement();
DwtControl.prototype._replaceElementHook.call(this,t,a,e,o);
if(t.id){
a.id=t.id
}
if(t.size){
a.size=t.size
}
if(t.title){
this.setHint(t.title)
}};
DwtInputField.prototype.__createInputEl=function(r){
var t=this._inputField;
if(t){
for(var n in this._inputEventHandlers){
t.removeAttribute(n)
}}
var s=this._type!=DwtInputField.PASSWORD?"text":"password";
var o=document.createElement(AjxEnv.isIE?["<INPUT type='",s,"'>"].join(""):"INPUT");
if(!AjxEnv.isIE){
o.type=s
}
this._inputField=o;
var a=r?r.size:t.size;
var e=r?r.maxLen:t.maxLength;
o.autocomplete="off";
if(a){
o.size=a
}
if(e){
o.maxLength=e
}
o.value=(r?r.initialValue:t.value)||"";
o.readonly=t?t.readonly:false;
o.onkeyup=DwtInputField._keyUpHdlr;
o.onblur=DwtInputField._blurHdlr;
o.onfocus=DwtInputField._focusHdlr;
for(var n in this._inputEventHandlers){
o[n]=this._inputEventHandlers[n]
}
this._tabGroup.removeAllMembers();
this._tabGroup.addMember(o);
return o
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPasswordField")){
DwtPasswordField=function(e){
if(arguments.length==0){
return
}
e=e||{
parent:DwtShell.getShell(window)};
e.type=DwtInputField.PASSWORD;
DwtInputField.call(this,e);
this._tabGroup=new DwtTabGroup(this._htmlElId);
this._createHtml()
};
DwtPasswordField.prototype=new DwtInputField;
DwtPasswordField.prototype.constructor=DwtPasswordField;
DwtPasswordField.prototype.TEMPLATE="dwt.Widgets#DwtPasswordField";
DwtPasswordField.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtPasswordField.prototype.setShowPassword=function(e){
this._showCheckbox.setSelected(e);
this.setInputType(e?DwtInputField.STRING:DwtInputField.PASSWORD)
};
DwtPasswordField.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtPasswordField.prototype._createHtmlFromTemplate=function(a,n){
this._tabGroup.removeAllMembers();
var e=document.createDocumentFragment();
var r=this.getHtmlElement().firstChild;
while(r){
var o=r.nextSibling;
e.appendChild(r);
r=o
}
DwtInputField.prototype._createHtmlFromTemplate.apply(this,arguments);
var s=document.getElementById(n.id+"_input");
s.appendChild(e);
this._tabGroup.addMember(this.getInputElement());
var t=document.getElementById(n.id+"_show_password");
if(t){
this._showCheckbox=new DwtCheckbox({
parent:this}
);
this._showCheckbox.setText(AjxMsg.showPassword);
this._showCheckbox.addSelectionListener(new AjxListener(this,this._handleShowCheckbox));
this._showCheckbox.replaceElement(t);
this._tabGroup.addMember(this._showCheckbox)
}};
DwtPasswordField.prototype._handleShowCheckbox=function(e){
this.setShowPassword(e.detail)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtSash")){
DwtSash=function(a){
a=Dwt.getParams(arguments,DwtSash.PARAMS);
a.className=a.className||"DwtSash";
a.posStyle=a.posStyle||DwtControl.ABSOLUTE_STYLE;
DwtControl.call(this,a);
var t=this.getHtmlElement();
var e="dwt.Widgets#";
if(!a.style||a.style!=DwtSash.HORIZONTAL_STYLE){
this._style=DwtSash.VERTICAL_STYLE;
t.style.cursor=AjxEnv.isIE?"row-resize":"s-resize";
t.innerHTML=AjxTemplate.expand(e+"DwtVerticalSash")
}else{
this._style=DwtSash.HORIZONTAL_STYLE;
t.style.cursor=AjxEnv.isIE?"col-resize":"w-resize";
t.innerHTML=AjxTemplate.expand(e+"DwtHorizontalSash")
}
this._threshold=(a.threshold>0)?a.threshold:1;
this._captureObj=new DwtMouseEventCapture({
targetObj:this,id:"DwtSash",mouseOverHdlr:DwtSash._mouseOverHdlr,mouseDownHdlr:DwtSash._mouseDownHdlr,mouseMoveHdlr:DwtSash._mouseMoveHdlr,mouseUpHdlr:DwtSash._mouseUpHdlr,mouseOutHdlr: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.PARAMS=["parent","style","className","threshold","posStyle"];
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(e,t){
this._callbackFunc=e;
this._callbackObj=t
};
DwtSash._mouseOverHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtSash._mouseDownHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t,true);
if(e.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(t,true,false);
return false
}
DwtEventManager.notifyListeners(DwtEvent.ONMOUSEDOWN,e);
var a=e.dwtObj;
if(a._callbackFunc!=null){
a._captureObj.capture();
a._startCoord=(a._style==DwtSash.HORIZONTAL_STYLE)?e.docX:e.docY
}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtSash._mouseMoveHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
var o=0;
var a=DwtMouseEventCapture.getTargetObj();
if(a._style==DwtSash.HORIZONTAL_STYLE){
if(e.docX>0&&e.docX!=a._startCoord){
o=e.docX-a._startCoord
}}else{
if(e.docY>0&&e.docY!=a._startCoord){
o=e.docY-a._startCoord
}}
if(Math.abs(o)>=a._threshold){
if(a._callbackObj!=null){
o=a._callbackFunc.call(a._callbackObj,o)
}else{
o=a._callbackFunc(o)
}
a._startCoord+=o;
if(o!=0&&a.getHtmlElement().style.position==Dwt.ABSOLUTE_STYLE){
if(a._style==DwtSash.HORIZONTAL_STYLE){
a.setLocation(a.getLocation().x+o,Dwt.DEFAULT)
}else{
a.setLocation(Dwt.DEFAULT,a.getLocation().y+o)
}}}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtSash._mouseUpHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
if(e.button!=DwtMouseEvent.LEFT){
DwtUiEvent.setBehaviour(t,true,false);
return false
}
if(DwtMouseEventCapture.getTargetObj()._callbackFunc!=null){
DwtMouseEventCapture.getCaptureObj().release()
}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtSash._mouseOutHdlr=function(t){
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtToolBar")){
DwtToolBar=function(a){
if(arguments.length==0){
return
}
a=Dwt.getParams(arguments,DwtToolBar.PARAMS);
a.className=a.className||"ZToolbar";
DwtComposite.call(this,a);
if(a.parent instanceof DwtToolBar){
this._hasSetMouseEvents=a.parent._hasSetMouseEvents
}
if(a.handleMouse!==false&&!this._hasSetMouseEvents){
var e=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
this._setEventHdlrs(e);
this._hasSetMouseEvents=true
}
this._style=a.style||DwtToolBar.HORIZ_STYLE;
this._items=[];
this._createHtml();
this._numFillers=0;
this._curFocusIndex=0;
var t=(this._style==DwtToolBar.HORIZ_STYLE)?"horiz":"vert";
this._keyMapName=["DwtToolBar",t].join("-")
};
DwtToolBar.PARAMS=["parent","className","posStyle","style","index"];
DwtToolBar.prototype=new DwtComposite;
DwtToolBar.prototype.constructor=DwtToolBar;
DwtToolBar.prototype.toString=function(){
return"DwtToolBar"
};
DwtToolBar.HORIZ_STYLE=1;
DwtToolBar.VERT_STYLE=2;
DwtToolBar.ELEMENT=1;
DwtToolBar.SPACER=2;
DwtToolBar.SEPARATOR=3;
DwtToolBar.FILLER=4;
DwtToolBar.FIRST_ITEM="ZFirstItem";
DwtToolBar.LAST_ITEM="ZLastItem";
DwtToolBar.SELECTED_NEXT=DwtControl.SELECTED+"Next";
DwtToolBar.SELECTED_PREV=DwtControl.SELECTED+"Prev";
DwtToolBar._NEXT_PREV_RE=new RegExp("\\b"+[DwtToolBar.SELECTED_NEXT,DwtToolBar.SELECTED_PREV].join("|")+"\\b","g");
DwtToolBar.prototype.TEMPLATE="dwt.Widgets#ZToolbar";
DwtToolBar.prototype.ITEM_TEMPLATE="dwt.Widgets#ZToolbarItem";
DwtToolBar.prototype.SEPARATOR_TEMPLATE="dwt.Widgets#ZToolbarSeparator";
DwtToolBar.prototype.SPACER_TEMPLATE="dwt.Widgets#ZToolbarSpacer";
DwtToolBar.prototype.FILLER_TEMPLATE="dwt.Widgets#ZToolbarFiller";
DwtToolBar.__itemCount=0;
DwtToolBar.prototype.dispose=function(){
this._itemsEl=null;
this._prefixEl=null;
this._suffixEl=null;
DwtComposite.prototype.dispose.call(this)
};
DwtToolBar.prototype.getItem=function(e){
return this._children.get(e)
};
DwtToolBar.prototype.getItemCount=function(){
return this._children.size()
};
DwtToolBar.prototype.getItems=function(){
return this._children.getArray()
};
DwtToolBar.prototype.addSpacer=function(t,e){
var a=this._createSpacerElement();
this._addItem(DwtToolBar.SPACER,a,e);
return a
};
DwtToolBar.prototype.addSeparator=function(a,e){
var t=this._createSeparatorElement();
this._addItem(DwtToolBar.SEPARATOR,t,e);
return t
};
DwtToolBar.prototype.removeSeparator=function(e){
this._removeItem(e)
};
DwtToolBar.prototype.addFiller=function(a,e){
var t=this._createFillerElement();
this._addItem(DwtToolBar.FILLER,t,e);
return t
};
DwtToolBar.prototype.addChild=function(a,e){
DwtComposite.prototype.addChild.apply(this,arguments);
var t=this._createItemElement();
t.appendChild(a.getHtmlElement());
this._addItem(DwtToolBar.ELEMENT,t,e)
};
DwtToolBar.prototype.getKeyMapName=function(){
return this._keyMapName
};
DwtToolBar.prototype.handleKeyAction=function(t,o){
var a=this.getItem(this._curFocusIndex);
var e=this.getItemCount();
if(e<2){
return true
}
switch(t){
case DwtKeyMap.PREV:if(this._curFocusIndex>0){
this._moveFocus(true)
}
break;
case DwtKeyMap.NEXT:if(this._curFocusIndex<(e-1)){
this._moveFocus()
}
break;
default:if(a){
return a.handleKeyAction(t,o)
}}
return true
};
DwtToolBar.prototype._createItemId=function(t){
t=t||this._htmlElId;
var e=[t,"item",++DwtToolBar.__itemCount].join("_");
return e
};
DwtToolBar.prototype._createHtml=function(){
var e={
id:this._htmlElId};
this._createHtmlFromTemplate(this.TEMPLATE,e);
this._itemsEl=document.getElementById(e.id+"_items");
this._prefixEl=document.getElementById(e.id+"_prefix");
this._suffixEl=document.getElementById(e.id+"_suffix")
};
DwtToolBar.prototype._createItemElement=function(a){
a=a||this.ITEM_TEMPLATE;
var o={
id:this._htmlElId,itemId:this._createItemId()};
var t=AjxTemplate.expand(a,o);
var e=AjxStringUtil.calcDIV();
e.innerHTML=t;
return e.firstChild.rows[0].cells[0]
};
DwtToolBar.prototype._createSpacerElement=function(e){
return this._createItemElement(e||this.SPACER_TEMPLATE)
};
DwtToolBar.prototype._createSeparatorElement=function(e){
return this._createItemElement(e||this.SEPARATOR_TEMPLATE)
};
DwtToolBar.prototype._createFillerElement=function(e){
return this._createItemElement(e||this.FILLER_TEMPLATE)
};
DwtToolBar.prototype._addItem=function(o,a,t){
var n=this._items[t]||this._suffixEl;
var e=t||(typeof t=="number")?t:this._items.length;
this._items.splice(e,0,a);
this._itemsEl.insertBefore(a,n)
};
DwtToolBar.prototype._removeItem=function(t){
for(var e=0;
e<this._items.length;
e++){
if(this._items[e]==t){
this._items.splice(e,1);
this._itemsEl.removeChild(t);
break
}}};
DwtToolBar.prototype._focus=function(e){
if(!this._submenuKeySet){
var a=this.shell.getKeyboardMgr();
if(a.isEnabled()){
var t=a.__keyMapMgr;
if(t){
if(this._style==DwtToolBar.HORIZ_STYLE){
t.removeMapping("DwtButton","ArrowRight");
t.setMapping("DwtButton","ArrowDown",DwtKeyMap.SUBMENU)
}else{
t.removeMapping("DwtButton","ArrowDown");
t.setMapping("DwtButton","ArrowRight",DwtKeyMap.SUBMENU)
}
t.reloadMap("DwtButton")
}}
this._submenuKeySet=true
}
e=e?e:this._getFocusItem(this._curFocusIndex);
if(e){
e._hasFocus=true;
e._focus()
}else{
this._moveFocus()
}};
DwtToolBar.prototype._blur=function(e){
e=e?e:this._getFocusItem(this._curFocusIndex);
if(e){
e._hasFocus=false;
e._blur()
}};
DwtToolBar.prototype._getFocusItem=function(e){
var t=this.getItem(e);
if(!t||(t instanceof DwtToolBar)){
return null
}
if(t._noFocus){
return null
}
if(t.getEnabled&&!t.getEnabled()){
return null
}
if(t.getVisible&&!t.getVisible()){
return null
}
return t
};
DwtToolBar.prototype._moveFocus=function(e){
var t=this._curFocusIndex;
var a=this.getItemCount()-1;
var o=null;
while(!o&&t>=0&&t<=a){
t=e?t-1:t+1;
o=this._getFocusItem(t)
}
if(o){
this._blur();
this._curFocusIndex=t;
this._focus(o)
}};
DwtToolBar.prototype.__markPrevNext=function(r,s){
var e=this.__getButtonIndex(r);
var o=this.__getButtonAt(e-1);
var t=this.__getButtonAt(e+1);
if(s){
if(o){
Dwt.delClass(o.getHtmlElement(),DwtToolBar._NEXT_PREV_RE,DwtToolBar.SELECTED_PREV)
}
if(t){
Dwt.delClass(t.getHtmlElement(),DwtToolBar._NEXT_PREV_RE,DwtToolBar.SELECTED_NEXT)
}}else{
if(o){
Dwt.delClass(o.getHtmlElement(),DwtToolBar._NEXT_PREV_RE)
}
if(t){
Dwt.delClass(t.getHtmlElement(),DwtToolBar._NEXT_PREV_RE)
}}
var n=this.__getButtonAt(0);
if(n){
Dwt.addClass(n.getHtmlElement(),DwtToolBar.FIRST_ITEM)
}
var a=this.__getButtonAt(this.getItemCount()-1);
if(a){
Dwt.addClass(a.getHtmlElement(),DwtToolBar.LAST_ITEM)
}};
DwtToolBar.prototype.__getButtonIndex=function(a){
var t=0;
for(var e in this._buttons){
if(e==a){
return t
}
t++
}
return -1
};
DwtToolBar.prototype.__getButtonAt=function(t){
var a=0;
for(var e in this._buttons){
if(a==t){
return this._buttons[e]
}
a++
}
return null
};
DwtToolBarButton=function(e){
if(arguments.length==0){
return
}
var e=Dwt.getParams(arguments,DwtToolBarButton.PARAMS);
e.className=e.className||"ZToolbarButton";
DwtButton.call(this,e)
};
DwtToolBarButton.PARAMS=["parent","style","className","posStyle","actionTiming","id","index"];
DwtToolBarButton.prototype=new DwtButton;
DwtToolBarButton.prototype.constructor=DwtToolBarButton;
DwtToolBarButton.prototype.TEMPLATE="dwt.Widgets#ZToolbarButton"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtToolTip")){
DwtToolTip=function(a,o,t){
if(arguments.length==0){
return
}
this.shell=a;
this._dialog=t;
this._poppedUp=false;
this._div=document.createElement("div");
this._div.className=o||"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 e="dwt.Widgets#"+this._borderStyle;
this._div.innerHTML=AjxTemplate.expand(e,"tooltip");
var n=AjxTemplate.getParams(e);
this._borderWidth=Number(n.width);
this._borderHeight=Number(n.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(t,e){
this._content=t;
if(e){
this._contentDiv.innerHTML=this._content
}};
DwtToolTip.prototype.popup=function(e,a,t){
if(this._popupAction){
AjxTimedAction.cancelAction(this._popupAction);
this._popupAction=null
}
if(this._content!=null){
if(!t){
this._contentDiv.innerHTML=this._content
}
this._popupAction=new AjxTimedAction(this,this._positionElement,[e,a]);
AjxTimedAction.scheduleAction(this._popupAction,5)
}};
DwtToolTip.prototype.popdown=function(){
if(this._popupAction){
AjxTimedAction.cancelAction(this._popupAction);
this._popupAction=null
}
if(this._content!=null&&this._poppedUp){
Dwt.setLocation(this._div,Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
this._poppedUp=false
}};
DwtToolTip.prototype._positionElement=function(A,O){
this._popupAction=null;
var n=this._div;
var f="tooltip";
var T=this._dialog;
var z=5;
var d=8;
var h=8;
var e=document.getElementById(f+"TopPointer");
e.style.display="block";
var w=Dwt.getSize(e),x=w.x,a=w.y;
var s=document.getElementById(f+"BottomPointer");
s.style.display="block";
w=Dwt.getSize(s),bottomPointerWidth=w.x,bottomPointerHeight=w.y;
var q=e;
var r=DwtShell.getShell(window).getSize(),D=r.x,p=r.y;
var C=Dwt.getSize(n),j=C.x,u=C.y;
var m=this._borderHeight,S=this._borderHeight,y=this._borderWidth,k=this._borderWidth;
var B=A-j/2-d,W;
var t,o,v;
if(O+h+a-m+u<p-z){
s.style.display="none";
W=O+h+a-m;
t=m-a;
v=x;
q=e
}else{
e.style.display="none";
W=O-h-bottomPointerHeight+S-u;
t=u-S;
v=bottomPointerWidth;
q=s
}
var c=document.getElementById(f+"Contents");
if(j-y-k<v){
c.width=v;
c.style.width=String(v)+"px"
}else{
c.width="auto";
c.style.width="auto"
}
if(B<z){
B=z
}else{
if(B+j>D-z){
B=D-z-j
}}
o=A-B-v/2;
if(o+v>j-k){
o=j-k-v
}
if(o<y){
o=y
}
q.style.left=o;
q.style.top=t;
Dwt.setLocation(n,B,W);
var g=T?T.getZIndex()+Dwt._Z_INC:Dwt.Z_TOOLTIP;
Dwt.setZIndex(n,g);
this._poppedUp=true
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtTreeItem")){
DwtTreeItem=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtTreeItem.PARAMS);
var e=t.parent;
if(e instanceof DwtTree){
this._tree=e
}else{
if(e instanceof DwtTreeItem){
this._tree=e._tree
}else{
throw new DwtException("DwtTreeItem parent must be a DwtTree or DwtTreeItem",DwtException.INVALIDPARENT,"DwtTreeItem")
}}
this._origClassName=t.className||"DwtTreeItem";
this._textClassName=[this._origClassName,"Text"].join("-");
this._selectedClassName=[this._origClassName,DwtCssStyle.SELECTED].join("-");
this._selectedFocusedClassName=[this._origClassName,DwtCssStyle.SELECTED,DwtCssStyle.FOCUSED].join("-");
this._actionedClassName=[this._origClassName,DwtCssStyle.ACTIONED].join("-");
this._dragOverClassName=[this._origClassName,DwtCssStyle.DRAG_OVER].join("-");
t.deferred=(t.deferred!==false);
t.className=null;
DwtComposite.call(this,t);
this._imageInfoParam=t.imageInfo;
this._extraInfo=t.extraInfo;
this._textParam=t.text;
this._deferred=t.deferred;
this._expandNodeImage=t.expandNodeImage||"NodeExpanded";
this._collapseNodeImage=t.collapseNodeImage||"NodeCollapsed";
this._itemChecked=false;
this._initialized=false;
this._selectionEnabled=Boolean(t.selectable!==false);
this._forceNotifySelection=Boolean(t.forceNotifySelection);
this._actionEnabled=true;
this._forceNotifyAction=Boolean(t.forceNotifyAction);
this._dndScrollCallback=t.dndScrollCallback;
this._dndScrollId=t.dndScrollId;
if(this._tree.isCheckedStyle){
this.enableSelection(false);
this._selectedClassName=this._origClassName
}
if(t.singleClickAction){
this._singleClickAction=true;
this._selectedFocusedClassName=this._selectedClassName=this._textClassName;
this._hoverClassName=[this._origClassName,DwtCssStyle.HOVER].join("-")
}else{
this._hoverClassName=this._textClassName
}
if(e instanceof DwtTree||(e._initialized&&(!e._deferred||e._expanded))){
this._initialize(t.index)
}else{
e._addDeferredChild(this,t.index);
this._index=t.index
}};
DwtTreeItem.PARAMS=["parent","index","text","imageInfo","deferred","className","posStyle","forceNotifySelection","forceNotifyAction"];
DwtTreeItem.prototype=new DwtComposite;
DwtTreeItem.prototype.constructor=DwtTreeItem;
DwtTreeItem.prototype.TEMPLATE="dwt.Widgets#ZTreeItem";
DwtTreeItem.prototype._checkBoxVisible=true;
DwtTreeItem._NODECELL_DIM="16px";
DwtTreeItem._processedMouseDown=false;
DwtTreeItem.prototype.dispose=function(){
this._itemDiv=null;
this._nodeCell=null;
this._checkBoxCell=null;
this._checkedImg=null;
this._checkBox=null;
this._imageCell=null;
this._textCell=null;
this._childDiv=null;
DwtComposite.prototype.dispose.call(this)
};
DwtTreeItem.prototype.toString=function(){
return"DwtTreeItem"
};
DwtTreeItem.prototype.getChecked=function(){
return this._itemChecked
};
DwtTreeItem.prototype.setChecked=function(e,t){
if((this._itemChecked!=e)||t){
this._itemChecked=e;
if(this._checkBox!=null&&(this._checkBoxCell&&Dwt.getVisible(this._checkBoxCell))){
Dwt.setVisible(this._checkedImg,e)
}}};
DwtTreeItem.prototype._handleCheckboxOnclick=function(e){
this.setChecked(!Dwt.getVisible(this._checkedImg));
e=e||window.event;
e.item=this;
this._tree._itemChecked(this,e)
};
DwtTreeItem.prototype.getExpanded=function(){
return this._expanded
};
DwtTreeItem.prototype.setExpanded=function(t,s,n){
if(t){
var r=this.parent;
while(r instanceof DwtTreeItem&&!r._expanded){
r.setExpanded(true);
r=r.parent
}
this._realizeDeferredChildren()
}
if(this.getNumChildren()){
if(t&&s){
if(!this._expanded){
this._expand(t,null,n)
}
var e=this.getChildren();
for(var o=0;
o<e.length;
o++){
if(e[o] instanceof DwtTreeItem){
e[o].setExpanded(t,s,n)
}}}else{
if(this._expanded!=t){
this._expand(t,null,n)
}}}};
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(e){
if(this._initialized){
if(this._imageCell){
AjxImg.setImage(this._imageCell,e)
}
this._imageInfo=e
}else{
this._imageInfoParam=e
}};
DwtTreeItem.prototype.setDndImage=function(e){
this._dndImageInfo=e
};
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(e){
if(this._initialized){
if(!e){
e=""
}
this._text=this._textCell.innerHTML=e
}else{
this._textParam=e
}};
DwtTreeItem.prototype.setDndText=function(e){
this._dndText=e
};
DwtTreeItem.prototype.showCheckBox=function(e){
this._checkBoxVisible=e;
if(this._checkBoxCell){
Dwt.setVisible(this._checkBoxCell,e)
}};
DwtTreeItem.prototype.showExpansionIcon=function(e){
if(this._nodeCell){
Dwt.setVisible(this._nodeCell,e)
}};
DwtTreeItem.prototype.enableSelection=function(e){
this._selectionEnabled=e;
this._selectedClassName=e?this._origClassName+"-"+DwtCssStyle.SELECTED:this._origClassName
};
DwtTreeItem.prototype.enableAction=function(e){
this._actionEnabled=e
};
DwtTreeItem.prototype.addSeparator=function(e){
this._children.add((new DwtTreeItemSeparator(this)),e)
};
DwtTreeItem.prototype.setVisible=function(a,t,e){
if(t&&!e){
Dwt.setVisible(this._itemDiv,a)
}else{
if(e&&!t){
Dwt.setVisible(this._childDiv,a)
}else{
DwtComposite.prototype.setVisible.call(this,a)
}}};
DwtTreeItem.prototype.removeChild=function(t){
if(t._initialized){
this._tree._deselect(t);
if(this._childDiv){
this._childDiv.removeChild(t.getHtmlElement())
}}
this._children.remove(t);
if(this._children.size()==0){
if(this._expanded){
this._expanded=false
}
if(this._initialized&&this._nodeCell){
AjxImg.setImage(this._nodeCell,"Blank_16");
var e=AjxImg.getImageElement(this._nodeCell);
if(e){
Dwt.clearHandler(e,DwtEvent.ONMOUSEDOWN)
}}}};
DwtTreeItem.prototype.getKeyMapName=function(){
return"DwtTreeItem"
};
DwtTreeItem.prototype.handleKeyAction=function(a,r){
switch(a){
case DwtKeyMap.NEXT:var n=this._tree._getNextTreeItem(true);
if(n){
n._tree.setSelection(n,false,true)
}
break;
case DwtKeyMap.PREV:var n=this._tree._getNextTreeItem(false);
if(n){
n._tree.setSelection(n,false,true)
}
break;
case DwtKeyMap.EXPAND:if(!this._expanded){
this.setExpanded(true,false,true)
}
break;
case DwtKeyMap.COLLAPSE:if(this._expanded){
this.setExpanded(false,false,true)
}
break;
case DwtKeyMap.ACTION:var c=this.getHtmlElement();
var h=Dwt.toWindow(c,0,0);
var o=this.getSize();
var t=h.x+o.x/4;
var e=h.y+o.y/2;
this._gotMouseDownRight=true;
this._emulateSingleClick({
dwtObj:this,target:c,button:DwtMouseEvent.RIGHT,docX:t,docY:e,kbNavEvent:true}
);
break;
default:return false
}
return true
};
DwtTreeItem.prototype.addNodeIconListeners=function(){
var e=AjxImg.getImageElement(this._nodeCell);
if(e){
Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtTreeItem._nodeIconMouseUpHdlr)
}};
DwtTreeItem.prototype._initialize=function(e,o,a){
this._checkState();
if(AjxEnv.isIE){
this._setEventHdlrs([DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE])
}
if(AjxEnv.isSafari){
this._setEventHdlrs([DwtEvent.ONCONTEXTMENU])
}
var t={
id:this._htmlElId,divClassName:this._origClassName,isCheckedStyle:this._tree.isCheckedStyle,textClassName:this._textClassName};
this._createHtmlFromTemplate(this.TEMPLATE,t);
this.parent._addItem(this,e,o);
this._itemDiv=document.getElementById(t.id+"_div");
this._nodeCell=document.getElementById(t.id+"_nodeCell");
this._checkBoxCell=document.getElementById(t.id+"_checkboxCell");
this._checkBox=document.getElementById(t.id+"_checkbox");
this._checkedImg=document.getElementById(t.id+"_checkboxImg");
this._imageCell=document.getElementById(t.id+"_imageCell");
this._textCell=document.getElementById(t.id+"_textCell");
this._extraCell=document.getElementById(t.id+"_extraCell");
if(this._nodeCell){
this._nodeCell.style.width=this._nodeCell.style.height=DwtTreeItem._NODECELL_DIM;
if(this._children.size()>0||a){
AjxImg.setImage(this._nodeCell,this._collapseNodeImage);
this.addNodeIconListeners()
}}
if(this._extraCell){
AjxImg.setImage(this._extraCell,(this._extraInfo||"Blank_16"))
}
if(this._tree.isCheckedStyle&&this._checkBox){
this._checkBox.onclick=AjxCallback.simpleClosure(this._handleCheckboxOnclick,this);
this.showCheckBox(this._checkBoxVisible);
this.setChecked(this._tree.isCheckedByDefault,true)
}
if(this._imageCell&&this._imageInfoParam){
AjxImg.setImage(this._imageCell,this._imageInfoParam);
this._imageInfo=this._imageInfoParam
}
if(this._textCell&&this._textParam){
this._textCell.innerHTML=this._text=this._textParam
}
this._expanded=this._selected=this._actioned=false;
this._gotMouseDownLeft=this._gotMouseDownRight=false;
this._addMouseListeners();
this._initialized=true
};
DwtTreeItem.prototype.setTreeItemColor=function(o){
var s=this._htmlElId+"_table";
var a=document.getElementById(s);
var n=document.getElementById(this._htmlElId+"_div");
var t=this.getHtmlElement();
var e=this._origClassName+" "+o;
if(n){
n.className=e
}else{
if(t){
t.className=o
}}};
DwtTreeItem.prototype._addMouseListeners=function(){
var t=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONDBLCLICK];
if(AjxEnv.isIE){
t.push(DwtEvent.ONMOUSEENTER,DwtEvent.ONMOUSELEAVE)
}else{
t.push(DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT)
}
if(AjxEnv.isSafari){
t.push(DwtEvent.ONCONTEXTMENU)
}
for(var e=0;
e<t.length;
e++){
this.addListener(t[e],DwtTreeItem._listeners[t[e]])
}};
DwtTreeItem.prototype._addDeferredChild=function(a,e){
if(this._initialized&&this._children.size()==0){
if(this._nodeCell){
AjxImg.setImage(this._nodeCell,this._collapseNodeImage);
var t=AjxImg.getImageElement(this._nodeCell);
if(t){
Dwt.setHandler(t,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr);
Dwt.setHandler(t,DwtEvent.ONMOUSEUP,DwtTreeItem._nodeIconMouseUpHdlr)
}}}
this._children.add(a,e)
};
DwtTreeItem.prototype.addChild=function(e){};
DwtTreeItem.prototype._addItem=function(a,t,s){
if(!this._children.contains(a)){
this._children.add(a,t)
}
if(this._childDiv==null){
this._childDiv=document.createElement("div");
this._childDiv.className=(this.parent!=this._tree)?"DwtTreeItemChildDiv":"DwtTreeItemLevel1ChildDiv";
this.getHtmlElement().appendChild(this._childDiv);
if(!this._expanded){
this._childDiv.style.display="none"
}}
if(s&&this._nodeCell){
if(AjxImg.getImageClass(this._nodeCell)==AjxImg.getClassForImage("Blank_16")){
AjxImg.setImage(this._nodeCell,this._expanded?this._expandNodeImage:this._collapseNodeImage);
var n=AjxImg.getImageElement(this._nodeCell);
if(n){
Dwt.setHandler(n,DwtEvent.ONMOUSEDOWN,DwtTreeItem._nodeIconMouseDownHdlr)
}}}
var e=this._childDiv;
var o=e.childNodes.length;
if(t==null||t>=o||o==0){
e.appendChild(a.getHtmlElement())
}else{
e.insertBefore(a.getHtmlElement(),e.childNodes[t])
}};
DwtTreeItem.prototype.sort=function(e){
this._children.sort(e);
if(this._childDiv){
this._setChildElOrder()
}else{
this._needsSort=true
}};
DwtTreeItem.prototype._setChildElOrder=function(e){
var t=document.createDocumentFragment();
this._children.foreach(function(o,a){
t.appendChild(o.getHtmlElement());
o._index=a
}
);
this._childDiv.appendChild(t)
};
DwtTreeItem.prototype._getDragProxy=function(){
var t=document.createElement("div");
Dwt.setPosition(t,Dwt.ABSOLUTE_STYLE);
var a=document.createElement("table");
t.appendChild(a);
a.cellSpacing=a.cellPadding=0;
var o=a.insertRow(0);
var e=0;
var n=o.insertCell(e++);
n.noWrap=true;
if(this._dndImageInfo){
AjxImg.setImage(n,this._dndImageInfo)
}else{
if(this._imageInfo){
AjxImg.setImage(n,this._imageInfo)
}}
n=o.insertCell(e);
n.noWrap=true;
n.className=this._origClassName;
if(this._dndText){
n.innerHTML=this._dndText
}else{
if(this._text){
n.innerHTML=this._text
}}
this.shell.getHtmlElement().appendChild(t);
Dwt.setZIndex(t,Dwt.Z_DND);
return t
};
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(e){
if(this._preDragClassName){
this._textCell.className=this._preDragClassName
}};
DwtTreeItem.prototype._drop=function(){
if(this._preDragClassName){
this._textCell.className=this._preDragClassName
}};
DwtTreeItem._nodeIconMouseDownHdlr=function(t){
var a=DwtControl.getTargetControl(t);
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t,a);
if(e.button==DwtMouseEvent.LEFT){
a._expand(!a._expanded,e)
}else{
if(e.button==DwtMouseEvent.RIGHT){
e.dwtObj._tree._itemActioned(e.dwtObj,e)
}}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtTreeItem._nodeIconMouseUpHdlr=function(t){
var a=DwtControl.getTargetControl(t);
var e=DwtShell.mouseEvent;
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtTreeItem.prototype._expand=function(t,a,e){
if(!t){
this._expanded=false;
this._childDiv.style.display="none";
if(this._nodeCell){
AjxImg.setImage(this._nodeCell,this._collapseNodeImage)
}
this._tree._itemCollapsed(this,a,e)
}else{
this._realizeDeferredChildren();
this._expanded=true;
this._childDiv.style.display="block";
if(this._nodeCell){
AjxImg.setImage(this._nodeCell,this._expandNodeImage)
}
this._tree._itemExpanded(this,a,e)
}};
DwtTreeItem.prototype._realizeDeferredChildren=function(){
var e=this._children.getArray();
for(var t=0;
t<e.length;
t++){
var o=e[t];
if(!o._initialized){
o._initialize(o._index,true)
}else{
if(o._isSeparator&&!o.div){
var n=o.div=document.createElement("div");
n.className="vSpace";
this._childDiv.appendChild(n);
o._initialized=true
}}}
if(this._needsSort){
if(e.length){
this._setChildElOrder()
}
delete this.__needsSort
}};
DwtTreeItem.prototype._isChildOf=function(e){
var t=this.parent;
while(t&&t!=this._tree){
if(t==e){
return true
}
t=t.parent
}
return false
};
DwtTreeItem.prototype._setSelected=function(e,t){
if(this._selected!=e){
this._selected=e;
if(!this._initialized){
this._initialize()
}
if(!this._itemDiv){
return
}
if(e&&(this._selectionEnabled||this._forceNotifySelection)){
this._itemDiv.className=this._selectedClassName;
if(!t){
this.focus()
}
return true
}else{
this._itemDiv.className=this._origClassName;
return false
}}};
DwtTreeItem.prototype._setActioned=function(e){
if(this._actioned!=e){
this._actioned=e;
if(!this._initialized){
this._initialize()
}
if(!this._itemDiv){
return
}
if(e&&(this._actionEnabled||this._forceNotifyAction)&&!this._selected){
this._itemDiv.className=this._actionedClassName;
return true
}
if(!e){
if(!this._selected){
this._itemDiv.className=this._origClassName
}
return false
}}};
DwtTreeItem.prototype._focus=function(){
if(!this._itemDiv){
return
}
if(this._selectionEnabled){
this._itemDiv.className=this._selectedFocusedClassName
}};
DwtTreeItem.prototype._blur=function(){
if(!this._itemDiv){
return
}
this._itemDiv.className=this._selected?this._selectedClassName:this._origClassName
};
DwtTreeItem._mouseDownListener=function(e){
var t=e.dwtObj;
if(!t){
return false
}
if(e.target==t._childDiv){
return
}
if(e.button==DwtMouseEvent.LEFT&&(t._selectionEnabled||t._forceNotifySelection)){
t._gotMouseDownLeft=true
}else{
if(e.button==DwtMouseEvent.RIGHT&&(t._actionEnabled||t._forceNotifyAction)){
t._gotMouseDownRight=true
}}};
DwtTreeItem._mouseOutListener=function(e){
var t=e.dwtObj;
if(!t){
return false
}
if(e.target==t._childDiv){
return
}
t._gotMouseDownLeft=false;
t._gotMouseDownRight=false;
if(t._singleClickAction&&t._textCell){
t._textCell.className=t._textClassName
}};
DwtTreeItem._mouseOverListener=function(e){
var t=e.dwtObj;
if(!t){
return false
}
if(e.target==t._childDiv){
return
}
if(t._singleClickAction&&t._textCell){
t._textCell.className=t._hoverClassName
}};
DwtTreeItem._mouseUpListener=function(e){
var t=e.dwtObj;
if(!t){
return false
}
if(e.target==t._childDiv){
return
}
if(e.button==DwtMouseEvent.LEFT&&t._gotMouseDownLeft){
t._tree._itemClicked(t,e)
}else{
if(e.button==DwtMouseEvent.RIGHT&&t._gotMouseDownRight){
t._tree._itemActioned(t,e)
}}};
DwtTreeItem._doubleClickListener=function(t){
var a=t.dwtObj;
if(!a){
return false
}
if(t.target==a._childDiv){
return
}
var o=DwtControl.getTargetControl(t);
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t,o);
if(e.button==DwtMouseEvent.LEFT||e.button==DwtMouseEvent.NONE){
e.dwtObj._tree._itemDblClicked(e.dwtObj,e)
}};
DwtTreeItem._contextListener=function(t){
if(AjxEnv.isSafari){
var a=DwtControl.getTargetControl(t);
var e=a?a.preventContextMenu():true;
if(e){
a.notifyListeners(DwtEvent.ONMOUSEDOWN,t);
return a.notifyListeners(DwtEvent.ONMOUSEUP,t)
}}};
DwtTreeItem.prototype._emulateSingleClick=function(e){
var t=new DwtMouseEvent();
this._setMouseEvent(t,e);
t.kbNavEvent=e.kbNavEvent;
this.notifyListeners(DwtEvent.ONMOUSEUP,t)
};
DwtTreeItem._listeners={};
DwtTreeItem._listeners[DwtEvent.ONMOUSEDOWN]=new AjxListener(null,DwtTreeItem._mouseDownListener);
DwtTreeItem._listeners[DwtEvent.ONMOUSEOUT]=new AjxListener(null,DwtTreeItem._mouseOutListener);
DwtTreeItem._listeners[DwtEvent.ONMOUSELEAVE]=new AjxListener(null,DwtTreeItem._mouseOutListener);
DwtTreeItem._listeners[DwtEvent.ONMOUSEENTER]=new AjxListener(null,DwtTreeItem._mouseOverListener);
DwtTreeItem._listeners[DwtEvent.ONMOUSEOVER]=new AjxListener(null,DwtTreeItem._mouseOverListener);
DwtTreeItem._listeners[DwtEvent.ONMOUSEUP]=new AjxListener(null,DwtTreeItem._mouseUpListener);
DwtTreeItem._listeners[DwtEvent.ONDBLCLICK]=new AjxListener(null,DwtTreeItem._doubleClickListener);
DwtTreeItem._listeners[DwtEvent.ONCONTEXTMENU]=new AjxListener(null,DwtTreeItem._contextListener);
DwtTreeItemSeparator=function(e){
this.parent=e;
this._isSeparator=true;
this._initialized=true
};
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
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtTree")){
DwtTree=function(a){
if(arguments.length==0){
return
}
a=Dwt.getParams(arguments,DwtTree.PARAMS);
a.className=a.className||"DwtTree";
DwtComposite.call(this,a);
var e=[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONDBLCLICK];
if(!AjxEnv.isIE){
e=e.concat([DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT])
}
this._setEventHdlrs(e);
var t=a.style;
if(!t){
this._style=DwtTree.SINGLE_STYLE
}else{
if(t==DwtTree.CHECKEDITEM_STYLE){
t|=DwtTree.SINGLE_STYLE
}
this._style=t
}
this.isCheckedStyle=((this._style&DwtTree.CHECKEDITEM_STYLE)!=0);
this.isCheckedByDefault=a.isCheckedByDefault;
this._selectedItems=new AjxVector();
this._selEv=new DwtSelectionEvent(true)
};
DwtTree.PARAMS=["parent","style","className","posStyle"];
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(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtTree.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtTree.prototype.addTreeListener=function(e){
this.addListener(DwtEvent.TREE,e)
};
DwtTree.prototype.removeTreeListener=function(e){
this.removeListener(DwtEvent.TREE,e)
};
DwtTree.prototype.getItemCount=function(){
return this._children.size()
};
DwtTree.prototype.getItems=function(){
return this._children.getArray()
};
DwtTree.prototype.deselectAll=function(){
var e=this._selectedItems.getArray();
var o=this._selectedItems.size();
for(var t=0;
t<o;
t++){
if(e[t]){
e[t]._setSelected(false)
}}
if(o>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(n,r,d,e){
if(!n){
return
}
var c=this._selectedItems.getArray();
var h=this._selectedItems.size();
var u;
var t=0;
var s=false;
for(var o=0;
o<h;
o++){
if(c[o]==n){
s=true
}else{
c[o]._setSelected(false);
this._selectedItems.remove(c[o]);
if(u==null){
u=new Array()
}
u[t++]=c[o]
}}
if(u&&!r){
this._notifyListeners(DwtEvent.SELECTION,u,DwtTree.ITEM_DESELECTED,null,this._selEv,d)
}
if(s){
return
}
this._selectedItems.add(n);
this._expandUp(n);
if(n._setSelected(true,e)&&!r){
this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_SELECTED,null,this._selEv,d)
}};
DwtTree.prototype.getSelectionCount=function(){
return this._selectedItems.size()
};
DwtTree.prototype.addChild=function(e){};
DwtTree.prototype.addSeparator=function(){
var e=document.createElement("div");
e.className="vSpace";
this.getHtmlElement().appendChild(e)
};
DwtTree.prototype._expandUp=function(t){
var e=t.parent;
while(e instanceof DwtTreeItem){
e.setExpanded(true);
e.setVisible(true);
e=e.parent
}};
DwtTree.prototype._addItem=function(t,e){
this._children.add(t,e);
var o=this.getHtmlElement();
var a=o.childNodes.length;
if(e==null||e>a){
o.appendChild(t.getHtmlElement())
}else{
o.insertBefore(t.getHtmlElement(),o.childNodes[e])
}};
DwtTree.prototype.sort=function(e){
this._children.sort(e);
var t=document.createDocumentFragment();
this._children.foreach(function(o,a){
t.appendChild(o.getHtmlElement());
o._index=a
}
);
this.getHtmlElement().appendChild(t)
};
DwtTree.prototype.removeChild=function(e){
this._children.remove(e);
this._selectedItems.remove(e);
this.getHtmlElement().removeChild(e.getHtmlElement())
};
DwtTree.prototype._getNextTreeItem=function(n){
var a=this.getSelection();
var c=(a&&a.length)?a[0]:null;
var e=null,h=-1;
var r=this.getTreeItemList(true);
if(c){
for(var o=0,s=r.length;
o<s;
o++){
var t=r[o];
if(t==c){
h=n?o+1:o-1;
break
}}
e=r[h]
}else{
if(r&&r.length){
e=n?r[0]:r[r.length-1]
}}
return e
};
DwtTree.prototype.getTreeItemList=function(e){
return this._addToList([],e)
};
DwtTree.prototype._addToList=function(n,s,o){
if(o&&!o._isSeparator&&(!s||(o.getVisible()&&o._selectionEnabled))){
n.push(o)
}
if(!o||!s||o._expanded){
var a=o||this;
var t=a.getChildren?a.getChildren():[];
for(var e=0;
e<t.length;
e++){
this._addToList(n,s,t[e])
}}
return n
};
DwtTree.prototype._deselect=function(e){
if(this._selectedItems.contains(e)){
this._selectedItems.remove(e);
e._setSelected(false);
this._notifyListeners(DwtEvent.SELECTION,[e],DwtTree.ITEM_DESELECTED,null,this._selEv)
}};
DwtTree.prototype._itemActioned=function(t,e){
if(this._actionedItem){
this._actionedItem._setActioned(false);
this._notifyListeners(DwtEvent.SELECTION,[this._actionedItem],DwtTree.ITEM_DESELECTED,e,this._selEv)
}
this._actionedItem=t;
t._setActioned(true);
this._notifyListeners(DwtEvent.SELECTION,[t],DwtTree.ITEM_ACTIONED,e,this._selEv)
};
DwtTree.prototype._itemChecked=function(t,e){
this._notifyListeners(DwtEvent.SELECTION,[t],DwtTree.ITEM_CHECKED,e,this._selEv)
};
DwtTree.prototype._itemClicked=function(n,o){
var t;
var e=this._selectedItems.getArray();
var s=this._selectedItems.size();
if(this._style&DwtTree.SINGLE_STYLE||(!o.shiftKey&&!o.ctrlKey)){
if(s>0){
for(t=0;
t<s;
t++){
e[t]._setSelected(false)
}
this._notifyListeners(DwtEvent.SELECTION,this._selectedItems.getArray(),DwtTree.ITEM_DESELECTED,o,this._selEv);
this._selectedItems.removeAll()
}
this._selectedItems.add(n);
if(n._setSelected(true)){
this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_SELECTED,o,this._selEv)
}}else{
if(o.ctrlKey){
if(this._selectedItems.contains(n)){
this._selectedItems.remove(n);
n._setSelected(false);
this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_DESELECTED,o,this._selEv)
}else{
this._selectedItems.add(n);
if(n._setSelected(true)){
this._notifyListeners(DwtEvent.SELECTION,[n],DwtTree.ITEM_SELECTED,o,this._selEv)
}}}else{}}};
DwtTree.prototype._itemDblClicked=function(t,e){
this._notifyListeners(DwtEvent.SELECTION,[t],DwtTree.ITEM_DBL_CLICKED,e,this._selEv)
};
DwtTree.prototype._itemExpanded=function(a,t,e){
if(!e){
this._notifyListeners(DwtEvent.TREE,[a],DwtTree.ITEM_EXPANDED,t,DwtShell.treeEvent)
}};
DwtTree.prototype._itemCollapsed=function(c,s,n){
var o;
if(!n){
this._notifyListeners(DwtEvent.TREE,[c],DwtTree.ITEM_COLLAPSED,s,DwtShell.treeEvent)
}
var h=false;
var r=this._selectedItems.getArray();
var e=this._selectedItems.size();
var d;
var t=0;
for(o=0;
o<e;
o++){
if(r[o]._isChildOf(c)){
h=true;
if(d==null){
d=new Array()
}
d[t++]=r[o];
r[o]._setSelected(false);
this._selectedItems.remove(r[o])
}}
if(d){
this._notifyListeners(DwtEvent.SELECTION,d,DwtTree.ITEM_DESELECTED,s,this._selEv)
}
if(h&&!this._selectedItems.contains(c)){
this._selectedItems.add(c);
if(c._setSelected(true)){
this._notifyListeners(DwtEvent.SELECTION,[c],DwtTree.ITEM_SELECTED,s,this._selEv)
}}};
DwtTree.prototype._notifyListeners=function(s,e,o,a,t,n){
if(this.isListenerRegistered(s)){
if(a){
DwtUiEvent.copy(t,a)
}
t.items=e;
if(e.length==1){
t.item=e[0]
}
t.detail=o;
t.kbNavEvent=n;
this.notifyListeners(s,t);
if(s==DwtEvent.SELECTION){
this.shell.notifyGlobalSelection(t)
}}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtCalendar")){
DwtCalendar=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtCalendar.PARAMS);
e.className=e.className||"DwtCalendar";
DwtComposite.call(this,e);
this._skipNotifyOnPage=false;
this._hidePrevNextMo=e.hidePrevNextMo;
this._readOnly=e.readOnly;
this._showWeekNumber=e.showWeekNumber;
this._uuid=Dwt.getNextId();
var t=this._origDayClassName=e.className+"Day";
this._todayClassName=" "+e.className+"Day-today";
this._selectedDayClassName=" "+t+"-"+DwtCssStyle.SELECTED;
this._hoveredDayClassName=" "+t+"-"+DwtCssStyle.HOVER;
this._activeDayClassName=" "+t+"-"+DwtCssStyle.ACTIVE;
this._hiliteClassName=" "+t+"-hilited";
this._greyClassName=" "+t+"-grey";
if(!this._readOnly){
this._installListeners()
}
this._selectionMode=DwtCalendar.DAY;
this._init();
this._weekDays=new Array(7);
this._workingDays=e.workingDays||DwtCalendar._DEF_WORKING_DAYS;
this._useISO8601WeekNo=e.useISO8601WeekNo;
this.setFirstDayOfWeek(e.firstDayOfWeek||DwtCalendar.SUN);
this._forceRollOver=(e.forceRollOver!==false)
};
DwtCalendar.PARAMS=["parent","className","posStyle","firstDayOfWeek","forceRollOver","workingDaysArray","hidePrevNextMo","readOnly"];
DwtCalendar.prototype=new DwtComposite;
DwtCalendar.prototype.constructor=DwtCalendar;
DwtCalendar.SUN=0;
DwtCalendar.MON=1;
DwtCalendar.TUE=2;
DwtCalendar.WED=3;
DwtCalendar.THU=4;
DwtCalendar.FRI=5;
DwtCalendar.SAT=6;
DwtCalendar.DAY=1;
DwtCalendar.WEEK=2;
DwtCalendar.WORK_WEEK=3;
DwtCalendar.MONTH=4;
DwtCalendar.RANGE_CHANGE="DwtCalendar.RANGE_CHANGE";
DwtCalendar._FULL_WEEK=[1,1,1,1,1,1,1];
DwtCalendar._DEF_WORKING_DAYS=[0,1,1,1,1,1,0];
DwtCalendar._DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];
DwtCalendar._NO_MONTH=-2;
DwtCalendar._PREV_MONTH=-1;
DwtCalendar._THIS_MONTH=0;
DwtCalendar._NEXT_MONTH=1;
DwtCalendar._NORMAL=1;
DwtCalendar._HOVERED=2;
DwtCalendar._ACTIVE=3;
DwtCalendar._SELECTED=4;
DwtCalendar._DESELECTED=5;
DwtCalendar.DATE_SELECTED=1;
DwtCalendar.DATE_DESELECTED=2;
DwtCalendar.DATE_DBL_CLICKED=3;
DwtCalendar._LAST_DAY_CELL_IDX=41;
DwtCalendar._BUTTON_CLASS="DwtCalendarButton";
DwtCalendar._BUTTON_HOVERED_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.HOVER;
DwtCalendar._BUTTON_ACTIVE_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.ACTIVE;
DwtCalendar._TITLE_CLASS="DwtCalendarTitle";
DwtCalendar._TITLE_HOVERED_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.HOVER;
DwtCalendar._TITLE_ACTIVE_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.ACTIVE;
DwtCalendar.prototype.toString=function(){
return"DwtCalendar"
};
DwtCalendar.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtCalendar.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtCalendar.prototype.addActionListener=function(e){
this.addListener(DwtEvent.ACTION,e)
};
DwtCalendar.prototype.removeActionListener=function(e){
this.removeListener(DwtEvent.ACTION,e)
};
DwtCalendar.prototype.addDateRangeListener=function(e){
this.addListener(DwtEvent.DATE_RANGE,e)
};
DwtCalendar.prototype.removeDateRangeListener=function(e){
this.removeListener(DwtEvent.DATE_RANGE,e)
};
DwtCalendar.prototype.setSkipNotifyOnPage=function(e){
this._skipNotifyOnPage=e
};
DwtCalendar.prototype.getSkipNotifyOnPage=function(){
return this._skipNotifyOnPage
};
DwtCalendar.prototype.setDate=function(o,r,a,t){
a=(a==null)?this._forceRollOver:a;
var d=new Date(o.getTime());
var n=this._date;
var s=false;
var m=false;
var e;
if(this._date2CellId!=null){
var c=(d.getFullYear()*10000)+(d.getMonth()*100)+d.getDate();
var e=this._date2CellId[c];
if(e){
if(e==this._selectedCellId){
m=true
}
var u=document.getElementById(e);
if(u._dayType==DwtCalendar._THIS_MONTH){
m=true
}else{
if(a){
m=s=true
}else{
m=true
}}}else{
m=s=true
}}else{
m=s=true
}
if(m){
if(this._date){
d.setHours(this._date.getHours(),this._date.getMinutes(),this._date.getSeconds(),0)
}
this._date=d;
if(!s&&!this._readOnly){
this._setSelectedDate();
this._setToday()
}}
if(s){
this._layout()
}
if(m&&!r){
var h=t?DwtCalendar.DATE_DBL_CLICKED:DwtCalendar.DATE_SELECTED;
this._notifyListeners(DwtEvent.SELECTION,h,this._date)
}
return true
};
DwtCalendar.prototype.isSelected=function(t){
if(t==this._selectedDayElId){
return true
}else{
if(this._selectionMode!=DwtCalendar.DAY){
var e=this._getDayCellIndex(t);
if(Math.floor(e/7)==Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)&&this._currWorkingDays[e%7]){
return true
}}}
return false
};
DwtCalendar.prototype.getForceRollOver=function(){
return this._forceRollOver
};
DwtCalendar.prototype.setForceRollOver=function(e){
if(e==null){
return
}
if(this._forceRollOver!=e){
this._forceRollOver=e;
this._layout()
}};
DwtCalendar.prototype.getSelectionMode=function(){
return this._selectionMode
};
DwtCalendar.prototype.setSelectionMode=function(e){
if(this._selectionMode==e){
return
}
this._selectionMode=e;
if(e==DwtCalendar.WEEK){
this._currWorkingDays=DwtCalendar._FULL_WEEK
}else{
if(e==DwtCalendar.WORK_WEEK){
this._currWorkingDays=this._workingDays
}}
this._layout()
};
DwtCalendar.prototype.setWorkingWeek=function(e){
this._workingDays=this._currWorkingDays=e;
if(this._selectionMode==DwtCalendar.WORK_WEEK){
this._layout()
}};
DwtCalendar.prototype.setHilite=function(s,a,t){
if(this._date2CellId==null){
return
}
var e;
var r;
if(t){
for(r in this._date2CellId){
e=document.getElementById(this._date2CellId[r]);
if(e._isHilited){
e._isHilited=false;
this._setClassName(e,DwtCalendar._NORMAL)
}}}
var n;
for(var o in s){
r=s[o];
n=this._date2CellId[r.getFullYear()*10000+r.getMonth()*100+r.getDate()];
if(n){
e=document.getElementById(n);
if(e._isHilited!=a){
e._isHilited=a;
this._setClassName(e,DwtCalendar._NORMAL)
}}}};
DwtCalendar.prototype.getDate=function(){
return this._date
};
DwtCalendar.prototype.setFirstDayOfWeek=function(e){
for(var a=0;
a<7;
a++){
this._weekDays[a]=(a<e)?(6-(e-a-1)):(a-e);
var t=document.getElementById(this._getDOWCellId(a));
t.innerHTML=AjxDateUtil.WEEKDAY_SHORT[(e+a)%7]
}
this._firstDayOfWeek=e;
this._layout()
};
DwtCalendar.prototype.getDateRange=function(){
return this._range
};
DwtCalendar.prototype._getDayCellId=function(e){
return("c:"+e+":"+this._uuid)
};
DwtCalendar.prototype._getDayCellIndex=function(e){
return e.substring(2,e.indexOf(":",3))
};
DwtCalendar.prototype._getDOWCellId=function(e){
return("w:"+e+":"+this._uuid)
};
DwtCalendar.prototype._getWeekNumberCellId=function(e){
return("k:"+e+":"+this._uuid)
};
DwtCalendar.prototype._getDaysInMonth=function(t,e){
if(t!=1){
return DwtCalendar._DAYS_IN_MONTH[t]
}
if(e%4!=0||(e%100==0&&e%400!=0)){
return 28
}
return 29
};
DwtCalendar.prototype._installListeners=function(){
this._setMouseEventHdlrs();
this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
this.addListener(DwtEvent.ONDBLCLICK,new AjxListener(this,this._doubleClickListener))
};
DwtCalendar.prototype._notifyListeners=function(e,a,t,o){
if(!this.isListenerRegistered(e)){
return
}
var n=DwtShell.selectionEvent;
if(o){
DwtUiEvent.copy(n,o)
}else{
n.reset()
}
n.item=this;
n.detail=t;
n.type=a;
this.notifyListeners(e,n)
};
DwtCalendar.prototype._layout=function(){
if(this._date==null){
return false
}
if(!this._calWidgetInited){
this._init()
}
var g=new Date(this._date.getTime());
g.setDate(1);
var s=g.getFullYear();
var y=g.getMonth();
var n=g.getDay();
var a=this._getDaysInMonth(y,s);
var c=1;
var w=1;
this._date2CellId=new Object();
this._selectedDayElId=null;
var o,u,v,p,e;
if(!this._hidePrevNextMo){
if(y!=0){
o=this._getDaysInMonth(y-1,s)-this._weekDays[n]+1;
u=s;
v=y-1;
if(y!=11){
p=y+1;
e=s
}else{
p=0;
e=s+1
}}else{
o=this._getDaysInMonth(11,s-1)-this._weekDays[n]+1;
u=s-1;
v=11;
p=1;
e=s
}}
for(var d=0;
d<6;
d++){
for(var h=0;
h<7;
h++){
var f=document.getElementById(this._getDayCellId(d*7+h));
if(f._isHilited==null){
f._isHilited=false
}
if(c<=a){
if(d!=0||h>=this._weekDays[n]){
this._date2CellId[(s*10000)+(y*100)+c]=f.id;
f._day=c;
f._month=y;
f._year=s;
f.innerHTML=c++;
f._dayType=DwtCalendar._THIS_MONTH;
if(this._readOnly){
f.style.fontFamily="Arial";
f.style.fontSize="10px"
}}else{
if(this._hidePrevNextMo){
f.innerHTML=""
}else{
this._date2CellId[(u*10000)+(v*100)+o]=f.id;
f._day=o;
f._month=v;
f._year=u;
f.innerHTML=o++;
f._dayType=DwtCalendar._PREV_MONTH
}}}else{
if(!this._hidePrevNextMo){
this._date2CellId[(e*10000)+(p*100)+w]=f.id;
f._day=w;
f._month=p;
f._year=e;
f.innerHTML=w++;
f._dayType=DwtCalendar._NEXT_MONTH
}}
this._setClassName(f,DwtCalendar._NORMAL)
}
if(this._showWeekNumber){
var r=this._getWeekNumberCellId("kw"+d*7);
var m=document.getElementById(r);
if(m){
var t=document.getElementById(this._getDayCellId(d*7));
m.innerHTML=AjxDateUtil.getWeekNumber(new Date(t._year,t._month,t._day),this._firstDayOfWeek,null,this._useISO8601WeekNo)
}}}
this._setTitle(y,s);
if(!this._readOnly){
this._setSelectedDate();
this._setToday()
}
this._setRange()
};
DwtCalendar.prototype._setRange=function(){
var e=document.getElementById(this._getDayCellId(0));
var o=new Date(e._year,e._month,e._day,0,0,0,0);
e=document.getElementById(this._getDayCellId(DwtCalendar._LAST_DAY_CELL_IDX));
var a=this._getDaysInMonth(e._month,e._year);
var t;
if(e._day<a){
t=new Date(e._year,e._month,e._day+1,0,0,0,0)
}else{
if(e._month<11){
t=new Date(e._year,e._month+1,1,0,0,0,0)
}else{
t=new Date(e._year+1,0,1,0,0,0,0)
}}
if(this._range==null){
this._range={}
}else{
if(this._range.start.getTime()==o.getTime()&&this._range.end.getTime()==t.getTime()){
return false
}}
this._range.start=o;
this._range.end=t;
if(!this.isListenerRegistered(DwtEvent.DATE_RANGE)){
return
}
if(!this._dateRangeEvent){
this._dateRangeEvent=new DwtDateRangeEvent(true)
}
this._dateRangeEvent.item=this;
this._dateRangeEvent.start=o;
this._dateRangeEvent.end=t;
this.notifyListeners(DwtEvent.DATE_RANGE,this._dateRangeEvent)
};
DwtCalendar.prototype._setToday=function(){
var e;
var t=new Date();
var a=t.getDate();
if(!this._todayDay||this._todayDay!=a){
if(this._todayCellId!=null){
e=document.getElementById(this._todayCellId);
e._isToday=false;
this._setClassName(e,DwtCalendar._NORMAL)
}
this._todayCellId=this._date2CellId[(t.getFullYear()*10000)+(t.getMonth()*100)+a];
if(this._todayCellId!=null){
e=document.getElementById(this._todayCellId);
e._isToday=true;
this._setClassName(e,DwtCalendar._NORMAL)
}}};
DwtCalendar.prototype._setSelectedDate=function(){
var t=this._date.getDate();
var n=this._date.getMonth();
var a=this._date.getFullYear();
var e;
if(this._selectedDayElId){
e=document.getElementById(this._selectedDayElId);
this._setClassName(e,DwtCalendar._DESELECTED)
}
var o=this._date2CellId[(a*10000)+(n*100)+t];
e=document.getElementById(o);
this._selectedDayElId=o;
this._setClassName(e,DwtCalendar._SELECTED)
};
DwtCalendar.prototype._setCellClassName=function(t,a,o){
if(t._dayType!=DwtCalendar._THIS_MONTH){
a+=this._greyClassName
}
if(this._selectionMode==DwtCalendar.DAY&&t.id==this._selectedDayElId&&o!=DwtCalendar._DESELECTED){
a+=this._selectedDayClassName
}else{
if(this._selectionMode!=DwtCalendar.DAY&&o!=DwtCalendar._DESELECTED&&this._selectedDayElId!=null){
var e=this._getDayCellIndex(t.id);
if(Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)==Math.floor(e/7)&&this._currWorkingDays[e%7]){
a+=this._selectedDayClassName
}}}
if(t._isHilited){
a+=this._hiliteClassName
}
if(t._isToday){
a+=this._todayClassName
}
return a
};
DwtCalendar.prototype._setClassName=function(e,s){
var a="";
if(s==DwtCalendar._NORMAL){
a=this._origDayClassName
}else{
if(s==DwtCalendar._HOVERED){
a=this._hoveredDayClassName
}else{
if(s==DwtCalendar._ACTIVE){
a=this._activeDayClassName
}else{
if(s==DwtCalendar._DESELECTED&&this._selectionMode==DwtCalendar.DAY){
a=this._origDayClassName
}else{
if(this._selectionMode!=DwtCalendar.DAY&&(s==DwtCalendar._SELECTED||s==DwtCalendar._DESELECTED)){
var n=Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)*7;
for(var t=0;
t<7;
t++){
a=this._origDayClassName;
var o=document.getElementById(this._getDayCellId(n++));
o.className=this._setCellClassName(o,a,s)
}
return
}}}}}
e.className=this._setCellClassName(e,a,s)
};
DwtCalendar.prototype._setTitle=function(n,o){
var e=document.getElementById(this._monthCell);
var a=DwtCalendar.getMonthFormatter();
var t=new Date(o,n);
e.innerHTML=a.format(t)
};
DwtCalendar.prototype._init=function(){
var o=new Array(100);
var e=0;
this._monthCell="t:"+this._uuid;
o[e++]="<table width=100% cellspacing='0' cellpadding='0' style='border-collapse:collapse;'>";
o[e++]="<tr><td class=DwtCalendarTitlebar>";
o[e++]="<table width='100%' cellspacing='0' cellpadding='0'>";
o[e++]="<tr>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:py:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("FastRevArrowSmall",null,["id='b:py:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:pm:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("RevArrowSmall",null,["id='b:pm:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="<td align='center' class='DwtCalendarTitleCell' nowrap'><span class='";
o[e++]=DwtCalendar._TITLE_CLASS;
o[e++]="' id='";
o[e++]=this._monthCell;
o[e++]="'>&nbsp;</span></td>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:nm:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("FwdArrowSmall",null,["id='b:nm:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="<td class='";
o[e++]=DwtCalendar._BUTTON_CLASS;
o[e++]="' id='b:ny:";
o[e++]=this._uuid;
o[e++]="'>";
o[e++]=AjxImg.getImageHtml("FastFwdArrowSmall",null,["id='b:ny:img:",this._uuid,"'"].join(""));
o[e++]="</td>";
o[e++]="</tr>";
o[e++]="</table>";
o[e++]="</td></tr>";
o[e++]="<tr><td>";
o[e++]="<table cellspacing='0' cellpadding='1' width='100%'>";
o[e++]="<tr>";
if(this._showWeekNumber){
o[e++]="<td class='DwtCalendarWeekNoTitle' width='14%' id='";
o[e++]=this._getWeekNumberCellId("kw");
o[e++]="'>";
o[e++]=AjxMsg.calendarWeekTitle;
o[e++]="</td>"
}
for(var a=0;
a<7;
a++){
o[e++]="<td class='DwtCalendarDow' width='";
o[e++]=(a<5?"14%":"15%");
o[e++]="' id='";
o[e++]=this._getDOWCellId(a);
o[e++]="'>&nbsp;</td>"
}
o[e++]="</tr>";
for(var a=0;
a<6;
a++){
o[e++]=(AjxEnv.isLinux||AjxEnv.isMac)?"<tr style='line-height:12px'>":"<tr>";
if(this._showWeekNumber){
o[e++]="<td class='DwtCalendarWeekNo' id='"+this._getWeekNumberCellId("kw"+a*7)+"'>&nbsp;</td>"
}
for(var t=0;
t<7;
t++){
o[e++]="<td id='";
o[e++]=this._getDayCellId(a*7+t);
o[e++]="'>&nbsp;</td>"
}
o[e++]="</tr>"
}
o[e++]="</td></tr></table></table>";
this.getHtmlElement().innerHTML=o.join("");
if(!this._readOnly){
document.getElementById("b:py:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastRevArrowSmall");
document.getElementById("b:pm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("RevArrowSmall");
document.getElementById("b:nm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FwdArrowSmall");
document.getElementById("b:ny:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastFwdArrowSmall")
}
this._calWidgetInited=true
};
DwtCalendar.prototype.setMouseOverDayCallback=function(e){
this._mouseOverDayCB=e
};
DwtCalendar.prototype.setMouseOutDayCallback=function(e){
this._mouseOutDayCB=e
};
DwtCalendar.prototype.getDndDate=function(){
var e=this._lastDndCell;
if(e){
return new Date(e._year,e._month,e._day)
}
return null
};
DwtCalendar._tmpDate=new Date();
DwtCalendar._tmpDate.setHours(0,0,0,0);
DwtCalendar.prototype._mouseOverListener=function(t){
var a=t.target;
if(a.id.charAt(0)=="c"){
this._setClassName(a,DwtCalendar._HOVERED);
if(this._mouseOverDayCB){
DwtCalendar._tmpDate.setFullYear(a._year,a._month,a._day);
this._mouseOverDayCB.run(this,DwtCalendar._tmpDate)
}}else{
if(a.id.charAt(0)=="t"){
return
}else{
if(a.id.charAt(0)=="b"){
var e;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
}else{
a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName
}}}
t._stopPropagation=true
};
DwtCalendar.prototype._mouseOutListener=function(t){
this.setToolTipContent(null);
var a=t.target;
if(a.id.charAt(0)=="c"){
this._setClassName(a,DwtCalendar._NORMAL);
if(this._mouseOutDayCB){
this._mouseOutDayCB.run(this)
}}else{
if(a.id.charAt(0)=="b"){
var e;
a.className=DwtCalendar._BUTTON_CLASS;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_CLASS
}else{
a.className=DwtCalendar._BUTTON_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName
}}};
DwtCalendar.prototype._mouseDownListener=function(t){
if(t.button==DwtMouseEvent.LEFT){
var a=t.target;
if(a.id.charAt(0)=="c"){
this._setClassName(a,DwtCalendar._ACTIVE)
}else{
if(a.id.charAt(0)=="t"){
a.className=DwtCalendar._TITLE_ACTIVE_CLASS
}else{
if(a.id.charAt(0)=="b"){
var e;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_ACTIVE_CLASS
}else{
a.className=DwtCalendar._BUTTON_ACTIVE_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName
}else{
if(a.id.charAt(0)=="w"){}}}}}};
DwtCalendar.prototype._mouseUpListener=function(t){
var a=t.target;
if(t.button==DwtMouseEvent.LEFT){
if(a.id.charAt(0)=="c"){
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
if(this.setDate(new Date(a._year,a._month,a._day))){
return
}
this._setClassName(a,DwtCalendar._HOVERED)
}else{
if(a.id.charAt(0)=="b"){
var e;
if(a.firstChild==null){
e=a;
AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
}else{
a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
e=AjxImg.getImageElement(a)
}
e.className=e._origClassName;
if(e.id.indexOf("py")!=-1){
this._prevYear()
}else{
if(e.id.indexOf("pm")!=-1){
this._prevMonth()
}else{
if(e.id.indexOf("nm")!=-1){
this._nextMonth()
}else{
this._nextYear()
}}}}else{
if(a.id.charAt(0)=="t"){
a.className=DwtCalendar._TITLE_HOVERED_CLASS;
this.setDate(new Date(),this._skipNotifyOnPage);
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}}}}}else{
if(t.button==DwtMouseEvent.RIGHT&&a.id.charAt(0)=="c"){
this._notifyListeners(DwtEvent.ACTION,0,new Date(a._year,a._month,a._day),t)
}}};
DwtCalendar.prototype._doubleClickListener=function(e){
var t=e.target;
if(this._selectionEvent){
this._selectionEvent.type=DwtCalendar.DATE_DBL_CLICKED
}
if(t.id.charAt(0)=="c"){
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
this.setDate(new Date(t._year,t._month,t._day),false,false,true)
}};
DwtCalendar.prototype._prevMonth=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,-1),this._skipNotifyOnPage)
};
DwtCalendar.prototype._nextMonth=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,1),this._skipNotifyOnPage)
};
DwtCalendar.prototype._prevYear=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,-1),this._skipNotifyOnPage)
};
DwtCalendar.prototype._nextYear=function(e){
var t=new Date(this._date.getTime());
this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,1),this._skipNotifyOnPage)
};
DwtCalendar.getDateFormatter=function(){
if(!DwtCalendar._dateFormatter){
DwtCalendar._dateFormatter=new AjxDateFormat(AjxMsg.formatCalDate)
}
return DwtCalendar._dateFormatter
};
DwtCalendar.getDateLongFormatter=function(){
if(!DwtCalendar._dateLongFormatter){
DwtCalendar._dateLongFormatter=new AjxDateFormat(AjxMsg.formatCalDateLong)
}
return DwtCalendar._dateLongFormatter
};
DwtCalendar.getDateFullFormatter=function(){
if(!DwtCalendar._dateFullFormatter){
DwtCalendar._dateFullFormatter=new AjxDateFormat(AjxMsg.formatCalDateFull)
}
return DwtCalendar._dateFullFormatter
};
DwtCalendar.getHourFormatter=function(){
if(!DwtCalendar._hourFormatter){
DwtCalendar._hourFormatter=new AjxMessageFormat(AjxMsg.formatCalHour)
}
return DwtCalendar._hourFormatter
};
DwtCalendar.getDayFormatter=function(){
if(!DwtCalendar._dayFormatter){
DwtCalendar._dayFormatter=new AjxDateFormat(AjxMsg.formatCalDay)
}
return DwtCalendar._dayFormatter
};
DwtCalendar.getMonthFormatter=function(){
if(!DwtCalendar._monthFormatter){
DwtCalendar._monthFormatter=new AjxDateFormat(AjxMsg.formatCalMonth)
}
return DwtCalendar._monthFormatter
};
DwtCalendar.getShortMonthFormatter=function(){
if(!DwtCalendar._shortMonthFormatter){
DwtCalendar._shortMonthFormatter=new AjxDateFormat(AjxMsg.formatShortCalMonth)
}
return DwtCalendar._shortMonthFormatter
};
DwtCalendar.prototype._dragEnter=function(e){};
DwtCalendar.prototype._dragHover=function(e){};
DwtCalendar.prototype._dragOver=function(e){
var t=e.target;
if(t.id.charAt(0)=="c"){
this._setClassName(t,DwtCalendar._HOVERED);
this._lastDndCell=t
}else{
this._lastDndCell=null
}};
DwtCalendar.prototype._dragLeave=function(e){}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyPage")){
DwtPropertyPage=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtPropertyPage.PARAMS);
e.className=e.className||"DwtPropertyPage";
DwtComposite.call(this,e);
this._fieldIds=new Object();
this._fildDivIds=new Object();
this._isDirty=false
};
DwtPropertyPage.prototype=new DwtComposite;
DwtPropertyPage.prototype.constructor=DwtPropertyPage;
DwtPropertyPage.prototype.toString=function(){
return"DwtPropertyPage"
};
DwtPropertyPage.PARAMS=DwtComposite.PARAMS;
DwtPropertyPage.prototype.setDirty=function(e){
this._isDirty=e
};
DwtPropertyPage.prototype.isDirty=function(){
return this._isDirty
};
DwtPropertyPage.prototype._installOnKeyUpHandler=function(o,t){
if(!o){
return
}
var a=null;
a=document.getElementById(this._fieldIds[o]);
if(a){
Dwt.setHandler(a,DwtEvent.ONKEYUP,t?t:this._onKeyUp);
a._view=this;
a._field=o
}};
DwtPropertyPage.prototype._installOnClickHandler=function(o,t){
if(!o){
return
}
var a=document.getElementById(this._fieldIds[o]);
if(a){
Dwt.setHandler(a,DwtEvent.ONCLICK,t?t:this._onClick);
a._view=this;
a._field=o
}};
DwtPropertyPage.prototype._onClick=function(e){
this._view.setDirty(true);
return true
};
DwtPropertyPage.prototype._onKeyUp=function(e){
this._view.setDirty(true);
return true
};
DwtPropertyPage.prototype._installOnChangeHandler=function(o,t){
if(!o){
return
}
var a=null;
a=document.getElementById(this._fieldIds[o]);
if(a){
Dwt.setHandler(a,DwtEvent.ONCHANGE,t?t:this._onChange);
a._view=this;
a._field=o
}};
DwtPropertyPage._onChange=function(e){
this._view.setDirty(true);
return true
};
DwtPropertyPage.prototype._onChange2=function(e){
this.setDirty(true);
return true
};
DwtPropertyPage.prototype._addDwtSelectEntryRow=function(n,s,a,e,o){
var t="30ex";
if(o){
t=o
}
a[e++]="<tr valign='center'>";
e=this._addDwtSelectEntryCell(n,s,a,e,t);
a[e++]="</tr>";
return e
};
DwtPropertyPage.prototype._addDwtSelectEntryCell=function(a,o,t,e,s){
var n=Dwt.getNextId();
this._fieldIds[a]=n;
if(o){
t[e++]="<td align='left' style='width:"+s+"'>";
t[e++]=AjxStringUtil.htmlEncode(o)+":";
t[e++]="</td>"
}
t[e++]="<td align='left'>";
t[e++]="<div id='"+n+"'></div></td>";
return e
};
DwtPropertyPage.prototype._addBoolEntryRow=function(a,o,t,e,n){
t[e++]="<tr valign='center'>";
e=this._addBoolEntryCell(a,o,t,e,n);
t[e++]="</tr>";
return e
};
DwtPropertyPage.prototype._addBoolEntryCell=function(o,n,t,e,r){
var s=Dwt.getNextId();
this._fieldIds[o]=s;
var a="20ex";
if(r){
a=r
}
if(n){
t[e++]="<td style='width:"+a+";' align='left'>";
t[e++]=AjxStringUtil.htmlEncode(n)+":";
t[e++]="</td>"
}
t[e++]="<td align='left'>";
t[e++]="<input type='checkbox' id='"+s+"'>";
t[e++]="</td>";
return e
};
DwtPropertyPage.prototype._addTextAreaEntryRow=function(o,n,t,e,r){
var a="on";
if(r){
a="off"
}
var s=Dwt.getNextId();
this._fieldIds[o]=s;
t[e++]="<tr valign='center'>";
t[e++]="<td align='left' style='width:60ex;'>";
t[e++]=AjxStringUtil.htmlEncode(n)+":";
t[e++]="</td></tr>";
t[e++]="<tr valign='center'><td align='left' style='width:60ex;'><textarea wrap='"+a+"' rows='8' cols ='60' id='";
t[e++]=s;
t[e++]="'/></textarea></td></tr>";
return e
};
DwtPropertyPage.prototype._addEntryRow=function(r,s,t,c,o,n,e,h,a){
t[c++]="<tr valign='center'>";
c=this._addEntryCell(r,s,t,c,o,n,e,h,a);
t[c++]="</tr>";
return c
};
DwtPropertyPage.prototype._addEntryCell=function(c,h,o,u,s,r,t,d,n){
if(s==null){
s="text"
}
if(r==null){
r=35
}
var a="20ex";
if(d){
a=d
}
var e=Dwt.getNextId();
this._fieldIds[c]=e;
if(h){
o[u++]="<td align='left' style='width:"+a+";'>";
o[u++]=AjxStringUtil.htmlEncode(h)+":";
o[u++]="</td>"
}
o[u++]="<td ";
if(n){
o[u++]="class='redAsteric' "
}
o[u++]="	align='left'><input autocomplete='off' size='"+r+"' type='"+s+"' id='";
o[u++]=e;
o[u++]="'";
if(n){
o[u++]="/>*"
}else{
o[u++]="/>&nbsp;"
}
if(t!=null){
o[u++]=t
}
o[u++]="</td>";
return u
};
DwtPropertyPage.prototype._createHTML=function(){}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtTabView")){
DwtTabView=function(t){
if(arguments.length==0){
return
}
t=Dwt.getParams(arguments,DwtListView.PARAMS);
t.className=t.className||"ZTabView";
t.posStyle=t.posStyle||DwtControl.ABSOLUTE_STYLE;
DwtComposite.call(this,t);
this._stateChangeEv=new DwtEvent(true);
this._stateChangeEv.item=this;
this._tabs=[];
this._tabIx=1;
this._createHtml();
var e=[this.toString(),this._htmlElId].join("-");
this._tabGroup=new DwtTabGroup(e);
this._tabGroup.addMember(this._tabBar)
};
DwtTabView.PARAMS=["parent","className","posStyle"];
DwtTabView.prototype=new DwtComposite;
DwtTabView.prototype.constructor=DwtTabView;
DwtTabView.Z_ACTIVE_TAB=Dwt.Z_VIEW+10;
DwtTabView.Z_HIDDEN_TAB=Dwt.Z_HIDDEN;
DwtTabView.Z_TAB_PANEL=Dwt.Z_VIEW+20;
DwtTabView.Z_CURTAIN=Dwt.Z_CURTAIN;
DwtTabView.prototype.TEMPLATE="dwt.Widgets#ZTabView";
DwtTabView.prototype.toString=function(){
return"DwtTabView"
};
DwtTabView.prototype.addStateChangeListener=function(e){
this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabView.prototype.removeStateChangeListener=function(e){
this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabView.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtTabView.prototype.addTab=function(n,o,t,e){
var a=this._tabIx++;
this._tabs[a]={
title:n,button:this._tabBar.addButton(a,n,t,e)};
this.setTabView(a,o);
if(a==1){
if(o instanceof AjxCallback){
o=o.run(a)
}
if(o){
o.showMe()
}
this._currentTabKey=a;
this.switchToTab(a)
}else{
if(o&&!(o instanceof AjxCallback)){
o.hideMe();
Dwt.setVisible(o.getHtmlElement(),false)
}}
this._tabBar.addSelectionListener(a,new AjxListener(this,DwtTabView.prototype._tabButtonListener));
return a
};
DwtTabView.prototype.enable=function(e){
for(var a in this._tabs){
var t=this._tabs[a].button;
if(t){
t.setEnabled(e)
}}};
DwtTabView.prototype.getCurrentTab=function(){
return this._currentTabKey
};
DwtTabView.prototype.getNumTabs=function(){
return(this._tabs.length-1)
};
DwtTabView.prototype.getTab=function(e){
return(this._tabs&&this._tabs[e])?this._tabs[e]:null
};
DwtTabView.prototype.getTabBar=function(){
return this._tabBar
};
DwtTabView.prototype.getTabTitle=function(e){
return(this._tabs&&this._tabs[e])?this._tabs[e]["title"]:null
};
DwtTabView.prototype.getTabButton=function(e){
return(this._tabs&&this._tabs[e])?this._tabs[e]["button"]:null
};
DwtTabView.prototype.setTabView=function(o,a){
var t=this.getTab(o);
t.view=a;
if(a&&!(a instanceof AjxCallback)){
this._pageEl.appendChild(a.getHtmlElement());
a._tabKey=o;
if(o==this._currentTabKey){
var e=a.getTabGroupMember();
this._tabGroup.replaceMember(t.tabGroup,e);
t.tabGroup=e
}}};
DwtTabView.prototype.getTabView=function(o){
var a=this.getTab(o);
var t=a&&a.view;
if(t instanceof AjxCallback){
var n=t;
t=n.run(o);
this.setTabView(o,t);
var e=this._getTabSize();
t.setSize(e.x,e.y)
}
return t
};
DwtTabView.prototype.switchToTab=function(a){
var t=this.getTab(a);
if(t){
var e=this.getTab(this._currentTabKey);
if(e){
this._tabGroup.removeMember(e.tabGroup)
}
this._showTab(a);
this._tabBar.openTab(a);
if(!t.tabGroup&&t.view){
t.tabGroup=t.view.getTabGroupMember()
}
this._tabGroup.addMember(t.tabGroup);
if(this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}}};
DwtTabView.prototype.setBounds=function(t,o,a,e){
DwtComposite.prototype.setBounds.call(this,t,o,a,e);
this._resetTabSizes(a,e)
};
DwtTabView.prototype.getActiveView=function(){
return this._tabs[this._currentTabKey].view
};
DwtTabView.prototype.getKeyMapName=function(){
return"DwtTabView"
};
DwtTabView.prototype.resetKeyBindings=function(){
var t=this.shell.getKeyboardMgr();
if(t.isEnabled()){
var n=t.__keyMapMgr;
if(!n){
return
}
var o=this.getNumTabs();
var r=n.getKeySequences("DwtTabView","GoToTab");
for(var e=0;
e<r.length;
e++){
var h=r[e];
for(var a=1;
a<=o;
a++){
var s=48+a;
var c=h.replace(/NNN/,s);
n.setMapping("DwtTabView",c,"GoToTab"+a)
}}
n.reloadMap("DwtTabView")
}};
DwtTabView.prototype.handleKeyAction=function(o){
switch(o){
case DwtKeyMap.NEXT_TAB:var a=this.getCurrentTab();
if(a<this.getNumTabs()){
this.switchToTab(a+1)
}
break;
case DwtKeyMap.PREV_TAB:var a=this.getCurrentTab();
if(a>1){
this.switchToTab(a-1)
}
break;
default:var t=o.match(DwtKeyMap.GOTO_TAB_RE);
if(t&&t.length){
var e=t[1];
if((e<=this.getNumTabs())&&(e!=this.getCurrentTab())){
this.switchToTab(e)
}}else{
return false
}}
return true
};
DwtTabView.prototype._resetTabSizes=function(a,e){
if(this._tabs&&this._tabs.length){
for(var n in this._tabs){
var t=this._tabs[n].view;
if(t&&!(t instanceof AjxCallback)){
var o;
o=o||e-Dwt.getSize(this._tabBarEl).y;
t.resetSize(a,o)
}}}};
DwtTabView.prototype._getTabSize=function(){
var t=this.getSize();
var a=t.x||this.getHtmlElement().clientWidth;
var e=t.y||this.getHtmlElement().clientHeight;
var o=this._tabBar.getSize();
var n=o.y||this._tabBar.getHtmlElement().clientHeight;
return new DwtPoint(a,(e-n))
};
DwtTabView.prototype._createHtml=function(e){
this._createHtmlFromTemplate(e||this.TEMPLATE,{
id:this._htmlElId}
)
};
DwtTabView.prototype._createHtmlFromTemplate=function(e,t){
DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
this._tabBarEl=document.getElementById(t.id+"_tabbar");
this._tabBar=new DwtTabBar(this);
this._tabBar.reparentHtmlElement(this._tabBarEl);
this._pageEl=document.getElementById(t.id+"_page")
};
DwtTabView.prototype._showTab=function(t){
if(this._tabs&&this._tabs[t]){
this._currentTabKey=t;
this._hideAllTabs();
var e=this.getTabView(t);
if(e){
e.setVisible(true);
e.showMe()
}}};
DwtTabView.prototype._hideAllTabs=function(){
if(this._tabs&&this._tabs.length){
for(var t in this._tabs){
var e=this._tabs[t].view;
if(e&&!(e instanceof AjxCallback)){
e.hideMe();
Dwt.setVisible(e.getHtmlElement(),false)
}}}};
DwtTabView.prototype._tabButtonListener=function(e){
this.switchToTab(e.item.getData("tabKey"))
};
DwtTabViewPage=function(a,t,e){
if(arguments.length==0){
return
}
params=Dwt.getParams(arguments,DwtTabViewPage.PARAMS);
params.className=params.className||"ZTabPage";
params.posStyle=params.posStyle||DwtControl.ABSOLUTE_STYLE;
this._rendered=true;
DwtPropertyPage.call(this,params);
this._createHtml();
this.getHtmlElement().style.overflowY="auto";
this.getHtmlElement().style.overflowX="visible";
if(params.contentTemplate){
this.getContentHtmlElement().innerHTML=AjxTemplate.expand(params.contentTemplate,this._htmlElId)
}};
DwtTabViewPage.prototype=new DwtPropertyPage;
DwtTabViewPage.prototype.constructor=DwtTabViewPage;
DwtTabViewPage.prototype.toString=function(){
return"DwtTabViewPage"
};
DwtTabViewPage.prototype.TEMPLATE="dwt.Widgets#ZTabPage";
DwtTabViewPage.PARAMS=DwtPropertyPage.PARAMS.concat("contentTemplate");
DwtTabViewPage.prototype.getContentHtmlElement=function(){
return this._contentEl||this.getHtmlElement()
};
DwtTabViewPage.prototype.showMe=function(){
this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
if(this.parent.getHtmlElement().offsetHeight>80){
this._contentEl.style.height=this.parent.getHtmlElement().offsetHeight-80
}else{
var t=parseInt(this.parent.getHtmlElement().style.height);
var e=AjxStringUtil.getUnitsFromSizeString(this.parent.getHtmlElement().style.height);
if(t>80){
this._contentEl.style.height=(Number(t-80).toString()+e)
}}
this._contentEl.style.width=this.parent.getHtmlElement().style.width
};
DwtTabViewPage.prototype.hideMe=function(){
this.setZIndex(DwtTabView.Z_HIDDEN_TAB)
};
DwtTabViewPage.prototype.resetSize=function(t,e){
this.setSize(t,e)
};
DwtTabViewPage.prototype._createHtml=function(e){
this._createHtmlFromTemplate(e||this.TEMPLATE,{
id:this._htmlElId}
)
};
DwtTabViewPage.prototype._createHtmlFromTemplate=function(e,t){
DwtPropertyPage.prototype._createHtmlFromTemplate.call(this,e,t);
this._contentEl=document.getElementById(t.id+"_content")||this.getHtmlElement()
};
DwtTabBar=function(a,t,o){
if(arguments.length==0){
return
}
this._buttons=[];
this._btnStyle=o||"ZTab";
this._btnImage=null;
this._currentTabKey=1;
var e=t||"ZTabBar";
DwtToolBar.call(this,{
parent:a,className:e,posStyle:DwtControl.STATIC_STYLE}
)
};
DwtTabBar.prototype=new DwtToolBar;
DwtTabBar.prototype.constructor=DwtTabBar;
DwtTabBar.prototype.TEMPLATE="dwt.Widgets#ZTabBar";
DwtTabBar.prototype.toString=function(){
return"DwtTabBar"
};
DwtTabBar.prototype.getCurrentTab=function(){
return this._currentTabKey
};
DwtTabBar.prototype.addStateChangeListener=function(e){
this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabBar.prototype.removeStateChangeListener=function(e){
this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
};
DwtTabBar.prototype.addSelectionListener=function(t,e){
this._buttons[t].addSelectionListener(e)
};
DwtTabBar.prototype.removeSelectionListener=function(t,e){
this._buttons[t].removeSelectionListener(e)
};
DwtTabBar.prototype.addButton=function(s,n,r,a){
var t=this._buttons[s]=new DwtTabButton(this,r,a);
this._buttons[s].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
if(this._btnImage!=null){
t.setImage(this._btnImage)
}
if(n!=null){
t.setText(n)
}
t.setEnabled(true);
t.setData("tabKey",s);
if(parseInt(s)==1){
this.openTab(s,true)
}
var e=this.__getButtonIndex(this._currentTabKey);
if(e!=-1){
var o=this.__getButtonIndex(s);
if(o==e+1){
Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
}}
return t
};
DwtTabBar.prototype.getButton=function(e){
return(this._buttons[e])?this._buttons[e]:null
};
DwtTabBar.prototype.openTab=function(e,n){
this._currentTabKey=e;
var o=this._buttons.length;
for(var t=0;
t<o;
t++){
if(t==e){
continue
}
var a=this._buttons[t];
if(a){
this.__markPrevNext(t,false);
a.setClosed()
}}
var a=this._buttons[e];
if(a){
a.setOpen();
this.__markPrevNext(e,true)
}
if(!n&&this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
}};
DwtTabBar._setActiveTab=function(a){
var e;
if(a&&a.item){
e=a.item.getData("tabKey")
}else{
if(a&&a.target){
var t=a.target;
while(t.tagName!="TABLE"&&t.offsetParent){
t=t.offsetParent
}
e=t.getAttribute("tabKey");
if(e==null){
return false
}}else{
return false
}}
this.openTab(e)
};
DwtTabButton=function(t,a,e){
if(arguments.length==0){
return
}
DwtButton.call(this,{
parent:t,className:"ZTab",id:a,index:e}
)
};
DwtTabButton.prototype=new DwtButton;
DwtTabButton.prototype.constructor=DwtTabButton;
DwtTabButton.prototype.TEMPLATE="dwt.Widgets#ZTab";
DwtTabButton.prototype.toString=function(){
return"DwtTabButton"
};
DwtTabButton.prototype.setOpen=function(){
this._isSelected=true;
this.setDisplayState(DwtControl.SELECTED)
};
DwtTabButton.prototype.setClosed=function(){
this._isSelected=false;
this.setDisplayState(DwtControl.NORMAL)
};
DwtTabButton.prototype.setDisplayState=function(e){
if(this._isSelected&&e!=DwtControl.SELECTED){
e=[DwtControl.SELECTED,e].join(" ")
}
DwtButton.prototype.setDisplayState.call(this,e)
};
DwtTabBarFloat=function(t,e,a){
if(arguments.length==0){
return
}
DwtTabBar.call(this,t,e,a)
};
DwtTabBarFloat.prototype=new DwtTabBar;
DwtTabBarFloat.prototype.constructor=DwtTabBarFloat;
DwtTabBarFloat.prototype.TEMPLATE="dwt.Widgets#ZTabBarFloat";
DwtTabBarFloat.prototype.addButton=function(n,o,s){
var t=this._buttons[n]=new DwtTabButtonFloat(this,s);
this._buttons[n].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
if(this._btnImage!=null){
t.setImage(this._btnImage)
}
if(o!=null){
t.setText(o)
}
t.setEnabled(true);
t.setData("tabKey",n);
if(parseInt(n)==1){
this.openTab(n,true)
}
var e=this.__getButtonIndex(this._currentTabKey);
if(e!=-1){
var a=this.__getButtonIndex(n);
if(a==e+1){
Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
}}
return t
};
DwtTabBarFloat.prototype.addChild=function(t,e){
DwtComposite.prototype.addChild.apply(this,arguments);
this._addItem(DwtToolBar.ELEMENT,t,e)
};
DwtTabBarFloat.prototype._addItem=function(o,a,t){
var n=this._items[t]||this._suffixEl;
var e=t||(typeof t=="number")?t:this._items.length;
this._items.splice(e,0,a);
this._itemsEl.insertBefore(a.getHtmlElement(),n)
};
DwtTabButtonFloat=function(e,t){
DwtTabButton.call(this,e,t)
};
DwtTabButtonFloat.prototype=new DwtTabButton;
DwtTabButtonFloat.prototype.constructor=DwtTabButtonFloat;
DwtTabButtonFloat.prototype.TEMPLATE="dwt.Widgets#ZTabFloat"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtWizardDialog")){
DwtWizardDialog=function(n,o,c,e,a){
if(arguments.length==0){
return
}
o=o||"DwtDialog";
var r=new DwtDialog_ButtonDescriptor(DwtWizardDialog.NEXT_BUTTON,AjxMsg._next,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goNext));
var t=new DwtDialog_ButtonDescriptor(DwtWizardDialog.PREV_BUTTON,AjxMsg._prev,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goPrev));
var s=new DwtDialog_ButtonDescriptor(DwtWizardDialog.FINISH_BUTTON,AjxMsg._finish,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.finishWizard));
DwtDialog.call(this,{
parent:n,className:o,standardButtons:[DwtDialog.CANCEL_BUTTON],extraButtons:[t,r,s]}
);
if(!e){
this._contentW="80ex"
}else{
this._contentW=e
}
if(!a){
this._contentH="100ex"
}else{
this._contentH=a
}
this._pages=new Array();
this._pageIx=1;
this._currentPage=1;
this._progressDiv=document.createElement("div");
this._progressDiv.style.position=DwtControl.STATIC_STYLE;
this._pageDiv=document.createElement("div");
this._pageDiv.className="DwtWizardDialogPageDiv";
this._pageDiv.style.width=this._contentW;
this._pageDiv.style.height=this._contentH;
this._progressBar=new DwtWizProgressBar(this);
this._createContentHtml();
this.setTitle(c)
};
DwtWizardDialog.prototype=new DwtDialog;
DwtWizardDialog.prototype.constructor=DwtWizardDialog;
DwtWizardDialog.Z_ACTIVE_PAGE=Dwt.Z_VIEW+10;
DwtWizardDialog.Z_HIDDEN_PAGE=Dwt.Z_HIDDEN;
DwtWizardDialog.Z_TAB_PANEL=Dwt.Z_VIEW+20;
DwtWizardDialog.Z_CURTAIN=Dwt.Z_CURTAIN;
DwtWizardDialog.NEXT_BUTTON=12;
DwtWizardDialog.PREV_BUTTON=11;
DwtWizardDialog.FINISH_BUTTON=13;
DwtWizardDialog.prototype.toString=function(){
return"DwtWizardDialog"
};
DwtWizardDialog.prototype.popdown=function(){
DwtDialog.prototype.popdown.call(this);
this._hideAllPages()
};
DwtWizardDialog.prototype.goPage=function(e){
if(this._pages&&this._pages[e]){
this._currentPage=e;
this._showPage(e);
this._progressBar.showStep(e);
this._pages[e].setActive()
}};
DwtWizardDialog.prototype.goNext=function(){
var e=this._currentPage+1;
if(this._pages&&this._pages[this._currentPage]){
this._pages[this._currentPage].switchToNextPage(e)
}};
DwtWizardDialog.prototype.goPrev=function(){
var e=this._currentPage-1;
if(this._pages&&this._pages[this._currentPage]){
this._pages[this._currentPage].switchToPrevPage(e)
}};
DwtWizardDialog.prototype.finishWizard=function(){
this.popdown()
};
DwtWizardDialog.prototype.getPage=function(e){
if(this._pages&&this._pages[e]){
return this._pages[e]
}else{
return null
}};
DwtWizardDialog.prototype.addPage=function(e,t){
var a=this._pageIx++;
this._pages[a]=e;
this._progressBar.addStep(a,t);
this._pageDiv.appendChild(this._pages[a].getHtmlElement());
if(a==1){
this._pages[a].setZIndex(DwtWizardDialog.Z_ACTIVE_PAGE)
}else{
this._pages[a].setZIndex(DwtWizardDialog.Z_HIDDEN_PAGE);
Dwt.setVisible(this._pages[a].getHtmlElement(),false)
}
return a
};
DwtWizardDialog.prototype._createContentHtml=function(){
this._table=document.createElement("table");
this._table.border=0;
this._table.width=this._contentW;
this._table.cellPadding=this._table.cellSpacing=0;
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
var o;
var n;
o=this._table.insertRow(0);
o.align="left";
o.vAlign="middle";
n=o.insertCell(o.cells.length);
n.align="left";
n.vAlign="middle";
n.noWrap=true;
n.width="100%";
n.className="DwtTabTable";
n.appendChild(this._progressBar.getHtmlElement());
var r;
var e;
r=this._table.insertRow(1);
r.align="center";
r.vAlign="middle";
e=r.insertCell(r.cells.length);
e.align="left";
e.vAlign="middle";
e.noWrap=true;
e.style.width=this._contentW;
var s=document.createElement("div");
s.className="horizSep";
s.style.width=this._contentW;
s.style.height="5px";
e.appendChild(s);
var t;
var a;
t=this._table.insertRow(2);
t.align="left";
t.vAlign="middle";
a=t.insertCell(t.cells.length);
a.align="left";
a.vAlign="middle";
a.noWrap=true;
a.width=this._contentW;
a.appendChild(this._pageDiv);
this._getContentDiv().appendChild(this._table)
};
DwtWizardDialog.prototype.addChild=function(e){
this._children.add(e)
};
DwtWizardDialog.prototype._showPage=function(e){
if(this._pages&&this._pages[e]){
this._hideAllPages();
this._pages[e].showMe();
Dwt.setVisible(this._pages[e].getHtmlElement(),true)
}};
DwtWizardDialog.prototype._hideAllPages=function(){
if(this._pages&&this._pages.length){
for(var e in this._pages){
if(this._pages[e]){
this._pages[e].hideMe();
Dwt.setVisible(this._pages[e].getHtmlElement(),false)
}}}};
DwtWizardPage=function(t,e){
if(arguments.length==0){
return
}
var a=e||"DwtDialog";
DwtPropertyPage.call(this,t,e,DwtControl.ABSOLUTE_STYLE)
};
DwtWizardPage.prototype=new DwtTabViewPage;
DwtWizardPage.prototype.constructor=DwtWizardPage;
DwtWizardPage.prototype.toString=function(){
return"DwtWizardPage"
};
DwtWizardPage.prototype.setActive=function(){};
DwtWizardPage.prototype.switchToNextPage=function(e){
this.parent.goPage(e)
};
DwtWizardPage.prototype.switchToPrevPage=function(e){
this.parent.goPage(e)
};
DwtWizardPage.prototype.showMe=function(){
this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
this.getHtmlElement().style.height=this.parent._contentH;
this.getHtmlElement().style.width=this.parent._contentW
};
DwtWizProgressBar=function(e){
if(arguments.length==0){
return
}
DwtComposite.call(this,{
parent:e,className:"DwtWizProgressBar",posStyle:DwtControl.STATIC_STYLE}
);
this._table=document.createElement("table");
this._table.border=0;
this._table.cellPadding=0;
this._table.cellSpacing=0;
this.getHtmlElement().appendChild(this._table);
this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
this._stepsNumber=0;
this._steps=new Array();
this._lblHeader=new DwtStepLabel(this);
this._lblHeader.setText("Step 0 of 0");
this._lblHeader.setActive(true)
};
DwtWizProgressBar.prototype=new DwtComposite;
DwtWizProgressBar.prototype.constructor=DwtWizProgressBar;
DwtWizProgressBar.prototype.toString=function(){
return"DwtWizProgressBar"
};
DwtWizProgressBar.prototype.showStep=function(t){
var e="Step "+t+" of "+this._stepsNumber;
if(this._steps[t]){
e=e+": "+this._steps[t]
}
this._lblHeader.setText(e)
};
DwtWizProgressBar.prototype.addStep=function(t,e){
this._steps[t]=e;
return(++this._stepsNumber)
};
DwtWizProgressBar.prototype.addChild=function(a){
this._children.add(a);
var t;
var e;
this._table.width="100%";
t=(this._table.rows.length!=0)?this._table.rows[0]:this._table.insertRow(0);
t.align="center";
t.vAlign="middle";
e=t.insertCell(t.cells.length);
e.align="center";
e.vAlign="middle";
e.noWrap=true;
e.appendChild(a.getHtmlElement())
};
DwtStepLabel=function(e){
DwtLabel.call(this,{
parent:e,style:DwtLabel.ALIGN_CENTER,className:"DwtStepLabel"}
)
};
DwtStepLabel.prototype=new DwtLabel;
DwtStepLabel.prototype.constructor=DwtStepLabel;
DwtStepLabel.prototype.toString=function(){
return"DwtStepLabel"
};
DwtStepLabel.prototype.setActive=function(e){
if(e){
this._textCell.className="DwtStepLabelActive"
}else{
this._textCell.className="DwtStepLabelInactive"
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtSelect")){
DwtSelect=function(o){
if(arguments.length==0){
return
}
o=Dwt.getParams(arguments,DwtSelect.PARAMS);
o.className=o.className||"ZSelect";
o.posStyle=o.posStyle||Dwt.STATIC_STYLE;
DwtButton.call(this,o);
var a=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
this._setEventHdlrs(a);
this._hasSetMouseEvents=true;
this._currentSelectionId=-1;
this._options=new AjxVector();
this._optionValuesToIndices={};
this._selectedValue=this._selectedOption=null;
this._cascade=o.cascade==null||o.cascade;
var e=o.options;
if(e){
for(var t=0;
t<e.length;
++t){
this.addOption(e[t])
}}
this.setDropDownImages("SelectPullDownArrow","SelectPullDownArrowDis","SelectPullDownArrow","SelectPullDownArrow");
this._menuCallback=new AjxListener(this,this._createMenu);
this.setMenu(this._menuCallback,true)
};
DwtSelect.PARAMS=["parent","options","style","className"];
DwtSelect.prototype=new DwtButton;
DwtSelect.prototype.constructor=DwtSelect;
DwtSelect.prototype.toString=function(){
return"DwtSelect"
};
DwtSelect._CONTAINER_TEMPLATE="dwt.Widgets#ZSelectAutoSizingContainer";
DwtSelect._objectIds=[null];
DwtSelect.prototype.TEMPLATE="dwt.Widgets#ZSelect";
DwtSelect.getObjectFromElement=function(e){
return e&&e.dwtObj?AjxCore.objectWithId(e.dwtObj):null
};
DwtSelect.prototype.addOption=function(o,a,s){
if(!o){
return -1
}
var t=null;
var h=null;
if(typeof(o)=="string"){
h=s!=null?s:o;
t=new DwtSelectOption(h,a,o,this,null,null)
}else{
if(o instanceof DwtSelectOption){
t=o;
if(s){
t.setValue(s)
}
a=t.isSelected()
}else{
if(o instanceof DwtSelectOptionData||o.value!=null){
h=s!=null?s:o.value;
t=new DwtSelectOption(h,o.isSelected,o.displayValue,this,null,o.image,o.selectedValue);
a=Boolean(o.isSelected)
}else{
return -1
}}}
this._options.add(t);
if(this._options.size()==1||a){
this._setSelectedOption(t)
}
var n=this._pseudoItemsEl;
var r=n.insertRow(-1);
var e=r.insertCell(-1);
e.className="ZSelectPseudoItem";
e.innerHTML=["<div class='ZWidgetTitle'>",AjxStringUtil.htmlEncode(t.getDisplayValue()),"</div>"].join("");
this.setMenu(this._menuCallback,true);
this._optionValuesToIndices[t.getValue()]=this._options.size()-1;
return(this._options.size()-1)
};
DwtSelect.prototype.popup=function(){
var s=this.getMenu();
if(!s){
return
}
var o=this._selectEl;
var t=Dwt.getBounds(o);
var n=(o.style.borderLeftWidth=="")?0:parseInt(o.style.borderLeftWidth);
var h=(o.style.borderTopWidth=="")?0:parseInt(o.style.borderTopWidth);
h+=(o.style.borderBottomWidth=="")?0:parseInt(o.style.borderBottomWidth);
var a=Dwt.toWindow(o,0,0);
var e=a.x+n;
var r=a.y+t.height+h;
s.popup(0,e,r)
};
DwtSelect.prototype.rename=function(t,a){
var e=this.getOptionWithValue(t);
e._displayValue=a;
if(this.__selectedOption&&(this.__selectedOption._value==t)){
this.setText(AjxStringUtil.htmlEncode(a))
}
this.setMenu(this._menuCallback,true)
};
DwtSelect.prototype.enableOption=function(o,e){
var t=this.getOptionWithValue(o);
if(t.enabled!=e){
t.enabled=e;
var a=t.getItem();
if(a){
a.setEnabled(e)
}}};
DwtSelect.prototype.clearOptions=function(){
var t=this._options.getArray();
for(var e=0;
e<t.length;
++e){
t[e]=null
}
this._options.removeAll();
this._optionValuesToIndices=null;
this._optionValuesToIndices=[];
this._selectedValue=null;
this._selectedOption=null;
this._currentSelectionId=-1
};
DwtSelect.prototype.setName=function(e){
this._name=e
};
DwtSelect.prototype.getName=function(){
return this._name
};
DwtSelect.prototype.setSelectedValue=function(t){
var e=this._optionValuesToIndices[t];
if(e!=null){
this.setSelected(e)
}};
DwtSelect.prototype.setSelected=function(e){
var t=this.getOptionWithHandle(e);
this.setSelectedOption(t)
};
DwtSelect.prototype.getOptionCount=function(){
return this._options.size()
};
DwtSelect.prototype.getOptions=function(){
return this._options
};
DwtSelect.prototype.getOptionWithHandle=function(e){
return this._options.get(e)
};
DwtSelect.prototype.getOptionAtIndex=DwtSelect.prototype.getOptionWithHandle;
DwtSelect.prototype.getIndexForValue=function(e){
return this._optionValuesToIndices[e]
};
DwtSelect.prototype.getOptionWithValue=function(a){
var e=this._optionValuesToIndices[a];
var t=null;
if(e!=null){
t=this.getOptionWithHandle(e)
}
return t
};
DwtSelect.prototype.setSelectedOption=function(e){
if(e){
this._setSelectedOption(e)
}};
DwtSelect.prototype.getValue=function(){
return this._selectedValue
};
DwtSelect.prototype.getSelectedOption=function(){
return this._selectedOption
};
DwtSelect.prototype.getSelectedIndex=function(){
return this.getIndexForValue(this.getValue())
};
DwtSelect.prototype.addChangeListener=function(e){
this.addListener(DwtEvent.ONCHANGE,e)
};
DwtSelect.prototype.size=function(){
return this._options.size()
};
DwtSelect.prototype.disable=function(){
this.setEnabled(false)
};
DwtSelect.prototype.enable=function(){
this.setEnabled(true)
};
DwtSelect.prototype.setImage=function(e){
DwtLabel.prototype.setImage.call(this,e)
};
DwtSelect.prototype.setText=function(e){
DwtLabel.prototype.setText.call(this,e)
};
DwtSelect.prototype.dispose=function(){
this._selectEl=null;
this._pseudoItemsEl=null;
this._containerEl=null;
DwtButton.prototype.dispose.call(this);
if(this._internalObjectId){
DwtSelect._unassignId(this._internalObjectId)
}};
DwtSelect._assignId=function(e){
var t=DwtSelect._objectIds.length;
DwtSelect._objectIds[t]=e;
return t
};
DwtSelect._getObjectWithId=function(e){
return DwtSelect._objectIds[e]
};
DwtSelect._unassignId=function(e){
DwtSelect._objectIds[e]=null
};
DwtSelect.prototype._createHtmlFromTemplate=function(a,n){
var t=DwtSelect._CONTAINER_TEMPLATE;
var e={
id:n.id,selectTemplateId:a||this.TEMPLATE,selectData:n};
DwtButton.prototype._createHtmlFromTemplate.call(this,t,e);
this._selectEl=document.getElementById(n.id+"_select_container");
this._pseudoItemsEl=document.getElementById(n.id+"_pseudoitems_container");
this._pseudoItemsEl.style.display="none";
var o=this.getHtmlElement();
this._containerEl=o;
this._selectEl.className=o.className;
o.className="ZSelectAutoSizingContainer";
o.setAttribute("style","");
if(AjxEnv.isIE){
o.style.overflow="hidden"
}};
DwtSelect.prototype._createMenu=function(){
var r=new DwtSelectMenu(this);
for(var a=0,e=this._options.size();
a<e;
++a){
var t=new DwtSelectMenuItem(r);
var o=this._options.get(a);
var n=o.getImage();
if(n){
t.setImage(n)
}
var s=o.getDisplayValue();
if(s){
t.setText(AjxStringUtil.htmlEncode(s))
}
t.setEnabled(o.enabled);
t.addSelectionListener(new AjxListener(this,this._handleOptionSelection));
t._optionIndex=a;
o.setItem(t)
}
return r
};
DwtSelect.prototype._handleOptionSelection=function(r){
var o=r.item;
var s=o._optionIndex;
var a=this._options.get(s);
var t=this.getValue();
this._setSelectedOption(a);
var e=new Object();
e.selectObj=this;
e.newValue=a.getValue();
e.oldValue=t;
var n=DwtUiEvent.getEvent(r);
n._args=e;
this.notifyListeners(DwtEvent.ONCHANGE,n)
};
DwtSelect.prototype._clearOptionSelection=function(){
if(this._currentSelectionId!=-1){
var e=DwtSelect._getObjectWithId(this._currentSelectionId);
e.deSelect()
}};
DwtSelect.prototype._setSelectedOption=function(t){
var e=t.getSelectedValue()||t.getDisplayValue();
var a=t.getImage();
if(this._selectedOption!=t){
if(e){
this.setText(AjxStringUtil.htmlEncode(e))
}
this.setImage(a);
this._selectedValue=t._value;
this._selectedOption=t
}
this._updateSelection(t);
this.autoResize()
};
DwtSelect.prototype.autoResize=function(){
var e=this.getHtmlElement();
AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
var t=document.getElementById(e.id);
if(t){
t.style.width=t.childNodes[0].offsetWidth||"auto"
}}
,200))
};
DwtSelect.prototype._updateSelection=function(e){
var t=(this._currentSelectionId!=-1)?DwtSelect._getObjectWithId(this._currentSelectionId):null;
if(t){
t.deSelect()
}
if(e){
e.select();
this._currentSelectionId=e.getIdentifier()
}};
DwtSelectOptionData=function(o,a,e,t,n){
if(o==null||a==null){
return null
}
this.value=o;
this.displayValue=a;
this.isSelected=e;
this.selectedValue=t;
this.image=n
};
DwtSelectOption=function(s,n,o,t,e,r,a){
this._value=s;
this._selected=n;
this._displayValue=o;
this._image=r;
this._selectedValue=a;
this._internalObjectId=DwtSelect._assignId(this);
this.enabled=true
};
DwtSelectOption.prototype.setItem=function(e){
this._menuItem=e
};
DwtSelectOption.prototype.getItem=function(e){
return this._menuItem
};
DwtSelectOption.prototype.getDisplayValue=function(){
return this._displayValue
};
DwtSelectOption.prototype.getImage=function(){
return this._image
};
DwtSelectOption.prototype.getSelectedValue=function(){
return this._selectedValue
};
DwtSelectOption.prototype.getValue=function(){
return this._value
};
DwtSelectOption.prototype.setValue=function(e){
this._value=e
};
DwtSelectOption.prototype.select=function(){
this._selected=true
};
DwtSelectOption.prototype.deSelect=function(){
this._selected=false
};
DwtSelectOption.prototype.isSelected=function(){
return this._selected
};
DwtSelectOption.prototype.getIdentifier=function(){
return this._internalObjectId
};
DwtSelectMenu=function(e){
DwtMenu.call(this,{
parent:e,style:DwtMenu.DROPDOWN_STYLE,className:"DwtMenu",cascade:e._cascade}
)
};
DwtSelectMenu.prototype=new DwtMenu;
DwtSelectMenu.prototype.constructor=DwtSelectMenu;
DwtSelectMenu.prototype.TEMPLATE="dwt.Widgets#ZSelectMenu";
DwtSelectMenuItem=function(e){
DwtMenuItem.call(this,{
parent:e,style:DwtMenuItem.SELECT_STYLE,className:"ZSelectMenuItem"}
)
};
DwtSelectMenuItem.prototype=new DwtMenuItem;
DwtSelectMenuItem.prototype.constructor=DwtSelectMenuItem;
DwtSelectMenuItem.prototype.TEMPLATE="dwt.Widgets#ZSelectMenuItem"
}
if(AjxPackage.define("ajax.dwt.widgets.DwtAlert")){
DwtAlert=function(a,t,e){
if(arguments.length==0){
return
}
t=t||"DwtAlert";
e=e||DwtControl.STATIC_STYLE;
DwtControl.call(this,{
parent:a,className:t,posStyle:e}
);
this._alertStyle=DwtAlert.INFORMATION;
this._createHtml()
};
DwtAlert.prototype=new DwtControl;
DwtAlert.prototype.constructor=DwtAlert;
DwtAlert.INFORMATION=0;
DwtAlert.WARNING=1;
DwtAlert.CRITICAL=2;
DwtAlert._ICONS=[AjxImg.getClassForImage("Information_32"),AjxImg.getClassForImage("Warning_32"),AjxImg.getClassForImage("Critical_32")];
DwtAlert._CLASSES=["DwtAlertInfo","DwtAlertWarn","DwtAlertCrit"];
DwtAlert._RE_ICONS=new RegExp(DwtAlert._ICONS.join("|"));
DwtAlert._RE_CLASSES=new RegExp(DwtAlert._CLASSES.join("|"));
DwtAlert.prototype.TEMPLATE="dwt.Widgets#DwtAlert";
DwtAlert.prototype.setStyle=function(e){
this._alertStyle=e||DwtAlert.INFORMATION;
if(this._iconDiv){
Dwt.delClass(this._iconDiv,DwtAlert._RE_ICONS,DwtAlert._ICONS[this._alertStyle])
}
Dwt.delClass(this.getHtmlElement(),DwtAlert._RE_CLASSES,DwtAlert._CLASSES[this._alertStyle])
};
DwtAlert.prototype.getStyle=function(){
return this._alertStyle
};
DwtAlert.prototype.setIconVisible=function(e){
if(this._iconDiv){
Dwt.setVisible(this._iconDiv,e)
}};
DwtAlert.prototype.getIconVisible=function(){
return this._iconDiv?Dwt.getVisible(this._iconDiv):false
};
DwtAlert.prototype.setTitle=function(e){
this._alertTitle=e;
if(this._titleDiv){
this._titleDiv.innerHTML=e||""
}};
DwtAlert.prototype.getTitle=function(){
return this._alertTitle
};
DwtAlert.prototype.setContent=function(e){
this._alertContent=e;
if(this._contentDiv){
this._contentDiv.innerHTML=e||""
}};
DwtAlert.prototype.getContent=function(){
return this._alertContent
};
DwtAlert.prototype.setDismissContent=function(e){
if(this._dismissDiv){
e.reparentHtmlElement(this._dismissDiv.id)
}};
DwtAlert.prototype.getTabGroupMember=function(){
return null
};
DwtAlert.prototype._createHtml=function(e){
var t={
id:this._htmlElId};
this._createHtmlFromTemplate(e||this.TEMPLATE,t)
};
DwtAlert.prototype._createHtmlFromTemplate=function(e,t){
DwtControl.prototype._createHtmlFromTemplate.apply(this,arguments);
this._iconDiv=document.getElementById(t.id+"_icon");
this._titleDiv=document.getElementById(t.id+"_title");
this._contentDiv=document.getElementById(t.id+"_content");
this._dismissDiv=document.getElementById(t.id+"_dismiss")
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtText")){
DwtText=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtText.PARAMS);
e.className=e.className||"DwtText";
DwtControl.call(this,e)
};
DwtText.PARAMS=["parent","className","posStyle"];
DwtText.prototype=new DwtControl;
DwtText.prototype.constructor=DwtText;
DwtText.prototype.toString=function(){
return"DwtText"
};
DwtText.prototype.getTabGroupMember=function(){
return null
};
DwtText.prototype.setText=function(a){
if(!this._textNode){
this._textNode=document.createTextNode(a);
this.getHtmlElement().appendChild(this._textNode)
}else{
try{
this._textNode.data=a
}
catch(t){}}};
DwtText.prototype.getText=function(){
return this._textNode?this._textNode.data:""
};
DwtText.prototype.getTextNode=function(){
return this._textNode
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtIframe")){
DwtIframe=function(o){
o.posStyle=o.posStyle||DwtControl.STATIC_STYLE;
o.className=o.className||"DwtIframe";
DwtControl.call(this,o);
this._styles=o.styles;
this._noscroll=o.noscroll;
this._iframeID=o.id?DwtId.getIframeId(o.id):Dwt.getNextId();
this._onLoadHandler=o.onload;
this._processHtmlCallback=o.processHtmlCallback;
this._hidden=o.hidden;
this._createFrame(o.html);
if(o.useKbMgmt){
var t=this.getIframe();
var e=Dwt.getIframeDoc(t);
var a=AjxEnv.isIE?e:t.contentWindow;
Dwt.setHandler(a,DwtEvent.ONKEYDOWN,DwtKeyboardMgr.__keyDownHdlr);
Dwt.setHandler(a,DwtEvent.ONKEYUP,DwtKeyboardMgr.__keyUpHdlr);
Dwt.setHandler(a,DwtEvent.ONKEYPRESS,DwtKeyboardMgr.__keyPressHdlr)
}};
DwtIframe.prototype=new DwtControl;
DwtIframe.prototype.constructor=DwtIframe;
DwtIframe.prototype.toString=function(){
return"DwtIframe"
};
DwtIframe.prototype.getIframe=function(){
return document.getElementById(this._iframeID)
};
DwtIframe.prototype.getDocument=function(){
return this.getIframe().contentWindow.document
};
DwtIframe.prototype._rawEventHandler=function(r){
var a=this.getIframe();
var o=a.contentWindow;
if(AjxEnv.isIE){
r=o.event
}
var e;
if(/mouse|context|click|select/i.test(r.type)){
e=new DwtMouseEvent(true)
}else{
e=new DwtUiEvent(true)
}
e.setFromDhtmlEvent(r);
if(r.type=="mousedown"&&DwtMenu&&DwtMenu._outsideMouseDownListener){
DwtMenu._outsideMouseDownListener(r)
}
var n=e.type.toLowerCase();
if(!/^on/.test(n)){
n="on"+n
}
var s=this.getLocation();
if(!AjxEnv.isIE){
var h=o.document;
var t=h.documentElement.scrollLeft||(h.body?h.body.scrollLeft:0);
var u=h.documentElement.scrollTop||(h.body?h.body.scrollTop:0);
s.x-=t;
s.y-=u
}
e.docX+=s.x;
e.docY+=s.y;
e.elementX+=s.x;
e.elementY+=s.y;
var d=DwtMouseEventCapture.getCaptureObj();
if(AjxEnv.isIE||AjxEnv.isSafari||!d){
DwtEventManager.notifyListeners(n,e);
this.parent.notifyListeners(n,e)
}else{
var c=document.createEvent("MouseEvents");
c.initMouseEvent(r.type,true,true,document.defaultView,0,r.screenX,r.screenY,e.docX,e.docY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget);
document.body.dispatchEvent(c)
}
e.setToDhtmlEvent(r);
return e._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(t){
var e=this.getHTMLElId();
function a(s){
var n=document.getElementById(e);
var o=DwtControl.findControl(n);
return o._rawEventHandler(s)
}
(function(){
var c,h=[],r=0,o;
var s=document.getElementById(e);
var n=DwtControl.findControl(s);
h[r++]="<iframe";
if(n._noscroll){
h[r++]=" scrolling='no'"
}
if(n._hidden){
h[r++]=" style='visibility:hidden'"
}
h[r++]=" frameborder='0' width='100%' id='";
h[r++]=n._iframeID;
h[r++]="' name='"+n._iframeID+"'";
if(n._onLoadHandler){
h[r++]=" onload='"+n._onLoadHandler+"'"
}
h[r++]=" src='javascript:\"\";' ></iframe>";
n.setContent(h.join(""));
t=t.replace(/(<style[^>]*>)[\s\t\u00A0]*((.|\n)*?)[\s\t\u00A0]*<\x2fstyle>/mgi,function(d,m,u){
return m+u.replace(/@import.*?(;|[\s\t\u00A0]*$)/gi,"")+"</style>"
}
);
c=n.getIframe();
o=Dwt.getIframeDoc(c);
o.open();
if(n._styles){
o.write(["<style type='text/css'>",n._styles,"</style>"].join(""))
}
o.write(t);
o.close();
if(n._processHtmlCallback){
n._processHtmlCallback.run(o)
}
h=o.documentElement.style;
h.margin=h.padding="0";
if(o.body){
o.body.style.margin="0"
}
h=DwtIframe._forwardEvents;
if(!AjxEnv.isIE){
o=c.contentWindow
}
for(r=h.length;
--r>=0;
){
o[h[r]]=a
}}
)()
};
DwtIframe.prototype._resetEventHandlers=function(){
var e=this;
function t(a){
return e._rawEventHandler(a)
}
(function(){
var s,n=[],o=0,a;
s=e.getIframe();
a=Dwt.getIframeDoc(s);
n=DwtIframe._forwardEvents;
if(!AjxEnv.isIE){
a=s.contentWindow
}
for(o=n.length;
--o>=0;
){
a[n[o]]=t
}}
)()
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPropertySheet")){
DwtPropertySheet=function(n,o,a,e){
if(arguments.length==0){
return
}
o=o||"DwtPropertySheet";
DwtComposite.call(this,{
parent:n,className:o,posStyle:a}
);
this._labelSide=e||DwtPropertySheet.DEFAULT;
this._propertyIdCount=0;
this._propertyList=[];
this._propertyMap={};
this._tableEl=document.createElement("TABLE");
this._tableEl.border=0;
this._tableEl.cellSpacing=3;
this._tableEl.cellPadding=0;
var t=this.getHtmlElement();
t.appendChild(this._tableEl)
};
DwtPropertySheet.prototype=new DwtComposite;
DwtPropertySheet.prototype.constructor=DwtPropertySheet;
DwtPropertySheet.prototype.toString=function(){
return"DwtPropertySheet"
};
DwtPropertySheet.RIGHT="right";
DwtPropertySheet.LEFT="left";
DwtPropertySheet.DEFAULT=DwtPropertySheet.LEFT;
DwtPropertySheet.prototype._labelSide;
DwtPropertySheet.prototype._labelCssClass="Label";
DwtPropertySheet.prototype._valueCssClass="Field";
DwtPropertySheet.prototype._tableEl;
DwtPropertySheet.prototype._propertyIdCount;
DwtPropertySheet.prototype._propertyList;
DwtPropertySheet.prototype._propertyMap;
DwtPropertySheet.prototype.addProperty=function(t,o,s){
var e=this._tableEl.rows.length;
var n=this._tableEl.insertRow(e);
n.vAlign=this._vAlign?this._vAlign:"top";
if(this._labelSide==DwtPropertySheet.LEFT){
this._insertLabel(n,t,s);
this._insertValue(n,o,s)
}else{
this._insertValue(n,o,s);
this._insertLabel(n,t,s)
}
var r=this._propertyIdCount++;
var a={
id:r,index:e,row:n,visible:true};
this._propertyList.push(a);
this._propertyMap[r]=a;
return r
};
DwtPropertySheet.prototype._insertLabel=function(n,e,o){
var a=n.insertCell(-1);
a.className=this._labelCssClass;
if(this._labelSide!=DwtPropertySheet.LEFT){
a.width="100%";
a.style.textAlign="left"
}
a.innerHTML=e;
if(o){
var t=this._tableEl.ownerDocument.createElement("SUP");
t.innerHTML="*";
a.insertBefore(t,a.firstChild)
}};
DwtPropertySheet.prototype._insertValue=function(o,t,a){
var e=o.insertCell(-1);
e.className=this._valueCssClass;
if(!t){
e.innerHTML="&nbsp;"
}else{
if(t instanceof DwtControl){
e.appendChild(t.getHtmlElement())
}else{
if(t.nodeType==AjxUtil.ELEMENT_NODE){
e.appendChild(t)
}else{
e.innerHTML=String(t)
}}}};
DwtPropertySheet.prototype.removeProperty=function(s){
var n=this._propertyMap[s];
if(n.visible){
var t=n.index;
var o=this.__getTableIndex(t);
var a=this._tableEl.rows[o];
a.parentNode.removeChild(a)
}
n.row=null;
for(var e=index+1;
e<this._propertyList.length;
e++){
var n=this._propertyList[e];
n.index--
}
this._propertyList.splice(index,1);
delete this._propertyMap[s]
};
DwtPropertySheet.prototype.setPropertyVisible=function(s,o){
var n=this._propertyMap[s];
if(n.visible!=o){
n.visible=o;
var e=n.index;
if(o){
var a=this.__getTableIndex(e);
var t=this._tableEl.insertRow(a);
DwtPropertySheet.__moveChildNodes(n.row,t);
n.row=t
}else{
var t=n.row;
if(t&&t.parentNode){
t.parentNode.removeChild(t)
}}}};
DwtPropertySheet.prototype.__getTableIndex=function(t){
var a=0;
for(var e=0;
e<t;
e++){
var o=this._propertyList[e];
if(o.visible){
a++
}}
return a
};
DwtPropertySheet.__moveChildNodes=function(t,e){
if(t===e){
return
}
var a=t.firstChild;
while(a!=null){
e.appendChild(a);
a=t.firstChild
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtGrouper")){
DwtGrouper=function(o,a,t){
if(arguments.length==0){
return
}
a=a||"DwtGrouper";
t=t||DwtControl.STATIC_STYLE;
DwtComposite.call(this,{
parent:o,posStyle:t}
);
this._labelEl=document.createElement("LEGEND");
this._insetEl=document.createElement("DIV");
this._borderEl=document.createElement("FIELDSET");
this._borderEl.appendChild(this._labelEl);
this._borderEl.appendChild(this._insetEl);
var e=this.getHtmlElement();
e.appendChild(this._borderEl)
};
DwtGrouper.prototype=new DwtComposite;
DwtGrouper.prototype.constructor=DwtGrouper;
DwtGrouper.prototype._borderEl;
DwtGrouper.prototype._labelEl;
DwtGrouper.prototype._insetEl;
DwtGrouper.prototype.setLabel=function(e){
Dwt.setVisible(this._labelEl,Boolean(e));
this._labelEl.style.display="";
this._labelEl.innerHTML=e?e:""
};
DwtGrouper.prototype.setContent=function(t){
var e=this._insetEl;
e.innerHTML=t
};
DwtGrouper.prototype.setElement=function(t){
var e=this._insetEl;
Dwt.removeChildren(e);
e.appendChild(t)
};
DwtGrouper.prototype.setView=function(e){
this.setElement(e.getHtmlElement())
};
DwtGrouper.prototype.getInsetHtmlElement=function(){
return this._insetEl
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtProgressBar")){
DwtProgressBar=function(a,t,e){
if(arguments.length==0){
return
}
e=e||DwtControl.STATIC_STYLE;
DwtComposite.call(this,{
parent:a,posStyle:e}
);
this._maxValue=100;
this._value=0;
this._quotabarDiv=null;
this._quotausedDiv=null;
this._progressBgColor=null;
this._progressCssClass="quotaused";
this._wholeBgColor=null;
this._wholeCssClass="quotabar";
this._createHTML()
};
DwtProgressBar.prototype=new DwtComposite;
DwtProgressBar.prototype.constructor=DwtProgressBar;
DwtProgressBar.prototype.setProgressBgColor=function(e){
this._progressBgColor=e
};
DwtProgressBar.prototype.setWholeBgColor=function(e){
this._wholeBgColor=e
};
DwtProgressBar.prototype.setProgressCssClass=function(e){
this._progressCssClass=e
};
DwtProgressBar.prototype.setWholeCssClass=function(e){
this._wholeCssClass=e
};
DwtProgressBar.prototype.setProgressCssStyle=function(e){
this._progressCssStyle=e
};
DwtProgressBar.prototype.setWholeCssStyle=function(e){
this._wholeCssStyle=e
};
DwtProgressBar.prototype.setValue=function(t){
this._value=parseInt(t);
var e;
if(this._value==this._maxValue){
e=100
}else{
e=Math.min(Math.round((this._value/this._maxValue)*100),100)
}
if(isNaN(e)){
e="0"
}
if(!this._quotabarDiv){
this._quotabarDiv=document.createElement("div");
if(this._wholeCssClass){
this._quotabarDiv.className=this._wholeCssClass
}
if(this._wholeBgColor){
this._quotabarDiv.backgroundColor=this._wholeBgColor
}
this._cell.appendChild(this._quotabarDiv)
}
if(!this._quotausedDiv){
this._quotausedDiv=document.createElement("div");
if(this._progressCssClass){
this._quotausedDiv.className=this._progressCssClass
}
if(this._progressBgColor){
this._quotausedDiv.style.backgroundColor=this._progressBgColor
}
this._quotabarDiv.appendChild(this._quotausedDiv)
}
this._quotausedDiv.style.width=e+"%"
};
DwtProgressBar.prototype.setValueByPercent=function(e){
this.setMaxValue(100);
this.setValue(e.replace(/\%/gi,""))
};
DwtProgressBar.prototype.getValue=function(){
return this._value
};
DwtProgressBar.prototype.getMaxValue=function(){
return this._maxValue
};
DwtProgressBar.prototype.setMaxValue=function(e){
this._maxValue=parseInt(e)
};
DwtProgressBar.prototype.setLabel=function(n,t){
var a=document.createTextNode(n);
var e=t?-1:0;
var o=this._row.insertCell(e);
o.appendChild(a)
};
DwtProgressBar.prototype._createHTML=function(){
this._table=document.createElement("table");
this._table.border=this._table.cellpadding=this._table.cellspacing=0;
this._row=this._table.insertRow(-1);
this._cell=this._row.insertCell(-1);
this.getHtmlElement().appendChild(this._table)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyEditor")){
DwtPropertyEditor=function(n,t,o,a,e){
if(arguments.length>0){
if(!o){
o="DwtPropertyEditor"
}
DwtComposite.call(this,{
parent:n,className:o,posStyle:a,deferred:e}
);
this._useDwtInputField=t!=null?t:true;
this._schema=null;
this._init()
}};
DwtPropertyEditor.MSG_TIMEOUT=4000;
DwtPropertyEditor.MSG={
mustMatch:"This field does not match validators: REGEXP",mustNotMatch:"This field matches anti-validators: REGEXP"};
DwtPropertyEditor.prototype=new DwtComposite;
DwtPropertyEditor.prototype.constructor=DwtPropertyEditor;
DwtPropertyEditor.prototype.toString=function(){
return"DwtPropertyEditor"
};
DwtPropertyEditor.prototype._init=function(){
var t=document.createElement("div");
t.id=this._relDivId=Dwt.getNextId();
t.style.position="relative";
var e=document.createElement("table");
e.id=this._tableId=Dwt.getNextId();
e.cellSpacing=e.cellPadding=0;
e.appendChild(document.createElement("tbody"));
t.appendChild(e);
this.getHtmlElement().appendChild(t);
this.maxLabelWidth=0;
this.maxFieldWidth=0;
this._setMouseEventHdlrs();
this._onMouseDown=new AjxListener(this,this._onMouseDown);
this.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown)
};
DwtPropertyEditor.prototype.getRelDiv=function(){
return document.getElementById(this._relDivId)
};
DwtPropertyEditor.prototype.getTable=function(){
return document.getElementById(this._tableId)
};
DwtPropertyEditor.prototype._onMouseDown=function(a){
var o=a.target;
var e=o.tagName.toLowerCase();
if(e=="input"){
a._stopPropagation=false;
a._returnValue=true;
return true
}
if(this._currentInputField&&!this._currentInputField.onblur()){
a._stopPropagation=true;
a._returnValue=false;
return false
}
try{
while(o&&e!="tr"){
o=o.parentNode;
e=o.tagName.toLowerCase()
}
if(o&&o.__msh_doMouseDown){
o.__msh_doMouseDown(a)
}}
catch(t){}};
DwtPropertyEditor.prototype.getProperties=function(){
if(this._currentInputField){
this._currentInputField.onblur()
}
function e(o){
var r={}
,a,s=o.length;
for(var t=0;
t<s;
++t){
a=o[t];
if(a.type=="struct"){
r[a.name]=e(a.children)
}else{
r[a.name]=a.value
}}
return r
}
return e(this._schema)
};
DwtPropertyEditor.prototype.validateData=function(){
var e=true;
function t(s){
var o,r=s.length;
for(var a=0;
a<r;
++a){
o=s[a];
if(o.type=="struct"){
t(o.children)
}else{
if(!o._validate()){
e=false
}}}}
t(this._schema);
return e
};
DwtPropertyEditor.prototype.initProperties=function(a,t){
if(t==null){
this._schema=a;
t=null
}
for(var e=0;
e<a.length;
++e){
this._createProperty(a[e],t)
}};
DwtPropertyEditor.prototype._createProperty=function(e,c){
var t=c?c._level+1:0;
var h=this.getTable().firstChild.appendChild(document.createElement("tr"));
e._parent=c;
e._level=t;
e._rowElId=h.id=Dwt.getNextId();
e._propertyEditor=this;
for(var s in DwtPropertyEditor._prop_functions){
e[s]=DwtPropertyEditor._prop_functions[s]
}
e._init();
h.className="level-"+t;
if(e.visible=="false"){
h.className+=" invisible"
}
if(e.readonly){
h.className+=" readonly"
}
if(e.type!="struct"){
h.className+=" "+e.type;
var a=document.createElement("td");
a.className="label";
if(e.type=="checkboxgroup"){
a.className+=" grouplabel"
}
h.appendChild(a);
var r=AjxStringUtil.htmlEncode(e.label||e.name);
if(e.required){
r+="<span class='DwtPropertyEditor-required'>*</span>"
}
a.innerHTML=r;
var o=document.createElement("td");
o.className="field";
h.appendChild(o);
switch(e.type){
case"boolean":this._createCheckbox(e,o);
break;
case"enum":this._createDropDown(e,o);
break;
case"date":this._createCalendar(e,o);
break;
case"checkboxgroup":this._createCheckBoxGroup(e,o);
break;
default:if(this._useDwtInputField){
this._createInputField(e,o)
}else{
o.innerHTML=e._makeDisplayValue();
h.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._edit,e)
}
break
}
e._fieldCellId=o.id=Dwt.getNextId();
if(a.offsetWidth>this.maxLabelWidth){
this.maxLabelWidth=a.offsetWidth
}
if(o.offsetWidth>this.maxFieldWidth){
this.maxFieldWidth=o.offsetWidth
}}else{
var n=document.createElement("td");
n.colSpan=2;
h.appendChild(n);
n.className="label";
h.className+=" expander-collapsed";
n.innerHTML=["<div>",AjxStringUtil.htmlEncode(e.label),"</div>"].join("");
this.initProperties(e.children,e);
h.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._toggle,e)
}
if(t>0){
h.style.display="none";
c._hidden=true
}};
DwtPropertyEditor.prototype.setFixedLabelWidth=function(e){
try{
this.getTable().rows[0].cells[0].style.width=(e||this.maxLabelWidth)+"px"
}
catch(t){}};
DwtPropertyEditor.prototype.setFixedFieldWidth=function(e){
try{
this.getTable().rows[0].cells[1].style.width=(e||this.maxFieldWidth)+"px"
}
catch(t){}};
DwtPropertyEditor.prototype._setCurrentMsgDiv=function(e){
this._currentMsgDiv=e;
this._currentMsgDivTimer=setTimeout(DwtPropertyEditor.simpleClosure(this._clearMsgDiv,this),DwtPropertyEditor.MSG_TIMEOUT)
};
DwtPropertyEditor.prototype._clearMsgDiv=function(){
try{
this._stopMsgDivTimer()
}
catch(e){}
var t=this._currentMsgDiv;
if(t){
t.parentNode.removeChild(t);
this._currentMsgDiv=t=null;
this._currentMsgDivTimer=null
}};
DwtPropertyEditor.prototype._stopMsgDivTimer=function(){
if(this._currentMsgDivTimer){
clearTimeout(this._currentMsgDivTimer);
this._currentMsgDivTimer=null
}};
DwtPropertyEditor.prototype.addChild=function(e){
if(!this._currentFieldCell){
DwtComposite.prototype.addChild.call(this,e)
}else{
this._children.add(e);
this._currentFieldCell.appendChild(e.getHtmlElement())
}};
DwtPropertyEditor.prototype._createCheckbox=function(a,t){
var e=document.createElement("input");
e._prop=a;
e.id=a.name;
e.type="checkbox";
if(AjxEnv.isIE){
e.attachEvent("onclick",a._onCheckboxChange)
}else{
e.addEventListener("click",a._onCheckboxChange,false)
}
this._children.add(e);
t.appendChild(e);
if(a.value=="true"){
e.checked=a.value
}};
DwtPropertyEditor.prototype._createCheckBoxGroup=function(e,n){
var t=document.createElement("div");
t._prop=e;
t.id=e.name;
e._checkBox=[];
t.appendChild(document.createTextNode(e.value));
var h=document.createElement("table");
h.id=Dwt.getNextId();
h.border=0;
h.cellSpacing=h.cellPadding=0;
h.appendChild(document.createElement("tbody"));
for(var a=0;
a<e.checkBox.length;
a++){
var s=document.createElement("tr");
var c=document.createElement("td");
c.className="field";
var o=this._createCheckboxForGroup(e,e.checkBox[a],c);
s.appendChild(c);
o._label=e.checkBox[a].label;
var r=document.createElement("td");
r.className="field";
r.appendChild(document.createTextNode(e.checkBox[a].label));
s.appendChild(r);
h.firstChild.appendChild(s);
e._checkBox[a]=o
}
t.appendChild(h);
this._children.add(t);
n.appendChild(t);
return t
};
DwtPropertyEditor.prototype._createCheckboxForGroup=function(e,o,a){
var t=document.createElement("input");
t._prop=e;
t.id=o.name;
t.type="checkbox";
if(o.value=="true"){
t.checked=o.value
}
if(AjxEnv.isIE){
t.attachEvent("onclick",e._onCheckboxGroupChange)
}else{
t.addEventListener("click",e._onCheckboxGroupChange,false)
}
this._children.add(t);
a.appendChild(t);
return t
};
DwtPropertyEditor.prototype._createDropDown=function(r,s){
this._currentFieldCell=s;
var o,n,a=0,t=[],e=r.item;
while(o=e[a]){
t[a++]=new DwtSelectOption(o.value,o.value==r.value,o.label)
}
r._select=n=new DwtSelect({
parent:this,options:t}
);
n.addChangeListener(new AjxListener(r,r._onSelectChange));
n.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown);
this._currentFieldCell=null
};
DwtPropertyEditor.prototype._createCalendar=function(s,o){
this._currentFieldCell=o;
var t=new DwtButton({
parent:this}
);
this._currentFieldCell=null;
t.setText(s._makeDisplayValue());
var n=new DwtMenu({
parent:t,style:DwtMenu.CALENDAR_PICKER_STYLE}
);
n.setAssociatedObj(t);
var a=new DwtCalendar({
parent:n}
);
var e=new Date();
e.setTime(s.value);
a.setDate(e);
a.setSize(150,"auto");
a.addSelectionListener(new AjxListener(s,s._onCalendarSelect));
t.setMenu(n);
s._dateButton=t;
s._dateCalendar=a
};
DwtPropertyEditor.DWT_INPUT_FIELD_TYPES={
string:DwtInputField.STRING,password:DwtInputField.PASSWORD,integer:DwtInputField.INTEGER,number:DwtInputField.FLOAT};
DwtPropertyEditor.prototype._createInputField=function(o,a){
this._currentFieldCell=a;
var e=DwtPropertyEditor.DWT_INPUT_FIELD_TYPES[o.type]||DwtInputField.STRING;
var t=new DwtInputField({
parent:this,type:e,initialValue:o.value,maxLen:o.maxLength,rows:o.rows}
);
if(e==DwtInputField.INTEGER||e==DwtInputField.FLOAT){
t.setValidNumberRange(o.minValue||null,o.maxValue||null);
if(o.decimals!=null){
t.setNumberPrecision(o.decimals)
}}
if(e==DwtInputField.STRING||e==DwtInputField.PASSWORD){
t.setValidStringLengths(o.minLength,o.maxLength)
}
if(o.required){
t.setRequired()
}
this._currentFieldCell=null;
o._inputField=t;
t.setValue(o.value);
if(o.readonly){
t.setReadOnly(true)
}
t.setValidationCallback(new AjxCallback(o,o._onDwtInputFieldValidated))
};
DwtPropertyEditor._prop_functions={
_init:function(){
this.type!=null||(this.type="string");
this.value!=null||(this.value="");
this._initialVal=this.value;
if(this.type=="date"){
if(!this.value){
this.value=new Date().getTime()
}
if(!this.format){
this.format=AjxDateUtil.getSimpleDateFormat().toPattern()
}}}
,_modified:function(){
return this._initialVal!=this.value
}
,_getRowEl:function(){
return document.getElementById(this._rowElId)
}
,_makeDisplayValue:function(){
var t=this._getValue();
switch(this.type){
case"password":t=t.replace(/./g,"*");
break;
case"date":var e=new Date();
e.setTime(t);
t=AjxDateFormat.format(this.format,e);
break
}
if(t==""){
t="<br />"
}else{
t=AjxStringUtil.htmlEncode(String(t))
}
return t
}
,_display:function(o){
var n=this.children,a=o?"":"none";
if(n){
var e=n.length;
while(--e>=0){
n[e]._getRowEl().style.display=a;
if(!o){
n[e]._display(false)
}}
this._hidden=!o;
var t=this._getRowEl();
t.className=t.className.replace(/expander-[^\s]+/,o?"expander-expanded":"expander-collapsed")
}}
,_toggle:function(){
this._display(this._hidden)
}
,_edit:function(){
if(this.readonly){
return
}
switch(this.type){
case"string":case"number":case"integer":case"password":setTimeout(DwtPropertyEditor.simpleClosure(this._createInputField,this),50);
break
}}
,_createInputField:function(){
var e=this._propertyEditor;
var s=document.getElementById(this._fieldCellId);
var a=e.getRelDiv();
var t=document.createElement("input");
t.className="DwtPropertyEditor-input "+this.type;
t.setAttribute("autocomplete","off");
t.type=this.type=="password"?"password":"text";
var n=s.offsetLeft,o=s.offsetTop;
if(AjxEnv.isGeckoBased){
--n;
--o
}
t.style.left=n+"px";
t.style.top=o+"px";
t.style.width=s.offsetWidth+1+"px";
t.style.height=s.offsetHeight+1+"px";
t.value=this._getValue();
a.appendChild(t);
t.focus();
t.onblur=DwtPropertyEditor.simpleClosure(this._saveInput,this);
t.onkeydown=DwtPropertyEditor.simpleClosure(this._inputKeyPress,this);
this._propertyEditor._currentInputField=this._inputField=t;
if(!AjxEnv.isGeckoBased){
t.select()
}else{
t.setSelectionRange(0,t.value.length)
}}
,_getValue:function(){
return this.value||""
}
,_checkValue:function(a){
var e=a=="";
if(e){
if(!this.required){
return a
}
this._displayMsg(AjxMsg.valueIsRequired);
return null
}
if(this.maxLength!=null&&a.length>this.maxLength){
this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooLong,this.maxLength));
return null
}
if(this.minLength!=null&&a.length<this.minLength){
this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooShort,this.minLength));
return null
}
if(this.mustMatch&&!this.mustMatch.test(a)){
this._displayMsg(this.msg_mustMatch||DwtPropertyEditor.MSG.mustMatch.replace(/REGEXP/,this.mustMatch.toString()));
return null
}
if(this.mustNotMatch&&this.mustNotMatch.test(a)){
this._displayMsg(this.msg_mustNotMatch||DwtPropertyEditor.MSG.mustNotMatch.replace(/REGEXP/,this.mustNotMatch.toString()));
return null
}
switch(this.type){
case"integer":case"number":var s=new Number(a);
if(isNaN(s)){
this._displayMsg(AjxMsg.notANumber);
return null
}
if(this.type=="integer"&&Math.round(s)!=s){
this._displayMsg(AjxMsg.notAnInteger);
return null
}
if(this.minValue!=null&&s<this.minValue){
this._displayMsg(AjxMessageFormat.format(AjxMsg.numberLessThanMin,this.minValue));
return null
}
if(this.maxValue!=null&&s>this.maxValue){
this._displayMsg(AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this.maxValue));
return null
}
a=s;
if(this.type=="number"&&this.decimals!=null){
var t=a.toString();
var o=t.indexOf(".");
if(o==-1){
o=t.length
}
a=a.toPrecision(o+this.decimals)
}
break
}
return a
}
,_displayMsg:function(t){
var r,s,c,o;
var n=this._propertyEditor;
var e=n._currentMsgDiv;
if(!e){
e=document.createElement("div");
e.className="DwtPropertyEditor-ErrorMsg";
n.getRelDiv().appendChild(e)
}else{
n._stopMsgDivTimer()
}
e.style.visibility="hidden";
e.innerHTML=AjxStringUtil.htmlEncode(t);
var d=n.getTable();
c=d.offsetWidth;
if(!AjxEnv.isIE){
c-=12
}
r=d.offsetLeft;
e.style.left=r+"px";
e.style.width=c+"px";
o=e.offsetHeight;
var a=document.getElementById(this._fieldCellId);
s=a.offsetTop+a.offsetHeight;
if(s+o>d.offsetTop+d.offsetHeight){
s=a.offsetTop-o
}
e.style.top=s+"px";
e.style.visibility="";
n._setCurrentMsgDiv(e)
}
,_saveInput:function(){
var e=this._inputField;
var t=this._checkValue(e.value);
if(t!=null){
this._setValue(t);
e.onblur=e.onkeyup=e.onkeydown=e.onkeypress=null;
var a=document.getElementById(this._fieldCellId);
a.innerHTML=this._makeDisplayValue();
this._inputField=null;
this._propertyEditor._currentInputField=null;
this._propertyEditor._clearMsgDiv();
e.parentNode.removeChild(e);
return true
}else{
if(e.className.indexOf(" DwtPropertyEditor-input-error")==-1){
e.className+=" DwtPropertyEditor-input-error"
}
e.focus();
return false
}}
,_inputKeyPress:function(t){
t||(t=window.event);
var e=this._inputField;
if(t.keyCode==13){
this._saveInput()
}else{
if(t.keyCode==27){
e.value=this._getValue();
this._saveInput()
}else{
this._propertyEditor._clearMsgDiv();
e.className=e.className.replace(/ DwtPropertyEditor-input-error/,"")
}}}
,_onCheckboxChange:function(t){
t||(t=window.event);
var e=AjxEnv.isIE?t.srcElement:t.target;
e._prop._setValue(e.checked?"true":"false")
}
,_onSelectChange:function(){
this._setValue(this._select.getValue())
}
,_onCheckboxGroupChange:function(o){
o||(o=window.event);
var a=AjxEnv.isIE?o.srcElement:o.target;
var e=a._prop._checkBox;
var n=[];
for(var t=0;
t<e.length;
t++){
if(e[t].checked){
n.push(e[t]._label)
}}
a._prop._setValue(n)
}
,_onCalendarSelect:function(){
this._setValue(this._dateCalendar.getDate().getTime());
this._dateButton.setText(this._makeDisplayValue())
}
,_onDwtInputFieldValidated:function(e,a,t){
if(a){
this._setValue(t)
}}
,_setValue:function(t){
this.value=t;
var e=this._getRowEl();
e.className=e.className.replace(/ dirty/,"");
if(this._modified()){
e.className+=" dirty"
}}
,_validate:function(){
if(this._inputField){
if(this._inputField instanceof DwtInputField){
return this._inputField.validate()
}else{
return this._inputField.onblur()
}}else{
return true
}}};
DwtPropertyEditor.simpleClosure=function(e,t){
return function(){
return e.call(t,arguments[0])
}
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtConfirmDialog")){
DwtConfirmDialog=function(t,e){
if(arguments.length==0){
return
}
var a=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.CANCEL_BUTTON];
DwtDialog.call(this,{
parent:t,className:e,title:AjxMsg.confirmTitle,standardButtons:a}
);
this._questionDiv=document.createElement("DIV");
this._questionDiv.className="DwtConfirmDialogQuestion";
this._getContentDiv().appendChild(this._questionDiv);
this.registerCallback(DwtDialog.YES_BUTTON,this._handleYesButton,this);
this.registerCallback(DwtDialog.NO_BUTTON,this._handleNoButton,this);
this.registerCallback(DwtDialog.CANCEL_BUTTON,this._handleCancelButton,this)
};
DwtConfirmDialog.prototype=new DwtDialog;
DwtConfirmDialog.prototype.constructor=DwtConfirmDialog;
DwtConfirmDialog.prototype.toString=function(){
return"DwtConfirmDialog"
};
DwtConfirmDialog.prototype.popup=function(a,e,o,t,n){
this._questionDiv.innerHTML=a||"";
this._yesCallback=e;
this._noCallback=o;
this._cancelCallback=t;
this.setButtonVisible(DwtDialog.CANCEL_BUTTON,Boolean(o));
DwtDialog.prototype.popup.call(this,n)
};
DwtConfirmDialog.prototype.popdown=function(){
this._yesCallback=this._noCallback=this._cancelCallback=null;
DwtDialog.prototype.popdown.call(this)
};
DwtConfirmDialog.prototype._handleYesButton=function(e){
if(this._yesCallback){
this._yesCallback.run(e)
}
this.popdown()
};
DwtConfirmDialog.prototype._handleNoButton=function(e){
if(this._noCallback){
this._noCallback.run(e)
}
this.popdown()
};
DwtConfirmDialog.prototype._handleCancelButton=function(e){
if(this._cancelCallback){
this._cancelCallback.run(e)
}
this.popdown()
};
DwtConfirmDialog.prototype._getSeparatorTemplate=function(){
return""
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtChooser")){
DwtChooser=function(a){
if(arguments.length==0){
return
}
DwtComposite.call(this,a.parent,a.className);
this._slvClassName=a.slvClassName;
this._tlvClassName=a.tlvClassName;
this._layoutStyle=a.layoutStyle?a.layoutStyle:DwtChooser.HORIZ_STYLE;
this._selectStyle=a.selectStyle?a.selectStyle:DwtChooser.MULTI_SELECT;
this._mode=a.listStyle?a.listStyle:DwtChooser.MODE_MOVE;
this._noDuplicates=(a.noDuplicates!==false);
this._singleHeight=a.singleHeight?a.singleHeight:45;
this._listSize=a.listSize;
this._sourceEmptyOk=a.sourceEmptyOk;
this._allButtons=a.allButtons;
this._hasTextField=a.hasTextField;
this._handleButtonInfo(a.buttonInfo);
this._mode=a.mode?a.mode:this._hasMultiButtons?DwtChooser.MODE_COPY:DwtChooser.MODE_MOVE;
this._createHtml();
this._initialize();
var t=a.parent.getSize();
var o=a.listWidth||t.x;
var e=a.listHeight||t.y;
if(o&&e){
this.resize(o,e)
}};
DwtChooser.prototype=new DwtComposite;
DwtChooser.prototype.constructor=DwtChooser;
DwtChooser.HORIZ_STYLE=1;
DwtChooser.VERT_STYLE=2;
DwtChooser.SINGLE_SELECT=1;
DwtChooser.MULTI_SELECT=2;
DwtChooser.MODE_COPY=1;
DwtChooser.MODE_MOVE=2;
DwtChooser.REMOVE_BTN_ID="__remove__";
DwtChooser.ADD_ALL_BTN_ID="__addAll__";
DwtChooser.REMOVE_ALL_BTN_ID="__removeAll__";
DwtChooser.prototype.toString=function(){
return"DwtChooser"
};
DwtChooser.prototype.setItems=function(t,e,a){
e=e?e:DwtChooserListView.SOURCE;
this._reset(e);
this.addItems(t,e,true);
this._selectFirst(e);
if(a){
this._reset((e==DwtChooserListView.SOURCE)?DwtChooserListView.TARGET:DwtChooserListView.SOURCE)
}};
DwtChooser.prototype.getItems=function(e){
e=e?e:DwtChooserListView.TARGET;
if(e==DwtChooserListView.SOURCE){
return this.sourceListView.getList().clone()
}else{
if(this._hasMultiButtons){
var a={};
for(var t in this._data){
a[t]=this._data[t].clone()
}
return a
}else{
return this._data[this._buttonInfo[0].id].clone()
}}};
DwtChooser.prototype.addItems=function(t,e,o,r){
e=e?e:DwtChooserListView.SOURCE;
var s=(t instanceof AjxVector)?t.getArray():(t instanceof Array)?t:[t];
if(e==DwtChooserListView.SOURCE){
for(var a=0;
a<s.length;
a++){
this._addToSource(s[a],null,o)
}}else{
var n;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.targetListView._resetList();
s=(s.length>0)?[s[0]]:s
}
for(var a=0;
a<s.length;
a++){
this._addToTarget(s[a],r,o)
}}
if(e==DwtChooserListView.SOURCE){
var s=this.sourceListView.getList();
this._sourceSize=s?s.size():0
}};
DwtChooser.prototype.removeItems=function(o,e,a){
o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
for(var t=0;
t<o.length;
t++){
(e==DwtChooserListView.SOURCE)?this._removeFromSource(o[t],a):this._removeFromTarget(o[t],a)
}};
DwtChooser.prototype.transfer=function(t,o,e){
o=o?o:this._activeButtonId;
this._setActiveButton(o);
if(this._mode==DwtChooser.MODE_MOVE){
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
var a=this.targetListView.getList();
if(a&&a.size()){
this.remove(a,true)
}}
this.removeItems(t,DwtChooserListView.SOURCE,true)
}
this.addItems(t,DwtChooserListView.TARGET,e);
this.sourceListView.deselectAll()
};
DwtChooser.prototype.remove=function(o,a){
o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
if(this._mode==DwtChooser.MODE_MOVE){
for(var t=0;
t<o.length;
t++){
var e=this._getInsertionIndex(this.sourceListView,o[t]);
this.sourceListView.addItem(o[t],e,true)
}
this._sourceSize=o?o.length:0
}
this.removeItems(o,DwtChooserListView.TARGET)
};
DwtChooser.prototype.setSelectStyle=function(o,r){
if(o==this._selectStyle){
return
}
this._selectStyle=o;
if(this._defLabel){
var t=this._button[this._buttonInfo[0].id];
t.setText((o==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add)
}
if(!r){
var n=this.getSize();
this.resize(n.x,n.y)
}
if(this._allButtons){
this._addAllButton.setVisible(o==DwtChooser.MULTI_SELECT);
this._removeAllButton.setVisible(o==DwtChooser.MULTI_SELECT);
this._enableButtons()
}
if(o==DwtChooser.SINGLE_SELECT){
var s=this.targetListView.getList();
var e=s?s.clone().getArray():null;
if(e&&e.length){
this._reset(DwtChooserListView.TARGET);
this.addItems(e[0],DwtChooserListView.TARGET,true);
this.targetListView.deselectAll();
if(e.length>1&&this._mode==DwtChooser.MODE_MOVE){
this.addItems(e.slice(1),DwtChooserListView.SOURCE,true)
}
this._enableButtons()
}}
this.sourceListView.multiSelectEnabled=(o==DwtChooser.MULTI_SELECT);
this.targetListView.multiSelectEnabled=(o==DwtChooser.MULTI_SELECT)
};
DwtChooser.prototype.reset=function(e){
this._reset(e);
this._setActiveButton(this._buttonInfo[0].id);
this._enableButtons();
if(this._hasTextField){
this._textField.setValue("")
}};
DwtChooser.prototype._reset=function(e){
if(!e||e==DwtChooserListView.SOURCE){
this.sourceListView._resetList()
}
if(!e||e==DwtChooserListView.TARGET){
this.targetListView._resetList();
for(var t in this._data){
this._data[t].removeAll()
}}};
DwtChooser.prototype.addStateChangeListener=function(e){
this.targetListView.addStateChangeListener(e)
};
DwtChooser.prototype.removeStateChangeListener=function(e){
this.targetListView.removeStateChangeListener(e)
};
DwtChooser.prototype.getSourceListView=function(){
return document.getElementById(this._sourceListViewDivId)
};
DwtChooser.prototype.getButtons=function(){
return document.getElementById(this._buttonsDivId)
};
DwtChooser.prototype.getTargetListView=function(){
return document.getElementById(this._targetListViewDivId)
};
DwtChooser.prototype.getTextField=function(){
return this._textField
};
DwtChooser.prototype._createHtml=function(){
this._sourceListViewDivId=Dwt.getNextId();
this._targetListViewDivId=Dwt.getNextId();
this._buttonsDivId=Dwt.getNextId();
this._removeButtonDivId=Dwt.getNextId();
if(this._allButtons){
this._addAllButtonDivId=Dwt.getNextId();
this._removeAllButtonDivId=Dwt.getNextId()
}
if(this._hasTextField){
this._textFieldTdId=Dwt.getNextId()
}
var a=[];
var e=0;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
a[e++]="<table cellspacing=0 cellpadding=0 border=0>";
a[e++]="<tr>";
a[e++]="<td id='";
a[e++]=this._sourceListViewDivId;
a[e++]="'></td>";
a[e++]="<td valign='middle' id='";
a[e++]=this._buttonsDivId;
a[e++]="'>";
if(this._allButtons){
a[e++]="<div id='";
a[e++]=this._addAllButtonDivId;
a[e++]="'></div><br>"
}
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
a[e++]="<div id='";
a[e++]=this._buttonDivId[o];
a[e++]="'></div><br>"
}
a[e++]="<br><div id='";
a[e++]=this._removeButtonDivId;
a[e++]="'></div>";
if(this._allButtons){
a[e++]="<br><div id='";
a[e++]=this._removeAllButtonDivId;
a[e++]="'></div><br>"
}
a[e++]="</td>";
a[e++]="<td id='";
a[e++]=this._targetListViewDivId;
a[e++]="'></td>";
a[e++]="</tr>";
if(this._hasTextField){
a[e++]="<tr><td>";
a[e++]="<table border=0 width=100%><tr><td style='white-space:nowrap; width:1%'>";
a[e++]=AjxMsg.add;
a[e++]=":</td><td id='";
a[e++]=this._textFieldTdId;
a[e++]="'></td></tr></table>";
a[e++]="</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
}
a[e++]="</table>"
}else{
a[e++]="<div id='";
a[e++]=this._sourceListViewDivId;
a[e++]="'></div>";
a[e++]="<div align='center' id='";
a[e++]=this._buttonsDivId;
a[e++]="'>";
a[e++]="<table><tr>";
if(this._allButtons){
a[e++]="<td id='";
a[e++]=this._addAllButtonDivId;
a[e++]="'></td>"
}
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
a[e++]="<td id='";
a[e++]=this._buttonDivId[o];
a[e++]="'></td>"
}
a[e++]="<td id='";
a[e++]=this._removeButtonDivId;
a[e++]="'></td>";
if(this._allButtons){
a[e++]="<td id='";
a[e++]=this._removeAllButtonDivId;
a[e++]="'></td>"
}
a[e++]="</tr></table></div>";
a[e++]="<div id='";
a[e++]=this._targetListViewDivId;
a[e++]="'></div>"
}
this.getHtmlElement().innerHTML=a.join("")
};
DwtChooser.prototype._handleButtonInfo=function(t){
if(!t){
this._defLabel=(this._selectStyle==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add;
t=[{
label:this._defLabel}
]
}
this._buttonInfo=t;
this._buttonDivId={};
this._buttonId={};
if(this._buttonInfo.length==1){
if(!this._buttonInfo[0].id){
this._buttonInfo[0].id=Dwt.getNextId()
}
this._activeButtonId=this._buttonInfo[0].id
}
for(var e=0;
e<this._buttonInfo.length;
e++){
var a=this._buttonInfo[e].id;
this._buttonDivId[a]=Dwt.getNextId();
this._buttonId[a]=Dwt.getNextId()
}
this._hasMultiButtons=(this._buttonInfo.length>1)
};
DwtChooser.prototype._initialize=function(){
var e=new AjxListener(this,this._transferButtonListener);
this._button={};
this._buttonIndex={};
this._data={};
for(var t=0;
t<this._buttonInfo.length;
t++){
var o=this._buttonInfo[t].id;
this._button[o]=this._setupButton(o,this._buttonId[o],this._buttonDivId[o],this._buttonInfo[t].label);
this._button[o].addSelectionListener(e);
this._buttonIndex[o]=t;
this._data[o]=new AjxVector()
}
this.sourceListView=this._createSourceListView();
this._addListView(this.sourceListView,this._sourceListViewDivId);
this.sourceListView.addSelectionListener(new AjxListener(this,this._sourceListener));
this.targetListView=this._createTargetListView();
this._addListView(this.targetListView,this._targetListViewDivId);
this.targetListView.addSelectionListener(new AjxListener(this,this._targetListener));
this._removeButtonId=Dwt.getNextId();
this._removeButton=this._setupButton(DwtChooser.REMOVE_BTN_ID,this._removeButtonId,this._removeButtonDivId,AjxMsg.remove);
this._removeButton.addSelectionListener(new AjxListener(this,this._removeButtonListener));
if(this._allButtons){
this._addAllButtonId=Dwt.getNextId();
this._addAllButton=this._setupButton(DwtChooser.ADD_ALL_BTN_ID,this._addAllButtonId,this._addAllButtonDivId,AjxMsg.addAll);
this._addAllButton.addSelectionListener(new AjxListener(this,this._addAllButtonListener));
this._removeAllButtonId=Dwt.getNextId();
this._removeAllButton=this._setupButton(DwtChooser.REMOVE_ALL_BTN_ID,this._removeAllButtonId,this._removeAllButtonDivId,AjxMsg.removeAll);
this._removeAllButton.addSelectionListener(new AjxListener(this,this._removeAllButtonListener));
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this._addAllButton.setVisible(false);
this._removeAllButton.setVisible(false)
}}
if(this._hasTextField){
var a={
parent:this,type:DwtInputField.STRING};
this._textField=new DwtInputField(a);
this._textField.reparentHtmlElement(this._textFieldTdId);
this._textField._chooser=this;
this._textField.setHandler(DwtEvent.ONKEYUP,DwtChooser._onKeyUp);
Dwt.setSize(this._textField.getInputElement(),"100%",Dwt.DEFAULT)
}
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
this.sourceListView.multiSelectEnabled=false;
this.targetListView.multiSelectEnabled=false
}};
DwtChooser.prototype._createSourceListView=function(){
return new DwtChooserListView(this,DwtChooserListView.SOURCE,this._slvClassName)
};
DwtChooser.prototype._createTargetListView=function(){
return new DwtChooserListView(this,DwtChooserListView.TARGET,this._tlvClassName)
};
DwtChooser.prototype._addListView=function(t,a){
var e=document.getElementById(a);
e.appendChild(t.getHtmlElement());
t.setUI(null,true);
t._initialized=true
};
DwtChooser.prototype.resize=function(n,e){
if(!n||!e){
return
}
if(n==Dwt.DEFAULT&&e==Dwt.DEFAULT){
return
}
var a=document.getElementById(this._buttonsDivId);
var r=Dwt.getSize(a);
var t,o,s;
if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
t=this._listSize?this._listSize:(n==Dwt.DEFAULT)?n:Math.floor(((n-r.x)/2)-12);
o=s=e
}else{
t=n;
if(this._selectStyle==DwtChooser.SINGLE_SELECT){
o=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:e-r.y-this._singleHeight-30;
s=(e==Dwt.DEFAULT)?e:e-r.y-o-30
}else{
o=s=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:Math.floor(((e-r.y)/2)-12)
}}
this.sourceListView.setSize(t+2,o);
this.targetListView.setSize(t+2,s)
};
DwtChooser.prototype._setupButton=function(s,a,n,e){
var t=new DwtButton({
parent:this,id:a}
);
t.setText(e);
t.id=a;
t._buttonId=s;
var o=document.getElementById(n);
o.appendChild(t.getHtmlElement());
return t
};
DwtChooser.prototype._sourceListener=function(e){
if(e.detail==DwtListView.ITEM_DBL_CLICKED){
this.transfer(this.sourceListView.getSelection(),this._activeButtonId);
this.sourceListView.deselectAll()
}else{
if(this._activeButtonId==DwtChooser.REMOVE_BTN_ID){
var t=this._lastActiveTransferButtonId?this._lastActiveTransferButtonId:this._buttonInfo[0].id;
this._setActiveButton(t)
}}
this.targetListView.deselectAll();
this._enableButtons()
};
DwtChooser.prototype._targetListener=function(e){
if(e.detail==DwtListView.ITEM_DBL_CLICKED){
this.remove(this.targetListView.getSelection())
}else{
this._setActiveButton(DwtChooser.REMOVE_BTN_ID);
this.sourceListView.deselectAll();
this._enableButtons()
}};
DwtChooser.prototype._transferButtonListener=function(a){
var t=DwtControl.getTargetControl(a);
var s=t._buttonId;
var n=this.sourceListView.getSelection();
if(n&&n.length){
this.transfer(n,s);
var o=this.sourceListView.getList();
if(o&&o.size()){
this._selectFirst(DwtChooserListView.SOURCE)
}else{
this._enableButtons()
}}else{
var e=this._getEmailFromText();
if(e){
this.transfer([e],s)
}else{
this._setActiveButton(s)
}}};
DwtChooser.prototype._removeButtonListener=function(e){
this.remove(this.targetListView.getSelection());
var t=this.targetListView.getList();
if(t&&t.size()){
this._selectFirst(DwtChooserListView.TARGET)
}else{
this._enableButtons()
}};
DwtChooser.prototype._addAllButtonListener=function(e){
this.transfer(this.sourceListView.getList().clone());
this._selectFirst(DwtChooserListView.TARGET)
};
DwtChooser.prototype._removeAllButtonListener=function(e){
this.remove(this.targetListView.getList().clone());
this._selectFirst(DwtChooserListView.SOURCE)
};
DwtChooser.prototype._enableButtons=function(a,r){
var h=this.sourceListView.getList();
var d=this.targetListView.getList();
var o=(a||(this.sourceListView.getSelectionCount()>0));
for(var s=0;
s<this._buttonInfo.length;
s++){
var t=this._buttonInfo[s].id;
this._button[t].setEnabled(o)
}
var c=(r||(this.targetListView.getSelectionCount()>0));
this._removeButton.setEnabled(c);
if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){
var e=h?h.size():0;
var n=d?d.size():0;
this._addAllButton.setEnabled(e>0);
this._removeAllButton.setEnabled(n>0)
}};
DwtChooser.prototype._selectFirst=function(t,a){
var e=(t==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView;
var o=e.getList();
if(o&&o.size()>0){
e.setSelection(o.get(0))
}};
DwtChooser.prototype._setActiveButton=function(o){
if(!this._hasMultiButtons){
return
}
if(o!=this._activeButtonId){
var a=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId];
if(a){
var e=DwtControl.findControl(document.getElementById(a));
if(e){
e.setDisplayState(DwtControl.NORMAL)
}}
a=(o==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[o];
var t=DwtControl.findControl(document.getElementById(a));
if(t){
t.setDisplayState(DwtControl.DEFAULT)
}
this._activeButtonId=o;
if(o!=DwtChooser.REMOVE_BTN_ID){
this._lastActiveTransferButtonId=o
}}};
DwtChooser.prototype._isDuplicate=function(e,t){
return t.contains(e)
};
DwtChooser.prototype._addToSource=function(a,e,t){
if(!a){
return
}
if(!a._chooserIndex){
var o=this.sourceListView.getList();
a._chooserIndex=o?o.size()+1:1
}
this.sourceListView.addItem(a,e,t)
};
DwtChooser.prototype._addToTarget=function(c,e,s){
if(!c){
return
}
e=e?e:this._activeButtonId;
if(this._noDuplicates&&this._data[e]&&this._isDuplicate(c,this._data[e])){
return
}
var n=this.targetListView.getList();
if(n&&n.contains(c)&&c.clone){
var a=c.clone();
a.id=Dwt.getNextId();
c=a
}
var r=null;
if(this._hasMultiButtons){
n=[];
for(var t=0;
t<this._buttonInfo.length;
t++){
n=n.concat(this._data[this._buttonInfo[t].id].getArray())
}
var o=this._buttonIndex[e];
for(r=0;
r<n.length;
r++){
var h=this._buttonIndex[n[r]._buttonId];
if(h>o){
break
}}}
c._buttonId=e;
c.id=c.id||Dwt.getNextId();
this._data[e].add(c);
this.targetListView.addItem(c,r,s)
};
DwtChooser.prototype._removeFromSource=function(t,e){
if(!t){
return
}
var a=this.sourceListView.getList();
if(!a){
return
}
if(!a.contains(t)){
return
}
this.sourceListView.removeItem(t,e)
};
DwtChooser.prototype._removeFromTarget=function(t,e){
if(!t){
return
}
var a=this.targetListView.getList();
if(!a){
return
}
if(!a.contains(t)){
return
}
this._data[t._buttonId].remove(t);
this.targetListView.removeItem(t,e)
};
DwtChooser.prototype._getInsertionIndex=function(t,n){
var s=t.getList();
if(!s){
return null
}
var e=s.getArray();
for(var o=0;
o<e.length;
o++){
if(n._chooserIndex&&e[o]._chooserIndex&&(e[o]._chooserIndex>=n._chooserIndex)){
return o
}}
return null
};
DwtChooser.prototype._getEmailFromText=function(){
var t=this._textField.getValue();
var e=AjxEmailAddress.parse(t);
if(e){
e.id=Dwt.getNextId();
return e
}};
DwtChooser._onKeyUp=function(n){
var a=DwtUiEvent.getTarget(n);
var s=DwtControl.findControl(a);
var o=s._chooser;
var t=DwtKeyEvent.getCharCode(n);
if(t==3||t==13){
var e=o._getEmailFromText();
if(e){
o.transfer([e],o._activeButtonId);
a.value=""
}}
o._enableButtons(a.value.length)
};
DwtChooserListView=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtChooserListView.PARAMS);
e.className=e.className||"DwtChooserListView";
e.headerList=this._getHeaderList(parent);
DwtListView.call(this,e);
this.type=e.type;
this._chooserParent=e.parent.parent
};
DwtChooserListView.PARAMS=["parent","type","className","view"];
DwtChooserListView.SOURCE=1;
DwtChooserListView.TARGET=2;
DwtChooserListView.prototype=new DwtListView;
DwtChooserListView.prototype.constructor=DwtChooserListView;
DwtChooserListView.prototype._getHeaderList=function(){};
DwtChooserListView.prototype.toString=function(){
return"DwtChooserListView"
};
DwtChooserListView.prototype.setUI=function(t,e){
e=e?e:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk);
DwtListView.prototype.setUI.call(this,t,e)
};
DwtChooserListView.prototype._itemClicked=function(e,t){
if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){
return
}else{
DwtListView.prototype._itemClicked.call(this,e,t)
}};
DwtChooserListView.prototype._sortColumn=function(t,e){
this._chooserParent.search(t,e)
};
DwtChooserListView.prototype._getHeaderSashLocation=function(){
var t=this.getHtmlElement();
if(Dwt.getPosition(t)==Dwt.ABSOLUTE_STYLE){
return DwtListView.prototype._getHeaderSashLocation.call(this)
}
var a=Dwt.toWindow(t,0,0);
var e=Dwt.toWindow(this._chooserParent.getHtmlElement(),0,0);
if(!this._tmpPoint){
this._tmpPoint=new DwtPoint()
}
this._tmpPoint.x=a.x-e.x;
this._tmpPoint.y=a.y-e.y;
return this._tmpPoint
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtGridSizePicker")){
DwtGridSizePicker=function(e,t){
if(arguments.length==0){
return
}
DwtControl.call(this,{
parent:e,className:"DwtGridSizePicker"}
);
this._title=t;
if(e instanceof DwtMenu){
e.addPopdownListener(new AjxListener(this,this._reset))
}
this._reset()
};
DwtGridSizePicker.prototype=new DwtControl;
DwtGridSizePicker.prototype.constructor=DwtGridSizePicker;
DwtGridSizePicker.prototype.addSelectionListener=function(e){
this.addListener(DwtEvent.SELECTION,e)
};
DwtGridSizePicker.prototype.removeSelectionListener=function(e){
this.removeListener(DwtEvent.SELECTION,e)
};
DwtGridSizePicker.prototype._createGrid=function(){
var a=this.getHtmlElement();
var t=["<table cellpadding='0' border='0' cellspacing='0'>","<tr class='info'><td colspan='",this.maxCols,"'>",this._title,"</td></tr>"];
var o=["<tr class='grid'>"];
for(var e=0;
e<this.maxCols;
++e){
o.push("<td unselectable='unselectable'></td>")
}
o.push("</tr>");
o=o.join("");
for(var e=0;
e<this.maxRows;
++e){
t.push(o)
}
t.push("</table>");
t=t.join("");
a.innerHTML=t;
a.onmouseover=DwtGridSizePicker._onMouseOver;
a.onmouseup=DwtGridSizePicker._onSelect
};
DwtGridSizePicker.prototype._reset=function(){
this._endRow=-1;
this._endCol=-1;
this.maxRows=7;
this.maxCols=7;
this._createGrid()
};
DwtGridSizePicker._onSelect=function(e){
if(AjxEnv.isIE){
e=window.event
}
DwtControl.getTargetControl(e)._onSelect(e)
};
DwtGridSizePicker.prototype._onSelect=function(o){
if(AjxEnv.isIE){
o=window.event
}
var a=new DwtUiEvent();
a.setFromDhtmlEvent(o);
var n=a.target;
if(n.tagName.toLowerCase()=="td"){
var s=n.parentNode.rowIndex;
if(s>0){
var e=n.cellIndex;
var t=DwtShell.selectionEvent;
t.item=this;
t.detail={
rows:s,cols:e+1};
if(this.parent instanceof DwtMenu){
DwtMenu.closeActiveMenu()
}
this.notifyListeners(DwtEvent.SELECTION,t)
}}};
DwtGridSizePicker.prototype._onMouseOut=function(o){
if(AjxEnv.isIE){
o=window.event
}
var t=new DwtUiEvent();
t.setFromDhtmlEvent(o);
var n=t.target;
var a=this.getHtmlElement().firstChild;
try{
while(n&&n!==a){
n=n.parentNode
}}
catch(e){
n=null
}
if(!n){
this._endRow=this._endCol=-1;
this._update()
}};
DwtGridSizePicker._onMouseOver=function(e){
if(AjxEnv.isIE){
e=window.event
}
DwtControl.getTargetControl(e)._onMouseOver(e)
};
DwtGridSizePicker.prototype._onMouseOver=function(t){
var e=new DwtUiEvent(true);
e.setFromDhtmlEvent(t);
var a=e.target;
if(this._updateTimeout){
clearTimeout(this._updateTimeout)
}
this._updateTimeout=setTimeout(AjxCallback.simpleClosure(this._updateOnTimeout,this,a),10);
e.setToDhtmlEvent(t)
};
DwtGridSizePicker.prototype._addRow=function(){
var t=this.getHtmlElement().firstChild;
var a=t.insertRow(-1);
a.className="grid";
for(var e=0;
e<this.maxCols;
++e){
var o=a.insertCell(-1);
o.unselectable=true
}
++this.maxRows
};
DwtGridSizePicker.prototype._addCol=function(){
var t=this.getHtmlElement().firstChild;
var o=t.rows;
for(var e=1;
e<=this.maxRows;
++e){
var a=o[e];
var n=a.insertCell(-1);
n.unselectable=true
}
++t.rows[0].cells[0].colSpan;
++this.maxCols
};
DwtGridSizePicker.prototype._updateOnTimeout=function(a){
var e=true,o,t;
if(a.tagName.toLowerCase()=="td"){
o=a.parentNode.rowIndex;
if(o>0){
t=this._endCol=a.cellIndex;
this._endRow=a.parentNode.rowIndex-1;
e=false
}}
if(e){
this._endRow=this._endCol=-1
}
this._update();
if(!e){
if(o==this.maxRows){
this._addRow()
}
if(t==this.maxCols-1){
this._addCol()
}}};
DwtGridSizePicker.prototype._update=function(){
var t=this._endRow;
var s=this._endCol;
var h=this.getHtmlElement().firstChild;
var n=h.rows[0].cells[0];
this._rows=t+1;
this._cols=s+1;
if(this._rows>0&&this._cols>0){
n.innerHTML=this._rows+" x "+this._cols
}else{
n.innerHTML=this._title
}
for(var a=0;
a<this.maxRows;
++a){
var c=h.rows[a+1];
for(var e=0;
e<this.maxCols;
++e){
var r=c.cells[e];
var o=(a>this._endRow)||(e>this._endCol);
if(o){
Dwt.delClass(r,"Hovered")
}else{
Dwt.addClass(r,"Hovered")
}}}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtSpinner")){
DwtSpinner=function(e){
if(arguments.length==0){
return
}
DwtControl.call(this,{
parent:e.parent,className:e.className,posStyle:e.posStyle,parentElement:e.parentElement}
);
this._maxValue=e.max!=null?e.max:null;
this._minValue=e.min!=null?e.min:null;
this._fieldSize=e.size!=null?e.size:3;
this._origValue=e.value||0;
this._maxLen=e.maxLen||null;
this._step=e.step||1;
this._decimals="decimals" in e?e.decimals:0;
this._align=e.align||null;
this._timerFunc=AjxCallback.simpleClosure(this._timerFunc,this);
this._btnPressCapture=new DwtMouseEventCapture({
targetObj:this,id:"DwtSpinner",mouseUpHdlr:AjxCallback.simpleClosure(this._stopCapture,this)}
);
this._createElements()
};
DwtSpinner.prototype=new DwtControl;
DwtSpinner.prototype.constructor=DwtSpinner;
DwtSpinner.INIT_TIMER=250;
DwtSpinner.SLOW_TIMER=125;
DwtSpinner.FAST_TIMER=33;
DwtSpinner.prototype._createElements=function(){
var s=this.getHtmlElement();
var n=Dwt.getNextId();
this._idField=n;
this._idUpButton=n+"-up";
this._idDownButton=n+"-down";
var o=["<table class='DwtSpinner' cellspacing='0' cellpadding='0'>","<tr><td rowspan='2' class='DwtSpinner-inputCell'>","<input id='",n,"' autocomplete='off' />","</td>","<td unselectable id='",this._idUpButton,"' class='DwtSpinner-upBtn'><div class='ImgUpArrowSmall'>&nbsp;</div></td>","</tr><tr>","<td unselectable id='",this._idDownButton,"' class='DwtSpinner-downBtn'><div class='ImgDownArrowSmall'>&nbsp;</div></td>","</tr></table>"];
s.innerHTML=o.join("");
var a=this._getUpButton();
a.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Up");
var t=this._getDownButton();
t.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Down");
var e=this.getInputElement();
if(this._maxLen){
e.maxLength=this._maxLen
}
if(this._fieldSize){
e.size=this._fieldSize
}
if(this._align){
e.style.textAlign=this._align
}
if(this._origValue!=null){
this.setValue(this._origValue)
}
e.onblur=AjxCallback.simpleClosure(this.setValue,this,null);
e[(AjxEnv.isIE||AjxEnv.isOpera)?"onkeydown":"onkeypress"]=AjxCallback.simpleClosure(this.__onKeyPress,this)
};
DwtSpinner.prototype._getValidValue=function(e){
var t=parseFloat(e);
if(isNaN(t)||t==null){
t=this._lastValidValue
}
if(t==null){
t=this._minValue||0
}
if(this._minValue!=null&&t<this._minValue){
t=this._minValue
}
if(this._maxValue!=null&&t>this._maxValue){
t=this._maxValue
}
t=parseFloat(t);
if(this._decimals!=null){
t=t.toFixed(this._decimals)
}
this._lastValidValue=t;
return t
};
DwtSpinner.prototype.getInputElement=function(){
return document.getElementById(this._idField)
};
DwtSpinner.prototype._getUpButton=function(){
return document.getElementById(this._idUpButton)
};
DwtSpinner.prototype._getDownButton=function(){
return document.getElementById(this._idDownButton)
};
DwtSpinner.prototype._getButton=function(e){
switch(e){
case"Up":return this._getUpButton();
case"Down":return this._getDownButton()
}};
DwtSpinner.prototype._setBtnState=function(e,a){
var t=this._getButton(e);
if(a){
Dwt.addClass(t,"DwtSpinner-"+e+"-disabled");
t.firstChild.className="Img"+e+"ArrowSmallDis"
}else{
Dwt.delClass(t,"DwtSpinner-"+e+"-disabled");
t.firstChild.className="Img"+e+"ArrowSmall"
}};
DwtSpinner.prototype.getValue=function(){
return parseFloat(this._getValidValue(this.getInputElement().value))
};
DwtSpinner.prototype.setValue=function(e){
if(e==null){
e=this.getInputElement().value
}
e=this._getValidValue(e);
this.getInputElement().value=e;
e=parseFloat(e);
this._setBtnState("Down",this._minValue!=null&&this._minValue==e);
this._setBtnState("Up",this._maxValue!=null&&this._maxValue==e)
};
DwtSpinner.prototype.setEnabled=function(e){
DwtControl.prototype.setEnabled.call(this,e);
this.getInputElement().disabled=!e;
var t=this.getHtmlElement().firstChild;
if(!e){
Dwt.addClass(t,"DwtSpinner-disabled")
}else{
Dwt.delClass(t,"DwtSpinner-disabled")
}};
DwtSpinner.prototype._rotateVal=function(e){
var t=this.getValue();
switch(e){
case"Up":t+=this._step;
break;
case"Down":t-=this._step;
break
}
this.setValue(t)
};
DwtSpinner.prototype._btnPressed=function(e){
if(!this.getEnabled()){
return
}
Dwt.addClass(this._getButton(e),"DwtSpinner-"+e+"-pressed");
this._direction=e;
this._rotateVal(e);
this._btnPressCapture.capture();
this._timerSteps=0;
this._timer=setTimeout(this._timerFunc,DwtSpinner.INIT_TIMER)
};
DwtSpinner.prototype._timerFunc=function(){
var a=this.getValue();
this._rotateVal(this._direction);
var t=this.getValue();
this._timerSteps++;
var e=this._timerSteps>4?DwtSpinner.FAST_TIMER:DwtSpinner.SLOW_TIMER;
if(a!=t){
this._timer=setTimeout(this._timerFunc,e)
}else{
this._stopCapture()
}};
DwtSpinner.prototype._stopCapture=function(){
if(this._timer){
clearTimeout(this._timer)
}
this._timer=null;
this._timerSteps=null;
var t=this._direction;
Dwt.delClass(this._getButton(t),"DwtSpinner-"+t+"-pressed");
this._direction=null;
this._btnPressCapture.release();
var e=this.getInputElement();
e.focus();
Dwt.setSelectionRange(e,0,e.value.length)
};
DwtSpinner.prototype.__onKeyPress=function(a){
if(AjxEnv.isIE){
a=window.event
}
var t=null;
switch(a.keyCode){
case 38:t="Up";
break;
case 40:t="Down";
break
}
if(t){
this._rotateVal(t);
var e=this.getInputElement();
Dwt.setSelectionRange(e,0,e.value.length)
}};
DwtSpinner.prototype.focus=function(){
this.getInputElement().focus()
};
DwtSpinner.prototype.select=function(){
var e=this.getInputElement();
e.focus();
Dwt.setSelectionRange(e,0,e.value.length)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtButtonColorPicker")){
DwtButtonColorPicker=function(a){
if(arguments.length==0){
return
}
a=Dwt.getParams(arguments,DwtButtonColorPicker.PARAMS);
a.actionTiming=DwtButton.ACTION_MOUSEUP;
DwtButton.call(this,a);
var e=new DwtMenu({
parent:this,style:DwtMenu.COLOR_PICKER_STYLE}
);
this.setMenu(e);
var t=new DwtColorPicker(e,null,null,a.noFillLabel,a.allowColorInput);
t.addSelectionListener(new AjxListener(this,this._colorPicked));
this.__colorPicker=t;
this.__color=""
};
DwtButtonColorPicker.PARAMS=["parent","style","className","posStyle","id","index","noFillLabel","allowColorInput"];
DwtButtonColorPicker.prototype=new DwtButton;
DwtButtonColorPicker.prototype.constructor=DwtButtonColorPicker;
DwtButtonColorPicker._RGB_RE=/rgb\(([0-9]{1,3}),\s*([0-9]{1,3}),\s*([0-9]{1,3})\)/;
DwtButtonColorPicker._hexdigits=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
DwtButtonColorPicker.toHex=function(o,t){
var e=[];
while(o){
var a=DwtButtonColorPicker._hexdigits[o&15];
e.push(a);
o=o>>4
}
if(t!=null){
t-=e.length;
while(t-->0){
e.push("0")
}}
e.reverse();
return e.join("")
};
DwtButtonColorPicker.prototype.showColorDisplay=function(e){
if(!this._colorEl){
return
}
if(!e){
this._colorEl.onmouseover=DwtButtonColorPicker.__colorDisplay_onMouseOver;
this._colorEl.onmouseout=DwtButtonColorPicker.__colorDisplay_onMouseOut;
this._colorEl.onmousedown=DwtButtonColorPicker.__colorDisplay_onMouseDown
}};
DwtButtonColorPicker.prototype.getColor=function(){
return this.__color
};
DwtButtonColorPicker.prototype.setColor=function(e){
var t=e.match(DwtButtonColorPicker._RGB_RE);
if(t){
e="#"+DwtButtonColorPicker.toHex(parseInt(t[1]),2)+DwtButtonColorPicker.toHex(parseInt(t[2]),2)+DwtButtonColorPicker.toHex(parseInt(t[3]),2)
}
this.__color=e;
var a=this._colorEl;
if(a){
a.style.backgroundColor=e
}};
DwtButtonColorPicker.prototype._createHtmlFromTemplate=function(t,a){
DwtButton.prototype._createHtmlFromTemplate.call(this,t,a);
var e=AjxTemplate.expand("dwt.Widgets#ZButtonColorDisplay",a);
this.setText(e);
this._colorEl=document.getElementById(a.id+"_color")
};
DwtButtonColorPicker.prototype._setMinWidth=function(){};
DwtButtonColorPicker.prototype._colorPicked=function(a){
var e=a.detail;
this.__color=this.__detail=e;
var t=this._colorEl;
if(t){
t.style.backgroundColor=e
}
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var o=DwtShell.selectionEvent;
o.item=this;
o.detail=e;
this.notifyListeners(DwtEvent.SELECTION,o)
}};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseOver=function(e,t){
if(!this.getEnabled()){
return
}
Dwt.addClass(t,"ImgDisable")
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseOut=function(e,t){
if(!this.getEnabled()){
return
}
Dwt.delClass(t,"ImgDisable")
};
DwtButtonColorPicker.prototype.__colorDisplay_onMouseDown=function(t,o){
if(!this.getEnabled()){
return
}
var e=DwtShell.mouseEvent;
e.setFromDhtmlEvent(t);
this.__color=this.__detail=o.style.backgroundColor="";
if(this.isListenerRegistered(DwtEvent.SELECTION)){
var a=DwtShell.selectionEvent;
a.item=this;
a.detail="";
this.notifyListeners(DwtEvent.SELECTION,a)
}
e._stopPropagation=true;
e._returnValue=false;
e.setToDhtmlEvent(t);
return false
};
DwtButtonColorPicker.__colorDisplay_onMouseOver=function(e){
var t=DwtControl.getTargetControl(e);
t.__colorDisplay_onMouseOver(e,this)
};
DwtButtonColorPicker.__colorDisplay_onMouseOut=function(e){
var t=DwtControl.getTargetControl(e);
t.__colorDisplay_onMouseOut(e,this)
};
DwtButtonColorPicker.__colorDisplay_onMouseDown=function(e){
var t=DwtControl.getTargetControl(e);
t.__colorDisplay_onMouseDown(e,this)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtMessageComposite")){
DwtMessageComposite=function(a,t,e){
if(arguments.length==0){
return
}
t=t||"DwtMessageComposite";
DwtComposite.call(this,{
parent:a,className:t,posStyle:e}
)
};
DwtMessageComposite.prototype=new DwtComposite;
DwtMessageComposite.prototype.constructor=DwtMessageComposite;
DwtMessageComposite.prototype.toString=function(){
return"DwtMessageComposite"
};
DwtMessageComposite.prototype._formatter;
DwtMessageComposite.prototype._controls;
DwtMessageComposite.prototype.setFormat=function(f,h,n){
this._formatter=new AjxMessageFormat(f);
this._controls={};
var y=this._htmlElId;
var q=["<table class='DwtCompositeTable' border='0' cellspacing='0' cellpadding='0'><tr valign='center'>"];
var w=this._formatter.getSegments();
var s={};
var v={};
for(var k=0;
k<w.length;
k++){
var t=w[k];
var x=t instanceof AjxMessageFormat.MessageSegment;
var d=[y,k].join("_");
q.push("<td id='",d,"' class='",(x?"MessageControl"+t.getIndex():"")," DwtCompositeCell'>");
if(x){
var u=h?h.run(this,t,k):null;
if(!u){
u=new DwtInputField({
parent:this}
)
}
s[d]=u.getHtmlElement();
v[d]=n&&n.run(this,t,k);
var m=t.getIndex();
this._controls[m]=this._controls[m]||u
}else{
q.push(t.toSubPattern())
}
q.push("</td>")
}
q.push("</tr></table>");
var o=this.getHtmlElement();
var c=o.childNodes.length;
var j=document.createElement("DIV");
j.className=y+"_container";
o.appendChild(j);
j.innerHTML=q.join("");
for(var d in s){
var e=s[d];
var r=document.getElementById(d);
r.appendChild(e);
for(var g in v[d]){
r[g]=v[d][g]
}}};
DwtMessageComposite.prototype.format=function(){
var t=[];
for(var e in this._controls){
t[e]=this._controls[e].getValue()
}
return this._formatter.format(t)
}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButtonGroup")){
DwtRadioButtonGroup=function(a,e){
this._radios={};
this._radioButtons={};
this._values={};
this._value2id={};
this._eventMgr=new AjxEventMgr();
for(var t in a){
this.addRadio(t,a[t],(t==e))
}};
DwtRadioButtonGroup.prototype.toString=function(){
return"DwtRadioButtonGroup"
};
DwtRadioButtonGroup.prototype._enabled=true;
DwtRadioButtonGroup.prototype._visible=true;
DwtRadioButtonGroup.prototype.addSelectionListener=function(e){
return this._eventMgr.addListener(DwtEvent.SELECTION,e)
};
DwtRadioButtonGroup.prototype.removeSelectionListener=function(e){
return this._eventMgr.removeListener(DwtEvent.SELECTION,e)
};
DwtRadioButtonGroup.prototype.setEnabled=function(e){
this._enabled=e;
for(var t in this._radios){
this._radios[t].disabled=!e
}};
DwtRadioButtonGroup.prototype.isEnabled=function(){
return this._enabled
};
DwtRadioButtonGroup.prototype.setVisible=function(e){
this._visible=e;
for(var t in this._radioButtons){
this._radioButtons[t].setVisible(e)
}
for(var t in this._radios){
Dwt.setVisible(this._radios[t],e)
}};
DwtRadioButtonGroup.prototype.isVisible=function(){
return this._visible
};
DwtRadioButtonGroup.prototype.addRadio=function(h,r,o){
var e=r instanceof DwtRadioButton;
var n=e?r:null;
var s=n?n.getValue():r;
this._values[h]=s;
this._value2id[s]=h;
var t=document.getElementById(h);
this._radios[h]=t;
this._radioButtons[h]=n;
var a=AjxCallback.simpleClosure(this._handleClick,this);
Dwt.setHandler(t,DwtEvent.ONCLICK,a);
t.checked=o;
if(o){
this._selectedId=h
}};
DwtRadioButtonGroup.prototype.getRadioByValue=function(e){
var t=this._value2id[e];
return this._radios[t]
};
DwtRadioButtonGroup.prototype.getRadioButtonByValue=function(e){
var t=this._value2id[e];
return this._radioButtons[t]
};
DwtRadioButtonGroup.prototype.setSelectedId=function(o,e){
if(o!=this._selectedId){
var t=document.getElementById(o);
if(!t){
return
}
t.checked=true;
this._selectedId=o;
if(!e){
var a=DwtShell.selectionEvent;
a.reset();
this._notifySelection(a)
}}};
DwtRadioButtonGroup.prototype.setSelectedValue=function(t,e){
var a=this._valueToId(t);
this.setSelectedId(a,e)
};
DwtRadioButtonGroup.prototype.getSelectedId=function(){
return this._selectedId
};
DwtRadioButtonGroup.prototype.getSelectedValue=function(){
return this._values[this._selectedId]
};
DwtRadioButtonGroup.prototype.getValue=function(){
return this.getSelectedValue()
};
DwtRadioButtonGroup.prototype.getData=function(t){
var e=!AjxUtil.isUndefined(this._selectedId)&&this._radioButtons[this._selectedId];
if(e){
return e.getData(t)
}};
DwtRadioButtonGroup.prototype._valueToId=function(e){
for(var t in this._values){
if(this._values[t]==e){
return t
}
if(e===true&&this._values[t]=="true"){
return t
}
if(e===false&&(this._values[t]=="false"||this._values[t]=="")){
return t
}}
return null
};
DwtRadioButtonGroup.prototype._notifySelection=function(e){
e.item=this;
e.detail={
id:this._selectedId,value:this._values[this._selectedId]};
this._eventMgr.notifyListeners(DwtEvent.SELECTION,e)
};
DwtRadioButtonGroup.prototype._handleClick=function(e){
e=DwtUiEvent.getEvent(e);
var a=DwtUiEvent.getTarget(e);
if(a&&a.nodeName.match(/label/i)){
a=document.getElementById(a.getAttribute(AjxEnv.isIE?"htmlFor":"for"))
}
var o=a.id;
if(!a.checked){
for(o in this._radios){
if(this._radios[o].checked){
break
}}}
if(o!=this._selectedId){
this._selectedId=o;
var t=DwtShell.selectionEvent;
DwtUiEvent.copy(t,e);
this._notifySelection(t)
}}
}
if(AjxPackage.define("ajax.dwt.widgets.DwtForm")){
DwtForm=function(e){
if(arguments.length==0){
return
}
e=Dwt.getParams(arguments,DwtForm.PARAMS);
e.className=e.className||"DwtForm";
DwtComposite.apply(this,arguments);
this.setScrollStyle(DwtControl.SCROLL);
this._tabGroup=new DwtTabGroup(this._htmlElId);
this._context={
set:AjxCallback.simpleClosure(this.set,this),get:AjxCallback.simpleClosure(this.get,this)};
this._dirty={};
this._ignore={};
this._invalid={};
this._errorMessages={};
this.setModel(e.model);
this.setForm(e.form);
this.reset()
};
DwtForm.prototype=new DwtComposite;
DwtForm.prototype.constructor=DwtForm;
DwtForm.prototype.toString=function(){
return"DwtForm"
};
DwtForm.PARAMS=DwtControl.PARAMS.concat("form","model");
DwtForm.prototype.setValue=function(s,a,t){
if(typeof s!="string"){
s=String(s)
}
if(s.match(/\./)||s.match(/\[/)){
var n=s.replace(/\[(\d+)\](\.)?/,".$1$2").split(".");
var o=this.getControl(n[0]);
if(Dwt.instanceOf(o,"DwtForm")){
o.setValue(n.slice(1).join("."),a,t)
}
return
}
var e=this._items[s];
if(!e){
return
}
if(!t&&a==e.value){
return
}
this._setModelValue(s,a);
this._setControlValue(s,a)
};
DwtForm.prototype.getValue=function(s,e){
if(typeof s!="string"){
s=String(s)
}
if(s.match(/\./)||s.match(/\[/)){
var n=s.replace(/\[(\d+)\](\.)?/,".$1$2").split(".");
var o=this.getControl(n[0]);
if(Dwt.instanceOf(o,"DwtForm")){
return o.getValue(n.slice(1).join("."))
}
return null
}
var t=this._items[s];
if(!t){
return
}
if(t.getter){
return this._call(t.getter)||e
}
var a=this._getControlValue(s)||t.value;
return a||e
};
DwtForm.prototype.getControl=function(t){
if(typeof t!="string"){
t=String(t)
}
var e=this._items[t];
return e&&e.control
};
DwtForm.prototype.isRelevant=function(e){
return this.isVisible(e)&&this.isEnabled(e)
};
DwtForm.prototype.getTabGroupMember=function(){
return this._tabGroup
};
DwtForm.prototype.setLabel=function(o,e){
var t=this._items[o];
if(!t){
return
}
if(e==this.getLabel(o)){
return
}
var a=t.control;
if(!a){
return
}
if(a.setLabel){
a.setLabel(e);
return
}
if(a.setText){
a.setText(e);
return
}};
DwtForm.prototype.getLabel=function(a){
var e=this._items[a];
var t=e&&e.control;
if(t){
if(t.getLabel){
return t.getLabel()
}
if(t.getText){
return t.getText()
}}
return""
};
DwtForm.prototype.setVisible=function(n,o){
if(arguments.length==1){
DwtComposite.prototype.setVisible.call(this,arguments[0]);
return
}
var t=this._items[n];
var a=t&&t.control;
if(!a){
return
}
if(a.setVisible){
a.setVisible(o)
}else{
Dwt.setVisible(a,o)
}
var e=document.getElementById([this._htmlElId,n,"row"].join("_"));
if(e){
Dwt.setVisible(e,o)
}};
DwtForm.prototype.isVisible=function(a){
if(arguments.length==0){
return DwtComposite.prototype.isVisible.call(this)
}
var e=this._items[a];
var t=e&&e.control;
if(!t){
return false
}
if(t.getVisible){
return t.getVisible()
}
if(t.isVisible){
return t.isVisible()
}
return Dwt.getVisible(t)
};
DwtForm.prototype.setEnabled=function(o,e){
if(arguments.length==1){
DwtComposite.prototype.setEnabled.call(this,arguments[0]);
return
}
var t=this._items[o];
var a=t&&t.control;
if(!a){
return
}
if(a.setEnabled){
a.setEnabled(e)
}else{
a.disabled=!e
}};
DwtForm.prototype.isEnabled=function(a){
if(arguments.length==0){
return DwtComposite.prototype.isEnabled.call(this)
}
var e=this._items[a];
var t=e&&e.control;
if(!t){
return false
}
if(t.isEnabled){
return t.isEnabled()
}
if(t.getEnabled){
return t.getEnabled()
}
return !t.disabled
};
DwtForm.prototype.setValid=function(t,e){
if(typeof(t)=="boolean"){
e=arguments[0];
for(t in this._items){
this.setValid(t,e)
}
return
}
if(e){
delete this._invalid[t]
}else{
this._invalid[t]=true
}};
DwtForm.prototype.isValid=function(e){
if(arguments.length==0||AjxUtil.isUndefined(e)){
for(var e in this._invalid){
return false
}
return true
}
return !(e in this._invalid)
};
DwtForm.prototype.setErrorMessage=function(t,e){
if(!t||t==""){
this._errorMessages={};
return
}
if(!e){
delete this._errorMessages[t]
}else{
this._errorMessages[t]=e
}};
DwtForm.prototype.getErrorMessage=function(t){
if(arguments.length==0){
var e={};
for(var t in this._invalid){
e[t]=this._errorMessages[t]
}
return e
}
return this._errorMessages[t]
};
DwtForm.prototype.getInvalidItems=function(){
return AjxUtil.keys(this._invalid)
};
DwtForm.prototype.setDirty=function(o,t,e){
if(typeof o=="boolean"){
t=arguments[0];
for(o in this._items){
this.setDirty(o,t,true)
}
if(!e&&this._ondirty){
this._call(this._ondirty,["*"])
}
return
}
if(t){
this._dirty[o]=true
}else{
delete this._dirty[o]
}
if(!e&&this._ondirty){
var a=this._items[o];
if(!a.ignore||!this._call(a.ignore)){
this._call(this._ondirty,[o])
}}};
DwtForm.prototype.isDirty=function(t){
if(arguments.length==0){
for(var t in this._dirty){
var e=this._items[t];
if(e.ignore&&this._call(e.ignore)){
continue
}
return true
}
return false
}
var e=this._items[t];
return e.ignore&&this._call(e.ignore)?false:t in this._dirty
};
DwtForm.prototype.getDirtyItems=function(){
DwtForm.__acceptDirtyItem.form=this;
return AjxUtil.keys(this._dirty,DwtForm.__acceptDirtyItem)
};
DwtForm.__acceptDirtyItem=function(a){
var t=arguments.callee.form;
var e=t._items[a];
return !e.ignore||!t._call(e.ignore)
};
DwtForm.prototype.setIgnore=function(t,e){
if(typeof t=="boolean"){
this._ignore={};
return
}
if(e){
this._ignore[t]=true;
return
}
delete this._ignore[t]
};
DwtForm.prototype.isIgnore=function(e){
return e in this._ignore
};
DwtForm.prototype.set=function(t,e){
this.setValue(t,e,true);
this.update()
};
DwtForm.prototype.get=DwtForm.prototype.getValue;
DwtForm.prototype.setModel=function(e,t){
this._context.model=this.model=e
};
DwtForm.prototype.setForm=function(e){
this._context.form=this.form=e;
this._createHtml(e.template)
};
DwtForm.prototype.validate=function(e){
if(arguments.length==0){
this.setValid(true);
for(var e in this._items){
this._validateItem(e)
}
return this.isValid()
}
return this._validateItem(e)
};
DwtForm.prototype._validateItem=function(r){
if(!r){
return true
}
var o=this._items[r];
if(!o){
return true
}
try{
var n=this.getValue(r);
var a=o.validator?o.validator(n):((o.control&&o.control.validator)?o.control.validator(n):true);
this.setValid(r,Boolean(a)||a==="");
if(AjxUtil.isString(a)||AjxUtil.isObject(a)){
this._setControlValue(r,a);
o.value=o.setter?this._call(o.setter,[a]):a;
var t=!Boolean(this._call(o.equals,[o.value,o.ovalue]));
this.setDirty(r,t)
}}
catch(s){
this.setErrorMessage(r,AjxUtil.isString(s)?s:s.message);
this.setValid(r,false)
}
return !(r in this._invalid)
};
DwtForm.prototype.reset=function(o){
this._dirty={};
this._ignore={};
this._invalid={};
for(var a in this._items){
var t=this._items[a];
if(t.control instanceof DwtForm){
t.control.reset(o)
}
var e=this._items[a].def;
if(!e){
continue
}
this._initControl(e,o)
}
this.update();
for(var a in this._items){
var t=this._items[a];
t.ovalue=t.value
}
this.setDirty(false);
this.validate();
if(this._onreset){
this._call(this._onreset)
}};
DwtForm.prototype.update=function(){
for(var t in this._items){
var e=this._items[t];
if(e.control instanceof DwtForm){
e.control.update()
}
if(e.getter){
this.setValue(t,this._call(e.getter))
}}
for(var t in this._items){
var e=this._items[t];
if(e.visible){
this.setVisible(t,Boolean(this._call(e.visible)))
}
if(e.enabled){
this.setEnabled(t,Boolean(this._call(e.enabled)))
}
if(e.ignore){
this.setIgnore(t,Boolean(this._call(e.ignore)))
}}
if(this._onupdate){
this._call(this._onupdate)
}};
DwtForm.prototype._setModelValue=function(o,a){
var t=this._items[o];
t.value=t.setter?this._call(t.setter,[a]):a;
var e=!Boolean(this._call(t.equals,[t.value,t.ovalue]));
this.setDirty(o,e);
this.validate(o);
return e
};
DwtForm.prototype._setControlValue=function(a,e){
var t=this._items[a].control;
if(t){
if(t instanceof DwtCheckbox||t instanceof DwtRadioButton){
t.setSelected(e);
return
}
if(t instanceof DwtMenuItem&&t.isStyle(DwtMenuItem.CHECK_STYLE)){
t.setChecked(e,true);
return
}
if(t.setSelectedValue){
t.setSelectedValue(e);
return
}
if(t.setValue){
t.setValue(e);
return
}
if(t.setText&&!(t instanceof DwtButton)){
t.setText(e);
return
}
if(!(t instanceof DwtControl)){
if(t.type=="checkbox"||t=="radio"){
t.checked=e
}else{
t.value=e
}
return
}}};
DwtForm.prototype._getControlValue=function(t){
var e=this._items[t].control;
if(e){
if(e instanceof DwtCheckbox||e instanceof DwtRadioButton){
return e.isSelected()
}
if(e.getSelectedValue){
return e.getSelectedValue()
}
if(e.getValue){
return e.getValue()
}
if(e.getText&&!(e instanceof DwtButton)){
return e.getText()
}
if(!(e instanceof DwtControl)){
if(e.type=="checkbox"||e=="radio"){
return e.checked
}
return e.value
}}};
DwtForm.prototype._deleteItem=function(e){
delete this._items[e];
delete this._dirty[e];
delete this._invalid[e];
delete this._ignore[e]
};
DwtForm.prototype._call=function(t,e){
if(t){
if(e){
return t.apply(this,e)
}
return t.call(this)
}};
DwtForm.prototype._createHtml=function(e){
this._createHtmlFromTemplate(e||this.TEMPLATE,{
id:this._htmlElId}
)
};
DwtForm.prototype._createHtmlFromTemplate=function(t,s){
DwtComposite.prototype._createHtmlFromTemplate.apply(this,arguments);
var a=[];
this._items={};
this._tabGroup.removeAllMembers();
this._onupdate=null;
this._onreset=null;
this._ondirty=null;
var e=this.form;
if(e&&e.items){
this._registerControls(e.items,null,a);
this._onupdate=DwtForm.__makeFunc(e.onupdate);
this._onreset=DwtForm.__makeFunc(e.onreset);
this._ondirty=DwtForm.__makeFunc(e.ondirty)
}
var c=this.getHtmlElement().getElementsByTagName("A");
for(var r=0;
r<c.length;
r++){
var h=c[r];
if(!h.href||h.getAttribute("notab")=="true"){
continue
}
var d=h.id&&h.id.substr(this.getHTMLElId().length+1);
if(this._items[d]){
continue
}
a.push({
tabindex:h.getAttribute("tabindex")||Number.MAX_VALUE,control:h}
)
}
a.sort(DwtForm.__byTabIndex);
for(var r=0;
r<a.length;
r++){
var n=a[r].control;
var o=(n.getTabGroupMember&&n.getTabGroupMember())||n;
this._tabGroup.addMember(o)
}};
DwtForm.prototype._registerControls=function(a,n,e,s,o,r){
for(var t=0;
t<a.length;
t++){
this._registerControl(a[t],n,e,s,o,r)
}};
DwtForm.prototype._registerControl=function(d,t,o,n,p,u){
var e=d.id||[this._htmlElId,Dwt.getNextId()].join("_");
var w=this._items[e]={
id:e,def:d,parentDef:t,equals:DwtForm.__makeFunc(d.equals)||DwtForm.__equals,getter:DwtForm.__makeGetter(d),setter:DwtForm.__makeSetter(d),value:d.value,visible:DwtForm.__makeFunc(d.visible),enabled:DwtForm.__makeFunc(d.enabled),validator:DwtForm.__makeFunc(d.validator),ignore:DwtForm.__makeFunc(d.ignore),control:d.control};
if(d.aka){
this._items[e].aka=d.aka;
this._items[d.aka]=w
}
var c=w.control;
if(c){
return c
}
p=p||this;
var m=d.type=d.type||u;
var h=document.getElementById([p._htmlElId,e].join("_"));
if(Dwt.instanceOf(m,"DwtRadioButtonGroup")){
c=new window[m]({}
);
w.control=c;
var g={
name:[p._htmlElId,e].join("_"),value:d.value};
if(d.items){
for(var r=0;
r<d.items.length;
r++){
var s=d.items[r];
var f=s.checked||s.value==d.value;
var a=this._registerControl(s,d,o,g,p,"DwtRadioButton");
this._items[s.id].value=f;
if(a){
c.addRadio(a.getInputElement().id,a,f);
var y=DwtForm.__makeFunc(s.onclick||d.onclick);
a.addSelectionListener(new AjxListener(this,this._radio2group2model,[s.id,e,y]));
DwtForm.__hack_fixRadioButtonHandler(a)
}}}}else{
if(m){
if(Dwt.instanceOf(m,"DwtInputField")){
w.value=w.value||""
}
if(Dwt.instanceOf(m,"DwtFormRows")){
w.equals=DwtFormRows.__equals
}
if(h){
c=w.control=this._createControl(d,t,o,n,p,u)
}}else{
if(h){
this._attachElementHandlers(d,t,o,p,h);
c=w.control=h;
if(d.items){
this._registerControls(d.items,d,o,null,p,null)
}}}}
if(h&&c instanceof DwtControl){
c.replaceElement(h)
}
if(h&&c instanceof DwtInputField){
c.getInputElement().id+="_input"
}
if(d.notab==null){
d.notab=h&&h.getAttribute("notab")=="true"
}
if(o&&c&&!d.notab&&!(c instanceof DwtRadioButtonGroup)){
o.push({
tabindex:(h&&h.getAttribute("tabindex"))||Number.MAX_VALUE,control:c}
)
}
if(c instanceof DwtListView){
w.getter=w.getter||AjxCallback.simpleClosure(this.__list_getValue,this,e);
w.setter=w.setter||AjxCallback.simpleClosure(this.__list_setValue,this,e)
}
return c
};
DwtForm.prototype._attachElementHandlers=function(r,a,o,d,s){
var t=r.id;
var e=s.nodeName.toLowerCase();
var c=s.type;
if(c=="checkbox"||c=="radio"){
var h;
if(c=="radio"){
h=s.name;
if(!this._items[h]){
this._items[h]={
id:h}
}
if(s.checked){
this._items[h].value=s.value
}}
var m=s.onclick;
var u=DwtForm.__makeFunc(r.onclick);
s.onclick=AjxCallback.simpleClosure(this._htmlInput_checked,this,t,h,u,m)
}else{
if(e=="select"){
var n=s.onchange;
var u=DwtForm.__makeFunc(r.onchange);
s.onchange=AjxCallback.simpleClosure(this._htmlSelect_selectedIndex,this,t,u,n)
}else{
if(e=="button"||e=="a"||c=="button"||c=="reset"||c=="submit"){
var m=s.onclick;
var u=DwtForm.__makeFunc(r.onclick);
s.onclick=AjxCallback.simpleClosure(this._htmlElement,this,t,u,m)
}else{
if(e=="textarea"||e=="input"){
var n=s.onchange;
var u=DwtForm.__makeFunc(r.onchange);
s.onchange=AjxCallback.simpleClosure(this._htmlInput_value,this,t,u,n)
}}}}
return s
};
DwtForm.prototype._createControl=function(u,c,C,B,f,h){
var x=u.id||[this._htmlElId,Dwt.getNextId()].join("_");
var n=u.type=u.type||h;
B=B?AjxUtil.createProxy(B):{};
B.id=B.id||[this._htmlElId,x].join("_");
B.parent=f||this;
B.template=u.template||B.template;
B.className=u.className||B.className;
var W=Dwt.instanceOf(n,"DwtRadioButton");
var k=Dwt.instanceOf(n,"DwtCheckbox");
if(W||k){
B.name=u.name||B.name;
B.value=u.value||B.value;
B.checked=u.checked!=null?u.checked:B.checked
}
var m=Dwt.instanceOf(n,"DwtInputField");
if(m){
B.type=u.password?DwtInputField.PASSWORD:null;
B.size=u.cols;
B.rows=u.rows
}
var s=Dwt.instanceOf(n,"DwtTabViewPage");
if(s){
B.contentTemplate=u.template;
delete u.template
}
B.formItemDef=u;
if(u.params){
for(var q in u.params){
B[q]=u.params[q]
}}
var g=new window[n](B);
if(g instanceof DwtSelect){
var o=u.items;
if(o){
for(var O=0;
O<o.length;
O++){
var v=o[O];
v.displayValue=v.label||v.value;
g.addOption(v)
}}
var t=DwtForm.__makeFunc(u.onchange);
g.addChangeListener(new AjxListener(this,this._control2model,[x,t]))
}else{
if(g instanceof DwtButton||g instanceof DwtMenuItem){
if(u.label){
g.setText(u.label)
}
if(u.image){
g.setImage(u.image)
}
if(u.menu){
var a=Dwt.instanceOf(u.menu.type||"DwtMenu","DwtMenu");
var e;
if(a){
e=this._registerControl(u.menu,u,null,null,g,"DwtMenu")
}else{
e=new DwtMenu({
parent:g}
);
var A=Dwt.instanceOf(u.menu.type,"DwtCalendar")?DwtMenu.CALENDAR_PICKER_STYLE:DwtMenu.GENERIC_WIDGET_STYLE;
this._registerControl(u.menu,u,null,{
style:A}
,e)
}
g.setMenu(e)
}
var T;
if(f instanceof DwtToolBar||f instanceof DwtMenu){
T=c.id
}
var t=DwtForm.__makeFunc(u.onclick||(c&&c.onclick));
g.addSelectionListener(new AjxListener(this,this._item2parent,[x,T,t]))
}else{
if(g instanceof DwtCheckbox&&!(g instanceof DwtRadioButton)){
var t=DwtForm.__makeFunc(u.onclick);
g.addSelectionListener(new AjxListener(this,this._control2model,[x,t]))
}else{
if(g instanceof DwtInputField){
var t=DwtForm.__makeFunc(u.onchange);
var z=AjxCallback.simpleClosure(this._input2model2handler,this,x,t);
g.setHandler(DwtEvent.ONKEYUP,z);
g.setHint(u.hint)
}else{
if(g instanceof DwtListView){
g.addSelectionListener(new AjxListener(this,this._handleListSelection,[x]))
}else{
if(g instanceof DwtMenu){
if(u.items){
var j=u.items;
for(var O=0;
O<j.length;
O++){
var w=j[O];
if(w.type==DwtMenuItem.SEPARATOR_STYLE){
new DwtMenuItem({
parent:g,style:DwtMenuItem.SEPARATOR_STYLE}
);
continue
}
this._registerControl(w,u,null,null,g,"DwtMenuItem")
}}}else{
if(g instanceof DwtTabView){
var d=u.items;
if(d){
this._registerControls(d,u,null,null,g,"DwtTabViewPage")
}}else{
if(g instanceof DwtTabViewPage&&f instanceof DwtTabView){
var D=f.addTab(u.label,g);
if(u.image){
f.getTabButton(D).setImage(u.image)
}
if(u.items){
this._registerControls(u.items,u,C,null,g)
}}else{
if(g instanceof DwtToolBar){
var y=u.items;
if(y){
for(var O=0;
O<y.length;
O++){
var r=y[O];
if(r.type==DwtToolBar.SPACER){
g.addSpacer(r.size);
continue
}
if(r.type==DwtToolBar.SEPARATOR){
g.addSeparator(r.className);
continue
}
if(r.type==DwtToolBar.FILLER){
g.addFiller(r.className);
continue
}
this._registerControl(r,u,null,null,g,"DwtToolBarButton")
}}}else{
if(g instanceof DwtComposite){
if(u.items){
this._registerControls(u.items,u,C,null,g)
}}}}}}}}}}}
return g
};
DwtForm.prototype._initControl=function(e,o){
var a=e.id;
if(e.label){
this.setLabel(a,e.label)
}
var t=this._items[a];
if(o){
t.ovalue=t.value
}else{
if(e.value){
if(Dwt.instanceOf(e.type,"DwtRadioButton")){
t.ovalue=t.value=t.control&&t.control.isSelected()
}else{
this.setValue(a,e.value,true);
t.ovalue=t.value
}}else{
t.ovalue=null
}}
if(typeof e.enabled=="boolean"){
this.setEnabled(a,e.enabled)
}
if(typeof e.visible=="boolean"){
this.setVisible(a,e.visible)
}};
DwtForm.prototype._htmlElement=function(o,a,t,e){
if(a){
this._call(a,[o])
}
if(t){
t(e)
}};
DwtForm.prototype._htmlInput_checked=function(r,s,a,t,e){
var n=this.getControl(r);
var o=n.checked;
this._setModelValue(r,o);
if(s&&o){
this._setModelValue(s,n.value)
}
this.update();
this._htmlElement(r,a,t,e)
};
DwtForm.prototype._htmlInput_value=function(o,a,t,e){
this._setModelValue(o,this.getControl(o).value);
this.update();
this._htmlElement(o,a,t,e)
};
DwtForm.prototype._htmlSelect_selectedIndex=function(n,o,a,t){
var e=this.getControl(n);
this._setModelValue(n,e.options[e.selectedIndex].value);
this.update();
this._htmlElement(n,o,a,t)
};
DwtForm.prototype._control2model=function(t,e){
this._setModelValue(t,this._getControlValue(t));
this.update();
if(e){
this._call(e,[t])
}};
DwtForm.prototype._radio2group2model=function(e,t,a){
this._setModelValue(t,this.getControl(e).getValue());
this._setModelValue(e,this._getControlValue(e));
this.update();
if(a){
this._call(a,[e])
}};
DwtForm.prototype._input2model2handler=function(t,e){
this._setModelValue(t,this._getControlValue(t));
this.update();
if(e){
this._call(e,[t])
}};
DwtForm.prototype._item2parent=function(o,n,t){
var a=this.getControl(o);
var e=this._items[o].def;
if(a instanceof DwtButtonColorPicker||(e.menu&&!e.onclick)){
a._toggleMenu()
}else{
if(n){
this._setModelValue(n,this._getControlValue(o)||o);
this.update()
}}
if(t){
this._call(t,[o])
}};
DwtForm.prototype._handleListSelection=function(t,e){
this.update()
};
DwtForm.prototype.__list_getValue=function(e){
return this.getControl(e).getSelection()
};
DwtForm.prototype.__list_setValue=function(t,e){
this.getControl(t).setSelection(e)
};
DwtForm.__makeGetter=function(s){
var t=s.getter;
if(t){
return DwtForm.__makeFunc(t)
}
var n=s.ref;
if(!n){
return null
}
var r=n.split(".");
var e=["var context = this.model;",];
for(var o=0;
o<r.length;
o++){
var a=r[o];
var h=DwtForm.__makeFuncName(a);
if(o==r.length-1){
break
}
e.push("context = context && (context.",h," ? context.",h,"() : context.",a,");")
}
e.push("var value = context ? (context.",h," ? context.",h,"() : context.",a,") : this._items.",a,".value;","return value !== undefined ? value : defaultValue;");
return new Function("defaultValue",e.join(""))
};
DwtForm.__makeSetter=function(c){
var o=c.setter;
if(o){
return DwtForm.__makeFunc(o)
}
var a=c.ref;
if(!a){
return null
}
var n=a.split(".");
var h=["var context = this.model;",];
for(var r=0;
r<n.length;
r++){
var s=r==n.length-1;
var e=n[r];
var t=DwtForm.__makeFuncName(e,s?"set":"get");
if(s){
break
}
h.push("context = context && (context.",t," ? context.",t,"() : context.",e,");")
}
h.push("if (context) {","if (context.",t,") {","context.",t,"(value);","}","else {","context.",e," = value;","}","}");
return new Function("value",h.join("\n"))
};
DwtForm.__makeFuncName=function(e,t){
return[t||"get",e.substr(0,1).toUpperCase(),e.substr(1)].join("")
};
DwtForm.__makeFunc=function(t){
if(t==null){
return null
}
if(typeof t=="function"&&!(t instanceof RegExp)){
return t
}
var e=["with (this._context) {","return (",t,");","}"].join("");
return new Function(e)
};
DwtForm.__equals=function(t,e){
return t==e
};
DwtForm.__byTabIndex=function(t,e){
return t.tabindex-e.tabindex
};
DwtForm.__hack_fixRadioButtonHandler=function(t){
var e=[t.getInputElement().onclick,DwtCheckbox.__handleClick];
var a=function(o){
for(var n=0;
n<e.length;
n++){
var s=e[n];
if(s){
s(o)
}}};
Dwt.setHandler(t.getInputElement(),DwtEvent.ONCLICK,a)
};
DwtFormRows=function(a){
if(arguments.length==0){
return
}
this._itemDef=a.formItemDef||{};
a.className=a.className||"DwtFormRows";
DwtForm.call(this,{
id:a.id,parent:a.parent,form:{}
,template:this._itemDef.template}
);
this._rowsTabGroup=new DwtTabGroup(this._htmlElId);
this._rowDef=this._itemDef.rowitem||{};
this._equals=DwtForm.__makeFunc(this._rowDef.equals)||DwtForm.__equals;
this._rowCount=0;
this._minRows=this._itemDef.minrows||1;
this._maxRows=this._itemDef.maxrows||Number.MAX_VALUE;
if(this._itemDef.rowtemplate){
this.ROW_TEMPLATE=this._itemDef.rowtemplate
}
var t=this._itemDef.items||[];
for(var e=0;
e<t.length;
e++){
this.addRow(t[e])
}
for(;
e<this._minRows;
e++){
this.addRow()
}
this._onaddrow=DwtForm.__makeFunc(this._itemDef.onaddrow);
this._onremoverow=DwtForm.__makeFunc(this._itemDef.onremoverow)
};
DwtFormRows.prototype=new DwtForm;
DwtFormRows.prototype.constructor=DwtFormRows;
DwtFormRows.prototype.toString=function(){
return"DwtFormRows"
};
DwtFormRows.prototype.TEMPLATE="dwt.Widgets#DwtFormRows";
DwtFormRows.prototype.ROW_TEMPLATE="dwt.Widgets#DwtFormRow";
DwtFormRows.prototype.getTabGroupMember=function(){
return this._rowsTabGroup
};
DwtFormRows.prototype.setValue=function(o){
if(arguments.length>1){
DwtForm.prototype.setValue.apply(this,arguments);
return
}
var a=Math.max(o.length,this._minRows);
for(var t=this._rowCount;
t>a;
t--){
this.removeRow(t-1)
}
var e=Math.min(o.length,this._maxRows);
for(var t=this._rowCount;
t<e;
t++){
this.addRow()
}
for(var t=0;
t<e;
t++){
this.setValue(String(t),o[t],true)
}
for(var t=o.length;
t<this._rowCount;
t++){
this.setValue(String(t),null,true)
}};
DwtFormRows.prototype.getValue=function(){
if(arguments.length>0){
return DwtForm.prototype.getValue.apply(this,arguments)
}
var t=new Array(this._rowCount);
for(var e=0;
e<this._rowCount;
e++){
t[e]=this.getValue(String(e))
}
return t
};
DwtFormRows.prototype.getRowCount=function(){
return this._rowCount
};
DwtFormRows.prototype.addRow=function(n,o){
if(this._rowCount>=this._maxRows){
return
}
n=n||(this._rowDef&&AjxUtil.createProxy(this._rowDef));
if(!n){
return
}
if(o==null){
o=this._rowCount
}
for(var u=this._rowCount-1;
u>=o;
u--){
var v=u,m=u+1;
var f=this._items[v];
f.aka=String(m);
delete this._items[v];
this._items[f.aka]=f;
this._setControlIds(f.id,f.aka)
}
n.id=n.id||Dwt.getNextId();
n.aka=String(o);
this._rowCount++;
var k={
id:[this.getHTMLElId(),n.id].join("_")};
var g=AjxTemplate.expand(this.ROW_TEMPLATE,k);
var e=this._rowsEl;
e.appendChild(Dwt.toDocumentFragment(g,k.id+"_row"));
var y=e.lastChild;
if(o!=this._rowCount-1){
e.insertBefore(y,e.childNodes[o])
}
var w=[];
var s=this._registerControl(n,null,w);
var t=this._itemDef.additem?AjxUtil.createProxy(this._itemDef.additem):{
image:"Add"};
t.id=t.id||n.id+"_add";
t.visible="this.getRowCount() < this.getMaxRows()";
t.ignore=true;
var d=this._registerControl(t,null,w,null,null,"DwtButton");
if(!t.onclick){
d.addSelectionListener(new AjxListener(this,this._handleAddRow,[n.id]))
}
var h=this._itemDef.removeitem?AjxUtil.createProxy(this._itemDef.removeitem):{
image:"Remove"};
h.id=h.id||n.id+"_remove";
h.visible="this.getRowCount() > this.getMinRows()";
h.ignore=true;
var p=this._registerControl(h,null,w,null,null,"DwtButton");
if(!h.onclick){
p.addSelectionListener(new AjxListener(this,this._handleRemoveRow,[n.id]))
}
var f=this._items[n.id];
f._rowEl=y;
f._addId=t.id;
f._removeId=h.id;
this._setControlIds(f.id,o);
var a=new DwtTabGroup(n.id);
w.sort(DwtForm.__byTabIndex);
for(var u=0;
u<w.length;
u++){
var s=w[u].control;
a.addMember(s.getTabGroupMember()||s)
}
if(o==this._rowCount-1){
this._rowsTabGroup.addMember(a)
}else{
var r=this._items[String(o+1)];
var c=this._rowsTabGroup.getTabGroupMemberByName(r.id);
this._rowsTabGroup.addMemberBefore(a,c)
}
this.update();
if(this._onaddrow){
this._call(this._onaddrow,[o])
}
return s
};
DwtFormRows.prototype.removeRow=function(r){
if(this._rowCount<=this._minRows){
return
}
var d=this._items[r];
if(d.control instanceof DwtControl){
this.removeChild(d.control)
}
delete this._items[d.aka];
this._deleteItem(d.id);
var h=this._items[d._addId];
if(h){
this.removeChild(h.control);
this._deleteItem(h.id)
}
var c=this._items[d._removeId];
if(c){
this.removeChild(c.control);
this._deleteItem(c.id)
}
var s=Number(d.aka);
for(var a=s+1;
a<this._rowCount;
a++){
var n=a,t=a-1;
this._items[t]=this._items[n];
this._items[t].aka=String(t);
this._setControlIds(this._items[t].id,this._items[t].aka)
}
this._deleteItem(String(--this._rowCount));
var e=d._rowEl;
e.parentNode.removeChild(e);
delete d._rowEl;
var o=this._rowsTabGroup.getTabGroupMemberByName(d.id);
this._rowsTabGroup.removeMember(o);
this.update();
if(this._onremoverow){
this._call(this._onremoverow,[Number(d.aka)])
}};
DwtFormRows.prototype.getMinRows=function(){
return this._minRows
};
DwtFormRows.prototype.getMaxRows=function(){
return this._maxRows
};
DwtFormRows.prototype.getRowCount=function(){
return this._rowCount
};
DwtFormRows.prototype.getIndexForRowId=function(a){
var t=this._rowsEl.childNodes;
for(var e=0;
e<t.length;
e++){
if(t[e].id==[this._htmlElId,a,"row"].join("_")){
return e
}}
return -1
};
DwtFormRows.__equals=function(t,e){
if(t===e){
return true
}
if(!t||!e||t.length!=e.length){
return false
}
for(var o=0;
o<t.length;
o++){
if(!this._call(this._equals,[t[o],e[o]])){
return false
}}
return true
};
DwtFormRows.prototype._setControlIds=function(n,e){
var s=[this.getHTMLElId(),e].join("_");
var o=this._items[n];
this._setControlId(o&&o.control,s);
var t=this._items[o._addId];
this._setControlId(t&&t.control,s+"_add");
var a=this._items[o._removeId];
this._setControlId(a&&a.control,s+"_remove")
};
DwtFormRows.prototype._setControlId=function(e,t){
if(!e){
return
}
if(e instanceof DwtControl){
e.setHtmlElementId(t)
}else{
e.id=t
}};
DwtFormRows.prototype._handleAddRow=function(t){
var e=this.getIndexForRowId(t)+1;
this.addRow(null,e)
};
DwtFormRows.prototype._handleRemoveRow=function(e){
this.removeRow(e)
};
DwtFormRows.prototype._setModelValue=function(t,e){
if(DwtForm.prototype._setModelValue.apply(this,arguments)){
this.parent.setDirty(this._itemDef.id,true)
}};
DwtFormRows.prototype._createHtmlFromTemplate=function(e,t){
DwtForm.prototype._createHtmlFromTemplate.apply(this,arguments);
this._rowsEl=document.getElementById(this._htmlElId+"_rows")
}
}}
if(AjxPackage.define("dwt.Widgets")){
AjxTemplate.register("dwt.Widgets#DwtAlert",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td width=1%><div id='";
e[a++]=n.id;
e[a++]="_icon' style='margin-right:5px;'></div></td><td width=99%><table border=0 cellpadding=0 cellspacing=0><tr><td id='";
e[a++]=n.id;
e[a++]="_title' class='DwtAlertTitle'></td></tr><tr><td id='";
e[a++]=n.id;
e[a++]="_content' class='DwtAlertContent'></td></tr></table></td><td width=1%><div id='";
e[a++]=n.id;
e[a++]="_dismiss' style='margin-left:5px;'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtAlert"}
,false);
AjxTemplate.register("dwt.Widgets",AjxTemplate.getTemplate("dwt.Widgets#DwtAlert"),AjxTemplate.getParams("dwt.Widgets#DwtAlert"));
AjxTemplate.register("dwt.Widgets#DwtCheckbox",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table cellpadding='2' cellspacing='0' border='0'><tr><td><label id='";
e[a++]=n.id;
e[a++]="_text_left' for='";
e[a++]=n.id;
e[a++]="_input' class='Text' style='text-align:right'></label></td><td><input id='";
e[a++]=n.id;
e[a++]="_input' name='";
e[a++]=n.name;
e[a++]="' value='";
e[a++]=n.value;
e[a++]="' type='checkbox' ";
e[a++]=n.checked;
e[a++]="></td><td><label id='";
e[a++]=n.id;
e[a++]="_text_right' for='";
e[a++]=n.id;
e[a++]="_input' class='Text' style='text-align:left'></label></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtCheckbox"}
,false);
AjxTemplate.register("dwt.Widgets#DwtRadioButton",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table cellpadding='2' cellspacing='0' border='0'><tr><td><label id='";
e[a++]=n.id;
e[a++]="_text_left' for='";
e[a++]=n.id;
e[a++]="_input' class='Text' style='text-align:right'></label></td><td><input id='";
e[a++]=n.id;
e[a++]="_input' name='";
e[a++]=n.name;
e[a++]="' value='";
e[a++]=n.value;
e[a++]="' type='radio' ";
e[a++]=n.checked;
e[a++]="></td><td><label id='";
e[a++]=n.id;
e[a++]="_text_right' for='";
e[a++]=n.id;
e[a++]="_input' class='Text' style='text-align:left'></label></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtRadioButton"}
,false);
AjxTemplate.register("dwt.Widgets#DwtBaseDialog",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='DwtDialog WindowOuterContainer'><table cellspacing=0 cellpadding=0><tr id='";
e[a++]=n.dragId;
e[a++]="'><td class='minWidth'>";
e[a++]=n.icon;
e[a++]="</td><td id='";
e[a++]=n.id;
e[a++]="_title' class='DwtDialogTitle'>";
e[a++]=n.title;
e[a++]="</td><td class='minWidth'><div class='";
e[a++]=n.closeIcon2;
e[a++]="'></div></td><td class='minWidth'><div class='";
e[a++]=n.closeIcon1;
e[a++]="'></div></td></tr><tr><td class='WindowInnerContainer' colspan='4'><div id='";
e[a++]=n.id;
e[a++]="_content' class='DwtDialogBody'></div>";
if(n.controlsTemplateId){
e[a++]=AjxTemplate.expand(n.controlsTemplateId,n)
}
e[a++]="</td></tr></table></div>";
return o?e.length:e.join("")
}
,{
width:"20",height:"32",id:"dwt.Widgets#DwtBaseDialog"}
,false);
AjxTemplate.register("dwt.Widgets#DwtDialogControls",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='horizSep'></div><div id='";
e[a++]=n.id;
e[a++]="_buttons' class='DwtDialogButtonBar'>";
if(AjxEnv.isNav){
e[a++]="<input type='button' id='";
e[a++]=n.id;
e[a++]="_focus' style='height:0px;width:0px;display:none;'>"
}
e[a++]="</div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtDialogControls"}
,false);
AjxTemplate.register("dwt.Widgets#DwtSemiModalDialog",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='DwtDialog LightWindowOuterContainer'><table cellspacing=0 cellpadding=0 style='cursor:move;'><tr id='";
e[a++]=n.dragId;
e[a++]="'><td class='minWidth'>";
e[a++]=n.icon;
e[a++]="</td><td id='";
e[a++]=n.id;
e[a++]="_title' class='DwtDialogTitle'>";
e[a++]=n.title;
e[a++]="</td><td class='minWidth'><div class='";
e[a++]=n.closeIcon2;
e[a++]="'></div></td><td class='minWidth'><div class='";
e[a++]=n.closeIcon1;
e[a++]="'></div></td></tr><tr><td class='LightWindowInnerContainer full_size' colspan='4'><div id='";
e[a++]=n.id;
e[a++]="_content' class='DwtDialogBody'></div><div class='horizSep'></div><div id='";
e[a++]=n.id;
e[a++]="_buttons' class='DwtDialogButtonBar'>";
if(AjxEnv.isNav){
e[a++]="<input type='button' id='";
e[a++]=n.id;
e[a++]="_focus' style='height:0px;width:0px;display:none;'>"
}
e[a++]="</div></td></tr></table></div>";
return o?e.length:e.join("")
}
,{
width:"20",height:"32",id:"dwt.Widgets#DwtSemiModalDialog"}
,false);
AjxTemplate.register("dwt.Widgets#DwtToolTip",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="TopPointer' class='DwtToolTipTopPointer'><center><div class='DwtToolTipPointerRow' style='width:1px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:3px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:5px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:7px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:9px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:11px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:13px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:15px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:17px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:19px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:21px;'>&nbsp;</div></center></div><div id='";
e[a++]=n.id;
e[a++]="Contents' class='DwtToolTipBody'></div><div id='";
e[a++]=n.id;
e[a++]="BottomPointer' class='DwtToolTipBottomPointer'><center><div class='DwtToolTipPointerRow' style='width:21px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:19px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:17px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:15px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:13px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:11px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:9px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:7px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:5px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:3px;'>&nbsp;</div><div class='DwtToolTipPointerRow' style='width:1px;'>&nbsp;</div></center></div>";
return o?e.length:e.join("")
}
,{
width:"5",height:"5",id:"dwt.Widgets#DwtToolTip"}
,false);
AjxTemplate.register("dwt.Widgets#DwtVerticalSash",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='DwtVerticalSash'><center><div class='ImgVSash_thumb'></div></center></div>";
return o?e.length:e.join("")
}
,{
width:"0",height:"0",id:"dwt.Widgets#DwtVerticalSash"}
,false);
AjxTemplate.register("dwt.Widgets#DwtHorizontalSash",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='DwtHorizontalSash'><table cellspacing=0 cellpadding=0 height='100%'><tr><td height='100%' valign='middle'><div class='ImgHSash_thumb'></div></td></tr></table></div>";
return o?e.length:e.join("")
}
,{
width:"0",height:"0",id:"dwt.Widgets#DwtHorizontalSash"}
,false);
AjxTemplate.register("dwt.Widgets#DwtMissingSoundPlayer",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table class='DwtMissingSoundPlayer'><tr><td nowrap class='ImgCritical'>&nbsp;</td><td nowrap>";
e[a++]=ZmMsg.missingPlugin;
e[a++]="</td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtMissingSoundPlayer"}
,false);
AjxTemplate.register("dwt.Widgets#DwtVerticalSlider",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_button' class='DwtThumb DwtSliderThumb'><div class='DwtSliderThumbBorder'><div class='ImgVerticalSliderThumb'></div></div></div>";
return o?e.length:e.join("")
}
,{
"class":"DwtSlider DwtVerticalSlider",id:"dwt.Widgets#DwtVerticalSlider"}
,false);
AjxTemplate.register("dwt.Widgets#DwtHorizontalSlider",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_button' class='DwtThumb DwtSliderThumb'><div class='DwtSliderThumbBorder'><div class='ImgHorizontalSliderThumb'></div></div></div>";
return o?e.length:e.join("")
}
,{
"class":"DwtSlider DwtHorizontalSlider",id:"dwt.Widgets#DwtHorizontalSlider"}
,false);
AjxTemplate.register("dwt.Widgets#ZLabel",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table class='ZWidgetTable ZLabelBorder' cellspacing=0 cellpadding=0><tr><td id='";
e[a++]=n.id;
e[a++]="_left_icon'  \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
e[a++]=n.id;
e[a++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
e[a++]=n.id;
e[a++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td></tr></table>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZLabel"}
,false);
AjxTemplate.register("dwt.Widgets#ZButton",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
var e=s.buttonClass||"Button";
t[o++]="<table class='ZWidgetTable Z";
t[o++]=e;
t[o++]="Table Z";
t[o++]=e;
t[o++]="Border' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
t[o++]=s.id;
t[o++]="_left_icon'  \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
t[o++]=s.id;
t[o++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
t[o++]=s.id;
t[o++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td><td id='";
t[o++]=s.id;
t[o++]="_dropdown' \tclass='ZDropDown'></td></tr></table>";
return n?t.length:t.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZButton"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarButton",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
n.buttonClass=n.buttonClass||"ToolbarButton";
e[a++]=AjxTemplate.expand("#ZButton",n);
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZToolbarButton"}
,false);
AjxTemplate.register("dwt.Widgets#ZBorderlessButton",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
var e=s.buttonClass||"Button";
t[o++]="<table class='ZWidgetTable Z";
t[o++]=e;
t[o++]="Table' cellspacing=0 cellpadding=0 style='table-layout:auto;'><tr><td id='";
t[o++]=s.id;
t[o++]="_left_icon'  \tclass='ZLeftIcon ZWidgetIcon'></td><td id='";
t[o++]=s.id;
t[o++]="_title'\t\tclass='ZWidgetTitle'></td><td id='";
t[o++]=s.id;
t[o++]="_right_icon' \tclass='ZRightIcon ZWidgetIcon'></td><td id='";
t[o++]=s.id;
t[o++]="_dropdown' \tclass='ZDropDown'></td></tr></table>";
return n?t.length:t.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZBorderlessButton"}
,false);
AjxTemplate.register("dwt.Widgets#ZButtonColorDisplay",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_color' class='DwtButtonColorPicker-display' unselectable></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZButtonColorDisplay"}
,false);
AjxTemplate.register("dwt.Widgets#DwtComboBox",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr><td width=*><div id='";
e[a++]=n.id;
e[a++]="_input'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_button'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
"class":"DwtComboBox",id:"dwt.Widgets#DwtComboBox"}
,false);
AjxTemplate.register("dwt.Widgets#DwtComboBoxButton",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
var e=s.buttonClass||"Button";
t[o++]="<table class='Z";
t[o++]=e;
t[o++]="Border' cellspacing=0 cellpadding=0><tr><td id='";
t[o++]=s.id;
t[o++]="_dropdown' class='ZDropDown'></td></tr></table>";
return n?t.length:t.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#DwtComboBoxButton"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_tabbar'></div><div id='";
e[a++]=n.id;
e[a++]="_page'></div>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZTabView"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabBar",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table border=0 cellpadding=0 cellspacing=0><tr valign='bottom' id='";
e[a++]=n.id;
e[a++]="_items'>";
e[a++]=AjxTemplate.expand("#ZTabBarPrefix",n);
e[a++]=AjxTemplate.expand("#ZTabBarSuffix",n);
e[a++]="</tr></table>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZTabBar"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabBarFloat",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_items'>";
e[a++]=AjxTemplate.expand("#ZTabBarPrefixFloat",n);
e[a++]=AjxTemplate.expand("#ZTabBarSuffixFloat",n);
e[a++]="</div>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZTabBarFloat"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabBarPrefixFloat",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_prefix' class='ZTabBarPrefix'>&nbsp;</div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZTabBarPrefixFloat"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabBarSuffixFloat",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_suffix' class='ZTabBarSuffix'>&nbsp;</div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZTabBarSuffixFloat"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabBarPrefix",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<td id='";
e[a++]=n.id;
e[a++]="_prefix' class='ZTabBarPrefix'>&nbsp;</td>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZTabBarPrefix"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabBarSuffix",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<td id='";
e[a++]=n.id;
e[a++]="_suffix' class='ZTabBarSuffix'>&nbsp;</td>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZTabBarSuffix"}
,false);
AjxTemplate.register("dwt.Widgets#ZTab",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
var e=s.buttonClass||"Tab";
t[o++]="<table id='";
t[o++]=s.id;
t[o++]="_select' class='Z";
t[o++]=e;
t[o++]="Table Z";
t[o++]=e;
t[o++]="Border ZWidgetTable ZWidgetBorder' cellspacing=0 cellpadding=0><tr><td id='";
t[o++]=s.id;
t[o++]="_left_icon' class='ZLeftIcon ZWidgetIcon'></td><td id='";
t[o++]=s.id;
t[o++]="_title' class='ZWidgetTitle'></td><td id='";
t[o++]=s.id;
t[o++]="_right_icon' class='ZRightIcon ZWidgetIcon'></td></tr></table>";
return n?t.length:t.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZTab"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabFloat",function(a,r,s,t){
var n=Boolean(t);
s=(typeof s=="string"?{
id:s}
:s)||{};
t=t||[];
var o=t.length;
var e=s.buttonClass||"Tab";
t[o++]="<table id='";
t[o++]=s.id;
t[o++]="_select' class='Z";
t[o++]=e;
t[o++]="Table Z";
t[o++]=e;
t[o++]="Border ZWidgetBorder' cellspacing=0 cellpadding=0><tr><td id='";
t[o++]=s.id;
t[o++]="_left_icon' class='ZLeftIcon ZWidgetIcon'></td><td id='";
t[o++]=s.id;
t[o++]="_title' class='ZWidgetTitle'></td><td id='";
t[o++]=s.id;
t[o++]="_right_icon' class='ZRightIcon ZWidgetIcon'></td></tr></table>";
return n?t.length:t.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZTabFloat"}
,false);
AjxTemplate.register("dwt.Widgets#ZTabPage",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZTabPage"}
,false);
AjxTemplate.register("dwt.Widgets#ZSelectAutoSizingContainer",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<table border=0 cellpadding=0 cellspacing=0><tr><td id="';
e[a++]=n.id;
e[a++]='_select_container">';
e[a++]=AjxTemplate.expand(n.selectTemplateId,n.selectData);
e[a++]='</td></tr><tr><td><table id="';
e[a++]=n.id;
e[a++]='_pseudoitems_container" border=0 cellpadding=0 cellspacing=0></table></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZSelectAutoSizingContainer"}
,false);
AjxTemplate.register("dwt.Widgets#ZSelect",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]=AjxTemplate.expand("#ZButton",n);
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZSelect"}
,false);
AjxTemplate.register("dwt.Widgets#ZSelectMenu",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]=AjxTemplate.expand("#ZMenu",n);
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZSelectMenu"}
,false);
AjxTemplate.register("dwt.Widgets#ZSelectMenuItem",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]=AjxTemplate.expand("#ZMenuItem",n);
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZSelectMenuItem"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbar",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table class='ZToolbarTable' border=0 cellpadding=0 cellspacing=0><tr id='";
e[a++]=n.id;
e[a++]="_items'>";
e[a++]=AjxTemplate.expand("#ZToolbarPrefix",n);
e[a++]=AjxTemplate.expand("#ZToolbarSuffix",n);
e[a++]="</tr></table>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZToolbar"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarPrefix",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZToolbarPrefix"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarSuffix",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZToolbarSuffix"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarItem",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table><tr><td id='";
e[a++]=n.itemId;
e[a++]="'></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZToolbarItem"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarSeparator",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table><tr><td id='";
e[a++]=n.itemId;
e[a++]="' class='ZToolbarSeparator'>&nbsp;</td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZToolbarSeparator"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarSpacer",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table><tr><td id='";
e[a++]=n.itemId;
e[a++]="' class='ZToolbarSpacer'>&nbsp;</td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZToolbarSpacer"}
,false);
AjxTemplate.register("dwt.Widgets#ZToolbarFiller",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table><tr><td id='";
e[a++]=n.itemId;
e[a++]="' class='ZToolbarFiller' width='100%'>&nbsp;</td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZToolbarFiller"}
,false);
AjxTemplate.register("dwt.Widgets#ZField",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<input id='";
e[a++]=n.id;
e[a++]="_field' class='ZFieldInput'>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZField"}
,false);
AjxTemplate.register("dwt.Widgets#ZTreeItem",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='";
e[a++]=n.divClassName;
e[a++]="' id='";
e[a++]=n.id;
e[a++]="_div'><table id='";
e[a++]=n.id;
e[a++]="_table' border=0 cellpadding=0 cellspacing=0 width=100%><tr><td align=center nowrap id='";
e[a++]=n.id;
e[a++]="_nodeCell'></td>";
if(n.isCheckedStyle){
e[a++]="<td nowrap id='";
e[a++]=n.id;
e[a++]='_checkboxCell\' class="ZTreeItemCheckboxCell"><div class="ZTreeItemCheckbox" id=\'';
e[a++]=n.id;
e[a++]="_checkbox'><div class=\"ZTreeItemCheckboxImg\" id='";
e[a++]=n.id;
e[a++]="_checkboxImg'>";
e[a++]=AjxImg.getImageHtml("MenuCheck");
e[a++]="</div></div></td>"
}
e[a++]="<td nowrap class='imageCell' id='";
e[a++]=n.id;
e[a++]="_imageCell'></td><td width=100% nowrap class='";
e[a++]=n.textClassName;
e[a++]="' id='";
e[a++]=n.id;
e[a++]="_textCell'></td><td width=16 class='imageCell' id='";
e[a++]=n.id;
e[a++]="_extraCell'></td></tr></table></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZTreeItem"}
,false);
AjxTemplate.register("dwt.Widgets#ZHeaderTreeItem",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='";
e[a++]=n.divClassName;
e[a++]="' id='";
e[a++]=n.id;
e[a++]="_div'><table id='";
e[a++]=n.id;
e[a++]="_table' border=0 cellpadding=0 cellspacing=0><tr>";
if(!n.noNodeCell){
e[a++]="<td align=center nowrap id='";
e[a++]=n.id;
e[a++]="_nodeCell'></td>"
}
e[a++]="<td nowrap class='imageCell' id='";
e[a++]=n.id;
e[a++]="_imageCell'></td><td nowrap class='";
e[a++]=n.textClassName;
e[a++]="' id='";
e[a++]=n.id;
e[a++]="_textCell' width=\"100%\"></td><td class='";
e[a++]=n.textClassName;
e[a++]=" FakeAnchor' style=\"padding-right:4px\"><div id='";
e[a++]=n.id;
e[a++]="_headerButton'/></td></tr></table></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZHeaderTreeItem"}
,false);
AjxTemplate.register("dwt.Widgets#ZAccordion",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_div'><table class='ZAccordionTable ZWidget' border=0 cellspacing=0 cellpadding=0 id='";
e[a++]=n.id;
e[a++]="_accordion_table'></table></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZAccordion"}
,false);
AjxTemplate.register("dwt.Widgets#ZAccordionItem",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_header_";
e[a++]=n.itemNum;
e[a++]="' class='ZAccordionHeader'><table class='ZAccordionHeaderBorder ZWidgetTable' cellspacing=0 cellpadding=0><tr><td><div class='";
e[a++]=n.icon;
e[a++]="' id='";
e[a++]=n.id;
e[a++]="_icon_";
e[a++]=n.itemNum;
e[a++]="'></div></td><td><div class='ZAccordionTitle' id='";
e[a++]=n.id;
e[a++]="_title_";
e[a++]=n.itemNum;
e[a++]="'>";
e[a++]=n.title;
e[a++]="</div></td><td><div class='ImgAccordionClosed' id='";
e[a++]=n.id;
e[a++]="_status_";
e[a++]=n.itemNum;
e[a++]="'></div></td></tr></table></div><div class='ZAccordionBody' id='";
e[a++]=n.id;
e[a++]="_body_";
e[a++]=n.itemNum;
e[a++]="'></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZAccordionItem"}
,false);
AjxTemplate.register("dwt.Widgets#DwtTabView",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table width='100%' border='0' cellspacing='0' cellpadding='0' backgroundColor='";
e[a++]=n.bgcolor;
e[a++]="'><tr align='left' valign='middle'><td id='";
e[a++]=n.id;
e[a++]="_tabs' class='DwtTabTable' nowrap align='left' valign='middle' width='100%'></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtTabView"}
,false);
AjxTemplate.register("dwt.Widgets#DwtTabBar",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<!-- TODO -->";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtTabBar"}
,false);
AjxTemplate.register("dwt.Widgets#DwtTabSpacer",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table width='100%' cellspacing='0' cellpadding='0'><tr></tr><tr></tr><tr><td><div class='ImgTabSpacer'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtTabSpacer"}
,false);
AjxTemplate.register("dwt.Widgets#ZMenu",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div id='";
e[a++]=n.id;
e[a++]="_container' class='ZMenuBorder'></div>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZMenu"}
,false);
AjxTemplate.register("dwt.Widgets#ZMenuItem",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table class='ZWidgetTable ZMenuItemTable ZMenuItemBorder' cellspacing=0 cellpadding=0><tr><td id='";
e[a++]=n.id;
e[a++]="_check' class='ZCheckIcon'><div></div></td><td id='";
e[a++]=n.id;
e[a++]="_left_icon' class='ZLeftIcon ZWidgetIcon'><div></div></td><td id='";
e[a++]=n.id;
e[a++]="_title' class='ZWidgetTitle'></td><td id='";
e[a++]=n.id;
e[a++]="_dropdown' class='ZDropDown'><div></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZMenuItem"}
,false);
AjxTemplate.register("dwt.Widgets#ZMenuItemSeparator",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table class='ZWidgetTable ZMenuItemTable ZMenuItemBorder ZMenuItemSeparatorBorder' cellspacing=0 cellpadding=0><tr><td id='";
e[a++]=n.id;
e[a++]="_title' class='ZWidgetTitle'><div class='ZMenuItem-Separator'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
"class":"ZWidget",id:"dwt.Widgets#ZMenuItemSeparator"}
,false);
AjxTemplate.register("dwt.Widgets#ZMenuItemBlankCheck",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='ZMenuItem-BlankCheck'></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZMenuItemBlankCheck"}
,false);
AjxTemplate.register("dwt.Widgets#ZMenuItemBlankIcon",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='ZMenuItem-BlankIcon'></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZMenuItemBlankIcon"}
,false);
AjxTemplate.register("dwt.Widgets#ZMenuItemBlankCascade",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<div class='ZMenuItem-BlankCascade'></div>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#ZMenuItemBlankCascade"}
,false);
AjxTemplate.register("dwt.Widgets#DwtListView-NoResults",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table width='100%' cellspacing=0 cellpadding=1><tr><td class='NoResults' valign='top'><br><br>";
e[a++]=n.message;
e[a++]="\n";
e[a++]="\t\t\t</td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtListView-NoResults"}
,false);
AjxTemplate.register("dwt.Widgets#DwtPasswordField",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]="<table cellpadding='0' cellspacing='0' border='0'><tr><td><div id='";
e[a++]=n.id;
e[a++]="_input'></div></td><td><div id='";
e[a++]=n.id;
e[a++]="_show_password'></div></td></tr></table>";
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtPasswordField"}
,false);
AjxTemplate.register("dwt.Widgets#DwtFormRows",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<table border=0 cellspacing=3 cellpadding=0><tbody id="';
e[a++]=n.id;
e[a++]='_rows" tabindex="100"></tbody></table>';
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtFormRows"}
,false);
AjxTemplate.register("dwt.Widgets#DwtFormRow",function(t,s,n,e){
var o=Boolean(e);
n=(typeof n=="string"?{
id:n}
:n)||{};
e=e||[];
var a=e.length;
e[a++]='<table><tr id="';
e[a++]=n.id;
e[a++]='_row" class="DwtFormRow"><td><div id="';
e[a++]=n.id;
e[a++]='" tabindex="100"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_add" class="DwtFormRowAdd" tabindex="200"></div></td><td><div id="';
e[a++]=n.id;
e[a++]='_remove" class="DwtFormRowRemove" tabindex="300"></div></td></tr></table>';
return o?e.length:e.join("")
}
,{
id:"dwt.Widgets#DwtFormRow"}
,false)
};
