// ±Û µî·Ï
function send()
{
	var form = document.frm;

	pwd = form.pwd.value;
	name = form.name.value;
	country = form.country.value;
	title = form.title.value;
	content = form.content.value;

	if(pwd == "")
	{
		alert("Please Enter Your Password!");
		form.pwd.focus();
		return false;
	}

	if(name == "")
	{
		alert("Please Enter Your Name!");
		form.name.focus();
		return false;
	}

	if(country == "")
	{
		alert("Please Enter Your Country!");
		form.country.focus();
		return false;
	}

	if(title == "")
	{
		alert("Please Enter Your Title!");
		form.title.focus();
		return false;
	}

	if(content == "")
	{
		alert("Please Enter Your Content!");
		form.content.focus();
		return false;
	}

	form.submit();
}

// ¼öÁ¤ Àü¼Û
function send2()
{
	var form = document.frm;

	name = form.name.value;
	country = form.country.value;
	title = form.title.value;
	content = form.content.value;

	if(name == "")
	{
		alert("Please Enter Your Name!");
		form.name.focus();
		return false;
	}

	if(country == "")
	{
		alert("Please Enter Your Country!");
		form.country.focus();
		return false;
	}

	if(title == "")
	{
		alert("Please Enter Your Title!");
		form.title.focus();
		return false;
	}

	if(content == "")
	{
		alert("Please Enter Your Content!");
		form.content.focus();
		return false;
	}

	form.submit();
}


// ¸ñ·ÏÀ¸·Î ÀÌµ¿
function list(pagenum,search,searchString)
{
	location.href="./list.php?pagenum=" + pagenum + "&search=" + search + "&searchString=" + searchString;
}

// ±Û¾²±â ÀÌµ¿
function write_move()
{
	location.href="./write.php";
}

// list.php °Ë»öÇÏ±â
function search()
{
	location.search_frm.submit();
}

// list.php °Ë»ö ³»¿ë Áö¿ì±â
function clears()
{
	document.search_frm.searchString.value = "";
}

// content.php ²¿¸´¸» ÀÌ¸§ Áö¿ì±â
function check_name()
{
	var chk = false ;
	if ( chk ) return ;
		document.viewfrm.name.style.backgroundImage = "" ;
	chk = true ;
}

// content.php ²¿¸´¸» ºñ¹Ð¹øÈ£ Áö¿ì±â
function check_pwd()
{

var chk = false ;
	if ( chk ) return ;
		document.viewfrm.pwd.style.backgroundImage = "" ;
	chk = true ;
}

// content.php ²¿¸´¸» ³»¿ë Áö¿ì±â
function check_memo()
{
	var chk = false ;
	if ( chk ) return ;
		document.viewfrm.b_contents.style.backgroundImage = "" ;
	chk = true ;
}

// ºñ¹Ð¹øÈ£ È®ÀÎ
function pass(no,type,pagenum,search,searchString)
{
	url = "./pass.php?no=" + no + "&type=" + type + "&pagenum=" + pagenum + "&search=" + search + "&searchString=" + searchString;

	if(type == "edit")
	{
		window.open(url,"Edit","left=350, top=350, width=350, height=100");
	}
	else if(type == "del")
	{
		window.open(url,"Delete","left=350, top=350, width=350, height=100");
	}
	else if(type == "pass")
	{
		window.open(url,"Pass","left=350, top=350, width=350, height=100");
	}
}

function reply_pass(no,cno,type,pagenum,search,searchString)
{
	url = "./pass.php?no=" + no + "&cno=" + cno + "&type=" + type + "&pagenum=" + pagenum + "&search=" + search + "&searchString=" + searchString;
	window.open(url,"Reply","left=400, top=350, width=350, height=100");
}


// ÆË¾÷Ã¢ ºñ¹Ð¹øÈ£ ÀÔ·Â¶õ¿¡ Ä¿¼­¼±ÅÃ
function pwd_focus()
{
	document.dfrm.pwd.focus();
}

// ÆË¾÷Ã¢ ´Ý±â
function pass_cancel()
{
	this.close();
}

// ºñ¹Ð¹øÈ£ Àü¼ÛÇÏ±â
function pass_ok()
{
	if(document.dfrm.pwd.value == "")
	{
		alert("Please Enter Your Password!");
		document.dfrm.pwd.focus();
		return false;
	}
	document.dfrm.submit();
}


// Ãë¼Ò
function cancel()
{
	history.back();
}

function list2()
{
	location.href="./list.php";
}



// ²¿¸´¸» ÀÌ¸§ Áö¿ì±â
function check_name()
{
	var chk = false ;
	if ( chk ) return ;
	document.viewfrm.name.style.backgroundImage = "" ;
	chk = true ;
}

// ²¿¸´¸» ºñ¹Ð¹øÈ£ Áö¿ì±â
function check_pwd()
{
	var chk = false ;
	if ( chk ) return ;
	document.viewfrm.pwd.style.backgroundImage = "" ;
	chk = true ;
}

// ²¿¸´¸» ³»¿ë Áö¿ì±â
function check_memo()
{
	var chk = false ;
	if ( chk ) return ;
	document.viewfrm.b_contents.style.backgroundImage = "" ;
	chk = true ;
}


// reply_ok.php ÀÚ·á Àü¼Û
function reply()
{
	form = document.viewfrm;
	name = form.name.value;
	pwd = form.pwd.value;
	memo = form.b_contents.value;

	if(!name)
	{
		alert("Please Enter Your Name!");
		form.name.focus();
		return false;
	}

	if(!pwd)
	{
		alert("Please Your Password!");
		form.pwd.focus();
		return false;
	}

	if(!memo)
	{
		alert("Please Your Comment!");
		form.b_contents.focus();
		return false;
	}
	document.viewfrm.submit();
}


// °ü¸®ÀÚ ºñ¹Ð¹øÈ£ ¼öÁ¤
function admin()
{
	document.frm.submit();
}
