/*
 *
 * »õÃ¢¿­±â
 * window.open ¿¡¼­ »ç¿ëµÇ´Â ¹æ½ÄÀ¸·Î features ¼³Á¤
 * @param theURL    »õÃ¢ÀÇ Url
 * @param winName   »õÃ¢ÀÇ name
 * @param features  »õÃ¢ÀÇ ¼¼ºÎ ¼³Á¤
 * @return
 */

function OpenWindow(theURL, winName, features) {
	window.open(theURL, winName, features);
}

function OpenWindow(theURL,winName, sbars, stat, mtop, mleft, wsize, hsize) {
	window.open(theURL,winName,"scrollbars="+sbars+", status="+stat+",top="+mtop+",left="+mleft+",width="+wsize+",height="+hsize+"");
}

function fnCalReset() {
    document.listForm.sDate.value = "";
    document.listForm.eDate.value = "";
}

function topPage()
{
	parent.main.scrollTo(0,0);
}

/**
 * Á¢±ÙÁßÀÎ ÆäÀÌÁöÀÇ ÁÖ¼ÒÁß µµ¸ÞÀÎ¸í ºÎºÐ
 */
var	_hostName;
_hostName	= document.location.href;
_hostName	= _hostName.substring(0, _hostName.indexOf("/", 8));

/************************************************************************************************
 * S - iframe¸¦ °¡Áö´Â ·¹ÀÌ¾î °´Ã¼
 ***********************************************************************************************/
var	_IframeLayer_cnt	= 0;
// <body> ÅÂ±×°¡ ½ÃÀÛµÇÁö ¾ÊÀº <head> ÅÂ±× ¾ÈÀÇ <script>ÅÂ±×¿¡¼­ ÀÎ½ºÅÏ½º µÉ ¼ö ¾ø½À´Ï´Ù.
function IframeLayer()
{
	if (document.body == null) {
		throw new Error("IframeLayer´Â <BODY> ÅÂ±×°¡ ½ÃÀÛµÇ°í ³­ ÈÄ¿¡ ÀÎ½ºÅÏ½º ÇÏ½Ê½Ã¿À.");
		return;
	}
	var	curCnt		= _IframeLayer_cnt++;
	// ¸É¹ö ÃÊ±âÈ­
	this.docObj					= document;
	this.ifm					= null;
	this.ifmObj					= null;
	this.ifmBody				= null;
	this.ifmName				= "_ifmlayer" + curCnt;
	this.cssURL					= null;
	this.bgColor				= null;
	this.bgImage				= null;
	this.innerHTML				= null;
	this.allowTransparencyFlag	= false;
	// METHOD °áÇÕ
	this.moveTo				= _IframeLayer_moveTo;
	this.setSize			= _IframeLayer_setSize;
	this.setWidth			= _IframeLayer_setWidth;
	this.setHeight			= _IframeLayer_setHeight;
	this.getWidth           = _IframeLayer_getWidth;
	this.getHeight          = _IframeLayer_setHeight;
	this.setVisible			= _IframeLayer_setVisible;
	this.zIndex				= _IframeLayer_zIndex;
	this.setURL				= _IframeLayer_setURL;
	this.setInnerHTML		= _IframeLayer_setInnerHTML;
	this.write				= _IframeLayer_write;
	this.writeln			= _IframeLayer_writeln;
	this.getBody			= _IframeLayer_getBody;
	this.autoSize			= _IframeLayer_autoSize;
	this.setCss				= _IframeLayer_setCss;
	this.setBgColor			= _IframeLayer_setBgColor;
	this.setBgImage			= _IframeLayer_setBgImage;
	this.getLayerDiv		= _IframeLayer_getLayerDiv;
	this.allowTransparency	= _IframeLayer_allowTransparency;
	this.getPosX            = _IframeLayer_getPosX;
	this.getPosY            = _IframeLayer_getPosY;

	this.isLayer     		= _IframeLayer_isLayer;
	// ·¹ÀÌ¾î »ý¼º
	this.div				= this.docObj.createElement("div");
	this.div.style.cssText	= "position:absolute; left:0px; top:0px; z-index:250; border-style:none;visibility:hidden;";
	this.div.innerHTML		= "<iframe name=\"" + this.ifmName + "\" width=\"100%\" height=\"100%\" src=\""
		+ _hostName + "/ext/html/empty.html\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" scrolling=\"no\" style=\"border:none;border-width:0px\"></iframe>";
	this.docObj.body.insertBefore(this.div, this.docObj.body.children[0]);
	this.ifm				= window.frames[this.ifmName];
	this.ifmObj				= this.div.children(0);
}

// ·¹ÀÌ¾î¸¦ ÀÌµ¿ ½ÃÅµ´Ï´Ù.
function _IframeLayer_moveTo(x, y) {
	this.div.style.posLeft	= x;
	this.div.style.posTop	= y;
}

// ÇöÀç X ÁÂÇ¥À§Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù.
function _IframeLayer_getPosX () {
    return this.div.style.posLeft;
}

// ÇöÀç X ÁÂÇ¥À§Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù.
function _IframeLayer_getPosY () {
    return this.div.style.posTop;
}

// ·¹ÀÌ¾î Å©±â¸¦ Á¶ÀýÇÕ´Ï´Ù.
function _IframeLayer_setSize(width, height) {
	this.ifmObj.width		= width;
	this.ifmObj.height		= height;
}

// ·¹ÀÌ¾î ³ÐÀÌ¸¦ Á¶ÀýÇÕ´Ï´Ù,
function _IframeLayer_setWidth(width) {
	this.ifmObj.width	= width;
}

// ·¹ÀÌ¾î ³ôÀÌ¸¦ Á¶ÀýÇÕ´Ï´Ù.
function _IframeLayer_getHeight(height) {
	this.ifmObj.height	= height;
}

// ·¹ÀÌ¾î ³ÐÀÌ¸¦ ¸®ÅÏÇÕ´Ï´Ù.
function _IframeLayer_getWidth() {
	return this.ifmObj.width;
}

// ·¹ÀÌ¾î ³ôÀÌ¸¦ ¸®ÅÏÇÕ´Ï´Ù.
function _IframeLayer_setHeight() {
	return this.ifmObj.height;
}

// ·¹ÀÌ¾î Ç¥½Ã ¿©ºÎ¸¦ ¼³Á¤ÇÕ´Ï´Ù.
// »ç¿ëµÇ´Â °÷ÀÇ ÆäÀÌÁö°¡ ¿ÏÀüÈ÷ ·ÎµåµÇ°í ³­ ÈÄ¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
function _IframeLayer_setVisible(flag) {
	if (this.ifm.document.body == null) {
		throw new Error("IframeLayer.setVisible METHOD´Â µµÅ¥¸àÆ® ·Îµå ¿Ï·á ÈÄ¿¡¸¸ »ç¿ë µÉ ¼ö ÀÖ½À´Ï´Ù.");
	}
	if (this.ifm.document.styleSheets.length == 0
		&& this.cssURL != null) {
		this.ifm.document.createStyleSheet(this.cssURL);
	}
	if (this.innerHTML != null
		&& this.innerHTML != this.ifm.document.body.innerHTML) {
		this.ifm.document.body.innerHTML	= this.innerHTML;
		this.innerHTML						= null;
	}
	if (this.bgImage != null
		&& this.bgImage != this.ifm.document.body.background) {
		this.ifm.document.body.background		= this.bgImage;
		this.bgImage							= null;
	}
	if (!this.ifmObj.allowTransparency && this.allowTransparencyFlag) {
		this.ifm.document.body.style.backgroundColor	= "transparent";
		this.ifmObj.allowTransparency					= this.allowTransparencyFlag;
	} else {
		this.ifm.document.body.style.backgroundColor	= this.bgColor;
	}


	this.div.style.visibility			= (flag ? "visible" : "hidden");
}

// ·¹ÀÌ¾î z index¸¦ ¼³Á¤ÇÕ´Ï´Ù.
function _IframeLayer_zIndex(zIndex) {
	this.div.style.zIndex	= zIndex;
}

// ·¹ÀÌ¾îÀÇ ³»¿ëÀ» url·Î ÁöÁ¤ÇÕ´Ï´Ù.
function _IframeLayer_setURL(url) {
	this.ifm.document.location.href	= url;
}

// ·¹ÀÌ¾î¿¡ InnerHTML ÁöÁ¤ÇÕ´Ï´Ù.
// html °ªÀ¸·Î ÁöÁ¤µÈ°ÍÀÌ object¶ó¸é ±× objectÀÇ InnerHTMLÀ» Ä«ÇÇÇÕ´Ï´Ù.
function _IframeLayer_setInnerHTML(html) {
	var	inHtml;

	if (typeof(html) == "string") {
		inHtml	= html;
	} else {
		try {
			inHtml	= html.innerHTML;
			if (inHtml == null) {
				inHtml	= "";
			}
		} catch (ignore) {
			inHtml	= "";
		}
	}

	if (this.ifm.document.body == null) {
		this.innerHTML	= inHtml;
	} else {
		this.ifm.document.body.innerHTML	= inHtml;
	}
}

// ·¹ÀÌ¾î¿¡ text¸¦ ¾¹´Ï´Ù.
// »ç¿ëµÇ´Â °÷ÀÇ ÆäÀÌÁö°¡ ¿ÏÀüÈ÷ ·ÎµåµÇ°í ³­ ÈÄ¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
function _IframeLayer_write(text) {
	if (this.ifm.document.body == null) {
		throw new Error("IframeLayer.write METHOD´Â µµÅ¥¸àÆ® ·Îµå ¿Ï·á ÈÄ¿¡¸¸ »ç¿ë µÉ ¼ö ÀÖ½À´Ï´Ù.");
	}
	this.ifm.document.body.write(text);
}

// ·¹ÀÌ¾î¿¡ text¸¦ ¾¹´Ï´Ù.
// »ç¿ëµÇ´Â °÷ÀÇ ÆäÀÌÁö°¡ ¿ÏÀüÈ÷ ·ÎµåµÇ°í ³­ ÈÄ¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
function _IframeLayer_writeln(text) {
	if (this.ifm.document.body == null) {
		throw new Error("IframeLayer.writeln METHOD´Â µµÅ¥¸àÆ® ·Îµå ¿Ï·á ÈÄ¿¡¸¸ »ç¿ë µÉ ¼ö ÀÖ½À´Ï´Ù.");
	}
	this.ifm.document.body.writeln(text);
}

// ·¹ÀÌ¾î¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Â ¹Ùµð °´Ã¼¸¦ ¾ò½À´Ï´Ù.
// »ç¿ëµÇ´Â °÷ÀÇ ÆäÀÌÁö°¡ ¿ÏÀüÈ÷ ·ÎµåµÇ°í ³­ ÈÄ¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
function _IframeLayer_getBody() {
	if (this.ifm.document.body == null) {
		throw new Error("IframeLayer.getBody METHOD´Â µµÅ¥¸àÆ® ·Îµå ¿Ï·á ÈÄ¿¡¸¸ »ç¿ë µÉ ¼ö ÀÖ½À´Ï´Ù.");
	}
	return this.ifm.document.body;
}

// ·¹ÀÌ¾î¿¡ ´ã±ä ³»¿ë¿¡ ¸Â´Â ½ÎÀÌÁî ÀÚµ¿ Á¶Àý
// ·¹ÀÌ¾î¿¡ ´ã±ä ³»¿ëÀÌ TABLE·Î µÑ·¯ ½×¿© ÀÖ¾î¾ß Á¤È®ÇÑ Å©±â·Î Á¶ÀýµË´Ï´Ù.
// »ç¿ëµÇ´Â °÷ÀÇ ÆäÀÌÁö°¡ ¿ÏÀüÈ÷ ·ÎµåµÇ°í ³­ ÈÄ¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
function _IframeLayer_autoSize() {
	var	newWidth;
	var	newHeight;

	if (this.ifm.document.body == null) {
		throw new Error("IframeLayer.autoSize METHOD´Â µµÅ¥¸àÆ® ·Îµå ¿Ï·á ÈÄ¿¡¸¸ »ç¿ë µÉ ¼ö ÀÖ½À´Ï´Ù.");
	}
	this.setSize(1, 1);
	newWidth	= this.ifm.document.body.scrollWidth;
	newHeight	= this.ifm.document.body.scrollHeight;
	this.setSize(newWidth, newHeight);
}

function _IframeLayer_isLayer( )
{
    return true;
}

// CSS¸¦ URL·Î ÁöÁ¤ÇÕ´Ï´Ù.
// ÇÑ¹ø¸¸ ¼³Á¤ µÉ ¼ö ÀÖ½À´Ï´Ù.
function _IframeLayer_setCss(cssURL) {
	if (this.cssURL != null) {
		throw new Error("CSS´Â ÇÑ¹ø¸¸ ÁöÁ¤ °¡´ÉÇÕ´Ï´Ù.");
	}
	this.cssURL	= cssURL;
}

// ·¹ÀÌ¾îÀÇ ¹è°æ»öÀ» ÁöÁ¤ÇÕ´Ï´Ù.
// ¹Ý¿µÀº ½Ç½Ã°£À¸·Î µÇÁö ¾ÊÀ¸¸ç,setVisible METHOD°¡ È£ÃâµÉ¶§¸¶´Ù ¹Ý¿µµË´Ï´Ù.
function _IframeLayer_setBgColor(color) {
	this.bgColor	= color;
}

// ·¹ÀÌ¾îÀÇ ¹è°æÀÌ¹ÌÁö¸¦ ÁöÁ¤ÇÕ´Ï´Ù.
// ¹Ý¿µÀº ½Ç½Ã°£À¸·Î µÇÁö ¾ÊÀ¸¸ç,setVisible METHOD°¡ È£ÃâµÉ¶§¸¶´Ù ¹Ý¿µµË´Ï´Ù.
function _IframeLayer_setBgImage(url) {
	this.bgImage	= url;
}


// ·¹ÀÌ¾î¿¡ »ç¿ëµÈ div °´Ã¼¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
function _IframeLayer_getLayerDiv() {
	return this.div;
}

// ·¹ÀÌ¾îÀÇ Åõ¸í¿©ºÎ¸¦ ¼³Á¤ÇÕ´Ï´Ù.
// true¸¦ Àü´ÞÇÏ¸é Åõ¸íÀÔ´Ï´Ù.
function _IframeLayer_allowTransparency(flag) {
	this.allowTransparencyFlag	= flag;
}


/************************************************************************************************
 * S - ´Þ·Â ¼±ÅÃ ·¹ÀÌ¾î
 ***********************************************************************************************/
var	_calLayer;

// Ä®¸°´õ¿ë ·¹ÀÌ¾î ÃÊ±âÈ­. ¹Ýµå½Ã <body> ÅÂ±×°¡ ½ÃÀÛµÈ ÀÌÈÄ¿¡ È£Ãâ µÇ¾î¾ß ÇÕ´Ï´Ù.
function initCalendar() {
	_calLayer	= new IframeLayer();
	_calLayer.setCss("/ext/css/basic.css");
	_calLayer.setBgColor("white");
}

/**
 * paramname	    »ç¿ëÀÚ°¡ ¼±ÅÃÇÑ ³¯Â¥¸¦ ¼ÂÆÃÇÒ Obj ÀÌ¸§ - ¹®ÀÚ¿­
 * initDate         ´Þ·Â ´ÙÀÌ¾ó·Î±× »ó¿¡ ÃÊ±â°ª - ¹®ÀÚ¿­
 *                  yyyyMMddHH  Çü½ÄÀ¸·Î ÁöÁ¤.
 *                  »ý·«ÇÏ¸é ÇöÀç ÀÏ½Ã.
 * tobj				Ä¶¸°´õ ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 */
function fnCalPopup(paramname, initDate, tobj, dx, dy) {

	if (_calLayer == null) {
		throw new Error("Ä®¸°´õ Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initCalendar()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}

	var	loc;

	loc	= getPosition(tobj);

	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}

	if (_membLayer != null) {
		_membLayer.setVisible(false);
		_membLayer.setSize(0, 0);
	}

	_calLayer.setVisible(false);
	_calLayer.setSize(0, 0);

	_calLayer.moveTo(loc.x + dx, loc.y + dy);
	_calLayer.setURL(_hostName  + "/common/popup/popDate.jsp?mode=layer&paramname=" + paramname + (initDate == null ? "" : "&initdate=" + initDate));
}


/************************************************************************************************
 * S - ¾ÆÀÌµðÁßº¹Ã¼Å© ·¹ÀÌ¾î
 ***********************************************************************************************/
var	_useridLayer;

// ¾ÆÀÌµðÁßº¹Ã¼Å©¿ë ·¹ÀÌ¾î ÃÊ±âÈ­. ¹Ýµå½Ã <body> ÅÂ±×°¡ ½ÃÀÛµÈ ÀÌÈÄ¿¡ È£Ãâ µÇ¾î¾ß ÇÕ´Ï´Ù.
function initSelectUserid() {
	_useridLayer	= new IframeLayer();
	_useridLayer.setCss("/ext/css/basic.css");
	_useridLayer.setBgColor("white");
}

/**
 * tobj				¾ÆÀÌµðÁßº¹Ã¼Å© ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 */
function fnUseridPopup(tobj, dx, dy) {

	if (_useridLayer == null) {
		throw new Error("¾ÆÀÌµðÁßº¹Ã¼Å©¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectUserid()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}

	var	loc;

	loc	= getPosition(tobj);

	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}

	_useridLayer.setVisible(false);
	_useridLayer.setSize(0, 0);

	_useridLayer.moveTo(loc.x + dx, loc.y + dy);
	_useridLayer.setURL(_hostName  + "/common/popup/popCheckId.jsp?mode=layer");
}

/************************************************************************************************
 * S - °¡¸ÍÁ¡ ¼±ÅÃ ·¹ÀÌ¾î
 ***********************************************************************************************/
var	_membLayer;

// °¡¸ÍÁ¡ ¼±ÅÃ ·¹ÀÌ¾î ÃÊ±âÈ­. ¹Ýµå½Ã <body> ÅÂ±×°¡ ½ÃÀÛµÈ ÀÌÈÄ¿¡ È£Ãâ µÇ¾î¾ß ÇÕ´Ï´Ù.
function initSelectMemb() {
	_membLayer	= new IframeLayer();
	_membLayer.setCss("/ext/css/basic.css");
	_membLayer.setBgColor("white");
}

/*******************************************************************
 * rtnmemb	        ¼±ÅÃÀ¯Çü (1:»ç¾÷ÀÚ¹øÈ£, 2:°¡¸ÍÁ¡ID, 3:´Ü¸»±â¹øÈ£)
 * objname1         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * objname2         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * value1         	objname1¿¡ ReturnÇÒ °á°ú°ª
 * value2         	objname2¿¡ ReturnÇÒ °á°ú°ª
 * tobj				»ç¾÷ÀÚ ¼±ÅÃ ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 ******************************************************************/
function fnMembPopup(rtnmemb, objname1, objname2, value1, value2, tobj, dx, dy) {
	if (_membLayer == null) {
		throw new Error("»ç¾÷ÀÚ ¼±ÅÃ Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectMemb()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}
	var	loc;
	loc	= getPosition(tobj);
	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}
	if (_calLayer != null) {
		_calLayer.setVisible(false);
		_calLayer.setSize(0, 0);
	}
	if (_termlistLayer != null) {
		_termlistLayer.setVisible(false);
		_termlistLayer.setSize(0, 0);
	}

	_membLayer.setVisible(false);
	_membLayer.setSize(0, 0);
	_membLayer.moveTo(loc.x + dx, loc.y + dy);
	_membLayer.setURL(_hostName  + "/common/popup/popSearchMemb.jsp?mode=layer&rtnmemb=" + rtnmemb + "&objname1=" + objname1 + "&objname2=" + objname2 + "&value1=" + value1 + "&value2=" + value2);
}

/*******************************************************************
 * rtnmemb	        ¼±ÅÃÀ¯Çü (1:»ç¾÷ÀÚ¹øÈ£, 2:°¡¸ÍÁ¡ID, 3:´Ü¸»±â¹øÈ£)
 * objname1         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * objname2         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * value1         	objname1¿¡ ReturnÇÒ °á°ú°ª
 * value2         	objname2¿¡ ReturnÇÒ °á°ú°ª
 * tobj				»ç¾÷ÀÚ ¼±ÅÃ ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 ******************************************************************/
function fnMembPopup2(rtnmemb, objname1, objname2,objname3, value1, value2, tobj, dx, dy) {
	if (_membLayer == null) {
		throw new Error("»ç¾÷ÀÚ ¼±ÅÃ Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectMemb()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}
	var	loc;
	loc	= getPosition(tobj);
	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}
	if (_calLayer != null) {
		_calLayer.setVisible(false);
		_calLayer.setSize(0, 0);
	}
	if (_termlistLayer != null) {
		_termlistLayer.setVisible(false);
		_termlistLayer.setSize(0, 0);
	}

	_membLayer.setVisible(false);
	_membLayer.setSize(0, 0);
	_membLayer.moveTo(loc.x + dx, loc.y + dy);
	_membLayer.setURL(_hostName  + "/common/popup/popSearchMemb.jsp?mode=layer&rtnmemb=" + rtnmemb + "&objname1=" + objname1 + "&objname2=" + objname2 +"&objname3=" + objname3 + "&value1=" + value1 + "&value2=" + value2);
}


/******************************************************************
 * ÀÏ¹Ý°¡¸ÍÁ¡ - ÇØ´ç »ç¾÷ÀÚ¹øÈ£,»ç¾÷ÀÚidx Á¶È¸ ÆË¾÷
 * ****************************************************************
 * objname1         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * objname2         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * value1         	objname1¿¡ ReturnÇÒ °á°ú°ª
 * value2         	objname2¿¡ ReturnÇÒ °á°ú°ª
 * tobj				»ç¾÷ÀÚ ¼±ÅÃ ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 *****************************************************************/
function fnCompnoPopup(objname1, objname2, tobj, dx, dy) 
{
	if (_membLayer == null) {
		throw new Error("»ç¾÷ÀÚ ¼±ÅÃ Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectMemb()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}
	
	var	loc;
	loc	= getPosition(tobj);
	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}
	if (_calLayer != null) {
		_calLayer.setVisible(false);
		_calLayer.setSize(0, 0);
	}
	if (_termlistLayer != null) {
		_termlistLayer.setVisible(false);
		_termlistLayer.setSize(0, 0);
	}

	_membLayer.setVisible(false);
	_membLayer.setSize(0, 0);
	_membLayer.moveTo(loc.x + dx, loc.y + dy);
	_membLayer.setURL(_hostName  + "/common/popup/popSearchCompnoMain.jsp?mode=layer&objname1=" + objname1 + "&objname2=" + objname2);

}


/******************************************************************
 * ÀÏ¹Ý°¡¸ÍÁ¡ - ÇØ´ç »ç¾÷ÀÚ¹øÈ£,»ç¾÷ÀÚidx Á¶È¸ ÆË¾÷
 * ****************************************************************
 * objname1         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * objname2         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * objname3         °á°ú¸¦ ReturnÇÒ OBJ ¸í
 * value1         	objname1¿¡ ReturnÇÒ °á°ú°ª
 * value2         	objname2¿¡ ReturnÇÒ °á°ú°ª
 * value3         	objname3¿¡ ReturnÇÒ °á°ú°ª
 * tobj				»ç¾÷ÀÚ ¼±ÅÃ ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 *****************************************************************/
function fnCatidPopup(objname1, objname2, objname3, tobj, dx, dy) 
{  
	if (_membLayer == null) {
		throw new Error("»ç¾÷ÀÚ ¼±ÅÃ Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectMemb()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}
	
	var	loc;
	loc	= getPosition(tobj);
	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}
	if (_calLayer != null) {
		_calLayer.setVisible(false);
		_calLayer.setSize(0, 0);
	}
	if (_termlistLayer != null) {
		_termlistLayer.setVisible(false);
		_termlistLayer.setSize(0, 0);
	}

	_membLayer.setVisible(false);
	_membLayer.setSize(0, 0);
	_membLayer.moveTo(loc.x + dx, loc.y + dy);
	_membLayer.setURL(_hostName  + "/common/popup/popSearchCatid.jsp?mode=layer&objname1=" + objname1 + "&objname2=" + objname2 + "&objname3=" + objname3);

}


/************************************************************************************************
 * S - ´Ü¸»±â¸®½ºÆ® Ç¥½Ã ·¹ÀÌ¾î
 ***********************************************************************************************/
var	_termlistLayer;

// ´Ü¸»±â¸®½ºÆ® Ç¥½Ã¿ë ·¹ÀÌ¾î ÃÊ±âÈ­. ¹Ýµå½Ã <body> ÅÂ±×°¡ ½ÃÀÛµÈ ÀÌÈÄ¿¡ È£Ãâ µÇ¾î¾ß ÇÕ´Ï´Ù.
function initSelectTermlist() {
	_termlistLayer	= new IframeLayer();
	_termlistLayer.setCss("/ext/css/basic.css");
	_termlistLayer.setBgColor("white");
}

/**
 * compno	        ´Ü¸»±â¸¦ Á¶È¸ÇÒ »ç¾÷ÀÚ ¹øÈ£
 * compidx          ´Ü¸»±â¸¦ Á¶È¸ÇÒ »ç¾÷ÀÚ IDX
 * tobj				´Ü¸»±â¸®½ºÆ® ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 */
function fnTermlistPopup(compno, compidx, tobj, dx, dy) {

	if (_termlistLayer == null) {
		throw new Error("´Ü¸»±â¸®½ºÆ® Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectTermlist()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}

	var	loc;

	loc	= getPosition(tobj);

	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}

	if (_membLayer != null) {
		_membLayer.setVisible(false);
		_membLayer.setSize(0, 0);
	}

	_termlistLayer.setVisible(false);
	_termlistLayer.setSize(0, 0);

	_termlistLayer.moveTo(loc.x + dx, loc.y + dy);
	_termlistLayer.setURL(_hostName  + "/common/popup/popSearchTerm.jsp?mode=layer&compno=" + compno + "&compidx=" + compidx);
}

/************************************************************************************************
 * S - °ü¸®±×·ì ¼±ÅÃ ·¹ÀÌ¾î
 ***********************************************************************************************/
var	_groupLayer;

// °ü¸®±×·ì Ç¥½Ã¿ë ·¹ÀÌ¾î ÃÊ±âÈ­. ¹Ýµå½Ã <body> ÅÂ±×°¡ ½ÃÀÛµÈ ÀÌÈÄ¿¡ È£Ãâ µÇ¾î¾ß ÇÕ´Ï´Ù.
function initSelectGroup() {
	_groupLayer	= new IframeLayer();
	_groupLayer.setCss("/ext/css/basic.css");
	_groupLayer.setBgColor("white");
}

/**
 * objname	        »ç¿ëÀÚ°¡ ¼±ÅÃÇÑ ³¯Â¥¸¦ ¼ÂÆÃÇÒ Obj ÀÌ¸§ - ¹®ÀÚ¿­
 * tobj				Ä¶¸°´õ ·¹ÀÌ¾î°¡ Ç¥½ÃµÉ ±âÁØ À§Ä¡°¡ µÉ ¾Ù¸®¸ÕÆ® °´Ã¼ nullÀÌ ÁöÁ¤µÇ¸é ¸¶¿ì½º Æ÷ÀÎÅÍ
 * dx			    ±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë x À§Ä¡
 * dy				±âÁØ À§Ä¡·Î ºÎÅÍÀÇ »ó´ë y ÀÇÄ¡
 */

function fnGroupPopup(objname, tobj, dx, dy) {

	if (_groupLayer == null) {
		throw new Error("°ü¸®±×·ì Ç¥½Ã¸¦ À§ÇÑ ·¹ÀÌ¾îÀÇ ÃÊ±âÈ­ initSelectGroup()°¡ È£ÃâµÈ ÀûÀÌ ¾ø½À´Ï´Ù.");
	}

	var	loc;

	loc	= getPosition(tobj);

	if (dx == null) {
		dx	= 0;
	}
	if (dy == null) {
		dy	= 0;
	}

	_groupLayer.setVisible(false);
	_groupLayer.setSize(0, 0);

	_groupLayer.moveTo(loc.x + dx, loc.y + dy);
	_groupLayer.setURL(_hostName  + "/common/popup/popSearchGroup.jsp?mode=layer&objname=" + objname);

}

/************************************************************************************************
 * S - À§Ä¡ ÁÂÇ¥ °´Ã¼
 ***********************************************************************************************/

 function Position() {
 	this.x	= 0;
 	this.y	= 0;
 }

/************************************************************************************************
 * E - À§Ä¡ ÁÂÇ¥ °´Ã¼
 ***********************************************************************************************/

// ÁÖ¾îÁø °´Ã¼ÀÇ À§Ä¡¸¦ Position°´Ã¼·Î ¹ÝÈ¯ÇÕ´Ï´Ù.
// °´Ã¼°¡ ÁÖ¾îÁöÁö ¾ÊÀ¸¸é ¸¶¿ì½º Æ÷ÀÎÅÍÀÇ À§Ä¡¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
function getPosition(tobj) {
	var	rv;
	var	cobj;

	rv	= new Position();
	if (tobj == null){
		rv.x	= window.event.clientX;
		rv.y	= window.event.clientY;
	} else {
		cobj	= tobj;
		rv.x	= cobj.offsetLeft;
		rv.y	= cobj.offsetTop;
		cobj	= cobj.offsetParent;
		while(cobj != null) {
			rv.x	+= cobj.offsetLeft;
			rv.y	+= cobj.offsetTop;
			cobj	= cobj.offsetParent;
		}
	}

	return rv;
}
