function setTimeoutObj(o, t, f, a) {
	return setTimeout(function() {
		f.apply(o,a);
	}, t);
}

function setIntervalObj(o, t, f, a) {
	return setInterval(function() {
		f.apply(o,a);
	}, t);
}

function animateText(selector, css, delay, delayFinal) {
	this.element = $(selector);
	this.content = this.element.text();
	this.css = css;
	this.delay = delay;
	this.delayFinal = delayFinal ? delayFinal : delay;
	this.index = 0;
	this.timer = setTimeoutObj(this, this.delay, this.next, []);
}

animateText.prototype.next = function() {
	span = $(document.createElement('span'))
		.css(this.css)
		.text(this.content.substr(this.index, 1));
	this.element.text(this.content.substr(0,this.index))
		.append(span)
		.append(this.content.substr(this.index+1, this.content.length));
	if (this.index < this.content.length) {
		this.index++;
		this.timer = setTimeoutObj(this, this.delay, this.next, []);
	} else {
		this.index = 0;
		this.timer = setTimeoutObj(this, this.delayFinal, this.next, []);
	}
}

animateText.prototype.stop = function() {
	clearTimeout(this.timer);
}

/*
 * Twitter Stuff
 */
/*
twitter = new TWTR.Widget({
	version: 2,
	type: 'profile',
	rpp: 4,
	interval: 6000,
	width: 250,
	height: 300,
	theme: {
		shell: {
			background: '#bdb9bd',
			color: '#000000'
		},
		tweets: {
			background: '#e0e0e0',
			color: '#000000',
			links: '#6b6b6b'
		}
	},
		features: {
		scrollbar: false,
		loop: false,
		live: false,
		hashtags: true,
		timestamp: true,
		avatars: false,
		behavior: 'all'
	}
}).render().setUser('lampedweb').start();
*/
