// JavaScript Main Textfader

$(document).ready(function() {
	
	$("#span_light_small_02").animate({
		'opacity' : 0
	});
	$("#span_light_small_03").animate({
		'opacity' : 0
	});
	$('#span_light_small').fadeOut01();
	
});

// delay function
$.fn.delay = function( time, name ) {
    return this.queue( ( name || "fx" ), function() {
        var self = this;
        setTimeout(function() { $.dequeue(self); } , time );
    });
};

// fade functions
$.fn.fadeOut01 = function () {
	$('#span_light_small').delay(5000).animate({
		'opacity' : 0,
	  }, 2000, function() {
		$('#span_light_small_02').fadeIn02();
	});
};

$.fn.fadeIn01 = function () {
	$('#span_light_small_03').hide();
	$('#span_light_small').animate({
		'opacity' : 1
	});
	$('#span_light_small').show();
	$('#span_light_small').fadeOut01();
};

$.fn.fadeOut02 = function () {
	$('#span_light_small_02').delay(5000).animate({
		'opacity' : 0,
	  }, 2000, function() {
		$('#span_light_small').fadeIn03();
	});
};

$.fn.fadeIn02 = function () {
	$('#span_light_small').hide();
	$("#span_light_small_02").animate({
		'opacity' : 1
	});
	$('#span_light_small_02').show();
	$('#span_light_small_02').fadeOut02();
};

$.fn.fadeOut03 = function () {
	$('#span_light_small_03').delay(5000).animate({
		'opacity' : 0,
	  }, 2000, function() {
		$('#span_light_small').fadeIn01();
	});
};

$.fn.fadeIn03 = function () {
	$('#span_light_small_02').hide();
	$("#span_light_small_03").animate({
		'opacity' : 1
	});
	$('#span_light_small_03').show();
	$('#span_light_small_03').fadeOut03();
};
