/************************************************************************************************************
* System		: SendbillV3
* Program ID	: Common.js
* Program Name	: °øÅë JavaScript
* Author		: xlarge
* Created Date	: 2006-07-26
* -----------------------------------------------------------------------------------------------------------
* Description
* - 
* -----------------------------------------------------------------------------------------------------------
* Update History
* - 
************************************************************************************************************/
var COMMON_MESSAGE001 = "¼¼±Ý°è»ê¼­ Ãâ·Â¿¡ ÇÊ¿äÇÑ ÇÁ·Î±×·¥ÀÌ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n´ÙÀ½ ÇÁ·Î±×·¥À» ¼³Ä¡ÇÏ½ÅÈÄ ÇöÀç Ã¢À» ´Ý°í ºê¶ó¿ìÀú¸¦ ´Ù½Ã ½ÇÇàÇØ ÁÖ½Ê½Ã¿À.";
var sCurrentDivName = "";
var objTimer = null;
var objCurrentMenu = null;

//Ç³¼±µµ¿ò¸».
document.write("<DIV ID=\"divToolTipHelp\" NAME=\"divToolTipHelp\" STYLE=\"overflow-y:auto;position:absolute;z-index:99999;\"></DIV>");
document.write("<DIV ID=\"divLoading\" NAME=\"divLoading\" STYLE=\"overflow-y:auto;position:absolute;z-index:99999;\"></DIV>");

/***********************************************************************************************************
# ¼±ºÒ¿ä±Ý ÃæÀü ÆäÀÌÁö
************************************************************************************************************/
function viewCash(charge){
	if( charge == '20' || charge == '3' || charge == '4' || charge == '23' || charge == '28' )
	{
		var winPop = null;
		var sAttr = "toolbar=no,scrollbars=no,location=no,directories=no,menubar=no,resizable=no,status=yes";
		var sWidth = "700";
		var sHeight = "650";
		var url = "/service?command=netmania.sendbill.menu.ADMN.ADMN3000.ADMN3200.command.ADMN3200LF";
		winPop = openWindow(url,"SendBillCashPOP",sAttr,sWidth,sHeight);
		winPop.focus();
		winPop.opener = self;
	}
	else
	{
		alert("±Í»ç´Â ÇöÀç ÈÄºÒÁ¦¸¦ »ç¿ëÁßÀÌ¹Ç·Î ¼±ºÒÃæÀüÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.");
		return;
	}
}
/***********************************************************************************************************
# ¹«ÅëÀå ÀÔ±Ý È®ÀÎ ¿äÃ» ÆäÀÌÁö
************************************************************************************************************/
function viewAccount(){
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=no,location=no,directories=no,menubar=no,resizable=no,status=no";
	var sWidth = "600";
	var sHeight = "300";
	var url = "/service?command=netmania.sendbill.menu.COMM.COMM1000.command.COMM1000IF";
	winPop = openWindow(url,"SendBillAccountPOP",sAttr,sWidth,sHeight);
	winPop.focus();
	winPop.opener = self;
}
/***********************************************************************************************************
# CHECK BUTTON ÀÌ¹ÌÁö
************************************************************************************************************/
function changeImgOut(objArg)
{
	objArg.src = "/jsp/netmania/sendbill/frame/image/Check01On.gif";
}
function changeImgOver(objArg)
{
	objArg.src = "/jsp/netmania/sendbill/frame/image/Check01.gif";
}
function changeDTOut(objArg, nm)
{
	//for(i = 0; i < cn; i ++) 
		document.all[objArg].className = nm;
}
function changeDTOver(objArg, nm)
{
	//for(i = 0; i < cn; i ++) 
		document.all[objArg].className = nm;
}
/***********************************************************************************************************
# ´ÙÀ½°´Ã¼ Æ÷°Å½º ÀÌµ¿
************************************************************************************************************/
function nextObjFocus(pre, v, aft) {
	if (pre.value.length == v)
	{
		aft.focus();
	}
}
/***********************************************************************************************************
# ¿ù/ÀÏ ¼ÂÆÃ
************************************************************************************************************/
function setMmDd(dt, obj1, obj2){
	var sDay = String(dt).split("-");
	if( obj1.value == "" )
		obj1.value = sDay[1];
	if( obj2.value == "" )
		obj2.value = sDay[2];
}
/************************************************************************************************************
* Object°¡ ÀÖ´ÂÁö ¾ø´ÂÁö È®ÀÎ
************************************************************************************************************/
function isExistObject(Obj)
{
	var bRtn = true;

	if (Obj == undefined)
	{
		bRtn = false;
	}
	return bRtn;
}
/************************************************************************************************************
* µ¥ÀÌÅÍ Á¶È¸
************************************************************************************************************/
function Loading()
{
		var iTop = document.body.scrollTop;
		var iWidth = document.body.clientWidth;
		var iHeight = document.body.clientHeight;
		var sHtml = "";

		sHtml += "<TABLE BORDER='0' WIDTH='100%' HEIGHT='100%' CELLPADDING='0' CELLSPACING='0'>\n";
		sHtml += "	<TR>\n";
		sHtml += "		<TD ALIGN='center' VALIGN='middle'>\n";
		sHtml += "			<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0'>\n";
		sHtml += "				<TR>\n";
		sHtml += "					<TD ALIGN='center'><IMG SRC='/jsp/netmania/sendbill/frame/image/Waiting.gif'></TD>\n";
		sHtml += "				</TR>\n";
		sHtml += "			</TABLE>\n";
		sHtml += "		<TD>\n";
		sHtml += "	</TR>\n";
		sHtml += "</TABLE>\n";

		document.all["divLoading"].style.top = iTop;
		document.all["divLoading"].style.width = iWidth;
		document.all["divLoading"].style.height = iHeight;

		document.all["divLoading"].innerHTML = sHtml;
		document.all["divLoading"].style.display = "";

	window.status = "";	
}
function CloseLoading()
{
		var iTop = document.body.scrollTop;
		var iWidth = document.body.clientWidth;
		var iHeight = document.body.clientHeight;
		var sHtml = "";

		sHtml += "<TABLE BORDER='0' WIDTH='100%' HEIGHT='100%' CELLPADDING='0' CELLSPACING='0'>\n";
		sHtml += "	<TR>\n";
		sHtml += "		<TD ALIGN='center' VALIGN='middle'>\n";
		sHtml += "			<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0'>\n";
		sHtml += "				<TR>\n";
		sHtml += "					<TD ALIGN='center'><IMG SRC='/jsp/netmania/sendbill/frame/image/close.gif'></TD>\n";
		sHtml += "				</TR>\n";
		sHtml += "			</TABLE>\n";
		sHtml += "		<TD>\n";
		sHtml += "	</TR>\n";
		sHtml += "</TABLE>\n";

		document.all["divLoading"].style.top = iTop;
		document.all["divLoading"].style.width = iWidth;
		document.all["divLoading"].style.height = iHeight;

		document.all["divLoading"].innerHTML = sHtml;
		document.all["divLoading"].style.display = "";

	window.status = "";	
}
function endLoading()
{
	document.all["divLoading"].style.top = 0;
	document.all["divLoading"].style.width =0;
	document.all["divLoading"].style.height = 0;
	document.all["divLoading"].innerHTML = "";
	document.all["divLoading"].style.display = "none";
}
/************************************************************************************************************
* OS Version È®ÀÎ
************************************************************************************************************/
function getOSVersion()
{
	var sAgent = navigator.userAgent;
	var sRtn = "";

	if (sAgent.indexOf("Windows NT 5.1") >= 0)
	{
		sRtn = "Windows XP";
	}
	else
	{
		sRtn = "Windows 2000";
	}
	return sRtn;
}
/************************************************************************************************************
* ÁÂ/¿ìÃø ÇÁ·¹ÀÓ º¸ÀÌ±â/¼û±â±â
************************************************************************************************************/
function resizeL()
{
	var arrCols = window.top.MainSet.cols.split(",");
	var sRightColWidth = arrCols[2];

	if (document.all["DivHideL"].style.display == "")
	{
		window.top.MainSet.cols = "0,*," + sRightColWidth;
		document.all["DivHideL"].style.display = "none";
		document.all["DivShowL"].style.display = "";
	}
	else
	{
		window.top.MainSet.cols = "156,*," + sRightColWidth;
		document.all["DivHideL"].style.display = "";
		document.all["DivShowL"].style.display = "none";
	}
}

function resizeR()
{
	var arrCols = window.top.MainSet.cols.split(",");
	var sLeftColWidth = arrCols[0];

	if (document.all["DivHideR"].style.display == "")
	{
		window.top.MainSet.cols = sLeftColWidth + ",*,0";
		document.all["DivHideR"].style.display = "none";
		document.all["DivShowR"].style.display = "";
	}
	else
	{
		window.top.MainSet.cols = sLeftColWidth + ",*,100";
		document.all["DivHideR"].style.display = "";
		document.all["DivShowR"].style.display = "none";
	}
}

function changeImg(objArg, objArgImgName)
{
	objArg.src = objArgImgName;
}
/************************************************************************************************************
* ¸ÞÀÎÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizeMainPage()
{
	document.all["DivMainImg"].style.top = 0;
	document.all["DivMainMiddle"].style.top = document.all["DivMainImg"].offsetHeight;
	document.all["DivMainMiddle"].style.height = document.body.clientHeight - (document.all["DivMainImg"].offsetHeight + document.all["DivMainBottom"].offsetHeight);
	document.all["DivMainBottom"].style.top = document.body.clientHeight - document.all["DivMainBottom"].offsetHeight;
	document.all["DivNoticeDet"].style.height = (document.all["DivMainMiddle"].offsetHeight / 2) - (document.all["DivNoticeTit"].offsetHeight + 7);
	document.all["DivNewsDet"].style.height = (document.all["DivMainMiddle"].offsetHeight / 2) - (document.all["DivNewsTit"].offsetHeight + 7);
}
/************************************************************************************************************
* Á¶°ÇºÎÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizeFormPageCon()
{
	if( document.body.clientWidth > ( document.all["DivLeftBody"].clientWidth + 590) )
		document.all["DivCenterBody"].style.width = document.body.clientWidth - document.all["DivLeftBody"].clientWidth;
	else
		document.all["DivCenterBody"].style.width = 590;
	
	if( document.all["DivLeftBody"].clientHeight < document.all["DivCenterBody"].clientHeight )
		document.all["DivBottomBody"].style.top = document.all["DivCenterBody"].clientHeight + document.all["DivTopBody"].clientHeight;
	else
		document.all["DivBottomBody"].style.top = document.all["DivTopBody"].clientHeight + document.all["DivLeftBody"].clientHeight;
	
	document.all["DivTopBody"].style.width = (document.all["DivCenterBody"].clientWidth + document.all["DivLeftBody"].clientWidth);
}
/************************************************************************************************************
* ¸®½ºÆ®ºÎÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizeAdminFormPageQry()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
		iWidth02 = 17;
	}
	else
	{
		iWidth01 = 16;
		iWidth02 = 16;
	}

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - iWidth01;

	document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop);
	document.all["DivQry"].style.width  = document.all["DivTit"].offsetWidth + iWidth02;
}
function resizeFormPageQry()
{
	try {
		var iWidth01 = "";
		var iWidth02 = "";

		if (getOSVersion() == "Windows XP")
		{
			iWidth01 = 17;
			iWidth02 = 17;
		}
		else
		{
			iWidth01 = 16;
			iWidth02 = 16;
		}

		document.all["DivTit"].style.top   = 0;
		document.all["DivTit"].style.width = document.body.clientWidth - iWidth01;

		document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
		document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop + document.all["DivPage"].offsetHeight);
		document.all["DivQry"].style.width  = document.all["DivTit"].offsetWidth + iWidth02;
	//alert(document.body.clientHeight);
		document.all["DivPage"].style.top = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight;
	} catch (Exception) {
		//alert("size");
	}
}
function resizeFormPageQryAvgWidth()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
		iWidth02 = 17;
	}
	else
	{
		iWidth01 = 16;
		iWidth02 = 16;
	}

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - iWidth01;

	document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop + document.all["DivPage"].offsetHeight) - document.all["DivTot"].offsetHeight;
	document.all["DivQry"].style.width  = document.all["DivTit"].offsetWidth + iWidth02;

	document.all["DivTot"].style.top    = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight;

//alert(document.body.clientHeight);
	document.all["DivPage"].style.top = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight + document.all["DivTot"].offsetHeight + 1;
}
function resizeFormPageQryAvg()
{
	try
	{
		var iWidth01 = "";
		var iWidth02 = "";

		if (getOSVersion() == "Windows XP")
		{
			iWidth01 = 17;
			iWidth02 = 17;
		}
		else
		{
			iWidth01 = 16;
			iWidth02 = 16;
		}

		document.all["DivTit"].style.top   = 0;
		document.all["DivTit"].style.width = document.body.clientWidth - iWidth01;

		document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
		document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop + document.all["DivPage"].offsetHeight) - document.all["DivTot"].offsetHeight;
		document.all["DivQry"].style.width  = document.all["DivTit"].offsetWidth + iWidth02;

		document.all["DivTot"].style.top    = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight;
		document.all["DivTot"].style.width  = document.body.clientWidth - iWidth01;

	//alert(document.body.clientHeight);
		document.all["DivPage"].style.top = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight + document.all["DivTot"].offsetHeight + 1;
	} catch (Exception) {
		//alert("Å©±â°¡ ³Ê¹« ÀÛ½À´Ï´Ù...");
	}
}
function resizeFormPageQryLeft()
{
	document.all["DivTitLeft"].style.top    = 0;
	document.all["DivTitLeft"].style.left   = 0;

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - document.all["DivTitLeft"].offsetWidth;
	document.all["DivTit"].style.left  = document.all["DivTitLeft"].offsetLeft + document.all["DivTitLeft"].offsetWidth;

	document.all["DivLeft"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivLeft"].style.left   = 0;

	document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop + document.all["DivPage"].offsetHeight) - document.all["DivTot"].offsetHeight;
	document.all["DivQry"].style.width  = document.body.clientWidth - document.all["DivLeft"].offsetWidth;
	document.all["DivQry"].style.left = document.all["DivLeft"].offsetLeft + document.all["DivLeft"].offsetWidth;

	document.all["DivTot"].style.top    = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight;

	document.all["DivPage"].style.top = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight + document.all["DivTot"].offsetHeight + 1;
}
function resizeFormPageQryTree()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
		iWidth02 = 17;
	}
	else
	{
		iWidth01 = 16;
		iWidth02 = 16;
	}

	document.all["DivTitTree"].style.top    = 0;
	document.all["DivTitTree"].style.left   = 0;

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - document.all["DivTitTree"].offsetWidth - iWidth01 - iWidth01 - iWidth01 - 1;
	document.all["DivTit"].style.left  = document.all["DivTitTree"].offsetLeft + document.all["DivTitTree"].offsetWidth + iWidth02 + iWidth01;

	document.all["DivTree"].style.top    = document.all["DivTitTree"].offsetTop + document.all["DivTitTree"].offsetHeight + 1;
	document.all["DivTree"].style.left   = 0;
	document.all["DivTree"].style.width  = document.all["DivTitTree"].offsetWidth + iWidth02;
	document.all["DivTree"].style.height = document.body.clientHeight - (document.all["DivTitTree"].offsetHeight + document.all["DivTitTree"].offsetTop) - 1;

	document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop);
	document.all["DivQry"].style.width  = document.body.clientWidth - document.all["DivTree"].offsetWidth - iWidth01 - 1;
	document.all["DivQry"].style.left = document.all["DivTree"].offsetLeft + document.all["DivTree"].offsetWidth + iWidth01;
}


function resizeFormPageQryTree2()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
		iWidth02 = 17;
	}
	else
	{
		iWidth01 = 16;
		iWidth02 = 16;
	}

	document.all["DivTitTree"].style.top    = 0;
	document.all["DivTitTree"].style.left   = 0;

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - document.all["DivTitTree"].offsetWidth - iWidth01 - iWidth01 - iWidth01 - 1;
	document.all["DivTit"].style.left  = document.all["DivTitTree"].offsetLeft + document.all["DivTitTree"].offsetWidth + iWidth02 + iWidth01;

	document.all["DivTree"].style.top    = document.all["DivTitTree"].offsetTop + document.all["DivTitTree"].offsetHeight + 1;
	document.all["DivTree"].style.left   = 0;
	document.all["DivTree"].style.width  = document.all["DivTitTree"].offsetWidth + iWidth02;
	document.all["DivTree"].style.height = document.body.clientHeight - (document.all["DivTitTree"].offsetHeight + document.all["DivTitTree"].offsetTop) - 1;

	document.all["FrameQryEmp"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["FrameQryEmp"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop);
	document.all["FrameQryEmp"].style.width  = document.body.clientWidth - document.all["DivTree"].offsetWidth - iWidth01 - 1;
	document.all["FrameQryEmp"].style.left = document.all["DivTree"].offsetLeft + document.all["DivTree"].offsetWidth + iWidth01;
	
}

function resizeFormPageQryIFrame()
{
	var iWidth01 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
	}
	else
	{
		iWidth01 = 16;
	}

	document.all["DivList"].style.width = parent.DivQry.offsetWidth - iWidth01;
	document.all["DivList"].style.height = parent.DivQry.offsetHeight - 1;
}

function resizeFormPageQryIFrame2()
{
	var iWidth01 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
	}
	else
	{
		iWidth01 = 16;
	}

	document.all["DivList"].style.width = parent.FrameQryEmp.offsetWidth - iWidth01;
	document.all["DivList"].style.height = parent.FrameQryEmp.offsetHeight - 1;
}
/************************************************************************************************************
* Popup Á¶°ÇºÎÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizePopPageCon()
{
	document.all["DivIframe"].style.top = document.getElementById("FormCon").offsetHeight + 10;
	document.all["DivIframe"].style.height = document.body.clientHeight - document.all["DivIframe"].offsetTop;
}
/************************************************************************************************************
* Popupµî·Ï ¼öÁ¤ÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizePopInsUpdPageCon()
{
//	document.all["DivPopInsUpd"].style.top = document.getElementById("FormCon").offsetHeight + 10;
	document.all["DivPopInsUpd"].style.height = document.body.clientHeight;
}
/************************************************************************************************************
* Popup ¸®½ºÆ®ºÎÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizePopPageQry()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 17;
		iWidth02 = 17;
	}
	else
	{
		iWidth01 = 16;
		iWidth02 = 16;
	}

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - iWidth01;

	document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop + document.all["DivPage"].offsetHeight);
	document.all["DivQry"].style.width  = document.all["DivTit"].offsetWidth + iWidth02;
//alert(document.body.clientHeight);
	document.all["DivPage"].style.top = document.all["DivQry"].offsetTop + document.all["DivQry"].offsetHeight;
}
function resizePopPageQryLeft()
{
	document.all["DivTitLeft"].style.top    = 0;
	document.all["DivTitLeft"].style.left   = 0;

	document.all["DivTit"].style.top   = 0;
	document.all["DivTit"].style.width = document.body.clientWidth - document.all["DivTitLeft"].offsetWidth;
	document.all["DivTit"].style.left  = document.all["DivTitLeft"].offsetLeft + document.all["DivTitLeft"].offsetWidth;

	document.all["DivLeft"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivLeft"].style.left   = 0;

	document.all["DivQry"].style.top    = document.all["DivTit"].offsetTop + document.all["DivTit"].offsetHeight + 1;
	document.all["DivQry"].style.height = document.body.clientHeight - (document.all["DivTit"].offsetHeight + document.all["DivTit"].offsetTop);
	document.all["DivQry"].style.width  = document.body.clientWidth - document.all["DivLeft"].offsetWidth;
	document.all["DivQry"].style.left = document.all["DivLeft"].offsetLeft + document.all["DivLeft"].offsetWidth;
}
/************************************************************************************************************
* Popup	Ç×¸ñº¯µ¿ µî·ÏÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizePopPageConAvg()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 27;
		iWidth02 = 10;
	}
	else
	{
		iWidth01 = 26;
		iWidth02 = 9;
	}

	document.all["DivSInfo"].style.top = document.getElementById("FormCon").offsetHeight + 1;

	document.all["DivItemTitle"].style.top = document.all["DivSInfo"].offsetTop + document.all["DivSInfo"].offsetHeight + 1;
	document.all["DivItemTitle"].style.width = document.body.clientWidth - iWidth01;

	document.all["DivItemRow"].style.top = document.all["DivItemTitle"].offsetTop + document.all["DivItemTitle"].offsetHeight + 1;
	document.all["DivItemRow"].style.height = document.body.clientHeight - (document.all["DivItemTitle"].offsetHeight + document.all["DivItemTitle"].offsetTop + document.all["DivTotal"].offsetHeight);
	document.all["DivItemRow"].style.width = document.body.clientWidth - iWidth02;

	document.all["DivTotal"].style.top = document.all["DivItemRow"].offsetTop + document.all["DivItemRow"].offsetHeight + 1;
	document.all["DivTotal"].style.width  = document.body.clientWidth - iWidth01;
}
function resizePopItemInsUpdPageCon()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 27;
		iWidth02 = 10;
	}
	else
	{
		iWidth01 = 26;
		iWidth02 = 9;
	}

	document.all["DivSInfo"].style.top = document.getElementById("FormCon").offsetHeight + 1;

	document.all["DivItemTitle"].style.top = document.all["DivSInfo"].offsetTop + document.all["DivSInfo"].offsetHeight + 1;
	document.all["DivItemTitle"].style.width = document.body.clientWidth - iWidth01;

	document.all["DivItemRow"].style.top = document.all["DivItemTitle"].offsetTop + document.all["DivItemTitle"].offsetHeight + 1;
	document.all["DivItemRow"].style.height = document.body.clientHeight - (document.all["DivItemTitle"].offsetHeight + document.all["DivItemTitle"].offsetTop + document.all["DivTotal"].offsetHeight + 5);
	document.all["DivItemRow"].style.width = document.body.clientWidth - iWidth02;

	document.all["DivTotal"].style.top = document.all["DivItemRow"].offsetTop + 
		                                 document.all["DivItemRow"].offsetHeight + 1;
	document.all["DivTotal"].style.width = document.all["DivItemTitle"].clientWidth;
}
/************************************************************************************************************
* Popup	Ç×¸ñº¯µ¿ ÆÄÀÏµî·Ï µî·ÏÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizePopFileInsUpdPageCon()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 27;
		iWidth02 = 10;
	}
	else
	{
		iWidth01 = 26;
		iWidth02 = 9;
	}
	document.all["DivBBSInfo"].style.top = document.getElementById("FormCon").offsetHeight + 1;

	document.all["DivIframeFileTitle"].style.top = document.all["DivBBSInfo"].offsetTop + document.all["DivBBSInfo"].offsetHeight + 2;
	document.all["DivIframeFileTitle"].style.width = document.body.clientWidth - iWidth01;

	document.all["DivIframeFile"].style.top = document.all["DivIframeFileTitle"].offsetTop + document.all["DivIframeFileTitle"].offsetHeight + 1;
	document.all["DivIframeFile"].style.height = document.body.clientHeight - document.all["DivBBSInfo"].offsetTop - document.all["DivBBSInfo"].offsetHeight - 1 - document.all["DivIframeFileTitle"].offsetHeight - 1;	
	document.all["DivIframeFile"].style.width = document.body.clientWidth - iWidth02;
}
/************************************************************************************************************
* Popup	Ç×¸ñº¯µ¿ ÆÄÀÏµî·Ï µî·ÏÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizeAdmPopFileCon()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 27;
		iWidth02 = 10;
	}
	else
	{
		iWidth01 = 26;
		iWidth02 = 9;
	}
	document.all["DivBBSInfo"].style.top = document.getElementById("FormCon").offsetHeight + 1;

	document.all["DivBBSInfo"].style.height = document.body.clientHeight - document.getElementById("FormCon").offsetHeight;
	document.all["DivBBSInfo"].style.width = document.getElementById("FormCon").offsetWidth;
}
/************************************************************************************************************
* Popup	Ç×¸ñº¯µ¿ ÆÄÀÏµî·Ï µî·ÏÆäÀÌÁö »çÀÌÁî Á¶Àý
************************************************************************************************************/
function resizeFormHelp()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 27;
		iWidth02 = 10;
	}
	else
	{
		iWidth01 = 26;
		iWidth02 = 9;
	}
	document.all["DivHelp"].style.top = document.getElementById("FormCon").offsetHeight + 1;
	document.all["DivHelp"].style.height = document.body.clientHeight - document.getElementById("FormCon").offsetHeight;
	document.all["DivHelp"].style.width = document.getElementById("FormCon").offsetWidth;
}
/************************************************************************************************************
* HELP..
************************************************************************************************************/
function resizeFormHlp()
{
	var iWidth01 = "";
	var iWidth02 = "";

	if (getOSVersion() == "Windows XP")
	{
		iWidth01 = 27;
		iWidth02 = 10;
	}
	else
	{
		iWidth01 = 26;
		iWidth02 = 9;
	}
	document.all["DivHelp"].style.top = document.getElementById("FormCon").offsetHeight + 1;
	document.all["DivHelp"].style.height = document.body.clientHeight - document.getElementById("FormCon").offsetHeight;
	document.all["DivHelp"].style.width = document.getElementById("FormCon").offsetWidth - iWidth02 - 8;
}
/************************************************************************************************************
* ½ºÅ©·Ñ
************************************************************************************************************/
function evtQryScroll()
{
	if (DivTit.scrollLeft != DivQry.scrollLeft)
	{
		DivTit.scrollLeft = DivQry.scrollLeft;
		return;
	}

	if (DivTit.scrollTop != DivQry.scrollTop)
	{
		DivTit.scrollTop = DivQry.scrollTop;
		return;
	}
}
/************************************************************************************************************
* Sort
************************************************************************************************************/
function evtSort(sArgColName)
{
	var sSortType = document.FormCon.hddnSortType.value;

	document.FormCon.hddnSortCol.value = sArgColName;
	document.FormCon.hddnSortType.value = (sSortType == null || sSortType == "" || sSortType == "DESC")?"ASC":"DESC";

	exeQuery();
}
/************************************************************************************************************
* Key In¹Þ°í ½ÍÀº ÄÚµå¸¸ Key In ¹ÞÀ½. sFilter : "[0-9]", "[.0-9]"
************************************************************************************************************/
function checkValidate(obj, sArgFilter)
{
	var sKey = String.fromCharCode(event.keyCode);
	var regExp = new RegExp(sArgFilter);
	// Enter´Â Å°°Ë»ç¸¦ ÇÏÁö ¾Ê´Â´Ù.
	if (sKey!="\r" && !regExp.test(sKey))
	{
		event.returnValue = false;
	}

	if (eval(event.keyCode) > 225)
	{
		obj.value = "1";
		obj.focus();
		obj.select();
		alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		return false;
	}
	return true;
}
/************************************************************************************************************
* Ç³¼±µµ¿ò¸» °ü·Ã ½ÃÀÛ
************************************************************************************************************/
var Xoffset = 5;
var Yoffset = -15;
var yyy = -1000;

function showToolTipHelp(sArgMsg)
{
	if (sArgMsg == null || sArgMsg == "")
	{
		return false;
	}
	var sHtml =
	"<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" BGCOLOR=\"000000\">\n"+
	"	<TR>\n"+
	"		<TD>\n"+
	"			<TABLE CELLSPACING=\"0\" CELLPADDING=\"1\" BORDER=\"0\">\n"+
	"				<TR>\n"+
	"					<TD STYLE=\"background-color:#855425;font-family:µ¸¿ò, Arial,Verdana;font-size:9pt;color:#F8F5F0;text-align:left;vertical-align:middle;border-color:black;padding:2 0 0 0;\">\n"+
	"						"+sArgMsg+"\n"+
	"					</TD>\n"+
	"				</TR>\n"+
	"			</TABLE>\n"+
	"		</TD>\n"+
	"	</TR>\n"+
	"</TABLE>\n";

	yyy = Yoffset;

	document.all["divToolTipHelp"].innerHTML = sHtml;
	document.all["divToolTipHelp"].style.display = "";
}

function getMouse(e)
{
	var obj = document.all["divToolTipHelp"];
	var obx = event.x + document.body.scrollLeft + Xoffset + 7;
	var oby = event.y + document.body.scrollTop + yyy + 23;
	var width = obj.clientWidth;
	var height = obj.clientHeight;
	if (obx+width > document.body.clientWidth) obx=obx-width-17;
    if (oby+height > document.body.clientHeight) oby=oby-height-10;
    obj.style.left = obx;
	obj.style.top  = oby;
	
	//document.all["divToolTipHelp"].style.left = event.x + document.body.scrollLeft + Xoffset + 7;
	//document.all["divToolTipHelp"].style.top  = event.y + document.body.scrollTop + yyy + 23;
}

function getMouse2(e)
{
	document.all["divToolTipHelp"].style.right = Xoffset + 7;
	document.all["divToolTipHelp"].style.top  = event.y + document.body.scrollTop + yyy + 23;
}

function hideToolTipHelp()
{
	yyy = -1000;
	document.all["divToolTipHelp"].style.display = "none";
}
/************************************************************************************************************
* Ç³¼±µµ¿ò¸» °ü·Ã ³¡
************************************************************************************************************/
/************************************************************************************************************
* ¹öÆ° »óÅÂº¯°æ ½ÃÀÛ
************************************************************************************************************/
function evtEnableButton()
{
	if (arguments.length == 0)
	{
		return false;
	}
	else
	{
		for (var i=0; i<arguments.length; i++)
		{
			if (isExistObject(document.all["Div" + arguments[i] + "En"]))
			{
				document.all["Div" + arguments[i] + "En"].style.display = "";
				document.all["Div" + arguments[i] + "Dis"].style.display = "none";
			}
			else
			{
				alert("¹öÆ°¼³Á¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
				return false;
			}
		}
		
	}
}

function evtDisableButton()
{
	if (arguments.length == 0)
	{
		return false;
	}
	else
	{
		
		for (var i=0; i<arguments.length; i++)
		{
			if (isExistObject(document.all["Div" + arguments[i] + "Dis"]))
			{
				document.all["Div" + arguments[i] + "En"].style.display = "none";
				document.all["Div" + arguments[i] + "Dis"].style.display = "";
			}
			else
			{
				alert("¹öÆ°¼³Á¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
				return false;
			}
		}
		
	}
}

function evtHideButton()
{
	if (arguments.length == 0)
	{
		return false;
	}
	else
	{
		
		for (var i=0; i<arguments.length; i++)
		{
			if (isExistObject(document.all["Div" + arguments[0] + "En"]))
			{
				document.all["Div" + arguments[i] + "En"].style.display = "none";
				document.all["Div" + arguments[i] + "Dis"].style.display = "none";
			}
			else
			{
				alert("¹öÆ°¼³Á¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
				return false;
			}
		}
		
	}
}
/************************************************************************************************************
* ¹öÆ° »óÅÂº¯°æ ³¡
************************************************************************************************************/
/************************************************************************************************************
* ÀüÃ¼ µ¥ÀÌÅÍ °Ç¼ö ÁöÁ¤
************************************************************************************************************/
function setTotalRowCount(sArg)
{
	document.all.txtTotalDataCount.value = sArg;
}
/************************************************************************************************************
* Popup Window Open
************************************************************************************************************/
function openWindow(sArgUrl, sArgWinName, sArgAttr, sArgWidth, sArgHeight)
{
	var thisXpos = (screen.width/2) - (eval(sArgWidth)/2);
	var thisYpos = (screen.height/2) - (eval(sArgHeight)/2);

	var sAttr = sArgAttr + ",width=" + sArgWidth + ",height=" + sArgHeight + ",left=" + thisXpos + ",top=" + thisYpos;

	return window.open(sArgUrl, sArgWinName, sAttr);
}
/************************************************************************************************************
* Table¿¡¼­ Check image¼±ÅÃ½Ã ¹ß»ý
************************************************************************************************************/
function exeCheckAll(sArgFormName)
{
	var bCheckValue = false;
	var objForm = "document." + sArgFormName;

	if (eval(objForm).chkNo != undefined)
	{
		if (eval(objForm).chkNo.length > 0)
		{
			for (var i=0; i<eval(objForm).chkNo.length; i++)
			{
				bCheckValue = !eval(objForm).chkNo[i].checked;
				break;
			}

			for (var i=0; i<eval(objForm).chkNo.length; i++)
			{
				eval(objForm).chkNo[i].checked = bCheckValue;
			}
		}
		else
		{
			eval(objForm).chkNo.checked = !eval(objForm).chkNo.checked;
		}
	}
}
function exeSearchAll(objForm)
{
	var bCheckValue = false;

	if (objForm != undefined)
	{
		if (objForm.length > 0)
		{
			for (var i=0; i<objForm.length; i++)
			{
				bCheckValue = !objForm[i].checked;
				break;
			}

			for (var i=0; i<objForm.length; i++)
			{
				objForm[i].checked = bCheckValue;
			}
		}
		else
		{
			objForm.checked = !objForm.checked;
		}
	}
}

function exeNoCheck(objForm)
{
	var bCheckValue = false;

	if (objForm != undefined)
	{
		if (objForm.length > 0)
		{
			for (var i=0; i<objForm.length; i++)
			{
				if (objForm[i].checked == true)
				{
					bCheckValue = true;
					break;
				}
			}
		}
		else
		{
			if (objForm.checked == true)
			{
				bCheckValue = true;
			}
		}
	}

	return bCheckValue;
}
/************************************************************************************************************
# Mouse Over, Out
************************************************************************************************************/
function overBgColor(obj)
{
	obj.style.backgroundColor = "#CBDAF2";
}

function outBgColor(obj, sArgColor)
{
	obj.style.backgroundColor = sArgColor;
}


/************************************************************************************************************
# Á¤¼öÇüÀÇ ¼ýÀÚ¿¡ ÄÞ¸¶(,)¸¦ Ãß°¡ÇÏ´Â ÇÔ¼ö	
# ÀÎ¼ö a: Ã³¸®¿¡ ÇÊ¿äÇÑ ÀÎ¼ö °ª	
************************************************************************************************************/
function addComma(what) 
{
	sTemp = '' + what.value;
	sN = '';
	sNumber = '';
	var isMinus;
	if(sTemp.charAt(0)=='-')
	{
		sTemp = sTemp.substring(1);
		isMinus = 'y';
	}
	else isMinus = 'n';
	
	if( sTemp.indexOf(".") > -1 ) {
		sNumber = sTemp.substring(0, sTemp.indexOf("."));
		sN = sTemp.substring(sTemp.indexOf("."));
	} else	sNumber = sTemp;
	
	if (sNumber.length > 3) 
	{
		var mod = sNumber.length % 3;
		var output = (mod > 0 ? (sNumber.substring(0,mod)) : '');
		for (i=0 ; i < Math.floor(sNumber.length / 3); i++) 
		{
			if ((mod == 0) && (i == 0)) output += sNumber.substring(mod+ 3 * i, mod + 3 * i + 3);
			else output+= ',' + sNumber.substring(mod + 3 * i, mod + 3 * i + 3);
		}
		if(isMinus=='y') output = '-'+output;
		what.value = output + sN;
	}
	else
	{
		if(isMinus=='y') sNumber = '-'+sNumber;		
		what.value = sNumber + sN;
	}
}
function addCommaValue(what) 
{
	sTemp = '' + what;
	sN = '';
	sNumber = '';
	var isMinus;
	if(sTemp.charAt(0)=='-')
	{
		sTemp = sTemp.substring(1);
		isMinus = 'y';
	}
	else isMinus = 'n';
	
	if( sTemp.indexOf(".") > -1 ) {
		sNumber = sTemp.substring(0, sTemp.indexOf("."));
		sN = sTemp.substring(sTemp.indexOf("."));
	} else	sNumber = sTemp;
	
	if (sNumber.length > 3) 
	{
		var mod = sNumber.length % 3;
		var output = (mod > 0 ? (sNumber.substring(0,mod)) : '');
		for (i=0 ; i < Math.floor(sNumber.length / 3); i++) 
		{
			if ((mod == 0) && (i == 0)) output += sNumber.substring(mod+ 3 * i, mod + 3 * i + 3);
			else output+= ',' + sNumber.substring(mod + 3 * i, mod + 3 * i + 3);
		}
		if(isMinus=='y') output = '-'+output;
		return output + sN;
	}
	else
	{
		if(isMinus=='y') sNumber = '-'+sNumber;		
		return sNumber + sN;
	}
}

/************************************************************************************
# ³Ñ°ÜÁö´Â ¼ýÀÚ¿¡¼­ ÄÞ¸¶(,)¸¦ Á¦°ÅÇÏ´Â ÇÔ¼ö
# ÀÎ¼ö a: Ã³¸®¿¡ ÇÊ¿äÇÑ ÀÎ¼ö °ª
*************************************************************************************/
function removeComma(what) 
{
	sNumber = '' + what.value;
	var output = '';
	for (var i=0; i < sNumber.length; i++)
	{
		output += sNumber.charAt(i).replace(',','');
	}
	what.value = (output);
	what.focus();
	what.select();
}

function removeCommaAtValues(what) 
{
	sNumber = '' + what;
	var output = '';
	for (var i=0; i < sNumber.length; i++)
	{
		output += sNumber.charAt(i).replace(',','');
	}
	return (output);
}

/************************************************************************************************************
# Á¤¼öÀÇ ¸¶ÀÌ³Ê½º ¿©ºÎ Ã¼Å©
************************************************************************************************************/
function numMinusCheck(input)
{
	var chars = "-1234567890";
	for (var inx = 0; inx < input.length; inx++) 
	{
		if (chars.indexOf(input.charAt(inx)) == -1) 
		{
		   return true;
		}
	}
	return false;
}

function minusCheck(input)
{
	for (var inx = 0; inx < input.length; inx++) 
	{
		if (input.charAt(inx) == '-')
		{
			if (inx > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}
}

/************************************************************************************************************
# Æ¯¼ö¹®ÀÚ ¿©ºÎ Ã¼Å©
************************************************************************************************************/
function etcCheck(value)
{
	var _etcValue3   = '#+;:|\'\"';
	for(i=0; i<value.length; i++)
	{
		if(_etcValue3.indexOf(value.substring(i,i+1))>=0)
		{
			return true;
		}
	}
	return false;
}

function objCheck(value)
{
	var _etcValue3   = '#;:|\'\"';
	for(i=0; i<value.length; i++)
	{
		if(_etcValue3.indexOf(value.substring(i,i+1))>=0)
		{
			return true;
		}
	}
	return false;
}

/*****************************************************
# Ç×¸ñÀÌ Ãß°¡µÇ´Â °æ¿ìÀÇ ÇÕ°è±Ý¾× ±¸ÇØÁÜ
*****************************************************/
function checkSumRowResize(formNm)
{
	var iSupmoney	= 0;
	var iTaxmoney	= 0;

	for( i = 0; i < formNm.txtSup.length; i++)
	{
		if (numMinusCheck(removeCommaAtValues(formNm.txtSup[i].value)))
		{
			alert('¼ýÀÚ¿Í ¸¶ÀÌ³Ê½º±âÈ£(-)¸¸ÀÌ »ç¿ë°¡´ÉÇÕ´Ï´Ù');
			formNm.txtSup[i].value = '';
			formNm.txtSup[i].focus();
			return;
		}
		
		if(formNm.txtSup[i].value != null && formNm.txtSup[i].value != '')
		{
			iSupmoney += parseInt(removeCommaAtValues(formNm.txtSup[i].value));
			formNm.txtSup[i].value = addCommaValue(removeCommaAtValues(formNm.txtSup[i].value));
		}
	}

	for( i = 0; i < formNm.txtTax.length; i++)
	{
		if (numMinusCheck(removeCommaAtValues(formNm.txtTax[i].value)))
		{
			alert('¼ýÀÚ¿Í ¸¶ÀÌ³Ê½º±âÈ£(-)¸¸ÀÌ »ç¿ë°¡´ÉÇÕ´Ï´Ù');
			formNm.txtTax[i].value = '';
			formNm.txtTax[i].focus();
			return;
		}
		
		if(formNm.txtTax[i].value != null && formNm.txtTax[i].value != '')
		{
			iTaxmoney += parseInt(removeCommaAtValues(formNm.txtTax[i].value));
			formNm.txtTax[i].value = addCommaValue(removeCommaAtValues(formNm.txtTax[i].value));
		}
	}

	var iTotalmoney	= iSupmoney + iTaxmoney;
	formNm.txtSupmoney.value = addCommaValue(iSupmoney);
	formNm.txtTaxmoney.value = addCommaValue(iTaxmoney);
	formNm.txtTotalMoney.value = addCommaValue(iTotalmoney);

}
/************************************************************************************************************
# ÇØ´ç ¿¬¿ùÀÇ ¸¶Áö¸· ³¯À» ±¸ÇÏ´Â ÇÔ¼ö
************************************************************************************************************/
function lastday(calyear,calmonth)
{
	var dayOfMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

	if (((calyear %4 == 0) && (calyear % 100 != 0))||(calyear % 400 == 0))
	{
		dayOfMonth[1] = 29;
	}
	var nDays = dayOfMonth[calmonth-1];
	return nDays;
}

/************************************************************************************************************
# ÁÖ¾îÁø ¹®ÀÚ¿­ÀÇ ±æÀÌ¸¦ ±¸ÇÏ´Â ÇÔ¼ö
************************************************************************************************************/
function getStrLen(argStr)
{
	var ii;
	var strByte;
	var strLen = 0;

	for(ii = 0; ii < argStr.length; ii++)
	{
		if(argStr.charCodeAt(ii) < 128)
		{
			strLen ++;
		}
		else
		{
			strLen += 2;
		}
	}
	return strLen;
}

/************************************************************************************************************
# ¹®ÀÚ¿­ÀÇ ¾ÕµÚ ºó°ø¹éÀ» ¾ø¾Ö´Â ÇÔ¼ö
************************************************************************************************************/
function trim(txt) 
{
	while (txt.indexOf(' ') >= 0) 
	{ 
		txt = txt.replace(' ',''); 
	}
	return txt;
}

/************************************************************************************************************
# ³¯Â¥¿¡¼­ 1ÀÚ¸® ÀÏ¶§ ¾Õ¿¡ 0À» ºÙ¿©ÁÖ´Â ÇÔ¼ö
************************************************************************************************************/
function makeDoubleDate(dt)
{
	dt = trim(dt);
	if (dt.length==1) 
	{
		dt = "0"+dt;
	}
	return dt;
}

/************************************************************************************************************
# ³¯Â¥ Ã¼Å©
************************************************************************************************************/
function dateChk(mm,dd)
{
	var mm = mm*1;
	var dd = dd*1;
	if (mm <1 || mm > 12 )
	{
		alert('³¯Â¥°¡ Æ²·È½À´Ï´Ù. ´ÞÀº 1¿ù¿¡¼­ 12¿ù±îÁö	ÀÔ´Ï´Ù.	 ex)1999-8-9');
		return true;
	}
	else if (mm == 2)
	{
		if (dd <1 || dd > 29 )
		{
			alert('³¯Â¥°¡ Æ²·È½À´Ï´Ù.'+mm+'¿ù¿¡´Â '+dd+'ÀÏÀÌ ¾ø½À´Ï´Ù. ex)1999-8-9');
			return true;
		}
	}
	else if (mm != 2)
	{
		if (dd <1 || dd > 31 )
		{
			alert('³¯Â¥°¡ Æ²·È½À´Ï´Ù.'+mm+'¿ù¿¡´Â '+dd+'ÀÏÀÌ ¾ø½À´Ï´Ù. ex)1999-8-9');
			return true;
		}
	}
	else
	{
		return false;
	}
}

/************************************************************************************************************
# ÇÊ¼öÀÔ·Â Ã¼Å©
************************************************************************************************************/
function chkRequired(sObject, sMsg)
{
	if (trim(sObject.value) == "")
	{
		alert(sMsg + "ÇÊ¼öÀÔ·ÂÀÔ´Ï´Ù.");
		setFocus(sObject);
		return false;
	}
	return true;
}

/************************************************************************************************************
# Çü½Ä Ã¼Å©
************************************************************************************************************/
function chkSpell(sObject, sMsg)
{
	var Alpha = 'abcdefghijklmnopqrstuvwxyz';
	var Num   = '0123456789';
	var Alnum = Alpha + Num;
	var t = sObject.value;
	for(i=0; i<t.length; i++){
		if(Alnum.indexOf(t.substring(i,i+1))<0){
			alert(sMsg + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù  \n           ¿¹)  `+\|;:\'\"<>? ');
			setFocus(sObject);
			return false;
		}
	}
	return true;
}

/************************************************************************************************************
# Email Çü½Ä Ã¼Å©
************************************************************************************************************/
function chkEmail(sObject, msg, fObject){

	var Alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	var Num   = '0123456789';
	var Alnum = Alpha + Num;
	var UserEmail = Alnum + '@.[]_-';
	var i, a=0;
	var t = sObject.value;

	for(i=0; i<t.length; i++){

		if(UserEmail.indexOf(t.substring(i,i+1))<0){
			alert(msg + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
			if (fObject == null)
			{
				setFocus(sObject);
			}
			else
			{
				setFocus(fObject);
			}
			return false;
		}

		if(t.substring(i,i+1) == '@' || t.substring(i,i+1) == '.'){
			a++;
		}
	}

	if(a < 2){
		alert(msg + 'ÀÇ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.¿¹)sendbill@netmania.co.kr');
		if (fObject == null)
		{
			setFocus(sObject);
		}
		else
		{
			setFocus(fObject);
		}
		return false;
	}
	return true;
}

/************************************************************************************************************
# ÇÑ±Û, ¿µ¹® ¹®ÀÚ¿­ ±æÀÌ Ã¼Å© (return : byte¼ö)
************************************************************************************************************/
function chkStrLen(Object) {
	var byteLength = 0;

	for (var inx = 0; inx < Object.value.length; inx++) {
		var oneChar = escape(Object.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 chkResNo(comp1, comp2){
	var str_serial1 = comp1.value;
	var str_serial2 = comp2.value;

	var digit=0
	for(var i=0;i<str_serial1.length;i++){
		var str_dig=str_serial1.substring(i,i+1);
		if(str_dig<'0' || str_dig>'9'){ 
			digit=digit+1 
		}
	}

	if((str_serial1 == '') || ( digit != 0 )){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		comp1.focus();
		return false;   
	}

	var digit1=0
	for(var i=0;i<str_serial2.length;i++){
		var str_dig1=str_serial2.substring(i,i+1);
		if(str_dig1<'0' || str_dig1>'9'){ 
			digit1=digit1+1 
		}
	}

	if((str_serial2 == '') || ( digit1 != 0 )){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		comp2.focus();
		return false;   
	}

	if(str_serial1.substring(2,3) > 1){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		comp1.focus();
		return false;   
	}

	if(str_serial1.substring(4,5) > 3){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		comp1.focus();
		return false;   
	} 

	if(str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0){
		//alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		//comp2.focus();
		//return false;   
	}

	var a1=str_serial1.substring(0,1)
	var a2=str_serial1.substring(1,2)
	var a3=str_serial1.substring(2,3)
	var a4=str_serial1.substring(3,4)
	var a5=str_serial1.substring(4,5)
	var a6=str_serial1.substring(5,6)
		
	var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7

	var b1=str_serial2.substring(0,1)
	var b2=str_serial2.substring(1,2)
	var b3=str_serial2.substring(2,3)
	var b4=str_serial2.substring(3,4)
	var b5=str_serial2.substring(4,5)
	var b6=str_serial2.substring(5,6)
	var b7=str_serial2.substring(6,7)
	   
	var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
		
	check_digit = check_digit%11
	check_digit = 11 - check_digit
	

	if(b1 == "5" || b1 == "6" || b1 == "7" || b1 == "8"){
		if (check_digit >= 10) check_digit -= 10;
	    check_digit += 2;
	    if (check_digit >= 10) check_digit -= 10;
	    if(check_digit != b7){
	    	alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
			comp2.focus();
			return false;   
		}else{
			return true;	    
	    }
	} else {
		check_digit = check_digit%10;
		if(check_digit != b7){
			alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
			comp2.focus();
			return false;   
		}else{
			return true;
		}
	}
}

/************************************************************************************************************
# »ç¾÷ÀÚµî·Ï¹ø¹øÈ£ Ã¤Å©
************************************************************************************************************/
function jsTrim(src)
{
	return src.replace(/\s/g, "")
}
function chkNo(obj)
{
	if(jsTrim(obj.value) == undefined || jsTrim(obj.value) == null || jsTrim(obj.value) == "")
	{
		return false;
	}
	else
	{
		return true;
	}
}
function chkVenderno(no1, no2, no3){
	if (!chkNo(no1))
	{
		alert('»ç¾÷ÀÚ µî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		no1.focus();
		return false;
	}

	if (!chkNo(no2) )
	{
		alert('»ç¾÷ÀÚ µî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		no2.focus();
		return false;
	}

	if (!chkNo(no3) )
	{
		alert('»ç¾÷ÀÚ µî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		no3.focus();
		return false;
	}
	if ( no1.value.length < 3 )
	{
		alert('»ç¾÷ÀÚ µî·Ï¹øÈ£°¡ Àß¸ø µÇ¾ú½À´Ï´Ù');
		no1.focus();
		return false;
	}

	if ( no2.value.length < 2 )
	{
		alert('»ç¾÷ÀÚ µî·Ï¹øÈ£°¡ Àß¸ø µÇ¾ú½À´Ï´Ù');
		no2.focus();
		return false;
	}

	if ( no3.value.length < 5 )
	{
		alert('»ç¾÷ÀÚ µî·Ï¹øÈ£°¡ Àß¸ø µÇ¾ú½À´Ï´Ù');
		no1.focus();
		return false;
	}

	var menno,no,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c9_1,c9_2,c ;
	menno = no1.value+no2.value+no3.value ;

	if('0' == menno.substring(0,1))
	{
		alert('¿Ã¹Ù¸¥ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.');
		no1.focus();
		return false;
	}

	c1 = menno.substring(0,1);
	c2 = menno.substring(1,2);
	c3 = menno.substring(2,3);
	c4 = menno.substring(3,4);
	c5 = menno.substring(4,5);
	c6 = menno.substring(5,6);
	c7 = menno.substring(6,7);
	c8 = menno.substring(7,8);
	c9 = menno.substring(8,9);
	c10 = menno.substring(9,10);
	c1 = c1 * 1;
	c1 = c1 % 10 ;
	c2 = c2 * 3;
	c2 = c2 % 10 ;
	c3 = c3 * 7;
	c3 = c3 % 10 ;
	c4 = c4 * 1;
	c4 = c4 % 10 ;
	c5 = c5 * 3;
	c5 = c5 % 10 ;
	c6 = c6 * 7;
	c6 = c6 % 10 ;
	c7 = c7 * 1;
	c7 = c7 % 10 ;
	c8 = c8 * 3;
	c8 = c8 % 10 ;
	c9 = c9 * 5 ;
	c9_2 = c9 % 10 ;
	c9_1 = c9-c9_2 ;
	c9_1 = c9_1 / 10 ;
	no = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9_1 + c9_2 ;
	no=(no%10);
	no=(10-no) % 10 ;
	
	
	if(no != c10) {
		alert('¿Ã¹Ù¸¥ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.');
		no1.focus();
		return false;
	}
	
	return true;
}

/************************************************************************************************************
# ÁÖ¹Îµî·Ï¹øÈ£ Ã¤Å© ( ARGUMENT ÇÏ³ª ÀÏ °æ¿ì )
************************************************************************************************************/
function chkResNoByOneArg(obj){

	var str_serial1 = obj.value.substring(0,6);
	var str_serial2 = obj.value.substring(6,13);

	var digit=0
	for(var i=0;i<str_serial1.length;i++){
		var str_dig=str_serial1.substring(i,i+1);
		if(str_dig<'0' || str_dig>'9'){ 
			digit=digit+1 
		}
	}

	if((str_serial1 == '') || ( digit != 0 )){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;   
	}

	var digit1=0
	for(var i=0;i<str_serial2.length;i++){
		var str_dig1=str_serial2.substring(i,i+1);
		if(str_dig1<'0' || str_dig1>'9'){ 
			digit1=digit1+1 
		}
	}

	if((str_serial2 == '') || ( digit1 != 0 )){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;   
	}

	if(str_serial1.substring(2,3) > 1){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;   
	}

	if(str_serial1.substring(4,5) > 3){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;   
	} 

	if(str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;   
	}

	var a1=str_serial1.substring(0,1)
	var a2=str_serial1.substring(1,2)
	var a3=str_serial1.substring(2,3)
	var a4=str_serial1.substring(3,4)
	var a5=str_serial1.substring(4,5)
	var a6=str_serial1.substring(5,6)
		
	var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7

	var b1=str_serial2.substring(0,1)
	var b2=str_serial2.substring(1,2)
	var b3=str_serial2.substring(2,3)
	var b4=str_serial2.substring(3,4)
	var b5=str_serial2.substring(4,5)
	var b6=str_serial2.substring(5,6)
	var b7=str_serial2.substring(6,7)
	   
	var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
		
	check_digit = check_digit%11
	check_digit = 11 - check_digit
	check_digit = check_digit%10

	if(check_digit != b7){
		alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;   
	}else{
		return true;
	}
}

/************************************************************************************************************
# »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¤Å© ( ARGUMENT ÇÏ³ª ÀÏ °æ¿ì)
************************************************************************************************************/
function chkVendernoByOneArg(obj)
{
	var menno,no,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c9_1,c9_2,c ;
	menno = obj.value ;
	
	c1 = menno.substring(0,1);
	c2 = menno.substring(1,2);
	c3 = menno.substring(2,3);
	c4 = menno.substring(3,4);
	c5 = menno.substring(4,5);
	c6 = menno.substring(5,6);
	c7 = menno.substring(6,7);
	c8 = menno.substring(7,8);
	c9 = menno.substring(8,9);
	c10 = menno.substring(9,10);
	c1 = c1 * 1;
	c1 = c1 % 10 ;
	c2 = c2 * 3;
	c2 = c2 % 10 ;
	c3 = c3 * 7;
	c3 = c3 % 10 ;
	c4 = c4 * 1;
	c4 = c4 % 10 ;
	c5 = c5 * 3;
	c5 = c5 % 10 ;
	c6 = c6 * 7;
	c6 = c6 % 10 ;
	c7 = c7 * 1;
	c7 = c7 % 10 ;
	c8 = c8 * 3;
	c8 = c8 % 10 ;
	c9 = c9 * 5 ;
	c9_2 = c9 % 10 ;
	c9_1 = c9-c9_2 ;
	c9_1 = c9_1 / 10 ;
	no = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9_1 + c9_2 ;
	no=(no%10);
	no=(10-no) % 10 ;
	
	
	if(no != c10) {
		alert('¿Ã¹Ù¸¥ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.');
		obj.focus();
		return false;
	}
	
	return true;
}

/************************************************************************************************************
# set focus
************************************************************************************************************/
function setFocus(sObject)
{
	//alert(sObject.name);
	sObject.focus();
}

/************************************************************************************************************
# jump to next object
************************************************************************************************************/
function jump(me,next,len)
{
	if (me.value.length==len)
	{
		next.focus();
		return;
	}
}
function jumpObj(f,obj,len)
{
	var form = f.elements;
	for(i = 0; i < (f.length - 1); i ++)
	{
		if( form[i] == obj )
		{
			if (obj.value.length==len)
			{
				form[i+1].focus();
				return;			
			}
		}
	}
}

/************************************************************************************************************
# ¼ýÀÚ À¯È¿¼º Ã¼Å©
************************************************************************************************************/
function check_digit(value)
{
    var    i;
    var    str =  new String(value);
    for(i=0;i<str.length;i++)
	{
		if ( !(parseInt(str.charAt(i)) >= 0 && parseInt(str.charAt(i)) < 10) )
		{
			return false;
		}
	}
    return true;
}

function check_digit01(value)		//divAuto¿¡¼­ »ç¿ë..
{
    var    i;
    var    str =  new String(value);
    for(i=0;i<str.length;i++)
	{
		if ( !(parseInt(str.charAt(i)) >= 0 && parseInt(str.charAt(i)) < 10 || str.charAt(i) == "-") )
		{
			return false;
		}
	}
    return true;
}
/************************************************************************************************************
# ³¯Â¥ À¯È¿¼º Ã¼Å©
************************************************************************************************************/
function checkDateValid(obj){
	if( !isExistObject(obj) )
	{
		return false;
	}

	var yyyy;
	var mm;
	var dd;
	var dt = obj.value;

	if( (dt.indexOf("-") == dt.lastIndexOf("-")) || (dt.indexOf("-") == 0) || (dt.lastIndexOf("-") + 1 == dt.length))
	{
		return false;
	}
	else{
		yyyy = dt.substring(0, dt.indexOf("-"));
		mm = dt.substring(dt.indexOf("-") + 1, dt.lastIndexOf("-"));
		dd = dt.substring(dt.lastIndexOf("-") + 1, dt.length);
	}

	if( !check_digit(yyyy) ) return false;
	if( !check_digit(mm) ) return false;
    if( !check_digit(dd) ) return false;

	yyyy = makeDoubleDate(yyyy);
	mm = makeDoubleDate(mm);
	dd = makeDoubleDate(dd);

	obj.value = yyyy + "-" + mm + "-" + dd;

	if( !(mm < 13) || !(mm > 0) )
	{
		return false;
	}
	else
	{
		if( dd < 1 )
		{
			return false;
		}
		if( mm == 1 )
		{
			if( dd > 31 ) return false;
		}
		else if( mm == 2 )
		{
			if( dd > 29 ) return false;
		}
		else if( mm == 3 )
		{
			if( dd > 31 )  return false;
		}
		else if( mm == 4 )
		{
			if( dd > 30 )  return false;
		}
		else if( mm == 5 )
		{
			if( dd > 31)  return false;
		}
		else if( mm == 6 )
		{
			if( dd > 30 ) return false;
		}
		else if( mm == 7 )
		{
			if( dd > 31 ) return false;
		}
		else if( mm == 8 )
		{
			if( dd > 31 ) return false;
		}
		else if( mm == 9 )
		{
			if( dd > 30 ) return false;
		}
		else if( mm == 10 )
		{
			if( dd > 31 ) return false;
		}
		else if( mm == 11 )
		{
			if( dd > 30 ) return false;
		}
		else if( mm == 12 )
		{
			if( dd > 31 ) return false;
		}
	}

	if(yyyy%4 == 0){
		if( yyyy%100 == 0){				
			if(yyyy%400==0){
				if(mm == 2 && dd > 29){
					return false;
				}else{
					return true;
				}
			}else{
				if(mm == 2 && dd > 28){
					return false;
				}else{
					return true;
				}					
			}
		}else{
			if(mm == 2 && dd > 29){
				return false;
			}else{
				return true;
			}
		}
	}else if(yyyy%4 != 0 && mm == 2 && dd > 28){
		return false;
	}else{
		return true;
	}
}
/************************************************************************************************************
# º¯°æÀÌ·Âº¸±â È£Ãâ
************************************************************************************************************/
function viewStatHistory(sBillSeq){
	var sUrl = "/service?command=netmania.sendbill.frame.common.Function.BillHistory.BillStatListProcess";
		sUrl = sUrl+"&hddnBillSeq="+sBillSeq;
	var sName = "statHistory";
	var sState = "width=500,height=300,scrollbars=no";
	openWindow(sUrl,sName,sState,"500","300");
}
/************************************************************************************************************
# ÀÏ¹ÝÃâ·Â(HtmlPrint) È£Ãâ
************************************************************************************************************/
function htmlPrint(sBillType,sBillSeq,sIsMaechul,sCert)
{
	var sUrl = "/jsp/netmania/sendbill/frame/common/HtmlPrint/HtmlPrint.jsp?";
		sUrl = sUrl+"sBillType="+sBillType;
		sUrl = sUrl+"&sBillSeq="+sBillSeq;
		sUrl = sUrl+"&sIsMaechul="+sIsMaechul;
		sUrl = sUrl+"&sCert="+sCert;
		sUrl = sUrl+"&sIsPastData=N";
	var sName = "htmlprint";
	var sState = "width=750,height=600,scrollbars=no";
	openWindow(sUrl,sName,sState,"750","600");
}

/************************************************************************************************************
# ÀÏ¹ÝÃâ·Â(HtmlPrint) È£Ãâ - ÀÌÀüµ¥ÀÌÅ¸Ãâ·Â
************************************************************************************************************/
function pastDataHtmlPrint(sBillType,sBillSeq,sIsMaechul,sCert,sIsPastData)
{
	var sUrl = "/jsp/netmania/sendbill/frame/common/HtmlPrint/HtmlPrint.jsp?";
		sUrl = sUrl+"sBillType="+sBillType;
		sUrl = sUrl+"&sBillSeq="+sBillSeq;
		sUrl = sUrl+"&sIsMaechul="+sIsMaechul;
		sUrl = sUrl+"&sCert="+sCert;
		sUrl = sUrl+"&sIsPastData="+sIsPastData;
	var sName = "htmlprint";
	var sState = "width=750,height=600,scrollbars=no";
	openWindow(sUrl,sName,sState,"750","600");
}

/************************************************************************************************************
# ¿µ¼öÁõ ÀÏ¹ÝÃâ·Â(HtmlPrint) È£Ãâ
************************************************************************************************************/
function htmlPrintReceipt(sBillSeq, sIsMaechul, sCert)
{
	var sUrl = "/jsp/netmania/sendbill/frame/common/HtmlPrint/HtmlPrintReceipt.jsp?";
		sUrl = sUrl + "&sBillSeq=" + sBillSeq;
		sUrl = sUrl + "&sIsMaechul=" + sIsMaechul;
		sUrl = sUrl + "&sCert=" + sCert;
	var sName = "htmlprint";
	var sState = "width=590,height=710,scrollbars=no";

	openWindow(sUrl, sName, sState, "590","710");
}

/************************************************************************************************************
# ¿µ¼öÁõ ÀÏ¹ÝÃâ·Â(HtmlPrint) È£Ãâ - ÀÌÀüµ¥ÀÌÅ¸Ãâ·Â
************************************************************************************************************/
function pastDataHtmlPrintReceipt(sBillSeq, sIsMaechul, sCert, sIsPastData)
{
	var sUrl = "/jsp/netmania/sendbill/frame/common/HtmlPrint/HtmlPrintReceipt.jsp?";
		sUrl = sUrl + "&sBillSeq=" + sBillSeq;
		sUrl = sUrl + "&sIsMaechul=" + sIsMaechul;
		sUrl = sUrl + "&sCert=" + sCert;
		sUrl = sUrl + "&sIsPastData="+sIsPastData;
	var sName = "htmlprint";
	var sState = "width=590,height=710,scrollbars=no";

	openWindow(sUrl, sName, sState, "590","710");
}

/************************************************************************************************************
# ÀÔ±ÝÇ¥ ÀÏ¹ÝÃâ·Â(HtmlPrint) È£Ãâ
************************************************************************************************************/
function htmlPrintPayIn(sBillType, sBillSeq, sIsMaechul, sCert)
{
	var sUrl = "/jsp/netmania/sendbill/frame/common/HtmlPrint/HtmlPrintPayIn.jsp?";
		sUrl = sUrl + "sBillType=" + sBillType;
		sUrl = sUrl + "&sBillSeq=" + sBillSeq;
		sUrl = sUrl + "&sIsMaechul=" + sIsMaechul;
		sUrl = sUrl + "&sCert=" + sCert;
		sUrl = sUrl + "&sIsPastData=N";
	var sName = "htmlprint";
	var sState = "width=540,height=710,scrollbars=no";

	openWindow(sUrl, sName, sState, "540","710");
}

/************************************************************************************************************
# ÀÔ±ÝÇ¥ ÀÏ¹ÝÃâ·Â(HtmlPrint) È£Ãâ - ÀÌÀüµ¥ÀÌÅ¸Ãâ·Â
************************************************************************************************************/
function pastDataHtmlPrintPayIn(sBillType, sBillSeq, sIsMaechul, sCert, sIsPastData)
{
	var sUrl = "/jsp/netmania/sendbill/frame/common/HtmlPrint/HtmlPrintPayIn.jsp?";
		sUrl = sUrl + "sBillType=" + sBillType;
		sUrl = sUrl + "&sBillSeq=" + sBillSeq;
		sUrl = sUrl + "&sIsMaechul=" + sIsMaechul;
		sUrl = sUrl + "&sCert=" + sCert;
		sUrl = sUrl + "&sIsPastData="+sIsPastData;
	var sName = "htmlprint";
	var sState = "width=540,height=710,scrollbars=no";

	openWindow(sUrl, sName, sState, "540","710");
}

/***********************************************************************************************************
# ³ÎÃ¼Å© 
***********************************************************************************************************/
function checkNull (obj)
{
	if(obj == undefined || ojb.value == null || obj.value == "")
	{
		return false;
	}
	else
	{
		return true;
	}
}

/***********************************************************************************************************
# À¥ÇÁ¸°Æ® Ãâ·Â (Get ¹æ½Ä)
***********************************************************************************************************/
function exeWebPrintByGet(sTitle,sForm,sImg,sData)
{
	try
	{
		webprint.exec(sTitle,sForm,sImg,sData);
	}
	catch(e)
	{
		alert(COMMON_MESSAGE001);
		location.href='http://www.sendbill.co.kr/jsp/sendbill/WebPrint.exe';
		return false;
	}
}

/***********************************************************************************************************
# À¥ÇÁ¸°Æ® Ãâ·Â (Post ¹æ½Ä)
***********************************************************************************************************/
function exeWebPrintPost(sTitle,sForm,sImg,sData)
{
	try
	{
		webprint.execPost(sTitle,sForm,sImg,sData);
	}
	catch(e)
	{
		alert(COMMON_MESSAGE001);
		location.href='http://www.sendbill.co.kr/jsp/sendbill/WebPrint.exe';
		return false;
	}
}


function Chk_WebPrint(sRePrint) {
	if (sRePrint == "N") {
		if (confirm("Ãâ·ÂÀÌ Á¤»óÀûÀ¸·Î µÇ¾ú½À´Ï±î? Á¤»óÀûÀ¸·Î Ãâ·ÂµÇ¼Ì´Ù¸é 'È®ÀÎ'À» ´­·¯ÁÖ½Ê½Ã¿ä. ") == true) {
			alert("ÀÌÈÄ Ãâ·ÂºÎÅÍ´Â [Àç¹ßÇà]ÀÌ¶ó´Â ¹®±¸°¡ Æ÷ÇÔµÇ¾î Ãâ·ÂµË´Ï´Ù.");
			FormCon.action = "/jsp/sendbill/frame/common/WebPrint/WebPrintAddCount.jsp";
			FormCon.target = "FrmCount";
			FormCon.method="post";
			FormCon.submit();

		}
		else
		{
			alert("ÇÁ¸°Æ® ¼³Á¤¹× ¿ëÁö È®ÀÎÀ» ÇØÁÖ½Ê½Ã¿ä.");
		}
	}
}

/***********************************************************************************************************
# HELP °øÅë
***********************************************************************************************************/
function openHelpMenu(sMenuID,sMenuID2,sMenuName,sMenuSubName)
{
	parent.FrameLeftHelp.showMenu(sMenuID);

	parent.FrameLeftHelp.FormHidden.command.value = "sendbill.help.menu." + sMenuID + "." + sMenuID + sMenuID2 + ".command." + sMenuID + sMenuID2 + "Con";
	
	parent.FrameLeftHelp.FormHidden.target = "FrameCenterHelp";
	parent.FrameLeftHelp.FormHidden.hddnUpMenuId.value = sMenuID;
	parent.FrameLeftHelp.FormHidden.hddnMenuId.value = sMenuID + sMenuID2;
	parent.FrameLeftHelp.FormHidden.hddnUpMenuName.value = sMenuName;
	parent.FrameLeftHelp.FormHidden.hddnMenuName.value = sMenuSubName;

	parent.FrameLeftHelp.FormHidden.submit();
}

/***********************************************************************************************************
# CHECKBOX¿¡ ¼±ÅÃµÈ °¹¼ö
***********************************************************************************************************/
function checkedCnt(field,n)
{
	var iCnt =0;
	if( (n == 1 || n == undefined) && field.checked == true )
	{
		iCnt = 1;
	}

	if(field.length > 1 )
	{
		for( i =0 ; i< field.length; i ++ )
		{
			if(field[i].checked == true)
				iCnt ++;
		}
	}
	return iCnt;
}
function checkedRCnt(field,n,clnm,g)
{
	var iCnt =0;
	if( (n == 1 || n == undefined) && field.checked == true )
	{
		if( clnm.value == g )
			iCnt = 1;
	}

	if(field.length > 1 )
	{
		for( i =0 ; i< field.length; i ++ )
		{
			if(field[i].checked == true)
			{
				if( clnm[i].value == g)
					iCnt ++;
			}
		}
	}
	return iCnt;
}
/***********************************************************************************************************
# CHECKBOX¿¡ ¼±ÅÃµÈ °¹¼ö(´Ù·®Àü¼ÛÀÏ°æ¿ì)
***********************************************************************************************************/
function checkedMultiCnt(field,n,r)
{
	var iCnt =0;
	if( n == 1 && field.checked == true )
	{
		if( r.value == "F" ) iCnt = 1;
	}

	if(field.length > 1 )
	{
		for( i =0 ; i< field.length; i ++ )
		{
			if(field[i].checked == true && r[i].value == "F")
				iCnt ++;
		}
	}
	return iCnt;
}
/***********************************************************************************************************
# ÀÔ·Â µðÆúÆ® Á¶Á¤(ÇÑ±Û,¿µ¹®)
***********************************************************************************************************/
function changeImeKor(obj)
{
	for (var i=0; i<obj.elements.length; i++)
	{
		obj.elements[i].style.cssText = "ime-mode:active";
	}
}

function changeImeEng(obj)
{
	for (var i=0; i<obj.elements.length; i++)
	{
		obj.elements[i].style.cssText = "ime-mode:inactive";
	}
}


function QryMsg()
{
	if (isExistObject(document.FrameQry) == false)
	{
		return;
	}
	else
	{
		if (FrameQry.document.forms.length > 0)
		{
			FrameQry.document.body.style.display = "none";
		}
		var iTop = document.all["DivIframe"].offsetTop;
		var iWidth = document.all["DivIframe"].offsetWidth;
		var iHeight = document.all["DivIframe"].offsetHeight;
		var sHtml = "";

		sHtml += "<TABLE BORDER='0' WIDTH='100%' HEIGHT='100%' CELLPADDING='0' CELLSPACING='0'>\n";
		sHtml += "	<TR>\n";
		sHtml += "		<TD ALIGN='center' VALIGN='middle'>\n";
		sHtml += "			<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0'>\n";
		sHtml += "				<TR>\n";
		sHtml += "					<TD ALIGN='center'><IMG SRC='../jsp/sendbill/frame/image/Search.gif'></TD>\n";
		sHtml += "				</TR>\n";
		sHtml += "			</TABLE>\n";
		sHtml += "		<TD>\n";
		sHtml += "	</TR>\n";
		sHtml += "</TABLE>\n";

		document.all["divLoading"].style.top = iTop;
		document.all["divLoading"].style.width = iWidth;
		document.all["divLoading"].style.height = iHeight;

		document.all["divLoading"].innerHTML = sHtml;
		document.all["divLoading"].style.display = "";
	}

	window.status = "";
}
/*
 * ½ÃÀÛÀÏ°ú Á¾·áÀÏÀÇ °£°Ý.
 * param stDt	½ÃÀÛÀÏ
 * param enDt	Á¾·áÀÏ
 * return boolean 
 * Author haki
 * Created Date 2005. 12. 19.
 */
function limitDate(stDt, enDt){
	var FirstDay = String(stDt.value).split("-");
	var SecondDay = String(enDt.value).split("-");
	
	var years  = eval(SecondDay[0] - FirstDay[0]);
	var months = eval(SecondDay[1] - FirstDay[1]);
	var days   = eval(SecondDay[2] - FirstDay[2]);
	/*var oDate = new Date(FirstDay[0], FirstDay[1] - 1, FirstDay[2]);
	var eDate = new Date(SecondDay[0], SecondDay[1] - 1, SecondDay[2]);
	var years  = eDate.getFullYear() - oDate.getFullYear();
	var months = eDate.getMonth() - oDate.getMonth();
	var days   = eDate.getDate() - oDate.getDate();
	*/
	if( eval(years * 12 + months + (days < 0 ? 0 : 1)) > 3){
		alert("1.ºÎ°¡¼¼È®Á¤½Å°í ±â°£µ¿¾È ÀÏÀÚº°°Ë»ö ±â°£À» ÃÖ´ë 3°³¿ù ´ÜÀ§·Î Á¦ÇÑÇÕ´Ï´Ù.\n\n2.Á¶È¸ÇÏ½Å ±â°£À» 3°³¿ù ÀÌ³»·Î º¯°æÈÄ ´Ù½Ã °Ë»öÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n ¿¹)2005-07-01~2005-09-31\n\n3.ÀÏÀÚº°°Ë»ö ±â°£ Á¦ÇÑ ÀÏÁ¤ : 2006³â 1¿ù 16ÀÏ - 31ÀÏ±îÁö");
		return false;
	} 
	return true;
}
/***********************************************************************************************************
# ÁöÁ¤¹®ÀÚ¸¦ ¾ø¾Ø´Ù.
***********************************************************************************************************/
function remString(strjArg, strjArgRemString)
{
	var strjRtn   = "";
	var strjTemp  = "";
	for (var i=0; i<strjArg.length; i++)
	{
		strjTemp = "" + strjArg.substring(i, i+1);
		if (strjTemp.indexOf(strjArgRemString) == -1)
		{
			strjRtn += strjTemp;
		}
	}
	return strjRtn;
}
/***********************************************************************************************************
# CHECKBOX Ã¼Å©
# sMsg1 checkbox ¾øÀ»°æ¿ì ¸Þ½ÃÁö
# sMsg2	¼±ÅÃµÈ°ÍÀÌ ¾øÀ»°æ¿ì ¸Þ½ÃÁö
# chkNo checkbox name
***********************************************************************************************************/
function exeCheckSeleted(sMsg1, sMsg2, chkNo)
{
	if (chkNo==null)
	{ 
		alert(sMsg1);
		return false;
	} 
	else 
	{
		var iLen=chkNo.length;
		if (iLen==null) 
		{
			if (!chkNo.checked)
			{
				alert(sMsg2);
				return false;
			}
			else
			{ 
				return true;
			}
		}
		else
		{
			var iFlag=0;
			for (i=0;i<iLen;i++)
			{
				if (chkNo[i].checked) iFlag++
			}
			if (iFlag==0)
			{ 
				alert(sMsg2);
				return false;
			}
			else
			{
				return true;
			}
		}
	}
}

function viewMainFlash(imagepath){
		document.write(" <OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" CODEBASE=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=\"740\" HEIGHT=\"167\"> ");
		document.write(" 		<PARAM NAME=\"movie\" VALUE=\""+imagepath+"CntMainImg.swf\">" );
		document.write(" 		<PARAM NAME=\"quality\" VALUE=\"high\"> ");
		document.write(" 		<EMBED SRC=\""+imagepath+"CntMainImg.swf\" QUALITY=\"high\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" TYPE=\"application/x-shockwave-flash\" WIDTH=\"740\" HEIGHT=\"167\"> ");
		document.write(" 		</EMBED> ");
		document.write(" 	</OBJECT> ");
	}	

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_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_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 goMenuPage(menuId, upMenuId) {
   document.menuForm.action = "/service";
   document.menuForm.command.value = menuId;
   document.menuForm.hddnUpMenuId.value = upMenuId;
   document.menuForm.target = "_self";
   document.menuForm.submit();
}


function showMenu(sArgMenuId)
{
	if (sCurrentDivName == sArgMenuId)
	{
		if (document.all["divMenu" + sArgMenuId].style.display == "none")
		{
			document.all["divMenu" + sArgMenuId].style.display = "";
		}
		else
		{
			document.all["divMenu" + sArgMenuId].style.display = "none";
		}
	}
	else
	{
		if (sCurrentDivName != "")
		{
			document.all["divMenu" + sCurrentDivName].style.display = "none";
		}
		document.all["divMenu" + sArgMenuId].style.display = "";
	}
	sCurrentDivName = sArgMenuId;
}

function setCookie( name, value ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + (60*60*24*365));
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function getCookie(name){
  var coki;
  var idx = document.cookie.indexOf(name+'=');

  if (idx != -1) {
	idx += name.length + 1;
	to_idx = document.cookie.indexOf(';', idx);

	if (to_idx == -1) {
		
		to_idx = document.cookie.length;
	}		
	coki = document.cookie.substring(idx, to_idx);
  } 
  else
  {
	  coki = "";
  }
  return coki;
}

function callTopMenu()
{
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"750\" height=\"80\">");
    document.write("<param name=\"movie\" value=\"/jsp/netmania/frame/image/flash/topmenu.swf\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<embed src=\"/jsp/netmania/frame/image/flash/topmenu.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"750\" height=\"80\"></embed></object>");
}
/**
 *		ÀÔ·Â°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
 *		onblur="js_Chk_Number(this);" onkeypress="js_Chk_NoChars();" ÇÔ²² »ç¿ë
 */
function js_Chk_Number(Object) {
	var sVal = Number(Object.value);
	if (sVal.toString() =='NaN')
	{
		alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
		Object.value = '';
		Object.focus();
		return false;
	}else {
		return true;
	}
}

/**
 *		¹®ÀÚÀÔ·Â(¿µ¹®ÀÚ) ±ÝÁö
 */
function js_Chk_NoChars()
{
	if(( event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >=65 && event.keyCode <=90))
	{
		event.keyCode=0;
	}
}

function infoUpdate()
{
	
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=no,location=no,directories=no,menubar=no,resizable=no,status=yes";
	var sWidth = "650";
	var sHeight = "500";

	winPop = openWindow("","ADMN1000MF",sAttr,sWidth,sHeight);
	document.menuForm.command.value = "netmania.sendbill.menu.ADMN.ADMN1000.command.ADMN1000MF";
	document.menuForm.target = winPop.name;
	document.menuForm.submit();

	winPop.focus();
	winPop.opener = self;		

}

//ÆäÀÌÁö incluede¹®Á¦·Î ÀÌ°÷¿¡ ¼±¾ð..
function goPrivate()
{
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=yes,location=no,directories=no,menubar=no,resizable=no,status=no";
	var sWidth = "730";
	var sHeight = "540";

	winPop = openWindow("/html/help/p_private.htm","ReverseTrans",sAttr,sWidth,sHeight);
	winPop.focus();
	winPop.opener = self;
}

function openCertCenter()
{
	var winPop = null;
	var sAttr = "toolbar=no,scrollbars=yes,location=no,directories=no,menubar=no,resizable=no,status=no";
	var sWidth = "655";
	var sHeight = "550";

	winPop = openWindow("/jsp/netmania/sendbill/frame/common/CertCenter/CertCenter.jsp","CertCenter",sAttr,sWidth,sHeight);
	winPop.focus();
	winPop.opener = self;
}
