WestgateChapel.Website.EventsScroller = Class.create();
WestgateChapel.Website.EventsScroller.prototype = {

    initialize: function(container, scrolling) {
    	
	    container = $(container);
	    scrolling = $(scrolling);
	    
	    Element.makeClipping(container);
	    dw_scrollObj.GeckoTableBugFix(container.id);
	    
	    var scrollWin = new dw_scrollObj(container.id, scrolling.id);
        scrollWin.bSizeDragBar = false;
		
	    var scroller = document.createElement("span");
	    scroller.id = container.id + "Scroller";
		
	    var up = document.createElement("a");
	    up.title = "Scroll Up";
	    up.innerHTML = "Up";
	    up.href = "#up";
	    Element.addClassName(up, "up");
		
	    up.onmouseover = function() { dw_scrollObj.initScroll(container.id, "up"); };
        up.onmouseout = function() { dw_scrollObj.stopScroll(container.id); };
        up.onmousedown = function() { dw_scrollObj.doubleSpeed(container.id); };
        up.onmouseup = function() { dw_scrollObj.resetSpeed(container.id); };
            
	    scroller.appendChild(up);
		
	    var down = document.createElement("a");
	    down.title = "Scroll Down";
	    down.innerHTML = "Down";
	    down.href = "#down";
	    Element.addClassName(down, "down");
		
	    down.onmouseover = function() { dw_scrollObj.initScroll(container.id, "down"); };
	    down.onmouseout = function() { dw_scrollObj.stopScroll(container.id); };
	    down.onmousedown = function() { dw_scrollObj.doubleSpeed(container.id); };
	    down.onmouseup = function() { dw_scrollObj.resetSpeed(container.id); };
		
	    scroller.appendChild(down);
		
	    container.appendChild(scroller);
	    
    }
};

new WestgateChapel.Website.EventsScroller("eventsContainer", "events");