function updatefav(id, detail) {
    if (detail == 'yes'){
        document.getElementById('fav' + id).innerHTML = "<img src='/images/loading_ajax.gif' border='0'>";
    } else {
        document.getElementById('fav' + id).innerHTML = "<img src='/images/loading_ajax.gif' height='14' border='0'>";
    }
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', '/user_ajax_anunt_fav.php?id=' + id + '&detail=' + detail, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            var varres = self.xmlHttpReq.responseText;
            document.getElementById('fav' + id).innerHTML = varres;
        }
    }
    self.xmlHttpReq.send(" ");
}