var cssdropdown = { disappeardelay: 250, dropdownindicator: '<img src="/way2k/images/gif/down.gif" border="0" />', enablereveal: [true, 5], enableiframeshim: 1, dropmenuobj: null, asscmenuitem: null, domsupport: document.all || document.getElementById, standardbody: null, iframeshimadded: false, revealtimers: {}, getposOffset: function(c, d) { var b = d == "left" ? c.offsetLeft : c.offsetTop, a = c.offsetParent; while (a != null) { b = d == "left" ? b + a.offsetLeft : b + a.offsetTop; a = a.offsetParent } return b }, css: function(a, d, b) { var c = new RegExp("(^|\\s+)" + d + "($|\\s+)", "ig"); if (b == "check") return c.test(a.className); else if (b == "remove") a.className = a.className.replace(c, ""); else if (b == "add" && !c.test(a.className)) a.className += " " + d }, showmenu: function(a) { var b = this; if (b.enablereveal[0]) { if (!a._trueheight || a._trueheight < 10) a._trueheight = a.offsetHeight; clearTimeout(b.revealtimers[a.id]); a.style.height = a._curheight = 0; a.style.overflow = "hidden"; a.style.visibility = "visible"; b.revealtimers[a.id] = setInterval(function() { cssdropdown.revealmenu(a) }, 10) } else a.style.visibility = "visible"; b.css(b.asscmenuitem, "selected", "add") }, revealmenu: function(a) { var d = a._curheight, b = a._trueheight, e = this.enablereveal[1]; if (d < b) { var c = Math.min(d, b); a.style.height = c + "px"; a._curheight = c + Math.round((b - c) / e) + 1 } else { a.style.height = "auto"; a.style.overflow = "hidden"; clearInterval(this.revealtimers[a.id]) } }, clearbrowseredge: function(d, h) { var a = this, b = 0; if (h == "rightedge") { var e = document.all && !window.opera ? a.standardbody.scrollLeft + a.standardbody.clientWidth - 15 : window.pageXOffset + window.innerWidth - 15, f = a.dropmenuobj.offsetWidth; if (e - a.dropmenuobj.x < f) b = f - d.offsetWidth } else { var g = document.all && !window.opera ? a.standardbody.scrollTop : window.pageYOffset, e = document.all && !window.opera ? a.standardbody.scrollTop + a.standardbody.clientHeight - 15 : window.pageYOffset + window.innerHeight - 18, c = a.dropmenuobj._trueheight; if (e - a.dropmenuobj.y < c) { b = c + d.offsetHeight; if (a.dropmenuobj.y - g < c) b = a.dropmenuobj.y + d.offsetHeight - g } } return b }, dropit: function(b, d, c) { var a = this; a.dropmenuobj != null && a.hidemenu(); a.clearhidemenu(); a.dropmenuobj = document.getElementById(c); a.asscmenuitem = b; a.showmenu(a.dropmenuobj, d); a.dropmenuobj.x = a.getposOffset(b, "left"); a.dropmenuobj.y = a.getposOffset(b, "top"); a.dropmenuobj.style.left = a.dropmenuobj.x - a.clearbrowseredge(b, "rightedge") + "px"; a.dropmenuobj.style.top = a.dropmenuobj.y - a.clearbrowseredge(b, "bottomedge") + b.offsetHeight + 1 + "px"; a.positionshim() }, positionshim: function() { var b = "px", a = this; if (a.iframeshimadded) if (a.dropmenuobj.style.visibility == "visible") { a.shimobject.style.width = a.dropmenuobj.offsetWidth + b; a.shimobject.style.height = a.dropmenuobj._trueheight + b; a.shimobject.style.left = parseInt(a.dropmenuobj.style.left) + b; a.shimobject.style.top = parseInt(a.dropmenuobj.style.top) + b; a.shimobject.style.display = "block" } }, hideshim: function() { if (this.iframeshimadded) this.shimobject.style.display = "none" }, isContained: function(c, b) { var b = window.event || b, a = b.relatedTarget || (b.type == "mouseover" ? b.fromElement : b.toElement); while (a && a != c) try { a = a.parentNode } catch (b) { a = c } if (a == c) return true; else return false }, dynamichide: function(b, a) { !this.isContained(b, a) && this.delayhidemenu() }, delayhidemenu: function() { this.delayhide = setTimeout("cssdropdown.hidemenu()", this.disappeardelay) }, hidemenu: function() { var a = this; a.css(a.asscmenuitem, "selected", "remove"); a.dropmenuobj.style.visibility = "hidden"; a.dropmenuobj.style.left = a.dropmenuobj.style.top = "-1000px"; a.hideshim() }, clearhidemenu: function() { this.delayhide != "undefined" && clearTimeout(this.delayhide) }, addEvent: function(a, b, c) { if (a.addEventListener) a.addEventListener(c, b, false); else a.attachEvent && a.attachEvent("on" + c, function() { return b.call(a, window.event) }) }, startchrome: function() { var g = "mouseout", f = "mouseover", a = this; if (!a.domsupport) return; a.standardbody = document.compatMode == "CSS1Compat" ? document.documentElement : document.body; for (var e = 0; e < arguments.length; e++) for (var c = document.getElementById(arguments[e]).getElementsByTagName("a"), b = 0; b < c.length; b++) if (c[b].getAttribute("rel")) { var h = c[b].getAttribute("rel"), d = document.getElementById(h); a.addEvent(d, function() { cssdropdown.clearhidemenu() }, f); a.addEvent(d, function(a) { cssdropdown.dynamichide(this, a) }, g); a.addEvent(d, function() { cssdropdown.delayhidemenu() }, "click"); try { c[b].innerHTML = c[b].innerHTML + " " + a.dropdownindicator } catch (i) { } a.addEvent(c[b], function(a) { if (!cssdropdown.isContained(this, a)) { var b = window.event || a; cssdropdown.dropit(this, b, this.getAttribute("rel")) } }, f); a.addEvent(c[b], function(a) { cssdropdown.dynamichide(this, a) }, g); a.addEvent(c[b], function() { cssdropdown.delayhidemenu() }, "click") } if (a.enableiframeshim && document.all && !window.XDomainRequest && !a.iframeshimadded) { document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>'); a.shimobject = document.getElementById("iframeshim"); a.shimobject.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"; a.iframeshimadded = true } } }; function activeme(a) { document.getElementById(a).style.color = "#000"; document.getElementById(a).style.backgroundColor = "#8dc5d7"; document.getElementById(a).style.backgroundPosition = "center center"; GlobalAncId = a };
