function createRequestObject() {
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

var http = createRequestObject();

function Like(action,survey_id) {
    http.open('get', '../lib/like.htm?rating='+action+'&id='+survey_id, true);
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function handleResponse() {
if(http.readyState == 4){
    var response = http.responseText;
    var elements = new Array();
    elements = response.split("|");
    document.getElementById('amount').innerHTML = elements[0];
}
}