/**
 * @version $Id: menu.js
 */

$(document).ready(function(){

	
	// logo redirect
	$('.gh_logo h1').click(function(){
		var url = "http://www.gamer-hub.com";
		$(location).attr('href',url);
	});
	
	
	
	// toggle sub menu
	$('#show_more').click(function(){
		
		$('ul.main_menu').animate({
		
			top: '+=30'
	
		}, 'slow', function(){
			
			$('ul.sub_menu').animate({
		
				top: '-=30'
		
			}, 'slow');
			
		});
	})
	// toggle main menu
	$('#show_less').click(function(){
		
		$('ul.sub_menu').animate({
		
			top: '+=30'
	
		}, 'slow', function(){
			
			$('ul.main_menu').animate({
		
				top: '-=30'
		
			}, 'slow');
			
		});
	})
	
	
	$('ul.main_menu li, ul.sub_menu li').hover(
		function(){
	
			var myClass = $(this).attr('class');
			
			$(this).removeAttr('class');
			$(this).addClass(myClass + '_o');
			
		}, function(){
			
			var myClass = $(this).attr('class');
			
			$(this).removeAttr('class');
			$(this).addClass(myClass.replace(/_o/, ''));
			
		}
	);

	
	// roll over a gamedisplay area
	$('.game_display').hover(function(){
		
		$(this).find('.blue_ttl_bg').css('opacity', '0.5');
		
	}, function(){
		
		$(this).find('.blue_ttl_bg').css('opacity', '1');
		
	});
	

});
