	var step = 6; //pixels to scroll per tick
	var time = 70; //time per tick (lower scrlls faster)
	var blockHeight = 94; //height of the outer block level element
	var blockId = 'scroll'; //id of the content div;
	var scrollup = false;
	var scrolldown = false;
	var noScroll = false;
	var inner;
	var minMargin;
	var outHeight;
	var inHeight;

	function init_scroll() {
		inner = document.getElementById(blockId);
		var outer = inner.parentNode;
		outer.style.overflow = 'hidden';
		
		var agenda = outer.parentNode;
		var img = document.createElement('img');
		img.src = 'images/scrollup.png';
		img.style.position = 'absolute';
		img.style.top = '240px';
		img.style.right = '168px';
		img.onmouseover = function() { scrollup=true; scroll() }
		img.onmouseout = function() { scrollup = false; }
		agenda.appendChild(img);
		
		var img = document.createElement('img');
		img.src = 'images/scrolldown.png';
		img.style.position = 'absolute';
		img.style.top = '254px';
		img.style.right = '168px';
		img.onmouseover = function() { scrolldown=true; scroll() }
		img.onmouseout = function() { scrolldown = false; }
		agenda.appendChild(img);


		inHeight = (inner.clientHeight) ? inner.clientHeight : inner.offsetHeight;
		if (inHeight <= blockHeight) {
			noScroll = true;
		}
		
		minMargin = (inHeight)*-1 + blockHeight;
		
		//attach mozilla scroll event to the div
		if (inner.addEventListener) {
			inner.addEventListener( "DOMMouseScroll", mozScroll, false ); 
		}
	}

	function mozScroll(e) { 
		if (e.detail < 0) scrollUp(2)
		else { scrollDown(2); }
	}

	function iescrollwheel(e) {
		if (!e) {  e = window.event; }

		if (e.wheelDelta >= 120) scrollUp(2);
		else if (e.wheelDelta <= -120) scrollDown(2);   
	}

	function scroll() {
		if (scrollup) { scrollUp(); setTimeout(scroll, time);}
		if (scrolldown) { scrollDown(); setTimeout(scroll, time); }
	}
	
	function scrollUp(i) {
		if (noScroll) return;
		if (!i) { i = 1; }
		var mg = inner.style.marginTop;
		newMg = mg.substr(0, mg.length-2)*1 + i * step;
		newMg = Math.min(0, Math.round(newMg) );
		inner.style.marginTop = newMg + 'px';
	}

	function scrollDown(i) {
		if (noScroll) return;
		if (!i) { i = 1; }
		var mg = inner.style.marginTop;
		newMg = mg.substr(0, mg.length-2)*1 - i * step;
		newMg = Math.max(minMargin, Math.round(newMg) );
		inner.style.marginTop = newMg  + 'px';
	}
__onloadStack.push(init_scroll);
