
/*
 * Copyright 2005- by ERDAS Inc.,
 * 18 Av Wallonie, 4460 Grace-Hollogne, Belgium.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ERDAS Inc.("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with ERDAS Inc..
 *
 *
 * IMPORTANT
 *
 * This file is internal to RedSpider Enterprise Tilapia toolkit.  It is subject to
 * changes and CANNOT BE DIRECTLY ACCESSED BY APPLICATIONS.  Only
 * the  objects contained in the ERDAS package may be used.
 */

/*
 * Some IE-specific stuff. Especially for knowing what format to
 * choose for images: GIF or PNG?
 */

var IE = false; /*@cc_on IE=true; @*/
var IE7 = false;
/*@cc_on
  /*@if (@_jscript_version >= 5.7)
     IE7=true;
  @else @*/

  /*@end
@*/


/**
 * Create a new XMLHttpRequest object.
 *
 * Inspired from
 * <a href="http://www.webpasties.com/xmlHttpRequest/">here</a>
 *
 * @return a new XMLHttpRequest object.
 */
function createXMLHttpRequest () {

        var xmlhttp;
        /*@cc_on
         @if (@_jscript_version >= 5)
         try {
         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {

         try {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
         } catch (E) {
         xmlhttp = false;
         }
         } @else
         xmlhttp = false;
         @end @*/

        if (! xmlhttp && typeof XMLHttpRequest !== 'undefined') {

                try {

                        xmlhttp = new XMLHttpRequest();

                } catch (e) {

                        xmlhttp = false;
                }
        }

        return xmlhttp;
}
/*
 * Copyright 2005- by ERDAS Inc.,
 * 18 Av Wallonie, 4460 Grace-Hollogne, Belgium.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ERDAS Inc.("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with ERDAS Inc..
 *
 *
 * IMPORTANT
 *
 * This file is internal to RedSpider Enterprise Tilapia toolkit.  It is subject to
 * changes and CANNOT BE DIRECTLY ACCESSED BY APPLICATIONS.  Only
 * the  objects contained in the ERDAS package may be used.
 */

/*extern ERDAS,YAHOO*/

/**
 *  Name spaces definition file.
 */


/**
 * This declares the 'root' name space of the whole Tilapia tookit, 'ERDAS'.
 * It provides a namespace creation helper method.
 */
if (typeof ERDAS === "undefined") {

        /**
         * @class ERDAS
         * @static
         */
        var ERDAS = {};


        /**
         * Backward-compatibility binding to ERDAS web toolkit
         *
         * @class IONIC
         * @static
         */
        var IONIC = ERDAS;


        /**
         * Define 'namespaces' in the ERDAS namespace
         *
         * <p>
         *   Those namespaces can be composed; i.e., "util.misc". Is
         *   such cases, that will result in two namespaces being
         *   created
         *   <ol>
         *     <li>the "util" namespace in the "ERDAS" parent</li>
         *     <li>the "misc" namespace in the "util" parent</li>
         *   </ol>
         * </p>
         */
        ERDAS.defns = function () {

                var i, n, j, n2;
                var curns, parts, curpart, node;

                for (i = 0, n = arguments.length; i < n; i ++) {

                        curns = arguments [i];

                        parts = curns.split ('.');

                        node = ERDAS;
                        for (j = 0, n2 = parts.length; j < n2; j ++) {

                                curpart = parts [j];

                                // Ignore an "ERDAS" prefix
                                if (curpart === "ERDAS") {

                                        continue;
                                }

                                if (typeof (node [curpart]) === "undefined") {

                                        node [curpart] = {};
                                }
                                node = node [curpart];
                        }
                }
        };
}


/****************************************************************************
 *                                                                          *
 * ONLY the API contained in the ERDAS package is user-accessible.  The *
 * other packages are internal to Tilapia.                                  *
 *                                                                          *
 ****************************************************************************/


/**
 * ERDAS.maps: The 'map' object and other objects directly related to it
 * (key maps, layers, map service discovery,...).
 *
 * @class Basic mapping functionnalities
 * @name ERDAS.maps
 * @namespace
 */
ERDAS.defns ("maps");



/**
 * ERDAS.maps.keymap: All that's needed in order to attach keymaps
 * (i.e., child maps) to 'main' maps.
 *
 * @class Overview maps
 * @name ERDAS.maps.keymap
 * @namespace
 */
ERDAS.defns ("maps.keymap");



/**
 * ERDAS.ui: Objects related to the user interface: HTML-related helper,
 * toolbars, layer list viewer,...
 *
 * @class Various UI-related utilities, such as the layer list, ...
 * @name ERDAS.ui
 * @namespace
 */
ERDAS.defns ("ui");



/**
 * @class Actions used by the featuretable
 * @name ERDAS.ui.featuretableactions
 * @namespace
 * @deprecated
 */
ERDAS.defns ("ui.featuretableactions");



/**
 * @class Actions used by the featuretable2
 * @name ERDAS.ui.featuretable2actions
 * @namespace
 */
ERDAS.defns ("ui.featuretable2actions");



/**
 * @class Navigation-related UI components
 * @name ERDAS.ui.navigation
 * @namespace
 */
ERDAS.defns ("ui.navigation");



/**
 * @class Geometries used by the toolkit
 * @name ERDAS.geom
 * @namespace
 */
ERDAS.defns ("geom");



/**
 * @class Features, and feature manipulation types
 * @name ERDAS.feature
 * @namespace
 */
ERDAS.defns ("feature");



/**
 * @class Miscellaneous public utilies
 * @name ERDAS.misc
 * @namespace
 */
ERDAS.defns ("misc");



/****************************************************************************
 *                                                                          *
 * The following defines name spaces outside the ERDAS package.  It is  *
 * internal to Tilapia and should not be accessed directly by the user.     *
 *                                                                          *
 ****************************************************************************/


// Private packages hold the same kind of objects as their public counterparts.


/**
 * @class Miscellaneous private utilities
 * @name ERDAS.misc
 * @namespace
 */
ERDAS.defns ("misc");


/**
 * @class Private mapping types and tools
 * @name ERDAS.maps
 * @namespace
 */
ERDAS.defns ("maps");



/**
 * @class Private UI-related tools
 * @name ERDAS.ui
 * @namespace
 */
ERDAS.defns ("ui");



/**
 * @class Private security-related UI tools
 * @name ERDAS.ui.security
 * @namespace
 */
ERDAS.defns ("ui.security");



/**
 * @class Internal geometry handling types
 * @name ERDAS.geom
 * @namespace
 */
ERDAS.defns ("geom");


ERDAS.defns ("geom.edit");



/**
 * @class Private feature handling types
 * @name ERDAS.feature
 * @namespace
 */
ERDAS.defns ("feature");


ERDAS.defns ("feature.edit");



/**
 * @class Internal portray types
 * @name ERDAS.portray
 * @namespace
 */
ERDAS.defns ("portray");



/**
 * @class Private security tools
 * @name ERDAS.security
 * @namespace
 */
ERDAS.defns ("security");



/**
 * @class Miscellaneous private utilities
 */
ERDAS.misc =
/**
 * @scope ERDAS.misc
 */
{

        /**
         * Declares 'subType' to be a subtype of 'parentType', by means of the
         * prototype chain.
         *
         * <p>
         *   See &lt;a href="http://developer.yahoo.com/yui/docs/YAHOO.html"&gt;the YUI spec&lt;/a&gt; for more info.
         * </p>
         *
         * @param {function} subType The specialized type
         *
         * @param {function} parentType The parent, generalized type
         *
         * @param {object} overrides (optional) An object holding properties
         * to append to the prototype of <tt>subType</tt>
         */
        extendType : function (subType, parentType, overrides) {

                YAHOO.extend (subType, parentType, overrides);
        },





        /**
         * Augment "subType"'s prototype to contain all the properties the
         * prototype of "parentType" contains.
         *
         * <p>
         *   This is meant to be used when a type must extend more than one
         *   other type.
         * </p>
         * <p>
         *   Example:
         *   <pre>
ERDAS.misc.extendType  (ERDAS.ui.navigation.NavBar,
                        ERDAS.ui.AbstractToolbar);

ERDAS.misc.augmentType (ERDAS.ui.navigation.NavBar,
                        ERDAS.ui.AbstractMapAttachedComponent);
         </pre>
         * </p>
         *
         * @param {function} subType The 'subType' constructor function
         * @param {function} parentType The 'parentType' constructor function
         *
         * @see #extendType
         * @see #addToPrototype
         */
        augmentType : function (subType, parentType) {

                YAHOO.lang.augmentProto (subType, parentType);
        },



        /**
         * Augment <tt>type</tt>'s prototype to contain all the properties of
         * the object <tt>o</tt>
         *
         * <p>
         *   See the &lt;a
         *   href="http://developer.yahoo.com/yui/docs/YAHOO.lang.html#augmentObject"&gt;
         *   YUI reference&lt;/a&gt; for more information
         * <p>
         *   This is meant to be used when a type must be extended with a set
         *   of properties that are not part of another type's prototype.
         * </p>
         * <p>
         *   Example:
         *   <pre>
ERDAS.misc.extendType (
        ERDAS.ui.AbstractToolbar,
        YAHOO.widget.Toolbar,
        {
           // We already put additional properties in the prototype, here.
           // We'll have to use addToPrototype() if we want to add even
           // more. See below.
           foo : "bar",
           baz : "quux",
           ...
        });

ERDAS.misc.addToPrototype (
         ERDAS.ui.AbstractToolbar,
         {
            tron : "movie"
         });
     </pre>
         * </p>
         *
         * @param {function} subType The 'subType' constructor function
         *
         * @param {object} o The property bag
         *
         * @param args a list of properties to set, or <tt>true</tt> or
         * <tt>undefined</tt>to override them all
         *
         * @see #extendType
         * @see #augmentType
         */
        addToPrototype : function (subType, o, args) {

                if (typeof args === "undefined") {

                        args = true;
                }

                YAHOO.lang.augmentObject (subType.prototype, o, args);
        },



        /**
         * Get a copy of the input object.
         *
         * <p>
         *   Only direct properties (i.e., those which pass the
         *   <code>hasOwnProperty</code> test) will be copied.
         * </p>
         *
         * @param {object} [input] The input object. If not provided,
         * a fresh new object is created
         *
         * @param {object} [output] (optional) The object into which to copy
         * the properties. If none provided, a new object will be created.
         *
         * @return {object} a copy of the input
         */
        copyObject : function (input, output) {

                var out, id;

                if (input) {

                        out = output || {};

                        for (id in input) {

                                if (input.hasOwnProperty (id)) {

                                        out [id] = input [id];
                                }
                        }

                        return out;
                } else {

                        return {};
                }
        },



        /**
         * @private
         */
        confTokens : {},



        /**
         * Get the configuration token corresponding to the
         * key.
         *
         * @param {string} key The configuration key
         *
         * @return the corresponding value, or null/undefined
         */
        conf : function (key) {

                return ERDAS.misc.confTokens [key];
        },



        /**
         * Set the configuration token corresponding to the
         * key to the given value.
         *
         * @param {string} key The configuration key
         *
         * @param value The value
         */
        setConf : function (key, value) {

                ERDAS.misc.confTokens [key] = value;
        },



        /**
         * Import all the key-values of the object in the
         * application's configuration
         *
         * @param {object} conf The configuration properties
         * holder
         */
        importConf : function (conf) {

                ERDAS.misc.copyObject (conf, ERDAS.misc.confTokens);
        },



        /**
         * Get the URL of the root of the webapp.
         *
         * @return {string}
         */
        getWebappBaseUrl : function () {

                return ERDAS.misc.conf ("webapp.context.path") || "./";
        },


        /**
         * @private
         */
        i18nTokens : {},



        /**
         * Get the i18n token corresponding to the
         * key.
         *
         * @param {string} key The i18n key
         *
         * @return the corresponding value, <b>or the key itself</b>
         */
        i18n : function (key) {

                return ERDAS.misc.i18nTokens [key] || key;
        },



        /**
         * Set the i18n token corresponding to the
         * key to the given value.
         *
         * @param {string} key The i18n key
         *
         * @param value The value
         */
        setI18n : function (key, value) {

                ERDAS.misc.i18nTokens [key] = value;
        },



        /**
         * Import all the key-values of the object in the
         * application's i18n
         *
         * @param {object} i18n The i18n tokens
         * holder
         */
        importI18n : function (i18n) {

                ERDAS.misc.copyObject (i18n, ERDAS.misc.i18nTokens);
        }
};

/*
 * Copyright 2005- by ERDAS Inc.,
 * 18 Av Wallonie, 4460 Grace-Hollogne, Belgium.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ERDAS Inc.("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with ERDAS Inc..
 */

/*extern ERDAS,YAHOO,IE*/

/**
 * Build a loader.
 *
 * @constructor
 *
 * @class
 * The loader is a utility wrapping the
 * {@link YAHOO.util.YUILoader}, that allows
 * dynamic loading of the components of the YAHOO! YUI
 * library, as well as those of the Tilapia toolkit.
 *
 * <p>
 *   <b>Note</b>: You should probably not instanciate a
 *   loader instance, but get it by using
 *   {@link #getInstance}
 * </p>
 *
 */
ERDAS.Loader = function () {

        var data = {};
        var parameters = {};
        // putText ('<init> : (making new loader)');
        parameters.onSuccess = this.cbModuleLoaded;
        parameters.onFailure = this.cbModuleLoadingFailed;
        parameters.scope     = this;
        parameters.data      = data;

        this.debug = window.location.href.indexOf ("debug=true") !== -1;

        if (this.debug) {

                parameters.filter = "DEBUG";

                // Patch the YUI Get utility autopurge threshold,
                // to _not_ remove loaded nodes
                YAHOO.util.Get.PURGE_THRESH = 100000;

        }

        var loader = new YAHOO.util.YUILoader (parameters);
        loader.toString = function () {

                return "Wrapped YUI loader";
        };

        loader.parentLoader = this;


        // KLUDGE:
        // There's no easy way, AFAIK to know whether a module is a YUI
        // module, or a tilapia module
        this.nonYUIModules = {};

        /**
         * The YUI loader instance
         */
        this.yuiLoader = loader;
        loader._url = this.generateUrl;


        // Add custom modules
        var id, info, desc = ERDAS.Loader.modulesDesc;
        for (id in desc) {

                if (desc.hasOwnProperty (id)) {

                        info = this.dup (desc [id]);
                        info.name = id;
                        if (! this.addModule (info)) {

                                throw "Failed to add module \"" + id + "\"";
                        }
                }
        }

        data.yuiLoader = this.yuiLoader;
        data.userCallbacks = [];

        // KLUDGE:
        // Since the loader does not advertize what module was loaded,
        // we must keep track of what was explicitely requested, in
        // order to "guess" what has been added!
	//     --ad Fri May 16 15:51:46 2008
        this.explicitelyRequested = [];
};



/**
 * Retrieve the application's loader
 *
 * @return {ERDAS.Loader} the loader instance
 */
ERDAS.Loader.getInstance = function () {

        if (! this.instance) {

                this.instance = new ERDAS.Loader ();
        }

        return this.instance;
};



ERDAS.Loader.prototype =
/**
 * @scope ERDAS.Loader.prototype
 */
{
        /**
         * Add a module description to the list of
         * available modules.
         *
         * <p>
         *   This is a thin wrapper around the
         *   {@link YAHOO.util.YUILoader#addModule} function,
         *   that helps keep track of what are the non-YUI
         *   modules that were registered.
         * </p>
         *
         * @param {object} info The module info
         *
         * @return {boolean} a flag describing whether the module
         * was properly added or not
         */
        addModule : function (info) {

                this.nonYUIModules [info.name] = info;

                return this.yuiLoader.addModule (info);
        },



        /**
         * Load the given module and, when done, call
         * the appropriate callback.
         *
         * @param {string} name The name of the module
         *
         * @param {object} callbacks An object holding the user
         * callbacks, that must have the following properties:
         * <dl>
         *   <dt>success</dt>
         *   <dl>
         *     <b>mandatory</b>: A function of one argument: The
         *     name of the module that was loaded
         *   </dl>
         *   <dt>failure</dt>
         *   <dl>
         *     <b>mandatory</b>: A function of no argument
         *   </dl>
         * </dl>
         */
        withModule : function (name, callbacks) {

                this.withModules ([name], callbacks);
        },



        /**
         * Load the given set of modules and, when done, call
         * the appropriate callback.
         *
         * @param {string[]} names The names of the modules
         *
         * @param {object} callbacks An object holding the user
         * callbacks, that must have the following properties:
         * <dl>
         *   <dt>success</dt>
         *   <dl>
         *     <b>mandatory</b>: A function
         *   </dl>
         *   <dt>failure</dt>
         *   <dl>
         *     <b>mandatory</b>: A function
         *   </dl>
         * </dl>
         */
        withModules : function (names, callbacks) {

                if (! callbacks ||
                    (typeof callbacks.success !== "function") ||
                    (typeof callbacks.failure !== "function")) {

                        throw "A proper \"callbacks\" object must be passed";
                }

                var data = this.yuiLoader.data;
                data.userCallbacks.push (
                        {
                                names : names,
                                callbacks : callbacks
                        });

                this.explicitelyRequested.push (names);

                this.yuiLoader.require (names);
                this.yuiLoader.insert ();
        },



        /**
         * Call, sequentially, {@link #withModule}, with the list
         * of required module passed as parameter.
         *
         * @param {object[]} modules The list of modules to load. Each
         * entry is of the form: <pre>
{
         name    : string,   // the name of the module
         success : function, // the success callback
         failure : function, // the failure callback
         scope   : [object]  // optional: a scope object, for the callbacks
}
</pre>
         */
        chainLoad : function (modules) {

                modules = modules.slice ();
                var iterator = function () {

                        var curCb, callbacks;
                        if (modules.length) {

                                curCb = modules.shift ();
                                callbacks = {

                                        success : function (names, argument) {

                                                curCb.success.call (
                                                        curCb.scope || this,
                                                        names,
                                                        argument);

                                                // Keep going...
                                                iterator.call (this);
                                        },
                                        failure : function (names, argument) {

                                                curCb.failure.call (
                                                        curCb.scope || this,
                                                        names,
                                                        argument);

                                                // Keep going...
                                                iterator.call (this);
                                        },
                                        argument : curCb.argument,
                                        scope    : this
                                };
                                this.withModules (
                                        (curCb.names ?
                                         curCb.names.slice () :
                                         [curCb.name]),
                                        callbacks);
                        }
                };

                // Start iterating
                iterator.call (this);
        },



        /**
         * Called when a module is succesfully loaded
         *
         * @private
         *
         * @context The {@link YAHOO.util.YUILoader} instance
         */
        cbModuleLoaded : function (info) {

                var data = info.data;
                var rq = this.explicitelyRequested;
                var i, nameSets = [];
                for (i = 0; i < rq.length; i ++) {

                        if (this.modulesAreInserted (rq [i])) {

                                nameSets.push (rq [i]);
                                rq.splice (i, 1);
                                i --; // bring one back, since we are removing the item..
                        }
                }

                // putText ("Guess " + names + " are loaded! Left: " + (rq.length ? rq : "/none/"));

                var callbacks, nameSet;
                for (i = 0; i < nameSets.length; i ++) {

                        nameSet = nameSets [i];

                        callbacks = this.extractFirstCallback (
                                data.userCallbacks,
                                nameSet);

                        callbacks.success.call (
                                callbacks.scope || this,
                                nameSet,
                                callbacks.argument);
                }
        },



        /**
         * Return <tt>true</tt> IIF all of the modules are
         * present in the application, <tt>false</tt> otherwise.
         *
         * @param {string[]} names The set of names
         *
         * @return {boolean} a flag
         */
        modulesAreInserted : function (names) {

                var l = this.yuiLoader;

                var i, n;
                for (i = 0, n = names.length; i < n; i ++) {

                        if (! l.inserted [names [i]]) {

                                return false;
                        }
                }

                return true;

        },



        /**
         * Extract the first callback information for the given names.
         *
         * @return {object} the callbacks object
         *
         * @private
         */
        extractFirstCallback : function (userCallbacks, names) {

                names = names.join (",");

                // There might be more than one waiter on this name..
                var i, n, curCb;
                for (i = 0, n = userCallbacks.length; i < n; i ++) {

                        curCb = userCallbacks [i];
                        if (curCb.names.join (",") === names) {

                                userCallbacks.splice (i, 1);
                                return curCb.callbacks;
                        }
                }
        },



        /**
         * Called when a module failed loading
         *
         * @param {string} info.msg An information message explaining the
         * failure
         *
         * @param {string} info.data Additional data
         *
         * @private
         *
         * @context The {@link YAHOO.util.YUILoader} instance
         */
        cbModuleLoadingFailed : function (info) {

                var c, userCallbacks = info ? info.data.userCallbacks [0] : null;

                if (userCallbacks) {

                        c = userCallbacks.callbacks;
                        c.failure.call (
                                c.scope || this,
                                userCallbacks.names,
                                c.argument);

                } else {

                        alert ("Failed loading module: " + info.msg);
                }
        },



        /**
         * @private
         */
        dup : function (input) {

                var id, out = {};

                for (id in input) {

                        if (input.hasOwnProperty (id)) {

                                out [id] = input [id];
                        }
                }

                return out;
        },



        /**
         * Generates the full url for a module
         *
         * @param path {string} the path fragment
         *
         * @return {string} the full url
         *
         * @context A {@link YAHOO.util.YUILoader} instance
         *
         * @private
         */
        generateUrl : function (path) {

                //putText ("Generating URL for path: " + path);

                var base = this.base || "";
                var waBase;

                // Big hack!
	        //     --ad Fri May 16 15:36:13 2008

                var isNotYUI = false;

                var id, descs = this.parentLoader.nonYUIModules;
                for (id in descs) {

                        if (path.indexOf (id) !== -1 ||
                            descs [id].path === path) {

                                isNotYUI = true;
                                break;
                           }
                }

                waBase = ERDAS.misc.getWebappBaseUrl ();
                // Big Fscking hack
	        //     --ad Wed Jun 18 17:49:54 2008
                if (waBase === "./") {

                        waBase = "";
                } else {

                        waBase = waBase + "/";
                }

                if (isNotYUI) {

                        base = waBase + "tilapia/build/";

                } else {

                        base = waBase + "third-party/yui/build/";
                }

                var u = base, f=this.filter;
                u = u + path;

                if (f) {
                        // YAHOO.log("filter: " + f + ", " + f.searchExp +
                        // ", " + f.replaceStr);
                        u = u.replace(new RegExp(f.searchExp), f.replaceStr);
                }

                // YAHOO.log(u);

                return u;
        }
};



/**
 * The list of modules of the web toolkit.
 *
 * @private
 */
ERDAS.Loader.modulesDesc = {

        "wtk-config" : {
                "type" : "js",
                "path" : "../../loadconf.jsp"
        },

        "wtk-utils-uiutils-geometry" : {
                "type" : "js",
                "path" : "wtk-utils-uiutils-geometry-min.js",
                "requires" : [
                        "wtk-config",
                        "event",
                        "logger",
                        "connection"
                ],
                "skinnable" : true
        },

        "wtk-features" : {
                "type" : "js",
                "path" : "wtk-features-min.js",
                "requires" : ["wtk-utils-uiutils-geometry"]
        },

        "wtk-services" : {
                "type" : "js",
                "path" : "wtk-services-min.js",
                "requires" : [
                        "wtk-utils-uiutils-geometry"
                ]
        },

        "wtk-maps-base" : {
                "type" : "js",
                "path" : "wtk-maps-base-min.js",
                "requires" : [
                        "wtk-services"
                ],
                "skinnable" : true
        },

        "wtk-layers-base" : {
                "type" : "js",
                "path" : "wtk-layers-base-min.js",
                "requires" : [
                        "wtk-maps-base",
                        "wtk-features"
                ],
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-ecwp" : {
                "type" : "js",
                "path" : "wtk-ecwp-min.js",
                "requires" : [
                        "wtk-layers-base"
                ],
                "def" : {
                        "interest" : "maincomponent"
                }
        },


        "wtk-login-panel" : {
                "type" : "js",
                "path" : "wtk-login-panel-min.js",
                "requires" : [
                        "wtk-editors",
                        "button"
                ]
        },


        "wtk-services-ui" : {
                "type" : "js",
                "path" : "wtk-services-ui-min.js",
                "requires" : [
                        "wtk-maps-base",
                        "wtk-services",
                        "treeview",
                        "wtk-patched-yui-datatable",
                        "wtk-login-panel"
                ],
                "def" : {
                        "interest" : "maincomponent"
                },
                "skinnable" : true
        },

        "wtk-overviewmaps" : {
                "type" : "js",
                "path" : "wtk-overviewmaps-min.js",
                "requires" : [
                        "wtk-maps-base"
                ],
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-map-elements" : {
                "type" : "js",
                "path" : "wtk-map-elements-min.js",
                "requires" : [
                        "wtk-maps-base"
                ]
        },

        "wtk-editors" : {
                "type" : "js",
                "path" : "wtk-editors-min.js",
                "requires" : [
                        "wtk-utils-uiutils-geometry",
                        "wtk-patched-yui-calendar"
                ],
                "skinnable" : true
        },

        "wtk-toolbar" : {
                "type" : "js",
                "path" : "wtk-toolbar-min.js",
                "requires" : [
                        "wtk-maps-base",
                        "wtk-patched-yui-editor",
                        "wtk-patched-yui-button"
                ],
                "skinnable" : true
        },

        "wtk-geditbar" : {
                "type" : "js",
                "path" : "wtk-geditbar-min.js",
                "requires" : [
                        "wtk-toolbar"
                ]
        },

        "wtk-navbar" : {
                "type" : "js",
                "path" : "wtk-navbar-min.js",
                "requires" : [
                        "wtk-toolbar"
                ],
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-embedded-navbar" : {
                "type" : "js",
                "path" : "wtk-embedded-navbar-min.js",
                "requires" : [
                        "wtk-utils-uiutils-geometry"
                ],
                "def" : {
                        "interest" : "maincomponent"
                },
                "skinnable" : true
        },

        "wtk-navinfo" : {
                "type" : "js",
                "path" : "wtk-navinfo-min.js",
                "requires" : [
                        "wtk-editors"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-featuretable" : {
                "type" : "js",
                "path" : "wtk-featuretable-min.js",
                "requires" : [
                        "wtk-features",
                        "wtk-map-elements",
                        "wtk-geditbar"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-featurepanel" : {
                "type" : "js",
                "path" : "wtk-featurepanel-min.js",
                "requires" : [
                        "wtk-features",
                        "wtk-geditbar",
                        "container",
                        "resize"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-layerinfo" : {
                "type" : "js",
                "path" : "wtk-layerinfo-min.js",
                "requires" : [
                        "wtk-navbar",
                        "wtk-patched-yui-datatable",
                        "wtk-featuretable",
                        "wtk-featurepanel"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-layerlist" : {
                "type" : "js",
                "path" : "wtk-layerlist-min.js",
                "requires" : [
                        "wtk-patched-yui-dragdrop",
                        "animation",
                        "slider",
                        "tabview",
                        "wtk-layers-base",
                        "wtk-editors",
                        "button",
                        "wtk-login-panel"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-legend" : {
                "type" : "js",
                "path" : "wtk-legend-min.js",
                "requires" : [
                        "wtk-layers-base"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-userdatapanel" : {
                "type" : "js",
                "path" : "wtk-userdatapanel-min.js",
                "requires" : [
                        "wtk-layers-base",
                        "wtk-editors",
                        "tabview",
                        "datatable"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },

        "wtk-features-ui" : {
                "type" : "js",
                "path" : "wtk-features-ui-min.js",
                "requires" : [
                        "wtk-features",
                        "wtk-editors",
                        "wtk-patched-yui-button",
                        "wtk-layers-base",
                        "container",
                        "resize"
                ],
                "skinnable" : true
        },

        "wtk-catalog-ui" : {
                "type" : "js",
                "path" : "wtk-catalog-ui-min.js",
                "requires" : [
                        "wtk-maps-base",
                        "wtk-services-ui",
                        "wtk-editors"
                ],
                "skinnable" : true,
                "def" : {
                        "interest" : "maincomponent"
                }
        },


        // -----------
        // YUI patches

        "wtk-patched-yui-button" : {
                "type": "js",
                "path": "wtk-patched-yui-button-min.js",
                "requires": [
                        "button"
                ]
        },

        "wtk-patched-yui-editor" : {
                "type": "js",
                "path": "wtk-patched-yui-toolbar-min.js",
                "requires": [
                        "editor"
                ]
        },

        "wtk-patched-yui-dragdrop" : {
                "type": "js",
                "path": "wtk-patched-yui-dragdrop-min.js",
                "requires": [
                        "dragdrop"
                ]
        },

        "wtk-patched-yui-datatable" : {
                "type": "js",
                "path": "wtk-patched-yui-datatable-min.js",
                "requires": [
                        "datatable"
                ]
        },

        "wtk-patched-yui-calendar" : {
                "type": "js",
                "path": "wtk-patched-yui-calendar-min.js",
                "requires": [
                        "calendar"
                ]
        }
};


