/* * Helper functions */ function stripStr(str) { return str.replace(/^\s*/, "").replace(/\s*$/, ""); } // Multiline strip function stripStrML(str) { // Split because m flag doesn't exist before JS1.5 and we need to // strip newlines anyway var parts = str.split('\n'); for (var i=0; i 128) newstr += "&#"+str.charCodeAt(i)+";"; else newstr += str.charAt(i); } return newstr; } // Return translation, if translation dictionary exists and has a translation. this.translate = function (str, params) { var transl = str; if (this.i18nd && this.i18nd[str]) transl = this.i18nd[str]; return printf(transl, params); } this.translateNodes = function () { var nodes = document.getElementsByTagName("*"); for (var i=0;i