﻿var lyr1;
var lyr2;

var blnIsStopped = false;

window.onload = start_ticker;

function start_ticker()
{ 
    try
    {
        Set_Layers();
        Ticker_Initialize();
        Ticker_Scroll();
    }
    catch(err) { }
}

function Set_Layers()
{
    lyr1 = document.getElementById("layer1");
    lyr2 = document.getElementById("layer2");
}

function Ticker_Initialize()	
{
    lyr1.style.top = 250 + 'px';
    lyr2.style.top = (lyr1.offsetHeight + 250) + 'px';
}

function Ticker_Scroll() 
{
    setTimeout("Ticker_Scroll()", 40);

    if(blnIsStopped) return;
	
    lyr1.style.top = parseInt(lyr1.style.top) - 1 + 'px';
    lyr2.style.top = parseInt(lyr2.style.top) - 1 + 'px';

    if(parseInt(lyr1.style.top) < -lyr1.offsetHeight) 
        lyr1.style.top = lyr1.offsetHeight + 'px';
	
    if(parseInt(lyr2.style.top) < -lyr2.offsetHeight) 
        lyr2.style.top = lyr2.offsetHeight + 'px';
}

function Ticker_Stop()
{
    blnIsStopped = true;
}

function Ticker_Start()
{
    blnIsStopped = false;
}
           