Activate object on list automatically ?

My script is about list of objects where first one is activated and the rest is deactivated. Now, what I want is if first object deactivate next one should be activated automatically. This option can be done manually and I want it automatically.

Script link