Move js code from contents.pt to sdi.js