js function definitions outside $\(function\(\){}\)