// ÃÖ»óÀ§ Ã¼Å© ·ÎÁ÷(chars·Î ³Ñ±ä °ªÀÌ ÀÖ´Ù¸é true)

    function containsCharsOnly(input,chars) {
        for (var inx = 0; inx < input.length; inx++) {

            if (chars.indexOf(input.charAt(inx)) == -1)

                return false;

        }

        return true;

    }

//// ±Û¾²±â Ã¼Å© 


function chk(){

	if (document.form.title.value==false){
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.title.focus();
		return false;
	}

	if(document.form.use_refer.value=="1"){//º¸µµ¸ÅÃ¼
		if (document.form.refer.value==false){
			alert('º¸µµ¸ÅÃ¼¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
			document.form.refer.focus();
			return false;
		}
	}

	if(document.form.use_vchr.value=="1"){//Ä«Å×°í¸®
		if (document.form.wcate.value==false){
			alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
			document.form.wcate.focus();
			return false;
		}
	}

	if (document.form.name.value==false){
		alert('ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.name.focus();
		return false;
	}

	if (document.form.name.value.indexOf('<',0) != -1){
	alert('ÀÛ¼ºÀÚ¸¦ ÀÔ·Â ¸øÇÏ´Â ±ÛÀÚ¸¦ ÀÔ·Â ÇÏ¼Ì±º¿ä.')
	document.form.name.focus()
	return false;
	}

	if (document.form.pwd.value==false){
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.pwd.focus();
		return false;
	}
  

	if (document.form.email.value!=false){
	 var objEmail = document.form.email; //eval(FromAddr) ;
	 var szEmail = objEmail.value ;
	 var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	 var regMust = /^[a-zA-Z0-9\-\.\_]+@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;

		 if ( !regDoNot.test(szEmail) && regMust.test(szEmail) ){
		}else{
		alert('ÀÌ¸ÞÀÏÁÖ¼Ò°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!');
		objEmail.focus() ;
		return false;
		}
	}




	document.all.submit_btn.style.display = "none";
	document.all.wait_btn.style.display = "";

}

function chkBook(){//µµ°¡¼­Æò/¿ÀÅ»ÀÚ½Å°í

	if (document.form.title.value==false){
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.title.focus();
		return false;
	}

	if (document.form.wcate.value==false){
			alert('°ü·Ãµµ¼­¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
			document.form.bookname.focus();
			return false;
		}

	if (document.form.name.value==false){
		alert('ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.name.focus();
		return false;
	}

	if (document.form.name.value.indexOf('<',0) != -1){
	alert('ÀÛ¼ºÀÚ¸¦ ÀÔ·Â ¸øÇÏ´Â ±ÛÀÚ¸¦ ÀÔ·Â ÇÏ¼Ì±º¿ä.')
	document.form.name.focus()
	return false;
	}

	if (document.form.pwd.value==false){
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.pwd.focus();
		return false;
	}
  

	if (document.form.email.value!=false){
	 var objEmail = document.form.email; //eval(FromAddr) ;
	 var szEmail = objEmail.value ;
	 var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	 var regMust = /^[a-zA-Z0-9\-\.\_]+@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;

		 if ( !regDoNot.test(szEmail) && regMust.test(szEmail) ){
		}else{
		alert('ÀÌ¸ÞÀÏÁÖ¼Ò°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù!');
		objEmail.focus() ;
		return false;
		}
	}




	document.all.submit_btn.style.display = "none";
	document.all.wait_btn.style.display = "";

}

function faq_chk(){//faq¿ë Ã¼Å©

	if (document.form.title.value==false){
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.title.focus();
		return false;
	}

	if(document.form.use_vchr.value=="1"){//Ä«Å×°í¸®
		if (document.form.wcate.value==false){
			alert('Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
			document.form.wcate.focus();
			return false;
		}
	}

	document.all.submit_btn.style.display = "none";
	document.all.wait_btn.style.display = "";

}

function photo_chk(){//»çÁøÃ¸¿ë Ã¼Å©

	if (document.form.title.value==false){
		alert('Çà»ç¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.title.focus();
		return false;
	}


		if (document.form.start_date1.value==false){
		alert('Çà»ç½ÃÀÛÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.start_date1.focus();
		return false;
	}

	if (document.form.start_date2.value==false){
		alert('Çà»çÁ¾·áÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.start_date2.focus();
		return false;
	}

	if (document.form.ufile.value==false){
		alert('Ã·ºÎÆÄÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.ufile.focus();
		return false;
	}


	document.all.submit_btn.style.display = "none";
	document.all.wait_btn.style.display = "";

}

function photo_echk(){//»çÁøÃ¸¿ë Ã¼Å©

	if (document.form.title.value==false){
		alert('Çà»ç¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.title.focus();
		return false;
	}


		if (document.form.start_date1.value==false){
		alert('Çà»ç½ÃÀÛÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.start_date1.focus();
		return false;
	}

	if (document.form.start_date2.value==false){
		alert('Çà»çÁ¾·áÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.form.start_date2.focus();
		return false;
	}



	document.all.submit_btn.style.display = "none";
	document.all.wait_btn.style.display = "";

}

/*fckeditor¿¡ »ç¿ëµÇ´Â ºÎºÐ*/
function FCKeditor_OnComplete( editorInstance )
{
	var oCombo = document.getElementById( 'cmbSkins' ) ;
	
	// Get the active skin.
	var sSkin = editorInstance.Config['SkinPath'] ;
	sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
	
	oCombo.value = sSkin ;
	oCombo.style.visibility = '' ;
}

function ChangeSkin( skinName )
{
	window.location.href = window.location.pathname + "?Skin=" + skinName ;
}

function chg_cate(cval,url){//Ä«Å×°í¸® Ã¼ÀÎÁö½Ã º¯°æ
location.href=url+"?cate="+cval;
}

/*fckeditor¿¡ »ç¿ëµÇ´Â ºÎºÐ ³¡*/


///////////////////
///  ¿¡·¯ Ã¼Å©
/////////////////


function err_chk(){
alert("±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ¼¼¿ä.");
}


//////////////////////////////
// ÆÐ½º¿öµå ÀÔ·ÂÃ¼Å©

//////////////////////////

function pwd_chk(){

	if(document.form.pwd.value==false){
	alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
	document.form.pwd.focus();
	return false;
	}
	document.form.submit();
}

//////////////////////////
		//°Ë»ö Æû Ã¼Å©ÇÏ±â
//////////////////////////
function search_chk(){
if (document.search_form.searchstring.value==false){
		alert('°Ë»ö³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		document.search_form.searchstring.focus();
		return false;
	}
	document.search_form.submit();
}

///////////////////////¿øº» ÀÌ¹ÌÁöÅ©±â·Î »õÃ¢¶ì¿ì±â

function gogo(){
setTimeout("gogo()",100);
window.resizeTo(img1.width+10,img1.height+29);
//window.moveTo((screen.width-img1.width)/2,(screen.height-img1.height)/2);

}


//ÀÌ¹ÌÁö Å©±â¿¡ ¸Â°Ô ¶ç¿ì±â #2
function ZoomWin(imgPath)
{
	//alert(imgPath);
	newWin=window.open("./zoomwin.php?img="+imgPath,"Detail_view","width=20,height=10,scrollbars=0,resizable=0,left=50,top=50");
	if (newWin !=null)
	{
		newWin.opener=self;
	}
	newWin.focus();
}


function p_search(){//»çÁøÃ¸¾²±â Çà»ç¸í Ã£±â
win=window.open('product_search.php','ps','width=517,height=300,scrollbars=1,status=1');
}

function ps_send(pname,sdate,edate,idx){//Çà»çÃ£±â¿¡¼­ Çà»ç¸é Å¬¸¯½Ã
opener.document.form.title.value=pname;
opener.document.form.start_date.value=sdate;
opener.document.form.end_date.value=edate;
opener.document.form.idx.value=idx;
window.close();
}
///////////////////////////////////


//ÀÌ¹ÌÁöÆÄÀÏ ´Ù¿î¹Þ±â


/////////////////////////////////////
function FileDown(bbs_name,dwname,dwdir)
{
	
	location.href="../download.php?bbs_name="+bbs_name+"&filename="+dwname+"&filedir="+dwdir+"";
	return;
}

function FileDown_user(bbs_name,dwname,dwdir)
{
	
	location.href="../board/download.php?bbs_name="+bbs_name+"&filename="+dwname+"&filedir="+dwdir+"";
	return;
}

function FileDown1(board,filename,filedir)
	{
		location.href="../download1.php?bbs_name="+board+"&filedir="+filedir+"&filename="+filename;
		return;
	}

function FileDown_pho(bbs_name,dwname,dwdir,fpath)
{
	
	location.href="../download.php?bbs_name="+bbs_name+"&filename="+dwname+"&filedir="+dwdir+"&fpath="+fpath;
	return;
}
////////////////////////////////////

///ÀÌ¹ÌÁöÆÄÀÏ¿Ã¸®±â Ã¼Å©

///////////////////////////
function CkImageVal() {
	var oInput = event.srcElement;
	var fname = oInput.value;
	//alert(fname);
	if((/(.jpg|.jpeg|.gif|.png)$/i).test(fname)){
		oInput.parentElement.children[0].src = fname;
	}else{
		alert('ÀÌ¹ÌÁöÆÄÀÏÀ» ¾÷·Îµå½Ã gif, jpg, png ÆÄÀÏ¸¸ °¡´ÉÇÕ´Ï´Ù.');
	return false;
	}
	}

function PreviewImage() 
{
	var oInput = event.srcElement;
	var fname = oInput.value;

	if(!(/(.jpg|.jpeg)$/i).test(fname))
	{
	  alert('ÀÌ¹ÌÁö´Â jpg ÆÄÀÏ¸¸ °¡´ÉÇÕ´Ï´Ù.');
	  return false;
	}
	
	return true;
}


function CkZipVal() {
	var oInput = event.srcElement;
	var fname = oInput.value;
	//alert(fname);
	if((/(.zip|.ZIP)$/i).test(fname)){
		oInput.parentElement.children[0].src = fname;
	}else{
		alert('ÀÌ¹ÌÁöÆÄÀÏÀ» ¾÷·Îµå½Ã zip ÆÄÀÏ¸¸ °¡´ÉÇÕ´Ï´Ù.\n´Ù½Ã ¼±ÅÃÇØ ÁÖ¼¼¿ä.');
	return false;
	}
	}
///////////////////////////
	//Ã¼Å©¹Ú½º ¼±ÅÃ ÇÏ±â
//////////////////////////
function allcheck(theform)
{
	var check_box=theform["check[]"]; 
	obj = document.getElementsByName("check[]");
	if(!check_box)
	{
	alert('°ªÀÌ ¾ø½À´Ï´Ù.');
	    return false;
	}
	for(var i=0; i<obj.length;i++)
	{
		var ele = obj.item(i);
		if(ele.checked == false)
		{
			ele.checked = true;
		}	
	}
	return;
}



//¼±ÅÃÃë¼Ò
function discheck(theform)
{
	for( var i=0; i<theform.elements.length; i++) 
	{
		var ele = theform.elements[i];
		if(ele.name == 'check[]')
			ele.checked = false;
	}
	return;
}


//¼±ÅÃºÎºÐ ¹ÝÀü
function invert_check(theform)
{
	for( var i=0; i<theform.elements.length; i++) 
	{
		var ele1 = theform.elements[i];
		if(ele1.name == 'check[]')
		{
			if(ele1.checked == true)
			{
				ele1.checked = false;
			} 
			else 
			{
				ele1.checked = true;
			}
		}
		
	}
	return;
}

/////////////¼±ÅÃ»óÇ° »èÁ¦
function delall(theform){
obj = document.getElementsByName("check[]");
var check_box=theform["check[]"]; 

	if(!check_box){
			alert('°ªÀÌ ¾ø½À´Ï´Ù.');
			return;
	}

	for(var i=0; i<obj.length;i++){
		var ele = obj.item(i);
		if(ele.checked == true)	break;		
	}

	if(obj.length==i){
		alert('¼±ÅÃÀ» ÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù.');
		return;
	}
	 else 
	{
		if(confirm("¼±ÅÃµÈ ¸ðµç °Ô½Ã¹°ÀÌ Áö¿öÁý´Ï´Ù.")){
			theform.action="select_all_del_ok.php";
			theform.submit();
		}else{
			location.href="#";  
		}
	}
}

//faq ³»¿ë º¸ÀÌ°í ¼û±â±â
var old='';

	function faq_menu(name){
	submenu=eval("faq_"+name+".style");

		if(old!=submenu){

			if(old!=''){
				old.display='none';
			}

			submenu.display='block';

			old=submenu;
		}else{

		submenu.display='none';

		old='';

		}

	}


//°Ô½ÃÆÇÀÌµ¿ ½ºÅ©¸³Æ®
function write_go(url){
theform=document.form;
theform.action=url+"?mode=write#ltop";
theform.submit();
}

function list_go(url){
theform=document.form;
theform.action=url+"?mode=list#ltop";
theform.submit();
}

function edit_go(url){
theform=document.form;
theform.action=url+"?mode=edit#ltop";
theform.submit();
}

function edit_go_faq(url,idx){//faq¿ë ¼öÁ¤
theform=document.form;
theform.action=url+"?mode=edit&idx="+idx;
theform.submit();
}

//Ä«Å×°í¸® º¯°æ
function cate_chg(url,cval,b_idx){
location.href=url+"?cate="+cval+"&b_idx="+b_idx;
}

//°Ô½Ã±Û»èÁ¦
function del_go(idx,page,search,searchstring,bbs_name,b_idx,cate){
win=window.open('../board/'+bbs_name+'/board_del.php?idx='+idx+'&b_idx='+b_idx+'&cate='+cate+'&search='+search+'&page='+page+'&searchstring='+searchstring+'','pwdchk','width=250,height=100');
}

//°Ô½Ã±Û»èÁ¦(À¯Àú¸ðµå°ü¸®ÀÚ¿ë)
function del_go_a(bbs_name){

vn_con = confirm('»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
 if ( vn_con == true  )
 {
document.form.action="../board/"+bbs_name+"/board_del_ok.php";
document.form.submit();
 }

}
//°Ô½Ã±Û»èÁ¦(»çÁø°Ô½ÃÆÇ °ü¸®ÀÚ¿ë)
function photoDel(gid,page,searchstring){
	vn_con = confirm('ÀÌ Çà»ç·Î µî·ÏµÈ ¸ðµç»çÁøÀÌ »èÁ¦µË´Ï´Ù.\n»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
		if ( vn_con == true  )
		{
		location.href="board_class_del_ok.php?gid="+gid+"&page="+page+"&searchstring="+searchstring;
		}
}



//°Ô½Ã±Û»èÁ¦(°­»ç°Ô½ÃÆÇ)
function del_go_lec(idx,page,search,searchstring,bbs_name,b_idx,cate){
win=window.open('board_del.php?idx='+idx+'&b_idx='+b_idx+'&cate='+cate+'&search='+search+'&page='+page+'&searchstring='+searchstring+'','pwdchk','width=250,height=100');
}

//°Ô½Ã±Û»èÁ¦(À¯Àú¸ðµåfaq°ü¸®ÀÚ¿ë)
function del_go_faq_a(bbs_name,idx){

vn_con = confirm('»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
 if ( vn_con == true  )
 {
document.form.action="../board/"+bbs_name+"/board_del_ok.php?idx="+idx;
document.form.submit();
 }

}

function del_con(){//°ü¸®ÀÚÆäÀÌÁö ±Û»èÁ¦

vn_con = confirm('»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
 if ( vn_con == true  )
 {
document.form.action="board_del_ok.php?tag=admin";
document.form.submit();
 }

}

function del_con_faq(idx){//°ü¸®ÀÚÆäÀÌÁö ±Û»èÁ¦(faq)

vn_con = confirm('»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
 if ( vn_con == true  )
 {
document.form.action="board_del_ok.php?idx="+idx;
document.form.submit();
 }

}



//input¹Ú½º type=image ÀÏ°æ¿ì ÀÌ¹ÌÁö OnmouseOver È¿°ú ³»±â
//bt_name:input¹Ú½º name
//bt_url:¸¶¿ì½ºÀÌº¥Æ® ¹ß»ý½Ã ¹Ù²ð ÀÌ¹ÌÁö °æ·Î
function Bt_Input_Over(bt_name,bt_url){
var input_bt = document.getElementById(bt_name);
input_bt.src=bt_url;
}

//input¹Ú½º type=image ÀÏ°æ¿ì ÀÌ¹ÌÁö OnmouseOut È¿°ú ³»±â
function Bt_Input_Out(bt_name,bt_url){
var input_bt = document.getElementById(bt_name);
input_bt.src=bt_url;
}


function PageGo(page){
theform=document.form;
theform.page.value=page;
theform.action="./board_list.php?focus_move=m";
theform.submit();
}



/*********************** ÄÚ¸àÆ® °ü·Ã ½ºÅ©¸³Æ® ½ÃÀÛ******************/
function CoModi(name,comment_id){
theform=document.form;
theform.co_name.value=name;
theform.co_mode.value="edit";
theform.co_modeidx.value=comment_id;
document.getElementById('comment').value = document.getElementById('save_comment_' + comment_id).value;
}

function CoModi_ad(name,comment_id,pwd){
theform=document.form;
theform.co_name.value=name;
theform.co_pwd.value=pwd;
theform.co_mode.value="edit";
theform.co_modeidx.value=comment_id;
document.getElementById('comment').value = document.getElementById('save_comment_' + comment_id).value;
}

//°ü¸®ÀÚÆäÀÌÁö ÄÚ¸àÆ® ¼öÁ¤
function CoModi_a(name,comment_id){
theform=document.form;
theform.co_name.value=name;
theform.co_mode.value="edit";
theform.co_modeidx.value=comment_id;
document.getElementById('comment').value = document.getElementById('save_comment_' + comment_id).value;
document.getElementById("comm_save").src="../img/memo_modify2.gif";
document.getElementById("ncomment").style.display="block";
}


//ÄÚ¸àÆ® »èÁ¦
function CoDel(co_idx,idx,page,search,searchstring,bbs_name,b_idx,cate){
win=window.open('../board/'+bbs_name+'/comment_del.php?co_idx='+co_idx+'&idx='+idx+'&b_idx='+b_idx+'&cate='+cate+'&search='+search+'&page='+page+'&searchstring='+searchstring+'','cpwdchk','width=250,height=100');
}

function CoDel_con(idx,bbs_name){//À¯Àú¸ðµå °ü¸®ÀÚ¿ë ÄÚ¸àÆ®»èÁ¦
	vn_con = confirm('»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
 if ( vn_con == true  )
 {
document.form.action="../board/"+bbs_name+"/comment_del_ok.php?co_idx="+idx;
document.form.submit();
 }
}


function CoDel_a(idx,bbs_name){//°ü¸®ÀÚ¿ë
	vn_con = confirm('»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?');
 if ( vn_con == true  )
 {
document.form.action="./comment_del_ok.php?co_idx="+idx;
document.form.submit();
 }
}

//ÄÚ¸àÆ® ¾²±â¿¡ °üÇÑ ½ºÅ©¸³Æ®
function comment_chk(bbs_name){
if (document.form.co_name.value==false){
alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
document.form.co_name.focus();
return false;
}
if (document.form.co_pwd.value==false){
alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
document.form.co_pwd.focus();
return false;
}
if (document.form.comment.value==false){
alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
document.form.comment.focus();
return false;
}

document.form.action="../board/"+bbs_name+"/comment_write_ok.php"
document.form.submit();
}

//ÄÚ¸àÆ®¿¡ °üÇÑ ½ºÅ©¸³Æ® °ü¸®ÀÚ¿ë
function comment_chk_a(bbs_name){
if (document.form.co_name.value==false){
alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
document.form.co_name.focus();
return false;
}
if (document.form.co_pwd.value==false){
alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
document.form.co_pwd.focus();
return false;
}
if (document.form.comment.value==false){
alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
document.form.comment.focus();
return false;
}
document.form.action="./comment_write_ok.php"
document.form.submit();
}

//°ü¸®ÀÚ¿¡¼­ ¼öÁ¤¸ðµå Çß´Ù°¡ ´Ù½Ã ¾²·ÁÇÒ¶§..
function New_comment_a(){
theform=document.form;
theform.co_name.value="";
theform.co_mode.value="write";
theform.co_modeidx.value="";
document.getElementById('comment').value = "";
document.getElementById("comm_save").src="../img/memo_ok.gif";
document.getElementById("ncomment").style.display="none";
}

/****************ÄÚ¸àÆ® °ü·Ã ½ºÅ©¸³Æ® ³¡*************************/




//fck¿¡µðÅÍ¿ë
function isNull( s ) { 
  if( s == null ) return true; 

  var result = s.replace(/(^\s*)|(\s*$)/g, ""); 

  if( result ) 
    return false; 
  else 
    return true; 
}

/*############## °Ô½ÃÆÇ »ý¼º °ü·Ã ½ºÅ©¸³Æ® ½ÃÀÛ ###############*/

// Ã¼Å©¹Ú½º Àû¾îµµ ÇÑ°³ ÀÌ»ó ¼±ÅÃÇß´ÂÁö °Ë»ç
function isCheckAtLeastOne (elem)
{
	if (elem != null)	// Ç×¸ñÀÌ ÇÏ³ªÀÌ»ó Á¸Àç ÇÒ¶§
	{
		if (elem.length == null)	// Ç×¸ñÀÌ ÇÏ³ª¸¸ ÀÖÀ»¶§
		{
			if (elem.checked == true)
				return true;
		}
		else	// Ç×¸ñÀÌ µÎ°³ ÀÌ»óÀÏ ¶§
		{
			for(index = 0; index < elem.length; index++)
				if(elem[index].checked == true)
					return true;
		}
	}

	return false;
}

//»ý¼ºÆû¿¡¼­ ¸ñ·ÏÀ¸·Î ÀÌµ¿
function alist_go(){
document.join_form.action="bbs_list.php";
document.join_form.submit();
}

//°Ô½ÃÆÇ µî·ÏÃ¼Å©
function chk_bbs(){
	var theform=document.join_form;

	if (theform.bbs_name.value==false){
		alert('¿µ¹® °Ô½ÃÆÇ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		theform.bbs_name.focus();
		return false;
	}

	if (theform.board_name.value==false){
		alert('±¹¹® °Ô½ÃÆÇ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		theform.board_name.focus();
		return false;
	}

	if (theform.bbs_class.value==false){
		alert('°Ô½ÃÆÇ Á¾·ù¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
		theform.bbs_class.focus();
		return false;
	}

	if (theform.bbs_width.value==false){
		alert('°Ô½ÃÆÇ ³ÐÀÌ¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		theform.bbs_width.focus();
		return false;
	}
		
	/*if (theform.list_cut.value==false){
		alert('¸®½ºÆ® ÇÑÁÙ¿¡ º¸¿©ÁÙ ±ÛÀÚ¼ö¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		theform.list_cut.focus();
		return false;
	}*/

	if(!isCheckAtLeastOne (theform["list_per[]"]))
	{
	elem=theform["list_per[]"];
	alert("±Û¸ñ·Ï º¸±â ±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["write_per[]"]))
	{
	elem=theform["write_per[]"];
	alert("¾²±â±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["edit_per[]"]))
	{
	elem=theform["edit_per[]"];
	alert("¼öÁ¤±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["reply_per[]"]))
	{
	elem=theform["reply_per[]"];
	alert("´äº¯±Û¾²±â ±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["del_per[]"]))
	{
	elem=theform["del_per[]"];
	alert("»èÁ¦±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["view_per[]"]))
	{
	elem=theform["view_per[]"];
	alert("ÀÐ±â±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["com_per[]"]))
	{
	elem=theform["com_per[]"];
	alert("ÄÚ¸àÆ® »ç¿ë±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if(!isCheckAtLeastOne (theform["admin_per[]"]))
	{
	elem=theform["admin_per[]"];
	alert("ÃÖ°í°ü¸®±ÇÇÑÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ¼¼¿ä.");
	elem[0].focus();
	return false;
	}

	if (theform.go_url.value==false){
		alert('°Ô½ÃÆÇ ÀÌµ¿ °æ·Î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		theform.go_url.focus();
		return false;
	}

	if (theform.go_page.value==false){
		alert('°Ô½ÃÆÇ ÀÌµ¿ ÆäÀÌÁö¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		theform.go_page.focus();
		return false;
	}

	document.all.submit_btn.style.display = "none";
	document.all.wait_btn.style.display = "";

	theform.submit();

}

function movie_yn(b_val){//°Ô½ÃÆÇ ÇüÅÂ°¡ µ¿¿µ»óÀÏ¶§ Ãß°¡ÇÊµå º¸ÀÌ±â

	if(b_val=="movie"){
		document.getElementById("movie1").style.display="block";
		document.getElementById("movie2").style.display="block";
	}else{
		document.getElementById("movie1").style.display="none";
		document.getElementById("movie2").style.display="none";
	}
}

function cate_go(idx){
	win=window.open('bbs_cate.php?bidx='+idx,'cate','width=316,height=300,scrollbars=yes');
}

/*############## °Ô½ÃÆÇ »ý¼º °ü·Ã ½ºÅ©¸³Æ® ³¡ ###############*/

/*############## °ü¸®ÀÚÆäÀÌÁö °ü·Ã ÀÌµ¿ ½ºÅ©¸³Æ® ##############*/

function adreload_go(b_idx,cate){//»õ·Î°íÄ§
location.href="board_list.php?b_idx="+b_idx+"&cate="+cate;
}

function adreload_go1(b_idx,cate){//»õ·Î°íÄ§
location.href="board_list_class.php?b_idx="+b_idx+"&cate="+cate;
}

function adwrite_go(){//ÀÛ¼ºÀ¸·Î
document.form.action="board_write.php";
document.form.submit();
}

function adlist_go(){//¸ñ·ÏÀ¸·Î
document.form.action="board_list.php";
document.form.submit();
}

function adedit_go(){// ¼öÁ¤À¸·Î
document.form.action="board_edit.php";
document.form.submit();
}

function adedit_go_faq(idx){// faq ¼öÁ¤À¸·Î
document.form.action="board_edit.php?idx="+idx;
document.form.submit();
}

function in_chg(idx,chg_val,old_val) {//°íÁ¤°øÁö ¼ø¼­º¯°æ
	if(confirm("¼ø¼­¸¦ º¯°æÇÏ½Ã°Ú½À´Ï±î?")) {
		document.form.action="board_grade.php?in_idx="+idx+"&in_chg="+chg_val+"&old_val="+old_val;
		document.form.submit();
	}
}

function bookSearch(url){
	window.open(url,"book","width=300,height=300,scrollbars=yes");
}

function bin(idx,title){
	opener.form.wcate.value=idx;
	opener.form.bookname.value=title;
	window.close();
}
