edited version of slidebars.js