(function(jQuery){
  jQuery.fn.textRotator = function(options) {
      var settings = {
        timeLapse: 7000,
        speedFadeOut: "slow",
        speedFadeIn: "slow",
        selector: "p",
        delay: 500
      };
      if(options) {
        jQuery.extend(settings, options);
      }     
      return this.each(function () {
        var upcoming;
        $(this).everyTime(settings.timeLapse, function(i) {
          if(i == 1) {
            current = $(this).children(settings.selector + ":first");   
          }else {     
            current = upcoming;     
          }
          upcoming = $(current).next(settings.selector);
          if(!$(upcoming).html()) {
            upcoming = $(this).children(settings.selector + ":first");
          }
          $(current).fadeOut(settings.speedFadeOut);
          $(upcoming).delay(settings.delay).fadeIn(settings.speedFadeIn);
        });
      });
  };
})(jQuery);
