﻿if (!this.JSON) { this.JSON = {} } (function() { function f(n) { return n < 10 ? '0' + n : n } if (typeof Date.prototype.toJSON !== 'function') { Date.prototype.toJSON = function(key) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(key) { return this.valueOf() } } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }, rep; function quote(string) { escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function(a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + string + '"' } function str(key, holder) { var i, k, v, length, mind = gap, partial, value = holder[key]; if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key) } if (typeof rep === 'function') { value = rep.call(holder, key, value) } switch (typeof value) { case 'string': return quote(value); case 'number': return isFinite(value) ? String(value) : 'null'; case 'boolean': case 'null': return String(value); case 'object': if (!value) { return 'null' } gap += indent; partial = []; if (Object.prototype.toString.apply(value) === '[object Array]') { length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null' } v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; gap = mind; return v } if (rep && typeof rep === 'object') { length = rep.length; for (i = 0; i < length; i += 1) { k = rep[i]; if (typeof k === 'string') { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v) } } } } else { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v) } } } } v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; gap = mind; return v } } if (typeof JSON.stringify !== 'function') { JSON.stringify = function(value, replacer, space) { var i; gap = ''; indent = ''; if (typeof space === 'number') { for (i = 0; i < space; i += 1) { indent += ' ' } } else if (typeof space === 'string') { indent = space } rep = replacer; if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } return str('', { '': value }) } } } ());

$get = function(id) { return document.getElementById(id) }; $find = function(id) { return document.getElementById(id).control }; $create = function(func, settings, events, wtf, ele) { if (ele.control != null) return; var obj = new func(ele); for (var k in settings) { if (!obj["set_" + k]) throw "Control doesn't have set_" + k + " setter function"; obj["set_" + k](settings[k]) } var evt = obj.get_events(); for (var k in events) { if (!obj["add_" + k]) { evt.addHandler(k, events[k]) } else { obj["add_" + k](events[k]) } } obj.__element = ele; ele.control = obj; obj.initialize() }; Type = {}; Type.registerNamespace = function(name) { if (window[name]) return; if (name.indexOf('.') > -1) alert("Error: No subnamespaces supported in jaspAjax mode, switch to Both."); window[name] = { __namespace: true} }; Function.prototype.initializeBase = function(obj, wtf) { }; Function.prototype.callBaseMethod = function(obj, wtf) { }; Function.prototype.registerClass = function(name, type) { this.prototype.get_events = function() { if (!this.__eventHandler) this.__eventHandler = new EventHandler(); return this.__eventHandler }; this.prototype.get_element = function() { return this.__element } }; EventHandler = function() { this._list = {} }; EventHandler.prototype.getEvents = function(id, create) { if (!this._list[id]) { if (!create) return null; this._list[id] = [] } return this._list[id] }; EventHandler.prototype.addHandler = function(id, handler) { this.getEvents(id, true).push(handler) }; EventHandler.prototype.removeHandler = function(id, handler) { var evt = this.getEvents(id); if (evt != null) Array.remove(this.getEvents(id), handler) }; EventHandler.prototype.clear = function() { this._list = {} }; EventHandler.prototype.getHandler = function(id) { var evt = this.getEvents(id); if (!evt || evt.length === 0) return null; evt = Array.clone(evt); return function(source, args) { for (var i = 0, l = evt.length; i < l; i++) { evt[i](source, args) } } }; Sys = { UI: { Control: 0 }, Application: { notifyScriptLoaded: function() { }, add_init: function(f) { $(document).ready(f) } }, Serialization: { JavaScriptSerializer: { serialize: JSON.stringify}} }; Array.indexOf = function(array, item) { return $.inArray(item, array) }; Array.remove = function(array, item) { var index = $.inArray(item, array); if (index >= 0) array.splice(index, 1); return (index >= 0) }; Array.clone = function(array) { if (array.length === 1) return [array[0]]; else return Array.apply(null, array) };
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();