﻿var scroller_width='275px'
var scroller_height='91px'
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
var next3index=3
var next4index=4

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;
                next2index=(next2index<scrollercontent.length-1)? next2index+1 : 0;
                next3index=(next3index<scrollercontent.length-1)? next3index+1 : 0;
                //next4index=(next4index<scrollercontent.length-1)? next4index+1 : 0;
                crossobj.innerHTML= scrollercontent[curindex]  + scrollercontent[nextindex] + scrollercontent[next1index]+ scrollercontent[next2index];
                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;
        next2index=(next2index<scrollercontent.length-1)? next2index+1 : 0;
        next3index=(next3index<scrollercontent.length-1)? next3index+1 : 0;
        //next4index=(next4index<scrollercontent.length-1)? next4index+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";
    }
