function getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
	}
	else if (document.all) {
		this.obj = document.all[name];
	}
	else if (document.layers) {
		this.obj = document.layers[name];
	}
}


function rateMedia(mediaid, score, which) {
	var oX = zXmlHttp.createRequest();
	if(which) {
		oX.open("get", "/rate/?id=" + mediaid + "&score=" + score, true);
	} else {
		oX.open("get", "/rate/garage.php?id=" + mediaid + "&score=" + score, true);
	}
	oX.onreadystatechange = function() {
		if(oX.readyState == 4) {
			changeRate(oX.responseText, mediaid);
		}
	};
	oX.send(null);
}

function changeRate(response, id) {
		if(response) {
			var width = response * 20;
			var star = document.getElementById("starating" + id);
			star.innerHTML = "<li class=\"current-rating\" style=\"width:" + width + "%;\">Currently " + response + "/5 Stars.</li>";
		}
}
