function InputCheck(f) {
	if (f.writer.value.length == 0 || f.writer.value.length < 2) {
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä!!")
		f.writer.focus()
		return false
	}
	else if (f.email.value.length != 0) {
		if (f.email.value.search(/(\S+)@(\S+)\.(\S+)/)== -1 ) {
            alert("E-mail ÁÖ¼Ò°¡ ºÎÁ¤È®ÇÕ´Ï´Ù.");
            f.email.focus();
            return false;
       }

	}
	else if (f.subject.value.length == 0 || f.subject.value.length < 4) {
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä!!")
		f.subject.focus()
		return false
	}
	else if (f.content.value.length == 0 || f.content.value.length < 4) {
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä!!")
		f.content.focus()
		return false
	}
	else if (f.pwd.value.length == 0 || f.pwd.value.length < 4) {
		alert("ºñ¹Ð¹øÈ£À» ÀÔ·ÂÇÏ¼¼¿ä!!")
		f.pwd.focus()
		return false
	}
	chkValidation();
	return true
}

function clearField(field){
	if (field.value == field.defaultValue) {
		field.value = "";
	}
}

function checkField(field){
	if (field.value == "") {
		field.value = field.defaultValue;
	}
}

function wOpen(URL,wName,wWidth,wHeight) {
	var x
	var y
	var wFeatures
	x = (screen.width - wWidth) / 2
	y = (screen.height - wHeight) / 2

	wFeatures = 'width='+wWidth+',height='+wHeight+',top='+y+',left='+x
	window.open(URL,wName,wFeatures)
}

function selectDelete(strBbsID) {

	var nCount = 0;

	for (var i = 0; i < document.listForm.num.length; i++) {
		if (document.listForm.num[i].checked == true) {
			nCount++;
		}
    }
	if (nCount < 2) {
		alert('µÎ°³ ÀÌ»ó ¼±ÅÃÇØ ÁÖ¼¼¿ä!');
	}
	else {
		if (confirm('¼±ÅÃÇÑ °Ô½Ã¹°À» »èÁ¦ÇÒ±î¿ä?')) {
			listForm.action = "BoardMain.asp?BbsID="+strBbsID+"&mode=seldel"
			listForm.submit()
		}
	}
}

function selectRead(strBbsID) {

	var nCount = 0;

	for (var i = 0; i < document.listForm.num.length; i++) {
		if (document.listForm.num[i].checked == true) {
			nCount++;
		}
    }
	if (nCount == 0) {
		alert('ÀÐÀ» ±ÛÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä!');
		//return false;
	}
	else {
		listForm.action = "BoardMain.asp?BbsID="+strBbsID+"&mode=read"
		listForm.submit()
	}
}

function select_all(checked) {
	var i =0;
	while (i < document.listForm.elements.length)
	{
		if (document.listForm.elements[i].name=='num')
		{
			document.listForm.elements[i].checked=checked;
		}
		i++;
	}
}

function searchFormCheck(f) {
	if (f.ks.checked != true && f.kc.checked != true && f.kw.checked != true) {
		alert('°Ë»öÇ×¸ñÀ» Ã¼Å©ÇØ ÁÖ¼¼¿ä!');
		return false;
	}
	else if(f.kword.value.length == 0) {
		alert("°Ë»öÇÒ ´Ü¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä")
		f.kword.focus()
		return false
	}
	return true
}

function commentSubmit(f) {
	if (f.comment.value == f.comment.defaultValue) {
		alert("ÀÇ°ßÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä..")
		f.comment.focus()
		return false
	}
	return true
}

function winOpen(winURL,winName,winFeatures) {
	window.open(winURL,winName,winFeatures)
}

function gobbs(s) {
	location.href = s.value
}

function adminSubmit(f) {
	if(f.adminid.value.length == 0) {
		alert("°ü¸®ÀÚ ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä!!")
		f.adminid.focus()
		return false
	}
	else if(f.adminpwd.value.length == 0) {
		alert("°ü¸®ÀÚ ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!!")
		f.adminpwd.focus()
		return false
	}
	return true
}
