// JavaScript Document
// Cookbook/wait, wait( [time], [type] ) 
// Simple wrapper enabling setTimout within chained functions.
// Special thanks to nlogax in #jquery on freenode.

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