extract common script into common_script.js