	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(header);  //동기 방식일 경우 결과를 기다린다.(브자우저 방식에 따라 처리불능 가능성)
											//비동기 방식일 경우 다음 명령 바로 처리.(크로스 브라우저 추천)

		
	}

	//.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(e) { 
		var keyCode; 
		if(window.event){
			keyCode = event.keyCode;
		}else{
			if(e != null)
				keyCode = e.which;
		}	
		
		if(keyCode != ""){
			if ((keyCode > 47 && keyCode < 58) || (keyCode > 95 && keyCode < 106) || keyCode == 13 ||  keyCode == 8) {}
			else {
				if(window.event){
					event.returnValue = false;
				}else{
					e.preventDefault();
				}
			}
		}
	}
	
	
	//숫자와 '-'만 입력 받기
	function numDashInput(e) { 
		var keyCode; 
		if(window.event){
			keyCode = event.keyCode;
		}else{
			if(e != null)
				keyCode = e.which;
		}	
		
		if(keyCode != ""){
			if ((keyCode > 47 && keyCode < 58) || keyCode == 13 || keyCode == 45 ||  keyCode == 8) {}
			else {
				if(window.event){
					event.returnValue = false;
				}else{
					e.preventDefault();
				}
			}
		}
	}

	
	
	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 numInputOnly() {    
		var keyCode = event.keyCode;	

		if ((keyCode > 47 && keyCode < 58) || keyCode == 189) {}
		else {
			 event.returnValue=false;
		 }
	 }
	 
	 //메일 체크
	 function emailValidate(em) {		 
		 if(em.value.search(/(\S+)@(\S+)\.(\S+)/) == -1) {
			 alert("ID@고유도메인명 형식으로 입력하세요!!\n\n예) ID@naver.com");
			 em.value = '';
			 //em.focus();
			 return false;
		 } 
		 return true;
	}
		

	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 sizeUnit(value){
	  var sizeUnit="0KB";
	  
	  if(  value >= 1048576 )
		sizeUnit = Math.floor( ( ( value / 1024 ) / 1024 ) * 100 ) / 100 + "MB";
	  else
		sizeUnit = Math.floor( ( value / 1024 ) * 100 ) / 100 + "KB";
	  
	  return sizeUnit;
	}


	//체크 박스 체크 여부
	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;
		}

	}
	 
	/*** 리스트 삭제 선택(obj) ****/
	var checkNUMObj=0;
	var checkValueObj=false;

	function allCheckObj(chkObj)
	{
		checkNUMObj++;
		if(checkNUMObj%2==0) checkValueObj = false;
		else checkValueObj = true;
		
		if (typeof(chkObj) != "undefined" && chkObj != null){
			var elementSize = chkObj.length;
		
			if(elementSize) 	
			{
				for(var i=0; i < chkObj.length; i++)
				{
					if (!chkObj[i].disabled)
					{
						chkObj[i].checked = checkValueObj;
					}
					
				}
			}
			else
			{
				if (!chkObj.disabled)
				{
					chkObj.checked = checkValueObj;
				}
			}
		}
	}


	//체크 박스 체크 여부(obj)
	function CheckBox_CheckingObj(chkObj)
	{
		var i=0;			
		var check_y = 0;	
		var elementName = chkObj;		
		var elementSize = 0;
		
		if (typeof(elementName) != "undefined" && elementName != null)
		{
			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 > 0){
			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 getByte(str)
	{
		var byteLen = 0;
		for(i=0; i<str.length; i++)
		{
			if(str.charCodeAt(i) > 255)
				byteLen += 2;
			else
				byteLen ++;	
		}
		return byteLen;
	}

	//문자열 자르기
	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;
	}
	/*
	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 == 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 + "' style='width:160;' ><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 + "' style='width:160;margin-bottom:2px;ime-mode:active;' maxlength='50' >";
			}
			else
			{
				s1_id.innerHTML ="<input name='" + srcTempName + "' value='" + sp_temp_df + "' onkeypress='checkNoTucsu();' onkeyup='checkTucsu()' type='text' class='" + classStr + "' style='width:160;margin-bottom:2px;ime-mode:active;' maxlength='50' >";
			}
		}

	}

	function body_resize()
	{
		if(top.document.all.bodyFrame)
		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');
	}



    /*----------------------------------------------------------------------------*/
	/* NAME : fileDown(fold,cmscd,rfile,ofile)                                    */
	/* DESC : 파일다운로드                                                        */
	/*----------------------------------------------------------------------------*/
	function fileDown(fold,cmscd,rfile,ofile){
      location.href="/servlet/filedown?cmscd="+cmscd+"&fold="+fold+"&repFileName="+rfile+"&orgFileName="+ofile;
    }


    /*----------------------------------------------------------------------------*/
	/* NAME : showPhoto(src,w,h)                                                  */
	/* DESC : 파일다운로드                                                        */
	/* 제한 : IE 6,7용                                                            */
	/*----------------------------------------------------------------------------*/
	function showPhotoIe67(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 : showPhoto(src,w,h)                                                  */
	/* DESC : 파일다운로드                                                        */
	/* 제한 : IE 6,7,8용                                                            */
	/*----------------------------------------------------------------------------*/
	function showPhoto(srcObj,defalt_src,w,h){
		var preViewObj = document.getElementById("previewPhoto");
		var imgSrc = "";
		
		if(srcObj.value.indexOf("\\fakepath\\") < 0){
			imgSrc = srcObj.value;
		}else{
			srcObj.select();
			var selectionRange = document.selection.createRange();
			imgSrc = selectionRange.text.toString();
			srcObj.blur();
		}
		//imgSrc = imgSrc.toLowerCase();
		if(imgSrc.length == 0){
			preViewObj.style.filter = "";
			preViewObj.style.background ="url("+defalt_src+") no-repeat";
		}else if(imgSrc.match(/\.(gif|jpg|jpeg)$/i)){
			preViewObj.style.width = w+'px';
			preViewObj.style.height= h+'px';
			preViewObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ imgSrc +"',sizingMethod='scale');";
		}else{
			alert("gif, jpg, jpeg 파일만 가능합니다.");
			preViewObj.style.filter = "";
			preViewObj.style.background ="url("+defalt_src+") no-repeat";
		}
	}
	
	 /*----------------------------------------------------------------------------*/
	/* NAME : showPhotoThum(src,w,h)                                                  */
	/* DESC : 파일다운로드                                                        */
	/* 제한 : IE 6,7,8용                                                            */
	/*----------------------------------------------------------------------------*/
	function showPhotoThum(srcObj,defalt_src,w,h){
		var preViewObj = document.getElementById("previewPhoto");
		var imgSrc = "";
		
		if(srcObj.value.indexOf("\\fakepath\\") < 0){
			imgSrc = srcObj.value;
		}else{
			srcObj.select();
			var selectionRange = document.selection.createRange();
			imgSrc = selectionRange.text.toString();
			srcObj.blur();
		}
		//imgSrc = imgSrc.toLowerCase();
		if(imgSrc.length == 0){
			preViewObj.style.filter = "";
			preViewObj.style.background ="url("+defalt_src+") no-repeat";
		}else if(imgSrc.match(/\.(gif|jpg|jpeg)$/i)){
			preViewObj.style.width = w+'px';
			preViewObj.style.height= h+'px';
			preViewObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ imgSrc +"',sizingMethod='scale');";
			document.getElementById("thumImage").style.display = "none";
		}else{
			alert("gif, jpg, jpeg 파일만 가능합니다.");
			preViewObj.style.filter = "";
			preViewObj.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;
	  }  
  }
  
  /* keyEvent중 enter 일때만 true 반환
   */
  function enterChk(e) {
  	if(window.event){
  		if (event.keyCode == 13) {
  			return true;
  		}
  	}else{
  		if(e != null){
	  		if (e.which == 13) {
	  			return true;
	  		}
  		}
  	}
  	return false;
  }
  /* keyEvent중 tab 일때만 true 반환
   */
  function onlyTab(e) {
	  	if(window.event){
	  		if (event.keyCode != 0x09) {
	  			event.returnValue = false;
	  		}
	  	}else{
	  		if(e != null){
		  		if (e.which != 0x09) {
		  			e.preventDefault();
		  		}
	  		}
	  	}
  }
  

  /* 문자의 바이트를 반환한다.
  */
  function chr_byte(chr){
  	if(escape(chr).length > 4)
  		return 2;
  	else
  		return 1;
  }


  /* java의 StringBuffer 클래스의 기능을 수행한다.
  */
  var StringBuffer = function() {
  	this.buffer = new Array();
  }

  StringBuffer.prototype.append = function(str) {
  	this.buffer.push(str);

  	return this;
  }

  StringBuffer.prototype.toString = function(){
  	return this.buffer.join("");
  }



  /* 일정한 문자열의 끝에 문자를 삽입한다.
   * param - str: 자를 문자열
   * param - len: 자를 바이트 수
   * param - addStr: 삽입할 문자열
  */
  function addLineEndString(str, len, addStr){
  	if(str == null || str == "" ) return "";
   
  	var returnStr = new StringBuffer("");
  	var byteSize = 0;
   
  	for(var i=0; i< str.length; i++){
  		byteSize += chr_byte(str.charAt(i));
    
  		if(byteSize >= len){
  			byteSize = 0;
  			returnStr.append(str.charAt(i)).append(addStr);
  		}else{
  			returnStr.append(str.charAt(i));
  		}
    
  	}
   
  	return returnStr.toString();
  }



  /* 문자열을 길이 만큼 자른다.
   * param - str: 자를 문자열
   * param - limit: 자를 바이트 수
  */
  function cutStr(str,limit){
  	var tmpStr = str;
  	var byte_count = 0;
  	var len = str.length;
  	var dot = "";

  	for(i=0; i<len; i++){
  		byte_count += chr_byte(str.charAt(i)); 
  		if(byte_count == limit-1){
  			if(chr_byte(str.charAt(i+1)) == 2){
  				tmpStr = str.substring(0,i+1);
  				dot = "...";
  			}else {
  				if(i+2 != len) dot = "...";
  				tmpStr = str.substring(0,i+2);
  			}
  			break;
  		}else if(byte_count == limit){
  			if(i+1 != len) dot = "...";
  			tmpStr = str.substring(0,i+1);
  			break;
  		}
  	}
  	return tmpStr+dot;
  }


  /* 문자열을 replaceAll 한다.
   * param - str: 문자열
   * param - ori: 바꿀 문자열
   * param - replace: 바뀔 문자열
  */
  function replaceStr(str, ori, replace){
	  str = str.split(ori).join(replace);
	  return str;
  }
  
  /* e-mail 체크
   */
  function chkMail(str) 
  { 
	  var strMail = /^[\w\-]+@(?:(?:[\w\-]{2,}\.)+[a-zA-Z]{2,})$/;
        
      if(!str.match(strMail)) 
      { 
          return false; 
      }
      return true;
  }
  
  /*url 입력 체크
   * 
   */
  function chkUrl(str) 
  { 
	  var strUrl = /^([a-z]+):\/\/((?:[a-z\d\-]{2,}\.)+[a-z]{2,})(:\d{1,5})?(\/[^\?]*)?(\?.+)?$/i;
        
      if(!str.match(strUrl)) 
      { 
          return false; 
      }
      return true;
  }
 
  /*전화번호 입력체크
   * 
   */
  function chkTel(str) 
  { 
	  var strTel = /^[0-9]{2,5}-[0-9]{3,4}-[0-9]{4}/;
        
      if(!str.match(strTel)) 
      { 
          return false; 
      }
      return true;
  }
  
  /*숫자 입력체크
   * 
   */
  function chkNum(str) 
  { 
	  var strNum = /^[0-9]/;
        
      if(!str.match(strNum)) 
      { 
          return false; 
      }
      return true;
  }
  
  
  /* 우편번호 찾기
   */
  function zipcodePop(url) 
  { 
	  cmm_popup_windowOpenResize_title(url, 420, 380, 'zipcode');
  }
  
  /* 화면 가운데 팝업띄우기
   */
   var PopUpWindow= null;
  function cmm_popup_windowOpenResize_title(url, popupwidth, popupheight, popup_title)
  {
	  if (PopUpWindow != null && PopUpWindow)
	  {
		  PopUpWindow.close();
	  }
  	Top = (window.screen.height - popupheight) / 3;
  	Left = (window.screen.width - popupwidth) / 2;
  	if (Top < 0) Top = 0;
  	if (Left < 0) Left = 0;
  	Future = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + Left + ",top=" + Top + ",width=" + popupwidth + ",height=" + popupheight;
  	PopUpWindow = window.open(url, popup_title, Future)
  	PopUpWindow.focus();
  }

  //숫자 입력시 세자리 컴마찍기
  function filterNum(str) { 
  	re = /^\$|,/g; 
    	return str.replace(re, ""); 
  } 
  function commaSplitAndNumberOnly(ob) { 
      
      var txtNumber = '' + ob.value; 
      if (isNaN(txtNumber) || txtNumber.indexOf('.') != -1 ) { 
          ob.value = ob.value.substring(0, ob.value.length-1 ); 
          ob.value = commaSplitAndNumberOnly(ob); 
          ob.focus(); 
          return ob.value; 
      } 
      else { 
          var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])'); 
          var arrNumber = txtNumber.split('.'); 
          arrNumber[0] += '.'; 
          do { 
              arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2'); 
          } 
          while (rxSplit.test(arrNumber[0])); 
           
          if (arrNumber.length > 1) { 
              return arrNumber.join(''); 
          } 
          else { 
              return arrNumber[0].split('.')[0]; 
          } 
     } 
  } 
  function checkNumber(e) { 
  	var ob ="";
  	if(window.event){ 
  		ob = event.srcElement;
  	}else{
  		ob = e.target;
  	}

      ob.value = filterNum(ob.value); 
      ob.value = commaSplitAndNumberOnly(ob); 
      return false; 
  } 

	var newSize = 1;

	function changeFontSizeInit() {	
		var className = "main_contents";	
		document.getElementById("main_contents").className = className;
		newSize = 1;
	}

	function changeFontSize( updown ) {
		var preSize = newSize;
		if(updown == 1) newSize = newSize + 1;
		else if(updown == -1) newSize = newSize - 1;
			
		if ( newSize < 1 ) {
			alert("가장 작은 글꼴입니다.");
			newSize = 1;
			return;
		} else if ( newSize > 5 ) {
			alert("가장 큰 글꼴입니다.");
			newSize = 5;
			return;
		}
		
		if (newSize == 1)
		{
			var className = "main_contents";	
			document.getElementById("main_contents").className = className;
		}
		else {
			var className = "main_contents fs_util0" + newSize;
			if(document.getElementById("main_contents")) {
				document.getElementById("main_contents").className = className;
				fontFind(document.getElementById("main_contents"), updown);
			}	
		}
	}	

	function fontFind(obj, updown)
	{
		var addMinuse = "";
		if(updown == 1)  addMinuse = "+";
		else if(updown == -1) addMinuse = "-";
		
		if(obj.tagName) {
			if(obj.childNodes.length > 0) {
				if(obj.tagName == "FONT"){
					if(obj.getAttribute("SIZE")){				
						var temp = eval(obj.getAttribute("SIZE") + addMinuse + "1");
						temp = temp + "";
						obj.setAttribute("size",temp);
					}
				}
				if(obj.tagName == "P"){
					if(obj.style.fontSize){
						var fontSize = obj.style.fontSize;				
						fontSize = fontSize.replace("pt","");				
						obj.style.fontSize = eval("(" + fontSize + addMinuse +"3)+\"pt\"");
					}
				}		
				
				for(var nodeIdx = 0; nodeIdx < obj.childNodes.length ; nodeIdx++){
					fontFind(obj.childNodes[nodeIdx], updown);
				}
			}
			else
			{
				if(obj.tagName == "FONT"){
					if(obj.getAttribute("SIZE")){				
						var temp = eval(obj.getAttribute("SIZE") + addMinuse + "1");
						temp = temp + "";
						obj.setAttribute("size",temp);
					}
				}
				if(obj.tagName == "P"){
					if(obj.style.fontSize){
						var fontSize = obj.style.fontSize;				
						fontSize = fontSize.replace("pt","");				
						obj.style.fontSize = eval("(" + fontSize + addMinuse +"3)+\"pt\"");
					}
				}		
			}
		}
	}


	function allMenuShow()
	{
		document.getElementById("allMenuGnb").style.display = "block";
	}

	function allMenuHide()
	{
		document.getElementById("allMenuGnb").style.display = "none";
	}

	//edited by nalpari (2010.10.04)
	function initEle(){
		document.getElementById("mainFlex01").className = "hideEle";		//$("#mainFlex01").css("hideEle");
		document.getElementById("mainFlex02").className = "hideEle";
		document.getElementById("mainFlex03").className = "hideEle";
	}
	function initBtn(){
		document.getElementById("imgFlexCoastInfo").src = "/images/kor/main/hidebtnMainFlexCoastInfo.gif";
		document.getElementById("imgFlexLinkSeaDevide").src = "/images/kor/main/hidebtnMainFlexSeaDevide.gif";
		document.getElementById("imgFlexTideInfo").src = "/images/kor/main/hidebtnMainFlexTideInfo.gif";
	}
	function chgClass( idVal ){
		//flash div init
		initEle();
		//processing
		if(idVal == "mainFlexLinkCoastInfo"){
			initBtn();
			document.getElementById("mainFlex01").className = "showEle";
			document.getElementById("imgFlexCoastInfo").src = "/images/kor/main/showbtnMainFlexCoastInfo.gif";
		}else if(idVal == "mainFlexLinkSeaDevide"){
			initBtn();
			document.getElementById("mainFlex02").className = "showEle";
			document.getElementById("imgFlexLinkSeaDevide").src = "/images/kor/main/showbtnMainFlexSeaDevide.gif";
		}else{
			initBtn();
			document.getElementById("mainFlex03").className = "showEle";
			document.getElementById("imgFlexTideInfo").src = "/images/kor/main/showbtnMainFlexTideInfo.gif";
		}
	}

	//scripted by nalpari - 2010.10.13
	function openBeachInfo(num){
		var popPath = "/app/beach/beachInfo.asp?cmsCd=CM0375&ntNo="+num;
		//alert(popPath);
		window.open(popPath,"beachInfo","top=0,left=0,width=647,height=800,menubar=0,scrollbars=1");
	}


	//2011-06-24 임시 링크 변경  name=?띿큹&id=18&tide=SOKCHO&xScr=453061&yScr=621037&wr=1&seq_no=1
	function openBeachInfo2(name,id,tide,xScr,yScr,seq_no){
		var popPath = "http://info.khoa.go.kr/app/beach/geo_beach_info.asp?name="+name+"&id="+id+"&tide="+tide+"&xScr="+xScr+"&yScr="+yScr+"&wr=1&seq_no="+seq_no;
		//alert(popPath);
		window.open(popPath,"beachInfo","top=0,left=0,width=647,height=800,menubar=0,scrollbars=1");
	}



	/**********************************************
	- 실명인증 팝업 20060830추가
	- formName : 글쓰기 form name
	- fieldName: 사용자 이름 입력 input name
	**********************************************/ 
	function openCheckNameWindow(formName, fieldName) 
	{	
		//var url = "/korea/SCI/test_N_checkOk.asp?formName="+formName+"&fieldName="+fieldName;
		var url = "/SCI/openPopup.asp?formName="+formName+"&fieldName="+fieldName;
		window.open(url, "openPopup", "width=415, height=480, scrollbars=no, status=0, titlebar=0, toolbar=0 ");
	}

	function openCheckNameWindow2(formName, fieldName, sendType) 
	{	
		//var url = "/korea/SCI/test_N_checkOk.asp?formName="+formName+"&fieldName="+fieldName;
		var url = "/SCI/openPopup.asp?formName="+formName+"&fieldName="+fieldName+"&sendType="+sendType;
		window.open(url, "openPopup", "width=415, height=480, scrollbars=no, status=0, titlebar=0, toolbar=0 ");
	}

	function openGPINWindow(gourl) {
		wWidth = 360;
		wHight = 120;
		
		wX = (window.screen.width - wWidth) / 2;
		wY = (window.screen.height - wHight) / 2;
		// Request Page Call
		var w = window.open("/GPIN_SamplePage/Sample-AuthRequest.asp?gourl=http://www.khoa.go.kr"+gourl, "gPinLoginWin", "directories=no,toolbar=no,left="+wX+",top="+wY+",width="+wWidth+",height="+wHight);
	}

	function openCheckGPINWindow(formName, fieldName, sendType, gourl) {
		var url = "/GPIN_SamplePage/gpin_NCheck.asp?formName="+formName+"&fieldName="+fieldName+"&sendType="+sendType + "&gourl=" + gourl;
		// Request Page Call
		var w = window.open(url, "gPinLoginWin",  "width=415, height=480, scrollbars=no, status=0, titlebar=0, toolbar=0 ");	
	}

	function showCheckWindow(objName)
	{
		var chkNameWindow = document.getElementById(objName);
		chkNameWindow.style.display = "block";
	}

	function hiddenCheckWindow(objName)
	{
		var chkNameWindow = document.getElementById(objName);
		
		chkNameWindow.style.display = "none";
	}

	function showCheckWindowM(objName)
	{
		var chkNameWindow = document.getElementById(objName);
		var x,y;
		x = event.x;
		y = event.y;
		chkNameWindow.style.left = x;
		chkNameWindow.style.top = y+20;
		chkNameWindow.style.display = "block";
	}

	function hiddenCheckWindowM(objName)
	{
		var chkNameWindow = document.getElementById(objName);
		chkNameWindow.style.display = "none";
	}

	function forecastWinOpen(tide){
		//alert(tide);
		var now = new Date();
		var year = now.getFullYear();
		var mon = (now.getMonth()+1 > 9) ? ''+(now.getMonth()+1) : now.getMonth()+1;
		if(mon < 10){
			mon = '0' + mon;
		}
		var fPath = '/info/tide/' + tide + '/' + year + mon + '.htm';
		//alert(mon);
		window.open(fPath,'forecast','toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = yes, resizable = no, width = 620, height = 580');
	}

	function forecastWinOpen2(url){
		window.open(url,'forecast','toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = yes, resizable = no, width = 620, height = 580');
	}

	function searchAlert(){
		alert('준비중입니다.');
	}

	function initObject(){
		document.getElementById('div_1').className = "text_box hideObject";
		document.getElementById('div_2').className = "text_box hideObject";
		document.getElementById('div_3').className = "text_box hideObject";
		document.getElementById('div_4').className = "text_box hideObject";
		document.getElementById('div_5').className = "text_box hideObject";
		document.getElementById('div_6').className = "text_box hideObject";
		document.getElementById('div_7').className = "text_box hideObject";
		document.getElementById('div_8').className = "text_box hideObject";
		document.getElementById('div_9').className = "text_box hideObject";
	}

	function showObject(num){
		var idStr = "div_"+num;
		initObject();
		document.getElementById(idStr).className = "text_box showObject";
		//alert(document.getElementById(idStr).display);
		//alert(idVal);
	}


	function printContents(vGrp, vTitle){
		var ww = "710";
		var hh = "550";
		var param = "";
		
		param += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
	    param += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
	    param += "<head>\n";		
		param += "<title>" + vTitle + "</title>\n";	
		param += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";

		param += "<link href=\"/css/common.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
		param += "<link href=\"/css/kor/" + vGrp + "/board.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
		param += "<link href=\"/css/kor/print/print.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
		param += "<script language=\"javascript\">\n";
		param += "window.onload = function() {\n";		
		param += "\tif(document.getElementById(\"take_charge_w\")){\n";
		param += "\t\talert(\"aa\");document.getElementById(\"take_charge_w\").innerHTML = \"\";\n";	
		param += "\t}\n";
		param += "\tfor(var i = 0; i < document.getElementsByTagName(\"A\").length; i++){\n";
		param += "\t\tvar obj = document.getElementsByTagName(\"A\")[i];\n";
		param += "\t\tif(obj.id != \"print_btn\") {\n"; 	
		param += "\t\t\tobj.disabled = true;\n";	
		param += "\t\t\tobj.onclick = \"\";\n";
		param += "\t\t\tobj.onkeypress = \"\";\n";
		param += "\t\t}\n"; 
		param += "\t}\n";
		param += "}\n";
		
		param += "function enterChk(e) {\n";
		param += "\tif(window.event){\n";
		param += "\t\tif (event.keyCode == 13) {\n";
		param += "\t\t\treturn true;\n";
		param += "\t\t}else{\n";
		param += "\t\t\tif(e != null){\n";
		param += "\t\t\t\tif (e.which == 13) \n";
		param += "\t\t\t\treturn true;\n";
		param += "\t\t\t}\n";
		param += "\t\t}\n";
		param += "\t}\n";
		param += "\treturn false;\n";
		param += "}\n";
		param += "</script>\n";		
		param += "</head>\n";
		param += "<body>\n";
		param += "\t<div id=\"wrap\">\n";
		param += "\t\t<h1><img src=\"/images/kor/common/print_title.gif\" width=\"690\" height=\"52\" alt=\"콘텐츠 인쇄하기\" /></h1>\n";
		param += "\t\t\t<div id=\"contents\">\n";
		param += "<p class=\"page_depth\">" + document.getElementById("page_depth").innerHTML + "</p>\n";
		param += "<div class=\"btn_right\">\n";
		param += "<p class=\"bg_btn01\"><a id=\"print_btn\" href=\"#popupPrint\" onclick=\"window.print();return false\" onkeypress=\"if(enterChk(event))  {window.print(); return false;}\">인쇄하기</a></p>\n";
		param += "</div>\n";
		param += "<div class=\"page_title\">\n";
		param += "<h3 class=\"contents_title\">" + document.getElementById("contents_title").innerHTML + "</h3>\n";
		param += "</div>\n";
		param += "<div class=\"main_contents\"><!-- Print area -->\n";
		
		if(document.getElementById("main_contents"))
		{	
			param += document.getElementById("main_contents").innerHTML.replace("take_charge_w","take_charge_w style=\"display:none;\"");
			param = param.replace("last_depth","last_depth style=\"display:none;\"");
			param = param.replace("bg_btn","bg_btn style=\"display:none;\"");
			
		} 
		
		param += "</div>\n";
		param += "</div>\n";
		param += "</div>\n";
		param += "</body>\n";
		param += "</html>\n";
			
		var win = window.open("","printContentsWindow","top=0,left=0,width="+ww+",height="+hh+",menubar=0,scrollbars=1");
		win.document.write("" + param);
	
		win.document.close();
		win.focus();
	}


	function printCatalogs(vGrp, vTitle){
		var ww = "710";
		var hh = "550";
		var param = "";
		
		param += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
	    param += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
	    param += "<head>\n";		
		param += "<title>" + vTitle + "</title>\n";	
		param += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";

		param += "<link href=\"/css/common.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
		param += "<link href=\"/css/kor/" + vGrp + "/contents.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
		param += "<link href=\"/css/kor/print/print.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
		param += "<script language=\"javascript\">\n";
		param += "window.onload = function() {\n";		
		param += "\tif(document.getElementById(\"take_charge_w\")){\n";
		param += "\t\talert(\"aa\");document.getElementById(\"take_charge_w\").innerHTML = \"\";\n";	
		param += "\t}\n";
		param += "\tfor(var i = 0; i < document.getElementsByTagName(\"A\").length; i++){\n";
		param += "\t\tvar obj = document.getElementsByTagName(\"A\")[i];\n";
		param += "\t\tif(obj.id != \"print_btn\") {\n"; 	
		param += "\t\t\tobj.disabled = true;\n";	
		param += "\t\t\tobj.onclick = \"\";\n";
		param += "\t\t\tobj.onkeypress = \"\";\n";
		param += "\t\t}\n"; 
		param += "\t}\n";
		param += "}\n";
		
		param += "function enterChk(e) {\n";
		param += "\tif(window.event){\n";
		param += "\t\tif (event.keyCode == 13) {\n";
		param += "\t\t\treturn true;\n";
		param += "\t\t}else{\n";
		param += "\t\t\tif(e != null){\n";
		param += "\t\t\t\tif (e.which == 13) \n";
		param += "\t\t\t\treturn true;\n";
		param += "\t\t\t}\n";
		param += "\t\t}\n";
		param += "\t}\n";
		param += "\treturn false;\n";
		param += "}\n";
		param += "</script>\n";		
		param += "</head>\n";
		param += "<body>\n";
		param += "\t<div id=\"wrap\">\n";
		param += "\t\t<h1><img src=\"/images/kor/common/print_title.gif\" width=\"690\" height=\"52\" alt=\"콘텐츠 인쇄하기\" /></h1>\n";
		param += "<p class=\"bg_btn01\"><a id=\"print_btn\" href=\"#popupPrint\" onclick=\"window.print();return false\" onkeypress=\"if(enterChk(event))  {window.print(); return false;}\">인쇄하기</a></p>\n";
		param += "</div>\n";
		param += "<div class=\"main_contents\"><!-- Print area -->\n";
		
		if(document.getElementById("main_contents"))
		{	
			param += document.getElementById("main_contents").innerHTML.replace("take_charge_w","take_charge_w style=\"display:none;\"");
			param = param.replace("img_l_box","img_l_box style=\"display:none;\"");
			param = param.replace("last_depth","last_depth style=\"display:none;\"");
			param = param.replace("bg_btn","bg_btn style=\"display:none;\"");
			param = param.replace("cal_tab_nos","cal_tab_nos style=\"display:none;\"");
			param = param.replace("calender_tab","calender_tab style=\"display:none;\"");
		} 
		
		param += "</div>\n";
		param += "</div>\n";
		param += "</div>\n";
		param += "</body>\n";
		param += "</html>\n";
			
		var win = window.open("","printContentsWindow","top=0,left=0,width="+ww+",height="+hh+",menubar=0,scrollbars=1");
		win.document.write("" + param);
	
		win.document.close();
		win.focus();
	}
