    questionCount = 0;

    values = new Array ("$100", "$200", "$300", "$500", "$1,000",
                         "$2,000", "$4,000", "$8,000", "$16,000", "$25,000",
                         "$50,000", "$100,000", "$250,000", "$500,000", "$1,000,000");

    questions = new Array (
        "How many buttons are enabled by default on a standard Mac mouse?",
        "The <i>1984</i> TV ad introducing the Mac was shown during what event?",
        "In Mac OS X, in which menu would you find Shut Down?",
        "Which of these chips has never been a Mac CPU?",
        "Which of the following could HyperCard <i>not</i> attach HyperTalk script to?",
        "Which of these games was never ported to the Mac?",
        "Which of the following ports would you find on a Rev/A \"Bondi Blue\" iMac?",
        "Which iPod had a row of four buttons between the screen and the thumb wheel?",
        "Cyberdog, Shiira, and Opera are all what kind of application?",
        "What music festival was sponsored by Steve Wozniak after he left Apple?",
        "Which 68030-based Mac was obsoleted after just four months by the introduction of the PowerPC-based Centris 650?",
        "What did the Apple code name BHA stand for?",
        "Which of the following people has never been the CEO of Apple?",
        "What 300-micron long icon can be found on the PowerPC 750 (G3) chip?",
        "What award-winning anime film, advertised in <i>MacWorld</i>, was created entirely by one man on a PowerMac G4?"
);

    responses = new Array (
                    new Array( "1", "2", "3", "4"),
                    new Array( "FIFA World Cup", "Winter Olympics", "Super Bowl", "Academy Awards"),
                    new Array ("Apple", "Special", "Start", "Power"),
                    new Array ("Mororola 68000", "Motorola PowerPC 601", "Zilog Z80", "Intel Core Duo"),
                    new Array ("Buttons", "Cards", "Stacks", "Desktop"),
                    new Array ("<i>Tomb Raider</i>", "<i>Final Fantasy VII</i>", "<i>Madden NFL</i>", "<i>Lego Star Wars</i>"),
                    new Array ("ADB", "SCSI", "FireWire", "USB"),
                    new Array ("First Generation", "Second Generation", "Third Generation", "Fourth Generation"),
                    new Array ("Personal organizers", "Music composers", "Disk utilities", "Web browsers"),
                    new Array ("Bonaroo", "US Festival", "Woodstock 94", "Lilith Fair"),
                    new Array ("IIcx", "IIci", "IIvx", "Quadra"),
                    new Array ("Big Heap Arithmetic", "Butt Head Astronomer", "Better Help Apple", "Byte Hex Assembly"),
                    new Array ("Mike Markkula", "Gil Amelio", "Michael Spindler", "Fred D. Anderson"),
                    new Array ("Apple", "Dolphin", "Sword", "Minivan"),
                    new Array ("<i>The Place Promised in Our Early Days</i>", "<i>The Wings of Honneamise</i>", "<i>Voices of a Distant Star</i>", "<i>The Secret of Blue Water</i>")
               );
                              
    correctAnswers = new Array (0, 2, 0, 2, 3, 1, 3, 2, 3, 1, 2, 1, 3, 2, 2);


    function loadNextQuestion() {
        // alert ("load next question");
        document.getElementById("value").innerHTML = values [questionCount];
        document.getElementById("question").innerHTML = questions [questionCount];
        for (i=0; i<=3; i++) {
            document.getElementById("response"+i).innerHTML = 
                responses[questionCount][i];
        }
        uncheckAll();

    }

    function handleResponse() {
        // alert ("handle response");
        responseForm = findFormWithResponse();
        response = null;
        for (i=0; i<=3; i++) {
            // if (document.theform.response[i].checked==true) {
            // if (document.forms[0].response[i].checked==true) {
            if (responseForm.response[i].checked==true) {
                response = i;
                break;
            }
        }
        // alert (response);
        if (response == null) {
            alert ("no response!");
        } else if (response == correctAnswers [questionCount]) {
            alert ("Correct!");
            questionCount++;
            if (questionCount < questions.length)
                loadNextQuestion();
        } else {
            // alert ("Wrong!");
            alert ("Wrong, it was " +
                    responses[questionCount][correctAnswers[questionCount]]);
            restartGame();
        }
    }

    function uncheckAll() {
        responseForm = findFormWithResponse();
        for (i=0; i<=3; i++) {
            // document.theform.response[i].checked=false;
            responseForm.response[i].checked=false;
        }
    }

    function findFormWithResponse() {
        formCount = 0;
        someForm = null;
        while ( (someForm = document.forms[formCount]) != undefined) {
            // alert ("Found form " + formCount);
            if (someForm.response != undefined) {
                // alert ("found response");
                return someForm;
            }
            formCount++;
        }
        return null;
    }

    function restartGame() {
        findFormWithResponse();
        questionCount = 0;
        loadNextQuestion();
    }
