﻿//i'm assuming it will take the user 10secs to read 
//the content
var seconds = 60;
var position = -300;
function countDown()
{
    if(seconds >= 1 )
    {
        seconds--;
        countDownDisplay("count",seconds);
        setTimeout("countDown()","1000");
    }    
    else
    {
        window.location="CoursePurchase.aspx";
    }
}

function countDownDisplay(id,text)
{
    nodeElement = document.getElementById(id);
    
        nodeElement.innerText = text;
        nodeElement.textContent = text;
}


function init()
{
      countDown();
}

function change(obj,num,file)
{
var bnt = document.getElementById(obj);
bnt.src = file+"_"+num+".gif";
}

function focusTextBox(obj)
{    
    unhideLogin(obj);
    flash(obj);
}

function flash(obj)
{
    
    var box2 = document.getElementById(obj);
   
    
    if( position != 0)
    {
        
        
        box2.style.position = 'absolute';
        box2.style.right = position+'px';
        position+=20;
        
        setTimeout('flash(\''+obj+'\')',30);
    }
    else
    {
       
       
       box2.style.right = 0+'px';
        
    }
    
}

function unhideLogin(obj)
{
    var box2 = document.getElementById(obj);
    box2.style.display = 'block';
}

function hide(obj)
{
    var box2 = document.getElementById(obj);
   
    position = -300;
    box2.style.display = 'none';
    box2.style.position = 'absolute';
    box2.style.right = '400px';
}
