var Comments = {

	form: null,

	showForm: function(id, url, is_autoarea) {
		try {
			if (this.form) {
				var oldId = Html.getById("parent_id").value;
	//			Html.show("comment_reply"+oldId);
				Html.getById("comment_"+oldId).removeChild(this.form)
				this.form = null;
				if (oldId.toString()==id.toString()) {
					return false;
				}
			}
			this.form = document.createElement("form");
			this.form.method = "POST";
			this.form.action = url;
	
	//		this.form.appendChild(document.createTextNode("Добавить комментарий:<br />"));
	
			var inputId = document.createElement("input");
			inputId.type = "hidden";
			inputId.id = "parent_id";
			inputId.name = "parent_id";
			inputId.value = id;
			this.form.appendChild(inputId);
	
			var textareaBody = document.createElement("textarea");
			textareaBody.id = "commentText";
			textareaBody.name = "body";
			textareaBody.className = textareaBody["class"] = "auto-resizeable";
	//		textareaBody.rows = "3";
	//		textareaBody.cols = "7";
	//		textareaBody.style.height = "50px !important";
			this.form.appendChild(textareaBody);
	
			var inputSubmit = document.createElement("input");
			inputSubmit.type = "submit";
			inputSubmit.value = "Отправить";
			inputSubmit.accesskey = "s";
			this.form.appendChild(inputSubmit);
	
			Html.getById("comment_"+id).appendChild(this.form);
	//		Html.hide("comment_reply"+id);
			
			new Autoarea1("commentText", 200);
			textareaBody.focus();
		} catch (e) {
			if (console) {
				console.log(e);
			}
		}
		return false;
	}
}
