function getXMLHTTPRequest() {
try {
req = new XMLHttpRequest();
} catch(err1) {
  try {
  req = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (err2) {
    try {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (err3) {
      req = false;
    } 
  } 
}
return req;
}

var http = getXMLHTTPRequest();

function getVote(id,i) {   
	
  var url = 'ajax/script.php?funr='+i+'&opt='+id;
  
  myRand = parseInt(Math.random()*999999999999999);
  
  var modurl = url + '&rand=' + myRand;  
  
  
  http.open("GET", modurl, true);
 
  http.onreadystatechange = useHttpResponse2;
  
  http.send(null);

}


function useHttpResponse2() {
	var id = 'vote';
   if (http.readyState == 4) {
    if(http.status == 200) { 
    	
       
       document.getElementById(id).innerHTML = http.responseText;
    }
  } else {
  document.getElementById(id).innerHTML = '<img src="images/loading.gif">';
  }
}

  
function getNews(num,lid, name) {
  
 
  var url = 'ajax/script.php?numr=' + num + '&namr=' + name;
  
  myRand = parseInt(Math.random()*999999999999999);
  
  var modurl = url + '&rand=' + myRand;  
  
  
 
  http.open("GET", modurl, true);
 
  http.onreadystatechange = useHttpResponse;
  
  http.send(null);
}

function useHttpResponse() {
	var id = 'news';
   if (http.readyState == 4) {
    if(http.status == 200) { 
    	
       
       document.getElementById(id).innerHTML = http.responseText;
    }
  } else {
  document.getElementById(id).innerHTML = '<img src="images/loading.gif">';
  }
}