Updated per latest changes in project logic

JS function was converted to jQuery plugin.