  function scoreOpinion (id, score) {
    var url = 'score.php';
    var pars = 'id=' + id + '&score=' + score + '&mode=ajax';
    var score1 = document.getElementById('score[' + id + '][1]');
    var score2 = document.getElementById('score[' + id + '][2]');
    
    switch (score) {
      
      case 1:
        score1.src = "/images/qa/sanko2.png";
        score1.onclick = function(){scoreOpinion(id, 0)};
        score2.src = "/images/qa/manzoku1.png";
        score2.onclick = function(){scoreOpinion(id, 2)};
        break;
      
      case 2:
        score1.src = "/images/qa/sanko1.png";
        score1.onclick = function(){scoreOpinion(id, 1)};
        score2.src = "/images/qa/manzoku2.png";
        score2.onclick = function(){scoreOpinion(id, 0)};
        break;
      
      default:
        score1.src = "/images/qa/sanko1.png";
        score1.onclick = function(){scoreOpinion(id, 1)};
        score2.src = "/images/qa/manzoku1.png";
        score2.onclick = function(){scoreOpinion(id, 2)};
    }
    
      $.ajax( {
          type : "POST",
          url : url,
          data : {
                  id : id,
                  score : score,
                  mode : 'ajax'
                },
          success : function(txt) {
                location.reload();
            },
            error : function() {
               alert('Function Read Error!');
             }             
        });
    
//    var scoreAjax = new Ajax.Request (
//      url, 
//            {
//        method: 'post', 
//        postBody: pars, 
//        onComplete: setScore
//      });
  }

  function setScore (originalRequest) {  
    if (originalRequest != "") {
      eval("var txt = " + originalRequest);
      document.getElementById('tree-op-score[' + txt.id + ']').innerHTML = txt.tree_score;
      document.getElementById('detail-score[' + txt.id + ']').innerHTML = txt.tree_score;
/*      $('div_opinion_score[' + txt.id + ']').innerHTML = txt.list_score;*/
    } else {
      document.getElementById('tree-op-score[' + txt.id + ']').innerHTML = "";
      document.getElementById('detail-score[' + txt.id + ']').innerHTML = "";
/*      $('div_opinion_score[' + txt.id + ']').innerHTML = "";*/
    }
  }

