Menu = function(id, menType){
	this.id = id;
	this.menType = menType;
}

Menu.prototype.getLiEl = function(){
	var pointer = this;
	var ul = $('#navigation');
	ul.children(0).each(
		function(){
			var eleSubMenu = $('ul:first', this);
//			alert(eleSubMenu.html());
			if(eleSubMenu.html())
			{
//				$(this).attr('onmouseover', 'menu1.printSubMenu(this, $(\'span:first\', this));');
//				$(this).attr('onmouseout', 'menu1.hideSubMenu($(\'span:first\', this), this);');
				$(this).mouseover(function(){pointer.printSubMenu(this, eleSubMenu)}).mouseout(function(){pointer.hideSubMenu(eleSubMenu, this)});
			}
		}
	);
}

Menu.prototype.printSubMenu = function(ele, eleSubMenu){
//	if(navigator.userAgent.indexOf("MSIE 6")>=0 || navigator.userAgent.indexOf("MSIE 7")>=0){
//		$(eleSubMenu).css({'width' : $(ele).innerWidth()})
//	}
	$(ele).addClass('selected');
//	var left = $(ele).outerWidth();
	var left = $(ele).position().left+$(ele).innerWidth();
//	var top = 0-$(ele).outerHeight();
	var top = $(ele).position().top;
//	alert(top+'     '+left);
	var pointer = this;
	if(eleSubMenu.css('display') == 'block')
		return;
	eleSubMenu.css({'left' : left, 'top' : top, 'display' : 'block', 'width' : '250px'});

//	if(navigator.userAgent.indexOf("MSIE 6")>=0)
//	$('li', eleSubMenu).each(
//		function(){
//			$(this).hover(function(){$(this).css({'background-color' : '#a3a484'})}, function(){$(this).css({'background-color' : ''})});
//		}
//	);
}

Menu.prototype.hideSubMenu = function(eleSubMenu, ele){
	$(ele).removeClass('selected');
	if(eleSubMenu.css('display') == 'none')
		return;
	eleSubMenu.css('display', 'none');
}
