//document.domain = "bujoo.com";

// Browse Type
// IE Script
var NS4;
var IE4;
if (document.all)
{
    IE4 = true;
    NS4 = false;
}
else
{
    IE4 = false;
    NS4 = true;
}
isWin = (navigator.appVersion.indexOf("Win") != -1)


/*ÀÏÁ¤½Ã°£ ¾ÏÁþµµ ¾ÈÇÏ¸é ÀÚµ¿À¸·Î ·Î±×¾Æ¿ô ÇÏ´Â ·ÎÁ÷ ½ÃÀÛ*/


if (!(getCookie("UserId")==""))
{
	setTimeout("TimeLogOut()", 1200000);
}

function TimeLogOut() {
	top.location.href='/Member/Login/Logout.joo?why=TimeOut';
}

/*ÀÏÁ¤½Ã°£ ¾ÏÁþµµ ¾ÈÇÏ¸é ÀÚµ¿À¸·Î ·Î±×ÀÎ ÇÏ´Â ·ÎÁ÷ ³¡*/


function NavigationWrite(sHTML) {
    sTDNavigation.innerHTML = sHTML;
}

// left menu rollover
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// \left menu rollover

function openwindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function popview(url,title)
{
	window.open("/_Common/Editor/showImg.joo?image="+url+"&title_name="+title,'imgsWin','width=10,height=10,scrollbars=no,toolbar=no,status=no,resizable=yes');
}

// isRegExp ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÌ Á¤±Ô½Ä°ú ÀÏÄ¡¿©ºÎ true, false ¸®ÅÏ
// re : Á¤±Ô½Ä, str : °Ë»çÇÒ ¹®ÀÚ¿­
function isRegExp(re, str){
	return (re.test(str));
}
/*
email : /\w+((-\w+)|(\.\w+)|(\_\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]{2,5}/
jumin : /\d{13}$/
phone : /\d{11}|\d{10}/
URL : /(?:ftp\:\\\\|http\:\\\\|mailto\:\\\\)?(\w+\@)?(www\.)?\w+(\.\w+)+(\:\d+)?/
id : ¿µ¼ýÀÚ 4~10 /^[a-zA-Z0-9]{4,10}/
*/

function OpenMnhBoard(serviceNum, qstring) {
	var nowTime = new Date();
	//alert(queryString);
	window.open('/minihome/Mnh_main.asp?sltServiceNum='+ serviceNum + '&targetUrl=/minihome/board/read.asp?' + qstring,'MiniHome'+nowTime.getTime(),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=0,left=0,resizable=no,width=1000,height=730,alwaysRaised=yes');
}

function GoMiniHome(iServiceNum) {
	window.open('/minihome/Mnh_main.asp?sltServiceNum='+iServiceNum,'MiniHome','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=0,left=0,resizable=no,width=1000,height=730,alwaysRaised=yes');
}

function GoMiniHomeByHomeID(iHomeID) {
	window.open('/minihome/Mnh_main.asp?sltMiniHomeNum='+iHomeID,'MiniHome','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=0,left=0,resizable=no,width=1000,height=730,alwaysRaised=yes');
}

function GoMiniHome2(iServiceNum, iMiniHomeNum) {
	window.open('/minihome/Mnh_Manager.asp?sltServiceNum='+iServiceNum+'&targetUrl=/MiniHome/Mnh_ServiceAdminFrm.asp?sltServiceNum='+iServiceNum+escape("&")+'minihomeNum='+iMiniHomeNum,'MiniHome','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=0,left=0,resizable=no,width=1000,height=730,alwaysRaised=yes');
}

function GoMiniHomeSMS(iServiceNum) {
	window.open('/minihome/Mnh_main.asp?sltServiceNum='+iServiceNum+'&targetUrl=/MiniHome/Mnh_SMS_SendFrm.asp','MiniHome','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=0,left=0,resizable=no,width=1000,height=730,alwaysRaised=yes');
}

function roundTable(objID) {
       var obj = document.getElementById(objID);
       var Parent, objTmp, Table, TBody, TR, TD;
       var bdcolor, bgcolor, Space;
       var trIDX, tdIDX, MAX;
       var styleWidth, styleHeight;

       // get parent node
       Parent = obj.parentNode;
       objTmp = document.createElement('SPAN');
       Parent.insertBefore(objTmp, obj);
       Parent.removeChild(obj);

       // get attribute
       bdcolor = obj.getAttribute('rborder');
       bgcolor = obj.getAttribute('rbgcolor');
       radius = parseInt(obj.getAttribute('radius'));
       if (radius == null || radius < 1) radius = 1;
       else if (radius > 6) radius = 6;

       MAX = radius * 2 + 1;

       /*
              create table {{
       */
       Table = document.createElement('TABLE');
       TBody = document.createElement('TBODY');

       Table.cellSpacing = 0;
       Table.cellPadding = 0;

       for (trIDX=0; trIDX < MAX; trIDX++) {
              TR = document.createElement('TR');
              Space = Math.abs(trIDX - parseInt(radius));
              for (tdIDX=0; tdIDX < MAX; tdIDX++) {
                     TD = document.createElement('TD');

                     styleWidth = '1px'; styleHeight = '1px';
                     if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
                     else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
                     else if (radius > 2) {
                            if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
                            if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
                     }

                     if (styleWidth != null) TD.style.width = styleWidth;
                     if (styleHeight != null) TD.style.height = styleHeight;

                     if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
                     else if (tdIDX > Space && Space < MAX - tdIDX - 1)  TD.style.backgroundColor = bgcolor;

                     if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
                     TR.appendChild(TD);
              }
              TBody.appendChild(TR);
       }

       /*
              }}
       */

       Table.appendChild(TBody);

       // insert table and remove original table
       Parent.insertBefore(Table, objTmp);
}


/* ÆË¾÷ °ü·Ã ÇÔ¼ö */
function open_window(url, name, width, height, feature)
{
    var oWnd;

    if (IE4 && width < window.screen.width && height < window.screen.height)
    {
        var windowX = Math.ceil( (window.screen.width  - width) / 2 );
        var windowY = Math.ceil( (window.screen.height - height) / 2 );

        oWnd = window.open(url, name, feature+",width=" + width +",height=" + height+",left="+windowX+",top="+windowY + ",resizable=yes");
    }
    else
    {
        oWnd = window.open(url, name, feature+",width=" + width +",height=" + height + ",resizable=yes");
    }

    return oWnd;
}


//ÆË¾÷¿¡¼­ xp»çÀÌÁî  º¯°æ±â´É Æ÷ÇÔ resize
function popup_resize(wid,hei){
	window.resizeTo(wid, hei);
	 if(window.navigator.userAgent.indexOf("SV1") != -1)
	{
		window.resizeBy(0, 30);
	}
}


function open_wnd(url, name, width, height)
{
    var oWnd = open_window(url, name, width, height, "toolbar=0,menubar=0,resizable=yes,scrollbars=no");
    return oWnd;
}

function pop(url,width,height,flag)
{
    if (flag == 1 )
        var oPop = open_window(url, "", width, height, "toolbar=0,menubar=0,scrollbars=yes,resizable=yes");
    else
        var oPop = open_window(url, "", width, height, "toolbar=0,menubar=0,scrollbars=no,resizable=yes");
    return oPop;
}

function pop2(url,width,height,flag)
{
    if (flag == 1)
		var oPop = open_window(url, "", width, height, "toolbar=0,menubar=0,scrollbars=no,resizable=yes");
    else
		var oPop = open_window(url, "", width, height, "toolbar=0,menubar=0,scrollbars=no,resizable=no");

	return oPop;
}

/* ÆäÀÌÁö ÀÌµ¿ °ü·Ã ÇÔ¼ö */
function toLoginPage(paramURL)
{
    if (paramURL == null || paramURL == '')
        paramURL = document.location.href;

    var url = "/Member/Login/Login.joo?url=" + paramURL;
    top.location.href = url;
}
function toLogoutPage()
{
    var url = "/Member/Login/Logout.joo";
    top.location.href = url;
}

// change admin menu's class
function admin_menu_select(menu_num)
{
    for (i=1; i<=27; i++)
    {
		var objMenu = parent.document.getElementById("menu" + i);
        if (objMenu != null && typeof(objMenu) == 'object')
        {
            if (i == menu_num)
				objMenu.className = "b u";
            else
				objMenu.className = "";
        }
    }
}


function resizepopup()
{
// var winW = 356, winH = 200;
    winW = document.body.scrollWidth;
    winH = document.body.scrollHeight;
/*
    if(winH > 550)
        winH = 550;
*/
    window.resizeTo(winW + 25,winH + 40);
}

function resizepopup2(wid)
{
    var winW = wid, winH = 200;
    winH = document.body.scrollHeight;

    if(winH > 550)
        winH = 550;

    window.resizeTo(winW,winH+40);
}

/* ÇÑ±Û ½ºÆ®¸µ Ã³¸® ÇÔ¼ö */
// string String::cut(int len, string tail)
String.prototype.cut = function(len, tail)
{
    var str = this;
    var l = 0;
    for (var i=0; i<str.length; i++)
    {
        l += (str.charCodeAt(i) > 128) ? 2 : 1;
        if (l > len) return str.substring(0,i) + tail;
    }
    return str;
}

// bool String::bytes(void)
String.prototype.bytes = function()
{
    var str = this;
    var l = 0;
    for (var i=0; i<str.length; i++)
        l += (str.charCodeAt(i) > 128) ? 2 : 1;

    return l;
}

// string String::trim();
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

// µû¿ÈÇ¥¿Í ¿ª½½·¡½¬ Ã³¸®
function replaceBackslash(paramStr)
{
    var str = paramStr;
    if (str.indexOf("\\") >= 0) str = str.replace(/\\/g, "\\\\");
    if (str.indexOf("\"") >= 0) str = str.replace(/\"/g, "\\\"");
    return str;
}

// == Iframe Handling ==
// iframe resize½Ã ÃÖ¼Ò width, height
var frmMinWidth;
var frmMinHeight;
var applyMinSize = false;
// iframe resize½Ã ÃÖ´ë width, height
var frmMaxWidth;
var frmMaxHeight;
var applyMaxSize = false;
function setMinSize(width, height)
{
    frmMinWidth = width;
    frmMinHeight = height
    applyMinSize = true;
}
function setMaxSize(width, height)
{
    frmMaxWidth = width;
    frmMaxHeight = height
    applyMaxSize = true;
}

function resizeIframe(name)
{
    if (name == null || name == "")
    {
        name = "cafe_main";
    }

    try
    {
        if (IE4)
            var oBody   = document.frames(name).document.body;
        else
            var oBody = document.getElementById(name).contentDocument.body;
        var oIFrame = document.getElementById(name);

        var frmWidth  = oBody.scrollWidth;
        var frmHeight = oBody.scrollHeight;

        if (applyMinSize)
        {
            frmWidth  = Math.max(frmWidth, frmMinWidth);
            frmHeight = Math.max(frmHeight, frmMinHeight);
        }
        if (applyMaxSize)
        {
            frmWidth  = Math.min(frmWidth, frmMaxWidth);
            frmHeight = Math.min(frmHeight, frmMaxHeight);
        }

        oIFrame.style.height = frmHeight;
        oIFrame.style.width = frmWidth;
    }
    catch (e) {}
}

function parentResizeIframe(name)
{
    if (parent && parent != this && parent.resizeIframe != null)
    {
        parent.resizeIframe(name);
    }
}

// F5¸¦ ´­·¶À»¶§ iframe ³»ºÎ¸¸ refresh µÇµµ·Ï Ã³¸® start
if (NS4)
{
    document.captureEvents(Event.KEYDOWN)
    document.onkeydown = trapRefreshNS;
}
else if (IE4)
{
    document.onkeydown = trapRefreshIE;
}

function trapRefreshNS(e)
{
    if (e.keyCode == 116)
    {
        e.cancelBubble = true;
        e.returnValue = false;
        document.location.reload();
    }
}

function trapRefreshIE()
{
    if (event.keyCode == 116)
    {
        event.keyCode = 0;
        event.cancelBubble = true;
        event.returnValue = false;
        document.location.reload();
    }
}
// F5¸¦ ´­·¶À»¶§ iframe ³»ºÎ¸¸ refresh µÇµµ·Ï Ã³¸® end

function parentPlusIframe(name, height)
{
    if (parent && parent != this && parent.plusIframe != null)
    {
        parent.plusIframe(name, height);
    }
}

function plusIframe(name, height)
{
    if (name == null || name == "")
    {
        name = "cafemain";
    }

    try
    {
        if (IE4)
            var oBody   = document.frames(name).document.body;
        else
            var oBody = document.getElementById(name).contentDocument.body;
        var oIFrame = document.getElementById(name);

        var frmWidth  = oBody.scrollWidth;
        var frmHeight  = oBody.scrollHeight;

        if (applyMinSize)
        {
            frmHeight = Math.max(frmHeight, frmMinHeight);
        }
        if (applyMaxSize)
        {
            frmHeight = Math.min(frmHeight, frmMaxHeight);
        }
        oIFrame.style.height = frmHeight + height;
    }
    catch (e)
    {
        window.status = "IFrame Size Plus Error";
    }
}


function getCookie( name ){
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}

function setCookie (name, value) {
         var argv = SetCookie.arguments;
         var argc = SetCookie.arguments.length;
         var expires = (argc > 2) ? argv[2] : null;
         var path = (argc > 3) ? argv[3] : null;
         var domain = (argc > 4) ? argv[4] : null;
         var secure = (argc > 5) ? argv[5] : false;
         document.cookie = name + "=" + escape (value) +
         ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
         ((path == null) ? "" : ("; path=" + path)) +
         ((domain == null) ? "" : ("; domain=" + domain)) +
         ((secure == true) ? "; secure" : "");
}


/* ³×ºñ°ÔÀÌ¼Ç ÀÌ¹ÌÁö ·Ñ¿À¹ö */
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô ÇÔ
function onlyNumber(el)
{
	el.value = el.value.replace(/\D/g, '');
}

// ¹ÙÀÌÆ® ¼ö ±¸ÇÏ±â
function get_byte(obj)
{
	var byte_size = 0;
	if(obj.value == null)
	{
		return 0;
	}
	else
	{
		for(var i = 0; i < obj.value.length; i++)
		{
			var chr = escape(obj.value.charAt(i));
			if(chr.length == 1)
			{
				byte_size++;
			}
			else if(chr.indexOf("%u") != -1)
			{
				byte_size += 2;
			}
			else if(chr.indexOf("%") != -1)
			{
				byte_size += chr.length / 3;
			}
		}
	}
	return byte_size;
}

// ¹øÈ£ Ã¼Å©
function numCheckRule(id)
{
	var str = "1234567890";
	var chk = 0 ;
	for(i = 0; i < id.value.length; i++)
	{
		idcheck = id.value.charAt(i);
		for(j = 0; j < str.length; j++)
		{
			if(idcheck == str.charAt(j))
			{
				chk = chk + 1
				break;
			}
			if(j == str.length)
			{
				return false;
			}
		}
	}
	if(chk == id.value.length)
	{
		return true;
	}
}

function onlyNumber(field)
{
	var valid = "0123456789";
	var ok = "yes";
	var temp;
	for(var i = 0; i < field.value.length; i++)
	{
		temp = "" + field.value.substring(i, i + 1);
		if(valid.indexOf(temp) == "-1") ok = "no";
	}
	if(ok == "no")
	{
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		field.value = "";
		field.focus();
		field.select();
	}
}

// ¼ýÀÚ¿¡ 3 ÀÚ¸®¸¶´Ù ÄÞ¸¶¸¦ Âï¾î ÁØ´Ù.
function numberComma(srcNumber, hanNumber, hiddenNumber)
{
	num1 = srcNumber.length; // ¼ýÀÚÀÇ ±æÀÌ¸¦ ±¸ÇÑ´Ù.

	src1 = srcNumber.substr(0, 1); // ÀÔ·Â¼ýÀÚÀÇ Ã¹¹øÂ°¸¦ Àß¶ó ³½´Ù.
	src2 = srcNumber.substr(1, num1); // '0' ´ÙÀ½ÀÇ ¼ýÀÚ¸¦ Àß¶ó³½´Ù.

	if(src1 == "0") // ¸¸¾à ¼ýÀÚ°¡ "0"À¸·Î ½ÃÀÛµÇ¸é ¾Õ¿¡ '0'À» »« ¼ýÀÚ¸¸Å­ ¸®ÅÏ ÇÑ´Ù.
	{
		return src2;
		srcNumber = src2;
	}

	re = /^$|,/g; // "$" and "," ÀÔ·Â Á¦°Å
	srcNumber = srcNumber.replace(re, ""); // ÄÞ¸¶¸¦ Á¦°Å ÇØÁØ´Ù.

	hiddenNumber.value = srcNumber; // È÷µç°ª¿¡ ÄÞ¸¶¸¦ »« °ªÀ» ³Ö¾îµÐ´Ù.

	var txtNumber = '' + srcNumber;
	if(isNaN(txtNumber)) // ¼ýÀÚÀÎ°¡ ºñ±³
	{
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		srcNumber.value = "";
		hanNumber.value = "";
		return 0;
	}
	else
	{
		// ¿©±â¼­ ºÎÅÍ ¼ýÀÚ¸¦ ÇÑ±Û·Î º¯È¯ ½ÃÄÑÁÖ´Â ºÎºÐ
		if(srcNumber != "")
		{
			var i, j = 0, k = 0;
			var han1 = new Array("", "ÀÏ", "ÀÌ", "»ï", "»ç", "¿À", "À°", "Ä¥", "ÆÈ", "±¸");
			var han2 = new Array("", "¸¸ ", "¾ï ", "Á¶ ", "°æ ", "ÇØ ", "½Ã ", "¾ç ", "±¸ ", "°£ ");
			var han3 = new Array("", "½Ê", "¹é", "Ãµ");
			var result = "", hangul = srcNumber + "", pm = "";
			var str = new Array(), str2 = "";
			var strTmp = new Array();

			if(parseInt(srcNumber) == 0) hanNumber.value = "¿µ"; // ÀÔ·ÂµÈ ¼ýÀÚ°¡ 0ÀÏ °æ¿ì Ã³¸®
			if(hangul.substring(0,1) == "-") // À½¼ö Ã³¸®
			{
				pm = "¸¶ÀÌ³Ê½º ";
				hangul = hangul.substring(1, hangul.length);
			}
			if(hangul.length > han2.length * 4) hanNumber.value ="too much number"; // ¹üÀ§¸¦ ³Ñ´Â ¼ýÀÚ Ã³¸® ÀÚ¸®¼ö ¹è¿­ han2¿¡ ÀÚ¸®¼ö ´ÜÀ§¸¸ Ãß°¡ÇÏ¸é ¹üÀ§°¡ ´Ã¾î³².

			for(i = hangul.length; i > 0; i = i - 4)
			{
				str[j] = hangul.substring(i - 4, i); // 4ÀÚ¸®¾¿ ²÷´Â´Ù.
				for(k = str[j].length; k > 0; k--)
				{
					strTmp[k] = (str[j].substring(k - 1, k)) ? str[j].substring(k - 1, k) : "";
					strTmp[k] = han1[parseInt(strTmp[k])];
					if(strTmp[k]) strTmp[k] += han3[str[j].length - k];
					str2 = strTmp[k] + str2;
				}
				str[j] = str2;
				if(str[j]) result = str[j] + han2[j] + result;
				// 4ÀÚ¸®¸¶´Ù ÇÑÄ­¾¿ ¶ç¿ö¼­ º¸¿©ÁÖ´Â ºÎºÐ. ¿ì¼±Àº ÁÖ¼®Ã³¸®
				// result = (str[j]) ? " " + str[j] + han2[j] + result : " " + result;

				j++; str2 = "";
			}

			hanNumber.value = pm + result + "¿ø"; // ºÎÈ£ + ¼ýÀÚ°ª
		}
		else
		{
			hanNumber.value = "";
		}

		// ¿©±â¼­ ºÎÅÍ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶¸¦ Âï¾î ÁØ´Ù.
		if(isNaN(txtNumber)) // ¼ýÀÚÀÎ°¡ ºñ±³
		{
			alert("¼ýÀÚ¸¸ ÀÔ·Â ÇÏ¼¼¿ä");
			srcNumber.value = "";
			hanNumber.value = "";
			//srcNumber.focus();
			return "0";
		}
		else
		{
			var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
			var arrNumber = txtNumber.split('.');
			arrNumber[0] += '.';
			do
			{
				arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
			}
			while(rxSplit.test(arrNumber[0]));

			if(arrNumber.length > 1)
			{
				return arrNumber.join('');
			}
			else
			{
				return arrNumber[0].split('.')[0];
			}
		}
	}
}

function hanNumbers(srcNumber, hanNumber)
{
	var i, j = 0, k = 0;
	var han1 = new Array("", "ÀÏ", "ÀÌ", "»ï", "»ç", "¿À", "À°", "Ä¥", "ÆÈ", "±¸");
	var han2 = new Array("", "¸¸ ", "¾ï ", "Á¶ ", "°æ ", "ÇØ ", "½Ã ", "¾ç ", "±¸ ", "°£ ");
	var han3 = new Array("", "½Ê", "¹é", "Ãµ");
	var result = "", hangul = srcNumber + "", pm = "";
	var str = new Array(), str2 = "";
	var strTmp = new Array();
	if(srcNumber != "")
	{
		var i, j = 0, k = 0;
		var han1 = new Array("", "ÀÏ", "ÀÌ", "»ï", "»ç", "¿À", "À°", "Ä¥", "ÆÈ", "±¸");
		var han2 = new Array("", "¸¸ ", "¾ï ", "Á¶ ", "°æ ", "ÇØ ", "½Ã ", "¾ç ", "±¸ ", "°£ ");
		var han3 = new Array("", "½Ê", "¹é", "Ãµ");
		var result = "", hangul = srcNumber + "", pm = "";
		var str = new Array(), str2 = "";
		var strTmp = new Array();

		if(parseInt(srcNumber) == 0) hanNumber.value = "¿µ"; // ÀÔ·ÂµÈ ¼ýÀÚ°¡ 0ÀÏ °æ¿ì Ã³¸®
		if(hangul.substring(0,1) == "-") // À½¼ö Ã³¸®
		{
			pm = "¸¶ÀÌ³Ê½º ";
			hangul = hangul.substring(1, hangul.length);
		}
		if(hangul.length > han2.length * 4) hanNumber.value ="too much number"; // ¹üÀ§¸¦ ³Ñ´Â ¼ýÀÚ Ã³¸® ÀÚ¸®¼ö ¹è¿­ han2¿¡ ÀÚ¸®¼ö ´ÜÀ§¸¸ Ãß°¡ÇÏ¸é ¹üÀ§°¡ ´Ã¾î³².

		for(i = hangul.length; i > 0; i = i - 4)
		{
			str[j] = hangul.substring(i - 4, i); // 4ÀÚ¸®¾¿ ²÷´Â´Ù.
			for(k = str[j].length; k > 0; k--)
			{
				strTmp[k] = (str[j].substring(k - 1, k)) ? str[j].substring(k - 1, k) : "";
				strTmp[k] = han1[parseInt(strTmp[k])];
				if(strTmp[k]) strTmp[k] += han3[str[j].length - k];
				str2 = strTmp[k] + str2;
			}
			str[j] = str2;
			if(str[j]) result = str[j] + han2[j] + result;
			// 4ÀÚ¸®¸¶´Ù ÇÑÄ­¾¿ ¶ç¿ö¼­ º¸¿©ÁÖ´Â ºÎºÐ. ¿ì¼±Àº ÁÖ¼®Ã³¸®
			// result = (str[j]) ? " " + str[j] + han2[j] + result : " " + result;

			j++; str2 = "";
		}

		hanNumber.value = pm + result + "¿ø"; // ºÎÈ£ + ¼ýÀÚ°ª
	}
	else
	{
		hanNumber.value = "";
	}
}

// ¿µ¹®, ¼ýÀÚ·Î¸¸ µÇ¾î ÀÖ´ÂÁö Ã¼Å©
function engNumCheck(str)
{
	re = /[A-Z0-9]+/i;
	if(re.test(str))
	{
		return true;
	}
	else
	{
		return false;
	}
}

//³ªÀÇ°èÁÂ Á¤º¸º¸±â ½ºÅ©¸³Æ®
function GoAccountInfoDetail(ai_idx,ai_type,sub_topmenu){

		location.href = '/MyAccount/AccountInfoDetail.joo?ai_idx=' + ai_idx + '&ai_type=' + ai_type + '&sub_topmenu=' + sub_topmenu;
}

function stretchimage(iw,ih,j){


	iWidth=parseInt(eval("document.pic"+j+".width"));
	iHeight=parseInt(eval("document.pic"+j+".height"));

	if(iWidth>parseInt(iw)){
		eval('document.pic'+j+'.height=parseInt(iw)/iWidth*iHeight;');
		eval('document.pic'+j+'.width=parseInt(iw);');
	}
	else if(iHeight>parseInt(ih)){
		eval('document.pic'+j+'.width=parseInt(ih)/iHeight*iWidth;');
		eval('document.pic'+j+'.height=parseInt(ih);');
	}

	eval('document.pic'+j+'.style.visibility="visible";');

}

function subSize3()
{
	var ParentFrame =	parent.MyBlogSub_i.document.body;
	var ContentFrame =	parent.document.all["MyBlogSub_i"];

	var ParentFrame2 = parent.parent.MyBlog_i.document.body;
	var ContentFrame2 =	parent.parent.document.all["MyBlog_i"];

	//alert(ParentFrame.scrollHeight);

	if(ParentFrame.scrollHeight <= 370)
	{
		ContentFrame2.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight) + 700;
	}
	else if(ParentFrame.scrollHeight >= 370 || ParentFrame.scrollHeight <= 800)
	{
		ContentFrame2.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight) + 450;
	}
	else
	{
		ContentFrame2.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight) + 300;
	}
}
// ÀÌ¿ë¾È³» ÆË¾÷
// UserGuide('<%= Menu %>');
// UserGuide(ÀÌ¿ë¾È³» SubMenu);

function UseGuideGo(index){

	var GuideUrl;

	if (index == "MyAccount"){
		GuideUrl = "/UseGuide/MyAccount.joo";
	}else if (index == "Send"){
		GuideUrl = "/UseGuide/SendReceive.joo";
	}else if (index == "pay"){
		GuideUrl = "/UseGuide/PayBtn.joo";
	}else if (index == "BlogMain"){
		GuideUrl = "/UseGuide/Blog.joo";
	}else if(index == "0001"){
		GuideUrl = "/UseGuide/BujooDotCom.joo";
	}else if (index == "0002"){
		GuideUrl = "/UseGuide/MemberJoin.joo";
	}else if (index == "0003"){
		GuideUrl = "/UseGuide/SendReceive.joo";
	}else if (index == "0004"){
		GuideUrl = "/UseGuide/Withdraw.joo";
	}else if (index == "0005"){
		GuideUrl = "/UseGuide/MyAccount.joo";
	}else if (index == "0006"){
		GuideUrl = "/UseGuide/PayBtn.joo";
	}else if (index == "0007"){
		GuideUrl = "/UseGuide/Blog.joo";
	}else if (index == "0008"){
		GuideUrl = "/UseGuide/MobileBujoo.joo";
	}else if (index == "0009"){
		GuideUrl = "/UseGuide/Fee.joo";
	}else if (index == "00010"){
		GuideUrl = "/UseGuide/Word.joo";
	}
	window.open(GuideUrl,'UserGuide','');
}
