//crunchinatorvariable_compressed
var documentLayers=document.all.tags('DIV');var menuLayers=new Array();var activeMenuButton;function fRangesIntersect(a1,a2,b1,b2){if(((a1<b1)&&(b1<a2))||((a1<b2)&&(b2<a2)))return true;else return false;}function fLayerOverObject(oLayer,oObject){fDebugPoint('fLayerOverObject','Checking for '+oLayer.id+' over '+oObject.tagName);var iLX1=fCalcLeft(oLayer);var iLY1=fCalcTop(oLayer);var iLX2=iLX1+oLayer.offestWidth;var iLY2=iLY1+oLayer.offsetHeight;var iOX1=fCalcLeft(oObject);var iOY1=fCalcTop(oObject);var iOX2=iOX1+oObject.offsetWidth;var iOY2=iOY1+oObject.offsetHeight;if(fRangesIntersect(iLX1,iLX2,iOX1,iOX2)&&fRangesIntersect(iLY1,iLY2,iOY1,iOY2))return true;else return false;}function fShowHideMenu(oLayer,sVisibility){fDebugPoint('fShowHideMenu','Setting menu '+oLayer.id+' '+sVisibility);if(sVisibility==null)sVisibility=oLayer.style.getAttribute('visibility')=='visible'?'hidden':'visible';if(sVisibility=='hidden'){for(var i=0;i<oLayer.all.tags('DIV').length;i++)fShowHideMenu(oLayer.all.tags('DIV')[i],'hidden');}if(oLayer.style.getAttribute('visibility')==sVisibility)return;oLayer.style.setAttribute('visibility',sVisibility);for(var i=0;i<document.all.tags('SELECT').length;i++){with(document.all.tags('SELECT')[i]){var sSelectVis=sVisibility!='hidden'?'hidden':'visible';fDebugPoint('fShowHideMenu','Setting select '+name+' '+sSelectVis);style.visibility=sSelectVis;}}}function fRemoveMenu(oMenu){fDebugPoint('fRemoveMenu','Removing '+oMenu.id);var aMenuButtons=document.all.menuButton;var oMenuButton;for(var i=0;i<aMenuButtons.length;i++){if((aMenuButtons[i].attachedMenu)&&(aMenuButtons[i].attachedMenu==oMenu.id)){oMenuButton=aMenuButtons[i];break;}}if(!oMenuButton)return false;oMenu.parentElement.removeChild(oMenu);var oContainerCell=fParentElement(oMenuButton,'TD');oMenuButton.parentElement.removeChild(oMenuButton);if((oContainerCell!=null)&&(oContainerCell.childNodes.length==0))oContainerCell.parentElement.removeChild(oContainerCell);return true;}function fCleanupDividers(iRowIndexDeleted,oParentTable){if(iRowIndexDeleted==0)return 0;if(oParentTable.rows(iRowIndexDeleted-1).getAttribute('ID')=='divider'){if((iRowIndexDeleted>=oParentTable.rows.length)||(oParentTable.rows[iRowIndexDeleted].getAttribute('ID')=='divider')){oParentTable.deleteRow(iRowIndexDeleted-1);return 1;}}return 0;}function fRemoveExpander(oSubMenu){fDebugPoint('fRemoveExpander','Removing '+oSubMenu.id);var aExpanders=document.all.expander;var oExpander;for(var i=0;i<aExpanders.length;i++){if((aExpanders[i].nextTeir)&&(aExpanders[i].nextTeir==oSubMenu.id)){oExpander=aExpanders[i];break;}}if(!oExpander)return false;var oExpanderTable=fParentElement(oExpander,'TABLE');var oExpanderDiv=fParentElement(oExpanderTable,'DIV');var aSubMenus=oExpanderDiv.all.tags('DIV');var iCurrentTop=fCalcTop(oSubMenu);for(var i=0;i<aSubMenus.length;i++){if(aSubMenus[i]==oSubMenu)continue;if(fCalcTop(aSubMenus[i])<iCurrentTop)aSubMenus[i].style.posTop-=oExpander.offsetHeight;}oExpanderDiv.removeChild(oSubMenu);var iExpanderIndex=oExpander.rowIndex;oExpanderTable.deleteRow(iExpanderIndex);fCleanupDividers(iExpanderIndex,oExpanderTable);if(oExpanderTable.rows.length==0)fRemoveMenu(oExpanderDiv);return true;}function fDeactivateElements(aData){fDebugPoint('fDeativateElements','Keeping active elements '+aData.valueOf());for(var i=document.all.menuTable.length-1;i>=0;i--){var oTable=document.all.menuTable[i];if(oTable.tagName!='TABLE')return;for(var j=oTable.rows.length-1;j>=0;j--){if((oTable.rows[j].getAttribute('privilege')==null)||(oTable.rows[j].privilege==''))continue;if(aData.indexOf(oTable.rows[j].privilege)<0){oTable.deleteRow(j);if(fCleanupDividers(j,oTable))j--;if(oTable.rows.length==0){var oSubMenu=fParentElement(oTable,'DIV');if(oSubMenu!=null)fRemoveExpander(oSubMenu);}}}}}function fSetMenuLayers(){fDebugPoint('fSetMenuLayers','setting menu layers');for(i=0;i<documentLayers.length;i++)if(documentLayers[i].id!='oWaitLayer')menuLayers[menuLayers.length]=documentLayers[i];}function fShowNextTeir(oExpander){fDebugPoint('fShowNextTeir','showing submenu '+oExpander.getAttribute('id'));if(oExpander.tagName!='TR')oExpander=fParentElement(oExpander,'TR');var oNextTeir=eval(oExpander.nextTeir);with(oNextTeir.style){posTop=fCalcTop(oExpander,'DIV')-3;posLeft=fCalcLeft(oExpander,'DIV')+oExpander.offsetWidth-4;}fShowHideMenu(oNextTeir,'visible');}function fCheckTeir(oFe,oTe){fDebugPoint('fCheckTeir','Checking tier');var oT=fParentElement(oFe,'TABLE');if((oT==null)||oT.contains(oTe)){if(oFe.tagName!='TR')oFe=fParentElement(oFe,'TR');var oTeirLayer=eval(oFe.nextTeir);fShowHideMenu(oTeirLayer,'hidden');return false;}return true;}function fHideMenu(oTe,oFe){fDebugPoint('fHideMenu','hiding menu '+oFe.id);var oLayer=fParentElement(oFe,'DIV');if(oLayer==null)return;var oToDiv=fParentElement(oTe,'DIV');if(oLayer.className!='menuLayer')return;oTe=fCheckButton(oTe);if(oLayer.contains(oTe))return;fDebugPoint('fHideMenu','checking to element');if(oToDiv==null)return;if(!oToDiv.contains(oLayer))return;fShowHideMenu(oLayer,'hidden');}function fCloseMenu(oObj){var sObjID=oObj.getAttribute('id');if(oObj.getAttribute('id')=='menuButton')return;fHideAllMenus();}function fHideAllMenus(bResetActiveMenuButton){fDebugPoint('fHideAllMenus','hiding all menus');for(i=0;i<menuLayers.length;i++)fShowHideMenu(menuLayers[i],'hidden');if(oForm.activeMenuButton){fAnimateButton(oForm.activeMenuButton,'inert');if(bResetActiveMenuButton)oForm.activeMenuButton.id='menuButton';}}function fHideActiveMenu(bResetActiveMenuButton){fDebugPoint('fHideActiveMenu','Reset Active Menu Button='+bResetActiveMenuButton);if(!oForm.activeMenuButton)return false;fDebugPoint('fHideActiveMenu','Resetting menu '+oForm.activeMenuButton.attachedMenu);var oLayer=eval(oForm.activeMenuButton.attachedMenu);fShowHideMenu(oLayer,'hidden');fAnimateButton(oForm.activeMenuButton,'inert');if(bResetActiveMenuButton)oForm.activeMenuButton.id='menuButton';}function fMenuButtonOver(oButton){fDebugPoint('fMenuButtonOver','Cursor moved to button '+oButton.getAttribute('name'));if(oButton.tagName!='BUTTON')oButton=fParentElement(oButton,'BUTTON');if((oButton==null)||(!oButton.attachedMenu)||(oButton.attachedMenu==''))return;var oLayer=eval(oButton.attachedMenu);if((oForm.activeMenuButton)&&(oButton.menuGroup)&&(oForm.activeMenuButton.menuGroup)&&(oButton.menuGroup==oForm.activeMenuButton.menuGroup)){fHideActiveMenu(false);fAnimateButton(oForm.activeMenuButton,'inert');oForm.activeMenuButton.id='menuButton';fAnimateButton(oButton,'activeMenu');with(oLayer.style){setAttribute('top',fCalcTop(oButton)+oButton.offsetHeight-1);setAttribute('left',fCalcLeft(oButton));}fShowHideMenu(oLayer,'visible');oButton.id='activeMenuButton';}else fAnimateButton(oButton,'over');}function fMenuButtonClick(oButton){fDebugPoint('fMenuButtonClick',oButton.getAttribute('name')+' clicked');window.event.cancelBubble=true;fHideActiveMenu(true);if((!oButton.attachedMenu)||(oButton.attachedMenu==''))return;var oLayer=eval(oButton.attachedMenu);if(oButton.id=='activeMenuButton'){fShowHideMenu(oLayer,'hidden');oButton.id='menuButton';fAnimateButton(oButton,'inert');}else{with(oLayer.style){setAttribute('top',fCalcTop(oButton)+oButton.offsetHeight-1);setAttribute('left',fCalcLeft(oButton));}if((document.selection)&&(document.selection.type=='control')){var oRange=document.selection.createControlRange();for(var i=0;i<oRange.length;i++)oRange.remove(i);}fShowHideMenu(oLayer,'visible');oButton.id='activeMenuButton';fAnimateButton(oButton,'activeMenu');}}function fActiveMenuButtonOut(oEvent){var oButton=fFindButton(oEvent.srcElement);fDebugPoint('fActiveMenuButtonOut','Cursor moved from active menu button '+oButton.getAttribute('name'));if((oButton==null)||(!oButton.attachedMenu)||(oButton.attachedMenu==''))return;var oTe=fCheckButton(oEvent.toElement);var oLayer=eval(oButton.attachedMenu);if(oTe==null){fShowHideMenu(oLayer,'visibile');return;}if((oLayer.contains(oTe))||(oTe==oForm.activeMenuButton))return;if((oTe.id=='menuButton')&&(oTe.menuGroup)&&(oButton.menuGroup)&&(oTe.menuGroup==oButton.menuGroup))return;fShowHideMenu(oLayer,'hidden');oButton.id='menuButton';fAnimateButton(oButton,'inert');}function fUnHighlightCell(oFe,bActive){fDebugPoint('fUnHighlightCell','Unhighlighting cell '+oFe.id+' active is '+bActive);var oC=fParentElement(oFe,'TD');var oR=fParentElement(oC,'TR');if((oR.id)&&(oR.id=='divider'))return;var oT=fParentElement(oR,'TABLE');if((!oT.id)||(oT.id==null))return;with(oR){if(cells.length==1)cells[0].className='inertTable';else{cells[0].className='inertTableLeft';cells[1].className='inertTableRight';}if((id)&&(id=='expander'))fShowHideMenu(eval(nextTeir),'hidden');}}function fHighlightCell(oEvent,bActive){fDebugPoint('fHighlightCell','Highlighting menu item');oEvent.cancelBubble=true;var oE=oEvent.srcElement;fDebugPoint('fHighlightCell','Highlighting cell '+oE.id+' active is '+bActive);if(oE.tagName=='TABLE')return;var oC=fParentElement(oE,'TD');var oT=fParentElement(oC,'TABLE');if((!oT.id)||(oT.id==null))return;for(var i=0;i<oT.rows.length;i++){if(oT.rows[i].contains(oE))continue;with(oT.rows[i]){if((id)&&(id=='divider'))continue;if(cells.length==1){cells[0].className='inertTable';continue;}if(cells[0].className!='inertTableLeft'){cells[0].className='inertTableLeft';if((id)&&(id=='expander'))fShowHideMenu(eval(nextTeir),'hidden');}with(cells[1])if(className!='inertTableRight')className='inertTableRight';}}var oR=fParentElement(oC,'TR');if((oR.disabled)&&(oR.disabled==true))return;if(bActive)with(oR){if(cells.length==1)cells[0].className='over';else{oR.cells[0].className='overLeft';oR.cells[1].className='overRight';}}}function fActionIt(oEvent){fDebugPoint('fActionIt','starting action');var oEventSrc=oEvent.srcElement;var oRow=fParentElement(oEventSrc,'TR');if((oRow==null)||(!oRow.action)||(oRow.action==''))return;fDebugPoint('fActionIt','Actioning function '+oRow.getAttribute('action'));if((oRow.disabled)&&(oRow.disabled==true))return;eval(oRow.action);}function fToggleLabel(sOptionA,sOptionB,oRow){fDebugPoint('fToggleLabel',sOptionA+' '+sOptionB+' '+oRow.id);var oReA=new RegExp();var oReB=new RegExp();oReA.compile(sOptionA,'g');oReB.compile(sOptionB,'g');for(var i=0;i<oRow.cells.length;i++){var oCell=oRow.cells[i];if(oCell.innerHTML.search(oReA)>-1)oCell.innerHTML=oCell.innerHTML.replace(oReA,sOptionB);else oCell.innerHTML=oCell.innerHTML.replace(oReB,sOptionA);}}function fSetMenuMarkers(oRange){fDebugPoint('fSetMenuButtons','setting menu markers');var aAllMenuMarkers=new Array();if(document.all.menuMarker)aAllMenuMarkers.addStuff(document.all.menuMarker);if(aAllMenuMarkers.length==0)return;for(var i=0;i<aAllMenuMarkers.length;i++){if(aAllMenuMarkers[i]==null)continue;if(aAllMenuMarkers[i].formatTag){if(oRange.queryCommandState(aAllMenuMarkers[i].formatTag)){aAllMenuMarkers[i].style.visibility='inherit';}else{aAllMenuMarkers[i].style.visibility='hidden';}}}}fRegister('menus.js v. 2803031359');
