comparison media/js/shoutbox.js @ 1:dbd703f7d63a

Initial import of sg101 stuff from private repository.
author gremmie
date Mon, 06 Apr 2009 02:43:12 +0000
parents
children f408971657b9
comparison
equal deleted inserted replaced
0:900ba3c7b765 1:dbd703f7d63a
1 /***********************************************
2 * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
3 * This notice MUST stay intact for legal use
4 * Visit http://www.dynamicdrive.com/ for this script and 100s more.
5 ***********************************************/
6
7 var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
8 var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
9 var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
10
11 ////NO NEED TO EDIT BELOW THIS LINE////////////
12
13 var copyspeed=marqueespeed
14 var pausespeed=(pauseit==0)? copyspeed: 0
15 var actualheight=''
16
17 function scrollmarquee(){
18 if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
19 cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
20 else
21 cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
22 }
23
24 function initializemarquee(){
25 cross_marquee=document.getElementById("vmarquee")
26 cross_marquee.style.top=0
27 marqueeheight=document.getElementById("marqueecontainer").offsetHeight
28 actualheight=cross_marquee.offsetHeight
29 if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
30 cross_marquee.style.height=marqueeheight+"px"
31 cross_marquee.style.overflow="scroll"
32 return
33 }
34 setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
35 }
36
37 if (window.addEventListener)
38 window.addEventListener("load", initializemarquee, false)
39 else if (window.attachEvent)
40 window.attachEvent("onload", initializemarquee)
41 else if (document.getElementById)
42 window.onload=initializemarquee
43
44 ///////////////////////////////
45
46 function sb_toggle_smilies()
47 {
48 var d = document.getElementById("shoutbox-smiley-frame");
49 d.style.display = d.style.display == "none" ? "block" : "none";
50 }
51
52 function sb_smiley_click(code)
53 {
54 var txt = document.getElementById("shoutbox-smiley-input");
55 txt.value += code;
56 txt.focus();
57 }