Calendar: Move some inline JS to external file