var xmlhttp;

function create_ajax() {
    if(window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    } else {
        try{ xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.6.0");} catch(e) {}
        try{ xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");} catch(e) {}
    }
}

function makerequest(serverPage, objID) {
    
    var obj = document.getElementById(objID);
    xmlhttp.open("GET", serverPage);
    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            obj.innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.send(null);
}

function addlike(blogID) {
    create_ajax();
    var idOnly = blogID.split("_")[1];
    makerequest("addlikeblog.php?id=" + idOnly, blogID);
}
