
function getVest(id) {
	var brojVesti=6;
	var table = document.getElementById('vest');
	var link_prev = document.getElementById('vest_prev');
	var link_next = document.getElementById('vest_next');
	var Request = new AJAX();
	Request.onload = function() {
		document.vesti_count = this.responseXML.getElementsByTagName('count')[0].attributes[0].value;
		var num_vesti = this.responseXML.getElementsByTagName('vest').length;
		table.innerHTML = "&nbsp;";
		
		if (document.vesti_count > 0) {
			document.getElementById('vesti_list_current').innerHTML = id*brojVesti+1;
			document.getElementById('vesti_list_num').innerHTML = id*brojVesti+num_vesti;
		} else {
			document.getElementById('vesti_list_current').innerHTML = 0;
			document.getElementById('vesti_list_num').innerHTML = id*brojVesti+num_vesti;
		}
		
		
		for (var i=0; i<num_vesti; i++) {
		
		var vest = this.responseXML.getElementsByTagName('vest')[i].attributes;
		table.innerHTML += '<span class="datumVesti">' +vest[1].value +'</span><br>' +vest[0].value +'... <a href="vesti.php?id=' +vest[2].value +'" class="linkVestiStreliceDalje">Даље&gt;&gt;&gt;</a><br><br>'
		
		link_prev.onclick = new Function('getVest(' +(id-1) +')')
		link_next.onclick = new Function('getVest(' +(id+1) +')')
		
		}
		
		if (id > 0) link_prev.style.visibility = 'visible'; else link_prev.style.visibility = 'hidden';
		if ((id+1)*brojVesti < document.vesti_count) link_next.style.visibility = 'visible'; else link_next.style.visibility = 'hidden';
		
	}
	Request.load('xml/list.php?list=vesti_list&id=' +id)
}