
function mode_read(folder,mode,b_idx,idx){// ±Û ÀÐ±â ÆäÀÌÁö·Î ÀÌµ¿
	location.href=folder+".php?mode="+mode+"&b_idx="+b_idx+"&idx="+idx;
}

function main_read(folder,mode,b_idx,idx){// ±Û ÀÐ±â ÆäÀÌÁö·Î ÀÌµ¿
	location.href=folder+"/"+folder+".php?mode="+mode+"&b_idx="+b_idx+"&idx="+idx;
}

function mode_ch(folder,mode,b_idx){
	location.href=folder+".php?mode="+mode+"&b_idx="+b_idx;
}


function mode_ch2(folder,mode,b_idx,cate){
	if (cate=="admin")
	{
		location.href="../manager/"+folder+"/"+folder+".php?mode="+mode+"&b_idx="+b_idx;
	}else{
		location.href="../manager/"+folder+"/"+folder+".php?mode="+mode+"&b_idx="+b_idx;
	}
}


function login_write(folder,mode,b_idx,idx){
	window.open('admin_login.php?mode='+mode+"&b_idx="+b_idx+"&folder="+folder+"&idx="+idx,'','width=240,height=150');
}

function pass_chk(folder,mode,b_idx,idx){
	window.open('../pass_chk.php?mode='+mode+"&b_idx="+b_idx+"&folder="+folder+"&idx="+idx,'','width=240,height=150');
}

function mode_del(folder,mode,b_idx,idx){
	if(confirm('Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')){
	location.href=folder+".php?mode="+mode+"&b_idx="+b_idx+"&idx="+idx;
	}
}

function comment_del(idx,mode,comment_idx){ //´ñ±Û »èÁ¦ÇÏ±â
	if(confirm('Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')){
	location.href="comment.php?idx="+idx+"&mode="+mode+"&comment_idx="+comment_idx;
	}
}

function searchsearch(){ //°Ô½ÃÆÇ °Ë»ö
	document.searchfrm.submit();
}

function download(folder,idx){ //Å¸°ÙÁöÁ¤ ´Ù¿î·Îµå 
	window.open('../../upload_file/file_down.php?idx='+idx+"&folder="+folder,'down','width=1,height=1');
//	document.read.file_idx.value=idx;
//	document.read.submit();
}

function download2(folder,idx){ //ÆË¾÷Ã¢ ¶ç¿ö¼­ ´Ù¿î·Îµå 
	window.open('../../upload_file/file_down.php?idx='+idx+"&folder="+folder,'down','width=1,height=1');

}

function form_check(){
	var frm = document.frmlist;
//	document.<?=$formName?>.<?=$contentForm?>.value = SubmitHTML();
	if (frm.mtitle.value=="")
	{
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		frm.mtitle.focus();
		return;
	}
	
	if (frm.mcontent.value=="")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä");
//		frm.mcontent.focus();
		return;
	}
	//alert(frm.mcontent.value);
	frm.submit();
}

//====================ÇÁ·¹ÀÓ »çÀÌÁî ÀÚµ¿Á¶Àý ========================
function resizeFrame(iframeObj){
var innerBody = iframeObj.contentWindow.document.body;
oldEvent = innerBody.onclick;
innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
iframeObj.style.height = innerHeight;
var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
iframeObj.style.width = innerWidth;     
if( !arguments[1] )        /* Æ¯Á¤ ÀÌº¥Æ®·Î ÀÎÇÑ È£Ãâ½Ã ½ºÅ©·ÑÀ» ±×³É µÐ´Ù. */
this.scrollTo(1,1);
}


function calcHeight(s) 
{ 
//find the height of the internal page 
var the_height= 
document.getElementById('wsos').contentWindow. 
document.body.scrollHeight; 

//change the height of the iframe 
document.getElementById('wsos').height= 
the_height; 
} 

//====================ÆÄÀÏÃ·ºÎ ÀÚµ¿»ý¼º ========================
intTmp = 1;

function addFile()
{
	intTmp = intTmp + 1;
	if (intTmp < 6 )
	{
	fileDiv.insertAdjacentElement("BeforeBegin", document.createElement("<input type='file' name='upfile[]' size='50' nchange=\"LimitAttach(document.frmlist, document.frmlist.upfile"+intTmp+".value, document.frmlist.upfile"+intTmp+", 'upfile"+intTmp+"')\">"));
	fileDiv.insertAdjacentElement("BeforeBegin", document.createElement("<br><br>"));
	}
	else 
	{
  		alert('5°³ ÀÌ»ó Ãß°¡ÇÏ½Ç¼ö¾ø½À´Ï´Ù.');
 	}
	
}

function addFile2(count)
{
	var cnt=6-count;
	intTmp = intTmp + 1;
	if (intTmp < cnt )
	{
		fileDiv.insertAdjacentElement("BeforeBegin", document.createElement("<input type='file' name='upfile[]' style='width:80%' nchange=\"LimitAttach(document.frmlist, document.frmlist.upfile"+intTmp+".value, document.frmlist.upfile"+intTmp+", 'upfile"+intTmp+"')\">"));
		fileDiv.insertAdjacentElement("BeforeBegin", document.createElement("<br><br>"));
	}
	else 
	{
  		alert('5°³ ÀÌ»ó Ã·ºÎ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
 	}
	
}

