﻿

    /***********************************************
    * OOCC Vertical Cross browser Marquee - © John Davenport Scheuer
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for this script and 100s more.
    * Modified from Cross browser Marquee II - © Dynamic Drive
    * in http://www.dynamicdrive.com/forums username - jscheuer1
    * For multiple use, continuous content, and functionality in Opera and NS 7
    ***********************************************/

    //////// NO NEED TO EDIT ////////////
    function cross_marquee(delayb4scroll, marqueespeed, pauseit, imagemarquee) {
        if (!document.getElementById || !document.removeChild)
            return;
        if (!cross_marquee.ar)
            cross_marquee.ar = [];
        cross_marquee.ar[this.mqid = cross_marquee.ar.length] = this;
        this.delayb4scroll = delayb4scroll ? delayb4scroll : 300;
        this.marqueespeed = marqueespeed ? marqueespeed : 1;
        this.pauseit = pauseit ? pauseit : 0;
        this.factor = imagemarquee ? 0 : 8;
        this.copyspeed = this.marqueespeed
        this.pausespeed = (this.pauseit == 0) ? this.copyspeed : 0;
        if (document.getElementById('marqueecontainer' + this.mqid)) {
            document.write('<\/div><\/div>');
            document.getElementById('marqueecontainer' + this.mqid).parentNode.removeChild(document.getElementById('marqueecontainer' + this.mqid));
        }
        else {
            alert('You are missing one or more of the divisions:\n<div id="marqueecontainer' + this.mqid + '" style="overflow:auto;">\n' +
'<div class="marq_noscript">\n from your markup.')
            return;
        }
        document.write('<div id="marqueecontainer' + this.mqid + '" style="position:relative;overflow:hidden;" onmouseover="cross_marquee.ar[' + this.mqid + '].copyspeed=cross_marquee.ar[' + this.mqid + '].pausespeed;" onmouseout="cross_marquee.ar[' + this.mqid + '].copyspeed=cross_marquee.ar[' + this.mqid + '].marqueespeed;">\n' +
'<div id="vmarquee_0_' + this.mqid + '" style="position: absolute; width: 98%;"><\/div><div id="vmarquee_1_' + this.mqid + '" style="position: absolute; width: 98%;">')

        this.cross_marquee = document.getElementById("vmarquee_1_" + this.mqid)
        this.cross_marquee2 = document.getElementById("vmarquee_0_" + this.mqid)
        this.marqueeheight = document.getElementById("marqueecontainer" + this.mqid).offsetHeight;
        var cacheobj = this;
        setTimeout(function() { cacheobj.runtime = setInterval("cross_marquee.ar[" + cacheobj.mqid + "].scrollmarquee()", 30) }, this.delayb4scroll);
    }

    cross_marquee.prototype.scrollmarquee = function() {
        if (!this.factor && this.cross_marquee2.innerHTML == '') {
            this.ims = this.cross_marquee.getElementsByTagName('img');
            for (var i_tem = 0; i_tem < this.ims.length; i_tem++)
                if (typeof this.ims[i_tem].complete == 'boolean' && !this.ims[i_tem].complete)
                return;
            this.cross_marquee.innerHTML = this.cross_marquee.innerHTML.replace(/\n|\f/g, '').replace(/> </g, '><');
        }
        if (this.cross_marquee2.innerHTML == '' || this.cross_marquee2.innerHTML != this.cross_marquee.innerHTML)
            this.cross_marquee2.innerHTML = this.cross_marquee.innerHTML;
        if (!this.actualheight || this.actualheight != this.cross_marquee.offsetHeight || this.actualheight != this.cross_marquee2.offsetHeight) {
            this.cross_marquee.style.top = 0;
            this.actualheight = this.cross_marquee.offsetHeight;
            this.cross_marquee2.style.top = this.actualheight + this.factor + 'px';
        }
        if (this.marqueeheight < this.actualheight) {
            if (parseInt(this.cross_marquee.style.top) < this.actualheight * -1 + this.factor)
                this.cross_marquee.style.top = parseInt(this.cross_marquee2.style.top) + this.actualheight + this.factor + "px";
            if (parseInt(this.cross_marquee2.style.top) < this.actualheight * -1 + this.factor)
                this.cross_marquee2.style.top = parseInt(this.cross_marquee.style.top) + this.actualheight + this.factor + "px";
            this.cross_marquee2.style.top = parseInt(this.cross_marquee2.style.top) - this.copyspeed + "px";
            this.cross_marquee.style.top = parseInt(this.cross_marquee.style.top) - this.copyspeed + "px";
        }
        else {
            this.cross_marquee2.style.top = this.marqueeheight * -1 - 28 + 'px';
            if (parseInt(this.cross_marquee.style.top) > this.actualheight * -1 - 28)
                this.cross_marquee.style.top = parseInt(this.cross_marquee.style.top) - this.copyspeed + "px";
            else
                this.cross_marquee.style.top = this.marqueeheight + this.factor + "px";
        }
    }

