Menu = {
	
	timer: null,
	
	dropDownsToHide: { 
		"infoMenu": [ "calendarDropDown" ] 
	},
	
	show: function( id ) {
		this.clear();
		this.hideAll();
		if ( document.getElementById( id ) )
			document.getElementById( id ).style.visibility = "visible";
		if ( this.dropDownsToHide[ id ] )
			for ( var x in this.dropDownsToHide[ id ] ) {
				var dd = document.getElementById( this.dropDownsToHide[ id ][ x ] );
				if ( dd )
					dd.style.visibility = "hidden";	
			}	
	},
	
	clear: function() {
		if ( this.timer )
			window.clearTimeout( this.timer );
	},
	
	delayedHide: function( id ) {
		this.clear();
		this.timer = window.setTimeout( "Menu.hide( '" + id + "' )", 1000 );	
	},
	
	hide: function( id ) {
		if ( document.getElementById( id ) )
			document.getElementById( id ).style.visibility = "hidden";
		if ( this.dropDownsToHide[ id ] )
			for ( var x in this.dropDownsToHide[ id ] ) {
				var dd = document.getElementById( this.dropDownsToHide[ id ][ x ] );
				if ( dd )
					dd.style.visibility = "visible";	
			}	
	},
	
	hideAll: function() {
		var menus = document.getElementById( "subMenus" );				
		for ( var i = 0; i < menus.childNodes.length; i++ ) {
			if ( menus.childNodes[ i ].id && menus.childNodes[ i ].id.indexOf( "Menu" ) >= 0 )
				this.hide( menus.childNodes[ i ].id );
		}		
	}
	
}


