if(menu.VISIBLE==on)
{...}

whats wrong with that?
menu is a PANEL