
	var InfoworldNewsticker 		= Class.create();
	InfoworldNewsticker.prototype	= {
		ref: null,
		index: 0,
		news: new Array(),

		initialize: function( aRef ) {
			this.ref = aRef;

			return this;
		},

		addNews: function( aHeadline, aUrl ) {
			this.news[this.news.length] = {headline: aHeadline, url: aUrl};
		},

		run: function() {
			if (!this.news.length) {
				return false;
			}

			this.ref.innerHTML = '<a href="' + this.news[0].url + '" target="_blank">' + this.news[0].headline + '</a>';
			setTimeout( function() { this.next(); }.bind(this), 3500 );

			return true;
		},

		next: function() {
			Effect.Fade( this.ref, {
				duration: 0.8,
				afterFinish: function() {
					this.index++;

					if (this.index >= this.news.length) {
						this.index = 0;
					}

					this.ref.innerHTML = '<a href="' + this.news[this.index].url + '" target="_blank">' + this.news[this.index].headline + '</a>';

					Effect.Appear( this.ref, {
						duration: 0.8,
						afterFinish: function() {
							setTimeout( function() { this.next(); }.bind(this), 3500 );
						}.bind(this)
					} );
				}.bind(this)
			} );
		}
	};
