var OpacityDropdown = { intervals: 10, menues: [], start: function(div) { var div = document.getElementById(div); var end = div.getElementsByTagName("div").length; while(end--) { var ddItem = div.getElementsByTagName("div")[end]; if(ddItem.className.indexOf("ddItem") != -1 && ddItem.getElementsByTagName("div").length != 0 && ddItem.getElementsByTagName("a").length != 0) { this.createDropdown(ddItem); } } }, createDropdown: function(div) { var index = this.menues.length; var dropdown = { ddItem: div, className: div.className, a: div.getElementsByTagName("a")[0], div: div.getElementsByTagName("div")[0], start: function() { if(navigator.appName == "Netscape") { this.div.style.opacity = 0; this.div.style.filter = "alpha(opacity=0)"; } this.div.style.display = "none"; this.interval = 0; this.status = "hidden"; this.ddItem.onmouseover = function() { OpacityDropdown.show(index); } this.ddItem.onmouseout = function() { OpacityDropdown.menues[index].hideTimeout = setTimeout("OpacityDropdown.menues["+index+"].hide()", 100); } }, show: function() { this.div.style.display = "block"; if(typeof(this.hideTimeout) != "undefined") { clearTimeout(this.hideTimeout); } if(navigator.appName == "Netscape") { if(typeof(this.hideInterval) != "undefined") { clearTimeout(this.hideInterval); } if(typeof(this.showInterval) != "undefined") { clearTimeout(this.showInterval); } this.status = "shown"; OpacityDropdown.menues[index].incrementOpacity(); } }, incrementOpacity: function() { if(this.interval < 9) { this.div.style.opacity = (this.interval+1) / 10; this.div.style.filter = "alpha(opacity="+(this.interval+1) * 10+")"; } if(this.interval < 10) { this.interval++; this.showInterval = setTimeout("OpacityDropdown.menues["+index+"].incrementOpacity();", 40); } }, hide: function() { if(navigator.appName == "Netscape") { if(typeof(this.hideInterval) != "undefined") { clearTimeout(this.hideInterval); } if(typeof(this.showInterval) != "undefined") { clearTimeout(this.showInterval); } OpacityDropdown.menues[index].decrementOpacity(); } else { this.div.style.display = "none"; } }, decrementOpacity: function() { if(this.interval < 11) { this.div.style.opacity = (this.interval-1) / 10; this.div.style.filter = "alpha(opacity="+(this.interval-1) * 10+")"; } if(this.interval > 0) { this.interval--; this.hideInterval = setTimeout("OpacityDropdown.menues["+index+"].decrementOpacity();", 40); } else { this.div.style.display = "none"; this.status = "hidden"; } } } dropdown.start(); this.menues[index] = dropdown; }, show: function(menu) { var end = this.menues.length; while(end--) { if(end == menu) { this.menues[end].show(); } else if(this.menues[end].status == "shown") { this.menues[end].hide(); } } } }