Added new function

Allows to get the index of the next slide.