	function getCookie(cookieName) {
		var cookieValue = '';
		var posName = document.cookie.indexOf(escape(cookieName) + '=');

		if (posName != -1) {
			var posValue = posName + (escape(cookieName) + '=').length;
			var endPos = document.cookie.indexOf(';', posValue);
			if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
			else cookieValue = unescape(document.cookie.substring(posValue));
		}
		return (cookieValue);
	}

	function setCookie(cookieName, cookieValue, expires, path, domain, secure) {
		document.cookie =
			escape(cookieName) + '=' + escape(cookieValue)
			+ (expires ? '; expires=' + expires.toGMTString() : '')
			+ (path ? '; path=' + path : '')
			+ (domain ? '; domain=' + domain : '')
			+ (secure ? '; secure' : '');
	}

	function setRowSizeCookie( cookieName, cookieValue, expireDate )
	{
		var today = new Date();
		today.setDate( today.getDate() + parseInt( expireDate ) );
		document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";";
	}

	function setSkinCookie( cookieName, cookieValue, expireDate )
	{
		var today = new Date();
		today.setDate( today.getDate() + parseInt( expireDate ) );
		document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";";
	}


	//객체 생성
	function getXMLHttpRequest() {
		if (window.ActiveXObject)			//
		{
			try
			{
				return new ActiveXObject("Msxml2.XMLHTTP");  //msxml 이 설치 되었을시
			}
			catch (e)
			{
				try
				{
			
					return new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e1)
				{
					return null;
				}
			}
		}
		else if (window.XMLHttpRequest)		// iE 이외 브라우저
		{
		
			return new XMLHttpRequest();
		}
		else		// 생성 실패
		{
			return null;
		}
	}

	//Get 방식
	//httpRequest.open("GET","/test.txt?id=XXX&pw=***",true);
	//httpRequest.send(null);

	//Post 방식
	//httpRequest.open("POST","/test.txt", true);
	//httpRequest.send("id=XXX&pw=***");


	var httpRequest = null;

	function load(method, url, header, syn)
	{
		if (method = "GET")
		{
			url = url + "?" + header;
			header = null;
		}
		else if(method = "POST")
		{
			//httpRequest.open(method,url,syn);
			//httpRequest.send(header);
		}
		else
		{
			alert("잘못된 방식으로 전송하려고 합니다. 다시 확인바랍니다.");
			return null;
		}

		httpRequest = getXMLHttpRequest();		//객체 생성
		httpRequest.onreadystatechange = callbackResult;		//callback 시
		httpRequest.open(method,url,syn);
		httpRequest.send(null);  //동기 방식일 경우 결과를 기다린다.(브자우저 방식에 따라 처리불능 가능성)
												//비동기 방식일 경우 다음 명령 바로 처리.(크로스 브라우저 추천)
	}

	//.readyState (상태)에 따라 처리
	//페이지 미존재시 오페라 3으로 변경 안함,  파이어폭스 3으로 변경됨
	//크로스 브라우저 : 1 과 4만 사용 추천

	//.status (결과상태)
	// 200 : OK							성공
	// 403 : Forbidden					접근거부
	// 404 : Not Found					페이지 없음
	// 500 : Internal Server Error		서버 오류 발생

	//.statusText (결과 상태 영문 문장)
	// 위 영문 설명 문자열
	// 크로스 브라우저 : 오페라 8.51 이전 버전 지원 안함



	function callbackResult() //callback 함수
	{
		if (httpRequest.readyState == 0)
		{
			//UNINITIALIZED 객체만 생성 미초기화
		}
		else if (httpRequest.readyState == 1)
		{
			//LOADING open 호출 이후 send 호출 이전
		}
		else if (httpRequest.readyState == 2)
		{
			//LOADED send 호출 이후 status와 헤더 도착이전 상태
		}
		else if (httpRequest.readyState == 3)
		{
			//INTERACTIVE 일부 데이터 수신 상태
		}
		else if (httpRequest.readyState == 4)
		{			
			
			//COMPLETED 데이터 완전 수신 상태
			if (httpRequest.status == 200)
			{
				// 200 : OK	성공
				// httpRequest.ResponseText 를 가지고 처리
				process();  //처리시
			}
			else if (httpRequest.status == 403)
			{
				//403 : Forbidden					접근거부
				alert("Error 403 : 접근이 거부되었습니다.");
			}
			else if (httpRequest.status == 404)
			{
				// 404 : Not Found					페이지 없음
				alert("Error 404 : 파일이 존재 하지 않습니다.");
			}
			else if (httpRequest.status == 500)
			{
				// 500 : Internal Server Error		서버 오류 발생
				alert("Error 500 : 오류가 발생 하였습니다.");
			}
		}
	}

	//function process() //처리 함수{}

	// Open New Window
	function openNewWindow(url,winName,condition)
	{
		eval("var " + winName);

		eval(winName + " = window.open(url,winName,condition);");
		eval(winName + ".focus();");
		// condition : top=0, left=0, width=10, height=10, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0
	}

	function OpenWin(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable, kind){
		if(kind == 1){
			var winl = (screen.width/2)-(width/2);
			var wint = (screen.height/2)-(height/2);
		}
		toolbar_str = toolbar ? 'yes' : 'no';
		menubar_str = menubar ? 'yes' : 'no';
		statusbar_str = statusbar ? 'yes' : 'no';
		scrollbar_str = scrollbar ? 'yes' : 'no';
		resizable_str = resizable ? 'yes' : 'no';
		fo = window.open(url, name, 'left='+winl+',top='+wint+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
		fo.focus();
	}

	function nextchk(arg, len, nextname){
		if(arg.value.length==len){
			nextname.focus();
			return;
		}
	}

	//숫자만 입력 받기
	function numInput() {
		var keyCode = event.keyCode;
		if ((keyCode > 47 && keyCode < 58) || keyCode == 13) {}
		else {
			 event.returnValue=false;
		}
	 }

	function checNumInput()
	{
	 var objEv = event.srcElement;
	 var num ="0123456789";
	 event.returnValue = true;

	 for (var i=0;i<objEv.value.length;i++)
	 {
		if(-1 == num.indexOf(objEv.value.charAt(i))){
		   event.returnValue = false;
		}
		if(!event.returnValue){
		   alert("숫자만 입력이 가능합니다.");
		   objEv.value="";
		}
	 }
	}

	 //숫자와 영문자만 입력 받기
	function numEngInput() {
		var keyCode = event.keyCode;
		if ((keyCode > 47 && keyCode < 58) || (keyCode > 96 && keyCode < 123) || (keyCode > 64 && keyCode < 91) || keyCode == 13) {}
		else {
			 event.returnValue=false;
		 }
	 }

	  //숫자와 영문자만 입력 받기
	function numBlankEngInput() {
		var keyCode = event.keyCode;

		if ((keyCode > 46 && keyCode < 58) || (keyCode > 96 && keyCode < 123) || (keyCode > 64 && keyCode < 91) || keyCode == 13 || keyCode == 32) {}
		else {
			 event.returnValue=false;
		 }
	 }

	   //숫자와 영문자만 입력 받기
	function numBlankEngDashInput() {
		var keyCode = event.keyCode;
		//              ~                 &
		if (keyCode == 126 || keyCode == 38 || keyCode == 40 || keyCode == 41 || keyCode == 45 || (keyCode > 46 && keyCode < 58) || (keyCode > 96 && keyCode < 123) || keyCode == 63 || (keyCode > 64 && keyCode < 91) || keyCode == 13 || keyCode == 32) {}
		else {
			 event.returnValue=false;
		 }
	 }


	  //특정문자 입력 불가
	function noinputChar() {
		var keyCode = event.keyCode;
	   if (keyCode == 49) {		// "'"
			 event.returnValue=false;
		 }
	 }




	 //숫자와 "-"만 입력 받기(전화번호 입력 받을시)
	function telDashInput() {
		var keyCode = event.keyCode;

		if ((keyCode > 47 && keyCode < 58) || keyCode == 45 || keyCode == 189) {}
		else {
			 event.returnValue=false;
		 }
	 }

	function currentDateTime()
	{
		var today = new Date()
		var tempDate;
		var tempTime;

		var yyyy, mm, dd, hh, mi, ss, ampm;

		yyyy = today.getYear();
		mm = (today.getMonth()+1) + "";
		dd = today.getDate() + "";

		if((today.getHours() - 12) < 0){
			ampm = "오전"
			hh = today.getHours() + "";
		}
		else{
			ampm = "오후"
			hh = (today.getHours() - 12) + "";
		}

		if(hh == "0") hh = "12";

		mi = today.getMinutes() + "";
		ss = today.getSeconds() + "";

		if(mm.length < 2) mm = "0" + mm;
		if(dd.length < 2) dd = "0" + dd;
		if(hh.length < 2) hh = "0" + hh;
		if(mi.length < 2) mi = "0" + mi;
		if(ss.length < 2) ss = "0" + ss;

		tempDate = yyyy + "/" + mm + "/" + dd + " ";
		tempTime = hh + ":" + mi + ":" + ss ;

		return tempDate + " " + ampm + " " + tempTime;
	}

	var timeSpan;
	function onlineDateTime(obj)
	{
		if(obj != null){
			timeSpan = obj;
			setInterval("timeSpan.innerHTML = currentDateTime();",1000);
		}
	}

	var checkNUM=0;
	var checkNUM2=0;
	var checkValue=false;

	function allCheck(chkForm)
	{
		checkNUM++;
		if(checkNUM%2==0) checkValue = false;
		else checkValue = true;

		var elementSize = chkForm.length;

		if(elementSize)
		{
			for(i=0; i<chkForm.length; i++)
			{
				if (!chkForm[i].disabled)
				{
					chkForm[i].checked = checkValue;
				}

			}
		}
		else
		{
			if (!chkForm.disabled)
			{
				chkForm.checked = checkValue;
			}
		}
	}


	//체크 박스 체크 여부
	function CheckBox_Checking(chkForm)
	{
		var i=0;
		var check_y = 0;
		var elementName = chkForm;
		var elementSize = 0;

		if (typeof(elementName) != "undefined")
		{
			elementSize = elementName.length;

			if(elementSize){
				for(i=0;i<elementSize;i++){
					if(elementName[i].checked==true){
						check_y++;
					}
				}
			}else{
				if(elementName.checked){
					check_y++;
				}
			}
		}

		if(check_y){
			return true;
		}else{
			alert("선택된 항목이 없습니다.")
			return false;
		}

	}

	function LTrim(str){
		if (str==null){
			return null;
		}

		for(var i=0;str.charAt(i)==" ";i++);

		return str.substring(i,str.length);
	}

	function RTrim(str){
		if (str==null){
			return null;
		}

		for(var i=str.length-1;str.charAt(i)==" ";i--);

		return str.substring(0,i+1);
	}

	function Trim(str){return LTrim(RTrim(str));}

	function trim( str ){
		return Trim(str);
		//return str.replace(/(^s*)|(s*$)/g, "");

	} // end trim

	function CheckByteLength(str, limitBytes)
	{
		var byteLen = 0;
		for(i=0; i<str.length; i++)
		{
			if(str.charCodeAt(i) > 255)
				byteLen += 2;
			else
				byteLen ++;

			if(byteLen > limitBytes)
				return false;
		}
		return true;
	}

	//문자열 자르기
	function CutString(str, limitBytes)
	{
		var byteLen = 0;
		for(i=0; i<str.length; i++)
		{
			if(str.charCodeAt(i) > 255)
				byteLen += 2;
			else
				byteLen ++;

			if(byteLen > limitBytes)
				return str.substring(0, i);
		}
		return str;
	}

	//문자열 자르기
	function StringCut(str, limitBytes,tail)
	{
		var byteLen = 0;
		for(i=0; i<str.length; i++)
		{
			if(str.charCodeAt(i) > 255)
				byteLen += 2;
			else
				byteLen ++;

			if(byteLen > limitBytes)
				return str.substring(0, i)+tail;
		}
		return str;
	}


	function CheckInputLength(obj, limitBytes, fieldName, alertFlag, idx)
	{
		if(obj.length>0){

			if(CheckByteLength(obj[idx].value, limitBytes) == false)
			{
				if(alertFlag) alert(fieldName + "는 최대 " + limitBytes + "바이트 까지만 입력 가능합니다.\n(한글 "+ (limitBytes/2)+"자, 영문 " + limitBytes + "자)");

				obj[idx].value = CutString(obj[idx].value, limitBytes);
			}
		}else{

			if(CheckByteLength(obj.value, limitBytes) == false)
			{
				if(alertFlag) alert(fieldName + "는 최대 " + limitBytes + "바이트 까지만 입력 가능합니다.\n(한글 "+ (limitBytes/2)+"자, 영문 " + limitBytes + "자)");

				obj.value = CutString(obj.value, limitBytes);
			}
		}
	}

    /* byte check(다음꺼) */
	function updateChar_upd(FieldName, mententname){

			var strCount = 0;
			var tempStr, tempStr2;
			for(i = 0;i < document.getElementById(mententname).value.length;i++)
			{
				tempStr = document.getElementById(mententname).value.charAt(i);
				if(escape(tempStr).length > 4) strCount += 2;
					else strCount += 1 ;
			}
			if (strCount > FieldName){
				alert("최대 " + FieldName + "byte이므로 초과된 글자수는 자동으로 삭제됩니다.");
				strCount = 0;
				tempStr2 = "";
				for(i = 0; i < document.getElementById(mententname).value.length; i++)
				{
					tempStr = document.getElementById(mententname).value.charAt(i);
					if(escape(tempStr).length > 4) strCount += 2;
					else strCount += 1 ;
					if (strCount > FieldName)
					{
						if(escape(tempStr).length > 4) strCount -= 2;
						else strCount -= 1 ;
						break;
					}
					else tempStr2 += tempStr;
				}
				document.getElementById(mententname).value = tempStr2;
				//document.writeForm.mentents.value = tempStr2;
			}
	}

	/* byte check(다음꺼) */
	function updateChar(FieldName, mententname, textlimitname){

			var strCount = 0;
			var tempStr, tempStr2;
			for(i = 0;i < document.getElementById(mententname).value.length;i++)
			{
				tempStr = document.getElementById(mententname).value.charAt(i);
				if(escape(tempStr).length > 4) strCount += 2;
					else strCount += 1 ;
			}
			if (strCount > FieldName){
				alert("최대 " + FieldName + "byte이므로 초과된 글자수는 자동으로 삭제됩니다.");
				strCount = 0;
				tempStr2 = "";
				for(i = 0; i < document.getElementById(mententname).value.length; i++)
				{
					tempStr = document.getElementById(mententname).value.charAt(i);
					if(escape(tempStr).length > 4) strCount += 2;
					else strCount += 1 ;
					if (strCount > FieldName)
					{
						if(escape(tempStr).length > 4) strCount -= 2;
						else strCount -= 1 ;
						break;
					}
					else tempStr2 += tempStr;
				}
				document.getElementById(mententname).value = tempStr2;
				//document.writeForm.mentents.value = tempStr2;
			}
			document.getElementById(textlimitname).innerHTML = strCount;
	}


	//첨부 파일 사이즈 체크

	function getFileSize(path)
	{
		var img = new Image();
		img.dynsrc = path;
		return img.fileSize;
		// IE7 버젼을 위해아래로 대체
		
/*
		if(navigator.userAgent.indexOf('MSIE') > 0 && (navigator.appVersion.indexOf('MSIE7.') > 0) || navigator.appVersion.indexOf('MSIE8.')){
			var fso = new ActiveXObject("Scripting.FileSystemObject");
			var f = fso.GetFile(path);
			var fileSize = f.size;
			return fileSize;
		}else{
			img.dynsrc = path;
			return img.fileSize;
		}
	
		*/
	}
	/*
	function getFileSize(path)
	{
	var fso =new ActiveXObject("Scripting.FileSystemObject");
	var f=fso.GetFile(path);
	var fileSize=f.size;
	f=null;
	fso=null;
	return fileSize

	}
	*/


	function getimgExt(fnm){
	  var imgExt ="gif,jpg,jpeg,bmp";
	  if(imgExt.indexOf(fnm.toLowerCase()) != -1){
		   return true;
	  }
	  return false;
	}


	function Number_Format(fn)
	{
		  var str = fn.value;
		  var Re = /[^0-9]/g;
		  var ReN = /(-?[0-9]+)([0-9]{3})/;
		  str = str.replace(Re,'');
		  while (ReN.test(str)) {
				  str = str.replace(ReN, "$1,$2");
				  }
		  fn.value = str;
	}

	function Number_Format2(strg)
	{
		  var str;
		  var Re = /[^0-9]/g;
		  var ReN = /(-?[0-9]+)([0-9]{3})/;
		  str = strg.replace(Re,'');
		  while (ReN.test(str)) {
				  str = str.replace(ReN, "$1,$2");
				  }
		  return str;
	}


	function fileName(path)
	{
		var file = path.substring(path.lastIndexOf('\\')+1,path.length);
		var filename;

		if(file.indexOf('.')>=0) {
			filename = file.substring(0,file.lastIndexOf('.'));
		} else {
			filename = file;
		}

		return filename;
	}


	function fileNameExp(path)
	{

		var file = path.substring(path.lastIndexOf('\\')+1,path.length);
		var exp;


		if(file.indexOf('.')>=0) {
			exp = file.substring(file.lastIndexOf('.')+1,file.length);
		} else {
			exp = '';
		}

		return exp;
	}


	function checkNoTucsu()
	{
		var keyCode = event.keyCode;
		if (keyCode == 123 || keyCode == 124 || keyCode == 125 || keyCode == 126
			|| keyCode == 91 || keyCode == 92 || keyCode == 93 || keyCode == 94 || keyCode == 95 || keyCode == 96
			|| keyCode == 40 || keyCode == 41 || keyCode == 42 || keyCode == 43 || keyCode == 45
			|| keyCode == 60 || keyCode == 61 || keyCode == 62 || keyCode == 63 || keyCode == 64
			|| keyCode == 33 || keyCode == 34 || keyCode == 35 || keyCode == 36 || keyCode == 37  || keyCode == 38 || keyCode == 39)
		{

			 event.returnValue=false;
		 }
	}

	function checkTucsu()
	{
	 var objEv = event.srcElement;
	 var num ="{}[]<>_|`!@#$%^*+\"'\\"; //&뺌
	 event.returnValue = true;

	 for (var i=0;i<objEv.value.length;i++)
	 {
	 if(-1 != num.indexOf(objEv.value.charAt(i)))
	 event.returnValue = false;
	 }

	 if (!event.returnValue)
	 {
	  alert("특수문자는 입력하실 수 없습니다.");
	  objEv.value="";
	 }
	}


	function checkDomain(nname){
		var arr = new Array(
		'.com','.net','.org','.biz','.coop','.info','.museum','.name',
		'.pro','.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag',
		'.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',
		'.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm',
		'.bn','.bo','.br','.bs','.bt','.bv','.bw','.by','.bz','.ca','.cc',
		'.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co','.cr',
		'.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz',
		'.ec','.ee','.eg','.eh','.er','.es','.et','.fi','.fj','.fk','.fm',
		'.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi','.gl','.gm',
		'.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm',
		'.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io','.iq',
		'.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
		'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li',
		'.lk','.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg',
		'.mh','.mk','.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt',
		'.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng',
		'.ni','.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf',
		'.pg','.ph','.pk','.pl','.pm','.pn','.pr','.ps','.pt','.pw','.py',
		'.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',
		'.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv',
		'.sy','.sz','.tc','.td','.tf','.tg','.th','.tj','.tk','.tm','.tn',
		'.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk','.um',
		'.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws',
		'.wf','.ye','.yt','.yu','.za','.zm','.zw');

		var mai = nname;
		var val = true;

		var dot = mai.lastIndexOf(".");
		var dname = mai.substring(0,dot);
		var ext = mai.substring(dot,mai.length);
		//alert(ext);

		if(dot>2 && dot<57)
		{
			for(var i=0; i<arr.length; i++)
			{
				if(ext == arr[i])
				{
					val = true;
					break;
				}
				else
				{
					val = false;
				}
			}
			if(val == false)
			{
				   alert("도메인명의 "+ext+" 가 부적합합니다.");
				 return false;
			}
			else
			{
				for(var j=0; j<dname.length; j++)
				{
					var dh = dname.charAt(j);
					var hh = dh.charCodeAt(0);
					if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
					{
						if((j==0 || j==dname.length-1) && hh == 45)
						{
							alert("Domain name should not begin are end with '-'");
							return false;
						}
					}else{
						alert("특수문자(한글포함)는 입력하실 수 없습니다.");
						return false;
					}
				}
			}
		}
		else
		{
			alert("도메인명이 부적합합니다.");
			return false;
		}

		return true;
	}

	function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
	{
		  toolbar_str = toolbar ? 'yes' : 'no';
		  menubar_str = menubar ? 'yes' : 'no';
		  statusbar_str = statusbar ? 'yes' : 'no';
		  scrollbar_str = scrollbar ? 'yes' : 'no';
		  resizable_str = resizable ? 'yes' : 'no';

		  eval("var " + name + " = null;");

		  eval(name + " = window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);");

		  eval(name + ".focus();");
	}



	function replace(str,s,d){
		var i=0;

		while(i > -1){
			i = str.indexOf(s);
			str = str.substr(0,i) + d + str.substr(i+1,str.length);
		}

		return str;
	}

	function optionClear(obj, selidx, noClCnt)
	{
		obj.selectedIndex = selidx;
		obj.options.length = noClCnt;
	}

	function src_change(formname,srcName,srcTempName,textBoxSpanName,state, classStr){
		var s1_id=document.getElementById(textBoxSpanName);

		var srcObj = eval("document." + formname + "." + srcName);
		var srcTempObj = eval("document." + formname + "." + srcTempName);
	
		if(srcObj.value == "sp_w"){
			s1_id.innerHTML ="<select name='" + srcTempName + "' class=\"board_Select\" ><option value='' selected></option>" + sp_wOptionList + "</select>";
			if(state==2){
			srcTempObj.value="";
			}
		}else if(srcObj.value == "ptcd"){
			s1_id.innerHTML ="<select name='" + srcTempName + "' style='width:160;' ><option value='' selected></option>" + ptcdOptionList + "</select>";
			if(state==2){
				srcTempObj.value="";
			}
		}else if(srcObj.value == "LCD"){
			s1_id.innerHTML ="<select name='" + srcTempName + "' style='width:160;' ><option value='' selected></option>" + LCDOptionList + "</select>";
			if(state==2){
				srcTempObj.value="";
			}
		}else if(srcObj.value == "FLAG"){
			s1_id.innerHTML ="<select name='" + srcTempName + "' style='width:160;' ><option value='' selected></option>" + FLAGOptionList + "</select>";
			if(state==2){
				srcTempObj.value="";
			}
		}else {
			
			if(state==2){
				s1_id.innerHTML ="<input name='" + srcTempName + "' value='' onkeypress='checkNoTucsu();' onkeyup='checkTucsu()' type='text' class='" + classStr + "' maxlength='50' > ";
			}
			else
			{
				s1_id.innerHTML ="<input name='" + srcTempName + "' value='" + sp_temp_df + "' onkeypress='checkNoTucsu();' onkeyup='checkTucsu()' type='text' class='" + classStr + "' maxlength='50' > ";
			}
		}

	}

	function body_resize()
	{
		top.document.all.bodyFrame.height = top.document.all.bodyFrame.contentWindow.document.body.scrollHeight;
	}

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}


	/*------------------------------------------------------------------*/
	/*  펑션명   : tts_setCookie                                            */
	/*  내용설명 : 쿠키값을 설정한다.                                   */
	/*  호출 모듈명                                                     */
	/*      1) html        :                                            */
	/*      2) JSP/servlet :                                            */
	/*      3) script func.:                                            */
	/*  매개변수  : key값, value값, 쿠키 유효일자-1                     */
	/*  특이사항  :                                                     */
	/*------------------------------------------------------------------*/
	function tts_setCookie(key, value, term){
	  var expire = new Date();
	  expire.setDate( expire.getDate() + term );
	  document.cookie = key + "=" + escape( value ) + "; path=/; expires=" + expire.toGMTString() + ";";
	}



	var zoomRate = 20;
	var maxRate = 200;
	var minRate = 100;
	var curRate = 100;

	function zoomInOut(contentid, how)
	{
	  if (((how == "in")&&(curRate >= maxRate))||((how == "out") && (curRate <= minRate))) {
		return;   /* 범위 초과시 리턴한다 */
	  }
	  if (how == "in") {
		curRate = (-(-(curRate))) + (-(-(zoomRate)));
		document.body.style.zoom = curRate + '%';	/* 화면 확대 */
	  }
	  else {
		curRate = (-(-(curRate))) - (-(-(zoomRate)));
		document.body.style.zoom = curRate + '%';	/* 화면 축소 */
	  }
	  tts_setCookie("zoomVal",curRate, 1);
	}


	/*----------------------------------------------------------------------------*/
	/* NAME : f_setInit()                                                         */
	/* DESC : 화면이 처음 Load되었을 때 실행되는 함수(글자관련)                   */
	/*----------------------------------------------------------------------------*/
	function f_setInit(){


	  if(getCookie("zoomVal") != null && getCookie("zoomVal") != "")
	   {
		  curRate = getCookie("zoomVal");
		  if(!((curRate >= minRate) & (curRate <= maxRate)))
		  {
			 curRate = 100;
		  }

		  tts_setCookie("zoomVal",curRate, 1);
		  document.body.style.zoom = curRate + '%';
	   }
	   else
	   {
		  document.body.style.zoom = '100%';
		  curRate = 100;
		  tts_setCookie("zoomVal",100, 1);
	   }


	}



    /*----------------------------------------------------------------------------*/
	/* NAME : openZipCode()                                                       */
	/* DESC : 우편번호검색                                                        */
	/*----------------------------------------------------------------------------*/
     function openZipCode()
	{
           openNewWindow('/modules/zipcode.do?method=getDisplay','zipCode','width=430,height=430,scrollbars=no');
	}

	 function openZipCode2(zipcdCtlName, addr1CtlName, addr2CtlName)
	{
           openNewWindow('/modules/zipcode.do?method=getDisplay&zipId=' + zipcdCtlName + '&addr1Id=' + addr1CtlName + '&addr2Id=' + addr2CtlName,'zipCode','width=430,height=430,scrollbars=no');
	}

	 function openZipCode3(zipcdCtlName, addr1CtlName, addr2CtlName, thisVil)
	{
           openNewWindow('/modules/zipcode.do?method=getDisplay&zipId=' + zipcdCtlName + '&addr1Id=' + addr1CtlName + '&addr2Id=' + addr2CtlName + '&thisVil=' + thisVil,'zipCode','width=430,height=430,scrollbars=no');
	}



    /*----------------------------------------------------------------------------*/
	/* NAME : fileDown(fold,cmscd,rfile,ofile)                                    */
	/* DESC : 파일다운로드                                                        */
	/*----------------------------------------------------------------------------*/
	function fileDown(fold,cmscd,rfile,ofile){
      location.href="/servlet/filedown?cmscd="+cmscd+"&fold="+fold+"&repFileName="+rfile+"&orgFileName="+encodeURIComponent(ofile)+"";
    }


    /*----------------------------------------------------------------------------*/
	/* NAME : showPhoto(src,w,h)                                                  */
	/* DESC : 파일다운로드                                                        */
	/* 제한 : IE 6,7용                                                            */
	/*----------------------------------------------------------------------------*/
	function showPhoto(src,defalt_src,w,h){
       if(src.match(/\.(gif|jpg|jpeg)$/i)){
		  document.getElementById("previewPhoto").style.width = w+'px';
		  document.getElementById("previewPhoto").style.height= h+'px';

		  document.getElementById("previewPhoto").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod=scale);";
	   }else{
	      document.getElementById("previewPhoto").style.background ="url("+defalt_src+") no-repeat"
	   }
	}


    /*----------------------------------------------------------------------------*/
	/* NAME : selCheck(obj)                                                       */
	/* DESC : 체크박스,라디오 버튼 유효성체크                                     */
	/* 제한 : -                                                                   */
	/*----------------------------------------------------------------------------*/
	function selCheck(obj){
		var selck =false;
		  if(obj =='[object]'){
			  if(obj.length){
				 for(var i=0; i<obj.length; i++){
					if(obj[i].checked){ selck = true; break; }
				 }
			  }else{
					if(obj.checked){ selck = true;}
			  }
		  }
		return selck;
	}

   /*----------------------------------------------------------------------------*/
   /* NAME : getSelBuild(obj)                                                    */
   /* DESC : 체크박스 sep 단위로 조합                                            */
   /* 제한 : -                                                                   */
   /*----------------------------------------------------------------------------*/
   function getSelBuild(obj,sep){
		var sel_val ="";
		  if(obj =='[object]'){
			  if(obj.length){
				 for(var i=0; i<obj.length; i++){
					if(obj[i].checked){ sel_val += obj[i].value + sep; }
				 }
			  }else{
					if(obj.checked){ sel_val = obj.value; }
			  }
		  }
		return sel_val;
  }

   /*----------------------------------------------------------------------------*/
   /* NAME : isValidBusiNo(string)                                               */
   /* DESC : 사업자번호체크                                                      */
   /* 제한 : -                                                                   */
   /*----------------------------------------------------------------------------*/
  function isValidBusiNo(busiNo_value) {
	  var str = busiNo_value;
	  var c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,a1,a2,a3,a4,a5,a6,a7,a8;

	  if (str == "") {
	 //alert("사업자등록번호'를 입력하세요.");
	 //busiNo_obj.focus();
	 return false;
	  }

	  c1 = str.substring(0,1);
	  c2 = str.substring(1,2);
	  c3 = str.substring(2,3);
	  c4 = str.substring(3,4);
	  c5 = str.substring(4,5);
	  c6 = str.substring(5,6);
	  c7 = str.substring(6,7);
	  c8 = str.substring(7,8);
	  c9 = str.substring(8,9);
	  c10 = str.substring(9,10);

	  a1 = (c1*1)+(c2*3)+(c3*7)+(c4*1)+(c5*3)+(c6*7)+(c7*1);

	  a2 = a1 % 10;
	  a3 = (c8 * 3) % 10;
	  a4 = c9 * 5;
	  a5 = Math.round(a4/10-0.5);
	  a6 = a4 - (a5*10);
	  a7 = (a2+a3+a5+a6) % 10;
	  a8 = (10 - a7) % 10;

	  if (a8 != c10) {
	  // alert("잘못된 '사업자등록번호'입니다.\n\n다시 확인하시고 입력해 주세요.");
	  // busiNo_obj.focus();
		return false;
	  } else {
		return true;
	  }
  }

	function encodeURL(str){
	    var s0, i, s, u;
	    s0 = "";                // encoded str
	    for (i = 0; i < str.length; i++){   // scan the source
	        s = str.charAt(i);
	        u = str.charCodeAt(i);          // get unicode of the char
	        if (s == " "){s0 += "+";}       // SP should be converted to "+"
	        else {
	            if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f || ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) || ((u >= 0x61) && (u <= 0x7a))){       // check for escape
	                s0 = s0 + s;            // don't escape
	            }
	            else {                  // escape
	                if ((u >= 0x0) && (u <= 0x7f)){     // single byte format
	                    s = "0"+u.toString(16);
	                    s0 += "%"+ s.substr(s.length-2);
	                }
	                else if (u > 0x1fffff){     // quaternary byte format (extended)
	                    s0 += "%" + (0xf0 + ((u & 0x1c0000) >> 18)).toString(16);
	                    s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
	                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
	                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
	                }
	                else if (u > 0x7ff){        // triple byte format
	                    s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
	                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
	                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
	                }
	                else {                      // double byte format
	                    s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
	                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
	                }
	            }
	        }
	    }
	    return s0;
	}


	function decodeURL(str)
	{
	    var s0, i, j, s, ss, u, n, f;
	    s0 = "";                // decoded str
	    for (i = 0; i < str.length; i++){   // scan the source str
	        s = str.charAt(i);
	        if (s == "+"){s0 += " ";}       // "+" should be changed to SP
	        else {
	            if (s != "%"){s0 += s;}     // add an unescaped char
	            else{               // escape sequence decoding
	                u = 0;          // unicode of the character
	                f = 1;          // escape flag, zero means end of this sequence
	                while (true) {
	                    ss = "";        // local str to parse as int
	                        for (j = 0; j < 2; j++ ) {  // get two maximum hex characters for parse
	                            sss = str.charAt(++i);
	                            if (((sss >= "0") && (sss <= "9")) || ((sss >= "a") && (sss <= "f"))  || ((sss >= "A") && (sss <= "F"))) {
	                                ss += sss;      // if hex, add the hex character
	                            } else {--i; break;}    // not a hex char., exit the loop
	                        }
	                    n = parseInt(ss, 16);           // parse the hex str as byte
	                    if (n <= 0x7f){u = n; f = 1;}   // single byte format
	                    if ((n >= 0xc0) && (n <= 0xdf)){u = n & 0x1f; f = 2;}   // double byte format
	                    if ((n >= 0xe0) && (n <= 0xef)){u = n & 0x0f; f = 3;}   // triple byte format
	                    if ((n >= 0xf0) && (n <= 0xf7)){u = n & 0x07; f = 4;}   // quaternary byte format (extended)
	                    if ((n >= 0x80) && (n <= 0xbf)){u = (u << 6) + (n & 0x3f); --f;}         // not a first, shift and add 6 lower bits
	                    if (f <= 1){break;}         // end of the utf byte sequence
	                    if (str.charAt(i + 1) == "%"){ i++ ;}                   // test for the next shift byte
	                    else {break;}                   // abnormal, format error
	                }
	            s0 += String.fromCharCode(u);           // add the escaped character
	            }
	        }
	    }
	    return s0;
	}
	
	//숫자형체크 
	function checkNumber(num) { 

	    var pattern = /^[0-9]+$/;
	    var flag = false;
	       flag = pattern.test(num);
	       
	    return flag; 
	}
	
	function openNewWindow(url,winName,condition)
	{
		eval("var " + winName);

		eval(winName + " = window.open(url,winName,condition);");
		eval(winName + ".focus();");
		// condition : top=0, left=0, width=10, height=10, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0
	}
	
	
	//글자 크기 크게/작게
	defsize = 73;
	var TF = 12;
	function zoom_it(n) {
		defsize += n*10;
		var mFont = TF ;
		n=parseInt(n);
		mFont+=n;
			
		if(defsize >= 43 &&  defsize <= 103){
		
			objs = document.getElementsByTagName("body").item(0);
		
			//objs.style.fontSize = defsize + "%";
			objs.style.fontSize = mFont+'px';
			
			objs=document.getElementsByTagName("td");
			
			for (i=0;i<objs.length;i++) {
				try {
					objs[i].style.fontSize=mFont+'px';
				} catch(e) {}
			}
			
			objs=document.getElementsByTagName("a");
			
			for (i=0;i<objs.length;i++) {
				try {
					objs[i].style.fontSize=mFont+'px';
				} catch(e) {}
			}
			
			objs=document.getElementsByTagName("th");
			
			for (i=0;i<objs.length;i++) {
				try {
					objs[i].style.fontSize=mFont+'px';
				} catch(e) {}
			} 
			
			objs=document.getElementsByTagName("span");
			
			for (i=0;i<objs.length;i++) {
				try {
					objs[i].style.fontSize=mFont+'px';
				} catch(e) {}
			}
			
			
		}
		TF = mFont;
	
	} 	
	
	//레이어배너
	function initMoving(target, position, topLimit, btmLimit) {
		if (!target)
			return false;

		var obj = target;
		obj.initTop = position;
		obj.topLimit = topLimit;
		obj.bottomLimit = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - btmLimit - obj.offsetHeight;

		obj.style.position = "absolute";
		obj.top = obj.initTop;
		obj.left = obj.initLeft;		

		if (typeof(window.pageYOffset) == "number") {	//WebKit
			obj.getTop = function() {
				return window.pageYOffset;
			}
		} else if (typeof(document.documentElement.scrollTop) == "number") {
			obj.getTop = function() {
				return Math.max(document.documentElement.scrollTop, document.body.scrollTop);
			}
		} else {
			obj.getTop = function() {
				return 0;
			}
		}

		if (self.innerHeight) {	//WebKit
			obj.getHeight = function() {
				return self.innerHeight;
			}
		} else if(document.documentElement.clientHeight) {
			obj.getHeight = function() {
				return document.documentElement.clientHeight;
			}
		} else {
			obj.getHeight = function() {
				return 500;
			}
		}

		obj.move = setInterval(function() {
			if (obj.initTop > 0) {
				pos = obj.getTop() + obj.initTop;
			} else {
				pos = obj.getTop() + obj.getHeight() + obj.initTop;
				//pos = obj.getTop() + obj.getHeight() / 2 - 15;
			}

			if (pos > obj.bottomLimit)
				pos = obj.bottomLimit;
			if (pos < obj.topLimit)
				pos = obj.topLimit;

			interval = obj.top - pos;
			obj.top = obj.top - interval / 3;
			obj.style.top = obj.top + "px";
		}, 30)
	}	
