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