Possible Duplicate:
Difference between using var and not using var in JavaScript
For the code, I found it is no need to declare variable using var. the following are both working
// with var
var object = new Object();
// without var
object = new Object();
what's the difference between those two?