Rating = {

  save: function (articleId, tableName, rating) {
    $.ajax({
       type: "POST",
       url: "/ajax/rating/",
       data: "rating=" + rating + "&id=" + articleId + "&table=" + tableName,
       success: function(msg){
         document.getElementById('your_rating').innerHTML = msg;
       }
     });
     return false;
  },

  hilite: function (element) {

    id = parseInt(element.id.substring (6));
   // alert(id);

    for (i = 1; i <= id; i++) {
      elId = 'rating'+i;
   //   alert (elId);
      className = document.getElementById(elId).className;
      //alert (className);
      newClass = 'active';
      if (className == 'bw') newClass = 'bw_active';
      document.getElementById(elId).className = newClass;
    }
  },

  unhilite: function (element) {
    //id = parseInt(String.substring(element.id, 6));

    for (i = 1; i <= 10; i++) {
      elId = 'rating'+i;
      //alert (elId);
      className = document.getElementById(elId).className;
      //alert (className);
      newClass = '';
      if (className == 'bw_active' || className == 'bw') newClass = 'bw';
      document.getElementById(elId).className = newClass;
    }
  }

}

$(document).ready(function() {
  $(".writecomment a").bind('click', function() {
    $(".comment_new").show('slow');
    return false;
  });
});
