I've been looking for a script to tell when the DOM content of the page has loaded, and I found this script that does the trick but I'd like to know how some of it works.

what is the reason for wrapping everything in the parentheses "()" I know it groups sections of code or requirements for if statements, but what is the application here

when argument.callee is called is it calling it's containing function or a different one
Code:
(function(i) {
    var u =navigator.userAgent;
    var e=/*@cc_on!@*/false;
    var st = setTimeout;
    if(/webkit/i.test(u)){
        st(
            function(){
                var dr=document.readyState;
                if(dr=="loaded"||dr=="complete"){
                    i()
                }else{
                    st(arguments.callee,10);
                }
            }
       ,10);
    }else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
        document.addEventListener("DOMContentLoaded",i,false);
    } else if(e){
        (
            function(){
                var t=document.createElement('doc:rdy');
                try{
                    t.doScroll('left');
                    i();
                    t=null;
                }catch(e){
                    st(arguments.callee,0);
                }
            }
        )();
    }else{
        window.onload=i;
    }
})(init);
thanks