﻿var scroller_width='275px'
var scroller_height='44px'
var pause=4000 
var scrollercontent=new Array()
var curpos=scroller_height*(1)
var degree=10
var curlines="lines0"
var curindex=-1
var nextindex=0
var next1index = 1
var next2index = 2

function GetScroller() 
    {
        document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height + ';overflow:hidden"><div id="lines0" style="position:absolute;width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=5);-moz-opacity:0.5;">' +  '</div><div id="lines1" style="position:absolute;width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=5);-moz-opacity:0.5;">'  + '</div></div>');
        crossobj=document.getElementById(curlines);
        rotateslide();
    }
function moveslide()
    {
        if (curpos>0)
            {
                curpos=Math.max(curpos-degree,0);
                tempobj.style.top=curpos+"px";
            }
        else
            {
                clearInterval(dropslide);
                if (crossobj.filters)
                    crossobj.filters.alpha.opacity=100;
                else if (crossobj.style.MozOpacity)
                    crossobj.style.MozOpacity=1;
                nextlines=(curlines=="lines0")? "lines0" : "lines1";
                tempobj=document.getElementById(nextlines);
                curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0;
                nextindex = (nextindex < scrollercontent.length - 1) ? nextindex + 1 : 0;
                next1index = (next1index < scrollercontent.length - 1) ? next1index + 1 : 0;
                crossobj.innerHTML= scrollercontent[curindex]  + scrollercontent[nextindex];
                setTimeout("rotateslide()",pause);
            }
    }

function rotateslide()
    {
        
        curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0;
        nextindex = (nextindex < scrollercontent.length - 1) ? nextindex + 1 : 0;
        next1index = (next1index < scrollercontent.length - 1) ? next1index + 1 : 0;
        resetit(curlines);
        crossobj=tempobj=document.getElementById(curlines);
        crossobj.style.zIndex++;
        if (crossobj.filters)
            document.all.lines0.filters.alpha.opacity=document.all.lines1.filters.alpha.opacity=5;
        else if (crossobj.style.MozOpacity)
            document.getElementById("lines0").style.MozOpacity=document.getElementById("lines1").style.MozOpacity=0.05;
        dropslide=eval('setInterval("moveslide()",50)');
        curlines=(curlines=="lines0")? "lines1" : "lines0";
                
    }

function resetit(what)
    {
        curpos=parseInt(scroller_height)*(1);
        var crossobj=document.getElementById(what);
        crossobj.style.top=curpos+"px";
    }
