/**
* Text fade
*
* @prerequisite jQuery.js
*
* @author Websell Masters Ltd
* @copyright Websell Masters Ltd
* @date 24/09/09
*/
$(function() {
	//fade text elements in and out
	$.each($(".fade_text"), function() {
		var fade_text = $(this);
		
		window.setInterval(function(a,b) {
			fade_text.fadeIn(500).wait(2000).fadeOut(500);
		}, 4000);
	});
});

//Extend jQuery functionality
$.fn.wait = function(time, type) {
	time = time || 1000;
	type = type || "fx";
	return this.queue(type, function() {
		var self = this;
		setTimeout(function() {
			$(self).dequeue();
		}, time);
	});
};
