/* Создание нового объекта XMLHttpRequest для общения с Web-сервером */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
function callRating(rate, type, id) {


  var url = "/tools/ajaxtonnel.php?act=rating";
  url+='&rate='+rate+'&type='+type+'&id='+id;
  xmlHttp.open("GET", url, true);
  //xmlHttp.setRequestHeader("Content-Type",  "application/x-www-form-urlencoded");
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null);
}
var progress='Loading';
 function updatePage() {
     if (xmlHttp.readyState == 4) {
       document.getElementById('rating').innerHTML=xmlHttp.responseText;
     }
     else
     {
       progress+='.';
       document.getElementById('rating').innerHTML='<b>'+progress+'</b>'; //alert(2);
     }
   }
