i have three "buttons". when each is pressed i want to 1.) detect if it is not hidden, if so, return (do nothing). 2.) detect if another button is not hidden, if so i want it to hide that button and continue to the third. 3.) i want it to perform an action slidedown() which makes it not hidden.

i came up with this code.

function toggleSlide(objname){
  if(document.getElementById(objname).style.display != "none")return;
  if(document.getElementById('mainA').style.display != "none")
  if(document.getElementById('mainB').style.display != "none")
  if(document.getElementById('mainC').style.display != "none")
  if(document.getElementById(objname).style.display == "none")

very simple, and it works. However, i wanted it to complete the second task of checking if 'mainA' 'mainB' or 'mainC' had been pressed and WAIT for that to finish until moving on to step three. But that did not happen. it wasn't too pretty.
i tried a way of doing this, but needless to say it didn't work. any suggestions?

nevermind, i figured it out. just a little slow on the uptake of interval time delays with variables involved.