SpoilerAlert

SpoilerAlert blackens the page and displays a dialog that asks the visitor if he wants to see the spoilers on the current page or not. If not the visitor will be send back to the page he came from. If it's not possible to send the visitor back, the page will remain black. If the visitor accepts, the black foreground fades away and reveals the page. Additionally a cookie is set, to ensure the visitor won't be shown the dialog again.

You can see a demo here.

Installation
Add this line to your JavaScript page of choice:

Options
You can override the text in the dialog. You can also override the function that decides, whether or not to display the dialog. By default SpoilerAlert test if the page's title starts with "Spoiler:".

This example translates the dialog into German and displays it, if the page is in the category "Spoiler":