// Licensed Materials - Property of IBM // IBM Cognos Products: hal // (C) Copyright IBM Corp. 2003, 2017. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. function C_OrgTreeView(_h4C1, _hXP1, _hLN1){this._hKE2=document;this._hFI1=G_HAL.M_sImagePath;this._hXN1=_hLN1?_hLN1:null;this._hK91=window["G_ResManager"]?G_ResManager:null;this._h5C1=_h4C1;this._h5C1._hYP1=this;this._hZP1=_hXP1;this._hER=( _hXP1.getAttribute( "multiSelect" )=="true" );this._hQN=( _hXP1.getAttribute( "forceSelection" )=="true" );this._hRJ=1;this._h6C1=this._hKE2.createElement("IMG");this._h6C1.style.verticalAlign="middle";this._h7O=this._h6C1.cloneNode(true);var _hT91=this._hZP1.getAttribute("iconHeight");if(!_hT91){_hT91=this._hZP1.getAttribute("smallIconHeight");}this._h7C1=_hT91?parseInt(_hT91):32;var _hXG1=this._hZP1.getAttribute("iconWidth");if(!_hXG1){_hXG1=this._hZP1.getAttribute("smallIconWidth");}this._hCJ1=_hXG1?parseInt(_hXG1):32;this._h7O.style.height=_hT91?_hT91:"32px";this._h7O.style.width=_hXG1?_hXG1:"32px";this.F_Draw();this._hLB();this._h051=this._hKE2.getElementById("idOrgTreeViewDropCaret");this._h6E=this._hKE2.getElementById("idOrgTreeViewDropCaretInside");};C_OrgTreeView.prototype._hLB=function(){this._h5C1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerover":"onmouseover"] =function(e){ this._hYP1._hO91(e); };this._h5C1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerout":"onmouseout"] =function(e){ this._hYP1._hRG1(e); };this._h5C1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerdown":"onmousedown"] =function(e){ this._hYP1._hP91(e); };this._h5C1.ondblclick=function(e){ this._hYP1._hDJ1(e); };};C_OrgTreeView.prototype.F_Detach=function(){this._h5C1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerover":"onmouseover"]=null;this._h5C1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerout":"onmouseout"]=null;this._h5C1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerdown":"onmousedown"]=null;this._h5C1.ondblclick=null;this._h5C1.innerHTML="";this._h5C1._hYP1=null;};C_OrgTreeView.prototype.F_GetId=function(){return this._h5C1.id;};C_OrgTreeView.prototype.F_GetContainer=function(){return this._h5C1;};C_OrgTreeView.prototype.F_GetTreeViewNode=function(){return this._hZP1;};C_OrgTreeView.prototype.F_GetSelectedNode=function(){return this._hZP1.selectSingleNode(".//treeNode[@selected='true']");};C_OrgTreeView.prototype._hO=function(n1,n2){var i1=parseInt(n1.getAttribute("selectedCounter"));var i2=parseInt(n2.getAttribute("selectedCounter"));return(i1>i2)?1:((i10){_hPP1._hQP1=G_DragDrop.eLocationBefore;}else{_hPP1._hQP1=G_DragDrop.eLocationAfter;}if(Math.abs(_hI62)<8){_hPP1._h212=true;}}return _hPP1;};C_OrgTreeView.prototype.F_HitTest=function(x,y){var el=this._hKE2.elementFromPoint(x, y);if(el){if(this._h5C1.contains(el)){if(el._h8C1){return el.nNode;}if(el._hG12||el._h0W1){return el.parentNode.nNode;}}}return null;};C_OrgTreeView.prototype.F_Draw=function(){this._h9O=this._hZP1.getAttribute("arrowDirection");this._hK51(this._hZP1);};C_OrgTreeView.prototype.F_DrawNode=function(_h0Q1){};C_OrgTreeView.prototype._hK51=function(_h0Q1){var nl=_h0Q1.selectNodes("treeNode");var _hBZ1=nl.length;var _h512=_h0Q1.getAttribute("htmlId");if(_h0Q1.nodeName=="treeView"){this._h5C1.innerHTML='
';var tbl=this._h5C1.firstChild;for(var i=0;i<_hBZ1;i++){var tr1=tbl.insertRow(0);var tr0=tbl.insertRow(0);tr0.appendChild(this._hKE2.createElement("TD"));tr1.appendChild( this._hKE2.createElement( "TD" ) ).style.height = "100%";}U_XML.F_RemoveAttribute( _h0Q1, ".//treeNode", "htmlId" );}for(var i=0;i<_hBZ1;i++){this._h2W1(_h0Q1, nl.item(i), i);}};C_OrgTreeView.prototype.F_ShowMessage=function(_hBC2){C_OrgTreeView.F_ShowMessage(this._h5C1, _hBC2);};C_OrgTreeView.F_ShowMessage=function(_h4C1,_hBC2){_h4C1.innerHTML=G_HAL.M_oLibraries["hal"]["enableAccessibility"] ?'
' + _hBC2.F_HTMLEncode() + '
':'
' + _hBC2.F_HTMLEncode() + '
';};C_OrgTreeView.prototype._h2W1=function(_hH12,_h0Q1,_h5D2){var _hAO=_h0Q1.getAttribute("arrowDirection");if(!_hAO){_hAO=this._h9O;}var nl=_h0Q1.selectNodes("treeNode");var _hBZ1=nl.length;var _h0O1=( _h0Q1.getAttribute( "selected" )=="true" );var _hBO=_hH12?_hH12.getAttribute( "htmlId" ):"";var _hFZ=_hBO?this._hKE2.getElementById(_hBO):this._h5C1.firstChild.rows.item(_h5D2).cells.item(0);if(_hBO){var cells=_hFZ.parentNode.parentNode.parentNode.parentNode.rows.item(_h5D2).cells;_hFZ=cells.item(cells.length-1);}var tbl=_hFZ.appendChild(this._hKE2.createElement("TABLE"));tbl.cellPadding=0;tbl.cellSpacing=0;tbl.className="clsDialogText";tbl.style.height="100%";tbl.style.borderCollapse="collapse";U_Accessibility.F_SetRoleForLayoutTable(tbl);var _hN62=tbl.appendChild(this._hKE2.createElement("TBODY"));var tr=_hN62.appendChild(this._hKE2.createElement("TR"));tr.style.verticalAlign="middle";var td=tr.appendChild(this._hKE2.createElement("TD"));td._h8O=true;td.className="clsOrgTreeNode";if(_hBZ1>1){td.rowSpan=_hBZ1;}var _hX92=td.appendChild(this._hKE2.createElement("DIV"));_hX92._h8C1=true;_hX92.nNode=_h0Q1;_h0Q1.setAttribute("htmlId", _hX92.uniqueID);_hX92.className=_h0O1?"clsOrgTreeNode_selected":"clsOrgTreeNode_normal";var img=_hX92.appendChild(this._h7O.cloneNode(true));img._hG12=true;var _hGZ=_h0Q1.getAttribute("expandedIcon");if(!_hGZ){_hGZ=_h0Q1.getAttribute("expandedSmallIcon");}if(_hGZ){img.src=G_HAL.F_GetImageURL(_hGZ);}else{var _h292=_h0Q1.getAttribute("icon");if(!_h292){_h292=_h0Q1.getAttribute("smallIcon");}if(_h292){img.src=G_HAL.F_GetImageURL(_h292);}}var _h052;var _hEU1=_h0Q1.getAttribute("idsLabel");if(_hEU1){G_HAL.F_VerifyDependencies("G_ResManager");_h052=this._hK91.F_GetString(_hEU1);}else{_h052=_h0Q1.getAttribute("label");}if(_h052){_hX92.appendChild(this._hKE2.createElement("BR"));var _hH62=_hX92.appendChild(this._hKE2.createElement("SPAN"));_hH62._h0W1=true;_hH62.style.verticalAlign="middle";_hH62.innerText=_h052;}var _hBG1=_h0Q1.getAttribute("idsTooltip");if(_hBG1){G_HAL.F_VerifyDependencies("G_ResManager");_hX92.title=this._hK91.F_GetString(_hBG1);}else{var _h3U1=_h0Q1.getAttribute("tooltip");if(_h3U1){_hX92.title=_h3U1;}}if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){tbl.setAttribute( "role", "presentation" );_hX92.setAttribute( "role", "gridcell" );_hX92.setAttribute( "tabIndex", "0" );if(!_hX92.title&&_h052){_hX92.setAttribute("aria-label", _h052);}U_Accessibility.F_SetAriaStateAndProperty(_hX92, "aria-selected", _h0O1);img.alt=(_hX92.title?_hX92.title:_h052)||"";}var td=tr.appendChild(this._hKE2.createElement("TD"));td._h1W1=true;if(_hBZ1>1){td.rowSpan=_hBZ1;}var img=td.appendChild(this._h6C1.cloneNode(true));img._h9C1=true;img.className="clsOrgTreeNodeArrow";var _h6D2;switch(_hAO){case "up":_h6D2="tv_org_arrow_left.gif";break;case "down":_h6D2=(_hBZ1==1)?"tv_org_arrow_right.gif":"tv_org_arrow_no_head.gif";break;case "upAndDown":_h6D2=(_hBZ1==1)?"tv_org_arrow_left_and_right.gif":"tv_org_arrow_left.gif";break;case "none":default:_h6D2="tv_org_arrow_no_head.gif";break;}img.src=this._hFI1+_h6D2;if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){img.alt=_hAO||"";}if(_hBZ1==0){img.style.visibility="hidden";}if(_hBZ1==1){tr.appendChild(this._hKE2.createElement("TD"));}else{for(var i=0;i<_hBZ1;i++){if(i>0){tr=_hN62.appendChild(this._hKE2.createElement("TR"));}var td1=tr.appendChild(this._hKE2.createElement("TD"));td1.style.height="100%";var _h3W1=td1.appendChild(this._hKE2.createElement("TABLE"));_h3W1.cellPadding=0;_h3W1.cellSpacing=0;_h3W1.className="clsOrgTreeNodeLines";U_Accessibility.F_SetRoleForLayoutTable(_h3W1);var _hAC1=_h3W1.appendChild(this._hKE2.createElement("TBODY"));var _hI12=_hAC1.appendChild(this._hKE2.createElement("TR"));var _hJ12=_hI12.appendChild(this._hKE2.createElement("TD"));_hJ12.className="clsOrgTreeNodeLine";_hJ12.innerText=" ";if ((_hAO=="down" )||( _hAO=="upAndDown" ) ){_hJ12.style.textAlign="right";_hJ12.style.verticalAlign="bottom";var img=_hJ12.appendChild(this._h6C1.cloneNode(true));img.className="clsOrgTreeNodeArrowHeadRight";img.src=this._hFI1+"tv_org_arrow_head_right.gif";img.style.position="relative";img.style.top=G_BrowserInfo.M_bIsIE?"10px":( G_BrowserInfo.M_bIsWebKit?"5px":"8px" );if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){img.alt=_hAO||"";}}var _hK12=_hAC1.appendChild(this._hKE2.createElement("TR"));var _hL12=_hK12.appendChild(this._hKE2.createElement("TD"));_hL12.className="clsOrgTreeNodeLine";_hL12.innerText=" ";if(i==(_hBZ1-1)){_hJ12.style.borderTop="none";_hL12.style.borderLeft="1px solid transparent";_hL12.style.borderBottom="none";}else if(i==0){_hJ12.style.borderLeft="1px solid transparent";_hJ12.style.borderTop="none";_hL12.style.borderBottom="none";}else{_hJ12.style.borderTop="none";_hL12.style.borderBottom="none";}var td2=tr.appendChild(this._hKE2.createElement("TD"));}}for(var i=0;i<_hBZ1;i++){this._h2W1(_h0Q1, nl.item(i), i);}};C_OrgTreeView.prototype.F_SelectNode=function(_h0Q1,_hLC2,_hF31){if(_h0Q1){var _h512=_h0Q1.getAttribute("htmlId");this._hFJ1(_h0Q1, _h512?this._hKE2.getElementById(_h512):null, false, _hLC2, _hF31);}};C_OrgTreeView.prototype._hFJ1=function(_h0Q1,_hF12,_h4W1,_hLC2,_hF31){if(_h4W1||_hLC2){if(!this._hER){this.F_ClearSelections();}this._hL91( _h0Q1, _hLC2||( _h0Q1.getAttribute( "selected" ) != "true" ) );}else{if(_h0Q1.getAttribute( "selected" )=="true" ){if(!this._hER&&!this._hQN){return;}}this.F_ClearSelections();this._hL91(_h0Q1, true);}_hF12.className="clsOrgTreeNode_selected";if(_hF31!=false){this._hCO(_h0Q1, NaN);}};C_OrgTreeView.prototype._hCO=function(_h0Q1,_hQ31){if(this._hXN1&&this._hXN1.F_TreeView_OnNodeClick){this._hXN1.F_TreeView_OnNodeClick(this, _h0Q1, _hQ31);}};C_OrgTreeView.prototype._hL91=function(_h0Q1,b){if(b){_h0Q1.setAttribute( "selected", "true" );_h0Q1.setAttribute("selectedCounter", this._hRJ++);}else{_h0Q1.removeAttribute("selected");_h0Q1.removeAttribute("selectedCounter");}if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){var _hX92=this._hKE2.getElementById(_h0Q1.getAttribute("htmlId"));U_Accessibility.F_SetAriaStateAndProperty(_hX92, "aria-selected", b);}};C_OrgTreeView.prototype.F_EnsureVisible=function(_h0Q1,_hP){var _hF12=this._hKE2.getElementById(_h0Q1.getAttribute("htmlId"));var _hK7=_hP?_hP:this._h5C1;var _hHZ=0;var _hHT=0;for(var el=_hF12;el;el=el.offsetParent){if(el==_hK7){_hHZ+= parseInt(el.currentStyle.paddingTop);_hHT+= parseInt(el.currentStyle.paddingLeft);break;}else{_hHZ+= el.offsetTop;_hHT+= el.offsetLeft;}}var _hDO=45;if((_hHZ-_hDO)<_hK7.scrollTop){_hK7.scrollTop=_hHZ-_hDO;}else if((_hHZ+this._h7C1 + _hDO)>(_hK7.scrollTop+_hK7.offsetHeight)){_hK7.scrollTop=_hHZ+this._h7C1+_hDO-_hK7.offsetHeight-parseInt(_hK7.currentStyle.paddingBottom);}var _hSG=60;if((_hHT-_hSG)<_hK7.scrollLeft){_hK7.scrollLeft=_hHT-_hSG;}else if((_hHT+this._hCJ1 + _hSG)>(_hK7.scrollLeft+_hK7.offsetWidth)){_hK7.scrollLeft=_hHT+this._hCJ1+_hSG-_hK7.offsetWidth-parseInt(_hK7.currentStyle.paddingRight);}};C_OrgTreeView.prototype.F_ClearSelections=function(_hNB1){this._hL7(this._hZP1, _hNB1);this._hRJ=1;};C_OrgTreeView.prototype._hL7=function(_hIZ,_hNB1){var nl=_hIZ.selectNodes(".//treeNode[@selected='true']");var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){var _h0Q1=nl.item(i);this._hL91(_h0Q1, false);if(_hNB1!=false){var _h512=_h0Q1.getAttribute("htmlId");if(_h512){this._hKE2.getElementById(_h512).className="clsOrgTreeNode_normal";}}}return _hBZ1;};C_OrgTreeView._hUJ=function(e){if(C_OrgTreeView.s_oMouseUpTreeView){C_OrgTreeView.s_oMouseUpTreeView._h59(e);}G_CaptureManager.F_StopCapture();};C_OrgTreeView._hA7=function(e){e.stopPropagation();if(C_OrgTreeView.s_aPotentialDragNodes){if(G_DragDrop.F_ExceedsDragSize(C_OrgTreeView.s_iPotentialDragNodeX-e.clientX, C_OrgTreeView.s_iPotentialDragNodeY-e.clientY)){var _hYP1=C_OrgTreeView.s_oDragTreeView;if(_hYP1&&_hYP1._hXN1.F_TreeView_OnDragStart){_hYP1._hXN1.F_TreeView_OnDragStart(_hYP1, C_OrgTreeView.s_aPotentialDragNodes, _hYP1._hVJ);}C_OrgTreeView.s_oDragTreeView=null;C_OrgTreeView.s_aPotentialDragNodes=null;}}};C_OrgTreeView.prototype._hP91=function(e){if(G_HAL.M_oTestListener&&G_HAL.M_oTestListener.F_TestListener_TreeViewOnMouseDown){G_HAL.M_oTestListener.F_TestListener_TreeViewOnMouseDown(e, this);}if(G_BrowserInfo.M_bIsIE&&(e.target.componentFromPoint(e.clientX, e.clientY).indexOf("outside")!=-1)){e.stopPropagation();return;}if(this._hEO){return;}var _h692=e.target;if(_h692._h8C1){_h692=_h692.firstChild;}if(_h692._hG12||_h692._h0W1){var nNode=_h692.parentNode.nNode;var _h0O1=( nNode.getAttribute( "selected" )=="true" );if(this._hER&&e.shiftKey){var a=this.F_GetSelectedNodes();this.F_ClearSelections();this._hOB(a[0], nNode);this._hL91(nNode, true);}else if(_h0O1){if(this._hER){C_OrgTreeView.s_oMouseUpTreeView=this;this._hB9=_h692.parentNode;}}else{if(e.ctrlKey){if(!this._hER){this.F_ClearSelections();}this._hL91(nNode, !_h0O1);}else{this.F_ClearSelections();this._hL91(nNode, true);}this._hCO(nNode, e.button);}this._hGJ1(_h692.parentNode, nNode);C_OrgTreeView.s_aPotentialDragNodes=this.F_GetSelectedNodes();var _hMP1={};_hMP1[G_BrowserInfo.M_bIsPointerEnabled?"onpointerup":"onmouseup"]=C_OrgTreeView._hUJ.bind(C_OrgTreeView);_hMP1["onStopCapture"]=C_OrgTreeView._hSY.bind(C_OrgTreeView);if(window["G_DragDrop"]){_hMP1[G_BrowserInfo.M_bIsPointerEnabled?"onpointermove":"onmousemove"]=C_OrgTreeView._hA7.bind(C_OrgTreeView);}G_CaptureManager.F_StartCapture(_hMP1);this._hVJ=e.button;C_OrgTreeView.s_oDragTreeView=this;C_OrgTreeView.s_iPotentialDragNodeX=e.clientX;C_OrgTreeView.s_iPotentialDragNodeY=e.clientY;}else{this.F_ClearSelections();this._hCO(null, e.button);}};C_OrgTreeView.prototype.F_UpdateNode=function(_h0Q1){var _h512=_h0Q1.getAttribute("htmlId");if(_h512){this._hGJ1(this._hKE2.getElementById(_h512), _h0Q1);}};C_OrgTreeView.prototype._hGJ1=function(_hF12,_h0Q1){_hF12.className=( _h0Q1.getAttribute( "selected" )=="true" )?"clsOrgTreeNode_selected":"clsOrgTreeNode_normal";};C_OrgTreeView._hSY=function(){C_OrgTreeView._hT3();C_OrgTreeView.s_aPotentialDragNodes=null;C_OrgTreeView.s_oDragTreeView=null;};C_OrgTreeView._hT3=function(){if(C_OrgTreeView.s_oMouseUpTreeView){C_OrgTreeView.s_oMouseUpTreeView._hB9=null;C_OrgTreeView.s_oMouseUpTreeView=null;}};C_OrgTreeView.prototype._h59=function(e){var nNode=this._hB9.nNode;if(e.ctrlKey){this._hL91( nNode, nNode.getAttribute( "selected" ) != "true" );}else{if(e.button==U_DOM.K_iLeftMouseButton){this.F_ClearSelections();this._hL91(nNode, true);}}this._hCO(nNode, e.button);this._hGJ1(this._hB9, nNode);};C_OrgTreeView.prototype._hOB=function(_hJZ,_hBC1){if(!_hJZ||!_hBC1||(_hJZ.parentNode!=_hBC1.parentNode)){return;}for(var n=_hJZ; n; n=U_XML.F_GetNextSiblingElement(n)){if(n==_hBC1){for(var n=_hJZ; n; n=U_XML.F_GetNextSiblingElement(n)){this._hL91(n, true);this.F_UpdateNode(n);this._hCO(n, NaN);if(n==_hBC1){return;}}}}for(var n=_hJZ; n; n=U_XML.F_GetPreviousSiblingElement(n)){if(n==_hBC1){for(var n=_hJZ; n; n=U_XML.F_GetPreviousSiblingElement(n)){this._hL91(n, true);this.F_UpdateNode(n);this._hCO(n, NaN);if(n==_hBC1){return;}}}}};C_OrgTreeView.prototype._hDJ1=function(e){if(G_HAL.M_oTestListener&&G_HAL.M_oTestListener.F_TestListener_TreeViewOnDblClick){G_HAL.M_oTestListener.F_TestListener_TreeViewOnDblClick(e, this);}var _h692=e.target;if(_h692._h8C1){_h692=_h692.firstChild;}if(_h692._hG12||_h692._h0W1){if(this._hXN1&&this._hXN1.F_TreeView_OnNodeDblClick){setTimeout(this._hXN1.F_TreeView_OnNodeDblClick.bind(this._hXN1, this, _h692.parentNode.nNode), 0);}}};C_OrgTreeView.prototype._hO91=function(e){var _h692=e.target;if(_h692._h8C1){_h692=_h692.firstChild;}if(_h692._hG12||_h692._h0W1){var _hF12=_h692.parentNode;_hF12.className=( _hF12.nNode.getAttribute( "selected" )=="true" )?"clsOrgTreeNode_selected":"clsOrgTreeNode_hover";}};C_OrgTreeView.prototype._hRG1=function(e){var _h692=e.target;if(_h692._h8C1){_h692=_h692.firstChild;}if(_h692._hG12||_h692._h0W1){var _hF12=_h692.parentNode;_hF12.className=( _hF12.nNode.getAttribute( "selected" )=="true" )?"clsOrgTreeNode_selected":"clsOrgTreeNode_normal";}};C_OrgTreeView.F_GetCaretsHtml=function(){return('' +'' );};