


var QuickShout = Class.create();
QuickShout.prototype = {
	initialize : function() {
		this.defaults = new DefaultTextWidget($('quickShout'), "Type a quick comment");
		Event.observe($('quickShoutForm'), "submit", this.onSubmit.bindAsEventListener(this));
	},
	onSubmit : function(event) {
		if ($F('quickShout') == this.defaults.text) {
			Event.stop(event);
			alert("Whoops, you forgot to put in a comment!");
			return false;
		}
		return Clicker.guard();
	}
};

var DeleteComment = Class.create();
DeleteComment.prototype = {
	initialize : function(event, commentId) {
		Event.stop(event);
		if (confirm("Are you sure you want to delete this message?")) {
			var params = "commentId="+commentId;
			new Ajax.Request('/talk/deletecomment', {parameters:params});
			Try.these(
				function() { Effect.BlindUp("comment"+commentId); },
				function() { Element.hide("comment"+commentId); } 
			);
		}
	}
}
var dC = function(event, commentId) { new DeleteComment(event, commentId); }