separate DW related functions in jsencryption.js to script.js