/* FILE ARCHIVED ON 15:59:10 Aug 3, 2010 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 1:16:37 Jul 15, 2013. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ function ratepostVote(post_id, vote) { jQuery.ajax({ type: 'POST', data: {'post_id': post_id, 'vote': vote}, url: '/index.php?ak_action=ratepost_vote', timeout: 2000, error: function() {}, success: function(r) { ratepostVoteAvg(post_id); } }) return false; } function ratepostVoteAvg(post_id) { jQuery.ajax({ type: 'POST', data: {'post_id': post_id}, url: '/index.php?ak_action=ratepost_vote_avg', timeout: 2000, error: function() {}, success: function(r) { jQuery('#ratepost-'+post_id).find('div.rating-info').text('Rating ' + r + ' out of 5'); } }) return false; } jQuery(document).ready(function() { jQuery('div.ratepost').not('.voted').find('span div').hover( function() { rating_text = { '1': 'Shit&', '2': 'Poor&', '3': 'Average&', '4': 'Good&', '5': 'Excellent&'}; $current = jQuery(this); $ratepost = $current.parent().parent(); new_rating = $current.attr('rel'); $ratepost.find('span').removeClass().addClass('rating' + new_rating); $ratepost.find('div.status-info').html(rating_text[new_rating]); }, function (){ $ratepost = jQuery(this).parent().parent(); $ratepost.find('span').removeClass().addClass('rating' + $ratepost.attr('rel')); $ratepost.find('div.status-info').text(''); }); jQuery('div.ratepost').not('.voted').find('span div').click(function() { $current = jQuery(this); $ratepost = $current.parent().parent(); vote = $current.attr('rel'); post_id = $ratepost.attr('id').split('-')[1]; $ratepost.find('span div').unbind(); $ratepost.attr('rel', vote); $ratepost.find('span').removeClass().addClass('rating' + vote); $ratepost.find('div.status-info').text('Thank you for voting!'); ratepostVote(post_id, vote); }); });