Made it into a jQuery plugin