	// ¼ýÀÚ(iValue)¸¦ iLen´ÜÀ§·Î ºÐÇÒ..
	function FormatNumber(iValue, iLen){
		var sValue = iValue.toString();			// ¹®ÀÚ¿­·Î º¯°æ..

		return sliceString(sValue, iLen);
	}


	function sliceString(sText, iLength){
		if(sText.length > iLength){
			return sliceString( sText.substring(0, sText.length - iLength), iLength ) + "," + sText.substring(sText.length - iLength, sText.length);
		} else{
			return sText;
		}
	}


function udfCheckRsno(ssn1 ,ssn2)  //ÁÖ¹Î¹øÈ£Ã¼Å©
{		
  
	var ssn_tot = ssn1 + ssn2;
	var yy = ssn1.substring(0,2);
	var mm = ssn1.substring(2,4);
	var dd = ssn1.substring(4,6);
	var sex = ssn2.substring(0,1);
	
	if (ssn1.length < 6)
	{
		alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return 'N';
	} 
	else if (ssn2.length < 7) 
	{
		alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return 'N';
	} 
	else if ((mm < 1)||(mm > 12)) 
	{
		alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return 'N';
	} 
	else if ((dd < 1)||(dd > 31)) 
	{
		alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		return 'N';
	} 
	else 
	{
		for(var i=0;i < ssn_tot.length;i++) 
		{
		  if (!((ssn_tot.charAt(i) >= "0")&&(ssn_tot.charAt(i) <= "9"))) 
		  {
		    alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		    return 'N';
		  }		
		}
	}
	// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
	var a1=ssn1.substring(0,1)
	var a2=ssn1.substring(1,2)
	var a3=ssn1.substring(2,3)
	var a4=ssn1.substring(3,4)
	var a5=ssn1.substring(4,5)
	var a6=ssn1.substring(5,6)
	var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7

	var b1=ssn2.substring(0,1)
	var b2=ssn2.substring(1,2)
	var b3=ssn2.substring(2,3)
	var b4=ssn2.substring(3,4)
	var b5=ssn2.substring(4,5)
	var b6=ssn2.substring(5,6)
	var b7=ssn2.substring(6,7)

	var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5

	check_digit = check_digit%11
	check_digit = 11 - check_digit
	check_digit = check_digit%10

	if (check_digit != b7)
	{
	    alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Àß¸ø‰ç½À´Ï´Ù.");
	    return 'N';
	}
	return 'Y';
}

	// ¿¢¼¿ ´Ù¿î·Îµå..
	function ExcelDownload(aValues){
		var oForm = document.createElement("form");
		var aInputs = ["strFileName", "strTitle", "strSubTitles", "strFields", "strPK", "strTables", "intPageNo", "intPageSize", "strFilter", "strSort"];

		document.body.appendChild(oForm);


		for(var i=0; i<aInputs.length; i++){
			var oInput = document.createElement("input");

			oInput.type = "text";
			oInput.name = aInputs[i];
			oInput.value = aValues[i];

			oForm.appendChild(oInput);
		}

		oForm.style.display = "none";
		oForm.method = "post";
		oForm.action = "/pub/makeXLS.asp";
		oForm.submit();
	}


	function NCP_pupop(user_id, user_pw){
		document.write("<form name = 'ncpForm'>"); 	
		document.write("<input type ='hidden' name ='user_id' value =''>"); 	
		document.write("<input type ='hidden' name ='user_pw' value =''>"); 	
		document.write("</form>"); 		
		
		var form = eval("document.ncpForm");

		form.user_id.value = user_id;
		form.user_pw.value = user_pw;

		PopUp("", "ncp", 400, 284);
		form.target = "ncp";
		form.method = "post";
		form.action = "/member/pop_realname.asp";
		form.submit();
	}



	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function MM_showHideLayers() { //v6.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}



	function PopUp(url, wName, width, height) {//È­¸éÀÇ Áß¾Ó
		var LeftPosition = (screen.width/2) - (width/2);
		var TopPosition = (screen.height/2) - (height/2);
		var win = window.open(url, wName, "left="+LeftPosition+",top="+TopPosition+",width="+width+",height="+height);

		if(win == null){
			alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä!");
		} else{
			win.focus();
		}
	}

	function PopUp_withScroll(url, wName, width, height) {//È­¸éÀÇ Áß¾Ó
		var LeftPosition = (screen.width/2) - (width/2);
		var TopPosition = (screen.height/2) - (height/2);
		var win = window.open(url, wName, "left="+LeftPosition+",scrollbars=yes,top="+TopPosition+",width="+width+",height="+height);

		if(win == null){
			alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä!");
		} else{
			win.focus();
		}
	}


	function OpenWinFullScreen(strUrl, s){
		var win = window.open(strUrl , "FullScreen", "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+s+",resizable=0")
		win.focus();
	}
		
	function ObjNullChk(obj, msg){
		if(obj.value==""){
			alert(msg+"À»(¸¦) ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			obj.focus();
			return true;
		}else{
			return false;
		}
	}

	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 arg = name + "=";
		var alen = arg.length; 
		var clen = document.cookie.length;
		var i = 0;

		while (i < clen) {
			var j = i + alen; 
			if (document.cookie.substring(i, j) == arg){
				var endstr = document.cookie.indexOf (";", j);
				if (endstr == -1) 
					endstr = document.cookie.length; 
				return unescape(document.cookie.substring(j, endstr));
			}
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
		return null;
	} 

	function DeleteCookie (name) {//ÄíÅ° »èÁ¦
		var exp = new Date(); 
		exp.setTime (exp.getTime() - 1); 
		var cval = GetCookie (name); 
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); 
	} 

	function ChkRadioChecked(obj){//¶óµð¿À ¹öÆ°ÀÇ Ã¼Å©À¯¹« °Ë»ç
		var chk = false;
		for(i=0; i<=obj.length-1; i++){
			if(obj[i].checked)
				chk = true;
		}
		return chk;
	}

	function CopyClipBoard(strObj){//Å¬¸³º¸µå·Î ÅØ½ºÆ® º¹»ç
		var ra;
		var tempObj;
		tempObj = eval("document."+strObj);
		tempObj.focus();
		tempObj.select();
		ra = tempObj.createTextRange()
		ra.execCommand("copy");
		alert('ÀÌ¹ÌÁöÀÇ °æ·Î°¡ Å¬¸³º¸µå¿¡ º¹»çµÇ¾ú½À´Ï´Ù. \n\n'
		+'º¹»çÇÏ½Ç °÷¿¡¼­ Ctrl + v ¶Ç´Â ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°À» ´­·¯ ºÙ¿©³Ö±â ÇÏ½Ã¸é µË´Ï´Ù.\n\n');
	}

	function FileExtCheck(obj, n) {//ÆÄÀÏ¸íÀÇ È®ÀåÀÚ¿Í Æ¯¼ö¹®ÀÚ °Ë»ç, ¸¶Ä§Ç¥ 2°³ ÀÌ»ó »ç¿ëµÇ¾ú´ÂÁö °Ë»ç
		var t = obj.value;
		var strFn;
		var strFn2;
		var re;
		var dotCnt = 0;
		
		if((t.lastIndexOf(".jpg")==-1) && (t.lastIndexOf(".gif")==-1) && (t.lastIndexOf(".JPG")==-1) && (t.lastIndexOf(".GIF")==-1)) {
			alert(n+"¹ø ÆÄÀÏ : ¾÷·ÎµåÇÒ ÆÄÀÏÀº JPG ¶Ç´ÂGIF¸¸ °¡´ÉÇÕ´Ï´Ù. ");
			return false;
		}
		
		//ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ °Ë»ç
		strFn = t.substring(t.lastIndexOf("\\")+1, t.length);//È®ÀåÀÚ Æ÷ÇÔ ÆÄÀÏ¸í
		strFn2 = strFn.substring(0, strFn.indexOf("."));//È®ÀåÀÚ Á¦¿ÜÇÑ ÆÄÀÏ¸í
		
		re = /!|@|#|\$|%|\^|&|\*|\+|\?|\.|\,/;
		
		if(re.test(strFn2)){
			alert(n+"¹ø ÆÄÀÏ : ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
		
		for(i=0; i<strFn.length; i++){
			if(strFn.substring(i,i+1)=="."){
				dotCnt++;
			}
		}
		if(dotCnt > 1){
			alert(n+'¹ø ÆÄÀÏ : ÆÄÀÏ¸í¿¡ ±¸ºÐÀÚ(ÆÄÀÏ¸í°ú È®ÀåÀÚ ±¸ºÐ) " . " ´Â 1°³ÀÌ»ó »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
			return false;
		}
		
		return true;
	}

	function FileExtCheck2(obj) {//ÆÄÀÏ¸íÀÇ È®ÀåÀÚ¿Í Æ¯¼ö¹®ÀÚ °Ë»ç, ¸¶Ä§Ç¥ 2°³ ÀÌ»ó »ç¿ëµÇ¾ú´ÂÁö °Ë»ç
		var t = obj.value;
		var strFn;
		var strFn2;
		var re;
		var dotCnt = 0;
		
		if((t.lastIndexOf(".jpg")==-1) && (t.lastIndexOf(".gif")==-1) && (t.lastIndexOf(".JPG")==-1) && (t.lastIndexOf(".GIF")==-1)) {
			alert("¾÷·ÎµåÇÒ ÆÄÀÏÀº JPG ¶Ç´ÂGIF¸¸ °¡´ÉÇÕ´Ï´Ù. ");
			return false;
		}
		
		//ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ °Ë»ç
		strFn = t.substring(t.lastIndexOf("\\")+1, t.length);//È®ÀåÀÚ Æ÷ÇÔ ÆÄÀÏ¸í
		strFn2 = strFn.substring(0, strFn.indexOf("."));//È®ÀåÀÚ Á¦¿ÜÇÑ ÆÄÀÏ¸í
		
		re = /!|@|#|\$|%|\^|&|\*|\+|\?|\.|\,/;
		
		if(re.test(strFn2)){
			alert("ÆÄÀÏ¸í¿¡ Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
		
		for(i=0; i<strFn.length; i++){
			if(strFn.substring(i,i+1)=="."){
				dotCnt++;
			}
		}
		if(dotCnt > 1){
			alert('ÆÄÀÏ¸í¿¡ ±¸ºÐÀÚ(ÆÄÀÏ¸í°ú È®ÀåÀÚ ±¸ºÐ) " . " ´Â 1°³ÀÌ»ó »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
			return false;
		}
		
		return true;
	}



	//ÆÄÀÏ ¾÷·Îµå
	function UpLoadOpenWin(form, elem, path){
		var url = "/pub/fileUpload.asp?frmName="+form+"&elem="+elem+"&path="+path;
		var top = screen.height/2 - 75;
		var left = screen.width/2 - 200;
		var win = window.open(url, "uploadWin", "width=340, height=200, top="+top+", left="+left);
		win.focus();
	}


	// *************************************************************
	//		Ãß°¡ºÎºÐ
	// *************************************************************

	function isNull(elem, msg){
		if(elem.value.Trim() == ""){
			alert(msg + " ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			elem.value = "";
			elem.focus();
			return true;
		} else{
			return false;
		}
	}


	// ÀÌ¹ÌÁö »çÀÌÁî¿¡ ¸Â°Ô ÀÚµ¿À¸·Î Å©±âÁ¶ÀýµÇ´Â »õÃ¢¶ç¿ì±â
	function showPicture(src) {
	  var imgObj = new Image();
	  imgObj.src = src;

	  var wopt = "scrollbars=no,status=no,resizable=no";
	  wopt += ",width=" + imgObj.width;
	  wopt += ",height=" + imgObj.height;
	  
	  var wbody = "<head><title>»çÁø º¸±â</title>";
	  wbody += "<script language='javascript'>";
	  wbody += "function finalResize(){";
	  wbody += "  var oBody=document.body;";
	  wbody += "  var oImg=document.images[0];";
	  wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	  wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	  wbody += "  window.resizeBy(xdiff,ydiff);";
	  wbody += "}";
	  wbody += "</"+"script>";
	  wbody += "</head>";
	  wbody += "<body onLoad='finalResize()' style='margin:0'>";
	  wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
	  wbody += "</body>";
	  winResult = window.open("about:blank","",wopt);
	  winResult.document.open("text/html", "replace");
	  winResult.document.write(wbody);
	  winResult.document.close();
	  
	  return;
	}


	function check_email(argObject) {
		var strEmail = argObject.value
		// email³»¿¡ '@'³ª '.'ÀÌ ¾øÀ¸¸é
		if (strEmail.indexOf(".", 0) == -1)
		{
			alert('e-mailÀ» Á¤È®È÷ ÀÔ·ÂÇÏ½Ê½Ã¿À.')
			argObject.focus(); argObject.select(); return false
		}
		// email³»¿¡ AlphaNumeric, '@', '.', '-','_' ÀÌ¿ÜÀÇ ¹®ÀÚ°¡ ÀÖÀ¸¸é
		for (i = 0; i < strEmail.length; i++) 
		{
			var ch = strEmail.substr(i,1)
			if ((ch < "0" || ch > "9") && (ch < "A" || ch > "Z") && (ch < "a" || ch > "z") && (ch != "@") && (ch != "_") && (ch != ".") && (ch != "-")) 
			{
				alert('E-MailÀ» Á¤È®È÷ ÀÔ·ÂÇÏ½Ê½Ã¿À.')
				argObject.focus(); argObject.select(); return false
			}
		}
		return true
	}


	//°ø¹é/¿µ¾î/Æ¯¼ö¹®ÀÚ °Ë»ö¼Ò½º
	function BJname(objtext1) {
		var inText = objtext1.value;
		var ret;

		for (var i = 0; i < inText.length; i++) {
			ret = inText.charCodeAt(i);
			if (ret > 31 && ret < 127) {
				alert("ÀÌ¸§Àº ¶ç¾î¾²±â ¾øÀÌ ÇÑ±Û·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
				objtext1.value = "";
				objtext1.focus();
				return false;
			}
		}
		return true;
	}

	function CheckStr(strOriginal, strFind, strChange){
		var position, strOri_Length;
		position = strOriginal.indexOf(strFind);  

		while (position != -1){
			strOriginal = strOriginal.replace(strFind, strChange);
			position    = strOriginal.indexOf(strFind);
		}

		strOri_Length = strOriginal.length;
		return strOri_Length;
	}


	// ÇÃ·¡½Ã Á¡¼±¾øÀÌ ¶ç¿ì±â..
	function getFlashObject(flashSrc, objWidth, objHeight, etcParam) {
		var tag = "";
		var baseFlashDir="";
		flashSrc = baseFlashDir + flashSrc;

		if ( etcParam != "" || etcParam != null ) {
			if ( etcParam.substr(0, 1) == "?" )
				flashSrc += etcParam;
			else
				flashSrc += "?" + etcParam;
		}

		tag += "<object id=\"adqua\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
		tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
		tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
		tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
		tag += "<param name=\"menu\" value=\"true\">";
		tag += "<param name=\"quality\" value=\"high\">";
		tag += "<embed name=\"adqua\" src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
		tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
		tag += "></embed>";
		tag += "</object>";

		document.write(tag);
	}


	// ÇÃ·¡½Ã Á¡¼±¾øÀÌ ¶ç¿ì±â(ÇÃ·¡½ÃÀÇ id/nameÁöÁ¤)..
	function getFlashObject(flashSrc, objWidth, objHeight, etcParam, flaName) {
		var tag = "";
		var baseFlashDir="";
		flashSrc = baseFlashDir + flashSrc;

		if ( etcParam != "" || etcParam != null ) {
			if ( etcParam.substr(0, 1) == "?" )
				flashSrc += etcParam;
			else
				flashSrc += "?" + etcParam;
		}

		tag += "<object id=\"" + flaName + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
		tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
		tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
		tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
		tag += "<param name=\"menu\" value=\"true\">";
		tag += "<param name=\"quality\" value=\"high\">";
		tag += "<param name=\"wmode\" value=\"transparent\">";
		tag += "<embed name=\"" + flaName + "\" src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
		tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
		tag += "></embed>";
		tag += "</object>";

		document.write(tag);
	}

	/*	F11, F5, ¼Ò½ºº¸±â ¸·±â.	*/

	if(window.Event)	// ³Ý½ºÄÉÀÌÇÁ¿¡¼­´Â ´ë¹®ÀÚ Event
		document.captureEvents(Event.MOUSEUP);

	function nocontextmenu(){		// IE
		event.cancelBubble = true;
		event.returnValue = false;
		return false;
	}

	function norightclick(e){		// Others..
		if(window.Event){
			if(e.which == 2 || e.which == 3)
				return false;
		} else{
			if(event.button == 2 || event.button == 3){
				event.cancelBubble = true;
				event.returnValue = false;
				return false;
			}
		}
	}

	function processKey(){
		if(event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82) || (event.keyCode >= 112 && event.keyCode <= 123) || event.keyCode == 8){
			event.keyCode = 0;
			event.cancelBubble = true;
			event.returnValue = false;
		}
	}
	/*
	document.onkeydown = processKey;
	document.oncontextmenu = nocontextmenu;
	document.onmousedown = norightclick;
	document.onselectstart = new Function("return false");
	document.ondragstart = new Function("return false");
	*/



// Trim Function Implementation from JScavitto
String.prototype.LTrim=new Function("return this.replace(/^\\s+/,'')")
String.prototype.RTrim=new Function("return this.replace(/\\s+$/,'')")
String.prototype.Trim= new Function("return this.replace(/^\\s+|\\s+$/g,'')")	