Refactored JS code
Functions replaced by jQuery plugin