var preloaded = [];

//preload images
for (var i = 1; i <= 5; i++) {
	preloaded[i] = [loadImage(i + "-0.gif"), loadImage(i + "-1.gif")];
}

		
function init() {
	
//
//resizeTo(900,800);
			
//==========================================================================================
			// 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 hightlited until
				// the menu is closed.
				
				//mouseover code. :)
				menu1.onactivate = function() { swapImage("button1","images/profile_on.gif") };
				menu1.ondeactivate = function() { swapImage("button1","images/profile_off.gif") };

				menu2.onactivate = function() { swapImage("button2", "images/services_on.gif") };
				menu2.ondeactivate = function() { swapImage("button2", "images/services_off.gif") };

				//menu3.onactivate = function() { swapImage("button3", "images/portfolio_on.gif") };
				//menu3.ondeactivate = function() { swapImage("button3", "images/portfolio_off.gif") };

				menu3.onactivate = function() { swapImage("button3", "images/active_on.gif") };
				menu3.ondeactivate = function() { swapImage("button3", "images/active_off.gif") };

				menu4.onactivate = function() { swapImage("button4", "images/resources_on.gif") };
				menu4.ondeactivate = function() { swapImage("button4", "images/resources_off.gif") };
				
				menu5.onactivate = function() { swapImage("button5", "images/contact_on.gif") };
				menu5.ondeactivate = function() { swapImage("button5", "images/contact_off.gif") };
			}
		}

		// this is a crappy example preloader. Use whichever one you want.
		function loadImage(sFilename) {
			var img = new Image();
			img.src ="/_images/nav/" + sFilename;
			return img;
		}

		// this is a crappy example image swapper. Use whichever you want.
		function swapImage(imgName, sFilename) {
			document.images[imgName].src = sFilename;
		}