function zwin(div){
	document.getElementById(div).innerHTML = ''; 
}
function add_comment(nazwa, ida, idb, id_news){
	jQuery('#toggle_button').removeClass('rozwin');
	jQuery('#'+nazwa).show();
	advAJAX.get({
		url: 'content/comment.php?ida='+ida+'&idb='+idb+'&id_news='+id_news,
		onSuccess : function(obj){
			document.getElementById(nazwa).innerHTML = obj.responseText; 
			if(id_news!=''){
				window.location.href='#add_comment_'+id_news;
			} else if(ida!='' && idb!=''){
				window.location.href='#add_comment_'+ida+'_'+idb;
			}
		}
	})
}
function news(nazwa, page){
	advAJAX.get({
		url: 'content/news.php?page='+page,
		onSuccess : function(obj){
			document.getElementById(nazwa).innerHTML = obj.responseText; 
		}
	})
}
function comment(nazwa, ida, idb, id_news){
	jQuery('#toggle_button').removeClass('rozwin');
	jQuery('#'+nazwa).show();
	advAJAX.get({
		url: 'content/comment.php?ida='+ida+'&idb='+idb+'&id_news='+id_news,
		onSuccess : function(obj){
			document.getElementById(nazwa).innerHTML = obj.responseText; 
		}
	})
}
function gallery(nazwa, ida, idb, page){
	advAJAX.get({
		url: 'content/gallery.php?ida='+ida+'&idb='+idb+'&page='+page,
		onSuccess : function(obj){
			document.getElementById(nazwa).innerHTML = obj.responseText; 
		}
	})
}
function save_comment(nazwa){
	advAJAX.assign(document.getElementById("forma_comment_"+nazwa), {
		onInitialization : function(obj) {
		   document.getElementById("submitt_"+nazwa).value = "Prosze czekać";
		},
	    onSuccess : function(obj) { 
	    	document.getElementById("add_comment_"+nazwa).innerHTML = obj.responseText; 
	    },
	    onError : function(obj) { 
	    	alert("Error: " + obj.status); 
	    }, onComplete : function() {
	                document.getElementById("submitt_"+nazwa).value = "Dodaj";
	    }
	    
	});
}
