function handleError() { return true; }
window.onerror = handleError;

var xmlHttp;
var theID;

function update(page, id) {
xmlHttp = GetXmlHttpObject();
document.getElementById(id).innerHTML = "Зарежда..";
if (xmlHttp == null) {
alert("Browser does not support HTTP Request");
return;
}
var date = new Date();
theID = id;
xmlHttp.onreadystatechange = stateChanged;
xmlHttp.open("GET", page, true);
xmlHttp.send(null);
}

function stateChanged() {
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
document.getElementById(theID).innerHTML = xmlHttp.responseText;
}
}

function GetXmlHttpObject() {
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else {
alert("Your browser does not support AJAX.");
return false;
}
}

var count = 0;

function left() {
count = count + 40;
document.getElementById("menubody").style.marginLeft = "-" + count + "px";
}

function right() {
if (document.getElementById("menubody").style.marginLeft == "0px") { return; }
else {
count = count - 40;
document.getElementById("menubody").style.marginLeft = "-" + count + "px";
}
}

function comment() {
var doc = document.getElementById("addcomment");
if (doc.style.display == "none") { doc.style.display = "block"; }
else { doc.style.display = "none"; }
}

function star_on(which, count) {

var vote = new Array();
vote[0] = "Много зле!";
vote[1] = "Зле!";
vote[2] = "Средно!";
vote[3] = "Добре!";
vote[4] = "Много добре!";

for (var i = 1; i <= count; i++) {
document.getElementById("star" + i).src = "img/star_on.png";
document.getElementById("return").innerHTML = vote[i-1];
}
}

function star_off(which, count) {
for (var i = 1; i <= count; i++) {
document.getElementById("star" + i).src = "img/star_off.png";
document.getElementById("return").innerHTML = "";
}
}