function RatingHttpRequest()
{
        var requestRating; 
		var browser = navigator.appName;
		
        if(browser == "Microsoft Internet Explorer")
        {
                requestRating = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else
        {
                requestRating = new XMLHttpRequest();
        }
        
        return requestRating;
}

function addRating(vote,song)
{
        http = RatingHttpRequest(); 
		
        http.onreadystatechange = function() { if(http.readyState == 4) { ratingResponse(song, http.responseText); } } 
        
        http.open('GET', "/../inc/rating.php?song="+song+"&vote="+vote, true);
        http.send(null);
        

}

function ratingResponse(song, response)
{
    if(response == "voted")
    {
        alert("You already Voted!");
    }
    document.getElementById('songr_rating'+song).innerHTML = response;        
}
