Started a more proper implementation as a jQuery plugin.