function get_file_ext(filename) { 

	temp_image=filename.split("."); 
	size=temp_image.length; 
	return temp_image[size-1]; 

} 

function form_submit(form) { 

	file_type=get_file_ext(form.upLoadFile.value); 

	if(file_type == 'jpg' || file_type == 'gif' || file_type == 'jpeg')  { 
		alert("ÀÌ¹ÌÁö ÆÄÀÏÀÌ³×¿ä~"); 
	} else { 
		alert("ÀÌ¹ÌÁö ÆÄÀÏÀÌ ¾Æ´ÏÀÝ¾Æ¿ä!!!~"); 
	} 

} 



//°Ô½ÃÆÇ ±Û¾²±â¿Í ¼öÁ¤, ´äº¯±Û¿¡¼­ÀÇ Ã¼Å©
function Member_BBS_Check(form) {

	// ¾Æ¹«³»¿ëµµ ¾øÀ»¶§
	if (isEmpty(form.subject.value)) {
		alert("Á¦¸ñÀº ÇÊ¼öÀÔ·Â Ç×¸ñÀÔ´Ï´Ù!!");
		form.subject.focus();
		return false;
	}

	if(form.bbs_id != null && form.bbs_id.length > 0) {
		if(form.bbs_id.options[form.bbs_id.selectedIndex].value == '') {
			alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À!!");
			form.bbs_id.focus();
			return false;
		}
	}

	//±æÀÌ Ã¼Å© 3ÀÚ¿¡¼­ 16ÀÚ±îÁö
	//checkLengthÀÌ¶ó´Â ÇÔ¼ö¸¦ À§¿¡¼­ È£ÃâÇÑµÚ °Ë»çÇÑ´Ù.
	if (!checkLength(form.content.value, 5, 99999999)) {
		alert("º»¹®¿¡ ÀÔ·ÂµÈ °ªÀÇ ±æÀÌ°¡ Âª½À´Ï´Ù!!");
		form.content.focus();
		return false;
	}

	return true;

}

//°Ô½ÃÆÇ ±Û¾²±â¿Í ¼öÁ¤, ´äº¯±Û¿¡¼­ÀÇ Ã¼Å©
function BBS_Check(form, author) {

	// ¾Æ¹«³»¿ëµµ ¾øÀ»¶§
	if (isEmpty(form.name.value)) {
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À!!");
		form.name.focus();
		return false;
	}

	// ¾Æ¹«³»¿ëµµ ¾øÀ»¶§
	if (isEmpty(form.subject.value)) {
		alert("Á¦¸ñÀº ÇÊ¼öÀÔ·Â Ç×¸ñÀÔ´Ï´Ù!!");
		form.subject.focus();
		return false;
	}

	if(form.bbs_id != null && form.bbs_id.length > 0) {
		if(form.bbs_id.options[form.bbs_id.selectedIndex].value == '') {
			alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À!!");
			form.bbs_id.focus();
			return false;
		}
	}

	//±æÀÌ Ã¼Å© 3ÀÚ¿¡¼­ 16ÀÚ±îÁö
	//checkLengthÀÌ¶ó´Â ÇÔ¼ö¸¦ À§¿¡¼­ È£ÃâÇÑµÚ °Ë»çÇÑ´Ù.
	if (!checkLength(form.content.value, 5, 99999999)) {
		alert("º»¹®¿¡ ÀÔ·ÂµÈ °ªÀÇ ±æÀÌ°¡ Âª½À´Ï´Ù!!");
		form.content.focus();
		return false;
	}

	// ¾Æ¹«³»¿ëµµ ¾øÀ»¶§
	if (isEmpty(form.passwd.value) && author < 8) {
		alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À!! »èÁ¦/¼öÁ¤½Ã ²À ÇÊ¿äÇÕ´Ï´Ù!!");
		form.passwd.focus();
		return false;
	}

	return true;

}


function contentShow(form) {

	form.content.value = form.content.value + form.hide.value;
	return;

}


function bbsUseProtect(userID, bbsTable, bbs_id, page) {	
	ans = confirm(userID + "´ÔÀÇ °Ô½ÃÆÇ »ç¿ëÀ» Á¦ÇÑÇÏ½Ã°Ú½À´Ï±î!!");
	if(ans == true) {
		var url = "bbsProcess.php?bbsMode=bbsUseProtect&userID=" + userID + "&code=" + bbsTable + "&bbs_id=" + bbs_id + "&page=" + page;
		location.href = url;
	} 
}





		//µ¿Àû½ºÅ©¸³Æ®
		function OnOff(s) {
		k = document.getElementById("k_type");
		onoff = "";
		res_type="";
		for(i=0;i<4;i++){
			if(s==i+""){
				if(k.value.substr(i,1)=="0"){
					res_type = res_type + "1";
				}else{
					res_type = res_type + "0";
				}
			
			}else{
				res_type = res_type + k.value.substr(i,1)
			}
		}

		t = document.getElementById("sb"+s);
		//alert(t.src);
		if(k.value.substr(s,1)=="0"){
			onoff="over_";
		}else if(k.value.substr(s,1)=="1"){
			onoff="";
		}

		if(s=="0"){
			t.src="/images/bbs/serach_"+onoff+"01.gif";
		}else if(s=="1"){
			t.src="/images/bbs/serach_"+onoff+"02.gif";
		}else if(s=="2"){
			t.src="/images/bbs/serach_"+onoff+"03.gif";
		}
		k.value = res_type;
		//0000 nothing
		//1000 name
		//0100 subject
		//0010 text
	}

