http://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/ is very relevant. This article suggests using function expressions rather than function declarations. So you can probably scratch my previous comment.