var permNum     = "0123456789,." ;
var permSEng    = "abcdefghijklmnopqrstuvwxyz " ;
var permLEng    = "ABCDEFGHIJKLMNOPQRSTUVWXYZ " ;
var permEng     = permSEng + permLEng ;
var permSpecial = "~!@#$%^&*()_+|{}[]\"=':;?><,./` "







function _private_trim() {
  var tmpStr, atChar;
  tmpStr = this;

  if (tmpStr.length > 0) atChar = tmpStr.charAt(0);
  while (_private_stringvb_isSpace(atChar)) {
    tmpStr = tmpStr.substring(1, tmpStr.length);
    atChar = tmpStr.charAt(0);
  }
  if (tmpStr.length > 0) atChar = tmpStr.charAt(tmpStr.length-1);
  while (_private_stringvb_isSpace(atChar)) {
    tmpStr = tmpStr.substring(0,( tmpStr.length-1));
    atChar = tmpStr.charAt(tmpStr.length-1);
  }
  return tmpStr;
}

function _private_stringvb_isSpace(inChar) {
  return (inChar == ' ' || inChar == 't' || inChar == 'n');
}




function _private_left(inLen) {
  return this.substring(0,inLen);
}
function _private_right(inLen) {
  return this.substring((this.length-inLen),this.length);
}
function _private_mid(inStart,inLen) {
  var iEnd;
  if (!inLen)
    iEnd = this.length;
  else
    iEnd = inStart + inLen;
  return this.substring(inStart,iEnd);
}


//String.prototype.trim = _private_trim;
String.prototype.left = _private_left;
String.prototype.right = _private_right;
String.prototype.mid = _private_mid;






/*******************************************************************************/
// 공백 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
/*******************************************************************************/
function fncChkSpace(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;
		
	for(i=0 ; i<tmpStr.length ; i++){
		if(tmpStr.charAt(i)!=" "){
			return true ;
		}
	}
	
	if(str!=null){
		alert(str + " 는(은) 공백을 입력할 수 없습니다. ") ;
		obj.value = '';
	}
	obj.focus() ;

	return false ;
}

/*******************************************************************************/
// 공백 체크(value)
//	- value : 입력폼 이름 ex) document.frm.MBR_ID     
/*******************************************************************************/
function fncChkSpaceV(value){
	tmpStr = value ;
		
	for(i=0 ; i<tmpStr.length ; i++){
		if(tmpStr.charAt(i)!=" ")
			return true ;
	}

	return false ;
}
      
/*******************************************************************************/
// 영문체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkEng(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if(permEng.indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n영문만 입력이 가능합니다.") ;
			}
			obj.focus() ;
			return false ;
		}
	}
	return true ;
}

/*******************************************************************************/
// 대문자 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkLEng(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if(permLEng.indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n대문자만 입력이 가능합니다.") ;
			}
			obj.focus() ;
			return false ;
		}
	}
	return true ;
}

/*******************************************************************************/
// 소문자 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkSEng(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if(permSEng.indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n소문자만 입력이 가능합니다.") ;
			}
			obj.focus() ;

			return false ;
		}
	}
	return true ;
}

/*******************************************************************************/
// 대문자,숫자 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkLEngNum(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if((permLEng+permNum).indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n대문자와 숫자의 조합으로만 입력이 가능합니다.") ;
			}
			obj.focus() ;

			return false ;
		}
	}
	return true ;
}


/*******************************************************************************/
// 소문자,숫자 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkSEng(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if((permSEng+permNum).indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n소문자와 숫자의 조합으로만 입력이 가능합니다.") ;
			}
			obj.focus() ;

			return false ;
		}
	}
	return true ;
}

/*******************************************************************************/
// 영문숫자체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkEngNum(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if((permEng+permNum).indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n영문과 숫자의 조합으로만 입력이 가능합니다.") ;
			}
			obj.focus() ;

			return false ;
		}
	}
	return true ;
}

/*******************************************************************************/
// 숫자체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkNumber(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if((permNum).indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n숫자만 입력이 가능합니다.") ;
			}
			obj.value = '';
			obj.focus() ;
			return false ;
		}
	}
	return true ;
}

/*******************************************************************************/
// 숫자체크(value)
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str       : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkNumberV(value){
	tmpStr = value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if((permNum).indexOf(tmpStr.charAt(i))<0)
			return false ;
	}
	return true ;
}



/*******************************************************************************/
// 길이체크(바이트)
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- min : 최소 길이
//	- max : 최대 길이
//	- str : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkBytes(formName,fieldName,min,max,str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;
    var tcount = 0;
    var onechar;

	tmpStr = obj.value ;
	len    = calBytes(tmpStr) ;

	if(min==max){
		if(len<min || len>max){
			if(str!=null){
				alert(str + " 길이가 잘못되었습니다. \r\n" + (min/2) + "자, 영문(숫자) " + min +"자로 입력하세요") ;
			}
            for(k=0;k<len;k++){
                onechar = tmpStr.charAt(k);
    
                if(escape(onechar).length > 4) {
                    tcount += 2;
                }else if(onechar!='r') {
                    tcount++;
                }
                if(tcount>max) {
                    obj.value = tmpStr.substring(0,k);
                    obj.focus() ;
    		        return false ;
                }
            }

			obj.focus() ;

			return false ;
		}
	}
	else if(len<min && min!=0){
		if(str!=null){
			alert(str + " 길이가 너무 짧습니다. \r\n한글 " + (min/2) + "자, 영문(숫자) " + min +"자 이상으로 입력하세요") ;
		}
		obj.focus() ;

		return false ;
	}
	else if(len>max){
		if(str!=null){
			alert(str + " 길이가 초과되었습니다. \r\n한글 " + (max/2) + "자, 영문(숫자) " + max +"자 이하로 입력하세요") ;
		}
        for(k=0;k<len;k++){
            onechar = tmpStr.charAt(k);

            if(escape(onechar).length > 4) {
                tcount += 2;
            }else if(onechar!='r') {
                tcount++;
            }
            if(tcount>max) {
                obj.value = tmpStr.substring(0,k);
                obj.focus() ;
		        return false ;
            }
        }

		obj.focus() ;

		return false ;
	}

	return true ;
}

/*******************************************************************************/
// 길이 체크(length)
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- min : 최소 길이
//	- max : 최대 길이
//	- str : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkLength(formName,fieldName,min,max,str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;
	len     = tmpStr.length ;

	if(min==max){
		if(len<min || len>max){
			if(obj.value!=null){
				if(str!=null){
					alert(str + " 길이가 잘못되었습니다. \r\n" + min +"자로 입력하세요") ;
				}
				obj.focus() ;
			}

			return false ;
		}
	}
	else if(len<min){
		if(obj.value!=null){
			if(str!=null){
				alert(str + " 길이가 너무 짧습니다. \r\n" + min +"자 이상으로 입력하세요") ;
			}
			obj.focus() ;
		}
		return false ;
	}
	else if(len>max){
		if(obj.value!=null){
			if(str!=null){
				alert(str + " 길이가 초과되었습니다.\r\n" + max +"자 이하로 입력하세요") ;
			}
			obj.focus() ;
		}
		return false ;
	}

	return true ;
}

/*******************************************************************************/
// byte 변환
/*******************************************************************************/
function calBytes(str){
	tmpStr = str
	strLength = tmpStr.length
	var one_char;
	var bytes = 0;

	for (k=0;k<strLength;k++){
		one_char = tmpStr.charAt(k);

		if(escape(one_char).length>4){
			bytes += 2;
		}
		else if(one_char!='\r'){
			bytes++;
		}
	}
	
	return bytes ;
}

/*******************************************************************************/
// 이메일 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str : 뿌려질 메세지 ex) "이메일을"
/*******************************************************************************/
function fncChkEmail(formName, fieldName, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	tmpStr = obj.value
	
	if(((tmpStr.search(exclude) != -1)||(tmpStr.search(check)) == -1)||(tmpStr.search(checkend) == -1)){
		if(str!=null){
			alert(str + " 잘못 입력하였습니다. \r\n형식에 맞게 입력하세요") ;
		}
	//	obj.focus() ;

		return false ;
	}

	return true;
}

/*******************************************************************************/
// 주민등록번호 체크
//	- formName   : 폼이름
//  - fieldName1 : 주민번호 앞자리
//  - fieldName2 : 주민번호 뒷자리
//	- str  : 뿌려질 메세지 ex) "주민번호를"
/*******************************************************************************/
function fncChkRegNum(formName, fieldName1, fieldName2, str){ 
	var f    = document.forms[formName] ;
	var obj1 = f[fieldName1] ;
	var obj2 = f[fieldName2] ;

	if(!fncChkSpace(formName, fieldName1, "주민등록번호를")) return false ;
	if(!fncChkNumber(formName, fieldName1, "주민등록번호를")) return false ;
	if(!fncChkLength(formName, fieldName1, 6, 6, "주민등록번호를")) return false ;

	if(!fncChkSpace(formName, fieldName2, "주민등록번호를")) return false ;
	if(!fncChkNumber(formName, fieldName2, "주민등록번호를")) return false ;
	if(!fncChkLength(formName, fieldName2, 7, 7, "주민등록번호를")) return false ;

	sIdno = obj1.value + "-" + obj2.value ;

	a1 = sIdno.substring(0, 1);
	a2 = sIdno.substring(1, 2);
	a3 = sIdno.substring(2, 3);
	a4 = sIdno.substring(3, 4);
	a5 = sIdno.substring(4, 5);
	a6 = sIdno.substring(5, 6);
	a7 = sIdno.substring(7, 8);
	a8 = sIdno.substring(8, 9);
	a9 = sIdno.substring(9, 10);
	a10 = sIdno.substring(10, 11);
	a11 = sIdno.substring(11, 12);
	a12 = sIdno.substring(12, 13);
	a = sIdno.substring(13, 14);
	
	x = a1*2 + a2*3 + a3*4 + a4*5 + a5*6 + a6*7 + a7*8 + a8*9 + a9*2 + a10*3 + a11*4 + a12*5;
	
	xx = x % 11;
	
	
	
	if (xx == 10) xx = 0; 
	a = 11 - a;
	
	if (a == 11) a = 1;
	else if (a == 10) a = 0;
	
	
	
	if (xx == a) 
		return true;
	else {
		if(str!=null){
			alert(str + " 잘못 입력하였습니다. \r\n형식에 맞게 입력하세요") ;
		}
		obj1.focus() ;

		return false;
	}
}


/*******************************************************************************/
// 외국인등록번호 체크
//	- formName   : 폼이름
//  - fieldName1 : 주민번호 앞자리
//  - fieldName2 : 주민번호 뒷자리
//	- str  : 뿌려질 메세지 ex) "외국인등록번호를"
/*******************************************************************************/

function fncChkForeignRegNum(formName, fieldName1, fieldName2){ 
        var f    = document.forms[formName] ;
	    var obj1 = f[fieldName1] ;
	    var obj2 = f[fieldName2] ;

        var fgn_reg_no = obj1.value 
                         + obj2.value; 

        if (fgn_reg_no == ''){ 
                alert('외국인등록번호를 입력하십시오.'); 
                return false; 
        } 

        if (fgn_reg_no.length != 13) { 
                alert('외국인등록번호 자리수가 맞지 않습니다.'); 
                return false; 
        } 
        if ((fgn_reg_no.charAt(6) == "5") || (fgn_reg_no.charAt(6) == "6")) 
        { 
           birthYear = "19"; 
        } 
        else if ((fgn_reg_no.charAt(6) == "7") || (fgn_reg_no.charAt(6) == "8")) 
        { 
           birthYear = "20"; 
        } 
        else if ((fgn_reg_no.charAt(6) == "9") || (fgn_reg_no.charAt(6) == "0")) 
        { 
           birthYear = "18"; 
        } 
        else 
        { 
          alert("외국인 등록번호에 오류가 있습니다. 다시 확인하십시오."); 
          return false; 
        }         

        birthYear += fgn_reg_no.substr(0, 2); 
        birthMonth = fgn_reg_no.substr(2, 2) - 1; 
        birthDate = fgn_reg_no.substr(4, 2); 
        birth = new Date(birthYear, birthMonth, birthDate); 
         
        if ( birth.getYear() % 100 != fgn_reg_no.substr(0, 2) || 
             birth.getMonth() != birthMonth || 
             birth.getDate() != birthDate) { 
          alert('생년월일에 오류가 있습니다. 다시 확인하십시오.'); 
          return false; 
        } 

        return true; 
} 


/*******************************************************************************/
// 날짜 세팅
//  - formName   : 폼이름
//	- fieldName1 : 날짜 연도 필드이름
//	- fieldName2 : 날짜 월 필드이름
//	- fieldName3 : 날짜 일 필드이름
/*******************************************************************************/
function fncSetDate(formName, fieldName1, fieldName2, fieldName3){
	var f = document.forms[formName] ;
	var obj1 = f[fieldName1] ;
	var obj2 = f[fieldName2] ;
	var obj3 = f[fieldName3] ;

	year  = obj1.value ;
	month = obj2.value ;
	day   = obj3.value ;
	
	days    = new Array(31,28,31,30,31,30,31,31,30,31,30,31) ;
	days[1] = (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 29 : 28 // 윤달
	
	for(i=obj3.options.length-1; i>=0 ; i--){	
		obj3.options.remove(i);
	}
	
	for(i=0; i<days[month-1] ; i++){
		oOption=document.createElement("OPTION");
		oOption.value = i+1 ;
		oOption.text  = i+1 ;
		obj3.options.add(oOption);
	}
}

/*******************************************************************************/
// 셀렉트 폼 이동
//	- formName    : 폼명
//	- selectName1 : 원본 셀렉트 이름
//	- selectName2 : 이동할 셀렉트 이름
//	- selectCont  : 이동할 곳의 개수 제한
//  - duplication : 중복체크여부
/*******************************************************************************/
function fncSelectMove(formName, selectName1,selectName2, selectCount, duplication)
{
	var f = document.forms[formName] ;
	var obj1 = f[selectName1] ;
	var obj2 = f[selectName2] ;

	var selectIndex = obj1.selectedIndex ;

	// 선택되지 않았을 경우
	if(selectIndex==-1) return ;

	// 기본값이 넘어올 경우 
	if(obj1.value=="") return ;

	// 중복 체크
	if(duplication){
		for(i=0; i<obj2.length; i++){
			if(obj2.options[i].value==obj1.value){
				alert("선택하신 항목은 이미 등록되어 있습니다.") ;
				return ;
			}
		}
	}

	// 개수체크
	if(selectCount!=null && obj2.options.length >= selectCount){
		alert(selectCount + "개 까지 이동이 가능합니다");
		return ;
	}

	// 선택된 값의 text와 value
	var text  = obj1.options[selectIndex].text ;
	var value = obj1.options[selectIndex].value ;

	// 이동될 곳에 추가
	opt = document.createElement("OPTION");
	opt.text  = text ;
	opt.value = value ;
	obj2.add(opt) ;

	obj2.options[obj2.options.length-1].selected = true ;

	// 이동된 것은 삭제
	obj1.options.remove(selectIndex) ;

	// 최상단 선택
	if(obj1.options.length>selectIndex)	{
		obj1.options[selectIndex].selected = true ;
	}
	else if(obj1.options.length!=0){
		obj1.options[selectIndex-1].selected = true ;
	}
}


/*******************************************************************************/
// 쿠키 값 가져오기
//	- name : 쿠키명
/*******************************************************************************/
function fncGetCookie( name ){
	var cookie_name = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+cookie_name.length);
		if ( document.cookie.substring( x, y ) == cookie_name ){
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
	
		break;
	}
	return "";
}


/*******************************************************************************/
// 쿠키 값 세팅
//	- name  : 쿠키명
//	- value : 쿠키값
//  - expiredays : 만료일
/*******************************************************************************/
function fncSetCookie( name, value, expiredays ) {
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

	//쿠키 세팅하기
/*
//중복 함수	
function setCookie(name, value, expires, path, domain, secure){
	var curCookie = name + "=" + escape(value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "; path=/" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
	document.cookie = curCookie;
}
*/

/*******************************************************************************/
// 엔터를 <br>로 바꾸기
//	- str : 바꿀 문자열
/*******************************************************************************/
function fncChgBR(str){
	tmpStr   = str ;
	ret_str   = ""
	left_str  = "" ;
	right_str = "" ;


	while(tmpStr.indexOf("\r\n")>=0){
		left_str  = tmpStr.substring(0,tmpStr.indexOf("\r\n")) ;
		right_str = tmpStr.substring(tmpStr.indexOf("\r\n")+2) ;

		ret_str += left_str + "<br>";
		tmpStr = right_str ;
	}
	return ret_str + right_str ;
}


var ne = (navigator.appName == "Netscape") ? true : false;
var cursorPosX ;
var cursorPosY ;

document.onmousemove = mousePos;

if(ne) document.captureEvents(Event.MOUSEMOVE); 

/*******************************************************************************/
// 마우스 좌표
/*******************************************************************************/
function mousePos(e){
/*
	if(ne)
		evt = e;
	else
		evt = event;

	cursorPosX = window.evt.x + document.body.scrollLeft;
	cursorPosY = window.evt.y + document.body.scrollTop;
	*/
}


/*******************************************************************************/
// 자릿수 콤마 붙이기
//	- formName  : 폼이름
//  - fieldName : 필드명
/*******************************************************************************/
function fncCipher(formName, fieldName){
	var f ;
	if(typeof(formName)=="object") f = formName
	else f = document.forms[formName] ;

	var obj = f[fieldName] ;

	value = fncNonCipher(formName, fieldName) ;
	return fncCipher2(value,formName, fieldName) ;
}

function fncCipher2(value, formName, fieldName){
	number         = value + "" ;
	sign           = number.substring(0,1)=="+"||number.substring(0,1)=="-"?
					 number.substring(0,1):"" ; // 부호(+,-) ;
	decimalPoint   = number.indexOf(".") ; // 소수점의 자릿수
	positiveNumber = decimalPoint>=0 ? number.substring(0,decimalPoint) : number ; // 정수부분
	positiveNumber = sign=="+"||sign=="-"?
					 positiveNumber.substring(1) : positiveNumber ;
	decimal        = decimalPoint>=0 ? number.substring(decimalPoint+1) : "" ; // 소수부분
	n              = positiveNumber.length ; // 정수의 길이
	result         = "" ; //결과값


	// 숫자체크
	if(!fncChkNumberV(positiveNumber)){
		alert("숫자를 입력하세요");
		if(formName!=null && fieldName!=null){
			document.forms[formName][fieldName].focus() ;
			return "";
		}
	}


	if(!fncChkNumberV(decimal)){
		alert("숫자를 입력하세요");
		if(formName!=null && fieldName!=null){
			document.forms[formName][fieldName].focus() ;
			return "";
		}
	}

	// 콤마 붙이기
	for( x=n-1 , y=0 ; x>=0 ; x--,y++){
		if((y%3)==0 && (y!=0)) 
			result =',' + result;
			result = positiveNumber.charAt(x) + result ;
	}

	// 소수점 이하가 있으나 정수값이 ""일 경우 정수를 0으로 변환
	if(decimalPoint>=0 && result==""){
		result = "0." ;
	}

	// 소수점 이하가 있을 경우 소수점 붙이기
	result = decimalPoint>0 ? result + "." + decimal : result ;

	// 맨앞에 0이 있을 경우 제거
	num = 0 ;
	if(result.length>1){
		while(result.substring(0,1)=="0" && result.length!=1) {
			result = result.substring(1) ;
			if(num>100) break ;
			num ++ ;
		}
	}

	return sign+result ;
}

function fncCipher3(numStr){
	number         = numStr + "" ;
	sign           = number.substring(0,1)=="+"||number.substring(0,1)=="-"?
					 number.substring(0,1):"" ; // 부호(+,-) ;
	decimalPoint   = number.indexOf(".") ; // 소수점의 자릿수
	positiveNumber = decimalPoint>=0 ? number.substring(0,decimalPoint) : number ; // 정수부분
	positiveNumber = sign=="+"||sign=="-"?
					 positiveNumber.substring(1) : positiveNumber ;
	decimal        = decimalPoint>=0 ? number.substring(decimalPoint+1) : "" ; // 소수부분
	n              = positiveNumber.length ; // 정수의 길이
	result         = "" ; //결과값


	// 숫자체크
	/*
	if(!fncChkNumberV(positiveNumber)){
		alert("숫자를 입력하세요");
		if(formName!=null && fieldName!=null){
			document.forms[formName][fieldName].focus() ;
			return "";
		}
	}*/

    /*
	if(!fncChkNumberV(decimal)){
		alert("숫자를 입력하세요");
		if(formName!=null && fieldName!=null){
			document.forms[formName][fieldName].focus() ;
			return "";
		}
	}*/

	// 콤마 붙이기
	for( x=n-1 , y=0 ; x>=0 ; x--,y++){
		if((y%3)==0 && (y!=0)) 
			result =',' + result;
			result = positiveNumber.charAt(x) + result ;
	}

	// 소수점 이하가 있으나 정수값이 ""일 경우 정수를 0으로 변환
	if(decimalPoint>=0 && result==""){
		result = "0." ;
	}

	// 소수점 이하가 있을 경우 소수점 붙이기
	result = decimalPoint>0 ? result + "." + decimal : result ;

	// 맨앞에 0이 있을 경우 제거
	num = 0 ;
	if(result.length>1){
		while(result.substring(0,1)=="0" && result.length!=1) {
			result = result.substring(1) ;
			if(num>100) break ;
			num ++ ;
		}
	}
	return sign+result ;
}

/*******************************************************************************/
// 자릿수 콤마 제거
//	- formName  : 폼이름
//  - fieldName : 필드명
/*******************************************************************************/
function fncNonCipher(formName, fieldName){
	var f ;
	if(typeof(formName)=="object") f = formName
	else f = document.forms[formName] ;

	var obj = f[fieldName] ;

	number = obj.value ;
	data   = number + "" ;
	while(data.indexOf(",")>=0){
		idx = data.indexOf(",") ;
		data = data.substring(0,idx) + data.substring(idx+1) ;
	}

	return data ;
}

function fncNonCipher2(number){
	//number = obj.value ;
	data   = number + "" ;
	while(data.indexOf(",")>=0){
		idx = data.indexOf(",") ;
		data = data.substring(0,idx) + data.substring(idx+1) ;
	}
	return data ;
}

function fncNonCipherV(obj){
	number = obj.value ;
	data   = number + "" ;
	while(data.indexOf(",")>=0){
		idx = data.indexOf(",") ;
		data = data.substring(0,idx) + data.substring(idx+1) ;
	}
	return data ;
}
/*******************************************************************************/
// 배경색 바꾸기
//	- id    : 바꿀 곳의 객체 또는 id
//	- color : 바꿀 색
/*******************************************************************************/
function fncChgBgcolor(id, color){
	obj = document.all[id] ;
	
	if(obj!=null){
		obj.style.background = color ;
	}
}

/*******************************************************************************/
// 이미지 바꾸기
//	- imgId  : 바꿀 곳의 id
//	- imgSrc : 바꿀 이미지 경로
/*******************************************************************************/
function fncChgImage(imgId, imgSrc){
	document.images[imgId].src = imgSrc ; 
}


/*******************************************************************************/
// 문자열 바꾸기
//	- str    : 원본 문자열
//  - oldStr : 바꿀 문자열
//  - newStr : 새 문자열
/*******************************************************************************/
function fncReplace(str, oldStr, newStr){
	tmpStr    = str ;
	ret_str   = ""
	left_str  = "" ;
	right_str = "" ;

	if(str.indexOf(oldStr)==-1){
		return str ;
	}

	while(tmpStr.indexOf(oldStr)>=0){
		left_str  = tmpStr.substring(0,tmpStr.indexOf(oldStr)) ;
		right_str = tmpStr.substring(tmpStr.indexOf(oldStr)+oldStr.length) ;

		ret_str += left_str + newStr;
		tmpStr = right_str ;
	}

	return ret_str + right_str ;
}


/*******************************************************************************/
// Iframe 크기 조절
//	- iframId : iframe의 id
/*******************************************************************************/
function frameResize(iframId){
	parent.document.getElementById(iframId).style.height=document.body.scrollHeight+(document.body.offsetHeight-document.body.clientHeight);
	//alert(document.body.scrollHeight + " : " + document.body.offsetHeight + " : " +document.body.clientHeight) ;
}


/*******************************************************************************/
// 해당문자만 입력 허용 
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- val : 허용문자
//	- str : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkString(formName, fieldName, val, str){
	var f = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	for(i=0 ; i<tmpStr.length ; i++){
		if(val.indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str) ;
			}

			obj.focus() ;
			return false ;
		}
	}
	return true ;
}


/*******************************************************************************/
// 콤마가 들어간 숫자 체크
//	- formName  : 폼이름
//  - fieldName : 필드명
//	- str : 뿌려질 메세지 ex) "회원 아이디를"
/*******************************************************************************/
function fncChkCommaNum(formName, fieldName, str){
	var f = document.forms[formName] ;
	var obj = f[fieldName] ;

	tmpStr = obj.value ;

	// 숫자와 , 체크
	for(i=0 ; i<tmpStr.length ; i++)	{
		if((permNum + ","+".").indexOf(tmpStr.charAt(i))<0){
			if(str!=null){
				alert(str + " 잘못 입력하였습니다.\r\n숫자만 입력이 가능합니다.") ;
			}
			obj.value="";
			obj.focus() ;

			return false ;
		}
	}

	// 자릿수 체크
	var tmpStrlen = tmpStr.indexOf(".");	// 소숫점 위치
	tmpStr = tmpStr.substring(0,tmpStrlen)	// 소숫점 왼쪽 정수 반환

	numbers = tmpStr.split(",") ;
	for(i=0; i<numbers.length; i++){
		if(i==0) {
			if(numbers[i].length>3){
				if(str!=null){
					alert(str + " 잘못 입력하였습니다.\r\n자릿수를 확인하세요") ;
				}
				return false ;
			}
		}
		else{
			if(numbers[i].length!=3){
				if(str!=null){
					alert(str + " 잘못 입력하였습니다.\r\n자릿수를 확인하세요") ;
				}
				return false ;
			}
		}
	}

	return true ;
}


/*******************************************************************************/
// 숫자 자리수 표시
//	- number : 자릿수 표시를 할 숫자
//	- formName 
//  - fieldName
/*******************************************************************************/
function autoComma(formName, fieldName){
	document.forms[formName][fieldName].value = fncCipher(formName,fieldName) ;
}


/*******************************************************************************/
// 공인인증 확인
//  - f  : form 객체
//  - dn : ?
/*******************************************************************************/
function chkXecure(f,dn){
	f.orderData.value = getOrderData(f) ;
	f.q.value = getSessionKey() ;
	if(setOrderSignData(dn,f)) return true ;
	else{
		window.close() ;
		if(opener!=null && opener.name==ORD_ORDER){
			opener.focus() ;
		}
		return false ;
	}
}

/*******************************************************************************/
// 날짜포맷 세팅
//  - formName  : form 명
//  - fieldName : 필드명
//  - format    : 데이타포맷("/":yyyy/MM/dd, "-":yyyy-MM-dd 등)
/*******************************************************************************/

function autoDateFormat(formName, fieldName, format){
	var f       = document.forms[formName] ;
	var obj     = f[fieldName] ;
	var date    = "" ;
	var tmpDate = obj.value ;

	// 숫자와 format만 허용
	if(!fncChkString(formName, fieldName, permNum+format)){
		if(tmpDate.length>0)
			date = tmpDate.substring(0,tmpDate.length-1) ;
		else 
			date = tmpDate ;

		obj.value = date ;
		return ;
	}

	// 숫자형태로 변환
	if(format!=null && format!="") tmpDate = fncReplace(tmpDate,format,"") ;

	// 백스페이스바, 좌우방향키를 눌렀을 때는 입력값 그대로.
	if(event.keyCode==8 || event.keyCode==37 || event.keyCode==39){
		return ;
	}

	// 포맷붙이기
	for(i=0; i<tmpDate.length; i++){
		date += tmpDate.charAt(i) ;
		if(date.length==4) date += format ;
		if(date.length==(6+format.length)) date += format ;
	}

	if(format!=null && format!="") date = date.substring(0,10) ;
	else  date = date.substring(0,8) ;
	obj.value = date;
}

/*******************************************************************************/
// 날짜 유효성 체크
//  - formName  : form 명
//  - fieldName : 필드명
//  - format    : 데이타포맷("/":yyyy/MM/dd, "-":yyyy-MM-dd 등)
/*******************************************************************************/
function fncChkDateFormat(formName, fieldName, format, str){
	var f   = document.forms[formName] ;
	var obj = f[fieldName] ;

	var year ;
	var month ;
	var day ;

	if(format!=""){
		date    = obj.value.split(format) ;

		if(date.length!=3) {
			if(str!=null){
				alert(str + " 날짜가 유효하지 않습니다.\r\nyyyy"+format+"MM"+format+"dd 형태로 입력하세요.") ;
			}
			obj.focus() ;
			return false ;
		}

		year  = date[0] ;
		month = date[1] ;
		day   = date[2] ;
	}
	else{
		date = obj.value ;
		if(date.length!=8){
			if(str!=null){
				alert(str + " 날짜가 유효하지 않습니다.\r\nyyyy"+format+"MM"+format+"dd 형태로 입력하세요.") ;
			}
			obj.focus() ;
			return false ;
		}

		year  = date.substring(0,4) ;
		month = date.substring(4,6) ;
		day   = date.substring(6,8) ;
	}

	if(eval(month)<1 || eval(month) > 12) {
		if(str!=null){
			alert(str + " 날짜가 유효하지 않습니다.\r\nyyyy"+format+"MM"+format+"dd 형태로 입력하세요.") ;
		}
		obj.focus() ;
		return false ;
	}
	else if(eval(month)<10) month = "0" + eval(month) ;
	
	days    = new Array(31,28,31,30,31,30,31,31,30,31,30,31) ;
	days[1] = (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 29 : 28 // 윤달

	if(eval(day)<1 || eval(day)>days[month-1]){
		if(str!=null){
			alert(str + " 날짜가 유효하지 않습니다.") ;
		}
		obj.focus() ;
		return false ;
	}
	else if(eval(day)<10) day = "0" + eval(day) ;

	obj.value = year + format + month + format + day ;

	return true ;
}


/*******************************************************************************/
// 필드 readOnly 세팅
//   - f         : 폼 객체
//   - fieldName : 필드명 
//   - value     : 값
/*******************************************************************************/
function setReadOnly(f, fieldName, readonly){
	var obj = f[fieldName] ;
	obj.readOnly = readonly ;

	if(readonly){
		obj.readonly = true ;
		obj.style.background  = "#F9F9F9" ;
		obj.style.borderColor = "#ACACAC" ;
	}
	else{
		obj.readonly = false ;
		obj.style.background  = "#FFFFFF" ;
		obj.style.borderTopColor    = "#1F1F1F" ;
		obj.style.borderLeftColor   = "#1F1F1F" ;
		obj.style.borderRightColor  = "#7F7F7F" ;
		obj.style.borderBottomColor = "#7F7F7F" ;
	}
}


/*******************************************************************************/
// 필드 disabled, enabled
//   - formName  : 폼명
//   - fieldName : 필드명 
//   - disable   : disabled 여부
/*******************************************************************************/
function setFieldDisable(f, fieldName, disable){
	var obj = f[fieldName] ;
	
	if(disable){
		obj.disabled = true ;
		obj.style.background  = "#DDDDDD" ;
		obj.style.borderColor = "#ACACAC" ;
	}
	else{
		obj.disabled = false ;
		obj.style.background  = "#FFFFFF" ;
		obj.style.borderTopColor    = "#1F1F1F" ;
		obj.style.borderLeftColor   = "#1F1F1F" ;
		obj.style.borderRightColor  = "#7F7F7F" ;
		obj.style.borderBottomColor = "#7F7F7F" ;
	}
}


/*******************************************************************************/
// 데이터 숫자포맷 전환
/*******************************************************************************/
function replace(szAll, szFind, szReplace) {
 	var i;
 	var length;
 	var bQuation;

 	bQuation = false;
 	length = szReplace.length - szFind.length;

 	for(i = 0; i < szAll.length; i++) {
   		if(szAll.substr(i,szFind.length) == szFind) {
     			if(i > 0) {
       				if(szFind == "\n") {
         				szAll = szAll.substr(0, i-1) + szReplace + szAll.substr(i+szFind.length,szAll.length - (i+szFind.length));
       				} else {
         				szAll = szAll.substr(0, i) + szReplace + szAll.substr(i+szFind.length,szAll.length - (i+szFind.length));
       				}
     			} else {
       				szAll = szReplace + szAll.substr(i+szFind.length,szAll.length - (i+szFind.length));
     			}
     			i = i + length;
   		}
 	}
 	return szAll;
}
/*******************************************************************************/
// 필드 disabled, enabled
//   - formName  : 폼명
//   - fieldName : 필드명 
//   - disable   : disabled 여부
/*******************************************************************************/
function disableAll(obj, except1, except2){
	for(i=0; i<obj.length; i++){ 
		if(obj[i].name!=except1&&obj[i].name!=except2){
			alert(obj[i].name);
			obj[i].name.disabled = true;
		}
	}
}
function enableAll(obj, except1, except2){
	for(i=0; i<obj.length; i++){
		if(obj[i].name!=except1&&obj[i].name!=except2){
			alert(obj[i].name);
			obj[i].name.disabled = false;
		}
	}
}

/*******************************************************************************/
// 필드 SimpleDateValue
/*******************************************************************************/
function getSimpleDateValue(dtVal){
//	ADD MODIFIED BY JJS 
	format = "/";
//	ADD MODIFIED BY JJS 
	if(dtVal.indexOf(format)!=-1){
		var yyyyTmp = dtVal.substr(0,dtVal.indexOf(format));
		var mmTmp=dtVal.substr(dtVal.indexOf(format)+1,2);
		var ddTmp = dtVal.substr(dtVal.lastIndexOf(format)+1,2);
		return (yyyyTmp+mmTmp+ddTmp);
	}
	else return (dtVal);
}


/*******************************************************************************/
// 전달 가져오기 ※이 함수를 쓰기 위해서는 반드시 /t_js/calendar.js와 같이 써야 한다.
//   - date  : 기준날짜
//   - num   : 전 달 
/*******************************************************************************/
function getPreDateByMonth(date, num){
	var dates = date.split("/") ;
	if(dates.length<3){
		alert("날짜형식이 잘못되었습니다.\r\nyyyy/MM/dd 형태로 입력하세요");
		return "";
	}

	try{
		var yy = eval(dates[0]) ;
		var mm = eval(dates[1]) ;
		var dd = eval(dates[2]) ;

		if(mm-num<=0){
			yy = yy - 1 ;
			mm = 12 + (mm-num) ;
		}
		else {
			mm = mm - num ;
		}

		newDate = new Date(yy, mm-1, 1) ;
		lastDate = getLastDay(yy,mm) ;

		if(lastDate<dd) dd = lastDate ;

		newDate = yy + "/" + (mm<10?"0"+mm:mm+"") + "/" + (dd<10?"0"+dd:dd+"");

		return newDate ;
	}
	catch(e){
		alert("날짜형식이 잘못되었습니다.\r\nyyyy/MM/dd 형태로 입력하세요");
		return "";
	}
}

/*******************************************************************************/
// 필드 isCheckPeriod
/*******************************************************************************/
function isCheckPeriod(orgVal, period){
	var isAble = false;
	var today = new Date();
	thisYear  = today.getYear()<2000 ? eval("19" + today.getYear()) : today.getYear();
	thisMonth = today.getMonth() + 1;
	thisDay   = today.getDate();

	regYear   = orgVal.substr(0,4);
	regMonth  = orgVal.substr(5,2);
	regDate   = orgVal.substr(8,2);

	gapday = thisDay-period;
	if(gapday<0) thisMonth--;
	if(thisMonth==0){
		thisYear--;
		thisMonth = 12
	}
	endDay = new Date(thisYear, thisMonth, gapday);
	regDay = new Date(regYear, regMonth-1, regDate);
	if(regDay<endDay){
		alert(orgVal+'신청일기준의 잔고증명서는 거래영업점에 \r\n내점하시어 신청하여 주시기 바랍니다.');
		return false;
	}
	else return true;
}



/*******************************************************************************/
// onLoad시 Select/Checkbox/Radiobox Default 입력로드
//	- obj           : String 폼명.대상객체
//	- chk_var       : String Default value
//	- act           : String 'selected' or 'checked'
/*******************************************************************************/
function setLoadSelect(obj, chk_var, act) {
	for(i=0; i < eval(obj+".length"); i++) {
		if (eval(obj+"["+i+"].value") == chk_var) {
			eval(obj+"["+i+"]." + act + " = true");
			break;
		}
	}

	if (!eval(obj+".length")) {
		if (eval(obj+".value") == chk_var) { eval(obj+"." + act + " = true"); }
	}
}




/*******************************************************************************/
// Selectbox selected value 추출
//	- obj           : 폼명.대상객체
/*******************************************************************************/
function getSelectboxValue(obj) {
    for (var j = 0; j < obj.length; j++) {
        if (obj[j].selected) {
            var obj_value = obj[j].value;
            break;
        } // end if
    } // end for    
    
    return obj_value;   
}


/*******************************************************************************/
// Selectbox selected text 추출
//	- obj           : 폼명.대상객체
/*******************************************************************************/
function getSelectboxText(obj) {
    for (var j = 0; j < obj.length; j++) {
        if (obj[j].selected) {
            var obj_value = obj[j].text;
            break;
        } // end if
    } // end for    
    
    return obj_value;   
}



/*******************************************************************************/
// Checkbox/Radiobox checked value 추출
//	- obj           : 폼명.대상객체
//  - prop          : 추출 속성 (default : value)
/*******************************************************************************/
function getRadioValue(obj) {
    for (var j = 0; j < obj.length; j++) {
        if (obj[j].checked) {
            var obj_value = obj[j].value;
            break;
        } // end if
    } // end for  
    
    return obj_value;   
}



/*******************************************************************************/
// HashTable 역활
//	- strMap        : "key=>value,key1=>value1" 포맷으로 구성된 String
/*******************************************************************************/
function ArrMap(strMap) {
    var mapList     = strMap.split(",");

    this.arrKey     = new Array();
    this.arrValue   = new Array();
    this.length     = mapList.length;  
        
    for (j=0; j<mapList.length; j++) {
        var map = mapList[j].split("=>");
        
        if (map.length == 1) {
            this.arrKey[j]      = map[0];
            this.arrValue[j]    = map[0];
        } else {
            this.arrKey[j]      = map[0];
            this.arrValue[j]    = map[1];
        }
    }
    
    this.getValue       = getValue;
    this.getKey         = getKey;  
    this.getKeyIdx      = getKeyIdx;  
    this.getValueIdx    = getValueIdx;  
        
    function getValue(key) {    //key에 해당하는 value 추출
        for (j=0; j<this.arrKey.length; j++) {
            if (this.arrKey[j] == key) {
                return this.arrValue[j];
            }
        }
        return false;
    }
    
    function getKey(value) {    //value에 해당하는 key 추출
        for (j=0; j<this.arrValue.length; j++) {
            if (this.arrValue[j] == value) {
                return this.arrKey[j];
            }
        }
        return false;
    }

    function getKeyIdx(key) {    //key에 해당하는 index 추출
        for (j=0; j<this.arrKey.length; j++) {
            if (this.arrKey[j] == key) {
                return j;
            }
        }
        return false;
    }    
    
    function getValueIdx(value) {    //value에 해당하는 index 추출
        for (j=0; j<this.arrValue.length; j++) {
            if (this.arrValue[j] == arrValue) {
                return j;
            }
        }
        return false;
    }    
}


/*******************************************************************************/
// 화면에 input box 삽입
//	- nm            : string input box의 name
//  - val           : string input box의 value
//  - hidyn         : string input box의 hidden 여부
//  - size          : string input box의 size 여부
// scripter name    : 이동엽
/*******************************************************************************/
function addInput(nm, val, hidyn, size) {
    var f=document.exKrx;
    var i=document.createElement("input");
    i.type= hidyn;
    i.name=nm;
    i.id = nm;
    i.value=val;
    f.insertBefore(i);
    return f;
}



function fncDateRangeChk(fr_date, to_date) {
    if (fr_date > to_date) {
        alert("검색시작일이 검색종료일 보다 이전일 수 없습니다.");
        return false;
    }
    return true;
}



/*******************************************************************************/
// 비동기식으로 BLD를 통한 콤보박스 생성
//	- comboType     : BLD 내부적으로 조회조건이 있을 시 구분
//  - objValue      : 콤보박스 name, value 값을 가진 BLD output필드명
//  - objName       : 콤보박스 option text, 표시 text 값을 가진 BLD output필드명
//  - ioSchema      : BLD 경로
//  - changeOn      : onChange시 호출 함수
//  - defaultVal    : default selected value
// scripter name    : 배성련
/*******************************************************************************/
function getCombobox(comboType,objValue,objName,ioSchema,defaultVal,firstOpt) {
	var interact = new Interaction();
	var input    = new DataSet();
		
	input.put('type', comboType);
	output = interact.execute(ioSchema,input);
	
	document.all[objValue].length = 0;
	
	var j = 0;
	// 콤보박스의 첫 옵션값이 존재할 때
	if (firstOpt) {
        document.all[objValue].options[0] = new Option(firstOpt, '');
        j++;
	}
	
    if (output.getCount(objValue) > 0) {
    	for(i = 0 ; i < output.getCount(objValue) ; i++) {
            document.all[objValue].options[j] = new Option( output.get(objName,i),output.get(objValue,i) );
    
    	    if( defaultVal == output.get(objValue,i) ) {
    	        document.all[objValue].options[j].selected = true;
    	    }
    	    j++;
    	}
    }
}



/*******************************************************************************/
// 브라우저 가운데 새창열기
//	- url         : open url
//  - name        : 윈도우 이름
//  - width       : width
//  - height      : height
//  - option      : 'scrollbars=..' 등 window.open() 함수의 옵션 문자열
/*******************************************************************************/
function windowOpen(url, name, width, height, option) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
	if (option) str += "," + option;
  }
  window.open(url, name, str);
}


/**************************************************
 * 약식 fileDownload 스크립트 - 소스 바로 밑에 있는 양식 파일 다운로드 시 사용
 *
 * - fileDown 명의 폼을 이용한 submit 처리
 * - Form Action   : 파일위치(/abk/dw_file/1-1소명서.hwp)
 * - ex) <iframe name="ifrm" width="0" height="0" scrolling="no" frameborder="0"></iframe>
         <form name="fileDown"  target="ifrm" action="/abk/dw_file/1-1소명서.hwp" method="post" >
         </form>
         생성해주고 formDown('/abk/dw_file/2-2유가증권등변동신고서.hwp') 호출함.
 **************************************************/

function formDown(val) {
    var frm = document.fileDown;
    frm.action = val;
    frm.submit();        
}


/**************************************************
 * fileDownload 스크립트
 * - fileName : fl_indx_nm, realName : 사용자가 등록한 파일명
 * - fileDown 명의 폼을 이용한 submit 처리
 * - Form Action   : /servlets/exkrx/util/Download
 **************************************************/

function fileDownload(fileName, realName, fileDir) {
    
  var frm = document.fileDown;
  
  frm.fileName.value = fileName;
  frm.realName.value = realName;
  frm.fileDir.value  = fileDir;
  frm.submit();
    
}


/**************************************************
 * 우편번호 스크립트
 *
 * - parentParm : 부모창에 hidden 태그 필요.
                  value는 콜론으로 구분 
                  ex) a,b,c,d
 * - scripter name : 이진주
 **************************************************/

function getZipCd(){
    
    
    winWidth  = "400";
    winHeight = "333";
    winLeft   = screen.width  / 2 - winWidth  / 2 ;
    winTop    = screen.height / 2 - winHeight / 2 ;

    elements  = "width="   + winWidth ;
    elements += ",height=" + winHeight ;
    elements += ",top="    + winTop ;
    elements += ",left="   + winLeft ;
        
    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.forms[0].target="popup";
    document.forms[0].action="/popup/pop_adsch.jsp";
    document.forms[0].submit();
    
    
}



/**************************************************
 * 쿠키적용
 *
 * - setCookie : 쿠키적용
 * - 현재적용FILE : index.jsp
 **************************************************/

function setCookie( name, value, expiredays ) {
  var todayDate = new Date(); 
  
  todayDate.setDate( todayDate.getDate() + expiredays ); 
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
}



/**************************************************
 * 쿠키값 가져오기
 *
 * - getCookie : 쿠키적용
 * - 현재적용FILE : index.jsp
 **************************************************/
function getCookie( name ){
    
    var nameOfCookie = name + "=";
    var x = 0;
    
    while ( x <= document.cookie.length ){
        
        var y = (x+nameOfCookie.length);
        
        if ( document.cookie.substring( x, y ) == nameOfCookie ) {
            if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
            endOfCookie = document.cookie.length; 
            return unescape( document.cookie.substring( y, endOfCookie ) ); 
        }
        
        x = document.cookie.indexOf( " ", x ) + 1; 
        if ( x == 0 )
        break;
        
    }//end while
     
    return ""; 
    
}



/*******************************************************************************/
// 문자열 앞뒤 공백 제거 
//	- str       : 대상문자열
/*******************************************************************************/
function trim(str) {
	var start, end, i;

	start = 0;
	for(i=0; i<=str.length-1; i++) {
		if(str.substr(i,1) == " ") start++;
		else break;
	}

	end = str.length-1;
	for(i=end; i>=0; i--) {
		if(str.substr(i,1) == " ") end--;
		else break;
	}

	if(end < 0) // " "일 경우에...
		return "";
	else
		return str.substring(start, end+1);
}



/**************************************************
 * 지정한 수만큼 0으로 자리 채우기
 *
 * - 예제 : zeroFile('5', 3)  return - > '00005'
 * - 필요한 파라미터 : val : 문자형 숫자, len : 표시되어야 할 자릿수
 **************************************************/

function zeroFile(val, len) {
    var rtnVal = val;
    var strLen = val.length;
    if(strLen < len) {
        strLen = len - strLen;
	    for(i = strLen ; i < len ; i++) {
	        rtnVal = '0'+rtnVal;
	    }
	}
	return rtnVal;
}



/*******************************************************************************/
// 문자열 지정된 길이만큼 자르고 말줄임 표시
//	- str       : 대상문자열
//	- len       : fix 할 문자열 길이
/*******************************************************************************/

function fixLength(str, len) {
    var cutStr = "";
    if (str.length > len) {
        cutStr = str.substring(0,len) + "..";
    
    } else {
        cutStr = str;
        
    }
    return cutStr;
}



/*******************************************************************************/
// num_only(숫자만 입력받기, -)
/*******************************************************************************/


function num_only(event){
	var evCode = (window.netscape) ? event.which : event.keyCode;

	if(!(evCode == 0  || evCode == 8 || (evCode > 47 && evCode < 58) ) ) {
		if(window.netscape) {
			event.preventDefault();
		} else {
			event.returnValue=false;
		}
	}
}


/*******************************************************************************/
// num_only(숫자만 입력받기, -)
/*******************************************************************************/

function NumObj(obj) {
    
    if(event.keyCode >=48 && event.keyCode <=57 ){
        return true;
    } else {
      event.returnValue = false;  
    }
}



//전체 체크박스
function checkAll(chk_obj){
	var totCnt = document.frm.totCnt.value;
	var allChk = document.frm.allChk.checked;
	
	if(allChk == true){
		for(var j=0; j<totCnt; j++) {	
			box = eval(chk_obj + j); 
			box.checked = true;
		}
	}else{
		for(var j=0; j<totCnt; j++) {	
			box = eval(chk_obj + j); 
			box.checked = false;
		}
	}
}



//전체 체크박스
function setCheckboxAll(frm, obj) 
{
    var oCheckbox = document.getElementsByName(obj);
	var allChk = frm.checked;
	
	
    if ( !oCheckbox ) { return; }
    
    // 체크 박스가 1개인 경우
    if ( !oCheckbox.length ) 
    {
        oCheckbox.checked = allChk;
    }
    // 체크 박스가 다수개인 경우
    else 
    {
        for( var i=0; i<oCheckbox.length; i++ ) {
            oCheckbox[i].checked = allChk;
		}
    }
}


// 엔터 시 validation Check
function enterCheck(submit_method){

    if (window.event.keyCode == 13) { 
        javascript:submit_method;
    } 
}



/////////////////////////////////////////////////////////////
// 2007.07.06 
// 김세윤 추가
// javascript String 객체 확장

/**
 * 자바스크립트의 내장 객체인 String 객체에 cut 메소드를 추가한다. cut 메소드는 스트링의 특정 영역을
 * 잘라낸다.
 * Parameters
 *  start   : 잘라낼 문자열 시작 인덱스
 *  length  : 잘라낼 길이
 * Return
 *  잘려진 문자열
 *
 * Ex
 *  var str = "abcde"
 *  str = str.cut(2, 2);
 *  // str 은 "abe" 
 */
String.prototype.cut = function(start, length) {
    return this.substring(0, start) + this.substr(start + length);
}


/**
 * 숫자에 소숫점이 있는경우 지정한 숫자의 소수점 까지 반올림하여 결과를 반환하는 함수
 *
 * Parameters 
 * Return
 *  반올림된 숫자
 *
 * Ex
 *  "10000.15791".toRound()     // -> 10000.15791
 *  "10000.15791".toRound(3)    // -> 10000.158
 */  
String.prototype.toRound  = function() {
    quotient = new String(this).substring(0, new String(this).indexOf(".") == -1 ? new String(this).length:new String(this).indexOf("."));
    radix = new String(this).substring(new String(this).indexOf(".") == -1 ? new String(this).length : new String(this).indexOf(".")  );

    if (arguments.length == 1) {
        var idx = arguments[0];
        var rst = 1;
        for (j=1; j <= idx; j++) {
            rst = rst * 10;
        }
        radix = radix * 1;
        radix = radix * rst;
        radix = Math.round(radix);
        radix = radix / rst;
        radix =  new String(radix);
        radix = radix.substring(radix.indexOf("."));
    } else {
        return this;
    }
    if (new Number(radix) == 0)
    {
        return new Number(quotient);
    } else {
        return new Number(quotient + radix);
    }
}


/**
 * 숫자에 소숫점이 있는경우 지정한 숫자의 소수점 이하 버림
 *
 * Parameters 
 * Return
 *  버림된 숫자
 *
 * Ex
 *  "10000.15791".toThrow()     // -> 10000.15791
 *  "10000.15791".toThrow(3)    // -> 10000.157
 */ 
String.prototype.toThrow  = function() {
    quotient = new String(this).substring(0, new String(this).indexOf(".") == -1 ? new String(this).length:new String(this).indexOf("."));
    radix = new String(this).substring(new String(this).indexOf(".") == -1 ? new String(this).length : new String(this).indexOf(".")  );

    if (arguments.length == 1) {
        var idx = arguments[0];
        var rst = 1;
        for (j=1; j <= idx; j++) {
            rst = rst * 10;
        }
        radix = radix * 1;
        radix = radix * rst;
        radix = Math.floor(radix);
        radix = radix / rst;
        radix =  new String(radix);
        radix = radix.substring(radix.indexOf("."));
    } else {
        return this;
    }
    if (new Number(radix) == 0)
    {
        return new Number(quotient);
    } else {
        return new Number(quotient + radix);
    }
}


/**
 * 빈공백(캐리지리턴, 탭등을 없애기 위한 trim정규식 패턴
 */
var TRIM_PATTERN = /(^\s*)|(\s*$)/g; // 내용의 값을 빈공백을 trim하기 위한것(앞/뒤)
var ALL_TRIM_PATTERN = /\s*/g;       // 모든값의 공백을 제거.
//var GLB_CALENDAR = new Object();
var GLB_GDS = "";
var GLB_ERR_COLID = "";
var GLB_ERR_ROW = -1;

/**
  * 좌우측 공백제거
*/
String.prototype.trim = function() {
    return this.replace(TRIM_PATTERN, "");
}



/**
  * 문자열 내 공백 모두 제거
  */
String.prototype.trimAll = function() {
    return this.replace(ALL_TRIM_PATTERN, "");
}

/**
  * 문자열 대체
  *
  * Parameters
  *     p_oldstr    : 기존문자열
  *     p_newstr    : 바꿀문자열
  *
  * Return
  *     바뀐문자열
  */
String.prototype.replaceStr = function(p_oldstr, p_newstr) {
    var v_regstr = p_oldstr;
    v_regstr = v_regstr.replace(/\\/g, "\\\\");
    v_regstr = v_regstr.replace(/\^/g, "\\^");
    v_regstr = v_regstr.replace(/\$/g, "\\$");
    v_regstr = v_regstr.replace(/\*/g, "\\*");
    v_regstr = v_regstr.replace(/\+/g, "\\+");
    v_regstr = v_regstr.replace(/\?/g, "\\?");
    v_regstr = v_regstr.replace(/\./g, "\\.");
    v_regstr = v_regstr.replace(/\(/g, "\\(");
    v_regstr = v_regstr.replace(/\)/g, "\\)");
    v_regstr = v_regstr.replace(/\|/g, "\\|");
    v_regstr = v_regstr.replace(/\,/g, "\\,");
    v_regstr = v_regstr.replace(/\{/g, "\\{");
    v_regstr = v_regstr.replace(/\}/g, "\\}");
    v_regstr = v_regstr.replace(/\[/g, "\\[");
    v_regstr = v_regstr.replace(/\]/g, "\\]");
    v_regstr = v_regstr.replace(/\-/g, "\\-");
    var re = new RegExp(v_regstr, "g");
    return this.replace(re, p_newstr);

}

// javascript String 객체 확장 끝
/////////////////////////////////////////////////////////////


/**
  * 대문자변환
  *
  * Parameters
  *     obj    : 오브젝트
  *
  * Return
  *     바뀐문자열
  */
function changeUpper(obj){
			var tmp = obj.value;
			obj.value = tmp.toUpperCase();

}



/*****************************************************************
  *
  * addUploadImg()
  * Image 업로드 팝업
  * 필요한 Parameters   
  *  - excute_parm   	: 업로드 후 부모스크립트 실행여부 (N:비실행,Y:실행) 
  *  - excute_script 	: 업로드 후 실행 스크립트  
  *  - upload_gubun	: 업로드 구분(insert,update,delete)
  *  - path				    : 업로드 Path
  *  - save_dir			: 업로드 Directory 
  *  - upload_method	: 업로드 방법 (Temp 저장 or Directory 바로저장)
  *  - upload_cnt		: 업로드 갯수
  *
  ****************************************************************/ 
  
function addUploadImg(addUploadImg){

	document.fileUpload.upload_name.value= addUploadImg;
	
	
	var winWidth	= "420";
	var winHeight 	= "300";
	var popUrl 		= "/common/popup/upload_image.jsp";

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var elements  = "width="   + winWidth ;
	    elements += ",height=" + winHeight ;
    	elements += ",top="    + winTop ;
	    elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=auto,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.fileUpload.target="popup";
    document.fileUpload.action=popUrl ;
    document.fileUpload.submit();
}



function thumbNailUpload(addUploadImg){

	document.thumbNail.upload_name.value= addUploadImg;
	
	var winWidth	= "410";
	var winHeight 	= "300";
	var popUrl 		= "/common/popup/upload_image.jsp";

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var elements  = "width="   + winWidth ;
	    elements += ",height=" + winHeight ;
    	elements += ",top="    + winTop ;
	    elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.thumbNail.target="popup";
    document.thumbNail.action=popUrl ;
    document.thumbNail.submit();
}


/*****************************************************************
  *
  *  addUploadFile()
  *  File 업로드 팝업
  *  필요한 Parameters   
  *  - excute_parm   	: 업로드 후 부모스크립트 실행여부 (N:비실행,Y:실행) 
  *  - excute_script 	: 업로드 후 실행 스크립트  
  *  - upload_gubun	: 업로드 구분(insert,update,delete)
  *  - path					: 업로드 Path
  *  - save_dir			: 업로드 Directory 
  *  - upload_method	: 업로드 방법 (Temp 저장 or Directory 바로저장)
  *  - upload_cnt		: 업로드 갯수
  *
  ****************************************************************/
  
function addUploadFile(){

	var winWidth	= "550";
	var winHeight 	= "260";
	var popUrl 		= "/common/popup/upload_file.jsp";

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var 	elements  = "width="   + winWidth ;
	    	elements += ",height=" + winHeight ;
    		elements += ",top="    + winTop ;
	    	elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.fileUpload.target="popup";
    document.fileUpload.action=popUrl ;
    document.fileUpload.submit();
}





/*****************************************************************
  *
  *  addUploadFileS()
  *  File 업로드 팝업
  *  필요한 Parameters   
  *  - excute_parm   	: 업로드 후 부모스크립트 실행여부 (N:비실행,Y:실행) 
  *  - excute_script 	: 업로드 후 실행 스크립트  
  *  - upload_gubun	: 업로드 구분(insert,update,delete)
  *  - path					: 업로드 Path
  *  - save_dir			: 업로드 Directory 
  *  - upload_method	: 업로드 방법 (Temp 저장 or Directory 바로저장)
  *  - upload_cnt		: 업로드 갯수
  *
  ****************************************************************/
  

function addUploadFileS(addUploadImg){

	document.fileUpload.upload_name.value= addUploadImg;
	
	
	var winWidth	= "410";
	var winHeight 	= "250";
	var popUrl 		= "/common/popup/upload_file_s.jsp";

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var elements  = "width="   + winWidth ;
	    elements += ",height=" + winHeight ;
    	elements += ",top="    + winTop ;
	    elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.fileUpload.target="popup";
    document.fileUpload.action=popUrl ;
    document.fileUpload.submit();
}


function addUploadFile1(span){

	var winWidth	= "550";
	var winHeight 	= "260";
	var popUrl 		= "/common/popup/upload_file.jsp?span="+span;

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var 	elements  = "width="   + winWidth ;
	    	elements += ",height=" + winHeight ;
    		elements += ",top="    + winTop ;
	    	elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.fileUpload.target="popup";
    document.fileUpload.action=popUrl ;
    document.fileUpload.submit();
}



/*****************************************************************
  *
  * addUploadImg()
  * Image 업로드 팝업
  * 필요한 Parameters   
  *  - excute_parm   	: 업로드 후 부모스크립트 실행여부 (N:비실행,Y:실행) 
  *  - excute_script 	: 업로드 후 실행 스크립트  
  *  - upload_gubun	: 업로드 구분(insert,update,delete)
  *  - path				    : 업로드 Path
  *  - save_dir			: 업로드 Directory 
  *  - upload_method	: 업로드 방법 (Temp 저장 or Directory 바로저장)
  *  - upload_cnt		: 업로드 갯수
  *
  ****************************************************************/ 
  
function addUploadImgWeb(addUploadImg){

	document.fileUpload.upload_name.value= addUploadImg;
	
	
	var winWidth	= "410";
	var winHeight 	= "300";
	var popUrl 		= "/common/popup/upload_image.jsp";

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var elements  = "width="   + winWidth ;
	    elements += ",height=" + winHeight ;
    	elements += ",top="    + winTop ;
	    elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.fileUpload.target="popup";
    document.fileUpload.action=popUrl ;
    document.fileUpload.submit();
}



/*****************************************************************
  *
  *  addUploadFileWeb()
  *  File 업로드 팝업
  *  필요한 Parameters   
  *  - excute_parm   	: 업로드 후 부모스크립트 실행여부 (N:비실행,Y:실행) 
  *  - excute_script 	: 업로드 후 실행 스크립트  
  *  - upload_gubun	: 업로드 구분(insert,update,delete)
  *  - path					: 업로드 Path
  *  - save_dir			: 업로드 Directory 
  *  - upload_method	: 업로드 방법 (Temp 저장 or Directory 바로저장)
  *  - upload_cnt		: 업로드 갯수
  *
  ****************************************************************/
  
function addUploadFileWeb(){

	var winWidth	= "550";
	var winHeight 	= "260";
	var popUrl 		= "/common/popup/upload_file.jsp";

    var winLeft	= screen.width  / 2 - winWidth  / 2 ;
    var winTop 	= screen.height / 2 - winHeight / 2 ;
    var 	elements  = "width="   + winWidth ;
	    	elements += ",height=" + winHeight ;
    		elements += ",top="    + winTop ;
	    	elements += ",left="   + winLeft ;
	    
    window.open('','popup','scrollbars=no,toolbar=no,location=no, status=no,menubar=no,resizable=no,'+ elements);
    
    document.fileUpload.target="popup";
    document.fileUpload.action=popUrl ;
    document.fileUpload.submit();
}

/**
* Function      : 필수입력, 수치입력등 항목을 체크한다.(Validation Check)
* @param        : fieldList     - 필드키, 필드명, 수치체크플래그 상의 리스트 객체
*                                 예) 1 - (필수입력)
*                                     var fieldList = {"FR_DT" : "조회 시작일","TO_DT" : "조회 완료일"};
*                                 
*               : formNm        - 폼명
* @return       : boolean
*/
function validationCheck(fieldList, formNm)
{
    var form = null;
    var bVailid = true;

    if ( formNm == null ) { form = document.all; }
    else { form = document.forms[formNm]; }

  for (var fieldname in fieldList) {    
      
      //=== 1. 필수입력 체크
        if ( trimmed(form[fieldname].value) == "" ) {
            bVailid = false;

            if ( fieldList[fieldname][0] ){
                alert(fieldList[fieldname][0] + " 을(를) 입력하여 주십시요.");
            }else{
                alert(fieldList[fieldname] + " 을(를) 입력하여 주십시요.");
            }
    }

        //=== 2. 수치 입력 체크
        if ( fieldList[fieldname][1] == "Y" && isNaN(form[fieldname].value) ) {
            bVailid = false;
            alert(fieldList[fieldname][0] + " 항목에 수치형 데이터를 입력하여 주십시요.");
        }


        if ( !bVailid ) { 
            form[fieldname].focus();
            if (form[fieldname].type != 'select-one') { form[fieldname].select(); }
            return false; 
        }
    }

    return true;
}





/**
* Function      : 문자열의 앞뒤 space를 제거한다.
* @param        : value
* @return       : 앞뒤의 space가 제거된 문자열
*/
function trimmed(value){
    value = value.replace(/^\s+/, "");  // remove leading white spaces
    value = value.replace(/\s+$/g, ""); // remove trailing while spaces
    return value;
}

/**
* Function      : 다음 포커스 이동(현재의 셀렉트 박스를 선택후 다음에 입력할 포커스로 이동
* @param        : 폼이름
* @param        : 현재의 셀렉트 박스 이름
* @param        : 이동할 포커스의 이름
*/
function setNextFoucs(form, sname, fname) {
	var f = document.forms[form];
	var obj1 = f[sname];
	var obj2 = f[fname];
	
	if (obj1.value != "") {
		obj2.focus();
	}
}

/**
* Function      : File 확장자
* @param        : File Name
*/
function getFileExtImg(name)
{
	var ExtSet  = "gif,jpg,jpeg,bmp,png,swf,fla,pds,ai,tif,pcx,ppj,";
		ExtSet += "mid,wav,mp3,";
		ExtSet += "asf,asx,avi,mpg,mpeg,wmv,wma,ra,ram,mov,"; 
		ExtSet += "doc,xls,ppt,hwp,hlp,eml,txt,"; 
		

	var FileNameArr = name.split('.');
	var ext = FileNameArr[FileNameArr.length - 1].toLowerCase()
	
	if (ExtSet.indexOf(ext) != -1)
	{
		return "<img src='/images/file/small/"+ext+".gif'  vspace=1 >";
	}
	else {
		return "";
	}
}


/*
 * 로그인 페이지 이동
 *
*/
function goLoginReturn(return_url){
	document.location.href="/hac.do?menu=MEMBER&id=GO_LOGIN&p_menu_seq=0000000212&t_menu_seq=0000000273&returnUrl=" + escape(return_url);
}



/*
 * 금지어 체크 
*/
function chkBadContent(objectName, msg,  isSet) {

	var badWord = document.unit.bad_content.value;
	
	if (badWord == 'null' || badWord == '')
		return true;
	var val = eval('document.'+objectName+'.value');	
	var bad = badWord.split(";");
	for (var i = 0; i < bad.length; i++) {
		
		if (bad[i].trim().length > 0 && val.indexOf(bad[i]) > -1) {
			alert(msg+'에 "'+bad[i]+'"을/를 사용할 수 없습니다!');
			if (isSet) eval('document.'+objectName+'.focus();');
			return false;
		}
	}
	return true;
}


/* 
 * 회관안내 이동
*/
function goIntroduction(id){
	document.frm.id.value = id;
	document.frm.target="_self";
	document.frm.action = "/hac.do";
	document.frm.submit();
}

function $() {
	var ret = [];
	for(var i=0; i < arguments.length; i++) {
		if (typeof arguments[i] == 'string') {
			ret[ret.length] = document.getElementById(arguments[i]);
		} else {
			ret[ret.length] = arguments[i];
		}
	}
	return ret[1]?ret:ret[0];
}


function introductionPage(theURL) {
	window.open(theURL,'','width=850,height=611');
}
/*---------------------
    첨부파일 확장자체크
----------------------*/
function checkExt2(filenm)
{
	var extArray = new Array(".jpg", ".gif", ".bmp", ".jpeg", ".png", ".swf", ".pdf", ".tif", ".doc", ".xls", ".ppt", ".hwp", ".txt", ".avi", ".mpeg", ".mpg", ".wma");

	allowSubmit = false;
	file = filenm.slice(filenm.indexOf("\\") + 1);
	ext = filenm.slice(filenm.lastIndexOf(".")).toLowerCase();

	for(var i = 0; i < extArray.length; i++)	{
		if(extArray[i] == ext)	{
			allowSubmit = true;
			document.frm.tt.value = "Y";
			break;
		}
	}
	
	if(allowSubmit == false){
		alert("확장자 확인하세요. 불가능한 확장자입니다.");
		document.frm.tt.value = "X";
	}
	return allowSubmit;
}

/*
*	인터넷 예매불가 경고
*/
function warnTicketing(){
	alert("시스템의 장애로 현재 결제가 불가합니다. \n 잠시후에 다시 시도해주세요.");
}


