		var preloaded = [];

		// here is a lame preloading script i am putting in just for demonstration
		for (var i = 1; i <= 5; i++) {
			preloaded[i] = [loadImage(i + "-0.gif"), loadImage(i + "-1.gif")];
		}


function showEleObj() {
// showElement("IFRAME");
showElement("applet");
showElement("SELECT");

}
function hideEleObj(menuid) {
var ox = parseInt(menuid.style.left);
var oy = parseInt(menuid.style.top);
var ow = menuid.offsetWidth;
var oh = menuid.offsetHeight;
// hideElement("IFRAME", ox, oy, ow, oh);
 hideElement("applet", ox, oy, ow, oh);
hideElement("SELECT", ox, oy, ow, oh);
}
function showElement(elmID){
for (i = 0; i < document.all.tags(elmID).length; i++) {
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent)
continue;
obj.style.visibility = "";
}
}
function hideElement(elmID, ox, oy, ow, oh){
ox = parseInt(ox);
oy = parseInt(oy);
ow = parseInt(ow);
oh = parseInt(oh);
for (i = 0; i < document.all.tags(elmID).length; i++) {
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent)
continue;
objLeft = obj.offsetLeft;
objTop = obj.offsetTop;
objParent = obj.offsetParent;
while (objParent.tagName.toUpperCase() != "BODY") {
objLeft += objParent.offsetLeft;
objTop += objParent.offsetTop;
objParent = objParent.offsetParent;
}
if ( (ox > (objLeft+obj.offsetWidth)) || (objLeft > (ox+ow)) || (objTop > (oy+oh)) || (oy>(objTop+obj.offsetHeight)) )
obj.style.visibility = "";
else
obj.style.visibility = "hidden";
}
}

		function init() {
			// whatever stuff you need to do onload goes here.

			//==========================================================================================
			// if supported, initialize mtdropdowns
			//==========================================================================================
			// Check isSupported() so that menus aren't accidentally sent to non-supporting browsers.
			// This is better than server-side checking because it will also catch browsers which would
			// normally support the menus but have javascript disabled.
			//
			// If supported, call initialize() and then hook whatever image rollover code you need to do
			// to the .onactivate and .ondeactivate events for each menu.
			//==========================================================================================
			if (mtDropDown.isSupported()) {
				mtDropDown.initialize();

				// hook all the image swapping of the main toolbar to menu activation/deactivation
				// instead of simple rollover to get the effect where the button stays hightlit until
				// the menu is closed.
				menu1.onactivate = function() { swapImage("button1", preloaded[1][1].src);hideEleObj(button1); };
				menu1.ondeactivate = function() { swapImage("button1", preloaded[1][0].src);showEleObj(); };

				menu2.onactivate = function() { swapImage("button2", preloaded[2][1].src);hideEleObj(button2); };
				menu2.ondeactivate = function() { swapImage("button2", preloaded[2][0].src);showEleObj(); };

				menu3.onactivate = function() { swapImage("button3", preloaded[3][1].src);hideEleObj(button3); };
				menu3.ondeactivate = function() { swapImage("button3", preloaded[3][0].src);showEleObj(); };

				menu4.onactivate = function() { swapImage("button4", preloaded[4][1].src);hideEleObj(button4); };
				menu4.ondeactivate = function() { swapImage("button4", preloaded[4][0].src);showEleObj(); };

				menu5.onactivate = function() { swapImage("button5", preloaded[5][1].src);hideEleObj(button5); };
				menu5.ondeactivate = function() { swapImage("button5", preloaded[5][0].src);showEleObj(); };
				
				



			}
		}

		// this is a crappy example preloader. Use whichever one you want.
		function loadImage(sFilename) {
			var img = new Image();
			img.src ="images/" + sFilename;
			return img;
		}

		// this is a crappy example image swapper. Use whichever you want.
		function swapImage(imgName, sFilename) {
			document.images[imgName].src = sFilename;
		}