function chgStar(num,bylo,pul) {

  for(i = 1; i <= 5; i++) {
    prom = 'rate_off.gif';

    if (num == 0) {
      if (((pul==1) && (i < bylo)) || ((pul==0) && (i<=bylo))) {
        prom = 'rate_on.gif';
      }
      if ((pul==1) && (i==bylo)) {
        prom = 'rate_half.gif';
      }
    } else {
      if (i <= num) {
        prom = 'rate_over.gif';      
      }
    }
    
    document.getElementById('star_'+i).src = 'ikony/'+prom;
  }
}


var xmlHttpReq;
if(typeof XMLHttpRequest != 'undefined') 
{
  try 
  {
    xmlHttpReq = new XMLHttpRequest();
  } 
  catch(e) 
  {
	  try {
	    xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {
	  try {
	    xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	    xmlHttpReq = false;
	  }
	 }
  }
}
else
{
  try {
	  xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try {
	  xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	  xmlHttpReq = false;
	}
  }
}


function sendRequest(getOrPost, page, params)
{
  var strResult;
  if(getOrPost.toUpperCase() == "POST")
  {
    xmlHttpReq.open("POST", page, false);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttpReq.send(params);
  }
  else
  {
    xmlHttpReq.open("GET", page + "?" + params, false);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttpReq.send(null);
  }
  strResult = xmlHttpReq.responseText;
  return strResult;
}


function hodnotit(id,hodnoceni)
{
  document.getElementById('hodnoceni').innerHTML = sendRequest("GET", "hodnoceni.php", "id="+id+"&hodnotit=1&hodnoceni="+hodnoceni);
}

