/* 
  JavaScript-Set, last modification 28 September 2004 02:52:36 from publisher
  (C) 2004 VEW online Internet Service Agentur GmbH

  Set Contents:

      # Window Popup-Library (5408)

      # Navigation (8180)

      # teaserScroller (43266)

*/
    function OpenCustomWindow(sUrl, sName, nWidth, nHeight, bScrollBars, bToolBar, bLocation, bResizable, bMenuBar, bStatus, nX, nY) {
  if ((typeof nWidth == 'undefined') || (nWidth == null)) nWidth = 600;
  if ((typeof nHeight == 'undefined') || (nHeight == null)) nHeight = 400;
  if ((typeof bScrollBars == 'undefined') || (bScrollBars == null)) bScrollBars = false;
  if ((typeof bToolBar == 'undefined') || (bToolBar == null)) bToolBar = false;
  if ((typeof bLocation == 'undefined') || (bLocation == null)) bLocation = false;
  if ((typeof bResizable == 'undefined') || (bResizable == null)) bResizable = false;
  if ((typeof bMenuBar == 'undefined') || (bMenuBar == null)) bMenuBar = false;
  if ((typeof bStatus == 'undefined') || (bStatus == null)) bStatus = false;
  if ((typeof nX == 'undefined') || (nX == null)) nX = -1;
  if ((typeof nY == 'undefined') || (nY == null)) nY = -1;
  
  var param = "width=" + nWidth + ",height=" + nHeight 
                                 + ",scrollbars=" + (bScrollBars ? "yes" : "no")
                                 + ",toolbar=" + (bToolBar ? "yes" : "no")
                                 + ",menubar=" + (bMenuBar ? "yes" : "no")
                                 + ",location=" + (bLocation ? "yes" : "no")
                                 + ",resizable=" + (bResizable ? "yes" : "no")
                                 + ",status=" + (bStatus ? "yes" : "no")
                                 + ((nX != -1) ? ",left=" + nX : "" )
                                 + ((nY != -1) ? ",top=" + nY : "" );
    
  window.open(sUrl, sName == null ? "" : sName, param);
}

var onLayer=false;
var currentLayer = "";
var lastLayer = "";

function showLayer(layerId)
{
 hideLayer(lastLayer); 
 lastLayer=layerId;
 if(document.getElementById)
   document.getElementById(layerId).style.visibility = "visible";

}

function setCheckTimeout(layerId)
{
	currentLayer=layerId
	window.setTimeout("checkOnLayer()",50);
}

function checkOnLayer()
{
	var layerId = currentLayer;
	if (!onLayer)
	{
		hideLayer(layerId);
	}
}

function hideLayer(layerId)
{
	if (layerId.length>0)
	{
  		onLayer = false;
  		if(document.getElementById)
    			document.getElementById(layerId).style.visibility = "hidden";
    	}

}

function setOnLayer(b, layerId)
{
	if (b) 
	{
		onLayer = true
	}
	else
	{
		onLayer = false;
		setCheckTimeout(layerId);
	}
}  var scrollers = new Array();
  var scCount = 0;
  function Scroller(bound, content)
  {
    this.Id = ++scCount;
    scrollers[this.Id] = this;
    this.Bound = bound;
    this.Content = content;
    this.StartDelay = 500;
    this.StepSize = 1;
    this.StepDelay = 10;
    this.Position = 0;
    this.DelayPositions = new Array();
  }
  Scroller.prototype.start = function p_start()
  {
    this.SecondContent = this.Content.cloneNode(true);
    this.Bound.appendChild(this.SecondContent);
    this.SecondContent.style.top = this.Content.offsetHeight;
    
    window.setTimeout("_p_next(" + this.Id + ")", this.StartDelay);
    
    for(var pos = 0; pos < this.Content.childNodes.length; pos++)
    {
      var node = this.Content.childNodes[pos];
      
      if (node.tagName)
      {
        var delay = node.getAttribute("scrollDelay");
        if (delay)
        {
          this.DelayPositions[node.offsetTop] = delay;
        }
      }
    }
  }
  Scroller.prototype.next = function p_start()
  {
    if (this.Position == this.Content.offsetHeight)
    {
      this.Position = 0;
      var c = this.Content;
      this.Content = this.SecondContent;
      this.SecondContent = c;
      
      this.SecondContent.style.clip = "rect(auto auto auto auto)";
      this.Content.style.clip = "rect(auto auto auto auto)";
    }
    else
      this.Position += this.StepSize;
    
    var delay = this.StepDelay;
    if (this.DelayPositions[this.Position])
    {
      delay = this.DelayPositions[this.Position];
    }
    
    if (this.Position > this.Content.offsetHeight)
      this.Position = this.Content.offsetHeight;
    
    this.Content.style.clip = "rect(" + this.Position + " auto auto auto)";
    this.Content.style.top = -this.Position;
    this.SecondContent.style.top = this.Content.offsetHeight-this.Position;
    
    window.setTimeout("_p_next(" + this.Id + ")", delay);
  }
  function _p_next(id)
  {
    scrollers[id].next();
  }
  
  
  var scroller;
  function init()
  {
    scroller = new Scroller(document.getElementById('boundary'), document.getElementById('container'));
    scroller.start();
  }