var comments = function() {
	this.__construct = function(manager, name) {
		comments.prototype.__construct.call(this, manager, name);

		this.ErrorMsg = new Array();
		this.ErrorMsg[0] = "UNUSED";
		this.ErrorMsg[1] = "<h3>Captcha error</h3><p>You've entered the wrong code. Please try again.</p>";
		
	}
	
	this.submit = function(id) {
		if (document.forms[id+"dialog"].elements["SWX_CAPTCHA"].value == "")
			return alert("Please enter the captcha code.");
		
		var result = this.execute("submit", document.forms[id].elements["name"].value, document.forms[id].elements["text"].value, document.forms[id+"dialog"].elements["SWX_CAPTCHA"].value);
		if (typeof result == "number") {
			swx_Dialog.update(id+"dialog", this.ErrorMsg[result]+"<p class=\"Footer\"><button type=\"submit\">OK</button></p>", "javascript:swx_Dialog.hide('"+id+"dialog');");
		}
		else {
			document.getElementById(id+"feed").innerHTML = result + document.getElementById(id+"feed").innerHTML;
			swx_Dialog.hide(id+"dialog");
		}
	}
	
	this.ErrorMsg = undefined;
}
comments.prototype = new swx_BloxFrontendModule();

