// JavaScript Document

//==========================================   ÀüÃ¼ ÇÔ¼ö Á¤ÀÇ    ===============================================
//	(°øÅë ÇÔ¼ö)
//================
//	btn_login						:				·Î±×ÀÎ½Ã Ã¼Å©ÇÑ´Ù.
//	fun_null_chk					:				³Î°ªÃ¼Å©¸¦ ÇÑ´Ù.
//	fun_length_between				:				ÀÔ·Â¹Þ´Â ¹®ÀÚ,¼ýÀÚÀÇ ±æÀÌ¿¡ Á¦ÇÑÀ» µÐ´Ù. ÃÖ¼Ò,ÃÖ´ë
//	fun_length_chk					:				ÀÔ·Â¹ÞÀº ¹®ÀÚÀÇ ±æÀÌ¿¡ Á¦ÇÑÀ» µÐ´Ù.
//	fun_comparison_tchk				:				µÎ°ªÀÌ ÀÏÄ¡ÇÏ´Â Áö¸¦ Ã¼Å©
//	fun_comparison_fchk				:				µÎ°ªÀÌ ÀÏÄ¡ÇÏÁö¾Ê´Â Áö¸¦ Ã¼Å©
//	fun_submit_chk					:				ÃÖÁ¾ È®ÀÎ confirmÇÔ¼ö¸¦ ÀÌ¿ë Ã¼Å©ÇÑ´Ù.
//	fun_del_chk						:				ÃÖÁ¾ »èÁ¦ ¿©ºÎ¸¦ confirmÇÔ¼ö¸¦ ÀÌ¿ë Ã¼Å©ÇÑ´Ù.
//	fun_self_close					:				window.openÀ¸·Î ¿­¸°Ã¢À» ´ÝÀ» °æ¿ì Ã¼Å©
//	view_alert						:				°æ°íÃ¢À» Ãâ·ÂÇÑ´Ù.

//	(±âÅ¸ ÇÔ¼ö)
//=================
//	btn_mem_write					:				È¸¿øÃß°¡½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	btn_mem_motify					:				È¸¿ø¼öÁ¤½Ã Ã¼Å©ÇÑ´Ù.
//	btn_sch_write					:				½ºÄÉÁìÃß°¡ ½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	btn_sch_motify					:				½ºÄÉÁì¼öÁ¤ ½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	btn_mem_del						:				È¸¿ø »èÁ¦½Ã Ã¼±×
//	btn_sch_del						:				½ºÄÉÁì »èÁ¦½Ã Ã¼±×
//	btn_cate_del					:				Ä«Å×°í¸® »èÁ¦½Ã Ã¼±×
//	btn_cate_add					:				Ä«Å×°í¸® Ãß°¡½Ã Ã¼Å©
//
//==============================================================================================================

//===========================================  °øÅë ÇÔ¼ö Á¤ÀÇ   ================================================

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_ascii_numchk
//	Æò¼Ç ±â´É 		 :	¼ýÀÚÀÎÁö Ã¼Å©
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_ascii_numchk(word){

	var err;
	err=0;
	if(word.value.charCodeAt(0) == 0x30){
		err++;
	}
      for(i=0; i<word.value.length; i++)
      {
        var cv = word.value.charCodeAt(i);
        if(!( 0x30 <=cv && cv<= 0x39))
        {
            err++;
        }
      } 
	  if (err >0)
	  {
		  alert('Àß¸øµÈ ¼ýÀÚ ÀÔ´Ï´Ù.');
		  word.value="";
		  word.focus();
		  return 0;
	  }
	  else{
		return 1;
	  }

}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_ascii_wordchk
//	Æò¼Ç ±â´É 		 :	Æ¯¼ö¹®ÀÚ Ã¼Å©
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_ascii_wordchk(word){
	
      for(i=0; i<word.value.length; i++)
      {
		var cv = word.value.charCodeAt(i);

		if(cv >47 && cv <58)
		  { return 1;}
		else if(cv >64 && cv<91)
		  { return 1;}
		else if(cv>96 && cv<123)
		  {	return 1; }
		else if (44032 <= cv && cv <= 55203)
		  { return 1;}
		else
		  {		
			window.alert('Æ¯¼ö¹®ÀÚ »ç¿ëÀº ±ÝÁöÀÔ´Ï´Ù.');
			word.value ="";
			word.focus();
			return 0;
		  }//end if

	}//end for
}//end func

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_date_chk
//	Æò¼Ç ±â´É 		 :	¾ÕµÚ ³¯Â¥ Ã¼Å©	µÚÀÇ ³¯Â¥°¡ ¾ÕÀÇ ³¯Â¥º¸´Ù ÀÌ¸£¸é...>.<
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_date_chk(err,sdate,edate){
	
//	var cha=0;
//	cha = edate.value-sdate.value;
//	window.alert(err+" : "+cha);

	var date1 = sdate.value.split("-")
	var date2 = edate.value.split("-")

	//date1[0]		:	³âµµ
	//date1[1]		:	¿ù
	//date1[2]		:	ÀÏ
	var firyear = fun_num_change(date1[0]);
	var endyear = fun_num_change(date2[0]);
	var firmonth = fun_num_change(date1[1]);
	var endmonth = fun_num_change(date2[1]);
	var firday = fun_num_change(date1[2]);
	var endday = fun_num_change(date2[2]);

	var chk1,chk2,chk3;

	chk1 = endyear - firyear;
	chk2 = endmonth - firmonth;
	chk3 = endday - firday;

	if(chk1 >= 0 ){					//³âµµ
		if(chk2 >= 0 ){				//¿ù
			if(chk3 >= 0 ){			//ÀÏ
				return 1;
			}else{window.alert(err);return 0;}
		}else{window.alert(err);return 0;}
	}else{window.alert(err);return 0;}
}//end func

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_num_change
//	Æò¼Ç ±â´É 		 :	¾ÕÀÇ 0À» Áö¿î´Ù. ¿ù ÀÏ¿¡°æ¿ì 
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_num_change(num){
	
	var cv;
	cv = num.substr(0,1);
	if (cv == "0")
	{
		cv = num.substr(1,2);
	}
	else
	{
		cv = num.substr(0,2);
	}
//	window.alert(cv);
	return cv; 

}//end func
//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_login
//	Æò¼Ç ±â´É 		 :	·Î±×ÀÎ Ã¼Å©¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function btn_login(form)
{
	var chk = 0;
//	form.action="mem_writeC.asp";
		if(fun_null_chk(form.userid,'¾ÆÀÌµð')==0){return;}else{chk++;}
		if(fun_null_chk(form.passwd,'ºñ¹Ð¹øÈ£')==0){return;}else{chk++;}
		
		if(chk == 2)		{						//9°³ÀÇ Ã¼Å© »çÇ×À» È®ÀÎÈÄ ½ÇÇà ÆÄÆ®·Î ÀÌµ¿
		form.action = "login_ck.asp";
		form.submit();
		}
	//	document.write(chk);
}//end func

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_self_close()
//	Æò¼Ç ±â´É 		 :	open ÆäÀÌÁö¸¦ ´Ý´Â´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_self_close(){
	
	if(confirm('Á¤¸»·Î ´Ý°Ú½À´Ï±î?')){
	self.close();	
	}
}
//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_null_chk
//	Æò¼Ç ±â´É 		 :	³Î°ª ¿©ºÎ¸¦ È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function fun_null_chk(form,err_msg){
	
	if(form.value == ""){
		window.alert(err_msg+'À»(¸¦) ÀÔ·ÂÁÖ¼¼¿ä.');
		form.focus();
		return 0;
	}
	else { return 1; }
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_length_between
//	Æò¼Ç ±â´É 		 :	µÎ¼ö »çÀÌÀÇ °ª¸¦ È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function fun_length_between(form,err_msg,fir,end){
	
	if(form.value.length < fir){
		window.alert(err_msg+'À»(¸¦)'+fir+'ÀÚ¸® ÀÌ»óÀ¸·Î ÀÔ·ÂÁÖ¼¼¿ä.');
		form.focus();
		return 0;}
	else if(form.value.length > end){
		window.alert(err_msg+'À»(¸¦)'+end+'ÀÚ¸® ÀÌÇÏ·Î ÀÔ·ÂÁÖ¼¼¿ä.');
		form.focus();
		return 0;}
	else{
		return 1;
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_value_between
//	Æò¼Ç ±â´É 		 :	µÎ¼ö »çÀÌÀÇ °ª¸¦ È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function fun_value_between(form,err_msg,fir,end){
	
	if(form.value < fir){
		window.alert(err_msg+'À»(¸¦)'+fir+' ÀÌ»óÀ¸·Î ÀÔ·ÂÁÖ¼¼¿ä.');
		form.focus();
		return 0;}
	else if(form.value > end){
		window.alert(err_msg+'À»(¸¦)'+end+' ÀÌÇÏ·Î ÀÔ·ÂÁÖ¼¼¿ä.');
		form.focus();
		return 0;}
	else{
		return 1;
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_comparison_tchk
//	Æò¼Ç ±â´É 		 :	µÎ¼ö »çÀÌÀÇ °ª¸¦ È®ÀÎ¸¦ ÇÑ´Ù. 
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function fun_comparison_tchk(form1,form2,err_msg){

	if(form1.value == form2.value){
		return 1;
	}
	else { 
		window.alert(err_msg);
		form2.focus();
		return 0;
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_comparison_fchk
//	Æò¼Ç ±â´É 		 :	µÎ¼ö »çÀÌÀÇ °ª¸¦ È®ÀÎ¸¦ ÇÑ´Ù. 
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function fun_comparison_fchk(form1,form2,err_msg){

	if(form1.value == form2.value){
		window.alert(err_msg);
		form2.focus();
		return 0;
	}
	else { return 1; }
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_length_chk
//	Æò¼Ç ±â´É 		 :	ÀÔ·Â¹ÞÀº ¼ýÀÚ·Î È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function fun_length_chk(form,err_msg,len){
	
	if(form.value.length != len){
		window.alert(err_msg+'À»(¸¦)'+len+'À¸·Î ÀÔ·ÂÁÖ¼¼¿ä.');
		form.focus();
		return 0;
	}
	else { return 1; }
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_submit_chk
//	Æò¼Ç ±â´É 		 :	ÃÖÁ¾ ½ÇÇà ¿©ºÎ¸¦ È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_submit_chk(form,action,msg){

	if (confirm(msg)){
	form.action = action;
	form.submit();
	}
	else{
//	history.back(-1);
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_submit_chk
//	Æò¼Ç ±â´É 		 :	ÃÖÁ¾ »èÁ¦ ¿©ºÎ¸¦ È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_del_chk(url,msg){

	if (confirm(msg)){
	this.location = url;
//	form.submit();
	}
	else{
//	history.back(-1);
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  alert()
//	Æò¼Ç ±â´É 		 :	°æ°íÃ¢À» »ý¼ºÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function view_alert(form,msg){

	window.alert(msg);
	this.form.focus();
}

//==============================================================================================================




//=========================================		±âÅ¸	ÇÔ¼ö	================================================



//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_pop_write
//	Æò¼Ç ±â´É 		 :	ÆË¾÷Ãß°¡½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function btn_pop_write(form)
{
		//³¯Â¥ ¿À·ù ¿©ºÎ
//		if(fun_date_chk('¾ÕÀÇ ³¯Â¥°¡ ´õ ´Ê½À´Ï´Ù. Àß¸øµÈ ³¯Â¥ÀÔ´Ï´Ù.',form.pop_sdate,form.pop_edate)==0){return;}
		//Á¦¸ñÀÇ Æ¯¼ö¹®ÀÚ »ç¿ë¿©ºÎ
		if(fun_ascii_wordchk(form.pop_title)==0){return;}

		//³Ð°ª Ã¼Å©

		if(fun_null_chk(form.pop_title,'Å¸ÀÌÆ²')==0){return;}
		if(fun_null_chk(form.pop_sdate,'½ÃÀÛÀÏ')==0){return;}
		if(fun_null_chk(form.pop_edate,'Á¾·áÀÏ')==0){return;}


		//±æÀÌ Ã¼Å©

		if(fun_value_between(form.pop_width,'ÆË¾÷Ã¢ °¡·Î±æÀÌ',100,800)==0){return;}
		if(fun_value_between(form.pop_height,'ÆË¾÷Ã¢ ¼¼·Î±æÀÌ',100,800)==0){return;}
		if(fun_value_between(form.pop_wp,'ÆË¾÷Ã¢ »ý¼º °¡·ÎÁÂÇ¥',1,500)==0){return;}
		if(fun_value_between(form.pop_hp,'ÆË¾÷Ã¢ »ý¼º ¼¼·ÎÁÂÇ¥',1,500)==0){return;}

		//¼ýÀÚÀÎÁö Ã¼Å©

		if(fun_ascii_numchk(form.pop_width)==0){return;}
		if(fun_ascii_numchk(form.pop_height)==0){return;}
		if(fun_ascii_numchk(form.pop_wp)==0){return;}
		if(fun_ascii_numchk(form.pop_hp)==0){return;}

		//¸ðµÎ Á¤»óÀÌ¶ó¸é ½ÇÇà

		if (form.pop_sdate.value > form.pop_edate.value)
		{
			alert('µÚ¿¡ ³¯Â¥°¡ ´õ ºü¸¨´Ï´Ù.');
			return;
		}


		fun_submit_chk(form,'./Pop_WriteC.asp','Ãß°¡ÇÏ°Ú½À´Ï±î?');		//ÆÄ¶ó¹ÌÅÍ1 : ÆûÀÌ¸§ ,ÆÄ¶ó¹ÌÅÍ2 : ÀÌµ¿À§Ä¡  ,ÆÄ¶ó¹ÌÅÍ3 : ¸Þ¼¼Áö
		
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_event_write
//	Æò¼Ç ±â´É 		 :	Çà»çÃß°¡ ½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function btn_event_write(form,ok_flag)
{
	if(confirm('Ãß°¡ÇÏ½Ã°Ú½À´Ï±î?'))
	{
		if(jhj_chkForm(form))
		{
			if (form.pr_sdate.value > form.pr_edate.value)
			{
				alert('µÚ¿¡ ³¯Â¥°¡ ´õ ºü¸¨´Ï´Ù.');
				return;
			}

			form.action="event_writec.asp";
			form.submit();
		}
	}
		else
	{		
		return;
	}
}

function btn_confirm_chk(url,mode)
{
	if(confirm(mode+'ÇÏ½Ã°Ú½À´Ï±î?'))
	{
		location=url;
	}
	else
	{
		alert(mode+'(ÀÌ)°¡ Ãë¼ÒµÇ¾ú½À´Ï´Ù');
	}
}



//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_event_motify
//	Æò¼Ç ±â´É 		 :	Çà»ç¼öÁ¤ ½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------
function btn_event_modify(form)
{
	if(jhj_chkForm(form))
	{
		if (form.pr_sdate.value > form.pr_edate.value)
		{
			alert('µÚ¿¡ ³¯Â¥°¡ ´õ ºü¸¨´Ï´Ù.');
			return;
		}
		
		form.action="event_modifyc.asp";
		form.submit();
	}
}



//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_pop_motify
//	Æò¼Ç ±â´É 		 :	ÆË¾÷¼öÁ¤ ½Ã Ã¼Å©¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------


function btn_pop_motify(form)
{



		//³¯Â¥ ¿À·ù ¿©ºÎ
//		if(fun_date_chk('¾ÕÀÇ ³¯Â¥°¡ ´õ ´Ê½À´Ï´Ù. Àß¸øµÈ ³¯Â¥ÀÔ´Ï´Ù.',form.pop_sdate,form.pop_edate)==0){return;}
		//Á¦¸ñÀÇ Æ¯¼ö¹®ÀÚ »ç¿ë¿©ºÎ
		if(fun_ascii_wordchk(form.pop_title)==0){return;}	

		//³Ð°ª Ã¼Å©

		if(fun_null_chk(form.pop_title,'Å¸ÀÌÆ²')==0){return;}
		if(fun_null_chk(form.pop_sdate,'½ÃÀÛÀÏ')==0){return;}
		if(fun_null_chk(form.pop_edate,'Á¾·áÀÏ')==0){return;}

		//Á¦¸ñÀÇ Æ¯¼ö¹®ÀÚ »ç¿ë¿©ºÎ
		if(fun_ascii_wordchk(form.pop_title)==0){return;}

		//±æÀÌ Ã¼Å©

		if(fun_value_between(form.pop_width,'ÆË¾÷Ã¢ °¡·Î±æÀÌ',100,800)==0){return;}
		if(fun_value_between(form.pop_height,'ÆË¾÷Ã¢ ¼¼·Î±æÀÌ',100,800)==0){return;}
		if(fun_value_between(form.pop_wp,'ÆË¾÷Ã¢ »ý¼º °¡·ÎÁÂÇ¥',1,500)==0){return;}
		if(fun_value_between(form.pop_hp,'ÆË¾÷Ã¢ »ý¼º ¼¼·ÎÁÂÇ¥',1,500)==0){return;}
	
		//¼ýÀÚÀÎÁö Ã¼Å©

		if(fun_ascii_numchk(form.pop_width)==0){return;}
		if(fun_ascii_numchk(form.pop_height)==0){return;}
		if(fun_ascii_numchk(form.pop_wp)==0){return;}
		if(fun_ascii_numchk(form.pop_hp)==0){return;}
	
		

		if (form.pop_sdate.value > form.pop_edate.value)
		{
			alert('µÚ¿¡ ³¯Â¥°¡ ´õ ºü¸¨´Ï´Ù.');
			return;
		}

		//¸ðµÎ Á¤»óÀÌ¶ó¸é ½ÇÇà
		fun_submit_chk(form,'./Pop_Modifyc.asp','¼öÁ¤ÇÏ°Ú½À´Ï±î?');		//ÆÄ¶ó¹ÌÅÍ1 : ÆûÀÌ¸§ ,ÆÄ¶ó¹ÌÅÍ2 : ÀÌµ¿À§Ä¡  ,ÆÄ¶ó¹ÌÅÍ3 : ¸Þ¼¼Áö
}



//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_pop_del
//	Æò¼Ç ±â´É 		 :	Ä«Å×°í¸®ÀÇ ÃÖÁ¾ »èÁ¦ ¿©ºÎ¸¦ È®ÀÎ¸¦ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function btn_pop_del(pop_no){
	//document.write(mem_no);
	fun_del_chk('Pop_Del.asp?pop_no='+pop_no,'Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?');
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_cate_add()
//	Æò¼Ç ±â´É 		 :	category ¿¡ ¸ñ·ÏÀ» Ãß°¡ ÇÑ´Ù.
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function btn_cate_add(form){
		
	var chk =0;
	chk = fun_null_chk(form.sch_div_nm,'Á¦¸ñ')
	if (chk > 0)
	{
		form.action="CateOpc.asp?chksql=cate_write";
		form.submit();
	}
}


//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  ()
//	Æò¼Ç ±â´É 		 :	ÀÏÁ¤À» º»´Ù °ü¸®ÀÚ¿Í ³ªÀÇ
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function btn_cancel(form){

	form.reset();
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  change_inptype()
//	Æò¼Ç ±â´É 		 :	ÀÏÁ¤À» º»´Ù °ü¸®ÀÚ¿Í ³ªÀÇ
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function change_type(form,chk){

	var url = "Pop_Write.asp?inptype="
	if(chk=="0"){
		window.alert('normalÅ¸ÀÔ');
//		form.pop_inptype.checked();
		window.location = url+"normal_type";
	}
	else{
		window.alert('htmlÅ¸ÀÔ');
		window.location = url+"html_type";
		form.pop_inptype.checked();
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  link_tag()
//	Æò¼Ç ±â´É 		 :	ÀÏÁ¤À» º»´Ù °ü¸®ÀÚ¿Í ³ªÀÇ
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function link_tag(url){

	//var url = "Pop_Write.asp?inptype="
	//window.location="/popup/"+url;
	self.close();

}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_div_close()
//	Æò¼Ç ±â´É 		 :	·¹ÀÌ¾îµé ´Ý´Â´Ù
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

//function btn_div_close(div_id){
//	div_id.style.display='none';
//	div_id.style.visibility="hidden";
//}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_pop_closeWin
//	Æò¼Ç ±â´É 		 :	ÄíÅ°¿¡ µ¥ÀÌÅÍ ÀÔ·Â
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function notice_setCookie( name, value, expiredays )
    {
 //      var todayDate = new Date();
 //       todayDate.setDate( todayDate.getDate() + expiredays );
 //       document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
 self.close();
        } 

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_pop_closeWin
//	Æò¼Ç ±â´É 		 :	ÄíÅ°¸¦ È®ÀÎ ÆË¾÷Ã¢À» ¶ç¿ïÁö ¾Ê¶ç¿ïÁö¸¦ Àû¿ë
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function btn_pop_closeWin(form) 
{ 
        if ( url.checked ) 
                notice_setCookie( form, "done" , 1); // 1=ÇÏ·íµ¿¾È °øÁöÃ¢ ¿­Áö ¾ÊÀ½
        self.close(); 
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_pop_closeWin
//	Æò¼Ç ±â´É 		 :	ÄíÅ°¸¦ È®ÀÎ ÆË¾÷Ã¢À» ¶ç¿ïÁö ¾Ê¶ç¿ïÁö¸¦ Àû¿ë
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function notice_getCookie( name ){
 var nameOfCookie = name + "=";
 var x = 0;
 while ( x <= document.cookie.length )
 {
   var y = (x+nameOfCookie.length);
   if ( document.cookie.substring( x, y ) == nameOfCookie ) {
     if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
       endOfCookie = document.cookie.length;
     return unescape( document.cookie.substring( y, endOfCookie ) );
   }
   x = document.cookie.indexOf( " ", x ) + 1;
   if ( x == 0 )
     break;
 }
 return "";

}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_pop_link
//	Æò¼Ç ±â´É 		 :	ÆË¾÷ ¸µÅ©
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/05
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function link_pop(url){

	opener.parent.window.location.href=url;
	window.close();
//alert('error');
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  notice_getCookie
//	Æò¼Ç ±â´É 		 :	¿À´ÃÇÏ·ç ¿­Áö¾Ê±â
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/12
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function notice_getCookie( name ) 
{ 
	//alert(name);
//	return ;
	var nameOfCookie = name + "="; 
	var x = 0; 
	while ( x <= document.cookie.length ) 
	{ 
		var y = (x+nameOfCookie.length); 
		if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
		if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
			endOfCookie = document.cookie.length; 
			return unescape( document.cookie.substring( y, endOfCookie ) ); 
			} 
			x = document.cookie.indexOf( " ", x ) + 1; 
		if ( x == 0 ) 
		break; 
	} 
	return ""; 
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  setCookie
//	Æò¼Ç ±â´É 		 :	¿À´ÃÇÏ·ç ¿­Áö¾Ê±â ÄíÅ°¼³Á¤
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/12
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function setCookie( name, value, expiredays ) 
{ 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  fun_style_chk
//	Æò¼Ç ±â´É 		 :	¸Þ´º¼±ÅÃ ...
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/12
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

function fun_style_chk(id){

	var chk = document.getElementById(id);
	if (chk.style.display=="none")
	{
		chk.style.display="block";
	}
	else
	{
		chk.style.display="none";
	}
}

//----------------------------------------------------
//	Æã¼Ç ÀÌ¸§		 :  btn_select_prog
//	Æò¼Ç ±â´É 		 :	ÇÁ·Î±×·¥¼±ÅÃ ...
//	Æã¼Ç Á¦ÀÛ ³¯Â¥   :	2008/05/12
//	Æã¼Ç Á¦ÀÛÀÚ		 :  bgh
//----------------------------------------------------

	function msgposit(){
		message.style.posLeft = event.x + 0 + document.body.scrollLeft;
		message.style.posTop = event.y + 20 + document.body.scrollTop;
	}
	
	function msgset(str){
		var text;
		text ='<table border=0 width=10 height=22 cellpadding=5 cellspacing=0 bgcolor=#fdfff2 style="font-size:9pt; line-height:18px; border-width:1; border-color:#666666; border-style:solid;"><tr><td nowrap>';
		text += str;
		text += '</td></tr></table>';
		message.innerHTML=text;
	}


	function imgset(str){
		var text;
		text ='<table border=0 width=300 height=400 cellpadding=5 border=1 cellspacing=0 bgcolor=#fdfff2 style="font-size:9pt; line-height:18px; border-width:1; border-color:#666666; border-style:solid;"><tr>';
		text += "<td nowrap><img src='"+str+"' border=0 >";
		text += '</td></tr></table>';
		message.innerHTML=text;
	}


	function msghide2(){
		message.innerHTML='';
	//	message.style.visibility='visible';
	}

	function msghide(){
		message.innerHTML='';
		message.style.visibility='visible';
	}

	function msgtd(str){
		var text;
		text ='<table border=0 width=100% cellpadding=0 cellspacing=0  style="font-size:9pt;"><tr><td align=center>';
		text += str;
		text += '</td></tr></table>';
		message.innerHTML=text;
	}


	function func_parent(url)
	{
		parent.location.href="http://"+url;
	}


	
