3 addSlashes: function(){
4 return this.replace(/("|'|\\|\0)/g, '\\$1');
7 stripSlashes: function(){
8 return this.replace(/\\("|'|\\|\0)/g, '$1');
15 $tab: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
18 * Base 64 encode / Base 64 decode
19 * Taken from orbited project - http://www.orbited.org
22 // Encode a string as a base64-encoded string
23 var s = [], l = ba.length;
27 for (var i = 0; i < x;){
28 t = ba.charCodeAt(i++)<<16|ba.charCodeAt(i++)<<8|ba.charCodeAt(i++);
29 s.push(B64.$tab.charAt((t>>>18)&0x3f));
30 s.push(B64.$tab.charAt((t>>>12)&0x3f));
31 s.push(B64.$tab.charAt((t>>>6)&0x3f));
32 s.push(B64.$tab.charAt(t&0x3f));
34 // deal with trailers, based on patch from Peter Wood.
37 t = ba.charCodeAt(i++)<<16|ba.charCodeAt(i++)<<8;
38 s.push(B64.$tab.charAt((t>>>18)&0x3f));
39 s.push(B64.$tab.charAt((t>>>12)&0x3f));
40 s.push(B64.$tab.charAt((t>>>6)&0x3f));
44 t = ba.charCodeAt(i++)<<16;
45 s.push(B64.$tab.charAt((t>>>18)&0x3f));
46 s.push(B64.$tab.charAt((t>>>12)&0x3f));
52 return s.join(''); // string
55 decode: function(str){
56 var s = str.split(''), out = [];
59 while(s[--l] == B64.$p){ ++tl; } // strip off trailing padding
60 for (var i = 0; i < l;){
61 var t = B64.$tab.indexOf(s[i++])<<18;
62 if(i <= l) t|=B64.$tab.indexOf(s[i++])<<12;
63 if(i <= l) t|=B64.$tab.indexOf(s[i++])<<6;
64 if(i <= l) t|=B64.$tab.indexOf(s[i++]);
65 out.push(String.fromCharCode((t>>>16)&0xff));
66 out.push(String.fromCharCode((t>>>8)&0xff));
67 out.push(String.fromCharCode(t&0xff));
69 // strip off trailing padding
70 while(tl--){ out.pop(); }
71 return out.join(''); // string
75 //Avoid showing error if window.parent.setInterval() is not working (ie : permission denied)
76 window.parent.setInterval();
78 //Override setInterval to be done outside the frame (there is some issue inside the frame with FF3 and WebKit)
79 if (!Browser.Engine.trident && !Browser.Engine.presto && !(Browser.Engine.gecko && Browser.Engine.version<=18)) {
80 setInterval = function(fn,time) {
81 return window.parent.setInterval(fn, time);
84 setTimeout = function(fn,time) {
85 return window.parent.setTimeout(fn, time);
88 clearInterval = function(id) {
89 return window.parent.clearInterval(id);
92 clearTimeout = function(id) {
93 return window.parent.clearTimeout(id);