Help with toggling of overlay

I have three buttons, and each can toggle the overlay. I want to be able to toggle the overlay if you click a button, BUT if the overlay is visible when i click another of the buttons, I want it to stay open.

Click two times on of the buttons = toggle the overlay on and off.
Click on a button one time and then clicking another = keep the overlay visible until you click the last clicked button again.

Can anyone help me with this?

if the buttons do not have any other functionality that should be availably while the toggle is on, you can disable all other buttons.