$.time = 50;
$.ran = 0;
// This initializes the menu
$(function() {
	$('ul.fader').fader();
});

(function($){
	function addTimers(ul) {
		$.size = $('> li', ul).length;

		$('> li', ul).each( function() {

					$(this).oneTime( eval("$.time + 'ms'"), "show", function() {
						//$(this).css("margin-left", Math.floor(Math.random()*501) + "px");
						//$(this).css("margin-top", Math.floor(Math.random()*101) + "px");
						$(this).fadeIn(7000);
						$(this).oneTime( "500ms", function() {
							$(this).fadeOut(3500);
						});
					});

					$(this).everyTime( eval("(7000 * ($.size + 1) + $.time) + 'ms'"), "show", function() {
						//$(this).css("margin-left", Math.floor(Math.random()*501) + "px");
						//$(this).css("margin-top", Math.floor(Math.random()*101) + "px");
						$(this).fadeIn(7000);
						$(this).oneTime( "500ms", function() {
							$(this).fadeOut(3500);
						}, 3, true);
					});

					$.time = $.time + 7000;

				});

	}

	function addTimer(li) {

	}

// Public methods
	$.fn.fader = function(settings) {
		// Future settings: activateDelay
		var settings = $.extend({	// Time in ms before menu shows
									showDelay: 		200,
									// Time in ms before menu hides
									hideDelay: 		500,
									// Should items that contain submenus not
									// respond to clicks
									disableLinks:	true
									// This callback allows for you to animate menus
									//onAnimate:	null
									}, settings);
		$('> li', this).hide();
		addTimers(this);

	};

})(jQuery);