<!--
function OnlyNum(){		//¼ýÀÚ¸¸ ÀÔ·Â¹Þµµ·Ï
	if((event.keyCode<48)||(event.keyCode>57)){ 
		alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue = false;
	}
}


function isEmail(str) {		// ¸ÞÀÏÀÇ À¯È¿¼º °ËÁõ
	// Á¤±Ô½Ä Áö¿ø ¿©ºÎ Á¡°Ë
	var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
	return (str.indexOf(".") > 3) && (str.indexOf("@") > 0);
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  
	return (!r1.test(str) && r2.test(str));
}

function mail_check(obj){		// ¸ÞÀÏ Ã¼Å©
	var str = obj.value;
	if(str != ""){
		if(isEmail(str) != true){
			alert('¿Ã¹Ù¸¥ ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
			obj.value = "";
			obj.focus();
			return false;
		}
	}
}

function blank_check(obj) { //°ø¹é °É·¯ ³»±â//
		for(i = 0 ; i< obj.value.length ; i++){	
			if(obj.value.substring(i , i+1) == " "){ 
				alert("°ø¹é¾øÀÌ ÀÔ·ÂÇÏ¼¼¿ä.");
				obj.value = "";
				obj.focus();
				return false;
			 	
			}
		}
}

function condition_id(id,min,max){  // ¾ÆÀÌµð Á¶°Ç Ã¼Å©//
		var userid = id.value;
		for (i = 0; i < userid.length; i++) {
		  if ((userid.length > min-1) && (userid.length < max+1)){
			if (userid.charAt(i) >= '0' && userid.charAt(i) <= '9')
				continue;
			else if (userid.charAt(i) >= 'a' && userid.charAt(i) <= 'z')
				continue;
			else if (userid.charAt(i) >= 'A' && userid.charAt(i) <= 'Z')
				continue;
			else {
				alert("ID´Â ÃÖ¼Ò "+min+"ÀÚ¿¡¼­ ÃÖ´ë "+max+"ÀÚ ±îÁöÀÇ ¿µ¹®°ú ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
				id.value = "";
				id.focus();
				return false;
			}
          }else if ((userid.length < min) || (userid.length > max)) {
				alert("ID´Â ÃÖ¼Ò "+min+"ÀÚ¿¡¼­ ÃÖ´ë "+max+"ÀÚ ±îÁöÀÇ ¿µ¹®°ú ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
				id.value = "";
				id.focus();
				return false;
			}
		}
 }

function condition_pwd(pwd, min, max){  // ,ÆÐ½º¿öµå Á¶°Ç Ã¼Å©//
		var userpwd = pwd.value;
		for (i = 0; i < userpwd.length; i++) {
		  if ((userpwd.length > min-1) && (userpwd.length < max+1)){
			if (userpwd.charAt(i) >= '0' && userpwd.charAt(i) <= '9')
				continue;
			else if (userpwd.charAt(i) >= 'a' && userpwd.charAt(i) <= 'z')
				continue;
			else if (userpwd.charAt(i) >= 'A' && userpwd.charAt(i) <= 'Z')
				continue;
			else {
				alert("ºñ¹Ð¹øÈ£´Â ÃÖ¼Ò "+min+"ÀÚ¿¡¼­ ÃÖ´ë "+max+"ÀÚ ±îÁöÀÇ ¿µ¹®°ú ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
				pwd.value = "";
				pwd.focus();
				return false;
			}
          }else if ((userpwd.length < min) || (userpwd.length > max)) {
				alert("ºñ¹Ð¹øÈ£´Â ÃÖ¼Ò "+min+"ÀÚ¿¡¼­ ÃÖ´ë "+max+"ÀÚ ±îÁöÀÇ ¿µ¹®°ú ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
				pwd.value = "";
				pwd.focus();
				return false;
			}
		}
 }

function isCondition(cmt,id,min,max){  // ¾ÆÀÌµð Á¶°Ç Ã¼Å©//
		var userid = id.value;
		for (i = 0; i < userid.length; i++) {
		  if ((userid.length > min-1) && (userid.length < max+1)){
			if (userid.charAt(i) >= '0' && userid.charAt(i) <= '9')
				continue;
			else if (userid.charAt(i) >= 'a' && userid.charAt(i) <= 'z')
				continue;
			else if (userid.charAt(i) >= 'A' && userid.charAt(i) <= 'Z')
				continue;
			else {
				alert(""+cmt+"´Â ÃÖ¼Ò "+min+"ÀÚ¿¡¼­ ÃÖ´ë "+max+"ÀÚ ±îÁöÀÇ ¿µ¹®°ú ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
				id.value = "";
				id.focus();
				return false;
			}
          }else if ((userid.length < min) || (userid.length > max)) {
				alert(""+cmt+"´Â ÃÖ¼Ò "+min+"ÀÚ¿¡¼­ ÃÖ´ë "+max+"ÀÚ ±îÁöÀÇ ¿µ¹®°ú ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
				id.value = "";
				id.focus();
				return false;
			}
		}
 }



function SearchChk(){	// °Ë»öÃ¼Å©
	with (window.document.searchfrm){
		if((finder[0].checked==false)&&(finder[1].checked==false)){
			alert("°Ë»öÁ¶°ÇÀ» ¼±ÅÃÇÏ¼¼¿ä.");
			finder[0].focus();
			return false;
		}
		if(search.value==""){
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			search.focus();
			return false;
		}
		return true;
	}
}

function GoTo(idx,tname,page,etc){		// ÀÌÀü/´ÙÀ½±Û·Î ÀÌµ¿
	location.href = "view.asp?idx="+idx+"&tablename="+tname+"&page="+page+"&"+etc;
}

function Modify(tname,section){	// ¼öÁ¤
		window.document.viewfrm.action = "check_pwd.asp?tablename="+tname+"&section="+section+"&pname=modify.asp"
		window.document.viewfrm.submit();
}

function Del(tname,section){		// »èÁ¦
		chk = confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");
		if(chk){
			window.document.viewfrm.action = "check_pwd.asp?tablename="+tname+"&section="+section+"&pname=delete.asp"
			window.document.viewfrm.submit();
		}
}


function AModify(tname){	// ¼öÁ¤
		window.document.viewfrm.action = "modify.asp?tablename="+tname;
		window.document.viewfrm.submit();
}

function ADel(tname){		// »èÁ¦
		chk = confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");
		if(chk){
			window.document.viewfrm.action = "delete.asp?tablename="+tname;
			window.document.viewfrm.submit();
		}
}


function Reply(tname,section){		//´äº¯
		window.document.viewfrm.action = "write.asp?tablename="+tname+"&section="+section;
		window.document.viewfrm.submit();
}

function Write(tnmae){		//	µî·Ï ÆäÀÌÁö·Î ÀÌµ¿
		location.href = "write.asp?tablename="+tname;
}

function FileDown(filepath, filename){
	window.DownFrame.location.href = "/include/down.asp?file="+filepath+"&fn=\\"+filename;
}

function FileDown2(filepath, filename){
	window.DownFrame.location.href = "/include/down2.asp?file="+filepath+"&fn=\\"+filename;
}


function OpenImg(filepath, title, type, width, height){	 //Æ÷Åä¿¡¼­ ÀÌ¹ÌÁö ¿øº» º¸±â
		var scrollbars = "";
		if(width==""||width>900){
				width = 880;
				scrollbars = ",scrollbars=yes";
		}
		if(height==""||height>600){
				height = 590;
				scrollbars = ",scrollbars=yes";
		}
		window.open("/include/fileview.asp?filepath="+filepath+"&type="+type+"&title="+title,"Viewer","width="+width+", height="+height+",top=0,left=0,menubar=no,status=no"+scrollbars)
}

function OpenImg2(filepath, title, type, width, height){	 //Æ÷Åä¿¡¼­ ÀÌ¹ÌÁö ¿øº» º¸±â
		var scrollbars = "";
		//if(width==""||width>900){
				width = 500;
				scrollbars = ",scrollbars=yes";
		//}
		//if(height==""||height>600){
				height = 400;
				scrollbars = ",scrollbars=yes";
		//}
		window.open("/include/fileview.asp?filepath="+filepath+"&type="+type+"&title="+title,"Viewer","width="+width+", height="+height+",top=0,left=0,menubar=no,resizable=yes,status=no"+scrollbars)
}


function resizeImg(imgObj, width, height) {
   if(imgObj.width>width){
	  imgObj.width = width;
   }
   if(height!=""){
	   if(imgObj.height>height){
		  imgObj.height = height;
	   }
   }
}


function resizeImg2(imgObj, width, height) {
	document.all.fw.value = imgObj.width;
	document.all.fh.value = imgObj.height;
	//-- Æ÷Åä¿¡¼­ ÀÌ¹ÌÁö È®´ë º¸±â Ã³¸® ÇÒ¶§, ÀÌ¹ÌÁö ¿ø·¡ »çÀÌÁî Àâ¾ÆÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù.
   if(imgObj.width>width){
	  imgObj.width = width;
   }
   if(height!=""){
	   if(imgObj.height>height){
		  imgObj.height = height;
	   }
   }
}

function resizeImgFile(imgObj, imgwid, imghei, width, height) {
	if(imgwid==""){imgwid=imgObj.width;}
	if(imghei==""){imghei=imgObj.height;}
	//document.all.fw.value = imgwid;
	//document.all.fh.value = imghei;
   if(imgObj.width>width){
	  imgObj.width = width;
   }
   if(height!=""){
	   if(imgObj.height>height){
		  imgObj.height = height;
	   }
   }
}

function sTag(tag){
	if (tag=="2") { //TEXT + HTML
		alert("ÀÚµ¿ ÁÙ¹Ù²ÞÀÌ Àû¿ëµË´Ï´Ù.\n\nÁï, ÁÙ¹Ù²ï °÷ÀÌ <br>ÅÂ±×·Î º¯È¯µË´Ï´Ù.");
	}else if  (tag=="0") { //TEXT
		alert("HTML ÅÂ±×°¡ Àû¿ëµÇÁö ¾Ê½À´Ï´Ù.");
	}else if  (tag=="1") { //HTML
		alert("HTML ÅÂ±×·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n\nÀÚµ¿ÁÙ¹Ù²ÞÀÌ µÇÁö ¾Ê°í Á÷Á¢ <br>ÅÂ±×¸¦ ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù.");
	}
}
//-->

