HxG_5.prototype.JSFImage=function () { this.type=hX_5.CMP_image; this.label=null; this.imageNormalSrc=this.imageMousedSrc=this.imageDepressedSrc=this.imageDisabledSrc=null; this.iconNormalSrc=this.iconMousedSrc=this.iconDepressedSrc=this.iconDisabledSrc=null; this.optimizeEvents=this.noResize=false; this.outerSpan=this.innerSpan=this.labelTag=this.iconTag=this.mouseDiv=null; this.gE=function (s) { return hX_5.g.getP(this.DOMobj, s); } this.state=-1; hX_5.IMG_DEPRESSEDTimer=null; this.isDepressed=this.foundClass=this.iconFromClass=false; this.labelAbsolute=this.iconAbsolute=false; this.dispType=(hX_5.brw.isIE()) ? hX_5._INB : hX_5._E; this.calcClass=hX_5._E; this.dispType=(hX_5.brw.isIE()) ? hX_5._INB : hX_5._E; this.baseClass=[]; this.labelClass=[]; this.iconClass=[]; this.imageSrc=this.iconSrc=null; this.image=[null, null, null, null]; this.icon=[null, null, null, null]; this.suffixes=[hX_5.CLASS_BUTTON_MOUSED, hX_5.CLASS_BUTTON_DEPRSD, hX_5.CLASS_BUTTON_DISBLD]; this.doRealignmentCalcOnceDone=false; this.buttonleftoffsemargin=0; this.attributeTable=[]; this.attributeTable ['label']=['label', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['normal']=['imageNormalSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['moused']=['imageMousedSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['depressed']=['imageDepressedSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['disabled']=['imageDisabledSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['icon-normal']=['iconNormalSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['icon-moused']=['iconMousedSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['icon-depressed']=['iconDepressedSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['icon-disabled']=['iconDisabledSrc', hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['embedded']=['noResize', hX_5.ARG_IS_TRUE, false, null, null]; this.setAttribute(arguments); } HxG_5.prototype.JSFImage.prototype.onPageLoad=function () { if (this.DOMobj && this.DOMobj.src) this.imageNormalSrc=this.DOMobj.src; this.addSpansToInput(); this.setValue(0, true); return true; } HxG_5.prototype.JSFImage.prototype.redraw=function () { this.sizeImageToAttributes(); this.setValue(0, true); return true; } HxG_5.prototype.JSFImage.prototype.uirelease=function () { this.setValue(0); this.isDepressed=false; return true; } HxG_5.prototype.JSFImage.prototype.destroy=function () { var o,i,d=[this.baseClass,this.labelClass,this.iconClass,this.imageSrc,this.iconSrc,this.suffixes]; if (this.mouseDiv) hX_5.removeAllEvents(this.mouseDiv, this.mouseDiv.id); for (i=0; i0) d[i].pop(); delete d[i]; } } delete d; while (this.image.length > 0) { o=this.image.pop(); if (o) delete o; } delete this.image; while (this.icon.length > 0) { o=this.icon.pop(); if (o) delete o; } if (this.attributeTable) delete this.attributeTable; return true; } HxG_5.prototype.JSFImage.prototype.setValue=function (ivalue, force) { var cl=false, j,t,s, v=ivalue, bDisabled=(hX_5.g.isDisabled(this.DOMobj) || this.DOMobj.readOnly); v=(bDisabled)?3:v; if (this.state!=v && v>=0 && v<=3) { t=hX_5.getFirstClassName (this.DOMobj); if (t) t=hX_5.stripClassSuffix(t, this.suffixes); if (t != this.calcClass) this.prepImages(); j=(this.image[v]==null || this.image[v].src==null || this.image[v].src.length==0)?0:v; if (this.image[j] && this.image[j].src) { if (this.DOMobj.tagName==hX_5._IMG || this.DOMobj.type==hX_5._lIMG) this.DOMobj.src=this.image[j].src; else { s=this.wrapURL(j); if (this.gE(hX_5._BIMG)!=s) this.DOMobj.style.backgroundImage=s; } } if (this.baseClass[v] && this.baseClass[hX_5.IMG_NORMAL]) hX_5.appendClassName (this.DOMobj, this.baseClass[v], this.baseClass[hX_5.IMG_NORMAL], true); if (this.labelTag && this.labelClass) { if (this.labelTag.className != this.labelClass[v]) { this.labelTag.className=this.labelClass[v]; cl=true; } } if (this.iconTag) { j=(this.icon[v]==null || this.icon[v].src==null || this.icon[v].src.length==0)?0:v; if (this.icon[j] && this.icon[j].src && this.iconTag.src != this.icon[j].src) this.iconTag.src=this.icon[j].src; if (this.iconClass[v] && this.iconTag.className != this.iconClass[v]) { this.iconTag.className=this.iconClass[v]; cl=true; } } this.state=v; } if ((force || cl) && (this.innerSpan!=null))this.sizeContentToAttributes(); return true; } HxG_5.prototype.JSFImage.prototype.wrapURL=function(img) { return (hX_5._URL + hX_5._SQT + hX_5.stripURL(this.imageSrc[img]) + hX_5._SQT + ")"); } HxG_5.prototype.JSFImage.prototype.getValue=function() { return this.state; } HxG_5.prototype.JSFImage.prototype.setAttribute=function(a) { hX_5.parseArg (this.attributeTable, this, a); this.imageSrc=[this.imageNormalSrc, this.imageMousedSrc, this.imageDepressedSrc, this.imageDisabledSrc]; this.iconSrc=[this.iconNormalSrc, this.iconMousedSrc, this.iconDepressedSrc, this.iconDisabledSrc]; if (this.HTMLrendered) this.redraw(); return true; } HxG_5.prototype.JSFImage.prototype.getAttribute=function (attribute) { return (hX_5.getArg(this.attributeTable, this, attribute)); } HxG_5.prototype.JSFImage.prototype.dispatchRelay=function (evt) { if ((typeof hX_5)=="undefined") return true; var obj, r=true; evt=(evt) ? evt : ((event) ? event: null); if (evt && this) { obj=(this.parentNode && this.parentNode.firstChild) ? (hX_5.getComponentById(this.parentNode.firstChild.id)) : null; if (obj) { if (hX_5.g.isDisabled(obj.DOMobj)) r=false; else { if (evt.type==hX_5._evMC) { if (obj.DOMobj.click && hX_5.brw.isIE()) obj.DOMobj.click(); else hX_5.i.fireEvent(obj.DOMobj, hX_5._onMC) hX_5.i.cancelAction(evt, true); r=false; } else { r=hX_5.runEvent(obj.DOMobj, evt, false, true); } } } } return r; } HxG_5.prototype.JSFImage.prototype.dispatchTimer= function (id, item, action) { if ((typeof hX_5)=="undefined") return; if (item == "redraw") { this.sizeContentToAttributes(); } else { hX_5.IMG_DEPRESSEDTimer=null; if (this.isDepressed) { this.isDepressed=false; this.dispatchComponent(hX_5._lINP, null, hX_5._evMO, null); } } } HxG_5.prototype.JSFImage.prototype.dispatchComponent=function (item, evt, action, keycode) { var newvalue=-1, r=(hX_5.g.isDisabled(this.DOMobj))?false:true; if (this.DOMobj != null) switch (action) { case hX_5._evB: case hX_5._evKU: newvalue=0; if (this.isDepressed && hX_5.IMG_DEPRESSEDTimer) hX_5.i.killTimerTimed(hX_5.IMG_DEPRESSEDTimer); this.isDepressed=false; break; case hX_5._evMO: newvalue=0; if (this.isDepressed) hX_5.IMG_DEPRESSEDTimer=hX_5.i.startTimerTimed(this.DOMobj.id, "depress", "depress", 2000); break; case hX_5._evMU: newvalue=1; if (this.isDepressed && hX_5.IMG_DEPRESSEDTimer) hX_5.i.killTimerTimed(hX_5.IMG_DEPRESSEDTimer); this.isDepressed=false; break; case hX_5._evMC: if (evt.button>1) r=false; break; case hX_5._evMV: newvalue=(this.isDepressed && hX_5.IMG_DEPRESSEDTimer) ? 2 : 1; if (this.isDepressed && hX_5.IMG_DEPRESSEDTimer) hX_5.i.killTimerTimed(hX_5.IMG_DEPRESSEDTimer); break; case hX_5._evMD: if (evt.button<=1) { newvalue=2; this.isDepressed=true; } break; case hX_5._evKD: if (keycode == hX_5.KEY_SPACEBAR || keycode == hX_5.KEY_ENTER) newvalue=2; break; } if (newvalue >= 0) this.setValue(newvalue); if (!r) hX_5.i.cancelAction(evt, true); return r; } HxG_5.prototype.JSFImage.prototype.prepImages=function () { if (!this.HTMLrendered && this.DOMobj.src!=undefined && this.DOMobj.src.length > 0 && this.imageSrc[hX_5.IMG_NORMAL] == null) this.imageNormalSrc=this.DOMobj.src; this.imageSrc=[this.imageNormalSrc, this.imageMousedSrc, this.imageDepressedSrc, this.imageDisabledSrc]; this.iconSrc=[this.iconNormalSrc, this.iconMousedSrc, this.iconDepressedSrc, this.iconDisabledSrc]; var i,c,t=hX_5.getFirstClassName (this.DOMobj); if (t) t=hX_5.stripClassSuffix(t, this.suffixes); if (this.calcClass==hX_5._E || this.calcClass != t) { if (t == null) { this.baseClass[hX_5.IMG_MOUSED]=this.baseClass[hX_5.IMG_DEPRESSED]=this.baseClass[hX_5.IMG_DISABLED]=t; this.labelClass[hX_5.IMG_MOUSED]=this.labelClass[hX_5.IMG_DEPRESSED]=this.labelClass[hX_5.IMG_DISABLED]=hX_5._E; this.iconClass[hX_5.IMG_MOUSED]=this.iconClass[hX_5.IMG_DEPRESSED]=this.iconClass[hX_5.IMG_DISABLED]=hX_5._E; } else if (t != this.baseClass[hX_5.IMG_NORMAL]) { this.foundClass=false; this.baseClass[hX_5.IMG_NORMAL]=t; this.prepClass(t, hX_5.CLASS_BUTTON_MOUSED, this.baseClass, hX_5.IMG_MOUSED); this.prepClass(t, hX_5.CLASS_BUTTON_DEPRSD, this.baseClass, hX_5.IMG_DEPRESSED); this.prepClass(t, hX_5.CLASS_BUTTON_DISBLD, this.baseClass, hX_5.IMG_DISABLED); c=t + hX_5.CLASS_BUTTON_LABEL; if (hX_5.isClassDefined(c)) { this.labelClass[hX_5.IMG_NORMAL]=c; this.prepClass(c, hX_5.CLASS_BUTTON_MOUSED, this.labelClass, hX_5.IMG_MOUSED); this.prepClass(c, hX_5.CLASS_BUTTON_DEPRSD, this.labelClass, hX_5.IMG_DEPRESSED); this.prepClass(c, hX_5.CLASS_BUTTON_DISBLD, this.labelClass, hX_5.IMG_DISABLED); } else this.labelClass[hX_5.IMG_NORMAL]=this.labelClass[hX_5.IMG_MOUSED]=this.labelClass[hX_5.IMG_DEPRESSED]=this.labelClass[hX_5.IMG_DISABLED]=hX_5._E; c=t + hX_5.CLASS_BUTTON_ICON; if (hX_5.isClassDefined(c)) { this.prepClass(c, hX_5._E, this.iconClass, hX_5.IMG_NORMAL, this.iconSrc); this.prepClass(c, hX_5.CLASS_BUTTON_MOUSED, this.iconClass, hX_5.IMG_MOUSED, this.iconSrc); this.prepClass(c, hX_5.CLASS_BUTTON_DEPRSD, this.iconClass, hX_5.IMG_DEPRESSED, this.iconSrc); this.prepClass(c, hX_5.CLASS_BUTTON_DISBLD, this.iconClass, hX_5.IMG_DISABLED, this.iconSrc); } else this.iconClass[hX_5.IMG_NORMAL]=this.iconClass[hX_5.IMG_MOUSED]=this.iconClass[hX_5.IMG_DEPRESSED]=this.iconClass[hX_5.IMG_DISABLED]=hX_5._E; } this.calcClass=t; } for (i=hX_5.IMG_NORMAL; i<=hX_5.IMG_DISABLED; i++) this.prepImage(this.imageSrc, this.image, i); if (this.iconSrc[hX_5.IMG_NORMAL]) for (i=hX_5.IMG_NORMAL; i<=hX_5.IMG_DISABLED; i++) this.prepImage(this.iconSrc, this.icon, i); } HxG_5.prototype.JSFImage.prototype.prepImage=function (src, imp, state) { if (src[state] && src[state].length > 0) { if (imp[state] == null) imp[state]=new Image(50,50); imp[state].src=hX_5.stripURL(src[state]); } else imp[state]=null; } HxG_5.prototype.JSFImage.prototype.prepClass=function (base, suffix, imp, state, imgsrc) { var im, c=base+suffix, isC=hX_5.isClassDefined(c); this.foundClass=(this.foundClass || suffix==hX_5._E) ? this.foundClass : isC; imp[state]=(isC) ? c : base; if (arguments.length > 4 && isC && (this.iconFromClass || this.iconSrc[state] == null)) { im=hX_5.getClassStyle(c, hX_5._BIMG); if (im && im.length > 0) { this.iconFromClass=true; this.iconSrc[state]=im; } } } HxG_5.prototype.JSFImage.prototype.addSpansToInput=function () { if (!this.DOMobj) return false; this.prepImages(); if (this.DOMobj.tagName==hX_5._IMG || this.DOMobj.type==hX_5._lIMG) { if (this.image && this.image[hX_5.IMG_NORMAL]) this.DOMobj.setAttribute(hX_5._SRC, this.image[hX_5.IMG_NORMAL].src); else if (this.DOMobj.src==null || this.DOMobj.src.length==0) this.DOMobj.setAttribute(hX_5._SRC, this.r.getURL(hX_5.R_IMG_SPACER)); } else { if (this.image && this.image[hX_5.IMG_NORMAL]) { if (this.gE(hX_5._BPOS) != hX_5._NREP) this.DOMobj.style.backgroundRepeat=hX_5._NREP; if ((hX_5.brw.isNavOrMoz() && hX_5.g.getP(this.DOMobj, hX_5._BRWID)==hX_5._E) || (hX_5.brw.isIE() && hX_5.g.getP(this.DOMobj, hX_5._BRWID)==hX_5._2PX && hX_5.g.getP(this.DOMobj, hX_5._BRSTY)==hX_5._OUT && hX_5.g.getP(this.DOMobj, hX_5._BRCOR)==hX_5.CLR_BLK)) { this.DOMobj.style.borderWidth=hX_5._ZPX; this.DOMobj.style.backgroundColor=hX_5._TRN } var s=this.wrapURL(hX_5.IMG_NORMAL); if (this.gE(hX_5._BIMG)!=s) this.DOMobj.style.backgroundImage=s; } } if (this.label || this.iconSrc[hX_5.IMG_NORMAL]) { var tag, d=this.gE(hX_5._DSP); tag=document.createElement(hX_5._SPN); tag.setAttribute (hX_5._ID, this.DOMobj.id + "_SPAN"); tag.style.position=(this.gE(hX_5._POS)!=hX_5._ABS)?hX_5._REL:hX_5._ABS; tag.style.display=(d==hX_5._E)?this.dispType:d; tag.style.visibility= this.gE(hX_5._VIS); tag.style.margin=tag.style.padding=tag.style.borderWidth=hX_5._ZPX; tag.style.left=this.gE(hX_5._LFT); tag.style.right=this.gE(hX_5._RGT); tag.style.top=this.gE(hX_5._TOP); tag.style.bottom= this.gE(hX_5._BOT); this.DOMobj.style.position=hX_5._REL; this.DOMobj.style.left=this.DOMobj.style.top=hX_5._ZPX; this.DOMobj.style.bottom=this.DOMobj.style.right=hX_5._E; if (hX_5.brw.isIE()) this.DOMobj.style.textIndent=hX_5._ZPX; if (hX_5.brw.isIE()) this.DOMobj.style.padding=hX_5._ZPX; this.outerSpan=this.DOMobj.parentNode.insertBefore(tag, this.DOMobj); this.outerSpan.appendChild(this.DOMobj); tag=document.createElement(hX_5._SPN); tag.setAttribute(hX_5._ID, this.DOMobj.id + "_SPN"); tag.style.position=hX_5._ABS; tag.style.left=tag.style.top=hX_5._1PX; tag.style.display=this.dispType; tag.style.overflow=hX_5._HI; tag.style.zIndex=hX_5._1; tag.style.textIndent=tag.style.margin=tag.style.padding=tag.style.borderWidth=hX_5._ZPX; this.innerSpan=this.outerSpan.appendChild(tag); if (this.icon[hX_5.IMG_NORMAL]) { tag=document.createElement(hX_5._IMG); tag.setAttribute(hX_5._ID, this.DOMobj.id + "_ICON"); tag.setAttribute(hX_5._SRC, this.icon[hX_5.IMG_NORMAL].src); tag.setAttribute(hX_5._BRD, hX_5._Z); this.iconAbsolute=(hX_5._ABS == hX_5.getClassStyle(this.iconClass[hX_5.IMG_NORMAL], hX_5._POS)); tag.style.position=hX_5._ABS; if (!this.iconAbsolute) tag.style.left=tag.style.top=hX_5._ZPX; tag.style.textIndent=hX_5._ZPX; tag.style.display=hX_5._E; tag.style.zIndex=hX_5._1; if (this.iconFromClass) tag.style.backgroundImage=hX_5._NO; this.iconTag=this.innerSpan.appendChild(tag); } if (this.label) { tag=document.createElement(hX_5._SPN); tag.setAttribute (hX_5._ID, this.DOMobj.id + "_LABEL"); this.labelAbsolute=(this.labelClass[hX_5.IMG_NORMAL])?(hX_5._ABS == hX_5.getClassStyle(this.labelClass[hX_5.IMG_NORMAL], hX_5._POS)):false; tag.style.position=hX_5._ABS; if (!this.labelAbsolute) tag.style.left=tag.style.top=hX_5._ZPX; tag.style.textIndent=hX_5._ZPX; tag.style.display=this.dispType; tag.style.zIndex=hX_5._2; this.labelTag=this.innerSpan.appendChild(tag); } if (this.DOMobj.tagName == hX_5._IMG) tag=document.createElement(hX_5._IMG) else { tag=document.createElement(hX_5._INP); tag.setAttribute(hX_5._TYP, hX_5._lIMG); } tag.setAttribute(hX_5._ID, this.DOMobj.id + "_MOUSE"); tag.setAttribute(hX_5._SRC, this.r.getURL(hX_5.R_IMG_SPACER)); tag.tabIndex=hX_5.__1; tag.style.zIndex="3"; tag.style.position=hX_5._ABS; tag.style.left=tag.style.top=hX_5._ZPX; tag.style.textIndent=tag.style.margin=tag.style.padding=tag.style.borderWidth=hX_5._ZPX; tag.style.display=hX_5._E; tag.setAttribute(hX_5._ALT, this.DOMobj.alt); tag.setAttribute(hX_5._TTL, this.DOMobj.title); this.mouseDiv=this.outerSpan.appendChild(tag); } else { if (this.image[hX_5.IMG_MOUSED] == null && this.image[hX_5.IMG_DEPRESSED] == null && this.image[hX_5.IMG_DISABLED] == null && !this.foundClass) this.optimizeEvents=true; } this.sizeImageToAttributes(true); if (!this.optimizeEvents) { hX_5.attachComponentEvent (this.DOMobj, hX_5._onKD, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onKU, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onB, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onMC, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onMU, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onMD, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onMV, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onMO, hX_5._lN); hX_5.attachComponentEvent (this.DOMobj, hX_5._onMM, hX_5._lN); if (this.mouseDiv) { hX_5.attachEvent (this.mouseDiv, hX_5._onMC, hX_5._lN, this.dispatchRelay); hX_5.attachEvent (this.mouseDiv, hX_5._onMU, hX_5._lN, this.dispatchRelay); hX_5.attachEvent (this.mouseDiv, hX_5._onMD, hX_5._lN, this.dispatchRelay); hX_5.attachEvent (this.mouseDiv, hX_5._onMV, hX_5._lN, this.dispatchRelay); hX_5.attachEvent (this.mouseDiv, hX_5._onMO, hX_5._lN, this.dispatchRelay); hX_5.attachEvent (this.mouseDiv, hX_5._onMM, hX_5._lN, this.dispatchRelay); } hX_5.i.attachMonitor(this.DOMobj, "standard1", hX_5._DSB, hX_5._RDO, hX_5._ALT, hX_5._TTL); if (!this.noResize && this.outerSpan) hX_5.i.attachResizeMonitor(this.DOMobj); } return true; } HxG_5.prototype.JSFImage.prototype.sizeImageToAttributes=function (skipPrep) { if (!this.DOMobj) return false; if (skipPrep==null) this.prepImages(); if (this.outerSpan && (this.DOMobj.parentNode.id==undefined || this.DOMobj.parentNode.id != this.DOMobj.id + "_SPAN")) { this.DOMobj.parentNode.insertBefore(this.outerSpan, this.DOMobj); if (this.innerSpan) this.outerSpan.insertBefore(this.DOMobj, this.innerSpan); else this.outerspan.appendChild(this.DOMobj); } if (this.labelTag && this.DOMobj.value!=undefined && this.DOMobj.value!=null && this.DOMobj.value.length > 0) { this.label=this.DOMobj.value; this.DOMobj.value=hX_5._E; } if (this.outerSpan) { if (this.gE(hX_5._DSP) == hX_5._NO) this.outerSpan.style.display=hX_5._NO; else { var bDisabled=(hX_5.g.isDisabled(this.DOMobj) || this.DOMobj.readOnly); var bHideFocus=(this.DOMobj.hideFocus) ? this.DOMobj.hideFocus : false; var bNoSelect=(this.DOMobj.unselectable) ? this.DOMobj.unselectable : false; var bVisible=this.gE(hX_5._VIS), zIndex=this.gE(hX_5._ZND), prop, prop1, prop2; zIndex=hX_5.isString(zIndex) ? parseInt(zIndex) : zIndex; if (this.outerSpan.style.display != this.dispType) this.outerSpan.style.display=this.dispType; if (this.outerSpan.style.visibility != bVisible)this.outerSpan.style.visibility=bVisible; if (this.DOMobj.hideFocus && this.outerspan.hideFocus != bHideFocus) this.outerSpan.HideFocus=bHideFocus; if (this.DOMobj.unselectable && this.outerspan.unselectable != bNoSelect) this.outerSpan.unselectable=bNoSelect; if (zIndex!=null && zIndex > 0) { if (this.outerSpan.style.zIndex != (zIndex+hX_5._E)) this.outerSpan.style.zIndex=zIndex+hX_5._E; zIndex=(zIndex+1)+hX_5._E; } prop2=(this.label && this.label.length > 0 && this.label.indexOf("<")<0) ? this.label : null; prop=(this.DOMobj.alt && this.DOMobj.alt.length > 0) ? this.DOMobj.alt : prop2; prop1=(this.DOMobj.title && this.DOMobj.title.length > 0) ? this.DOMobj.title : prop2; if (prop && this.DOMobj.alt != prop) this.DOMobj.alt=prop; if (prop1 && this.DOMobj.title != prop1) this.DOMobj.title=prop1; if (this.labelTag || this.iconTag) { if (this.innerSpan && zIndex && this.innerSpan.style.zIndex != zIndex) this.innerSpan.style.zIndex=zIndex; if (this.labelTag) { if (this.labelTag && hX_5.getIHTML(this.labelTag) != this.label) hX_5.setIHTML(this.labelTag, this.label); if (this.labelTag.className != this.labelClass[hX_5.IMG_NORMAL]) this.labelTag.className=this.labelClass[hX_5.IMG_NORMAL]; if (hX_5.getIHTML(this.labelTag) != this.label) hX_5.setIHTML(this.labelTag, this.label); if (hX_5.brw.isIE() && this.labelTag.disabled != bDisabled) this.labelTag.disabled=bDisabled; } if (this.iconTag) { if (this.iconTag.className != this.iconClass[hX_5.IMG_NORMAL]) this.iconTag.className=this.iconClass[hX_5.IMG_NORMAL]; if (hX_5.brw.isIE() && this.iconTag.disabled != bDisabled) this.iconTag.disabled=bDisabled; this.iconTag.src=(bDisabled && this.icon[hX_5.IMG_DISABLED] && this.icon[hX_5.IMG_DISABLED].src)?(this.icon[hX_5.IMG_DISABLED].src):(this.icon[hX_5.IMG_NORMAL].src); } if (this.mouseDiv) { if (this.mouseDiv.disabled != bDisabled) this.mouseDiv.disabled=bDisabled; if (prop && this.mouseDiv.alt != prop) this.mouseDiv.alt=prop; if (prop1 && this.mouseDiv.title != prop1) this.mouseDiv.title=prop1; prop2=this.gE(hX_5._CRS); if (prop2 && prop2.length > 0) hX_5.g.setP(this.mouseDiv, hX_5._CRS, prop2); if (zIndex && this.mouseDiv.style.zIndex != zIndex) this.mouseDiv.style.zIndex=zIndex; } } } } if (!hX_5.brw.isIE() && !this.HTMLrendered) hX_5.i.startTimerTimed(this.DOMobj.id, "redraw", "redraw", 10); return true; } HxG_5.prototype.JSFImage.prototype.sizeContentToAttributes=function () { var prop,align,span,t,lf,tp,btnHeight=hX_5.g.getRendHeight(this.DOMobj), btnWidth=hX_5.g.getRendWidth(this.DOMobj); if (this.innerSpan) { this.innerSpan.style.fontSize=this.gE(hX_5._FSZ); this.innerSpan.style.fontFamily=this.gE("font-family"); this.innerSpan.style.fontWeight=this.gE("font-weight"); this.innerSpan.style.fontStyle=this.gE("font-style"); this.innerSpan.style.fontVariant=this.gE("font-variant"); this.innerSpan.style.textDecoration=this.gE("text-decoration"); this.innerSpan.style.color=this.gE("color"); if (hX_5.brw.isIE()) { this.outerSpan.style.marginLeft=this.gE(hX_5._MGNL); this.outerSpan.style.marginRight=this.gE(hX_5._MGNR); lf=0; tp=hX_5.g.getAbsPosTop(this.DOMobj) - hX_5.g.getAbsPosTop(this.outerSpan); if (this.DOMobj.tagName==hX_5._INP && this.DOMobj.type.toLowerCase()!=hX_5._lIMG) { if (!this.doRealignmentCalcOnceDone) { this.buttonleftoffsemargin=(-this.DOMobj.offsetLeft)+ hX_5._PX; this.doRealignmentCalcOnceDone=true; } hX_5.g.setP(this.DOMobj, hX_5._LFT, this.buttonleftoffsemargin); } } else { lf=this.DOMobj.offsetLeft; tp=hX_5.g.getAbsPosTop(this.DOMobj) - hX_5.g.getAbsPosTop(this.outerSpan); } hX_5.g.setP(this.innerSpan, hX_5._LFT, lf+hX_5._PX); hX_5.g.setP(this.innerSpan, hX_5._TOP, tp+hX_5._PX); hX_5.g.setP(this.innerSpan, hX_5._WD, (btnWidth + hX_5._PX)); hX_5.g.setP(this.innerSpan, hX_5._HT, (btnHeight + hX_5._PX)); if (this.mouseDiv) { hX_5.g.setP(this.mouseDiv, hX_5._LFT, lf+hX_5._PX); hX_5.g.setP(this.mouseDiv, hX_5._TOP, tp+hX_5._PX); hX_5.g.setP(this.mouseDiv, hX_5._WD, (btnWidth + hX_5._PX)); hX_5.g.setP(this.mouseDiv, hX_5._HT, (btnHeight + hX_5._PX)); } } if (this.labelTag && !this.labelAbsolute) { align=hX_5._LFT; if (this.labelClass[hX_5.IMG_NORMAL] && this.labelClass[hX_5.IMG_NORMAL].length>0) { prop=hX_5.getClassStyle(this.labelClass[hX_5.IMG_NORMAL], hX_5._TXA); align=(prop && prop.length>0 && prop!=hX_5._AUT) ? prop: align; } span=hX_5.g.getRendWidth(this.labelTag); t=((btnWidth - span) > 0) ? (btnWidth - span) : 0; t=((align == hX_5._LFT) ? 0 : ((align == hX_5._RGT) ? t : (Math.floor(t/2)))) + hX_5._PX; hX_5.g.setP(this.labelTag, hX_5._LFT, t); align=hX_5._MID; if (this.labelClass[hX_5.IMG_NORMAL] && this.labelClass[hX_5.IMG_NORMAL].length>0) { prop=hX_5.getClassStyle(this.labelClass[hX_5.IMG_NORMAL], hX_5._VXA); align=(prop && prop.length>0 && prop!=hX_5._AUT) ? prop: align; } span=hX_5.g.getRendHeight(this.labelTag); t=((btnHeight - span)) > 0 ? (btnHeight - span) : 0; t=((align == hX_5._TOP) ? 0 : ((align == hX_5._BOT) ? (t) : (Math.floor(t/2)))) + hX_5._PX; hX_5.g.setP(this.labelTag, hX_5._TOP, t); } if (this.iconTag && !this.iconAbsolute) { align=hX_5._LFT; if (this.iconClass[hX_5.IMG_NORMAL] && this.iconClass[hX_5.IMG_NORMAL].length>0) { prop=hX_5.getClassStyle(this.iconClass[hX_5.IMG_NORMAL], hX_5._TXA); align=(prop && prop.length>0 && prop!=hX_5._AUT) ? prop: align; } span=hX_5.g.getRendWidth(this.iconTag); if (align==hX_5._RGT && this.iconFromClass) { prop=parseInt(hX_5.g.getP(this.iconTag, hX_5._MGNR),10); span+=(isNaN(prop) || prop==null)?0:prop; } t=((btnWidth - span) > 0) ? (btnWidth - span) : 0; t=((align == hX_5._LFT) ? 0 : ((align == hX_5._RGT) ? t : (Math.floor(t/2)))) + hX_5._PX; hX_5.g.setP(this.iconTag, hX_5._LFT, t); align=hX_5._MID; if (this.iconClass[hX_5.IMG_NORMAL] && this.iconClass[hX_5.IMG_NORMAL].length>0) { prop=hX_5.getClassStyle(this.iconClass[hX_5.IMG_NORMAL], hX_5._VXA); align=(prop && prop.length>0 && prop!=hX_5._AUT) ? prop: align; } span=hX_5.g.getRendHeight(this.iconTag); if (align==hX_5._BOT && this.iconFromClass) { prop=parseInt(hX_5.g.getP(this.iconTag, hX_5._MGNB),10); span+=(isNaN(prop) || prop==null)?0:prop; } t=((btnHeight - span)) > 0 ? (btnHeight - span) : 0; t=((align == hX_5._TOP) ? 0 : ((align == hX_5._BOT) ? t : (Math.floor(t/2)))) + hX_5._PX; hX_5.g.setP(this.iconTag, hX_5._TOP, t); } } HxG_5.prototype.JSFTwistie=function () { this.type=hX_5.CMP_twistie; this.direction=hX_5.TW_RT; this.style=hX_5.TW_VEE; this.barstyle=hX_5.TW_NOBAR; this.size=this.sColorEdge=this.sColorFill=null; this.ptype=hX_5._BTN; this.canvas=this.colorEdge =this.colorFill=null; this.height=this.width=this.saveCanvasLeft=this.saveCanvasTop=0; this.saveBorderStyle=hX_5._E; this.attributeTable=[]; this.attributeTable ['direction']=['direction', hX_5.ARG_TO_NUM, false, 0, 3]; this.attributeTable ['style']=['style', hX_5.ARG_TO_NUM, false, 0, 3]; this.attributeTable ['bar-style']=['barstyle', hX_5.ARG_TO_NUM, false, 0, 2]; this.attributeTable ['size']=['size', hX_5.ARG_TO_NUM, false, 0, 999]; this.attributeTable ['color-edge']=['sColorEdge',hX_5.ARG_TO_NAN, false, null, null]; this.attributeTable ['color-fill']=['sColorFill',hX_5.ARG_TO_NAN, false, null, null]; this.setAttribute(arguments); } HxG_5.prototype.JSFTwistie.prototype.onPageLoad=function () { hX_5.bodyLoadRedrawA=true; this.redraw(); return true; } HxG_5.prototype.JSFTwistie.prototype.redraw=function () { this.sizeImageToAttributes(); this.draw(); return true; } HxG_5.prototype.JSFTwistie.prototype.uirelease=function () { return true; } HxG_5.prototype.JSFTwistie.prototype.destroy=function () { this.DOMobj.onmousedown=this.DOMobj.onmouseout=this.DOMobj.onmouseup=null; return true; } HxG_5.prototype.JSFTwistie.prototype.setValue=function (value) { return false; } HxG_5.prototype.JSFTwistie.prototype.getValue=function() { return null; } HxG_5.prototype.JSFTwistie.prototype.setAttribute=function(a) { hX_5.parseArg (this.attributeTable, this, a); if (this.HTMLrendered) this.redraw(); return true; } HxG_5.prototype.JSFTwistie.prototype.getAttribute=function (attribute) { return (hX_5.getArg(this.attributeTable, this, attribute)); } HxG_5.prototype.JSFTwistie.prototype.sizeImageToAttributes=function () { if (!this.DOMobj) return false; if (this.DOMobj.tagName != hX_5._BTN && this.DOMobj.tagName != hX_5._INP && this.DOMobj.tagName == hX_5._IMG) return false; if (this.size==null || this.size==hX_5._E) { var sSize=hX_5.g.getP(this.DOMobj, hX_5._HT), nSize=parseInt(sSize, 10); this.size=(nSize == null || nSize == 0 || isNaN(nSize)) ? 7 : (Math.floor((nSize-2+1)/2)); } var realclass=this.DOMobj.className; this.DOMobj.className=realclass + "_twistie"; var twistieColorFill=hX_5.g.getP(this.DOMobj, hX_5._COR), twistieColorEdge=hX_5.g.getP(this.DOMobj, hX_5._BRLCL), twistieType=hX_5.g.getP(this.DOMobj, "list-style-type"), twistieType1=hX_5.g.getP(this.DOMobj, "list-style-position"); this.DOMobj.className=realclass; this.colorFill=this.sColorFill; this.colorEdge=this.sColorEdge; if (this.sColorFill == hX_5._E || this.sColorEdge == hX_5._E || this.sColorFill == null || this.sColorEdge == null) { if (this.sColorFill == hX_5._E || this.sColorFill == null) this.colorFill=twistieColorFill; if (this.sColorEdge == hX_5._E || this.sColorEdge == null) this.colorEdge=twistieColorEdge; } if (this.DOMobj.disabled) this.colorFill=this.colorEdge="GrayText"; this.colorFill=(this.colorFill == hX_5._E) ? "windowtext" : this.colorFill; this.colorEdge=(this.colorEdge == hX_5._E) ? "windowtext" : this.colorEdge; if (twistieType == "square") this.style=hX_5.TW_TRI; else if (twistieType == "circle") this.style=hX_5.TW_PUG; else if (twistieType == "decimal") this.style=hX_5.TW_SNOUT; if (twistieType1 == "inside") this.barstyle=hX_5.TW_BAR_INNER; this.height=this.width=0; var even=((Math.floor(this.size/2)*2) == this.size); var b=(this.barstyle == hX_5.TW_BAR_INNER) ? 4: 0 var v=(this.style == hX_5.TW_SNOUT) ? (even ? this.size :this.size+1) : ((this.style == hX_5.TW_TRI) ? Math.floor(((this.size+1)/2)) : Math.floor(((this.size+1)/2) + 1)); if (this.direction == hX_5.TW_LT || this.direction == hX_5.TW_RT) { this.height=this.size; this.width=v + b; } else { this.width=this.size; this.height=v + b; } if (this.DOMobj.tagName == hX_5._BTN) { this.canvas=this.DOMobj.lastChild; if (this.canvas == null || this.canvas.tagName != hX_5._DIV || this.canvas.id != (this.DOMobj.id+"_TWISTIE")) { this.canvas=document.createElement(hX_5._DIV); this.canvas.setAttribute (hX_5._ID, this.DOMobj.id+"_TWISTIE"); this.canvas.style.position=hX_5._REL; this.canvas.tabIndex=hX_5.__1; this.canvas.unselectable=hX_5._ON; this.DOMobj.appendChild(this.canvas); this.ptype=hX_5._BTN; } } else { var div=this.DOMobj.parentNode; if (div == null || div.tagName==undefined || div.tagName != hX_5._DIV || div.id==undefined || div.id != (this.DOMobj.id+"_TWISTIE")) { var find=hX_5.getElementById(this.DOMobj.id+"_TWISTIE"); if (find) { div=find; this.DOMobj.parentNode.insertBefore(div, this.DOMobj); if (div.firstChild) div.insertBefore(this.DOMobj, div.firstChild); else appendChild(this.DOMobj); } } if (div == null || div.tagName != hX_5._DIV || div.id==undefined || div.id != (this.DOMobj.id+"_TWISTIE")) { div=document.createElement(hX_5._DIV); div.setAttribute (hX_5._ID, this.DOMobj.id+"_TWISTIE"); div.style.position=hX_5._REL; this.DOMobj.parentNode.insertBefore(div, this.DOMobj); div.appendChild(this.DOMobj); this.DOMobj.style.position=hX_5._REL; if (this.DOMobj.style.zIndex == hX_5._E || this.DOMobj.style.zIndex == hX_5._Z || this.DOMobj.style.zIndex == hX_5._AUT) this.DOMobj.style.zIndex=hX_5._2; this.DOMobj.style.backgroundColor=hX_5._TRN; if (hX_5.brw.isNavOrMoz()) { var parent=div.parentNode; if (parent.tagName && parent.tagName == hX_5._TD) { parent.style.width=this.DOMobj.offsetWidth + hX_5._PX; div.style.height=this.DOMobj.offsetHeight + hX_5._PX; } } this.canvas=document.createElement(hX_5._DIV); this.canvas.style.position=hX_5._ABS; this.canvas.tabIndex=hX_5.__1; this.canvas.unselectable=hX_5._ON; this.canvas.zIndex=parseInt(this.DOMobj.style.zIndex,10)-1; div.appendChild(this.canvas); this.DOMobj.onmousedown=this.onredirect; this.DOMobj.onmouseout=this.onredirect; this.DOMobj.onmouseup=this.onredirect; this.ptype=hX_5._INP; } this.canvas=div.lastChild; } var child=this.canvas.firstChild; while (child != null) { this.canvas.removeChild(child); child=this.canvas.firstChild; } this.canvas.style.width=this.width + hX_5._PX; this.canvas.style.height=this.height + hX_5._PX; this.canvas.style.backgroundColor=hX_5._TRN; var align, xWidth, xHeight, xx, yy, xOff, yOff; if (this.ptype == hX_5._BTN) { if (hX_5.brw.isNavOrMoz()) { align=hX_5.g.getP(this.DOMobj, hX_5._TXA); if (align == hX_5._CTR) { xWidth=hX_5.g.getRendWidth(this.DOMobj); xx=Math.floor((xWidth - this.width - 1)/2); this.canvas.style.left=(xx - 3) + hX_5._PX; } align=hX_5.g.getP(this.DOMobj, hX_5._VXA); if (align == hX_5._MID) this.canvas.style.top=hX_5.__1 + hX_5._PX; } } else { xHeight=hX_5.g.getRendHeight(this.DOMobj); xWidth=hX_5.g.getRendWidth(this.DOMobj); yy=Math.round((xHeight- this.height)/2); xx=Math.round((xWidth - this.width)/2); yOff=xOff=0; this.canvas.style.left=(xx + xOff) + hX_5._PX; this.canvas.style.top=(yy + yOff) + hX_5._PX; } this.saveBorderStyle=this.DOMobj.style.borderStyle; this.saveCanvasLeft=this.canvas.style.left; this.saveCanvasTop=this.canvas.style.top; return ((this.direction == hX_5.TW_LT || this.direction == hX_5.TW_RT) ? this.width : this.height); } HxG_5.prototype.JSFTwistie.prototype.onredirect=function (evt) { evt=(evt) ? evt : ((event) ? event: null); if (evt) { var src=hX_5.evtGetTarget(evt); if (src && src.tagName == hX_5._INP) { var thisp=hX_5.getComponentById(src.id); if (thisp && !thisp.DOMobj.disabled) { thisp.drawState(evt); } } } } HxG_5.prototype.JSFTwistie.prototype.drawState=function (evt) { if (this.DOMobj.disabled) return; if (evt.type==hX_5._evMD) { hX_5.i.setFocus(this.DOMobj); this.saveBorderStyle=this.DOMobj.style.borderStyle; this.saveCanvasLeft=this.canvas.style.left; this.saveCanvasTop=this.canvas.style.top; this.DOMobj.style.borderStyle=hX_5._INS; this.canvas.style.left=parseInt(this.canvas.style.left, 10) + 1; this.canvas.style.top=parseInt(this.canvas.style.top, 10) + 1; } else { if (this.DOMobj.style.borderStyle != this.saveBorderStyle) this.DOMobj.style.borderStyle=this.saveBorderStyle; if (this.canvas.style.top != this.saveCanvasTop) this.canvas.style.top=this.saveCanvasTop; if (this.canvas.style.left != this.saveCanvasLeft) this.canvas.style.left=this.saveCanvasLeft; } } HxG_5.prototype.JSFTwistie.prototype.draw=function() { if (!this.DOMobj || !this.canvas) return false; var stroke=(this.style == hX_5.TW_SNOUT) ? 2 : 1; var d, i, j, k=0, r, xs; if (this.direction == hX_5.TW_RT || this.direction == hX_5.TW_LT) { r=(this.direction == hX_5.TW_RT); j=this.height; i=(r) ? 0 : this.width-1; if (this.style != hX_5.TW_VEE) this.drawLine(i, k, 1, j, false, false, true, false, 1, this.colorEdge, this.colorFill); else this.drawLine(i, k, 1, j, true, true, false, false, 1, this.colorEdge, hX_5._TRN); if (this.style == hX_5.TW_TRI) { j -= 2; k++; } for (i=((r) ? i+1:i-stroke); j > stroke; i=((r) ? i+stroke:i-stroke)) { this.drawLine(i, k, stroke, j, true, true, false, false, (this.style == hX_5.TW_VEE)?2:1, this.colorEdge, (this.style == hX_5.TW_VEE)?hX_5._TRN:this.colorFill); k++; j -= 2; } if (j > 0) this.drawLine((r) ? i : i+(stroke-1), k, 1, j, false, false, true, false, 1, this.colorEdge, this.colorFill); if (this.barstyle == hX_5.TW_BAR_INNER) { xs=(this.style == hX_5.TW_VEE || this.style == hX_5.TW_TRI) ? 0 : 2; this.drawLine((r) ? this.width-2 : 0, (xs > 0) ? 1:0, 2, this.height-xs, false, false, true, false, 1, this.colorEdge, this.colorFill); } } else { d=(this.direction == hX_5.TW_DN); i=(d) ? 0:this.height-1; j=this.width; if (this.style!=hX_5.TW_VEE) this.drawLine(k, i, j, 1, true, false, false, false, 1, this.colorEdge, this.colorFill); else this.drawLine(k, i, j, 1, false, false, true, true, 1, this.colorEdge, hX_5._TRN); if (this.style == hX_5.TW_TRI) { j -= 2; k++; } for (i=((d) ? i+1:i-stroke); j > stroke; i=((d) ? i+stroke : i-stroke)) { this.drawLine(k, i, j, stroke, false, false, true, true, (this.style == hX_5.TW_VEE)?2:1,this.colorEdge, (this.style == hX_5.TW_VEE)?hX_5._TRN:this.colorFill); k++; j -= 2; } if (j > 0) this.drawLine(k, (d) ? i:i+(stroke-1), j, 1, true, false, false, false, 1, this.colorEdge, this.colorFill); if (this.barstyle == hX_5.TW_BAR_INNER) { xs=(this.style == hX_5.TW_VEE || this.style == hX_5.TW_TRI) ? 0 : 2; this.drawLine((xs > 0) ? 1:0, (d) ? this.height-2:0, this.width-xs, 2, (d) ? false:true, (d)? true:false, false, false, 1, this.colorEdge, this.colorFill); } } return true; } HxG_5.prototype.JSFTwistie.prototype.drawLine=function(xOffset, yOffset, width, height, T, B, L, R, n, edge, fill) { var poly=document.createElement(hX_5._DIV); poly.tabIndex=hX_5._1; poly.style.position=hX_5._ABS; poly.style.borderColor=edge; poly.style.borderStyle=hX_5._SLD; poly.style.borderWidth=hX_5._ZPX; poly.style.overflow=hX_5._HI; this.canvas.appendChild(poly); var w=width, h=height, hide=false; if (hX_5.brw.isW3Cstd()) { if (T && B) { h=h - (2*n); if (h <= 0) { hide=true; n=height; h=1; } } else if (L && R) { w=w - (2*n); if (w <= 0) { hide=true; n=width; w=1; } } else if (L || R) { hide=(h <= n); w -= n; } else if (T || B) { hide=(w <= n); h -= n; } } poly.style.width=w + hX_5._PX; poly.style.height=h + hX_5._PX; poly.style.backgroundColor=(hide) ? hX_5._TRN : fill; poly.style.left=xOffset + hX_5._PX; poly.style.top=yOffset + hX_5._PX; if (T) poly.style.borderTopWidth=n + hX_5._PX; if (B) poly.style.borderBottomWidth=n + hX_5._PX; if (L) poly.style.borderLeftWidth=n + hX_5._PX; if (R) poly.style.borderRightWidth=n + hX_5._PX; if (hide) { if (B) poly.style.borderBottomWidth=hX_5._ZPX; if (R) poly.style.borderRightWidth=hX_5._ZPX; } }