window.Modernizr = (function(window,document,undefined){

//... full code goes here

A few things I would like to understand:

1) why the whole code is not simply wrapped into an anonymous function?

2) why use window.Modernizr instead of var Modernizr = function()

3) why pass arguments to the function that would be available inside of it anyway? -> function(window,document,undefined)

4) why end the code with this bit: (this,this.document). I really don't understand what is going on here

Well, if someone can help make sense out of it, I'm pretty sure I will have made some progress today!