1
|
<!--
|
2
|
|
3
|
var width="310px"
|
4
|
|
5
|
var speed=2
|
6
|
var pauseit=1
|
7
|
|
8
|
var divonclick=speed=(document.all)? speed : Math.max(1, speed-1)
|
9
|
var copyspeed=speed
|
10
|
var pausespeed=(pauseit==0)? copyspeed: 0
|
11
|
var iedom=document.all||document.getElementById
|
12
|
|
13
|
if (iedom)
|
14
|
document.write('<span id="marquee-container">'+content+'</span>')
|
15
|
|
16
|
var actualwidth=''
|
17
|
var scroller
|
18
|
|
19
|
if (window.addEventListener)
|
20
|
window.addEventListener("load", populatescroller, false)
|
21
|
else if (window.attachEvent)
|
22
|
window.attachEvent("onload", populatescroller)
|
23
|
else if (document.all || document.getElementById)
|
24
|
window.onload=populatescroller
|
25
|
|
26
|
function populatescroller(){
|
27
|
scroller=document.getElementById? document.getElementById("scroller") : document.all.scroller
|
28
|
scroller.style.left=parseInt(width)+8+"px"
|
29
|
|
30
|
scroller.innerHTML=content
|
31
|
actualwidth=document.all? document.getElementById("marquee-text").offsetWidth : document.getElementById("marquee-text").offsetWidth
|
32
|
lefttime=setInterval("scrollmarquee()",20)
|
33
|
}
|
34
|
|
35
|
function scrollmarquee(){
|
36
|
if (parseInt(scroller.style.left)>(actualwidth*(-1)+8))
|
37
|
scroller.style.left=parseInt(scroller.style.left)-copyspeed+"px"
|
38
|
else
|
39
|
scroller.style.left=parseInt(width)+8+"px"
|
40
|
}
|
41
|
|
42
|
if (iedom){
|
43
|
with (document){
|
44
|
document.write('<table id="marquee"><td>')
|
45
|
write('<div id="container" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=speed">')
|
46
|
write('<div id="scroller"></div>')
|
47
|
write('</div>')
|
48
|
document.write('</td></table>')
|
49
|
}
|
50
|
}
|
51
|
|
52
|
//-->
|