function menu() {

	// ¸Þ´º 
	var settimeout_serial;
	var ball_w = 11;
	var ball_h = 20;
	var tpos = $('#logo').position();
	$('.topmenu').each(function(){
		var idname = '#' + this.id + '_area';
		$(this).mouseenter(function(){
			//clearTimeout(settimeout_serial);
			var pos = $(this).position();
			var addw = parseInt($(this).width()/2, 10)-ball_w;
			//$('#ball').css({left:pos.left+addw, top:pos.top+ball_h});
			//$('#ball').show(); 
				
			$(idname).css({left:tpos.left+260, top:tpos.top+102});
			$(idname).slideDown();
		});
		$(this).mouseleave(function(){

			settimeout_serial = setTimeout(function(){ $(idname).slideUp(); }, 500);
			//$(idname).slideUp(function(){
			//	$('#ball').hide(); 
			//});

		});
	});

	$('.menu_table').each(function(){
		$(this).mouseenter(function(){ 
			clearTimeout(settimeout_serial);
			//$('#ball').show();
			$(this).show();
		});
		$(this).mouseleave(function(){ 
			$(this).slideUp(function(){
				//$('#ball').hide();
			});
		});
	});

}
function rollover_init() {

	$('.oimg').each(function(){

		// rollover ¸¦ À§ÇÑ ÀÌ¹ÌÁöÀÇ class ´Â oimg ·Î ÁöÁ¤.
		// È¤Àº »óÀ§³ëµå¿¡ oimg class ÁöÁ¤.

		if (this.tagName=='IMG' || this.tagName=='INPUT') { var img = $(this); }
		else { var img = $(this).find('img'); }

		$(this).hover(
			function(){
				var src = img.attr('src').replace(/(.gif|.png|.jpg)$/, '_o$1');
				img.attr('src',src);
			},
			function(){
				var src = img.attr('src').replace(/_o(.gif|.png|.jpg)$/, '$1');
				img.attr('src',src);	
			}
		);
	});
}
function tab_event() {

	$('#navlist li').eq(0).children().addClass('tab_current');
	$('.tab_table').eq(0).show();
	$('#navlist li').each(function(){
		$(this).mouseenter(function(){
			var tab_id = 'best_' + this.id; 
			var self = $(this);
			$('.tab_table').each(function(i){
				$('#navlist li').eq(i).children().removeClass('tab_current');		
				if (this.id==tab_id) { $(this).show(); self.children().addClass('tab_current'); }
				else { $(this).hide(); }
			});
			
		});
	});
}
function left_menu() {
	
	$('.m2 li').each(function(){
		$(this).mouseenter(function(){
			$(this).children('a').css('color','#f03b26');
			var cls = '#m3_' + this.className;
			var pos = $(this).position();
			$(cls).css({left:pos.left+100, top:pos.top}).show();
			/*
			var a = $(this).children()[0];
			var b = $(this).children()[1];
			var ul = $(this).children()[1];
			if (ul.nodeName=='ul') { ul.style.display='block'; }
			*/
		});
		$(this).mouseleave(function(){
			$(this).children('a').css('color','');
			var cls = '#m3_' + this.className;
			$(cls).hide();
			$(this).css('background','');
		});
	});

	$('.m3').each(function(){
		$(this).mouseenter(function(){
			$(this).show();
		});
		$(this).mouseleave(function(){
			$(this).hide();
		});
	});
}

