// Get time for the log function
var ts = new Date().getTime();
// MENU function
var menu = {
	// Check if Firebug is installed and output the log
	log: function(msg){if (window.console && window.console.firebug){console.log((new Date().getTime() - ts) + ': '+ msg);};},

	init: function(){
		menu.log('init()');
	},

	domready: function(scope){
		menu.log('domready()');		
	
		if(!scope){scope = $(document);};
		
		// Boardgames rollover
		$('#boardgames', scope).hover(
			function () {
				$('#boardgames-expand').css('display','block');
			},
			function () {
				$('#boardgames-expand').css('display','none');
			}
		);
		$('#boardgames-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#boardgames').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#boardgames').removeClass('current');
			}
		);	
		// Sportscards rollover
		$('#sportscards', scope).hover(
			function () {
				$('#sportscards-expand').css('display','block');
			},
			function () {
				$('#sportscards-expand').css('display','none');
			}
		);
		$('#sportscards-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#sportscards').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#sportscards').removeClass('current');
			}
		);
		// Card Games rollover
		$('#cardgames', scope).hover(
			function () {
				$('#cardgames-expand').css('display','block');
			},
			function () {
				$('#cardgames-expand').css('display','none');
			}
		);
		$('#cardgames-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#cardgames').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#cardgames').removeClass('current');
			}
		);
			
		// Miniatures rollover
		$('#miniatures', scope).hover(
			function () {
				$('#miniatures-expand').css('display','block');
			},
			function () {
				$('#miniatures-expand').css('display','none');
			}
		);
		$('#miniatures-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#miniatures').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#miniatures').removeClass('current');
			}
		);	
		// RPGs rollover
		$('#rpg', scope).hover(
			function () {
				$('#rpg-expand').css('display','block');
			},
			function () {
				$('#rpg-expand').css('display','none');
			}
		);
		$('#rpg-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#rpg').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#rpg').removeClass('current');
			}
		);	
		// Toys rollover
		$('#toys', scope).hover(
			function () {
				$('#toys-expand').css('display','block');
			},
			function () {
				$('#toys-expand').css('display','none');
			}
		);
		$('#toys-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#toys').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#toys').removeClass('current');
			}
		);	
		// Other Products rollover
		$('#other', scope).hover(
			function () {
				$('#other-expand').css('display','block');
			},
			function () {
				$('#other-expand').css('display','none');
			}
		);
		$('#other-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#other').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#other').removeClass('current');
			}
		);	
		// Events rollover
		$('#events', scope).hover(
			function () {
				$('#events-expand').css('display','block');
			},
			function () {
				$('#events-expand').css('display','none');
			}
		);
		$('#events-expand', scope).hover(
			function () {
				$(this).css('display','block');
				$('#events').addClass('current');
			},
			function () {
				$(this).css('display','none');
				$('#events').removeClass('current');
			}
		);	

	}
};

// Execute post DOM ready manipulation
$(document).ready(function(){menu.domready()});

// Execute pre DOM ready manipulation
menu.init();
//document.location.href = 'allaccess.htm';

