var RRRMenus = function (menu) {
	this.MenuContainer = $(menu)
	this.SubMenuParents = this.MenuContainer.find('li.hasSubMenu');
	this.Init();
};

RRRMenus.prototype = {
	Init: function () {
		var me = this;
		me.SubMenuParents.each(function (i, parent) {
			var $parent = $(parent),
				$parentAnchor = $parent.find('a:first'),
				$subMenu = $parent.find('.subMenu');
				$parent.hover(
				function () {
					$parentAnchor.addClass('active');
					$subMenu.show();
				},
				function () {
					$parentAnchor.removeClass('active');
					$subMenu.hide();
				}
			);
		});
		
	}
	
};



$(document).ready(function () {
	$('#menu').each(function () {
		new RRRMenus(this);
		
	});
	
});
