MyBbs = function () {
	this.user;
	this.isSended = false;

	this.confirm = function (url) {
		common.open(url, "CONFIRM", 250, 100);
	}

	this.imageView = function (src, w, h) {
		if (screen.width > w) {
			var width = w + 16;
		} else {
			var width = screen.width;
		}

		if (screen.height > h) {
			var height = h;
		} else {
			var height = screen.height - 100;
		}

		var win = window.open("", "IMGVIEW", "width=" + width + ", height=" + height + ", scrollbars=yes, top=0, left=0");
		var doc = "<html>\n"
				+ "\t<head>\n"
				+ "\t\t<title>image viewer</title>\n"
				+ "\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\" />\n"
				+ "\t</head>\n"
				+ "\t<body style=\"margin:0; cursor:pointer;\" onclick=\"self.close();\">\n"
				+ "\t\t<img src=\"" + src + "\">\n"
				+ "\t</body>\n"
				+ "</html>";

		win.document.write(doc);
	}

	this.setPost = function (frm) {
		if (!frm.title.value) {
			window.alert("Input the subject.");
			frm.title.focus();
			return false;
		}

		try {
			if (!frm.name.value) {
				window.alert("Input the name.");
				frm.name.focus();
				return false;
			} else if (!frm.pass.value) {
				window.alert("Input the password.");
				frm.pass.focus();
				return false;
			}
		} catch (e) {
		}

		if (common.object("_editor_div_body_") != false) {
			frm.body.value = editor.visualEditor ? common.object("_editor_div_body_").innerHTML : common.object("_editor_txt_body_").value;
		}

		try {
			if (!frm.body.value) {
				window.alert("Input the contents.");
				return false;
			}
		} catch (e) {
		}

		if (this.isSended == false) {
			this.isSended = true;
			return true;
		} else {
			window.alert("Is in the process of transmitting, only short time to wait.");
			return false;
		}
	}

	this.setMemo = function (frm) {
		try {
			if (frm.name.value == "") {
				window.alert("Input the name.");
				frm.name.focus();
				return false;
			} else if (frm.pass.value == "") {
				window.alert("Input the password.");
				frm.pass.focus();
				return false;
			}
		} catch (e) {
		}

		if (frm.body.value == "") {
			window.alert("Input the contents.");
			frm.body.focus();
			return false;
		}

		if (this.isSended == false) {
			this.isSended = true;
			return true;
		} else {
			window.alert("Is in the process of transmitting, only short time to wait.");
			return false;
		}
	}
}

var bbs = new MyBbs();
