Check this article http://stackoverflow.com/questions/8670877/this-value-in-javascript-anonymous-function