$(document).ready(function()
	{
//	return;
		$('.menu UL LI').removeClass('njs');
/*
		$('.menu UL LI UL').mouseover(function()
				{
					var obj = $(this);
					obj.stop();
					if($(this).parent().children('UL').css('width') != '')
					{
//						obj.css({width: '', height: '', display: '', overflow: '', opacity: 100, visibility: 'visible'});
						obj.stop().show(120, function() { $(this).parent().children('UL').show(); });
					}
					else
					{
						obj.stop().show();
					}
				});
*/
		$('.menu > UL > LI').mouseenter(function()
				{
//			debug('enter');
			var obj = $(this).children('UL');
//			debug('enter: '+obj.data('status'));
				//	var a = $(this);
			//this).parent().children('LI').children('UL')
//					alert(obj.length);
//					$('#test').html(obj.data('status'));
//					alert(obj.data('status'));
					if(obj.data('status') == 'hidding')
					{
					}
					if(obj.data('status') == 'showing')
						return;
					if(obj.data('status') == 'show')
					{
						obj.stop();
						return;
					}
					
					$('.menu UL LI UL').not($(this).children('UL')).stop().data('status', 'hidding').hide(120, function() { $(this).data('status', 'hide'); });
//					$('#test').html($(this).parent().children('LI').children('UL').not($(this).children('UL')).queue().length);
					
//					$('#test').html($('#test').html()+'enter<br />');
					obj.stop();
//					if($(this).children('UL').css('width') != '')
//					{
						obj.css({width: '', height: '', display: '', overflow: '', opacity: 100, visibility: 'visible'});
						if(obj.data('status') == 'hide' && obj.data('status') == 'hidding')
						{
							obj.animate({'font-size': ''}, 130);
						}
						obj.data('status', 'showing').show(120, function() { $(this).data('status', 'show'); });
/*					}
					else
					{
						obj.show();
					}
					*/
				});
//		$('.menu UL LI.headmenu UL').mouseover(function(event)
//				{
//					event.stopPropagation();
//				});
		$('.menu > UL > LI').mouseleave(function(obj)
				{
		//	debug('a');
//			alert('a');
//					if(typeof a != 'undefined' && $(this) != a)
//						return;
			//$('#test').html($('#test').html()+'leave<br />');
//			$('#test').html($(this).children('LI').children('UL').data('status'));
	//		alert(		
			//not($(this)).
//			alert($('.menu UL LI UL').data('status'));
					$('.menu UL LI UL').each(
							function()
							{
								if($(this).data('status') != 'hide')
								{
	//								debug('leave: '+$(this).data('status'));
									$(this).stop();
									if($(this).data('status') == 'show')
										$(this).animate({'font-size': ''}, 1000);
									$(this).data('status', 'hidding');
									$(this).hide(120, function() { $(this).data('status', 'hide'); });
									//								$('#test').html($('#test').html()+$(this).data('status')+'<br />');
								}
							});
							//stop().animate({'font-size': ''}, 1000).hide(120);
				});
		$('.menu > UL > LI.headmenu > UL').mouseover(function(event)
				{
					event.stopPropagation();
				});
		$('.menu > UL > LI.headmenu > UL').mouseout(function(event)
				{
//					event.stopPropagation();
				});
		$(document).click(function()
				{
					$('.menu UL LI UL').stop().hide(120);
				});
		$('.menu UL LI').click(function(event)
				{
					event.stopPropagation();
				});
	});
