
// Define new JQuery method to apply an effect to each element in a jQuery array one by one:
// See: http://www.nabble.com/What-is-the-best-way-to-show%28%29-many-items-in-sequence%2C-one-after-the-other--tf2629186.html#a7338002
(function($){
	$.extend($.fn, { orderedEffect: function(m, s, p, cb) { // (fx, speed, pause, callback)
		p === undefined && (p = 0);
		var col = $(this);
		var position = 0;
		var handler = function() {
			if (position < col.length) {
				setTimeout(function() {
					$(col[position++])[m](s, handler);
				}, position == 0 ? 0 : p);
			} else {
				typeof cb == "function" && cb();
			}
		};
		handler(); 
		return this; 
	}}); 
})(jQuery); 
