File: D:/HostingSpaces/SBogers10/deensekroon.komma-mediadesign.nl/wwwroot/admin/js/marquee.js
// JavaScript Document
info=[
['<b>Message One</b><br>Mouseover to pause, Mouseout to resume.'],
['<b>Message Two</b><br>With most scrollers the current message disappears up top before the next message appears from below.'],
['<b>Message Three</b><br>Notice that this message came into view before message two disappeared and the next one comes into view before this one disappears.'],
['<b>Message Four</b><br>Two nested divs are used and alternately populated with the messages in the array'],
['<b>Message Five</b><br>When the bottom of current div reaches the top of the display area it is repositioned'],
['<b>Message Six</b><br>If the next divs height is less than the height of the display area it is positioned at the botton of the display area.<br>If the next divs height is greater than the height of the display area it is positioned at the bottom of the next div']
]
step=1
nextMessage=1
function initTSV1(){
tsvDisplay=document.getElementById("tsvcont")
for(var i=0;i<2;i++){
newDiv=document.createElement("DIV")
newDiv.setAttribute("id","tsvdiv"+i)
newDiv.onmouseover=function(){clearTimeout(timer)}
newDiv.onmouseout=function(){scrollTSV1()}
newDiv.style.position="absolute"
newDiv.style.padding="0 5 10 5" // top right bottom left
tsvDisplay.appendChild(newDiv)
}
tsvDv0=document.getElementById("tsvdiv0")
tsvDv1=document.getElementById("tsvdiv1")
tsvDv0.innerHTML=info[0]
tsvDv1.innerHTML=info[1]
tsvDv0.style.top=tsvDisplay.offsetHeight
tsvDv1.style.top=tsvDisplay.offsetHeight+tsvDv0.offsetHeight+"px"
scrollTSV1()
}
function scrollTSV1(){
tsvDv0Pos=parseInt(tsvDv0.style.top)
tsvDv1Pos=parseInt(tsvDv1.style.top)
tsvDv0Pos-=step
tsvDv1Pos-=step
tsvDv0.style.top=tsvDv0Pos+"px"
tsvDv1.style.top=tsvDv1Pos+"px"
if(tsvDv0Pos< -tsvDv0.offsetHeight){
nextMessage++
if(nextMessage==info.length){nextMessage=0}
tsvDv0.innerHTML=info[nextMessage]
if(tsvDv1.offsetHeight<tsvDisplay.offsetHeight){
if(tsvDv1.offsetTop<tsvDisplay.offsetHeight-tsvDv1.offsetHeight){
tsvDv0.style.top=tsvDisplay.offsetHeight+"px"
}
else{
tsvDv0.style.top=tsvDv1.offsetTop+tsvDv1.offsetHeight+"px"
}
}
else{
tsvDv0.style.top=tsvDv1.offsetTop+tsvDv1.offsetHeight+"px"
}
}
if(tsvDv1Pos< -tsvDv1.offsetHeight){
nextMessage++
if(nextMessage==info.length){nextMessage=0}
tsvDv1.innerHTML=info[nextMessage]
if(tsvDv0.offsetHeight<tsvDisplay.offsetHeight){
if(tsvDv0.offsetTop<tsvDisplay.offsetHeight-tsvDv0.offsetHeight){
tsvDv1.style.top=tsvDisplay.offsetHeight+"px"
}
else{
tsvDv1.style.top=tsvDv0.offsetTop+tsvDv0.offsetHeight+"px"
}
}
else{
tsvDv1.style.top= tsvDv0.offsetTop+tsvDv0.offsetHeight+"px"
}
}
timer=setTimeout("scrollTSV1()",50)
}