﻿// --------------------------------------------------
// základní script pro efekt rolování TAGu vertikalne
// --------------------------------------------------

function FxNewsSystemListScroll(InstanceName,ScrollerWidth,ScrollerHeight,ScrollerSpeed,PauseIt,Filter)
{
    this.CopySpeed=ScrollerSpeed;
    this.PauseSpeed=ScrollerSpeed;
        if(PauseIt == 0)this.PauseSpeed=0
        
        
    this.Cross_Scroller = "";                           // ovládací element
    this.NewsSystemID = InstanceName;                   // ID instance
    this.Filter = Filter;                               // rozlišení vkládané části
    this.ScrollerWidth = ScrollerWidth + "px";          // sirka elementu (px)
    this.ScrollerHeight = ScrollerHeight + "px";        // vyska elementu (px)
    this.ScrollerSpeed = ScrollerSpeed;                 // rychlost posunu (1-10)
    this.PauseIt = PauseIt;                             // pri najeti pausa (0-1)
    
    this.build = function()
    {
        document.writeln('<div style="position:relative;width:'+this.ScrollerWidth+';height:'+this.ScrollerHeight+';overflow:hidden">');
        document.writeln('<div id="iescroller_' + this.NewsSystemID + this.Filter + '" style="position:absolute;left:0px;top:0px;width:100%;" onMouseover="newssystemListScroll_' + this.NewsSystemID + this.Filter + '.CopySpeed=' + this.PauseSpeed + '" onMouseout="newssystemListScroll_' + this.NewsSystemID + this.Filter + '.CopySpeed=' + this.ScrollerSpeed + '">');
        document.writeln('</div></div>');
    }
    
    this.populate = function()
    {
        this.Cross_Scroller = document.getElementById("iescroller_" + this.NewsSystemID + this.Filter);
        this.Cross_Scroller.style.top = parseInt(this.ScrollerHeight)+8+"px";
        this.Cross_Scroller.innerHTML = scrollercontent;
        lefttime=setInterval("newssystemListScroll_" + this.NewsSystemID + this.Filter + ".scrollscroller()",60)
    }
        
    this.scrollscroller  = function()
    {
        if (parseInt(this.Cross_Scroller.style.top)>(this.Cross_Scroller.offsetHeight*(-1)+8))
            this.Cross_Scroller.style.top=parseInt(this.Cross_Scroller.style.top)-this.CopySpeed+"px";
        else
            this.Cross_Scroller.style.top=parseInt(this.ScrollerHeight)+8+"px";
    }
}







