function ShowCommentForm()
{
	$(".commentbutton").fadeOut();
	$(".commentform").slideDown();
	$(".commentform #name").focus();
}

$(document).ready(function()
{
	$(".commentbutton").click(function()
	{
		ShowCommentForm();
	});

	$(".commentform input[type=radio]").click(function(EventObject)
	{
		$(".post .text .commentform .addcommentbutton input").removeAttr("disabled");

		$(".commentform img").css("border", "none");
		$(".commentform img").css("padding", "0px");

		$(".commentform #" + $(this).attr("id") + "label img").css("border", "2px solid #5C7444");
		$(".commentform #" + $(this).attr("id") + "label img").css("padding", "2px");

	});

	$(".post .text .commentform .addcommentbutton input[type=button]").click(function()
	{
		var Error = "";

		var Name = $(".post .text .commentform #name").val();
		if(Name == "")
		{
			Error += "Please include your name.\n"
		}

		var Comment = $(".post .text .commentform #comment").val();
		if(Comment == "")
		{
			Error += "Please include a comment.\n"
		}

		if(Error != "")
		{
			window.alert(Error);
		}
		else
		{
			$("#form_addcomment").submit();
		}
	});
});
