DragIndicator={init:function(A){var B=RichFaces.getIEVersion(); DragIndicator.isIE6=(B&&B<7); this.realParent=this.parentNode; this._nextSibling=this.nextSibling },setContent:function(A,F,D){Element.clearChildren(this); var C=DnD.getDnDDefaultParams(this); if(!C){C={} }if(D){Object.extend(C,D) }if(!C["marker"]){if(C[A]){C["marker"]=C[A] }else{C["marker"]=this.markers[A] }}var B; if(F){B=this.indicatorTemplates["single"] }else{B=this.indicatorTemplates["multi"] }new Insertion.Top(this,B.invoke("getContent",C).join("")); this.adjustIFrame() },show:function(){if(!this.floatedToBody){if(!this.realParent){this.realParent=this.parentNode; this._nextSibling=this.nextSibling }this.realParent.removeChild(this); document.body.appendChild(this); this.floatedToBody=true }Element.show(this); this.style.position="absolute"; this.adjustIFrame(true); if(this.iframe){this.realParent.removeChild(this.iframe); document.body.appendChild(this.iframe); Element.show(this.iframe) }},hide:function(){Element.hide(this); this.style.position=""; this.offsets=undefined; this.leave(); if(this.floatedToBody&&this.realParent){document.body.removeChild(this); if(this._nextSibling){this.realParent.insertBefore(this,this._nextSibling) }else{this.realParent.appendChild(this) }this.floatedToBody=false }this.adjustIFrame(false); if(this.iframe){Element.hide(this.iframe); document.body.removeChild(this.iframe); this.realParent.appendChild(this.iframe) }},position:function(A,B){if(!this.offsets){Element.show(this); this.style.position="absolute" }Element.setStyle(this,{"left":A+"px","top":B+"px"}); this.moveIFrame(A,B) },accept:function(){Element.removeClassName(this,"drgind_default"); Element.removeClassName(this,"drgind_reject"); Element.addClassName(this,"drgind_accept"); var A=this.getAcceptClass(); if(A){Element.addClassName(this,A) }},reject:function(){Element.removeClassName(this,"drgind_default"); Element.removeClassName(this,"drgind_accept"); Element.addClassName(this,"drgind_reject"); var A=this.getRejectClass(); if(A){Element.addClassName(this,A) }},leave:function(){Element.removeClassName(this,"drgind_accept"); Element.removeClassName(this,"drgind_reject"); Element.addClassName(this,"drgind_default"); var B=this.getAcceptClass(); var A=this.getRejectClass(); if(B){Element.removeClassName(this,B) }if(A){Element.removeClassName(this,A) }},getAcceptClass:function(){return this.ils_acceptClass },getRejectClass:function(){return this.ils_rejectClass },initIFrame:function(){if(DragIndicator.isIE6&&!this.iframe){var A=$(document.createElement("div")); A.innerHTML=''; this.iframe=$(A.getElementsByTagName("iframe")[0]); A.removeChild(this.iframe); this.realParent.appendChild(this.iframe) }},moveIFrame:function(A,B){this.initIFrame(); if(this.iframe){Element.setStyle(this.iframe,{"left":A,"top":B}) }},adjustIFrame:function(C){this.initIFrame(); if(this.iframe){if(Element.visible(this)){var B=this.offsetWidth+"px"; var D=this.offsetHeight+"px"; var A=this.offsetLeft+"px"; var F=this.offsetTop+"px"; Element.setStyle(this.iframe,{"left":A,"top":F}); Element.setStyle(this.iframe,{"width":B,"height":D}) }if(arguments.length>0){if(C){this.iframe.style.display="" }else{this.iframe.style.display="none" }}}}}; function createDragIndicator(B,C,A){Object.extend(B,DragIndicator); B.init(); B.ils_acceptClass=C; B.ils_rejectClass=A }DefaultDragIndicatorView=[new E("table",{"style":"height : 100%; z-index: 2;","className":"drgind_internal","cellspacing":"0","cellpadding":"3","border":"0"},[new E("tbody",{},[new E("tr",{},[new E("td",{"className":"drgind_marker"},[new ET(function(context){return Richfaces.eval("marker",context) })]),new E("td",{"className":"drgind_text"},[new E("div",{"className":"drgind_wordcut drgind_text_content"},[new ET(function(context){return Richfaces.eval("label",context) })])])])])])] ; DnD.SimpleDraggable=Class.create(); Object.extend(DnD.SimpleDraggable.prototype,DnD.Draggable.prototype); Object.extend(DnD.SimpleDraggable.prototype,{initialize:function(B,A){this.id=$(B); if(!this.id){alert("drag: Element with ["+B+"] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!"); return }this.options=A; this.dragIndicatorId=this.options.dragIndicator; this.eventMouseDown=this.initDrag.bindAsEventListener(this); Event.observe(this.id,"mousedown",this.eventMouseDown); this.form=this.id; while(this.form&&!/^form$/i.test(this.form.tagName)){this.form=this.form.parentNode }this.enableDraggableCursors(this.options.grab,this.options.grabbing) },getDnDDragParams:function(){if(this.options.dndParams){return this.options.dndParams.parseJSON(EventHandlersWalk) }return null },getIndicator:function(){var A=$(this.dragIndicatorId); if(!A){A=this.getOrCreateDefaultIndicator() }return A },ondragstart:function(B,A){A.params=this.options.parameters; A.params[this.id]=this.id; this.setIndicator(B); if(this.form){A.params[this.form.id]=this.form.id }},getContentType:function(){return this.options.dragType },getDraggableOptions:function(){return this.options },initDrag:function(A){if(Event.isLeftClick(A)){var B=Event.element(A); if(B.tagName&&/^INPUT|SELECT|OPTION|BUTTON|TEXTAREA$/i.test(B.tagName)){return }Event.stop(A); this.startDrag(A) }}}) ; DnD.SimpleDropZone=Class.create(); Object.extend(DnD.SimpleDropZone.prototype,DnD.Dropzone.prototype); Object.extend(DnD.SimpleDropZone.prototype,{initialize:function(C,A){this.id=C; var B=$(C); if(!B){alert("drop: Element with ["+C+"] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!"); return }this.element=B; if(A.acceptedTypes){this.acceptedTypes=A.acceptedTypes }else{this.acceptedTypes=[] }if(A.typeMapping){this.typeMapping=A.typeMapping }else{this.typeMapping={} }if(A.cursorTypeMapping){this.cursorTypeMapping=A.cursorTypeMapping }else{this.cursorTypeMapping={} }this.mouseoverBound=this.mouseover.bindAsEventListener(this); this.mouseoutBound=this.mouseout.bindAsEventListener(this); this.mouseupBound=this.mouseup.bindAsEventListener(this); Event.observe(B,"mouseover",this.mouseoverBound); Event.observe(B,"mouseout",this.mouseoutBound); Event.observe(B,"mouseup",this.mouseupBound); this.options=A||{}; this.enableDropzoneCursors(A.acceptCursor,A.rejectCursor) },getDropzoneOptions:function(){return this.options },getDnDDropParams:function(){if(this.options.dndParams){return this.options.dndParams.parseJSON(EventHandlersWalk) }return null },mouseover:function(A){if(window.drag){this.dragEnter(A) }},mouseup:function(A){this.dragUp(A) },mouseout:function(A){if(window.drag){this.dragLeave(A) }},getAcceptedTypes:function(){return this.acceptedTypes },getTypeMapping:function(){return this.typeMapping },getCursorTypeMapping:function(){return this.cursorTypeMapping },drop:function(B,A){alert("I drop") },onafterdrag:function(A){if(this.options.onafterdrag){this.options.onafterdrag.call(this,A) }}}) ; Richfaces.TreeSelectEvent="Richfaces.TreeSelectEvent"; Richfaces.TreeExpandEvent="Richfaces.TreeExpandEvent"; Richfaces.TreeCollapseEvent="Richfaces.TreeCollapseEvent"; Richfaces.TreeComposite=Class.create({parent:null,initialize:function(){this.childs=[] },removeChild:function(D){if(this.childs.length){var A=this.childs.indexOf(D); if(A!=-1){var B=this.childs.splice(A,1); if(B){for(var C=0; CB){this.element.scrollTop=E-this.element.clientHeight }}},getElement:function(){return $(this.id) }}) ; Tree.SelectionManager=Class.create(); Tree.SelectionManager.prototype={initialize:function(A){this.tree=A; if(!this.tree.disableKeyboardNavigation){this.eventKeyDown=this.processKeyDown.bindAsEventListener(this); Event.observe(document,"keydown",this.eventKeyDown) }this.eventLostFocus=this.processLostFocus.bindAsEventListener(this); Event.observe(document,"click",this.eventLostFocus); this.eventPreventLostFocus=this.processPreventLostFocus.bindAsEventListener(this); Event.observe(this.tree.element,"click",this.eventPreventLostFocus) },destroy:function(){this.activeItem=null; this.tree=null; if(this.eventKeyDown){Event.stopObserving(document,"keydown",this.eventKeyDown) }Event.stopObserving(document,"click",this.eventLostFocus) },restoreSelection:function(){if(this.tree.input.value){var A=$(this.tree.input.value); if(A){this.inFocus=true; this.setSelection(A.object) }}},processPreventLostFocus:function(A){if(Richfaces.eventIsSynthetic(A)){return }this.inFocus=true; this.preventLostFocus=true },processLostFocus:function(A){if(Richfaces.eventIsSynthetic(A)){return }if(!this.preventLostFocus){this.lostFocus() }else{this.preventLostFocus=false }},lostFocus:function(){this.inFocus=false },setSelection:function(A){A.toggleSelection(); this.activeItem=A },processKeyDown:function(E){if(!this.activeItem){return }if(!($(this.activeItem.id))){this.activeItem=null; this.tree.input.value=""; return }var C=false; var B=E.keyCode||E.charCode; switch(B){case Event.KEY_UP:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey){var D=this.activeItem; do{var A=this.getPreviousItemForSelection(D); if(A&&A!=D){D=A; if(D.toggleSelection(E)){this.activeItem=D; D=null }}else{D=null }}while(D) }C=true }break; case Event.KEY_DOWN:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey){var D=this.activeItem; do{var A=this.getNextItemForSelection(D); if(A&&A!=D){D=A; if(D.toggleSelection(E)){this.activeItem=D; D=null }}else{D=null }}while(D) }C=true }break; case Event.KEY_LEFT:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey&&!this.activeItem.isLeaf()){this.activeItem.collapse() }C=true }break; case Event.KEY_RIGHT:if(this.inFocus){if(!E.ctrlKey&&!E.shiftKey&&!E.altKey&&!this.activeItem.isLeaf()){this.activeItem.expand() }C=true }break; case Event.KEY_TAB:this.lostFocus() }if(C){if(E.preventBubble){E.preventBubble() }Event.stop(E) }},getNextItemForSelection:function(C){if(!C.isCollapsed()&&C.hasChilds()){return C.childs.first() }else{var B=C.next(); if(B!=C){return B }else{var A=C.parent; while(A&&A!=this.tree){var B=A.next(); if(B!=A){return B }else{A=A.parent }}return C }}},getPreviousItemForSelection:function(B){var A=B.previous(); if(A==B){if(B.parent!=this.tree&&B.parent){A=B.parent }}else{if(!A.isCollapsed()&&A.hasChilds()){A=A.childs.last(); while(!A.isCollapsed()&&A.hasChilds()){A=A.childs.last() }}}return A }} ; Tree.Item=Class.create(Richfaces.TreeComposite); Tree.Item.findComponent=function(B,C){var A; while(B&&!((A=B.object) instanceof Tree.Item)){if(C){B=C(B) }else{B=B.parentNode }}return A }; Tree.Item.createItemForNode=function(){var A=function(D){var C=0; var E=D; while(E){if(E.object instanceof Tree.Item){C++ }E=E.previousSibling }return C }; var B=function(C){var D=C.parentNode; if(D){D=Richfaces.previous(D) }if(D){return D.object }}; return function(G,D){var H=$(G); var E=B(H)||D; var C=A(H); var F=new Tree.Item(H,D,true); E.addChild(F,C); return F } }(); Tree.Item.addMethods({initialize:function($super,P,N,I){$super(); this.tree=N; this.elements={}; this["rich:destructor"]="destroy"; var G; if(typeof P=="string"){G=$(P); this.id=P }else{G=P; this.id=G.id }G.component=this; G.object=this; var M=G.rows; this.elements.itemElement=G; this.elements.mainRow=M[0]; var T=G.nextSibling; var B=this.id+Tree.ID_DEVIDER+Tree.ID_CHILDS_ROW; while(T&&T.id!=B){T=T.nextSibling }this.elements.childrenRow=T; var O=this.id+Tree.ID_DEVIDER+Tree.ID_HANDLES; var C=this.id+Tree.ID_DEVIDER+Tree.ID_ICON; var L=this.id+Tree.ID_DEVIDER+Tree.ID_TEXT; var K=Richfaces.next(G); this.createSubNodes(K); if(I&&this.tree.showConnectingLines){var F=G.rows[0].cells[0]; try{if(F.style&&F.style.removeExpression){F.style.backgroundImage=F.currentStyle.backgroundImage; F.style.removeExpression("backgroundImage") }if(K){if(K.style&&K.style.removeExpression){K.style.backgroundImage=K.currentStyle.backgroundImage; K.style.removeExpression("backgroundImage") }}}catch(U){}}var D=null; var J=this.elements.mainRow.cells; if("NETSCAPE"==RichFaces.navigatorType()){for(var S=0; S0){this.onContextMenu=new Function("event",A+"; return true;").bindAsEventListener(this) }Event.observe(this.elements.iconElement,"mousedown",this.eventSelectionClick); Event.observe(this.elements.iconElement,"mouseout",this.eventMouseOut); Event.observe(this.elements.iconElement,"mouseover",this.eventMouseOver); if(this.onContextMenu){Event.observe(this.elements.iconElement,"contextmenu",this.onContextMenu) }}if(this.elements.textElement){Event.observe(this.elements.textElement,"mousedown",this.eventSelectionClick); Event.observe(this.elements.textElement,"mouseout",this.eventMouseOut); Event.observe(this.elements.textElement,"mouseover",this.eventMouseOver); if(this.onContextMenu){Event.observe(this.elements.textElement,"contextmenu",this.onContextMenu) }}if(this.tree.switchType=="client"&&this.hasChilds()){this.eventCollapsionClick=this.toggleCollapsion.bindAsEventListener(this); var B=this.tree.toggleOnClick?this.elements.mainRow:this.elements.handle; Event.observe(B,"click",this.eventCollapsionClick) }},createSubNodes:function(B){if(B){var C=B.firstChild; while(C!=null){if(C.nodeType==1&&C.tagName.toLowerCase()=="table"){if(C.object instanceof Tree.Item){var A=C.object; this.addChild(A) }else{this.addChild(new Tree.Item(C,this.tree)) }}C=C.nextSibling }}},fireExpansionEvent:function(){var A=new Object(); A[Richfaces.TreeExpandEvent]=true; A["expandedNode"]=this.id; A["treeItem"]=this; var B=Richfaces.createEvent("click",this.tree.element,null,A); try{B.fire() }finally{B.destroy() }},fireCollapsionEvent:function(){var A=new Object(); A[Richfaces.TreeCollapseEvent]=true; A["collapsedNode"]=this.id; A["treeItem"]=this; var B=Richfaces.createEvent("click",this.tree.element,null,A); try{B.fire() }finally{B.destroy() }},toggleCollapsion:function(){var D=this.id+Tree.ID_DEVIDER+Tree.ID_CHILDS_ROW; if(this.hasChilds()){Element.toggle(D) }var C=this.elements.mainRow; if(C){Element.hide(C); Element.show(C) }var B=$(this.id+"NodeExpanded"); var A=this.elements.iconElement; if(this.isCollapsed()){Element.hide(this.elements.handleImgExpanded); Element.show(this.elements.handleImgCollapsed); if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_EXPANDED)){Element.removeClassName(A,Tree.CLASS_ITEM_EXPANDED); Element.addClassName(A,Tree.CLASS_ITEM_COLLAPSED) }if(B){B.value="false" }this.fireCollapsionEvent() }else{Element.show(this.elements.handleImgExpanded); Element.hide(this.elements.handleImgCollapsed); if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_COLLAPSED)){Element.removeClassName(A,Tree.CLASS_ITEM_COLLAPSED); Element.addClassName(A,Tree.CLASS_ITEM_EXPANDED) }if(B){B.value="true" }this.fireExpansionEvent() }},getRichAttribute:function(A){return Richfaces.getNSAttribute(A,this.elements.iconElement) },collapse:function(){if(!this.isCollapsed()&&this.tree.switchType!="client"){var C=$(this.tree.toggleOnClick?this.elements.mainRow:this.elements.handle); if(C){C.onclick() }}else{if(this.hasChilds()&&!this.isCollapsed()){Element.hide(this.elements.childrenRow); Element.hide(this.elements.handleImgExpanded); Element.show(this.elements.handleImgCollapsed); var A=this.elements.iconElement; if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_EXPANDED)){Element.removeClassName(A,Tree.CLASS_ITEM_EXPANDED); Element.addClassName(A,Tree.CLASS_ITEM_COLLAPSED) }var B=$(this.id+"NodeExpanded"); if(B){B.value="false" }this.fireCollapsionEvent() }}},expand:function(){if(this.isCollapsed()&&this.tree.switchType!="client"){var C=$(this.tree.toggleOnClick?this.elements.mainRow:this.elements.handle); if(C){C.onclick() }}else{if(this.hasChilds()&&this.isCollapsed()){Element.show(this.elements.childrenRow); Element.show(this.elements.handleImgExpanded); Element.hide(this.elements.handleImgCollapsed); var A=this.elements.iconElement; if(A&&Element.hasClassName(A,Tree.CLASS_ITEM_COLLAPSED)){Element.removeClassName(A,Tree.CLASS_ITEM_COLLAPSED); Element.addClassName(A,Tree.CLASS_ITEM_EXPANDED) }var B=$(this.id+"NodeExpanded"); if(B){B.value="true" }this.fireExpansionEvent() }}},isCollapsed:function(){var A=this.elements.childrenRow; if(A){return A.style.display=="none" }else{return true }},processMouseOut:function(B){if(this.isMouseIn){this.isMouseIn=false; var A=this.elements.textElement; A.className=this.previousTextClassNames; this.previousTextClassNames=null; if(window.drag){this.dragLeave(B) }}},processMouseOver:function(B){if(!this.isMouseIn){this.isMouseIn=true; var A=this.elements.textElement; this.previousTextClassNames=A.className; if(!this.highlightedTextClassNames){this.highlightedTextClassNames=Richfaces.getNSAttribute("highlightedclass",A) }if(this.highlightedTextClassNames){A.className+=" "+this.highlightedTextClassNames }if(window.drag){this.dragEnter(B) }}},toggleSelection:function(E){if(E&&!E[Richfaces.TreeSelectEvent]&&!Richfaces.eventIsSynthetic(E)){if(E&&E.type=="mousedown"){if((this.tree.rightClickSelection&&Event.isRightClick(E))||Event.isLeftClick(E)){var H=Event.element(E); if(H.tagName&&/^(input|select|option|button|textarea)$/i.test(H.tagName)){return }if(this.isDragEnabled()){Event.stop(E) }}else{return }}var C=new Object(); C[Richfaces.TreeSelectEvent]=true; C["originatingEventType"]=E.type; C["treeItem"]=this; C["selectedNode"]=this.id; var A=Richfaces.createEvent("click",this.tree.element,null,C); try{A.fire() }finally{A.destroy() }return !A.event["cancelSelection"] }else{var G=this.tree.selectionManager.activeItem; if(G){G.deselect() }if(!E||E["treeItem"]){var D=this.elements.textElement; if(!this.selectedTextClassNames){this.selectedTextClassNames=Richfaces.getNSAttribute("selectedclass",D) }if(this.selectedTextClassNames){var F=this.selectedTextClassNames.split(" "); for(var B=0; B0 },getElement:function(){return $(this.id) },isLeaf:function(){return !this.elements.handle }}) ; Object.extend(Tree.Item.prototype,DnD.Dropzone.prototype); Object.extend(Tree.Item.prototype,DnD.Draggable.prototype); Object.extend(Tree.Item.prototype,{getAcceptedTypes:function(){var B=this.getDropzoneOptions(); if(B){var A=B["acceptedTypes"]; if(A){return A }}return[] },mergeParams:function(C){var A=C(this.tree.getElement()); var B=C(this.getElement()); if(A){if(B){Object.extend(A,B) }return A }else{return B }},getDnDDefaultParams:function(){return this.mergeParams(DnD.getDnDDefaultParams) },getDnDDragParams:function(){return this.mergeParams(DnD.getDnDDragParams) },getDnDDropParams:function(){return this.mergeParams(DnD.getDnDDropParams) },getDropzoneOptions:function(){var A=Richfaces.getNSAttribute("dropzoneoptions",this.elements.iconElement); if(A){return A.parseJSON(EventHandlersWalk) }return null },drop:function(D,B){B.params[DnD.Dropzone.DROP_TARGET_ID]=this.id; var C=this.getDropzoneOptions(); if(C&&C.parameters){Object.extend(B.params,C.parameters) }this.tree.drop.call(this,D,B); var A=this.getDropzoneOptions(); if(A&&A.ondropend){A.ondropend() }},getIndicator:function(){var C=this.getDraggableOptions(); var B=C?C.dragIndicator:null; var A=$(B); if(!A){A=this.getOrCreateDefaultIndicator() }return A },ondragstart:function(C,A){A.params[this.id]=this.id; var B=this.getDraggableOptions(); if(B&&B.parameters){Object.extend(A.params,B.parameters) }this.dragEnter(C) },ondragend:function(B,A){this.dragStarted=false },getDraggableOptions:function(){var A=window.drag; if(A&&A.treeDraggableOptions){return A.treeDraggableOptions }else{var B=this._getDraggableOptions(); if(A){A.treeDraggableOptions=B }return B }},_getDraggableOptions:function(){var A=Richfaces.getNSAttribute("draggableoptions",this.elements.iconElement); if(A){return A.parseJSON(EventHandlersWalk) }return null },getContentType:function(){var A=this.getDraggableOptions(); if(A){return A["dragType"] }return"" },getElement:function(){return this.elements.textElement.parentNode }}) ; if(!window.DW){window.DW={} }if(!window.Richfaces){window.Richfaces={} }function discardElement(A){var B=document.getElementById("IELeakGarbageBin"); if(!B){B=document.createElement("DIV"); B.id="IELeakGarbageBin"; B.style.display="none"; document.body.appendChild(B) }window.RichFaces.Memory.clean(A); B.appendChild(A); B.innerHTML="" }Selection={}; Selection.eventHandler=function(A){Event.stop(A) }; Selection.eventHandler=Selection.eventHandler.bindAsEventListener(Selection); Selection.disableSelection=function(A){if(typeof A.onselectstart!="undefined"){Event.observe(A,"selectstart",this.eventHandler) }else{if(typeof A.style.MozUserSelect!="undefined"){A.style.MozUserSelect="none" }else{Event.observe(A,"mousedown",this.eventHandler) }}}; Selection.enableSelection=function(A){if(typeof A.onselectstart!="undefined"){Event.stopObserving(A,"selectstart",this.eventHandler) }else{if(typeof A.style.MozUserSelect!="undefined"){A.style.MozUserSelect="" }else{Event.stopObserving(A,"mousedown",this.eventHandler) }}}; ModalPanel=Class.create(); var ieVersion=RichFaces.getIEVersion(); if(ieVersion&&ieVersion<7){ModalPanel.disableSelects=true }ModalPanel.panels=new Array(); ModalPanel.activePanels=new Array(); function getSizeElement(){var A; var A; if(RichFaces.navigatorType()!=RichFaces.OPERA&&document.compatMode=="CSS1Compat"){A=document.documentElement }else{A=document.body }return A }ModalPanel.getMinimumSize=function(A){return Math.max(A,2*ModalPanel.Sizer.INITIAL_MIN+2) }; ModalPanel.prototype={initialize:function(E,B){this["rich:destructor"]="destroy"; this.markerId=$(E); this.id=$(E+"Container"); this.options=B; this.baseZIndex=this.options.zindex?this.options.zindex:100; this.minWidth=ModalPanel.getMinimumSize(this.options.minWidth); this.minHeight=ModalPanel.getMinimumSize(this.options.minHeight); this.div=E+"Div"; this.cursorDiv=E+"CursorDiv"; this.cdiv=E+"CDiv"; this.contentDiv=E+"ContentDiv"; this.contentTable=E+"ContentTable"; this.shadowDiv=E+"ShadowDiv"; this.borders=new Array(); if(this.options.resizeable){this.borders.push(new ModalPanel.Border(E+"ResizerN",this,"N-resize",ModalPanel.Sizer.N)); this.borders.push(new ModalPanel.Border(E+"ResizerE",this,"E-resize",ModalPanel.Sizer.E)); this.borders.push(new ModalPanel.Border(E+"ResizerS",this,"S-resize",ModalPanel.Sizer.S)); this.borders.push(new ModalPanel.Border(E+"ResizerW",this,"W-resize",ModalPanel.Sizer.W)); this.borders.push(new ModalPanel.Border(E+"ResizerNWU",this,"NW-resize",ModalPanel.Sizer.NWU)); this.borders.push(new ModalPanel.Border(E+"ResizerNEU",this,"NE-resize",ModalPanel.Sizer.NEU)); this.borders.push(new ModalPanel.Border(E+"ResizerNEL",this,"NE-resize",ModalPanel.Sizer.NEL)); this.borders.push(new ModalPanel.Border(E+"ResizerSEU",this,"SE-resize",ModalPanel.Sizer.SEU)); this.borders.push(new ModalPanel.Border(E+"ResizerSEL",this,"SE-resize",ModalPanel.Sizer.SEL)); this.borders.push(new ModalPanel.Border(E+"ResizerSWL",this,"SW-resize",ModalPanel.Sizer.SWL)); this.borders.push(new ModalPanel.Border(E+"ResizerSWU",this,"SW-resize",ModalPanel.Sizer.SWU)); this.borders.push(new ModalPanel.Border(E+"ResizerNWL",this,"NW-resize",ModalPanel.Sizer.NWL)) }if(this.options.moveable&&$(E+"Header")){this.header=new ModalPanel.Border(E+"Header",this,"move",ModalPanel.Header) }this.markerId.component=this; var A=$(this.div); if(A.style.setExpression){if(ModalPanel.disableSelects||Richfaces.getComputedStyle(A,"position")!="fixed"){A.style.position="absolute"; var C=$(this.cursorDiv); C.style.position="absolute"; A.style.zoom="1"; C.style.zoom="1"; var D=$(this.cdiv); D.style.position="absolute"; D.parentNode.style.position="absolute"; D.mpUseExpr=true }}ModalPanel.panels.push(this); this.eventFirstOnfocus=this.firstOnfocus.bindAsEventListener(this); this.eventLastOnfocus=this.lastOnfocus.bindAsEventListener(this); this.firstHref=E+"FirstHref"; this.lastHref=E+"LastHref"; this.selectBehavior=B.selectBehavior },_saveInputValues:function(D){if(Prototype.Browser.IE){var A=D.getElementsByTagName("input"); if(A){for(var C=0; C'); H=$(this.iframe); Event.observe(H,"load",this.initIframe.bindAsEventListener(H)) }var D={}; this.userOptions={}; if(!W.mpSet){Object.extend(D,this.options) }if(N){Object.extend(D,N); Object.extend(this.userOptions,N) }this.currentMinHeight=ModalPanel.getMinimumSize((D.minHeight||D.minHeight==0)?D.minHeight:this.minHeight); this.currentMinWidth=ModalPanel.getMinimumSize((D.minWidth||D.minWidth==0)?D.minWidth:this.minWidth); var C=this.getContentElement(); if(!this.options.autosized){if(D.width&&D.width==-1){D.width=300 }if(D.height&&D.height==-1){D.height=200 }}if(D.width&&D.width!=-1){if(this.currentMinWidth>D.width){D.width=this.currentMinWidth }C.style.width=D.width+(/px/.test(D.width)?"":"px") }if(D.height&&D.height!=-1){if(this.currentMinHeight>D.height){D.height=this.currentMinHeight }C.style.height=D.height+(/px/.test(D.height)?"":"px") }W.mpSet=true; this.disableOuterSelects(); ModalPanel.activePanels=ModalPanel.activePanels.without(this); ModalPanel.activePanels.push(this); var X=$(this.div); if(X.style.position=="absolute"){var K='getSizeElement().clientWidth + "px"'; var G='getSizeElement().clientHeight + "px"'; X.style.setExpression("width",K); X.style.setExpression("height",G); var M=$(this.cursorDiv); M.style.setExpression("width",K); M.style.setExpression("height",G); var Q='-Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft + "px"'; var J='-Position.cumulativeOffset(this.parentNode)[1] + getSizeElement().scrollTop + "px"'; X.style.setExpression("left",Q); X.style.setExpression("top",J); M.style.setExpression("left",Q); M.style.setExpression("top",J); var I='(this.mpLeft || 0) + -Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft + "px"'; var O='(this.mpTop || 0) + -Position.cumulativeOffset(this.parentNode)[1] + getSizeElement().scrollTop + "px"'; W.style.setExpression("left",I); W.style.setExpression("top",O) }A.style.visibility="hidden"; Element.show(A); this.correctShadowSize(); if(D.left){var V; if(D.left!="auto"){V=parseInt(D.left,10) }else{var B=getSizeElement().clientWidth; var F=this.width(); if(B>=F){V=(B-F)/2 }else{V=0 }}this.setLeft(Math.round(V)) }if(D.top){var S; if(D.top!="auto"){S=parseInt(D.top,10) }else{var B=getSizeElement().clientHeight; var Y=this.height(); if(B>=Y){S=(B-Y)/2 }else{S=0 }}this.setTop(Math.round(S)) }if(this.options.autosized){this.observerSize=window.setInterval(this.correctShadowSize.bindAsEventListener(this),500) }this.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY); for(var R=0; R0){ModalPanel.activePanels.last().preventFocus() }}},_getStyle:function(B,A){return parseInt(B.style[A].replace("px",""),10) },doResizeOrMove:function(L){var B={}; var H={}; var C={}; var F=false; var E; var K=this.getContentElement(); E=this._getStyle(K,"width"); var A=E; E+=L.deltaWidth||0; if(E>=this.currentMinWidth||this.options.autosized){if(L.deltaWidth){C.width=E+"px" }}else{if(L.deltaWidth){C.width=this.currentMinWidth+"px"; B.vx=A-this.currentMinWidth }B.x=true }if(B.vx&&L.deltaX){L.deltaX=-B.vx }var J=$(this.cdiv); if(L.deltaX&&(B.vx||!B.x)){if(B.vx){L.deltaX=B.vx }var G; G=this._getStyle(J,"left"); G+=L.deltaX; H.left=G+"px" }E=this._getStyle(K,"height"); var A=E; E+=L.deltaHeight||0; if(E>=this.currentMinHeight||this.options.autosized){if(L.deltaHeight){C.height=E+"px" }}else{if(L.deltaHeight){C.height=this.currentMinHeight+"px"; B.vy=A-this.currentMinHeight }B.y=true }if(B.vy&&L.deltaY){L.deltaY=-B.vy }if(L.deltaY&&(B.vy||!B.y)){if(B.vy){L.deltaY=B.vy }var G; if(J.mpUseExpr){G=J.mpTop||0; G+=L.deltaY; J.mpTop=G; H.top=G+"px" }else{G=this._getStyle(J,"top"); G+=L.deltaY; H.top=G+"px" }}Element.setStyle(K,C); Element.setStyle(J,H); this.correctShadowSize(); Object.extend(this.userOptions,H); Object.extend(this.userOptions,C); var I=this.width(); var D=this.height(); this.reductionData=null; if(I<=2*ModalPanel.Sizer.INITIAL_MAX){this.reductionData={}; this.reductionData.w=I }if(D<=2*ModalPanel.Sizer.INITIAL_MAX){if(!this.reductionData){this.reductionData={} }this.reductionData.h=D }if(this.header){this.header.doPosition() }return B },_findForm:function(A){var B=A; while(B){if(!B.tagName||B.tagName.toLowerCase()!="form"){B=B.parentNode }else{break }}return B },setStateInput:function(E){var D=Event.element(E); if(E&&D){D=this._findForm(D); var A=document.createElement("input"); A.type="hidden"; A.id=this.markerId.id+"OpenedState"; A.name=this.markerId.id+"OpenedState"; A.value=this.shown?"true":"false"; D.appendChild(A); var C=$H(this.userOptions).keys(); if(C){for(var B=0; B=D.length){var C=E.substring(E.length-D.length,E.length); if(C==D){return A.markerId }}}}}}}; Richfaces.showModalPanel=function(E,D,C){var B=(Richfaces.browser.isIE||Richfaces.browser.isSafari)?function(H){if(document.readyState!="complete"&&document.readyState!="interactive"){var G=arguments; var F=this; window.setTimeout(function(){G.callee.apply(F,G) },50) }else{H() }}:function(F){F() }; var A=$(E); if(!A){A=Richfaces.findModalPanel(E) }B(function(){A.component.show(C,D) }) }; Richfaces.hideModalPanel=function(D,C,B){var A=$(D); if(!A){A=Richfaces.findModalPanel(D) }A.component.hide(B,C) }; Richfaces.hideTopModalPanel=function(C,B){var A=ModalPanel.activePanels.last(); if(A){A.hide(C,B) }} ; ModalPanel.Border=Class.create(); ModalPanel.Border.prototype={initialize:function(E,C,D,B){this.id=E; var A=$(E); A.style.cursor=D; this.boundStartDrag=this.startDrag.bindAsEventListener(this,new Date()); Event.observe(this.id,"mousedown",this.boundStartDrag); this.modalPanel=C; this.sizer=B; this.boundDoDrag=this.doDrag.bindAsEventListener(this); this.boundEndDrag=this.endDrag.bindAsEventListener(this) },destroy:function(){if(this.doingDrag){Event.stopObserving(document,"mousemove",this.boundDoDrag); Event.stopObserving(document,"mouseup",this.boundEndDrag) }Event.stopObserving(this.id,"mousedown",this.boundStartDrag); this.modalPanel=null },show:function(){Element.show(this.id) },hide:function(){Element.hide(this.id) },startDrag:function(B){this.doingDrag=true; this.dragX=B.clientX; this.dragY=B.clientY; Event.observe(document,"mousemove",this.boundDoDrag); Event.observe(document,"mouseup",this.boundEndDrag); var A=$(this.modalPanel.cursorDiv); A.style.cursor=$(this.id).style.cursor; A.style.zIndex=10; this.modalPanel.startDrag(this); this.onselectStartHandler=document.onselectstart; document.onselectstart=function(){return false } },doDrag:function(A){if(!this.doingDrag){return }var E=A.clientX; var B=A.clientY; var G=Richfaces.getWindowSize(); if(E<0){E=0 }else{if(E>=G.width){E=G.width-1 }}if(B<0){B=0 }else{if(B>=G.height){B=G.height-1 }}var K=E-this.dragX; var J=B-this.dragY; if(K!=0||J!=0){var D=this.id; var I=this.sizer.doDiff(K,J); var H; var F=$(this.modalPanel.cdiv); if(I.deltaWidth||I.deltaHeight){H=this.modalPanel.invokeEvent("resize",A,null,F) }else{if(I.deltaX||I.deltaY){H=this.modalPanel.invokeEvent("move",A,null,F) }}var C; if(H){C=this.modalPanel.doResizeOrMove(I) }if(C){if(!C.x){this.dragX=E }else{if(!I.deltaX){this.dragX-=C.vx||0 }else{this.dragX+=C.vx||0 }}if(!C.y){this.dragY=B }else{if(!I.deltaY){this.dragY-=C.vy||0 }else{this.dragY+=C.vy||0 }}}}},endDrag:function(A){this.doingDrag=undefined; Event.stopObserving(document,"mousemove",this.boundDoDrag); Event.stopObserving(document,"mouseup",this.boundEndDrag); this.modalPanel.endDrag(this); this.modalPanel.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY); $(this.modalPanel.cursorDiv).style.zIndex=-200; document.onselectstart=this.onselectStartHandler; this.onselectStartHandler=null; var B=this.id },doPosition:function(){this.sizer.doPosition(this.modalPanel,$(this.id)) }}; ModalPanel.Sizer=Class.create(); ModalPanel.Sizer.INITIAL_MIN=4; ModalPanel.Sizer.INITIAL_MAX=40; ModalPanel.Sizer.Diff=Class.create(); ModalPanel.Sizer.Diff.prototype={initialize:function(C,A,B,D){this.deltaX=C; this.deltaY=A; this.deltaWidth=B; this.deltaHeight=D }}; ModalPanel.Sizer.Diff.EMPTY=new ModalPanel.Sizer.Diff(0,0,0,0); ModalPanel.Sizer.prototype={initialize:function(){},doSetupSize:function(E,B){var C=0; var A=0; var D=E.reductionData; if(D){if(D.w){C=D.w/2 }if(D.h){A=D.h/2 }}if(C>0){if(B.clientWidth>C){if(!B.reducedWidth){B.reducedWidth=B.style.width }B.style.width=C+"px" }else{if(C0){if(B.clientHeight>A){if(!B.reducedHeight){B.reducedHeight=B.style.height }B.style.height=A+"px" }else{if(A0 } }}; Array.prototype.remove=function(B){var A=this.indexOf(B,0,this.length); if(A==-1){return }if(A==0){this.shift() }else{this.splice(A,1) }} ; if(!window.Richfaces){window.Richfaces={} }Richfaces.getExternalClass=function(C,B){if(C){var A=C.length; while(B>=A){B-=A }return(C[B])?C[B]:"" }return"" }; Richfaces.SelectItem=Class.create(); Richfaces.SelectItem.findElement=function(B,D){var C=B; if(C){if(C.id==D){return C }C=C.firstChild; while(C){var A=arguments.callee(C,D); if(A){return A }C=C.nextSibling }}return null }; Richfaces.SelectItem.prototype={initialize:function(A,C,B){this._label=A; this._node=B; this._node.item=this; this._id=C; this.input=Richfaces.SelectItem.findElement(B,B.id+"StateInput"); this.selected=/^s/.test(this.input.value); this.active=/^s?a/.test(this.input.value) },destroy:function(){this._node.item=null },doActive:function(E,C){var B=this.CLASSES; var F=this._node; var A=B.ROW.ACTIVE; var D=B.CELL.ACTIVE; if(this.isSelected()){A=B.ROW.SELECTED+" "+B.ROW.ACTIVE; D=B.CELL.SELECTED+" "+B.CELL.ACTIVE }this.changeClass(F,A,D,E,C); this.active=true; this.saveState() },doSelect:function(C,B){var D=this._node; var A=this.CLASSES; this.changeClass(D,A.ROW.SELECTED,A.CELL.SELECTED,C,B); this.selected=true; this.saveState() },doNormal:function(C,B){var D=this._node; var A=this.CLASSES; this.changeClass(D,A.ROW.NORMAL,A.CELL.NORMAL,C,B); this.active=false; this.selected=false; this.saveState() },isSelected:function(){return this.selected },isActive:function(){return this.active },changeClass:function(H,G,E,F,D){H.className=F+" "+G; var B=H.cells; for(var C=0; C0)?F:0; return{srcWidth:D,colWidth:F} }; LayoutManager.getBorderWidth=function(B,A){return LayoutManager.getStyles(B,A,LayoutManager.borders) }; LayoutManager.getPaddingWidth=function(B,A){return LayoutManager.getStyles(B,A,LayoutManager.paddings) }; LayoutManager.getMarginWidth=function(B,A){return LayoutManager.getStyles(B,A,LayoutManager.margins) }; LayoutManager.getStyles=function(D,F,E){var G=0; for(var C=0,A=F.length; CD.rowIndex){D=C }}}return D },getEventTargetRow:function(A){var B; if(A.target){B=A.target }else{B=A.srcElement }if(B==null){return }if(B.tagName&&Richfaces.ListBase.CONTROL_SET.indexOf(B.tagName.toUpperCase())!=-1){return }while(B.tagName.toLowerCase()!="tr"){B=B.parentNode; if(!B.tagName){return }}return B },onfocusHandler:function(A){if(!this.activeItem&&this.shuttleItems.length!=0){this.setActiveItem(this.shuttleItems[0]._node) }if(this.activeItem){this.activeItem.item.doActive(this.getExtRowClass(this.activeItem.rowIndex),this.columnsClasses) }},onclickHandler:function(A){if(A.srcElement&&(A.srcElement.tagName.toLowerCase()=="tbody")){return }var B=this.getEventTargetRow(A); if(B!=null){if(A.ctrlKey){this.addSelectedItem(B); this.setActiveItem(B) }else{if(A.shiftKey){if(!this.pseudoActiveItem){this.selectionItem(B); this.setActiveItem(B) }else{this.selectItemGroup(B); this.activeItem=B }}else{this.selectionItem(B); this.setActiveItem(B) }}this.setFocus() }},onkeydownHandler:function(A){var B=null; switch(A.keyCode){case 38:B="up"; this.moveActiveItem(B,A); Event.stop(A); break; case 40:B="down"; this.moveActiveItem(B,A); Event.stop(A); break; case 65:if(A.ctrlKey){this.selectAll() }this.activeItem.item.doActive(this.getExtRowClass(this.activeItem.rowIndex),this.columnsClasses); Event.stop(A); break }},moveActiveItem:function(D,B){var A=this.activeItem; var C=this.shuttleTbody.rows; if((D=="up")&&(A.rowIndex>0)){this.changeActiveItems(C[A.rowIndex-1],A) }else{if((D=="down")&&(A.rowIndexA){D=A; C=B.rowIndex }else{D=B.rowIndex; C=A }this.resetMarked(); this.selectItemRange(D,C) },selectItemRange:function(D,C){var B=this.shuttleTbody.rows; for(var A=D; A<=C; A++){B[A].item.doSelect(this.getExtRowClass(B[A].rowIndex),this.columnsClasses); this.selectedItems.push(B[A]) }},resetMarked:function(){var C=this.selectedItems; var B=C.length; for(var A=0; A0){this.shuttleTable.parentNode.scrollTop+=A }}}if(F){Event.stop(F) }},setFocus:function(){this.focusKeeper.focus(); this.focusKeeper.focused=true },focusListener:function(A){A=A||window.event; this.focusKeeper.focused=false; if(this.activeItem){if(this.activeItem.item.isSelected()){this.activeItem.item.doSelect(this.getExtRowClass(this.activeItem.rowIndex),this.columnsClasses) }else{this.activeItem.item.doNormal(this.getExtRowClass(this.activeItem.rowIndex),this.columnsClasses) }}},compareByLabel:function(B,A){B=B._label; A=A._label; return Richfaces.ListBase.compare(B,A) },compareByRowIndex:function(B,A){B=B.rowIndex; A=A.rowIndex; return Richfaces.ListBase.compare(B,A) },isListActive:function(){if((this.activeItem!=null||this.selectedItems.length!=0)&&this.focusKeeper.focused){return true }return false },getExtRowClass:function(A){return Richfaces.getExternalClass(this.rowClasses,A) },getSelection:function(){var A=[]; for(var B=0; B0){if(Richfaces.invokeEvent(this.events.onorderchange,this.container,"rich:onorderchange",{items:this.shuttleItems})){D=window.event||D; var E=this.shuttleTbody.rows; var C; this.selectedItems.sort(this.compareByRowIndex); if((F=="up")&&this.getExtremeItem("first").previousSibling){for(var A=0; A-1; A--){C=this.selectedItems[A]; C.parentNode.insertBefore(C.nextSibling,C) }}else{if(F=="first"){var G=this.selectedItems[0].rowIndex; for(var A=0; A-1; A--){C=this.selectedItems[A]; if(C.rowIndex+G>B-1){C.parentNode.insertBefore(C,null) }else{C.parentNode.insertBefore(C,E[C.rowIndex+G]) }}}}}}this.shuttleItems=new Array(); for(var A=0; A0){var D=A.length; for(var B=0; A.length>0; ){var C=A[B]; this.moveItem(E,F,C) }this.controlListManager(); if(this.targetList.controlListManager){this.targetList.controlListManager() }this.targetLayoutManager.widthSynchronization(); this.sourceLayoutManager.widthSynchronization(); this.container.fire("rich:onlistchanged",{sourceItems:E.shuttleItems,targetItems:F.shuttleItems}) }}},moveItem:function(B,C,A){if(!A){return }if(!(A instanceof Richfaces.SelectItem)){A=B.getSelectItemByNode(A) }if(Richfaces.browser.isFF2&&(C.shuttleTbody.rows.length==0)){this.tableUpdate(C); this.addItem(C,A); this.removeItem(B,A); B.shuttleTable.deleteRow(A._node.rowIndex) }else{this.addItem(C,A); this.removeItem(B,A) }},removeItem:function(B,C){var A=B.shuttleItems; B.selectedItems.remove(C._node); A.remove(C); if(C==B.activeItem){B.activeItem==null }},addItem:function(A,B){B.doNormal(Richfaces.getExternalClass(B.rowIndex),A.columnsClasses); A.shuttleTbody.insertBefore(B._node,null); A.shuttleItems.push(B) },tableUpdate:function(B){var D=B.shuttleTable; var A=D.tBodies[0]; var C=A.cloneNode(false); D.removeChild(A); D.appendChild(C); B.shuttleTbody=D.tBodies[0] },moveItemByClick:function(D,C,E,A){if(Richfaces.invokeEvent(this.events.onlistchange,this.container,"rich:onlistchange",{sourceItems:C.shuttleItems,targetItems:E.shuttleItems})){var B=this.sourceList.getEventTargetRow(D); this.moveItem(C,E,B); this.controlListManager(); if(this.targetList.controlListManager){this.targetList.controlListManager() }this.targetLayoutManager.widthSynchronization(); this.sourceLayoutManager.widthSynchronization(); this.container.fire("rich:onlistchanged",{sourceItems:C.shuttleItems,targetItems:E.shuttleItems}) }},copyAll:function(){this.container.fire("rich:oncopyallclick",{sourceItems:this.sourceList.shuttleItems,targetItems:this.targetList.shuttleItems,selection:this.sourceList.getSelection()}); this.moveItems(this.sourceList,this.targetList,this.sourceList.shuttleItems) },copy:function(){this.container.fire("rich:oncopyclick",{sourceItems:this.sourceList.shuttleItems,targetItems:this.targetList.shuttleItems,selection:this.sourceList.getSelection()}); this.moveItems(this.sourceList,this.targetList,this.sourceList.selectedItems) },removeAll:function(){this.container.fire("rich:onremoveallclick",{sourceItems:this.sourceList.shuttleItems,targetItems:this.targetList.shuttleItems,selection:this.targetList.getSelection()}); this.moveItems(this.targetList,this.sourceList,this.targetList.shuttleItems) },remove:function(){this.container.fire("rich:onremoveclick",{sourceItems:this.sourceList.shuttleItems,targetItems:this.targetList.shuttleItems,selection:this.targetList.getSelection()}); this.moveItems(this.targetList,this.sourceList,this.targetList.selectedItems) },up:function(){this.targetList.up() },down:function(){this.targetList.down() },top:function(){this.targetList.top() },bottom:function(){this.targetList.bottom() },focusOrBlurHandlerLS:function(C){var A=C.target.id; if(C.type=="keydown"){var B=C.which; this.skipBlurEvent=false; this.wasKeyDown=true; if(Event.KEY_TAB==B){if(C.shiftKey){if((A==this.sourceList.focusKeeper.id)&&this.isFocused){this.fireOnblurEvent() }else{this.skipBlurEvent=true }}else{if((A==this.targetList.focusKeeper.id)&&this.isFocused){this.fireOnblurEvent() }else{this.skipBlurEvent=true }}}}else{if(C.type=="mousedown"){this.skipBlurEvent=false; this.wasMouseDown=true; if(!this.isFocused){this.fireOnfocusEvent() }}else{if(C.type=="click"){this.wasMouseDown=false }else{if(C.type=="keypress"){this.wasKeyDown=false }else{if(C.type=="focus"){if(A==this.sourceList.focusKeeper.id&&!this.wasMouseDown&&!this.isFocused){this.fireOnfocusEvent() }else{if(A==this.targetList.focusKeeper.id&&!this.wasMouseDown&&!this.isFocused){this.fireOnfocusEvent() }}}else{if(C.type=="blur"){if(!this.wasMouseDown&&!this.wasKeyDown&&this.isFocused&&!this.skipBlurEvent){this.fireOnblurEvent() }}}}}}}},fireOnfocusEvent:function(){this.isFocused=true; this.container.fire("rich:onfocus",{}) },fireOnblurEvent:function(){this.isFocused=false; this.container.fire("rich:onblur",{}) }}; Richfaces.ListShuttle.HANDLERS={copy:function(A){this.copy(); return false },copyAll:function(A){this.copyAll(); return false },remove:function(A){this.remove(); return false },removeAll:function(A){this.removeAll(); return false }} ; if(!window.Richfaces){window.Richfaces={} }Richfaces.PickListSI=Class.create(Richfaces.SelectItem,{initialize:function($super,A,C,B){$super(A,C,B); this.selected=false; this.active=false },saveState:function(){}}) ; if(!window.Richfaces){window.Richfaces={} }Richfaces.PickList=Class.create(Richfaces.ListShuttle,{initialize:function($super,G,E,B,D,C,A,H,F){$super(G,E,B,D,C,A,H); this.valueKeeper=$(F) },moveItems:function($super,B,C,A){this.saveState(A,this.isAdd(B)); $super(B,C,A) },moveItemByClick:function($super,C,B,D,A){this.saveState([this.sourceList.getEventTargetRow(C)],this.isAdd(B)); $super(C,B,D,A) },saveState:function(B,C){var B=this.getSIAsLabels(B); if(C){var E=this.valueKeeper.value; if(E.length!=0){E+="," }this.valueKeeper.value=E+B.join(",") }else{var A=this.valueKeeper.value.split(","); for(var D=0; D0 } }}; Richfaces.getBody=function(){if(document.body){return document.body }if(document.getElementsByTagName){var A=document.getElementsByTagName("BODY"); if(A!=null&&A.length>0){return A[0] }}return null }; Richfaces.zero=function(A){return(!Richfaces.defined(A)||isNaN(A))?0:A }; Richfaces.getDocumentHeight=function(){var B=0; var A=jQuery(window); B=A.height()+A.scrollTop(); return B }; Richfaces.getScrollWidth=function(A){if(A.clientWidth!=0){return A.offsetWidth-A.clientWidth }return 0 }; Richfaces.getBorderWidth=function(B,A){return Richfaces.getStyles(B,A,Richfaces.borders) }; Richfaces.getPaddingWidth=function(B,A){return Richfaces.getStyles(B,A,Richfaces.paddings) }; Richfaces.getMarginWidth=function(B,A){return Richfaces.getStyles(B,A,Richfaces.margins) }; Richfaces.getStyles=function(D,F,E){var G=0; for(var C=0,A=F.length; CB){A=B }}else{if(D(I-B)){if(G>(I-B)){E=-parseInt(D) }}this.clonePosition(this.listParent,this.fieldElem,E); if(this.iframe){this.clonePosition(this.iframe,this.fieldElem,E) }},scrolling:function(D){var A; var E=this.list; var G=Richfaces.ComboBoxList.getElemXY(E).top; var F=E.scrollTop; var C=Richfaces.ComboBoxList.getElemXY(this.activeItem).top; if((D.keyCode==Event.KEY_UP)||(D.keyCode==33)){A=(C-F)-G; if(A<0){E.scrollTop+=A }}else{if((D.keyCode==Event.KEY_DOWN)||(D.keyCode==34)){var B=C+this.activeItem.offsetHeight; var A=(B-F)-(G+E.clientHeight); if(A>0){E.scrollTop+=A }}}Event.stop(D) },scrollingUpToItem:function(B){var C=this.list; var A=(Richfaces.ComboBoxList.getElemXY(B).top-C.scrollTop)-Richfaces.ComboBoxList.getElemXY(C).top; C.scrollTop+=A },doActiveItem:function(A){if(this.activeItem){this.doNormalItem(this.activeItem) }this.activeItem=A; this.changeItem(A,this.classes.item.selected) },doNormalItem:function(A){this.activeItem=null; this.changeItem(A,this.classes.item.normal) },doSelectItem:function(A){this.selectedItem=A },changeItem:function(B,A){B.className=A },moveActiveItem:function(E){var D=this.activeItem; if(E.keyCode==Event.KEY_UP){if(!this.activeItem){if(!this.selectFirstOnUpdate){var C=this.getItems(); if(C!=null&&C.length!=0){this.doActiveItem(C[C.length-1]); this.scrollingUpToItem(C[C.length-1]) }}return }var B=D.previousSibling; if(B){this.itemsRearrangement(D,B) }}else{if(E.keyCode==Event.KEY_DOWN){if(!this.activeItem){if(!this.selectFirstOnUpdate){var C=this.getItems(); if(C!=null&&C.length!=0){this.doActiveItem(C[0]); this.scrollingUpToItem(C[0]) }}return }var A=D.nextSibling; if(A){this.itemsRearrangement(D,A) }}}this.scrolling(E) },itemsRearrangement:function(B,A){this.doActiveItem(A) },resetState:function(){if(this.filterNewValues){var A=this.list.cloneNode(false); this.listParent.childNodes[1].firstChild.replaceChild(A,this.list); this.list=$(A.id) }else{if(this.activeItem){this.doNormalItem(this.activeItem) }}this.activeItem=null; this.isList=false },dataFilter:function(A){this.createNewList(this.getFilteredItems(A)) },getFilteredItems:function(D){var A=new Array(); for(var B=0; B'+B+"" },createIframe:function(A,D,E,B){var C=document.createElement("iframe"); C.id="iframe"+E; C.style.display="none"; C.style.position="absolute"; C.frameBorder="0"; C.scrolling="no"; C.src="javascript:''"; C.style.width=D; C.className=B; A.insertBefore(C,A.firstChild); this.iframe=document.getElementById(C.id) },PX_REGEX:/px$/,parseToPx:function(B){var A=B.strip(); if(this.PX_REGEX.test(A)){try{return parseFloat(A.replace(this.PX_REGEX,"")) }catch(C){}}return NaN },clonePosition:function(F,A,D){var H=jQuery(F); var J=jQuery(A); var B=J.offset(); var E=(H.css("display")=="none"); var G; if(E){G=H.css("visibility"); H.css("visibility","hidden").css("display","") }var C=this.parseToPx(H.css("left")); if(isNaN(C)){C=0; H.css("left","0px") }var I=this.parseToPx(H.css("top")); if(isNaN(I)){I=0; H.css("top","0px") }var K=H.offset(); if(E){H.css("display","none").css("visibility",G) }H.css({left:(B.left-K.left+C)+"px",top:(B.top-K.top+I+D)+"px"}) }}; Richfaces.ComboBoxList.getElemXY=function(C){var A=C.offsetLeft; var D=C.offsetTop; for(var B=C.offsetParent; B; B=B.offsetParent){A+=B.offsetLeft; D+=B.offsetTop }return{left:A,top:D} } ; if(!window.LOG){window.LOG={warn:function(){}} }if(!window.Richfaces){window.Richfaces={} }Richfaces.InplaceInput=Class.create(); Richfaces.InplaceInput.prototype={initialize:function(A,B,I,H,D,G,F,E,C){this.inplaceInput=$(A); this.inplaceInput.component=this; this.tempValueKeeper=$(B); this.valueKeeper=$(I); this.attributes=D; this.events=G; this.currentText=this.getCurrentText(); this.value=this.valueKeeper.value; this.currentState=Richfaces.InplaceInput.STATES[0]; this.prevState=Richfaces.InplaceInput.STATES[0]; if(this.attributes.showControls){this.bar=new Richfaces.InplaceInputBar(C[0],C[1],C[2],C[3],C[4],this.attributes.verticalPosition,this.attributes.horizontalPosition) }this.editEvent=this.attributes.editEvent.substring(2,this.attributes.editEvent.length); this.tempValueKeeper.style.top=Richfaces.getBorderWidth(this.tempValueKeeper,"t")+"px"; this.initHandlers(); this.initEvents(); this.classes=Richfaces.mergeStyles(F,E.getCommonStyles()); this["rich:destructor"]="destroy"; this.skipSwitching=false },destroy:function(){this.inplaceInput.component=null },initHandlers:function(){this.inplaceInput.observe(this.editEvent,this.switchingStatesHandler.bindAsEventListener(this)); this.inplaceInput.observe("mouseout",this.inplaceMouseOutHandler.bindAsEventListener(this)); this.inplaceInput.observe("mouseover",this.inplaceMouseOverHandler.bindAsEventListener(this)); this.tempValueKeeper.observe("focus",function(A){this.switchingStatesHandler(A) }.bindAsEventListener(this)); this.tempValueKeeper.observe("blur",function(A){this.tmpValueBlurHandler(A) }.bindAsEventListener(this)); this.tempValueKeeper.observe("keydown",function(A){this.tmpValueKeyDownHandler(A) }.bindAsEventListener(this)); if(this.bar){if(this.bar.ok){this.bar.ok.observe("mousedown",function(A){this.okHandler(A) }.bindAsEventListener(this)); if(Richfaces.browser.isOpera){this.bar.ok.observe("click",Event.stop) }}if(this.bar.cancel){this.bar.cancel.observe("mousedown",function(A){this.cancelHandler(A) }.bindAsEventListener(this)); if(Richfaces.browser.isOpera){this.bar.cancel.observe("click",Event.stop) }}}},initEvents:function(){for(var A in this.events){if(A){this.inplaceInput.observe("rich:"+A,this.events[A]) }}},inplaceMouseOverHandler:function(B){var A=this.inplaceInput.className; if(this.currentState==Richfaces.InplaceInput.STATES[0]){if(A.indexOf(this.classes.component.view.hovered)==-1){A+=" "+this.classes.component.view.hovered }}else{if(this.currentState==Richfaces.InplaceInput.STATES[2]){if(A.indexOf(this.classes.component.changed.hovered)==-1){A+=" "+this.classes.component.changed.hovered }}}this.inplaceInput.className=A },inplaceMouseOutHandler:function(A){if(this.currentState==Richfaces.InplaceInput.STATES[0]){this.inplaceInput.className=this.classes.component.view.normal }else{if(this.currentState==Richfaces.InplaceInput.STATES[2]){this.inplaceInput.className=this.classes.component.changed.normal }}},switchingStatesHandler:function(B){if(this.skipSwitching){this.skipSwitching=false; return }var A=(B.srcElement)?B.srcElement:B.target; if(this.currentState!=Richfaces.InplaceInput.STATES[1]){this.edit() }if(A.id==this.inplaceInput.id){this.skipSwitching=true; this.tempValueKeeper.focus() }},edit:function(){if(Richfaces.invokeEvent(this.events.oneditactivation,this.inplaceInput,"rich:oneditactivation",{oldValue:this.valueKeeper.value,value:this.tempValueKeeper.value})){this.startEditableState(); if(this.events.oneditactivated){this.inplaceInput.fire("rich:oneditactivated",{oldValue:this.valueKeeper.value,value:this.tempValueKeeper.value}) }}},tmpValueBlurHandler:function(A){if(this.skipBlur){this.skipBlur=false; return }if(this.clickOnBar){this.clickOnBar=false; return }if(!this.attributes.showControls){this.save(A) }},tmpValueKeyDownHandler:function(A){switch(A.keyCode){case Event.KEY_ESC:this.cancel(A); if(!this.attributes.showControls){this.skipBlur=true; this.tempValueKeeper.blur() }Event.stop(A); break; case Event.KEY_RETURN:if(this.attributes.showControls){this.okHandler(A) }else{Event.stop(A); this.tempValueKeeper.blur() }break; case Event.KEY_TAB:if(this.attributes.showControls){this.save(A) }break }},okHandler:function(A){this.save(A); Event.stop(A) },cancelHandler:function(A){this.cancel(A); Event.stop(A) },endEditableState:function(){if(this.bar){this.bar.hide() }this.tempValueKeeper.style.clip="rect(0px 0px 0px 0px)"; this.tempValueKeeper.blur() },startEditableState:function(){if(this.currentState==Richfaces.InplaceInput.STATES[1]){return }this.changeState(Richfaces.InplaceInput.STATES[1]); var B=this.inplaceInput.offsetWidth; var A=this.setInputWidth(B); this.tempValueKeeper.style.clip="rect(auto auto auto auto)"; this.inplaceInput.className=this.classes.component.editable; if(this.bar){this.bar.show(A,this.tempValueKeeper.offsetHeight) }if(this.attributes.selectOnEdit){Richfaces.InplaceInput.textboxSelect(this.tempValueKeeper,0,this.tempValueKeeper.value.length) }},startViewState:function(){this.deleteViewArtifacts(); this.changeState(Richfaces.InplaceInput.STATES[0]); this.createNewText(this.currentText); this.inplaceInput.className=this.classes.component.view.normal; this.inplaceInput.observe("mouseover",function(A){this.inplaceMouseOverHandler(A) }.bindAsEventListener(this)) },startChangedState:function(){this.deleteViewArtifacts(); this.changeState(Richfaces.InplaceInput.STATES[2]); this.createNewText(this.currentText); this.inplaceInput.className=this.classes.component.changed.normal },setInputWidth:function(D){if(this.currentState!=1){return }var C=parseInt(this.attributes.inputWidth); if(!C){var A=parseInt(this.attributes.maxInputWidth); var B=parseInt(this.attributes.minInputWidth); if(D>A){C=A }else{if(D= 1.5.0") }$A(document.getElementsByTagName("script")).findAll(function(B){return(B.src&&B.src.match(/ClientUILib\.js(\?.*)?$/)) }).each(function(B){LibraryPath=B.src.replace(/ClientUILib\.js(\?.*)?$/,"") }); if(A){ClientUILogger.create("ClientUILogger"); this.startTime=(new Date()).getTime() }this.initBrowser() },include:function(C){if(!this.packages){this.packages=[] }if(!this.packages[C]){this.packages[C]=true; var A=/\./g; var B=LibraryPath+C.replace(A,"/"); document.write('