
		function doSlideUp() {
			if (actitem == null){
				$$("div.newsitem").each(function(item) {			
					if (actitem == null || parseInt(item.style.top) < parseInt(actitem.style.top)){
						actitem = item;
					}					
				});
				
			
				new Effect.Morph('newsticker-scroller', {
					duration : 0.5,
					style : {
						top : parseInt($('newsticker-scroller').style.top) - actitem.getHeight() + 'px'
					},
					afterFinish : function() {
						actitem.style.top = parseInt(actitem.style.top) + heights  + 'px';
						actitem = null;
					}
				});
			}
		}
		
		function doSlideDown() {
			if (actitem == null){
				$$("div.newsitem").each(function(item) {						
					if (actitem == null || parseInt(item.style.top) > parseInt(actitem.style.top)){
						actitem = item;
					}					
				});
				actitem.style.top = parseInt(actitem.style.top) - heights  + 'px';
				new Effect.Morph('newsticker-scroller', {
					duration : 0.5,
					style : {
						top : parseInt($('newsticker-scroller').style.top) + actitem.getHeight() + 'px'
					},
					afterFinish : function() {
						actitem = null;
					}
				});
			}
		}
		
		
		
		var pe;
					var newsitems = $('newsticker-scroller').select('div.newsitem');
			var widths = 0;
			var heights = 0;
			var actitem = null;
		Event.observe(window, 'load', function() {
			
			$('newsticker').style.display = 'block';
			$('newsticker').makePositioned();
			

	
			newsitems.each(function(item) {
				//item.style.left = widths + 'px';
				item.style.left = 0 + 'px';
				item.style.top = heights + 'px';
				item.style.position = 'absolute';
				widths = widths + item.getWidth();
				heights = heights + item.getHeight();
	
			});
			
			
			Event.observe($('newsticker'), 'mouseover', function(event) {									 
				pe.stop();
			});
			Event.observe($('newsticker'), 'mouseout', function(event) {											
				pe = new PeriodicalExecuter(function(pe) {			 	
							doSlideUp();
				}, 3);
			});
			
			Event.observe($('newsticker-right'), 'mouseover', function(event) {									 
				pe.stop();
			});
			Event.observe($('newsticker-right'), 'mouseout', function(event) {											
				pe = new PeriodicalExecuter(function(pe) {			 	
							doSlideUp();
				}, 3);
			});
			
			
			pe = new PeriodicalExecuter(function(pe) {
					doSlideUp();
			}, 3);
		});