1) {
+ if (index + 1 == tabCount) {
+ this.set('activeIndex', index - 1);
+ } else {
+ this.set('activeIndex', index + 1);
+ }
+ }
+ }
+
+ this._tabParent.removeChild( tab.get('element') );
+ this._contentParent.removeChild( tab.get('contentEl') );
+ this._configs.tabs.value.splice(index, 1);
+
+ };
+
+ /**
+ * Provides a readable name for the TabView instance.
+ * @method toString
+ * @return String
+ */
+ proto.toString = function() {
+ var name = this.get('id') || this.get('tagName');
+ return "TabView " + name;
+ };
+
+ /**
+ * The transiton to use when switching between tabs.
+ * @method contentTransition
+ */
+ proto.contentTransition = function(newTab, oldTab) {
+ newTab.set('contentVisible', true);
+ oldTab.set('contentVisible', false);
+ };
+
+ /**
+ * setAttributeConfigs TabView specific properties.
+ * @method initAttributes
+ * @param {Object} attr Hash of initial attributes
+ */
+ proto.initAttributes = function(attr) {
+ YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);
+
+ if (!attr.orientation) {
+ attr.orientation = 'top';
+ }
+
+ var el = this.get('element');
+
+ /**
+ * The Tabs belonging to the TabView instance.
+ * @config tabs
+ * @type Array
+ */
+ this.setAttributeConfig('tabs', {
+ value: [],
+ readOnly: true
+ });
+
+ /**
+ * The container of the tabView's label elements.
+ * @property _tabParent
+ * @private
+ * @type HTMLElement
+ */
+ this._tabParent =
+ this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
+ 'ul' )[0] || _createTabParent.call(this);
+
+ /**
+ * The container of the tabView's content elements.
+ * @property _contentParent
+ * @type HTMLElement
+ * @private
+ */
+ this._contentParent =
+ this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
+ 'div')[0] || _createContentParent.call(this);
+
+ /**
+ * How the Tabs should be oriented relative to the TabView.
+ * @config orientation
+ * @type String
+ * @default "top"
+ */
+ this.setAttributeConfig('orientation', {
+ value: attr.orientation,
+ method: function(value) {
+ var current = this.get('orientation');
+ this.addClass('yui-navset-' + value);
+
+ if (current != value) {
+ this.removeClass('yui-navset-' + current);
+ }
+
+ switch(value) {
+ case 'bottom':
+ this.appendChild(this._tabParent);
+ break;
+ }
+ }
+ });
+
+ /**
+ * The index of the tab currently active.
+ * @config activeIndex
+ * @type Int
+ */
+ this.setAttributeConfig('activeIndex', {
+ value: attr.activeIndex,
+ method: function(value) {
+ this.set('activeTab', this.getTab(value));
+ },
+ validator: function(value) {
+ return !this.getTab(value).get('disabled'); // cannot activate if disabled
+ }
+ });
+
+ /**
+ * The tab currently active.
+ * @config activeTab
+ * @type YAHOO.widget.Tab
+ */
+ this.setAttributeConfig('activeTab', {
+ value: attr.activeTab,
+ method: function(tab) {
+ var activeTab = this.get('activeTab');
+
+ if (tab) {
+ tab.set('active', true);
+ this._configs['activeIndex'].value = this.getTabIndex(tab); // keep in sync
+ }
+
+ if (activeTab && activeTab != tab) {
+ activeTab.set('active', false);
+ }
+
+ if (activeTab && tab != activeTab) { // no transition if only 1
+ this.contentTransition(tab, activeTab);
+ } else if (tab) {
+ tab.set('contentVisible', true);
+ }
+ },
+ validator: function(value) {
+ return !value.get('disabled'); // cannot activate if disabled
+ }
+ });
+
+ if ( this._tabParent ) {
+ _initTabs.call(this);
+ }
+
+ for (var type in this.DOM_EVENTS) {
+ if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
+ this.addListener.call(this, type, this.DOMEventHandler);
+ }
+ }
+ };
+
+ /**
+ * Creates Tab instances from a collection of HTMLElements.
+ * @method createTabs
+ * @private
+ * @param {Array|HTMLCollection} elements The elements to use for Tabs.
+ * @return void
+ */
+ var _initTabs = function() {
+ var tab,
+ attr,
+ contentEl;
+
+ var el = this.get('element');
+ var tabs = _getChildNodes(this._tabParent);
+ var contentElements = _getChildNodes(this._contentParent);
+
+ for (var i = 0, len = tabs.length; i < len; ++i) {
+ attr = {};
+
+ if (contentElements[i]) {
+ attr.contentEl = contentElements[i];
+ }
+
+ tab = new YAHOO.widget.Tab(tabs[i], attr);
+ this.addTab(tab);
+
+ if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
+ this._configs.activeTab.value = tab; // dont invoke method
+ }
+ }
+ };
+
+ var _createTabViewElement = function(attr) {
+ var el = document.createElement('div');
+
+ if ( this.CLASSNAME ) {
+ el.className = this.CLASSNAME;
+ }
+
+ return el;
+ };
+
+ var _createTabParent = function(attr) {
+ var el = document.createElement('ul');
+
+ if ( this.TAB_PARENT_CLASSNAME ) {
+ el.className = this.TAB_PARENT_CLASSNAME;
+ }
+
+ this.get('element').appendChild(el);
+
+ return el;
+ };
+
+ var _createContentParent = function(attr) {
+ var el = document.createElement('div');
+
+ if ( this.CONTENT_PARENT_CLASSNAME ) {
+ el.className = this.CONTENT_PARENT_CLASSNAME;
+ }
+
+ this.get('element').appendChild(el);
+
+ return el;
+ };
+
+ var _getChildNodes = function(el) {
+ var nodes = [];
+ var childNodes = el.childNodes;
+
+ for (var i = 0, len = childNodes.length; i < len; ++i) {
+ if (childNodes[i].nodeType == 1) {
+ nodes[nodes.length] = childNodes[i];
+ }
+ }
+
+ return nodes;
+ };
+
+/**
+ * Fires before the activeTab is changed.
+ * See: Element.addListener
+ * If handler returns false, the change will be cancelled, and the value will not
+ * be set.
+ * Event fields:
+ * <String> type
beforeActiveTabChange
+ * <YAHOO.widget.Tab>
+ * prevValue
the currently active tab
+ * <YAHOO.widget.Tab>
+ * newValue
the tab to be made active
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('beforeActiveTabChange', handler);
+ * @event beforeActiveTabChange
+ */
+
+/**
+ * Fires after the activeTab is changed.
+ * See: Element.addListener
+ * Event fields:
+ * <String> type
activeTabChange
+ * <YAHOO.widget.Tab>
+ * prevValue
the formerly active tab
+ * <YAHOO.widget.Tab>
+ * newValue
the new active tab
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('activeTabChange', handler);
+ * @event activeTabChange
+ */
+
+/**
+ * Fires before the orientation is changed.
+ * See: Element.addListener
+ * If handler returns false, the change will be cancelled, and the value will not
+ * be set.
+ * Event fields:
+ * <String> type
beforeOrientationChange
+ * <String>
+ * prevValue
the current orientation
+ * <String>
+ * newValue
the new orientation to be applied
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('beforeOrientationChange', handler);
+ * @event beforeOrientationChange
+ */
+
+/**
+ * Fires after the orientation is changed.
+ * See: Element.addListener
+ * Event fields:
+ * <String> type
orientationChange
+ * <String>
+ * prevValue
the former orientation
+ * <String>
+ * newValue
the new orientation
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('orientationChange', handler);
+ * @event orientationChange
+ */
+})();
+
+(function() {
+ var Dom = YAHOO.util.Dom,
+ Event = YAHOO.util.Event;
+
+ /**
+ * A representation of a Tab's label and content.
+ * @namespace YAHOO.widget
+ * @class Tab
+ * @extends YAHOO.util.Element
+ * @constructor
+ * @param element {HTMLElement | String} (optional) The html element that
+ * represents the TabView. An element will be created if none provided.
+ * @param {Object} properties A key map of initial properties
+ */
+ var Tab = function(el, attr) {
+ attr = attr || {};
+ if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+ attr = el;
+ el = attr.element;
+ }
+
+ if (!el && !attr.element) {
+ el = _createTabElement.call(this, attr);
+ }
+
+ this.loadHandler = {
+ success: function(o) {
+ this.set('content', o.responseText);
+ },
+ failure: function(o) {
+ }
+ };
+
+ Tab.superclass.constructor.call(this, el, attr);
+
+ this.DOM_EVENTS = {}; // delegating to tabView
+ };
+
+ YAHOO.extend(Tab, YAHOO.util.Element);
+ var proto = Tab.prototype;
+
+ /**
+ * The default tag name for a Tab's inner element.
+ * @property LABEL_INNER_TAGNAME
+ * @type String
+ * @default "em"
+ */
+ proto.LABEL_TAGNAME = 'em';
+
+ /**
+ * The class name applied to active tabs.
+ * @property ACTIVE_CLASSNAME
+ * @type String
+ * @default "on"
+ */
+ proto.ACTIVE_CLASSNAME = 'selected';
+
+ /**
+ * The class name applied to disabled tabs.
+ * @property DISABLED_CLASSNAME
+ * @type String
+ * @default "disabled"
+ */
+ proto.DISABLED_CLASSNAME = 'disabled';
+
+ /**
+ * The class name applied to dynamic tabs while loading.
+ * @property LOADING_CLASSNAME
+ * @type String
+ * @default "disabled"
+ */
+ proto.LOADING_CLASSNAME = 'loading';
+
+ /**
+ * Provides a reference to the connection request object when data is
+ * loaded dynamically.
+ * @property dataConnection
+ * @type Object
+ */
+ proto.dataConnection = null;
+
+ /**
+ * Object containing success and failure callbacks for loading data.
+ * @property loadHandler
+ * @type object
+ */
+ proto.loadHandler = null;
+
+ /**
+ * Provides a readable name for the tab.
+ * @method toString
+ * @return String
+ */
+ proto.toString = function() {
+ var el = this.get('element');
+ var id = el.id || el.tagName;
+ return "Tab " + id;
+ };
+
+ /**
+ * setAttributeConfigs TabView specific properties.
+ * @method initAttributes
+ * @param {Object} attr Hash of initial attributes
+ */
+ proto.initAttributes = function(attr) {
+ attr = attr || {};
+ Tab.superclass.initAttributes.call(this, attr);
+
+ var el = this.get('element');
+
+ /**
+ * The event that triggers the tab's activation.
+ * @config activationEvent
+ * @type String
+ */
+ this.setAttributeConfig('activationEvent', {
+ value: attr.activationEvent || 'click'
+ });
+
+ /**
+ * The element that contains the tab's label.
+ * @config labelEl
+ * @type HTMLElement
+ */
+ this.setAttributeConfig('labelEl', {
+ value: attr.labelEl || _getlabelEl.call(this),
+ method: function(value) {
+ var current = this.get('labelEl');
+
+ if (current) {
+ if (current == value) {
+ return false; // already set
+ }
+
+ this.replaceChild(value, current);
+ } else if (el.firstChild) { // ensure label is firstChild by default
+ this.insertBefore(value, el.firstChild);
+ } else {
+ this.appendChild(value);
+ }
+ }
+ });
+
+ /**
+ * The tab's label text (or innerHTML).
+ * @config label
+ * @type String
+ */
+ this.setAttributeConfig('label', {
+ value: attr.label || _getLabel.call(this),
+ method: function(value) {
+ var labelEl = this.get('labelEl');
+ if (!labelEl) { // create if needed
+ this.set('labelEl', _createlabelEl.call(this));
+ }
+
+ _setLabel.call(this, value);
+ }
+ });
+
+ /**
+ * The HTMLElement that contains the tab's content.
+ * @config contentEl
+ * @type HTMLElement
+ */
+ this.setAttributeConfig('contentEl', {
+ value: attr.contentEl || document.createElement('div'),
+ method: function(value) {
+ var current = this.get('contentEl');
+
+ if (current) {
+ if (current == value) {
+ return false; // already set
+ }
+ this.replaceChild(value, current);
+ }
+ }
+ });
+
+ /**
+ * The tab's content.
+ * @config content
+ * @type String
+ */
+ this.setAttributeConfig('content', {
+ value: attr.content,
+ method: function(value) {
+ this.get('contentEl').innerHTML = value;
+ }
+ });
+
+ var _dataLoaded = false;
+
+ /**
+ * The tab's data source, used for loading content dynamically.
+ * @config dataSrc
+ * @type String
+ */
+ this.setAttributeConfig('dataSrc', {
+ value: attr.dataSrc
+ });
+
+ /**
+ * Whether or not content should be reloaded for every view.
+ * @config cacheData
+ * @type Boolean
+ * @default false
+ */
+ this.setAttributeConfig('cacheData', {
+ value: attr.cacheData || false,
+ validator: YAHOO.lang.isBoolean
+ });
+
+ /**
+ * The method to use for the data request.
+ * @config loadMethod
+ * @type String
+ * @default "GET"
+ */
+ this.setAttributeConfig('loadMethod', {
+ value: attr.loadMethod || 'GET',
+ validator: YAHOO.lang.isString
+ });
+
+ /**
+ * Whether or not any data has been loaded from the server.
+ * @config dataLoaded
+ * @type Boolean
+ */
+ this.setAttributeConfig('dataLoaded', {
+ value: false,
+ validator: YAHOO.lang.isBoolean,
+ writeOnce: true
+ });
+
+ /**
+ * Number if milliseconds before aborting and calling failure handler.
+ * @config dataTimeout
+ * @type Number
+ * @default null
+ */
+ this.setAttributeConfig('dataTimeout', {
+ value: attr.dataTimeout || null,
+ validator: YAHOO.lang.isNumber
+ });
+
+ /**
+ * Whether or not the tab is currently active.
+ * If a dataSrc is set for the tab, the content will be loaded from
+ * the given source.
+ * @config active
+ * @type Boolean
+ */
+ this.setAttributeConfig('active', {
+ value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME),
+ method: function(value) {
+ if (value === true) {
+ this.addClass(this.ACTIVE_CLASSNAME);
+ this.set('title', 'active');
+ } else {
+ this.removeClass(this.ACTIVE_CLASSNAME);
+ this.set('title', '');
+ }
+ },
+ validator: function(value) {
+ return YAHOO.lang.isBoolean(value) && !this.get('disabled') ;
+ }
+ });
+
+ /**
+ * Whether or not the tab is disabled.
+ * @config disabled
+ * @type Boolean
+ */
+ this.setAttributeConfig('disabled', {
+ value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME),
+ method: function(value) {
+ if (value === true) {
+ Dom.addClass(this.get('element'), this.DISABLED_CLASSNAME);
+ } else {
+ Dom.removeClass(this.get('element'), this.DISABLED_CLASSNAME);
+ }
+ },
+ validator: YAHOO.lang.isBoolean
+ });
+
+ /**
+ * The href of the tab's anchor element.
+ * @config href
+ * @type String
+ * @default '#'
+ */
+ this.setAttributeConfig('href', {
+ value: attr.href || '#',
+ method: function(value) {
+ this.getElementsByTagName('a')[0].href = value;
+ },
+ validator: YAHOO.lang.isString
+ });
+
+ /**
+ * The Whether or not the tab's content is visible.
+ * @config contentVisible
+ * @type Boolean
+ * @default false
+ */
+ this.setAttributeConfig('contentVisible', {
+ value: attr.contentVisible,
+ method: function(value) {
+ if (value) {
+ this.get('contentEl').style.display = 'block';
+
+ if ( this.get('dataSrc') ) {
+ // load dynamic content unless already loaded and caching
+ if ( !this.get('dataLoaded') || !this.get('cacheData') ) {
+ _dataConnect.call(this);
+ }
+ }
+ } else {
+ this.get('contentEl').style.display = 'none';
+ }
+ },
+ validator: YAHOO.lang.isBoolean
+ });
+ };
+
+ var _createTabElement = function(attr) {
+ var el = document.createElement('li');
+ var a = document.createElement('a');
+
+ a.href = attr.href || '#';
+
+ el.appendChild(a);
+
+ var label = attr.label || null;
+ var labelEl = attr.labelEl || null;
+
+ if (labelEl) { // user supplied labelEl
+ if (!label) { // user supplied label
+ label = _getLabel.call(this, labelEl);
+ }
+ } else {
+ labelEl = _createlabelEl.call(this);
+ }
+
+ a.appendChild(labelEl);
+
+ return el;
+ };
+
+ var _getlabelEl = function() {
+ return this.getElementsByTagName(this.LABEL_TAGNAME)[0];
+ };
+
+ var _createlabelEl = function() {
+ var el = document.createElement(this.LABEL_TAGNAME);
+ return el;
+ };
+
+ var _setLabel = function(label) {
+ var el = this.get('labelEl');
+ el.innerHTML = label;
+ };
+
+ var _getLabel = function() {
+ var label,
+ el = this.get('labelEl');
+
+ if (!el) {
+ return undefined;
+ }
+
+ return el.innerHTML;
+ };
+
+ var _dataConnect = function() {
+ if (!YAHOO.util.Connect) {
+ return false;
+ }
+
+ Dom.addClass(this.get('contentEl').parentNode, this.LOADING_CLASSNAME);
+
+ this.dataConnection = YAHOO.util.Connect.asyncRequest(
+ this.get('loadMethod'),
+ this.get('dataSrc'),
+ {
+ success: function(o) {
+ this.loadHandler.success.call(this, o);
+ this.set('dataLoaded', true);
+ this.dataConnection = null;
+ Dom.removeClass(this.get('contentEl').parentNode,
+ this.LOADING_CLASSNAME);
+ },
+ failure: function(o) {
+ this.loadHandler.failure.call(this, o);
+ this.dataConnection = null;
+ Dom.removeClass(this.get('contentEl').parentNode,
+ this.LOADING_CLASSNAME);
+ },
+ scope: this,
+ timeout: this.get('dataTimeout')
+ }
+ );
+ };
+
+ YAHOO.widget.Tab = Tab;
+
+ /**
+ * Fires before the active state is changed.
+ * See: Element.addListener
+ * If handler returns false, the change will be cancelled, and the value will not
+ * be set.
+ * Event fields:
+ * <String> type
beforeActiveChange
+ * <Boolean>
+ * prevValue
the current value
+ * <Boolean>
+ * newValue
the new value
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('beforeActiveChange', handler);
+ * @event beforeActiveChange
+ */
+
+ /**
+ * Fires after the active state is changed.
+ * See: Element.addListener
+ * Event fields:
+ * <String> type
activeChange
+ * <Boolean>
+ * prevValue
the previous value
+ * <Boolean>
+ * newValue
the updated value
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('activeChange', handler);
+ * @event activeChange
+ */
+
+ /**
+ * Fires before the tab label is changed.
+ * See: Element.addListener
+ * If handler returns false, the change will be cancelled, and the value will not
+ * be set.
+ * Event fields:
+ * <String> type
beforeLabelChange
+ * <String>
+ * prevValue
the current value
+ * <String>
+ * newValue
the new value
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('beforeLabelChange', handler);
+ * @event beforeLabelChange
+ */
+
+ /**
+ * Fires after the tab label is changed.
+ * See: Element.addListener
+ * Event fields:
+ * <String> type
labelChange
+ * <String>
+ * prevValue
the previous value
+ * <String>
+ * newValue
the updated value
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('labelChange', handler);
+ * @event labelChange
+ */
+
+ /**
+ * Fires before the tab content is changed.
+ * See: Element.addListener
+ * If handler returns false, the change will be cancelled, and the value will not
+ * be set.
+ * Event fields:
+ * <String> type
beforeContentChange
+ * <String>
+ * prevValue
the current value
+ * <String>
+ * newValue
the new value
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('beforeContentChange', handler);
+ * @event beforeContentChange
+ */
+
+ /**
+ * Fires after the tab content is changed.
+ * See: Element.addListener
+ * Event fields:
+ * <String> type
contentChange
+ * <String>
+ * prevValue
the previous value
+ * <Boolean>
+ * newValue
the updated value
+ * Usage:
+ * var handler = function(e) {var previous = e.prevValue};
+ * myTabs.addListener('contentChange', handler);
+ * @event contentChange
+ */
+})();
+
+YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.2.0", build: "127"});
diff --git a/source/web/yui/yahoo-min.js b/source/web/yui/yahoo-min.js
new file mode 100644
index 0000000000..08e6ad9375
--- /dev/null
+++ b/source/web/yui/yahoo-min.js
@@ -0,0 +1,15 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.2.0
+*/
+
+if(typeof YAHOO=="undefined"){var YAHOO={};}
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i-1){return true;}else{return YAHOO.lang.isObject(obj)&&obj.constructor==Array;}},isBoolean:function(obj){return typeof obj=='boolean';},isFunction:function(obj){return typeof obj=='function';},isNull:function(obj){return obj===null;},isNumber:function(obj){return typeof obj=='number'&&isFinite(obj);},isObject:function(obj){return typeof obj=='object'||YAHOO.lang.isFunction(obj);},isString:function(obj){return typeof obj=='string';},isUndefined:function(obj){return typeof obj=='undefined';},hasOwnProperty:function(obj,prop){if(Object.prototype.hasOwnProperty){return obj.hasOwnProperty(prop);}
+return!YAHOO.lang.isUndefined(obj[prop])&&obj.constructor.prototype[prop]!==obj[prop];},extend:function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}},augment:function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i
+ * YAHOO.env.getVersion for the description of the version data structure.
+ * @property listener
+ * @static
+ */
+if (typeof YAHOO == "undefined") {
+ /**
+ * The YAHOO global namespace object. If YAHOO is already defined, the
+ * existing YAHOO object will not be overwritten so that defined
+ * namespaces are preserved.
+ * @class YAHOO
+ * @static
+ */
+ var YAHOO = {};
+}
+
+/**
+ * Returns the namespace specified and creates it if it doesn't exist
+ *
+ * YAHOO.namespace("property.package");
+ * YAHOO.namespace("YAHOO.property.package");
+ *
+ * Either of the above would create YAHOO.property, then
+ * YAHOO.property.package
+ *
+ * Be careful when naming packages. Reserved words may work in some browsers
+ * and not others. For instance, the following will fail in Safari:
+ *
+ * YAHOO.namespace("really.long.nested.namespace");
+ *
+ * This fails because "long" is a future reserved word in ECMAScript
+ *
+ * @method namespace
+ * @static
+ * @param {String*} arguments 1-n namespaces to create
+ * @return {Object} A reference to the last namespace object created
+ */
+YAHOO.namespace = function() {
+ var a=arguments, o=null, i, j, d;
+ for (i=0; i
+ * name: The name of the module
+ * version: The version in use
+ * build: The build number in use
+ * versions: All versions that were registered
+ * builds: All builds that were registered.
+ * mainClass: An object that was was stamped with the
+ * current version and build. If
+ * mainClass.VERSION != version or mainClass.BUILD != build,
+ * multiple versions of pieces of the library have been
+ * loaded, potentially causing issues.
+ *
+ *
+ * @method getVersion
+ * @static
+ * @param {String} name the name of the module (event, slider, etc)
+ * @return {Object} The version info
+ */
+ getVersion: function(name) {
+ return YAHOO.env.modules[name] || null;
+ }
+};
+
+/**
+ * Provides the language utilites and extensions used by the library
+ * @class YAHOO.lang
+ */
+YAHOO.lang = {
+ /**
+ * Determines whether or not the provided object is an array
+ * @method isArray
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isArray: function(obj) { // frames lose type, so test constructor string
+ if (obj.constructor && obj.constructor.toString().indexOf('Array') > -1) {
+ return true;
+ } else {
+ return YAHOO.lang.isObject(obj) && obj.constructor == Array;
+ }
+ },
+
+ /**
+ * Determines whether or not the provided object is a boolean
+ * @method isBoolean
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isBoolean: function(obj) {
+ return typeof obj == 'boolean';
+ },
+
+ /**
+ * Determines whether or not the provided object is a function
+ * @method isFunction
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isFunction: function(obj) {
+ return typeof obj == 'function';
+ },
+
+ /**
+ * Determines whether or not the provided object is null
+ * @method isNull
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isNull: function(obj) {
+ return obj === null;
+ },
+
+ /**
+ * Determines whether or not the provided object is a legal number
+ * @method isNumber
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isNumber: function(obj) {
+ return typeof obj == 'number' && isFinite(obj);
+ },
+
+ /**
+ * Determines whether or not the provided object is of type object
+ * or function
+ * @method isObject
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isObject: function(obj) {
+ return typeof obj == 'object' || YAHOO.lang.isFunction(obj);
+ },
+
+ /**
+ * Determines whether or not the provided object is a string
+ * @method isString
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isString: function(obj) {
+ return typeof obj == 'string';
+ },
+
+ /**
+ * Determines whether or not the provided object is undefined
+ * @method isUndefined
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ isUndefined: function(obj) {
+ return typeof obj == 'undefined';
+ },
+
+ /**
+ * Determines whether or not the property was added
+ * to the object instance. Returns false if the property is not present
+ * in the object, or was inherited from the prototype.
+ * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
+ * There is a discrepancy between YAHOO.lang.hasOwnProperty and
+ * Object.prototype.hasOwnProperty when the property is a primitive added to
+ * both the instance AND prototype with the same value:
+ *
+ * var A = function() {};
+ * A.prototype.foo = 'foo';
+ * var a = new A();
+ * a.foo = 'foo';
+ * alert(a.hasOwnProperty('foo')); // true
+ * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
+ *
+ * @method hasOwnProperty
+ * @param {any} obj The object being testing
+ * @return Boolean
+ */
+ hasOwnProperty: function(obj, prop) {
+ if (Object.prototype.hasOwnProperty) {
+ return obj.hasOwnProperty(prop);
+ }
+
+ return !YAHOO.lang.isUndefined(obj[prop]) &&
+ obj.constructor.prototype[prop] !== obj[prop];
+ },
+
+ /**
+ * Utility to set up the prototype, constructor and superclass properties to
+ * support an inheritance strategy that can chain constructors and methods.
+ *
+ * @method extend
+ * @static
+ * @param {Function} subc the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} overrides additional properties/methods to add to the
+ * subclass prototype. These will override the
+ * matching items obtained from the superclass
+ * if present.
+ */
+ extend: function(subc, superc, overrides) {
+ var F = function() {};
+ F.prototype=superc.prototype;
+ subc.prototype=new F();
+ subc.prototype.constructor=subc;
+ subc.superclass=superc.prototype;
+ if (superc.prototype.constructor == Object.prototype.constructor) {
+ superc.prototype.constructor=superc;
+ }
+
+ if (overrides) {
+ for (var i in overrides) {
+ subc.prototype[i]=overrides[i];
+ }
+ }
+ },
+
+ /**
+ * Applies all prototype properties in the supplier to the receiver if the
+ * receiver does not have these properties yet. Optionally, one or more
+ * methods/properties can be specified (as additional parameters). This
+ * option will overwrite the property if receiver has it already.
+ *
+ * @method augment
+ * @static
+ * @param {Function} r the object to receive the augmentation
+ * @param {Function} s the object that supplies the properties to augment
+ * @param {String*} arguments zero or more properties methods to augment the
+ * receiver with. If none specified, everything
+ * in the supplier will be used unless it would
+ * overwrite an existing property in the receiver
+ */
+ augment: function(r, s) {
+ var rp=r.prototype, sp=s.prototype, a=arguments, i, p;
+ if (a[2]) {
+ for (i=2; iYAHOO.lang
+ * @class YAHOO.util.Lang
+ */
+YAHOO.util.Lang = YAHOO.lang;
+
+/**
+ * An alias for YAHOO.lang.augment
+ * @for YAHOO
+ * @method augment
+ * @static
+ * @param {Function} r the object to receive the augmentation
+ * @param {Function} s the object that supplies the properties to augment
+ * @param {String*} arguments zero or more properties methods to augment the
+ * receiver with. If none specified, everything
+ * in the supplier will be used unless it would
+ * overwrite an existing property in the receiver
+ */
+YAHOO.augment = YAHOO.lang.augment;
+
+/**
+ * An alias for YAHOO.lang.extend
+ * @method extend
+ * @static
+ * @param {Function} subc the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} overrides additional properties/methods to add to the
+ * subclass prototype. These will override the
+ * matching items obtained from the superclass
+ * if present.
+ */
+YAHOO.extend = YAHOO.lang.extend;
+
+YAHOO.register("yahoo", YAHOO, {version: "2.2.0", build: "127"});