// <![CDATA[
jQuery(function(){
	
	// ¸Þ´º
	jQuery('div.gnb a')
		.mouseover(function(){
			var li = jQuery(this).parent();

			li.addClass('active');
			li.siblings().removeClass('active');
			li.find('li').removeClass('active');
		})
		.focus(function(){
			jQuery(this).mouseover();
		});
		//TODO µÎ¹øÂ° li À§Ä¡Àâ±â
		
	// ¼¿·ºÆ® ¹Ú½º
	var a_focused = false;
	jQuery('div.ft_grp > button')
		.click(function(){
			jQuery(this).next().toggle();
			return false;
		})
		.click()
		.next().find('li > a')
			.focus(function(){
				a_focused = true;
			})
			.blur(function(){
				var $ul = jQuery(this).parent().parent();

				a_focused = false;

				setTimeout(function(){
					if (a_focused) return;
					$ul.hide();
				}, 10);
			});
			
	jQuery('div.ft_fmy > button')
		.click(function(){
			jQuery(this).next().toggle();
			return false;
		})
		.click()
		.next().find('li > a')
			.focus(function(){
				a_focused = true;
			})
			.blur(function(){
				var $ul = jQuery(this).parent().parent();

				a_focused = false;

				setTimeout(function(){
					if (a_focused) return;
					$ul.hide();
				}, 10);
			});

	// ¹®¼­ ¹Ù´ÚÀ» Å¬¸¯ÇÏ¸é ¼¿·ºÆ® ¹Ú½º ¼û±è
	jQuery(document).click(function(event){
		if (typeof(event.which) == 'undefined') return;
		jQuery('div.ft_grp > ul').hide();
	});
	jQuery(document).click(function(event){
		if (typeof(event.which) == 'undefined') return;
		jQuery('div.ft_fmy > ul').hide();
	});
		
});




// ]]>
