Change button to grayed out

I have several buttons on a page. The buttons when clicked open a pop up window with either an image or text. When the pop up window is closed, you return to the main page. I'd like the corresponding button on the main page to be grayed out upon return. This probably includes variables, can't figure out how to set them up. Thanks,

Discussions have been disabled for this post