
<!--//<![CDATA[
               
var ajaxReq = new AjaxRequest();

function dodajKomentarz() {



	var typ = document.getElementById("typ").value;
	var id_art = document.getElementById("id_art").value;
	var autor = document.getElementById("comment_author").value;
	var tekst = document.getElementById("comment_text").value;

	if(autor == "") document.getElementById("error_koment").innerHTML = " Nie podałeś nicku !";
	else if(tekst == "") document.getElementById("error_koment").innerHTML = " Nie podałeś treści komentarza !";
	else if(tekst.length < 5) document.getElementById("error_koment").innerHTML = " Komentarz za krótki !";
	else {
	ajaxReq.send('POST', 'strony/baza/dodawanie_komentarza.php', handleRequest, 
	'application/x-www-form-urlencoded; charset=iso-8859-2',
	'id_art=' + id_art +
	'&&typ=' + typ +
	'&&autor=' + autor +
	'&&tekst=' + tekst);
	
	document.getElementById('whole_comment').innerHTML="";
	document.getElementById('dodano').innerHTML="<img src='grafika/layout/loading2.gif' />";

	
	}
};


	function handleRequest() {
	if(ajaxReq.getReadyState() == 4 && ajaxReq.getStatus() == 200) {
	
	$(document).ready(function() {

		$.prompt(ajaxReq.getResponseText(),{ callback: function () {location.reload()} }); 
		
	});	
	
		
		} 
		}

	// ]]>-->