Change the var decl to func and remove direct reference to Element in IE<=8