function get(eN){if(document.getElementById){return(eval('document.getElementById(\'' + eN + '\')'))}else{if (document.all){return(eval('document.all.' + eN))}}}

function q_callback(s)
{
    res = jsrsArrayFromString(s);
    get("rating" + res[0] + "_" + res[1]).innerHTML = res[3]+ " (" +  res[2] + " votes)";
    get("vote" + res[0] + "_" + res[1]).innerHTML = "Your vote has been recorded.";
    return false;
}

function ep_callback(s)
{
    res = jsrsArrayFromString(s);
    get("rating" + res[0] ).innerHTML = res[2]+ " (" +  res[1] + " votes)";
    get("vote" + res[0]).innerHTML = "Thanks";
    return false;
}


function rate(ep, q, r)
{
    //  jsrsPOST = 1;
    jsrsExecute("/ref/rq2.php", q_callback, "rateit", Array(new String(ep), new String(q), new String(r)));
}

function rate_ep(ep, r)
{
    //  jsrsPOST = 1;
    cbrating = r;
    jsrsExecute("/ref/re2.php", ep_callback, "rateit", Array(new String(ep), new String(r)));
}

function rate_img(img, r)
{
    cbrating = r;
    jsrsExecute("/media/ri2.php", ep_callback, "rateit", Array(new String(img), new String(r)));
}

