(function(window){
    "use strict";

    window.defined = function (x){
        return (typeof(x) !== 'undefined') ? true : false;
    };

    window.isUndefined = function (x){
        return (typeof(x) === 'undefined') ? true : false;
    };

    window.isNull = function (x){
        return (x === null) ? true : false;
    };

    window.definedNotNull = function (x){
        return (defined(x) && !isNull(x));
    };

    window.log = function (msg){
        if ((typeof(console) !== 'undefined') && (window.location.port == "8085")){
            console.log(msg);
        }
    };

    window.createNamespace = function (namespaceString){
        var growingNamespace = window,
            namespaceNodes    = namespaceString.split('.'),
            numNamespaceNodes = namespaceNodes.length;

        for (var i = 0; i < numNamespaceNodes; i++){
            if (isUndefined(growingNamespace[namespaceNodes[i]])){
                growingNamespace[namespaceNodes[i]] = {};
            }
            growingNamespace = growingNamespace[namespaceNodes[i]];
        }
        return growingNamespace;
    };

    createNamespace('Rtk.ThIntl.Util.Event');
    Rtk.ThIntl.Util.Event.Keys = function (){
        return { 
            arrowDown   : 40,
            arrowLeft   : 37,
            arrowRight  : 39,
            arrowUp     : 38, 
            backslash   : 220,
            enter       : 13, 
            escape      : 27, 
            numpadSlash : 111, 
            slash       : 191, 
            tab         : 9,
            fTwo        : 113,
            fTen        : 121
        };
    }();
})(this);

if (typeof(jQuery) !== 'undefined'){
    (function(window, $){
            window.found = function (elmt){
                return (elmt && ($(elmt).size() > 0)) ? true : false;
            };
    })(this, jQuery);
}

