js for cycling through sets of charts