v.3.5 - re-written

This changes is huge - the script is re-written becaue of serious
javascript injection error, and the fact that event listeners was not
working  on the last paglet after js and html was injected. Everything
okey now.