// ºê¶ó¿ìÀú ÆÇº°

var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")) >= 0 ? 1 : 0;
var isMinIE6 = (isMinIE4 && navigator.appVersion.indexOf("6.")) >= 0 ? 1 : 0;
var isMinIE7 = (isMinIE4 && navigator.appVersion.indexOf("7.")) >= 0 ? 1 : 0;
var isMinIE8 = (isMinIE4 && navigator.appVersion.indexOf("8.")) >= 0 ? 1 : 0;

// JavaScript Document
function winClose() {
	window.close()
}

/**********************************************************************************
 * Title      : ¼ýÀÚÃ¼Å©
 * Dreciption : ¼ýÀÚ¸¸À¸·Î ±¸¼ºµÇ¾îÀÖ´ÂÁö ÆÇ´ÜÇÑ ÈÄ °á°ú ¹ÝÈ¯
 * Input Date : 2003/06/14
 * Return Data Type : Boolean
 * Parameter Type   : String
 * Example : IsNumber("333344") -> true
 **********************************************************************************/
function IsNumber(argu_number){
	var Number = "1234567890,";
	var ii=0;
	var L = argu_number.length;
	for (var i=0; i < L; i++) {
		ch1 = argu_number.substring(i,i+1);
		if ( Number.indexOf(ch1) < 0 ) {
			ii = 0;
			break;
		}else {
			ii = 10;
		}
	}
	if ( ii == 10 ) {
		return true;
	}else {
		return false;
	}
}

/******************************************************
 * Function¸í : NUonlyNo()
 * ¼³      ¸í : ÀÔ·ÂÇÊµå¿¡¼­ ¿ÀÁ÷ ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô ÇÑ´Ù.
 *							È£ÃâÀº OnKeyDownÀ¸·Î ÇÑ´Ù.(OnKeyPress´Â
 *							ÇÑ±ÛÀÔ·Â½Ã Àû¿ëÀÌ ¾ÈµÈ´Ù.)
 * Return     : void
 ******************************************************/
function NUonlyNo() {
	var keycode = event.keyCode;

	if( (keycode>=48&&keycode<=57) ||
			(keycode==8||keycode==9||keycode==46) ||
			(keycode>=96&&keycode<=105) ||
			(keycode>=35&&keycode<=40) ||
			(event.ctrlKey)||(keycode==67||keycode==86) ) {
		if(!(event.ctrlKey) && (keycode==67||keycode==86))	//ctrlÅ°¸¦ ´©¸£Áö ¾ÊÀº »óÅÂ¿¡¼­ c¶Ç´Â vÅ°¸¦ ´©¸£´Â °æ¿ì
			event.returnValue=false;
		else
			event.returnValue=true;	//±×¿ÜÀÇ Á¤»óÀûÀÎ ÀÔ·Â»óÈ²
	} else {
		event.returnValue=false;
	}
}

/******************************************************
 * Function¸í : NUonlyNo2()
 * ¼³      ¸í : ÀÔ·ÂÇÊµå¿¡¼­ ¿ÀÁ÷ ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô ÇÑ´Ù. '-'Æ÷ÇÔ
 *							È£ÃâÀº OnKeyDownÀ¸·Î ÇÑ´Ù.(OnKeyPress´Â
 *							ÇÑ±ÛÀÔ·Â½Ã Àû¿ëÀÌ ¾ÈµÈ´Ù.)
 * Return     : void
 ******************************************************/
function NUonlyNo2() {
	var keycode = event.keyCode;

	if( (keycode>=48&&keycode<=57) ||
			(keycode==8||keycode==9||keycode==46||keycode==189||keycode==109) ||
			(keycode>=96&&keycode<=105) ||
			(keycode>=35&&keycode<=40) ||
			(event.ctrlKey)||(keycode==67||keycode==86) ) {
		if(!(event.ctrlKey) && (keycode==67||keycode==86))	//ctrlÅ°¸¦ ´©¸£Áö ¾ÊÀº »óÅÂ¿¡¼­ c¶Ç´Â vÅ°¸¦ ´©¸£´Â °æ¿ì
			event.returnValue=false;
		else
			event.returnValue=true;	//±×¿ÜÀÇ Á¤»óÀûÀÎ ÀÔ·Â»óÈ²
	} else {
		event.returnValue=false;
	}
}

/******************************************************
 *  Function¸í : DUformatDate(obj)
 *  ¼³      ¸í : ³¯Â¥¸¦ Æ÷¸ËÈ­ ÇÏ±â À§ÇØ OnKeyPress ÀÌº¥Æ®¿¡¼­ »ç¿ë
 *  Parameter  : obj    : ³¯Â¥¸¦ ÀÔ·Â¹ÞÀº °´Ã¼
 *  Return     : 2001-01-01
 *  ºñ      °í : ex) 20010101 ==> 2001-01-01
 ******************************************************/
function DUformatDate(obj) {
	var symbol = ".";
	var str = obj.value;

	if(str.length == 4 || str.length == 7)
		obj.value = str + symbol;

	obj.focus();
}


/*------------------------------------------------------------------------
f_getByteLength()
spec	 : ÀÔ·ÂµÈ ¹®ÀÚ¿­ÀÇ ¹ÙÀÌÆ®°ªÀ» Ã¼Å© - ÃÖÇö¿À
Argument : document.frm.input_name
Return   : var ±æÀÌ
Example  : if (getByteLength(form.title) > 100) {
				alert("Á¦¸ñÀº ÇÑ±Û 50ÀÚ(¿µ¹® 100ÀÚ) ÀÌ»ó ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
		   }
------------------------------------------------------------------------*/
function f_getByteLength(input) {
    var byteLength = 0;
    for (var inx = 0; inx < input.value.length; inx++) {
        var oneChar = escape(input.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }
    return byteLength;
}

function getByteLength(str) {

    var byteLength = 0;
    for (var inx = 0; inx < str.length; inx++) {
        var oneChar = escape(str.charAt(inx));

        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }
    return byteLength;
}

function checkNumber(input) {

    if (input == null || input.value == "")
        return;

    if (!IsNumber(input.value)) {
        alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.');
        input.select();
    }
}


function setComma(str)
{
	 var str_comma = "";

	 str = ""+str+"";

	 if(str.indexOf('.') > 0){
	 	str_comma = str.substr(str.indexOf('.') , str.length);
		str = str.substr(0 , str.indexOf('.'));
	 }

	 var retValue = "";
	 for(i=0; i<str.length; i++)
	 {
        if(i > 0 && (i%3)==0)
		{
            retValue = str.charAt(str.length - i -1) + "," + retValue ;
    	}
    	else
    	{
			retValue = str.charAt(str.length - i -1) + retValue ;
        }
	}

	return retValue + str_comma;

}


function documentLocation(url)
{
	if(login_state)
	{
		document.location = url;
	}
	else
	{
		openLoginWindow();
	}
}


// private
var if_name = "layerMenu";
function openLayerMenu(uri, w, h, scrolling)
{
	try
	{
		var parentLayer = document.getElementById("popmnu");
		var childLayer = document.getElementById("popmnu_");
		childLayer.innerHTML = "<iframe allowtransparency='true' id='"+if_name+"' src='"+uri+"' width='"+w+"' height='"+h+"' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='"+scrolling+"'></iframe>";
		setLayerPosition(parentLayer);

	}
	catch(ex)
	{
		debug(ex);
	}
}

function registerLayerMenuBlur(resize)
{
	if(resize)
	{
		parent.document.getElementById(if_name).height = document.body.scrollHeight;
	}
	parent.document.getElementById(if_name).focus();
	parent.document.getElementById(if_name).onblur=closeLayerMenu;
}

function closeLayerMenu()
{
	var parentLayer = parent.document.getElementById("popmnu");
	if(!parentLayer)
	{
		parentLayer = document.getElementById("popmnu");
	}

	var childLayer = parent.document.getElementById("popmnu_");
	if(!childLayer)
	{
		childLayer = document.getElementById("popmnu_");
	}
	parentLayer.style.visibility = "hidden";
}

function moveCategoryUrl(val)
{
	document.location.href="/SellProductSubListAction.ez?category_cd="+val;
}

function changeCheckBox(formname, rootcheckname, checkname)
{

	var cb = eval("document."+formname+"."+rootcheckname)

	if(cb.checked)
	{
		cb.checked = true;
	}
	else
	{
		cb.checked = false;
	}

	checkAllCheckBox(formname,checkname,cb.checked);
}

//Ã¼Å©¹Ú½º ÀüÃ¼¼±ÅÃ, ¼±ÅÃÇØÁ¦
function checkAllCheckBox(formname, checkname, thestate){
	var el_collection=eval("document."+formname+"."+checkname)
	if(el_collection != null)
	{
		if(el_collection.length)
		{
			for (c=0;c<el_collection.length;c++){
				// Ãß°¡
				if(el_collection[c].disabled == false){
					el_collection[c].checked=thestate;
				}

			}
		}
		else
		{
			// Ãß°¡
				if(el_collection.disabled == false){
					el_collection.checked=thestate;
				}
		}
	}
}

//setCookie("20050912", "done" , 7);
function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	if(expiredays >= 0)
	{
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
	}
	else
	{
		document.cookie = name + "=" + escape( value ) + "; path=/;"
	}
}
//if(getCookie('20050912') != 'done')

//ÄíÅ°°ª ¹Þ´Â ÇÔ¼ö
function getCookie(strName) {

	var strArg = new String(strName + "=");
	var nArgLen, nCookieLen, nEnd;
	var i = 0, j;

	nArgLen    = strArg.length;
	nCookieLen = document.cookie.length;

	if(nCookieLen > 0) {
		while(i < nCookieLen) {
			 j = i + nArgLen;
			 if(document.cookie.substring(i, j) == strArg) {
			  nEnd = document.cookie.indexOf (";", j);
			  if(nEnd == -1) nEnd = document.cookie.length;
			  	return unescape(document.cookie.substring(j, nEnd));
			 }
			 i = document.cookie.indexOf(" ", i) + 1;
			 if (i == 0) break;
		}
	}
	return("");
}

//name ¿¡ ÇØ´çÇÏ´Â ÄíÅ°°ª »èÁ¦
function delCookie(name)
{
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() - 1);
	var value = getCookie(name);
	if(value != "")
	{
		document.cookie=name+"="+value+"; path=/; expires=" + todayDate.toGMTString() + ";"
	}
}

function chkLoginCookieSet()
{
	var f = document.login;

	try
	{
		if(f.id_cookie_save.checked == true)
		{
			if(f.cust_id.value.length < 1)
			{
				//alert("ÀúÀåÇÒ ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
				//document.login.userid.focus();
			}
			else
			{
				setCookie( "wemarketid", f.cust_id.value , 365 );
				//alert("¾ÆÀÌµð¸¦ ÄíÅ°Á¤º¸¿¡ ÀúÀåÇÏ¿´½À´Ï´Ù.");
			}
		}
		else
		{
			delCookie("wemarketid");
		}
	}
	catch(ex)
	{}
}


// trim ÇÔ¼ö
String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/gi, "");
}



function qrychk() {

	var f = top.main.document.searchform;
	var qry = f.qry.value.trim();

	if(qry.length < 1)
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		f.qry.value = "";
		f.qry.focus();
		return;
	}

	f.action="/SearchAction.ez";
	f.submit();
}

//ÇÑ±ÛÀÔ·Â¸·´Â½ºÅ©¸³
//##################################################################################
	function korean_check(str) {
		var i;
		var ch;

		for (i=0;i<str.length;i++) {
			ch = escape(str.charAt(i));        //ISO-Latin-1 ¹®ÀÚ¼ÂÀ¸·Î º¯°æ

			if (strCharByte(ch) == 2) {
				alert("ÇÑ±ÛÀº ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return false;
			}
		}

		return true;
	}

	function strCharByte(chStr) {
		var y = "%u";
		var z = "%";

		if (chStr == null)
			chStr = "";

		if (chStr.indexOf(y) != -1) {

			if (chStr.substring(2,4) == '00') {
				return 1;
			}
			else {
	                        return 2;        //ÇÑ±Û
	               }
	        } else if (chStr.indexOf(z) != -1) {

	                if (parseInt(chStr.substring(1,3), 16) > 127) {
	                        return 2;        //ÇÑ±Û
			}
	                else {
	                        return 1;
			}
	        } else {
	                return 1;
	        }
	}

	function test() {
		return true;
	}


//##################################################################################

/**
	¼Ò¼ýÁ¡ * ÀÚ¸® ÀÌÇÏ ¹Ý¿Ã¸²
**/
function exRound(val, pos)
{
    var rtn;
    rtn = Math.round(val * Math.pow(10, Math.abs(pos)-1))
    rtn = rtn / Math.pow(10, Math.abs(pos)-1)


    return rtn;
}

// ÀÌ¸ÞÀÏ Çü½Ä °Ë»ç

function checkemail(email){
    var rtval = false;

    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

    if (filter.test(email)) {
        rtval = true;

    } else{
        rtval = false;
    }

    return rtval;
}


//######################### ÇÑ±Û ¿µ¹® ¼ýÀÚ °Ë»ç #############################################


// ÇÑ±ÛÀÌ¿ÜÀÇ Ä³¸¯ÅÍ°¡ ÀÖÀ»°æ¿ì false
// ÇÑÀÚ³ª ¼ýÀÚ ¿µ¹®ÀÇ °æ¿ì false

function checkKoreanOnly( koreanChar ) {

   if ( koreanChar == null ) return false ;

   for(var i=0; i < koreanChar.length; i++){

     var c=koreanChar.charCodeAt(i);

     //( 0xAC00 <= c && c <= 0xD7A3 ) ÃÊÁßÁ¾¼ºÀÌ ¸ðÀÎ ÇÑ±ÛÀÚ
     //( 0x3131 <= c && c <= 0x318E ) ÀÚÀ½ ¸ðÀ½

     if( !( ( 0xAC00 <= c && c <= 0xD7A3 ) || ( 0x3131 <= c && c <= 0x318E ) ) ) {
        return false ;
     }
   }
   return true ;
}

// ¿µ¹® ÀÌ¿ÜÀÇ Ä³¸¯ÅÍ°¡ ÀÖÀ»°æ¿ì false

function checkEnglishOnly( englishChar ) {

    if ( englishChar == null ) return false ;

    for( var i=0; i < englishChar.length;i++){
       var c=englishChar.charCodeAt(i);
       if( !( (  0x61 <= c && c <= 0x7A ) || ( 0x41 <= c && c <= 0x5A ) ) ) {
        return false ;
       }
     }
    return true ;

}

// ¼ýÀÚ ÀÌ¿ÜÀÇ Ä³¸¯ÅÍ°¡ ÀÖÀ»°æ¿ì false

function checkDigitOnly( digitChar ) {

    if ( digitChar == null ) return false ;

    for(var i=0;i<digitChar.length;i++){
       var c=digitChar.charCodeAt(i);
       if( !(  0x30 <= c && c <= 0x39 ) ) {
        return false ;
       }
     }
    return true ;

}

/* byte¸¦ °Ë»çÇÏ°í ÁöÁ¤ÇÑ  byte sizeº¸´Ù Å©¸é ±×¸¸Å­ Áö¿öÁØ´Ù.
   byteCheck(100,'product_name') */

function byteLimitCheck(limitByte, contentName){
	var strCount = 0;
	var tempStr, tempStr2;
	var frm = document.getElementById(contentName);
	var size = frm.value.length;

	for(i = 0;i < size;i++)
	{
		tempStr = frm.value.charAt(i);
		if(escape(tempStr).length > 4) strCount += 2;
		else strCount += 1 ;
	}

	if (strCount > limitByte){

		strCount = 0;
		tempStr2 = "";
		for(i = 0; i < size; i++)
		{
			tempStr = frm.value.charAt(i);
			if(escape(tempStr).length > 4) strCount += 2;
			else strCount += 1 ;
			if (strCount > limitByte)
			{
				if(escape(tempStr).length > 4) strCount -= 2;
				else strCount -= 1 ;
				break;
			}
			else tempStr2 += tempStr;
		}

		frm.value = tempStr2;

		return false;

	} else {
		return true;
	}
}

/* ÇÑ±Û¾ÆÀÌµð °ª °ü·Ã */
	function CheckIDKor(s) {
		var i;
		for(i=0; i<s.length; i++) {
			if((s.substring(i, i+1)).search(/[0-9|a-z|¤¡-¤¾|¤¿-¤Ó|°¡-Èþ]/) == -1)
			{
				return false;
			}
		}
		return true;
	}

	function CheckLenEng (s, name, nMin, nMax, bIsConsonant) {

		var nStrSize = StringSize(s);
		var cPostN, cPostL;

		if (bIsConsonant) {
			cPostL = "À»";
			cPostN = "Àº";
		} else {
			cPostL = "¸¦";
			cPostN = "´Â";
		}

		if (nStrSize == 0 && nMin > 0) {
			ERRORMSG = name + cPostL + "  ÀÔ·ÂÇÒ ¼ö ÀÖ¾î¿ä.";
			return false;
		}
		if (nMin == 0 && nStrSize > nMax) {
			ERRORMSG = name + cPostN + " " + nMax +
				"ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÒ ¼ö ÀÖ¾î¿ä.\n\nÇöÀç ÀÔ·ÂµÈ ±æÀÌ : " +
				nStrSize + "ÀÚ";
			return false;
		}
		if (nStrSize < nMin || nStrSize > nMax) {
			ERRORMSG = name + cPostN + " " + nMin +
				"ÀÚ ÀÌ»ó, " + nMax +
				"ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÒ ¼ö ÀÖ¾î¿ä.\n\nÇöÀç ÀÔ·ÂµÈ ±æÀÌ : " +
				nStrSize + "ÀÚ";
			return false;
		}

		return true;
	}

	function StringSize (s) {
		var i;
		var len = 0;
		for ( i=0 ; i<s.length; i++) {
			if ( s.charCodeAt(i) > 255 ) {
				len += 2;
			} else {
				len ++;
			}
		}
		return len;
	}

//######################### ±ÝÁö ´Ü¾î °Ë»ç #############################################
	function prohibitionCheck() {
		var f = document.frm;
		//var prohibitionTxt = /(eummall|administrator|eummoney|ÀÌÀ½¸Ó´Ï|eumm|°ü¸®ÀÚ|manager|owner|eumall|fuck|dick|ass|¿ì´¨ÆÀ|¿î¿ëÆÀ|¿î¿ëÀÚ|¿µÀÚ|¿µÀÚ´Ô|¿ì´¨ÀÚ|»çÀå´Ô|È¸Àå´Ô|»çÀå|È¸Àå|¿Á¼Ç|Áö¸¶ÄÏ|Áã¸¶ÄÏ|ÀÎÅÍÆÄÅ©|gsÀÌ¼ó|gsetyq|Áö¿¡½ºÀÌ¼ó|Áã¿¡½ºÀÌ¼ó|cjmall|CJmall|·Ôµ¥È¨¼îÇÎ|Çö´ëÈ¨¼îÇÎ|½Å¼¼°è¸ô|¾¾Á¦ÀÌ¸ô|µð¾Ø¼ó|µð¾Ø¼¥|µðn¼ó|µðn¼¥|dnshop|gmarket|g¸¶ÄÏ|auction|interpark|gseshop|gsshop|lottemall|lotteimall|hmall)/gi;
		var prohibitionTxt = /(½Ã¹ß|½Ã¹ú|¾¾¹ß|¾¾¹ß³ð|¾¾¹ß³â|°³³ð|°³³â|°³»õ³¢|Áö¶ö|Áö·Ñ|Áö·²|Ä«µå±ø|card|»êÈ­¸Ó´Ï|»ê¿Í¸Ó´Ï|°³¹ßÀÚ|¿î¿µÆÀ|¿î¿ëÆÀ|È¸¿ø|ÆÇ¸ÅÀÚ|±¸¸ÅÀÚ|ÀÌ¿òÅ×±×|ÀÌÀ½Å×±×|ÀÌ¿òÅÂ±×|ÀÌ¿ò¸Ó´Ï|eumteg|eumtag|ÀÌÀ½ÅÂ±×|ÀÌÀ½¸Ó´µ|ÀÌÀ½´ÙÀÌ·ºÆ®|safebuy|¼¼ÀÌÇÁ¹ÙÀÌ|³×½ºÅ©·Î|¿¡½ºÅ©·Î|nescro|inip2p|ÀÌ´ÏÇÇÅõÇÇ|À¯´ÏÅ©·Î|unicro|¼¼ÀÌÇÁÀ¯|safeu|¼¼ÀÌÇÁ¸Å´Ï¾Æ|¼¼ÀÌÇÁ¸Þ´Ï¾Æ|safemania|eummall|administrator|eummoney|ÀÌÀ½¸Ó´Ï|eumm|°ü¸®ÀÚ|manager|owner|eumall|fuck|dick|ass|¿ì´¨ÆÀ|¿î¿ëÆÀ|¿î¿ëÀÚ|¿µÀÚ|¿µÀÚ´Ô|¿ì´¨ÀÚ|»çÀå´Ô|È¸Àå´Ô|»çÀå|È¸Àå|¿Á¼Ç|Áö¸¶ÄÏ|Áã¸¶ÄÏ|ÀÎÅÍÆÄÅ©|gsÀÌ¼ó|gsetyq|Áö¿¡½ºÀÌ¼ó|Áã¿¡½ºÀÌ¼ó|cjmall|CJmall|·Ôµ¥È¨¼îÇÎ|Çö´ëÈ¨¼îÇÎ|½Å¼¼°è¸ô|¾¾Á¦ÀÌ¸ô|µð¾Ø¼ó|µð¾Ø¼¥|µðn¼ó|µðn¼¥|dnshop|gmarket|g¸¶ÄÏ|auction|interpark|gseshop|gsshop|lottemall|lotteimall|hmall)/gi;

		if (f.cust_id.value.match(prohibitionTxt)) {
			alert("ÇØ´ç´Ü¾î¸¦ ¾ÆÀÌµð·Î »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
			f.cust_id.value = "";
			f.cust_id.focus();
			return false;

		} else {
			return true;

		}
	}

//#########    MC view ###########
	function goMcView(product_id){
		//alert("ÁØºñÁß product_id :"+product_id);
		var mc_pop = window.open("/McModifyViewAction.ez?cmd=VIEW&product_id="+product_id, "sellReg", "top=10,left=10,width=820,height=530,meubar=no,status=no,scrollbars=yes");
		mc_pop.focus();
	}

//########  guide ###########
	function goGuide(val) {
		var pdt_pop = window.open("/guide/guide_0"+val+".jsp", "goGuide", "top=10,left=10,width=737,height=600,meubar=no,status=no,scrollbars=yes");
	}


	function gtrim(strText) {
		// this will get rid of leading spaces
		while (strText.substring(0,1) == ' ')
			strText = strText.substring(1, strText.length);

		// this will get rid of trailing spaces
		while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

	   return strText;
	}



//########  CapsLock key check ###########
	var pwdCapsLockChk = false;

	function pwdCapsLockLayer(command)
	{
		var pwdCapsLockLayer = document.getElementById("pwdCapsLockLayer");

		if(command == "on")
		{
			pwdCapsLockChk = true;
		}
		else
		{
			pwdCapsLockChk = false;
			pwdCapsLockLayer.style.visibility = "hidden";
		}
	}

	function pwdCapsLockLayerChk(keys)
	{
		var pwdCapsLockLayer = document.getElementById("pwdCapsLockLayer");

		var PwdKeyCode = 0;
		var ShiftKey = false;

		if (document.all)
		{// Internet Explorer
			PwdKeyCode = keys.keyCode;
			ShiftKey = keys.shiftKey;
		}
		else if (document.layers)
		{// Netscape 4
			PwdKeyCode = keys.which;
			ShiftKey=(KeyCode == 16) ? true : false;
		}
		else if (document.getElementById)
		{// Netscape 6
			PwdKeyCode = keys.which;
			ShiftKey=(KeyCode == 16) ? true : false;
		}


		if(PwdKeyCode >= 65 && PwdKeyCode <= 90 && !ShiftKey && pwdCapsLockChk)
		{
			//pwdCapsLockChk = true;
			pwdCapsLockLayer.style.visibility = "visible";
		}
		else if(PwdKeyCode >= 97 && PwdKeyCode <= 122 && ShiftKey && pwdCapsLockChk)
		{
			//pwdCapsLockChk = true;
			pwdCapsLockLayer.style.visibility = "visible";
		}
		else
		{
			pwdCapsLockLayer.style.visibility = "hidden";
		}
}


/******************************************************
 *  Function¸í : NUremoveComma(obj)
 *  ¼³      ¸í : ÀÔ·Â¹ÞÀº °ª¿¡´Ù ÄÞ¸¶¸¦ »èÁ¦ÇÑ´Ù.
 *  Parameter  : obj : ¼ýÀÚ½ºÆ®¸µ or ½ºÆ®¸µ °´Ã¼
 *  Return     : ÄÞ¸¶ »« ½ºÆ®¸µ
 *  ºñ      °í : 12,345.22 -- 12345.22 ÇüÅÂ·Î º¯°æ
 ******************************************************/
function NUremoveComma(obj) {
	var want_val = '';

	var resultVal = '';

	if(obj == '[object]')      // obj°¡ Object¸é
		resultVal = obj.value;
	else
		resultVal = obj;

	if (resultVal.length < 1) {
		if(obj == '[object]')      // obj°¡ Object¸é
		obj.value = want_val;

		return want_val;
	}

	//°ªÀÌ Á¸ÀçÇÏ¿©¾ß¸¸ ¿¬»êÀ» ¼öÇàÇÔ

	if (resultVal.length != 0) {
		//<,>´ÜÀ§ÀÇ Ç¥±â¹ýÀ» ¿¬»ê Çü½ÄÀ¸·Î º¯È¯
		for(var i=0; i < resultVal.length; i++) {
			var digit = resultVal.charAt(i);   //i ÀÌÀüÀÇ ¹®ÀÚ¸¦ ¹Ý¿µÇÑ´Ù

			if(digit != ",")                   //<,>°¡ ¾Æ´Ñ ¹®ÀÚ´Â ´©Àû
			want_val = want_val + digit;
		}
	}

	if(obj == '[object]') {      // obj°¡ Object¸é
		obj.value = want_val;
	}

	return want_val;
}


/**********************************************************************************
 * Title      : DIV ÀÏ¹Ý alert Ã¢ ¸Þ¼¼Áö Ã³¸®
 * Dreciption : action  ¿¡¼­ ¸Þ¼¼ÁöÈ£Ãâ ½Ã  DIV_ ·Î È£ÃâÇÏ´Â°Íµé¿¡ ´ëÇÑ Ã³¸®
 * Input Date : 2008/09/18
 * Return Data Type :
 * Parameter Type   : String
 * Example :
 **********************************************************************************/
function fnActionRetMsg(msg){
	modalAlert( msg, "");
}


/**********************************************************************************
 * Title      : DIV ÀÏ¹Ý alert Ã¢ Url ÀÌµ¿ ¸Þ¼¼Áö Ã³¸®
 * Dreciption : action  ¿¡¼­ ¸Þ¼¼ÁöÈ£Ãâ ½Ã  DIV_ ·Î È£ÃâÇÏ´Â°Íµé¿¡ ´ëÇÑ Ã³¸®
 * Input Date : 2008/09/18
 * Return Data Type :
 * Parameter Type   : String
 * Example :
 **********************************************************************************/
function fnActionUrlRetMsg(msg){
	modalUrlAlert( msg );
}


/**********************************************************************************
 * Title      : DIV ÀÏ¹Ý alert Ã¢ Url ÀÌµ¿ ¸Þ¼¼Áö Ã³¸® : confirm ¿ë
 * Dreciption : action  ¿¡¼­ ¸Þ¼¼ÁöÈ£Ãâ ½Ã  DIV_ ·Î È£ÃâÇÏ´Â°Íµé¿¡ ´ëÇÑ Ã³¸®
 * Input Date : 2008/09/18
 * Return Data Type :
 * Parameter Type   : String
 * Example :
 **********************************************************************************/
function fnActionUrlConfirmRetMsg(msg){
	modalUrlConfirm( msg );
}



/**********************************************************************************
 * Title      : ¿µ¼öÁõ Ãâ·Â °ü·Ã  ½ºÅ©¸³Æ®
 * Dreciption :  jsp ¿¡¼­ ¿µ¼öÁõ Ãâ·Â °ü·Ã
  * Input Date : 2008/11/04
 * Return Data Type :
 * Parameter Type   : String
 * Example :
 **********************************************************************************/
function goReceipt(form,mxid, mxissueno, smode, billtype){
  // form,mxid, mxissueno, smode, billtype
  var form = eval("document."+form);
	form = eval("document.frm");
		//var form = document.frm;
		form.mxid.value      = mxid;
		form.mxissueno.value = mxissueno;
		form.smode.value     = smode;
		form.billtype.value  = billtype;

		var url = "https://npg.tgcorp.com/dlp/tgcorpbill.jsp?MxID="+mxid+
		"&MxIssueNO="+mxissueno+
		"&Smode="+smode+
		"&BillType="+billtype;
		var win = window.open(url, "tgcorp", "width=400,height=640,menubar=no,resizable=yes");
		if(win.focus) win.focus();

	}

/***** ¾ÆÀÌµðÃ£±â/ºñ¹øÃ£±â/È¸¿ø°¡ÀÔ*****/
/* 2010.01.05 ÀÌÀü function
// ID Ã£±â
function fnIdSearch() {

    var f = document.login;

    window.open("", "idSearch", "width=400,height=400,meubar=no,status=no,scrollbars=auto,left=50,top=50");

    f.target="idSearch";
    f.action="/customer/idsearch_reg_o.jsp";
    f.submit();
}

// È¸¿ø password Ã£±â
function fnPassSearch(str) {

    window.open("/customer/pwsearch_reg_o_new.jsp", "", "width=400,height=450,meubar=no,status=no,scrollbars=auto,left=50,top=50");
}

// ºñÈ¸¿ø password Ã£±â
function fnNCPassSearch(str) {

    window.open("/customer/pwsearch_reg_o_new_nc.jsp", "", "width=400,height=450,meubar=no,status=no,scrollbars=auto,left=50,top=50");
}
*/

// È¸¿ø°¡ÀÔ
function fnJoinCustomer(self_close) {

    window.open("/mc/index.jsp?member_reg=new", "", "");
    if (self_close) self.close();
}

// ID Ã£±â
function fnFindId(self_close) {

    window.open("/customer/find_id.jsp", "", "width=400,height=359,meubar=no,status=no,scrollbars=auto,left=50,top=50");
    if (self_close) self.close();
}

// È¸¿ø ºñ¹øÃ£±â
function fnFindPass(self_close) {

    window.open("/customer/find_pw.jsp", "", "width=400,height=433,meubar=no,status=no,scrollbars=auto,left=50,top=50");
    if (self_close) self.close();
}

// ºñÈ¸¿ø ºñ¹øÃ£±â
function fnFindNCPass(self_close) {

    window.open("/customer/find_pw_no.jsp", "", "width=400,height=399,meubar=no,status=no,scrollbars=auto,left=50,top=50");
    if (self_close) self.close();
}

// È¸¿ø°¡ÀÔ, ºñÈ¸¿ø±¸¸Å °áÁ¦Ã¢, °³ÀÎÁ¤º¸¼öÁ¤ ÀÌ¸ÞÀÏ °áÁ¦Á¤º¸¼ö½Å
function emailYN() {

    var f = document.frm;
    f.email_yn.checked = !f.email_yn.checked;
}

