rem: var bod = document.getElementsByTagName('body')[0]; var htm = document.getElementsByTagName('html')[0]; 
add: scrollX = Math.max( document.documentElement.scrollLeft, document.body.scrollLeft ), 
context: YAHOO.widget.MenuModule.prototype.enforceConstraints =    function(type, args, obj) {        var Dom = this._oDom;        var oConfig = this.cfg;        var pos = args[0];        var x = pos[0];        var y = pos[1];        var bod = document.getElementsByTagName('body')[0];        var htm = document.getElementsByTagName('html')[0];        var bodyOverflow = Dom.getStyle(bod, "overflow");        var htmOverflow = Dom.getStyle(htm, "overflow");        var offsetHeight = this.element.offsetHeight;        var offsetWidth = this.element.offsetWidth;        var viewPortWidth = Dom.getClientWidth();        var viewPortHeight = Dom.getClientHeight();        var scrollX = window.scrollX || document.body.scrollLeft;        var scrollY = window.scrollY || document.body.scrollTop;        var topConstraint = scrollY + 10;        var leftConstraint = scrollX + 10;        var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;        var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;        var aContext = oConfig.getProperty("context");        var oContextElement = aContext ? aContext[0] : null;        if (x < 10) {            x = leftConstraint;        } else if ((x + offsetWidth) > viewPortWidth) {            if(                oContextElement &&                ((x - oContextElement.offsetWidth) > offsetWidth)            ) {                x = (x - (oContextElement.offsetWidth + offsetWidth));            }            else {                x = rightConstraint;            }        }        if (y < 10) {            y = topConstraint;        } else if (y > bottomConstraint) {            if(oContextElement && (y > offsetHeight)) {                y = ((y + oContextElement.offsetHeight) - offsetHeight);            }            else {                y = bottomConstraint;            }        }        oConfig.setProperty("x", x, true);        oConfig.setProperty("y", y, true);    };
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/menu.js/buggy/www/resources/yui/menu/menu.js