that one makes the close button functional at your owncloud? because here your changes are not (fully) working. Maybe I forgot a line, but what is definitly working is changing this line with:
document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) {

But I have to admit, I don't know the difference...