function PSR_star_over(obj, star_number) {
	var psr=document.getElementById('PSR_form');
	if (!psr) return;
	var as=psr.getElementsByTagName('span');
	var i;
	for (i=0;i<star_number;++i) {
		as[i].setAttribute('rel',as[i].className);
		as[i].className = 'PSR_full_star';
	}
	for (;i<as.length;++i) 
		as[i].rel = as[i].className;
}
function PSR_star_out() {
	var psr=document.getElementById('PSR_form');
	if (!psr) return;
	var as=psr.getElementsByTagName('span');
	var i, attr;
	for (i=0;i<as.length;++i) {
		attr = as[i].getAttribute('rel');
		if (attr) as[i].className = attr;
	}
}
function PSR_getHTTPObject() {
	var xmlhttp;
  	try { xmlhttp = new XMLHttpRequest();  }
  	catch (e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
  	catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
  	catch (e) { xmlhttp = false; }}}
  	if (!xmlhttp) return null;
	return xmlhttp;
}
function PSR_save_vote(oid, points, typ) {
	if (!PSR_isWorking) {
		PSR_current_post=oid;
		PSR_http.open('GET', '/styles/stars/psr-ajax-stars.php?' + typ + '=' + PSR_current_post + '&psr_stars=' + points, true); 
		PSR_http.setRequestHeader("Content-Type", "text/plain;charset=Windows-1250");
		PSR_http.onreadystatechange = PSR_update_vote; 
		PSR_isWorking = true;
		PSR_http.send(null);
	}
}
function PSR_update_vote() {
	if (PSR_http.readyState == 4) {
		PSR_isWorking = false;
		var cont = document.getElementById('PSR_container').parentNode;
	    cont.innerHTML=PSR_http.responseText;
	}
}

var PSR_current_post = null;
var PSR_http = PSR_getHTTPObject();
var PSR_isWorking = false;

