var dom = document.getElementById?1:0;
var ns4 = document.layers?1:0;
present = "Layer1";

onResize = loadAgain;

function loadAgain() {

if (ns4)
self.location.reload();
}


function init() {

 if (dom) {
 layer = document.getElementById("divScrollTextCont").getElementsByTagName("div");
 layer['Layer1'].style.visibility = "visible";
 layer['Layer1'].style.top = 0;
 }
 else if(ns4) {
 layer = "document['divScrollTextCont'].document";
 eval(layer + "['Layer1']" + '.visibility = "visible"');
 eval(layer + "['Layer1']" + '.top = 0');
 }
}


// Funktion zum Scrollen der Layer
// --------------------------------------------------------------------------  

function scroll(direction, speed) {

 if (dom) {
 var layertop = parseInt(layer[present].style.left);
 var scrollheight = (document.getElementById('divScrollTextCont').offsetWidth- layer[present].offsetWidth);
 }
 else if (ns4) {
 var layertop = parseInt(document['divScrollTextCont'].document[present].top);
 var scrollheight = (document['divScrollTextCont'].clip.height - document['divScrollTextCont'].document[present].clip.height);
 }

 if (direction == "down" && layertop - 3 > scrollheight) {

  if (dom) 
  layer[present].style.left = (layertop - speed) + "px";

  else if(ns4) 
  document['divScrollTextCont'].document[present].left = (layertop - speed);
 }

 else if (direction == "up" && layertop < -3 ) {

  if(dom)
  layer[present].style.left = (layertop + speed) + "px";

  else if(ns4)
  document['divScrollTextCont'].document[present].left = (layertop + speed);
 }

timer = setTimeout("scroll('" + direction + "', " + speed + ")", 3);
}


// Funktion zum Beenden des Scrollens
// --------------------------------------------------------------------------  

function stop() {
    
clearTimeout(timer);
}
