
/**
 * Menus object for handling display of menu dropdowns and such
 */
var Menus = {
	// Name of the div to use
	Div: 'menu_dropdown',
	
	// Delay in milliseconds
	Delay: 500,
	
	// Current timeout, if any
	Timeut: null,
	
	// Whether or not a menu is currently being shown
	Shown: "",
	
	// Menu items to use
	Items: new Array(),
	
	// Show the appropriate catalog at the appropriate position
	Over: function(catalog, e) {
		// Make sure the catalog's valid
		if (!this.Items[catalog] || this.Items[catalog] == 'undefined')
			return;
			
		// If there's a current item being shown, hide it
		if (this.Shown != '' && this.Shown != catalog)
			this.Hide();
		else if (this.Shown == catalog) {
			// Clear timeout
			if (this.Timeout != null)
				clearTimeout(this.Timeout);			
		}
			
		// Show the new guy
		this.Shown = catalog;
		
		// Move the menu div over this-a-way
		var offsets = $(e.id).cumulativeOffset();
		var elem = $(this.Div);
		elem.style.left = (offsets.left - 6) + "px";
		elem.style.top = (offsets.top + 27) + "px";
		
		// Populate it
		elem.update(this.Items[catalog].join(''));
		
		// Show up
		this.Show(catalog);
	},
	
	// Sustain the menu being open
	Sustain: function() {
		// Kill timeout
		if (this.Timeout != null)
			clearTimeout(this.Timeout);
	},
	
	// Hide the catalog when the 'out' function is called
	Out: function() {
		// Hide this guy after the delay requested
		this.Timeout = setTimeout('Menus.Hide();', this.Delay);
	},
	
	// Hide the menu div
	Hide: function() {
		// Hide it
		$(this.Div).style.display = 'none';
		this.Shown = "";
		
		// Kill the timeout if there is one
		if (this.Timeout != null)
			clearTimeout(this.Timeout);
	},
	
	// Show the menu div
	Show: function(catalog) {
		// Show it
		$(this.Div).style.display = 'block';
		this.Shown = catalog;
		
		// Kill the timeout if there is one
		if (this.Timeout != null)
			clearTimeout(this.Timeout);
	}
}

// Add the items
				Menus.Items['Accessories'] = new Array();
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/97\'">Bib</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/98\'">Burp Cloth</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/108\'">Diaper Bag Tag</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/96\'">Diaper Stacker</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/94\'">Diaper Wipe Case</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/93\'">Grocery Cart Cover</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/103\'">Loop Toys</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/95\'">Ring Sling</div>';
				Menus.Items['Accessories'][Menus.Items['Accessories'].length] = '<div onclick="window.location = \'/categories/view/99\'">Swaddle Blanket</div>';
				Menus.Items['Baby Gear'] = new Array();
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/80\'">Bib</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/27\'">Burp Cloth</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/108\'">Diaper Bag Tag</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/85\'">Diaper Cover</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/26\'">Diaper Stacker</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/32\'">Diaper Wipe Case</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/23\'">Grocery Cart Cover</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/70\'">Loop Toys</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/86\'">Ring Sling</div>';
				Menus.Items['Baby Gear'][Menus.Items['Baby Gear'].length] = '<div onclick="window.location = \'/categories/view/83\'">Swaddle Blanket</div>';
				Menus.Items['Bedding'] = new Array();
				Menus.Items['Bedding'][Menus.Items['Bedding'].length] = '<div onclick="window.location = \'/categories/view/104\'">Diaper Stacker</div>';
				Menus.Items['Clothing'] = new Array();
				Menus.Items['Clothing'][Menus.Items['Clothing'].length] = '<div onclick="window.location = \'/categories/view/33\'">Boys</div>';
				Menus.Items['Clothing'][Menus.Items['Clothing'].length] = '<div onclick="window.location = \'/categories/view/34\'">Girls</div>';
				Menus.Items['Gifts'] = new Array();
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/49\'">Baby Shower</div>';
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/46\'">Birthday</div>';
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/47\'">Christmas</div>';
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/115\'">Diaper Bag Tag</div>';
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/113\'">Large Stuffed Animals</div>';
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/112\'">Play Food</div>';
				Menus.Items['Gifts'][Menus.Items['Gifts'].length] = '<div onclick="window.location = \'/categories/view/105\'">Small Stuffed Animals</div>';
				Menus.Items['Holiday'] = new Array();
				Menus.Items['Holiday'][Menus.Items['Holiday'].length] = '<div onclick="window.location = \'/categories/view/4\'">Fall</div>';
				Menus.Items['Holiday'][Menus.Items['Holiday'].length] = '<div onclick="window.location = \'/categories/view/2\'">Spring</div>';
				Menus.Items['Holiday'][Menus.Items['Holiday'].length] = '<div onclick="window.location = \'/categories/view/3\'">Summer</div>';
				Menus.Items['Holiday'][Menus.Items['Holiday'].length] = '<div onclick="window.location = \'/categories/view/1\'">Winter</div>';
				Menus.Items['Sale'] = new Array();
				Menus.Items['Sale'][Menus.Items['Sale'].length] = 'N/A';
				Menus.Items['Toys'] = new Array();
				Menus.Items['Toys'][Menus.Items['Toys'].length] = '<div onclick="window.location = \'/categories/view/114\'">Large Stuffed Animals</div>';
				Menus.Items['Toys'][Menus.Items['Toys'].length] = '<div onclick="window.location = \'/categories/view/19\'">Loop Toys</div>';
				Menus.Items['Toys'][Menus.Items['Toys'].length] = '<div onclick="window.location = \'/categories/view/112\'">Play Food</div>';
				Menus.Items['Toys'][Menus.Items['Toys'].length] = '<div onclick="window.location = \'/categories/view/102\'">Small Stuffed Animals</div>';


