annotate media/js/shoutbox.js @ 3:33f73b7bd305

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