if(typeof window.mx == "undefined") { var debug; if ((debug != 0) && (debug != 1)) debug = 0; if (!debug && ie) window.onerror = function() { return true; } function bug(x) { try { if (console) if (console.log) { console.log(x); return true; } } catch(e) { window.status = x; } return true; } Array.prototype.size = function() { return this.length; } Array.prototype.clear = function() { this.length = 0; return this; } Array.prototype.first = function() { return this[0]; } Array.prototype.last = function() { return (this.length == 0) ? false : this[this.length - 1]; } Array.prototype.indexOf = function(x) { if (!x) return -1; if(this.join('').indexOf(x) == -1) return -1; for (var i = 0, l = this.length; i < l; i++) if (this[i] == x) return i; return -1; } Array.prototype.each = function(iterator) { if(!iterator) return false; if(typeof iterator != 'function') return false; for (var i = 0, l = this.length; i < l; i++) iterator(this[i]); return this; } Array.prototype.shuffle = function() { for (var i = 0, l = this.length; i < l; i++) { var r = parseInt(Math.random() * l); var o = this[i]; var p = this[r]; if(o == p) continue; this[i] = p; this[r] = o; } return this; } Array.prototype.toUpperCase = function() { for (var i = 0, l = this.length; i < l; i++) this[i] = this[i].toUpperCase(); return this; } Array.prototype.toLowerCase = function() { for (var i = 0, l = this.length; i < l; i++) this[i] = this[i].toLowerCase(); return this; } Array.prototype.capitalize = function() { for (var i = 0, l = this.length; i < l; i++) this[i] = this[i].charAt(0).toUpperCase() + this[i].substring(1).toLowerCase(); return this; } Array.prototype.clone = function() { return [].concat(this); } Array.prototype.max = function() { var max = this.first(); for (var i = 0, l = this.length; i < l; i++) max = max > this[i] ? max : this[i]; return max; } Array.prototype.min = function() { var min = this.first(); for (var i = 0, l = this.length; i < l; i++) min = min < this[i] ? min : this[i]; return min; } Array.prototype.concat = function() { var a = []; for (var i = 0, l = this.length; i < l; i++) a.push(this[i]); for (var i = 0, l = arguments.length; i < l; i++) { if(arguments[i].constructor == Array) { for (var j = 0, k = arguments[i].length; j < k; j++) a.push(arguments[i][j]); } else { a.push(arguments[i]); } } return a; } function $(x) { if (document.getElementById) { if (document.getElementById(x)) return document.getElementById(x); } if (document.all) if (document.all[x]) return document.all[x]; return false; } function $$(x) { if ($(x)) { if ($(x).style) { return $(x).style; } } return false; } var browserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.os = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i = 0, l = data.length; i < l; i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } return false; }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return ''; return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); }, dataBrowser: [ { string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" }, { string: navigator.vendor, subString: "Apple", identity: "Safari" }, { prop: window.opera, identity: "Opera" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.vendor, subString: "Camino", identity: "Camino" }, { string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } ], dataOS : [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ] }; browserDetect.init(); var locale, mx_site; var ns = document.layers ? 1 : 0; var ie = window.ActiveXObject ? 1 : 0; var ie5 = (ie && (parseInt(browserDetect.version) < 6)) ? 1 : 0; var ie6 = (ie && (parseInt(browserDetect.version) == 6)) ? 1 : 0; var ie7 = (ie && (parseInt(browserDetect.version) > 6)) ? 1 : 0; var opera = browserDetect.browser == 'Opera' ? 1: 0; var firefox = browserDetect.browser == 'Firefox' ? 1: 0; var dom = (document.getElementById && document.createElement) ? 1 : 0; var mx_prototype = function () { this.config = { locale : (locale == undefined) ? 'cz' : locale, session_variable : 'PHPSESSID', loading_picture : 'matrix/loading.gif', manticore_picture : 'matrix/manticore.gif', transparent_picture : 'matrix/null.gif', manticore_picture_enabled : 1, onload_fix_msie : 1, picture_show_opacity : 1, truncate : 30, ajax_timeout : 20000, ajax_cache_enabled : 1, ajax_cache_timeout : 60, ajax_parse_javascript : 1, ajax_retry_send : 1, silent : 0 } this.locale = { en : { loading : 'Loading...', close_picture : 'click to close the picture', md5_vm_failed : 'JavaScript VM not working correctly, MD5 selftest failed.', sha1_vm_failed : 'JavaScript VM not working correctly, SHA-1 selftest failed.' }, cz : { loading : 'Loading...', close_picture : 'kliknutím zavřete obrázek', md5_vm_failed : 'JavaScript VM nepracuje sprvn, MD5 selftest selhal.', sha1_vm_failed : 'JavaScript VM nepracuje sprvn, SHA-1 selftest selhal.' } } this.settings = { version : 'v2.8 build 007 2007-03-04', debug : (debug > 0) ? 1 : 0, ns : ns, ie : ie, ie5 : ie5, ie6 : ie6, ie7 : ie7, opera : opera, firefox : firefox, dom : dom, cookie : 0, ajax : (window.XMLHttpRequest || window.ActiveXObject) ? 1 : 0, locale : locale, mx_site : (mx_site == undefined) ? window.location.host.toLowerCase() : mx_site, framed : (window != top) ? 1 : 0, loaded : 0, loading : '', md5 : 0, sha1 : 0, onload : [], show : function() { var x = ''; for (var i in mx.settings) { if ((typeof mx.settings[i] != 'function') && (typeof mx.settings[i] != 'object')) x += '[' + i + '] ' + mx.settings[i] + ' '; } return x; } } this.logs = { ajax_call : 0, ajax_get : 0, ajax_post : 0, ajax_fail : 0, ajax_resend : 0, ajax_speed : -1, pictures_showed : 0, pictures_failed : 0, alert_id : '', alert_stack : [], alert_count : 0, picture_id : '', events : {}, show : function() { var x = ''; for (var i in mx.logs) { if ((typeof mx.logs[i] != 'function') && (typeof mx.logs[i] != 'object')) x += '[' + i + '] ' + mx.logs[i] + ' '; } return x; } } this.url = { host : window.location.host, protocol : window.location.protocol.toLowerCase(), port : (window.location.port == '') ? ((window.location.protocol.toLowerCase() == 'https:') ? 443 : 80) : window.location.port, href : window.location.href.replace(/#([\x00-\xff\u0000-\uffff]+)/, ''), ssl : ((window.location.port == 443) || (window.location.protocol == 'https:')) ? 1 : 0, path : window.location.pathname, sid : '', query : function() { var a = window.location.href.split('#', 2); if (a.length != 2) return ""; return a[1]; }, show : function() { var x = ''; x += '[query] ' + mx.url.query() + ' '; for (var i in mx.url) { if (typeof mx.url[i] != 'function') x += '[' + i + '] ' + mx.url[i] + ' '; } return x; } } this.navigator = { name : window.navigator.appName, platform : window.navigator.platform, application : window.navigator.appCodeName, browser : browserDetect.browser, version : browserDetect.version, os : browserDetect.os, show : function() { var x = ''; for (var i in mx.navigator) { if (typeof mx.navigator[i] != 'function') x += '[' + i + '] ' + mx.navigator[i] + ' '; } return x; } } this.screen = { width : function() { return window.screen.width; }, height : function() { return window.screen.height; }, depth : screen.colorDepth, colors : function() { if (screen.colorDepth < 1) return false; var x = 2; for (var i = 1, d = screen.colorDepth; i < d; i++) x *= 2; return x; }, show : function() { var x = ''; x += '[width] ' + mx.screen.width() + ' '; x += '[height] ' + mx.screen.height() + ' '; x += '[colors] ' + mx.screen.colors() + ' '; for (var i in mx.screen) { if (typeof mx.screen[i] != 'function') x += '[' + i + '] ' + mx.screen[i] + ' '; } return x; } } this.window = { width : function() { var x ; if (self.innerHeight) { x = self.innerWidth; } else if (document.documentElement && document.documentElement.clientHeight) { x = document.documentElement.clientWidth; } else if (document.body) { x = document.body.clientWidth; } return x; }, height : function() { var x; if (self.innerHeight) { x = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { x = document.documentElement.clientHeight; } else if (document.body) { x = document.body.clientHeight; } return x; }, opener : window.opener, status : window.status, name : window.name, title : document.title, show : function() { var x = ''; x += '[width] ' + mx.window.width() + ' '; x += '[height] ' + mx.window.height() + ' '; for (var i in mx.window) { if (typeof mx.window[i] != 'function') x += '[' + i + '] ' + mx.window[i] + ' '; } return x; } } this.data = { tick : {}, ajax : [] } this.nop = function() { } this.scriptFragment = '(?:)((\n|\r|.)*?)(?:<\/script>)'; this.K = function(x) { return x; } this.stripScripts = function(x) { if (!x) return false; return x.replace(new RegExp(this.scriptFragment, 'img'), ''); } this.update = function(element, html) { if (!element) return false; html = typeof html == 'undefined' ? '' : html.toString(); $(element).innerHTML = this.stripScripts(html); return element; } this.getHeight = function(element) { return $(element).getDimensions().height; } this.getWidth = function(element) { return $(element).getDimensions().width; } this.getDimensions = function(element) { element = $(element); var display = $(element).display; if (display != 'none' && display != null) return {width: element.offsetWidth, height: element.offsetHeight}; var els = element.style; var originalVisibility = els.visibility; var originalPosition = els.position; var originalDisplay = els.display; els.visibility = 'hidden'; els.position = 'absolute'; els.display = 'block'; var originalWidth = element.clientWidth; var originalHeight = element.clientHeight; els.display = originalDisplay; els.position = originalPosition; els.visibility = originalVisibility; return {width: originalWidth, height: originalHeight}; } this.strip = function(x) { if (!x) return false; return x.replace(/^\s+/, '').replace(/\s+$/, ''); } this.stripTags = function(x) { if (!x) return false; return x.replace(/<\/?[^>]+>/gi, ''); } this.truncate = function(x, length, truncation) { if (!x) return false; if (typeof x != 'string') return x; length = length || this.config.truncate; truncation = truncation === undefined ? '...' : truncation; return x.length > length ? x.slice(0, length - truncation.length) + truncation : x; } this.escapeHTML = function(x) { if (!x) return false; if (typeof x != 'string') return x; var div = document.createElement('div'); var text = document.createTextNode(x); div.appendChild(text); return div.innerHTML; } this.capitalize = function(x) { if (!x) return false; if (typeof x != 'string') return x; return x.charAt(0).toUpperCase() + x.substring(1).toLowerCase(); } this.toArray = function(x) { if (!x) return false; if (typeof x != 'string') return x; return x.split(''); } this.size = function(x) { if (!x) return 0; if (typeof x != 'string') return x; return this.toArray(x).length; } this.isEmail = function(x) { if (!x) return false; if (typeof x != 'string') return x; var reg = /[A-Z0-9._%-]+@+[A-Z0-9.-]+\.[A-Z]{2,6}/; return reg.test(x.toUpperCase()); } this.isDomain = function(x) { if (!x) return false; if (typeof x != 'string') return x; var reg = /[A-Z0-9.-]+\.[A-Z]{2,6}/; return reg.test(x.toUpperCase()); } this.isIP = function(x) { if (!x) return false; if (typeof x != 'string') return x; var reg = /\b(?:\d{1,3}\.){3}\d{1,3}\b/; return reg.test(x); } this.isUnicode = function(x) { var reg = /[\u0100-\uFFFD]/; return reg.test(x); } this.cleanWord = function(x) { x = x.replace(new RegExp(String.fromCharCode(8216), 'g'), "'"); x = x.replace(new RegExp(String.fromCharCode(8217), 'g'), "'"); x = x.replace(new RegExp(String.fromCharCode(8218), 'g'), "'"); x = x.replace(new RegExp(String.fromCharCode(8219), 'g'), "'"); x = x.replace(new RegExp(String.fromCharCode(8220), 'g'), "\""); x = x.replace(new RegExp(String.fromCharCode(8221), 'g'), "\""); x = x.replace(new RegExp(String.fromCharCode(8222), 'g'), "\""); x = x.replace(new RegExp(String.fromCharCode(8223), 'g'), "\""); x = x.replace(/color="?[^" >]*"?/gi, ''); x = x.replace(/([^-])color:[^;}"']+;?/gi, '$1'); x = x.replace(/size="?[^" >]*"?/gi, ''); x = x.replace(/font-size:[^;}"']+;?/gi, ''); x = x.replace(/face="?[^" >]*"?/gi, ''); x = x.replace(/font-family:[^;}"']+;?/gi, ''); x = x.replace(/lang="?[^" >]*"?/gi, ''); x = x.replace(/ class=[a-zA-Z]*/gi, ''); x = x.replace(/ style="[^"]*"/gi, ''); x = x.replace(/ face=[a-zA-Z]*/gi, ''); x = x.replace(/ size=[a-zA-Z0-9]*/gi, ''); x = x.replace(/ border=[a-zA-Z0-9]*/gi, ''); x = x.replace(/ width=[a-zA-Z0-9]*/gi, ''); x = x.replace(/ cellSpacing=[0-9]*/gi, ''); x = x.replace(/ cellPadding=[0-9]*/gi, ''); x = x.replace(/ align=[a-zA-Z]*/gi, ''); x = x.replace(/ vAlign=[a-zA-Z]*/gi, ''); x = x.replace(/]*">/gi, ''); x = x.replace(/]*>/gi, ''); x = x.replace(/<\/font>/gi, ''); x = x.replace(/]*>/gi, ''); x = x.replace(/<\/span>/gi, ''); x = x.replace(/

]*>/gi, '

'); x = x.replace(/<\/strong>/gi, ''); x = x.replace(/

<\/p>/gi, ''); x = x.replace(/<\/u>/gi, ''); x = x.replace(/<\/i>/gi, ''); x = x.replace(/<\/b>/gi, ''); return x; } this.getScrollX = function() { var x; if (self.pageXOffset) { x = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { x = document.documentElement.scrollLeft; } else if (document.body) { x = document.body.scrollLeft; } return x; } this.getScrollY = function() { var y; if (self.pageYOffset) { y = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) { y = document.documentElement.scrollTop; } else if (document.body) { y = document.body.scrollTop; } return y; } this.write = function(x) { document.write(x); } this.doTick = function(data, id) { if (!id) id = this.key(); if (data) { if (data.substr(-1, 1) != '|') data += '|'; if (!this.data.tick[id]) { this.data.tick[id] = data; } else { this.data.tick[id] += data; } } var s = this.data.tick[id].split('|'); if (s.length < 2) return false; var a = s.shift(); var b = s.shift(); this.data.tick[id] = s.join('|'); try { eval(a); } catch(e) { mx.addLog("function doTick() crashed when executing:\r\n" + a + "\r\n" + e); } setTimeout('mx.doTick("", "' + id + '");', b); return true; } this.removeTick = function(id) { if (!id) return false; this.data.tick[id] = ''; return true; } this.getID = function(obj) { if (!obj) return false; if (!obj.id) obj.id = this.key(); return obj.id; } this.rnd = function(x) { if (!x) return Number(Math.round(Math.random())); if (x < 2) x = 2; return Number(Math.round(Math.random() * (Math.round(x) - 1)) + 1); } this.stamp = function() { var a = new Date(); function _stamp(x) { if (isNaN(x)) return x; if (x < 10) x = '0' + x; return x; } return a.getFullYear() + '/' + _stamp(a.getUTCMonth() + 1) + '/' + _stamp(a.getUTCDate()) +'-' + _stamp(a.getHours()) + ':' + _stamp(a.getMinutes()) + ':' + _stamp(a.getSeconds()); } this.addLog = function(str) { if (!str) return false; if (str == '') return false; this.logs.events[this.stamp()] = str; if (this.settings.debug) bug(str); return true; } this.seconds = function() { var a = new Date(); return Math.round(a.valueOf() / 1000); } this.miliseconds = function() { var a = new Date(); return a.valueOf(); } this.getPassword = function(type) { if (!type) type = 2; var a1 = [ 'nA', 'Tou', 'SE', 'Bli', 'bE', 'cU', 'Ro', 'mE', 'da', 'sa', 'Dy', 'bi', 'EPi', 'LE', 'tI', 'kA', 'fRo', 'DA', 'GE', 'Ro', 'ho', 'Ty', 'tO', 'cHu', 'Di', 'je', 'Ma', 'ko', 'pY', 'tO', 'ME', 'Mi', 'Ze', 'rA', 'nE', 'hLo', 'No', 'mA', 'oPi', 'pA', 'gI', 'vE', 'lA', 'ra', 'Ri', 'rE', 'TU', 'Lu', 'MU', 'vi', 'zi', 'Go', 'WO', 'SOu', 'sTY', 'Lo', 'FO', 'Ze', 'Eno', 'zU', 'fi', 'Go', 'Te', 'mY' ]; var a2 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; var a3 = [ ',', '.', '@', '!', '_', '#', '$', '%', '&', '*', '^' ]; switch(type) { default: case 0: a1.toLowerCase(); a1.shuffle(); return a1.shift() + a1.shift() + a1.shift(); break; case 1: a1.toLowerCase(); a1 = a1.concat(a2); a1.shuffle(1); return a1.shift() + a1.shift() + a1.shift(); break; case 2: a1.toLowerCase(); a1 = a1.concat(a2, a2); a1.shuffle(2); return a1.shift() + a1.shift() + a1.shift() + a1.shift(); break; case 3: a1 = a1.concat(a2, a2); a1.shuffle(3); return a1.shift() + a1.shift() + a1.shift() + a1.shift(); break; case 4: a1 = a1.concat(a2, a3, a2); a1.shuffle(4); return a1.shift() + a1.shift() + a1.shift() + a1.shift() + a1.shift(); break; case 5: a1 = a1.concat(a2, a3, a2, a3); a1.shuffle(5); return a1.shift() + a1.shift() + a1.shift() + a1.shift() + a1.shift() + a1.shift(); break; } return false; } this.passwordStrength = function(x) { var s = 0; if (x.length > 5) s++; if (x.length > 9) s++; var y = /[A-Z]/; if (y.test(x)) s++; var y = /[0-9]/; if (y.test(x)) s++; var y = /[,./';\[\]\\\- =`~!@#$%^&*()_+<>?:"|]/; if (y.test(x)) s += 2; var y = /[\x80-\xFF]/; if (y.test(x)) s++; var y = /[\u0100-\uFFFD]/; if (y.test(x)) s++; if (s > 5) s = 5; return s; } this.key = function() { var a1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; var a2 = a1 + '0123456789'; var b = []; var argv = arguments; var argc = arguments.length; var count = 'x'; b.push(a1.substr(this.rnd(a1.length - 1), 1)); if (argc > 0) { var count = parseInt(argv[0]); } if (isNaN(count)) count = 16; for (var i = 0; i < count; i++) { b.push(a2.substr(this.rnd(a2.length - 1), 1)); } return b.join(''); } this.parseQuery = function(x) { if (!x) return false; var a = this.url.query(); var reg = new RegExp(x + "=(\\w+)", 'gim'); return a.replace(reg, "$1"); } this.vis = function(id) { if (!$(id)) return false; if (!$$(id)) return false; if (!$$(id).visibility) $$(id).visibility = 'visible'; return $$(id).visibility != 'none'; } this.visOn = function(id) { if (!$(id)) return false; if (!$$(id)) return false; $$(id).visibility = 'visible'; return true; } this.visOff = function(id) { if (!$(id)) return false; if (!$$(id)) return false; $$(id).visibility = 'hidden'; return true; } this.dis = function(id) { if (!$(id)) return false; if (!$$(id)) return false; return $$(id).display != 'none'; } this.disOn = function(id) { if (!$(id)) return false; if (!$$(id)) return false; $$(id).display = 'block'; return true; } this.disOff = function(id) { if (!$(id)) return false; if (!$$(id)) return false; $$(id).display = 'none'; return true; } this.src = function(id, url) { if (!url) return false; if (!$(id)) return false; if (!$(id).src) return false; $(id).src = url; return true; } this.href = function(id, url) { if (!url) return false; if (!$(id)) return false; if (!$(id).href) return false; $(id).href = url; return true; } this.setHTML = function(x, data) { if ($(x)) $(x).innerHTML = data; } this.getHTML = function(x) { if ($(x)) return $(x).innerHTML; return false; } this.preHTML = function(id, data) { if ($(id)) { this.setHTML(id, data + this.getHTML(id)); } } this.postHTML = function(id, data) { if ($(id)) { this.setHTML(id, this.getHTML(id) + data); } } this.appendHTML = function(id, data) { if ($(id)) { this.setHTML(id, this.getHTML(id) + data); } } this.dec2hex = function(x) { if (!x) return false; var a = "0123456789ABCDEF"; var b = a.substr(x & 15, 1); while (x > 15) { x >>= 4; b = a.substr(x & 15 ,1) + b; } return b; } this.removeDiacritics = function(data) { var t1 = '؊ݎͼݎ'; var t2 = 'acdeeinorstuuyzaacdeillnoorstuyzaouaeiooouuuACDEEINORSTUUYZAACDEILLNOORSTUYZAOUAEIOOOUUU'; for (var i = 0, l = t1.length; i < l; i++) { var reg = new RegExp(t1.substr(i, 1), 'gm'); data = data.replace(reg, t2.charAt(i)); } return data; } this.title = function(data) { if (!data) { document.title = this.window.title; } else { document.title = this.window.title + ': ' + data; } return document.title; } this.color = function(id, R, G, B) { if (!$(id)) return false; if (!$$(id)) return false; if (arguments.length != 4) return false; try { $$(id).color = 'RGB(' + R + ',' + G + ',' + B + ')'; } catch(e) { this.addLog("function color() crashed\r\n" + e); return false; } return true; } this.backgroundColor = function(id, R, G, B) { if (!$(id)) return false; if (!$$(id)) return false; if (arguments.length != 4) return false; try { $$(id).background = 'RGB(' + R + ',' + G + ',' + B + ')'; } catch(e) { this.addLog("function backgroundColor() crashed\r\n" + e); return false; } return true; } this.md5 = function(x) { if (!this.settings.md5) if (!md5_vm_test()) { if (mx.config.silent == 0) mx.alert(mx.locale[mx.config.locale].md5_vm_failed); return false; } else { this.settings.md5 = 1; } return hex_md5(x); } this.sha1 = function(x) { if (!this.settings.sha1) if (!sha1_vm_test()) { if (mx.config.silent == 0) mx.alert(mx.locale[mx.config.locale].sha1_vm_failed); return false; } else { this.settings.sha1 = 1; } return hex_sha1(x); } this.base64encode = function(str) { if (!str) return false; if (!str.length) return false; var base64EncodeChars = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' ]; str = this.removeDiacritics(str); if (this.isUnicode(str)) return false; var out, i, j, len; var c1, c2, c3; len = str.length; i = j = 0; out = []; while (i < len) { c1 = str.charCodeAt(i++) & 0xff; if (i == len) { out[j++] = base64EncodeChars[c1 >> 2]; out[j++] = base64EncodeChars[(c1 & 0x3) << 4]; out[j++] = '=='; break; } c2 = str.charCodeAt(i++) & 0xff; if (i == len) { out[j++] = base64EncodeChars[c1 >> 2]; out[j++] = base64EncodeChars[((c1 & 0x03) << 4) | ((c2 & 0xf0) >> 4)]; out[j++] = base64EncodeChars[(c2 & 0x0f) << 2]; out[j++] = '='; break; } c3 = str.charCodeAt(i++) & 0xff; out[j++] = base64EncodeChars[c1 >> 2]; out[j++] = base64EncodeChars[((c1 & 0x03) << 4) | ((c2 & 0xf0) >> 4)]; out[j++] = base64EncodeChars[((c2 & 0x0f) << 2) | ((c3 & 0xc0) >> 6)]; out[j++] = base64EncodeChars[c3 & 0x3f]; } return out.join(''); } this.base64decode = function(str) { if (!str) return false; if (!str.length) return false; var base64DecodeChars = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1,0,1,2,3,4,5,6,7,8,9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ]; var c1, c2, c3, c4; var i, j, len, out; len = str.length; i = j = 0; out = []; while (i < len) { do { c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; } while (i < len && c1 == -1); if (c1 == -1) break; do { c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; } while (i < len && c2 == -1); if (c2 == -1) break; out[j++] = String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4)); do { c3 = str.charCodeAt(i++) & 0xff; if (c3 == 61) return out.join(''); c3 = base64DecodeChars[c3]; } while (i < len && c3 == -1); if (c3 == -1) break; out[j++] = String.fromCharCode(((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2)); do { c4 = str.charCodeAt(i++) & 0xff; if (c4 == 61) return out.join(''); c4 = base64DecodeChars[c4]; } while (i < len && c4 == -1); if (c4 == -1) break; out[j++] = String.fromCharCode(((c3 & 0x03) << 6) | c4); } return out.join(''); } this.setCookie = function(name, value) { if (!name) return false; if (!value) this.delCookie(name); var argv = arguments; var argc = arguments.length; var expires = (argc > 2) ? argv[2] : null; if (expires != null) { var exp = new Date(); exp.setTime(exp.getTime() + (expires * 60 * 1000)); } var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : null; var x = name + '=' + escape(value) + ((expires == null) ? '' : ('; expires=' + exp.toGMTString())) + ((path == null) ? '' : ('; path=' + path)) + ((domain == null) ? '' : ('; domain=' + domain)) + ((secure == true) ? '; secure=' : ''); document.cookie = x; return true; } this.delCookie = function(name) { if (!name) return false; if (!this.getCookie(name)) return false; var exp = new Date(); exp.setTime(exp.getTime()); this.setCookie(name, this.getCookie(name), -1); return true; } this.deleteCookie = function(name) { if (!name) return false; this.delCookie(name); return true; } this.getCookie = function(name) { if (!name) return false; function _getCookie(offset) { if (!offset) return false; var e = document.cookie.indexOf(';', offset); if (e == -1) e = document.cookie.length; return unescape(document.cookie.substring(offset, e)); } if (!name) return false; var arg = name + '='; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return _getCookie(j); i = document.cookie.indexOf(' ', i) + 1; if (i == 0) break; } return false; } this.isAjax = function() { return this.settings.ajax; } this.ajaxLink = function(obj) { if (this.settings.ajax) { if (!obj) return false; var a = /id=([0-9]*)/; var m = a.exec(obj.href); if (m) if (m.length) { obj.href = '#ajax-' + m[0]; return true; } obj.href = '#blind-' + this.key(); return true; } return false; } this.reloadURI = function() { location.href = location.href.replace(/#/, ""); } this.appendElement = function(el, html) { if (!el) return false; if (!document.getElementsByTagName('body')[0]) { return false; } var e = document.createElement(el); e.id = this.key(16) + this.miliseconds(); if (html) e.innerHTML = html; e.style.display = 'none'; try { document.getElementsByTagName('body')[0].appendChild(e); } catch(e) { this.addLog("function appendElement() crashed adding:\r\n" + html + "\r\n" + e); return false; } return e.id; } this.removeElement = function(id) { if (!id) return false; if (!$(id)) id = this.getID(id); try { $$(id).display = 'none'; $$(id).opacity = 0; setTimeout("try{$('" + id + "').parentNode.removeChild($('" + id + "'))} catch(e) {}", 1); return true; } catch(e) { this.addLog("function removeElement() crashed removing:\r\n" + el + "\r\n" + e); return false; } } this.loadScript = function(url) { if (!url) return false; var e = document.createElement('script'); e.src = url; e.type = 'text/javascript'; e.language = 'JavaScript'; if (!document.getElementsByTagName('head')[0]) { return false; } try { document.getElementsByTagName('head')[0].appendChild(e); } catch(e) { this.addLog("function loadScript() crashed loading:\r\n" + url + "\r\n" + e); return false; } return true; } this.debug = function() { if (!this.settings.md5) var x = this.md5('test'); if (!this.settings.sha1) var x = this.sha1('test'); var e = this.appendElement('debug', ''); if (!e) return false; if (mx.settings.ie) { $$(e).position = 'absolute'; } else { $$(e).position = 'fixed'; } $$(e).top = -100; $$(e).left = 0; $$(e).zIndex = '10000'; $$(e).border = '1px solid #3366cc'; $$(e).backgroundColor = '#c3d9ff'; $$(e).cursor = 'default'; $$(e).display = 'block'; var l = this.key(); this.setHTML(e, ' DEBUG 

SETTINGS: ' + mx.settings.show() + '
NAVIGATOR: ' + mx.navigator.show() + '
SCREEN: ' + mx.screen.show() + '
WINDOW: ' + mx.window.show() + '
URL: ' + mx.url.show() + '
LOGS: ' + mx.logs.show() + '
'); var s = []; for (var i = -90; i <= 0; i += 10) s.push('$$("' + e + '").top = "' + i + 'px"|1|'); mx.doTick(s.join('')); try { $(l).focus(); } catch(e) {} return true; } this.alert = function(html) { if (!html) { if (this.logs.alert_stack.length) { eval(this.logs.alert_stack.shift()); } return true; } if (this.settings.framed) { try { parent.mx.alert(html); return true; } catch(e) {} return true; } if ((this.logs.alert_id) || (!this.settings.loaded)) { this.logs.alert_stack.push('mx.alert("' + html.replace(/\"/g, "'") + '")'); return false; } if (!document.getElementsByTagName('body')[0]) { setTimeout('mx.alert("' + html + '");', 1000); return true; } if(this.settings.ie) { var e = this.appendElement('