Made a jquery plugin of this excellent script.