$("textarea").textlimit('span.counter',1000);
$("#commntIDToReply input").val("");

//when reply button is clicked
$("span.actions a.reply").live("click", function(){
	
	//grab the "Commentid-2821" number and trim it to get the nodeID	
	var replyToNum = $(this).parent().parent().parent("li").attr("id");
	replyToNum = replyToNum.slice(8);
	//Grab the name of the person being replied to 
	var replyToName = $(this).parent().parent().parent("li").children("div.cont").children("span.username").text();
	$("#youarereplying").empty();
	
	//Add a notice showing users who they are replying to
	$("#youarereplying").append("<span>Ви відповідаєте на думку "+replyToName+" <a href=\"#\">відмінити відповідь</a></span>");
	//alert ($("#youarereplying").text());
	//add the node id to the hidden "commentReply" field (wth cancel button)
	$("#commntIDToReply input").val("");
	$("#commntIDToReply input").val(replyToNum);
	//alert ($("#commntIDToReply input").val());
});

// clear data when cancel link is clicked
$("#youarereplying a").live("click", function(){
	$(this).parent("span").fadeOut("slow");
	$("#commntIDToReply input").val("");
	return false;
});
