var popupId;
var wizcom = {};
var fadeTimerId = null;

function getBrowserType()
{
	if(navigator.userAgent.indexOf("MSIE") !=-1) return "IE";
	/*{
		if(navigator.userAgent.indexOf("MSIE 7") !=-1) return "IE7";
		else return "IE";
	}*/
	else if(navigator.userAgent.indexOf("Firefox") !=-1) return "FF";
	else if(navigator.userAgent.indexOf("Mozilla") !=-1) return "MZ";
	else if(navigator.userAgent.indexOf("Opera") !=-1) return "OP";
	else if(navigator.userAgent.indexOf("Safari") !=-1) return "SF";
	else if(navigator.userAgent.indexOf("Mac") !=-1) return "MC";
	else return "";
}

function ajaxRequest(url, callback, strParam)
{
	if ( strParam != null ) new wizcom.xhr.Request("POST", url, strParam, callback);
	else new wizcom.xhr.Request("GET", url, null, callback);
}
// ajaxHistory.jsp ¿¡¼­ È£ÃâµÇ´Â ÇÔ¼ö
function evalJs(strJs) { eval(strJs); }
// µÚ·Î°¡±â¸¦ À§ÇÑ wrapper ÇÔ¼ö. js´Â iframe¿¡ È÷½ºÅä¸® Âï°í evalJs¿¡¼­ ÆÄ½ÌµÉ ÇÔ¼ö¹®ÀÚ¿­
function ajaxHistory(strJs) { document.getElementById("ajaxHistory").src="/wizcom_cpnt/ajaxHistory.jsp?js=" + encodeURIComponent(strJs); }

wizcom.xhr = {};
wizcom.xhr.Request = function(method, url, params, callback, asynch)
{
	this.method = method;
	this.url = url;
	this.params = params;
	this.callback = callback;
	this.asynch = (asynch == null || asynch == "") ? true : asynch;;
	this.send();
}

wizcom.xhr.Request.prototype =
{
	createXMLHttpRequest: function()
	{
		if (window.ActiveXObject)
		{
			try
			{
				return new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					return new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) { return null; }
			}
		} else if (window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else {
			return null;
		}
	}
	, send: function()
	{
		this.req = this.createXMLHttpRequest();

		var httpMethod = this.method ? this.method : "GET";
		if ( httpMethod != "GET" && httpMethod != "POST") httpMethod = "GET";
		var httpParams = (this.params == null || this.params == "") ? null : this.params;
		var httpUrl = this.url;
		if (httpMethod == "GET" && httpParams != null) httpUrl = httpUrl + "?" + httpParams;
		this.req.open(httpMethod, httpUrl, this.asynch);
		this.req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
		var request = this;
		if (this.callback != null) this.req.onreadystatechange = function() { request.onStateChange.call(request); }
		this.req.send(httpMethod == "POST" ? httpParams : null);
	}
	, onStateChange: function()
	{
		// ¸Å°³º¯¼ö ¾ø´Â ÄÝ¹éÇÔ¼ö
		if ( typeof this.callback != "string" ) this.callback(this.req);
		// ¸Å°³º¯¼ö°¡ ÀÖ´Â ÄÝ¹éÇÔ¼öÀÏ °æ¿ì ¹®ÀÚ¿­ÇüÀ¸·Î ³Ñ±ä´Ù.
		else
		{
			if ( this.callback.indexOf("(") == -1 ) eval (this.callback + "(this.req)");
			else eval(this.callback.substring(0, this.callback.indexOf("(")+1) + "this.req," + this.callback.substr(this.callback.indexOf("(")+1));
		}
	}
}

wizcom.Event = {};

wizcom.Event.addListener = function(element, name, observer, useCapture)
{
	useCapture = useCapture || false;

	if (element.addEventListener) {
		element.addEventListener(name, observer, useCapture);
	} else if (element.attachEvent) {
		element.attachEvent('on' + name, observer);
	}
}

wizcom.Event.removeListener = function(element, name, observer, useCapture)
{
	useCapture = useCapture || false;

	if (element.removeEventListener) {
		element.removeEventListener(name, observer, useCapture);
	} else if (element.detachEvent) {
		element.detachEvent('on' + name, observer);
	}
}

wizcom.Event.getTarget = function(event)
{
	if (event == null) return null;
	if (event.target) return event.target;
	else if (event.srcElement) return event.srcElement;
	return null;
}

wizcom.Event.getMouseXY = function(event)
{
	var mouseX = event.clientX;
	var mouseY = event.clientY;

	var dd = document.documentElement;
	var db = document.body;
	if (dd) {
		mouseX += dd.scrollLeft;
		mouseY += dd.scrollTop;
	} else if (db) {
		mouseX += db.scrollLeft;
		mouseY += db.scrollTop;
	}
	return {x: mouseX, y: mouseY};
}

wizcom.Event.isLeftButton= function(event)
{
	return (event.which) ?
		   event.which == 1 && event.button == 0 :
		   (event.type == 'click') ? event.button == 0 : event.button == 1;
}

wizcom.Event.isRightButton = function(event)
{
	return event.button == 2;
}

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

wizcom.Event.preventDefault = function(event)
{
	if (event.preventDefault) {
		event.preventDefault();
	} else {
		event.returnValue = false;
	}
}

wizcom.Event.stopEvent = function(event)
{
	wizcom.Event.stopPropagation(event);
	wizcom.Event.preventDefault(event);
}

wizcom.Event.bindAsListener = function(func, obj)
{
	return function() {
		return func.apply(obj, arguments);
	}
}

wizcom.GUI = {};

wizcom.GUI.setOpacity = function(el, opacity)
{
	if (el.filters) {
		el.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
	} else {
		el.style.opacity = opacity;
	}
}

wizcom.GUI.getStyle = function(el, property)
{
	var value = null;
	var dv = document.defaultView;

	if (property == 'opacity' && el.filters) {// IE opacity
		value = 1;
		try {
			value = el.filters.item('alpha').opacity / 100;
		} catch(e) {}
	} else if (el.style[property]) {
		value = el.style[property];
	} else if (el.currentStyle && el.currentStyle[property]) {
		value = el.currentStyle[property];
	} else if ( dv && dv.getComputedStyle ) {
		// ´ë¹®ÀÚ¸¦ ¼Ò¹®ÀÚ·Î º¯È¯ÇÏ°í ±× ¾Õ¿¡ '-'¸¦ ºÙÀÎ´Ù.
		var converted = '';
		for(i = 0, len = property.length;i < len; ++i) {
			if (property.charAt(i) == property.charAt(i).toUpperCase()) {
				converted = converted + '-' +
							property.charAt(i).toLowerCase();
			} else {
				converted = converted + property.charAt(i);
			}
		}
		if (dv.getComputedStyle(el, '').getPropertyValue(converted)) {
			value = dv.getComputedStyle(el, '').getPropertyValue(converted);
		}
	}
	return value;
}

wizcom.GUI.getXY = function(el)
{
	// elÀº ¹®¼­¿¡ Æ÷ÇÔµÇ¾î ÀÖ¾î¾ß ÇÏ°í, È­¸é¿¡ º¸¿©¾ß ÇÑ´Ù.
	if (el.parentNode === null || el.style.display == 'none') {
		return false;
	}

	var parent = null;
	var pos = [];
	var box;

	if (document.getBoxObjectFor) { // gecko ¿£Áø ±â¹Ý
		box = document.getBoxObjectFor(el);
		pos = [box.x, box.y];
	} else { // ±âÅ¸ ºê¶ó¿ìÀú
		pos = [el.offsetLeft, el.offsetTop];
		parent = el.offsetParent;
		if (parent != el) {
			while (parent) {
				pos[0] += parent.offsetLeft;
				pos[1] += parent.offsetTop;
				parent = parent.offsetParent;
			}
		}
		// ¿ÀÆä¶ó¿Í »çÆÄ¸®ÀÇ 'absolute' postionÀÇ °æ¿ì
		// bodyÀÇ offsetTopÀ» Àß¸ø °è»êÇÏ¹Ç·Î º¸Á¤ÇØ¾ß ÇÑ´Ù.
		var ua = navigator.userAgent.toLowerCase();
		if (
			ua.indexOf('opera') != -1
			|| ( ua.indexOf('safari') != -1 && this.getStyle(el, 'position') == 'absolute' )
		) {
			pos[1] -= document.body.offsetTop;
		}
	}

	if (el.parentNode) { parent = el.parentNode; }
	else { parent = null; }

	// body ¶Ç´Â html ÀÌ¿ÜÀÇ ºÎ¸ð ³ëµå Áß¿¡ ½ºÅ©·ÑµÇ¾î ÀÖ´Â
	// ¿µ¿ªÀÌ ÀÖ´Ù¸é ¾Ë¸Â°Ô Ã³¸®ÇÑ´Ù.
	while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') {
		pos[0] -= parent.scrollLeft;
		pos[1] -= parent.scrollTop;

		if (parent.parentNode) { parent = parent.parentNode; }
		else { parent = null; }
	}
	return {x: pos[0], y: pos[1]};
}

wizcom.GUI.getX = function(el)
{
	return wizcom.GUI.getXY(el).x;
}

wizcom.GUI.getY = function(el)
{
	return wizcom.GUI.getXY(el).y;
}

wizcom.GUI.getBounds = function(el)
{
	var xy = wizcom.GUI.getXY(el);
	return {
		x: xy.x,
		y: xy.y,
		width: el.offsetWidth,
		height: el.offsetHeight
	};
}

wizcom.GUI.setXY = function(el, x, y)
{
	var pageXY = wizcom.GUI.getXY(el);
	if (pageXY === false) { return false; }
	var position = wizcom.GUI.getStyle(el, 'position');
	if (!position || position == 'static') {
		el.style.position = 'relative';
	}
	var delta = {
		x: parseInt( wizcom.GUI.getStyle(el, 'left'), 10 ),
		y: parseInt( wizcom.GUI.getStyle(el, 'top'), 10 )
	};
	if ( isNaN(delta.x) ) { delta.x = 0; }
	if ( isNaN(delta.y) ) { delta.y = 0; }

	if (x != null) {
		el.style.left = (x - pageXY.x + delta.x) + 'px';
	}
	if (y != null) {
		el.style.top = (y - pageXY.y + delta.y) + 'px';
	}

	return true;
}

wizcom.dnd = {};

function SdndRegister(strElemId)
{
	return new wizcom.dnd.SimpleDragSource(strElemId);
}

wizcom.dnd.SimpleDragSource = function(elementId)
{
	this.element = document.getElementById(elementId);
	this.dragging = false; // ÇöÀç µå·¡±×ÁßÀÎÁö ¿©ºÎ Ç¥½Ã
	this.selected = false; // ÇöÀç ¸¶¿ì½º´Ù¿î »óÅÂÀÎÁö Ç¥½Ã
	this.diff = null; // ¸¶¿ì½º À§Ä¡¿Í °´Ã¼ À§Ä¡

	this.mouseDown = wizcom.Event.bindAsListener(this.doMouseDown, this);
	this.mouseMove = wizcom.Event.bindAsListener(this.doMouseMove, this);
	this.mouseUp = wizcom.Event.bindAsListener(this.doMouseUp, this);

	wizcom.Event.addListener(this.element, "mousedown", this.mouseDown);
}

wizcom.dnd.SimpleDragSource.prototype =
{
	doMouseDown: function(e) {
		var event = window.event || e;
		if (!wizcom.Event.isLeftButton(event)) return;

		this.selected = true;

		var elementXY = wizcom.GUI.getXY(this.element);
		var mouseXY = wizcom.Event.getMouseXY(event);
		this.diff = {
			x: mouseXY.x - elementXY.x,
			y: mouseXY.y - elementXY.y
		};

		wizcom.Event.addListener(document, "mousemove", this.mouseMove);
		wizcom.Event.addListener(document, "mouseup", this.mouseUp);
		wizcom.Event.stopEvent(event);
	},
	doMouseMove: function(e) {
		if (!this.selected) return false;

		if (!this.dragging) {
			this.dragging = true;
			wizcom.GUI.setOpacity(this.element, 1.0); // µå·¡±×ÇÏ´Â µ¿¾È opacity °ª(µðÆúÆ® : 0.60)
		}

		var event = window.event || e;
		var mouseXY = wizcom.Event.getMouseXY(event);
		var newXY = {
			x: mouseXY.x - this.diff.x,
			y: mouseXY.y - this.diff.y
		}
		wizcom.GUI.setXY(this.element, newXY.x, newXY.y);

		wizcom.Event.stopEvent(event);
	},
	doMouseUp: function(e) {
		if (!this.selected) return;

		this.selected = false;
		this.diff = null;

		var event = window.event || e;
		if (this.dragging) {
			this.dragging = false;
			wizcom.GUI.setOpacity(this.element, 1.0);
		}
		wizcom.Event.removeListener(
			document, "mousemove", this.mouseMove);
		wizcom.Event.removeListener(
			document, "mouseup", this.mouseUp);
		wizcom.Event.stopEvent(event);
	}
}

wizcom.dnd.DNDManager = function()
{
	this.dropTargetList = new Array();
	this.dragSourceList = new Array();

	this.mouseDown = wizcom.Event.bindAsListener(this.doMouseDown, this);
	this.mouseMove = wizcom.Event.bindAsListener(this.doMouseMove, this);
	this.mouseUp = wizcom.Event.bindAsListener(this.doMouseUp, this);

	this.selectedDragSource = null;
}

wizcom.dnd.DNDManager.prototype =
{
	addDropTarget: function(dropTarget) {
		this.dropTargetList[this.dropTargetList.length] = dropTarget;
	},
	removeDropTarget: function(dropTarget) {
		var newList = new Array();
		for (var i = 0 ; i < this.dropTargetList.length ; i++) {
			if (this.dropTargetList[i] != dropTarget) {
				newList[newList.length] = this.dropTargetList[i];
			}
		}
		this.dropTargetList = newList;
	},
	addDragSource: function(dragSource) {
		this.dragSourceList[this.dragSourceList.length] = dragSource;
		wizcom.Event.addListener(dragSource.getElement(),
							   "mousedown", this.mouseDown);
	},
	removeDragSource: function(dragSource) {
		var newList = new Array();
		for (var i = 0 ; i < this.dropTargetList.length ; i++) {
			if (this.dragSourceList[i] != dragSource) {
				newList[newList.length] = this.dragSourceList[i];
			} else {
				wizcom.Event.removeListener(
					dragSource.getElement(),
					"mousedown", this.mouseDown);
			}
		}
		this.dragSourceList = newList;
	},
	doMouseDown: function(e) {
		var event = window.event || e;
		if (!wizcom.Event.isLeftButton(event)) return;

		var target = wizcom.Event.getTarget(event);

		while (target && !target.dragSource) {
			target = target.parentNode;
		}
		this.selectedDragSource = target.dragSource;
		this.selectedDragSource.selectDrag(event);

		wizcom.Event.addListener(document, "mousemove", this.mouseMove);
		wizcom.Event.addListener(document, "mouseup", this.mouseUp);
		wizcom.Event.stopEvent(event);
	},
	doMouseMove: function(e) {
		if (!this.selectedDragSource) return;

		var event = window.event || e;
		if (!this.selectedDragSource.isDragging()) {
			this.selectedDragSource.startDrag();
		}

		this.selectedDragSource.moveDrag(event);

		wizcom.Event.stopEvent(event);
	},
	doMouseUp: function(e) {
		if (!this.selectedDragSource) return;

		var dragSource = this.selectedDragSource;
		this.selectedDragSource = null;

		var event = window.event || e;

		dragSource.deselectDrag(event);

		if (dragSource.isDragging()) {
			var mouseXY = wizcom.Event.getMouseXY(event);

			var dropTarget = null;
			for (var i = 0 ; i < this.dropTargetList.length ; i++) {
				var droppable = this.dropTargetList[i].checkInDropTarget(
					dragSource, mouseXY);
				if (droppable) {
					dropTarget = this.dropTargetList[i];
					break;
				}
			}
			if (dropTarget) {
				dragSource.endDrag(event);
				dropTarget.drop(dragSource);
			} else {
				dragSource.cancelDrag(event);
			}
		}
		wizcom.Event.removeListener(
			document, "mousemove", this.mouseMove);
		wizcom.Event.removeListener(
			document, "mouseup", this.mouseUp);
		wizcom.Event.stopEvent(event);
	}
}

wizcom.dnd.DropTarget = function(elementId)
{
	this.element = document.getElementById(elementId);
}

wizcom.dnd.DropTarget.prototype =
{
	checkInDropTarget: function(dragSource, mouseXY) {
		var bounds = wizcom.GUI.getBounds(this.element);
		return bounds.x <= mouseXY.x && bounds.x + bounds.width >= mouseXY.x &&
			   bounds.y <= mouseXY.y && bounds.y + bounds.height >= mouseXY.y;
	},
	drop: function(dragSource) {
		var element = dragSource.getElement();
		this.element.appendChild(element);
	}
}

wizcom.dnd.DragSource = function(elementId)
{
	this.element = document.getElementById(elementId);
	this.element.dragSource = this;
	this.selected = false;
	this.dragging = false;
	this.diff = null;
}

wizcom.dnd.DragSource.prototype =
{
	getElement: function() {
		return this.element;
	},
	selectDrag: function(event) {
		this.selected = true;

		var elementXY = wizcom.GUI.getBounds(this.element);
		var mouseXY = wizcom.Event.getMouseXY(event);
		this.diff = {
			x: mouseXY.x - elementXY.x,
			y: mouseXY.y - elementXY.y
		};
	},
	deselectDrag: function(event) {
		this.selected = false;
		this.diff = null;
	},
	startDrag: function(event) {
		this.dragging = true;

		var elementXY = wizcom.GUI.getBounds(this.element);
		this.element.style.position = "absolute";
		wizcom.GUI.setOpacity(this.element, 0.60);
	},
	isDragging: function() {
		return this.dragging;
	},
	moveDrag: function(event) {
		var mouseXY = wizcom.Event.getMouseXY(event);
		var newXY = {
			x: mouseXY.x - this.diff.x,
			y: mouseXY.y - this.diff.y
		}
		wizcom.GUI.setXY(this.element, newXY.x, newXY.y);
	},
	endDrag: function(event) {
		this.dragging = false;
		this.element.style.position = "";
		wizcom.GUI.setOpacity(this.element, 1.0);
		this.element.parentNode.removeChild(this.element);
	},
	cancelDrag: function(event) {
		this.dragging = false;
		this.element.style.position = "";
		wizcom.GUI.setOpacity(this.element, 1.0);
	}
}

function reloadPage()
{
	if ( document.forms[0] == null )
		self.location.reload();
	else
	{
		document.forms[0].target="_self";
		document.forms[0].action=self.location;
		document.forms[0].submit();
	}
}

function forcedClose()
{
	if ( /MSIE/.test(navigator.userAgent) )
	{
		if ( navigator.appVersion.indexOf("MSIE 7") > -1 )
			window.open("about:blank", "_self").close();
		else
		{
			window.opener = self;
			self.close();
		}
	}
	else
	{

		window.name = "___temp___";
		var w = window.open("about:blank");
		w.document.open();
		w.document.write("<html><body><script type='text/javascript'>function _temp_close(){var w=window.open.('about:blank', '" + window.name + "'); w.close(); self.close();}</" + "script></body></html>");
		w.document.close();
		w._temp_close();
	}
}

function log(msg)
{
	var console = document.getElementById("DIV_LOG");
	if ( console == null )
		alert("µð¹ö±× ÄÜ¼Ö ID´Â DIV_LOG ÀÔ´Ï´Ù.");
	else
		console.innerHTML =+ msg + "<br/>";
}

// °ª ÀÔ·Â¿©ºÎ Ã¼Å©
function isEmpty(elem, title)
{
	try {
		if (elem.value) {
			for (index = 0; index < elem.value.length; index++) {
				// °ø¹é ¹®ÀÚ(13), ¼öÆòÅÇ(HT-9), ¿£ÅÍ(CR-13, LF-10)°¡ ¾Æ´Ñ°Ô ÇÏ³ª¶óµµ ÀÖÀ¸¸é...
				if (elem.value.charCodeAt(index) != 32 && elem.value.charCodeAt(index) != 9
				&& elem.value.charCodeAt(index) != 13 && elem.value.charCodeAt(index) != 10)
					return false;
			}
		}
		if ( title != null ) alert(title + " ÀÔ·ÂÀº ÇÊ¼öÀÔ´Ï´Ù.");
		elem.focus();
		return true;
	}
	catch(e) {
		return true;
	}
}

function isNoE(elem)
{
	try
	{
		if ( elem == null ) true;
		if (elem.value) {
			for (index = 0; index < elem.value.length; index++) {
				// °ø¹é ¹®ÀÚ(13), ¼öÆòÅÇ(HT-9), ¿£ÅÍ(CR-13, LF-10)°¡ ¾Æ´Ñ°Ô ÇÏ³ª¶óµµ ÀÖÀ¸¸é...
				if (elem.value.charCodeAt(index) != 32 && elem.value.charCodeAt(index) != 9
				&& elem.value.charCodeAt(index) != 13 && elem.value.charCodeAt(index) != 10)
					return false;
			}
		}
		return true;
	}
	catch(e) {
		return true;
	}
}

function appendStrParamByPrefix(strParam, prefix, formObj)
{
	if ( formObj == null ) formObj = form1;
	with ( formObj )
	{
		for ( n=0; n < elements.length; n++ )
		{
			if ( elements[n].name.indexOf(prefix) == 0 )
			{
				if (( elements[n].type == "checkbox" || elements[n].type == "radio" ) && !elements[n].checked ) continue;
				if ( elements[n].type == "select-multiple" )
				{
					for ( m=0;m < elements[n].options.length;m++ )
					{
						if ( elements[n].options[m].selected )
							strParam += "&" + elements[n].name + "=" + encodeURIComponent(elements[n].options[m].value);
					}
				}
				else
					strParam += "&" + elements[n].name + "=" + encodeURIComponent(elements[n].value);
			}
		}
	}
	return strParam;
}
// nameÀÌ ÁöÁ¤ Á¢µÎ»ç·Î ½ÃÀÛÇÏ´Â ¸ðµç Æû ÄÁÆ®·Ñ name, encodeURIComponent(value)¸¦ °áÇÕÇÑ Äõ¸® ½ºÆ®¸µ ¹ÝÈ¯
function getStrParamByPrefix(formObj, prefix)
{
	if ( formObj == null ) formObj = form1;
	var result = "";
	with ( formObj )
	{
		for ( n=0; n < elements.length; n++ )
		{
			if ( elements[n].name.indexOf(prefix) == 0 )
			{
				if (( elements[n].type == "checkbox" || elements[n].type == "radio" ) && !elements[n].checked ) continue;
				if ( elements[n].type == "select-multiple" )
				{
					for ( m=0;m < elements[n].options.length;m++ )
					{
						if ( elements[n].options[m].selected ) result += "&" + elements[n].name + "=" + encodeURIComponent(elements[n].options[m].value);
					}
				}
				else result += "&" + elements[n].name + "=" + encodeURIComponent(elements[n].value);
			}
		}
	}
	return result;
}

function getObject(strObjId)
{
// checkW3C DOM, then MSIE 4, then NN 4.
	if(document.getElementById && document.getElementById(strObjId))
		return document.getElementById(strObjId);
	else if (document.all && document.all(strObjId))
		return document.all(strObjId);
	else if (document.layers && document.layers[strObjId])
		return document.layers[strObjId];
	else return null;
}
// ÇØ´ç ¾ÆÀÌµð¸¦ °¡Áø °´Ã¼ÀÇ value ¼Ó¼º°ªÀ» ¹ÝÈ¯ÇÑ´Ù. ¾øÀ¸¸é ""
function getObjectVal(strObjId)
{
	if ( getObject(strObjId) == null ) return "";
	else return getObject(strObjId).value;
}
// ÇØ´ç ¾ÆÀÌµð¸¦ °¡Áø °´Ã¼ÀÇ value ¼Ó¼º°ªÀ» ¹ÝÈ¯ÇÑ´Ù. ¾øÀ¸¸é "" (encodeURIComponent ¿É¼Ç)
function getObjectValEnc(strObjId)
{
	if ( getObject(strObjId) == null ) return "";
	else return encodeURIComponent(getObject(strObjId).value);
}
// ÁöÁ¤Æû, ÁöÁ¤Å¸ÀÔÀÇ ¸î¹øÂ°(0, 1, 2...) Æû ÄÁÆ®·Ñ id º¯°æ
function setFormElemId(formObj, elemType, elemIndex, id)
{
	if ( getFormElem(formObj, elemType, elemIndex) != null ) getFormElem(formObj, elemType, elemIndex).id = id;
}
// ÁöÁ¤Æû, ÁöÁ¤Å¸ÀÔÇü½ÄÀÇ ¸î¹øÂ°(0, 1, 2...) Æû ÄÁÆ®·Ñ °¡Á®¿À±â
function getFormElem(formObj, elemType, elemIdx)
{
	var elemCnt = -1;
	try
	{
		with ( formObj )
		{
			for ( var n=0; n < elements.length; n++ )
			{
				if ( elements[n].type == elemType )
				{
				//	alert(elements[n].value);
					if (elements[n].tag == 'NoCount') ++elemIdx;
					++elemCnt;
					if ( elemCnt == elemIdx ) return elements[n];
				}
			}
		}
		return null;
	} catch (e) {
		return null;
	}
}

// ÁöÁ¤Æû, ÁöÁ¤Å¸ÀÔÇü½ÄÀÇ ¸î¹øÂ°(0, 1, 2...) Æû ÄÁÆ®·Ñ°ª °¡Á®¿À±â
function getFormElemVal(formObj, elemType, elemIdx)
{
	try
	{
		var elem = getFormElem(formObj, elemType, elemIdx);
		var val = "";
		if ( elem.type == "select-multiple" )
		{
			for ( var m=0;m < elem.options.length;m++ )
			{
				if ( elem.options[m].selected )
				{
					if ( m > 0 ) val += "|";
					val += elem.options[m].value;
				}
			}
			if ( val.charAt(0) == "|" ) val = encodeURIComponent(val.substr(1).trim());
			else val = encodeURIComponent(val.trim());
		}
		else val = encodeURIComponent(elem.value.trim());

		return val;
	} catch (e) {
		return val;
	}
}

// Ã¼Å©¹Ú½º³ª ¶óµð¿À´ÜÃß Àû¾îµµ ÇÏ³ª ÀÌ»ó ¼±ÅÃÇß´ÂÁö °Ë»ç
function isCheckAtLeastOne (checkBoxId, isAlert)
{
	if (checkBoxId != null)	// Ç×¸ñÀÌ ÇÏ³ªÀÌ»ó Á¸Àç ÇÒ¶§¸¸ °Ë»ç
	{
		if (checkBoxId.length == null)	// Ç×¸ñÀÌ ÇÏ³ª¸¸ ÀÖÀ» °æ¿ì
		{
			if (checkBoxId.checked == true)
				return true;
		}
		else	// Ç×¸ñÀÌ µÎ°³ ÀÌ»óÀÏ °æ¿ì
		{
			for(index = 0; index < checkBoxId.length; index++)
				if(checkBoxId[index].checked == true)
					return true;
		}
	}
	if ( isAlert == null || isAlert ) alert("Ç×¸ñÀ» ÇÏ³ªÀÌ»ó ¼±ÅÃÇØÁÖ¼¼¿ä.");
	return false;
}


// Ã¼Å©¹Ú½º ¸ðµÎ ¼±ÅÃ or ÇØÁ¦ÇÏ±â
function checkAll(allCheckerId, checkBoxId)
{
	if (checkBoxId != null)		// Ç×¸ñÀÌ ÇÏ³ªÀÌ»ó Á¸ÀçÇÒ °æ¿ì¸¸ µ¿ÀÛ
	{
		if (checkBoxId.length == null)			// Ç×¸ñÀÌ ÇÏ³ª¸¸ ÀÖÀ» °æ¿ì
		{
			if(allCheckerId.checked == true)		// '¸ðµÎ ¼±ÅÃ' ¹öÆ°ÀÌ Ã¼Å©µÈ »óÅÂÀÏ¶§
			{
				if ( checkBoxId.disabled == false )		// È°¼º»óÅÂÀÏ¶§¸¸ Ã¼Å©
					checkBoxId.checked = true;
			}
			else
				checkBoxId.checked = false;
		}
		else		// Ç×¸ñÀÌ µÎ°³ ÀÌ»óÀÏ¶§
		{
			if(allCheckerId.checked == true)
				for(index = 0; index < checkBoxId.length; index++)
				{
					if ( checkBoxId[index].disabled == false )
						checkBoxId[index].checked = true;		// È°¼º»óÅÂÀÏ¶§¸¸ Ã¼Å©
				}
			else
				for(index = 0; index < checkBoxId.length; index++)
					checkBoxId[index].checked = false;
		}
	}
	return;
}

// Ã¼Å©¹Ú½º, ¶óµð¿À ¹Ú½ºÀÇ Æ¯Á¤°ªÀ» °¡Áø ÀÎµ¦½º °¡Á®¿À±â
function getIndexByValue(elemId, val)
{
	if (elemId != null && elemId.length != null)
	{
		for ( n = 0; n < elemId.length; n ++)
		{
			if ( elemId[n].value == val) return n;
		}
	}
	return -1;
}

// Ã¼Å©¹Ú½º, ¶óµð¿À ¹Ú½ºÀÇ Ã¼Å©µÈ °ª °¡Á®¿À±â(¸ÖÆ¼°ªÀÏ °æ¿ì ±¸ºÐÀÚ '|')
function getCheckedValues(elemId)
{
	var result = "";
	if (elemId != null)										// Ç×¸ñÀÌ ÇÏ³ªÀÌ»ó Á¸ÀçÇÒ °æ¿ì¸¸ µ¿ÀÛ
	{
		if (elemId.length == null)						// Ç×¸ñÀÌ ÇÏ³ª¸¸ ÀÖÀ» °æ¿ì
		{
			if ( elemId.checked ) return elemId.value;
		}
		else														// Ç×¸ñÀÌ µÎ°³ ÀÌ»óÀÏ¶§
		{
			for( n = 0; n < elemId.length; n++ )
			{
				if ( elemId[n].checked )
				{
					if ( n > 0 && result != "") result += "|";
					result += elemId[n].value;
				}
			}
		}
	}
	return result;
}

// ¼¿·ºÆ® ¹Ú½ºÀÇ ¼±ÅÃµÈ °ª °¡Á®¿À±â(¸ÖÆ¼°ªÀÏ °æ¿ì ±¸ºÐÀÚ '|')
function getSelectedValues(selectBoxId)
{
	var result = "";
	if ( selectBoxId == null ) return result;
	for ( n=0; n < selectBoxId.options.length; n++ )
	{
		if (selectBoxId.options[n].selected)
		{
			if ( result.length > 0 ) result += "|";
			result += selectBoxId.options[n].value;
		}
	}
	return result;
}

// ¼¿·ºÆ® ¹Ú½ºÀÇ ¼±ÅÃµÈ °ªÀÇ ÅØ½ºÆ® °¡Á®¿À±â(¸ÖÆ¼°ªÀÏ °æ¿ì ±¸ºÐÀÚ '|')
function getSelectedTexts(selectBoxId)
{
	var result = "";
	if ( selectBoxId == null ) return result;
	for ( n=0; n < selectBoxId.options.length; n++ )
	{
		if (selectBoxId.options[n].selected)
		{
			if ( result.length > 0 ) result += "|";
			result += selectBoxId.options[n].text;
		}
	}
	return result;
}

// Ä¡È¯°ª »ðÀÔÀ» À§ÇØ Ä³·µ ÀúÀå
// ¿¹) onclick="storeCaret(this)" onselect="storeCaret(this)" onkeyup="storeCaret(this)"
function storeCaret(elemId)
{
	if( elemId.createTextRange ) elemId.caretPos = document.selection.createRange().duplicate();
}

// Ä³·µ¿¡ Ä¡È¯°ª »ðÀÔ
// ¿¹) onchange="insertValueAtCaret(this.form.SUBJECT, this.value);this.value='';"
function insertValueAtCaret(targetElem, str)
{
	if (str)
	{
		if( targetElem.createTextRange && targetElem.caretPos )
		{
			var caretPos = targetElem.caretPos;
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? str + ' ' : str;
		}
		else targetElem.value = str + targetElem.value;
	}
}

/** multiple select box °ü·Ã */
function copyOptions(srcElemId, targetElemId)
{
	var isSelected = false;
	for (n=0;n < srcElemId.options.length;n++)
	{
		if (srcElemId.options[n].selected)
		{
			var new_option = new Option(srcElemId.options[n].text, srcElemId.options[n].value);
			targetElemId.options.add(new_option, targetElemId.options.length);
			isSelected = true;
		}
	}
	//if ( !isSelected ) alert("Ç×¸ñÀ» ÇÏ³ªÀÌ»ó ¼±ÅÃÇØÁÖ¼¼¿ä.");
}

function deleteOptions(elemId)
{
	var isSelected = false;
	with ( elemId )
	{
		for (n=0;n < options.length;n++)
		{
			if (options[n].selected)
			{
				options[n] = null;
				n--;
				isSelected = true;
			}
		}
	}
	if ( !isSelected ) alert("Ç×¸ñÀ» ÇÏ³ªÀÌ»ó ¼±ÅÃÇØÁÖ¼¼¿ä.");
}

function moveOptions(srcElemId, targetElemId)
{
	copyOptions(srcElemId, targetElemId);
	deleteOptions(srcElemId);
}

function upOptions(elemId)
{
	var isSelected = false;
	with ( elemId )
	{
		for (n=0;n < options.length;n++)
		{
			if (options[n].selected)
			{
				if ( n == 0 ) break;
				var new_option = new Option(options[n].text, options[n].value);
				options[n]=null;
				options.add(new_option, n-1);
				options[n-1].selected = true;
				isSelected = true;
			}
		}
	}
	if ( !isSelected ) alert("Ç×¸ñÀ» ÇÏ³ªÀÌ»ó ¼±ÅÃÇØÁÖ¼¼¿ä.");
}

function downOptions(elemId)
{
	var isSelected = false;
	with ( elemId )
	{
		for (n=options.length-1;n > -1;n--)
		{
			if (options[n].selected)
			{
				if ( n == options.length - 1 ) break;
				var new_option = new Option(options[n].text, options[n].value);
				options[n]=null;
				options.add(new_option, n+1);
				options[n+1].selected = true;
				isSelected = true;
			}
		}
	}
	if ( !isSelected ) alert("Ç×¸ñÀ» ÇÏ³ªÀÌ»ó ¼±ÅÃÇØÁÖ¼¼¿ä.");
}

// flag = 0 : ¿µ¹®ÀÚ, ¼ýÀÚ, '_', '-', '.' ¸¸ Çã¿ë(¾ÆÀÌµð µî Ã¼Å©)
// flag = 1 : ¼ýÀÚ, '-' ¸¸ Çã¿ë(ÁÖ¹Î¹øÈ£ µî Ã¼Å©)
// flag = 2 : ¼ýÀÚ, ',' ¸¸ Çã¿ë(ÅëÈ­´ÜÀ§ Ã¼Å©)
// flag = 3 : ¿µ¹®ÀÚ, _ ¸¸ Çã¿ë
// flag = 4 : ¿µ¹®ÀÚ¸¸ Çã¿ë
// flag = 5 : ¼ýÀÚ, '.' ¸¸ Çã¿ë
function checkValidValue(elemId, fieldName, flag)
{
	if ( elemId == null || elemId.value == "" ) return;
	if ( eval(flag) == 0 )
	{
		for(i=0; i < elemId.value.length; i++)
		{
			if(!((elemId.value.charAt(i) >= "0" && elemId.value.charAt(i) <= "9") || (elemId.value.charAt(i) >= "A" && elemId.value.charAt(i) <= "Z")
			|| (elemId.value.charAt(i) >= "a" && elemId.value.charAt(i) <= "z") || (elemId.value.charAt(i) == "_") || (elemId.value.charAt(i) == "-") || (elemId.value.charAt(i) == ".")))
			{
				alert(fieldName +" ÀÔ·ÂÀº ¼ýÀÚ, ¿µ¹®ÀÚ, '_', '-', '.' ¸¸ Çã¿ëµË´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
	}
	else if ( eval(flag) == 1 )
	{
		for(i=0; i < elemId.value.length; i++)
		{
			if( !( (elemId.value.charAt(i) >= "0" && elemId.value.charAt(i) <= "9") || (elemId.value.charAt(i) == "-") ) )
			{
				alert(fieldName +" ÀÔ·ÂÀº ¼ýÀÚ¿Í '-' ¸¸ Çã¿ëµË´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
	}
	else if ( eval(flag) == 2 )
	{
		for( i = 0; i < elemId.value.length; i++ )
		{
			if( !(( elemId.value.charAt(i) >= "0" && elemId.value.charAt(i) <= "9" ) || (elemId.value.charAt(i) == ",")) )
			{
				alert(fieldName + " ÀÔ·ÂÀº ¼ýÀÚ¿Í ',' ¸¸ °¡´ÉÇÕ´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
	}
	else if ( eval(flag) == 3 )
	{
		for( i = 0; i < elemId.value.length; i++ )
		{
			if( !((elemId.value.charAt(i) >= "A" && elemId.value.charAt(i) <= "Z") || (elemId.value.charAt(i) >= "a" && elemId.value.charAt(i) <= "z") || (elemId.value.charAt(i) == "_")))
			{
				alert(fieldName + " ÀÔ·ÂÀº ¿µ¹®ÀÚ¿Í '_' ¸¸ °¡´ÉÇÕ´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
	}
	else if ( eval(flag) == 4 )
	{
		for( i = 0; i < elemId.value.length; i++ )
		{
			if( !((elemId.value.charAt(i) >= "A" && elemId.value.charAt(i) <= "Z") || (elemId.value.charAt(i) >= "a" && elemId.value.charAt(i) <= "z")))
			{
				alert(fieldName + " ÀÔ·ÂÀº ¿µ¹®ÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
	}
	else if ( eval(flag) == 5 )
	{
		for( i = 0; i < elemId.value.length; i++ )
		{
			if( !(( elemId.value.charAt(i) >= "0" && elemId.value.charAt(i) <= "9" ) || (elemId.value.charAt(i) == ".")) )
			{
				alert(fieldName + " ÀÔ·ÂÀº ¼ýÀÚ¿Í '.' ¸¸ °¡´ÉÇÕ´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
	}
	return true;
}

// point : °¡´ÉÇÑ ¼Ò¼öÁ¡ ÀÚ¸´¼ö
function checkValidFloat(elemId, point, fieldName)
{
	if ( elemId == null || elemId.value == "" ) return;
	var str = elemId.value;
	var t=0;

	point = eval(point);

	for (var i=0 ; i < str.length;i++)
	{
		if (str.charAt(i) == ".")
		{
			t = str.length - (i+1);

			if (t > eval(point))
			{
				alert(fieldName+" ÀÔ·ÂÀº ¼Ò¼öÁ¡ " + point + "ÀÚ¸® ±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù!");
				elemId.focus();
				return;
			}
		}
		else if (str.charAt(i) < "0" || str.charAt(i) > "9")
		{
			alert(fieldName + " ÀÔ·ÂÀº ¼ýÀÚ¿Í '.'¸¸ °¡´ÉÇÕ´Ï´Ù!");
			elemId.focus();
			return;
		}
	}

	return true;
}

// ¾ÆÀÌµð Ã¼Å© :  onblur="checkIdValue(this)"
function checkIdValue(elemId)
{
	if ( elemId == null || elemId.value == "" ) return;
	if ( elemId.value.length < 4 || elemId.value.length > 15 )
	{
		alert("±ÛÀÚ¼ö´Â 4~15ÀÚ±îÁö °¡´ÉÇÕ´Ï´Ù.");
		elemId.focus();
		return;
	}
	checkValidValue(elemId, "¾ÆÀÌµð", 0);
}

// ¸ÞÀÏ °Ë»ç(ÇÊÅÍ¸µ) : onblur="checkEmailValue(this)"
function checkEmailValue(elemId)
{
	if ( elemId == null || elemId.value == "" ) return;
	var filter=/^([\w-]+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if ( !filter.test(elemId.value) )
	{
		alert("E-mail ÁÖ¼Ò Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.\n\n¿¹) userid@domain.com");
		elemId.focus();
		return;
	}
}

// ÀüÈ­¹øÈ£ °Ë»ç(ÇÊÅÍ¸µ) : onblur="checkPhoneValue(this)"
function checkPhoneValue(elemId)
{
	if ( elemId == null || elemId.value == "" ) return;
	// ±¹¹øÀº 2~4ÀÚ¸®·Î ½ÃÀÛµÇ¸é, -¼ýÀÚ3~4ÀÚ¸® 2¹ø¹Ýº¹
	var filter=/^\d{2,4}(-\d{3,4}){2}$/;
	if ( !filter.test(elemId.value) )
	{
		alert("ÀüÈ­¹øÈ£ Çü½ÄÀ» ¾Æ·¡¿Í °°ÀÌ ÀÔ·ÂÇØÁÖ¼¼¿ä.\n\n¿¹) 010-1234-5678");
		elemId.focus();
		return;
	}
}

// ³¯Â¥ ÀÔ·ÂÇü½Ä Ã¼Å© : onblur="checkDateValue(this, '±¸ºÐÀÚ')", ±¸ºÐÀÚ´Â '-', '/', '.' ¸¸ Áö¿ø
function checkDateValue(elemId, delim)
{
	if ( elemId == null || elemId.value == "" ) return;
	if ( delim == null || delim.value == "" ) delim = "-";	// ±âº» ±¸ºÐÀÚ

	var filter;
	if ( delim == "-" )
		filter = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
	else if ( delim == "/" )
		filter = /^[0-9]{4}\/[0-9]{2}\/[0-9]{2}$/;
	else if ( delim == "." )
		filter = /^[0-9]{4}.[0-9]{2}.[0-9]{2}$/;

	if ( !filter.test(elemId.value) )
	{
		alert("³¯Â¥°¡ Àß¸øµÇ¾ú½À´Ï´Ù.\n\n³¯Â¥ Çü½ÄÀ» ¾Æ·¡¿Í °°ÀÌ ÀÔ·ÂÇØÁÖ¼¼¿ä.\n\n¿¹) 2000" + delim + "01" + delim + "01");
		elemId.focus();
		return;
	}

	arrDate = elemId.value.split(delim);
	if ( !(arrDate[0] >= 1900 && arrDate[0] <=9999 && arrDate[1] >= 1 && arrDate[1] <= 12 && arrDate[2] >= 1 && arrDate[2] <= 31) )
	{
		alert("³¯Â¥°¡ Àß¸øµÇ¾ú½À´Ï´Ù.\n\n³¯Â¥ Çü½ÄÀ» ¾Æ·¡¿Í °°ÀÌ ÀÔ·ÂÇØÁÖ¼¼¿ä.\n\n¿¹) 2000" + delim + "01" + delim + "01");
		elemId.focus();
		return;
	}
}

// Æ¯Á¤¹®ÀÚ ÃâÇö¼ö °¡Á®¿À±â
function countChar(str, ch)
{
	var cnt = 0;
	if ( str != null )
	{
		for ( var n=0; n < str.length; n++ )
			if ( str.charAt(n) == ch )	++cnt;
	}
	return cnt;
}
// ±¸ºÐÀÚ·Î ºÐ¸®µÇ´Â ¹®ÀÚ¿­Áß¿¡ ÇØ´ç¹øÂ° ¹®ÀÚ¿­ ¹ÝÈ¯
function getSplitValue(src, delim, idx)
{
	try
	{
		var arrStr = src.split(delim);
		for ( n = 0; n < arrStr.length; n++ )
		{
			if ( n == idx ) return arrStr[n];
		}
		return "";
	}
	catch (e)
	{
		return "";
	}
}
// Á¦ÇÑ¹®ÀÚ¼ö ÃÊ°ú Ã¼Å©
// ¿¹) onblur="isOverMaxLength(this, 100)"
function isOverMaxLength(elemId, max)
{
	if (elemId.value.length > max)
	{
		alert(max + "ÀÚ ÀÌ³»·Î ÀÛ¼ºÇÏ¿©ÁÖ¼¼¿ä");
		elemId.focus();
		return true;
	}
	return false;
}

// srcElemId - °è»êÇÒ ¹®ÀÚ¿­ °´Ã¼
// displayElemId - °è»êµÈ ¹ÙÀÌÆ®¸¦ Ãâ·ÂÇÒ °´Ã¼
// limitBytes - Á¦ÇÑ ¹ÙÀÌÆ®¼ö
// ¿¹) onblur="checkByte(this, form1.LETTER_CNT, 1000)"
function checkByte(srcElemId, displayElemId, limitBytes)
{
	var len = srcElemId.value.length;
	var bytesCount = 0;			// ¹ÙÀÌÆ®¼ö
	var limitIndex = 0;				// Àß¸®´Â ÁöÁ¡

	for (i = 0; i < len; i++)
	{
		// ISO Latin-1 Code ÀÇ ±æÀÌ°¡ 4 ÀÌ»óÀÌ¸é 2 bytes
		if (escape(srcElemId.value.charAt(i)).length > 4)
		{
			bytesCount += 2;
		}
		else //if (srcElemId.value.charAt(i) != '\r' && srcElemId.value.charAt(i) != '\n')		// SMS Àü¼Û½Ã CrLf ¹®ÀÚ´Â Á¦¿Ü
		{
			bytesCount++;
		}

		if ( limitIndex == 0 && bytesCount > limitBytes )	limitIndex = i;
	}

	displayElemId.value = bytesCount;

	if( bytesCount > limitBytes )
	{
		alert("Á¦ÇÑ ¿ë·®À» ÃÊ°úÇÏ¿´½À´Ï´Ù.\nÁ¦ÇÑ¿ë·®À» ³ÑÀ» °æ¿ì ÀÔ·ÂÀÌ µÇÁö ¾Ê½À´Ï´Ù.");
		//srcElemId.value = srcElemId.value.substr(0, limitIndex);
		//displayElemId.value = limitBytes;
		srcElemId.focus();
	}
}
/**
* ÁöÁ¤ ÀÚ¸®¼ö¿¡¼­ ¸ðÀÚ¶õ ¸¸Å­ ¾Õ¿¡ '0'Ã¤¿ì±â
* @param figures ÁöÁ¤ ÀÚ¸®¼ö
*/
function insertZeroNum(val, figures)
{
	temp = new String(val);
	zeroNum = figures - temp.length;		// ¾Õ¿¡ Ã¤¿öÁú 0ÀÇ °³¼ö
	for (n = 0; n < zeroNum; n++)
		temp = "0" + temp;
	return temp;
}

String.prototype.trim = function() {
	return this.replace(/(^ *)|( *$)/g, "");
}
String.prototype.ltrim = function() {
	return this.replace(/(^ *)/g, "");
}
String.prototype.rtrim = function() {
	return this.replace(/( *$)/g, "");
}
String.prototype.replaceAll = function(src, dest)
{
	var temp = new String(this);
	if ( src == "" ) return temp;

	if (temp.indexOf(src) == -1) return temp; // ±³Ã¼µÉ ¹®ÀÚ¿­ÀÌ ¾øÀ¸¸é
	else
	{
		var result = "";
		var srcLen = src.length; // src ¹®ÀÚ¿­ ±æÀÌ
		var srcPrevIndex = 0; // src ¹®ÀÚ¿­ÀÌ ³ªÅ¸³­ ÀÌÀü ÀÎµ¦½º
		var srcNextIndex = temp.indexOf(src); // src ¹®ÀÚ¿­ÀÌ ³ªÅ¸³­ ´ÙÀ½ ÀÎµ¦½º
		result += temp.substring(0, srcNextIndex) + dest; // Ã³À½ °Ë»öµÈ À§Ä¡±îÁö ¹®ÀÚ¿­À» ¹öÆÛ¿¡ ÀúÀåÇÑ´Ù.
		while ( true )
		{
			srcPrevIndex = srcNextIndex; // °Ë»öµÈ À§Ä¡¸¦ ÀÌÀü ÀÎµ¦½º¿¡ ÀúÀåÇÏ°í ´Ù½Ã °Ë»ö ¹Ýº¹
			srcNextIndex = temp.indexOf(src, srcPrevIndex + srcLen);
			if ( srcNextIndex < 0 ) // ´õÀÌ»ó src ¹®ÀÚ¿­ÀÌ ¾øÀ¸¸é ÀÌÀü ÀÎµ¦½º ´ÙÀ½ºÎÅÍ ÀúÀåÇÏ°í ³¡³½´Ù.
			{
				result += temp.substring(srcPrevIndex + srcLen, temp.length);
				break;
			}
			else
			{
				// src ¹®ÀÚ¿­ÀÌ Ã³À½ ³ªÅ¸³­ À§Ä¡ ÀÌÀü±îÁö ¹®ÀÚ¿­°ú »õ·Î¿î ¹®ÀÚ¿­ °áÇÕÇØ¼­ ¹öÆÛ¿¡ ÀúÀå
				result += temp.substring(srcPrevIndex + srcLen, srcNextIndex) + dest;
			}
		}
		return result;
	}
}

function formatCurrency(num)
{
	var minus = false;
	var result = "";
	if (num < 0) { num *= -1; minus = true}
	//Á¤¼ö, ¼Ò¼öºÎºÐ ºÐ¸®
	var dotPos = (num + "").split(".")
	var dotU = dotPos[0]	// Á¤¼ö
	var dotD = dotPos[1]	// ¼Ò¼ö
	var commaFlag = dotU.length%3 // Ã¹¹øÂ° ÄÞ¸¶ÀÚ¸®

	if(commaFlag > 0)
	{
		result = dotU.substring(0, commaFlag);
		if (dotU.length > 3) result += ","; // Ã¹¹øÂ° ÄÞ¸¶
	}

	for (var n=commaFlag; n < dotU.length; n+=3) {
			result += dotU.substring(n, n+3);
			if( n < dotU.length-3) result += ",";
	}

	if(minus) result = "-" + result;
	if(dotD) return result + "." + dotD
	else return result
}

// ÀÌÀü ÆäÀÌÁö URL¿¡¼­ 'http://domain' À» »« URL
function getReferrerFromRoot()
{
	var prevUrl = document.referrer.substring(7);
	if ( document.referrer ) return prevUrl.substring(prevUrl.indexOf('/'));
	else return "";
}

/* »ç¿ë¹ý : onKeyUp="autoFocus(this, form1.RegNum2, 6);" */
function autoFocus(curElem, nextElem, len)
{
	if ( curElem.value.length == len) nextElem.focus();
}

/**
 * ÁÖ¹Î¹øÈ£ °ËÁõ ¾Ë°í¸®Áò
 * ¸¶Áö¸· ÀÚ¸®¸¦ »« ÁÖ¹Î¹øÈ£ 12ÀÚ¸® °¢ ¼ýÀÚ¿Í ÀÏ·Ã¹øÈ£(234567892345) 12ÀÚ¸® °¢ ¼ýÀÚ¿ÍÀÇ °öÀÇ ÇÕÀ»
 * ±¸ÇÑ´ÙÀ½ ±× ÇÕÀ» 11·Î ³ª´« ³ª¸ÓÁö¸¦ ±¸ÇÑ °á°ú¸¦ 11¿¡¼­ »«´Ù.
 * ±× °á°ú¸¦ ÁÖ¹Î¹øÈ£ ¸¶Áö¸· ÀÚ¸®¿Í ºñ±³¸¦ ÇÑ´Ù. ( 0 ~ 9 )
 * ±×·±µ¥ ¿©±â¼­ 11·Î »« °á°ú°¡ 11ÀÌ³ª 10Ã³·³ µÎÀÚ¸®°¡ ³ª¿Ã¼ö ÀÖ´Âµ¥ ±×·± °æ¿ì¿¡´Â µÎÀÚ¸®ÀÇ ³¡ÀÚ¸®
 * Áï, 11Àº 1, 10Àº 0 ÀÌ °á°ú°¡ µÈ´Ù.
 *
 * ÀÌ·¸°Ô ³ª¿Â °á°ú°¡ ÁÖ¹Î¹øÈ£ ¸¶Áö¸· ÀÚ¸®¿Í °°À¸¸é ÂüÀÌ°í, ´Ù¸£¸é °ÅÁþÀÌ´Ù.
 * Âü°í·Î ´õ³ª¾Æ°¡¼­´Â À±³â°è»ê ±îÁö ÇØ¾ßÇÑ´Ù.
*/
/* »ç¿ë¹ý :  onBlur="checkRegNum(form1.REG_NUM1, this);" */
function checkRegNum(firstElem, secondElem)
{
	residentNo = new String(firstElem.value + secondElem.value);
	conditionNo = new String("234567892345");
	var total = 0;
	var result;

	if (residentNo.substring(2, 4) > 12 || residentNo.substring(2, 4) < 1 || residentNo.substring(4, 6) > 31 || residentNo.substring(4, 6) < 1 || firstElem.value.length < 6 || secondElem.value.length < 7)
	{
		secondElem.value="";
		alert("ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
		return false;
	}

	for (var i=0; i <= 11 ; i++ )
		total += (residentNo.substr(i,1) * conditionNo.substr(i,1));

	result = 11- (total % 11);

	if (result == 10) result = 0;

	if (result == 11) result = 1

	if (result != residentNo.substr(12))
	{
		secondElem.value="";
		alert("ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·ÂÀÌ Àß¸ø µÇ¾ú½À´Ï´Ù.");
		return false;
	}
	return true;
}

function setBirthday(firstElem, secondElem, birthdayElem1, birthdayElem2, birthdayElem3)
{
	strBirthday = new String(firstElem.value);
	if ( secondElem.value.charAt(0) == '1' || secondElem.value.charAt(0) == '2') birthdayElem1.value = "19" + strBirthday.substring(0, 2);
	else birthdayElem1.value = "20" + strBirthday.substring(0, 2);

	birthdayElem2.value = strBirthday.substring(2, 4);
	birthdayElem3.value = strBirthday.substring(4, 6);
}

// FLASH EMBED noTransparent Åõ¸í¾Æ´Ò¶§//
function flashEmbed(fid,fn,wd,ht,para)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + wd + '" height="' + ht + '" id="' + fid + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain">');
	document.write('<param name="movie" value="' + fn + para + '">');
	document.write('<param name="loop" value="false" />');
	document.write('<param name="menu" value="false">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="opaque">');
	document.write('<param name="scale" value="noscale" />');
	document.write('<param name="salign" value="lt" />');
	document.write('<embed src="' + fn + para + '" menu="false" quality="high" wmode="opaque" width="' + wd + '" height="' + ht + '" name="' + fid + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

// FLASH EMBED Transparent Åõ¸íÀÏ¶§//
function flashEmbedTrans(fid,fn,wd,ht,para)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + wd + '" height="' + ht + '" id="' + fid + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain">');
	document.write('<param name="movie" value="' + fn + para + '">');
	document.write('<param name="loop" value="false" />');
	document.write('<param name="menu" value="false">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="' + fn + para + '" menu="false" quality="high" wmode="transparent" width="' + wd + '" height="' + ht + '" name="' + fid + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
function openFileSelector1(confCd, isFileNameConv, isOverwrite, validFileExt, isMultiple, subDir, setFileJs)
{
	popupId = window.open("/wizcom_cpnt/FileSelector1.jsp?confCd=" + confCd + "&cv=" + (isFileNameConv == null || isFileNameConv == "" ? "false" : isFileNameConv) + "&ow=" + (isOverwrite == null || isOverwrite == "" ? "false" : isOverwrite) + "&vf=" + (validFileExt == null || validFileExt == "" ? "" : validFileExt) + "&mt=" + (isMultiple == null || isMultiple == "" ? "false" : isMultiple) + "&sd=" + (subDir == null || subDir == "" ? "" : subDir) + "&sfj=" + (setFileJs == null || setFileJs == "" ? "setFile" : setFileJs), "FileUploader", "width=1, height=1, status=1, scrollbars=1");
	if ( popupId == null ) alert("ÆÄÀÏ¼±ÅÃÀ» À§ÇØ ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.\n\n[ µµ±¸ > ÆË¾÷ Â÷´Ü > ÇöÀç »çÀÌÆ®ÀÇ ÆË¾÷À» Ç×»ó Çã¿ë ]");
}
function openFileSelector2(confCd, isFileNameConv, isOverwrite, validFileExt, isMultiple, subDir, setFileJs)
{
	popupId = window.open("/wizcom_cpnt/FileSelector2.jsp?confCd=" + confCd + "&cv=" + (isFileNameConv == null || isFileNameConv == "" ? "false" : isFileNameConv) + "&ow=" + (isOverwrite == null || isOverwrite == "" ? "false" : isOverwrite) + "&vf=" + (validFileExt == null || validFileExt == "" ? "" : validFileExt) + "&mt=" + (isMultiple == null || isMultiple == "" ? "false" : isMultiple) + "&sd=" + (subDir == null || subDir == "" ? "" : subDir) + "&sfj=" + (setFileJs == null || setFileJs == "" ? "setFile" : setFileJs), "FileUploader", "width=1, height=1, status=1, scrollbars=1");
	if ( popupId == null ) alert("ÆÄÀÏ¼±ÅÃÀ» À§ÇØ ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.\n\n[ µµ±¸ > ÆË¾÷ Â÷´Ü > ÇöÀç »çÀÌÆ®ÀÇ ÆË¾÷À» Ç×»ó Çã¿ë ]");
}
function openFileSelectorByRegistry(confCd, isFileNameConv, isOverwrite, validFileExt, isMultiple, subDir, setFileJs)
{
	popupId = window.open("/wizcom_cpnt/FileSelectorByRegistry.jsp?confCd=" + confCd + "&cv=" + (isFileNameConv == null || isFileNameConv == "" ? "false" : isFileNameConv) + "&ow=" + (isOverwrite == null || isOverwrite == "" ? "false" : isOverwrite) + "&vf=" + (validFileExt == null || validFileExt == "" ? "" : validFileExt) + "&mt=" + (isMultiple == null || isMultiple == "" ? "false" : isMultiple) + "&sd=" + (subDir == null || subDir == "" ? "" : subDir) + "&sfj=" + (setFileJs == null || setFileJs == "" ? "setFile" : setFileJs), "FileUploader", "width=1, height=1, status=1, scrollbars=1");
	if ( popupId == null ) alert("ÆÄÀÏ¼±ÅÃÀ» À§ÇØ ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.\n\n[ µµ±¸ > ÆË¾÷ Â÷´Ü > ÇöÀç »çÀÌÆ®ÀÇ ÆË¾÷À» Ç×»ó Çã¿ë ]");
}
function deleteFile(elemId)
{
	var isSelected = false;
	with ( elemId )
	{
		for (n=0;n < options.length;n++)
		{
			if (options[n].selected)
			{
				options[n] = null;
				n--;
				isSelected = true;
			}
		}
	}
	if ( !isSelected ) alert("»èÁ¦ÇÒ ÆÄÀÏÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.");
}

/**
* °íÁ¤ºñÀ²·Î ÀÌ¹ÌÁö Ãà¼Ò
* ¹Ýµå½Ã ÀÌ¹ÌÁöÀÇ °¡·Î ¹× ¼¼·Î »çÀÌÁî ÁöÁ¤À» ¾ø¾Ö¾ß ÇÑ´Ù.
* @param img_id ÀÌ¹ÌÁö id
* @param limit_w °¡·ÎÁ¦ÇÑ »çÀÌÁî
* @param limit_h ¼¼·ÎÁ¦ÇÑ »çÀÌÁî
* Ex) resizeImage("img1", 245, 211);
*/
function resizeImage(img_id, limit_w, limit_h)
{
	if ( document.getElementById(img_id) != null )
	{
		var img_w = document.getElementById(img_id).width;
		var img_h = document.getElementById(img_id).height;
		var img_ratio = limit_w / limit_h; // Å¬¼ö·Ï °¡·Î°¡ ±æ´Ù

		if ( img_w / img_h >= img_ratio ) // ±âº»ÀÌ¹ÌÁöº¸´Ù °¡·ÎºñÀ²ÀÌ Å©¹Ç·Î °¡·Î±âÁØ
		{
			if ( img_w > limit_w )	 document.getElementById(img_id).width = limit_w;
		}
		else // ±âº»ÀÌ¹ÌÁöº¸´Ù ¼¼·ÎºñÀ²ÀÌ Å©¹Ç·Î ¼¼·Î±âÁØ
		{
			if ( img_h > limit_h )	 document.getElementById(img_id).height = limit_h;
		}
	}
}

function appendStrParamSelectMultipleFile(strParam, selectBoxId, ajaxParamNames)
{
	if ( selectBoxId == null ) return strParam;
	var tempFileName = "&" + ajaxParamNames.split("|")[0] + "=";
	var tempFileSize = "";

	for ( n=0;n < selectBoxId.options.length;n++ )
	{
		if ( n > 0 ) tempFileName += "|";
		tempFileName += selectBoxId.options[n].text;
	}

	if ( ajaxParamNames.split("|").length == 2 )
	{
		tempFileSize = "&" + ajaxParamNames.split("|")[1] + "=";
		for ( n=0;n < selectBoxId.options.length;n++ )
		{
			if ( n > 0 ) tempFileSize += "|";
			tempFileSize += selectBoxId.options[n].value;
		}
	}

	return strParam += (tempFileName + tempFileSize);
}

// Æ¯Á¤ ÀÌ¸§¿¡ ´ëÇÑ °ªÀ» °¡Á®¿Â´Ù.
function getCookie(name)
{
	var first;
	var str = name + "=";
	if ( document.cookie == null ) return null;
	var arr = document.cookie.split("; ");
	for ( n=0; n < arr.length; n++ )
	{
		var c = arr[n];
		var nv = c.split("=");
		if ( nv[0] == name )		return unescape(nv[1]);
	}
	return null;
}

// ¸¸·áÀÏ ¼³Á¤ÇÏ±â
// ms´ÜÀ§ : var expireDate = new Date(); expires = expireDate.setTime(expireDate.getTime() + msÃÊ);
// ÀÏ´ÜÀ§ : var expireDate = new Date(); expires = expireDate.setDate( expireDate.getDate() + ³¯Â¥¼ö );
function setCookie (name, value, expires)
{
	var args = setCookie.arguments;		// ÆÄ¶ó¹ÌÅÍ ¹è¿­
	var argCnt = setCookie.arguments.length;		// ÆÄ¶ó¹ÌÅÍ °³¼ö
	var expires = (2 < argCnt) ? args[2] : null;	// ¼³Á¤ÇÏÁö ¾ÊÀ¸¸é ºê¶ó¿ìÀú¸¦ ´Ý´Â ¼ø°£ ¾ø¾îÁü
	var path = (3 < argCnt) ? args[3] : null;		// ¼³Á¤ÇÏÁö ¾ÊÀ¸¸é ÇöÀç Cookie¸¦ º¸³»´Â ¹®¼­ÀÇ URL»óÀÇ °æ·Î(µµ¸ÞÀÎ ¸í Á¦¿Ü)·Î ¼³Á¤µË´Ï´Ù.
	var domain = (4 < argCnt) ? args[4] : null;	// ¼³Á¤ÇÏÁö ¾ÊÀ¸¸é ÇöÀç Cookie¸¦ º¸³»´Â ¹®¼­°¡ ¼ÓÇÑ µµ¸ÞÀÎ ¸íÀ¸·Î ¼³Á¤µË´Ï´Ù.
	var secure = (5 < argCnt) ? args[5] : false;	// HTTPS Server(HTTP over SSL)¿Í °°Àº Secure Server¿¡¼­ Cookie¸¦ º¸³¾ °æ¿ì ÀÌ °ªÀ» ¼³Á¤ÇØ ÁÝ´Ï´Ù.

	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function deleteCookie()
{
	//¸¸¾à ÄíÅ°°¡ ÀÖ´Ù¸é
	if (document.cookie != "" || document.cookie != null)
	{
		// ;·Î ±¸ºÐÇÏ¿© ¹è¿­·Î ¸¸µé¾î Á¤º¸¸¦ ÀúÀåÇÕ´Ï´Ù
		thisCookie = document.cookie.split("; ");
		//ÄíÅ°¸¦ Áö¿ì´Â ¹æ¹ýÀº ¸¸·á½Ã°£À» 0À¸·Î ¼ÂÆÃÇÏ´Â °ÍÀÔ´Ï´Ù
		expireDate = new Date();
		expireDate.setDate(expireDate.getDate()-1);
		for (n=0; n < thisCookie.length; n++)
		{
			cookieName = thisCookie[n].split("=")[0]
			document.cookie = cookieName + "=;expires=" + expireDate.toGMTString()
		}
	}
}
/**
* »óÀ§ÄÚµå¿¡ ÇØ´çÇÏ´Â ÇÏÀ§ÄÚµå ÄÞº¸¹Ú½º ¼¼ÆÃ, ÇÏÀ§ÄÚµå ÄÞº¸¹Ú½ºµé ¸ðµÎ ÃÊ±âÈ­
* @param jsonUrl CodeSelectorAgent ÆÄÀÏ°æ·Î¸í
* @param cdClass ÄÚµåÅ¬·¡½º
* @param parentCd ºÎ¸ð ÄÚµå
* @param lowerSelectElems ¸®¼ÂÆÃÇÒ ÇÏÀ§ÄÚµå ÄÞº¸¹Ú½º ¾ÆÀÌµð ¸®½ºÆ®(±¸ºÐÀÚ : '|')
* @param triggerJs ½ÇÇàÈÄ ¿¬ÀÌ¾î ½ÇÇàÇÒ ÀÚ¹Ù½ºÅ©¸³Æ®(¼öÁ¤ ÆäÀÌÁö¿¡¼­ ÀúÀåµÈ °ª ¼¼ÆÃ½Ã »ç¿ë)
* @example ÀÏ¹ÝÆäÀÌÁö ÀÌº¥Æ® ÇÚµé·¯: onchange="reqJsonCode('/wizcom_cpnt/JsonCode.jsp', 'ÇÏÀ§ºÐ·ùÄÚµåÅ¬·¡½º', this.value, &quot;getFormElem(form1, 'select-one', 1)|getFormElem(form1, 'select-one', 2)&quot;)"
* @example ¼öÁ¤ÆäÀÌÁö ÀÚ¹Ù½ºÅ©¸³Æ® : reqJsonCode("/wizcom_cpnt/JsonCode.jsp", "ÁßºÐ·ùÄÚµåÅ¬·¡½º", "´ëºÐ·ùDB°ª", "getFormElem(form1, 'select-one', 1)|getFormElem(form1, 'select-one', 2)", "reqJsonCode('/wizcom_cpnt/JsonCode.jsp', '¼ÒºÐ·ùÄÚµåÅ¬·¡½º', 'ÁßºÐ·ùDB°ª', 'getFormElem(form1, \'select-one\', 1)')")"
*/
function reqJsonCode(jsonUrl, cdClass, parentCd, lowerSelectElems, triggerJs)
{
	var strParam = "";
	strParam += "cdClass=" + cdClass + "&parentCd=" + parentCd + "&lowerSelectElems=" + lowerSelectElems;
	if ( triggerJs != null ) strParam += "&triggerJs=" + triggerJs;
	new wizcom.xhr.Request("POST", jsonUrl, strParam, resJsonCode);
}
// ÇÏÀ§ ÄÚµå¸®½ºÆ® ¼¼ÆÃ
function resJsonCode(req)
{
	if (req.readyState == 4)
	{
		if (req.status == 200)
		{
			var result = eval("(" + req.responseText + ")");
			var lowerSelectElems = result.lowerSelectElems.split("|");
			for ( n=0; n < lowerSelectElems.length; n++ ) clearCodeList(eval(lowerSelectElems[n])); // ÇÏÀ§ ÄÚµå¹Ú½º ÃÊ±âÈ­
			for ( n=0; n < result.codes.length; n++ ) eval(lowerSelectElems[0]).options[n+1] = new Option(result.names[n], result.codes[n]); // 1´Ü°è ÇÏÀ§ ÄÚµå¹Ú½º °ª¼¼ÆÃ
			if ( result.triggerJs != "" ) eval(result.triggerJs);
		}
	}
}
// ÇÏÀ§ÄÚµå ¸®½ºÆ® ÃÊ±âÈ­
function clearCodeList(selectElem)
{
	selectElem.length = 1;
	selectElem.options[0].selected = true;
}
/*
* ÆäÀÌµå ÀÎ/¾Æ¿ô È¿°ú
*@param strDivId ´ë»ó °´Ã¼ ¾ÆÀÌµð
*@param fname "fadeOut"-ÆäÀÌµå ¾Æ¿ô, "fadeIn"-ÆäÀÌµå ÀÎ
*@param step ÇÑ½ºÅÜ´ç Áõ°¡/°¡°¨Ä¡(10~100)
*@È£Ãâ¿¹ : fadeController("image_01", "fadeIn", 30)
*/
function fadeController(strDivId, fname, step)
{
	var timerInterval = 10; // ÀÛÀ»¼ö·Ï º¯È­¼Óµµ°¡ ºü¸§
	if ( getBrowserType() != "IE" )
	{
		step = step / 100;
	}
	if ( fname == "fadeIn" )
	{
		getObject(strDivId).style.display='block';
		if ( getBrowserType() == "IE" ) getObject(strDivId).filters.alpha.opacity = 0;
		else getObject(strDivId).style.opacity = 0;
	}
	fadeTimerId = setInterval(fname + "('" + strDivId + "'," + step + ")", timerInterval);
}

function fadeIn(strDivId, step)
{
	if ( getBrowserType() == "IE" )
	{
		if ( getObject(strDivId).filters.alpha.opacity < 100) getObject(strDivId).filters.alpha.opacity += step;
		else
		{
			getObject(strDivId).filters.alpha.opacity = 100;
			clearTimeout(fadeTimerId);
		}
	}
	else
	{
		if ( getObject(strDivId).style.opacity < 1) getObject(strDivId).style.opacity = Number(getObject(strDivId).style.opacity) + step;
		else
		{
			getObject(strDivId).style.opacity = 1;
			clearTimeout(fadeTimerId);
		}
	}
}

function fadeOut(strDivId, step)
{
	if ( getBrowserType() == "IE" )
	{
		if ( getObject(strDivId).filters.alpha.opacity > 0) getObject(strDivId).filters.alpha.opacity -= step;
		else
		{
			getObject(strDivId).filters.alpha.opacity = 0;
			clearTimeout(fadeTimerId);
			getObject(strDivId).style.display='none';
		}
	}
	else
	{
		if ( getObject(strDivId).style.opacity > 0) getObject(strDivId).style.opacity -= step;
		else
		{
			getObject(strDivId).style.opacity = 0;
			clearTimeout(fadeTimerId);
			getObject(strDivId).style.display='none';
		}
	}
}

function showDiv(strDivId)
{
	try { getObject("IFR_EDITOR").style.display='block'; } catch (e) {}
	fadeController(strDivId, "fadeIn", 50);
}

function hideDiv(strDivId)
{
	try { getObject("IFR_EDITOR").style.display='none'; } catch (e) {}
	fadeController(strDivId, "fadeOut", 100);
}
function changeTdBgByTr(trElem, bgColor)
{
	if ( bgColor == null || bgColor == "" ) bgColor = "#FFFFFF";
	var tdElems = trElem.getElementsByTagName("td");
	for ( n=0; n < tdElems.length; n++ ) tdElems[n].style.background = bgColor;
}
// ±¸ºÐÀÚ·Î ºÐ¸®µÇ´Â ¹®ÀÚ¿­Áß¿¡ ÇØ´ç¹øÂ° ¹®ÀÚ¿­ ¹ÝÈ¯
function getSplitValueByIndex(src, delim, idx)
{
	try
	{
		var arrStr = src.split(delim);
		for ( n = 0; n < arrStr.length; n++ )
		{
			if ( n == idx ) return arrStr[n];
		}
		return "";
	}
	catch (e)
	{
		return "";
	}
}

