/***********************************************
* 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.
***********************************************/

var delayb4scroll=1000
var marqueespeed=1
var marqueespeedup=4
var pauseit=1

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function m_up_speedup() {
    copyspeed=marqueespeedup
    initializemarquee_up()
}

function m_down_speedup() {
    copyspeed=marqueespeedup
    initializemarquee_down()
}

function m_up() {
    copyspeed=marqueespeed
    initializemarquee_up()
}

function m_down() {
    copyspeed=marqueespeed
    initializemarquee_down()
}

function scrollmarquee_up(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
        cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
    }
    else {
        cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
    }
}

function scrollmarquee_down(){
    if (parseInt(cross_marquee.style.top)<(marqueeheight+8)) {
        cross_marquee.style.top=parseInt(cross_marquee.style.top)+copyspeed+"px";
    }
    else {
        cross_marquee.style.top=parseInt(marqueeheight)-(actualheight+marqueeheight)+"px"
    }
}

function initializemarquee_start(){
    cross_marquee=document.getElementById("vmarquee")
    cross_marquee.style.top=0
    marqueeheight=document.getElementById("marqueecontainer").offsetHeight
    actualheight=cross_marquee.offsetHeight
    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) { //if Opera or Netscape 7x, add scrollbars to scroll and exit
        cross_marquee.style.height=marqueeheight+"px"
        cross_marquee.style.overflow="scroll"
        return
    }
    setTimeout('lefttime=setInterval("scrollmarquee_up()",30)', delayb4scroll)
}

function initializemarquee_stop(){
    window.clearInterval(lefttime);
}

function initializemarquee_up(){
    window.clearInterval(lefttime);
    cross_marquee=document.getElementById("vmarquee")
    marqueeheight=document.getElementById("marqueecontainer").offsetHeight
    actualheight=cross_marquee.offsetHeight
    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) { //if Opera or Netscape 7x, add scrollbars to scroll and exit
        cross_marquee.style.height=marqueeheight+"px"
        cross_marquee.style.overflow="scroll"
        return
    }
    lefttime=setInterval("scrollmarquee_up()",30)
}

function initializemarquee_down(){
    window.clearInterval(lefttime);
    cross_marquee=document.getElementById("vmarquee")
    marqueeheight=document.getElementById("marqueecontainer").offsetHeight
    actualheight=cross_marquee.offsetHeight
    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) { //if Opera or Netscape 7x, add scrollbars to scroll and exit
        cross_marquee.style.height=marqueeheight+"px"
        cross_marquee.style.overflow="scroll"
        return
    }
    lefttime=setInterval("scrollmarquee_down()",30)
}

if (window.addEventListener) {
    window.addEventListener("load", initializemarquee_start, false)
}
else if (window.attachEvent) {
    window.attachEvent("onload", initializemarquee_start)
}
else if (document.getElementById) {
    window.onload=initializemarquee_start
}
