jQuery plugin for automatic behavior