Jquery UI Dialog in Firefox - Whole screen becomes non-clickable including dialog

Jquery UI Dialog in Firefox - Whole screen becomes non-clickable including dialog

I have two links that show up two modal dialogs. These dialogs are static divs in the html of the page with their own ids.

When I click the first link, the first dialog shows up and behaves correctly. But when I click the second link, the whole screen grays out and everything becomes unclickable, including the second dialog. It happens also the other way around, clicking the second link, and then the first link.

This problems occurs only in Firefox but not in IE.

Any ideas why this is happening in Firefox?