redo code using a JS object...test this for getting things to work with cycle2 click functionality