﻿    function getObject( obj ) {
        var strObj

        if ( document.all ) {
            strObj = document.all.item( obj );
        } else if ( document.getElementById ) {
            strObj = document.getElementById( obj );
        }
        return strObj;
    }

    var NewsTop    = 40;
    var NewsHeight = 180;
    var NewsWidth  = 180;
    var NewsLeft   = 20;
    var NewsClip    = 140;
    
    var EventsTop    = 240;
    var EventsHeight = 160;
    var EventsWidth  = 180;
    var EventsLeft   = 20;
    var EventsClip    = 150;


    function scrollNews( newsDiv, NewsMove ) {
        var theDiv;
        
        theDiv = getObject( newsDiv.toString() );
        if ( theDiv == null ) {
            return; 
        }
        
        if ( document.layers ) {
            theDiv.clip.top = NewsMove;
            theDiv.clip.bottom = NewsMove + NewsClip;
            theDiv.top = NewsTop - NewsMove;
        } else {
            theDiv = theDiv.style;
            theDiv.clip = "rect(" + NewsMove + "px " + (NewsWidth + NewsLeft) + "px " + (NewsMove + NewsClip) + "px 0px)";
            theDiv.top = NewsTop - NewsMove + 'px';
        }

        if ( ( NewsHeight - NewsMove ) < ( NewsTop - 20  ) ) {
            NewsMove = 0;
            if ( document.layers ) {
                theDiv.clip.top = NewsTop;
                theDiv.clip.bottom = NewsClip;
                theDiv.top = NewsTop
            } else {
                theDiv.clip = "rect(" + NewsMove + "px " + (NewsWidth + NewsLeft) + "px " + (NewsMove + NewsClip) + "px 0px)";
                theDiv.top = NewsTop + 'px';
            }
        }
        NewsMove = (NewsMove + 1);
        setTimeout("scrollNews('" + newsDiv + "'," + NewsMove + ")", 100);
    }
    
    function scrollEvents( eventsDiv, EventsMove ) {
        var theDiv;
        
        theDiv = getObject( eventsDiv.toString() );
        if ( theDiv == null ) {
            return; 
        }
        
        if ( document.layers ) {
            theDiv.clip.top = EventsMove;
            theDiv.clip.bottom = EventsMove + EventsClip;
            theDiv.top = EventsTop - EventsMove;
        } else {
            theDiv = theDiv.style;
            theDiv.clip = "rect(" + EventsMove + "px " + (EventsWidth + EventsLeft) + "px " + (EventsMove + EventsClip) + "px 0px)";
            theDiv.top = EventsTop - EventsMove + 'px';
        }

        if ( ( EventsHeight - EventsMove ) < ( EventsTop - 180  ) ) {
            EventsMove = 0;
            if ( document.layers ) {
                theDiv.clip.top = EventsTop;
                theDiv.clip.bottom = EventsClip;
                theDiv.top = EventsTop
            } else {
                theDiv.clip = "rect(" + EventsMove + "px " + (EventsWidth + EventsLeft) + "px " + (EventsMove + EventsClip) + "px 0px)";
                theDiv.top = EventsTop + 'px';
            }
        }
        EventsMove = (EventsMove + 1);
        setTimeout("scrollEvents('" + eventsDiv + "'," + EventsMove + ")", 120);
    }