In this code you can't have an argument in the function:
Code:
http.onreadystatechange = update_rating(video_id)
It has to be either this:
Code:
http.onreadystatechange = update_rating
Or this:
Code:
http.onreadystatechange = function()
{
// video_id here
}