$(document).ready(function(){
	
	
	$('.horizontalmenu ul.submenu')
		.hover(
		      function () {
		    	  
		    	  $(this).parents('li').addClass('menuSelected');
		    	  
		    	  
		    	  
		    	  $(this).children('.roundbottom').css('width',$(this).width());
		    	  
		        }, 
		        function () {
		           $('.horizontalmenu li.menuSelected').removeClass('menuSelected');
		        }
	
		);
	
	$('.horizontalmenu').children('ul').children('li')
		.hover(
		      function () {
		    	  
		    	  $(this).children().children('.roundbottom').css('width',$(this).children('ul.submenu').width());
		        }, 
		        function () {

		        }
	
		);	
	
	
	var checkMenuSelected = document.location.href.replace(document.location.protocol + '//' + document.location.host,'');
	
	$('.horizontalmenu ul.submenu a[href='+ checkMenuSelected + ']').addClass('initialLinkSelected').parents('li').addClass('initialMenuSelected');
	
	if ($.browser.msie) {
		/*
		 * Only for IE, since .roundbottom div is not inheriting .rounddialog width, if it is not explicitly set (i.e buttons)
		 */
		$('div.rounddialog').livequery(function(){
			
			$(this).children('.roundbottom').width($(this).width());
			
		});	
	}
		
	$('div.membermenu')
		.hover(
				function(){
					
					$('#memberMenuDiv ul').show();
				},
				function(){
					$('#memberMenuDiv ul').hide();
				}
				
		);
	
	$('#memberMenuDiv ul')
	.hover(
			function(){
				
				$(this).show();
			},
			function(){
				$(this).hide();
			}
			
	);

	$('#shortcut li')
	.hover(
			function(){
				$(this).css('list-style-image', 'url(/img/green.arrow.gif)');
			},
			function(){
				$(this).css('list-style-image', 'url(/img/black.arrow.gif)');
			}
	);
	
});