
function sndReq(sid) {

    r = Math.round((Math.random() * (10000000 - 1)));
    http.open("get", "/aj/tx_review/" + sid + "/?r=" + r);
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function handleResponse() {

    if(http.readyState == 4){

        response = http.responseText;
	i = response.substring(4, response.indexOf("-->"));
	j = parseInt(i);
	old_review[j] = document.getElementById("container_review_" + j).innerHTML;
        document.getElementById("container_review_" + j).innerHTML = response;
    }
}

// ---------------

function sndReqPrice(i, p) {

    r = Math.round((Math.random() * (10000000 - 1)));
    http.open("get", "/aj/tx_price/" + i + "-" + p + "/?r=" + r);
    http.onreadystatechange = handleResponsePrice;
    http.send(null);
}

function handleResponsePrice() {

    if(http.readyState == 4){

        response = http.responseText;
        a = document.getElementById("tab_2");
	if (a) a.innerHTML = response;
    }
}

function addMarked(cid, rem) {
    r = Math.round((Math.random() * (10000000 - 1)));
    http.open("get", "/aj/recent?cardid=" + cid + "&mark=" + rem + "&r=" + r);
    http.onreadystatechange = handleResponseMarked;
    http.send(null);
    return false;
}

function handleResponseMarked() {
    if(http.readyState == 4){
        document.getElementById('mark-link').innerHTML = http.responseText;
    }
}

function addOwned(cid, rem) {
    r = Math.round((Math.random() * (10000000 - 1)));
    http.open("get", "/aj/recent?cardid=" + cid + "&own=" + rem + "&r=" + r);
    http.onreadystatechange = handleResponseOwned;
    http.send(null);
    return false;
}

function handleResponseOwned() {
    if(http.readyState == 4){
        document.getElementById('own-link').innerHTML = http.responseText;
    }
}

