ls_UserRating = {
  topicId : 0,
  Rating_current : 0,
  Rating_countVote : 0,
  Rating_userIsVote : 0,
  
  Rating_move : function(div, e) {
    e = e||window.event;
    if(!div.className) div = div.parentNode;
    div.firstChild.style.width = ((e.layerX||e.offsetX)/120*100) + '%';
    
    iRating = (e.layerX||e.offsetX)*500/(120*50);
    $('topic_user_rating').set('text',Math.round(iRating*10)/10);
  },

  Rating_out : function(e) {
    e = e||window.event;
    var target = e.target||e.srcElement;
    if((target.className && target.className == 'stars')) {
      return false;
    }
    $('topic_user_rating').set('text',Math.round(this.Rating_current/5)/10);
    $('topic_user_rating_stars').style.width = ( this.Rating_current/500*100 + '%' );
  },
  
  Rating_click : function(div, e) {
    e = e||window.event;
    if(!div.className) div = div.parentNode;
    var value = Math.round((e.layerX||e.offsetX)*500/120);
    this.Rating_userIsVote = value;
    return lsVote.vote(this.topicId, div, value, 'user_rating');
  },

  Rating_voted : function(result) {
    this.Rating_current = Math.round(result.iRating);
    this.Rating_countVote = result.iCountVote;
    $('topic_user_rating').set('text',Math.round(this.Rating_current/5)/10);
    $('topic_user_rating_stars').style.width = ( this.Rating_current/500*100 + '%' );
    $('topic_user_count_vote').set('text',result.iCountVote);
    this.Rating_userIsVote = true;
  }
}