
//--------------------------------------------------------------------------------
// istier marquee Martin
//--------------------------------------------------------------------------------

var shift = 1;      // pixels to shift per interval, left to right
var interval = 20; // ms
var outerWidth = 958;
var marqueeWidth = 2310;

//--------------------------------------------------------------------------------
createStripMartin ();
setInterval ("scroll ()", interval);

var marquees = new Array ();
var x = 0;
var marqueesWidth = 0;
var stopped = 0;

//--------------------------------------------------------------------------------
// run marquee on/off (mouse)
//--------------------------------------------------------------------------------
function toggleMarquee()
{
    if (stopped)
        stopped = 0;
    else
        stopped = 1;
}

//--------------------------------------------------------------------------------
// scroll left to right
//--------------------------------------------------------------------------------
function scroll ()
{
    if (stopped)
        return;

    if (!marquees[0])
    {
        var marquee = document.getElementById ("marquee");
        // marqueeWidth = marquee.style.pixelWidth;
        // outerWidth = marquee.parentNode.style.pixelWidth;
        marquees[0] = marquee;
        var w = 0;
        while (w < outerWidth)
        {
            var m = marquee.cloneNode (true);
            marquees.push (m);
            marquee.parentNode.appendChild (m);
            w += marqueeWidth;
        }
        x = -marqueeWidth + 1;
        marqueesWidth = marquees.length * marqueeWidth;
    }

    for (i in marquees)
    {
        var mx = x + marqueeWidth * i;
        if (mx >= outerWidth)
            mx -= marqueesWidth;
        marquees[i].style.left = mx;
    }

    x += shift;
    if (x >= outerWidth)
        x -= outerWidth + marqueeWidth;
}

//--------------------------------------------------------------------------------
// create strip
//--------------------------------------------------------------------------------
function createStripMartin ()
{
    document.write ('<div id="marquee" style="position:absolute; width:462px; height:76px; left:0px; top:0px;">');
    var s1 = '<div style="position:absolute; left:';
    var s2 = 'px; width:77px; height:76px;"><img src="images/strip.png" /><img src="martin/';
    var s3 = '.png" class="filmStripImage" /></div>';   // 72x50
    var xp = 0;
    var deltaX = 77;
    for (i = 0; i < 30; i++)
    {
        var imgName = 'mf' + String (i + 1);
        var xOff = String (i * deltaX);
        var strip = s1 + xOff + s2 + imgName + s3;
        document.write (strip);
    }
    document.write ('</div>');
/*
<!-- raster over filmstrip -->
<div id="raster400x300" style="position:absolute; top:28px; left:0px; width: 946px; height: 100px; background-repeat:repeat;">
</div>

*/
}

