All pastes #746135 Raw Edit

Stuff

public javascript v1 · immutable
·published 2007-10-22 23:42 UTC
rendered paste body
// Our Ajax vote callfunction Rating_Vote(video, score) {    // This will remove our handlers  Remove_Rating_Handlers(video);    new Ajax.Request('/Pages/Videos/Video_Ajax_Vote.aspx', {    parameters: {		video: video,		score: score	},    onComplete: function(transport) {      ratingOn = false;      $('star_'+video+'_txt').update(transport.responseText);    }  });}// This will add the voting handlers to a specific videofunction Add_Rating_Handlers(video, adv, ratings) {  (5).times(function(n) {    n++;    $('star_'+video+'_'+(n)).observe('mouseover', function() { Rating_Change(video, n); });    $('star_'+video+'_'+(n)).observe('mouseout',  function() { Rating_Reset(video, adv, ratings); });    $('star_'+video+'_'+(n)).observe('click',     function() { Rating_Vote(video, n); });  })}// This will remove our rating handlersfunction Remove_Rating_Handlers(video) {  (4).times(function(n) {    n++    $('star_'+video+'_'+(n)).stopObserving('mouseout');    $('star_'+video+'_'+(n)).stopObserving('mouseover');    $('star_'+video+'_'+(n)).stopObserving('click');  })}