var speed = 20;
var el = 'vmarquee';
var t;
var ef;

function _marqueeInit() {
	el = $(el).cleanWhitespace();
	Event.observe(el,'mouseover',function() { ef.cancel(); });
	Event.observe(el,'mouseout',moveScroll);
	//alert( el.offsetHeight );
	moveScroll();
	//alert('top:-'+el.offsetHeight);
}

function moveScroll() {
	var that = this;
	if ( parseInt(el.style.top) <= -1*(el.offsetHeight) ) {
		el.setStyle({top: (el.ancestors()[0].offsetHeight) + 'px'});
	}
	if ( ef ) {
		ef.cancel();
	}
	ef = new Effect.Move(
		el,
		{
			y: '-'+el.offsetHeight,
			x: 0,
			duration: (el.offsetHeight+parseInt(el.getStyle('top')))/speed,
			fps:'30',
			mode: 'absolute',
			transition: Effect.Transitions.linear,
			afterFinish: moveScroll
		});
	//t = setInterval("moveScroll()",(el.offsetHeight/speed)*1000);

}


Event.observe(window, 'load', function() {
	_marqueeInit();
});
