Awesome,Put it up on The Forge?
function(){} // doesn't do anything
(function(){}) // same
(function(){ })() // calls itself
The function calls itself immediately with the final (). You can pass arguments to it also which helps in two ways: 1) you're free to use any "global" variable name inside the function and 2) compressors will reassign the variable name, even for stuff like window and undefined which it usually wouldn't, but since its' wrapped up in the function it's save to rename.
(function(x, y, $, window){
// x = foo
// y = bar
// $ = document.id
// window can be reassigned by obfuscators now
})(foo, bar, document.id, window)
Dropping `document.id` to the bottom and naming it $ at the top allows you to use $ inside the funciton even if globally it's defined as something else. I've seen it most with jQuery and dojo.