/* Copyright © 1998, 2012, Oracle and/or its affiliates.  All rights reserved. */
/* Version 11.1.0.0 */

//* <XBuild version="11.1.0-release,trace,browser.all,playback,hint-1"/>
//* <BaseDir path="E:/BUILDROOT_SUN/Builds/Branches/Hacienda/tfs/TargetApps/BrowserAppsBuild/Build/Source/Applications/"/>
//* <FileRef type="source" path="stdhemi/smarthelp/smarthelpsetup.js" time="2012-01-13T11:50:32"/>
//* <FileRef type="reference" path="../Include/Tools/ResourceManager.js" time="2012-01-13T11:50:46"/>
//* <FileRef type="reference" path="../Include/Tools/Base.js" version="1" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="../Include/Tools/Sanity.js" time="2012-01-13T11:50:46"/>
//* <FileRef type="reference" path="../Include/Tools/Fail.js" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="../Include/Tools/Trace.js" time="2012-01-13T11:50:47"/>
//* <FileRef type="reference" path="../Include/Tools/Error.js" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="../Include/Tools/Json.js" time="2012-01-13T11:50:47"/>
//* <FileRef type="reference" path="../Include/Tools/Main.js" time="2012-01-13T11:50:46"/>
//* <FileRef type="reference" path="../Include/Tools/Browser.js" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="../Include/NoTrace.js" time="2012-01-13T11:50:38"/>
//* <FileRef type="reference" path="../Include/Tools/Assert.js" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="../Include/Tools/HashMap.js" version="1" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="../Include/Tools/String.js" time="2012-01-13T11:50:46"/>
//* <FileRef type="reference" path="../Include/Tools/AjaxRequest.js" time="2012-01-13T11:50:44"/>
//* <FileRef type="reference" path="../Include/Tools/UniqueId.js" time="2012-01-13T11:50:46"/>
//* <FileRef type="reference" path="../Include/Tools/Array.js" version="1" time="2012-01-13T11:50:45"/>
//* <FileRef type="reference" path="stdhemi/resources/resources.js" time="2012-01-13T11:50:31"/>
//* <FileRef type="reference" path="../Include/Tools/Resize.js" time="2012-01-13T11:50:46"/>
//* <FileRef type="reference" path="../Include/Gateway/GatewayCookie.js" time="2012-01-13T11:50:41"/>
//* <FileRef type="reference" path="../Include/Tools/Cookie.js" time="2012-01-13T11:50:46"/>


//* <FileBegin path="stdhemi/smarthelp/smarthelpsetup.js"/>
//x /// <reference path="../../../Include/Tools/ResourceManager.js"/>
//x /// <reference path="../resources/resources.js"/>
//x /// <reference path="../../../Include/Tools/Resize.js"/>
//x /// <reference path="../../../Include/Gateway/GatewayCookie.js"/>

//* <FileBegin path="../Include/Tools/ResourceManager.js"/>
//x /// <reference path="Base.js" />
//x /// <reference path="HashMap.js" />
//x /// <reference path="Main.js" />
//x /// <reference path="String.js" />
//x /// <reference path="AjaxRequest.js" />
//x /// <reference path="Array.js" />

//* <FileBegin path="../Include/Tools/Base.js"/>
//x /// <reference path="Sanity.js" />

//* <FileBegin path="../Include/Tools/Sanity.js"/>
//x /// <reference path="Fail.js"/>

//* <FileBegin path="../Include/Tools/Fail.js"/>
//x /// <reference path="Trace.js" xconfig="Trace,Debug"/>
//x /// <reference path="Error.js"/>

//* <FileBegin path="../Include/Tools/Trace.js"/>
//x //: <if xconfig="Debug,Trace"/>
//x /// <reference path="Error.js"/>
//x /// <reference path="Json.js"/>
//x /// <reference path="Browser.js"/>

//* <FileBegin path="../Include/Tools/Error.js"/>
// Don't reference Trace.js in this file

/** @constructor */ // ../Include/Tools/Error.js: 3
function ArgumentError(message) { // ../Include/Tools/Error.js: 4
    this.name = 'ArgumentError'; // ../Include/Tools/Error.js: 5
    this.message = message; // ../Include/Tools/Error.js: 6
    this.toString = function() { return this.message; } // ../Include/Tools/Error.js: 7
} // ../Include/Tools/Error.js: 8

/** @constructor */ // ../Include/Tools/Error.js: 10
function ApplicationError(message) { // ../Include/Tools/Error.js: 11
    this.name = 'ApplicationError'; // ../Include/Tools/Error.js: 12
    this.message = message; // ../Include/Tools/Error.js: 13
    this.toString = function() { return this.message; } // ../Include/Tools/Error.js: 14
} // ../Include/Tools/Error.js: 15

//x //: <if xconfig="Debug,Trace"/>
function GetCallStack(droppedFrames) { // ../Include/Tools/Error.js: 18
    var fn = arguments.callee.caller; // ../Include/Tools/Error.js: 19
    if (droppedFrames) { // ../Include/Tools/Error.js: 20
        while (fn && droppedFrames > 0) { // ../Include/Tools/Error.js: 21
            fn = fn.caller; // ../Include/Tools/Error.js: 22
            --droppedFrames; // ../Include/Tools/Error.js: 23
        } // ../Include/Tools/Error.js: 24
    } // ../Include/Tools/Error.js: 25
    var callStack = []; // ../Include/Tools/Error.js: 26
    while (fn) { // ../Include/Tools/Error.js: 27
        var body = fn.toString(); // ../Include/Tools/Error.js: 28
        var posEndParam = body.indexOf(')'); // ../Include/Tools/Error.js: 29
        var name = body.substr(0, posEndParam + 1); // ../Include/Tools/Error.js: 30
        if (posEndParam != -1) { // ../Include/Tools/Error.js: 31
            var posNewLine = body.indexOf('\n', posEndParam); // ../Include/Tools/Error.js: 32
            if (posNewLine != -1) { // ../Include/Tools/Error.js: 33
                var line = body.substr(posEndParam + 1, posNewLine - posEndParam - 1); // ../Include/Tools/Error.js: 34
                var commentPos = line.indexOf('//'); // ../Include/Tools/Error.js: 35
                if (commentPos != -1) { // ../Include/Tools/Error.js: 36
                    var endPos = line.length - ((line[line.length - 1] == '\r') ? 1 : 0); // ../Include/Tools/Error.js: 37
                    var comment = line.substr(commentPos, endPos - commentPos); // ../Include/Tools/Error.js: 38
                    name += ' ' + comment; // ../Include/Tools/Error.js: 39
                } // ../Include/Tools/Error.js: 40
            } // ../Include/Tools/Error.js: 41
        } // ../Include/Tools/Error.js: 42
        callStack.push(name); // ../Include/Tools/Error.js: 43
        fn = fn.caller; // ../Include/Tools/Error.js: 44
    } // ../Include/Tools/Error.js: 45
    return callStack; // ../Include/Tools/Error.js: 46
} // ../Include/Tools/Error.js: 47
//x //: <end/>

//* <FileEnd path="../Include/Tools/Error.js"/>


//* <FileBegin path="../Include/Tools/Json.js"/>
//x /// <reference path="Main.js"/>
//x /// <reference path="Browser.js"/>

//* <FileBegin path="../Include/Tools/Main.js"/>
//x //: Don't add references in this file!

//x //: <if xconfig="Ignore"/>
//x function TYPEDEF(name_eq_new_TypeName) {
//x     /// <summary>Enable IntelliSense for an arbitrary object: TYPEDEF(name = new TypeName());</summary>
//x }
//x //: <end/>

function NameOf(name) { // ../Include/Tools/Main.js: 9
    return ((name != null) ? '"' + name + '"' : '(null)'); // ../Include/Tools/Main.js: 10
} // ../Include/Tools/Main.js: 11

function TypeOf(value) { // ../Include/Tools/Main.js: 13
    if (value == null) // ../Include/Tools/Main.js: 14
        return ((value === void 0) ? 'undefined' : 'null'); // ../Include/Tools/Main.js: 15
    var type = typeof value; // ../Include/Tools/Main.js: 16
    //Gyuri issue 1
    //See below
    if (IsArray(value)) { // ../Include/Tools/Main.js: 19
        return 'object Array'; // ../Include/Tools/Main.js: 20
    } // ../Include/Tools/Main.js: 21
    if (type != 'object' || value.constructor == null) // ../Include/Tools/Main.js: 22
        return type; // ../Include/Tools/Main.js: 23
    var result = /function\s+([^\(]*)\(/.exec(value.constructor.toString()); // ../Include/Tools/Main.js: 24
    return (type + ((result && result.length > 1 && result[1].length > 0) ? ' ' + result[1] : '')); // ../Include/Tools/Main.js: 25
} // ../Include/Tools/Main.js: 26

function IsNullOrString(obj) { // ../Include/Tools/Main.js: 28
    return ((obj == null) || (typeof obj == 'string') || (obj instanceof String)); // ../Include/Tools/Main.js: 29
} // ../Include/Tools/Main.js: 30

function IsNullOrNumber(obj) { // ../Include/Tools/Main.js: 32
    return ((obj == null) || (typeof obj == 'number') || (obj instanceof Number)); // ../Include/Tools/Main.js: 33
} // ../Include/Tools/Main.js: 34

function IsNullOrBoolean(obj) { // ../Include/Tools/Main.js: 36
    return ((obj == null) || (typeof obj == 'boolean') || (obj instanceof Boolean)); // ../Include/Tools/Main.js: 37
} // ../Include/Tools/Main.js: 38

function IsNullOrRegExp(obj) { // ../Include/Tools/Main.js: 40
    return ((obj == null) || (obj instanceof RegExp)); // ../Include/Tools/Main.js: 41
} // ../Include/Tools/Main.js: 42

function IsNullOrArray(obj) { // ../Include/Tools/Main.js: 44
    return ((obj == null) || IsArray(obj)); // ../Include/Tools/Main.js: 45
} // ../Include/Tools/Main.js: 46

function IsNullOrInstanceOf(obj, type) { // ../Include/Tools/Main.js: 48
    return ((obj == null) || (obj instanceof type)); // ../Include/Tools/Main.js: 49
} // ../Include/Tools/Main.js: 50

function IsUndefined(obj) { // ../Include/Tools/Main.js: 52
    return (typeof (obj) == 'undefined'); // ../Include/Tools/Main.js: 53
} // ../Include/Tools/Main.js: 54

function IsString(obj) { // ../Include/Tools/Main.js: 56
    return ((typeof obj == 'string') || (typeof obj == 'object' && obj.constructor === String)); // ../Include/Tools/Main.js: 57
} // ../Include/Tools/Main.js: 58

function IsNumber(obj) { // ../Include/Tools/Main.js: 60
    return ((typeof obj == 'number') || (typeof obj == 'object' && obj.constructor === Number)); // ../Include/Tools/Main.js: 61
} // ../Include/Tools/Main.js: 62

function IsBoolean(obj) { // ../Include/Tools/Main.js: 64
    return ((typeof obj == 'boolean') || (typeof obj == 'object' && obj.constructor === Boolean)); // ../Include/Tools/Main.js: 65
} // ../Include/Tools/Main.js: 66

//Gyuri issue 1, use other function to determine whether the actual object is an array
//Firefox gives error for an array created in the chrome environment
//Permission denied for <http://www.google.hu> to get property Array.constructor from <>.
/*
function IsArray(obj) {
return (obj != null) && (obj.constructor === Array);
}
*/ // ../Include/Tools/Main.js: 75
function IsArray(obj) { // ../Include/Tools/Main.js: 76
    return (typeof (obj) == 'object' && (obj.join != void 0) && (obj.push != void 0) && (obj.length != void 0)); // ../Include/Tools/Main.js: 77
} // ../Include/Tools/Main.js: 78


function IsFunction(obj) { // ../Include/Tools/Main.js: 81
    return (typeof obj == 'function') || ((obj != null) && (obj.constructor === Function)); // ../Include/Tools/Main.js: 82
} // ../Include/Tools/Main.js: 83

//TODO: Matyi: Ez mifele allat???
//Gyuri: olyanfajta, amit a YUI is használ...
//Matyi: :)
/*
    isObject: function(o) {
return (o && (typeof o === 'object' || L.isFunction(o))) || false;
    },
    isFunction: function(o) {
        return (typeof o === 'function') || Object.prototype.toString.apply(o) === '[object Function]';
    },    
*/     // ../Include/Tools/Main.js: 95

function IsObject(obj) { // ../Include/Tools/Main.js: 97
    return ((typeof (obj) == 'object' || IsFunction(obj)) && obj != null); // ../Include/Tools/Main.js: 98
} // ../Include/Tools/Main.js: 99

function IsInstanceOf(obj, type) { // ../Include/Tools/Main.js: 101
    return (obj instanceof type); // ../Include/Tools/Main.js: 102
} // ../Include/Tools/Main.js: 103

function IsHash(obj) { // ../Include/Tools/Main.js: 105
    return ( // ../Include/Tools/Main.js: 106
        (obj != null) && // ../Include/Tools/Main.js: 107
        (typeof obj == 'object') && // ../Include/Tools/Main.js: 108
        (obj.constructor !== String) && // ../Include/Tools/Main.js: 109
        (obj.constructor !== Number) && // ../Include/Tools/Main.js: 110
        (obj.constructor !== Boolean) && // ../Include/Tools/Main.js: 111
        (obj.constructor !== Array) && // ../Include/Tools/Main.js: 112
        (obj.constructor !== Date) // ../Include/Tools/Main.js: 113
    ); // ../Include/Tools/Main.js: 114
} // ../Include/Tools/Main.js: 115

function IsEmpty(obj) { // ../Include/Tools/Main.js: 117
    return (!obj || !obj.length); // ../Include/Tools/Main.js: 118
} // ../Include/Tools/Main.js: 119

//* <FileEnd path="../Include/Tools/Main.js"/>


//* <FileBegin path="../Include/Tools/Browser.js"/>
//x /// <reference path="Main.js"/>

function IsIE() { // ../Include/Tools/Browser.js: 3
    return (navigator.appName == 'Microsoft Internet Explorer'); // ../Include/Tools/Browser.js: 4
} // ../Include/Tools/Browser.js: 5

function IsFF() { // ../Include/Tools/Browser.js: 7
    return (navigator.appName == 'Netscape'); // ../Include/Tools/Browser.js: 8
} // ../Include/Tools/Browser.js: 9

//calling execScript once on a window object causes the eval method magically to reappear, if it was disappeared before
function ForceEval(obj) { // ../Include/Tools/Browser.js: 12
    if (IsIE()) { // ../Include/Tools/Browser.js: 13
        if (IsObject(obj) && IsFunction(obj.eval)) { // ../Include/Tools/Browser.js: 14
            if (IsObject(obj.execScript)) { // ../Include/Tools/Browser.js: 15
                obj.execScript('null'); // ../Include/Tools/Browser.js: 16
            } // ../Include/Tools/Browser.js: 17
        } // ../Include/Tools/Browser.js: 18
    } // ../Include/Tools/Browser.js: 19
} // ../Include/Tools/Browser.js: 20

//x //: <if xconfig="Browser.IE*,Browser.All"/>

function IE_ConvertVBArrayToArray(obj) { // ../Include/Tools/Browser.js: 24
    return ((obj == null)? null: obj['toArray']()); // ../Include/Tools/Browser.js: 25
} // ../Include/Tools/Browser.js: 26

//x //: <end/>

var _BrowserType = { // ../Include/Tools/Browser.js: 30
    NotDetected: -1, // ../Include/Tools/Browser.js: 31
    MicrosoftInternetExplorer: 0, // ../Include/Tools/Browser.js: 32
    MozillaFirefox: 1, // ../Include/Tools/Browser.js: 33
    GoogleChrome: 2 // ../Include/Tools/Browser.js: 34
}; // ../Include/Tools/Browser.js: 35

var _Browser = { // ../Include/Tools/Browser.js: 37
    Type: _BrowserType.NotDetected, // ../Include/Tools/Browser.js: 38
    Version: void 0, // ../Include/Tools/Browser.js: 39
    IE: void 0, // ../Include/Tools/Browser.js: 40
    FF: void 0, // ../Include/Tools/Browser.js: 41
    CR: void 0, // ../Include/Tools/Browser.js: 42
    GetVersionFn: [ // ../Include/Tools/Browser.js: 43
        function() { // ../Include/Tools/Browser.js: 44
            var agent = navigator.userAgent; // ../Include/Tools/Browser.js: 45
            var tokenBegin = agent.indexOf('MSIE '); // ../Include/Tools/Browser.js: 46
            if (tokenBegin != -1) { // ../Include/Tools/Browser.js: 47
                tokenBegin += 5; // ../Include/Tools/Browser.js: 48
                var tokenEnd = agent.indexOf(';', tokenBegin); // ../Include/Tools/Browser.js: 49
                if (tokenEnd != -1) // ../Include/Tools/Browser.js: 50
                    return Number(agent.substr(tokenBegin, tokenEnd - tokenBegin)); // ../Include/Tools/Browser.js: 51
            } // ../Include/Tools/Browser.js: 52
            return -1; // ../Include/Tools/Browser.js: 53
        }, // ../Include/Tools/Browser.js: 54
        null, // ../Include/Tools/Browser.js: 55
        null // ../Include/Tools/Browser.js: 56
    ] // ../Include/Tools/Browser.js: 57
}; // ../Include/Tools/Browser.js: 58

var Browser = { // ../Include/Tools/Browser.js: 60
    IsIE: function() { // ../Include/Tools/Browser.js: 61
        if (_Browser.IE !== void 0) // ../Include/Tools/Browser.js: 62
            return _Browser.IE; // ../Include/Tools/Browser.js: 63
        if (!!(_Browser.IE = (navigator.userAgent.indexOf('MSIE ') != -1))) { // ../Include/Tools/Browser.js: 64
            _Browser.Type = _BrowserType.MicrosoftInternetExplorer; // ../Include/Tools/Browser.js: 65
            return true; // ../Include/Tools/Browser.js: 66
        } // ../Include/Tools/Browser.js: 67
        return false; // ../Include/Tools/Browser.js: 68
    }, // ../Include/Tools/Browser.js: 69
    IsFF: function() { // ../Include/Tools/Browser.js: 70
        if (_Browser.FF !== void 0) // ../Include/Tools/Browser.js: 71
            return _Browser.FF; // ../Include/Tools/Browser.js: 72
        if (!!(_Browser.FF = (navigator.userAgent.indexOf('Firefox') != -1))) { // ../Include/Tools/Browser.js: 73
            _Browser.Type = _BrowserType.MozillaFirefox; // ../Include/Tools/Browser.js: 74
            return true; // ../Include/Tools/Browser.js: 75
        } // ../Include/Tools/Browser.js: 76
    }, // ../Include/Tools/Browser.js: 77
    //IsCR: function() { },
    GetVersion: function() { // ../Include/Tools/Browser.js: 79
        if (_Browser.Version !== void 0) // ../Include/Tools/Browser.js: 80
            return _Browser.Version; // ../Include/Tools/Browser.js: 81
        var getVersionFn = _Browser.GetVersionFn[_Browser.Type]; // ../Include/Tools/Browser.js: 82
        var version = ((getVersionFn && getVersionFn()) || -1); // ../Include/Tools/Browser.js: 83
        _Browser.Version = version; // ../Include/Tools/Browser.js: 84
        return version; // ../Include/Tools/Browser.js: 85
    } // ../Include/Tools/Browser.js: 86
}; // ../Include/Tools/Browser.js: 87


//* <FileEnd path="../Include/Tools/Browser.js"/>


// Author: Csaba Márton <csaba.marton@oracle.com>
// Version: 0.9.0
// 
// Supported browsers: IE 7+, Firefox 1.5+, Chrome 4+.
// Other browsers were not tested.
//
// Documentation: http://image.hu.oracle.com/matyi/js-encoding/
//
// JSON
// ====
//
// The JSON decoder is RFC 4627 compliant and passes JSON.org's
// JSON checker test suite: http://www.json.org/JSON_checker/test.zip
//
// The JSON encoder is RFC 4627 and ECMA-262 compliant with the 
// modification that Json.EncodeObject will not throw TypeError if 
// it contains a cyclic reference; it will return undefined instead. 
// Json.DecodeObject will also return undefined if an error occurs.
//
//   RFC 4627: The application/json Media Type for JavaScript Object Notation 
//   http://www.ietf.org/rfc/rfc4627.txt
//
//   ECMA-262: ECMAScript Language Specification, 5th Edition, December 2009
//   http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf
//

// IMPORTANT NOTE: Because PRIMAP6 implemented non-standard toJSON functions the 
// toJSON function function call was removed from this implementation. For this 
// reason the native implementation will be always tested to be valid.

var _Json = { // ../Include/Tools/Json.js: 34
    Indent: '  ' // ../Include/Tools/Json.js: 35
}; // ../Include/Tools/Json.js: 36

var Json = { // ../Include/Tools/Json.js: 38
    EncodeObject: function(obj, indent) { // ../Include/Tools/Json.js: 39
        try { return JSON.stringify(obj, null, (indent ? _Json.Indent : null)); } // ../Include/Tools/Json.js: 40
        catch (xe) { if (typeof TypeError == 'undefined' || !xe || xe.constructor !== TypeError) throw xe; } // ../Include/Tools/Json.js: 41
    }, // ../Include/Tools/Json.js: 42
    DecodeObject: function(str) { // ../Include/Tools/Json.js: 43
        if (str != null) // ../Include/Tools/Json.js: 44
            try { return JSON.parse(str); } catch (xe) { } // ../Include/Tools/Json.js: 45
    } // ../Include/Tools/Json.js: 46
}; // ../Include/Tools/Json.js: 47

function _Json_Emulate() { // ../Include/Tools/Json.js: 49
    var xt = /[^",:\{\}\[\] \t\r\n]|"""|"[ \t\r\n]+"]|[\}\]][ \t\r\n]*[:\{\[]|[\{\[][ \t\r\n]*[,:]|[,:][ \t\r\n]*[,:\}\]]/; // compliance test
    var xn = /"(?:[^"\\\x00-\x1F]|\\["\\\/bnfrt]|\\u[0-9a-fA-F]{4})*"|null|true|false|-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+\-]?[0-9]+)?/g; // tokens regexp
    var innerException = new Error(''); // ../Include/Tools/Json.js: 52
    function _u(n) { // ../Include/Tools/Json.js: 53
        var c = n.toString(16); // ../Include/Tools/Json.js: 54
        switch (c.length) { // ../Include/Tools/Json.js: 55
            case 1: return '\\u000' + c; // ../Include/Tools/Json.js: 56
            case 2: return '\\u00' + c; // ../Include/Tools/Json.js: 57
            case 3: return '\\u0' + c; // ../Include/Tools/Json.js: 58
            case 4: return '\\u' + c; // ../Include/Tools/Json.js: 59
        } // ../Include/Tools/Json.js: 60
        return '?'; // ../Include/Tools/Json.js: 61
    } // ../Include/Tools/Json.js: 62
    var _f = IsFunction; // ../Include/Tools/Json.js: 63
    var _c; // contains(array, item) or cyclic
    var _i; // indexOf(array, item)
    (function() { // ../Include/Tools/Json.js: 66
        try { // ../Include/Tools/Json.js: 67
            if (typeof [].indexOf == 'function' && [1, 2, 3, 4].indexOf(3) == 2) { // ../Include/Tools/Json.js: 68
                _c = function(a, o) { return (a.indexOf(o) != -1); }; // ../Include/Tools/Json.js: 69
                _i = function(a, o) { return a.indexOf(o); }; // ../Include/Tools/Json.js: 70
                return; // ../Include/Tools/Json.js: 71
            } // ../Include/Tools/Json.js: 72
        } // ../Include/Tools/Json.js: 73
        catch (ex) { }; // ../Include/Tools/Json.js: 74
        _c = function(a, o) { for (var i = 0, n = a.length; i < n; ++i) { if (a[i] === o) return true; } return false; }; // ../Include/Tools/Json.js: 75
        _i = function(a, o) { for (var i = 0, n = a.length; i < n; ++i) { if (a[i] === o) return i; } return -1; }; // ../Include/Tools/Json.js: 76
    })(); // ../Include/Tools/Json.js: 77
    var ae = '????????btn?fr??????????????????'; // 0x00..0x1F escape abreviation
    function _q(o) { // quote_string(input)
        return ('"' + String(o) // ../Include/Tools/Json.js: 80
              .replace(/(["\\])/g, "\\$1") // ../Include/Tools/Json.js: 81
              .replace(/([\x00-\x1F])/g, function(c) { // ../Include/Tools/Json.js: 82
                  var n = c.charCodeAt(0); // ../Include/Tools/Json.js: 83
                  var x = ae.charAt(n); // ../Include/Tools/Json.js: 84
                  return (x == '?' ? _u(n) : '\\' + x); // ../Include/Tools/Json.js: 85
              }) + '"'); // ../Include/Tools/Json.js: 86
    } // ../Include/Tools/Json.js: 87
    function _2(v) { // pad_to_2_digits(value) - pad decimals less than 9 with one zero. the input is guaranteed to be positive or zero
        return ((v < 10) ? '0' + v : v); // ../Include/Tools/Json.js: 89
    } // ../Include/Tools/Json.js: 90
    function _s(o, c, k) { // stringify(object, stack, key)
        // object is not undefined, null or function
        var t = typeof o; // ../Include/Tools/Json.js: 93
        // Matyi: The following lines were removed from standard implementation because PRIMAP6 implemented non-standard toJSON functions
        // if (t == 'object' && _f(o.toJSON)) {
        //     o = o.toJSON(k);
        //     t = typeof o;
        // }
        if (t != 'object') { // ../Include/Tools/Json.js: 99
            if (t == 'string') return _q(o); // ../Include/Tools/Json.js: 100
            if (t == 'number') return (isFinite(o) ? String(o) : 'null'); // ../Include/Tools/Json.js: 101
            if (t == 'boolean') return (o ? 'true' : 'false'); // ../Include/Tools/Json.js: 102
            return; // ../Include/Tools/Json.js: 103
        } // ../Include/Tools/Json.js: 104
        if (o === null) return 'null'; // ../Include/Tools/Json.js: 105
        if (o.constructor === String) return _q(o); // ../Include/Tools/Json.js: 106
        if (o.constructor === Number) return (isFinite(o) ? String(o) : 'null'); // ../Include/Tools/Json.js: 107
        if (o.constructor === Boolean) return (o ? 'true' : 'false'); // ../Include/Tools/Json.js: 108
        if (o.constructor === Date) return ''.concat(o.getUTCFullYear(), '-', _2(o.getUTCMonth()), '-', _2(o.getUTCDate()), 'T', _2(o.getUTCHours()), ':', _2(o.getUTCMinutes()), ':', _2(o.getUTCSeconds()), 'Z'); // ../Include/Tools/Json.js: 109
        if (o.constructor === Function) return; // ../Include/Tools/Json.js: 110
        if (_c(c, o)) throw innerException; // ensure no circular references
        var a = []; // ../Include/Tools/Json.js: 112
        c.push(o); // ../Include/Tools/Json.js: 113
        if (o.constructor === Array) { // ../Include/Tools/Json.js: 114
            for (var i = 0, n = o.length; i < n; ++i) { // ../Include/Tools/Json.js: 115
                var v1 = o[i]; // ../Include/Tools/Json.js: 116
                if (v1 == null || _f(v1)) // ../Include/Tools/Json.js: 117
                    a.push('null'); // ../Include/Tools/Json.js: 118
                else a.push(_s(v1, c, String(i))); // ../Include/Tools/Json.js: 119
            } // ../Include/Tools/Json.js: 120
            c.pop(); // ../Include/Tools/Json.js: 121
            return ('[' + a.join() + ']'); // ../Include/Tools/Json.js: 122
        } // ../Include/Tools/Json.js: 123
        for (var m in o) { // ../Include/Tools/Json.js: 124
            var v2 = o[m]; // ../Include/Tools/Json.js: 125
            if (v2 == null || _f(v2)) { // ../Include/Tools/Json.js: 126
                if (v2 === null) // ../Include/Tools/Json.js: 127
                    a.push(_q(m) + ':null'); // ../Include/Tools/Json.js: 128
            } // ../Include/Tools/Json.js: 129
            else if ((v2 = _s(v2, c, m)) != null) // ../Include/Tools/Json.js: 130
                a.push(_q(m) + ':' + v2); // ../Include/Tools/Json.js: 131
        } // ../Include/Tools/Json.js: 132
        c.pop(); // ../Include/Tools/Json.js: 133
        return ('{' + a.join() + '}'); // ../Include/Tools/Json.js: 134
    } // ../Include/Tools/Json.js: 135
    Json.EncodeObject = function(o) { // ../Include/Tools/Json.js: 136
        if (o == null || _f(o)) { // ../Include/Tools/Json.js: 137
            if (o === null) // ../Include/Tools/Json.js: 138
                return 'null'; // ../Include/Tools/Json.js: 139
            return; // ../Include/Tools/Json.js: 140
        } // ../Include/Tools/Json.js: 141
        try { return _s(o, [], ''); } catch (ex) { if (ex !== innerException) throw ex; }; // ../Include/Tools/Json.js: 142
    }; // ../Include/Tools/Json.js: 143
    Json.DecodeObject = function(s) { // ../Include/Tools/Json.js: 144
        try { // ../Include/Tools/Json.js: 145
            if ((s != null) && !xt.test(s.replace(xn, '""'))) // ../Include/Tools/Json.js: 146
                return eval('(' + s + ')'); // ../Include/Tools/Json.js: 147
        } // ../Include/Tools/Json.js: 148
        catch (ex) { } // ../Include/Tools/Json.js: 149
    }; // ../Include/Tools/Json.js: 150
} // ../Include/Tools/Json.js: 151

function _Json_CheckImplementation() { // ../Include/Tools/Json.js: 153
    if ((typeof (window['JSON']) != 'undefined') && (typeof (JSON.stringify && JSON.parse) != 'undefined')) { // ../Include/Tools/Json.js: 154
        try { // ../Include/Tools/Json.js: 155
            var xo = { a: "", b: 0.1, c: null, d: true, e: false, f: new Array([new Object(), { g: function() { return 1; }, h: 1 }, new Function("return 0;"), function() { return 1; }, 1]) }; // ../Include/Tools/Json.js: 156
            var xs = '{"a":"","b":0.1,"c":null,"d":true,"e":false,"f":[[{},{"h":1},null,null,1]]}'; // ../Include/Tools/Json.js: 157
            var sxo = JSON.stringify(xo); // ../Include/Tools/Json.js: 158
            if ((sxo == xs) && (sxo == JSON.stringify(JSON.parse(xs))) && (/2345-12-23T12:34:56(?:\.789[0]*)?Z/.test(JSON.stringify(new Date(Date.UTC(2345, 11, 23, 12, 34, 56, 789)))))) { // ../Include/Tools/Json.js: 159
                return; // ../Include/Tools/Json.js: 160
            } // ../Include/Tools/Json.js: 161
        } // ../Include/Tools/Json.js: 162
        catch (ex) { } // ../Include/Tools/Json.js: 163
    } // ../Include/Tools/Json.js: 164
    _Json_Emulate(); // ../Include/Tools/Json.js: 165
} // ../Include/Tools/Json.js: 166

_Json_CheckImplementation(); // ../Include/Tools/Json.js: 168

//* <FileEnd path="../Include/Tools/Json.js"/>


var _Trace = { // ../Include/Tools/Trace.js: 6
    _Filters: [], // ../Include/Tools/Trace.js: 7
    _Enabled: null, // ../Include/Tools/Trace.js: 8
    _SourceLines: [], // ../Include/Tools/Trace.js: 9
    _SourceOffset: 0, // ../Include/Tools/Trace.js: 10
    _LastEnabled: true, // ../Include/Tools/Trace.js: 11
    _Output: 'console', // ../Include/Tools/Trace.js: 12
    _TestGroup: function (group) { // ../Include/Tools/Trace.js: 13
        var filters = _Trace._Filters; // ../Include/Tools/Trace.js: 14
        var result = !filters.length; // ../Include/Tools/Trace.js: 15
        for (var i = 0, n = filters.length; i < n; ++i) { // ../Include/Tools/Trace.js: 16
            if (filters[i][0].test(group)) // ../Include/Tools/Trace.js: 17
                result = filters[i][1]; // ../Include/Tools/Trace.js: 18
        } // ../Include/Tools/Trace.js: 19
        return result; // ../Include/Tools/Trace.js: 20
    }, // ../Include/Tools/Trace.js: 21
    _CreateRegExp: function (filter) { // ../Include/Tools/Trace.js: 22
        if (filter == null) // ../Include/Tools/Trace.js: 23
            return new RegExp('.?'); // ../Include/Tools/Trace.js: 24
        if (!/^[\w\-\.\*,]*$/.test(filter)) // ../Include/Tools/Trace.js: 25
            throw new ArgumentError('Trace: Invalid filter "' + filter + '". Valid characters: [A-Za-z0-9_\-\.,].'); // ../Include/Tools/Trace.js: 26
        return new RegExp('^(?:.*,)?(?:' + filter.replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/,/g, '|') + ')(?:\\.[^,]*)?(,?:.*)?$'); // ../Include/Tools/Trace.js: 27
    }, // ../Include/Tools/Trace.js: 28
    _CreateMessage: function (group, message) { // ../Include/Tools/Trace.js: 29
        return ('[' + (group || '*') + ']' + ((message == void 0) ? '' : ': ' + message)); // ../Include/Tools/Trace.js: 30
    }, // ../Include/Tools/Trace.js: 31
    _GetConsole: function () { // ../Include/Tools/Trace.js: 32
        var console = window['console'] || null; // ../Include/Tools/Trace.js: 33
        if (console) { // ../Include/Tools/Trace.js: 34
            if (typeof window['content'] != 'object') { // ../Include/Tools/Trace.js: 35
                return console; // ../Include/Tools/Trace.js: 36
            } // ../Include/Tools/Trace.js: 37
        } // ../Include/Tools/Trace.js: 38
//x         //: <if xconfig="SmartHelp"/>
//x         //: <if xconfig="Browser.FF*"/>
//x         try {
//x             if (typeof window['content'] == 'object' &&
//x             typeof window['content']['wrappedJSObject'] == 'object')
//x                 console = window['content']['wrappedJSObject']['console'] || null;
//x         }
//x         catch (xe) { }
//x         //: <end/>
//x         //: <end/>
        return console; // ../Include/Tools/Trace.js: 49
    }, // ../Include/Tools/Trace.js: 50
    Output: function (output) { // ../Include/Tools/Trace.js: 51
        _Trace._Output = output; // ../Include/Tools/Trace.js: 52
    }, // ../Include/Tools/Trace.js: 53
    Log: function (group, message) { // ../Include/Tools/Trace.js: 54
        var enabled = _Trace.TestGroup(group); // ../Include/Tools/Trace.js: 55
        if (enabled || _Trace._LastEnabled) { // ../Include/Tools/Trace.js: 56
            _Trace._LastEnabled = enabled; // ../Include/Tools/Trace.js: 57
            if (_Trace._Output == 'console') { // ../Include/Tools/Trace.js: 58
                var console = _Trace._GetConsole(); // ../Include/Tools/Trace.js: 59
                if (console && console['log']) // ../Include/Tools/Trace.js: 60
                    console['log'](enabled ? _Trace._CreateMessage(group, message) : '... NoTrace ...'); // ../Include/Tools/Trace.js: 61
            } // ../Include/Tools/Trace.js: 62
            else if (_Trace._Output == 'viewer') { // ../Include/Tools/Trace.js: 63
                var _group = 'HTML'; // ../Include/Tools/Trace.js: 64
                var _message = (group || '*') + ' : ' + ((message == void 0) ? '' : message); // ../Include/Tools/Trace.js: 65
                if (IsIE()) { // ../Include/Tools/Trace.js: 66
                    try { // ../Include/Tools/Trace.js: 67
                        var viewer = new ActiveXObject('ODTraceCom.ODTrace'); // ../Include/Tools/Trace.js: 68
                        if (viewer) { // ../Include/Tools/Trace.js: 69
                            viewer.Write(_group, _message); // ../Include/Tools/Trace.js: 70
                        } // ../Include/Tools/Trace.js: 71
                    } // ../Include/Tools/Trace.js: 72
                    catch (e) { } // ../Include/Tools/Trace.js: 73

                } // ../Include/Tools/Trace.js: 75
                if (IsFF()) { // ../Include/Tools/Trace.js: 76
                    try { // ../Include/Tools/Trace.js: 77
                        if ('createEvent' in document) { // ../Include/Tools/Trace.js: 78
                            var element = document.getElementById('ODTraceMessageId'); // ../Include/Tools/Trace.js: 79
                            if (!element) { // ../Include/Tools/Trace.js: 80
                                element = document.createElement('ODTraceMessage'); // ../Include/Tools/Trace.js: 81
                                element.setAttribute('id', 'ODTraceMessageId'); // ../Include/Tools/Trace.js: 82
                                if (document.documentElement != null) // ../Include/Tools/Trace.js: 83
                                    document.documentElement.appendChild(element); // ../Include/Tools/Trace.js: 84
                            } // ../Include/Tools/Trace.js: 85

                            element.setAttribute('msg', _message); // ../Include/Tools/Trace.js: 87
                            element.setAttribute('ids', _group); // ../Include/Tools/Trace.js: 88
                            var ev = document.createEvent('Events'); // ../Include/Tools/Trace.js: 89
                            ev.initEvent('ODTraceEvent', true, false); // ../Include/Tools/Trace.js: 90
                            element.dispatchEvent(ev); // ../Include/Tools/Trace.js: 91
                        } // ../Include/Tools/Trace.js: 92
                    } // ../Include/Tools/Trace.js: 93
                    catch (e) { } // ../Include/Tools/Trace.js: 94
                } // ../Include/Tools/Trace.js: 95
            } // ../Include/Tools/Trace.js: 96
        } // ../Include/Tools/Trace.js: 97
    }, // ../Include/Tools/Trace.js: 98
    Error: function (group, message) { // ../Include/Tools/Trace.js: 99
        _Trace.Log(group, message); // ../Include/Tools/Trace.js: 100
        var console = _Trace._GetConsole(); // ../Include/Tools/Trace.js: 101
        if (console && console['error']) // ../Include/Tools/Trace.js: 102
            console['error'](_Trace._CreateMessage(group, message)); // ../Include/Tools/Trace.js: 103
    }, // ../Include/Tools/Trace.js: 104
    Warning: function (group, message) { // ../Include/Tools/Trace.js: 105
        _Trace.Log(group, message); // ../Include/Tools/Trace.js: 106
        var console = _Trace._GetConsole(); // ../Include/Tools/Trace.js: 107
        if (console && console['warn']) // ../Include/Tools/Trace.js: 108
            console['warn'](_Trace._CreateMessage(group, message)); // ../Include/Tools/Trace.js: 109
    }, // ../Include/Tools/Trace.js: 110
    AddFilter: function (filter, type) { // ../Include/Tools/Trace.js: 111
        _Trace._Filters.push([_Trace._CreateRegExp(filter || null), type]); // ../Include/Tools/Trace.js: 112
        _Trace._Enabled = null; // ../Include/Tools/Trace.js: 113
    }, // ../Include/Tools/Trace.js: 114
    ResetFilters: function () { // ../Include/Tools/Trace.js: 115
        _Trace._Filters = []; // ../Include/Tools/Trace.js: 116
        _Trace._Enabled = null; // ../Include/Tools/Trace.js: 117
    }, // ../Include/Tools/Trace.js: 118
    TestGroup: function (group) { // ../Include/Tools/Trace.js: 119
        if (group == null) // ../Include/Tools/Trace.js: 120
            group = ''; // ../Include/Tools/Trace.js: 121
        if (_Trace._Enabled == null) // ../Include/Tools/Trace.js: 122
            _Trace._Enabled = {}; // ../Include/Tools/Trace.js: 123
        var isEnabled; // ../Include/Tools/Trace.js: 124
        if ((isEnabled = _Trace._Enabled[group]) != void 0) // ../Include/Tools/Trace.js: 125
            return isEnabled; // ../Include/Tools/Trace.js: 126
        _Trace._Enabled[group] = isEnabled = _Trace._TestGroup(group); // ../Include/Tools/Trace.js: 127
        return isEnabled; // ../Include/Tools/Trace.js: 128
    }, // ../Include/Tools/Trace.js: 129
    _CaptureFileSource: function (fileName) { // ../Include/Tools/Trace.js: 130
        if (!/.js$/i.test(fileName)) // ../Include/Tools/Trace.js: 131
            return false; // ../Include/Tools/Trace.js: 132
        if (typeof (AjaxRequest) != 'undefined') { // ../Include/Tools/Trace.js: 133
            setTimeout( // ../Include/Tools/Trace.js: 134
                function () { // ../Include/Tools/Trace.js: 135
                    new AjaxRequest(fileName, { // ../Include/Tools/Trace.js: 136
                        'asynchronous': true, // ../Include/Tools/Trace.js: 137
                        'OnDone': function (arq) { // ../Include/Tools/Trace.js: 138
                            try { // ../Include/Tools/Trace.js: 139
                                var text = arq.request.responseText || ''; // ../Include/Tools/Trace.js: 140
                                _Trace._SourceOffset = -1; // ../Include/Tools/Trace.js: 141
                                _Trace._SourceLines = text.split('\n'); // ../Include/Tools/Trace.js: 142
                            } // ../Include/Tools/Trace.js: 143
                            catch (xe) { // ../Include/Tools/Trace.js: 144
                            } // ../Include/Tools/Trace.js: 145
                        } // ../Include/Tools/Trace.js: 146
                    }); // ../Include/Tools/Trace.js: 147
                }, // ../Include/Tools/Trace.js: 148
                10 // ../Include/Tools/Trace.js: 149
            ); // ../Include/Tools/Trace.js: 150
        } // ../Include/Tools/Trace.js: 151
        return true; // ../Include/Tools/Trace.js: 152
    }, // ../Include/Tools/Trace.js: 153
    _CaptureEvalSource: function (entryPoint) { // ../Include/Tools/Trace.js: 154
        if (/^OnDemand_IPXFF_JScriptManager_Eval\("window\.OraUpk=\{\}/.test(entryPoint)) // ../Include/Tools/Trace.js: 155
            _Trace._SourceOffset = 16; // ../Include/Tools/Trace.js: 156
        else if (/^\("window\.OraUpk=\{\}/.test(entryPoint)) // ../Include/Tools/Trace.js: 157
            _Trace._SourceOffset = 13; // ../Include/Tools/Trace.js: 158
        else if (/^_firebugInjectedEvaluate\("with\(_FirebugCommandLine\)/.test(entryPoint)) // ../Include/Tools/Trace.js: 159
            _Trace._SourceOffset = -71; // ../Include/Tools/Trace.js: 160
        else return false; // ../Include/Tools/Trace.js: 161
        ++_Trace._SourceOffset; // ../Include/Tools/Trace.js: 162
        _Trace._SourceLines = entryPoint.split('\\n'); // ../Include/Tools/Trace.js: 163
        return true; // ../Include/Tools/Trace.js: 164
    }, // ../Include/Tools/Trace.js: 165
    Initialize: function () { // ../Include/Tools/Trace.js: 166
//x         //: <if xconfig="Browser.All,Browser.FF*"/>
//x         //: <if-not xconfig="Browser.FF*"/>
        if (Browser.IsFF()) { // ../Include/Tools/Trace.js: 169
//x             //: <end/>
            var xe = new Error(); // ../Include/Tools/Trace.js: 171
//x             //: <if xconfig="Ignore"/>
//x             (function (xe) {
//x                 _Trace.Log('Trace.Initialize', 'fileName: ' + xe.fileName + ', lineNumber: ' + xe.lineNumber);
//x                 var lines = xe.stack.split('\n');
//x                 for (var i = 0; i < lines.length; ++i) {
//x                     _Trace.Log('Trace.Initialize', 'stack[' + i + ']: ' + xe.stack);
//x                 }
//x             })(xe);
//x             //: <end/>
            if (!(xe.fileName && _Trace._CaptureFileSource(xe.fileName)) && xe.stack) { // ../Include/Tools/Trace.js: 181
                var stackFrames = xe.stack.split('\n'); // ../Include/Tools/Trace.js: 182
                if (stackFrames.length >= 2) { // ../Include/Tools/Trace.js: 183
                    // var console = _Trace._GetConsole();
                    // var firebugVer = (console && console['firebug']) || null;
                    // firebugVer == "1.6.2"
                    _Trace._CaptureEvalSource(stackFrames.pop()) || _Trace._CaptureEvalSource(stackFrames.pop()); // ../Include/Tools/Trace.js: 187
                } // ../Include/Tools/Trace.js: 188
            } // ../Include/Tools/Trace.js: 189
//x             //: <if-not xconfig="Browser.FF*"/>
        } // ../Include/Tools/Trace.js: 191
//x         //: <end/>
//x         //: <end/>
    } // ../Include/Tools/Trace.js: 194
}; // ../Include/Tools/Trace.js: 195

function Trace(group, message) { // ../Include/Tools/Trace.js: 197
    _Trace.Log(group, message); // ../Include/Tools/Trace.js: 198
} // ../Include/Tools/Trace.js: 199

Trace.Allow = function(filter) { // ../Include/Tools/Trace.js: 201
    _Trace.AddFilter(filter, true); // ../Include/Tools/Trace.js: 202
} // ../Include/Tools/Trace.js: 203

Trace.Deny = function(filter) { // ../Include/Tools/Trace.js: 205
    _Trace.AddFilter(filter, false); // ../Include/Tools/Trace.js: 206
} // ../Include/Tools/Trace.js: 207

Trace.Output = function(output) { // ../Include/Tools/Trace.js: 209
    _Trace.Output(output); // ../Include/Tools/Trace.js: 210
} // ../Include/Tools/Trace.js: 211

Trace.Reset = function() { // ../Include/Tools/Trace.js: 213
    _Trace.ResetFilters(); // ../Include/Tools/Trace.js: 214
} // ../Include/Tools/Trace.js: 215

Trace.Object = function(group, value, name) { // ../Include/Tools/Trace.js: 217
    _Trace.Log(group, (name ? (name + ' = ') : '') + Json.EncodeObject(value)); // ../Include/Tools/Trace.js: 218
} // ../Include/Tools/Trace.js: 219

Trace.Warning = function(group, message) { // ../Include/Tools/Trace.js: 221
    _Trace.Warning(group, message); // ../Include/Tools/Trace.js: 222
} // ../Include/Tools/Trace.js: 223

Trace.Error = function(group, message) { // ../Include/Tools/Trace.js: 225
    _Trace.Error(group, message); // ../Include/Tools/Trace.js: 226
} // ../Include/Tools/Trace.js: 227

Trace.Exception = function(group, xe, droppedFrames) { // ../Include/Tools/Trace.js: 229
    var message = 'Exception: ' + ((xe && xe.message) || 'UNKNOWN'); // ../Include/Tools/Trace.js: 230
//x     //: <if xconfig="Browser.All,Browser.FF*"/>
    if (xe.stack) { // ../Include/Tools/Trace.js: 232
        try { // ../Include/Tools/Trace.js: 233
            var stackFrames = xe.stack.split('\n'); // ../Include/Tools/Trace.js: 234
            while (stackFrames.length) { // ../Include/Tools/Trace.js: 235
                var entryPoint = stackFrames.pop(); // ../Include/Tools/Trace.js: 236
                if (!/^_firebugInjectedEvaluate/.test(entryPoint)) { // ../Include/Tools/Trace.js: 237
                    stackFrames.push(entryPoint); // ../Include/Tools/Trace.js: 238
                    break; // ../Include/Tools/Trace.js: 239
                } // ../Include/Tools/Trace.js: 240
            } // ../Include/Tools/Trace.js: 241
            droppedFrames = (droppedFrames || 0); // ../Include/Tools/Trace.js: 242
            for (var i = droppedFrames, n = stackFrames.length; i < n; ++i) { // ../Include/Tools/Trace.js: 243
                var stackFrame = stackFrames[i] || '(unknown)'; // ../Include/Tools/Trace.js: 244
                var locationPos = stackFrame.lastIndexOf('@'); // ../Include/Tools/Trace.js: 245
                var call = (locationPos == -1) ? stackFrame : stackFrame.substr(0, locationPos); // ../Include/Tools/Trace.js: 246
                var callLocation = stackFrame.substr(locationPos + 1); // ../Include/Tools/Trace.js: 247
                if (locationPos != -1) { // ../Include/Tools/Trace.js: 248
                    var linePos = callLocation.lastIndexOf(':'); // ../Include/Tools/Trace.js: 249
                    if (linePos != -1) { // ../Include/Tools/Trace.js: 250
                        var line = Number(callLocation.substr(linePos + 1)) + _Trace._SourceOffset; // ../Include/Tools/Trace.js: 251
                        if (line >= 0 && line < _Trace._SourceLines.length) { // ../Include/Tools/Trace.js: 252
                            var sourceLine = _Trace._SourceLines[line]; // ../Include/Tools/Trace.js: 253
                            var commentPos = sourceLine.lastIndexOf('//'); // ../Include/Tools/Trace.js: 254
                            callLocation = (commentPos == -1) ? sourceLine : sourceLine.substr(commentPos); // ../Include/Tools/Trace.js: 255
                            if (/\\r$/.test(callLocation)) // ../Include/Tools/Trace.js: 256
                                callLocation = callLocation.substr(0, callLocation.length - 2); // ../Include/Tools/Trace.js: 257
                        } // ../Include/Tools/Trace.js: 258
                    } // ../Include/Tools/Trace.js: 259
                } // ../Include/Tools/Trace.js: 260
                message += '\n  ' + call + ': ' + callLocation; // ../Include/Tools/Trace.js: 261
            } // ../Include/Tools/Trace.js: 262
        } // ../Include/Tools/Trace.js: 263
        catch (xe2) { // ../Include/Tools/Trace.js: 264
            FailAlert(xe2.message); // ../Include/Tools/Trace.js: 265
        } // ../Include/Tools/Trace.js: 266
    } // ../Include/Tools/Trace.js: 267
//x     //: <end/>
    _Trace.Error(group, message); // ../Include/Tools/Trace.js: 269
} // ../Include/Tools/Trace.js: 270

TraceIf = function(condition, group, message) { // ../Include/Tools/Trace.js: 272
    if (condition) // ../Include/Tools/Trace.js: 273
        _Trace.Log(group, message); // ../Include/Tools/Trace.js: 274
} // ../Include/Tools/Trace.js: 275

TraceIf.Object = function(condition, group, value, name) { // ../Include/Tools/Trace.js: 277
    if (condition) // ../Include/Tools/Trace.js: 278
        _Trace.Log(group, (name ? (name + ' = ') : '') + Json.EncodeObject(value)); // ../Include/Tools/Trace.js: 279
} // ../Include/Tools/Trace.js: 280

TraceIf.Warning = function(condition, group, message) { // ../Include/Tools/Trace.js: 282
    if (condition) // ../Include/Tools/Trace.js: 283
        _Trace.Warning(group, message); // ../Include/Tools/Trace.js: 284
} // ../Include/Tools/Trace.js: 285

//x /// <reference path="../NoTrace.js"/>

//* <FileBegin path="../Include/NoTrace.js"/>
//x /// <reference path="Tools/Trace.js" xconfig="Ignore"/>

//Trace.Deny();
//Trace.Allow('Recognition');

Trace.Allow(); // ../Include/NoTrace.js: 6
Trace.Deny('SmartMatchApplication'); // ../Include/NoTrace.js: 7
//Trace.Deny('Recognition.GetPlaybackContext.*');
//Trace.Output('viewer');

//* <FileEnd path="../Include/NoTrace.js"/>


_Trace.Initialize(); // ../Include/Tools/Trace.js: 289

//x //: <end/>

//* <FileEnd path="../Include/Tools/Trace.js"/>


//x //: <if xconfig="Debug"/>
//x var FailMessages = {};
//x var FailAlert = function(message) {
//x     if (FailMessages[message] || (FailMessages[message] == void 0)) {
//x         FailMessages[message] = confirm(message + '\n\nCall stack:\n' + GetCallStack(2).join('\n') + '\n\nIgnore similar messages?');
//x     }
//x };
//x //: <end/>

// It is declared as a var to enable to be hooked
var Fail = function(source, message1, message2, droppedFrames) { // ../Include/Tools/Fail.js: 14
    var body = 'Failed: ' + message1 + ((message2 != null) ? ', ' + message2 : ''); // ../Include/Tools/Fail.js: 15
    var message = source + ' ' + body; // ../Include/Tools/Fail.js: 16
    Trace.Exception(source, new Error(body), (droppedFrames || 0) + 1); // ../Include/Tools/Fail.js: 17
//x     //: <if xconfig="Debug"/>
//x     FailAlert(message);
//x     //: <end/>
    throw new ApplicationError(message); // ../Include/Tools/Fail.js: 21
}; // ../Include/Tools/Fail.js: 22

Fail.NotImplemented = function(source) { // ../Include/Tools/Fail.js: 24
    Fail(source, 'Not implemented.', null, 2); // ../Include/Tools/Fail.js: 25
}; // ../Include/Tools/Fail.js: 26

Fail.Exception = function(source, xe) { // ../Include/Tools/Fail.js: 28
    Trace.Exception(source, xe, 0); // ../Include/Tools/Fail.js: 29
    Fail(source, 'Exception: ' + xe.message, null, 2); // ../Include/Tools/Fail.js: 30
}; // ../Include/Tools/Fail.js: 31

//* <FileEnd path="../Include/Tools/Fail.js"/>

//x //: <if xconfig="Debug,Trace"/>
//x /// <reference path="Assert.js"/>
//x /// <reference path="Json.js"/>

//* <FileBegin path="../Include/Tools/Assert.js"/>
//x //: <if xconfig="Debug,Trace"/>
//x /// <reference path="Fail.js"/>
//x /// <reference path="Main.js"/>

function Assert(source, value, message) { // ../Include/Tools/Assert.js: 5
    if (!value) // ../Include/Tools/Assert.js: 6
        Fail('Assert.Message', source, message, 2); // ../Include/Tools/Assert.js: 7
} // ../Include/Tools/Assert.js: 8
    
Assert.Condition = function(source, value, name) { // ../Include/Tools/Assert.js: 10
    if (!value) // ../Include/Tools/Assert.js: 11
        Fail('Assert.Condition', source, NameOf(name) + ' does not hold', 2); // ../Include/Tools/Assert.js: 12
}; // ../Include/Tools/Assert.js: 13

Assert.True = function(source, value, name) { // ../Include/Tools/Assert.js: 15
    if (value !== true) // ../Include/Tools/Assert.js: 16
        Fail('Assert.True', source, NameOf(name) + ' is not true', 2); // ../Include/Tools/Assert.js: 17
}; // ../Include/Tools/Assert.js: 18

Assert.False = function(source, value, name) { // ../Include/Tools/Assert.js: 20
    if (value !== false) // ../Include/Tools/Assert.js: 21
        Fail('Assert.False', source, NameOf(name) + ' is not false', 2); // ../Include/Tools/Assert.js: 22
}; // ../Include/Tools/Assert.js: 23

Assert.Null = function(source, value, name) { // ../Include/Tools/Assert.js: 25
    if (value != null) // ../Include/Tools/Assert.js: 26
        Fail('Assert.Null', source, NameOf(name) + ' is not null', 2); // ../Include/Tools/Assert.js: 27
}; // ../Include/Tools/Assert.js: 28

Assert.NonNull = function(source, value, name) { // ../Include/Tools/Assert.js: 30
    if (value == null) // ../Include/Tools/Assert.js: 31
        Fail('Assert.NonNull', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 32
}; // ../Include/Tools/Assert.js: 33

Assert.Defined = function(source, value, name) { // ../Include/Tools/Assert.js: 35
    if (value == void 0) // ../Include/Tools/Assert.js: 36
        Fail('Assert.Defined', source, NameOf(name) + ' is undefined', 2); // ../Include/Tools/Assert.js: 37
}; // ../Include/Tools/Assert.js: 38

Assert.Undefined = function(source, value, name) { // ../Include/Tools/Assert.js: 40
    if (value != void 0) // ../Include/Tools/Assert.js: 41
        Fail('Assert.Undefined', source, NameOf(name) + ' is defined', 2); // ../Include/Tools/Assert.js: 42
}; // ../Include/Tools/Assert.js: 43

Assert.Equals = function(source, value1, value2, name1, name2) { // ../Include/Tools/Assert.js: 45
    if (value1 != value2) // ../Include/Tools/Assert.js: 46
        Fail('Assert.Equals', source, NameOf(name1) + ' and ' + NameOf(name2) + ' are not equal', 2); // ../Include/Tools/Assert.js: 47
}; // ../Include/Tools/Assert.js: 48

Assert.Range = function(source, value, minValue, maxValue, name) { // ../Include/Tools/Assert.js: 50
    if (value < minValue || value > maxValue) // ../Include/Tools/Assert.js: 51
        Fail('Assert.Range', source, NameOf(name) + ' must be in range ' + minValue + ',  ' + maxValue, 2); // ../Include/Tools/Assert.js: 52
}; // ../Include/Tools/Assert.js: 53

Assert.ArrayIndex = function(source, index, arrayObj, indexName, arrayObjName) { // ../Include/Tools/Assert.js: 55
    if (arrayObj == null) // ../Include/Tools/Assert.js: 56
        Fail('Assert.ArrayIndex', source, NameOf(arrayObjName) + ' is null', 2); // ../Include/Tools/Assert.js: 57
    if (index < 0 || index >= arrayObj.length) // ../Include/Tools/Assert.js: 58
        Fail('Assert.ArrayIndex', source, NameOf(indexName) + ' invalid array index ' + index + ' in ' + NameOf(arrayObjName) + ', length = ' + arrayObj.length, 2); // ../Include/Tools/Assert.js: 59
}; // ../Include/Tools/Assert.js: 60

Assert.Length = function(source, value, length, name) { // ../Include/Tools/Assert.js: 62
    if (value == null) // ../Include/Tools/Assert.js: 63
        Fail('Assert.Length', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 64
    if (value.length != length) // ../Include/Tools/Assert.js: 65
        Fail('Assert.Length', source, NameOf(name) + ' must have ' + length + ' elements', 2); // ../Include/Tools/Assert.js: 66
}; // ../Include/Tools/Assert.js: 67

Assert.MinLength = function(source, value, minLength, name) { // ../Include/Tools/Assert.js: 69
    if (value == null) // ../Include/Tools/Assert.js: 70
        Fail('Assert.MinLength', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 71
    if (value.length < minLength) // ../Include/Tools/Assert.js: 72
        Fail('Assert.MinLength', source, NameOf(name) + ' must have at least ' + minLength + ' elements', 2); // ../Include/Tools/Assert.js: 73
}; // ../Include/Tools/Assert.js: 74

Assert.EqualLength = function(source, value1, value2, name1, name2) { // ../Include/Tools/Assert.js: 76
    if (value1 == null) // ../Include/Tools/Assert.js: 77
        Fail('Assert.EqualLength', source, NameOf(name1) + ' is null', 2); // ../Include/Tools/Assert.js: 78
    if (value2 == null) // ../Include/Tools/Assert.js: 79
        Fail('Assert.EqualLength', source, NameOf(name2) + ' is null', 2); // ../Include/Tools/Assert.js: 80
    if (value1.length != value2.length) // ../Include/Tools/Assert.js: 81
        Fail('Assert.EqualLength', source, NameOf(name1) + ' and ' + NameOf(name2) + ' length is not equal', 2); // ../Include/Tools/Assert.js: 82
}; // ../Include/Tools/Assert.js: 83

Assert.Identical = function(source, value1, value2, name1, name2) { // ../Include/Tools/Assert.js: 85
    if (value1 !== value2) // ../Include/Tools/Assert.js: 86
        Fail('Assert.Identical', source, NameOf(name1) + ' and ' + NameOf(name2) + ' are not identical', 2); // ../Include/Tools/Assert.js: 87
}; // ../Include/Tools/Assert.js: 88

Assert.String = function(source, value, name) { // ../Include/Tools/Assert.js: 90
    if (value == null) // ../Include/Tools/Assert.js: 91
        Fail('Assert.String', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 92
    if (!IsString(value)) // ../Include/Tools/Assert.js: 93
        Fail('Assert.String', source, NameOf(name) + ' is not a String', 2); // ../Include/Tools/Assert.js: 94
}; // ../Include/Tools/Assert.js: 95

Assert.Number = function(source, value, name) { // ../Include/Tools/Assert.js: 97
    if (value == null) // ../Include/Tools/Assert.js: 98
        Fail('Assert.Number', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 99
    if (!IsNumber(value)) // ../Include/Tools/Assert.js: 100
        Fail('Assert.Number', source, NameOf(name) + ' is not a Number', 2); // ../Include/Tools/Assert.js: 101
}; // ../Include/Tools/Assert.js: 102

Assert.Array = function(source, value, name) { // ../Include/Tools/Assert.js: 104
    if (value == null) // ../Include/Tools/Assert.js: 105
        Fail('Assert.Array', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 106
    if (!IsArray(value)) // ../Include/Tools/Assert.js: 107
        Fail('Assert.Array', source, NameOf(name) + ' is not an Array', 2); // ../Include/Tools/Assert.js: 108
}; // ../Include/Tools/Assert.js: 109

Assert.Hash = function(source, value, name) { // ../Include/Tools/Assert.js: 111
    if (value == null) // ../Include/Tools/Assert.js: 112
        Fail('Assert.Hash', source, NameOf(name) + ' is null', 2); // ../Include/Tools/Assert.js: 113
    if (!IsHash(value)) // ../Include/Tools/Assert.js: 114
        Fail('Assert.Hash', source, NameOf(name) + ' is not a hash Object', 2); // ../Include/Tools/Assert.js: 115
}; // ../Include/Tools/Assert.js: 116

Assert.InstanceOf = function(source, value, type, name, tname) { // ../Include/Tools/Assert.js: 118
    if (!(value instanceof type)) // ../Include/Tools/Assert.js: 119
        Fail('Assert.InstanceOf', source, NameOf(name) + ' is not instance of ' + NameOf(tname), 2); // ../Include/Tools/Assert.js: 120
}; // ../Include/Tools/Assert.js: 121

Assert.NullOrNumber = function(source, value, name) { // ../Include/Tools/Assert.js: 123
    if (!IsNullOrNumber(value)) // ../Include/Tools/Assert.js: 124
        Fail('Assert.NullOrNumber', source, NameOf(name) + ' is not a Number', 2); // ../Include/Tools/Assert.js: 125
}; // ../Include/Tools/Assert.js: 126

Assert.NullOrString = function(source, value, name) { // ../Include/Tools/Assert.js: 128
    if (!IsNullOrString(value)) // ../Include/Tools/Assert.js: 129
        Fail('Assert.NullOrString', source, NameOf(name) + ' is not a String', 2); // ../Include/Tools/Assert.js: 130
}; // ../Include/Tools/Assert.js: 131

Assert.NullOrArray = function(source, value, name) { // ../Include/Tools/Assert.js: 133
    if (!IsNullOrArray(value)) // ../Include/Tools/Assert.js: 134
        Fail('Assert.NullOrArray', source, NameOf(name) + ' is not an Array', 2); // ../Include/Tools/Assert.js: 135
}; // ../Include/Tools/Assert.js: 136

Assert.NullOrInstanceOf = function(source, value, type, name, tname) { // ../Include/Tools/Assert.js: 138
    if (!IsNullOrInstanceOf(value, type)) // ../Include/Tools/Assert.js: 139
        Fail('Assert.InstanceOf', source, NameOf(name) + ' is not instance of ' + NameOf(tname), 2); // ../Include/Tools/Assert.js: 140
}; // ../Include/Tools/Assert.js: 141

Assert.InRange = function(source, value, min, max, name) { // ../Include/Tools/Assert.js: 143
    if (!InRange(value, min, max)) // ../Include/Tools/Assert.js: 144
        Fail('Assert.InRange', source, NameOf(name) + ' is not in range [' + min + ', ' + max + ']', 2); // ../Include/Tools/Assert.js: 145
}; // ../Include/Tools/Assert.js: 146

Assert.Match = function(source, value, name, regexp, regexpName) { // ../Include/Tools/Assert.js: 148
    if (!IsString(value)) // ../Include/Tools/Assert.js: 149
        Fail('Assert.Match', source, NameOf(name) + ' is not a String', 2); // ../Include/Tools/Assert.js: 150
    if (regexp == null) // ../Include/Tools/Assert.js: 151
        Fail('Assert.Match', source, NameOf(regexpName) + ' is null', 2); // ../Include/Tools/Assert.js: 152
    if (!value.match(regexp)) // ../Include/Tools/Assert.js: 153
        Fail('Assert.Match', source, NameOf(name) + ' must match ' + NameOf(regexpName), 2); // ../Include/Tools/Assert.js: 154
}; // ../Include/Tools/Assert.js: 155

Assert.MustOverride = function(source) { // ../Include/Tools/Assert.js: 157
    Fail('Assert.MustOverride', source, NameOf(source) + ' must be overriden', 2); // ../Include/Tools/Assert.js: 158
}; // ../Include/Tools/Assert.js: 159

//x //: <end/>

//* <FileEnd path="../Include/Tools/Assert.js"/>


function DumpValue(value) { // ../Include/Tools/Sanity.js: 6
    var type = TypeOf(value); // ../Include/Tools/Sanity.js: 7
    var str = type; // ../Include/Tools/Sanity.js: 8
    if (value != (void 0) && type != '[function]' && type != '[object Function]') { // ../Include/Tools/Sanity.js: 9
        var encoded; // ../Include/Tools/Sanity.js: 10
        try { encoded = Json.EncodeObject(value); } catch (xe) { } // ../Include/Tools/Sanity.js: 11
        str += ':' + ((encoded == void 0) ? '(complex object)' : encoded); // ../Include/Tools/Sanity.js: 12
    } // ../Include/Tools/Sanity.js: 13
    return str; // ../Include/Tools/Sanity.js: 14
} // ../Include/Tools/Sanity.js: 15

function Dump(obj) { // ../Include/Tools/Sanity.js: 17
    if (obj == null) // ../Include/Tools/Sanity.js: 18
        return '(null)'; // ../Include/Tools/Sanity.js: 19
    var list = []; // ../Include/Tools/Sanity.js: 20
    for (var member in obj) // ../Include/Tools/Sanity.js: 21
        list.push(member + '=' + DumpValue(obj[member])); // ../Include/Tools/Sanity.js: 22
    return list.join(', '); // ../Include/Tools/Sanity.js: 23
} // ../Include/Tools/Sanity.js: 24

function Called(params) { // ../Include/Tools/Sanity.js: 26
    var str = 'Called'; // ../Include/Tools/Sanity.js: 27
    if (params != null) // ../Include/Tools/Sanity.js: 28
        str += ' with: ' + Dump(params); // ../Include/Tools/Sanity.js: 29
    return str; // ../Include/Tools/Sanity.js: 30
} // ../Include/Tools/Sanity.js: 31

function Returned(params) { // ../Include/Tools/Sanity.js: 33
    return ('Returned: ' + DumpValue(params)); // ../Include/Tools/Sanity.js: 34
} // ../Include/Tools/Sanity.js: 35

function ComplexObject(obj) { // ../Include/Tools/Sanity.js: 37
    return ((obj != null) ? (function() { }) : obj); // ../Include/Tools/Sanity.js: 38
} // ../Include/Tools/Sanity.js: 39


//x //: <end/>

//* <FileEnd path="../Include/Tools/Sanity.js"/>


//<!--Version 1-->

function _ExtendDeepObj(target, key, obj) { // ../Include/Tools/Base.js: 5
    if (targetObj === obj) // ../Include/Tools/Base.js: 6
        return; // ../Include/Tools/Base.js: 7
    var targetObj = target[key]; // ../Include/Tools/Base.js: 8
    if (!IsHash(targetObj)) // ../Include/Tools/Base.js: 9
        target[key] = targetObj = {}; // ../Include/Tools/Base.js: 10
    for (var objKey in obj) { // ../Include/Tools/Base.js: 11
        var value = obj[objKey]; // ../Include/Tools/Base.js: 12
        if (IsHash(value)) // ../Include/Tools/Base.js: 13
            _ExtendDeepObj(targetObj, objKey, value); // ../Include/Tools/Base.js: 14
        else targetObj[objKey] = value; // ../Include/Tools/Base.js: 15
    } // ../Include/Tools/Base.js: 16
} // ../Include/Tools/Base.js: 17

function _ExtendDeepList(target, objs) { // ../Include/Tools/Base.js: 19
    if (target == void 0 || !IsHash(target)) // ../Include/Tools/Base.js: 20
        target = {}; // ../Include/Tools/Base.js: 21
    for (var i = 0, n = objs.length, obj; i < n; ++i) { // ../Include/Tools/Base.js: 22
        if (IsHash(obj = objs[i]) && target !== obj) { // ../Include/Tools/Base.js: 23
            for (var key in obj) { // ../Include/Tools/Base.js: 24
                var value = obj[key]; // ../Include/Tools/Base.js: 25
                if (IsHash(value)) // ../Include/Tools/Base.js: 26
                    _ExtendDeepObj(target, key, value); // ../Include/Tools/Base.js: 27
                else target[key] = value; // ../Include/Tools/Base.js: 28
            } // ../Include/Tools/Base.js: 29
        } // ../Include/Tools/Base.js: 30
    } // ../Include/Tools/Base.js: 31
    return target; // ../Include/Tools/Base.js: 32
} // ../Include/Tools/Base.js: 33

function _ExtendFlatList(target, objs) { // ../Include/Tools/Base.js: 35
    if (target == void 0 || !IsHash(target)) // ../Include/Tools/Base.js: 36
        target = {}; // ../Include/Tools/Base.js: 37
    for (var i = 0, n = objs.length, obj; i < n; ++i) { // ../Include/Tools/Base.js: 38
        if (IsHash(obj = objs[i]) && target !== obj) { // ../Include/Tools/Base.js: 39
            for (var key in obj) // ../Include/Tools/Base.js: 40
                target[key] = obj[key]; // ../Include/Tools/Base.js: 41
        } // ../Include/Tools/Base.js: 42
    } // ../Include/Tools/Base.js: 43
    return target; // ../Include/Tools/Base.js: 44
} // ../Include/Tools/Base.js: 45

function Extend(deep) { // ../Include/Tools/Base.js: 47
    if (deep !== !!deep) // ../Include/Tools/Base.js: 48
        return _ExtendFlatList(arguments[0], [].slice.call(arguments, 1)); // ../Include/Tools/Base.js: 49
    if (deep) // ../Include/Tools/Base.js: 50
        return _ExtendDeepList(arguments[1], [].slice.call(arguments, 2)); // ../Include/Tools/Base.js: 51
    return _ExtendFlatList(arguments[1], [].slice.call(arguments, 2)); // ../Include/Tools/Base.js: 52
} // ../Include/Tools/Base.js: 53

function CloneObject(obj) { // ../Include/Tools/Base.js: 55
    return Extend(true, {}, obj); // ../Include/Tools/Base.js: 56
} // ../Include/Tools/Base.js: 57

function CloneHash(obj) { // ../Include/Tools/Base.js: 59
    var result = {}; // ../Include/Tools/Base.js: 60
    for (var m in obj) // ../Include/Tools/Base.js: 61
        result[m] = obj[m]; // ../Include/Tools/Base.js: 62
    return result; // ../Include/Tools/Base.js: 63
} // ../Include/Tools/Base.js: 64

function GetValue(obj, member, def) { // ../Include/Tools/Base.js: 66
    return ((typeof obj[member] == 'undefined') ? def : obj[member]); // ../Include/Tools/Base.js: 67
} // ../Include/Tools/Base.js: 68

function GetNonEmpty(value, def) { // ../Include/Tools/Base.js: 70
    return ((value && value.length) ? value : def); // ../Include/Tools/Base.js: 71
} // ../Include/Tools/Base.js: 72

function RandomInteger(min, max) { // ../Include/Tools/Base.js: 74
    return (min + Math.floor(Math.random() * (max - min + 1))); // ../Include/Tools/Base.js: 75
} // ../Include/Tools/Base.js: 76

function RandomIndex(length) { // ../Include/Tools/Base.js: 78
    return Math.floor(Math.random() * length); // ../Include/Tools/Base.js: 79
} // ../Include/Tools/Base.js: 80

function InRange(value, min, max) { // ../Include/Tools/Base.js: 82
    return (value >= min && value <= max); // ../Include/Tools/Base.js: 83
} // ../Include/Tools/Base.js: 84

function ExtendClass(base) { // ../Include/Tools/Base.js: 86
    var proto = {BaseClass: base}; // ../Include/Tools/Base.js: 87
    for (var key in base) // ../Include/Tools/Base.js: 88
        proto[key] = base[key]; // ../Include/Tools/Base.js: 89
    for (var i = 1, n = arguments.length; i < n; ++i) { // ../Include/Tools/Base.js: 90
        var arg_i = arguments[i]; // ../Include/Tools/Base.js: 91
        for (var key_i in arg_i) // ../Include/Tools/Base.js: 92
            proto[key_i] = arg_i[key_i]; // ../Include/Tools/Base.js: 93
    } // ../Include/Tools/Base.js: 94
    return proto; // ../Include/Tools/Base.js: 95
} // ../Include/Tools/Base.js: 96

//* <FileEnd path="../Include/Tools/Base.js"/>


//* <FileBegin path="../Include/Tools/HashMap.js"/>
//<!--Version 1-->

var HashMap = { // ../Include/Tools/HashMap.js: 3
    FromArray: function(arrayObj, value) { // ../Include/Tools/HashMap.js: 4
        if (value == void 0) // ../Include/Tools/HashMap.js: 5
            value = true; // ../Include/Tools/HashMap.js: 6
        var map = {}; // ../Include/Tools/HashMap.js: 7
        for (var i = 0, n = arrayObj.length; i < n; ++i) { // ../Include/Tools/HashMap.js: 8
            map[arrayObj[i]] = value; // ../Include/Tools/HashMap.js: 9
        } // ../Include/Tools/HashMap.js: 10
        return map; // ../Include/Tools/HashMap.js: 11
    }, // ../Include/Tools/HashMap.js: 12
    AddNewItem: function(hashObj, key, value) { // ../Include/Tools/HashMap.js: 13
        var doesntExists = (hashObj[key] === void 0); // ../Include/Tools/HashMap.js: 14
        if (doesntExists) // ../Include/Tools/HashMap.js: 15
            hashObj[key] = value; // ../Include/Tools/HashMap.js: 16
        return doesntExists; // ../Include/Tools/HashMap.js: 17
    }, // ../Include/Tools/HashMap.js: 18
    Extend: function(hashObj, source) { // ../Include/Tools/HashMap.js: 19
        for (var key in source) { // ../Include/Tools/HashMap.js: 20
            hashObj[key] = source[key]; // ../Include/Tools/HashMap.js: 21
        } // ../Include/Tools/HashMap.js: 22
        return hashObj; // ../Include/Tools/HashMap.js: 23
    }, // ../Include/Tools/HashMap.js: 24
    AddNewItems: function(hashObj, source) { // ../Include/Tools/HashMap.js: 25
        for (var key in source) { // ../Include/Tools/HashMap.js: 26
            if (hashObj[key] === void 0) // ../Include/Tools/HashMap.js: 27
                hashObj[key] = source[key]; // ../Include/Tools/HashMap.js: 28
        } // ../Include/Tools/HashMap.js: 29
    }, // ../Include/Tools/HashMap.js: 30
    GetKeys: function(hashObj) { // ../Include/Tools/HashMap.js: 31
        var keys = []; // ../Include/Tools/HashMap.js: 32
        for (var key in hashObj) // ../Include/Tools/HashMap.js: 33
            keys.push(key); // ../Include/Tools/HashMap.js: 34
        return keys; // ../Include/Tools/HashMap.js: 35
    }, // ../Include/Tools/HashMap.js: 36
    FromKeys: function(hashObj, value) { // ../Include/Tools/HashMap.js: 37
        if (value == void 0) // ../Include/Tools/HashMap.js: 38
            value = true; // ../Include/Tools/HashMap.js: 39
        var map = {}; // ../Include/Tools/HashMap.js: 40
        for (var key in hashObj) { // ../Include/Tools/HashMap.js: 41
            map[key] = value; // ../Include/Tools/HashMap.js: 42
        } // ../Include/Tools/HashMap.js: 43
        return map; // ../Include/Tools/HashMap.js: 44
    }, // ../Include/Tools/HashMap.js: 45
    Equals: function(hashObj1, hashObj2) { // ../Include/Tools/HashMap.js: 46
        if (hashObj1 == null) // ../Include/Tools/HashMap.js: 47
            return (hashObj2 == null); // ../Include/Tools/HashMap.js: 48
        else if (hashObj2 == null) // ../Include/Tools/HashMap.js: 49
            return false; // ../Include/Tools/HashMap.js: 50
        var count = 0; // ../Include/Tools/HashMap.js: 51
        var m; // ../Include/Tools/HashMap.js: 52
        for (m in hashObj1) ++count; // ../Include/Tools/HashMap.js: 53
        for (m in hashObj2) { // ../Include/Tools/HashMap.js: 54
            --count; // ../Include/Tools/HashMap.js: 55
            if (hashObj1[m] != hashObj2[m]) // ../Include/Tools/HashMap.js: 56
                return false; // ../Include/Tools/HashMap.js: 57
        } // ../Include/Tools/HashMap.js: 58
        return (count == 0); // ../Include/Tools/HashMap.js: 59
    }, // ../Include/Tools/HashMap.js: 60
    FindMembers: function(hashObj, memberNames, neededCount) { // ../Include/Tools/HashMap.js: 61
        if (neededCount == void 0) // ../Include/Tools/HashMap.js: 62
            neededCount = memberNames.length; // ../Include/Tools/HashMap.js: 63
        Assert.Condition('HashMap.FindMembers', neededCount <= memberNames.length, 'neededCount <= memberNames.length'); // ../Include/Tools/HashMap.js: 64
        for (var i = 0, n = memberNames.length; i < n; ++i) { // ../Include/Tools/HashMap.js: 65
            if (typeof (hashObj[memberNames[i]]) != 'undefined') { // ../Include/Tools/HashMap.js: 66
                if (--neededCount == 0) // ../Include/Tools/HashMap.js: 67
                    return true; // ../Include/Tools/HashMap.js: 68
            } // ../Include/Tools/HashMap.js: 69
        } // ../Include/Tools/HashMap.js: 70
        return false; // ../Include/Tools/HashMap.js: 71
    } // ../Include/Tools/HashMap.js: 72

}; // ../Include/Tools/HashMap.js: 74

//* <FileEnd path="../Include/Tools/HashMap.js"/>


//* <FileBegin path="../Include/Tools/String.js"/>

function Trim(str) { // ../Include/Tools/String.js: 2
    return str.replace(/^\s+|\s+$/g, ''); // ../Include/Tools/String.js: 3
} // ../Include/Tools/String.js: 4

function FindSubString(sPattern, sString, sEnd) { // ../Include/Tools/String.js: 6
    var sResult = ''; // ../Include/Tools/String.js: 7
    if (sString.length == 0 || sPattern.length == 0) // ../Include/Tools/String.js: 8
        return sResult; // ../Include/Tools/String.js: 9

    sString.toLowerCase(); // ../Include/Tools/String.js: 11
    sPattern.toLowerCase(); // ../Include/Tools/String.js: 12

    var l = sString.length; // ../Include/Tools/String.js: 14
    var ll = sPattern.length; // ../Include/Tools/String.js: 15

    var i = sString.indexOf(sPattern); // ../Include/Tools/String.js: 17
    var j = 0; // ../Include/Tools/String.js: 18

    if (i != -1) { // ../Include/Tools/String.js: 20
        if (sEnd.length > 0) { // ../Include/Tools/String.js: 21
            sEnd.toLowerCase(); // ../Include/Tools/String.js: 22
            j = sString.indexOf(sEnd, i); // ../Include/Tools/String.js: 23
            if (j == -1) // ../Include/Tools/String.js: 24
                j = l; // ../Include/Tools/String.js: 25
        } // ../Include/Tools/String.js: 26
        else { // ../Include/Tools/String.js: 27
            j = l; // ../Include/Tools/String.js: 28
        } // ../Include/Tools/String.js: 29

        if (j != -1) { // ../Include/Tools/String.js: 31
            sResult = sString.substr(i + ll, j - i - ll); // ../Include/Tools/String.js: 32
        } // ../Include/Tools/String.js: 33
    } // ../Include/Tools/String.js: 34
    sResult.toUpperCase(); // ../Include/Tools/String.js: 35

    return sResult; // ../Include/Tools/String.js: 37
} // ../Include/Tools/String.js: 38
 
//* <FileEnd path="../Include/Tools/String.js"/>


//* <FileBegin path="../Include/Tools/AjaxRequest.js"/>
//x /// <reference path="Assert.js"/>
//x /// <reference path="Base.js" />
//x /// <reference path="Json.js" />
//x /// <reference path="UniqueId.js" />
//x /// <reference path="HashMap.js" />

//* <FileBegin path="../Include/Tools/UniqueId.js"/>

var UniqueId = { // ../Include/Tools/UniqueId.js: 2
    _uid: {}, // ../Include/Tools/UniqueId.js: 3
    Next: function(label) { // ../Include/Tools/UniqueId.js: 4
//x         /// <summary>Generate next in sequence of a unique number or label</summary>
//x         /// <param name="label">Sequence name</param>
//x         /// <returns>Number (String when sequence name given)</returns>
//x         /// label = UniqueId.Next('SequenceName');
//x         /// number = UniqueId.Next();  
        var k = ((label == void 0) ? '__uid__' : label); // ../Include/Tools/UniqueId.js: 10
        var v; // ../Include/Tools/UniqueId.js: 11
        if (UniqueId._uid[k] === void 0) // ../Include/Tools/UniqueId.js: 12
            v = UniqueId._uid[k] = 1; // ../Include/Tools/UniqueId.js: 13
        else v = ++UniqueId._uid[k]; // ../Include/Tools/UniqueId.js: 14
        return ((label == void 0) ? v : (label + v)); // ../Include/Tools/UniqueId.js: 15
    }, // ../Include/Tools/UniqueId.js: 16
    Reset: function(label) { // ../Include/Tools/UniqueId.js: 17
//x         /// <summary>Reset sequence counter for a unique numbers or label to zero</summary>
//x         /// <param name="label">Sequence name</param>
//x         /// <returns>Number last used (String last used when sequence name given)</returns>
//x         /// lastUsedLabel = UniqueId.Reset('SequenceName');
//x         /// lastUsedNumber = UniqueId.Reset();  
        var k = ((label == void 0) ? '__uid__' : label); // ../Include/Tools/UniqueId.js: 23
        var v = UniqueId._uid[k] || 0; // ../Include/Tools/UniqueId.js: 24
        UniqueId._uid[k] = 0; // ../Include/Tools/UniqueId.js: 25
        return ((label == void 0) ? v : (label + v)); // ../Include/Tools/UniqueId.js: 26
    } // ../Include/Tools/UniqueId.js: 27
}; // ../Include/Tools/UniqueId.js: 28


//* <FileEnd path="../Include/Tools/UniqueId.js"/>


// AjaxRequest
// ==========================================================================

/** @constructor */ // ../Include/Tools/AjaxRequest.js: 10
function AjaxRequest(url, options) { // ../Include/Tools/AjaxRequest.js: 11
//x /// <summary>
//x ///    Ajax request handling for (IE + Firefox ?) browsers
//x /// </summary>
//x /// <param name="url" type="String">
//x /// </param> 
//x /// <param name="options" type="Object">
//x ///     { [method : GET|POST|HEAD], [parameters : ?], [asynchronous : true|false] }
//x /// </param> 

    Assert.NonNull('AjaxRequest', url, 'url'); // ../Include/Tools/AjaxRequest.js: 21
    this.url = url; // ../Include/Tools/AjaxRequest.js: 22

    var o = options || {}; // ../Include/Tools/AjaxRequest.js: 24
    this.options = o; // ../Include/Tools/AjaxRequest.js: 25
    this.method = o.method ? o.method.toUpperCase() : 'GET'; // ../Include/Tools/AjaxRequest.js: 26
    Assert.Match('AjaxRequest', this.method, 'options.method', /^GET$|^POST$|^HEAD$/, 'GET, POST, or HEAD'); // ../Include/Tools/AjaxRequest.js: 27

    //this.asynchronous = !!this.options.asynchronous || false;
    this.asynchronous = !!o.asynchronous; // ../Include/Tools/AjaxRequest.js: 30
    this.contentType = o.contentType || 'application/x-www-form-urlencoded'; // ../Include/Tools/AjaxRequest.js: 31
    this.parameters = HashMap.Extend({}, (o.parameters || {})); // ../Include/Tools/AjaxRequest.js: 32
    if (o.forceGet) // ../Include/Tools/AjaxRequest.js: 33
        this.parameters['_'] = new Date().getTime(); // ../Include/Tools/AjaxRequest.js: 34

    this.id = UniqueId.Next('AjaxRequest'); // ../Include/Tools/AjaxRequest.js: 36
    this.queryParams = AjaxRequest.$CreateQueryString(this.parameters); // ../Include/Tools/AjaxRequest.js: 37
    // when GET, append parameters to URL
    if (this.method != 'POST' && this.queryParams.length > 0) { // ../Include/Tools/AjaxRequest.js: 39
        this.url += ((this.url.indexOf('?') >= 0) ? '&' : '?') + this.queryParams; // ../Include/Tools/AjaxRequest.js: 40
    } // ../Include/Tools/AjaxRequest.js: 41
    // else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_=';
    this.body = (this.method == 'POST') ? this.queryParams : null; // ../Include/Tools/AjaxRequest.js: 43

    this.request = null; // ../Include/Tools/AjaxRequest.js: 45
    this.aborted = false; // ../Include/Tools/AjaxRequest.js: 46
    this.$completed = false; // ../Include/Tools/AjaxRequest.js: 47

    if (window.XMLHttpRequest) // ../Include/Tools/AjaxRequest.js: 49
        this.request = new XMLHttpRequest(); // ../Include/Tools/AjaxRequest.js: 50
    else if (window['ActiveXObject'] && !(this.request = new ActiveXObject("Msxml2.XMLHTTP"))) // ../Include/Tools/AjaxRequest.js: 51
        this.request = new ActiveXObject("Microsoft.XMLHTTP"); // ../Include/Tools/AjaxRequest.js: 52
    if (!this.request) // ../Include/Tools/AjaxRequest.js: 53
        throw new Error('AjaxRequest, no transport');    // ../Include/Tools/AjaxRequest.js: 54
        
    this.$DoRequest(); // ../Include/Tools/AjaxRequest.js: 56
} // ../Include/Tools/AjaxRequest.js: 57

AjaxRequest.PingUrl = function(url, options) { // ../Include/Tools/AjaxRequest.js: 59
//x /// <summary>
//x ///      Uses AjaxRequest to test HTTP status code
//x /// </summary>
//x /// <param name="url" type="String">
//x /// </param>
//x /// <param name="options" type="Object">
//x ///     { [method : GET|POST|HEAD], [parameters : ?], [asynchronous : true|false] }
//x /// </param> 
//x /// <returns type="Boolean"/>
    var o = options || {}; // ../Include/Tools/AjaxRequest.js: 69
    o.method = 'HEAD'; // ../Include/Tools/AjaxRequest.js: 70
    o.asynchronous = false; // ../Include/Tools/AjaxRequest.js: 71
    return new AjaxRequest(url, o).Success(); // ../Include/Tools/AjaxRequest.js: 72
} // ../Include/Tools/AjaxRequest.js: 73

AjaxRequest.Load = function(url, options) { // ../Include/Tools/AjaxRequest.js: 75
//x /// <summary>
//x ///     Alternate constructor for synchronous AjaxRequest
//x /// </summary>
//x /// <param name="url" type="String">
//x /// </param>
//x /// <param name="options" type="Object">
//x /// </param>
//x /// <returns type="AjaxRequest"/>
    var o = options || {}; // ../Include/Tools/AjaxRequest.js: 84
    o.asynchronous = false; // ../Include/Tools/AjaxRequest.js: 85
    return new AjaxRequest(url, o); // ../Include/Tools/AjaxRequest.js: 86
} // ../Include/Tools/AjaxRequest.js: 87

AjaxRequest.LoadText = function(url, options) { // ../Include/Tools/AjaxRequest.js: 89
//x /// <summary>
//x ///    Uses AjaxRequest to return response content at url
//x /// </summary>
//x /// <param name="url" type="String">
//x /// </param>
//x /// <param name="options" type="Object">
//x ///     { [method : GET|POST|HEAD], [parameters : ?], [asynchronous : true|false] }
//x /// </param> 
//x /// <returns type="String"/>
    return AjaxRequest.Load(url, options).GetResponseText(); // ../Include/Tools/AjaxRequest.js: 99
} // ../Include/Tools/AjaxRequest.js: 100

AjaxRequest.LoadXml = function(url, options) { // ../Include/Tools/AjaxRequest.js: 102
//x /// <summary>
//x ///    Uses AjaxRequest to return response xml content at url
//x /// </summary>
//x /// <param name="url" type="String">
//x /// </param>
//x /// <param name="options" type="Object">
//x ///     { [method : GET|POST|HEAD], [parameters : ?], [asynchronous : true|false] }
//x /// </param> 
//x /// <returns type="Object"/>
    return AjaxRequest.Load(url, options).GetResponseXML(); // ../Include/Tools/AjaxRequest.js: 112
} // ../Include/Tools/AjaxRequest.js: 113

AjaxRequest.LoadJson = function(url, options) { // ../Include/Tools/AjaxRequest.js: 115
//x /// <summary>
//x ///    Uses AjaxRequest to return an object from JSON content at url
//x /// </summary>
//x /// <param name="url" type="String">
//x /// </param>
//x /// <param name="options" type="Object">
//x ///     { [method : GET|POST|HEAD], [parameters : ?], [asynchronous : true|false] }
//x /// </param>
//x /// <returns type="Object"/>
    var json = AjaxRequest.Load(url, options).GetResponseText(); // ../Include/Tools/AjaxRequest.js: 125
    return Json.DecodeObject(json); // ../Include/Tools/AjaxRequest.js: 126
} // ../Include/Tools/AjaxRequest.js: 127


AjaxRequest.States = [ // ../Include/Tools/AjaxRequest.js: 130
    'Unsent',          // 0 
    'Opened',          // 1
    'HeadersReceived', // 2 
    'Loading',         // 3
    'Done'             // 4
]; // ../Include/Tools/AjaxRequest.js: 136

AjaxRequest.Nop = function() { } // maybe someone can explain why this is needed

AjaxRequest.$CreateQueryString = function(params) { // ../Include/Tools/AjaxRequest.js: 140
    if (params == void 0) // ../Include/Tools/AjaxRequest.js: 141
        params = {}; // ../Include/Tools/AjaxRequest.js: 142
    var a = []; // ../Include/Tools/AjaxRequest.js: 143
    for (var key in params) { // ../Include/Tools/AjaxRequest.js: 144
        var value = params[key]; // ../Include/Tools/AjaxRequest.js: 145
        a.push((value == void 0) ? key : key + '=' + encodeURIComponent(String(value))); // ../Include/Tools/AjaxRequest.js: 146
    } // ../Include/Tools/AjaxRequest.js: 147
    return a.join('&'); // ../Include/Tools/AjaxRequest.js: 148
} // ../Include/Tools/AjaxRequest.js: 149

AjaxRequest.prototype.$OnReadyStateChange = function() { // ../Include/Tools/AjaxRequest.js: 151
    if (this.$completed) { // ../Include/Tools/AjaxRequest.js: 152
        return; // ../Include/Tools/AjaxRequest.js: 153
    } // ../Include/Tools/AjaxRequest.js: 154

    var rs = this.request.readyState; // ../Include/Tools/AjaxRequest.js: 156
    var state = AjaxRequest.States[rs]; // ../Include/Tools/AjaxRequest.js: 157

    if (rs == 4) { // ../Include/Tools/AjaxRequest.js: 159
        this.$completed = true; // ../Include/Tools/AjaxRequest.js: 160
    } // ../Include/Tools/AjaxRequest.js: 161

    try { // ../Include/Tools/AjaxRequest.js: 163
        var onState = this.options['On' + state]; // ../Include/Tools/AjaxRequest.js: 164
        if (onState) // ../Include/Tools/AjaxRequest.js: 165
            onState(this); // ../Include/Tools/AjaxRequest.js: 166
    } // ../Include/Tools/AjaxRequest.js: 167
    catch (e) { // ../Include/Tools/AjaxRequest.js: 168
        if (this.options.OnException) // ../Include/Tools/AjaxRequest.js: 169
            this.options.OnException(this, e); // ../Include/Tools/AjaxRequest.js: 170
        else // ../Include/Tools/AjaxRequest.js: 171
            Fail('AjaxRequest.$OnReadyStateChange', e); // ../Include/Tools/AjaxRequest.js: 172
    } // ../Include/Tools/AjaxRequest.js: 173

    if (this.$completed) { // ../Include/Tools/AjaxRequest.js: 175
        // avoid memory leak (IE)
        this.request.onreadystatechange = function() { }; // ../Include/Tools/AjaxRequest.js: 177

        try { // ../Include/Tools/AjaxRequest.js: 179
            var onCompleted = this.options['On' + (this.Success() ? 'Success' : 'Failure')]; // ../Include/Tools/AjaxRequest.js: 180
            if (onCompleted) // ../Include/Tools/AjaxRequest.js: 181
                onCompleted(this); // ../Include/Tools/AjaxRequest.js: 182
        } // ../Include/Tools/AjaxRequest.js: 183
        catch (e) { // ../Include/Tools/AjaxRequest.js: 184
            if (this.options.OnException) { // ../Include/Tools/AjaxRequest.js: 185
                this.options.OnException(this, e); // ../Include/Tools/AjaxRequest.js: 186
            } // ../Include/Tools/AjaxRequest.js: 187
            else { // ../Include/Tools/AjaxRequest.js: 188
                Fail('AjaxRequest.$OnReadyStateChange', 'IE memory leak code', e); // ../Include/Tools/AjaxRequest.js: 189
            } // ../Include/Tools/AjaxRequest.js: 190
        } // ../Include/Tools/AjaxRequest.js: 191
    } // ../Include/Tools/AjaxRequest.js: 192
} // ../Include/Tools/AjaxRequest.js: 193

AjaxRequest.prototype.$DoRequest = function() { // ../Include/Tools/AjaxRequest.js: 195
    try { // ../Include/Tools/AjaxRequest.js: 196
        var myself = this; // ../Include/Tools/AjaxRequest.js: 197
        this.request.onreadystatechange = function() { myself.$OnReadyStateChange(); } // ../Include/Tools/AjaxRequest.js: 198
        this.request.open(this.method, this.url, this.asynchronous); // ../Include/Tools/AjaxRequest.js: 199
        this.$SetHeaders(); // ../Include/Tools/AjaxRequest.js: 200
        this.request.send(this.body); // ../Include/Tools/AjaxRequest.js: 201
        if (!this.asynchronous) myself.$OnReadyStateChange(); // Force ready state 4 for synchronous requests
    } // ../Include/Tools/AjaxRequest.js: 203
    catch (e) { // ../Include/Tools/AjaxRequest.js: 204
        if (this.options.OnException) { // ../Include/Tools/AjaxRequest.js: 205
            this.options.OnException(this, e); // ../Include/Tools/AjaxRequest.js: 206
        } // ../Include/Tools/AjaxRequest.js: 207
        else { // ../Include/Tools/AjaxRequest.js: 208
            Fail('AjaxRequest.$DoRequest', e); // ../Include/Tools/AjaxRequest.js: 209
        } // ../Include/Tools/AjaxRequest.js: 210
    } // ../Include/Tools/AjaxRequest.js: 211
} // ../Include/Tools/AjaxRequest.js: 212

AjaxRequest.prototype.$SetHeaders = function() { // ../Include/Tools/AjaxRequest.js: 214
    var header = { // ../Include/Tools/AjaxRequest.js: 215
        'Accept': 'text/plain, text/javascript, text/html, text/xml, application/xml, */*' // ../Include/Tools/AjaxRequest.js: 216
    }; // ../Include/Tools/AjaxRequest.js: 217

    if (this.method == 'POST') { // ../Include/Tools/AjaxRequest.js: 219
        if (!!this.contentType) // ../Include/Tools/AjaxRequest.js: 220
            header['Content-type'] = this.contentType + '; charset=UTF-8'; // ../Include/Tools/AjaxRequest.js: 221

        // Force "Connection: close" for older Mozilla browsers to work around a bug where 
        // XMLHttpRequest sends an incorrect Content-length header. See Mozilla Bugzilla #246651.
        if (this.request.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0, 2005])[1] < 2005) // ../Include/Tools/AjaxRequest.js: 225
            header['Connection'] = 'close'; // ../Include/Tools/AjaxRequest.js: 226
    } // ../Include/Tools/AjaxRequest.js: 227

    if (!!this.options.header) { // ../Include/Tools/AjaxRequest.js: 229
        for (var m in this.options.header) { // ../Include/Tools/AjaxRequest.js: 230
            header[m] = this.options.header[m]; // ../Include/Tools/AjaxRequest.js: 231
        } // ../Include/Tools/AjaxRequest.js: 232
    } // ../Include/Tools/AjaxRequest.js: 233
    for (var m in header) { // ../Include/Tools/AjaxRequest.js: 234
        this.request.setRequestHeader(m, header[m]); // ../Include/Tools/AjaxRequest.js: 235
    } // ../Include/Tools/AjaxRequest.js: 236
} // ../Include/Tools/AjaxRequest.js: 237

AjaxRequest.prototype.Abort = function() { // ../Include/Tools/AjaxRequest.js: 239
    if (!this.$completed) { // ../Include/Tools/AjaxRequest.js: 240
        this.request.abort(); // ../Include/Tools/AjaxRequest.js: 241
    }  // ../Include/Tools/AjaxRequest.js: 242
} // ../Include/Tools/AjaxRequest.js: 243

AjaxRequest.prototype.Success = function() { // ../Include/Tools/AjaxRequest.js: 245
    var s = this.GetStatus(); // ../Include/Tools/AjaxRequest.js: 246
    return (!s || (s >= 200 && s < 300)); // ../Include/Tools/AjaxRequest.js: 247
} // ../Include/Tools/AjaxRequest.js: 248

AjaxRequest.prototype.GetStatus = function() { // ../Include/Tools/AjaxRequest.js: 250
    try { // ../Include/Tools/AjaxRequest.js: 251
        return this.request.status || 0; // ../Include/Tools/AjaxRequest.js: 252
    } // ../Include/Tools/AjaxRequest.js: 253
    catch (e) { // ../Include/Tools/AjaxRequest.js: 254
        return 0;  // ../Include/Tools/AjaxRequest.js: 255
    } // ../Include/Tools/AjaxRequest.js: 256
} // ../Include/Tools/AjaxRequest.js: 257

AjaxRequest.prototype.GetResponseHeader = function(name) { // ../Include/Tools/AjaxRequest.js: 259
    try { // ../Include/Tools/AjaxRequest.js: 260
        return this.request.getResponseHeader(name) || null; // ../Include/Tools/AjaxRequest.js: 261
    } // ../Include/Tools/AjaxRequest.js: 262
    catch (e) { // ../Include/Tools/AjaxRequest.js: 263
        return null; // ../Include/Tools/AjaxRequest.js: 264
    } // ../Include/Tools/AjaxRequest.js: 265
} // ../Include/Tools/AjaxRequest.js: 266

AjaxRequest.prototype.GetResponseText = function() { // ../Include/Tools/AjaxRequest.js: 268
    return (this.Success() ? this.request.responseText : null);  // ../Include/Tools/AjaxRequest.js: 269
} // ../Include/Tools/AjaxRequest.js: 270

AjaxRequest.prototype.GetResponseXML = function() { // ../Include/Tools/AjaxRequest.js: 272
    return (this.Success() ? this.request.responseXML : null);  // ../Include/Tools/AjaxRequest.js: 273
} // ../Include/Tools/AjaxRequest.js: 274

/* Rolled into each call above for Fail()
AjaxRequest.prototype.$OnException = function(e) {
  if (this.options.OnException)
    this.options.OnException(this, e);
  else
    Fail('', e);
}
*/ // ../Include/Tools/AjaxRequest.js: 283

//* <FileEnd path="../Include/Tools/AjaxRequest.js"/>


//* <FileBegin path="../Include/Tools/Array.js"/>
//<!--Version 1-->

function ArrayPad(a, obj, count) { // ../Include/Tools/Array.js: 3
    while (a.length < count) // ../Include/Tools/Array.js: 4
        a.push(obj); // ../Include/Tools/Array.js: 5
    return a; // ../Include/Tools/Array.js: 6
} // ../Include/Tools/Array.js: 7

function ArrayClone(obj) { // ../Include/Tools/Array.js: 9
    return [].concat(obj); // ../Include/Tools/Array.js: 10
} // ../Include/Tools/Array.js: 11

function ArrayIndexOf(a, item, i) { // ../Include/Tools/Array.js: 13
    i = i || 0; // ../Include/Tools/Array.js: 14
    var l = a.length; // ../Include/Tools/Array.js: 15
    if (i < 0) i = l + i; // ../Include/Tools/Array.js: 16
    for (; i < l; i++) if (a[i] == item) return i; // ../Include/Tools/Array.js: 17
    return -1; // ../Include/Tools/Array.js: 18
} // ../Include/Tools/Array.js: 19
//* <FileEnd path="../Include/Tools/Array.js"/>


var _ResourceManager = { // ../Include/Tools/ResourceManager.js: 8
    _Cache: {}, // ../Include/Tools/ResourceManager.js: 9
    _RxReference: /[^\{]+|\{(?:rc:[^\}]+\})?/g, // ../Include/Tools/ResourceManager.js: 10
    _LoadResourceObject: function(url, language, loadNeutral) { // ../Include/Tools/ResourceManager.js: 11
        language = language || ''; // ../Include/Tools/ResourceManager.js: 12

        // add default language files
        var languageList = [language]; // ../Include/Tools/ResourceManager.js: 15
        if (loadNeutral && language) // ../Include/Tools/ResourceManager.js: 16
            languageList.push(''); // ../Include/Tools/ResourceManager.js: 17

        // compose resource object
        var resource = {}; // ../Include/Tools/ResourceManager.js: 20
        while (languageList.length) { // ../Include/Tools/ResourceManager.js: 21
            language = languageList.shift().toLowerCase(); // ../Include/Tools/ResourceManager.js: 22
            var key = url + '?' + language; // ../Include/Tools/ResourceManager.js: 23
            var obj = _ResourceManager._Cache[key]; // ../Include/Tools/ResourceManager.js: 24
            if (obj == void 0) { // ../Include/Tools/ResourceManager.js: 25
                obj = _ResourceManager.LoadXmlResource(url, language) || {}; // ../Include/Tools/ResourceManager.js: 26
                _ResourceManager._Cache[key] = obj; // ../Include/Tools/ResourceManager.js: 27
            } // ../Include/Tools/ResourceManager.js: 28
            HashMap.AddNewItems(resource, obj); // ../Include/Tools/ResourceManager.js: 29
        } // ../Include/Tools/ResourceManager.js: 30
        return resource; // ../Include/Tools/ResourceManager.js: 31
    }, // ../Include/Tools/ResourceManager.js: 32
    _BindString: function(stack, rc, rcl, rci, m, v, ri) { // ../Include/Tools/ResourceManager.js: 33
        if (rc[m] !== void 0) // ../Include/Tools/ResourceManager.js: 34
            return rc[m]; // ../Include/Tools/ResourceManager.js: 35

        var nonbase = (v === void 0); // ../Include/Tools/ResourceManager.js: 37
        if (nonbase) { // ../Include/Tools/ResourceManager.js: 38
            // search loops
            for (var i = 0; i < stack.length; ++i) // ../Include/Tools/ResourceManager.js: 40
                if (stack[i] == m) // ../Include/Tools/ResourceManager.js: 41
            { rc[m] = ''; return ''; } // ../Include/Tools/ResourceManager.js: 42

            ri = rci[m]; // ../Include/Tools/ResourceManager.js: 44
            if (ri !== void 0) // ../Include/Tools/ResourceManager.js: 45
                v = rcl[ri][m]; // ../Include/Tools/ResourceManager.js: 46

            if (v === void 0) // ../Include/Tools/ResourceManager.js: 48
            { rc[m] = ''; return ''; } // ../Include/Tools/ResourceManager.js: 49

            stack.push(m); // ../Include/Tools/ResourceManager.js: 51
        } // ../Include/Tools/ResourceManager.js: 52

        // bind string tokens
        var vb = null; // ../Include/Tools/ResourceManager.js: 55
        var vp = null; // ../Include/Tools/ResourceManager.js: 56
        var r = ''; // ../Include/Tools/ResourceManager.js: 57
        var a = v.match(_ResourceManager._RxReference); // ../Include/Tools/ResourceManager.js: 58
        if (a) { // ../Include/Tools/ResourceManager.js: 59
            for (var i = 0, n = a.length; i < n; ++i) { // ../Include/Tools/ResourceManager.js: 60
                var t = a[i]; // ../Include/Tools/ResourceManager.js: 61
                if (t.charAt(0) != '{' || t.length == 1) // ../Include/Tools/ResourceManager.js: 62
                    r += t; // ../Include/Tools/ResourceManager.js: 63
                else { // ../Include/Tools/ResourceManager.js: 64
                    var x = t.substr(4, t.length - 5); // ../Include/Tools/ResourceManager.js: 65
                    if (x == 'base') { // ../Include/Tools/ResourceManager.js: 66
                        if (vb == null) { // ../Include/Tools/ResourceManager.js: 67
                            vb = ''; // ../Include/Tools/ResourceManager.js: 68
                            var bi = ri; // ../Include/Tools/ResourceManager.js: 69
                            while (bi > 0) { // ../Include/Tools/ResourceManager.js: 70
                                --bi; // ../Include/Tools/ResourceManager.js: 71
                                var bs = rcl[bi][m]; // ../Include/Tools/ResourceManager.js: 72
                                if (bs !== void 0) { // ../Include/Tools/ResourceManager.js: 73
                                    vb = _ResourceManager._BindString(stack, rc, rcl, rci, m, bs, bi); // ../Include/Tools/ResourceManager.js: 74
                                    break; // ../Include/Tools/ResourceManager.js: 75
                                } // ../Include/Tools/ResourceManager.js: 76
                            } // ../Include/Tools/ResourceManager.js: 77
                        } // ../Include/Tools/ResourceManager.js: 78
                        r += vb; // ../Include/Tools/ResourceManager.js: 79
                    } // ../Include/Tools/ResourceManager.js: 80
                    else if (x == 'parent') { // ../Include/Tools/ResourceManager.js: 81
                        if (vp == null) { // ../Include/Tools/ResourceManager.js: 82
                            vp = ''; // ../Include/Tools/ResourceManager.js: 83
                            var p = m.lastIndexOf('.'); // ../Include/Tools/ResourceManager.js: 84
                            if (p >= 0) // ../Include/Tools/ResourceManager.js: 85
                                vp = _ResourceManager._BindString(stack, rc, rcl, rci, m.substring(0, p)); // ../Include/Tools/ResourceManager.js: 86
                        } // ../Include/Tools/ResourceManager.js: 87
                        r += vp; // ../Include/Tools/ResourceManager.js: 88
                    } // ../Include/Tools/ResourceManager.js: 89
                    else { // ../Include/Tools/ResourceManager.js: 90
                        var c0 = x.charAt(0); // ../Include/Tools/ResourceManager.js: 91
                        if (c0.toUpperCase() != c0) // ../Include/Tools/ResourceManager.js: 92
                            r += '(Invalid:' + t + ')'; // ../Include/Tools/ResourceManager.js: 93
                        else r += _ResourceManager._BindString(stack, rc, rcl, rci, x); // ../Include/Tools/ResourceManager.js: 94
                    } // ../Include/Tools/ResourceManager.js: 95
                } // ../Include/Tools/ResourceManager.js: 96
            } // ../Include/Tools/ResourceManager.js: 97
        } // ../Include/Tools/ResourceManager.js: 98

        if (nonbase) { // ../Include/Tools/ResourceManager.js: 100
            rc[m] = r; // ../Include/Tools/ResourceManager.js: 101
            stack.pop(); // ../Include/Tools/ResourceManager.js: 102
        } // ../Include/Tools/ResourceManager.js: 103

        return r; // ../Include/Tools/ResourceManager.js: 105
    }, // ../Include/Tools/ResourceManager.js: 106
    _BindResources: function(rcl, def) { // ../Include/Tools/ResourceManager.js: 107
        // merge plain strings
        var rc = {}; // ../Include/Tools/ResourceManager.js: 109
        //Add defaults
        for (var a in def) { // ../Include/Tools/ResourceManager.js: 111
            rc[a] = def[a]; // ../Include/Tools/ResourceManager.js: 112
        } // ../Include/Tools/ResourceManager.js: 113

        var rci = {}; // ../Include/Tools/ResourceManager.js: 115
        for (var i = rcl.length; i >= 0; --i) { // ../Include/Tools/ResourceManager.js: 116
            var rcn = rcl[i]; // ../Include/Tools/ResourceManager.js: 117
            for (var m in rcn) { // ../Include/Tools/ResourceManager.js: 118
                if (rc[m] !== void 0) // ../Include/Tools/ResourceManager.js: 119
                    continue; // ../Include/Tools/ResourceManager.js: 120
                var v = rcn[m]; // ../Include/Tools/ResourceManager.js: 121
                if (rcn[m].indexOf('{rc:') < 0) { // ../Include/Tools/ResourceManager.js: 122
                    rc[m] = v; // ../Include/Tools/ResourceManager.js: 123
                } // ../Include/Tools/ResourceManager.js: 124
                else if (rci[m] === void 0) // ../Include/Tools/ResourceManager.js: 125
                    rci[m] = i; // ../Include/Tools/ResourceManager.js: 126
            } // ../Include/Tools/ResourceManager.js: 127
        } // ../Include/Tools/ResourceManager.js: 128

        // bind resource strings containing references
        var empty = []; // ../Include/Tools/ResourceManager.js: 131
        for (var m in rci) { // ../Include/Tools/ResourceManager.js: 132
            _ResourceManager._BindString(empty, rc, rcl, rci, m); // ../Include/Tools/ResourceManager.js: 133
        } // ../Include/Tools/ResourceManager.js: 134

        return rc; // ../Include/Tools/ResourceManager.js: 136
    }, // ../Include/Tools/ResourceManager.js: 137
    _LoadResources: function(that, lang) { // ../Include/Tools/ResourceManager.js: 138
        var rcl = that.ParentResource ? _ResourceManager._LoadResources(that.ParentResource.that, lang) : []; // ../Include/Tools/ResourceManager.js: 139
        var rcn = {}; // ../Include/Tools/ResourceManager.js: 140
        for (var i = 0, n = that.ResourceSet.length; i < n; ++i) { // ../Include/Tools/ResourceManager.js: 141
            var rco = _ResourceManager._LoadResourceObject(that.ResourceSet[i], lang, 'en', true); // ../Include/Tools/ResourceManager.js: 142
            if (rco) // ../Include/Tools/ResourceManager.js: 143
                HashMap.Extend(rcn, rco); // ../Include/Tools/ResourceManager.js: 144
        } // ../Include/Tools/ResourceManager.js: 145
        rcl.push(rcn); // ../Include/Tools/ResourceManager.js: 146
        return rcl; // ../Include/Tools/ResourceManager.js: 147
    }, // ../Include/Tools/ResourceManager.js: 148
    AttachResource: function(that, url) { // ../Include/Tools/ResourceManager.js: 149
        var index = ArrayIndexOf(that.ResourceSet, url); // ../Include/Tools/ResourceManager.js: 150
        if (index != -1) // ../Include/Tools/ResourceManager.js: 151
            that.ResourceSet.splice(index, 1); // ../Include/Tools/ResourceManager.js: 152
        that.ResourceSet.push(url); // ../Include/Tools/ResourceManager.js: 153
    }, // ../Include/Tools/ResourceManager.js: 154
    LoadResources: function(that, language, def) { // ../Include/Tools/ResourceManager.js: 155
        language = language ? language.toUpperCase() : ''; // ../Include/Tools/ResourceManager.js: 156
        if (that.Language == language) // ../Include/Tools/ResourceManager.js: 157
            return that.ResourceObject; // ../Include/Tools/ResourceManager.js: 158

        var rc = _ResourceManager._BindResources(_ResourceManager._LoadResources(that, language), def); // ../Include/Tools/ResourceManager.js: 160
        that.Language = language; // ../Include/Tools/ResourceManager.js: 161
        that.ResourceObject = rc; // ../Include/Tools/ResourceManager.js: 162
        return rc; // ../Include/Tools/ResourceManager.js: 163
    }, // ../Include/Tools/ResourceManager.js: 164
    _GetXmlNodeTextContent: function(node) { // ../Include/Tools/ResourceManager.js: 165
        if (node.textConent !== void 0) // ../Include/Tools/ResourceManager.js: 166
            return node.textContent; // ../Include/Tools/ResourceManager.js: 167
        var c = node.childNodes; // ../Include/Tools/ResourceManager.js: 168
        var t = ''; // ../Include/Tools/ResourceManager.js: 169
        for (var i = 0, n = c.length; i < n; ++i) { // ../Include/Tools/ResourceManager.js: 170
            var $i = c[i]; // ../Include/Tools/ResourceManager.js: 171
            if ($i.nodeType == 1) // ../Include/Tools/ResourceManager.js: 172
                t += _ResourceManager._GetXmlNodeTextContent($i); // ../Include/Tools/ResourceManager.js: 173
            else if ($i.nodeType == 3) // ../Include/Tools/ResourceManager.js: 174
                t += $i.nodeValue; // ../Include/Tools/ResourceManager.js: 175
            else if ($i.nodeType == 4) // ../Include/Tools/ResourceManager.js: 176
                t += $i.data; // ../Include/Tools/ResourceManager.js: 177
        } // ../Include/Tools/ResourceManager.js: 178
        return t; // ../Include/Tools/ResourceManager.js: 179
    }, // ../Include/Tools/ResourceManager.js: 180
    GetXmlResourceUrl: function(url, lang) { // ../Include/Tools/ResourceManager.js: 181
        url = url || ''; // ../Include/Tools/ResourceManager.js: 182
        var rclang = (lang && lang != '') ? lang.toLowerCase() + '.' : ''; // ../Include/Tools/ResourceManager.js: 183
        var rcs = ((url == '' || /[\/]$/.test(url)) ? '' : '.') + rclang + 'resources.xml'; // ../Include/Tools/ResourceManager.js: 184
        return url.replace(/(?:\.[^\.\/]*)?$/, rcs); // ../Include/Tools/ResourceManager.js: 185
    }, // ../Include/Tools/ResourceManager.js: 186
    LoadXmlResource: function(url, lang) { // ../Include/Tools/ResourceManager.js: 187
        lang = lang || ''; // ../Include/Tools/ResourceManager.js: 188
        var rsu = _ResourceManager.GetXmlResourceUrl(url, lang); // ../Include/Tools/ResourceManager.js: 189
        var xrc = AjaxRequest.LoadXml(rsu); // ../Include/Tools/ResourceManager.js: 190
        var rc = {}; // ../Include/Tools/ResourceManager.js: 191
        if (xrc) { // ../Include/Tools/ResourceManager.js: 192
            var erg = xrc.getElementsByTagName('resource'); // ../Include/Tools/ResourceManager.js: 193
            for (var i = 0, n = erg.length; i < n; ++i) { // ../Include/Tools/ResourceManager.js: 194
                var $i = erg[i]; // ../Include/Tools/ResourceManager.js: 195
                //Matyi: The following failed on Opera
                //var a = $i.attributes.getNamedItem('xml:id').nodeValue;
                var a = $i.attributes[0].nodeValue; // ../Include/Tools/ResourceManager.js: 198
                if (!a) continue; // ../Include/Tools/ResourceManager.js: 199
                rc[a] = Trim(_ResourceManager._GetXmlNodeTextContent($i)); // ../Include/Tools/ResourceManager.js: 200
            } // ../Include/Tools/ResourceManager.js: 201
        } // ../Include/Tools/ResourceManager.js: 202
        return rc; // ../Include/Tools/ResourceManager.js: 203
    } // ../Include/Tools/ResourceManager.js: 204
}; // ../Include/Tools/ResourceManager.js: 205

var ResourceManager = { // ../Include/Tools/ResourceManager.js: 207
    Create: function(parentResource) { // ../Include/Tools/ResourceManager.js: 208
        var that = {}; // ../Include/Tools/ResourceManager.js: 209
        that.ParentResource = parentResource || null; // ../Include/Tools/ResourceManager.js: 210
        that.Language = null; // ../Include/Tools/ResourceManager.js: 211
        that.ResourceObject = {}; // ../Include/Tools/ResourceManager.js: 212
        that.ResourceSet = []; // ../Include/Tools/ResourceManager.js: 213
        var rc = function(id, defaultValue) { // ../Include/Tools/ResourceManager.js: 214
            var value = that.ResourceObject[id]; // ../Include/Tools/ResourceManager.js: 215
            var returnValue = ((value === void 0) ? ((defaultValue === void 0) ? 'Undefined:' + id : defaultValue) : value); // ../Include/Tools/ResourceManager.js: 216
            return returnValue; // ../Include/Tools/ResourceManager.js: 217
        } // ../Include/Tools/ResourceManager.js: 218
        rc.AttachResource = function(url) { _ResourceManager.AttachResource(that, url) }; // ../Include/Tools/ResourceManager.js: 219
        rc.LoadResources = function(lang, def) { _ResourceManager.LoadResources(that, lang, def) }; // ../Include/Tools/ResourceManager.js: 220
        rc.GetStrings = function() { return that.ResourceObject; }; // ../Include/Tools/ResourceManager.js: 221
        rc.that = that; // ../Include/Tools/ResourceManager.js: 222
        return rc; // ../Include/Tools/ResourceManager.js: 223
    }, // ../Include/Tools/ResourceManager.js: 224
    GetResources: function(urls, lang) { // ../Include/Tools/ResourceManager.js: 225
        var rc = ResourceManager.Create(); // ../Include/Tools/ResourceManager.js: 226
        urls = (urls && urls.length) ? (IsString(urls) ? ['' + urls] : urls) : ['']; // ../Include/Tools/ResourceManager.js: 227
        for (var i = 0, n = urls.length; i < n; ++i) // ../Include/Tools/ResourceManager.js: 228
            rc.AttachResource(urls[i]); // ../Include/Tools/ResourceManager.js: 229
        rc.LoadResources(lang); // ../Include/Tools/ResourceManager.js: 230
        return rc; // ../Include/Tools/ResourceManager.js: 231
    } // ../Include/Tools/ResourceManager.js: 232
}; // ../Include/Tools/ResourceManager.js: 233

// Resource
// ==========================================================================

/*
Gkod.Helper.GetResourceUrl = function(url, lang) {
    var l_lang = lang.toLowerCase();
    var rcurl = url.replace(/\.([^\.\/]*)$/, '.' + l_lang + '.$1');
    if (rcurl == url) rcurl += '.' + l_lang;
    return rcurl;
}
*/ // ../Include/Tools/ResourceManager.js: 245

ResourceManager.ContentURL = ''; // ../Include/Tools/ResourceManager.js: 247
ResourceManager.GetContentURL = function() { // ../Include/Tools/ResourceManager.js: 248
    return ResourceManager.ContentURL; // ../Include/Tools/ResourceManager.js: 249
}; // ../Include/Tools/ResourceManager.js: 250

ResourceManager.Resources = {}; // ../Include/Tools/ResourceManager.js: 252
ResourceManager.GetResource = function(id) { // ../Include/Tools/ResourceManager.js: 253
    return ResourceManager.Resources[id]; // ../Include/Tools/ResourceManager.js: 254
}; // ../Include/Tools/ResourceManager.js: 255

//* <FileEnd path="../Include/Tools/ResourceManager.js"/>


//* <FileBegin path="stdhemi/resources/resources.js"/>
var rm = ResourceManager.Create(); // stdhemi/resources/resources.js: 1
var url = ResourceManager.GetContentURL() + 'stdhemi/smarthelp/strings.resources'; // stdhemi/resources/resources.js: 2
rm.AttachResource(url); // stdhemi/resources/resources.js: 3
rm.LoadResources(/*null, { 'PRODUCTNAME': 'SmartHelp', 'SOT_PRODUCTNAME': 'Stay-On-Top' }*/); // stdhemi/resources/resources.js: 4
ResourceManager.Resources = rm.GetStrings(); // stdhemi/resources/resources.js: 5

//* <FileEnd path="stdhemi/resources/resources.js"/>


//* <FileBegin path="../Include/Tools/Resize.js"/>
//x ///<reference path="Trace.js"/>

function GetContentWidth() { // ../Include/Tools/Resize.js: 3
    var cw = 0; // ../Include/Tools/Resize.js: 4
    if (window.innerWidth) { // ../Include/Tools/Resize.js: 5
        cw = window.innerWidth; // ../Include/Tools/Resize.js: 6
    } // ../Include/Tools/Resize.js: 7
    else if (document.documentElement.clientWidth) { // ../Include/Tools/Resize.js: 8
        cw = document.documentElement.clientWidth; // ../Include/Tools/Resize.js: 9
    } // ../Include/Tools/Resize.js: 10
    else if (document.body.clientWidth) { // ../Include/Tools/Resize.js: 11
        cw = document.body.clientWidth; // ../Include/Tools/Resize.js: 12
    } // ../Include/Tools/Resize.js: 13
    return cw; // ../Include/Tools/Resize.js: 14
} // ../Include/Tools/Resize.js: 15

function GetContentHeight() { // ../Include/Tools/Resize.js: 17
    var ch = 0; // ../Include/Tools/Resize.js: 18
    if (window.innerHeight) { // ../Include/Tools/Resize.js: 19
        ch = window.innerHeight; // ../Include/Tools/Resize.js: 20
    } // ../Include/Tools/Resize.js: 21
    else if (document.documentElement.clientHeight) { // ../Include/Tools/Resize.js: 22
        ch = document.documentElement.clientHeight; // ../Include/Tools/Resize.js: 23
    } // ../Include/Tools/Resize.js: 24
    else if (document.body.clientHeight) { // ../Include/Tools/Resize.js: 25
        ch = document.body.clientHeight; // ../Include/Tools/Resize.js: 26
    } // ../Include/Tools/Resize.js: 27
    return ch; // ../Include/Tools/Resize.js: 28
} // ../Include/Tools/Resize.js: 29

function Resize(id) { // ../Include/Tools/Resize.js: 31
    var fr = document.getElementById(id); // ../Include/Tools/Resize.js: 32
    if (fr) { // ../Include/Tools/Resize.js: 33
        try { // ../Include/Tools/Resize.js: 34
            var ch = GetContentHeight(); // ../Include/Tools/Resize.js: 35
            var cw = GetContentWidth(); // ../Include/Tools/Resize.js: 36
            fr.setAttribute('height', ch + 'px'); // ../Include/Tools/Resize.js: 37
            fr.setAttribute('width', cw + 'px'); // ../Include/Tools/Resize.js: 38
            Trace('Resize', id + ' ch = ' + ch + ' cw = ' + cw); // ../Include/Tools/Resize.js: 39
        } // ../Include/Tools/Resize.js: 40
        catch (e) { // ../Include/Tools/Resize.js: 41
            Trace('Resize', typeof (e) == 'string' ? e : e.message); // ../Include/Tools/Resize.js: 42
        } // ../Include/Tools/Resize.js: 43
    } // ../Include/Tools/Resize.js: 44
} // ../Include/Tools/Resize.js: 45


//* <FileEnd path="../Include/Tools/Resize.js"/>


//* <FileBegin path="../Include/Gateway/GatewayCookie.js"/>
//x /// <reference path="../Tools/Cookie.js"/>

//* <FileBegin path="../Include/Tools/Cookie.js"/>

var _Cookie = { // ../Include/Tools/Cookie.js: 2
    Create: function(name, evalue, keepDays, path, domain, secure) { // ../Include/Tools/Cookie.js: 3
        var ename = encodeURIComponent(name); // ../Include/Tools/Cookie.js: 4
        var cookie = ename + '=' + evalue; // ../Include/Tools/Cookie.js: 5
        if (keepDays >= -1) { // ../Include/Tools/Cookie.js: 6
            var time = new Date().getTime(); // ../Include/Tools/Cookie.js: 7
            var millisecondsSinceMidnight = time % 86400000; // ../Include/Tools/Cookie.js: 8
            var expires = new Date(time - millisecondsSinceMidnight + 86400000 * (keepDays + 1)); // ../Include/Tools/Cookie.js: 9
            cookie += "; expires=" + expires.toGMTString(); // ../Include/Tools/Cookie.js: 10
        } // ../Include/Tools/Cookie.js: 11
        if (path) // ../Include/Tools/Cookie.js: 12
            cookie += "; path=" + path; // ../Include/Tools/Cookie.js: 13
        if (domain) // ../Include/Tools/Cookie.js: 14
            cookie += "; domain=" + domain; // ../Include/Tools/Cookie.js: 15
        if (secure) // ../Include/Tools/Cookie.js: 16
            cookie += "; secure"; // ../Include/Tools/Cookie.js: 17
        return cookie; // ../Include/Tools/Cookie.js: 18
    }, // ../Include/Tools/Cookie.js: 19
    TryGet: function(cookie, name) { // ../Include/Tools/Cookie.js: 20
        var ename = encodeURIComponent(name); // ../Include/Tools/Cookie.js: 21
        var nameValueList = cookie.split('; '); // ../Include/Tools/Cookie.js: 22
        for (var i = 0, n = nameValueList.length; i < n; ++i) { // ../Include/Tools/Cookie.js: 23
            var nameValue = nameValueList[i]; // ../Include/Tools/Cookie.js: 24
            if (nameValue == ename) // ../Include/Tools/Cookie.js: 25
                return ''; // ../Include/Tools/Cookie.js: 26
            var eqPos = nameValue.indexOf('='); // ../Include/Tools/Cookie.js: 27
            if ((eqPos > 0) && (eqPos == ename.length) && (nameValue.substr(0, eqPos) == ename)) // ../Include/Tools/Cookie.js: 28
                return nameValue.substr(eqPos + 1); // ../Include/Tools/Cookie.js: 29
        } // ../Include/Tools/Cookie.js: 30
        return null; // ../Include/Tools/Cookie.js: 31
    }, // ../Include/Tools/Cookie.js: 32
    EncodeHash: function(hash) { // ../Include/Tools/Cookie.js: 33
        if (!hash) // ../Include/Tools/Cookie.js: 34
            return ''; // ../Include/Tools/Cookie.js: 35
        var tokens = []; // ../Include/Tools/Cookie.js: 36
        for (var key in hash) // ../Include/Tools/Cookie.js: 37
            tokens.push(encodeURIComponent(key) + ':' + encodeURIComponent(hash[key])); // ../Include/Tools/Cookie.js: 38
        return tokens.join('&'); // ../Include/Tools/Cookie.js: 39
    }, // ../Include/Tools/Cookie.js: 40
    DecodeHash: function(value) { // ../Include/Tools/Cookie.js: 41
        var hash = {}; // ../Include/Tools/Cookie.js: 42
        if (value) { // ../Include/Tools/Cookie.js: 43
            var tokens = value.split('&'); // ../Include/Tools/Cookie.js: 44
            for (var i = 0, n = tokens.length; i < n; ++i) { // ../Include/Tools/Cookie.js: 45
                var keyValue = tokens[i].split(':'); // ../Include/Tools/Cookie.js: 46
                hash[decodeURIComponent(keyValue[0])] = ((keyValue.length == 2) ? decodeURIComponent(keyValue[1]) : ''); // ../Include/Tools/Cookie.js: 47
            } // ../Include/Tools/Cookie.js: 48
        } // ../Include/Tools/Cookie.js: 49
        return hash; // ../Include/Tools/Cookie.js: 50
    } // ../Include/Tools/Cookie.js: 51
}; // ../Include/Tools/Cookie.js: 52

/** @constructor */ // ../Include/Tools/Cookie.js: 54
var Cookie = { // ../Include/Tools/Cookie.js: 55
    CreateFromValue: function(name, value, keepDays, path, domain, secure) { // ../Include/Tools/Cookie.js: 56
        return _Cookie.Create(name, encodeURIComponent(value), keepDays, path, domain, secure); // ../Include/Tools/Cookie.js: 57
    }, // ../Include/Tools/Cookie.js: 58
    CreateFromHash: function(name, hash, keepDays, path, domain, secure) { // ../Include/Tools/Cookie.js: 59
        return _Cookie.Create(name, _Cookie.EncodeHash(hash), keepDays, path, domain, secure); // ../Include/Tools/Cookie.js: 60
    }, // ../Include/Tools/Cookie.js: 61
    CreateExpired: function(name, path, domain) { // ../Include/Tools/Cookie.js: 62
        return _Cookie.Create(name, '', -1, path, domain); // ../Include/Tools/Cookie.js: 63
    }, // ../Include/Tools/Cookie.js: 64
    TryGetValue: function(cookie, name, defaultValue) { // ../Include/Tools/Cookie.js: 65
        var evalue = _Cookie.TryGet(cookie, name); // ../Include/Tools/Cookie.js: 66
        if (evalue == null) // ../Include/Tools/Cookie.js: 67
            return defaultValue; // ../Include/Tools/Cookie.js: 68
        return encodeURIComponent(evalue); // ../Include/Tools/Cookie.js: 69
    }, // ../Include/Tools/Cookie.js: 70
    TryGetHash: function(cookie, name, defaultValue) { // ../Include/Tools/Cookie.js: 71
        var evalue = _Cookie.TryGet(cookie, name); // ../Include/Tools/Cookie.js: 72
        if (evalue == null) // ../Include/Tools/Cookie.js: 73
            return defaultValue; // ../Include/Tools/Cookie.js: 74
        return _Cookie.DecodeHash(evalue); // ../Include/Tools/Cookie.js: 75
    } // ../Include/Tools/Cookie.js: 76
} // ../Include/Tools/Cookie.js: 77

//* <FileEnd path="../Include/Tools/Cookie.js"/>


var GatewayCookie = { // ../Include/Gateway/GatewayCookie.js: 3
    Set: function(_cookie, _property, _value) { // ../Include/Gateway/GatewayCookie.js: 4
        var hash = Cookie.TryGetHash(document.cookie, _cookie, {}); // ../Include/Gateway/GatewayCookie.js: 5
        hash[_property] = _value; // ../Include/Gateway/GatewayCookie.js: 6
        document.cookie = Cookie.CreateFromHash(_cookie, hash, 365, '/'); // ../Include/Gateway/GatewayCookie.js: 7
    }, // ../Include/Gateway/GatewayCookie.js: 8

    Get: function(_cookie, _property) { // ../Include/Gateway/GatewayCookie.js: 10
        var hash = Cookie.TryGetHash(document.cookie, _cookie, {}); // ../Include/Gateway/GatewayCookie.js: 11
        return hash[_property]; // ../Include/Gateway/GatewayCookie.js: 12
    }, // ../Include/Gateway/GatewayCookie.js: 13

    GetAll: function(_cookie) { // ../Include/Gateway/GatewayCookie.js: 15
        return Cookie.TryGetHash(document.cookie, _cookie, {}); // ../Include/Gateway/GatewayCookie.js: 16
    } // ../Include/Gateway/GatewayCookie.js: 17
}; // ../Include/Gateway/GatewayCookie.js: 18

//* <FileEnd path="../Include/Gateway/GatewayCookie.js"/>


window.onresize = function() { Resize('setupframe'); } // stdhemi/smarthelp/smarthelpsetup.js: 6
var browser = ''; // stdhemi/smarthelp/smarthelpsetup.js: 7
document.title = ResourceManager.GetResource('SETUP_TITLE'); // stdhemi/smarthelp/smarthelpsetup.js: 8
//test page
var z = location.search.substr(1); // stdhemi/smarthelp/smarthelpsetup.js: 10
var k = z.split('&'); // stdhemi/smarthelp/smarthelpsetup.js: 11
if (k.length == 1) { // stdhemi/smarthelp/smarthelpsetup.js: 12
    var l = k[0].split('='); // stdhemi/smarthelp/smarthelpsetup.js: 13
    if (l[0] == 'showtestpage') { // stdhemi/smarthelp/smarthelpsetup.js: 14
        GatewayCookie.Set('HemiCookie', 'hemiparamtest', l[1].toString()); // stdhemi/smarthelp/smarthelpsetup.js: 15
    } // stdhemi/smarthelp/smarthelpsetup.js: 16
} // stdhemi/smarthelp/smarthelpsetup.js: 17

function SetFrame() { // stdhemi/smarthelp/smarthelpsetup.js: 19
    var fr = document.getElementById('setupframe'); // stdhemi/smarthelp/smarthelpsetup.js: 20
    var ch = GetContentHeight(); // stdhemi/smarthelp/smarthelpsetup.js: 21
    var cw = GetContentWidth(); // stdhemi/smarthelp/smarthelpsetup.js: 22
    fr.setAttribute('height', ch + 'px'); // stdhemi/smarthelp/smarthelpsetup.js: 23
    fr.setAttribute('width', cw + 'px'); // stdhemi/smarthelp/smarthelpsetup.js: 24
    if (browser == 'Firefox') { // stdhemi/smarthelp/smarthelpsetup.js: 25
        fr.setAttribute('src', 'stdhemi/smarthelpff/smarthelpff.html' + location.search); // stdhemi/smarthelp/smarthelpsetup.js: 26
    } // stdhemi/smarthelp/smarthelpsetup.js: 27
    else if (browser == 'MSIE') { // stdhemi/smarthelp/smarthelpsetup.js: 28
        fr.setAttribute('src', 'stdhemi/smarthelpie/smarthelpie.html' + location.search); // stdhemi/smarthelp/smarthelpsetup.js: 29
    } // stdhemi/smarthelp/smarthelpsetup.js: 30
} // stdhemi/smarthelp/smarthelpsetup.js: 31

function IsSupportedBrowser() { // stdhemi/smarthelp/smarthelpsetup.js: 33
    var s = navigator.userAgent; // stdhemi/smarthelp/smarthelpsetup.js: 34
    var k = -1; // stdhemi/smarthelp/smarthelpsetup.js: 35
    if (s.indexOf("MSIE") >= 0) { // stdhemi/smarthelp/smarthelpsetup.js: 36
        k = s.indexOf("MSIE") + 5; // stdhemi/smarthelp/smarthelpsetup.js: 37
        if (parseInt(s.substr(k)) >= 7) { //IE 7.0
            browser = 'MSIE'; // stdhemi/smarthelp/smarthelpsetup.js: 39
            return true; // stdhemi/smarthelp/smarthelpsetup.js: 40
        } // stdhemi/smarthelp/smarthelpsetup.js: 41
    } // stdhemi/smarthelp/smarthelpsetup.js: 42
    else if (s.indexOf("Firefox") >= 0) { // stdhemi/smarthelp/smarthelpsetup.js: 43
        k = s.indexOf("Firefox") + 8; // stdhemi/smarthelp/smarthelpsetup.js: 44
        if (parseInt(s.substr(k)) >= 3) { // stdhemi/smarthelp/smarthelpsetup.js: 45
            if ((parseInt(s.substr(k)) == 3 && parseInt(s.substr(k + 2, 1)) > 5) || parseInt(s.substr(k)) > 3) { // stdhemi/smarthelp/smarthelpsetup.js: 46
                browser = 'Firefox'; // stdhemi/smarthelp/smarthelpsetup.js: 47
                return true; // stdhemi/smarthelp/smarthelpsetup.js: 48
            } // stdhemi/smarthelp/smarthelpsetup.js: 49
        } // stdhemi/smarthelp/smarthelpsetup.js: 50
    } // stdhemi/smarthelp/smarthelpsetup.js: 51
    return false; // stdhemi/smarthelp/smarthelpsetup.js: 52
} // stdhemi/smarthelp/smarthelpsetup.js: 53

function IsSupportedProtocol() { // stdhemi/smarthelp/smarthelpsetup.js: 55
    var z = window.location.href; // stdhemi/smarthelp/smarthelpsetup.js: 56
    if (z.indexOf('http://') == 0 || z.indexOf('https://') == 0) { // stdhemi/smarthelp/smarthelpsetup.js: 57
        return true; // stdhemi/smarthelp/smarthelpsetup.js: 58
    } // stdhemi/smarthelp/smarthelpsetup.js: 59
    return false; // stdhemi/smarthelp/smarthelpsetup.js: 60
} // stdhemi/smarthelp/smarthelpsetup.js: 61

function Load() { // stdhemi/smarthelp/smarthelpsetup.js: 63
    if (IsSupportedBrowser() && IsSupportedProtocol()) { // stdhemi/smarthelp/smarthelpsetup.js: 64
        var content = document.createElement('iframe'); // stdhemi/smarthelp/smarthelpsetup.js: 65
        content.setAttribute('width', '0'); // stdhemi/smarthelp/smarthelpsetup.js: 66
        content.setAttribute('height', '0'); // stdhemi/smarthelp/smarthelpsetup.js: 67
        content.setAttribute('frameBorder', '0'); // stdhemi/smarthelp/smarthelpsetup.js: 68
        content.setAttribute('id', 'setupframe'); // stdhemi/smarthelp/smarthelpsetup.js: 69
        document.body.appendChild(content); // stdhemi/smarthelp/smarthelpsetup.js: 70
        setTimeout(SetFrame, 100); // stdhemi/smarthelp/smarthelpsetup.js: 71
    } // stdhemi/smarthelp/smarthelpsetup.js: 72
    else { // stdhemi/smarthelp/smarthelpsetup.js: 73
        var a = '', b = '', c = ''; // stdhemi/smarthelp/smarthelpsetup.js: 74
        if (!IsSupportedBrowser()) { // stdhemi/smarthelp/smarthelpsetup.js: 75
            a = ResourceManager.GetResource('SETUP_SUPPORTED_BROWSERS'); // stdhemi/smarthelp/smarthelpsetup.js: 76
        } // stdhemi/smarthelp/smarthelpsetup.js: 77
        else if (!IsSupportedProtocol()) { // stdhemi/smarthelp/smarthelpsetup.js: 78
            a = ResourceManager.GerResource('SETUP_NOTSUPPORTED_PROT'); // stdhemi/smarthelp/smarthelpsetup.js: 79
        } // stdhemi/smarthelp/smarthelpsetup.js: 80
        var z = '<table><tr><td><img src=\"img/error.png\" alt=\"Error\"/></td><td><div>'; // stdhemi/smarthelp/smarthelpsetup.js: 81
        z += a + '</div></td></tr></table>'; // stdhemi/smarthelp/smarthelpsetup.js: 82
        document.body.innerHTML = z; // stdhemi/smarthelp/smarthelpsetup.js: 83
    } // stdhemi/smarthelp/smarthelpsetup.js: 84
} // stdhemi/smarthelp/smarthelpsetup.js: 85
//* <FileEnd path="stdhemi/smarthelp/smarthelpsetup.js"/>
