﻿// Crosdomain request

var callbacks = new Object();

function CreateCallBack(callBack, callBackContext) {
    var cbId;
    do cbId = 'c' + Math.floor(Math.random() * 99999); while (callbacks[cbId]);
    callbacks[cbId] = function(obj) { callBack(callBackContext, obj); delete callbacks[cbId]; document.body.removeChild(document.getElementById(cbId)); };
    return cbId;
}

// tooltip

var d = document;
var offsetfromcursorY = -20 // y offset of tooltip
var ie=d.all && !window.opera;
var ns6=d.getElementById && !d.all;
var tipobj,op;
		
function tooltip(container, el,txt) {	
	tipobj = container;
	tipobj.innerHTML = txt;
	op = 0.1;	
	tipobj.style.opacity = op; 
	tipobj.style.visibility="visible";
	el.onmousemove=positiontip;
	appear();
}

function hide_info(tipobj, el) {
	tipobj.style.visibility='hidden';
	el.onmousemove='';
}

function ietruebody(){
return (d.compatMode && d.compatMode!="BackCompat")? d.documentElement : d.body
}

function positiontip(e) {
	var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
	var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
	var winwidth=ie? ietruebody().clientWidth : window.innerWidth-20
	var winheight=ie? ietruebody().clientHeight : window.innerHeight-20
	
	var rightedge=ie? winwidth-event.clientX : winwidth-e.clientX;
	var bottomedge=ie? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY;

	if (rightedge < tipobj.offsetWidth)	tipobj.style.left=curX-tipobj.offsetWidth+"px";
	else tipobj.style.left=curX+"px";

	if (bottomedge < tipobj.offsetHeight) tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
	else tipobj.style.top=curY+offsetfromcursorY+"px";
}

function appear() {	
	if(op < 1) {
		op += 0.1;
		tipobj.style.opacity = op;
		tipobj.style.filter = 'alpha(opacity='+op*100+')';
		t = setTimeout('appear()', 30);
	}
}

// sscompat.js
function __loadCompatLayer(w) { w.Debug = function() { }; w.Debug._fail = function(message) { throw new Error(message); }; w.Debug.writeln = function(text) { if (window.console) { if (window.console.debug) { window.console.debug(text); return; } else if (window.console.log) { window.console.log(text); return; } } else if (window.opera && window.opera.postError) { window.opera.postError(text); return; } }; w.__getNonTextNode = function(node) { try { while (node && (node.nodeType != 1)) { node = node.parentNode; } } catch (ex) { node = null; } return node; }; w.__getLocation = function(e) { var loc = { x: 0, y: 0 }; while (e) { loc.x += e.offsetLeft; loc.y += e.offsetTop; e = e.offsetParent; } return loc; }; RegExp._cacheable = true; String._quoteSkipTest = true; w.navigate = function(url) { window.setTimeout('window.location = "' + url + '";', 0); }; var attachEventProxy = function(eventName, eventHandler) { eventHandler._mozillaEventHandler = function(e) { window.event = e; eventHandler(); if (!e.avoidReturn) { return e.returnValue; } }; this.addEventListener(eventName.slice(2), eventHandler._mozillaEventHandler, false); }; var detachEventProxy = function(eventName, eventHandler) { if (eventHandler._mozillaEventHandler) { var mozillaEventHandler = eventHandler._mozillaEventHandler; delete eventHandler._mozillaEventHandler; this.removeEventListener(eventName.slice(2), mozillaEventHandler, false); } }; w.attachEvent = attachEventProxy; w.detachEvent = detachEventProxy; w.HTMLDocument.prototype.attachEvent = attachEventProxy; w.HTMLDocument.prototype.detachEvent = detachEventProxy; w.HTMLElement.prototype.attachEvent = attachEventProxy; w.HTMLElement.prototype.detachEvent = detachEventProxy; w.Event.prototype.__defineGetter__('srcElement', function() { return __getNonTextNode(this.target) || this.currentTarget; }); w.Event.prototype.__defineGetter__('cancelBubble', function() { return this._bubblingCanceled || false; }); w.Event.prototype.__defineSetter__('cancelBubble', function(v) { if (v) { this._bubblingCanceled = true; this.stopPropagation(); } }); w.Event.prototype.__defineGetter__('returnValue', function() { return !this._cancelDefault; }); w.Event.prototype.__defineSetter__('returnValue', function(v) { if (!v) { this._cancelDefault = true; this.preventDefault(); } }); w.Event.prototype.__defineGetter__('fromElement', function() { var n; if (this.type == 'mouseover') { n = this.relatedTarget; } else if (this.type == 'mouseout') { n = this.target; } return __getNonTextNode(n); }); w.Event.prototype.__defineGetter__('toElement', function() { var n; if (this.type == 'mouseout') { n = this.relatedTarget; } else if (this.type == 'mouseover') { n = this.target; } return __getNonTextNode(n); }); w.Event.prototype.__defineGetter__('button', function() { return (this.which == 1) ? 1 : (this.which == 3) ? 2 : 0 }); w.Event.prototype.__defineGetter__('offsetX', function() { return window.pageXOffset + this.clientX - __getLocation(this.srcElement).x; }); w.Event.prototype.__defineGetter__('offsetY', function() { return window.pageYOffset + this.clientY - __getLocation(this.srcElement).y; }); w.HTMLElement.prototype.__defineGetter__('parentElement', function() { return this.parentNode; }); w.HTMLElement.prototype.__defineGetter__('children', function() { var children = []; var childCount = this.childNodes.length; for (var i = 0; i < childCount; i++) { var childNode = this.childNodes[i]; if (childNode.nodeType == 1) { children.push(childNode); } } return children; }); w.HTMLElement.prototype.__defineGetter__('innerText', function() { try { return this.textContent } catch (ex) { var text = ''; for (var i = 0; i < this.childNodes.length; i++) { if (this.childNodes[i].nodeType == 3) { text += this.childNodes[i].textContent; } } return str; } }); w.HTMLElement.prototype.__defineSetter__('innerText', function(v) { var textNode = document.createTextNode(v); this.innerHTML = ''; this.appendChild(textNode); }); w.HTMLElement.prototype.__defineGetter__('currentStyle', function() { return window.getComputedStyle(this, null); }); w.HTMLElement.prototype.__defineGetter__('runtimeStyle', function() { return window.getOverrideStyle(this, null); }); w.HTMLElement.prototype.removeNode = function(b) { return this.parentNode.removeChild(this) }; w.HTMLElement.prototype.contains = function(el) { while (el != null && el != this) { el = el.parentNode; } return (el != null) }; w.HTMLStyleElement.prototype.__defineGetter__('styleSheet', function() { return this.sheet; }); w.CSSStyleSheet.prototype.__defineGetter__('rules', function() { return this.cssRules; }); w.CSSStyleSheet.prototype.addRule = function(selector, style, index) { this.insertRule(selector + '{' + style + '}', index); }; w.CSSStyleSheet.prototype.removeRule = function(index) { this.deleteRule(index); }; w.CSSStyleDeclaration.prototype.__defineGetter__('styleFloat', function() { return this.cssFloat; }); w.CSSStyleDeclaration.prototype.__defineSetter__('styleFloat', function(v) { this.cssFloat = v; }); DocumentFragment.prototype.getElementById = function(id) { var nodeQueue = []; var childNodes = this.childNodes; var node; var c; for (c = 0; c < childNodes.length; c++) { node = childNodes[c]; if (node.nodeType == 1) { nodeQueue.push(node); } } while (nodeQueue.length) { node = nodeQueue.dequeue(); if (node.id == id) { return node; } childNodes = node.childNodes; if (childNodes.length != 0) { for (c = 0; c < childNodes.length; c++) { node = childNodes[c]; if (node.nodeType == 1) { nodeQueue.push(node); } } } } return null; }; DocumentFragment.prototype.getElementsByTagName = function(tagName) { var elements = []; var nodeQueue = []; var childNodes = this.childNodes; var node; var c; for (c = 0; c < childNodes.length; c++) { node = childNodes[c]; if (node.nodeType == 1) { nodeQueue.push(node); } } while (nodeQueue.length) { node = nodeQueue.dequeue(); if (node.tagName == tagName) { elements.add(node); } childNodes = node.childNodes; if (childNodes.length != 0) { for (c = 0; c < childNodes.length; c++) { node = childNodes[c]; if (node.nodeType == 1) { nodeQueue.push(node); } } } } return elements; }; DocumentFragment.prototype.createElement = function(tagName) { return document.createElement(tagName); }; var selectNodes = function(doc, path, contextNode) { contextNode = contextNode ? contextNode : doc; var xpath = new XPathEvaluator(); var result = xpath.evaluate(path, contextNode, doc.createNSResolver(doc.documentElement), XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var nodeList = new Array(result.snapshotLength); for (var i = 0; i < result.snapshotLength; i++) { nodeList[i] = result.snapshotItem(i); } return nodeList; }; var selectSingleNode = function(doc, path, contextNode) { path += '[1]'; var nodes = selectNodes(doc, path, contextNode); if (nodes.length != 0) { for (var i = 0; i < nodes.length; i++) { if (nodes[i]) { return nodes[i]; } } } return null; }; w.XMLDocument.prototype.selectNodes = function(path, contextNode) { return selectNodes(this, path, contextNode); }; w.XMLDocument.prototype.selectSingleNode = function(path, contextNode) { return selectSingleNode(this, path, contextNode); }; w.XMLDocument.prototype.transformNode = function(xsl) { var xslProcessor = new XSLTProcessor(); xslProcessor.importStylesheet(xsl); var ownerDocument = document.implementation.createDocument("", "", null); var transformedDoc = xslProcessor.transformToDocument(this); return transformedDoc.xml; }; Node.prototype.selectNodes = function(path) { var doc = this.ownerDocument; return doc.selectNodes(path, this); }; Node.prototype.selectSingleNode = function(path) { var doc = this.ownerDocument; return doc.selectSingleNode(path, this); }; Node.prototype.__defineGetter__('baseName', function() { return this.localName; }); Node.prototype.__defineGetter__('text', function() { return this.textContent; }); Node.prototype.__defineSetter__('text', function(value) { this.textContent = value; }); Node.prototype.__defineGetter__('xml', function() { return (new XMLSerializer()).serializeToString(this); }); }
function __supportsCompatLayer(ua) { return (ua.indexOf('Gecko') >= 0) || (ua.indexOf('AppleWebKit') >= 0) || (ua.indexOf('Opera') >= 0); }
if (__supportsCompatLayer(window.navigator.userAgent)) { try { __loadCompatLayer(window); } catch (e) { } }

// sscorlib.js
function isUndefined(o) { return (o === undefined); }
function isNull(o) { return (o === null); }
function isNullOrUndefined(o) { return (o === null) || (o === undefined); }
window.__scriptsharp = '0.5.1.0'; function $(id) { return document.getElementById(id); }
document.getElementsBySelector = function(cssSelector, root) { var all = root ? root.getElementsByTagName('*') : document.getElementsByTagName('*'); var matches = []; var styleSheet = document.getElementsBySelector.styleSheet; if (!styleSheet) { var styleSheetNode = document.createElement('style'); styleSheetNode.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(styleSheetNode); styleSheet = styleSheetNode.styleSheet || styleSheetNode.sheet; document.getElementsBySelector.styleSheet = styleSheet; } if (window.navigator.userAgent.indexOf('MSIE') >= 0) { styleSheet.addRule(cssSelector, 'ssCssMatch:true', 0); for (var i = all.length - 1; i >= 0; i--) { var element = all[i]; if (element.currentStyle.ssCssMatch) { matches[matches.length] = element; } } styleSheet.removeRule(0); } else { var matchValue = document.getElementsBySelector.matchValue; if (!matchValue) { matchValue = (window.navigator.userAgent.indexOf('Opera') >= 0) ? '"ssCssMatch"' : 'ssCssMatch 1'; document.getElementsBySelector.matchValue = matchValue; } styleSheet.insertRule(cssSelector + ' { counter-increment: ssCssMatch }', 0); var docView = document.defaultView; for (var i = all.length - 1; i >= 0; i--) { var element = all[i]; if (docView.getComputedStyle(element, null).counterIncrement === matchValue) { matches[matches.length] = element; } } styleSheet.deleteRule(0); } if (matches.length > 1) { matches.reverse(); } return matches; }
Object.__typeName = 'Object'; Object.__baseType = null; Object.parse = function(s) { return eval(s); }
Object.getKeyCount = function(d) { var count = 0; for (var n in d) { count++; } return count; }
Object.clearKeys = function(d) { for (var n in d) { delete d[n]; } }
Object.keyExists = function(d, key) { return d[key] !== undefined; }
Function.parse = function(s) { if (!Function._parseCache) { Function._parseCache = {}; } var fn = Function._parseCache[s]; if (!fn) { try { eval('fn = ' + s); if (typeof (fn) != 'function') { fn = null; } else { Function._parseCache[s] = fn; } } catch (ex) { } } return fn; }
Function.prototype.invoke = function() { this.apply(null, arguments); }
Boolean.__typeName = 'Boolean'; Boolean.parse = function(s) { return (s.toLowerCase() == 'true'); }
Number.__typeName = 'Number'; Number.parse = function(s) { if (!s || !s.length) { return 0; } if ((s.indexOf('.') >= 0) || (s.indexOf('e') >= 0) || s.endsWith('f') || s.endsWith('F')) { return parseFloat(s); } return parseInt(s); }
Number.prototype.format = function(format, useLocale) { if (isNullOrUndefined(format) || (format.length == 0) || (format == 'i')) { if (useLocale) { return this.toLocaleString(); } else { return this.toString(); } } return this._netFormat(format, useLocale); }
Number._commaFormat = function(number, groups, decimal, comma) { var decimalPart = null; var decimalIndex = number.indexOf(decimal); if (decimalIndex > 0) { decimalPart = number.substr(decimalIndex); number = number.substr(0, decimalIndex); } var negative = number.startsWith('-'); if (negative) { number = number.substr(1); } var groupIndex = 0; var groupSize = groups[groupIndex]; if (number.length < groupSize) { return decimalPart ? number + decimalPart : number; } var index = number.length; var s = ''; var done = false; while (!done) { var length = groupSize; var startIndex = index - length; if (startIndex < 0) { groupSize += startIndex; length += startIndex; startIndex = 0; done = true; } if (!length) { break; } var part = number.substr(startIndex, length); if (s.length) { s = part + comma + s; } else { s = part; } index -= length; if (groupIndex < groups.length - 1) { groupIndex++; groupSize = groups[groupIndex]; } } if (negative) { s = '-' + s; } return decimalPart ? s + decimalPart : s; }
Number.prototype._netFormat = function(format, useLocale) { var nf = useLocale ? CultureInfo.Current.numberFormat : CultureInfo.Neutral.numberFormat; var s = ''; var precision = -1; if (format.length > 1) { precision = parseInt(format.substr(1)); } var fs = format.charAt(0); switch (fs) { case 'd': case 'D': s = parseInt(Math.abs(this)).toString(); if (precision != -1) { s = s.padLeft(precision, '0'); } if (this < 0) { s = '-' + s; } break; case 'x': case 'X': s = parseInt(Math.abs(this)).toString(16); if (fs == 'X') { s = s.toUpperCase(); } if (precision != -1) { s = s.padLeft(precision, '0'); } break; case 'e': case 'E': if (precision == -1) { s = this.toExponential(); } else { s = this.toExponential(precision); } if (fs == 'E') { s = s.toUpperCase(); } break; case 'f': case 'F': case 'n': case 'N': if (precision == -1) { precision = nf.numberDecimalDigits; } s = this.toFixed(precision).toString(); if (precision && (nf.numberDecimalSeparator != '.')) { var index = s.indexOf('.'); s = s.substr(0, index) + nf.numberDecimalSeparator + s.substr(index + 1); } if ((fs == 'n') || (fs == 'N')) { s = Number._commaFormat(s, nf.numberGroupSizes, nf.numberDecimalSeparator, nf.numberGroupSeparator); } break; case 'c': case 'C': if (precision == -1) { precision = nf.currencyDecimalDigits; } s = Math.abs(this).toFixed(precision).toString(); if (precision && (nf.currencyDecimalSeparator != '.')) { var index = s.indexOf('.'); s = s.substr(0, index) + nf.currencyDecimalSeparator + s.substr(index + 1); } s = Number._commaFormat(s, nf.currencyGroupSizes, nf.currencyDecimalSeparator, nf.currencyGroupSeparator); if (this < 0) { s = String.format(nf.currencyNegativePattern, s); } else { s = String.format(nf.currencyPositivePattern, s); } break; case 'p': case 'P': if (precision == -1) { precision = nf.percentDecimalDigits; } s = (Math.abs(this) * 100.0).toFixed(precision).toString(); if (precision && (nf.percentDecimalSeparator != '.')) { var index = s.indexOf('.'); s = s.substr(0, index) + nf.percentDecimalSeparator + s.substr(index + 1); } s = Number._commaFormat(s, nf.percentGroupSizes, nf.percentDecimalSeparator, nf.percentGroupSeparator); if (this < 0) { s = String.format(nf.percentNegativePattern, s); } else { s = String.format(nf.percentPositivePattern, s); } break; } return s; }
Math.truncate = function(n) { return (n >= 0) ? Math.floor(n) : Math.ceil(n); }
String.__typeName = 'String'; String.Empty = ''; String.compare = function(s1, s2, ignoreCase) { if (ignoreCase) { if (s1) { s1 = s1.toUpperCase(); } if (s2) { s2 = s2.toUpperCase(); } } s1 = s1 || ''; s2 = s2 || ''; if (s1 == s2) { return 0; } if (s1 < s2) { return -1; } return 1; }
String.prototype.compareTo = function(s, ignoreCase) { return String.compare(this, s, ignoreCase); }
String.prototype.endsWith = function(suffix) { if (!suffix.length) { return true; } if (suffix.length > this.length) { return false; } return (this.substr(this.length - suffix.length) == suffix); }
String.equals = function(s1, s2, ignoreCase) { return String.compare(s1, s2, ignoreCase) == 0; }
String._format = function(format, values, useLocale) { if (!String._formatRE) { String._formatRE = /(\{[^\}^\{]+\})/g; } return format.replace(String._formatRE, function(str, m) { var index = parseInt(m.substr(1)); var value = values[index + 1]; if (isNullOrUndefined(value)) { return ''; } if (value.format) { var formatSpec = null; var formatIndex = m.indexOf(':'); if (formatIndex > 0) { formatSpec = m.substring(formatIndex + 1, m.length - 1); } return value.format.call(value, formatSpec, useLocale); } else { if (useLocale) { return value.toLocaleString(); } return value.toString(); } }); }
String.format = function(format) { return String._format(format, arguments, false); }
String.fromChar = function(ch, count) { var s = ch; for (var i = 1; i < count; i++) { s += ch; } return s; }
String.prototype.htmlDecode = function() { if (!String._htmlDecRE) { String._htmlDecMap = { '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '"' }; String._htmlDecRE = /(&amp;|&lt;|&gt;|&quot;)/gi; } var s = this; s = s.replace(String._htmlDecRE, function(str, m) { return String._htmlDecMap[m]; }); return s; }
String.prototype.htmlEncode = function() { if (!String._htmlEncRE) { String._htmlEncMap = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }; String._htmlEncRE = /([&<>"])/g; } var s = this; if (String._htmlEncRE.test(s)) { s = s.replace(String._htmlEncRE, function(str, m) { return String._htmlEncMap[m]; }); } return s; }
String.prototype.indexOfAny = function(chars, startIndex, count) { var length = this.length; if (!length) { return -1; } startIndex = startIndex || 0; count = count || length; var endIndex = startIndex + count - 1; if (endIndex >= length) { endIndex = length - 1; } for (var i = startIndex; i <= endIndex; i++) { if (chars.indexOf(this.charAt(i)) >= 0) { return i; } } return -1; }
String.prototype.insert = function(index, value) { if (!value) { return this; } if (!index) { return value + this; } var s1 = this.substr(0, index); var s2 = this.substr(index); return s1 + value + s2; }
String.isNullOrEmpty = function(s) { return !s || !s.length; }
String.prototype.lastIndexOfAny = function(chars, startIndex, count) { var length = this.length; if (!length) { return -1; } startIndex = startIndex || length - 1; count = count || length; var endIndex = startIndex - count + 1; if (endIndex < 0) { endIndex = 0; } for (var i = startIndex; i >= endIndex; i--) { if (chars.indexOf(this.charAt(i)) >= 0) { return i; } } return -1; }
String.localeFormat = function(format) { return String._format(format, arguments, true); }
String.prototype.padLeft = function(totalWidth, ch) { if (this.length < totalWidth) { ch = ch || ' '; return String.fromChar(ch, totalWidth - this.length) + this; } return this; }
String.prototype.padRight = function(totalWidth, ch) { if (this.length < totalWidth) { ch = ch || ' '; return this + String.fromChar(ch, totalWidth - this.length); } return this; }
String.prototype.quote = function() { if (!String._quoteMap) { String._quoteMap = { '\\': '\\\\', '\'': '\\\'', '"': '\\"', '\r': '\\r', '\n': '\\n', '\t': '\\t', '\f': '\\f', '\b': '\\b' }; } if (!String._quoteRE || !RegExp._cacheable) { String._quoteRE = new RegExp("([\'\"\\\\\x00-\x1F\x7F-\uFFFF])", "g"); } var s = this; if (String._quoteSkipTest || String._quoteRE.test(s)) { s = this.replace(String._quoteRE, function(str, m) { var c = String._quoteMap[m]; if (c) { return c; } c = m.charCodeAt(0); return '\\u' + c.toString(16).toUpperCase().padLeft(4, '0'); }); } return '"' + s + '"'; }
String.prototype.remove = function(index, count) { if (!count || ((index + count) > this.length)) { return this.substr(0, index); } return this.substr(0, index) + this.substr(index + count); }
String.prototype._replace = String.prototype.replace; String.prototype.replace = function(oldValue, newValue) { if (oldValue.constructor == String) { newValue = newValue || ''; return this.split(oldValue).join(newValue); } return String.prototype._replace.call(this, oldValue, newValue); }
String.prototype.startsWith = function(prefix) { if (!prefix.length) { return true; } if (prefix.length > this.length) { return false; } return (this.substr(0, prefix.length) == prefix); }
String.prototype.trim = function() { return this.trimEnd().trimStart(); }
String.prototype.trimEnd = function() { return this.replace(/\s*$/, ''); }
String.prototype.trimStart = function() { return this.replace(/^\s*/, ''); }
String.prototype.unquote = function() { return eval('(' + this + ')'); }
Array.__typeName = 'Array'; Array.prototype.add = function(item) { this[this.length] = item; }
Array.prototype.addRange = function(items) { if (!items) { return; } var length = items.length; for (var index = 0; index < length; index++) { this[this.length] = items[index]; } }
Array.prototype.aggregate = function(seed, callback) { var length = this.length; for (var index = 0; index < length; index++) { seed = callback(seed, this[index], index, this); } return seed; }
Array.prototype.clear = function() { if (this.length > 0) { this.splice(0, this.length); } }
Array.prototype.clone = function() { var length = this.length; var array = new Array(length); for (var index = 0; index < length; index++) { array[index] = this[index]; } return array; }
Array.prototype.contains = function(item) { var index = this.indexOf(item); return (index >= 0); }
Array.prototype.dequeue = function() { return this.shift(); }
Array.prototype.enqueue = function(item) { this._queue = true; this.push(item); }
Array.prototype.peek = function() { if (this.length) { var index = this._queue ? 0 : this.length - 1; return this[index]; } return null; }
if (!Array.prototype.every) { Array.prototype.every = function(callback) { for (var i = this.length - 1; i >= 0; i--) { if (!callback(this[i], i, this)) { return false; } } return true; } }
Array.prototype.extract = function(index, count) { if (!count) { return this.slice(index); } return this.slice(index, index + count); }
if (!Array.prototype.filter) { Array.prototype.filter = function(callback) { var filtered = []; for (var i = 0; i < this.length; i++) { if (callback(this[i], i, this)) { filtered.add(this[i]); } } return filtered; } }
if (!Array.prototype.forEach) { Array.prototype.forEach = function(callback) { for (var i = 0; i < this.length; i++) { callback(this[i], i, this); } } }
Array.prototype.groupBy = function(callback) { var length = this.length; var groups = []; var keys = {}; for (var index = 0; index < length; index++) { var key = callback(this[index], index); if (String.isNullOrEmpty(key)) { continue; } var items = keys[key]; if (!items) { items = []; items.key = key; keys[key] = items; groups.add(items); } items.add(this[index]); } return groups; }
Array.prototype.index = function(callback) { var length = this.length; var items = {}; for (var index = 0; index < length; index++) { var key = callback(this[index], index); if (String.isNullOrEmpty(key)) { continue; } items[key] = this[index]; } return items; }
Array.prototype.indexOf = function(item) { var length = this.length; if (length) { for (var index = 0; index < length; index++) { if (this[index] === item) { return index; } } } return -1; }
Array.prototype.insert = function(index, item) { this.splice(index, 0, item); }
Array.prototype.insertRange = function(index, items) { this.splice(index, 0, items); }
if (!Array.prototype.map) { Array.prototype.map = function(callback) { var mapped = new Array(this.length); for (var i = this.length - 1; i >= 0; i--) { mapped[i] = callback(this[i], i, this); } return mapped; } }
Array.parse = function(s) { return eval('(' + s + ')'); }
Array.prototype.remove = function(item) { var index = this.indexOf(item); if (index >= 0) { this.splice(index, 1); return true; } return false; }
Array.prototype.removeAt = function(index) { return this.splice(index, 1)[0]; }
Array.prototype.removeRange = function(index, count) { return this.splice(index, count); }
if (!Array.prototype.some) { Array.prototype.some = function(callback) { for (var i = this.length - 1; i >= 0; i--) { if (callback(this[i], i, this)) { return true; } } return false; } }
RegExp.__typeName = 'RegExp'; RegExp.parse = function(s) { if (s.startsWith('/')) { var endSlashIndex = s.lastIndexOf('/'); if (endSlashIndex > 1) { var expression = s.substring(1, endSlashIndex); var flags = s.substr(endSlashIndex + 1); return new RegExp(expression, flags); } } return null; }
Date.__typeName = 'Date'; Date.get_now = function() { return new Date(); }
Date.get_today = function() { var d = new Date(); return new Date(d.getFullYear(), d.getMonth(), d.getDate()); }
Date.prototype.format = function(format, useLocale) { if (isNullOrUndefined(format) || (format.length == 0) || (format == 'i')) { if (useLocale) { return this.toLocaleString(); } else { return this.toString(); } } if (format == 'id') { if (useLocale) { return this.toLocaleDateString(); } else { return this.toDateString(); } } if (format == 'it') { if (useLocale) { return this.toLocaleTimeString(); } else { return this.toTimeString(); } } return this._netFormat(format, useLocale); }
Date.prototype._netFormat = function(format, useLocale) { var dtf = useLocale ? CultureInfo.Current.dateFormat : CultureInfo.Neutral.dateFormat; var useUTC = false; if (format.length == 1) { switch (format) { case 'f': format = dtf.longDatePattern + ' ' + dtf.shortTimePattern; case 'F': format = dtf.dateTimePattern; break; case 'd': format = dtf.shortDatePattern; break; case 'D': format = dtf.longDatePattern; break; case 't': format = dtf.shortTimePattern; break; case 'T': format = dtf.longTimePattern; break; case 'g': format = dtf.shortDatePattern + ' ' + dtf.shortTimePattern; break; case 'G': format = dtf.shortDatePattern + ' ' + dtf.longTimePattern; break; case 'R': case 'r': format = dtf.gmtDateTimePattern; useUTC = true; break; case 'u': format = dtf.universalDateTimePattern; useUTC = true; break; case 'U': format = dtf.dateTimePattern; useUTC = true; break; case 's': format = dtf.sortableDateTimePattern; break; } } if (format.charAt(0) == '%') { format = format.substr(1); } if (!Date._formatRE) { Date._formatRE = /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g; } var re = Date._formatRE; var sb = new StringBuilder(); var dt = this; if (useUTC) { dt = new Date(Date.UTC(dt.getUTCFullYear(), dt.getUTCMonth(), dt.getUTCDate(), dt.getUTCHours(), dt.getUTCMinutes(), dt.getUTCSeconds(), dt.getUTCMilliseconds())); } re.lastIndex = 0; while (true) { var index = re.lastIndex; var match = re.exec(format); sb.append(format.slice(index, match ? match.index : format.length)); if (!match) { break; } var fs = match[0]; var part = fs; switch (fs) { case 'dddd': part = dtf.dayNames[dt.getDay()]; break; case 'ddd': part = dtf.shortDayNames[dt.getDay()]; break; case 'dd': part = dt.getDate().toString().padLeft(2, '0'); break; case 'd': part = dt.getDate(); break; case 'MMMM': part = dtf.monthNames[dt.getMonth()]; break; case 'MMM': part = dtf.shortMonthNames[dt.getMonth()]; break; case 'MM': part = (dt.getMonth() + 1).toString().padLeft(2, '0'); break; case 'M': part = (dt.getMonth() + 1); break; case 'yyyy': part = dt.getFullYear(); break; case 'yy': part = (dt.getFullYear() % 100).toString().padLeft(2, '0'); break; case 'y': part = (dt.getFullYear() % 100); break; case 'h': case 'hh': part = dt.getHours() % 12; if (!part) { part = '12'; } else if (fs == 'hh') { part = part.toString().padLeft(2, '0'); } break; case 'HH': part = dt.getHours().toString().padLeft(2, '0'); break; case 'H': part = dt.getHours(); break; case 'mm': part = dt.getMinutes().toString().padLeft(2, '0'); break; case 'm': part = dt.getMinutes(); break; case 'ss': part = dt.getSeconds().toString().padLeft(2, '0'); break; case 's': part = dt.getSeconds(); break; case 't': case 'tt': part = (dt.getHours() < 12) ? dtf.amDesignator : dtf.pmDesignator; if (fs == 't') { part = part.charAt(0); } break; case 'fff': part = dt.getMilliseconds().toString().padLeft(3, '0'); break; case 'ff': part = dt.getMilliseconds().toString().padLeft(3).substr(0, 2); break; case 'f': part = dt.getMilliseconds().toString().padLeft(3).charAt(0); break; case 'z': part = dt.getTimezoneOffset() / 60; part = ((part >= 0) ? '-' : '+') + Math.floor(Math.abs(part)); break; case 'zz': case 'zzz': part = dt.getTimezoneOffset() / 60; part = ((part >= 0) ? '-' : '+') + Math.floor(Math.abs(part)).toString().padLeft(2, '0'); if (fs == 'zzz') { part += dtf.timeSeparator + Math.abs(dt.getTimezoneOffset() % 60).toString().padLeft(2, '0'); } break; } sb.append(part); } return sb.toString(); }
Date._parse = Date.parse; Date.parse = function(s) { return new Date(Date._parse(s)); }
Error.__typeName = 'Error'; Error.create = function(message, userData, innerException) { var e = new Error(message); if (userData) { e.userData = userData; } if (innerException) { e.innerException = innerException; } return e; }
if (!Debug._fail) { Debug._fail = function(message) { Debug.writeln(message); eval('debugger;'); } }
Debug.assert = function(condition, message) { if (!condition) { message = 'Assert failed: ' + message; if (confirm(message + '\r\n\r\nBreak into debugger?')) { Debug._fail(message); } } }
Debug._dumpCore = function(sb, object, name, indentation, dumpedObjects) { if (object === null) { sb.appendLine(indentation + name + ': null'); return; } switch (typeof (object)) { case 'undefined': sb.appendLine(indentation + name + ': undefined'); break; case 'number': case 'string': case 'boolean': sb.appendLine(indentation + name + ': ' + object); break; default: if (Date.isInstance(object) || RegExp.isInstance(object)) { sb.appendLine(indentation + name + ': ' + object); break; } if (dumpedObjects.contains(object)) { sb.appendLine(indentation + name + ': ...'); break; } dumpedObjects.add(object); var type = Type.getInstanceType(object); var typeName = type.get_fullName(); var recursiveIndentation = indentation + '  '; if (IArray.isInstance(object)) { sb.appendLine(indentation + name + ': {' + typeName + '}'); var length = object.getLength(); for (var i = 0; i < length; i++) { Debug._dumpCore(sb, object.getItem(i), '[' + i + ']', recursiveIndentation, dumpedObjects); } } else { if (object.tagName) { sb.appendLine(indentation + name + ': <' + object.tagName + '>'); var attributes = object.attributes; for (var i = 0; i < attributes.length; i++) { var attrValue = attributes[i].nodeValue; if (attrValue) { Debug._dumpCore(sb, attrValue, attributes[i].nodeName, recursiveIndentation, dumpedObjects); } } } else { sb.appendLine(indentation + name + ': {' + typeName + '}'); for (var field in object) { var v = object[field]; if (!Function.isInstance(v)) { Debug._dumpCore(sb, v, field, recursiveIndentation, dumpedObjects); } } } } dumpedObjects.remove(object); break; } }
Debug.dump = function(object, name) { if ((!name || !name.length) && (object !== null)) { name = Type.getInstanceType(object).get_fullName(); } if (!name || !name.length) { return; } var sb = new StringBuilder(); Debug._dumpCore(sb, object, name, '', []); Debug.writeLine(sb.toString()); }
Debug.fail = function(message) { Debug._fail(message); }
Debug.inspect = function(object, name) { var dumped = false; if (window.debugService) { dumped = window.debugService.inspect(name, object); } if (!dumped) { Debug.dump(object, name); } }
Debug.writeLine = function(message) { if (window.debugService) { window.debugService.trace(message); return; } Debug.writeln(message); var traceTextBox = $('_traceTextBox'); if (traceTextBox) { traceTextBox.value = traceTextBox.value + '\r\n' + message; } }
Debug.__typeName = 'Debug'; var Type = Function; Type.__typeName = 'Type'; var __Namespace = function(name) { this.__typeName = name; }
__Namespace.prototype = { __namespace: true, getName: function() { return this.__typeName; } }
Type.createNamespace = function(name) { if (!window.__namespaces) { window.__namespaces = {}; } if (!window.__rootNamespaces) { window.__rootNamespaces = []; } if (window.__namespaces[name]) { return; } var ns = window; var nameParts = name.split('.'); for (var i = 0; i < nameParts.length; i++) { var part = nameParts[i]; var nso = ns[part]; if (!nso) { ns[part] = nso = new __Namespace(nameParts.slice(0, i + 1).join('.')); if (i == 0) { window.__rootNamespaces.add(nso); } } ns = nso; } window.__namespaces[name] = ns; }
Type.prototype.createClass = function(name, baseType, interfaceType) { this.prototype.constructor = this; this.__typeName = name; this.__class = true; this.__baseType = baseType || Object; if (baseType) { this.__basePrototypePending = true; } if (interfaceType) { this.__interfaces = []; for (var i = 2; i < arguments.length; i++) { interfaceType = arguments[i]; this.__interfaces.add(interfaceType); } } }
Type.prototype.createInterface = function(name) { this.__typeName = name; this.__interface = true; }
Type.prototype.createEnum = function(name, flags) { for (var field in this.prototype) { this[field] = this.prototype[field]; } this.__typeName = name; this.__enum = true; if (flags) { this.__flags = true; } }
Type.prototype.setupBase = function() { if (this.__basePrototypePending) { var baseType = this.__baseType; if (baseType.__basePrototypePending) { baseType.setupBase(); } for (var memberName in baseType.prototype) { var memberValue = baseType.prototype[memberName]; if (!this.prototype[memberName]) { this.prototype[memberName] = memberValue; } } delete this.__basePrototypePending; } }
if (!Type.prototype.resolveInheritance) { Type.prototype.resolveInheritance = Type.prototype.setupBase; }
Type.prototype.constructBase = function(instance, args) { if (this.__basePrototypePending) { this.setupBase(); } if (!args) { this.__baseType.apply(instance); } else { this.__baseType.apply(instance, args); } }
Type.prototype.callBase = function(instance, name, args) { var baseMethod = this.__baseType.prototype[name]; if (!args) { return baseMethod.apply(instance); } else { return baseMethod.apply(instance, args); } }
Type.prototype.get_baseType = function() { return this.__baseType || null; }
Type.prototype.get_fullName = function() { return this.__typeName; }
Type.prototype.get_name = function() { var fullName = this.__typeName; var nsIndex = fullName.lastIndexOf('.'); if (nsIndex > 0) { return fullName.substr(nsIndex + 1); } return fullName; }
Type.prototype.isInstance = function(instance) { if (isNullOrUndefined(instance)) { return false; } if ((this == Object) || (instance instanceof this)) { return true; } var type = Type.getInstanceType(instance); return this.isAssignableFrom(type); }
Type.prototype.isAssignableFrom = function(type) { if ((this == Object) || (this == type)) { return true; } if (this.__class) { var baseType = type.__baseType; while (baseType) { if (this == baseType) { return true; } baseType = baseType.__baseType; } } else if (this.__interface) { var interfaces = type.__interfaces; if (interfaces && interfaces.contains(this)) { return true; } var baseType = type.__baseType; while (baseType) { interfaces = baseType.__interfaces; if (interfaces && interfaces.contains(this)) { return true; } baseType = baseType.__baseType; } } return false; }
Type.isClass = function(type) { return (type.__class == true); }
Type.isEnum = function(type) { return (type.__enum == true); }
Type.isFlagsEnum = function(type) { return ((type.__enum == true) && (type.__flags == true)); }
Type.isInterface = function(type) { return (type.__interface == true); }
Type.canCast = function(instance, type) { return type.isInstance(instance); }
Type.safeCast = function(instance, type) { if (type.isInstance(instance)) { return instance; } return null; }
Type.getInstanceType = function(instance) { var ctor = null; try { ctor = instance.constructor; } catch (ex) { } if (!ctor || !ctor.__typeName) { ctor = Object; } return ctor; }
Type.getType = function(typeName) { if (!typeName) { return null; } if (!Type.__typeCache) { Type.__typeCache = {}; } var type = Type.__typeCache[typeName]; if (!type) { type = eval(typeName); Type.__typeCache[typeName] = type; } return type; }
Type.parse = function(typeName) { return Type.getType(typeName); }
var Enum = function() { }
Enum.createClass('Enum'); Enum.parse = function(enumType, s) { var values = enumType.prototype; if (!enumType.__flags) { for (var f in values) { if (f === s) { return values[f]; } } } else { var parts = s.split('|'); var value = 0; var parsed = true; for (var i = parts.length - 1; i >= 0; i--) { var part = parts[i].trim(); var found = false; for (var f in values) { if (f === part) { value |= values[f]; found = true; break; } } if (!found) { parsed = false; break; } } if (parsed) { return value; } } throw 'Invalid Enumeration Value'; }
Enum.toString = function(enumType, value) { var values = enumType.prototype; if (!enumType.__flags || (value === 0)) { for (var i in values) { if (values[i] === value) { return i; } } throw 'Invalid Enumeration Value'; } else { var parts = []; for (var i in values) { if (values[i] & value) { if (parts.length) { parts.add(' | '); } parts.add(i); } } if (!parts.length) { throw 'Invalid Enumeration Value'; } return parts.join(''); } }
var Delegate = function() { }
Delegate.createClass('Delegate'); Delegate.Null = function() { }
Delegate._create = function(targets) { var delegate = function() { if (targets.length == 2) { return targets[1].apply(targets[0], arguments); } else { for (var i = 0; i < targets.length; i += 2) { targets[i + 1].apply(targets[i], arguments); } return null; } }; delegate.invoke = delegate; delegate._targets = targets; return delegate; }
Delegate.create = function(object, method) { if (!object) { method.invoke = method; return method; } return Delegate._create([object, method]); }
Delegate.combine = function(delegate1, delegate2) { if (!delegate1) { if (!delegate2._targets) { return Delegate.create(null, delegate2); } return delegate2; } if (!delegate2) { if (!delegate1._targets) { return Delegate.create(null, delegate1); } return delegate1; } var targets1 = delegate1._targets ? delegate1._targets : [null, delegate1]; var targets2 = delegate2._targets ? delegate2._targets : [null, delegate2]; return Delegate._create(targets1.concat(targets2)); }
Delegate.remove = function(delegate1, delegate2) { if (!delegate1 || (delegate1 === delegate2)) { return null; } if (!delegate2) { return delegate1; } var targets = delegate1._targets; var object = null; var method; if (delegate2._targets) { object = delegate2._targets[0]; method = delegate2._targets[1]; } else { method = delegate2; } for (var i = 0; i < targets.length; i += 2) { if ((targets[i] === object) && (targets[i + 1] === method)) { if (targets.length == 2) { return null; } targets.splice(i, 2); return Delegate._create(targets); } } return delegate1; }
Delegate.createExport = function(delegate, multiUse) { var name = '__' + (new Date()).valueOf(); Delegate[name] = function() { if (!multiUse) { Delegate.deleteExport(name); } delegate.apply(null, arguments); }; return name; }
Delegate.deleteExport = function(name) { if (Delegate[name]) { delete Delegate[name]; } }
Delegate.clearExport = function(name) { if (Delegate[name]) { Delegate[name] = Delegate.Null; } }
var CultureInfo = function(name, numberFormat, dateFormat) { this.name = name; this.numberFormat = numberFormat; this.dateFormat = dateFormat; }
CultureInfo.createClass('CultureInfo'); CultureInfo.Neutral = new CultureInfo('en-US', { naNSymbol: 'NaN', negativeSign: '-', positiveSign: '+', negativeInfinityText: '-Infinity', positiveInfinityText: 'Infinity', percentSymbol: '%', percentGroupSizes: [3], percentDecimalDigits: 2, percentDecimalSeparator: '.', percentGroupSeparator: ',', percentPositivePattern: '{0} %', percentNegativePattern: '-{0} %', currencySymbol: '$', currencyGroupSizes: [3], currencyDecimalDigits: 2, currencyDecimalSeparator: '.', currencyGroupSeparator: ',', currencyNegativePattern: '(${0})', currencyPositivePattern: '${0}', numberGroupSizes: [3], numberDecimalDigits: 2, numberDecimalSeparator: '.', numberGroupSeparator: ',' }, { amDesignator: 'AM', pmDesignator: 'PM', dateSeparator: '/', timeSeparator: ':', gmtDateTimePattern: 'ddd, dd MMM yyyy HH:mm:ss \'GMT\'', universalDateTimePattern: 'yyyy-MM-dd HH:mm:ssZ', sortableDateTimePattern: 'yyyy-MM-ddTHH:mm:ss', dateTimePattern: 'dddd, MMMM dd, yyyy h:mm:ss tt', longDatePattern: 'dddd, MMMM dd, yyyy', shortDatePattern: 'M/d/yyyy', longTimePattern: 'h:mm:ss tt', shortTimePattern: 'h:mm tt', firstDayOfWeek: 0, dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], shortDayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], minimizedDayNames: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ''], shortMonthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ''] }); CultureInfo.Current = CultureInfo.Neutral; var IArray = function() { }; IArray.createInterface('IArray'); var IEnumerator = function() { }; IEnumerator.createInterface('IEnumerator'); var IEnumerable = function() { }; IEnumerable.createInterface('IEnumerable'); var ArrayEnumerator = function(array) { this._array = array; this._index = -1; }
ArrayEnumerator.prototype = { get_current: function() { return this._array[this._index]; }, moveNext: function() { this._index++; return (this._index < this._array.length); }, reset: function() { this._index = -1; } }
ArrayEnumerator.createClass('ArrayEnumerator', null, IEnumerator); Array.__interfaces = [IArray, IEnumerable]; Array.prototype.getLength = function() { return this.length; }
Array.prototype.getItem = function(index) { return this[index]; }
Array.prototype.getEnumerator = function() { return new ArrayEnumerator(this); }
var IDisposable = function() { }; IDisposable.createInterface('IDisposable'); var IServiceProvider = function() { }; IServiceProvider.createInterface('IServiceProvider'); var IServiceContainer = function() { }; IServiceContainer.createInterface('IServiceContainer'); var StringBuilder = function(s) { if ((s !== undefined) && (s !== null)) { this._parts = [s]; } else { this._parts = []; } }
StringBuilder.prototype = { get_isEmpty: function() { return (this._parts.length == 0); }, append: function(s) { if ((s !== undefined) && (s !== null)) { this._parts.add(s); } }, appendLine: function(s) { this.append(s); this.append('\r\n'); }, clear: function() { this._parts.clear(); }, toString: function() { return this._parts.join(''); } }; StringBuilder.createClass('StringBuilder'); var EventArgs = function() { }
EventArgs.createClass('EventArgs'); EventArgs.Empty = new EventArgs(); if (!window.XMLHttpRequest) { window.XMLHttpRequest = function() { var progIDs = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP']; for (var i = 0; i < progIDs.length; i++) { try { var xmlHttp = new ActiveXObject(progIDs[i]); return xmlHttp; } catch (ex) { } } return null; } }
var XMLDocumentParser = function() { }
XMLDocumentParser.createClass('XMLDocumentParser'); XMLDocumentParser.parse = function(markup) { if (!window.DOMParser) { var progIDs = ['Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument']; for (var i = 0; i < progIDs.length; i++) { try { var xmlDOM = new ActiveXObject(progIDs[i]); xmlDOM.async = false; xmlDOM.loadXML(markup); xmlDOM.setProperty('SelectionLanguage', 'XPath'); return xmlDOM; } catch (ex) { } } } else { try { var domParser = new DOMParser(); return domParser.parseFromString(markup, 'text/xml'); } catch (ex) { } } return null; }
var ScriptLoader = function ScriptLoader(scriptURLs) { Debug.assert((scriptURLs) && (scriptURLs.length)); this._scriptURLs = scriptURLs; this._scriptLoadIndex = -1; }
ScriptLoader.prototype = { _scriptURLs: null, _loadedHandler: null, _errorHandler: null, _isIE: false, _onLoadHandler: null, _onErrorHandler: null, _scriptLoadIndex: 0, _scriptElements: null, _loadedScripts: 0, _inError: false, _loaded: false, dispose: function() { if (this._scriptElements) { for (var i = 0; i < this._scriptElements.length; i++) { var scriptElement = this._scriptElements[i]; if (this._isIE) { scriptElement.detachEvent('onreadystatechange', this._onLoadHandler); } else { scriptElement.detachEvent('onload', this._onLoadHandler); scriptElement.detachEvent('onerror', this._onErrorHandler); } } this._scriptElements = null; } }, load: function(loadInParallel, timeout, loadedHandler, errorHandler) { Debug.assert(loadedHandler); Debug.assert(errorHandler); this._loadedHandler = loadedHandler; this._errorHandler = errorHandler; this._isIE = (window.navigator.userAgent.indexOf('MSIE') >= 0); this._onLoadHandler = Delegate.create(this, this._onScriptLoad); if (!this._isIE) { this._onErrorHandler = Delegate.create(this, this._onScriptError); } this._scriptElements = []; if (loadInParallel) { for (var i = 0; i < this._scriptURLs.length; i++) { this._loadScript(this._scriptURLs[i]); } } else { this._scriptLoadIndex++; this._loadScript(this._scriptURLs[this._scriptLoadIndex]); } if (timeout) { window.setTimeout(Delegate.create(this, this._onScriptError), timeout); } }, _loadScript: function(scriptURL) { var scriptElement = document.createElement('SCRIPT'); if (this._isIE) { scriptElement.attachEvent('onreadystatechange', this._onLoadHandler); } else { scriptElement.readyState = 'complete'; scriptElement.attachEvent('onload', this._onLoadHandler); scriptElement.attachEvent('onerror', this._onErrorHandler); } scriptElement.type = 'text/javascript'; scriptElement.src = scriptURL; this._scriptElements.add(scriptElement); document.getElementsByTagName('HEAD')[0].appendChild(scriptElement); }, _onScriptError: function() { if ((!this._inError) && (!this._loaded)) { this._inError = true; this._errorHandler.invoke(this, EventArgs.Empty); } }, _onScriptLoad: function() { if (this._inError) { return; } var scriptElement = window.event.srcElement; if (!scriptElement.readyState) { scriptElement = window.event.currentTarget; } if ((scriptElement.readyState != 'complete') && (scriptElement.readyState != 'loaded')) { return; } if (this._scriptLoadIndex != -1) { this._scriptLoadIndex++; if (this._scriptLoadIndex != this._scriptURLs.length) { this._loadScript(this._scriptURLs[this._scriptLoadIndex]); return; } } else { this._loadedScripts++; if (this._loadedScripts != this._scriptURLs.length) { return; } } this._loaded = true; this._loadedHandler.invoke(this, EventArgs.Empty); } }; ScriptLoader.createClass('ScriptLoader', null, IDisposable); var ScriptHost = function ScriptHost() { }
ScriptHost.get_isLoading = function() { return ScriptHost._loading; }
ScriptHost.add_load = function(value) { if (ScriptHost._loaded) { value.invoke(null, EventArgs.Empty); } else { ScriptHost._loadHandler = Delegate.combine(ScriptHost._loadHandler, value); } }
ScriptHost.remove_load = function(value) { ScriptHost._loadHandler = Delegate.remove(ScriptHost._loadHandler, value); }
ScriptHost.add_unload = function(value) { ScriptHost._unloadHandler = Delegate.combine(ScriptHost._unloadHandler, value); }
ScriptHost.remove_unload = function(value) { ScriptHost._unloadHandler = Delegate.remove(ScriptHost._unloadHandler, value); }
ScriptHost.close = function() { if (ScriptHost._fxScripts) { ScriptHost._fxScripts.dispose(); ScriptHost._fxScripts = null; } if (ScriptHost._coreScripts) { ScriptHost._coreScripts.dispose(); ScriptHost._coreScripts = null; } if (ScriptHost._unloadHandler) { ScriptHost._unloadHandler.invoke(null, EventArgs.Empty); ScriptHost._unloadHandler = null; } if (ScriptHost._windowLoadHandler) { window.detachEvent('onload', ScriptHost._windowLoadHandler); ScriptHost._windowLoadHandler = null; } if (ScriptHost._windowUnloadHandler) { window.detachEvent('onunload', ScriptHost._windowUnloadHandler); ScriptHost._windowUnloadHandler = null; } }
ScriptHost.initialize = function(coreScriptURLs, fxScriptURLs) { if (!ScriptHost._initialized) { ScriptHost._initialized = true; if (ScriptHost._windowLoadHandler) { window.detachEvent('onload', ScriptHost._windowLoadHandler); ScriptHost._windowLoadHandler = null; } if ((coreScriptURLs) && (coreScriptURLs.length)) { ScriptHost._coreScripts = new ScriptLoader(coreScriptURLs); } if ((fxScriptURLs) && (fxScriptURLs.length)) { ScriptHost._fxScripts = new ScriptLoader(fxScriptURLs); } if ((!ScriptHost._coreScripts) && (!ScriptHost._fxScripts)) { ScriptHost._onLoaded(); } else { ScriptHost._loadScripts(); } } }
ScriptHost._loadScripts = function() { ScriptHost._loading = true; if (ScriptHost._coreScripts) { ScriptHost._coreScripts.load(false, 20 * 1000, Delegate.create(null, ScriptHost._onScriptsCompleted), Delegate.create(null, ScriptHost._onScriptsError)); return; } else { ScriptHost._fxScripts.load(true, 20 * 1000, Delegate.create(null, ScriptHost._onScriptsCompleted), Delegate.create(null, ScriptHost._onScriptsError)); } }
ScriptHost._onLoaded = function() { ScriptHost._loaded = true; if (window.main) { window.main(); } if (ScriptHost._loadHandler) { ScriptHost._loadHandler.invoke(null, EventArgs.Empty); ScriptHost._loadHandler = null; } }
ScriptHost._onScriptsCompleted = function(sender, e) { if (sender == ScriptHost._coreScripts) { ScriptHost._coreScripts.dispose(); ScriptHost._coreScripts = null; if (ScriptHost._fxScripts) { ScriptHost._fxScripts.load(true, 20 * 1000, Delegate.create(null, ScriptHost._onScriptsCompleted), Delegate.create(null, ScriptHost._onScriptsError)); return; } } else { ScriptHost._fxScripts.dispose(); ScriptHost._fxScripts = null; } ScriptHost._loading = false; ScriptHost._onLoaded(); }
ScriptHost._onScriptsError = function(sender, e) { }
ScriptHost._onWindowLoad = function() { ScriptHost.initialize(null, null); }
ScriptHost._onWindowUnload = function() { ScriptHost.close(); }
ScriptHost.createClass('ScriptHost'); ScriptHost._coreScripts = null; ScriptHost._fxScripts = null; ScriptHost._loadHandler = null; ScriptHost._unloadHandler = null; ScriptHost._initialized = false; ScriptHost._loading = false; ScriptHost._loaded = false; ScriptHost._windowLoadHandler = Delegate.create(null, ScriptHost._onWindowLoad); ScriptHost._windowUnloadHandler = Delegate.create(null, ScriptHost._onWindowUnload); window.attachEvent('onload', ScriptHost._windowLoadHandler); window.attachEvent('onunload', ScriptHost._windowUnloadHandler);

// ssfx.Core.js
Type.createNamespace('ScriptFX'); ScriptFX.CollectionChangedAction = function() { }; ScriptFX.CollectionChangedAction.prototype = { add: 0, remove: 1, reset: 2 }
ScriptFX.CollectionChangedAction.createEnum('ScriptFX.CollectionChangedAction', false); ScriptFX.$create__Core$1 = function(eventType, sender, eventArgs, eventCookie) { var $o = {}; $o.$1 = eventType; $o.$0 = sender; $o.$2 = eventArgs; $o.$3 = eventCookie; return $o; }
ScriptFX.IEventManager = function() { }; ScriptFX.IEventManager.createInterface('ScriptFX.IEventManager'); ScriptFX.ISupportInitialize = function() { }; ScriptFX.ISupportInitialize.createInterface('ScriptFX.ISupportInitialize'); ScriptFX.INotifyDisposing = function() { }; ScriptFX.INotifyDisposing.createInterface('ScriptFX.INotifyDisposing'); ScriptFX.HostName = function() { }; ScriptFX.HostName.prototype = { other: 0, IE: 1, mozilla: 2, safari: 3, opera: 4 }
ScriptFX.HostName.createEnum('ScriptFX.HostName', false); ScriptFX.INotifyCollectionChanged = function() { }; ScriptFX.INotifyCollectionChanged.createInterface('ScriptFX.INotifyCollectionChanged'); ScriptFX.INotifyPropertyChanged = function() { }; ScriptFX.INotifyPropertyChanged.createInterface('ScriptFX.INotifyPropertyChanged'); ScriptFX.ITask = function() { }; ScriptFX.ITask.createInterface('ScriptFX.ITask'); ScriptFX.IObjectWithOwner = function() { }; ScriptFX.IObjectWithOwner.createInterface('ScriptFX.IObjectWithOwner'); ScriptFX.Application = function() { this.$9 = []; this.$A = 100; ScriptHost.add_load(Delegate.create(this, this.$18)); ScriptHost.add_unload(Delegate.create(this, this.$19)); this.$12 = Delegate.create(this, this.$1C); window.attachEvent('onbeforeunload', this.$12); this.$13 = Delegate.create(this, this.$1B); window.attachEvent('onerror', this.$13); var $0 = document.documentElement; var $1 = $0.className; if ($1.startsWith('$')) { var $2 = this.get_host(); $1 = $1.replace('$browser', Enum.toString(ScriptFX.HostName, $2.get_name())); $1 = $1.replace('$majorver', $2.get_majorVersion().toString()); $1 = $1.replace('$minorver', $2.get_minorVersion().toString()); $0.className = $1; } }
ScriptFX.Application.prototype = { $0: null, $1: 0, $2: null, $3: false, $4: false, $5: false, $6: null, $7: null, $8: null, $9: null, $A: 0, $B: 0, $C: null, $D: 0, $E: null, $F: null, $10: null, $11: null, $12: null, $13: null, $14: null, $15: null, get_domain: function() { return window.document.domain; }, set_domain: function(value) { window.document.domain = value; return value; }, get_$16: function() { if (!this.$8) { this.$8 = new ScriptFX.EventList(); } return this.$8; }, get_history: function() { return this.$7; }, get_host: function() { if (!this.$0) { this.$0 = new ScriptFX.HostInfo(); } return this.$0; }, get_idleFrequency: function() { return this.$A; }, set_idleFrequency: function(value) { this.$A = value; return value; }, get_isFirstLoad: function() { return this.$5; }, get_isIE: function() { if (!this.$1) { this.$1 = (this.get_host().get_name() === 1) ? 1 : -1; } return (this.$1 === 1) ? true : false; }, get_sessionState: function() { return this.$6; }, add_error: function(value) { this.get_$16().addHandler('error', value); }, remove_error: function(value) { this.get_$16().removeHandler('error', value); }, add_idle: function(value) { this.get_$16().addHandler('idle', value); if (!this.$B) { if (!this.$14) { this.$14 = Delegate.create(this, this.$17); } this.$B = window.setTimeout(this.$14, this.$A); } }, remove_idle: function(value) { var $0 = this.get_$16().removeHandler('idle', value); if ((!$0) && (this.$B)) { window.clearTimeout(this.$B); this.$B = 0; } }, add_load: function(value) { if (this.$3) { value.invoke(this, EventArgs.Empty); } else { this.get_$16().addHandler('load', value); } }, remove_load: function(value) { this.get_$16().removeHandler('load', value); }, add_unload: function(value) { this.get_$16().addHandler('unload', value); }, remove_unload: function(value) { this.get_$16().removeHandler('unload', value); }, add_unloading: function(value) { this.get_$16().addHandler('unloading', value); }, remove_unloading: function(value) { this.get_$16().removeHandler('unloading', value); }, addTask: function(task) { if (!this.$C) { this.$C = []; } this.$C.enqueue(task); if (!this.$D) { if (!this.$15) { this.$15 = Delegate.create(this, this.$1A); } this.$D = window.setTimeout(this.$15, 0); } }, enableHistory: function() { if (this.$7) { return; } this.$7 = ScriptFX.HistoryManager.$8(); }, getService: function(serviceType) { if ((serviceType === IServiceContainer) || (serviceType === ScriptFX.IEventManager)) { return this; } if (this.$11) { var $0 = serviceType.get_fullName().replace('.', '$'); return this.$11[$0]; } return null; }, $17: function() { this.$B = 0; var $0 = this.get_$16().getHandler('idle'); if ($0) { $0.invoke(this, EventArgs.Empty); this.$B = window.setTimeout(this.$14, this.$A); } }, $18: function($p0, $p1) { var $0 = $('__session'); if ($0) { var $2 = $0.value; if (String.isNullOrEmpty($2)) { this.$5 = true; this.$6 = {}; } else { this.$6 = ScriptFX.JSON.deserialize($2); if (isUndefined(this.$6['__appLoaded'])) { this.$5 = true; } } this.$6['__appLoaded'] = true; } else { this.$5 = true; } if (this.$2) { for (var $3 = 0; $3 < this.$2.length; $3 += 2) { this.$2[$3].main(this.$2[$3 + 1]); } this.$2 = null; } this.$3 = true; var $1 = this.get_$16().getHandler('load'); if ($1) { $1.invoke(this, EventArgs.Empty); } if (this.$7) { this.$7.$A(); } }, $19: function($p0, $p1) { if (!this.$4) { this.$4 = true; if (this.$D) { window.clearTimeout(this.$D); } if (this.$B) { window.clearTimeout(this.$B); } var $0 = this.get_$16().getHandler('unload'); if ($0) { $0.invoke(this, EventArgs.Empty); } if (this.$C) { while (this.$C.length) { var $1 = this.$C.dequeue(); if (Type.canCast($1, IDisposable)) { ($1).dispose(); } } } if (this.$9.length) { var $enum1 = this.$9.getEnumerator(); while ($enum1.moveNext()) { var $2 = $enum1.get_current(); $2.dispose(); } this.$9.clear(); } if (this.$7) { this.$7.dispose(); this.$7 = null; } window.detachEvent('onbeforeunload', this.$12); window.detachEvent('onerror', this.$13); this.$12 = null; this.$13 = null; this.$15 = null; this.$14 = null; } }, $1A: function() { this.$D = 0; if (this.$C.length) { var $0 = this.$C.dequeue(); if (!$0.execute()) { this.$C.enqueue($0); } else { if (Type.canCast($0, IDisposable)) { ($0).dispose(); } } if (this.$C.length) { this.$D = window.setTimeout(this.$15, 0); } } }, $1B: function() { var $0 = this.get_$16().getHandler('error'); if ($0) { var $1 = new ScriptFX.CancelEventArgs(); $1.set_canceled(true); $0.invoke(this, $1); if ($1.get_canceled()) { window.event.returnValue = false; } } }, $1C: function() { window.event.avoidReturn = true; var $0 = this.get_$16().getHandler('unloading'); if ($0) { var $1 = new ScriptFX.ApplicationUnloadingEventArgs(); $0.invoke(this, $1); } if (this.$6) { var $2 = $('__session'); $2.value = ScriptFX.JSON.serialize(this.$6); } }, raiseEvent: function(eventType, sender, e) { if (this.$E) { var $0 = this.$E[eventType]; if ($0) { $0.invoke(sender, e); } } }, registerDisposableObject: function(disposableObject) { if (!this.$4) { this.$9.add(disposableObject); } }, registerEvent: function(eventType, sender, e) { if (this.$E) { var $1 = this.$E[eventType]; if ($1) { $1.invoke(sender, e); } } if (!this.$10) { this.$10 = []; } if (!this.$F) { this.$F = {}; this.$F[eventType] = 1; } else { var $2 = this.$F[eventType]; if (isUndefined($2)) { this.$F[eventType] = 1; } else { this.$F[eventType] = 1 + $2; } } var $0 = ScriptFX.$create__Core$1(eventType, sender, e, this.$10.length); this.$10.add($0); return $0.$3; }, registerEventHandler: function(eventType, handler) { var $0 = null; if (!this.$E) { this.$E = {}; } else { $0 = this.$E[eventType]; } this.$E[eventType] = Delegate.combine($0, handler); if (!isNullOrUndefined(this.$F[eventType])) { var $enum1 = this.$10.getEnumerator(); while ($enum1.moveNext()) { var $1 = $enum1.get_current(); if (!$1) { continue; } if ($1.$1 === eventType) { handler.invoke($1.$0, $1.$2); } } } }, registerService: function(serviceType, service) { if (!this.$11) { this.$11 = {}; } var $0 = serviceType.get_fullName().replace('.', '$'); this.$11[$0] = service; }, run: function(scriptletType, args) { if (this.$3) { scriptletType.main(args); } else { if (!this.$2) { this.$2 = []; } this.$2.add(scriptletType); this.$2.add(args); } }, unregisterDisposableObject: function(disposableObject) { if (!this.$4) { this.$9.remove(disposableObject); } }, unregisterEvent: function(eventCookie) { var $0 = this.$10[eventCookie]; var $1 = this.$F[$0.$1]; if ($1 === 1) { delete this.$F[$0.$1]; } else { this.$F[$0.$1] = $1 - 1; } this.$10[eventCookie] = null; }, unregisterEventHandler: function(eventType, handler) { if (this.$E) { var $0 = this.$E[eventType]; if ($0) { $0 = Delegate.remove($0, handler); if (!$0) { delete this.$E[eventType]; } else { this.$E[eventType] = $0; } } } }, unregisterService: function(serviceType) { if (this.$11) { var $0 = serviceType.get_fullName().replace('.', '$'); delete this.$11[$0]; } } }
ScriptFX.CancelEventArgs = function() { ScriptFX.CancelEventArgs.constructBase(this); }
ScriptFX.CancelEventArgs.prototype = { $1_0: false, get_canceled: function() { return this.$1_0; }, set_canceled: function(value) { this.$1_0 = value; return value; } }
ScriptFX.CollectionChangedEventArgs = function(action, item) { ScriptFX.CollectionChangedEventArgs.constructBase(this); this.$1_0 = action; this.$1_1 = item; }
ScriptFX.CollectionChangedEventArgs.prototype = { $1_0: 0, $1_1: null, get_action: function() { return this.$1_0; }, get_item: function() { return this.$1_1; } }
ScriptFX.ApplicationUnloadingEventArgs = function() { ScriptFX.ApplicationUnloadingEventArgs.constructBase(this); }
ScriptFX.ApplicationUnloadingEventArgs.prototype = { setUnloadPrompt: function(prompt) { window.event.returnValue = prompt; window.event.avoidReturn = false; } }
ScriptFX.HistoryManager = function(enabled, iframe) { this.$0 = enabled; this.$1 = iframe; }
ScriptFX.HistoryManager.$8 = function() { var $0 = ScriptFX.Application.current.get_host().get_name(); if (($0 !== 1) && ($0 !== 2)) { return new ScriptFX.HistoryManager(false, null); } var $1 = null; if ($0 === 1) { $1 = $('_historyFrame'); } return new ScriptFX.HistoryManager(true, $1); }
ScriptFX.HistoryManager.prototype = { $0: false, $1: null, $2: null, $3: null, $4: false, $5: false, $6: null, get_isEnabled: function() { return this.$0; }, add_navigated: function(value) { this.$7 = Delegate.combine(this.$7, value); }, remove_navigated: function(value) { this.$7 = Delegate.remove(this.$7, value); }, $7: null, addEntry: function(entryName) { if (!this.$0) { return; } this.$4 = true; if (this.$1) { this.$5 = true; this.$1.src = this.$2 + entryName; } else { this.$E(entryName); } }, dispose: function() { if (this.$1) { this.$1.detachEvent('onload', this.$3); this.$1 = null; } }, $9: function() { var $0 = window.location.hash; if (($0.length) && ($0.charAt(0) === '#')) { $0 = $0.substr(1); } return $0; }, goBack: function() { window.history.back(); }, goForward: function() { window.history.forward(); }, $A: function() { if (!this.$0) { return; } ScriptFX.Application.current.add_idle(Delegate.create(this, this.$B)); if (this.$1) { this.$2 = this.$1.src + '?'; this.$3 = Delegate.create(this, this.$C); this.$1.attachEvent('onload', this.$3); } this.$6 = this.$9(); this.$D(this.$6); }, $B: function($p0, $p1) { var $0 = this.$9(); if ($0 !== this.$6) { if (this.$4) { return; } this.$6 = $0; this.$D($0); } else { this.$4 = false; } }, $C: function() { var $0 = this.$1.contentWindow.location.search; if (($0.length) && ($0.charAt(0) === '?')) { $0 = $0.substr(1); } this.$E($0); if (this.$5) { this.$5 = false; return; } this.$D($0); }, $D: function($p0) { if (this.$7) { this.$7.invoke(this, new ScriptFX.HistoryEventArgs($p0)); } }, $E: function($p0) { this.$6 = $p0; window.location.hash = $p0; } }
ScriptFX.HistoryEventArgs = function(entryName) { ScriptFX.HistoryEventArgs.constructBase(this); this.$1_0 = entryName; }
ScriptFX.HistoryEventArgs.prototype = { $1_0: null, get_entryName: function() { return this.$1_0; } }
ScriptFX.HostInfo = function() { var $0 = window.navigator.userAgent.toLowerCase(); var $1 = null; var $2; if (($2 = $0.indexOf('opera')) >= 0) { this.$0 = 4; $1 = $0.substr($2 + 6); } else if (($2 = $0.indexOf('msie')) >= 0) { this.$0 = 1; $1 = $0.substr($2 + 5); } else if (($2 = $0.indexOf('safari')) >= 0) { this.$0 = 3; $1 = $0.substr($2 + 7); } else if (($2 = $0.indexOf('firefox')) >= 0) { this.$0 = 2; $1 = $0.substr($2 + 8); } else if ($0.indexOf('gecko') >= 0) { this.$0 = 2; $1 = window.navigator.appVersion; } if ($1) { this.$1 = parseFloat($1); this.$2 = parseInt(this.$1); if (($2 = $1.indexOf('.')) >= 0) { this.$3 = parseInt($1.substr($2 + 1)); } } }
ScriptFX.HostInfo.prototype = { $0: 0, $1: 0, $2: 0, $3: 0, get_majorVersion: function() { return this.$2; }, get_minorVersion: function() { return this.$3; }, get_name: function() { return this.$0; }, get_version: function() { return this.$1; } }
ScriptFX.EventList = function() { }
ScriptFX.EventList.prototype = { $0: null, addHandler: function(key, handler) { if (!this.$0) { this.$0 = {}; } this.$0[key] = Delegate.combine(this.$0[key], handler); }, getHandler: function(key) { if (this.$0) { return this.$0[key]; } return null; }, removeHandler: function(key, handler) { if (this.$0) { var $0 = this.$0[key]; if ($0) { var $1 = Delegate.remove($0, handler); this.$0[key] = $1; return ($1); } } return false; } }
ScriptFX.JSON = function() { }
ScriptFX.JSON.deserialize = function(s) { if (String.isNullOrEmpty(s)) { return null; } if (!ScriptFX.JSON.$0) { ScriptFX.JSON.$0 = new RegExp('(\'|\")\\\\@(-?[0-9]+)@(\'|\")', 'gm'); } s = s.replace(ScriptFX.JSON.$0, 'new Date($2)'); return eval('(' + s + ')'); }
ScriptFX.JSON.serialize = function(o) { if (isNullOrUndefined(o)) { return String.Empty; } var $0 = new StringBuilder(); ScriptFX.JSON.$1($0, o); return $0.toString(); }
ScriptFX.JSON.$1 = function($p0, $p1) { if (isNullOrUndefined($p1)) { $p0.append('null'); return; } var $0 = typeof ($p1); switch ($0) { case 'boolean': $p0.append($p1.toString()); return; case 'number': $p0.append((isFinite($p1)) ? $p1.toString() : 'null'); return; case 'string': $p0.append(($p1).quote()); return; case 'object': if (Array.isInstance($p1)) { $p0.append('['); var $1 = $p1; var $2 = $1.length; var $3 = true; for (var $4 = 0; $4 < $2; $4++) { if ($3) { $3 = false; } else { $p0.append(','); } ScriptFX.JSON.$1($p0, $1[$4]); } $p0.append(']'); } else if (Date.isInstance($p1)) { var $5 = $p1; var $6 = Date.UTC($5.getUTCFullYear(), $5.getUTCMonth(), $5.getUTCDate(), $5.getUTCHours(), $5.getUTCMinutes(), $5.getUTCSeconds(), $5.getUTCMilliseconds()); $p0.append('\"\\@'); $p0.append($6.toString()); $p0.append('@\"'); } else if (RegExp.isInstance($p1)) { $p0.append($p1.toString()); } else { $p0.append('{'); var $7 = true; var $dict1 = $p1; for (var $key2 in $dict1) { var $8 = { key: $key2, value: $dict1[$key2] }; if (($8.key).startsWith('$') || Function.isInstance($8.value)) { continue; } if ($7) { $7 = false; } else { $p0.append(','); } $p0.append($8.key); $p0.append(':'); ScriptFX.JSON.$1($p0, $8.value); } $p0.append('}'); } return; default: $p0.append('null'); return; } }
ScriptFX.PropertyChangedEventArgs = function(propertyName) { ScriptFX.PropertyChangedEventArgs.constructBase(this); this.$1_0 = propertyName; }
ScriptFX.PropertyChangedEventArgs.prototype = { $1_0: null, get_propertyName: function() { return this.$1_0; } }
ScriptFX.ObservableCollection = function(owner, disposableItems) { this.$0 = owner; this.$1 = []; this.$2 = disposableItems; }
ScriptFX.ObservableCollection.prototype = { $0: null, $1: null, $2: false, $3: null, add_collectionChanged: function(value) { this.$3 = Delegate.combine(this.$3, value); }, remove_collectionChanged: function(value) { this.$3 = Delegate.remove(this.$3, value); }, add: function(item) { (item).setOwner(this.$0); this.$1.add(item); if (this.$3) { this.$3.invoke(this, new ScriptFX.CollectionChangedEventArgs(0, item)); } }, clear: function() { if (this.$1.length) { var $enum1 = this.$1.getEnumerator(); while ($enum1.moveNext()) { var $0 = $enum1.get_current(); $0.setOwner(null); } this.$1.clear(); if (this.$3) { this.$3.invoke(this, new ScriptFX.CollectionChangedEventArgs(2, null)); } } }, contains: function(item) { return this.$1.contains(item); }, dispose: function() { if (this.$2) { var $enum1 = this.$1.getEnumerator(); while ($enum1.moveNext()) { var $0 = $enum1.get_current(); $0.dispose(); } } this.$1 = null; this.$0 = null; this.$3 = null; }, getEnumerator: function() { return this.$1.getEnumerator(); }, getItem: function(index) { return this.$1[index]; }, getItems: function() { return this.$1; }, getLength: function() { return this.$1.length; }, remove: function(item) { if (this.$1.contains(item)) { (item).setOwner(null); this.$1.remove(item); if (this.$3) { this.$3.invoke(this, new ScriptFX.CollectionChangedEventArgs(1, item)); } } } }
Type.createNamespace('ScriptFX.Net'); ScriptFX.Net.HTTPStatusCode = function() { }; ScriptFX.Net.HTTPStatusCode.prototype = { canContinue: 100, switchingProtocols: 101, OK: 200, created: 201, partialContent: 206, accepted: 202, nonAuthoritativeInformation: 203, noContent: 204, resetContent: 205, ambiguous: 300, moved: 301, redirect: 302, redirectMethod: 303, notModified: 304, useProxy: 305, temporaryRedirect: 307, badRequest: 400, methodNotAllowed: 400, unauthorized: 401, paymentRequired: 402, forbidden: 403, notFound: 404, notAcceptable: 406, proxyAuthenticationRequired: 407, requestTimeout: 408, conflict: 409, gone: 410, lengthRequired: 411, preconditionFailed: 412, requestEntityTooLarge: 413, requestUriTooLong: 414, unsupportedMediaType: 415, requestedRangeNotSatisfiable: 416, expectationFailed: 417, internalServerError: 500, notImplemented: 501, badGateway: 502, serviceUnavailable: 503, gatewayTimeout: 504, httpVersionNotSupported: 505 }
ScriptFX.Net.HTTPStatusCode.createEnum('ScriptFX.Net.HTTPStatusCode', false); ScriptFX.Net.HTTPRequestState = function() { }; ScriptFX.Net.HTTPRequestState.prototype = { inactive: 0, inProgress: 1, completed: 2, aborted: 3, timedOut: 4 }
ScriptFX.Net.HTTPRequestState.createEnum('ScriptFX.Net.HTTPRequestState', false); ScriptFX.Net.HTTPVerb = function() { }; ScriptFX.Net.HTTPVerb.prototype = { GET: 0, POST: 1, PUT: 2, DELETE: 3 }
ScriptFX.Net.HTTPVerb.createEnum('ScriptFX.Net.HTTPVerb', false); ScriptFX.Net.IHTTPResponse = function() { }; ScriptFX.Net.IHTTPResponse.createInterface('ScriptFX.Net.IHTTPResponse'); ScriptFX.Net.HTTPRequest = function() { }
ScriptFX.Net.HTTPRequest.createRequest = function(uri, verb) { var $0 = new ScriptFX.Net.HTTPRequest(); if (!uri.startsWith('{')) { $0.$0 = uri; } else { var $1 = ScriptFX.JSON.deserialize(uri); $0.$0 = $1['__uri']; if ($1['__nullParams']) { $0.$6 = $1['__transportType']; } else { $0.$6 = Type.getType($1['__transportType']); delete $1.__uri; delete $1.__transportType; $0.$7 = $1; } } $0.$1 = verb; return $0; }
ScriptFX.Net.HTTPRequest.createURI = function(uri, parameters) { var $0 = new StringBuilder(uri); if (uri.indexOf('?') < 0) { $0.append('?'); } var $1 = 0; var $dict1 = parameters; for (var $key2 in $dict1) { var $2 = { key: $key2, value: $dict1[$key2] }; if ($1) { $0.append('&'); } $0.append($2.key); $0.append('='); $0.append(encodeURIComponent($2.value.toString())); $1++; } return $0.toString(); }
ScriptFX.Net.HTTPRequest.prototype = { $0: null, $1: 0, $2: null, $3: null, $4: null, $5: null, $6: null, $7: null, $8: 0, $9: null, $A: null, $B: 0, $C: null, $D: null, $E: null, get_content: function() { return this.$2; }, set_content: function(value) { this.$2 = value; return value; }, get_hasCredentials: function() { return (!String.isNullOrEmpty(this.$4)); }, get_hasHeaders: function() { return (this.$3); }, get_headers: function() { if (!this.$3) { this.$3 = {}; } return this.$3; }, get_password: function() { return this.$5; }, get_response: function() { return this.$D; }, get_state: function() { return this.$B; }, get_timeout: function() { return this.$8; }, set_timeout: function(value) { this.$8 = value; return value; }, get_timeStamp: function() { return this.$E; }, get_$F: function() { return this.$C; }, get_$10: function() { return this.$7; }, get_transportType: function() { return this.$6; }, get_URI: function() { return this.$0; }, get_userName: function() { return this.$4; }, get_verb: function() { return this.$1; }, abort: function() { if (this.$B === 1) { ScriptFX.Net.HTTPRequestManager.$5(this, false); } }, dispose: function() { if (this.$C) { this.abort(); } }, invoke: function(callback, context) { this.$9 = callback; this.$A = context; ScriptFX.Application.current.registerDisposableObject(this); ScriptFX.Net.HTTPRequestManager.$6(this); }, $11: function() { ScriptFX.Application.current.unregisterDisposableObject(this); if (this.$C) { this.$C.dispose(); this.$C = null; } if (this.$9) { this.$9.invoke(this, this.$A); this.$9 = null; this.$A = null; } }, $12: function() { this.$B = 3; this.$11(); }, $13: function($p0) { this.$C = $p0; this.$B = 1; this.$E = new Date(); }, $14: function($p0) { this.$D = $p0; this.$B = 2; this.$11(); }, $15: function() { this.$B = 4; this.$11(); }, setContentAsForm: function(data) { this.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded'; var $0 = new StringBuilder(); var $1 = true; var $dict1 = data; for (var $key2 in $dict1) { var $2 = { key: $key2, value: $dict1[$key2] }; if (!$1) { $0.append('&'); } $0.append($2.key); $0.append('='); $0.append(encodeURIComponent($2.value.toString())); $1 = false; } this.set_content($0.toString()); }, setContentAsJSON: function(data) { this.get_headers()['Content-Type'] = 'text/json'; this.set_content(ScriptFX.JSON.serialize(data)); }, setCredentials: function(userName, password) { this.$4 = userName; this.$5 = password; } }
ScriptFX.Net.HTTPRequestManager = function() { }
ScriptFX.Net.HTTPRequestManager.add_requestInvoking = function(value) { ScriptFX.Net.HTTPRequestManager.$0 = Delegate.combine(ScriptFX.Net.HTTPRequestManager.$0, value); }
ScriptFX.Net.HTTPRequestManager.remove_requestInvoking = function(value) { ScriptFX.Net.HTTPRequestManager.$0 = Delegate.remove(ScriptFX.Net.HTTPRequestManager.$0, value); }
ScriptFX.Net.HTTPRequestManager.add_requestInvoked = function(value) { ScriptFX.Net.HTTPRequestManager.$1 = Delegate.combine(ScriptFX.Net.HTTPRequestManager.$1, value); }
ScriptFX.Net.HTTPRequestManager.remove_requestInvoked = function(value) { ScriptFX.Net.HTTPRequestManager.$1 = Delegate.remove(ScriptFX.Net.HTTPRequestManager.$1, value); }
ScriptFX.Net.HTTPRequestManager.get_online = function() { return window.navigator.onLine; }
ScriptFX.Net.HTTPRequestManager.get_timeoutInterval = function() { return ScriptFX.Net.HTTPRequestManager.$2; }
ScriptFX.Net.HTTPRequestManager.set_timeoutInterval = function(value) { ScriptFX.Net.HTTPRequestManager.$2 = value; return value; }
ScriptFX.Net.HTTPRequestManager.$5 = function($p0, $p1) { var $0 = $p0.get_$F(); if ($0) { $0.abort(); ScriptFX.Net.HTTPRequestManager.$7($p0, null, $p1); } }
ScriptFX.Net.HTTPRequestManager.abortAll = function() { var $0 = ScriptFX.Net.HTTPRequestManager.$3; ScriptFX.Net.HTTPRequestManager.$3 = []; var $enum1 = $0.getEnumerator(); while ($enum1.moveNext()) { var $1 = $enum1.get_current(); ScriptFX.Net.HTTPRequestManager.$5($1, false); } }
ScriptFX.Net.HTTPRequestManager.$6 = function($p0) { if (ScriptFX.Net.HTTPRequestManager.$0) { var $2 = new ScriptFX.Net.PreHTTPRequestEventArgs($p0); ScriptFX.Net.HTTPRequestManager.$0.invoke(null, $2); if ($2.get_isSuppressed()) { $p0.$14($2.get_response()); return; } } var $0 = $p0.get_transportType(); if (!$0) { $0 = ScriptFX.Net._Core$3; } var $1 = new $0($p0); $p0.$13($1); ScriptFX.Net.HTTPRequestManager.$3.add($p0); $1.invoke(); if (((ScriptFX.Net.HTTPRequestManager.$2) || ($p0.get_timeout())) && (!ScriptFX.Net.HTTPRequestManager.$4)) { ScriptFX.Net.HTTPRequestManager.$4 = Delegate.create(null, ScriptFX.Net.HTTPRequestManager.$8); ScriptFX.Application.current.add_idle(ScriptFX.Net.HTTPRequestManager.$4); } }
ScriptFX.Net.HTTPRequestManager.$7 = function($p0, $p1, $p2) { ScriptFX.Net.HTTPRequestManager.$3.remove($p0); if ($p1) { $p0.$14($p1); } else if ($p2) { $p0.$15(); } else { $p0.$12(); } if (ScriptFX.Net.HTTPRequestManager.$1) { var $0 = new ScriptFX.Net.PostHTTPRequestEventArgs($p0, $p1); ScriptFX.Net.HTTPRequestManager.$1.invoke(null, $0); } if ((!ScriptFX.Net.HTTPRequestManager.$3.length) && (ScriptFX.Net.HTTPRequestManager.$4)) { ScriptFX.Application.current.remove_idle(ScriptFX.Net.HTTPRequestManager.$4); ScriptFX.Net.HTTPRequestManager.$4 = null; } }
ScriptFX.Net.HTTPRequestManager.$8 = function($p0, $p1) { if (!ScriptFX.Net.HTTPRequestManager.$3.length) { return; } var $0 = null; var $1 = (new Date()).getTime(); var $enum1 = ScriptFX.Net.HTTPRequestManager.$3.getEnumerator(); while ($enum1.moveNext()) { var $2 = $enum1.get_current(); var $3 = $2.get_timeStamp().getTime(); var $4 = $2.get_timeout(); if (!$4) { $4 = ScriptFX.Net.HTTPRequestManager.$2; if (!$4) { continue; } } if (($1 - $3) > $4) { if (!$0) { $0 = []; } $0.add($2); } } if ($0) { var $enum2 = $0.getEnumerator(); while ($enum2.moveNext()) { var $5 = $enum2.get_current(); ScriptFX.Net.HTTPRequestManager.$5($5, true); } } }
ScriptFX.Net.HTTPRequestManager.$9 = function($p0, $p1) { ScriptFX.Net.HTTPRequestManager.$7($p0, $p1, false); }
ScriptFX.Net.HTTPTransport = function(request) { this.$0 = request; }
ScriptFX.Net.HTTPTransport.createURI = function(uri, transportType, parameters) { if (!parameters) { return '{__nullParams: true, __uri:\'' + uri + '\', __transportType: ' + transportType.get_fullName() + '}'; } else { parameters['__uri'] = uri; parameters['__transportType'] = transportType.get_fullName(); return ScriptFX.JSON.serialize(parameters); } }
ScriptFX.Net.HTTPTransport.prototype = { $0: null, get_parameters: function() { return this.$0.get_$10(); }, get_request: function() { return this.$0; }, getMethod: function() { return Enum.toString(ScriptFX.Net.HTTPVerb, this.$0.get_verb()); }, onCompleted: function(response) { ScriptFX.Net.HTTPRequestManager.$9(this.$0, response); } }
ScriptFX.Net.PostHTTPRequestEventArgs = function(request, response) { ScriptFX.Net.PostHTTPRequestEventArgs.constructBase(this); this.$1_0 = request; this.$1_1 = response; }
ScriptFX.Net.PostHTTPRequestEventArgs.prototype = { $1_0: null, $1_1: null, get_request: function() { return this.$1_0; }, get_response: function() { return this.$1_1; } }
ScriptFX.Net.PreHTTPRequestEventArgs = function(request) { ScriptFX.Net.PreHTTPRequestEventArgs.constructBase(this); this.$1_0 = request; }
ScriptFX.Net.PreHTTPRequestEventArgs.prototype = { $1_0: null, $1_1: null, $1_2: false, get_isSuppressed: function() { return this.$1_2; }, get_request: function() { return this.$1_0; }, get_response: function() { return this.$1_1; }, suppressRequest: function(response) { this.$1_2 = true; this.$1_1 = response; } }
ScriptFX.Net._Core$2 = function(request, xmlHTTP) { this.$3 = new Date(); this.$0 = request; this.$1 = xmlHTTP; }
ScriptFX.Net._Core$2.prototype = { $0: null, $1: null, $2: null, $3: null, $4: null, $5: null, $6: null, get_contentLength: function() { return this.getText().length; }, get_contentType: function() { return this.$1.getResponseHeader('Content-Type'); }, get_headers: function() { if (!this.$2) { var $0 = this.$1.getAllResponseHeaders(); var $1 = $0.split('\n'); this.$2 = {}; var $enum1 = $1.getEnumerator(); while ($enum1.moveNext()) { var $2 = $enum1.get_current(); var $3 = $2.indexOf(':'); this.$2[$2.substr(0, $3)] = $2.substr($3 + 1).trim(); } } return this.$2; }, get_request: function() { return this.$0; }, get_statusCode: function() { return this.$1.status; }, get_statusText: function() { return this.$1.statusText; }, get_timeStamp: function() { return this.$3; }, getHeader: function($p0) { return this.$1.getResponseHeader($p0); }, getObject: function() { if (!this.$5) { this.$5 = ScriptFX.JSON.deserialize(this.getText()); } return this.$5; }, getText: function() { if (!this.$4) { this.$4 = this.$1.responseText; } return this.$4; }, getXML: function() { if (!this.$6) { var $0 = this.$1.responseXML; if ((!$0) || (!$0.documentElement)) { try { $0 = XMLDocumentParser.parse(this.$1.responseText); if (($0) && ($0.documentElement)) { this.$6 = $0; } } catch ($1) { } } else { this.$6 = $0; if (ScriptFX.Application.current.get_isIE()) { $0.setProperty('SelectionLanguage', 'XPath'); } } } return this.$6; } }
ScriptFX.Net._Core$3 = function(request) { ScriptFX.Net._Core$3.constructBase(this, [request]); }
ScriptFX.Net._Core$3.prototype = { $1: null, abort: function() { if (this.$1) { this.$1.onreadystatechange = Delegate.Null; this.$1.abort(); this.$1 = null; } }, dispose: function() { this.abort(); }, invoke: function() { var $0 = this.get_request(); this.$1 = new XMLHttpRequest(); this.$1.onreadystatechange = Delegate.create(this, this.$2); if (!this.get_request().get_hasCredentials()) { this.$1.open(this.getMethod(), $0.get_URI(), true); } else { this.$1.open(this.getMethod(), $0.get_URI(), true, $0.get_userName(), $0.get_password()); } var $1 = ($0.get_hasHeaders()) ? $0.get_headers() : null; if ($1) { var $dict1 = $1; for (var $key2 in $dict1) { var $3 = { key: $key2, value: $dict1[$key2] }; this.$1.setRequestHeader($3.key, $3.value); } } var $2 = $0.get_content(); if (($2) && ((!$1) || (!$1['Content-Type']))) { this.$1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } this.$1.send($2); }, $2: function() { if (this.$1.readyState === 4) { var $0 = new ScriptFX.Net._Core$2(this.get_request(), this.$1); this.$1.onreadystatechange = Delegate.Null; this.$1 = null; this.onCompleted($0); } } }
Type.createNamespace('ScriptFX.UI'); ScriptFX.UI.AnimationStopState = function() { }; ScriptFX.UI.AnimationStopState.prototype = { complete: 0, abort: 1, revert: 2 }
ScriptFX.UI.AnimationStopState.createEnum('ScriptFX.UI.AnimationStopState', false); ScriptFX.UI.$create_Bounds = function(left, top, width, height) { var $o = {}; $o.left = left; $o.top = top; $o.width = width; $o.height = height; return $o; }
ScriptFX.UI.$create_DragDropData = function(mode, dataType, data) { var $o = {}; $o.mode = mode; $o.dataType = dataType; $o.data = data; return $o; }
ScriptFX.UI.DragMode = function() { }; ScriptFX.UI.DragMode.prototype = { move: 0, copy: 1 }
ScriptFX.UI.DragMode.createEnum('ScriptFX.UI.DragMode', false); ScriptFX.UI.IAction = function() { }; ScriptFX.UI.IAction.createInterface('ScriptFX.UI.IAction'); ScriptFX.UI.IDragDrop = function() { }; ScriptFX.UI.IDragDrop.createInterface('ScriptFX.UI.IDragDrop'); ScriptFX.UI.IDragSource = function() { }; ScriptFX.UI.IDragSource.createInterface('ScriptFX.UI.IDragSource'); ScriptFX.UI.IDropTarget = function() { }; ScriptFX.UI.IDropTarget.createInterface('ScriptFX.UI.IDropTarget'); ScriptFX.UI.IEditableText = function() { }; ScriptFX.UI.IEditableText.createInterface('ScriptFX.UI.IEditableText'); ScriptFX.UI.IStaticText = function() { }; ScriptFX.UI.IStaticText.createInterface('ScriptFX.UI.IStaticText'); ScriptFX.UI.IToggle = function() { }; ScriptFX.UI.IToggle.createInterface('ScriptFX.UI.IToggle'); ScriptFX.UI.IValidator = function() { }; ScriptFX.UI.IValidator.createInterface('ScriptFX.UI.IValidator'); ScriptFX.UI.Key = function() { }; ScriptFX.UI.Key.prototype = { backspace: 8, tab: 9, enter: 13, escape: 27, space: 32, pageUp: 33, pageDown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40, del: 127 }
ScriptFX.UI.Key.createEnum('ScriptFX.UI.Key', false); ScriptFX.UI.$create_Location = function(left, top) { var $o = {}; $o.left = left; $o.top = top; return $o; }
ScriptFX.UI.$create_OverlayOptions = function(cssClass) { var $o = {}; $o.cssClass = cssClass; $o.fadeInOutInterval = 250; $o.opacity = 0.75; return $o; }
ScriptFX.UI.PopupMode = function() { }; ScriptFX.UI.PopupMode.prototype = { center: 0, anchorTopLeft: 1, anchorTopRight: 2, anchorBottomRight: 3, anchorBottomLeft: 4, alignTopLeft: 5, alignTopRight: 6, alignBottomRight: 7, alignBottomLeft: 8 }
ScriptFX.UI.PopupMode.createEnum('ScriptFX.UI.PopupMode', false); ScriptFX.UI.$create_PopupOptions = function(referenceElement, mode) { var $o = {}; $o.referenceElement = referenceElement; $o.mode = mode; $o.id = null; $o.xOffset = 0; $o.yOffset = 0; return $o; }
ScriptFX.UI.$create_Size = function(width, height) { var $o = {}; $o.width = width; $o.height = height; return $o; }
ScriptFX.UI.Animation = function(domElement) { if (!domElement) { domElement = document.documentElement; } this.$0 = domElement; this.$1 = 1; ScriptFX.Application.current.registerDisposableObject(this); }
ScriptFX.UI.Animation.prototype = { $0: null, $1: 0, $2: false, $3: 0, $4: false, $5: false, $6: false, $7: 0, $8: 0, $9: false, add_repeating: function(value) { this.$A = Delegate.combine(this.$A, value); }, remove_repeating: function(value) { this.$A = Delegate.remove(this.$A, value); }, $A: null, add_starting: function(value) { this.$B = Delegate.combine(this.$B, value); }, remove_starting: function(value) { this.$B = Delegate.remove(this.$B, value); }, $B: null, add_stopped: function(value) { this.$C = Delegate.combine(this.$C, value); }, remove_stopped: function(value) { this.$C = Delegate.remove(this.$C, value); }, $C: null, get_autoReverse: function() { return this.$2; }, set_autoReverse: function(value) { this.$2 = value; return value; }, get_completed: function() { return this.$4; }, get_domElement: function() { return this.$0; }, get_isPlaying: function() { return this.$5; }, get_isReversed: function() { return this.$9; }, get_repeatCount: function() { return this.$1; }, set_repeatCount: function(value) { this.$1 = value; return value; }, get_repeatDelay: function() { return this.$3; }, set_repeatDelay: function(value) { this.$3 = value; return value; }, get_repetitions: function() { return this.$7; }, dispose: function() { if (this.$5) { this.stop(1); } if (this.$0) { this.$0 = null; ScriptFX.Application.current.unregisterDisposableObject(this); } }, $D: function($p0) { if (this.$B) { this.$B.invoke(this, EventArgs.Empty); } this.performSetup(); this.$5 = true; this.$7 = 1; this.$9 = $p0; this.playCore(); }, $E: function($p0, $p1) { this.stopCore($p0, $p1); this.$4 = $p0; this.$5 = false; this.performCleanup(); if (this.$C) { this.$C.invoke(this, EventArgs.Empty); } }, $F: function($p0) { if (this.$6) { if ((this.$3) && ((this.$8 + this.$3) > $p0)) { return false; } } var $0 = this.progressCore(this.$6, $p0); this.$6 = false; if ($0 && ((!this.$1) || (this.$1 > this.$7))) { $0 = false; this.$7++; if (this.$A) { var $1 = new ScriptFX.CancelEventArgs(); this.$A.invoke(this, $1); $0 = $1.get_canceled(); } if (!$0) { this.$6 = true; if (this.$2) { this.$9 = !this.$9; } this.$8 = $p0; this.performRepetition(this.$9); } } return $0; }, performCleanup: function() { }, performRepetition: function(reversed) { }, performSetup: function() { }, play: function() { this.$4 = false; ScriptFX.UI.AnimationManager.$4(this); }, stop: function(stopState) { ScriptFX.UI.AnimationManager.$5(this, stopState); } }
ScriptFX.UI.AnimationManager = function() { }
ScriptFX.UI.AnimationManager.get_FPS = function() { return ScriptFX.UI.AnimationManager.$0; }
ScriptFX.UI.AnimationManager.set_FPS = function(value) { ScriptFX.UI.AnimationManager.$0 = value; return value; }
ScriptFX.UI.AnimationManager.$3 = function() { ScriptFX.UI.AnimationManager.$2 = 0; if (!ScriptFX.UI.AnimationManager.$1.length) { return; } var $0 = (new Date()).getTime(); var $1 = ScriptFX.UI.AnimationManager.$1; var $2 = []; ScriptFX.UI.AnimationManager.$1 = null; var $enum1 = $1.getEnumerator(); while ($enum1.moveNext()) { var $3 = $enum1.get_current(); var $4 = $3.$F($0); if ($4) { $3.$E(true, 0); } else { $2.add($3); } } if ($2.length) { ScriptFX.UI.AnimationManager.$1 = $2; if (!ScriptFX.UI.AnimationManager.$2) { ScriptFX.UI.AnimationManager.$2 = window.setTimeout(Delegate.create(null, ScriptFX.UI.AnimationManager.$3), 1000 / ScriptFX.UI.AnimationManager.$0); } } }
ScriptFX.UI.AnimationManager.$4 = function($p0) { if (!ScriptFX.UI.AnimationManager.$1) { ScriptFX.UI.AnimationManager.$1 = []; } ScriptFX.UI.AnimationManager.$1.add($p0); $p0.$D(false); if (!ScriptFX.UI.AnimationManager.$2) { ScriptFX.UI.AnimationManager.$2 = window.setTimeout(Delegate.create(null, ScriptFX.UI.AnimationManager.$3), 1000 / ScriptFX.UI.AnimationManager.$0); } }
ScriptFX.UI.AnimationManager.$5 = function($p0, $p1) { $p0.$E(false, $p1); ScriptFX.UI.AnimationManager.$1.remove($p0); }
ScriptFX.UI.AnimationSequence = function(animations) { ScriptFX.UI.AnimationSequence.constructBase(this, [null]); this.$10 = animations; this.$12 = -1; }
ScriptFX.UI.AnimationSequence.prototype = { $10: null, $11: 0, $12: 0, $13: false, $14: 0, get_successionDelay: function() { return this.$11; }, set_successionDelay: function(value) { this.$11 = value; return value; }, playCore: function() { if (!this.get_isReversed()) { this.$12 = 0; } else { this.$12 = this.$10.length - 1; } this.$10[this.$12].$D(this.get_isReversed()); }, progressCore: function(startRepetition, timeStamp) { if (startRepetition) { if (!this.get_isReversed()) { this.$12 = 0; } else { this.$12 = this.$10.length - 1; } this.$13 = true; } var $0 = this.$10[this.$12]; if (this.$13) { if ((this.$11) && ((this.$14 + this.$11) > timeStamp)) { return false; } this.$13 = false; $0.$D(this.get_isReversed()); } var $1 = $0.$F(timeStamp); if ($1) { $0.$E(true, 0); if (!this.get_isReversed()) { this.$12++; } else { this.$12--; } this.$13 = true; this.$14 = timeStamp; } return $1 && ((this.$12 === this.$10.length) || (this.$12 === -1)); }, stopCore: function(completed, stopState) { if (!completed) { var $0 = this.$10[this.$12]; $0.$E(false, stopState); } } }
ScriptFX.UI.Behavior = function(domElement, id) { ScriptFX.Application.current.registerDisposableObject(this); this.$0 = domElement; this.$1 = id; if (!String.isNullOrEmpty(id)) { if (id === 'control') { var $1 = domElement[id]; if (($1) && (Type.getInstanceType($1) === ScriptFX.UI._Core$4)) { delete domElement.control; ScriptFX.Application.current.unregisterDisposableObject($1); this.$3 = $1.get_$5(); } } domElement[id] = this; } if (id !== 'control') { var $2 = domElement.control; if (!$2) { $2 = new ScriptFX.UI._Core$4(domElement); } } var $0 = domElement._behaviors; if (!$0) { $0 = []; domElement._behaviors = $0; } $0.add(this); }
ScriptFX.UI.Behavior.getBehavior = function(domElement, type) { var $0 = domElement._behaviors; if ($0) { var $enum1 = $0.getEnumerator(); while ($enum1.moveNext()) { var $1 = $enum1.get_current(); if (type.isAssignableFrom(Type.getInstanceType($1))) { return $1; } } } return null; }
ScriptFX.UI.Behavior.getBehaviors = function(domElement, type) {
    var $0 = domElement._behaviors; if (isNullOrUndefined($0) || (!$0.length)) { return null; } if (!type) { return $0.clone(); } return $0.filter(Delegate.create(null, function($p1_0) {
        return type.isAssignableFrom(Type.getInstanceType($p1_0));
    }));
}
ScriptFX.UI.Behavior.getNamedBehavior = function(domElement, id) { return domElement[id]; }
ScriptFX.UI.Behavior.prototype = { $0: null, $1: null, $2: null, $3: null, $4: false, get_domElement: function() { return this.$0; }, get_domEvents: function() { if (!this.$2) { this.$2 = new ScriptFX.UI.DOMEventList(this.$0); } return this.$2; }, get_events: function() { if (!this.$3) { this.$3 = new ScriptFX.EventList(); } return this.$3; }, get_$5: function() { return this.$3; }, get_isDisposed: function() { return (!this.$0); }, get_isInitializing: function() { return this.$4; }, add_propertyChanged: function(value) { this.get_events().addHandler('PropertyChanged', value); }, remove_propertyChanged: function(value) { this.get_events().removeHandler('PropertyChanged', value); }, beginInitialize: function() { this.$4 = true; }, dispose: function() { if (this.$2) { this.$2.dispose(); } if (this.$0) { if (this.$1) { if (ScriptFX.Application.current.get_isIE()) { this.$0.removeAttribute(this.$1); } else { delete this.$0[this.$1]; } } var $0 = this.$0._behaviors; $0.remove(this); this.$0 = null; ScriptFX.Application.current.unregisterDisposableObject(this); } }, endInitialize: function() { this.$4 = false; }, raisePropertyChanged: function(propertyName) { var $0 = this.get_events().getHandler('PropertyChanged'); if ($0) { $0.invoke(this, new ScriptFX.PropertyChangedEventArgs(propertyName)); } } }
ScriptFX.UI.Color = function(red, green, blue) { this.$0 = red; this.$1 = green; this.$2 = blue; }
ScriptFX.UI.Color.format = function(red, green, blue) { return String.format('#{0:X2}{1:X2}{2:X2}', red, green, blue); }
ScriptFX.UI.Color.parse = function(s) { if (String.isNullOrEmpty(s)) { return null; } if ((s.length === 7) && s.startsWith('#')) { var $0 = parseInt(s.substr(1, 2), 16); var $1 = parseInt(s.substr(3, 2), 16); var $2 = parseInt(s.substr(5, 2), 16); return new ScriptFX.UI.Color($0, $1, $2); } else if (s.startsWith('rgb(') && s.endsWith(')')) { var $3 = s.substring(4, s.length - 1).split(','); if ($3.length === 3) { return new ScriptFX.UI.Color(parseInt($3[0].trim()), parseInt($3[1].trim()), parseInt($3[2].trim())); } } return null; }
ScriptFX.UI.Color.prototype = { $0: 0, $1: 0, $2: 0, get_blue: function() { return this.$2; }, get_green: function() { return this.$1; }, get_red: function() { return this.$0; }, toString: function() { return ScriptFX.UI.Color.format(this.$0, this.$1, this.$2); } }
ScriptFX.UI.Control = function(domElement) { ScriptFX.UI.Control.constructBase(this, [domElement, 'control']); }
ScriptFX.UI.Control.getControl = function(domElement) { return ScriptFX.UI.Behavior.getNamedBehavior(domElement, 'control'); }
ScriptFX.UI.Control.prototype = { add_disposing: function(value) { this.get_events().addHandler('disposing', value); }, remove_disposing: function(value) { this.get_events().removeHandler('disposing', value); }, dispose: function() { var $0 = this.get_domElement(); if ($0) { var $1 = this.get_events().getHandler('disposing'); if ($1) { $1.invoke(this, EventArgs.Empty); } var $2 = ScriptFX.UI.Behavior.getBehaviors($0, null); if ($2.length > 1) { var $enum1 = $2.getEnumerator(); while ($enum1.moveNext()) { var $3 = $enum1.get_current(); if ($3 !== this) { $3.dispose(); } } } } ScriptFX.UI.Control.callBase(this, 'dispose'); } }
ScriptFX.UI.DOMEventList = function(element) { this.$0 = element; this.$1 = {}; }
ScriptFX.UI.DOMEventList.prototype = { $0: null, $1: null, attach: function(eventName, handler) { this.$0.attachEvent(eventName, handler); this.$1[eventName] = handler; }, detach: function(eventName) { var $0 = this.$1[eventName]; if ($0) { this.$0.detachEvent(eventName, $0); delete this.$1[eventName]; return true; } return false; }, dispose: function() { if (this.$0) { var $dict1 = this.$1; for (var $key2 in $dict1) { var $0 = { key: $key2, value: $dict1[$key2] }; this.$0.detachEvent($0.key, $0.value); } this.$0 = null; this.$1 = null; } }, isAttached: function(eventName) { return (this.$1[eventName]) ? true : false; } }
ScriptFX.UI.DragDropEventArgs = function(dataObject) { ScriptFX.UI.DragDropEventArgs.constructBase(this); this.$1_0 = dataObject; }
ScriptFX.UI.DragDropEventArgs.prototype = { $1_0: null, get_dataObject: function() { return this.$1_0; } }
ScriptFX.UI.DragDropManager = function() { }
ScriptFX.UI.DragDropManager.get_canDragDrop = function() { return (ScriptFX.UI.DragDropManager.$0); }
ScriptFX.UI.DragDropManager.get_supportsDataTransfer = function() { return ScriptFX.UI.DragDropManager.$0.get_supportsDataTransfer(); }
ScriptFX.UI.DragDropManager.add_dragDropEnding = function(value) { ScriptFX.UI.DragDropManager.$3 = Delegate.combine(ScriptFX.UI.DragDropManager.$3, value); }
ScriptFX.UI.DragDropManager.remove_dragDropEnding = function(value) { ScriptFX.UI.DragDropManager.$3 = Delegate.remove(ScriptFX.UI.DragDropManager.$3, value); }
ScriptFX.UI.DragDropManager.add_dragDropStarting = function(value) { ScriptFX.UI.DragDropManager.$2 = Delegate.combine(ScriptFX.UI.DragDropManager.$2, value); }
ScriptFX.UI.DragDropManager.remove_dragDropStarting = function(value) { ScriptFX.UI.DragDropManager.$2 = Delegate.remove(ScriptFX.UI.DragDropManager.$2, value); }
ScriptFX.UI.DragDropManager.$5 = function() { if (ScriptFX.UI.DragDropManager.$3) { ScriptFX.UI.DragDropManager.$3.invoke(null, new ScriptFX.UI.DragDropEventArgs(ScriptFX.UI.DragDropManager.$4)); } ScriptFX.UI.DragDropManager.$4 = null; }
ScriptFX.UI.DragDropManager.registerDragDropImplementation = function(dragDrop) { ScriptFX.UI.DragDropManager.$0 = dragDrop; }
ScriptFX.UI.DragDropManager.registerDropTarget = function(target) { ScriptFX.UI.DragDropManager.$1.add(target); }
ScriptFX.UI.DragDropManager.startDragDrop = function(data, dragVisual, dragOffset, source, context) { if (ScriptFX.UI.DragDropManager.$4) { return false; } var $0 = []; var $enum1 = ScriptFX.UI.DragDropManager.$1.getEnumerator(); while ($enum1.moveNext()) { var $1 = $enum1.get_current(); if ($1.supportsDataObject(data)) { $0.add($1); } } if (!$0.length) { return false; } ScriptFX.UI.DragDropManager.$4 = data; if (ScriptFX.UI.DragDropManager.$2) { ScriptFX.UI.DragDropManager.$2.invoke(null, new ScriptFX.UI.DragDropEventArgs(data)); } ScriptFX.UI.DragDropManager.$0.dragDrop(new ScriptFX.UI._Core$0(source), context, $0, dragVisual, dragOffset, ScriptFX.UI.DragDropManager.$4); return true; }
ScriptFX.UI.DragDropManager.unregisterDropTarget = function(target) { ScriptFX.UI.DragDropManager.$1.remove(target); }
ScriptFX.UI._Core$0 = function(actualSource) { this.$0 = actualSource; }
ScriptFX.UI._Core$0.prototype = { $0: null, get_domElement: function() { return this.$0.get_domElement(); }, onDragStart: function($p0) { if (this.$0) { this.$0.onDragStart($p0); } }, onDrag: function($p0) { if (this.$0) { this.$0.onDrag($p0); } }, onDragEnd: function($p0, $p1) { if (this.$0) { this.$0.onDragEnd($p0, $p1); } ScriptFX.UI.DragDropManager.$5(); } }
ScriptFX.UI.Element = function() { }
ScriptFX.UI.Element.addCSSClass = function(element, className) { var $0 = element.className; if ($0.indexOf(className) < 0) { element.className = $0 + ' ' + className; } }
ScriptFX.UI.Element.containsCSSClass = function(element, className) { return element.className.split(' ').contains(className); }
ScriptFX.UI.Element.getBounds = function(element) { var $0 = ScriptFX.UI.Element.getLocation(element); return ScriptFX.UI.$create_Bounds($0.left, $0.top, element.offsetWidth, element.offsetHeight); }
ScriptFX.UI.Element.getLocation = function(element) { var $0 = 0; var $1 = 0; for (var $2 = element; $2; $2 = $2.offsetParent) { $0 += $2.offsetLeft; $1 += $2.offsetTop; } return ScriptFX.UI.$create_Location($0, $1); }
ScriptFX.UI.Element.getSize = function(element) { return ScriptFX.UI.$create_Size(element.offsetWidth, element.offsetHeight); }
ScriptFX.UI.Element.removeCSSClass = function(element, className) { var $0 = ' ' + element.className + ' '; var $1 = $0.indexOf(' ' + className + ' '); if ($1 >= 0) { var $2 = $0.substr(0, $1) + ' ' + $0.substr($1 + className.length + 1); element.className = $2; } }
ScriptFX.UI.Element.setLocation = function(element, location) { element.style.left = location.left + 'px'; element.style.top = location.top + 'px'; }
ScriptFX.UI.Element.setSize = function(element, size) { element.style.width = size.width + 'px'; element.style.height = size.height + 'px'; }
ScriptFX.UI.FadeEffect = function(domElement, duration, opacity) { ScriptFX.UI.FadeEffect.constructBase(this, [domElement, duration]); this.$14 = opacity; }
ScriptFX.UI.FadeEffect.prototype = { $13: false, $14: 0, get_isFadingIn: function() { return this.$13; }, fadeIn: function() { if (this.get_isPlaying()) { this.stop(0); } this.$13 = true; this.play(); }, fadeOut: function() { if (this.get_isPlaying()) { this.stop(0); } this.$13 = false; this.play(); }, performCleanup: function() { ScriptFX.UI.FadeEffect.callBase(this, 'performCleanup'); if (!this.$13) { this.$15(0); this.get_domElement().style.display = 'none'; } }, performSetup: function() { ScriptFX.UI.FadeEffect.callBase(this, 'performSetup'); if (this.$13) { this.$15(0); this.get_domElement().style.display = ''; } }, performTweening: function(frame) { if (this.$13) { this.$15(this.$14 * frame); } else { this.$15(this.$14 * (1 - frame)); } }, $15: function($p0) { if (ScriptFX.Application.current.get_isIE()) { this.get_domElement().style.filter = 'alpha(opacity=' + ($p0 * 100) + ')'; } else { this.get_domElement().style.opacity = $p0.toString(); } } }
ScriptFX.UI._Core$4 = function(domElement) { ScriptFX.UI._Core$4.constructBase(this, [domElement]); }
ScriptFX.UI.OverlayBehavior = function(domElement, options) { ScriptFX.UI.OverlayBehavior.constructBase(this, [domElement, options.id]); this.$7 = document.createElement('div'); this.$7.className = options.cssClass; var $0 = this.$7.style; $0.display = 'none'; $0.top = '0px'; $0.left = '0px'; $0.width = '100%'; if (ScriptFX.Application.current.get_isIE() && (ScriptFX.Application.current.get_host().get_majorVersion() < 7)) { $0.position = 'absolute'; } else { this.$8 = true; $0.position = 'fixed'; $0.height = '100%'; } document.body.appendChild(this.$7); if (options.fadeInOutInterval) { this.$9 = new ScriptFX.UI.FadeEffect(this.$7, options.fadeInOutInterval, options.opacity); this.$9.set_easingFunction(Delegate.create(null, ScriptFX.UI.TimedAnimation.easeInOut)); this.$9.add_stopped(Delegate.create(this, this.$C)); } }
ScriptFX.UI.OverlayBehavior.prototype = { $7: null, $8: false, $9: null, $A: null, $B: false, get_isVisible: function() { return this.$B; }, add_visibilityChanged: function(value) { this.get_events().addHandler(ScriptFX.UI.OverlayBehavior.$6, value); }, remove_visibilityChanged: function(value) { this.get_events().removeHandler(ScriptFX.UI.OverlayBehavior.$6, value); }, dispose: function() { if (this.$9) { this.$9.dispose(); this.$9 = null; } if (this.$A) { window.detachEvent('onresize', this.$A); this.$A = null; } ScriptFX.UI.OverlayBehavior.callBase(this, 'dispose'); }, hide: function() { if ((!this.$B) || this.$9.get_isPlaying()) { return; } if (this.$A) { window.detachEvent('onresize', this.$A); this.$A = null; } if (this.$9) { this.$9.fadeOut(); } else { this.$7.style.display = 'none'; this.$B = false; var $0 = this.get_events().getHandler(ScriptFX.UI.OverlayBehavior.$6); if ($0) { $0.invoke(this, EventArgs.Empty); } } }, $C: function($p0, $p1) { this.$B = this.$9.get_isFadingIn(); var $0 = this.get_events().getHandler(ScriptFX.UI.OverlayBehavior.$6); if ($0) { $0.invoke(this, EventArgs.Empty); } }, $D: function() { this.$7.style.height = document.documentElement.offsetHeight + 'px'; }, show: function() { if (this.$B || this.$9.get_isPlaying()) { return; } if (!this.$8) { this.$7.style.height = document.documentElement.offsetHeight + 'px'; this.$A = Delegate.create(this, this.$D); window.attachEvent('onresize', this.$A); } if (this.$9) { this.$9.fadeIn(); } else { this.$7.style.display = ''; this.$B = true; var $0 = this.get_events().getHandler(ScriptFX.UI.OverlayBehavior.$6); if ($0) { $0.invoke(this, EventArgs.Empty); } } } }
ScriptFX.UI.PopupBehavior = function(domElement, options) { ScriptFX.UI.PopupBehavior.constructBase(this, [domElement, options.id]); this.$6 = options; domElement.style.position = 'absolute'; domElement.style.display = 'none'; }
ScriptFX.UI.PopupBehavior.prototype = { $6: null, $7: null, dispose: function() { if (this.get_domElement()) { this.hide(); } ScriptFX.UI.PopupBehavior.callBase(this, 'dispose'); }, hide: function() { this.get_domElement().style.display = 'none'; if (this.$7) { this.$7.parentNode.removeChild(this.$7); this.$7 = null; } }, show: function() { var $0 = this.get_domElement().offsetParent; if (!$0) { $0 = document.documentElement; } this.get_domElement().style.display = 'block'; var $1 = 0; var $2 = 0; var $3 = 1; var $4 = 1; var $5 = false; var $6 = ScriptFX.UI.Element.getBounds($0); var $7 = ScriptFX.UI.Element.getBounds(this.get_domElement()); var $8 = ScriptFX.UI.Element.getBounds(this.$6.referenceElement); var $9 = $8.left - $6.left; var $A = $8.top - $6.top; switch (this.$6.mode) { case 0: $1 = Math.round($8.width / 2 - $7.width / 2); $2 = Math.round($8.height / 2 - $7.height / 2); break; case 1: $1 = 0; $2 = -$7.height; break; case 2: $1 = $8.width - $7.width; $2 = -$7.height; break; case 3: $1 = $8.width - $7.width; $2 = $8.height; break; case 4: $1 = 0; $2 = $8.height; break; case 5: $1 = $8.left; $2 = $8.top; $5 = true; break; case 6: $1 = $8.left + $8.width - $7.width; $2 = $8.top; $3 = -1; $5 = true; break; case 7: $1 = $8.left + $8.width - $7.width; $2 = $8.top + $8.height - $7.height; $3 = -1; $4 = -1; $5 = true; break; case 8: $1 = $8.left; $2 = $8.top + $8.height - $7.height; $4 = -1; $5 = true; break; } if (!$5) { $1 += $9 + this.$6.xOffset; $2 += $A + this.$6.yOffset; } else { $1 += $9 + this.$6.xOffset * $3; $2 += $A + this.$6.yOffset * $4; } var $B = document.body.clientWidth; if ($1 + $7.width > $B - 2) { $1 -= ($1 + $7.width - $B + 2); } if ($1 < 0) { $1 = 2; } if ($2 < 0) { $2 = 2; } ScriptFX.UI.Element.setLocation(this.get_domElement(), ScriptFX.UI.$create_Location($1, $2)); var $C = ScriptFX.Application.current.get_host(); if (($C.get_name() === 1) && ($C.get_majorVersion() < 7)) { this.$7 = document.createElement('IFRAME'); this.$7.src = 'javascript:false;'; this.$7.scrolling = 'no'; this.$7.style.position = 'absolute'; this.$7.style.display = 'block'; this.$7.style.border = 'none'; this.$7.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'; this.$7.style.left = $1 + 'px'; this.$7.style.top = $2 + 'px'; this.$7.style.width = $7.width + 'px'; this.$7.style.height = $7.height + 'px'; this.$7.style.zIndex = 1; this.get_domElement().parentNode.insertBefore(this.$7, this.get_domElement()); } } }
ScriptFX.UI.TimedAnimation = function(domElement, duration) { ScriptFX.UI.TimedAnimation.constructBase(this, [domElement]); this.$10 = duration; }
ScriptFX.UI.TimedAnimation.easeIn = function(t) { return t * t; }
ScriptFX.UI.TimedAnimation.easeInOut = function(t) { t = t * 2; if (t < 1) { return t * t / 2; } return -((--t) * (t - 2) - 1) / 2; }
ScriptFX.UI.TimedAnimation.easeOut = function(t) { return -t * (t - 2); }
ScriptFX.UI.TimedAnimation.prototype = { $10: 0, $11: null, $12: 0, get_duration: function() { return this.$10; }, set_duration: function(value) { this.$10 = value; return value; }, get_easingFunction: function() { return this.$11; }, set_easingFunction: function(value) { this.$11 = value; return value; }, playCore: function() { this.$12 = (new Date()).getTime(); this.progressCore(false, this.$12); }, progressCore: function(startRepetition, timeStamp) { var $0 = 0; var $1 = false; if (!startRepetition) { $0 = (timeStamp - this.$12) / this.$10; if (!this.get_isReversed()) { $1 = ($0 >= 1); $0 = Math.min(1, $0); } else { $0 = 1 - $0; $1 = ($0 <= 0); $0 = Math.max(0, $0); } if ((!$1) && (this.$11)) { $0 = this.$11.invoke($0); } } else { this.$12 = timeStamp; if (this.get_isReversed()) { $0 = 1; } } this.performTweening($0); return $1; }, stopCore: function(completed, stopState) { if (!completed) { if (!stopState) { this.performTweening(1); } else if (stopState === 2) { this.performTweening(0); } } } }
ScriptFX.Application.createClass('ScriptFX.Application', null, IServiceProvider, IServiceContainer, ScriptFX.IEventManager); ScriptFX.CancelEventArgs.createClass('ScriptFX.CancelEventArgs', EventArgs); ScriptFX.CollectionChangedEventArgs.createClass('ScriptFX.CollectionChangedEventArgs', EventArgs); ScriptFX.ApplicationUnloadingEventArgs.createClass('ScriptFX.ApplicationUnloadingEventArgs', EventArgs); ScriptFX.HistoryManager.createClass('ScriptFX.HistoryManager', null, IDisposable); ScriptFX.HistoryEventArgs.createClass('ScriptFX.HistoryEventArgs', EventArgs); ScriptFX.HostInfo.createClass('ScriptFX.HostInfo'); ScriptFX.EventList.createClass('ScriptFX.EventList'); ScriptFX.JSON.createClass('ScriptFX.JSON'); ScriptFX.PropertyChangedEventArgs.createClass('ScriptFX.PropertyChangedEventArgs', EventArgs); ScriptFX.ObservableCollection.createClass('ScriptFX.ObservableCollection', null, IDisposable, IArray, IEnumerable, ScriptFX.INotifyCollectionChanged); ScriptFX.Net.HTTPRequest.createClass('ScriptFX.Net.HTTPRequest', null, IDisposable); ScriptFX.Net.HTTPRequestManager.createClass('ScriptFX.Net.HTTPRequestManager'); ScriptFX.Net.HTTPTransport.createClass('ScriptFX.Net.HTTPTransport', null, IDisposable); ScriptFX.Net.PostHTTPRequestEventArgs.createClass('ScriptFX.Net.PostHTTPRequestEventArgs', EventArgs); ScriptFX.Net.PreHTTPRequestEventArgs.createClass('ScriptFX.Net.PreHTTPRequestEventArgs', EventArgs); ScriptFX.Net._Core$2.createClass('ScriptFX.Net._Core$2', null, ScriptFX.Net.IHTTPResponse); ScriptFX.Net._Core$3.createClass('ScriptFX.Net._Core$3', ScriptFX.Net.HTTPTransport); ScriptFX.UI.Animation.createClass('ScriptFX.UI.Animation', null, IDisposable); ScriptFX.UI.AnimationManager.createClass('ScriptFX.UI.AnimationManager'); ScriptFX.UI.AnimationSequence.createClass('ScriptFX.UI.AnimationSequence', ScriptFX.UI.Animation); ScriptFX.UI.Behavior.createClass('ScriptFX.UI.Behavior', null, IDisposable, ScriptFX.ISupportInitialize, ScriptFX.INotifyPropertyChanged); ScriptFX.UI.Color.createClass('ScriptFX.UI.Color'); ScriptFX.UI.Control.createClass('ScriptFX.UI.Control', ScriptFX.UI.Behavior, ScriptFX.INotifyDisposing); ScriptFX.UI.DOMEventList.createClass('ScriptFX.UI.DOMEventList', null, IDisposable); ScriptFX.UI.DragDropEventArgs.createClass('ScriptFX.UI.DragDropEventArgs', EventArgs); ScriptFX.UI.DragDropManager.createClass('ScriptFX.UI.DragDropManager'); ScriptFX.UI._Core$0.createClass('ScriptFX.UI._Core$0', null, ScriptFX.UI.IDragSource); ScriptFX.UI.Element.createClass('ScriptFX.UI.Element'); ScriptFX.UI.TimedAnimation.createClass('ScriptFX.UI.TimedAnimation', ScriptFX.UI.Animation); ScriptFX.UI.FadeEffect.createClass('ScriptFX.UI.FadeEffect', ScriptFX.UI.TimedAnimation); ScriptFX.UI._Core$4.createClass('ScriptFX.UI._Core$4', ScriptFX.UI.Control); ScriptFX.UI.OverlayBehavior.createClass('ScriptFX.UI.OverlayBehavior', ScriptFX.UI.Behavior); ScriptFX.UI.PopupBehavior.createClass('ScriptFX.UI.PopupBehavior', ScriptFX.UI.Behavior); ScriptFX.Application.current = new ScriptFX.Application(); ScriptFX.JSON.$0 = null; ScriptFX.Net.HTTPRequestManager.$0 = null; ScriptFX.Net.HTTPRequestManager.$1 = null; ScriptFX.Net.HTTPRequestManager.$2 = 0; ScriptFX.Net.HTTPRequestManager.$3 = []; ScriptFX.Net.HTTPRequestManager.$4 = null; ScriptFX.UI.AnimationManager.$0 = 100; ScriptFX.UI.AnimationManager.$1 = null; ScriptFX.UI.AnimationManager.$2 = 0; ScriptFX.UI.DragDropManager.$0 = null; ScriptFX.UI.DragDropManager.$1 = []; ScriptFX.UI.DragDropManager.$2 = null; ScriptFX.UI.DragDropManager.$3 = null; ScriptFX.UI.DragDropManager.$4 = null; ScriptFX.UI.OverlayBehavior.$6 = 'visibilityChanged';

// ssfx.UI.Forms.js
Type.createNamespace('ScriptFX.UI'); ScriptFX.UI.$create_AutoCompleteOptions = function(service) { var $o = {}; $o.service = service; $o.id = null; $o.itemCount = 10; $o.itemLookupDelay = 500; $o.minimumPrefixLength = 3; $o.cssClass = 'autoComplete'; $o.itemCSSClass = 'autoCompleteItem'; $o.selectedItemCSSClass = 'autoCompleteSelectedItem'; $o.xOffset = 0; $o.yOffset = 0; return $o; }
ScriptFX.UI.$create_EnterKeyOptions = function(clickTarget) { var $o = {}; $o.clickTarget = clickTarget; return $o; }
ScriptFX.UI.$create_WatermarkOptions = function(watermarkText, watermarkCssClass) { var $o = {}; $o.watermarkText = watermarkText; $o.watermarkCssClass = watermarkCssClass; return $o; }
ScriptFX.UI.AutoCompleteBehavior = function(domElement, options) { ScriptFX.UI.AutoCompleteBehavior.constructBase(this, [domElement, options.id]); this.$1_0 = options; this.$1_6 = -1; domElement.autocomplete = 'off'; var $0 = this.get_domEvents(); $0.attach('onfocus', Delegate.create(this, this.$1_15)); $0.attach('onblur', Delegate.create(this, this.$1_14)); $0.attach('onkeydown', Delegate.create(this, this.$1_16)); }
ScriptFX.UI.AutoCompleteBehavior.prototype = { $1_0: null, $1_1: null, $1_2: null, $1_3: null, $1_4: null, $1_5: false, $1_6: 0, $1_7: null, $1_8: 0, $1_9: null, $1_A: null, get_arguments: function() { if (!this.$1_1) { this.$1_1 = {}; } return this.$1_1; }, add_itemDisplay: function(value) { this.get_events().addHandler('itemDisplay', value); }, remove_itemDisplay: function(value) { this.get_events().removeHandler('itemDisplay', value); }, add_itemSelected: function(value) { this.get_events().addHandler('itemSelected', value); }, remove_itemSelected: function(value) { this.get_events().removeHandler('itemSelected', value); }, add_requestingItems: function(value) { this.get_events().addHandler('requestingItems', value); }, remove_requestingItems: function(value) { this.get_events().removeHandler('requestingItems', value); }, $1_B: function() { if (this.$1_A) { this.$1_A.abort(); this.$1_A = null; } }, clearCache: function() { this.$1_7 = null; }, $1_C: function() { this.$1_2 = document.createElement('DIV'); if (this.$1_0.cssClass) { this.$1_2.className = this.$1_0.cssClass; } this.$1_2.unselectable = 'unselectable'; document.body.appendChild(this.$1_2); this.$1_4 = new ScriptFX.UI.DOMEventList(this.$1_2); this.$1_4.attach('onmousedown', Delegate.create(this, this.$1_10)); this.$1_4.attach('onmouseup', Delegate.create(this, this.$1_11)); this.$1_4.attach('onmouseover', Delegate.create(this, this.$1_12)); var $0 = ScriptFX.UI.$create_PopupOptions(this.get_domElement(), 4); $0.xOffset = this.$1_0.xOffset; $0.yOffset = -1 + this.$1_0.yOffset; this.$1_3 = new ScriptFX.UI.PopupBehavior(this.$1_2, $0); }, dispose: function() { this.$1_1A(); this.$1_B(); if (this.$1_2) { this.$1_4.dispose(); this.$1_4 = null; this.$1_3.dispose(); this.$1_3 = null; document.body.removeChild(this.$1_2); this.$1_2 = null; this.$1_5 = false; } ScriptFX.UI.AutoCompleteBehavior.callBase(this, 'dispose'); }, $1_D: function($p0) { while (($p0) && ($p0 !== this.$1_2)) { if (!isUndefined($p0.__item)) { return $p0; } $p0 = $p0.parentNode; } return null; }, $1_E: function() { if (this.$1_5) { this.$1_5 = false; this.$1_3.hide(); this.$1_6 = -1; } }, $1_F: function($p0) { if (this.$1_0.selectedItemCSSClass) { ScriptFX.UI.Element.addCSSClass($p0, this.$1_0.selectedItemCSSClass); } }, $1_10: function() { var $0 = this.$1_D(window.event.srcElement); if ($0) { var $1 = $0.__item; var $2 = $0.__index; this.$1_1D($1, $2); } }, $1_11: function() { this.get_domElement().focus(); }, $1_12: function() { var $0 = this.$1_D(window.event.srcElement); if (this.$1_6 !== -1) { this.$1_1B(this.$1_2.childNodes[this.$1_6]); this.$1_6 = -1; } if ($0) { var $1 = $0.__index; if (!isUndefined(this.$1_6)) { this.$1_6 = $1; this.$1_F($0); return; } } }, $1_13: function($p0, $p1) { if (($p0 !== this.$1_A) || ($p0.get_state() !== 2) || ($p0.get_response().get_statusCode() !== 200)) { return; } var $0 = $p1; var $1 = $0['prefix']; var $2 = $1; if (this.get_events().getHandler('requestingItems')) { delete $0.prefix; delete $0.count; $2 += ScriptFX.JSON.serialize($0); } var $3 = $p0.get_response().getObject(); this.$1_1C($1, $3, $2); }, $1_14: function() { this.$1_1A(); this.$1_B(); this.$1_E(); }, $1_15: function() { this.$1_19(); }, $1_16: function() { this.$1_1A(); var $0 = window.event; if (this.$1_5) { switch ($0.keyCode) { case 27: this.$1_E(); $0.returnValue = false; break; case 38: if (this.$1_6 > 0) { this.$1_1B(this.$1_2.childNodes[this.$1_6]); this.$1_6--; this.$1_F(this.$1_2.childNodes[this.$1_6]); } else if (this.$1_6 === -1) { this.$1_6 = this.$1_2.childNodes.length - 1; this.$1_F(this.$1_2.childNodes[this.$1_6]); } $0.returnValue = false; break; case 40: if (this.$1_6 < (this.$1_2.childNodes.length - 1)) { if (this.$1_6 === -1) { this.$1_6 = 0; } else { this.$1_1B(this.$1_2.childNodes[this.$1_6]); this.$1_6++; } this.$1_F(this.$1_2.childNodes[this.$1_6]); } $0.returnValue = false; break; case 13: if (this.$1_6 !== -1) { var $1 = this.$1_2.childNodes[this.$1_6].__item; var $2 = this.$1_2.childNodes[this.$1_6].__index; this.$1_1D($1, $2); } $0.returnValue = false; break; } } if ($0.keyCode !== 9) { this.$1_19(); } }, $1_17: function() { this.$1_8 = 0; this.$1_B(); var $0 = (this.get_domElement()).value; if ($0 === this.$1_9) { return; } if ($0.trim().length < this.$1_0.minimumPrefixLength) { this.$1_1C(null, null, null); return; } this.$1_9 = $0; var $1 = this.get_events().getHandler('requestingItems'); if ($1) { var $3 = new ScriptFX.UI.AutoCompleteRequestEventArgs($0); $1.invoke(this, $3); var $4 = $3.get_$1_2(); if ($4) { this.$1_1C($0, $4, null); return; } } if (this.$1_7) { var $5 = $0; if (this.$1_1) { delete this.$1_1.prefix; delete this.$1_1.count; $5 += ScriptFX.JSON.serialize(this.$1_1); } var $6 = this.$1_7[$5]; if ($6) { this.$1_1C($0, $6, null); return; } } var $2; if (this.$1_1) { $2 = this.$1_1; } else { $2 = {}; } $2['prefix'] = $0; $2['count'] = this.$1_0.itemCount; this.$1_A = ScriptFX.Net.HTTPRequest.createRequest(ScriptFX.Net.HTTPRequest.createURI(this.$1_0.service, $2), 0); this.$1_A.invoke(Delegate.create(this, this.$1_13), $2); }, $1_18: function() { if (!this.$1_5) { this.$1_5 = true; this.$1_2.style.width = (this.get_domElement().offsetWidth - 2) + 'px'; this.$1_3.show(); } }, $1_19: function() { if (!this.$1_8) { this.$1_8 = window.setTimeout(Delegate.create(this, this.$1_17), this.$1_0.itemLookupDelay); } }, $1_1A: function() { if (this.$1_8) { window.clearTimeout(this.$1_8); this.$1_8 = 0; } }, $1_1B: function($p0) { if (this.$1_0.selectedItemCSSClass) { ScriptFX.UI.Element.removeCSSClass($p0, this.$1_0.selectedItemCSSClass); } }, $1_1C: function($p0, $p1, $p2) { var $0 = 0; if ($p1) { $0 = $p1.length; } if (($p2) && ($0)) { if (!this.$1_7) { this.$1_7 = {}; } this.$1_7[$p2] = $p1; } if (!this.$1_2) { this.$1_C(); } this.$1_2.innerHTML = ''; this.$1_6 = -1; if ($0) { for (var $1 = 0; $1 < $0; $1++) { var $2 = document.createElement('DIV'); if (this.$1_0.itemCSSClass) { $2.className = this.$1_0.itemCSSClass; } var $3 = $p1[$1]; var $4 = $3; var $5 = this.get_events().getHandler('itemDisplay'); if ($5) { var $6 = new ScriptFX.UI.AutoCompleteItemEventArgs($3, $1); $5.invoke(this, $6); $4 = $6.get_text(); if (!$4) { $4 = $3; } } $2.innerHTML = $4; $2.__index = $1; $2.__item = $p1[$1]; this.$1_2.appendChild($2); } this.$1_18(); } else { this.$1_E(); } }, $1_1D: function($p0, $p1) { this.$1_1A(); this.$1_E(); var $0 = null; var $1 = this.get_events().getHandler('itemSelected'); if ($1) { var $2 = new ScriptFX.UI.AutoCompleteItemEventArgs($p0, $p1); $1.invoke(this, $2); $0 = $2.get_text(); } if (!$0) { $0 = $p0; } this.$1_9 = $0; (this.get_domElement()).value = $0; } }
ScriptFX.UI.AutoCompleteItemEventArgs = function(item, index) { ScriptFX.UI.AutoCompleteItemEventArgs.constructBase(this); this.$1_0 = item; this.$1_1 = index; }
ScriptFX.UI.AutoCompleteItemEventArgs.prototype = { $1_0: null, $1_1: 0, $1_2: null, get_index: function() { return this.$1_1; }, get_item: function() { return this.$1_0; }, get_text: function() { return this.$1_2; }, set_text: function(value) { this.$1_2 = value; return value; } }
ScriptFX.UI.AutoCompleteRequestEventArgs = function(prefixText) { ScriptFX.UI.AutoCompleteRequestEventArgs.constructBase(this); this.$1_0 = prefixText; }
ScriptFX.UI.AutoCompleteRequestEventArgs.prototype = { $1_0: null, $1_1: null, get_$1_2: function() { return this.$1_1; }, get_prefixText: function() { return this.$1_0; }, setItems: function(items) { this.$1_1 = items; } }
ScriptFX.UI.Button = function(domElement) { ScriptFX.UI.Button.constructBase(this, [domElement]); this.get_domEvents().attach('onclick', Delegate.create(this, this.$2_3)); }
ScriptFX.UI.Button.prototype = { $2_1: null, $2_2: null, get_actionArgument: function() { return this.$2_1; }, set_actionArgument: function(value) { this.$2_1 = value; return value; }, get_actionName: function() { return this.$2_2; }, set_actionName: function(value) { this.$2_2 = value; return value; }, add_action: function(value) { this.get_events().addHandler(ScriptFX.UI.Button.$2_0, value); }, remove_action: function(value) { this.get_events().removeHandler(ScriptFX.UI.Button.$2_0, value); }, add_click: function(value) { this.get_events().addHandler(ScriptFX.UI.Button.$2_0, value); }, remove_click: function(value) { this.get_events().removeHandler(ScriptFX.UI.Button.$2_0, value); }, $2_3: function() { var $0 = this.get_events().getHandler(ScriptFX.UI.Button.$2_0); if ($0) { $0.invoke(this, EventArgs.Empty); } }, performClick: function() { this.$2_3(); } }
ScriptFX.UI.CheckBox = function(domElement) { ScriptFX.UI.CheckBox.constructBase(this, [domElement]); this.get_domEvents().attach('onclick', Delegate.create(this, this.$2_1)); }
ScriptFX.UI.CheckBox.prototype = { get_checked: function() { return (this.get_domElement()).checked; }, set_checked: function(value) { (this.get_domElement()).checked = value; return value; }, add_checkedChanged: function(value) { this.get_events().addHandler(ScriptFX.UI.CheckBox.$2_0, value); }, remove_checkedChanged: function(value) { this.get_events().removeHandler(ScriptFX.UI.CheckBox.$2_0, value); }, $2_1: function() { var $0 = this.get_events().getHandler(ScriptFX.UI.CheckBox.$2_0); if ($0) { $0.invoke(this, EventArgs.Empty); } this.raisePropertyChanged('Checked'); } }
ScriptFX.UI.EnterKeyBehavior = function(element, options) { ScriptFX.UI.EnterKeyBehavior.constructBase(this, [element, null]); this.$1_0 = options.clickTarget; this.get_domEvents().attach('onkeypress', Delegate.create(this, this.$1_1)); }
ScriptFX.UI.EnterKeyBehavior.prototype = { $1_0: null, $1_1: function() { if ((window.event.keyCode === 13) && (!this.$1_0.disabled)) { window.event.cancelBubble = true; window.event.returnValue = false; this.$1_0.click(); } } }
ScriptFX.UI.Label = function(domElement) { ScriptFX.UI.Label.constructBase(this, [domElement]); }
ScriptFX.UI.Label.prototype = { get_text: function() { return this.get_domElement().innerText; }, set_text: function(value) { this.get_domElement().innerText = value; return value; } }
ScriptFX.UI.TextBox = function(domElement) { ScriptFX.UI.TextBox.constructBase(this, [domElement]); this.get_domEvents().attach('onchange', Delegate.create(this, this.$2_1)); }
ScriptFX.UI.TextBox.prototype = { get_text: function() { var $0 = ScriptFX.UI.Behavior.getBehavior(this.get_domElement(), ScriptFX.UI.WatermarkBehavior); if (($0) && $0.get_isWatermarked()) { return String.Empty; } return (this.get_domElement()).value; }, set_text: function(value) { (this.get_domElement()).value = value; this.$2_1(); return value; }, add_textChanged: function(value) { this.get_events().addHandler(ScriptFX.UI.TextBox.$2_0, value); }, remove_textChanged: function(value) { this.get_events().removeHandler(ScriptFX.UI.TextBox.$2_0, value); }, $2_1: function() { var $0 = this.get_events().getHandler(ScriptFX.UI.TextBox.$2_0); if ($0) { $0.invoke(this, EventArgs.Empty); } } }
ScriptFX.UI.WatermarkBehavior = function(element, options) { ScriptFX.UI.WatermarkBehavior.constructBase(this, [element, null]); this.$1_0 = options; this.get_domEvents().attach('onfocus', Delegate.create(this, this.$1_4)); this.get_domEvents().attach('onblur', Delegate.create(this, this.$1_5)); this.update(); }
ScriptFX.UI.WatermarkBehavior.prototype = { $1_0: null, $1_1: 0, get_isWatermarked: function() { return ScriptFX.UI.Element.containsCSSClass(this.get_domElement(), this.$1_0.watermarkCssClass); }, $1_2: function() { var $0 = this.get_domElement(); if (!$0.value.length) { this.$1_1 = $0.maxLength; $0.maxLength = this.$1_0.watermarkText.length; ScriptFX.UI.Element.addCSSClass($0, this.$1_0.watermarkCssClass); $0.value = this.$1_0.watermarkText; } }, $1_3: function($p0) { var $0 = this.get_domElement(); if (ScriptFX.UI.Element.containsCSSClass($0, this.$1_0.watermarkCssClass)) { $0.maxLength = this.$1_1; ScriptFX.UI.Element.removeCSSClass($0, this.$1_0.watermarkCssClass); if ($p0) { $0.value = ''; } } }, dispose: function() { if (!this.get_isDisposed()) { this.$1_3(false); } ScriptFX.UI.WatermarkBehavior.callBase(this, 'dispose'); }, $1_4: function() { this.$1_3(true); }, $1_5: function() { this.$1_2(); }, update: function() { var $0 = this.get_domElement(); if (!$0.value.length) { this.$1_2(); } else { this.$1_3(false); } } }
ScriptFX.UI.AutoCompleteBehavior.createClass('ScriptFX.UI.AutoCompleteBehavior', ScriptFX.UI.Behavior); ScriptFX.UI.AutoCompleteItemEventArgs.createClass('ScriptFX.UI.AutoCompleteItemEventArgs', EventArgs); ScriptFX.UI.AutoCompleteRequestEventArgs.createClass('ScriptFX.UI.AutoCompleteRequestEventArgs', EventArgs); ScriptFX.UI.Button.createClass('ScriptFX.UI.Button', ScriptFX.UI.Control, ScriptFX.UI.IAction); ScriptFX.UI.CheckBox.createClass('ScriptFX.UI.CheckBox', ScriptFX.UI.Control, ScriptFX.UI.IToggle); ScriptFX.UI.EnterKeyBehavior.createClass('ScriptFX.UI.EnterKeyBehavior', ScriptFX.UI.Behavior); ScriptFX.UI.Label.createClass('ScriptFX.UI.Label', ScriptFX.UI.Control, ScriptFX.UI.IStaticText); ScriptFX.UI.TextBox.createClass('ScriptFX.UI.TextBox', ScriptFX.UI.Control, ScriptFX.UI.IEditableText); ScriptFX.UI.WatermarkBehavior.createClass('ScriptFX.UI.WatermarkBehavior', ScriptFX.UI.Behavior); ScriptFX.UI.Button.$2_0 = 'click'; ScriptFX.UI.CheckBox.$2_0 = 'checkChanged'; ScriptFX.UI.TextBox.$2_0 = 'textChanged';
