// JavaScript Document

window.addEvent('domready', function() {

	
	// initialise script
	
	initNav();
	resetNav();
	function initNav() {
		// get all of the activate buttons
		// var buttons = document.getElementsByClassName('activate');
	    // var buttons = getButtonList('nav','activate');
		var buttons = document.getElementById('nav').childNodes;
	    //alert(buttons.length);
		for(var b=0;b<buttons.length; b++) {  
  			if (buttons[b].id != undefined) 
			{                  
				if (buttons[b].className=='activate')
				{
					buttons[b].onmouseover = function () {
						showSubNav(this, 'show');
					};
					buttons[b].onmouseout = function () {
						startResetTimer();
					};
				} 
				if (buttons[b].className=='deactivate') 
				{                
					buttons[b].onmouseover = function () {
						showSubNav(this, 'hide');
					};
					buttons[b].onmouseout = function () {
						startResetTimer();
					};
				}
			}
		}
	}  
	
});
