var Menu = {
    timeout: null,
		globalHolder: 'GlobalMenu',
		subMenuItemClass: 'submenu',
		triggerClassName: 'menuArrow',
		secondsWait: 5000,
		activeMenu: null,
		toggle: function(_id)
		{
			if( this.activeMenu == _id )
			{
				this.hide(_id);
			}
			else
			{
				this.hideAll();
				this.show(_id);
			}
		},
	    show: function(_id)
		{
			this.clearTime();
			document.getElementById(_id).style.display = 'block';
			this.activeMenu = _id;
	    },
	    hide: function(_id)
		{
			if( document.getElementById(_id) ) document.getElementById(_id).style.display = 'none';
			this.activeMenu = null;
	    },
	    hideAll: function()
		{
			var holder = document.getElementById(this.globalHolder); 
			if(holder)
			{
				var smenus = holder.getElementsByTagName('div');
				for( var x = 0, y = smenus.length; x < y; x++ )
				{
					if( smenus[x].className == this.subMenuItemClass )
					{
						this.hide(smenus[x].id);
					}
				}
			}
	    },		
		startTime: function (_id)
		{
			this.timeout = window.setTimeout('Menu.hide(\''+_id+'\')', this.secondsWait);
		},
		clearTime: function()
		{
			if(this.timeout)
			{
				window.clearTimeout(this.timeout);
				this.timeout = null;
			}			
		}		
	}	
	
	document.onclick = function(e)
	{ 
		var ref = document.all ? window.event.srcElement : e.target;
		if (ref.className != Menu.triggerClassName)
		{
			Menu.hideAll(); 	
		}
	};
	
	
function stripe(e) {
  var evens = $$('table.data-table tr:nth-child(odd)');
    if(evens) {
      evens.each(function(tr) {
        tr.addClassName('alternate');
      });
    }
}
 
Event.observe(window, 'load', stripe);