In current times, saving energy in all its variants is becoming more and more important each day. When it comes to websites one simple way to save energy is to dim the display when idle.
Both Interact has released a simple yet versatile cross-browser jQuery lights out plugin. In order to keep things simple you only need to make sure to include jQuery 1.3 and higher and the plugin itself. It will then do the magic of automatically adding the required DOM elements for the overlays and register some event handlers to track user interactions and idle times.
Feel free to download the jQuery lights out plugin from Github and adjust it to your needs.