function update_stars(elem, num, mode) {
      var i;
      for (i = 1; i < 6; i++) {
            if (i >= num) {
                  if (!mode) {
                        this.window.document.getElementById('star' + elem + '_' + i).src = '/images/main/staroff1.jpg';
                  } else if (mode == 1) {
                        this.window.document.getElementById('star' + elem + '_' + i).src = '/images/main/starnone1.jpg';
                  } else if (mode == 2) {
                        this.window.document.getElementById('star' + elem + '_' + i).src = '/images/main/staroff2.jpg';
                  } else if (mode == 3) {
                        this.window.document.getElementById('star' + elem + '_' + i).src = '/images/main/starnone2.jpg';
                  }
            } else {
                  if (mode == 2) {
                        this.window.document.getElementById('star' + elem + '_' + i).src = '/images/main/staron2.jpg';
                  } else {
                        this.window.document.getElementById('star' + elem + '_' + i).src = '/images/main/staron1.jpg';
                  }
            }
      }
}

function update_text(num) {
      var text;
      text = this.window.document.getElementById("star_text");
      if (text) {
            if (num === 0) { text.innerHTML = msg_vote0; }
            if (num === 1) { text.innerHTML = msg_vote1; }
            if (num === 2) { text.innerHTML = msg_vote2; }
            if (num === 3) { text.innerHTML = msg_vote3; }
            if (num === 4) { text.innerHTML = msg_vote4; }
            if (num === 5) { text.innerHTML = msg_vote5; }
      }
}

function show_stars(elem, num, mode) {
      update_stars(elem, num + 1, mode);
      update_text(num);
}

function hide_stars(elem, num, mode) {
      update_stars(elem, num + 1, mode);
      update_text(num);
}
