jQuery(document).ready(function(){


	
	$('.subm').mouseover(function(){
	
		var subm = $(this).parent().find('.paskutinis').show();

		
		
	});
	
	$('.subm').mouseout(function(){
		$(this).parent().find('.paskutinis').hide();
	});

	$('.paskutinis').mouseover(function(){	

		$(this).show();
		//$(this).parent().find('a').css({textDecoration: 'underline'});
	});
	
	$('.paskutinis').mouseout(function(){	
		$(this).hide();
		//$(this).parent().find('a').css({textDecoration: 'none'});
	});	

		$('.subm').mouseover(function(){
	
		var subm = $(this).parent().find('.m2_ul').show();

		
		
	});
	
	var tm=new Array;
	tm[0]=null, tm[1] = null, tm[2] = null, tm[3]=null, tm[4]=null;
	
	
	$('.subm2').mouseover(function(){
			
			var k = $('.subm2').index($(this));
	

		var subm = $(this).parent().find('.m2_ul').show();
		
	});	
	
	
	$('.subm2').mouseout(function(){

		kuris = $(this).parent().find('.m2_ul');
		$(this).parent().addClass('active');
		hideMenu(kuris);
		
	
	});

	$('.m2_ul').mouseover(function(){	

		$(this).show();
		//$(this).parent().find('a').css({textDecoration: 'underline'});
	});
	
	$('.m2_ul').mouseout(function(){

		kuris = $(this);
		hideMenu(kuris);
		//$(this).parent().find('a').css({textDecoration: 'none'});
	});	
	
	
	
});
function hideMenu(t)
{	

t.parent().removeClass('active');
t.hide();
}
