neaten up JS in tipue demo page: WORKING
move inline jQuery code to js/scripts.js