function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function flash_movie(src, ids, width, height, wmode)
{
	var wh = "";
	if (parseInt(width) && parseInt(height))
		wh = " width='"+width+"' height='"+height+"' ";
	return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=wmode value="+wmode+"><param name=movie value="+src+"><param name=quality value=high><embed src="+src+" quality=high wmode="+wmode+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object>";
}

function obj_movie(src, ids, width, height, autostart)
{
	var wh = "";
	if (parseInt(width) && parseInt(height))
		wh = " width='"+width+"' height='"+height+"' ";
	if (!autostart) autostart = false;
	return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>";
}

function doc_write(cont)
{
	document.write(cont);
}

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_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_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];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//----------------------  ¸Þ´º¹Ù --------------------------
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var isNN = (navigator.appName.indexOf("Netscape")!=-1);


/******************************************************************************************************
 *	Æ¯È­ÇÔ¼ö
 ******************************************************************************************************/
// ------- ·Î±×ÀÎ °Ë»ç ---------------------------------
function login_check(f) {
	if (chkBlank_msg(f.id,"¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä")) return false;
	if (chkBlank_msg(f.pwd,"ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä")) return false;
	if(typeof(f.boan) == 'object'){
		if(f.boan.checked){
			var url = "https://www.kaes.or.kr:8101/login.php";
			 f.action = url;
		}
	}
	return true;
}

//------- waiting ·¹ÀÌ¾î °ü·ÃÇÔ¼ö ----------------------
function show_waiting() {
	document.check_attack.check.value = 1;
	var _x = document.body.clientWidth/2 + document.body.scrollLeft - 145;
	var _y = document.body.clientHeight/2 + document.body.scrollTop - 44;
	waiting.style.posLeft=_x;
	waiting.style.posTop=_y;
	waiting.style.visibility='visible';
}
function hide_waiting() {
	waiting.style.visibility='hidden';
	check_attack.check.value=0;
}

//----------Àü¼Û Ã¼Å© ------------------------
function submit_check() {
	if(document.check_attack.check.value==1) {
		alert('Áö±Ý Ã³¸®ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù·Á ÁÖ¼¼¿ä.');
		return true;
	}
	return false;
}

//----------Àü¼Û ¿ÀÄÉÀÌ ------------------------
function submit_ok() {
	document.check_attack.check.value=1;
}

// Ã¼Å©¹Ú½º ¿Ã Ã¼Å©
function AllCheck(f) {
	for (var i=0; i<f.elements.length; i++) {
		if (typeof(f.select)=="object") {
			if (f.elements[i].type=="checkbox") f.elements[i].checked = f.select.checked;
		} else {
			if (f.elements[i].type=="checkbox") f.elements[i].checked = !(f.elements[i].checked);
		}
	}
}

// ¼±ÅÃµÈ ¸®½ºÆ® »èÁ¦
function All_del(code) {
	var f = document.Brd_Frm;
	var cnt = 0;
	for (var i=0; i<f.elements.length; i++) {
		if (f.elements[i].name!="select" && f.elements[i].type=="checkbox" && f.elements[i].checked) cnt++;
	}
	if (cnt==0) { alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù."); return; }
	if (confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
		f.target = "";
		f.action = "";
		f.submit();
	}
}

// ¼±ÅÃµÈ ¸®½ºÆ® »èÁ¦ 2
function Check_del(f, act, tgt, mod) { // Æû, ¾×¼Ç, Å¸°Ù
	var cnt = 0;
	for (var i=0; i<f.elements.length; i++) {
		if (f.elements[i].name!="select" && f.elements[i].type=="checkbox" && f.elements[i].checked) cnt++;
	}
	if (cnt==0) { alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù."); return; }
	if (confirm("¼±ÅÃµÈ Ç×¸ñÀ» ¸ðµÎ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
		if (tgt) f.target = tgt; else f.target = '';
		if (mod) f.mode.value = mod;
		f.action = act;
		f.submit();
	}
}

// ÄÁÆß¸Þ¼¼Áö Ãâ·Â ÈÄ ÀÌµ¿
function conf_url(msg,murl) {
	if(confirm(msg)) window.location = murl;
}

// ¿ìÆí¹øÈ£ Ã£±â
function goZipsearch(zip_gubun, is_https) {
	var page = "/zip_search.html?zip_gubun=" + zip_gubun;
	if( is_https ) page += "&amp;is_https=" + is_https;
	open_win_center(page,'','417','240','yes','center');
}

// º´¿ø Ã£±â
function goHospsearch(hosp_gubun) {
	var page = "/hosp_search.html?hosp_gubun=" + hosp_gubun;
	open_win_center(page,'','500','290','yes','center');
}





/******************************************************************************************************
 *	°øÅëÇÔ¼ö
 ******************************************************************************************************/

//----------------- chk***() °¢Á¾ °Ë»ç ÇÔ¼ö ----------------------//

// ºó°ª °Ë»ç (°ø¹éÀ» Á¦¿ÜÇÏ°í ºó°ªÀÌ¸é true ¾Æ´Ï¸é false)
function chkBlank(box) { // box´Â object ex) input, textarea
	var valid = box.value.replace(/\s/gi,"");
	if (valid=="") return true;
	return false;
}

// ºó°ª °Ë»ç (¸Þ¼¼Áö Ãâ·Â / °ø¹éÀ» Á¦¿ÜÇÏ°í ºó°ªÀÌ¸é true ¾Æ´Ï¸é false)
function chkBlank_msg(box, msg) {
	var valid = box.value.replace(/\s/gi,"");
	if (valid=="") {
		if (!msg) msg = "ºó °ªÀÔ´Ï´Ù. °ªÀ» ÀÔ·ÂÇÏ¼¼¿ä.";
		alert(msg); box.focus();
		return true;
	}
	return false;
}

// Ã¹±ÛÀÚ ¿µ¹® °Ë»ç (Ã¹±ÛÀÚ°¡ ¿µ¹®¼Ò¹®ÀÚÀÌ¸é true ¾Æ´Ï¸é false)
function chkOnechar(strText) {
	var isEng = (/^[a-z]*$/g).test(strText.charAt(0));
	if (!isEng) return false;
	return true;
}

// ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô
function chkInputNum() {
	if (event != null) {
		var key = event.keyCode;
		if ((key!=13) && (key<48 || key>57)) { event.returnValue = false; return; }
	}
	return;
}

// ¼ýÀÚ°¡ µé¾îÀÖ´ÂÁö °Ë»ç (¼ýÀÚ°¡ µé¾îÀÖÀ¸¸é true ¼ýÀÚ°¡ ¾Èµé¾îÀÖÀ¸¸é false)
function chkNumeric(s) {
	var isNum = /\d/;
	if ( !isNum.test(s) ) return false;
	return true;
}

// ¼ýÀÚÇü½Ä °Ë»ç (ÀüºÎ¼ýÀÚ¸é true ¼ýÀÚ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖÀ» °æ¿ì false)
function chkNum(box) {
	var isNum = /^[\d]+$/;
	if ( box.value.search(isNum) ) return false;
	return true;
}

// ¼ýÀÚ Çü½Ä °Ë»ç (¸Þ¼¼Áö Ãâ·Â / Æ¯¼ö¹®ÀÚ Á¦°Å / type==1 ÀÌ¸é ¾Õ¿¡¿À´Â 0 Á¦°Å : 000012 -> 12)
function chkNum_msg(box,type) {
	var valid = "0123456789";
	var len = box.value.length;
	for (var i=0; i<len; i++) {
		if (valid.indexOf(box.value.charAt(i)) == -1) {
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä");
			box.value = box.value.substring(0, i); box.focus();
		}
	}
	if (type==1) {
		var result, ch, flag=0;
		if (len == 0 || box.value == "0" || box.value.charAt(0) != "0") return;
		for (var z=0; z<len; z++) {
			ch = box.value.charAt(z);
			if (ch=="0") {continue;} else {flag=1; box.value = box.value.substring(z); break;}
		}
		if (flag==0) box.value=0;
	}
}

// °ø¹é(½ºÆäÀÌ½º)°Ë»ç (°ø¹éÀÌ ÀÖÀ¸¸é true ¾øÀ¸¸é false)
function chkSpace(strText) {
	if (strText.search(/\s/) != -1) return true; else return false;
}

// ¿µ¹® Çü½Ä °Ë»ç (¿µ¹®ÀÌ¸é(°ø¹éÀÎÁ¤) true ¾Æ´Ï¸é false)
function chkEng(strText) {
	var isEng;
	for (var i=0; i<strText.length; i++) {
		isEng = (/^[a-zA-Z\s]*$/g).test(strText.charAt(i));
		if (!isEng) return false;
	}
	return true;
}

// ÇÑ±Û°Ë»ç (ÀüºÎÇÑ±ÛÀÌ¸é true ¾Æ´Ï¸é false)
function chkHangul(strText) {
	for (var i=0; i<strText.length; i++) {
		if (strText.charCodeAt(i)<0xAC00 || strText.charCodeAt(i)>0xD7A3) {
			if ((strText.charCodeAt(i)<12593 || strText.charCodeAt(i)>12643 ) && (strText.charCodeAt(i) != 32)) return false;
		}
	}
	return true;
}

// ¶óµð¿À¹öÆ° Ã¼Å© (¼±ÅÃµÈ °ÍÀÌ true ¾Æ´Ï¸é false)
function chkRadio(box) {
	for (var i=0; i<box.length; i++) { if (box[i].checked) return true; }
	return false;
}

// ¶óµð¿À¹öÆ° Ã¼Å© (¼±ÅÃµÈ °ÍÀÌ ÀÖÀ¸¸é false ¼±ÅÃµÈ °ÍÀÌ ¾øÀ¸¸é true°ª ¸®ÅÏÇÏ°í ¸Þ¼¼Áö Ãâ·Â)
function chkRadio_msg(box, msg) {
	var cnt = 0;
	for (var i=0; i<box.length; i++) {
		if (box[i].checked) return false;
	}
	if (!msg) msg = "¼±ÅÃÇ×¸ñÀ» ÇÏ³ª ÀÌ»ó ¼±ÅÃÇÏ½Ê½Ã¿À.";
	alert(msg);
	box[0].focus();
	return true;
}

// ÀÌ¸ÞÀÏ Çü½Ä °Ë»ç (¸ÂÀ¸¸é true Æ²¸®¸é false)
function chkEmail(box) {
	if (chkBlank_msg(box,"ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä")) return false;
	if (chkSpace(box.value)) {
		alert("ÀÌ¸ÞÀÏÀº °ø¹é¾øÀÌ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		box.value = box.value.replace(/\s/gi,"");
		box.focus(); box.select(); return false;
	}
	var email_exp = /^[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$/;
	if (!email_exp.test(box.value)) {
		alert("ÀÌ¸ÞÀÏ Çü½ÄÀÌ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.");
		box.focus(); box.select(); return false;
	}
//	if( box.value.length > 60 ) {
//		alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò´Â 60ÀÚ±îÁö À¯È¿ÇÕ´Ï´Ù.");
//		box.focus(); box.select(); return false;
//	}
	return true;
}

//------- ÆË¾÷ ¶ç¿ì±â ÇÔ¼ö (pos=="random" - À§Ä¡°¡ ÀÓÀÇ·Î, pos=="center" - °¡¿îµ¥ À§Ä¡, pos=="" - ÀÏ¹Ý) -------------------//
var win=null;
function open_win_center(url,name,w,h,scroll,pos) { // (°æ·Î,ÀÌ¸§,°¡·Î,¼¼·Î,½ºÅ©·ÑÀ¯¹«,À§Ä¡)
	if (pos=='random') {
		LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;
		TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
	}
	if (pos=='center') {
		LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
		TopPosition = (screen.height) ? (screen.height - h - 100) / 2 : 100;
	} else if ( (pos != 'center' && pos != 'random') || pos == null) {
		LeftPosition=0; TopPosition=0;
	}
	var settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll +
						',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win = window.open(url,name,settings);
	if (win.focus) win.focus();
}

function Photo_Frm(theForm){
        if(theForm.title.value==""){
                alert("»çÁøÁ¦¸ñÀ» ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù!");
                theForm.title.focus();
                return false;
        }
        if(theForm.data_file1.value==""){
                alert("»çÁøÀ» ¼±ÅÃÇØ¾ß ÇÕ´Ï´Ù!");
                theForm.data_file1.focus();
                return false;
        }
        if(theForm.data_file2.value==""){
                alert("»çÁøÀ» ¼±ÅÃÇØ¾ß ÇÕ´Ï´Ù!");
                theForm.data_file2.focus();
                return false;
        }
}

function PhotoMod_Frm(theForm){
        if(theForm.title.value==""){
                alert("»çÁøÁ¦¸ñÀ» ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù!");
                theForm.title.focus();
                return false;
        }
}

function Cancel() {
	f = document.form1;
	f.reset();
}

//------------------ ·Î±×ÀÎ CHECK FORM --------------
function LoginFrm(theForm)
{
	if (theForm.id.value == "") {
		window.alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.id.focus();
		return false;
	}
	if (theForm.pwd.value == "") {
		window.alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.pwd.focus();
		return false;
	}
}

//------------------ ¼­ºê ¸Þ´º ÆîÄ§ --------------
function spanMenu(subName) {
	if (subName.style.display == "none") {
		subName.style.display = "";
	} else {
		subName.style.display = "none";
	}
}


//----------------------- »õÃ¢ ¶ç¿ì±â(½ºÅ©·Ñ¹Ù À¯) ----------------------------
function Win_scroll(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=yes,resizable=no,top=' + window_top + ',left=' + window_left + '');
}

//----------------------- (½ºÅ©·Ñ¹Ù À¯) ----------------------------
function Win_scroll2(theURL) {
	location.href=theURL;
}

function Win_pop(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=yes,resizable=no,top=' + window_top + ',left=' + window_left + '');
}

//----------------------- »õÃ¢ ¶ç¿ì±â(½ºÅ©·Ñ¹Ù ¹«) ----------------------------
function Win_mu(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=no,resizable=no,top=' + window_top + ',left=' + window_left + '');
}

//----------------------- »õÃ¢ ¶ç¿ì±â(½ºÅ©·Ñ¹Ù ¹«) ----------------------------
function Win_Date(theURL,wide,high) {
	var window_left = (screen.width-740)/2;
	var window_top = (screen.height-580)/2;
	window.open(theURL,"DateT",'width='+wide+',height='+high+',scrollbars=no,resizable=no,top=' + window_top + ',left=' + window_left + '');
}

//------------------ ¶óµð¿À¹öÆ° CHECK --------------
function radioCheck(oN){
	for(i=0;i<oN.length;i++){
		if(oN[i].checked){ return true; }
	}
	return false;
}

//-----------------------E-mail ÁÖ¼ÒÈ®ÀÎ----------------------------
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(".") > 2) && (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 Check_Num(theForm) {
	t = theForm.value ;
	for(i=0;i<t.length;i++) {
		if (t.charAt(i)<'0' || t.charAt(i)>'9') {
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ;
			theForm.value="";
			theForm.focus();
			return false ;
		}
	}
	return true;
}
//----------------------- ¼ýÀÚ È®ÀÎ(ÀÚ¸®¼ö Æ÷ÇÔ) ----------------------------
function Check_Tel(theForm,mm) {
	t = theForm.value;
	for(i=0;i<t.length;i++) {
		if (t.charAt(i)<'0' || t.charAt(i)>'9') {
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ;
			theForm.value="";
			theForm.focus() ;
			return false ;
		}
	}
	if (t.length < mm)
	{
		alert("¼ýÀÚÀÇ ±æÀÌ¸¦ È®ÀÎÇÏ½Ê½Ã¿ä.");
		theForm.focus();
		return false;
	}
	return true;
}

//--------------------- ÆÄÀÏ Æ÷¸Ë CHECK -------------------------
function formatChk(theForm)
{
    var fname = theForm.value;
    sp_arry = fname.split(".");
    sp_einx = sp_arry.length - 1;
    sp_arry[sp_einx] = sp_arry[sp_einx].toLowerCase();

	return sp_arry[sp_einx];
}

//------------------ Ã¼Å©¹Ú½º CHECK --------------
function ChkboxCheck(str,no){
	for(var cnt = 1; cnt <= no; cnt++){
		obj = eval("document.regist_frm." + str + cnt);
		if(obj == "[object]") {
			if(obj.checked == true){	return true;	}
		}
	}
	return false;
}

//----------------------- °Ë»ö ----------------------------
function Search_send(theForm)
{
	if(theForm.keyword.value == "")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		theForm.keyword.focus();
		return false;
	}
}

//------------------------ ¿ìÆí¹øÈ£°Ë»ö ----------------------------
function OpenZipcode(z){    //open zip code check win
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	zName = "/zipcode.html?zip_gubun="+z
	window.open(zName,"ZipWin",'width=395,height=197,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ º´¿ø°Ë»ö ----------------------------
function OpenHosp(z){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	murl = "/hosp_search.html?field="+z
	window.open(murl,"HosWin",'width=415,height=245,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ »çÁø ÀÔ·Â ----------------------------
function OpenPhoto(str){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	murl = "/photo_up.html?photo_id="+str;
	window.open(murl,"PhoWin",'width=520,height=263,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ °øÁö»çÇ× PopUp ----------------------------
function OpenNotify(murl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NoticeWin",'width=396,height=365,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ ÀÇ·á°è´º½º PopUp ----------------------------
function OpenNews(murl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NewsWin",'width=529,height=345,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ Çà»çÀÏÁ¤ PopUp ----------------------------
function OpenEvent(murl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NewsWin",'width=396,height=365,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//-------------------------Æ¯¼ö¹®ÀÚ ÀÔ·Â-------------------------
function ch_insert(str)
{
	var win_left = (screen.width-640)/2;
	var win_top = (screen.height-480)/2;
	window.open ("/sp_char.html?code="+str, "character", 'width=340, height=383, scrollbars=no, resizable=no, top='+win_top+',left='+win_left+'')
}

//------------------------ »èÁ¦ ----------------------------
function delconf(murl)
{
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	window.location = murl;
}

//---------------------- ÂÊÁö popup -------------
function Memo_open(myurl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open (myurl, "memo", 'width=460, height=315,scrollbars=yes,top=' + window_top + ',left=' + window_left + '')
}

//---------------------- ÂÊÁö -------------
function Memo_wasteconf(murl){
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?\n\nÈÞÁöÅë·Î ÀÌµ¿µË´Ï´Ù."))
	window.location = murl;
}

//---------------------- ÂÊÁö -------------
function Memo_delconf(murl){
	if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?\n\n¼±ÅÃÇÑ ÂÊÁö°¡ ¿ÏÀüÈ÷ »èÁ¦µË´Ï´Ù."))
	window.location = murl;
}

//---------------------- ÂÊÁö -------------
function Sender_delconf(murl){
	if(confirm("ÂÊÁö¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	window.location = murl;
}

//----------------------- ¾ÆÀÌµð Ã£±â ----------------------------
function Find_Send(theForm)
{
	if (!theForm.name.value) {
		window.alert("¼º¸íÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.name.focus();
		return false;
	}
	if (!theForm.jumin1.value) {
		window.alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.jumin1.focus();
		return false;
	}
	if (!theForm.jumin2.value) {
		window.alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.jumin2.focus();
		return false;
	}
}

//----------------------- ÆÐ½º¿öµå Ã£±â ----------------------------
function PwdFind_send(theForm)
{
	if (!theForm.id.value) {
		window.alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.id.focus();
		return false;
	}
	if (!theForm.email.value) {
		window.alert("°¡ÀÔ½Ã ÀÔ·ÂÇÏ¼Ì´ø ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.email.focus();
		return false;
	}else{
		if (!isEmail(theForm.email.value)){
			alert("Á¤È®ÇÑ e-mailÇü½ÄÀÌ ÇÊ¿äÇÕ´Ï´Ù, È®ÀÎÈÄ ´Ù½Ã ÀÔ·Â ¹Ù¶ø´Ï´Ù!");
			theForm.email.value="";
			theForm.email.focus();
			return false;
		}
	}
}

//----------------------- È¸¿ø°Ë»ö ----------------------------
function User_send(theForm)
{
	var cnt = 0;
	for( var i=0; i< theForm.elements.length; i++)
	{
		var temp = theForm.elements[i];
		if(temp.value != "")
		cnt += 1;
	}
	if (cnt == 0)
	{
		window.alert("ÇÑ°¡Áö ÀÌ»óÀÇ °Ë»öÁ¶°Ç°ú °Ë»ö¾î¸¦ ¼±ÅÃ,ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		theForm.key.focus();
		return false;
	}else{
		if(theForm.key.value != "" && !theForm.keyword.value){
			window.alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
			theForm.keyword.focus();
			return false;
		}
		if(theForm.keyword.value != "" && !theForm.key.value){
			window.alert("°Ë»öÁ¶°ÇÀ» ¼±ÅÃÇÏ½Ê½Ã¿ä.");
			theForm.key.focus();
			return false;
		}
	}
}

function goQuiz(theForm)
{
	theForm.submit();
}

//------------------ ¾à°ü¿¡ µ¿ÀÇ --------------
function Chk_Agree()
{
	theForm = document.signform;
	if(!radioCheck(theForm.agree))
	{
		alert("¾à°ü¿¡ µ¿ÀÇÇÏ¿© ÁÖ½Ê½Ã¿À.");
		theForm.agree[0].focus();
		return false;
	}else{
		if(theForm.agree[1].checked == true){
			alert("¾à°ü¿¡ µ¿ÀÇÇÏ¿© ÁÖ½Ê½Ã¿À.");
			theForm.agree[0].focus();
			return false;
		}
	}
	theForm.submit();
}

//------------- È¸ºñ½ÂÀÎ ·¹ÀÌ¾î º¸±â -----------------
function ondisplay(num, ex, ey)
{
	dd = eval('Layer'+num+'.style');
	dd.top = ey+document.body.scrollTop;
	dd.left=(ex-230);
	dd.display='block';
	dd.visibility = 'visible';
}

//------------- È¸ºñ½ÂÀÎ ·¹ÀÌ¾î ´Ý±â -----------------
function offdisplay(num)
{
	dd = eval('Layer'+num+'.style');
	dd.display='none';
	dd.visibility = 'hidden';
}

function autotab(input,len, e) {
	var keycd = (isNN) ? e.which : e.keyCode;
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !iscontain(filter, keycd))
	{
		input.value = input.value.slice(0, len);
		input.form[(getindex(input)+1) % input.form.length].focus();
	}
}

function iscontain(filter, keycd) {
	var found = false;
	var index = 0;

	while(!found && index < filter.length)

	if(filter[index] == keycd) found = true;
	else index++;

	return found;
}
function getindex(input) {
	var index = -1;
	var i = 0;
	var found = false;

	while (i < input.form.length && index == -1)

	if (input.form[i] == input)index = i;
	else i++;

	return index;
	return true;
}

//----------------------- ÃÊ·Ï Á¢¼ö/¼öÁ¤ check ----------------------------
function Err_abs(str)
{
	switch(str)
	{
		case"green":
		var msg = "ÃÊ·Ï Á¢¼ö¹× ¼öÁ¤±â°£ÀÌ Áö³µ½À´Ï´Ù";
		break;

		case"entry":
		var msg = "»çÀüµî·Ï ±â°£ÀÌ Áö³µ½À´Ï´Ù";
		break;

		case"slide":
		var msg = "±¸¿¬½½¶óÀÌµå Á¢¼ö ±â°£ÀÌ Áö³µ½À´Ï´Ù";
		break;

		case"lecture":
		var msg = "°­ÀÇ ½½¶óÀÌµå Á¢¼ö ±â°£ÀÌ Áö³µ½À´Ï´Ù";
		break;
	}
	alert(msg+'\n\nÀÚ¼¼ÇÑ »çÇ×Àº ÇÐÈ¸·Î ¹®ÀÇ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
}

//----------------------- °Ô½ÃÆÇ »èÁ¦ Popup ÆäÀÌÁö ----------------------------
function Del_OpenWin(myurl){
	var window_left = (screen.width-400);
	var window_top = (screen.height-450);
	window.open (myurl, "mymenu", 'width=172, height=103,top=' + window_top + ',left=' + window_left + '')
}

//------------------------ »èÁ¦ ----------------------------
function Del_conf(murl)
{
	if(confirm("Do you want this Event?"))
	window.location = murl;
}







/******************************************************************************************************
 *	È¸¿ø ±âº»Á¤º¸ °ü·Ã
 ******************************************************************************************************/
// ÀüÈ­¹øÈ£(ÇÚµåÆù,ÆÑ½ºÆ÷ÇÔ) Ã¼Å© (ÀüÈ­¹øÈ£°¡ ÀÌ»óÇÏ¸é true ¾ÈÀÌ»óÇÏ¸é false)
function chkTel_msg(a, b, c, target) {
	var tel = new Array("02","031","032","033","041","042","043","051","052","053","054","055","061","062","063","064","010","011","016","017","018","019");
	var pcs = new Array("010","011","016","017","018","019");

	var isNum = /^[\d]+$/;
	var a_len = a.value.length;
	var b_len = b.value.length;
	var c_len = c.value.length;
	var msg1 = target + "¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.";
	var msg2 = target + "¹øÈ£ ÀÚ¸´¼ö¸¦ È®ÀÎÇÏ¼¼¿ä.";
	if (target == "¿¬¶ôÃ³") {
		var msg1 = target + "¸¦ ÀÔ·ÂÇÏ¼¼¿ä.";
		var msg2 = target + " ÀÚ¸´¼ö¸¦ È®ÀÎÇÏ¼¼¿ä.";
	}

	if (chkBlank_msg(a,msg1)) return true;
	if (a.value.search(isNum)) { alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ; a.value=""; a.focus() ; return true ; }
	if (a_len<2 || a_len>3) { alert(msg2); a.focus(); return true; }
	if (target=="ÇÚµåÆù") var limit = pcs.length;
	else var limit = tel.length;

	var cnt=0;
	for (var i=0; i<limit; i++) {
		if (target=="ÇÚµåÆù") { if (a.value==pcs[i]) cnt++; }
		else { if (a.value==tel[i]) cnt++; }
	}
	if (cnt==0) { alert("Àß¸øµÈ ¹øÈ£ÀÔ´Ï´Ù."); a.value=""; a.focus(); return true; }

	if (chkBlank_msg(b,msg1)) return true;
	if (b.value.search(isNum)) { alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ; b.value=""; b.focus() ; return true ; }
	if (b_len<3 || b_len>4) { alert(msg2); b.focus(); return true; }

	if (chkBlank_msg(c,msg1)) return true;
	if (c.value.search(isNum)) { alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.") ; c.value=""; c.focus() ; return true ; }
	if (c_len!=4) { alert(msg2); c.focus(); return true; }
	return false;
}

/******************************************************************************************************
 *	°Ô½ÃÆÇ °ü·Ã ÇÔ¼ö
 ******************************************************************************************************/
// °Ô½ÃÆÇ ±Û¾²±â °Ë»ç
function chkBoard(f) {
	if (submit_check()) return false; // Àü¼ÛÃ¼Å©

	if (typeof(f.subject) == 'object') { if (chkBlank_msg(f.subject,"Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä!")) return false; }
	if (typeof(f.name) == 'object') { if (chkBlank_msg(f.name,"ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇÏ¼¼¿ä!")) return false; }
	if (typeof(f.email) == 'object') { chkEmail(f.email); }
	if (typeof(f.body) == 'object') { if (chkBlank_msg(f.body,"³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä!")) return false; }

	if (typeof(f.pwd) == 'object') { if (chkBlank_msg(f.pwd,"ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!")) return false; }

	if (f.mode.value=="edit") var msg = "¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î?"; else var msg = "µî·ÏÇÏ½Ã°Ú½À´Ï±î?";
	if (!confirm(msg)) return false;

	submit_ok();
	return true;
}

// °Ë»öÆû Ã¼Å©
function chkSearch(f) {
	if (typeof(f.key)=="object") { 	if (chkBlank_msg(f.key,"°Ë»öºÐ·ù¸¦ ¼±ÅÃÇÏ¼¼¿ä")) return false; }
	if (typeof(f.keyword)=="object") { 	if (chkBlank_msg(f.keyword,"°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä")) return false; }
	return true;
}

// ÄÚ¸àÆ® Ã¼Å©
function chkComment(f) {
	if (typeof(f.name)=="object") { if (chkBlank_msg(f.name,"ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä")) return false; }
	if (typeof(f.comment)=="object") { if (chkBlank_msg(f.comment,"³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä")) return false; }
	return true;
}
