<!-- 

        if (document.images) {
          yellow0 = new Image(); yellow0.src = "yellow.gif";
          yellow1 = new Image(); yellow1.src = "yellow_d.gif";
          green0 = new Image(); green0.src = "green.gif";
          green1 = new Image(); green1.src = "green_d.gif";
          blue0 = new Image(); blue0.src = "blue.gif";
          blue1 = new Image(); blue1.src = "blue_d.gif";
          red0 = new Image(); red0.src = "red.gif";
          red1 = new Image(); red1.src = "red_d.gif";
        }

        // Flash one of the quarters /////////////////////////////////////////////

        function flash_quarter(n) {
          // convert number to name of colour:
          if (n==1) colour= "yellow"; if (n==2) colour= "green";
          if (n==3) colour= "blue"; if (n==4) colour= "red";

          document.images[colour].src = eval(colour + "1.src");
          setTimeout('document.images[colour].src = eval(colour + "0.src")', 80);
        }

        
        rnd.today=new Date(); rnd.seed=rnd.today.getTime();

        function rnd() {
          rnd.seed = (rnd.seed * 9301 + 49297) % 233280;
          return rnd.seed / (233280.0);
        }

        function rand() {
          return Math.ceil(rnd() *4 );
        }

        // Initialize global variables ///////////////////////////////////////////

        var count;                // how much we've completed of the current sequence
        var round_number;         // how long the current sequence is
        var difficulty;           // how long the maximum sequence can be
        var rounds= new Array;    // the total sequence of colours
        var interval= 500;        // the interval between flashes (lower is harder)
        var on;                   // are we playing the game at the moment?

        // Set up the game ///////////////////////////////////////////////////////

        function set_up() {
          count= 0; round_number= 0; on= 0;

          // find out the current difficulty level:
          var index= document.diff.level.selectedIndex;
          difficulty= document.diff.level.options[index].value;

          // create the sequence:
          for (var i=0; i<=difficulty; i++) {
            rounds[i]= rand();
          }
        }

        // Show the sequence //////////////////////////////////////////////////////

        function start_round() {
          if (!document.images) {
            // if browser does not support JavaScript images then say so and end
            alert('Sorry, your browser does not support JavaScript Images');
            return;
          }

          document.text.area.value= ""; count= 0; on= 1;

          // but only up to the current step:
          for (var i=0; i<=round_number; i++) {
            setTimeout("flash_quarter(" + rounds[i] + ")", i * interval);
          }
        }

        // User input /////////////////////////////////////////////////////////////

        function user_play(button) {

          // check that we're playing the game:
          if (on) {

            // show the results of the click:
            flash_quarter(button);

            if (rounds[count]!= button) {
              // uh oh.. wrong colour:
              document.text.area.value= "Sorry, you lose.";
              set_up();
            }

            else if (count==round_number) {
              // right colour *and* we've completed the current sequence:
              round_number++;

              if (round_number==difficulty) {
                // the sequence is at an end so that's all :
                document.text.area.value= "Yahoo, you win!";
                set_up();
              }

              else {
                // right colour, but the sequence isn't completed yet:
                setTimeout("start_round()", 1000);
              }
            }

            // next step in the sequence:
            count++;
          }

          else {
            // we're not playing yet:
            document.text.area.value= "Click START to play";
            setTimeout("document.text.area.value=''", 400);
          }
        }

-->