function bbsWriteChk(flag) {
	if (valueChk(form.bd_subject,"Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä")) { return false; }
	
	writeFlag = false;

	if (form.bd_wMode[3].checked) {
		if (flag=="0") {
			if (document.form.edit_mode.value == "html_layer") {
				document.form.html_contents.value = TextEditor.document.body.innerHTML;
				var html_contents = document.form.html_contents.value; 
				if (CheckStr(html_contents, " ", "")==0 || CheckStr(html_contents, "&nbsp;", "")==0) {  
					alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä"); 
					TextEditor.document.body.focus();
					return false; 
				} 

			} else {
				document.form.html_contents.value = document.form.html_body.value;
				var html_contents = document.form.html_contents.value; 
				if (CheckStr(html_contents, " ", "")==0 || CheckStr(html_contents, "&nbsp;", "")==0) {  
					alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä~"); 
					document.form.html_body.focus();
					return false; 
				}
			}

		} else {
			var html_contents = document.form.html_contents.value; 
			if (CheckStr(html_contents, " ", "")==0 || CheckStr(html_contents, "&nbsp;", "")==0) {  
				alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä"); 
				document.form.html_body.focus();
				return false; 
			}
		}
	} else {
		if (valueChk(form.text_contents,"³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä")) { return false; }
	}

	var saveImage;
	saveImage = document.form.saveImage.value;
	if (saveImage != "" && saveImage != null) {
		document.form.imgInfo.value = saveImage + document.form.imgInfo.value;
	}

	document.form.submitChk.value = "true";
	document.form.encoding = "MULTIPART/FORM-DATA";
}





function preview(flag) {
	if (valueChk(form.bd_subject,"Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä")) { return false; }
	preForm.bd_subject.value = form.bd_subject.value;

	if (form.bd_wMode[3].checked) {
		if (flag=="0") {
			if (document.form.edit_mode.value == "html_layer") {
				document.form.html_contents.value = TextEditor.document.body.innerHTML;
				var html_contents = document.form.html_contents.value; 
				if (CheckStr(html_contents, " ", "")==0 || CheckStr(html_contents, "&nbsp;", "")==0) {  
					alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä"); 
					TextEditor.document.body.focus();
					return false; 
				} 

			} else {
				document.form.html_contents.value = document.form.html_body.value;
				var html_contents = document.form.html_contents.value; 
				if (CheckStr(html_contents, " ", "")==0 || CheckStr(html_contents, "&nbsp;", "")==0) {  
					alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä~"); 
					document.form.html_body.focus();
					return false; 
				}
			}

		} else {
			var html_contents = document.form.html_contents.value; 
			if (CheckStr(html_contents, " ", "")==0 || CheckStr(html_contents, "&nbsp;", "")==0) {  
				alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä"); 
				document.form.html_body.focus();
				return false; 
			}
		}
		preForm.bd_contents.value = document.form.html_contents.value;
		preForm.bd_wMode.value = "1";
	} else {
		if (valueChk(form.text_contents,"³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä")) { return false; }
		preForm.bd_contents.value = document.form.text_contents.value;
		preForm.bd_wMode.value = "0";
	}

	preForm.bd_name.value = document.form.bd_name.value;
	windowOpen("","prv","750","650","scrollbars=yes");
	preForm.submit();
}
