$(document).ready(function() {

	
	$('#replycomment').hide();
	$('#commentreplybox').hide();

	$('#viewComment a').click(function() {

		$('#Commentbox').show();
		$('#viewComment').hide();
		$('#hideComment').show();
		$('#commentDetails').show();
		

	});

	$('#hideComment a').click(function() {

		$('#Commentbox').hide();
		$('#hideComment').hide();
		$('#viewComment').show();
		$('#commentDetails').hide();

	});

	$('#commenttext').keyup(function() {

		limitChars('commenttext', 500, 'charlimitinfo');

	})
	
	
	
	

});

function limitChars(textid, limit, infodiv)

{

	var text = $('#' + textid).val();

	var textlength = text.length;

	if (textlength > limit) {

		$('#' + infodiv).html(
				'You cannot write more then ' + limit + ' characters!');

		$('#' + textid).val(text.substr(0, limit));

		return false;

	}

	else {

		$('#' + infodiv).html((limit - textlength) + ' characters Remaining.');

		return true;

	}

}

