Split code into jQuery plugin and demo