<!--

var mobjStickerBox = null;
var mobjStickerBg = null;
var mobjStickerMinimized = null;
var mobjTimer = null;
var mintStickerInitialRight = -149;
var mintStickerFinalRight = 21;
var mintStickerDisplayInterval = 30000;
var mintStickerAnimInterval = 20;
var mintStickerAnimPxStep = 5;
var mblnStickerAnimating = false;

// DIV-Objekte erzeugen
function StickerInit()
  {
  if(mobjTimer)
    {
    window.clearTimeout(mobjTimer);
    mobjTimer = null;
    }
  if(!mobjStickerBox)
    {
    mobjStickerBox = document.getElementById('divStickerBox');
    }
  if(!mobjStickerBg)
    {
    mobjStickerBg = document.getElementById('divStickerBg');
    }
  if(!mobjStickerMinimized)
    {
    mobjStickerMinimized = document.getElementById('divStickerMin');
    }
  }

// Box einblenden/ausblenden
function StickerShow(vblnShow)
  {
  if(!mblnStickerAnimating)
    {
    StickerInit();
    if(mobjStickerBox && mobjStickerBg && mobjStickerMinimized)
      {
      mblnStickerAnimating = true;

      if(vblnShow)
        {
        mobjStickerBox.style.right = mintStickerInitialRight + 'px';
        mobjStickerBox.style.display = 'block';
        mobjStickerBg.style.display = 'block';
        StickerArrangeBackground();
        mobjStickerMinimized.style.display = 'none';
        window.setTimeout('StickerFadeIn()', mintStickerAnimInterval);
        }
      else
        {
        window.setTimeout('StickerFadeOut()', mintStickerAnimInterval);
        }
      }
    }
  }

// Animation: Box einblenden
function StickerFadeIn()
  {
  var intRight = (document.body.clientWidth - mobjStickerBox.offsetLeft - mobjStickerBox.offsetWidth) + mintStickerAnimPxStep;
  if(intRight > mintStickerFinalRight)
    {
    intRight = mintStickerFinalRight;
    }
  mobjStickerBox.style.right = intRight + 'px';
  StickerArrangeBackground();
  if(intRight < mintStickerFinalRight)
    {
    window.setTimeout('StickerFadeIn()', mintStickerAnimInterval);
    }
  else
    {
    mblnStickerAnimating = false;
    mobjTimer = window.setTimeout('StickerShow(false)', mintStickerDisplayInterval);
    }
  }

// Animation: Box ausblenden
function StickerFadeOut()
  {
  var intRight = (document.body.clientWidth - mobjStickerBox.offsetLeft - mobjStickerBox.offsetWidth) - mintStickerAnimPxStep;
  if(intRight < mintStickerInitialRight)
    {
    intRight = mintStickerInitialRight;
    }
  mobjStickerBox.style.right = intRight + 'px';
  StickerArrangeBackground();
  if(intRight > mintStickerInitialRight)
    {
    window.setTimeout('StickerFadeOut()', mintStickerAnimInterval);
    }
  else
    {
    mobjStickerMinimized.style.display = 'block';
    mobjStickerBox.style.display = 'none';
    mobjStickerBg.style.display = 'none';
    mblnStickerAnimating = false;
    }
  }

function StickerArrangeBackground()
  {
  if(mobjStickerBg)
    {
    mobjStickerBg.style.right = ((document.body.clientWidth - mobjStickerBox.offsetLeft - mobjStickerBox.offsetWidth) + 2) + 'px';
    mobjStickerBg.style.height = mobjStickerBox.offsetHeight + 'px';
    }
  }

//-->
