$(function(){
		$('#current').find('ul:first').show();
		$('#current').parents('ul').show();
		$('#menus div').each(function(){
			var div = $(this);
			var m = div.parents('li:first').find('ul:first');
			if(m.get(0)){
				if(div.parent('li').find('ul:first').is(':visible')){
						div.attr('class','drop');
						div.mouseover(function(){
							div.attr('class','drop_over');
						});
						div.mouseout(function(){
							div.attr('class','drop');
						})
				}
				else{
						div.attr('class','have_sub');
						div.mouseover(function(){
							div.attr('class','have_sub_over');
						});
						div.mouseout(function(){
							div.attr('class','have_sub');
						})
				}
			}
			else div.removeAttr('class');
		})
		 $('#menus div').click(function() {
					var a = $(this);
					var ul = a.parents('li:first').find('ul:first');
					if (ul.get(0)) {
							ul.toggle();
							if(a.parent('li').find('ul:first').is(':visible')){
								a.attr('class','drop');
								a.mouseover(function(){
									a.attr('class','drop_over');
								});
								a.mouseout(function(){
									a.attr('class','drop');
								})
							}
							else{
								a.attr('class','have_sub');
								a.mouseover(function(){
									a.attr('class','have_sub_over');
								});
								a.mouseout(function(){
									a.attr('class','have_sub');
								})
							}
							
					}
					
		});
		
})
