Moved some js code from cz.htm to common.js