
    function showTheDigits()
    {
        $('d1').appear( { duration: 0.2, afterFinish: 
          function() { $('d2').appear( { duration: 0.2, afterFinish: 
            function() { $('d3').appear( { duration: 0.2, afterFinish: 
              function() { $('d4').appear( { duration: 0.2, afterFinish: 
                function() { $('d5').appear( { duration: 0.2} ) } } ) } } ) } } ) } } );
        
    }


    var secs
    var timerID = null
    var timerRunning = false
    var delay = 1000
    
    function InitializeTimer()
    {
        secs = 2
        StopTheClock()
        StartTheTimer()
    }
    
    function StopTheClock()
    {
        if(timerRunning)
            clearTimeout(timerID)
        timerRunning = false
    }
    
    function StartTheTimer()
    {
        if (secs==0)
        {
            StopTheClock()
            closePopup();
        }
        else
        {
            self.status = secs
            secs = secs - 1
            timerRunning = true
            timerID = self.setTimeout("StartTheTimer()", delay)
        }
    }

    // preload images
    a1= new Image(102,380)
    a1.src = "/images/arrow1.png"
    a2= new Image(102,380)
    a2.src = "/images/arrow2.png"
    a3= new Image(102,380)
    a3.src = "/images/arrow3.png"
    
    var last = 't1';

    function openPopup(){ 
      StopTheClock();
      $('popup').show();
      //$('popup').appear( { duration: 0.2} );
    }

    function closePopup(){ 
      StopTheClock();
      $('popup').hide();
      //$('popup').fade( { duration: 0.2} );
    }

    function changePopup(m) {
        StopTheClock();  
        document.images['arrow'].src = '/images/arrow' + m + '.png';
        $(last).hide();
        last = 't'+m;
        $(last).show();
        $('popup').show();
        //$('popup').appear( { duration: 0.2} );
        
    } 
    
    function submitLogin(){ 
      document.forms["login"].submit();
    }
    
    function checkEnter(){
    	if (event.keyCode == 13)
    		submitLogin()
    }
