var http = _3k_createRequestObject();

function pohvali(p_content_id, p_cmd_name)
{
    //alert('tu sam!');
    http.open('get', 'index.php?cmd=' + p_cmd_name + '&action=pohvali&content_id=' + p_content_id);
    http.onreadystatechange = pohvali_handle_response;
    http.send(null);
}

function pohvali_handle_response()
{
    if(http.readyState == 4 && http.status == 200){

        //alert(http.responseText);
        
        arr_response = http.responseText.split(";");
        content_id  = arr_response[0];
        broj_pohvala = arr_response[1];

        // nakon digg-a zamjeni link za digg sa porukom korisniku
        el  =   document.getElementById('pohvala_link_' + content_id);
        if(el){
            el.innerHTML = "HVALA NA GLASU!";
        }

        // nakon digg-a incrementaj broj glasova pošto nema refresh-a
        el  =   document.getElementById('pohvala_count_' + content_id);
        if(el){
            el.innerHTML = broj_pohvala;
        }
    }
}
