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) {

	code_reload();


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

	// ¾Æ¹«³»¿ëµµ ¾øÀ»¶§
	if (isEmpty(form.subject.value)) {
		alert("Á¦¸ñÀº ÇÊ¼öÀÔ·Â Ç×¸ñÀÔ´Ï´Ù!!");
		form.subject.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) {

	code_reload();


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

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