The script you use is old. Its from Lectora X10 era… at that time you couldnot set CSS classes for elements in Lectora thus this approach was needed to work with JS in Lectora X10. From version 11 and up that has changed very much.
Actually i did use the script ( smoothHTMLtransitions.js ) too in X10. What it does..giving elements the option for a transition ( eg. fade ) now is as default available in the latest versions of Lectora. I am not sure in which version it debuted, but with the latest versions of Lectora you can simply select a transition for a page-element.