| | |
| | | return out; |
| | | }; |
| | | |
| | | // make a string URL safe |
| | | // make a string URL safe (and compatible with PHP's rawurlencode()) |
| | | function urlencode(str) |
| | | { |
| | | return window.encodeURIComponent ? encodeURIComponent(str) : escape(str); |
| | | if (window.encodeURIComponent) |
| | | return encodeURIComponent(str).replace('*', '%2A'); |
| | | |
| | | return escape(str) |
| | | .replace('+', '%2B') |
| | | .replace('*', '%2A') |
| | | .replace('/', '%2F') |
| | | .replace('@', '%40'); |
| | | }; |
| | | |
| | | |
| | |
| | | return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); |
| | | }; |
| | | |
| | | // Extend Date prototype to detect Standard timezone without DST |
| | | // from http://www.michaelapproved.com/articles/timezone-detect-and-ignore-daylight-saving-time-dst/ |
| | | Date.prototype.getStdTimezoneOffset = function() |
| | | { |
| | | var m = 12, |
| | | d = new Date(null, m, 1), |
| | | tzo = d.getTimezoneOffset(); |
| | | |
| | | while (--m) { |
| | | d.setUTCMonth(m); |
| | | if (tzo != d.getTimezoneOffset()) { |
| | | return Math.max(tzo, d.getTimezoneOffset()); |
| | | } |
| | | } |
| | | |
| | | return tzo; |
| | | } |
| | | |
| | | // Make getElementById() case-sensitive on IE |
| | | if (bw.ie) |