doc.write('

Rate This Video

'); doc.write(''); function rateVideo(score,article_id) { urlString = '/components/video_rating.cfm?mode=rate&score=' + score + '&article_id=' + article_id; new Ajax.Request(urlString,{asynchronous: true, onSuccess: rateSuccess}) } function rateSuccess(t) { $('rating_hdr').innerHTML = "Thank you for rating this video!"; score = t.responseText; rateList = $A($('rating_tools').getElementsByTagName("li")); loopCount = 1; rateList.each(function(listItem) { newSpan = doc.createElement("span"); newSpan.appendChild(doc.createTextNode(loopCount)); aKill = listItem.getElementsByTagName("a")[0]; aKill.parentNode.removeChild(aKill); listItem.appendChild(newSpan); if (loopCount == score) { listItem.id = "marked_score" } loopCount++; }); }