// $Revision: 4071 $

function TAfterErrorCounter(id, thisObjName)
{
  this.ID = id;
  this.ThisObjName = thisObjName;
  this.SetTime = SetTime;
  this.GetTime = GetTime;
  
  this.AutoUpdate = AutoUpdate;
  
  this.Time = 0;
  
function SetTime(sec)
{
  this.Time = sec;
  
  if(this.Time > 0)  this.AutoUpdate();
}

function GetTime()
{
  return this.Time;
}

function AutoUpdate()
{
  if(this.Time > 0)
  {
    document.getElementById(this.ID).innerHTML = BeginCenter() + this.Time + EndCenter();
    this.Time--;
    //alert("Before setTimeout");
    setTimeout(this.ThisObjName + ".AutoUpdate()", 1000);
    //alert("After setTimeout");
    return;
  }
  
  document.getElementById(this.ID).innerHTML = keyboard.PlaceKeyboard('900');
//  keyboard.InitKeyInput();
  keyboard.InitKeyboard();
//  FlashKeyboard.SetKey(ExerciseText.charAt(CaretPos));
  CiteField.Render();
  CiteField.Update();
  
  SetLeftSideTyping();
  ExerciseAfterError();
}

}
///