/* 
* package : Brightcode Weblinks Module
* author : Theo van der Sluijs
* link : http://www.brightcode.eu
* Description : Notepad for Joomla!
* copyright : Copyright (C) 2007 Brightcode.eu
* email: theo@brightcode.eu
* date:  October 2007
* Release: 1.5
* Package Code License : http://creativecommons.org/licenses/by-nc-sa/3.0/
* Joomla! API Code License : http://www.gnu.org/copyleft/gpl.html GNU/GPL 
* JavaScript Code & CSS  : http://creativecommons.org/licenses/by-nc-sa/3.0/
* 
*/


/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var sactualwidth=''


function sscrollmarquee(){
  if (parseInt(scross_marquee.style.left)>(sactualwidth*(-1)+8))
    scross_marquee.style.left=parseInt(scross_marquee.style.left)-copyspeed+"px"
  else
    scross_marquee.style.left=parseInt(scross_marquee2.style.left)+parseInt(sactualwidth)+"px"
    
  if (parseInt(scross_marquee2.style.left)>(sactualwidth*(-1)+8))
    scross_marquee2.style.left=parseInt(scross_marquee2.style.left)-copyspeed+"px"
  else
    scross_marquee2.style.left=parseInt(scross_marquee.style.left)+parseInt(sactualwidth)+"px"
/*  document.getElementById("test").innerHTML=parseInt(scross_marquee2.style.left) 
  scross_marquee2.style.left =parseInt(scross_marquee.offsetWidth) + parseInt(scross_marquee.style.left) + 8 + "px"
*/
  }

function sinitializemarquee(){
    scross_marquee=document.getElementById("shout1")
    scross_marquee2=document.getElementById("shout2")
    scross_marquee.style.left=0
    smarqueewidth=document.getElementById("smarquee").offsetWidth
    sactualwidth=scross_marquee.offsetWidth
    scross_marquee2.style.left =parseInt(sactualwidth)+"px"

    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
      scross_marquee.style.width=smarqueewidth+"px"
      scross_marquee.style.overflow="scroll"
      return
      }
    setTimeout('lefttime=setInterval("sscrollmarquee()",30)', delayb4scroll)
  }

if (window.addEventListener)
  window.addEventListener("load", sinitializemarquee, false)
else if (window.attachEvent)
  window.attachEvent("onload", sinitializemarquee)
else if (document.getElementById)
  window.onload=sinitializemarquee
