    var currentPage = 0;
    var maxPage;
	var nrArt;
	var xml;


$(document).ready(function(){
	nrArt = $("#comentlist").attr("name");
	$("form#addComment").submit(function(){
		if (tresc = $("#tresc").val() == "")
		{
			alert("Wpisz komentarz");
			return false;
		}
	});
});

function Odpowiedz(nr) {
	var kom = document.getElementById("kom"+nr);
	var tresc = kom.innerHTML;
	
	tresc = tresc.replace(/<\/?p>/gi,"");
	tresc = tresc.replace(/<blockquote>/gi,"[cytat]");
	tresc = tresc.replace(/<\/blockquote>/gi,"[/cytat]");
	tresc = tresc.replace(/<strong>/gi,"[autor]");
	tresc = tresc.replace(/<\/strong>/gi,"[/autor]");
	tresc = tresc.replace(/<br ?\/?>/gi,"");
	
	tresc = tresc.replace(/&lt;/gi,"<");
	tresc = tresc.replace(/&gt;/gi,">");
	tresc = tresc.replace(/&amp;/gi,"&");
	
	tresc = tresc.replace(/<a href[^>]+title=\"Przejdź do /gi,"");
	tresc = tresc.replace(/">[^<]+<\/a>/gi,"");

	var autor = $("#autor"+nr).text();

	$("#comment_text").val("[cytat][autor] " + autor + " [/autor] " + tresc + " [/cytat] ");
	$("#comment_text").focus();
}

function Zglos(nr) {
	comment_id = nr;
	$.post("/index.php/comments/modPost/"+comment_id+"/"+nrArt+"/",
	{  }, function() {
		alert("Zgłoszenie zostało przyjęte\nDziękujemy");
	});
}
