var max = 5000;

function bthPaginate2(aPost, aPage) {
	var myHidden = $('#ajaxUrl');
	$.get(myHidden.attr('value') + aPost + '/page:' + aPage,
		function(myData) {
			$('#bthAjaxWrapper').html(myData);
		},
		'html'
	);
} // eof bthPaginate2()
var comment = {
	onUserInput: function(e){
		var commentElem = $(e.target);
		if(commentElem.val().length > max) {
			commentElem.val(commentElem.val().slice(0,max));
		}
		var liczbaZnakow = $("#liczbaZnakow");
		liczbaZnakow.html(""+(max-commentElem.val().length));
		if(commentElem.val().length>=max)
			liczbaZnakow.css({color: "red"});
		else
			liczbaZnakow.removeAttr("style");
	}
};
function viewReady() {
	$("#liczbaZnakow").html(max);
	$("#BlgCommentContent")
		.bind("keyup", comment.onUserInput)
		.bind("change", comment.onUserInput);

	$('#BlgCommentContent').focus(function() {
		if ($('#BlgCommentContent').attr('value') == 'tekst Twojej opinii...') {
			$('#BlgCommentContent').attr('value', '');
		} // eof if()
	});

	$('#BlgCommentContent').blur(function() {
		if ($('#BlgCommentContent').attr('value') == '') {
			$('#BlgCommentContent').attr('value', 'tekst Twojej opinii...');
		} // eof if()
	});

	$("#BlgQuestionContent")
		.bind("keyup", comment.onUserInput)
		.bind("change", comment.onUserInput);

	$('#BlgQuestionContent').focus(function() {
		if ($('#BlgQuestionContent').attr('value') == 'tekst Twojego pytania...') {
			$('#BlgQuestionContent').attr('value', '');
		} // eof if()
	});

	$('#BlgQuestionContent').blur(function() {
		if ($('#BlgQuestionContent').attr('value') == '') {
			$('#BlgQuestionContent').attr('value', 'tekst Twojego pytania...');
		} // eof if()
	});
} // eof viewLoad()

