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