Not sure why we need to pass always ``i``` as a variable to all methods. Could it be part of the component state?
Something like 
```javascript
Collapsible.prototype.setVisibility = function(show){
...
  this.currentIndex //would be the same as the i parameter
...
}
```