refactored setup logic of all pivot
random.. winjs suck!
dded eventlistener for testing purposes.