Created by: phmasek
Added a check if there are more than one tab active, make the one with highest index inactive.