/*=======================================================
 *  $Id: Control.js,v 1.5 2011/12/01 07:06:40 IM026 Exp $ <br>
 *  $Revision: 1.5 $ <br>
 * 
 ======================================================= */

function executeCMD(cmd) {
	var form = document.sendForm;
	if((form != undefined) && (cmd != '')) {
		form.cmd.value = cmd;
		form.submit();
	}
}



/*=======================================================
 * ¼³  ¸í : onMouseOver,onMouseOut ½Ã »ö»óÀ» ¹Ù²ãÁÜ(tr ¸¶¿ì½º ¿À¹ö½Ã ÀÌº¥Æ®)
 * »ç¿ë¹æ¹ý : <tr onMouseOver="trMouseOver(this);" onMouseOut="trMouseOut(this);">
 * ÀÛ¼ºÀÚ : À¯È¿Á¾       2006/08/09 02:31:45
 ======================================================= */
function trMouseOver(obj){
  obj.style.backgroundColor='#F0F5FD';
}

function trMouseOver1(obj){
  obj.style.backgroundColor='#FBFDF6';
}

function trMouseOver3(obj){
  obj.style.backgroundColor='#FAF4FC';
}

function trMouseOver4(obj){
  obj.style.backgroundColor='#F4F9FC';
}

function trMouseOut(obj){
  obj.style.backgroundColor='#ffffff';
}

/*
 * ¼³¸í : ±ÝÀ¶°áÁ¦¿ø ³³ºÎ ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : ÀüÀÚ³³ºÎ¹øÈ£
 */
function linkGiroEpayPopup(epayNo, memberYn, callbackFunc) {
	var memberYn = (memberYn == "N") ? "N" : "Y";

	var submitter = new formSubmitter("/");
	submitter.addElement("cmd", "LPEPDA1F0");
	submitter.addElement("epayNo", epayNo);
	submitter.addElement("memberYn", memberYn);

	var width = (memberYn == "Y") ? "720" : "530"; 
	var height = (memberYn == "Y") ? "580" : "380"; 
	var loc = getCenter(width, height, 50);
	var features = loc + ",location=no,toolbar=no,resizable=no,status=no,titlebar=no,menubar=no";
	var winName = "WETAX_GIRO";

	var giroWin = window.open("about:blank", winName, features);
	 submitter.submit(winName);
	
	giroWin.focus();

	if (typeof callbackFunc == "function") {
		waitPopupClose(giroWin, callbackFunc);
	}
}

/*
 * ¼³¸í : ¼­¿ïÀÌÅÃ½º ³³ºÎ ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : targetUrl, goji1, goji2, goji3, goji4
 */
function linkSeoulWholeEpay(targetUrl, goji1, goji2, goji3, goji4, wetaxamt) {
    if(arguments.length == 0) {
        return false;
    }
    var width = "790";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "700";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
    
    var url = "/?cmd=LPEPDA1F3&targetUrl=" + targetUrl + "&goji1=" + goji1 + "&goji2=" + goji2 + "&goji3=" + goji3 + "&goji4=" + goji4 + "&wetaxamt=" + wetaxamt;
    var winName = "SEOUL_WholeEpay";
    var loc = getCenter(width, height, 50);
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=no,titlebar=no,menubar=no";
    var giroWin = window.open(url, winName, features);
    
}

/*
 * ¼³¸í : ¼­¿ïÀÌÅÃ½º ³³ºÎÈ®ÀÎ¼­ Ãâ·Â ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : targetUrl, goji1, goji2, goji3, goji4
 */
function linkSeoulpayReceipt(targetUrl, goji1, goji2, goji3, goji4, wetaxamt) {
    if(arguments.length == 0) {
        return false;
    }
    
    var width = "754";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "520";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
    
    var url = "http://" + targetUrl + "/wetaxlink3.jsp?goji1=" + goji1 + "&goji2=" + goji2 + "&goji3=" + goji3 + "&goji4=" + goji4;
    //alert(url);
    var winName = "SEOUL_payReceipt";
    var loc = getCenter(width, height, 50);
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=no,titlebar=no,menubar=no";
    
    var giroWin = window.open(url, winName, features);
}

/*
 * ¼³¸í : ¼­¿ïÀÌÅÃ½º ³³ºÎ¼­ Ãâ·Â ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : targetUrl, goji1, goji2, goji3, goji4, tax_dt, biz_no, rvsn_yy
 */
function linkSeoulpaperPrint(targetUrl, goji1, goji2, goji3, goji4, wetaxamt, tax_dt, biz_no, rvsn_yy) {
    if(arguments.length == 0) {
        return false;
    }
    
    var width = "754";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "643";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî

    var url = "http://" + targetUrl + "/wetaxlink1.jsp?goji1=" + goji1 + "&goji2=" + goji2 + "&goji3=" + goji3 + "&goji4=" + goji4 + "&wetaxamt=" + wetaxamt + "&tax_dt=" + tax_dt + "&biz_no=" + biz_no + "&rvsn_yy=" + rvsn_yy;
    var winName = "SEOUL_PaperPrint";
    var loc = getCenter(width, height, 50);
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=no,titlebar=no,menubar=no";
    
    var giroWin = window.open(url, winName, features);
}


/*
 * ¼³¸í : ±ÝÀ¶°áÁ¦¿ø ³³ºÎ ÆäÀÌÁö(modal)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : ÀüÀÚ³³ºÎ¹øÈ£
 */
function linkGiroEpayModal(epayNo) {
    if(arguments.length == 0) {
        return false;
    }
    
    var width = "800px";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "600px";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî

    var url = "/?cmd=LPEPDA1F0&epayNo=" + epayNo;
    //var features = "help:no;edge:raised;resizable:0;status:0;location:0;titlebar:0;menubar:0;";
    var features = "dialogWidth:" + width + ";dialogHeight:" + height + ";help:no;edge:raised;resizable:0;status:0;location:0;titlebar:0;menubar:0;";
    
    var giroWin = window.showModalDialog(url, window, features);
}


/*
 * ÇØ´ç¾÷¹« 	: ¿¹¾à³³ºÎ½ÅÃ».
 * ¼³¸í 		: ±ÝÀ¶°áÁ¦¿ø ³³ºÎ ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ 		: ÀüÀÚ³³ºÎ¹øÈ£
 * ÀÛ¼ºÁ¤º¸ 	: ¹ÎÀ±°æ 20100426
 */
function linkGiroEpayRevPopup(epayNo) {
    if(arguments.length == 0) {
        return false;
    }
    
    var width = "660";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "760";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
    
    var url = "/?cmd=LPEPDA4F0&epayNo=" + epayNo;
    var winName = "WETAX_GIRO";
    var loc = getCenter(width, height, 50);
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=no,titlebar=no,menubar=no";
    
    var giroWin = window.open(url, winName, features);
    
}



/*
 * ÇØ´ç¾÷¹« 	: ¿¹¾à³³ºÎ½ÅÃ»Ãë¼Ò.
 * ¼³¸í 		: ±ÝÀ¶°áÁ¦¿ø ³³ºÎ ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ 		: ÀüÀÚ³³ºÎ¹øÈ£
 * ÀÛ¼ºÁ¤º¸ 	: ¹ÎÀ±°æ 20100716
 */
function linkGiroEpayCancelPopup(epayNo) {
    if(arguments.length == 0) {
        return false;
    }
    
    var width = "660";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "760";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
	
    var url = "/?cmd=LPEPDA4F1&epayNo=" + epayNo;
    var winName = "WETAX_GIRO";
    var loc = getCenter(width, height, 50);
    
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=no,titlebar=no,menubar=no";
    var giroWin = window.open(url, winName, features);
}

/*
 * ÇØ´ç¾÷¹« 	: ºñÈ¸¿ø ¿¹¾à³³ºÎ½ÅÃ».
 * ¼³¸í 		: ±ÝÀ¶°áÁ¦¿ø ³³ºÎ ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ 		: ÀüÀÚ³³ºÎ¹øÈ£
 * ÀÛ¼ºÁ¤º¸ 	: ¹ÎÀ±°æ 20100531
 */
function linkGiroRevNonMember(epayNo) {
    if(arguments.length == 0) {
        return false;
    }
    
    var width = "513";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "332";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
    
    var url = "/?cmd=LPEPCF3R0&epayNo=" + epayNo;
    
    var winName = "WETAX_GIRO";
    var loc = getCenter(width, height, 50);
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=yes,titlebar=no,menubar=no";
    
    var giroWin = window.open(url, winName, features);
}


/*
 * ¼³¸í : ½Å¿ëÄ«µå»ç¸¦ ÅëÇÑ ³³ºÎ ¹öÆ° Å¬¸¯½Ã °¢ ½Å¿ëÄ«µå»çÀÇ È¨ÆäÀÌÁö¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : ½Å¿ëÄ«µå»ç Á¾·ù
 * ½Å±ÔÃß°¡ : 2008.09.19 ±ÇÁ¤ÈÆ
 */
function linkCreditCardPopup(divNum) {
    if(arguments.length == 0) {
        return false;
    }
    
    //var width = "";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    //var height = "";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
    var message = "¹Ýµå½Ã È®ÀÎ ÇÏ½Ê½Ã¿À!!!\n\n½Å¿ëÄ«µå»ç¸¦ ÅëÇÑ ³³ºÎ´Â ÇØ´ç ½Å¿ëÄ«µå»ç¿Í\nÀÚÄ¡´ÜÃ¼°£¿¡ °è¾àÀÌ µÈ °æ¿ì¸¸ °¡´ÉÇÕ´Ï´Ù.\n½Å¿ëÄ«µå·Î ³³ºÎÇÏ½Ã±â Àü¿¡ ½Å¿ëÄ«µå·Î ³³ºÎ°¡\n°¡´ÉÇÑ Áö¿ªÀÎÁö ¸ÕÀú È®ÀÎÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n(È®ÀÎÀº °¢ ½Å¿ëÄ«µå»ç ¾È³»ÆäÀÌÁö¿¡¼­ ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.)\n\nÈ®ÀÎ ¹öÆ°À» Å¬¸¯ÇÏ¸é ÇØ´ç ½Å¿ëÄ«µå»ç·Î ÀÌµ¿ÇÕ´Ï´Ù.";

    if(!confirm(message)) {	return false; }
    
    var url = "";
    var winName = "";
    
    if(divNum == 1) {
    	url = "http://www.shinhancard.com/servlet/localtax/main";
    	winName = "shinhan";
    } else if(divNum == 2) {
    	url = "http://www.samsungcard.co.kr/Goood/index2.jsp?url=/Goood/finance.localtax.SPITAT100.htm";
    	winName = "samsung";
    } else if(divNum == 3) {
    	url = "http://www.hyundaicard.com/main.html?1&togo=/pc/AD100S20_01HA.do?step=10";
    	winName = "hyundai";
    }
    
    //var loc = getCenter(width, height, 50);
    var features = "location=yes,toolbar=yes,resizable=yes,status=yes,titlebar=yes,menubar=yes";
    
    var ccWin = window.open(url, winName, features);
}


function openWin(url, width, height) {
    var param = url;
    var loc = getCenter(width, height, 50);
    loc = loc + ",location=no,toolbar=no,resizable=no,status=no,titlebar=no,menubar=no";
    var popObj = window.open(param, '_blank', loc);
}

/*
 * ¼³¸í : À¥Á¢±Ù¼º°³¼± (Å°º¸µå ÄÁÆ®·Ñ °ü·Ã. onKeyPress¿¡ ÀÔ·Â)
 * ½Å±ÔÃß°¡ : 2009. 12. 01 Á¶½ÅÇý
 */
function key_ctl(function_name){
	if (event.keyCode == 13) {
		eval(function_name);
	}
}

//È­¸éÃâ·Â url ¿¹ : /jsp/common/common_prn4.jsp
function list_print(url){
	window.open( url,'','scrollbars=yes,resizable=yes width=680 height=700');
}

//»ó¼¼µµ¿ò¸» ÆË¾÷ »ç¿ë¿¹: onKeyPress="key_ctl('guide_open(\'html/help/04.html\')');"
function guide_open(url){
	window.open( url,'JSGUIDE','status=0,scrollbars=yes,resizable=0,width=856,height=600');
}








/*
 * ¼³¸í : ±ÝÀ¶°áÁ¦¿ø ÃÑ°ý³³ºÎ³³ºÎ ÆäÀÌÁö(ÆË¾÷)¸¦ ·ÎµùÇÏ±â À§ÇÑ ÇÔ¼ö.
 * ÀÎÀÚ : ÀüÀÚ³³ºÎ¹øÈ£
 * ÀÛ¼ºÁ¤º¸ : [¼º´É°³¼±]  °ûÅÂÈ¯(20100830)
 */
function linkGiroEpayTPopup(callbackFunc) {
    var width = "720";      // ÆË¾÷Ã¢ÀÇ °¡·Î »çÀÌÁî
    var height = "580";     // ÆË¾÷Ã¢ÀÇ ¼¼·Î »çÀÌÁî
    
    var url = "/?cmd=LPEPDA7F0";
	url += "&cmdCall=total";

    var winName = "WETAX_GIRO";
    var loc = getCenter(width, height, 50);
    var features = loc + ",location=no,toolbar=no,resizable=yes,status=no,titlebar=no,menubar=no";

    var giroWin = window.open(url, winName, features);
	
	giroWin.focus();

	if (typeof callbackFunc == "function") {
		waitPopupClose(giroWin, callbackFunc);
	}
}


function linkGiroEpayTPopupTprid(tprId, regNo, memberYn, callbackFunc) {
	var memberYn = (memberYn == "N") ? "N" : "Y";

	var submitter = new formSubmitter("/");
	submitter.addElement("cmd", "LPEPDA7F0");
	submitter.addElement("cmdCall", "tprId");
	submitter.addElement("memberYn", memberYn);
	submitter.addElement("tprId", tprId);
	submitter.addElement("regNo", regNo);
	//submitter.addElement("tprId", document.IssacWebEnc.issacweb_encrypt_s(tprId, keyname1));
	//submitter.addElement("regNo", document.IssacWebEnc.issacweb_encrypt_s(regNo, keyname1));
	//submitter.addElement("issacweb_data", document.IssacWebEnc.issacweb_hybrid_encrypt_s("", pubkey2, keyname1));
	
	var width = (memberYn == "Y") ? "680" : "530"; 
	var height = (memberYn == "Y") ? "680" : "380"; 
	var loc = getCenter(width, height, 50);
	var features = loc + ",location=no,toolbar=no,resizable=no,status=no,titlebar=no,menubar=no";
	var winName = "WETAX_GIRO";

	var giroWin = window.open('', winName, features);
	//submitter.submit(winName);
    XecureSubmit(submitter.submit(winName));
	giroWin.focus();

	if (typeof callbackFunc == "function") {
		waitPopupClose(giroWin, callbackFunc);
	}
}

function linkGiroEpayCPopup(formObj, memberYn, callbackFunc) {
	var memberYn = (memberYn == "N") ? "N" : "Y";
	var width = (memberYn == "Y") ? "680" : "530"; 
	var height = (memberYn == "Y") ? "680" : "380"; 

	var winName = "WETAX_GIRO";
	var loc = getCenter(width, height, 50);
	var features = loc + ",location=no,toolbar=no,resizable=no,status=no,titlebar=no,menubar=no";
	var giroWin = window.open('', winName, features);

	formObj.cmd.value = "LPEPDA7F0";
	formObj.cmdCall.value = "selected";
	formObj.target = winName;
	if (typeof formObj.memberYn != "undefined") formObj.memberYn.value = memberYn;
	formObj.submit();	
	
	giroWin.focus();

	if (typeof callbackFunc == "function") {
		waitPopupClose(giroWin, callbackFunc);
	}
}

/* °Ë»ö °á°ú ³³ºÎ */
function linkGiroEpaySearchPopup(formObj, memberYn, callbackFunc) {
	var memberYn = (memberYn == "N") ? "N" : "Y";
	var width = (memberYn == "Y") ? "680" : "530"; 
	var height = (memberYn == "Y") ? "680" : "380"; 

	var winName = "WETAX_GIRO";
	var loc = getCenter(width, height, 50);
	var features = loc + ",location=no,toolbar=no,resizable=no,status=no,titlebar=no,menubar=no";
	var giroWin = window.open('', winName, features);

	formObj.cmd.value = "LPEPDA7F0";
	formObj.cmdCall.value = "searchRst";
	formObj.target = winName;
	if (typeof formObj.memberYn != "undefined") formObj.memberYn.value = memberYn;
	formObj.submit();	
	
	giroWin.focus();

	if (typeof callbackFunc == "function") {
		waitPopupClose(giroWin, callbackFunc);
	}
}

/* ¼±ÅÃ Á¦¿Ü ³³ºÎ */
function linkGiroEpayExceptPopup(formObj, memberYn, callbackFunc) {
	var memberYn = (memberYn == "N") ? "N" : "Y";
	var width = (memberYn == "Y") ? "680" : "530"; 
	var height = (memberYn == "Y") ? "680" : "380"; 

	var winName = "WETAX_GIRO";
	var loc = getCenter(width, height, 50);
	var features = loc + ",location=no,toolbar=no,resizable=no,status=no,titlebar=no,menubar=no";
	var giroWin = window.open('', winName, features);

	formObj.cmd.value = "LPEPDA7F0";
	formObj.cmdCall.value = "exceptEpay";
	formObj.target = winName;
	if (typeof formObj.memberYn != "undefined") formObj.memberYn.value = memberYn;
	formObj.submit();	
	
	giroWin.focus();

	if (typeof callbackFunc == "function") {
		exceptWaitPopupClose(giroWin, callbackFunc);
	}
}


/* ¼±ÅÃ Á¦¿Ü ³³ºÎÀÇ °æ¿ì ºÎ¸ðÃ¢À» ¸®·Îµå ½ÃÄÑ¾ß ÇÔÀ¸·Î ¾Æ·¡ÀÇ ÇÔ¼ö¸¦ ´Ù½Ã ¸¸µç´Ù. */
function exceptWaitPopupClose(winObj, callbackFunc) {

	var focusFunc = function(event) {
		if (typeof submitted == "undefined") submitted = false;
		if (typeof winObj != "object") return false;
		if (submitted == true) return false;
		if (winObj.closed == true) {
			submitted = true;
			if (typeof callbackFunc == "function") callbackFunc();
		} else {
			//winObj.focus();
		}
	}

	if (typeof window.addEventListener != "undefined") {
		top.parent.addEventListener("focus", focusFunc, true);
	} else if (typeof window.attachEvent != "undefined") {
		top.parent.attachEvent("onfocus", focusFunc);
	} else {
		top.parent.onfocus = focusFunc;
	}
}

function waitPopupClose(winObj, callbackFunc) {
	var focusFunc = function(event) {
		if (typeof submitted == "undefined") submitted = false;
		if (typeof winObj != "object") return false;
		if (submitted == true) return false;
		if (winObj.closed == true) {
			submitted = true;
			if (typeof callbackFunc == "function") callbackFunc();
		} else {
			//winObj.focus();
		}
	}

	if (typeof window.addEventListener != "undefined") {
		window.addEventListener("focus", focusFunc, true);
	} else if (typeof window.attachEvent != "undefined") {
		window.attachEvent("onfocus", focusFunc);
	} else {
		window.onfocus = focusFunc;
	}
}

function cancelBubble(event){
	if (event.stopPropagation) event.stopPropagation();
	else event.cancelBubble=true;
}

function numberFormat(nStr) {
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

/* ÀüÀÚ³³ºÎ¹øÈ£ Ãâ·ÂÆ÷¸Ë º¯È¯ */
function formatEpayNo(epayNo) {
	epayNo = epayNo.split("-").join("").split(" ").join(""); // °ø¹é, ´ë½¬ Á¦°Å
	if (epayNo.length == 19) { // ÀüÀÚ³³ºÎ¹øÈ£(19ÀÚ¸®)
		epayNo = epayNo.replace(/^(\d{5})(\d{1})(\d{2})(\d{2})(\d{1})(\d{7})(\d{1})$/, "$1-$2-$3-$4-$5-$6-$7");
	} else { // ÀüÀÚ³³ºÎ¹øÈ£(17ÀÚ¸®)
		epayNo = epayNo.replace(/^(\d{5})(\d{1})(\d{2})(\d{2})(\d{7})$/, "$1-$2-$3-$4-$5");
	}
	return epayNo;
}

/* ½Å°íÈ®ÀÎ ¹× ³³ºÎ¾È³»¼­ Ãâ·Â */
function printNapbu(taxItem, epayNo, urlParams){
	var cmd;
	switch (taxItem) {
		case "102000": // µî·Ï¼¼
		case "114002": // µî·Ï¸éÇã¼¼(µî·Ï) / 2011
		case "114003": // µî·Ï¸éÇã¼¼(Â÷·®µî·Ï) / 2011
			cmd = "LPEPBB1T0";
		break;
		case "101001": // Ãëµæ¼¼
		case "101002": // Â÷·®Ãëµæ¼¼
		case "101501": // Ãëµæ¼¼(ºÎµ¿»ê) / 2011
		case "101502": // Ãëµæ¼¼(Â÷·®) / 2011
			cmd = "LPEPBA2T0";
		break;
		case "109000": // ·¹Àú¼¼
			cmd = "LPEPBK1T0";
		break;
		case "133000": // Áö¿ª°³¹ß¼¼
		case "135001": // Áö¿ªÀÚ¿ø½Ã¼³¼¼(Æ¯Á¤ÀÚ¿ø) / 2011
			cmd = "LPEPBJ0T0";
		break;
		case "103001": // ¸éÇã¼¼
		case "114001": // µî·Ï¸éÇã¼¼(¸éÇã) / 2011
			cmd = "LPEPBM1T0";
		break;
		case "140001": // Áö¹æ¼Òµæ¼¼ Á¾ÇÕ¼Òµæ¼¼ºÐ
		case "104004": // ÁÖ¹Î¼¼(Á¾ÇÕ¼Òµæ¼¼ÇÒ)
			cmd = "LPEPBO1T0";
		break;
		case "140002": // Áö¹æ¼Òµæ¼¼ ¾çµµ¼Òµæ¼¼ºÐ
		case "104005": // ÁÖ¹Î¼¼(¾çµµ¼Òµæ¼¼ÇÒ)
			cmd = "LPEPBP1T0";
		break;
		case "140003": // Áö¹æ¼Òµæ¼¼ ¹ýÀÎ¼¼ºÐ
		case "104006": // ÁÖ¹Î¼¼(¹ýÀÎ¼¼ÇÒ)
			cmd = "LPEPBQ1T0";
		break;
		case "140004": // Áö¹æ¼Òµæ¼¼ Æ¯º°Â¡¼ö
		case "104008": // ÁÖ¹Î¼¼(Æ¯º°Â¡¼ö)
			cmd = "LPEPBN1T0";
		break;
		case "104009": // ÁÖ¹Î¼¼ Àç»êºÐ
		case "132001": // »ç¾÷¼Ò¼¼(Àç»êÇÒ)
			cmd = "LPEPBS1T0";
		break;
		case "140011": // Áö¹æ¼Òµæ¼¼ Á¾¾÷¿øºÐ
		case "132002": // »ç¾÷¼Ò¼¼(Á¾¾÷¿øÇÒ)
			cmd = "LPEPBR1T0";
		break;
	}

	var open_url = "/?cmd=" + cmd + "&taxItem=" + taxItem + "&EPAY_NO=" + encryptValue(epayNo) + urlParams;
	var windowname = "napbuPrint";
	var winWidth   = 800;
	var winHeight  = 600;
	var winPosLeft = 30; // »õÃ¢ Y ÁÂÇ¥
	var winPosTop  = 30; // »õÃ¢ X ÁÂÇ¥

	winOpt = "width=" + winWidth + ",height=" + winHeight + ",top=" + winPosTop + ",left=" + winPosLeft;
	winOpt += ",menubar=yes,scrollbars=yes,resizable=yes,status=yes";
	cb = window.open(open_url, windowname, winOpt);
	cb.focus();
}


/* ½Å°í°á°ú¼­ Ãâ·Â */
function printSingo(taxItem, epayNo){
	var cmd;
	switch (taxItem) {
		case "104008": // ÁÖ¹Î¼¼ Æ¯º°Â¡¼ö
		case "140004": // Áö¹æ¼Òµæ¼¼ Æ¯º°Â¡¼ö
			cmd = "LPEPBC3T0";
		break;
		case "104004": // ÁÖ¹Î¼¼ Á¾ÇÕ¼Òµæ¼¼ÇÒ
		case "140001": // Áö¹æ¼Òµæ¼¼ Á¾ÇÕ¼ÒµæºÐ
			cmd = "LPEPBC4T0";
		break;
		case "104005": // ÁÖ¹Î¼¼ ¾çµµ¼Òµæ¼¼ÇÒ
		case "140002": // Áö¹æ¼Òµæ¼¼ ¾çµµ¼ÒµæºÐ
			cmd = "LPEPBC5T0";
		break;
		case "104006": // ÁÖ¹Î¼¼ ¹ýÀÎ¼¼ÇÒ
		case "140003": // Áö¹æ¼Òµæ¼¼ ¹ýÀÎ¼¼ºÐ
			cmd = "LPEPBC6T0";
		break;
		case "132002": // »ç¾÷¼Ò¼¼ Á¾¾÷¿øÇÒ
		case "140011": // Áö¹æ¼Òµæ¼¼ Á¾¾÷¿øºÐ
			cmd = "LPEPBC7T0";
		break;
		case "132001": // »ç¾÷¼Ò¼¼ Àç»êÇÒ
		case "104009": // ÁÖ¹Î¼¼ Àç»êÇÒ
			cmd = "LPEPBC8T0";
		break;
	}

	var open_url   = "/?cmd=" + cmd + "&taxItem=" + taxItem + "&EPAY_NO=" + encryptValue(epayNo);
    var windowname = "singoPrint";
	var winWidth   = 800;
	var winHeight  = 600;
	var winPosLeft = 30; // »õÃ¢ Y ÁÂÇ¥
	var winPosTop  = 30; // »õÃ¢ X ÁÂÇ¥

	winOpt = "width=" + winWidth + ",height=" + winHeight + ",top=" + winPosTop + ",left=" + winPosLeft;
	winOpt += ",menubar=yes,scrollbars=yes,resizable=yes,status=yes";
	cb = window.open(open_url, windowname, winOpt);
	cb.focus();
}



// Æû µ¿Àû »ý¼º ¹× Àü¼Û
function formSubmitter(action, name, method) {

	this.addElement = function(name, value) {
		var input = document.createElement("input");
		input.type = "hidden";
		input.name = name;
		input.value = value == null ? "" : value;
		this.form.appendChild(input);
		input = null;
	}

	this.randomId = function(prefix) {
		var rslt = prefix + (parseInt(Math.random()*10000).toString());
		if (document.getElementById(rslt)) rslt = this.randomId(prefix);
		return rslt;
	}
	
	this.destroy = function() {
		document.body.removeChild(this.container);
	}

	this.submit = function(target) {
		this.form.target = (target == null || target == "") ? "_self" : target;
		this.container.style.display = "none";
		this.container.appendChild(this.form);
		document.body.appendChild(this.container);
		this.form.submit();
		this.destroy();
	}

	this.setAction = function(action) {
		this.form.action = action;
	}

	this.getAction = function(action) {
		return this.form.action;
	}

	this.setMethod = function(method) {
		this.form.method = method;
	}

	this.getMethod = function() {
		return this.form.method;
	}

	this.getName = function() {
		return this.form.name;
	}

	this.getForm = function() {
		return this.form;
	}

	this.init = function(action, name, method) {
		this.form = document.createElement("form");
		this.form.method = (method == null || method == "") ? "post" : "get";
		this.form.action = action;
		this.form.name = (name == null || name =="") ? this.randomId("_fg_") : name;
		this.container = document.createElement("div");
		this.container.name = this.form.name + "_container";
	}

	this.init(action, name, method);
}
