Simplification of in-page Javascript (moved from XSL to separate JS file)