/*******************************************************************************
* ÄíÆù±¸¸ÅÃ¢
*******************************************************************************/
function buycoupon()
{

	window.open('/coupon/selectcoupon.php?path='+escape(location.pathname+location.search),'coupon', 'top=50, left=50, width=700, height=400, toolbars=no,resizable=yes,scrollbars=yes,status=no');
}

/*******************************************************************************
* MMS Ã¢..
*******************************************************************************/
function mms_pop(mms_img_num)
{
	window.open('/mms/pop.php?mms_img_num='+mms_img_num,'mms', 'top=50, left=50, width=750, height=600, toolbars=no,resizable=yes,scrollbars=yes,status=no');
}

/*******************************************************************************
* »çÁøº¸³»±â
*******************************************************************************/
function mms_photo_pop(mms_img_num)
{
	window.open('/my_photo2/pop.php?mms_img_num='+mms_img_num,'mms', 'top=50, left=50, width=750, height=600, toolbars=no,resizable=yes,scrollbars=yes,status=no');
}

/*******************************************************************************
*  ºÎÀû
*******************************************************************************/
function mms_charm_pop(mms_img_num)
{
	window.open('/charm/pop.php?mms_img_num='+mms_img_num,'mms', 'top=50, left=50, width=750, height=600, toolbars=no,resizable=yes,scrollbars=yes,status=no');
}

/*******************************************************************************
* »õÃ¢
*******************************************************************************/
function openPopup(url,na,wi,he)
{
	window.open(url,na,'toolbar=no,scrollbars=no,top=200,left=300,width='+wi+',height='+he+'/');
}

/*******************************************************************************
* Æû À¯È¿¼º °Ë»ç¿¡ »ç¿ëµÇ´Â ÆÐÅÏ Á¤ÀÇ
*******************************************************************************/
var patterns = new Array();

patterns["num"]		= /^[0-9]+$/;
patterns["han"]		= /^[°¡-ÆR]+$/;
patterns["eng"]		= /^[a-zA-Z]+$/;
patterns["eng_num"]	= /^[0-9a-zA-Z]+$/;
patterns["email"]	= /^[_a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+\.[a-zA-Z]+$/; 
patterns["url"]		= /^[\.a-zA-Z0-9-]+\.[a-zA-Z]+$/; 
patterns["img"]		= /.+(\.jpg|\.gif|\.bmp|\.png|\.jpeg)+$/gi;

/*******************************************************************************
* ÀÌ¹ÌÁö Ã¼Å©
*******************************************************************************/
function is_img(str)
{
	if(str.match(patterns["img"]))	return true;
	else							return false;
}

/*******************************************************************************
* object write
*******************************************************************************/
function objWrite(str1) 
{
    document.write(str1);
}


/*******************************************************************************
* ¼ýÀÚ Ã¼Å©
*******************************************************************************/
function is_num(str)
{
	if(str.match(patterns["num"]))	return true;
	else							return false;
}

/*******************************************************************************
* ÇÑ±Û Ã¼Å©
*******************************************************************************/
function is_han(str)
{
	if(str.match(patterns["han"]))	return true;
	else							return false;
}

/*******************************************************************************
* ¿µ¹® Ã¼Å©
*******************************************************************************/
function is_eng(str)
{
	if(str.match(patterns["eng"]))	return true;
	else							return false;
}

/*******************************************************************************
* ¿µ¹®¼ýÀÚ Ã¼Å©
*******************************************************************************/
function is_engnum(str)
{
	if(str.match(patterns["eng_num"]))	return true;
	else								return false;
}

/*******************************************************************************
* ¸ÞÀÏ Ã¼Å©
*******************************************************************************/
function is_email(str)
{
	if(str.match(patterns["email"]))	return true;
	else								return false;
}

/*******************************************************************************
* URL Ã¼Å©
*******************************************************************************/
function is_url(str)
{
	if(str.match(patterns["url"]))	return true;
	else							return false;
}

/*******************************************************************************
* °ø¹éÀÎÁö
*******************************************************************************/
function is_empty(str)
{
	if(get_length(trim(str)) <= 0)	return true;
	else							return false;
}

/*******************************************************************************
* °ø¹éÁ¦°Å
*******************************************************************************/
function trim(str)
{
	return str.replace(/^\s+|\s+$/g, '');
}

function del_space(str)
{
	return str.replace(/\s+/g, '');
}

/*******************************************************************************
* ¼ýÀÚ¸¸ °¡´É
*******************************************************************************/
function del_char(obj)
{
	obj.value = obj.value.replace(/[^0-9]+/g, "");
}

/*******************************************************************************
* Ã¼Å©¹Ú½º ¼±ÅÃ
*******************************************************************************/
var checkall_flag = false;

function check_all(form, obj_name)
{
	var length = form.elements.length;

	for (var i = 0; i < length; i++)
	{
		if(form.elements[i].name == obj_name && form.elements[i].disabled  == false)
			form.elements[i].checked = !checkall_flag;
	}

	checkall_flag = !checkall_flag;
}

function check_ex(form, obj_name)
{
	var length = form.elements.length;

	for (var i = 0; i < length; i++)
	{
		if(form.elements[i].name == obj_name)
			form.elements[i].checked = !form.elements[i].checked;
	}
}


/*******************************************************************************
* Ã¼Å©¹Ú½º ¼±ÅÃµÇ¾î ÀÖ´ÂÁö
*******************************************************************************/
function is_checked(form, obj_name)
{
	var is_checked_flag = false;
	var length = form.elements.length;

	for (var i = 0; i < length; i++)
	{
		if(form.elements[i].name == obj_name && form.elements[i].checked == true)
		{
			is_checked_flag = true;
			break;
		}
	}

	return is_checked_flag;
}

/*******************************************************************************
* ¸Þ¼¼Áö ¹Ú½º ÃÊ±âÈ­
*******************************************************************************/
function init_body_box(obj)
{
	if(trim(obj.value) == "¿©±â¿¡ ¸Þ¼¼Áö¸¦ ÀÔ·ÂÇÏ¼¼¿ä.")
		obj.value = "";											
}

/*******************************************************************************
* ¹ÙÀÌÆ® Ã¼Å© 80bytes ±îÁö
*******************************************************************************/
function check_bytes(form, max_length)
{
	var page = 0;
	var body_length = get_length(form.body.value);
	
	if(body_length > max_length)
	{
		alert(max_length + "bytes ÀÌ»ó ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
		form.body.value	= cut_str(form.body.value, max_length);
		body_length		= get_length(form.body.value);
	}

	if(body_length)
		page = parseInt(body_length / 80);

	if(body_length % 80)
		page += 1;

	if(typeof(form.page) != "undefined")
		form.page.value = page;

	if(typeof(form.bytes) != "undefined")
		form.bytes.value = body_length;
}

function checkBytes2(form)
{	
	var page = 0;

	var body_length = get_length(form.body.value);	
	
	form.bytes.value = body_length;
	
	if(body_length)
		page = parseInt(body_length / 80);

	if(body_length % 80)
		page += 1;

	if(typeof(form.page) != "undefined")
		form.page.value = page;
}


/*******************************************************************************
* 80bytes¾¿.. Àß¶ó ¸®ÅÏ..
*******************************************************************************/
function get_split_body(str)
{
	var bodys		= new Array();
	var length		= 0;
	var start_idx	= 0;

	for(var i = 0; i < str.length; i++)
	{
		if(escape(str.charAt(i)).length >= 4)
			length += 2;
		else
			if(escape(str.charAt(i)) != "%0D")
				length++;

		if(length >= 80 || i == str.length - 1)
		{
			if(length > 80)
				i--;

			bodys[bodys.length] = str.substring(start_idx, i + 1);
	
			length = 0;
			start_idx = i + 1;
		}
	}

	return bodys;
}

/*******************************************************************************
* ¹®ÀÚ¿­ ÀÚ¸£±â
*******************************************************************************/
function cut_str(str, max_length)
{
	var count = 0;
	 
	for(var i = 0; i < str.length; i++)
	{
		if(escape(str.charAt(i)).length >= 4)
			count += 2;
		else
			if(escape(str.charAt(i)) != "%0D")
				count++;

		if(count > max_length)
		{
			if(escape(str.charAt(i)) == "%0A")
				i--;
			break;		
		}
	}
	
	return str.substring(0, i);
}

/*******************************************************************************
* ¹®ÀÚ¿­ ±æÀÌ¸¦ ¸®ÅÏÇÑ´Ù. 
*******************************************************************************/
function get_length(str) 
{
	var length = 0;

	for(var i = 0; i < str.length; i++)
	{
		if(escape(str.charAt(i)).length >= 4)
			length += 2;
		else if(escape(str.charAt(i)) == "%A7")
			length += 2;
		else
			if(escape(str.charAt(i)) != "%0D")
				length++;
	}	

	return length;
}

/*******************************************************************************
* ÄíÅ°°ª ¸®ÅÏ
* 
* name	-	ÄíÅ°¸í
*******************************************************************************/
function get_cookie(name)
{
	var label = name + "=";
	var label_len = label.length;
	var cookie_len = document.cookie.length;
	var i = 0;

	while (i < cookie_len) 
	{
		var j = i + label_len;

		if (document.cookie.substring(i, j) == label) 
		{
			var cookie_end = document.cookie.indexOf(";", j);
			if (cookie_end == -1) 
				cookie_end = document.cookie.length;
		
			return unescape(document.cookie.substring(j, cookie_end));
		}
		i++;
	}
	return "";
}

/*******************************************************************************
* ÄíÅ°¼³Á¤
* 
* name			-	ÄíÅ°¸í
* value			-	°ª
* expiredays	-	½Ã°£ (ÀÏ´ÜÀ§)
*******************************************************************************/
function set_cookie( name, value, expiredays )
{
	var today = new Date();
	today.setDate(today.getDate() + expiredays);
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + today.toGMTString() + ";";
}

/*******************************************************************************
* ÀÌÅë»ç ¹øÈ£ Ã¼Å©
*
* str	- ÀüÈ­¹øÈ£
*******************************************************************************/
var tel = new Array("010", "011", "016", "017", "018", "019");

function is_handphone(str)
{
	var flag = false;
	
	if(str.length > 9 && str.length < 12)
	{
		for(var i = 0; i < tel.length; i++)
		{
			if(str.substring(0, 3) == tel[i])
			{
				flag = true;
				break;
			}
		}
	}
	return flag;
}

function show_alert(msg, top, left)
{
	document.all.div_alert.innerHTML = msg;

	document.all.div_alert.style.pixelTop	= event.y + top + document.body.scrollTop;
	document.all.div_alert.style.pixelLeft	= event.x + left + document.body.scrollLeft;
	document.all.div_alert.style.display = "";
}

function hide_alert()
{
	document.all.div_alert.style.display = "none";
}

document.write("<div id='div_alert' style='z-index:1; position:absolute; background-color: #f5f5f5; border: 1px solid aaaaaa; padding: 5px; display:none'></div>");

function obj_write(str)
{
	document.write(str);
}

/*******************************************************************************
* ¹Ìµð¾î ÇÃ·¹ÀÌ¾î
*******************************************************************************/
function media_write(obj_name, w, h)
{
	obj_write("<OBJECT ID='" + obj_name + "' WIDTH=" + w + " HEIGHT=" + h + " hspace=0 vspace=0 CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject' CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'><PARAM NAME=ShowControls VALUE=0><PARAM NAME=ShowGotoBar VALUE=0><PARAM NAME=ShowStatusBar VALUE=-1><PARAM NAME=ControlType VALUE=2><PARAM NAME=AutoStart value=1><PARAM NAME=ShowDisplay value=-1><PARAM NAME=DisplayBackColor VALUE=0><PARAM NAME=DisplayForeColor VALUE=12369600><PARAM NAME=Enabled VALUE=false><PARAM NAME=EnableContextMenu Value=false><PARAM NAME=Volume value=0><PARAM NAME=BufferingTime value=0><PARAM NAME=ShowCaptioning value=false><Embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' Name='Player' width='328' height='24' SHOWSTATUSBAR='-1' SHOWCONTROLS='0' SHOWGOTOBAR='0' SHOWDISPLAY='-1' INVOKEURLS='-1' AUTOSTART='1' CLICKTOPLAY='0' DisplayForeColor='12945678' ShowCaptioning='false'></Embed></OBJECT>");
}

/*******************************************************************************
* Àü¼ÛÁß.. ¾È³»Ã¢
*******************************************************************************/
function show_sending(top, left)
{
	document.all.div_ing.style.pixelTop		= event.y + top + document.body.scrollTop;
	document.all.div_ing.style.pixelLeft	= event.x + left + document.body.scrollLeft;
	document.all.div_ing.style.display = "";

	setTimeout(function() {document.all.div_ing.style.display = "none"; }, 5000);
}

function hide_sending(target)
{
	if(target == "self")
		document.all.div_ing.style.display = "none";
	else if(target == "top")
		top.document.all.div_ing.style.display = "none";
}

/*******************************************************************************
* »ó´Ü Å¸ÀÌÆ²
*******************************************************************************/
function write_bar(str)
{
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%'>");
	document.write("<tr><td width='33'><img src='/img/pop_top_left.gif'></td>");
	document.write("<td background='/img/pop_top_mid.gif' style='padding-top:2px'><B><font color='white'>" + str + "</font></B></td>");
	document.write("<td width='9'><img src='/img/pop_top_right.gif'></td></tr></table>");
}

/*******************************************************************************
* ÆäÀÌÁö °æ°í
*******************************************************************************/
var page_alert = 0;

function check_page(page)
{
	if(page_alert == 0 && page > 1)
	{
		page_alert = 1;
		alert("ÀÛ¼ºÇÏ½Å ¸Þ¼¼Áö°¡ 80Byte(ÇÑ±Û40ÀÚ, ¿µ¹®80ÀÚ)¸¦ ÃÊ°úÇÏ¿´½À´Ï´Ù.\n\n80Byte´ç ÇÑ°ÇÀ¸·Î °ú±ÝµÇ¸ç, ¿©·¯°ÇÀ¸·Î ³ª´©¾î Àü¼ÛµË´Ï´Ù.\n\nÀü¼ÛÀü ¹Ì¸®º¸±â¸¦ ½ÇÇàÇÏ¿© ¸Þ¼¼Áö¸¦ È®ÀÎÇØ º¸½Ã±â ¹Ù¶ø´Ï´Ù.");

		document.all.preview_msg.style.display = "";
	}
	else if(page_alert == 1 && page > 1)
		document.all.preview_msg.style.display = "";
	else if(page <= 1)
		document.all.preview_msg.style.display = "none";
}

function blank_win(target, msg)
{
	var newwin = window.open("", target, "top=200, left=200, width=250, height=250");
	
	if(!newwin)
	{
		msg += "\n\n---------------------------------------------------------";
		msg += "\n\nÆË¾÷ÀÌ Â÷´ÜµÇ¾î ÀÖ½À´Ï´Ù.";
		msg += "\n\nº¸´Ù ¿øÇÒÇÑ »çÀÌÆ® ÀÌ¿ëÀ» À§ÇØ¼­ ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.";
		
		alert(msg);
	}
}

/* marquee */
var marqueeId	= null;
var marqueeObj	= null;
var marqueeOn	= false;
var marqueeCls	= new marqueeClass();

function marqueeStart (Obj) {
	if (marqueeOn) return;
	if (!Obj) return;
	if (!Obj.style) return;
	if (!Obj.style.width) return;

	if (Obj.scrollWidth > parseInt(Obj.style.width)) {
		marqueeCls.set(Obj);
		marqueeId	= setInterval('marqueeCls.scroll()',26);
	}
}

function marqueeEnd (Obj) {
	clearInterval(marqueeId);
	marqueeCls.init();
}

function marqueeClass() {
}

marqueeClass.prototype.set = function(Obj) {
	marqueeOn = true;
	marqueeObj = Obj;
	marqueeObj.style.overflow = "visible";
	marqueeObj.style.position = "relative";
	marqueeObj.style.paddingLeft = parseInt(marqueeObj.style.width);
	marqueeObj.style.paddingRight = parseInt(marqueeObj.style.width);
	marqueeObj.style.left = -66;
//	marqueeObj.style.color = "#E7406e";
	
//	marqueeObj.style.textDecoration='underline';

}

marqueeClass.prototype.init = function() {
	marqueeOn = false;
	if (!marqueeObj) return;
	marqueeObj.style.overflow = "hidden";
	marqueeObj.style.paddingLeft = 0;
	marqueeObj.style.paddingRight = 0;
	marqueeObj.style.left = 0;
//	marqueeObj.style.color = "#666666";
//	marqueeObj.style.textDecoration='none';
}

marqueeClass.prototype.scroll = function() {
	if (!marqueeObj) return;

	if (marqueeObj.scrollWidth + parseInt(marqueeObj.style.left) < parseInt(marqueeObj.style.width)) {
		marqueeObj.style.left = 0;
	} else {
		marqueeObj.style.left = parseInt(marqueeObj.style.left) - 1;
	}
}

function showDDayCalc()
{
    window.open("/mms/dday_calc.php", "dday_calc", "top=100, left=100, width=300, height=250");
}

/*******************************************************************************
* ³»¸Þ¼¼Áö ÀúÀåÇÔ °¡Á®¿À±â
*******************************************************************************/
function get_my_msg()
{
	var url = "/smsbox/my_msg.php";
	window.open(url, "my_msg", "top=100, left=100, width=600, height=500, scrollbars=yes");
}

/*******************************************************************************
* ³»¸Þ¼¼Áö ÀúÀå
*******************************************************************************/
function my_msg_save()
{
	var url = "/smsbox/my_msg_save_form.php";
	window.open(url, "my_msg_save_form", "top=100, left=100, width=300, height=200, scrollbars=yes");
}

function view(what) 
{ 
	var imgwin = window.open("", 'WIN', 'scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10'); 
	imgwin.focus(); 
	imgwin.document.open(); 
	imgwin.document.write("<html>\n"); 
	imgwin.document.write("<head>\n"); 
	imgwin.document.write("<title></title>\n"); 
	imgwin.document.write("<sc"+"ript>\n"); 
	imgwin.document.write("function resize() {\n"); 
	imgwin.document.write("pic = document.il;\n"); 
	imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
	imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 40; myWidth = eval(pic).width + 12;\n"); 
	imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 
	imgwin.document.write("  clearTimeout();\n"); 
	imgwin.document.write("  var height = screen.height;\n"); 
	imgwin.document.write("  var width = screen.width;\n"); 
	imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
	imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
	imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 
	imgwin.document.write("  self.resizeTo(myWidth, myHeight);\n"); 
	imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
	imgwin.document.write("</sc"+"ript>\n"); 
	imgwin.document.write("</head>\n"); 
	imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
	imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'>\n"); 
	imgwin.document.write("</body>\n"); 
	imgwin.document.close(); 



} 

function showHelpMsg_main(msg, top, left)
{
        document.all.show_help_msg_main.innerHTML = msg;

        document.all.show_help_msg_main.style.pixelTop       = event.y + top + document.body.scrollTop;
        document.all.show_help_msg_main.style.pixelLeft      = event.x + left + document.body.scrollLeft;
        document.all.show_help_msg_main.style.display = "";
}

function hideHelpMsg_main()
{
        document.all.show_help_msg_main.style.display = "none";
}
document.write("<div id='show_help_msg_main' style='z-index:1; position:absolute; background-color: #f5f5f5; border: 1px solid aaaaaa; padding: 5px; display:none'></div>");


// cjy - 08.09.30 Ãß°¡ 
function showHelpMsg_main2(msg, index, value, total)
{
	var top = 10;
	var left = 10;
	var right = -200;

	document.all.show_help_msg_main2.innerHTML = msg;
	if( value == "theme" )
	{
		if( index == 0 || index == 1 || index == 4 || index == 5 || index == 8 || index == 9 )
		{			
			if( index == 1 && total == 2)
			{
				document.all.show_help_msg_main2.style.pixelTop       = event.y + top + document.body.scrollTop;
				document.all.show_help_msg_main2.style.pixelLeft    = event.x + right + document.body.scrollLeft;	
	
			}
			else
			{
				document.all.show_help_msg_main2.style.pixelTop       = event.y + top + document.body.scrollTop;
				document.all.show_help_msg_main2.style.pixelLeft      = event.x + left + document.body.scrollLeft;
			}
		}
		else 
		{
			document.all.show_help_msg_main2.style.pixelTop       = event.y + top + document.body.scrollTop;
			document.all.show_help_msg_main2.style.pixelLeft    = event.x + right + document.body.scrollLeft;	
		}		
	}
	else
	{
		if( index == 0 || index == 1 || index == 4 || index == 5 || index == 8 || index == 9 || index == 12 || index == 13 )
		{
			if( index == 1 && total == 2)
			{
				document.all.show_help_msg_main2.style.pixelTop       = event.y + top + document.body.scrollTop;
				document.all.show_help_msg_main2.style.pixelLeft    = event.x + right + document.body.scrollLeft;	
	
			}
			else
			{
				document.all.show_help_msg_main2.style.pixelTop       = event.y + top + document.body.scrollTop;
				document.all.show_help_msg_main2.style.pixelLeft      = event.x + left + document.body.scrollLeft;	
			}
		}
		else 
		{
			document.all.show_help_msg_main2.style.pixelTop       = event.y + top + document.body.scrollTop;
			document.all.show_help_msg_main2.style.pixelLeft    = event.x + right + document.body.scrollLeft;	
		}
	}


	//document.all.show_help_msg_main2.style.pixelTop       = top;
	//document.all.show_help_msg_main2.style.pixelLeft      = left;
	document.all.show_help_msg_main2.style.display = "";
}

function hideHelpMsg_main2()
{
        document.all.show_help_msg_main2.style.display = "none";
}
document.write("<div id='show_help_msg_main2' style='z-index:0; position:absolute; background-color: #f5f5f5; border: 1px solid aaaaaa; padding: 5px; display:none'></div>");

// cjy - 08.09.30 Ãß°¡ 
function showHelpMsg_main3(msg, index, value, total)
{
	var top = 10;
	var left = 10;
	var right = -200;

	document.all.show_help_msg_main3.innerHTML = msg;
	if( value == "theme" )
	{
		if( index == 0 || index == 3 || index == 6 || index == 9  )
		{			
			if( index == 1 && total == 2)
			{
				document.all.show_help_msg_main3.style.pixelTop       = event.y + top + document.body.scrollTop;
				document.all.show_help_msg_main3.style.pixelLeft    = event.x + right + document.body.scrollLeft;	
	
			}
			else
			{
				document.all.show_help_msg_main3.style.pixelTop       = event.y + top + document.body.scrollTop;
				document.all.show_help_msg_main3.style.pixelLeft      = event.x + left + document.body.scrollLeft;
			}
		}
		else 
		{
			document.all.show_help_msg_main3.style.pixelTop       = event.y + top + document.body.scrollTop;
			document.all.show_help_msg_main3.style.pixelLeft    = event.x + right + document.body.scrollLeft;	
		}		
	}
	document.all.show_help_msg_main3.style.display = "";
}

function hideHelpMsg_main3()
{
        document.all.show_help_msg_main3.style.display = "none";
}
document.write("<div id='show_help_msg_main3' style='z-index:0; position:absolute; background-color: #f5f5f5; border: 1px solid aaaaaa; padding: 5px; display:none'></div>");

var category_tmp_menu_value,category_tmp_menu_value_sub;

function show_submenu(value,bgcolor)
{
	if(category_tmp_menu_value)
	{
		eval("document.all.submenu_"+category_tmp_menu_value).style.display = "none";
		eval("document.all.td_"+category_tmp_menu_value).style.backgroundColor='#FFFFFF';
	}

	eval("document.all.submenu_"+value).style.display = "";
	eval("document.all.submenu_"+value).style.top = event.y -30 + document.body.scrollTop;

	eval("document.all.td_"+value).style.backgroundColor=bgcolor;

	category_tmp_menu_value=value;

	load_img("document.all.submenu_" + value + "_img_1");
	load_img("document.all.submenu_" + value + "_img_2");
	load_img("document.all.submenu_" + value + "_img_3");
}

function load_img(obj_name)
{
	if(typeof(eval(obj_name)) != "undefined") 
	{
		var obj = eval(obj_name);
		if(obj.src != obj.getAttribute("nsrc"))
			obj.src = obj.getAttribute("nsrc");
	}
}

function show_submenu_out(value)
{
	eval("document.all.submenu_"+value).style.display = "none";
}

function show_submenu_sub(value,bgcolor)
{
	if(category_tmp_menu_value_sub)
		eval("document.all.td_sub_"+category_tmp_menu_value_sub).style.backgroundColor = "";

	eval("document.all.td_sub_"+value).style.backgroundColor = bgcolor;
	category_tmp_menu_value_sub=value;
}

function show_submenu_sub_out(value)
{
	eval("document.all.submenu_"+value).style.display = "none";
}

/*******************************************************************************
* 80bytes¾¿.. Àß¶ó ¸®ÅÏ..
*******************************************************************************/
function getParseBodys(str)
{
	var bodys		= new Array();
	var length		= 0;
	var start_idx	= 0;

	for(var i = 0; i < str.length; i++)
	{
		if(escape(str.charAt(i)).length >= 4)
			length += 2;
		else
			if(escape(str.charAt(i)) != "%0D")
				length++;

		if(length >= 80 || i == str.length - 1)
		{
			if(length > 80)
				i--;

			bodys[bodys.length] = str.substring(start_idx, i + 1);
	
			length = 0;
			start_idx = i + 1;
		}
	}

	return bodys;
}

/*******************************************************************************
* ÀÌ¸ðÆ¼ÄÜ Àû¿ë
*******************************************************************************/
function selectEmoticon(msg_no, obj)
{
	var form = document.msg_form;

	form.body.value		= obj.value;
	form.msg_no.value	= msg_no;

	//ars_service_chk();

	check_bytes(form);
}

function setSubjectShow(top, left)
{
	document.all.subject_chk.style.display = "";	
	document.all.subject_chk.style.top	= top;
	document.all.subject_chk.style.left = left;
}

function setSubjectHide()
{
	document.all.subject_chk.style.display = "none";	
	
}

function setCallbackShow(top, left)
{
	document.all.callback_chk.style.display = "";	
	document.all.callback_chk.style.top	= top;
	document.all.callback_chk.style.left = left;
}

function setCallbackHide()
{
	document.all.callback_chk.style.display = "none";	
	
}
