var ajax = new sack();

/*function whenLoading(){
dropmenuobj=document.getElementById? document.getElementById("addcommentbutton") : addcommentbutton
dropmenuobj.disabled=true;
dropmenuobj.value="Loading..."
}
*/
/*
function whenLoaded(){
dropmenuobj=document.getElementById? document.getElementById("addcommentbutton") : addcommentbutton
window.location = "#comments";
message2.setCode('<body style=\"font-size: small;color: white;background-color: #0B2734;\">Add Another Comment</body>');
dropmenuobj.value = "Add Comment";
dropmenuobj.disabled = false;
}
*/

function whenCompletedRating(){
update = this.response.split('||');
first = update[0];
dropmenuobj=document.getElementById? document.getElementById(first) : first
dropmenuobj.innerHTML=update[1];
//alert(update[1]);
}


/*function whenCompleted(){
dropmenuobj=document.getElementById? document.getElementById("imagecomments") : imagecomments
dropmenuobj.innerHTML=this.response;
alert("Your IMAGE Comment Has Been Submitted, There is no need to press Submit Again.");
}
*/
function sndReq(vote,feature,id_num,ip_num,units,obj){
//	alert("here");
	var theUL = document.getElementById('unit_ul_'+feature+id_num); // the UL
        theUL.innerHTML = '<div class="loading"></div>';
        ajax.setVar("j", vote); // recomended method of setting data to be parsed.
        ajax.encVar("f", feature); // recomended method of setting data to be parsed.
        ajax.encVar("q", id_num); // recomended method of setting data to be parsed.
        ajax.encVar("t", ip_num); // recomended method of setting data to be parsed.
        ajax.encVar("c", units); // recomended method of setting data to be parsed.
        ajax.requestFile = "/includes/rpc.php";
        ajax.method = "GET";
//        ajax.onLoading = whenLoading;
//        ajax.onLoaded = whenLoaded;
//      ajax.onInteractive = whenInteractive;
        ajax.onCompletion = whenCompletedRating;
        ajax.runAJAX();
}


/*

function sndReq(vote,feature,id_num,ip_num,units) {
	var theUL = document.getElementById('unit_ul_'+feature+id_num); // the UL
	theUL.innerHTML = '<div class="loading"></div>';
    xmlhttp.open('get', '/includes/rpc.php?f='+feature+'&j='+vote+'&q='+id_num+'&t='+ip_num+'&c='+units);
    xmlhttp.onreadystatechange = handleResponse;
    xmlhttp.send(null);	
}
*/
