//NEW SCRIPT var g_degLayerCount = 0; function degLayer( sName) { this.name = sName; this.divName = sName; this.buffer = ''; this.objLayer = null; this.objEventLayer = null; this.isFirstGen = true; //flag to indicate is the contents are being generated for the first time this.width = 0; this.height = 0; this.parentObject = null; //methods this.clearBuffer = degLayerClearBuffer; this.appendBuffer = degLayerAppendBuffer; this.flushBuffer = degLayerFlushBuffer; this.replaceContent = degLayerReplaceContent; this.genLayer = degLayerGen; this.bodyOnLoad = degLayerBodyOnLoad; this.show = degLayerShow; this.hide = degLayerHide; this.moveTo = degLayerMoveTo; this.moveBy = degLayerMoveBy; this.scrollTo = degLayerScrollTo; this.scrollBy = degLayerScrollBy; this.clip = degLayerClip; //property - get this.getVisibility = degLayerVisibility; this.getOffsetLeft = degLayerGetOffsetLeft; this.getOffsetTop = degLayerGetOffsetTop; this.getLeft = degLayerGetLeft; this.getTop = degLayerGetTop; this.getWidth = degLayerGetWidth; this.getHeight = degLayerGetHeight; this.getRight = degLayerGetRight; this.getBottom = degLayerGetBottom; this.getZIndex = degLayerGetZIndex; this.getClipLeft = degLayerGetClipLeft; this.getClipTop = degLayerGetClipTop; this.getClipRight = degLayerGetClipRight; this.getClipBottom = degLayerGetClipBottom; this.getClipWidth = degLayerGetClipWidth; this.getClipHeight = degLayerGetClipHeight; //property - set this.setClipHeight = degLayerSetClipHeight; this.setClipWidth = degLayerSetClipWidth; this.setZIndex = degLayerSetZIndex; this.setBgColor = degLayerSetBgColor; this.setBgImage = degLayerSetBgImage; this.onMouseOver = degLayerSetOnMouseOver; this.onMouseOut = degLayerSetOnMouseOut; this.onClick = degLayerSetOnClick; g_degLayerCount++; return 0; } //-------------------- //Methods //-------------------- function degLayerClearBuffer() { this.buffer = ''; return 0; } function degLayerAppendBuffer( sContent) { this.buffer += sContent; return 0; } function degLayerFlushBuffer() { if (isN4) { var oDoc = this.objLayer.document; oDoc.open( "text/html"); oDoc.write( this.buffer); oDoc.close(); } if (isIE) { this.objLayer.innerHTML = this.buffer; } return 0; } function degLayerReplaceContent( sContent) { this.clearBuffer(); this.appendBuffer( sContent); this.flushBuffer(); return 0; } function degLayerGen() { var sAttrib, sScope; var sCache; if (degLayerGen.arguments.length == 0) { sScope = 'all'; } else { sScope = degLayerGen.arguments[ 0].toLowerCase(); } if ((sScope == 'all') || (sScope == 'body')) { if (isN4) { sAttrib = ""; if (this.width > 0) { sAttrib += ' width="' + this.width + '"'; } if (this.height > 0) { sAttrib += ' height="' + this.height + '"'; } document.writeln( ''); sCache = ''; } if (isIE) { sAttrib = 'style="position:absolute;visibility:hidden;'; if (this.width > 0) { sAttrib += 'width:' + this.width + ';'; } if (this.height > 0) { sAttrib += 'height:' + this.height + ';'; } sAttrib += '"'; document.writeln( '
'); sCache = '
\n'; } } if ((sScope == 'all') || (sScope == 'body')) { document.writeln( this.buffer); sCache = sCache + this.buffer + '\n'; } if ((sScope == 'all') || (sScope == 'close')) { if (isN4) { document.writeln( ''); sCache = sCache + '\n'; } if (isIE) { document.writeln( '
'); sCache = sCache + '
\n'; } } //alert( sCache); return 0; } function degLayerBodyOnLoad() { //document.all( "txtJunk").value = document.body.innerHTML; if (isN4) { this.objLayer = document.layers[ this.divName]; } if (isIE) { this.objLayer = document.all[ this.divName]; // alert( 'tagName: ' + document.all[ this.divName].tagName); } return 0; } function degLayerShow() { if (isN4) { this.objLayer.visibility = "show"; if (this.objEventLayer != null) { this.objEventLayer.show() } } if (isIE) { this.objLayer.style.visibility = "visible"; } return 0; } function degLayerHide() { if (isN4) { this.objLayer.visibility = "hide"; if (this.objEventLayer != null) { this.objEventLayer.hide(); } } if (isIE) { this.objLayer.style.visibility = "hidden"; } return 0; } function degLayerMoveTo( pageX, pageY) { var oLayer = this.objLayer; //alert( this.name + '=(' + pageX + ',' + pageY + ')'); if (isN4) { oLayer.left = pageX; oLayer.top = pageY; if (this.objEventLayer != null) { this.objEventLayer.moveTo( pageX, pageY); } } if (isIE) { //alert( this.objLayer); oLayer.style.left = pageX; oLayer.style.top = pageY; } return 0; } function degLayerMoveBy( cx, cy) { var oLayer = this.objLayer; if (isN4) { oLayer.left += cx; oLayer.top += cy; if (this.objEventLayer != null) { this.objEventLayer.moveBy( cx, cy); } } if (isIE) { oLayer.style.pixelLeft += cx; oLayer.style.pixelTop += cy; } return 0; } function degLayerClip( clipLeft, clipTop, clipRight, clipBottom) { var oLayer = this.objLayer; if (isN4) { oLayer.clip.left = clipLeft; oLayer.clip.top = clipTop; oLayer.clip.right = clipRight; oLayer.clip.bottom = clipBottom; if (this.objEventLayer != null) { this.objEventLayer.clip( clipLeft, clipTop, clipRight, clipBottom); } } if (isIE) { oLayer.style.clip = 'rect(' + clipTop + ' ' + clipRight + ' ' + clipBottom + ' ' + clipLeft +')'; } } function degLayerScrollTo( toX, toY, isBound) { var cx = this.getClipLeft() - toX; var cy = this.getClipTop() - toY; this.scrollBy( -cx, -cy, isBound); } function degLayerScrollBy(cx, cy, isBound) { var clipLeft = this.getClipLeft(); var clipTop = this.getClipTop(); var clipRight = this.getClipRight(); var clipBottom = this.getClipBottom(); if (isBound) { if (clipLeft + cx < 0) cx = -clipLeft; else if (clipRight + cx > oLayer.getWidth()) cx = oLayer.getWidth() - cr; if (clipTop + cy < 0) cy = -clipTop; else if (clipBottom + cy > oLayer.getHeight()) cy = oLayer.getHeight() - clipBottom; } oLayer.clipLayer( clipLeft + cx, clipTop + cy, clipRight + cx, clipBottom + cy); oLayer.moveBy( -cx, -cy); } //-------------------- //Property - Get //-------------------- function degLayerGetLayer(name) { if (isN4) { return( document.layers[ name]); } if (isIE) { return( eval('document.all.' + name)); } return null; } function degLayerVisibility() { var oLayer = this.objLayer; if (isN4) { if (oLayer.visibility == "show") { return( "visible") } else if (oLayer.visibility == "hide") { return( "hidden") } else { return( oLayer.visibility); } } if (isIE) { return( oLayer.style.visibility); } return( "unknown"); } function degLayerGetOffsetLeft() { var oLayer = this.objLayer; if (isN4) { return( oLayer.left); } if (isIE) { return( oLayer.style.pixelLeft); } return -1; } function degLayerGetOffsetTop() { var oLayer = this.objLayer; if (isMinNS4) { return( oLayer.top); } if (isMinIE4) { return( oLayer.style.pixelTop); } return -1; } function degLayerGetLeft() { var iLeft; var oLayer = this.objLayer; if (isN4) { return( oLayer.pageX); } if (isIE) { iLeft = 0; while (oLayer.offsetParent != null) { iLeft += oLayer.offsetLeft; oLayer = oLayer.offsetParent; } iLeft += oLayer.offsetLeft; return( iLeft); } return -1; } function degLayerGetTop() { var iTop; var oLayer = this.objLayer; if (isN4) { return( oLayer.pageY); } if (isIE) { iTop = 0; while (oLayer.offsetParent != null) { iTop += oLayer.offsetTop; oLayer = oLayer.offsetParent; } iTop += oLayer.offsetTop; return( iTop); } return -1; } function degLayerGetWidth() { var oLayer = this.objLayer; if (isN4) { if (oLayer.document.width) { return( oLayer.document.width); } else { return( oLayer.clip.right - oLayer.clip.left); } } if (isIE) { if (oLayer.style.pixelWidth) { return( oLayer.style.pixelWidth); } else { return( oLayer.clientWidth); } } return -1; } function degLayerGetHeight() { var oLayer = this.objLayer; if (isN4) { if (oLayer.document.height) { return( oLayer.document.height); } else { return( oLayer.clip.bottom - oLayer.clip.top); } } if (isIE) { if (oLayer.style.pixelHeight) { return( oLayer.style.pixelHeight); } else { return( oLayer.clientHeight); } } return -1; } function degLayerGetRight() { var oLayer = this.objLayer; if (isN4) { return( oLayer.left + oLayer.getWidth()); } if (isIE) { return( oLayer.style.pixelLeft + oLayer.getWidth()); } return -1; } function degLayerGetBottom() { var oLayer = this.objLayer; if (isN4) { return( oLayer.top + oLayer.getHeight()); } if (isIE) { return( oLayer.style.pixelTop + oLayer.getHeight()); } return -1; } function degLayerGetZIndex() { var oLayer = this.objLayer; if (isN4) { return( oLayer.zIndex); } if (isIE) { return( oLayer.style.zIndex); } return -1; } function degLayerGetClipLeft() { var oLayer = this.objLayer; if (isN4) { return( oLayer.clip.left); } if (isIE) { if (oLayer.style.clip == '') { return 0; } var vDim = parseFloat( oLayer.currentStyle.clipLeft); return( isNaN( vDim) ? 0 : vDim ); } return -1; } function degLayerGetClipTop() { var oLayer = this.objLayer; if (isN4) { return( oLayer.clip.top); } if (isIE) { if (oLayer.style.clip == '') { return 0; } var vDim = parseFloat( oLayer.currentStyle.clipTop); return( isNaN( vDim) ? 0 : vDim ); } return -1; } function degLayerGetClipRight() { var oLayer = this.objLayer; if (isN4) { return( oLayer.clip.right); } if (isIE) { if (oLayer.style.clip == '') { return( oLayer.style.pixelWidth); } var vDim = parseFloat( oLayer.currentStyle.clipRight); return( isNaN( vDim) ? 0 : vDim ); } return -1; } function degLayerGetClipBottom() { var oLayer = this.objLayer; if (isN4) { return( oLayer.clip.bottom); } if (isIE) { if (oLayer.style.clip == '') { return( oLayer.style.pixelHeight); } var vDim = parseFloat( oLayer.currentStyle.clipBottom); return( isNaN( vDim) ? 0 : vDim ); } return -1; } function degLayerGetClipWidth() { var oLayer = this.objLayer; if (isN4) { return( oLayer.clip.width); } if (isIE) { if (oLayer.style.clip == '') { return( layer.style.pixelWidth); } var vDim = parseFloat( oLayer.currentStyle.clipRight) - parseFloat( oLayer.currentStyle.clipLeft); return( isNaN( vDim) ? 0 : vDim ); } return -1; } function degLayerGetClipHeight() { var oLayer = this.objLayer; if (isN4) { return( oLayer.clip.height); } if (isIE) { if (oLayer.style.clip == '') { return( oLayer.style.pixelHeight); } var vDim = parseFloat( oLayer.currentStyle.clipBottom) - parseFloat( oLayer.currentStyle.clipTop); return( isNaN( vDim) ? 0 : vDim ); } return -1; } //-------------------- //Property - Set //-------------------- function degLayerSetClipHeight( height) { var oLayer = this.objLayer; this.height = height; if (isN4) { oLayer.clip.height = height; } if (isIE) { oLayer.style.pixelHeight = height; } } function degLayerSetClipWidth( width) { var oLayer = this.objLayer; this.width = width; if (isN4) { oLayer.clip.width = width; } if (isIE) { oLayer.style.pixelWidth = width; } return -1; } function degLayerSetZIndex( z) { var oLayer = this.objLayer; if (!isNaN( parseInt( z))) { if (isN4) { oLayer.zIndex = z; if (this.objEventLayer != null) { this.objEventLayer.setZIndex( z); } } if (isIE) { oLayer.style.zIndex = z; } } //else { // alert( 'Invalid z: ' + z); //} } function degLayerSetBgColor( bgColor) { var oLayer = this.objLayer; if (isN4) { //alert( oLayer.bgColor + '-' + bgColor); if (bgColor.length > 0) { oLayer.bgColor = bgColor; } } if (isIE) { //alert( oLayer.style.backgroundColor); if (bgColor.length > 0) { oLayer.style.backgroundColor = bgColor; } } } function degLayerSetBgImage( imgSource) { var oLayer = this.objLayer; if (isN4) { oLayer.background.src = srcimgSource; } if (isIE) { oLayer.style.backgroundImage = "url(" + imgSource + ")"; } } function degLayerCreateEventLayerNS( oDegLayer) { oDegLayer.objEventLayer = new degLayer( 'inv_' + oDegLayer.name); if (isN4) { oDegLayer.objEventLayer.objLayer = new Layer( oDegLayer.width); } oDegLayer.objEventLayer.objLayer.parentObject = oDegLayer.objLayer.parentObject; oDegLayer.objEventLayer.setClipHeight( oDegLayer.getHeight()); oDegLayer.objEventLayer.objLayer.moveTo( oDegLayer.getLeft(), oDegLayer.getTop()); if (oDegLayer.getVisibility() == 'visible') { oDegLayer.objEventLayer.show(); } else { oDegLayer.objEventLayer.hide(); } } function degLayerSetOnMouseOver( eventHandler) { if (isN4) { if (this.objEventLayer == null) { degLayerCreateEventLayerNS( this); } this.objEventLayer.objLayer.onmouseover = eventHandler; } if (isIE) { this.objLayer.onmouseover = eventHandler; } } function degLayerSetOnMouseOut( eventHandler) { if (isN4) { if (this.objEventLayer == null) { degLayerCreateEventLayerNS( this); } this.objEventLayer.objLayer.onmouseout = eventHandler; } if (isIE) { this.objLayer.onmouseout = eventHandler; } } function degLayerSetOnClick( eventHandler) { var oLayer = this.objLayer; if (isN4) { if (this.objEventLayer == null) { degLayerCreateEventLayerNS( this); } this.objEventLayer.objLayer.document.onmousedown = eventHandler; this.objEventLayer.objLayer.document.parentObject = oLayer.parentObject; } if (isIE) { oLayer.onclick = eventHandler; } } function degFindLayerN4( oDocument,layerName) { var oLayer; for( var i = 0; i < oDocument.layers.length; i++) { oLayer = oDocument.layers[ i]; if (oLayer.name == layerName) { return( oLayer.parentObject); } if (oLayer.document.layers.length > 0) { if ((oLayer = degFindLayerN4( oLayer.document, layerName)) != null) { return( oLayer.parentObject); } } } return( null); } function degGetLayer( layerName) { if (isN4) { return( degFindLayerN4( document, layerName)); } if (isIE) { var oLayer = eval( 'document.all.' + layerName); if (oLayer != null) { return( oLayer.parentObject); } else { return( null); } } } function degLayerReload() { if (isN4 & (g_windowHeigth == getWindowHeight()) && (g_windowWidth == getWindowWidth())) { return 0; } window.location.href = window.location.href; } //NEW SCRIPT var isIE, isN4; isIE = (document.all) ? true : false; isN4 = (document.layers) ? true : false; var g_windowHeigth, g_windowWidth; function initJsEnv() { if (g_degLayerCount > 0) { window.onresize = degLayerReload; } g_windowHeigth = getWindowHeight(); g_windowWidth = getWindowWidth(); } function getPageWidth() { if (isN4) { return( document.width); } if (isIE) { return( document.body.scrollWidth); } return -1; } function getPageHeight() { if (isN4) { return( document.height); } if (isIE) { return( document.body.scrollHeight); } return -1; } function getPageScrollX() { if (isN4) { return( window.pageXOffset); } if (isIE) { return( document.body.scrollLeft); } return -1; } function getPageScrollY() { if (isN4) { return( window.pageYOffset); } if (isIE) { return( document.body.scrollTop); } return -1; } function getWindowWidth() { if (isN4) { return( window.innerWidth); } if (isIE) { return( document.body.clientWidth); } return -1; } function getWindowHeight() { if (isN4) { return( window.innerHeight); } if (isIE) { return( document.body.clientHeight); } return -1; } //NEW SCRIPT function degImage( sName) { this.name = sName; if (document.images[ sName]) { this.objImage = document.images[ sName]; this.getX = degImageGetX; this.getY = degImageGetY; return 0; } else { return 1; } } function degImageGetX() { var iX, oX; iX = -1; if (isN4) { iX = this.objImage.x; } if (isIE) { iX = 0; oX = this.objImage; while (oX.tagName.toUpperCase() != "BODY") { iX += oX.offsetLeft; oX = oX.offsetParent; } } return( iX); } function degImageGetY() { var iY, oX; iY = -1; if (isN4) { iY = this.objImage.y; } if (isIE) { iY = 0; oX = this.objImage; while (oX.tagName.toUpperCase() != "BODY") { iY += oX.offsetTop; oX = oX.offsetParent; } } return( iY); } //NEW SCRIPT var g_mbRootVisible = null; //root menu bar whose menu items are visible var g_mbHdlTimer = null; var g_mbMenu = new degMenu( 'Global'); var g_mbMenuBar = null; var g_mbMenuItem = null; function degMenu( sName) { this.name = sName; this.rootMenuItem = new Array(); this.addRootMenuItem = degMenuAddRootMenuItem; this.genMenu = degMenuGenMenu; this.bodyOnLoad = degMenuBodyOnLoad; } function degMenuAddRootMenuItem( sName) { var oRootMenuItem = new degMenuItem( sName); this.rootMenuItem[ this.rootMenuItem.length] = oRootMenuItem; return( oRootMenuItem); } function degMenuGenMenu() { for (var i = 0; i < this.rootMenuItem.length; i++) { this.rootMenuItem[ i].genMenuBar(); } } function degMenuBodyOnLoad() { for (var i=0; i < this.rootMenuItem.length; i++) { this.rootMenuItem[ i].bodyOnLoad(); var oMI = this.rootMenuItem[ i].menuBarLayer; this.rootMenuItem[ i].show(); } } function degMenuItem( sName) { this.name = sName; this.caption = 'MB'; this.captionAlign = 'center'; this.urlAddress = ''; this.urlTarget = ''; this.menuBarLayerName = 'mb0_' + sName; this.menuBarLayer = null; this.menuBarParent = null; //parent menu bar -- one level up this.menuBarRoot = this; //root menu bar -- top most level this.menuItemContainerName = 'mb2_' + sName; this.menuItemContainer = null this.menuItemContainerBgColor = ''; this.isGenerated = false; this.imgAnchor = ''; //anchor for menu bar this.imgAchorLeft = ''; //anchor for left edge of body this.left = 0; this.top = 0; this.zIndex = 100; this.menuBarWidth = 100; this.menuBarHeight = 0; this.menuItemOffset = 1; //distance between menu bar and menu items this.bodyWidth = 0; this.leftEdge = 0; //screen pixel location of left and right edges of bar this.rightEdge = 600; this.cssForeId = ''; this.cssUrlId = '' this.onMouseOutBgColor = ''; this.onMouseOverBgColor = ''; this.menuItemBorderWidth = 0; this.menuOuterBorderWidth = 2; //sub-menu options this.menuItemList = new Array(); //array of degMenuBar objects that form the drop-down menu this.menuDropDirection = 0; //0-down, 1-right this.hasBeenMoved = false; //has the menu layers been positioned? this.defaultMenuItemWidth = 150; this.defaultMenuItemHeight = 0; this.defaultCaptionAlign = 'left'; this.defaultCssForeId = ''; this.defaultOnMouseOutBgColor = ''; this.defaultOnMouseOverBgColor = ''; this.defaultMenuItemOffset = 1; this.defaultMenuItemBorderWidth = 0; this.defaultMenuOuterBorderWidth = 2; //sub-sub-menu visible this.openSubMenu = null; this.setDimension = degMenuBarSetDimension; this.bodyOnLoad = degMenuBarBodyOnLoad; this.addMenuItem = degMenuBarAddMenuItem; this.copyDefaulValue = degMenuBarCopyDefaultValue; this.genMenuBar = degMenuBarGen; this.moveTo = degMenuBarMoveTo; this.show = degMenuBarShow; this.hide = degMenuBarHide; this.hasSubMenu = degMenuBarHasSubMenu; this.showSubMenu = degMenuBarShowSubMenu; this.hideSubMenu = degMenuBarHideSubMenu; this.isRoot = degMenuBarIsRoot; } function degMenuBarAddMenuItem( sName) { var menuItem = new degMenuItem( sName); this.menuItemList[ this.menuItemList.length] = menuItem; menuItem.zIndex = this.zIndex; menuItem.menuBarWidth = this.defaultMenuItemWidth; menuItem.menuBarHeight = this.defaultMenuItemHeight; menuItem.captionAlign = this.defaultCaptionAlign; menuItem.cssForeId = this.defaultCssForeId; menuItem.onMouseOutBgColor = this.defaultOnMouseOutBgColor; menuItem.onMouseOverBgColor = this.defaultOnMouseOverBgColor; menuItem.defaultMenuItemBorderWidth = this.defaultMenuItemBorderWidth; menuItem.defaultMenuOuterBorderWidth = this.defaultMenuOuterBorderWidth; menuItem.defaultMenuItemOffset = this.defaultMenuItemOffset; menuItem.copyDefaulValue(); menuItem.menuBarParent = this; menuItem.menuBarRoot = this.menuBarRoot; return( menuItem); } function degMenuBarCopyDefaultValue() { if (this.menuBarParent != null) { var oParent = this.menuBarParent; this.menuDropDirection = oParent.menuDropDirection; this.defaultMenuItemWidth = oParent.defaultMenuItemWidth; this.defaultMenuItemHeight = oParent.defaultMenuItemHeight; this.defaultCaptionAlign = oParent.defaultCaptionAlign; this.defaultCssForeId = oParent.defaultCssForeId; this.defaultOnMouseOutBgColor = oParent.defaultOnMouseOutBgColor; this.defaultOnMouseOverBgColor = oParent.defaultOnMouseOverBgColor; this.defaultMenuItemBorderWidth = oParent.defaultMenuItemBorderWidth; this.defaultMenuOuterBorderWidth = oParent.defaultMenuOuterBorderWidth; this.defaultMenuItemOffset = oParent.defaultMenuItemOffset; } } function degMenuBarGen() { var caption; caption = this.caption; this.menuBarLayer = new degLayer( this.menuBarLayerName); this.menuBarLayer.width = this.menuBarWidth; this.menuBarLayer.height = this.menuBarHeight; this.menuBarLayer.clearBuffer(); this.menuBarLayer.appendBuffer( '' + '
' + '' + caption + '' + '
' ); this.menuBarLayer.genLayer(); //if menu bar has menu items -- generate layers for menu items if (this.hasSubMenu()) { this.menuItemContainer = new degLayer( this.menuItemContainerName) this.menuItemContainer.clearBuffer(); this.menuItemContainer.genLayer(); for (var i=0; i < this.menuItemList.length; i++) { this.menuItemList[ i].genMenuBar(); } } this.isGenerated = true; } function degMenuBarMoveTo( left, top, isMoveMenuItem) { var topY0, topY, leftX, minLeft, maxWidth, tempX; if ((this.menuBarWidth + this.menuOuterBorderWidth + left) > this.menuBarRoot.rightEdge) { this.left = this.menuBarRoot.rightEdge - this.menuBarWidth - this.menuOuterBorderWidth - 1; } else { this.left = left; } this.top = top; if (this.isGenerated) { this.menuBarLayer.moveTo( this.left, this.top); if (this.hasSubMenu() && isMoveMenuItem) { if (this.menuDropDirection == 0) { //drop down topY0 = this.top + this.menuBarLayer.getHeight() + this.menuItemOffset; topY = topY0 + this.menuOuterBorderWidth; for (var i = 0; i < this.menuItemList.length; i++) { this.menuItemList[ i].moveTo( this.left + this.menuOuterBorderWidth, topY, true); tempX = this.menuItemList[ i].menuBarLayer.getWidth(); if ((isNaN( maxWidth)) || (tempX > maxWidth)) { maxWidth = tempX; } tempX = this.menuItemList[ i].menuBarLayer.getLeft(); if ((isNaN( minLeft)) || (tempX < minLeft)) { minLeft = tempX;} topY += this.menuItemList[ i].menuBarLayer.getHeight() + this.menuItemBorderWidth; } if (minLeft != (this.left + this.menuOuterBorderWidth)) { this.menuItemContainer.moveTo( minLeft - this.menuOuterBorderWidth, topY0); } else { this.menuItemContainer.moveTo( this.left, topY0); } this.menuItemContainer.setClipWidth( maxWidth + this.menuOuterBorderWidth * 2); this.menuItemContainer.setClipHeight( topY - topY0 + this.menuOuterBorderWidth); } else if (this.menuDropDirection == 1) { //drop right topY = this.top; leftX = this.left + this.menuBarWidth + this.menuItemOffset; if (leftX + this.defaultMenuItemWidth > this.menuBarRoot.rightEdge) { leftX = this.left - this.defaultMenuItemWidth - this.menuItemOffset - 1; } for (var i=0; i < this.menuItemList.length; i++) { this.menuItemList[ i].moveTo( leftX, topY, true); topY += this.menuItemList[ i].menuBarLayer.getHeight() + this.menuItemBorderWidth; } } this.hasBeenMoved = true; } else { this.hasBeenMoved = false; } } } function degMenuBarSetDimension( imgLeft, barWidth) { var oImage = new degImage( imgLeft); this.leftEdge = oImage.getX(); this.rightEdge = this.leftEdge + barWidth; oImage = null; } function degMenuBarBodyOnLoadAll( menuBar) { var barLayer = menuBar.menuBarLayer; barLayer.bodyOnLoad(); barLayer.setZIndex( menuBar.zIndex); barLayer.objLayer.parentObject = menuBar; barLayer.setBgColor( menuBar.onMouseOutBgColor); barLayer.onMouseOver( degMenuBarOnMouseOver); barLayer.onMouseOut( degMenuBarOnMouseOut); barLayer.onClick( degMenuBarOnClick); if (menuBar.menuItemList.length > 0) { menuBar.menuItemContainer.bodyOnLoad(); menuBar.menuItemContainer.objLayer.parentObject = menuBar; menuBar.menuItemContainer.onMouseOver( degMenuBarOnMouseOver); menuBar.menuItemContainer.onMouseOut( degMenuBarOnMouseOut); menuBar.menuItemContainer.setBgColor( menuBar.menuItemContainerBgColor); for( var i=0; i < menuBar.menuItemList.length; i++) { degMenuBarBodyOnLoadAll( menuBar.menuItemList[ i]); } } return 0 } function degMenuBarShowAll( menuBar) { menuBar.show(); if (menuBar.menuItemList.length > 0) { for( var i=0; i < menuBar.menuItemList.length; i++) { testShowAll( menuBar.menuItemList[ i]); } } return 0 } function degMenuBarShowSubMenu() { var isRoot = this.isRoot(); if (this.hasSubMenu()) { //if the sub-menu hasn't been positioned if (!this.hasBeenMoved) { this.moveTo( this.left, this.top, true); } this.menuItemContainer.show(); for( var i=0; i < this.menuItemList.length; i++) { this.menuItemList[ i].show(); } if (!isRoot) { this.menuBarParent.openSubMenu = this; } } else { if (!isRoot) { this.menuBarParent.openSubMenu = null; } } if (isRoot) { g_mbRootVisible = this; } return 0 } function degMenuBarHideSubMenu() { var isRoot = this.isRoot(); if (this.hasSubMenu()) { this.menuItemContainer.hide(); for( var i=0; i < this.menuItemList.length; i++) { this.menuItemList[ i].hide(); } if (!isRoot) { this.menuBarParent.openSubMenu = null; } } if (isRoot) { if (this == g_mbRootVisible) { g_mbRootVisible = null; } } return 0 } function degMenuBarHideSubMenuAll( menuBarLayerName) { var menuBar = degGetLayer( menuBarLayerName); while (menuBar != null) { menuBar.hideSubMenu(); menuBar = menuBar.menuBarParent; } } function degMenuBarHideSubMenu2( menuBarLayerName) { var menuBar = degGetLayer( menuBarLayerName); if (menuBar != null) { menuBar.hideSubMenu(); } } function degMenuBarHasSubMenu() { return( this.menuItemList.length > 0); } function degMenuBarIsRoot() { return( this.menuBarRoot.name == this.name); } function degMenuBarBodyOnLoad() { degMenuBarBodyOnLoadAll( this); this.setDimension( this.imgAnchorLeft, this.bodyWidth); if (this.imgAnchor.length >= 0) { var oImage = new degImage( this.imgAnchor); this.left = oImage.getX(); this.top = oImage.getY(); oImage = null; } this.moveTo( this.left, this.top, false); this.show(); } function degMenuBarShow() { this.menuBarLayer.show(); this.hideSubMenu(); } function degMenuBarHide() { this.menuBarLayer.hide(); this.hideSubMenu(); } function degMenuBarOnMouseOver() { if ((g_mbRootVisible != null) && (this.parentObject.menuBarRoot != null) && (this.parentObject.menuBarRoot.name == g_mbRootVisible.name)) { clearTimeout( g_mbHdlTimer); } var oDegLayer = this.parentObject; oDegLayer.menuBarLayer.setBgColor( oDegLayer.onMouseOverBgColor); if (!oDegLayer.isRoot()) { if (oDegLayer.menuBarParent.openSubMenu != null) { oDegLayer.menuBarParent.openSubMenu.hideSubMenu(); } } oDegLayer.showSubMenu(); } function degMenuBarOnMouseOut() { var oDegLayer = this.parentObject; oDegLayer.menuBarLayer.setBgColor( oDegLayer.onMouseOutBgColor); g_mbHdlTimer = setTimeout( 'degMenuBarHideSubMenuAll( "' + oDegLayer.menuBarLayerName + '");', 30); } function degMenuBarOnClick() { var urlAddress = this.parentObject.urlAddress; var urlTarget = this.parentObject.urlTarget; if (urlAddress.substr( 0, 11) == 'javascript:') { eval( urlAddress); } else if (urlTarget.toLowerCase() == '_top') { document.location.assign( urlAddress); } else if (urlTarget.toLowerCase() == '_self') { this.document.location.assign( urlAddress); } else { window.open( urlAddress); } return( false); }