function hideme() {
	document.getElementById('result_content').style.display = 'none';
}

function hide(id) {
	document.getElementById('result_' + id).style.display = 'none';
}

function chat(id) {
	window.open('/mods/chat/chat.php?sess=' + id,'','width=300,height=460,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
}

function vote(id, type) {
	document.getElementById('result_' + id).innerHTML = '<br />Моля, изчакайте...';
	document.getElementById('result_' + id).style.display = 'block';
	var xmlhttp=false;

	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); // Firefox
	} catch (e) {
		try {
			xmlhttp = new
			ActiveXObject('Microsoft.XMLHTTP'); // IE
		} catch (E) {
			xmlhttp = false;
		}
	}

    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

    if (type=='1') var url = '/mods/authors/comment_votes.php?id=' + id + '&t=1';
	else if (type=='0') var url = '/mods/authors/comment_votes.php?id=' + id + '&t=0';

	xmlhttp.open('GET', url, true);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState==4) {
			var content = xmlhttp.responseText;
			if (content) {
				switch (content) {
					case "1":
						document.getElementById('result_' + id).innerHTML = "<span style='color:green'><br />Гласуването е успешно!</span>";
						var status = Number(document.getElementById('vote_' + id).innerHTML);
						if(type=='1') status = status + 1;
						else status = status - 1;
						document.getElementById('vote_' + id).innerHTML = status;
						break;
					case "2": document.getElementById('result_' + id).innerHTML = "<span style='color:red'><br />Гласуването НЕ може да се извърши!</span>"; break;
					case "3": document.getElementById('result_' + id).innerHTML = "<span style='color:red'><br />Грешка! Трябва да се логнете!</span>"; break;
					default: document.getElementById('result_' + id).innerHTML = ""; break;
				}
				var m = 'hide(' + id + ');';
			}
		}
	}
	xmlhttp.send(null);
    mTimer = setTimeout(m, 1000);
	return;
}