var News = {
	speed: 0.010,
	delay: 800,
	
	elem: null,
	innerElem: null,
	ul: null,
	li: null,
	
	init: function(e) {
		this.elem = $(e);
		this.innerElem = $(e + " > div");
		this.ul = $(e + " ul");
		this.li = $(e + " li");

		this.elem.hover(function() { News.stop() }, function() { News.start() });
		
		window.setTimeout(function() { News.start(); }, News.delay);
	},
	
	 //animator function
	animator: function(currentItem) {
		//work out new anim duration
		var distance = currentItem.outerHeight() + 5;
		var duration = (distance + parseInt(currentItem.css("marginTop"))) / this.speed;

		//animate the first child of the ticker
		currentItem.animate({ marginTop: -distance }, duration, "linear", function() {
			  
			//move current item to the bottom
			currentItem.appendTo(currentItem.parent()).css("marginTop", 0);

			//recurse
			News.animator(currentItem.parent().children(":first"));
		});
	},
	
	stop: function() {
		this.li.stop();
	},
	start: function() {
		this.animator(this.ul.children(":first"));
	}
    
}
