﻿var active_menu = null;
var current_href = document.location.href;

$(document).ready(function(){
		$('.menu_cell').each(function(index){
			var $this = $(this);
			var a = $this.find("a:first");
			var menu_href = a.attr('href');
			if(menu_href!='#'){
				$('.menu_cell').removeClass('menu_highlight');
				if(current_href.indexOf(menu_href)!=-1){
					active_menu = $(this)[0];
					$(this).addClass('menu_highlight');
				};
				$this.click(function(){
					document.location.href=menu_href;
				});
			}
			$this.mouseover(
				function(event){
					event.stopPropagation();
					$('.menu_highlight').removeClass('menu_highlight');
					$(this).addClass('menu_highlight');
				});
		});
		
		$('body').mouseover(function(){
			$('.menu_highlight').removeClass('menu_highlight');
			$(active_menu).addClass('menu_highlight');
		});
		
	});	/* $(document).ready() */

