"use strict";
var credits = (function() {
  var names = [],
      len   = roles.length,
      vid   = document.querySelector("video"),
      main  = document.querySelector("main");

  function init() {
    var choices = document.querySelector("#choices"),
        i       = 0;

    for (; i < len; i++) {
      names.push(chance.name());
    }

    choices.addEventListener("change", function(e) {
      var choice = this.value,
          source0, source1;

      if (choice === "blank" || choice === "star-wars") {
        vid.style.display = "none";
      } else {
        vid.style.display = "block";
        vid.setAttribute("id", this.value);
        source0 = vid.querySelectorAll("source")[0];
        source1 = vid.querySelectorAll("source")[1];
        source0.setAttribute("src", "media/" + this.value + ".mp4");
        source0.setAttribute("type", "video/mp4");
        source1.setAttribute("src", "media/" + this.value + ".ogg");
        source1.setAttribute("type", 'video/ogg; codecs="theora, vorbis"');
        vid.load();
      }

      restartCredits(choice);
    });

    buildCredits();
  }

  function restartCredits(choice) {
    main.classList.remove("animate", "star-wars");

    setTimeout(function() {
      main.classList.add("animate", choice);
    });
  }

  function buildCredits() {
    var dl, dt, dd, i = 0;

    dl = document.createElement("dl");

    for (; i < len; i++) {
      dt = document.createElement("dt");
      dt.appendChild(document.createTextNode(roles[i]));
      dd = document.createElement("dd");
      dd.appendChild(document.createTextNode(names[i]));
      dl.appendChild(dt);
      dl.appendChild(dd);
    }

    main.appendChild(dl);
    main.classList.add("animate");
  }

  return { init : init };
})();

@@ -251,29 +251,8 @@
 es%22)
-,%0A        i       = 0
 ;%0A%0A 
@@ -251,32 +251,41 @@
 es%22);%0A%0A    for (
+var i = 0
 ; i %3C len; i++) 
@@ -1259,19 +1259,24 @@
 );%0A    %7D
+, 300
 );%0A
-
   %7D%0A%0A  f
@@ -1321,20 +1321,16 @@
 t, dd, i
- = 0
 ;%0A%0A    d
@@ -1360,24 +1360,24 @@
 ent(%22dl%22);%0A%0A
-
     for (; i
@@ -1373,16 +1373,21 @@
    for (
+i = 0
 ; i %3C le

Revert "Clean up credits JS"