Use four-space indents for your code. Not tabs. You should be able to configure your editor to do this for you when you hit the tab key.

The body immediately after
    
    (function() {

should be indented. Function brackets should be on the same line as function definitions.