
// forum >>>
var ocsm = false;
function oc_smileys() {
	if (ocsm) {
		document.getElementById("smiley-fce").innerHTML = '<a href="#" onclick="return !oc_smileys()"><img src="/img/open.jpg" width="15" height="15" alt="otevřít smajllíky" /></a>';
		document.getElementById("smileys").className = 'smileys smileys-close';
		ocsm = false;
	} else {
		document.getElementById("smiley-fce").innerHTML = '<a href="#" onclick="return !oc_smileys()"><img src="/img/close.jpg" width="15" height="15" alt="zavřít smajllíky" /></a>';
		document.getElementById("smileys").className = 'smileys';
		ocsm = true;
	}
}

function write_smiley(i) {
	if (ocsm)	oc_smileys();
	document.getElementById('txt').value += ' :'+ i +': ';
	document.getElementById('txt').focus();
	return true;
}






// hodnoceni profilu >>>
var zal_voting_1 = '';
var zal_voting_2 = '';
var zal_voting_3 = '';
var zal_voting_4 = '';
var zal_voting_5 = '';
function voting_over(h) {
	if (h > 0) {
		zal_voting_1 = document.getElementById("voting-hvezda-1").src;
		document.getElementById("voting-hvezda-1").src = '/img/stars/hover.gif';
	}
	if (h > 1) {
		zal_voting_2 = document.getElementById("voting-hvezda-2").src;
		document.getElementById("voting-hvezda-2").src = '/img/stars/hover.gif';
	}
	if (h > 2) {
		zal_voting_3 = document.getElementById("voting-hvezda-3").src;
		document.getElementById("voting-hvezda-3").src = '/img/stars/hover.gif';
	}
	if (h > 3) {
		zal_voting_4 = document.getElementById("voting-hvezda-4").src;
		document.getElementById("voting-hvezda-4").src = '/img/stars/hover.gif';
	}
	if (h > 4) {
		zal_voting_5 = document.getElementById("voting-hvezda-5").src;
		document.getElementById("voting-hvezda-5").src = '/img/stars/hover.gif';
	}
}

function voting_out() {
	if (zal_voting_1 != '') document.getElementById("voting-hvezda-1").src = zal_voting_1;
	if (zal_voting_2 != '') document.getElementById("voting-hvezda-2").src = zal_voting_2;
	if (zal_voting_3 != '') document.getElementById("voting-hvezda-3").src = zal_voting_3;
	if (zal_voting_4 != '') document.getElementById("voting-hvezda-4").src = zal_voting_4;
	if (zal_voting_5 != '') document.getElementById("voting-hvezda-5").src = zal_voting_5;
}








// hodnoceni dovolena popisky >>>
function get_hodnoceni_next(col, t, id) {
	cnt = 'inf_c_'+ col +'++';
	eval(cnt);
	get_hodnoceni_inf(col, t, id);
}
function get_hodnoceni_prev(col, t, id) {
	cnt = 'inf_c_'+ col +'--';
	eval(cnt);
	get_hodnoceni_inf(col, t, id);
}


function init_get_hodnoceni_inf(col, t, id) {
	window.setTimeout("get_hodnoceni_inf('"+ col +"', '"+ t +"', "+ id +")", 500);
}

function get_hodnoceni_inf(col, t, id) {
	cnt = 'inf_c_'+ col;
	cnt = eval(cnt);
	url = '/get-hodnoceni.php?what='+ col +'&type='+ t +'&id='+ id +'&cnt='+ cnt;
	if (!send_xmlhttprequest(get_hodnoceni_showit, 'GET', url)) return false;
	return true;
}

function get_hodnoceni_showit(xmlhttp) {
	if (xmlhttp.readyState == 4) {
		data = xmlhttp.responseText.split('|');
		o = document.getElementById('inf-'+ data[0]);
		o.innerHTML = data[2];
		cnt = "inf_c_"+ data[0] +"="+ data[1];
		eval(cnt);
	}
}


function send_xmlhttprequest(obsluha, method, url, content, headers) {
	var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
	if (!xmlhttp) return false;
	xmlhttp.open(method, url);
	xmlhttp.onreadystatechange = function() {
		obsluha(xmlhttp);
	};
	if (headers) {
		for (var key in headers) {
			xmlhttp.setRequestHeader(key, headers[key]);
		}
	}
	xmlhttp.send(content);
	return true;
}


