jQuery( function($) {

var speed=10;   // speed of scroller
var step=1;     // smoothness of movement
var y, scroll, hb, hc, hs, h, tp;

function startScroller(){
  h=$('.scroller ul')[0].offsetHeight;
  y-=step;
  if (y<-h) {y=hs;}
  $('.scroller ul')[0].style.top=y+'px';
  scroll=setTimeout(startScroller,speed);
}

function stopScroller(){clearTimeout(scroll);}
function scrollUp(){
	y-=step*20;
    if (y<-h) {y=hs;}
    $('.scroller ul')[0].style.top=y+'px';
}
function scrollDown(){
    y+=step*50;
    if (y>h) {y=h;}
    $('.scroller ul')[0].style.top=y+'px'
}

var initScroller = function(){
    hb=$('.scroller')[0].offsetHeight;
    hs=hb;
    tp=hs-(hs/3);
	itemscont = $('.scroller ul')[0];
	if (itemscont.style) {
	    itemscont.style.top=tp+'px';
		$('li',itemscont).each(function(){
			this.onmouseover = function() { stopScroller(); };
			this.onmouseout = function() { startScroller(); };
		});
	    y=tp;
	    scroll=setTimeout(startScroller,speed);
	}
}();


});


