function sndReq(vote,id_num) {
	//make request
	$ajax('get',
				'/process_rating_db.php',
				{
					vote : vote,
					vid : id_num,
					redirect : 'n'
				},
				{
					loading : function(x){
						$('#star_rating_ul').HTML('<div class="loading"></div>');
					},
					success : handleResponse
				}
	);
}

function handleResponse(x) {

	var response = x.responseText;
	var update = new Array();
	
	if(response.indexOf('|') != -1) {
	    update = response.split('|');
	    changeText(update[0], update[1]);
	}
}

function changeText( div2show, text ) {
    // Detect Browser
    var IE = (document.all) ? 1 : 0;
    var DOM = 0; 
    if (parseInt(navigator.appVersion) >=5) {DOM=1};

    // Grab the content from the requested "div" and show it in the "container"
    if (DOM) {
        var viewer = document.getElementById(div2show);
        viewer.innerHTML = text;
    }  else if(IE) {
        document.all[div2show].innerHTML = text;
    }
}

function ajaxStarRatingSystem(theVote, theratingID){
    sndReq(theVote,theratingID);
}