<!-- hide script from old browsers
//-------------------------------------------------------------------------------
// JavaScript Digit Perception Test for Pagine Blu degli Psicoterapeuti.
// Written by Rick Glusick, April 1997. 
// Updated July 1997.
// Updated January 1999 - fixed a bug with Netscape 4.5...
//
// This code may be copied, used and modified as long as this banner
// is left intact and attached to this code.
//
// Email : glusick@dave-world.net
// Copyright 1997
//-------------------------------------------------------------------------------
var fullBrowserNameVer = navigator.userAgent;
var browserNameVersion = navigator.userAgent.substring(0,11);
var badGuys = "";
var badGuysTemp = "";
var goodGuy = "))==>";
var space = "  ";
var laser = "--";
var widthGame = 40;
var pause = 61;
var i = 0;
var wait = 0;
var score = 0;
var buttonPress = -1;



function checkBrowser() {
   if (browserNameVersion == "Mozilla/2.0") {
       alert('Sorry, this game requires Netscape Navigator 3.0 or above!');
   }
   else { 
       // The fonts in the text box is proportional in Netscape 3.0
       // and fixed in Netscape 4.0, at least on Windows 3.1.
       // This will adjust a couple variables if you are running 
       // Netscape 4.0.
       if (browserNameVersion == "Mozilla/4.0") {     
           space = " ";
           laser = "-";
       }
       game();
   }
}



function game() {
    var view = "";
    var spaceOut = "";
    var laserOut = "";
    var randNum=Math.floor(Math.random() * 10);
    var lenBadGuys = badGuys.length;
    if (wait == 10) {
        badGuys += randNum.toString(10);
        wait = 0;
    }
    else {
        wait += 1;
    }
    if (badGuys.charAt(0) == buttonPress.toString(10)) {
        score += 1;
        badGuysTemp = badGuys;
        badGuys = "";
        for (i=1; i<lenBadGuys; i++) {
           badGuys += badGuysTemp.charAt(i);
        }
        if (score%10 == 0 & pause > 10)
           pause -= 10;      
    }
    spaceOut = "";
    laserOut = "";
    for (i=1; i<=(widthGame-lenBadGuys); i++) {
       spaceOut += space;
       laserOut += laser;
    }
    if (buttonPress == -1)
      view = goodGuy + spaceOut + badGuys;
    else
      view = goodGuy + laserOut + badGuys;
//  You can comment this next line if the status bar annoys you...
    window.status = view;
    document.cntrlForm.gameBox.value = view;
    document.cntrlForm.scoreBox.value = score.toString(10);
    buttonPress = -1;
    if (lenBadGuys<widthGame) {
        setTimeout("game()",pause);
    }
}
// end hiding contents -->


        