

/* determines the div-position and relocates it - scrolling */
var scrollActive;

function imageBarScroll(){
  if(document.getElementById('image-bar-div1')) {
    var imageHeight = 1004;
    var div1top = document.getElementById('image-bar-div1').style.top;

    div1top = div1top.replace('px','');

    if (div1top < -1004){
      div1top = 0;
    } else {
      div1top--;
    }

    document.getElementById('image-bar-div1').style.top = div1top + 'px';
    document.getElementById('image-bar-div2').style.top = (div1top + imageHeight) + 'px';
    document.getElementById('image-bar-div3').style.top = (div1top + imageHeight+ imageHeight) + 'px';
  }
}

/* onload functions, iFrame-reload and image-scroller */
function imageBarScrollInit() {
  document.writeln('' +
  '<div id="image-bar-div1" style="top: 0px;">' +
  '<img height="1004" alt="" src="image-bar.jpg" width="152" border="0" />' +
  '</div>' +
  '<div id="image-bar-div2" style="top: 1006px;">' +
  '<img height="1004" alt="" src="image-bar.jpg" width="152" border="0" />' +
  '</div>' +
  '<div id="image-bar-div3" style="top: 2012px;">' +
  '<img height="1004" alt="" src="image-bar.jpg" width="152" border="0" />' +
  '</div>');
  imageBarScrollStart();
}
function imageBarScrollStart() {
  scrollActive = window.setInterval("imageBarScroll()",100);
}

function imageBarScrollStop() {
  window.clearInterval(scrollActive);
}
