	//히든 프레임
	document.write("<iframe name='submitFrame' width='0' height='0' src=''></iframe>");
	
	function passwd_search() {
		newWindow("/admin/passwd_search.jsp", "passwd", "left=100,top=100,width=260,height=200");
	}


	//주소 검색 공통 부분 시작
	var address_pos1 = -1;
	var address_pos2 = -1;


	function init(f) {
		while(1 < eval("document.all." + f + ".options.length")) {
			eval("document.all." + f + ".options[(document.all." + f + ".options.length - 1)] = null"); 
		}
	}

	function setaddr1(address) {
		for (i=1;i<Addr_arr.length;i++) {
			if (address != null) {
				if ((address == Addr_arr[i][0][0]) || (address.indexOf(Addr_arr[i][0][0]) > -1))  {
					address_pos1 = i;
				}
			}
			document.all.addr1.options[i] = new Option(Addr_arr[i][0][0], Addr_arr[i][0][0]);
			document.all.addr1.options[i].title = i;
		}

		if (address_pos1 > 0) {
			document.all.addr1.selectedIndex = address_pos1;
		}
	}

	function setaddr2(pos, address) {
		if (pos == "[object]")
		{
			pos = pos.options[pos.selectedIndex].title;
		}
		init("addr2");
		init("addr3");

		if (pos == "" || pos < 0) { return;}

		address_pos1 = pos;
		address_pos2 = -1;
		for (i=1;i<Addr_arr[address_pos1].length;i++) {
			if (address != null && address != "") {
				if ((address == Addr_arr[address_pos1][i][0]) || (address.indexOf(Addr_arr[address_pos1][i][0]) > -1))  {
					address_pos2 = i;
				}
			}
			document.all.addr2.options[i] = new Option(Addr_arr[address_pos1][i][0], Addr_arr[address_pos1][i][0]);
			document.all.addr2.options[i].title = i;
		}

		if (address_pos2 > 0) {
			document.all.addr2.selectedIndex = address_pos2;
		}
	}

	function setaddr3(pos, address) {
		if (pos == "[object]")
		{
			pos = pos.options[pos.selectedIndex].title;
		}


		var loc = -1;
		init("addr3");

		if (pos == "" || pos < 0) { return;}

		address_pos2 = pos;
		for (i=1;i<Addr_arr[address_pos1][address_pos2].length;i++) {
			if (address != null && address != "") {
				if ((address == Addr_arr[address_pos1][address_pos2][i]) || (address.indexOf(Addr_arr[address_pos1][address_pos2][i]) > -1)) {
					loc = i;
				}
			}
			document.all.addr3.options[i] = new Option(Addr_arr[address_pos1][address_pos2][i], Addr_arr[address_pos1][address_pos2][i]);
			document.all.addr3.options[i].title = i;
		}

		if (loc > 0) {
			document.all.addr3.selectedIndex = loc;
		}
	}
	//주소 검색 공통 부분 끝


// JavaScript Document
	// 폼입력 체크
	//Form_ch(this,'이름은','kor','4,8') --> 한글만 입력 가능하며, 2~4자리 이내에서 등록 가능
	function Form_ch(frm, strArg, check_type, check_length, set_yn)
	{
		var i;
		var t = frm.value;

//		if (t.length){
		
			//id체크 함수 (영문,숫자,-,_)만 입력 가능
			if (check_type == 'id'){
				for ( nindex = 0; nindex < t.length; nindex++) {
					str2 = t.charAt(nindex);
								
					if (!(str2 >= 'a' && str2 <= 'z') && !(str2 >= 'A' && str2 <= 'Z') && !(str2 >= '0' && str2 <= '9') && str2 != '-' && str2 != '_'){
						alert(strArg + ' 영문, 숫자, "-", "_" 만 사용 가능 합니다.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			//한글만 입력가능
			}else if (check_type == 'kor'){
				for ( nindex = 0; nindex < t.length; nindex++) {
					str2 = t.charAt(nindex);					
								
					if (!( str2 >= 'ㄱ' && str2 <= '힣' )){
						alert(strArg + ' 한글로만 입력해 주세요.');
						frm.focus();
						frm.select();
						return true;
					}
						
					kor_err_ch ='ㅛㅕㅑㅐㅔㅗㅓㅏㅣㅠㅜㅡㅒㅖㅂㅈㄷㄱㅇㅅㅁㄴㄹㅋㅎㅌㅊㅍㅃㅉㄸㄲㅆ';
					if(kor_err_ch.indexOf(str2)>-1) {
						alert(strArg + ' 한글을 정확히 입력해 주세요.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			//한글만 입력 불가
			}else if (check_type == 'nkor'){
				for ( nindex = 0; nindex < t.length; nindex++) {
					str2 = t.charAt(nindex);
					if (( str2 >= 'ㄱ' && str2 <= '힣' )){
						alert(strArg + ' 한글은 입력할수 없습니다.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			// 영문만 입력 가능
			}else if (check_type == 'eng'){
				num = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
				for (i=0; i<t.length; i++){
					if(num.indexOf(t.charAt(i))<0) {
						alert(strArg + ' 영문만 입력해 주세요.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			//전화번호 입력 가능		
			}else if (check_type == 'phone'){
				num = '1234567890-';
				for (i=0; i<t.length; i++){
					if(num.indexOf(t.charAt(i))<0) {
						alert(strArg + ' 숫자만 입력해 주세요.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			//숫자만 입력 가능		
			}else if (check_type == 'num'){
				num = '1234567890';
				for (i=0; i<t.length; i++){
					if(num.indexOf(t.charAt(i))<0) {
						alert(strArg + ' 숫자만 입력해 주세요.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			//공백입력 제한		
			}else if (check_type == 'space'){
				num = ' ';
				for (i=0; i<t.length; i++){
					if(num.indexOf(t.charAt(i))>=0) {
						alert(strArg + ' 공백을 입력할수 없습니다.');
						frm.focus();
						frm.select();
						return true;
					}
				}
			}

			if(check_length.length > 1) {
				if (set_yn == null || set_yn == "")
				{
					return length_check(frm, strArg, check_type, check_length);
				}
				else {
					if (t != "" ){
						return length_check(frm, strArg, check_type, check_length);
					} 
					else {
						return false;
					}
				}

			}
			else {
				var m_length = frm.getAttribute("maxlength");

				if (m_length != "2147483647")
				{
					if (set_yn == null || set_yn == "")
					{
						return length_check(frm, strArg, check_type, "1,"+m_length);
					}
					else {
						if (t != "" ){
							return length_check(frm, strArg, check_type, "1,"+m_length);
						} 
						else {
							return false;
						}
					}
				}
				else {
					return false;
				}
				return true;
			}
//		}
		return false;
	}

	function length_check(frm, strArg, check_type, check_length) {
		//자리수 체크
		var t = frm.value;
		var gr_length;
		var lmin;
		var lmax;
		gr_length = check_length.split(",")
		lmin = gr_length[0]
		lmax = gr_length[1]

		if (getlength(t) < parseInt(lmin) || getlength(t) > parseInt(lmax)) {

			if (check_type == 'kor'){
				if (lmin == lmax)
				{
					alert(strArg + ' 한글 ' + parseInt(lmax / 2) + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' 한글 ' + parseInt(lmax / 2) + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' 한글 ' + parseInt(lmin / 2) + ' ~ ' + parseInt(lmax / 2) + '자 이내로 입력해 주세요.');
				}
			}else if (check_type == 'nkor'){
				if (lmin == lmax)
				{
					alert(strArg + ' ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			}else if (check_type == 'eng'){
				if (lmin == lmax)
				{
					alert(strArg + ' ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			}else if (check_type == 'phone'){
				if (lmin == lmax)
				{
					alert(strArg + ' ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			}else if (check_type == 'num'){
				if (lmin == lmax)
				{
					alert(strArg + ' ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			}else if (check_type == 'id'){
				if (lmin == lmax)
				{
					alert(strArg + ' ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			}else if (check_type == 'space'){
				if (lmin == lmax)
				{
					alert(strArg + ' ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			} else {
				if (lmin == lmax)
				{
					alert(strArg + ' 한글 ' + parseInt(lmax / 2) + '자, 영문 ' + lmax + '자로 입력해 주세요.');
				}
				else if(lmin < 3) {
					alert(strArg + ' 한글 ' + parseInt(lmax / 2) + '자, 영문 ' + lmax + '자 이내로 입력해 주세요.');
				}
				else {
					alert(strArg + ' 한글 ' + parseInt(lmin / 2) + ' ~ ' + parseInt(lmax / 2) + '자, 영문 ' + lmin + ' ~ ' + lmax + '자 이내로 입력해 주세요.');
				}
			}
			frm.focus();
			frm.select();
			return true;
		}
		return false;
	}
		
	//한글은  한 글자당 length를 2로 처리 
	function getlength(string)
	{
		var ch;
		var length = 0;
		
		for ( k = 0; k < string.length; k++ )
		{
			ch = string.charAt(k);
			if ( ch >= 'ㄱ' && ch <= '힣' )
			{
				length += 2;
			}
			else if ( ch.charCodeAt(k) > 128)  //문자를 받아 아스키  코드 값으로 반환 
			{
				length += 2;
			}
			else
				length++;
		}
		return length;
	}
	
	//사업자등록번호 체크
	function OffNum_ch(OfficeNum1,OfficeNum2,OfficeNum3)
	{
		//tmpStr = input.value;
		tmpStr = OfficeNum1.value + OfficeNum2.value + OfficeNum3.value;
		tmpSum = new Number(0);
		tmpMod = new Number(0);
		resValue = new Number(0);
		var intOffNo = new Array(0,0,0,0,0,0,0,0,0,0);
		var strChkNum = new Array(1,3,7,1,3,7,1,3,5);
				
		for(i = 0 ; i < 10 ; i ++){
			intOffNo[i] = new Number(tmpStr.substring(i, i+1));
		}
				
		for(i = 0 ; i < 9 ; i ++){
			tmpSum = tmpSum + (intOffNo[i]*strChkNum[i]);
		}
				
		tmpSum = tmpSum + ((intOffNo[8]*5)/10);
				
		tmpMod = parseInt(tmpSum%10, 10);
				
		if(tmpMod == 0){
			resValue = 0;
		}
		else
		{
			resValue = 10 - tmpMod;
		}
						
		if(resValue == intOffNo[9]){
			return false;
		}
		else
		{
			alert('유효한 사업자등록번호가 아닙니다\n\n다시한번 확인 후, 시도하여 주시기 바랍니다');
			OfficeNum1.focus();
			return true;
		}
	}
	
	//주민등록번호 체크
	function Jumin_ch(ju1,ju2)
	{
		juid = new Array(13);
		for(var i=0;i < 6;i++) juid[i]=ju1.value.substr(i,1);
		for(var i=0;i < 7;i++) juid[i+6]=ju2.value.substr(i,1);
		for(var sum=0,i=0;i<12;i++) sum+=juid[i]*((i>7)?(i-6):(i+2));
		var mod=11-sum%11;
		if(mod>=10) mod-=10;
		if(mod!=juid[12]) {
			alert('주민등록번호가 정확한지\n\n다시한번 확인 후, 시도하여 주시기 바랍니다');
			ju1.focus();
			return true;
		}
	}
	
	//이메일 체크 함수
	function email_ch(frm)
	{
	//한글입력안되게 체크
		if(!Form_ch(frm,'이메일에는','nkor','')){
			if (frm.value.length){
				var t = frm.value
				var ValidFlag = true
				var atCount = 0
				var SpecialFlag
				var atLoop
				var atChr
				var BadFlag
				var tAry1
				var UserName
				var DomainName
				if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
						atCount = 0
						SpecialFlag = true
						for( atLoop=0; atLoop<=t.length - 1; atLoop++ ) {

								atChr = t.substring( atLoop, atLoop+1 ).charCodeAt(0);
								//alert(escape(atChr));	
								//if ( atChr == "a") alert("일치 합니다.");							
								if ( atChr == "@" ) atCount = atCount + 1
								if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = false 								
								if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = false 
								if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = false 
								if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = false 
								//alert(SpecialFlag);
						}
						
						if ( ( atCount == 1 ) && (SpecialFlag == true ) ) {
								BadFlag = true
								tAry1 = t.split("@")
								UserName = tAry1[0]
								DomainName = tAry1[1]
								if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = false
								if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = false
								if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." )
		
								BadFlag = false
								ValidFlag = false
						}
				}
				if ( BadFlag == false ) ValidFlag = true
				
				if (ValidFlag == false) {
					return false;
				}
				else {
					alert('올바른 이메일을 입력해 주세요.')
					frm.focus();
					frm.select();
					return false;
				}
			}
		} 	
	}

	//이메일 체크 함수
	function email_chk2(t)
	{
		var ValidFlag = true
		var atCount = 0
		var SpecialFlag
		var atLoop
		var atChr
		var BadFlag
		var tAry1
		var UserName
		var DomainName
		if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
				atCount = 0
				SpecialFlag = true
				for( atLoop=0; atLoop<=t.length-1; atLoop++ ) {
						atChr = t.substring( atLoop, atLoop+1 ).charCodeAt(0);
						if ( atChr == 64 ) atCount = atCount + 1
						if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = false 
						if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = false 
						if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = false 
						if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = false 
				}
				if ( ( atCount == 1 ) && (SpecialFlag == true ) ) {
						BadFlag = true
						tAry1 = t.split("@")
						UserName = tAry1[0]
						DomainName = tAry1[1]
						if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = false
						if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = false
						if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." )

						BadFlag = false
						ValidFlag = false
				}
		}
		if ( BadFlag == false ) ValidFlag = true
		
		if (ValidFlag == false) {
			return false;
		}
		else {
			alert('올바른 이메일을 입력해 주세요.')
			this.frm1.email.focus();
			return true;
		}
	}

	// 새창뛰우는 함수(경로, 창이름, 창옵션)//팝업
	function newWindow(url, target, option) {
		//option = "left=150, top=150, " + option;
		var winfocus = window.open(url, target, option);
		if (winfocus!=null) {
			winfocus.focus();
		}
		//return winfocus;
	}

	function newWindow8(dir, data, target, option) {

		var href= dir+uriEncode(data);

		var winfocus = window.open(href, target, option);
		if (winfocus!=null) {
			winfocus.focus();
		}
		//return winfocus;
	}

	function popWin(url, target, option) {
		var winfocus = window.open(url, target, option);
		if (winfocus!=null) {
			winfocus.focus();
		}
		//return winfocus;
	}
	
	//업로드 이미지 미리 보기
	//ImgPreview(대상 이미지 태그 이름)
	function ImgPreview(target_img) {
		if(event.srcElement.value != ""){
			if(event.srcElement.value.match(/(.jpg|.jpeg|.gif|.png|.JPG|.JPEG|.GIF|.PNG)/)){
				document.images[target_img].src = event.srcElement.value;
			} else {
				document.images[target_img].src = '/images/icon_noimg.gif';
				alert("업로드할 이미지는 \n\njpg, jpeg, gif, png 파일만 가능 합니다.");
			}
		} else {
			document.images[target_img].src = '/images/icon_noimg.gif';
		}
	}

	//업로드 이미지 미리 보기
	//ImgPreview()
	function ImgPreview2() {
		if(event.srcElement.value != ""){
			if(event.srcElement.value.match(/(.jpg|.jpeg|.gif|.png|.JPG|.JPEG|.GIF|.PNG)/)){
				eval("document.all.auto_img[" + (parseInt(event.srcElement.parentElement.children[0].name.replace("imagefile", "")) - 1) + "].src = event.srcElement.value");
			} else {
				eval("document.all.auto_img[" + (parseInt(event.srcElement.parentElement.children[0].name.replace("imagefile", "")) - 1) + "].src = '/images/icon_noimg.gif'");
				alert("업로드할 이미지는 \n\njpg, jpeg, gif, png 파일만 가능 합니다.");
			}
		} else {
			eval("document.all.auto_img[" + (parseInt(event.srcElement.parentElement.children[0].name.replace("imagefile", "")) - 1) + "].src = '/images/icon_noimg.gif'");
		}
	}

	// selectbox에서 값 선택했는지 체크하는 함수
	// selectbox_check(객체, 메세지) 
	function selectbox_check(controlId, msg) {
		if(controlId.options[controlId.selectedIndex].value == "") {
			alert(msg + " 선택해 주세요.");
			controlId.focus();
			return true;
		}
		return false;
	}

	// 유료옵션 라디오 버튼 체크 여부 함수
	// checkbox_check(폼이름, 라디오버튼 이름)
	function checkbox_check(formname, controlId, check_cnt) {
		var el_collection = eval("document.forms." + formname + "." + controlId);
		if (check_cnt == null)
		{
			var cnt = -1;

			if (el_collection != null) {
				if(el_collection.length){
					for (c=0;c<el_collection.length;c++) {
						if (el_collection[c].checked == true) {
							cnt = c;
						}
					}
				}
				else{
					if (el_collection.checked == true) {
						cnt = 0;
					}
				}
			}
			return cnt;
		}
		else {
			if (el_collection != null) {
				if(el_collection.length){
					alert("옵션을 선택해 주세요.");
					el_collection[0].focus();
					return;
				}
				else {
					alert("옵션을 선택해 주세요.");
					el_collection.focus();
					return;
				}
			}
		}
	}
	
	// 라디오 버튼 체크 여부 함수
	// checkbox_check2(폼이름, 라디오버튼 이름, msg)
	function checkbox_check2(formname, controlId, msg) {
		var el_collection = eval("document.forms." + formname + "." + controlId);
		var cnt = -1;

		if (el_collection != null) {
			if(el_collection.length){
				for (c=0;c<el_collection.length;c++) {
					if (el_collection[c].checked == true) {
						cnt = c;
					}
				}
			}
			else{
				if (el_collection.checked == true) {
					cnt = 0;
				}
			}
		}
		if (msg != null)
		{
			if (cnt == -1) {
				alert(msg + " 선택해 주세요.");
				el_collection[0].focus();
				return true;
			} 
		}

		return false;
	}

	// 체크박스 체크 수 리턴 함수
	// checkbox_count(폼이름, 컨트롤이름)
	function checkbox_count(formname, controlId) {
		var el_collection = eval("document.forms." + formname + "." + controlId);

		var cnt = 0;

		if (el_collection != null) {
			if(el_collection.length){
				for (c=0;c<el_collection.length;c++) {
					if (el_collection[c].checked == true) {
						cnt++;
					}
				}
			}
			else{
				if (el_collection.checked == true) {
					cnt = 1;
				}
			}
		}
		return cnt;
	}

	// 파일 수정 함수
	function fileview(obj)
	{
		if (eval("document.all." + obj + "edit.style.display == ''"))
		{
			eval("document.all." + obj + ".disabled = false");

			eval("document.all." + obj + "edit.style.display ='none'");
			eval("document.all." + obj + "cancel.style.display =''");
		}
		else
		{
			eval("document.all." + obj + ".disabled = true");

			eval("document.all." + obj + "edit.style.display =''");
			eval("document.all." + obj + "cancel.style.display ='none'");
		}	
	}
	function fileview2(obj)
	{
		if (eval("document.all." + obj + "edit.style.display == ''"))
		{
			eval("document.all." + obj + ".disabled = false");

			eval("document.all." + obj + "edit.style.display ='none'");
			eval("document.all." + obj + "cancel.style.display =''");
		}
		else
		{
			eval("document.all." + obj + ".disabled = true");

			eval("document.all." + obj + "edit.style.display =''");
			eval("document.all." + obj + "cancel.style.display ='none'");
		}	
	}
	function fileview3(obj)
	{
		if (eval("document.all." + obj + "edit.style.display == ''"))
		{
			eval("document.all." + obj + ".disabled = false");

			eval("document.all." + obj + "edit.style.display ='none'");
			eval("document.all." + obj + "cancel.style.display =''");
		}
		else
		{
			eval("document.all." + obj + ".disabled = true");

			eval("document.all." + obj + "edit.style.display =''");
			eval("document.all." + obj + "cancel.style.display ='none'");
		}	
	}
	function layerview(obj)
	{
		if (eval("document.all." + obj + "on.style.display == ''"))
		{
			eval("document.all." + obj + "on.disabled = true");

			eval("document.all." + obj + "on.style.display ='none'");
			eval("document.all." + obj + "off.style.display =''");
		}
		else
		{
			eval("document.all." + obj + "off.disabled = false");

			eval("document.all." + obj + "on.style.display =''");
			eval("document.all." + obj + "off.style.display ='none'");
		}	
	}

	// 우편번호 검색 함수
	function zip_search() {
		newWindow("/common/zip_search_form.asp", "zip_search", "left=100,top=100,width=450,height=230,scrollbars=yes");
	}

	// 문자열 체크 함수
	function OnkeyCnt(obj)
	{
		var form = document.frm1;
		var len = 0;
		var str;
		var count = 0;
		var temp;
		var txt;

		str = new String(obj.value);
		len = str.length;

			for (k=0 ; k<len ; k++){
				temp = str.charAt(k);
				if (escape(temp).length > 4) {
					count += 2;
				}
				else if (temp == '\r' && str.charAt(k+1) == '\n') { // \r\n일 경우
					count += 2;
				}
				else if (temp != '\n') {
					count++;
				}

				if (count > 500){
					obj.blur();
					obj.focus();
					alert("500Byte 이내로 입력하세요.");
					txt = str.substring( 0, k );
					obj.value = txt;
					form.bytes.value = 500;
					return false;
				}

			}

		form.bytes.value = count;
	}

	// 문자열 체크 함수
	function OnkeyCnt100(obj)
	{
		var form = document.frm1;
		var len = 0;
		var str;
		var count = 0;
		var temp;
		var txt;

		str = new String(obj.value);
		len = str.length;

			for (k=0 ; k<len ; k++){
				temp = str.charAt(k);
				if (escape(temp).length > 4) {
					count += 2;
				}
				else if (temp == '\r' && str.charAt(k+1) == '\n') { // \r\n일 경우
					count += 2;
				}
				else if (temp != '\n') {
					count++;
				}

				if (count > 100){
					obj.blur();
					obj.focus();
					alert("100Byte 이내로 입력하세요.");
					txt = str.substring( 0, k );
					obj.value = txt;
					form.bytes.value = 100;
					return false;
				}

			}

		form.bytes.value = count;
	}

	// 문자열 체크 함수
	function OnkeyCnt120(obj)
	{
		var form = document.frm1;
		var len = 0;
		var str;
		var count = 0;
		var temp;
		var txt;

		str = new String(obj.value);
		len = str.length;

			for (k=0 ; k<len ; k++){
				temp = str.charAt(k);
				if (escape(temp).length > 4) {
					count += 2;
				}
				else if (temp == '\r' && str.charAt(k+1) == '\n') { // \r\n일 경우
					count += 2;
				}
				else if (temp != '\n') {
					count++;
				}

				if (count > 240){
					obj.blur();
					obj.focus();
					alert("240Byte 이내로 입력하세요.");
					txt = str.substring( 0, k );
					obj.value = txt;
					form.bytes.value = 240;
					return false;
				}

			}

		form.bytes.value = count;
	}



	// 프린터 자바스크립트 함수 시작
	function printFrame(frame, onfinish) {
		frame.printbody.innerHTML = document.all.printbody.innerHTML;
		frame.focus();
		frame.print();
	}
	// 프린터 자바스크립트 함수 끝

	function convertAmt(obj){
		amt = obj.value;

		if (isNaN(amt)) {
			alert("숫자만 입력해 주세요.");
			obj.select();
			return;
		}

		arrayUnit = new Array("", "만", "억", "조");

		posi = amt.length%4; //자리수
		len = (amt.length/4).toString();

		if(len.indexOf(".")>0){
			unit = len.substring(0, len.indexOf(".")); //단위(0:일단위, 1:만단위...)
		}else{
			unit = amt.length/4-1;
		}

		var korAmt = "";
		op=0;
		check_flag = 0;
		for(i=0; i<amt.length; i++){
			if(posi==0){
				posi = 4;
				check_flag = 0
			}
			num = parseInt(amt.substring(i, i+1))
			if(num!=0){
				korAmt += num;
				//korAmt += arrayPosi[posi-1];
				op=1;
				check_flag = 0
			}
			else {
				check_flag++;
				if(op==1){
					for (kk=0;kk<check_flag;kk++)
					{
						korAmt += '0';
					}

					check_flag = 0;
				}
			}
			if(posi==1){
				if(op==1){
					for (kk=0;kk<check_flag;kk++)
					{
						korAmt += '0';
					}

					check_flag = 0;

					korAmt += arrayUnit[unit];
				}
				unit--;
				op=0;
			}
			posi--;
		}

		if (korAmt.length==0 || korAmt.length==null || amt.length>10){
			eval("document.frm1." + obj.name + "999.value = ''");
		} else {
			eval("document.frm1." + obj.name + "999.value = '("+korAmt+"원)'");
		}
	}


	//탭키 자동이동
	var isNN = (navigator.appName.indexOf("Netscape")!=-1);
	
	function Next_tab(input,len, e) {
		var keyCode = (isNN) ? e.which : e.keyCode; 
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];

		if(input.value.length >= len && !containsElement(filter,keyCode)) {
			input.value = input.value.slice(0, len);
			input.form[(getIndex(input)+1) % input.form.length].focus();
		}

		function containsElement(arr, ele) {
			var found = false, index = 0;
			
			while(!found && index < arr.length)
				if(arr[index] == ele)
					found = true;
				else
					index++;
				return found;
		}

		function getIndex(input) {
			var index = -1, i = 0, found = false;
		
			while (i < input.form.length && index == -1)
				if (input.form[i] == input)index = i;
				else i++;

			return index;
		}

		return true;
	}

	//게시판 이미지관련 추가
	function detailView(thi){			
		img_thm= new Image(); 
		img_thm.src=(thi);
	
		if((img_thm.width < 600) && (img_thm.height < 480)) 
		{
			img_thm.width = img_thm.width;
			img_thm.height = img_thm.height;
		}
		else
		{
			if( (img_thm.width * 480) > (img_thm.height * 600) )
			{
				img_thm.height = img_thm.height * (600 / img_thm.width); 
				img_thm.width = 600;
			}
			else
			{
				img_thm.width = img_thm.width * (480 / img_thm.height);
				img_thm.height = 480;
			}
		}
		document.thumimage.width = img_thm.width;
		document.thumimage.height = img_thm.height;		
	}

	function detailView2(thi){			
		img_thm2= new Image(); 
		img_thm2.src=(thi);
	
		if((img_thm2.width < 600) && (img_thm2.height < 480)) 
		{
			img_thm2.width = img_thm2.width;
			img_thm2.height = img_thm2.height;
		}
		else
		{
			if( (img_thm2.width * 480) > (img_thm2.height * 600) )
			{
				img_thm2.height = img_thm2.height * (600 / img_thm2.width); 
				img_thm2.width = 600;
			}
			else
			{
				img_thm2.width = img_thm2.width * (480 / img_thm2.height);
				img_thm2.height = 480;
			}
		}
		document.thumimage2.width = img_thm2.width;
		document.thumimage2.height = img_thm2.height;		
	}

	function detailView3(thi){			
		img_thm3= new Image(); 
		img_thm3.src=(thi);
	
		if((img_thm3.width < 600) && (img_thm3.height < 480)) 
		{
			img_thm3.width = img_thm3.width;
			img_thm3.height = img_thm3.height;
		}
		else
		{
			if( (img_thm3.width * 480) > (img_thm3.height * 600) )
			{
				img_thm3.height = img_thm3.height * (600 / img_thm3.width); 
				img_thm3.width = 600;
			}
			else
			{
				img_thm3.width = img_thm3.width * (480 / img_thm3.height);
				img_thm3.height = 480;
			}
		}
		document.thumimage3.width = img_thm3.width;
		document.thumimage3.height = img_thm3.height;		
	}

	function relicView(thi){			
		img_thm= new Image(); 
		img_thm.src=(thi);
	
		if((img_thm.width < 300) && (img_thm.height < 300)) 
		{
			img_thm.width = img_thm.width;
			img_thm.height = img_thm.height;
		}
		else
		{
			if( (img_thm.width * 300) > (img_thm.height * 300) )
			{
				img_thm.height = img_thm.height * (300 / img_thm.width); 
				img_thm.width = 300;
			}
			else
			{
				img_thm.width = img_thm.width * (300 / img_thm.height);
				img_thm.height = 300;
			}
		}
		document.thumimage.width = img_thm.width;
		document.thumimage.height = img_thm.height;		
	}
	
	function Zip_Find(file)
	{
	 file = file;
	 nwin = window.open(file, "Find_Zip", "scrollbars=yes,status=no,width=500,height=300");
	 winopen = nwin.document.write
	 nwin.moveTo(100,50)
	}
	
	//특수문자입력기 팝업띄우기
	function openime(url,formName) {
		var str = escape(eval("document."+ formName + ".qry.value"));
		var wnd = window.open(url+str , formName, 'toolbar=no, width=560, height=480');
		wnd.focus(); 
	} 
	
	//특수문자입력기 팝업에서 부모창의 검색폼으로 특수문자 넣기
    function setsearchkey(str){ 
    	 eval("document.formS.qry").value = str;
    }   
    
    //인기검색어
    function pWord(str)
	{
		eval("document.formS.qry").value = str;
	}
		
	
	// 화면 확대 축소 시작 IE 전용
	 var nowZoom = 100; // 현재비율
	 var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
	 var minZoom = 80; // 최소비율
	
	
	
	 //화면 확대
	 function zoomIn() {
	  if (nowZoom < maxZoom) {
	   nowZoom += 10; //25%씩 커진다.
	  } else {
	   return;
	  }
	
	  document.body.style.zoom = nowZoom + "%";
	 }
	
	
	 //화면 축소
	 function zoomOut() {
	  if (nowZoom > minZoom) {
	   nowZoom -= 10; //25%씩 작아진다.
	  } else {
	   return;
	  }
	
	  document.body.style.zoom = nowZoom + "%";
	 }
	 
	 function cookieVal(cookieName) {
	    thisCookie = document.cookie.split("; ")
			for (i = 0; i < thisCookie.length; i++) {
			if (cookieName == thisCookie[i].split("=")[0]) {
					return thisCookie[i].split("=")[1];
			   }
			}
	    return 0;
	}


	// URL Encoding goPage
	
	function uriEncode(data) 
	{
	    if(data != "") 
	    {
	        var encdata = '';
	        var datas = data.split('&');
	        
	        for(i=1;i<datas.length;i++) 
	        {
	            var dataq = datas[i].split('=');
	            encdata += '&'+encodeURIComponent(dataq[0])+'='+encodeURIComponent(dataq[1]);
	        }
	    } 
	    else 
	    {
	        encdata = "";
	    }
	    
	    return encdata;
	} 
	function goPage(dir,data)
	{
		//data += "&ssot=";
		location.href= dir+uriEncode(data);
	}
	
	function goPageParent(dir,data)
	{
		data += "&ssot=";
		parent.location.href= dir+uriEncode(data);
	}

//검색콤보박스 페이지 이동
	function openData(i,srchTab)
	{
		var strURL;
	
		if(!(document.all.item("s"+i).options[document.all.item("s"+i).selectedIndex].value=="")){
	
			strURL = '';
			strURL += 'searchOldBookBookBiblio.jsp?srchTab='+srchTab;
			strURL += '&DataID=' + document.all.item('s'+i).options[document.all.item('s'+i).selectedIndex].value;
			strURL += '&DataName='+ encodeURIComponent(document.all.item('s'+i).options[document.all.item('s'+i).selectedIndex].text);
			
						
			location.href = strURL;
		}
	}

// 새창뛰우는 함수(경로, 창이름, 창옵션)//팝업//Uni적용
	function uniPop(url,p, target, option) {
		popUrl = url + encodeURIComponent(p);
		option = "left=150, top=150, " + option;
		var winfocus = window.open(popUrl, target, option);
		if (winfocus!=null) {
			winfocus.focus();
		}
		//return winfocus;
	}	
	
//프린트
  var win=null;
  function printIt(printThis)  
  {
    win = window.open();
    self.focus();
    win.document.open();
    win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
    win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
    win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
    win.document.write(printThis);
    win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
    win.document.close();
    win.print();
    win.close();
  }	
  
  function doPrint(frame) {
	window.print();
}

//글자 확대축소
var fSize = 13;

function scaleFont(k,n)
{
	fSize = fSize + n;
	for(i=0; i<k; i++)
	{
		document.all.zName[i].style.fontSize  = fSize + "px";
	}
}	

function vFont(k,n)
{
	fSize = fSize + n;
	document.all.vert_fm.style.fontSize  = fSize + "px";
}

function hFont(k,n)
{
	fSize = fSize + n;
	document.all.horz_fm.style.fontSize  = fSize + "px";
}

var nowFont = 100; // 현재비율
var maxFont = 200; // 최대비율(500으로하면 5배 커진다)
var minFont = 80; // 최소비율
 
function fontZIn() {
	 if (nowFont < maxFont) 
	 {
	 	nowFont += 10; //25%씩 커진다.
	 } 
	 else
	 {
	 	return;
	 }
	 document.all.horz_fm_txt.style.zoom = nowFont + "%";
	 document.all.vert_fm_txt.style.zoom = nowFont + "%";
}
function fontZOut() {
	 if (nowFont > minFont) 
	 {
	 	nowFont -= 10; //25%씩 커진다.
	 } 
	 else
	 {
	 	return;
	 }
	 document.all.horz_fm_txt.style.zoom = nowFont + "%";
	 document.all.vert_fm_txt.style.zoom = nowFont + "%";
}

function fontZIn2() {
	 if (nowFont < maxFont) 
	 {
	 	nowFont += 10; //25%씩 커진다.
	 } 
	 else
	 {
	 	return;
	 }
	 document.all.horz_fm_txt.style.zoom = nowFont + "%";
}
function fontZOut2() {
	 if (nowFont > minFont) 
	 {
	 	nowFont -= 10; //25%씩 커진다.
	 } 
	 else
	 {
	 	return;
	 }
	 document.all.horz_fm_txt.style.zoom = nowFont + "%";
}

//계정 체크

function MainCheck(Frm) 
{
	if (Frm.check.checked == true)
		CheckT(Frm);
	else
		CheckF(Frm);
}

function MainCheck2(Frm) 
{
	if (Frm.check.checked == false)
		CheckF(Frm);
	else
		CheckT(Frm);
}

function CheckT(Frm) {
	for (i = 0; i < Frm.authority.length; i++) {
		Frm.authority[i].checked = true; 
	}
}

function CheckF(Frm) {
	for (i = 0; i < Frm.authority.length; i++) {
		Frm.authority[i].checked = false;
	}
}

//유물등록
if (document.all) {
  layerview='document.all'
  styleview='.style.'
} else if (document.layers) {
  layerview='document.layers'
  styleview='.'
} 
function show(p){
  eval(layerview+'.'+p+styleview+'display=""');
}
function hide(p){
  eval(layerview+'.'+p+styleview+'display="none"');
}

//통합검색창
function send2_1(){
	/*
	if(document.search_fm1.v_keyword.value==""){

		alert("검색어를 넣어주세요!");
		
		document.search_fm1.v_keyword.focus();
		return false;
	}
	*/
	document.search_fm1.action="/search/searchList.jsp?page=1&amp;search_sect=total";
	//document.search_fm.submit();
}

function send2_2(){
	document.search_fm.action="/search/searchList.jsp?page=1&amp;search_sect=total";
}

//결과내 재검색
/*
function send2_1_Re(){
	if(document.reSearch_fm.re_keyword.value==""){

		alert("검색어를 넣어주세요!");
		
		document.reSearch_fm.re_keyword.focus();
		return;
	}

	document.reSearch_fm.submit();
}
*/
function send2_1_Re(){
	document.reSearch_fm.action="/search/searchList.jsp?page=1&amp;search_sect=total";
}

//페이지이동
function send(i,k){
			document.f.action="/search/searchList.jsp?pages="+i+"&amp;search_sect="+k;
			document.f.submit();
}

function search_fcs(){
	document.search_fm.v_key1.focus();
}

//이미지팝업
function searchSubWin(i,j) {
	// 소장처코드
	var url = "/search/searchImgPop.jsp?view="+i+j;
	window.open(url,'','top=100,left=300,height=683,width=820,status=1,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no');
}

//박물관을 찾아서
function go_swf_view() {
	window.open('/fla/screen1.htm',"fla","width=720,height=534,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

//폼입력시
function enter_check(para) 
{ 
	if(event.keyCode==13){
				send(para);
	}
}


//게시판
function go_search() {
	if (document.form1.searchtext.value == "") {
		alert("검색어를 2글자 이상 입력해 주세요.")
		document.form1.searchtext.focus();
		return false;
	}
}


function confirmMsg(url)
{
	var yn = "";
	yn = confirm("새로 구축된 자료를 업로드했을 경우에만 사용하십시오. 갱신시 오류가 발생할 수 있으며 시간이 다소 걸립니다. \n \n통계자료를 갱신하시겠습니까?");
	
	if(yn)
	{
		location.href = url;
	}
	else
		return;
}