/*
*******************************************************************

		Autocomplete - MARKE

*******************************************************************
*/
function glasaj(anketa_id) {
	 for (var i=0; i < document.anketa_odgovori.odgovor.length; i++){
		if (document.anketa_odgovori.odgovor[i].checked){
			var odgovor_vrijednost = document.anketa_odgovori.odgovor[i].value;
		}//end IF
	}//end FOR

	
	
	if(odgovor_vrijednost.length != '') {
		$.post("/include/ajax/switch.php?exec=glasaj", {queryString: ""+odgovor_vrijednost+"|"+anketa_id}, function(data){
			if(data.length >0) {
				$('#anketa_txt').html(data);
			}
		});
	}
	
} // 

	
/*
*******************************************************************

		rezultati

*******************************************************************
*/
function rezultati(anketa_id) {
	if(anketa_id.length != '') {
		$.post("/include/ajax/switch.php?exec=rezultati", {queryString: ""+anketa_id+""}, function(data){
			if(data.length >0) {
				$('#anketa_txt').html(data);
			}
		});
	}
	
} // 


/*
*********************************************************************************
				SAT
*********************************************************************************
*/
var tick;
function stop() {
	clearTimeout(tick);
}
function clock() {
	var currentTime = new Date()
	var year = currentTime.getFullYear();
	var month = currentTime.getMonth() + 1
	var days = currentTime.getDate();
	var hours = currentTime.getHours();
	var minutes = currentTime.getMinutes();
	var seconds = currentTime.getSeconds();

	if(seconds<=9) seconds="0"+seconds;
	if(minutes<=9) minutes="0"+minutes;
	if(hours<=9) hours="0"+hours;
	if(days<=9) days="0"+days;
	if(month<=9) month="0"+month;
	var time =hours+":"+minutes+":"+seconds+" "+days+"."+month+"."+year+".";
	document.getElementById('clock').innerHTML=time;
	tick=setTimeout("clock()",1000); 
}
/*
*********************************************************************************
*/
