/// 스트링 객체에 메소드 추가 ///
String.prototype.trim = function(str) {
	str = ((this != window) ? this : str);
	return (str.replace(/^\s+/g, '').replace(/\s+$/g, ''));
};

String.prototype.hasFinalConsonant = function(str) {
	str = ((this != window) ? this : str);
	var strTemp = str.substr(str.length - 1);
	return ((strTemp.charCodeAt(0) - 16) % 28 != 0);
};

String.prototype.bytes = function(str) {
	str = ((this != window) ? this : str);
	var len = 0; //bug. 이 한줄때문에 고생을.. 넣어주세요. -_-;;
	for (j = 0; j < str.length; j++) {
		var chr = str.charAt(j);
		len += (chr.charCodeAt() > 128) ? 2 : 1
	}
	return len;
};
// 대소문자 구별하지 않고 단어 위치 찾기
String.prototype.ipos = function(needle, offset) {
	offset = (typeof(offset)== "number") ? offset : 0;

	return str.toLowerCase().indexOf(needle.toLowerCase(), offset);
};
// 대소문자 구별하지 않고 뒤에서부터 단어위치 찾기
String.prototype.ripos = function(needle, offset) {
	offset = (typeof(offset)== "number") ? offset : 0;
	return str.toLowerCase().lastIndexOf(needle.toLowerCase(), offset);
};
// 문자열을 배열로
String.prototype.toArray = function() {
	var len = this.length;
	var arr = new Array;
	for (var i = 0; i < len; i++) arr[i] = this.charAt(i);
	return arr;
};
//문자열을 전부 replace하기
String.prototype.replaceAll = function(str1, str2) {
	var temp_str = "";
	if ((this.trim().length > 0) && (str1 != str2)) {
		temp_str = this.trim();
		while (temp_str.indexOf(str1) > -1) {
			temp_str = temp_str.replace(str1, str2);
		}
	}
	return temp_str;
};
//문자변환함수
function alterString(str, before, after) {
	var returnStr = "";
	for (i = 0; i < str.length; i++) {
		value = str.charAt(i);
		index = before.indexOf(value);
		if (index >= 0) {
			value = after.charAt(index);
		}
		returnStr += value;
	}
	return returnStr;
};
// 대문자로 변경
String.prototype.ToUpper = function() {
	return alterString(this, TOLOWER, TOUPPER);
};
// 소문자로 변경
String.prototype.ToLower = function() {
	return alterString(this, TOUPPER, TOLOWER);
};
function setCookie(name, value, expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);

	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie(name) {

	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == ' ') c = c.substring(1, c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
	}
	return null;
}

// correctly handle PNG transparency in Win IE 5.5 & 6.
function setPng24(obj) {
	try {
		if (navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
			reIE.test(navigator.appVersion);
			var version = parseFloat(RegExp["$1"]);
			if ((5.5 <= version) && (version < 7) && (document.body.filters)) {
				var imgName = obj.src.toUpperCase();
				if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
					var imgID = (obj.id) ? "id='" + obj.id + "' " : "";
					var imgClass = (obj.className) ? "class='" + obj.className + "' " : "";
					var imgTitle = (obj.title) ? "title='" + obj.title + "' " : "title='" + obj.alt + "' ";
					var imgStyle = "display:inline-block;" + obj.style.cssText;
					if (obj.align == "left") imgStyle = "float:left;" + imgStyle;
					if (obj.align == "right") imgStyle = "float:right;" + imgStyle;
					if (obj.parentElement.href) imgStyle = "cursor:pointer;" + imgStyle;
					var strNewHTML = "<span " + imgID + imgClass + imgTitle
						+ " style=\"" + "width:" + obj.width + "px; height:" + obj.height + "px;" + imgStyle + ";"
						+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
						+ "(src=\'" + obj.src + "\', sizingMethod='scale');\"></span>";
					obj.outerHTML = strNewHTML;
				}
			}
		}
	}
	catch (e) { }
}
/// <summary>
/// 객체의 선택된 숫자를 구한다.
/// </summary>
/// <param name="arg">검사할 객체</param>
function getSelectedCount(el) {
	var cnt = 0;

	if (el) {
		if (el.tagName == "SELECT") {
			// SelectBox
			for (var i = 0; i < el.options[i].length; i++) {
				if (el.options[i].selected) {
					cnt++;
				}
			}
		} else {
			// CheckBox
			if (el.length) {
				for (c = 0; c < el.length; c++) {
					if (el[c].checked == true) {
						cnt++;
					}
				}
			} else {
				if (el.checked == true) {
					cnt++;
				}
			}
		}
	}
	return cnt;
}
/// <summary>
/// 클릭 이벤트를 발생 시킨다
/// </summary>
/// <param name="arg">이벤트가 발생할 객체의 아이디.</param>
function setClickEvt(arg) {
	if (event.keyCode == 13) {
		document.getElementById(arg).click();
		event.returnValue = false;
		return false;
	}
}
function parseURL(str) {
	var param;
	str = new String(str);
	arr = str.split("?");

	if (arr[1]) {
		param = arr[1].split("&");
		for (var x in param) {
			p = param[x].split("=");
			HTTP_GET_VARS[p[0]] = p[1];
		}
	}
}
function parseGet() {
	var tmp, pattern1, pattern2, i, keyval = new Array(), e;

	pattern1 = /\?/;
	if (!pattern1.test(location.href)) {
		return true;
	}

	tmp = location.href.replace(/^.*\?/, "");

	if (tmp == "") {
		return true;
	}

	tmp = tmp.split("&");

	pattern1 = /^([^=]+)=?(.*)$/;
	pattern2 = /^(.*)\[(\d*)\]$/;
	for (i = 0; i < tmp.length; i++) {
		if (!pattern1.test(tmp[i])) {
			window.alert("error");
		}
		keyval[0] = RegExp.$1;
		keyval[1] = RegExp.$2;
		if (pattern2.test(keyval[0])) {
			if (RegExp.$2 == "") {
				try {
					HTTP_GET_VARS[RegExp.$1].push(keyval[1]);
				} catch (e) {
					HTTP_GET_VARS[RegExp.$1] = new Array();
					HTTP_GET_VARS[RegExp.$1][0] = keyval[1];
				}
			} else {
				try {
					HTTP_GET_VARS[RegExp.$1][RegExp.$2] = keyval[1];
				} catch (e) {
					HTTP_GET_VARS[RegExp.$1] = new Array();
					HTTP_GET_VARS[RegExp.$1][RegExp.$2] = keyval[1];
				}
			}
		} else {
			HTTP_GET_VARS[keyval[0]] = keyval[1];
		}
	}

	return true;
}
function echo(strMsg) {
	document.write(strMsg);
}
function flash(strCtlID, strPath, intWidth, intHeight, strFlashVars, strStyleText) {
	var strHTML = "";

	try {
/*
		//strHTML += "<div id='" + strCtlID + "_Container' style='" + strStyleText + ";'>Flash</div>";
		strHTML += "<div id='" + strCtlID + "_Container' style='" + strStyleText + ";'></div>";
		echo(strHTML);
		jQuery(document).ready(function(){
			var strHTML = "";
			//$('#' + strCtlID + '_Container').flash({src: strPath, width: intWidth, height: intHeight,flashvars:{foo: 'bar', baz: 'zoo' }});
			strHTML += "<object name='" + strCtlID + "' id='" + strCtlID + "' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0' width='" + intWidth + "' height='" + intHeight + "'>";
			strHTML += "<param name='WMode' value='transparent' />";
			strHTML += "<param name='Movie' value='" + strPath + "' />";
			strHTML += "<param name='Src' value='" + strPath + "' />";
			if ((strFlashVars != undefined) && (strFlashVars != null) && (strFlashVars.trim().length > 0)) {
				strHTML += "<param name='FlashVars' value='" + strFlashVars + "'>";
			}
			strHTML += "<param name='Quality' value='High' />";
			strHTML += "<param name='AllowScriptAccess' value='sameDomain' />";
			strHTML += "<param name='BGColor' value='#ffffff' />";
			strHTML += "<embed id='" + strCtlID + "' src='" + strPath + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + intWidth + "' height='" + intHeight + "' flashvars='" + ((strFlashVars != undefined) && (strFlashVars != null) && (strFlashVars.trim().length > 0) ? strFlashVars : "") + "'></embed>";
			strHTML += "</object>";
			jQuery('#' + strCtlID + '_Container').html(strHTML);
		});
*/
		strHTML += "<object name='" + strCtlID + "' id='" + strCtlID + "' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0' width='" + intWidth + "' height='" + intHeight + "'>";
		strHTML += "<param name='WMode' value='transparent' />";
		strHTML += "<param name='Movie' value='" + strPath + "' />";
		strHTML += "<param name='Src' value='" + strPath + "' />";
		if ((strFlashVars != undefined) && (strFlashVars != null) && (strFlashVars.trim().length > 0)) {
			strHTML += "<param name='FlashVars' value='" + strFlashVars + "'>";
		}
		strHTML += "<param name='Quality' value='High' />";
		strHTML += "<param name='AllowScriptAccess' value='sameDomain' />";
		strHTML += "<param name='BGColor' value='#ffffff' />";
		strHTML += "<embed id='" + strCtlID + "' src='" + strPath + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + intWidth + "' height='" + intHeight + "' flashvars='" + ((strFlashVars != undefined) && (strFlashVars != null) && (strFlashVars.trim().length > 0) ? strFlashVars : "") + "'></embed>";
		strHTML += "</object>";

		strHTML = "<div id='" + strCtlID + "_Container' style='" + strStyleText + ";'>" + strHTML + "</div>";
		echo(strHTML);
	} catch (e) {
		OnErrorHandler(e);
	}
}
function get_objectTop(obj) {
	if (obj.offsetParent == document.body){
		return obj.offsetTop;
	} else {
		return obj.offsetTop + get_objectTop(obj.offsetParent);
	}
}
function addOnloadEvent(fnc) {
	if (typeof window.addEventListener != "undefined") {
		window.addEventListener("load", fnc, false);
	} else if (typeof window.attachEvent != "undefined") {
		window.attachEvent("onload", fnc);
	} else {
		if (window.onload != null) {
			var oldOnload = window.onload;
			window.onload = function(e) {
				oldOnload(e);
				window[fnc]();
			};
		} else {
			window.onload = fnc;
		}
	}
}

function DeleteASPNETViewState(oForm) {
	var el = null;
	var bRtn = false;

	for (i = 0; i < oForm.elements.length; i++) {
		el = oForm.elements[i];
		if ((el.getAttribute("ID") == "__VIEWSTATE") || (el.getAttribute("ID") == "__EVENTVALIDATION")) {
			el.setAttribute("value", "");
			el.parentNode.removeChild(el);
		}
	}

	bRtn = true;
	el = null;

	return bRtn;
}
function CommonAjaxCallByForm(oHtmlFormElement, sUrl, fncAjaxRequestOnSuccess, fncAjaxRequestOnFail) {
	if (DeleteASPNETViewState(oHtmlFormElement)) {
		if ((sUrl == undefined) || (sUrl.trim().bytes() < 1)) {
			sUrl = oHtmlFormElement.action;
		}

		if (fncAjaxRequestOnSuccess == undefined) {
			fncAjaxRequestOnSuccess = AjaxRequest_onSuccess;
		}
		if (fncAjaxRequestOnFail == undefined) {
			fncAjaxRequestOnFail = AjaxRequest_onFail;
		}
		CommonAjaxCall(sUrl, jQuery("#" + oHtmlFormElement.getAttribute("id")).find("input,textarea,select,hidden").not("[type=hidden][name^=__]").serialize(), fncAjaxRequestOnSuccess, fncAjaxRequestOnFail);
	}
}
function CommonAjaxCall(sUrl, oParms, fncAjaxRequestOnSuccess, fncAjaxRequestOnFail) {
		SetEnableProgressBar();
		//new Ajax.Request(sUrl, { method: 'post', parameters: oParms, onSuccess: AjaxRequest_onSuccess, onFailure: AjaxRequest_onFail });
		oParms += "&isajax=1";

		if (fncAjaxRequestOnSuccess == undefined) {
			fncAjaxRequestOnSuccess = AjaxRequest_onSuccess;
		}
		if (fncAjaxRequestOnFail == undefined) {
			fncAjaxRequestOnFail = AjaxRequest_onFail;
		}

		jQuery.ajax({ url: sUrl, type: 'post', data: oParms, success: fncAjaxRequestOnSuccess, error: fncAjaxRequestOnFail, complete: AjaxRequest_onComplete });
}
function CommonAjaxCallByForm2(oHtmlFormElement, sUrl, fncAjaxRequestOnSuccess, fncAjaxRequestOnFail) {
    if (DeleteASPNETViewState(oHtmlFormElement)) {
        if ((sUrl == undefined) || (sUrl.trim().bytes() < 1)) {
            sUrl = oHtmlFormElement.action;
        }

        if (fncAjaxRequestOnSuccess == undefined) {
            fncAjaxRequestOnSuccess = AjaxRequest_onSuccess;
        }
        if (fncAjaxRequestOnFail == undefined) {
            fncAjaxRequestOnFail = AjaxRequest_onFail;
        }
        CommonAjaxCall2(sUrl, jQuery("#" + oHtmlFormElement.getAttribute("id")).find("input,textarea,select,hidden").not("[type=hidden][name^=__]").serialize(), fncAjaxRequestOnSuccess, fncAjaxRequestOnFail);
    }
}
function CommonAjaxCall2(sUrl, oParms, fncAjaxRequestOnSuccess, fncAjaxRequestOnFail) {
    //SetEnableProgressBar();
    //new Ajax.Request(sUrl, { method: 'post', parameters: oParms, onSuccess: AjaxRequest_onSuccess, onFailure: AjaxRequest_onFail });
    oParms += "&isajax=1";

    if (fncAjaxRequestOnSuccess == undefined) {
        fncAjaxRequestOnSuccess = AjaxRequest_onSuccess;
    }
    if (fncAjaxRequestOnFail == undefined) {
        fncAjaxRequestOnFail = AjaxRequest_onFail;
    }

    jQuery.ajax({ url: sUrl, type: 'post', data: oParms, success: fncAjaxRequestOnSuccess, error: fncAjaxRequestOnFail, complete: AjaxRequest_onComplete });
}
function AjaxRequest_onComplete(transport) {
	//alert("complate!\n" + transport);
}
function AjaxRequest_onSuccess(transport) {
	SetDisableProgressBar();
	//alert(transport.responseText);
	alert(transport);
	if (eval(document.getElementById("RedirectURL"))) {
		document.location.replace(document.getElementById("RedirectURL").value);
	} else if (eval(document.getElementById("UsePageReload"))) {
		document.location.replace(document.location);
	}
}
function AjaxRequest_onFail() {
	SetDisableProgressBar();
	alert('요청하신 데이터를 처리하는중 오류가 발생 하였습니다.\n다시한번 시도해 주시기 바랍니다.\n\n깉은 오류가 계속 발생하면, 관리자에게 문의하여 주십시요\n감사합니다.');
}
function SetEnableProgressBar() {
	var pnlProgrssPopupContainer = document.getElementById('pnlProgrssPopupContainer');
	var pnlProgrssPopup = document.getElementById('pnlProgrssPopup');
	var pnlButtons = document.getElementById("pnlButtons");
	var scrollX = 0;
	var scrollY = 0;
	var frameX = 800;
	var frameY = 600;

	document.body.style.cursor = "wait";
	if (eval(pnlButtons)) {
		pnlButtons.style.display = "none";
	}
	if (eval(pnlProgrssPopup)) {
		pnlProgrssPopup.style.position = "absolute";
		pnlProgrssPopup.style.width = "600px";
		pnlProgrssPopup.style.height = "49px";

		//스크롤 위치 파악
		if (self.pageYOffset) {
			//IE외 모든 브라우저
			scrollX = self.pageXOffset;
			scrollY = self.pageYOffset;
		} else if (document.documentElement && document.documentElement.scrollTop) {
			//Explorer 6 Strict mode
			scrollX = document.documentElement.scrollLeft;
			scrollY = document.documentElement.scrollTop;
		} else if (document.body) {
			//다른 IE
			scrollX = document.body.scrollLeft;
			scrollY = document.body.scrollTop;
		}
		//윈도우나 프레임의 내부크기를 알아 낸다.
		if (self.innerHeight) {
			//IE외 모든 브라우저
			frameX = self.innerWidth;
			frameY = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			//Explorer 6 Strict mode
			frameX = document.documentElement.clientWidth;
			frameY = document.documentElement.clientHeight;
		} else if (document.body) {
			//다른 IE
			frameX = document.body.clientWidth;
			frameY = document.body.clientHeight;
		}
		pnlProgrssPopup.style.top = (scrollY + (frameY / 2) - (parseInt(pnlProgrssPopup.style.height) / 2)).toString() + "px";
		pnlProgrssPopup.style.left = (scrollX + (frameX / 2) - (parseInt(pnlProgrssPopup.style.width) / 2)).toString() + "px";

		frameY = ((frameY + scrollY) > frameY ? (frameY + scrollY) : frameY);
		frameY = (self.innerHeight > frameY ? self.innerHeight : frameY);
		if (document.documentElement && document.documentElement.clientHeight) {
			frameY = (document.documentElement.clientHeight > frameY ? document.documentElement.clientHeight : frameY);
		}
		if (document.body.clientHeight) {
			frameY = (document.body.clientHeight > frameY ? document.body.clientHeight : frameY);
		}

		if (navigator.userAgent.toString().indexOf("MSIE 6") > 0) {
			pnlProgrssPopupContainer.style.background = "";
			pnlProgrssPopupContainer.style.backgroundColor = "#fff";
			pnlProgrssPopupContainer.style.width = ((eval(document.documentElement.clientWidth) > eval(document.body.clientWidth)) ? parseInt(document.documentElement.clientWidth) : parseInt(document.body.clientWidth)).toString() + "px";
		}

		pnlProgrssPopup.style.backgroundColor = "#fff";
		pnlProgrssPopupContainer.style.height = frameY.toString() + "px";
		pnlProgrssPopupContainer.style.display = "block";
	}
}
function SetDisableProgressBar() {
	document.body.style.cursor = "default";
	if (eval(document.getElementById("pnlButtons"))) {
		document.getElementById("pnlButtons").style.display = "block";
	}
	if (eval(document.getElementById('pnlProgrssPopupContainer'))) {
		document.getElementById('pnlProgrssPopupContainer').style.display = 'none';
	}
}
function GlobalOnErrorHandler(sMsg, sUrl, iLine) {
	var errortxt = "";

	try {
		errortxt += "페이지 스크립트에 오류가 있습니다.\n\n";
		errortxt += "URL: " + sUrl + "\n";
		if (IsDebugMode) {
			errortxt += "오류내용: " + sMsg + "\n";
			errortxt += "Line = " + iLine + "\n\n";
		}
		errortxt += "\n\n확인을 누르시면 페이지를 계속 탐색하고,\n취소를 누르시면 첫 페이지로 이동 합니다.";
		if (!confirm(errortxt)) {
			document.location.href = "/";
		}
	} catch (ex) {
		errortxt += "페이지 스크립트에 오류가 있습니다.";
		if (IsDebugMode) {
			errortxt += "\n\n오류코드 : " + ex.code + "\n오류 메세지 : " + ex.message;
		}
		alert(errortxt);
	}

	return (!IsDebugMode);
}
function OnErrorHandler(e) {
	var errortxt = "";

	try {
		errortxt += "페이지 스크립트에 오류가 있습니다.";
		if (IsDebugMode) {
			errortxt += "\n\n오류코드 : " + e.code + "\n오류 메세지 : " + e.message;
			alert(errortxt);
		} else {
			errortxt += "\n계속 하시겠습니까?";
			errortxt += "\n";
			errortxt += "\n확인을 누르시면 페이지를 계속 탐색하고,";
			errortxt += "\n취소를 누르시면 첫 페이지로 이동 합니다.";
			if (!confirm(errortxt)) {
				document.location.href = "/";
			}
		}
	} catch (ex) {
		errortxt += "페이지 스크립트에 오류가 있습니다.";
		if (IsDebugMode) {
			errortxt += "\n\n오류코드 : " + ex.code + "\n오류 메세지 : " + ex.message;
		}
		alert(errortxt);
	}

	return (!IsDebugMode);
}
function ValivateFormData(objForm) {
	var rtn = false;

	try {
		alert("처리되지 않았습니다.");
	} catch (e) {
		OnErrorHandler(e);
	}

	return rtn;
}
function SetCenterPopup(url, name, w, h, sbar, ismodal) {
    
    var isWinOpend = false;
    var objWin = null;
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    var strModal = (ismodal ? ",modal=yes" : "");

    pFeatures = 'height=' + h.toString() + ',width=' + w.toString() + ',top=' + wint.toString() + ',left=' + winl.toString() + ',';
    pFeatures += 'scrollbars=' + sbar + ', resizable=no, menubar=no, titlebar=no, toolbar=no, status=no, directories=no ' + strModal;

    try {
        objWin = window.open(url, name, pFeatures);
        if (objWin) {
            isWinOpend = true;
        }
    } catch (e) {
    }
    if (isWinOpend) {
        objWin.focus();
    } else {
        alert("팝업이 차된되어 있습니다. 팝업 차단을 해제해 주세요.");
    }
    
	return;
}
function GetDateDiffVal(strSrtDT, strEndDT, interval, rounding ) {
	var iOut = 0;
	var strSrtMsg = "";
	var strItvMsg = "";

	var arrTemp = strSrtDT.split("-");
	var SrtDate = new Date(arrTemp [0], (arrTemp [1]-1), arrTemp [2]);

	arrTemp = strEndDT.split("-");
	var EndDate = new Date(arrTemp [0], (arrTemp [1]-1), arrTemp [2]);

	var bufferA = Date.parse(SrtDate);
	var bufferB = Date.parse(EndDate);

	// Create 2 error messages, 1 for each argument.
	strSrtMsg += "Check the Start Date and End Date\n";
	strSrtMsg += "must be a valid date format.\n\n";
	strSrtMsg += "Please try again.";

	strItvMsg += "Sorry the dateAdd function only accepts\n";
	strItvMsg += "d, h, m OR s intervals.\n\n";
	strItvMsg += "Please try again.";

	// check that the start parameter is a valid Date.
	if (isNaN(bufferA) || isNaN(bufferB)) {
		alert(strSrtMsg);
		return null;
	}

	if ( interval.charAt == 'undefined' ) {// check that an interval parameter was not numeric.
		alert( strItvMsg );// the user specified an incorrect interval, handle the error.
		return null;
	}

	var number = bufferB-bufferA;

	// what kind of add to do?
	switch (interval.charAt(0)) {
		case 'd': case 'D':
			iOut = parseInt(number / 86400000);
			if(rounding) iOut += parseInt((number % 86400000)/43200001);
			break;
		case 'h': case 'H':
			iOut = parseInt(number / 3600000 );
			if(rounding) iOut += parseInt((number % 3600000)/1800001);
			break;
		case 'm': case 'M':
			iOut = parseInt(number / 60000 );
			if(rounding) iOut += parseInt((number % 60000)/30001);
			break;
		case 's': case 'S':
			iOut = parseInt(number / 1000 );
			if(rounding) iOut += parseInt((number % 1000)/501);
			break;
		default:
		// If we get to here then the interval parameter
		// didn't meet the d,h,m,s criteria.  Handle
		// the error.
		alert(strItvMsg);
		return null;
	}

	return iOut;
}
function DateAdd(strIvtType, iDaysCnt, FrmDT) {
	var RtnDate		= null;
	var iFrmYear	= null;
	var iFrmMonth	= null;
	var iFrmDate	= null;
	var iRtnYear	= null;
	var iRtnMonth	= null;
	var iRtnDate	= null;
	var arrTempDT	= null;

	iDaysCnt = parseInt(iDaysCnt);

	if(FrmDT instanceof Date) {
		// FrmDT가 Date 객체일 경우
		iFrmYear	= FrmDT.getYear();
		iFrmMonth	= FrmDT.getMonth();
		iFrmDate	= FrmDT.getDate();
	} else {
		// FrmDT가 문자열일경우
		arrTempDT	= FrmDT.split("-");
		FrmDT		= new Date(arrTempDT[0], (arrTempDT[1]-1), arrTempDT[2]);
		iFrmYear	= arrTempDT[0];
		iFrmMonth	= arrTempDT[1]-1;
		iFrmDate	= arrTempDT[2];
	}

	if(strIvtType == "y" || strIvtType == "Y") {
		iFrmYear = parseInt(iFrmYear) + iDaysCnt;
	} else if (strIvtType == "m" || strIvtType == "M") {
		iFrmMonth = ((iFrmMonth < '10') ? iFrmMonth.replace('0', '') : iFrmMonth);
		iFrmMonth = (parseInt(iFrmMonth.replace('0', '')) + iDaysCnt);
	} else if (strIvtType == "d" || strIvtType == "D") {
		iFrmDate = ((iFrmDate < '10') ? iFrmDate.replace('0', '') : iFrmDate);
		iFrmDate = parseInt(iFrmDate) + iDaysCnt;
	}

	RtnDate = new Date(iFrmYear, iFrmMonth, iFrmDate);
	iRtnYear = RtnDate.getFullYear();
	iRtnMonth = RtnDate.getMonth()+1;
	iRtnDate = RtnDate.getDate();

	if (iRtnMonth < 10) {
		iRtnMonth = "0" + iRtnMonth;
	}
	if (iRtnDate < 10) {
		iRtnDate = "0" + iRtnDate;
	}

	return iRtnYear + "-" + iRtnMonth + "-" + iRtnDate;
}
function DateWeekDay(date, isDecoString) {
	var datePattern = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
	var day = "";

	if (datePattern.test(date)) {
		var tmpDate = date.toString().split("-");

		tmpDate = new Date(tmpDate[0], tmpDate[1] - 1, tmpDate[2]);
		tmpDate = tmpDate.getDay();

		switch (tmpDate) {
			case 0:		day = "일";		break;
			case 1:		day = "월";		break;
			case 2:		day = "화";		break;
			case 3:		day = "수";		break;
			case 4:		day = "목";		break;
			case 5:		day = "금";		break;
			case 6:		day = "토";		break;
		}

		if (isDecoString) {
			return "(" + day + ")";
		} else {
			return day;
		}
	} else {
		alert("날짜 형식이 아닙니다.\n요일을 반환할 수 없습니다.");
		return "";
	}
}
// addCommaValue("120000", 3) 하면 120,000돌려줌
function addCommaValue(strValue, iLen) {
	iLen = (iLen || 3);
	var strBeforeValue = (strValue.indexOf('.') != -1)? strValue.substring(0,strValue.indexOf('.')) :strValue ;
	var strAfterValue  = (strValue.indexOf('.') != -1)? strValue.substr(strValue.indexOf('.'),fLen+1) : '' ;
	var intLast =  strBeforeValue.length-1;
	var arrValue = new Array;
	var strComma = '';
	/*
	if(!isNaN(strValue)) {
		alert(strValue.concat(' -> 숫자가 아닙니다.'));
		return false;
	}
	*/
	for(var i=intLast,j=0 ; i >= 0; i--,j++) {
		strComma = ((j !=0 && j%3 == 0) ? ',' : '');
		arrValue[arrValue.length] = strBeforeValue.charAt(i) + strComma;
	}

	return arrValue.reverse().join('') +  strAfterValue;
}

function CreateBookmarkLink() {
	title = "세상의 모든 여행 Justgo Travel";
	url = "http://www.justgo.kr";

	if (window.sidebar) {						// Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {				// IE Favorite
		window.external.AddFavorite( url, title);
	} else if(window.opera && window.print) {	// Opera Hotlist
		return true;
	}
}
function num2str(num) {
	var qu			= num.length / 4;
	var re			= num.length % 4;
	var sutja		= "";
	var sutja_rd	= "";
	var sutja_jr	= "";
	var read		= "";

	for(i=0;i<num.length;i++) {
		sutja = num.substring(i,i+1);
		if ((parseInt(sutja, 10)<10)) {
			sutja_rd = new String(sutja);
		} else {
			sutja_rd = "";
		}

		if ((num.length - i - 1) < 4) {
			switch((num.length - i -1) % 4 +1) {
				case(4): sutja_jr = "천"; break;
				default: sutja_jr = "";
			}
		}

		if (sutja_rd != "") {read += sutja_rd + sutja_jr;}

		if((num.length - i - 1) % 4 == 0) {
			switch((num.length - i - 1) / 4) {
				case(1): read += "만"; break;
				case(2): read += "억"; break;
				case(3): read += "조"; break;
				default: break;
			}
		}
	}
	return read;
}

/*
CUSTOM FORM ELEMENTS

Created by Ryan Fait
www.ryanfait.com

The only thing you need to change in this file is the following
variables: checkboxHeight, radioHeight and selectWidth.

Replace the first two numbers with the height of the checkbox and
radio button. The actual height of both the checkbox and radio
images should be 4 times the height of these two variables. The
selectWidth value should be the width of your select list image.

You may need to adjust your images a bit if there is a slight
vertical movement during the different stages of the button
activation.

Visit http://ryanfait.com/ for more information.
*/
var checkboxHeight = "25";
var radioHeight = "25";
var selectWidth = "190";
/* No need to change anything after this */

//document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');

var Custom = {
	init: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && (inputs[a].className == "CFStyle" || inputs[a].className == "CFStyle2" || inputs[a].className == "CFStyle3")) {
				span[a] = document.createElement("span");
				span[a].className = inputs[a].type + inputs[a].className.replace("CFStyle", "");
				span[a].id = "CFStyle"+inputs[a].id;

				if(inputs[a].checked == true) {
					if(inputs[a].type == "checkbox") {
						position = "0 -" + (checkboxHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					} else {
						position = "0 -" + (radioHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					}
				}
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.clear;
				inputs[a].onclick = Custom.clear;
				span[a].onmousedown = Custom.pushed;
				span[a].onmouseup = Custom.check;
				//document.onmouseup = Custom.clear;
			}
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "CFStyle" || inputs[a].className == "CFStyle2" || inputs[a].className == "CFStyle3") {
				option = inputs[a].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}
				span[a] = document.createElement("span");
				span[a].className = "select" + inputs[a].className.replace("CFStyle", "");
				span[a].id = "CFStyle" + inputs[a].name;
				span[a].appendChild(textnode);
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.choose;
			}
		}
	},
	pushed: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";
			//this.style.backgroundPosition = "0 -" + (checkboxHeight*3 - 5) + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*3 + "px";
			//this.style.backgroundPosition = "0 -" + (radioHeight*3 - 5) + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight + "px";
			//this.style.backgroundPosition = "0 -" + (checkboxHeight - 5) + "px";
		} else {
			this.style.backgroundPosition = "0 -" + radioHeight + "px";
			//this.style.backgroundPosition = "0 -" + (radioHeight - 5) + "px";
		}
	},
	check: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 0";
			//this.style.backgroundPosition = "0 5px";
			element.checked = false;
		} else {
			if(element.type == "checkbox") {
				this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
				//this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else {
				this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
				//this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
				group = this.nextSibling.name;
				inputs = document.getElementsByTagName("input");
				for(a = 0; a < inputs.length; a++) {
					if(inputs[a].name == group && inputs[a] != this.nextSibling) {
						inputs[a].previousSibling.style.backgroundPosition = "0 0";
						//inputs[a].previousSibling.style.backgroundPosition = "0 -5px";
					}
				}
			}
			element.checked = true;
		}
	},
	clear: function() {/*
		inputs = document.getElementsByTagName("input");
		for(var b = 0; b < inputs.length; b++) {
			if(inputs[b].type == "checkbox" && inputs[b].checked == true && (inputs[b].className == "CFStyle" || inputs[b].className == "CFStyle2" || inputs[b].className == "CFStyle3")) {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
				//inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
				//inputs[b].previousSibling.style.backgroundPosition = "0 5px";
			} else if(inputs[b].type == "radio" && inputs[b].checked == true && (inputs[b].className == "CFStyle" || inputs[b].className == "CFStyle2" || inputs[b].className == "CFStyle3")) {
				if (eval(document.getElementById("CFStyle"+inputs[b].id))) {
					document.getElementById("CFStyle"+inputs[b].id).style.backgroundPosition = "0 -" + (radioHeight*2) + "px";
					alert("CFStyle"+inputs[b].id);
				}
				//inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
			} else if(inputs[b].type == "radio" && (inputs[b].className == "CFStyle" || inputs[b].className == "CFStyle2" || inputs[b].className == "CFStyle3")) {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
				//inputs[b].previousSibling.style.backgroundPosition = "0 5px";
			}
		}*/
		alert("id: " + this);
	},
	choose: function() {
		option = this.getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
			}
		}
	}
};

var HTTP_GET_VARS = new Array();
var strRootPath = "/";
var IsDebugMode = false;
var TOUPPER = "QWERTYUIOPASDFGHJKLZXCVBNM";
var TOLOWER = "qwertyuiopasdfghjklzxcvbnm";
onerror = GlobalOnErrorHandler;
jQuery.noConflict();
addOnloadEvent(parseGet);
addOnloadEvent(Custom.init);