The situation is somewhat like-
var someVar;
someVar = some_other_function();
someObj.addEventListener("click",
function(){
some_function(someVar);
},
false);
The problem is that the value of someVar is not visible inside the listener function of the addEventListener, where it is probably being treated as a new variable.
Thanks in advance.