/*
     $Revision$
     $Id$
     
     File:      localscripts/statusline.js (formerly new/backgrounder.js)
     Status:    100%
     

*/
var DoNewMessagesBlinking = 1;
var HasBlinkingTimeout = 1;
var BlinkingTimeout = 10; // seconds
var BlinkTimerID = 0;
var passed = 0;

function Blinking(text, blink)
{
  if (blink == null) blink = 1;

  if (blink && DoNewMessagesBlinking )
    window.status = "";
  else
    window.status = text;

  blink = 1 - blink;

  if (passed < BlinkingTimeout || !HasBlinkingTimeout)
    BlinkTimerID = setTimeout("Blinking('" + text + "', " + blink + ")", 500);

  if (HasBlinkingTimeout)
    passed += 0.5;
}

function PutTextinStatusline (text)
{
  passed = 0;
  if (BlinkTimerID)
   clearTimeout(BlinkTimerID);
  Blinking(text);
}
